index-legacy.69ca4eed.js 346 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829
  1. ;(function () {
  2. var _excluded = ['premium', 'referrerPolicy']
  3. function _objectWithoutProperties(source, excluded) {
  4. if (source == null) return {}
  5. var target = _objectWithoutPropertiesLoose(source, excluded)
  6. var key, i
  7. if (Object.getOwnPropertySymbols) {
  8. var sourceSymbolKeys = Object.getOwnPropertySymbols(source)
  9. for (i = 0; i < sourceSymbolKeys.length; i++) {
  10. key = sourceSymbolKeys[i]
  11. if (excluded.indexOf(key) >= 0) continue
  12. if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue
  13. target[key] = source[key]
  14. }
  15. }
  16. return target
  17. }
  18. function _objectWithoutPropertiesLoose(source, excluded) {
  19. if (source == null) return {}
  20. var target = {}
  21. var sourceKeys = Object.keys(source)
  22. var key, i
  23. for (i = 0; i < sourceKeys.length; i++) {
  24. key = sourceKeys[i]
  25. if (excluded.indexOf(key) >= 0) continue
  26. target[key] = source[key]
  27. }
  28. return target
  29. }
  30. function _toConsumableArray(arr) {
  31. return (
  32. _arrayWithoutHoles(arr) ||
  33. _iterableToArray(arr) ||
  34. _unsupportedIterableToArray(arr) ||
  35. _nonIterableSpread()
  36. )
  37. }
  38. function _nonIterableSpread() {
  39. throw new TypeError(
  40. 'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
  41. )
  42. }
  43. function _iterableToArray(iter) {
  44. if (
  45. (typeof Symbol !== 'undefined' && iter[Symbol.iterator] != null) ||
  46. iter['@@iterator'] != null
  47. )
  48. return Array.from(iter)
  49. }
  50. function _arrayWithoutHoles(arr) {
  51. if (Array.isArray(arr)) return _arrayLikeToArray(arr)
  52. }
  53. function _classCallCheck2(instance, Constructor) {
  54. if (!(instance instanceof Constructor)) {
  55. throw new TypeError('Cannot call a class as a function')
  56. }
  57. }
  58. function _defineProperties(target, props) {
  59. for (var i = 0; i < props.length; i++) {
  60. var descriptor = props[i]
  61. descriptor.enumerable = descriptor.enumerable || false
  62. descriptor.configurable = true
  63. if ('value' in descriptor) descriptor.writable = true
  64. Object.defineProperty(target, descriptor.key, descriptor)
  65. }
  66. }
  67. function _createClass2(Constructor, protoProps, staticProps) {
  68. if (protoProps) _defineProperties(Constructor.prototype, protoProps)
  69. if (staticProps) _defineProperties(Constructor, staticProps)
  70. Object.defineProperty(Constructor, 'prototype', { writable: false })
  71. return Constructor
  72. }
  73. function ownKeys(object, enumerableOnly) {
  74. var keys = Object.keys(object)
  75. if (Object.getOwnPropertySymbols) {
  76. var symbols = Object.getOwnPropertySymbols(object)
  77. enumerableOnly &&
  78. (symbols = symbols.filter(function (sym) {
  79. return Object.getOwnPropertyDescriptor(object, sym).enumerable
  80. })),
  81. keys.push.apply(keys, symbols)
  82. }
  83. return keys
  84. }
  85. function _objectSpread(target) {
  86. for (var i = 1; i < arguments.length; i++) {
  87. var source = null != arguments[i] ? arguments[i] : {}
  88. i % 2
  89. ? ownKeys(Object(source), !0).forEach(function (key) {
  90. _defineProperty2(target, key, source[key])
  91. })
  92. : Object.getOwnPropertyDescriptors
  93. ? Object.defineProperties(
  94. target,
  95. Object.getOwnPropertyDescriptors(source)
  96. )
  97. : ownKeys(Object(source)).forEach(function (key) {
  98. Object.defineProperty(
  99. target,
  100. key,
  101. Object.getOwnPropertyDescriptor(source, key)
  102. )
  103. })
  104. }
  105. return target
  106. }
  107. function _slicedToArray(arr, i) {
  108. return (
  109. _arrayWithHoles(arr) ||
  110. _iterableToArrayLimit(arr, i) ||
  111. _unsupportedIterableToArray(arr, i) ||
  112. _nonIterableRest()
  113. )
  114. }
  115. function _nonIterableRest() {
  116. throw new TypeError(
  117. 'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
  118. )
  119. }
  120. function _unsupportedIterableToArray(o, minLen) {
  121. if (!o) return
  122. if (typeof o === 'string') return _arrayLikeToArray(o, minLen)
  123. var n = Object.prototype.toString.call(o).slice(8, -1)
  124. if (n === 'Object' && o.constructor) n = o.constructor.name
  125. if (n === 'Map' || n === 'Set') return Array.from(o)
  126. if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
  127. return _arrayLikeToArray(o, minLen)
  128. }
  129. function _arrayLikeToArray(arr, len) {
  130. if (len == null || len > arr.length) len = arr.length
  131. for (var i = 0, arr2 = new Array(len); i < len; i++) {
  132. arr2[i] = arr[i]
  133. }
  134. return arr2
  135. }
  136. function _iterableToArrayLimit(arr, i) {
  137. var _i =
  138. arr == null
  139. ? null
  140. : (typeof Symbol !== 'undefined' && arr[Symbol.iterator]) ||
  141. arr['@@iterator']
  142. if (_i == null) return
  143. var _arr = []
  144. var _n = true
  145. var _d = false
  146. var _s, _e
  147. try {
  148. for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
  149. _arr.push(_s.value)
  150. if (i && _arr.length === i) break
  151. }
  152. } catch (err) {
  153. _d = true
  154. _e = err
  155. } finally {
  156. try {
  157. if (!_n && _i['return'] != null) _i['return']()
  158. } finally {
  159. if (_d) throw _e
  160. }
  161. }
  162. return _arr
  163. }
  164. function _arrayWithHoles(arr) {
  165. if (Array.isArray(arr)) return arr
  166. }
  167. function _defineProperty2(obj, key, value) {
  168. if (key in obj) {
  169. Object.defineProperty(obj, key, {
  170. value: value,
  171. enumerable: true,
  172. configurable: true,
  173. writable: true
  174. })
  175. } else {
  176. obj[key] = value
  177. }
  178. return obj
  179. }
  180. function _typeof(obj) {
  181. '@babel/helpers - typeof'
  182. return (
  183. (_typeof =
  184. 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator
  185. ? function (obj) {
  186. return typeof obj
  187. }
  188. : function (obj) {
  189. return obj &&
  190. 'function' == typeof Symbol &&
  191. obj.constructor === Symbol &&
  192. obj !== Symbol.prototype
  193. ? 'symbol'
  194. : typeof obj
  195. }),
  196. _typeof(obj)
  197. )
  198. }
  199. var __vite_style__ = document.createElement('style')
  200. __vite_style__.innerHTML =
  201. '@charset "UTF-8";._video-container_1vz16_1{position:relative;width:100%;--plyr-color-main: #01c1b5}._video-container_1vz16_1 video{width:100%}._video-container_1vz16_1 .video-back{position:absolute;left:.53333rem;top:.53333rem;color:#fff;z-index:99;font-size:.64rem;width:.8rem;height:.8rem;background-color:rgba(0,0,0,.5);border-radius:50%;padding:.10667rem .13333rem .10667rem .08rem}._video-container_1vz16_1 .plyr__poster{background-size:cover}._video-container_1vz16_1 .plyr__control--overlaid{border:.02667rem solid #fff;background-color:transparent!important}._video-container_1vz16_1 .plyr--video .plyr__control:hover{background-color:transparent!important}._video-container_1vz16_1 ._video_1vz16_1{position:relative}._loadingVideo_1vz16_35{position:absolute;top:0;left:0;bottom:0;right:0;background:rgba(0,0,0,.9);z-index:10}._playOver_1vz16_44{background:rgba(0,0,0,.5);color:#fff;display:flex;align-items:center;justify-content:center;flex-direction:column}._playOver_1vz16_44 ._tips_1vz16_52{font-size:.4rem;color:#fff}._playOver_1vz16_44 ._btn_1vz16_56{margin:.26667rem 0}._freeTxt_1vz16_59{font-size:.4rem;color:#fff;line-height:.56rem;padding-top:.26667rem}._freeRate_1vz16_65{color:#32ffd8}@keyframes plyr-progress{to{background-position:.66667rem 0;background-position:var(--plyr-progress-loading-size,25px) 0}}@keyframes plyr-popup{0%{opacity:.5;transform:translateY(.26667rem)}to{opacity:1;transform:translateY(0)}}@keyframes plyr-fade-in{0%{opacity:0}to{opacity:1}}.plyr{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;align-items:center;direction:ltr;display:flex;flex-direction:column;font-family:inherit;font-family:var(--plyr-font-family,inherit);font-variant-numeric:tabular-nums;font-weight:400;font-weight:var(--plyr-font-weight-regular,400);line-height:1.7;line-height:var(--plyr-line-height,1.7);max-width:100%;min-width:5.33333rem;position:relative;text-shadow:none;transition:box-shadow .3s ease;z-index:0}.plyr audio,.plyr iframe,.plyr video{display:block;height:100%;width:100%}.plyr button{font:inherit;line-height:inherit;width:auto}.plyr:focus{outline:0}.plyr--full-ui{box-sizing:border-box}.plyr--full-ui *,.plyr--full-ui :after,.plyr--full-ui :before{box-sizing:inherit}.plyr--full-ui a,.plyr--full-ui button,.plyr--full-ui input,.plyr--full-ui label{touch-action:manipulation}.plyr__badge{background:#4a5464;background:var(--plyr-badge-background,#4a5464);border-radius:.05333rem;border-radius:var(--plyr-badge-border-radius,2px);color:#fff;color:var(--plyr-badge-text-color,#fff);font-size:.24rem;font-size:var(--plyr-font-size-badge,9px);line-height:1;padding:.08rem .10667rem}.plyr--full-ui ::-webkit-media-text-track-container{display:none}.plyr__captions{animation:plyr-fade-in .3s ease;bottom:0;display:none;font-size:.34667rem;font-size:var(--plyr-font-size-small,13px);left:0;padding:.26667rem;padding:var(--plyr-control-spacing,10px);position:absolute;text-align:center;transition:transform .4s ease-in-out;width:100%}.plyr__captions span:empty{display:none}@media (min-width:480px){.plyr__captions{font-size:.4rem;font-size:var(--plyr-font-size-base,15px);padding:.53333rem;padding:calc(var(--plyr-control-spacing, 10px)*2)}}@media (min-width:768px){.plyr__captions{font-size:.48rem;font-size:var(--plyr-font-size-large,18px)}}.plyr--captions-active .plyr__captions{display:block}.plyr:not(.plyr--hide-controls) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(-1.06667rem);transform:translateY(calc(var(--plyr-control-spacing, 10px)*-4))}.plyr__caption{background:rgba(0,0,0,.8);background:var(--plyr-captions-background,rgba(0,0,0,.8));border-radius:.05333rem;-webkit-box-decoration-break:clone;box-decoration-break:clone;color:#fff;color:var(--plyr-captions-text-color,#fff);line-height:185%;padding:.2em .5em;white-space:pre-wrap}.plyr__caption div{display:inline}.plyr__control{background:transparent;border:0;border-radius:.08rem;border-radius:var(--plyr-control-radius,3px);color:inherit;cursor:pointer;flex-shrink:0;overflow:visible;padding:.18667rem;padding:calc(var(--plyr-control-spacing, 10px)*.7);position:relative;transition:all .3s ease}.plyr__control svg{fill:currentColor;display:block;height:.48rem;height:var(--plyr-control-icon-size,18px);pointer-events:none;width:.48rem;width:var(--plyr-control-icon-size,18px)}.plyr__control:focus{outline:0}.plyr__control.plyr__tab-focus{outline:.08rem dotted #00b2ff;outline:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff))) dotted .08rem;outline-offset:.05333rem}a.plyr__control{text-decoration:none}.plyr__control.plyr__control--pressed .icon--not-pressed,.plyr__control.plyr__control--pressed .label--not-pressed,.plyr__control:not(.plyr__control--pressed) .icon--pressed,.plyr__control:not(.plyr__control--pressed) .label--pressed,a.plyr__control:after,a.plyr__control:before{display:none}.plyr--full-ui ::-webkit-media-controls{display:none}.plyr__controls{align-items:center;display:flex;justify-content:flex-end;text-align:center}.plyr__controls .plyr__progress__container{flex:1;min-width:0}.plyr__controls .plyr__controls__item{margin-left:.06667rem;margin-left:calc(var(--plyr-control-spacing, 10px)/4)}.plyr__controls .plyr__controls__item:first-child{margin-left:0;margin-right:auto}.plyr__controls .plyr__controls__item.plyr__progress__container{padding-left:.06667rem;padding-left:calc(var(--plyr-control-spacing, 10px)/4)}.plyr__controls .plyr__controls__item.plyr__time{padding:0 .13333rem;padding:0 calc(var(--plyr-control-spacing, 10px)/2)}.plyr__controls .plyr__controls__item.plyr__progress__container:first-child,.plyr__controls .plyr__controls__item.plyr__time+.plyr__time,.plyr__controls .plyr__controls__item.plyr__time:first-child{padding-left:0}.plyr [data-plyr=airplay],.plyr [data-plyr=captions],.plyr [data-plyr=fullscreen],.plyr [data-plyr=pip],.plyr__controls:empty{display:none}.plyr--airplay-supported [data-plyr=airplay],.plyr--captions-enabled [data-plyr=captions],.plyr--fullscreen-enabled [data-plyr=fullscreen],.plyr--pip-supported [data-plyr=pip]{display:inline-block}.plyr__menu{display:flex;position:relative}.plyr__menu .plyr__control svg{transition:transform .3s ease}.plyr__menu .plyr__control[aria-expanded=true] svg{transform:rotate(90deg)}.plyr__menu .plyr__control[aria-expanded=true] .plyr__tooltip{display:none}.plyr__menu__container{animation:plyr-popup .2s ease;background:hsla(0,0%,100%,.9);background:var(--plyr-menu-background,hsla(0,0%,100%,.9));border-radius:.10667rem;bottom:100%;box-shadow:0 .02667rem .05333rem rgba(0,0,0,.15);box-shadow:var(--plyr-menu-shadow,0 1px 2px rgba(0,0,0,.15));color:#4a5464;color:var(--plyr-menu-color,#4a5464);font-size:.4rem;font-size:var(--plyr-font-size-base,15px);margin-bottom:.26667rem;position:absolute;right:-.08rem;text-align:left;white-space:nowrap;z-index:3}.plyr__menu__container>div{overflow:hidden;transition:height .35s cubic-bezier(.4,0,.2,1),width .35s cubic-bezier(.4,0,.2,1)}.plyr__menu__container:after{border:.10667rem solid transparent;border-top-color:rgba(255,255,255,.9);border:var(--plyr-menu-arrow-size,4px) solid transparent;border-top-color:var(--plyr-menu-background,hsla(0,0%,100%,.9));content:"";height:0;position:absolute;right:.37333rem;right:calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7 - var(--plyr-menu-arrow-size, 4px)/2);top:100%;width:0}.plyr__menu__container [role=menu]{padding:.18667rem;padding:calc(var(--plyr-control-spacing, 10px)*.7)}.plyr__menu__container [role=menuitem],.plyr__menu__container [role=menuitemradio]{margin-top:.05333rem}.plyr__menu__container [role=menuitem]:first-child,.plyr__menu__container [role=menuitemradio]:first-child{margin-top:0}.plyr__menu__container .plyr__control{align-items:center;color:#4a5464;color:var(--plyr-menu-color,#4a5464);display:flex;font-size:.34667rem;font-size:var(--plyr-font-size-menu,var(--plyr-font-size-small,13px));padding:.12444rem .28rem;padding:calc(var(--plyr-control-spacing, 10px)*.7/1.5) calc(var(--plyr-control-spacing, 10px)*.7*1.5);-webkit-user-select:none;user-select:none;width:100%}.plyr__menu__container .plyr__control>span{align-items:inherit;display:flex;width:100%}.plyr__menu__container .plyr__control:after{border:.10667rem solid transparent;border:var(--plyr-menu-item-arrow-size,4px) solid transparent;content:"";position:absolute;top:50%;transform:translateY(-50%)}.plyr__menu__container .plyr__control--forward{padding-right:.74667rem;padding-right:calc(var(--plyr-control-spacing, 10px)*.7*4)}.plyr__menu__container .plyr__control--forward:after{border-left-color:#728197;border-left-color:var(--plyr-menu-arrow-color,#728197);right:.17333rem;right:calc(var(--plyr-control-spacing, 10px)*.7*1.5 - var(--plyr-menu-item-arrow-size, 4px))}.plyr__menu__container .plyr__control--forward.plyr__tab-focus:after,.plyr__menu__container .plyr__control--forward:hover:after{border-left-color:currentColor}.plyr__menu__container .plyr__control--back{font-weight:400;font-weight:var(--plyr-font-weight-regular,400);margin:.18667rem;margin:calc(var(--plyr-control-spacing, 10px)*.7);margin-bottom:.09333rem;margin-bottom:calc(var(--plyr-control-spacing, 10px)*.7/2);padding-left:.74667rem;padding-left:calc(var(--plyr-control-spacing, 10px)*.7*4);position:relative;width:calc(100% - 0.37333rem);width:calc(100% - var(--plyr-control-spacing, 10px)*.7*2)}.plyr__menu__container .plyr__control--back:after{border-right-color:#728197;border-right-color:var(--plyr-menu-arrow-color,#728197);left:.17333rem;left:calc(var(--plyr-control-spacing, 10px)*.7*1.5 - var(--plyr-menu-item-arrow-size, 4px))}.plyr__menu__container .plyr__control--back:before{background:#dcdfe5;background:var(--plyr-menu-back-border-color,#dcdfe5);box-shadow:0 .02667rem #fff;box-shadow:0 .02667rem 0 var(--plyr-menu-back-border-shadow-color,#fff);content:"";height:.02667rem;left:0;margin-top:.09333rem;margin-top:calc(var(--plyr-control-spacing, 10px)*.7/2);overflow:hidden;position:absolute;right:0;top:100%}.plyr__menu__container .plyr__control--back.plyr__tab-focus:after,.plyr__menu__container .plyr__control--back:hover:after{border-right-color:currentColor}.plyr__menu__container .plyr__control[role=menuitemradio]{padding-left:.18667rem;padding-left:calc(var(--plyr-control-spacing, 10px)*.7)}.plyr__menu__container .plyr__control[role=menuitemradio]:after,.plyr__menu__container .plyr__control[role=menuitemradio]:before{border-radius:100%}.plyr__menu__container .plyr__control[role=menuitemradio]:before{background:rgba(0,0,0,.1);content:"";display:block;flex-shrink:0;height:.42667rem;margin-right:.26667rem;margin-right:var(--plyr-control-spacing,10px);transition:all .3s ease;width:.42667rem}.plyr__menu__container .plyr__control[role=menuitemradio]:after{background:#fff;border:0;height:.16rem;left:.32rem;opacity:0;top:50%;transform:translateY(-50%) scale(0);transition:transform .3s ease,opacity .3s ease;width:.16rem}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]:before{background:#00b2ff;background:var(--plyr-control-toggle-checked-background,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)))}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]:after{opacity:1;transform:translateY(-50%) scale(1)}.plyr__menu__container .plyr__control[role=menuitemradio].plyr__tab-focus:before,.plyr__menu__container .plyr__control[role=menuitemradio]:hover:before{background:rgba(35,40,47,.1)}.plyr__menu__container .plyr__menu__value{align-items:center;display:flex;margin-left:auto;margin-right:calc(-0.18667rem + 2);margin-right:calc(var(--plyr-control-spacing, 10px)*.7*-1 - -2);overflow:hidden;padding-left:.65333rem;padding-left:calc(var(--plyr-control-spacing, 10px)*.7*3.5);pointer-events:none}.plyr--full-ui input[type=range]{-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:.69333rem;border-radius:calc(var(--plyr-range-thumb-height, 13px)*2);color:#00b2ff;color:var(--plyr-range-fill-background,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));display:block;height:.50667rem;height:calc(var(--plyr-range-thumb-active-shadow-width, 3px)*2 + var(--plyr-range-thumb-height, 13px));margin:0;min-width:0;padding:0;transition:box-shadow .3s ease;width:100%}.plyr--full-ui input[type=range]::-webkit-slider-runnable-track{background:transparent;background-image:linear-gradient(90deg,currentColor 0,transparent 0);background-image:linear-gradient(to right,currentColor var(--value,0),transparent var(--value,0));border:0;border-radius:.06667rem;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:.13333rem;height:var(--plyr-range-track-height,5px);-webkit-transition:box-shadow .3s ease;transition:box-shadow .3s ease;-webkit-user-select:none;user-select:none}.plyr--full-ui input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2));height:.34667rem;height:var(--plyr-range-thumb-height,13px);margin-top:-.10667rem;margin-top:calc((var(--plyr-range-thumb-height, 13px) - var(--plyr-range-track-height, 5px))/2*-1);position:relative;-webkit-transition:all .2s ease;transition:all .2s ease;width:.34667rem;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-moz-range-track{background:transparent;border:0;border-radius:.06667rem;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:.13333rem;height:var(--plyr-range-track-height,5px);-moz-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-moz-range-thumb{background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2));height:.34667rem;height:var(--plyr-range-thumb-height,13px);position:relative;-moz-transition:all .2s ease;transition:all .2s ease;width:.34667rem;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-moz-range-progress{background:currentColor;border-radius:.06667rem;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:.13333rem;height:var(--plyr-range-track-height,5px)}.plyr--full-ui input[type=range]::-ms-track{color:transparent}.plyr--full-ui input[type=range]::-ms-fill-upper,.plyr--full-ui input[type=range]::-ms-track{background:transparent;border:0;border-radius:.06667rem;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:.13333rem;height:var(--plyr-range-track-height,5px);-ms-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-ms-fill-lower{background:transparent;background:currentColor;border:0;border-radius:.06667rem;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:.13333rem;height:var(--plyr-range-track-height,5px);-ms-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-ms-thumb{background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2));height:.34667rem;height:var(--plyr-range-thumb-height,13px);margin-top:0;position:relative;-ms-transition:all .2s ease;transition:all .2s ease;width:.34667rem;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-ms-tooltip{display:none}.plyr--full-ui input[type=range]::-moz-focus-outer{border:0}.plyr--full-ui input[type=range]:focus{outline:0}.plyr--full-ui input[type=range].plyr__tab-focus::-webkit-slider-runnable-track{outline:.08rem dotted #00b2ff;outline:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff))) dotted .08rem;outline-offset:.05333rem}.plyr--full-ui input[type=range].plyr__tab-focus::-moz-range-track{outline:.08rem dotted #00b2ff;outline:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff))) dotted .08rem;outline-offset:.05333rem}.plyr--full-ui input[type=range].plyr__tab-focus::-ms-track{outline:.08rem dotted #00b2ff;outline:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff))) dotted .08rem;outline-offset:.05333rem}.plyr__poster{background-color:#000;background-color:var(--plyr-video-background,var(--plyr-video-background,#000));background-position:50% 50%;background-repeat:no-repeat;background-size:contain;height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity .2s ease;width:100%;z-index:1}.plyr--stopped.plyr__poster-enabled .plyr__poster{opacity:1}.plyr--youtube.plyr--paused.plyr__poster-enabled:not(.plyr--stopped) .plyr__poster{display:none}.plyr__time{font-size:.34667rem;font-size:var(--plyr-font-size-time,var(--plyr-font-size-small,13px))}.plyr__time+.plyr__time:before{content:"\\2044";margin-right:.26667rem;margin-right:var(--plyr-control-spacing,10px)}@media (max-width:767px){.plyr__time+.plyr__time{display:none}}.plyr__tooltip{background:hsla(0,0%,100%,.9);background:var(--plyr-tooltip-background,hsla(0,0%,100%,.9));border-radius:.13333rem;border-radius:var(--plyr-tooltip-radius,5px);bottom:100%;box-shadow:0 .02667rem .05333rem rgba(0,0,0,.15);box-shadow:var(--plyr-tooltip-shadow,0 1px 2px rgba(0,0,0,.15));color:#4a5464;color:var(--plyr-tooltip-color,#4a5464);font-size:.34667rem;font-size:var(--plyr-font-size-small,13px);font-weight:400;font-weight:var(--plyr-font-weight-regular,400);left:50%;line-height:1.3;margin-bottom:.26667rem;margin-bottom:calc(var(--plyr-control-spacing, 10px)/2*2);opacity:0;padding:.13333rem .2rem;padding:calc(var(--plyr-control-spacing, 10px)/2) calc(var(--plyr-control-spacing, 10px)/2*1.5);pointer-events:none;position:absolute;transform:translate(-50%,.26667rem) scale(.8);transform-origin:50% 100%;transition:transform .2s ease .1s,opacity .2s ease .1s;white-space:nowrap;z-index:2}.plyr__tooltip:before{border-left:.10667rem solid transparent;border-left:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-right:.10667rem solid transparent;border-right:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-top:.10667rem solid hsla(0,0%,100%,.9);border-top:var(--plyr-tooltip-arrow-size,4px) solid var(--plyr-tooltip-background,hsla(0,0%,100%,.9));bottom:-.10667rem;bottom:calc(var(--plyr-tooltip-arrow-size, 4px)*-1);content:"";height:0;left:50%;position:absolute;transform:translate(-50%);width:0;z-index:2}.plyr .plyr__control.plyr__tab-focus .plyr__tooltip,.plyr .plyr__control:hover .plyr__tooltip,.plyr__tooltip--visible{opacity:1;transform:translate(-50%) scale(1)}.plyr .plyr__control:hover .plyr__tooltip{z-index:3}.plyr__controls>.plyr__control:first-child .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip{left:0;transform:translateY(.26667rem) scale(.8);transform-origin:0 100%}.plyr__controls>.plyr__control:first-child .plyr__tooltip:before,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip:before{left:.42667rem;left:calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7)}.plyr__controls>.plyr__control:last-child .plyr__tooltip{left:auto;right:0;transform:translateY(.26667rem) scale(.8);transform-origin:100% 100%}.plyr__controls>.plyr__control:last-child .plyr__tooltip:before{left:auto;right:.42667rem;right:calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7);transform:translate(50%)}.plyr__controls>.plyr__control:first-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control:hover .plyr__tooltip,.plyr__controls>.plyr__control:first-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child:hover .plyr__tooltip,.plyr__controls>.plyr__control:last-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:last-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:last-child:hover .plyr__tooltip{transform:translate(0) scale(1)}.plyr__progress{left:.17333rem;left:calc(var(--plyr-range-thumb-height, 13px)*.5);margin-right:.34667rem;margin-right:var(--plyr-range-thumb-height,13px);position:relative}.plyr__progress input[type=range],.plyr__progress__buffer{margin-left:-.17333rem;margin-left:calc(var(--plyr-range-thumb-height, 13px)*-.5);margin-right:-.17333rem;margin-right:calc(var(--plyr-range-thumb-height, 13px)*-.5);width:calc(100% + 0.34667rem);width:calc(100% + var(--plyr-range-thumb-height, 13px))}.plyr__progress input[type=range]{position:relative;z-index:2}.plyr__progress .plyr__tooltip{left:0;max-width:3.2rem;overflow-wrap:break-word;white-space:normal}.plyr__progress__buffer{-webkit-appearance:none;background:transparent;border:0;border-radius:2.66667rem;height:.13333rem;height:var(--plyr-range-track-height,5px);left:0;margin-top:-.06667rem;margin-top:calc((var(--plyr-range-track-height, 5px)/2)*-1);padding:0;position:absolute;top:50%}.plyr__progress__buffer::-webkit-progress-bar{background:transparent}.plyr__progress__buffer::-webkit-progress-value{background:currentColor;border-radius:2.66667rem;min-width:.13333rem;min-width:var(--plyr-range-track-height,5px);-webkit-transition:width .2s ease;transition:width .2s ease}.plyr__progress__buffer::-moz-progress-bar{background:currentColor;border-radius:2.66667rem;min-width:.13333rem;min-width:var(--plyr-range-track-height,5px);-moz-transition:width .2s ease;transition:width .2s ease}.plyr__progress__buffer::-ms-fill{border-radius:2.66667rem;-ms-transition:width .2s ease;transition:width .2s ease}.plyr--loading .plyr__progress__buffer{animation:plyr-progress 1s linear infinite;background-image:linear-gradient(-45deg,rgba(35,40,47,.6) 25%,transparent 0,transparent 50%,rgba(35,40,47,.6) 0,rgba(35,40,47,.6) 75%,transparent 0,transparent);background-image:linear-gradient(-45deg,var(--plyr-progress-loading-background,rgba(35,40,47,.6)) 25%,transparent 25%,transparent 50%,var(--plyr-progress-loading-background,rgba(35,40,47,.6)) 50%,var(--plyr-progress-loading-background,rgba(35,40,47,.6)) 75%,transparent 75%,transparent);background-repeat:repeat-x;background-size:.66667rem .66667rem;background-size:var(--plyr-progress-loading-size,25px) var(--plyr-progress-loading-size,25px);color:transparent}.plyr--video.plyr--loading .plyr__progress__buffer{background-color:rgba(255,255,255,.25);background-color:var(--plyr-video-progress-buffered-background,hsla(0,0%,100%,.25))}.plyr--audio.plyr--loading .plyr__progress__buffer{background-color:rgba(193,200,209,.6);background-color:var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6))}.plyr__progress__marker{background-color:#fff;background-color:var(--plyr-progress-marker-background,#fff);border-radius:.02667rem;height:.13333rem;height:var(--plyr-range-track-height,5px);position:absolute;top:50%;transform:translate(-50%,-50%);width:.08rem;width:var(--plyr-progress-marker-width,3px);z-index:3}.plyr__volume{align-items:center;display:flex;max-width:2.93333rem;min-width:2.13333rem;position:relative;width:20%}.plyr__volume input[type=range]{margin-left:.13333rem;margin-left:calc(var(--plyr-control-spacing, 10px)/2);margin-right:.13333rem;margin-right:calc(var(--plyr-control-spacing, 10px)/2);position:relative;z-index:2}.plyr--is-ios .plyr__volume{min-width:0;width:auto}.plyr--audio{display:block}.plyr--audio .plyr__controls{background:#fff;background:var(--plyr-audio-controls-background,#fff);border-radius:inherit;color:#4a5464;color:var(--plyr-audio-control-color,#4a5464);padding:.26667rem;padding:var(--plyr-control-spacing,10px)}.plyr--audio .plyr__control.plyr__tab-focus,.plyr--audio .plyr__control:hover,.plyr--audio .plyr__control[aria-expanded=true]{background:#00b2ff;background:var(--plyr-audio-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));color:#fff;color:var(--plyr-audio-control-color-hover,#fff)}.plyr--full-ui.plyr--audio input[type=range]::-webkit-slider-runnable-track{background-color:rgba(193,200,209,.6);background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6)))}.plyr--full-ui.plyr--audio input[type=range]::-moz-range-track{background-color:rgba(193,200,209,.6);background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6)))}.plyr--full-ui.plyr--audio input[type=range]::-ms-track{background-color:rgba(193,200,209,.6);background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6)))}.plyr--full-ui.plyr--audio input[type=range]:active::-webkit-slider-thumb{box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2),0 0 0 .08rem rgba(35,40,47,.1);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(35,40,47,.1))}.plyr--full-ui.plyr--audio input[type=range]:active::-moz-range-thumb{box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2),0 0 0 .08rem rgba(35,40,47,.1);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(35,40,47,.1))}.plyr--full-ui.plyr--audio input[type=range]:active::-ms-thumb{box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2),0 0 0 .08rem rgba(35,40,47,.1);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(35,40,47,.1))}.plyr--audio .plyr__progress__buffer{color:rgba(193,200,209,.6);color:var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6))}.plyr--video{background:#000;background:var(--plyr-video-background,var(--plyr-video-background,#000));overflow:hidden}.plyr--video.plyr--menu-open{overflow:visible}.plyr__video-wrapper{background:#000;background:var(--plyr-video-background,var(--plyr-video-background,#000));height:100%;margin:auto;overflow:hidden;position:relative;width:100%}.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{aspect-ratio:16/9}@supports not (aspect-ratio:16/9){.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{height:0;padding-bottom:56.25%;position:relative}}.plyr__video-embed iframe,.plyr__video-wrapper--fixed-ratio video{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.plyr--full-ui .plyr__video-embed>.plyr__video-embed__container{padding-bottom:240%;position:relative;transform:translateY(-38.28125%)}.plyr--video .plyr__controls{background:linear-gradient(transparent,rgba(0,0,0,.75));background:var(--plyr-video-controls-background,linear-gradient(transparent,rgba(0,0,0,.75)));border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;bottom:0;color:#fff;color:var(--plyr-video-control-color,#fff);left:0;padding:.13333rem;padding:calc(var(--plyr-control-spacing, 10px)/2);padding-top:.53333rem;padding-top:calc(var(--plyr-control-spacing, 10px)*2);position:absolute;right:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out;z-index:3}@media (min-width:480px){.plyr--video .plyr__controls{padding:.26667rem;padding:var(--plyr-control-spacing,10px);padding-top:.93333rem;padding-top:calc(var(--plyr-control-spacing, 10px)*3.5)}}.plyr--video.plyr--hide-controls .plyr__controls{opacity:0;pointer-events:none;transform:translateY(100%)}.plyr--video .plyr__control.plyr__tab-focus,.plyr--video .plyr__control:hover,.plyr--video .plyr__control[aria-expanded=true]{background:#00b2ff;background:var(--plyr-video-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));color:#fff;color:var(--plyr-video-control-color-hover,#fff)}.plyr__control--overlaid{background:#00b2ff;background:var(--plyr-video-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));border:0;border-radius:100%;color:#fff;color:var(--plyr-video-control-color,#fff);display:none;left:50%;opacity:.9;padding:.4rem;padding:calc(var(--plyr-control-spacing, 10px)*1.5);position:absolute;top:50%;transform:translate(-50%,-50%);transition:.3s;z-index:2}.plyr__control--overlaid svg{left:.05333rem;position:relative}.plyr__control--overlaid:focus,.plyr__control--overlaid:hover{opacity:1}.plyr--playing .plyr__control--overlaid{opacity:0;visibility:hidden}.plyr--full-ui.plyr--video .plyr__control--overlaid{display:block}.plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{background-color:rgba(255,255,255,.25);background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,hsla(0,0%,100%,.25)))}.plyr--full-ui.plyr--video input[type=range]::-moz-range-track{background-color:rgba(255,255,255,.25);background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,hsla(0,0%,100%,.25)))}.plyr--full-ui.plyr--video input[type=range]::-ms-track{background-color:rgba(255,255,255,.25);background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,hsla(0,0%,100%,.25)))}.plyr--full-ui.plyr--video input[type=range]:active::-webkit-slider-thumb{box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2),0 0 0 .08rem rgba(255,255,255,.5);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,hsla(0,0%,100%,.5))}.plyr--full-ui.plyr--video input[type=range]:active::-moz-range-thumb{box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2),0 0 0 .08rem rgba(255,255,255,.5);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,hsla(0,0%,100%,.5))}.plyr--full-ui.plyr--video input[type=range]:active::-ms-thumb{box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2),0 0 0 .08rem rgba(255,255,255,.5);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,hsla(0,0%,100%,.5))}.plyr--video .plyr__progress__buffer{color:rgba(255,255,255,.25);color:var(--plyr-video-progress-buffered-background,hsla(0,0%,100%,.25))}.plyr:-webkit-full-screen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:fullscreen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-webkit-full-screen video{height:100%}.plyr:fullscreen video{height:100%}.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen{display:block}.plyr:fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-webkit-full-screen.plyr--hide-controls{cursor:none}.plyr:fullscreen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:-webkit-full-screen .plyr__captions{font-size:.56rem;font-size:var(--plyr-font-size-xlarge,21px)}.plyr:fullscreen .plyr__captions{font-size:.56rem;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr--fullscreen-fallback{background:#000;border-radius:0!important;bottom:0;display:block;height:100%;left:0;margin:0;position:fixed;right:0;top:0;width:100%;z-index:10000000}.plyr--fullscreen-fallback video{height:100%}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen{display:block}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr--fullscreen-fallback.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr--fullscreen-fallback .plyr__captions{font-size:.56rem;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr__ads{border-radius:inherit;bottom:0;cursor:pointer;left:0;overflow:hidden;position:absolute;right:0;top:0;z-index:-1}.plyr__ads>div,.plyr__ads>div iframe{height:100%;position:absolute;width:100%}.plyr__ads:after{background:#23282f;border-radius:.05333rem;bottom:.26667rem;bottom:var(--plyr-control-spacing,10px);color:#fff;content:attr(data-badge-text);font-size:.29333rem;padding:.05333rem .16rem;pointer-events:none;position:absolute;right:.26667rem;right:var(--plyr-control-spacing,10px);z-index:3}.plyr__ads:empty:after{display:none}.plyr__cues{background:currentColor;display:block;height:.13333rem;height:var(--plyr-range-track-height,5px);left:0;opacity:.8;position:absolute;top:50%;transform:translateY(-50%);width:.08rem;z-index:3}.plyr__preview-thumb{background-color:rgba(255,255,255,.9);background-color:var(--plyr-tooltip-background,hsla(0,0%,100%,.9));border-radius:.13333rem;border-radius:var(--plyr-tooltip-radius,5px);bottom:100%;box-shadow:0 .02667rem .05333rem rgba(0,0,0,.15);box-shadow:var(--plyr-tooltip-shadow,0 1px 2px rgba(0,0,0,.15));margin-bottom:.26667rem;margin-bottom:calc(var(--plyr-control-spacing, 10px)/2*2);opacity:0;padding:.08rem;pointer-events:none;position:absolute;transform:translateY(.26667rem) scale(.8);transform-origin:50% 100%;transition:transform .2s ease .1s,opacity .2s ease .1s;z-index:2}.plyr__preview-thumb--is-shown{opacity:1;transform:translate(0) scale(1)}.plyr__preview-thumb:before{border-left:.10667rem solid transparent;border-left:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-right:.10667rem solid transparent;border-right:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-top:.10667rem solid hsla(0,0%,100%,.9);border-top:var(--plyr-tooltip-arrow-size,4px) solid var(--plyr-tooltip-background,hsla(0,0%,100%,.9));bottom:-.10667rem;bottom:calc(var(--plyr-tooltip-arrow-size, 4px)*-1);content:"";height:0;left:calc(50% + var(--preview-arrow-offset));position:absolute;transform:translate(-50%);width:0;z-index:2}.plyr__preview-thumb__image-container{background:#c1c8d1;border-radius:.10667rem;border-radius:calc(var(--plyr-tooltip-radius, 5px) - .02667rem);overflow:hidden;position:relative;z-index:0}.plyr__preview-thumb__image-container img,.plyr__preview-thumb__image-container:after{height:100%;left:0;position:absolute;top:0;width:100%}.plyr__preview-thumb__image-container:after{border-radius:inherit;box-shadow:inset 0 0 0 .02667rem rgba(0,0,0,.15);content:"";pointer-events:none}.plyr__preview-thumb__image-container img{max-height:none;max-width:none}.plyr__preview-thumb__time-container{background:linear-gradient(transparent,rgba(0,0,0,.75));background:var(--plyr-video-controls-background,linear-gradient(transparent,rgba(0,0,0,.75)));border-bottom-left-radius:.10667rem;border-bottom-left-radius:calc(var(--plyr-tooltip-radius, 5px) - .02667rem);border-bottom-right-radius:.10667rem;border-bottom-right-radius:calc(var(--plyr-tooltip-radius, 5px) - .02667rem);bottom:0;left:0;line-height:1.1;padding:.53333rem .16rem .16rem;position:absolute;right:0;z-index:3}.plyr__preview-thumb__time-container span{color:#fff;font-size:.34667rem;font-size:var(--plyr-font-size-time,var(--plyr-font-size-small,13px))}.plyr__preview-scrubbing{bottom:0;filter:blur(.02667rem);height:100%;left:0;margin:auto;opacity:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;transition:opacity .3s ease;width:100%;z-index:1}.plyr__preview-scrubbing--is-shown{opacity:1}.plyr__preview-scrubbing img{height:100%;left:0;max-height:none;max-width:none;object-fit:contain;position:absolute;top:0;width:100%}.plyr--no-transition{transition:none!important}.plyr__sr-only{clip:rect(.02667rem,.02667rem,.02667rem,.02667rem);border:0!important;height:.02667rem!important;overflow:hidden;padding:0!important;position:absolute!important;width:.02667rem!important}.plyr [hidden]{display:none!important}\n'
  202. document.head.appendChild(__vite_style__)
  203. System.register(
  204. ['./vendor-legacy.09f20d09.js', './index-legacy.595c24c3.js'],
  205. function (exports) {
  206. 'use strict'
  207. var defineComponent,
  208. createVNode,
  209. Loading,
  210. createTextVNode,
  211. Fragment,
  212. Icon,
  213. Button,
  214. Toast,
  215. listenerMessage,
  216. browser$1,
  217. postMessage,
  218. state
  219. return {
  220. setters: [
  221. function (module) {
  222. defineComponent = module.d
  223. createVNode = module.a
  224. Loading = module.L
  225. createTextVNode = module.j
  226. Fragment = module.F
  227. Icon = module.K
  228. Button = module.B
  229. Toast = module.T
  230. },
  231. function (module) {
  232. listenerMessage = module.l
  233. browser$1 = module.b
  234. postMessage = module.p
  235. state = module.s
  236. }
  237. ],
  238. execute: function execute() {
  239. var video = '_video_1vz16_1'
  240. var loadingVideo = '_loadingVideo_1vz16_35'
  241. var playOver = '_playOver_1vz16_44'
  242. var tips = '_tips_1vz16_52'
  243. var btn = '_btn_1vz16_56'
  244. var freeTxt = '_freeTxt_1vz16_59'
  245. var freeRate = '_freeRate_1vz16_65'
  246. var styles = {
  247. 'video-container': '_video-container_1vz16_1',
  248. video: video,
  249. loadingVideo: loadingVideo,
  250. playOver: playOver,
  251. tips: tips,
  252. btn: btn,
  253. freeTxt: freeTxt,
  254. freeRate: freeRate
  255. }
  256. function _defineProperty$1(e, t, i) {
  257. return (
  258. t in e
  259. ? Object.defineProperty(e, t, {
  260. value: i,
  261. enumerable: !0,
  262. configurable: !0,
  263. writable: !0
  264. })
  265. : (e[t] = i),
  266. e
  267. )
  268. }
  269. function _classCallCheck(e, t) {
  270. if (!(e instanceof t))
  271. throw new TypeError('Cannot call a class as a function')
  272. }
  273. function _defineProperties(e, t) {
  274. for (var i = 0; i < t.length; i++) {
  275. var s = t[i]
  276. ;(s.enumerable = s.enumerable || !1),
  277. (s.configurable = !0),
  278. 'value' in s && (s.writable = !0),
  279. Object.defineProperty(e, s.key, s)
  280. }
  281. }
  282. function _createClass(e, t, i) {
  283. return (
  284. t && _defineProperties(e.prototype, t),
  285. i && _defineProperties(e, i),
  286. e
  287. )
  288. }
  289. function _defineProperty(e, t, i) {
  290. return (
  291. t in e
  292. ? Object.defineProperty(e, t, {
  293. value: i,
  294. enumerable: !0,
  295. configurable: !0,
  296. writable: !0
  297. })
  298. : (e[t] = i),
  299. e
  300. )
  301. }
  302. function ownKeys(e, t) {
  303. var i = Object.keys(e)
  304. if (Object.getOwnPropertySymbols) {
  305. var s = Object.getOwnPropertySymbols(e)
  306. t &&
  307. (s = s.filter(function (t) {
  308. return Object.getOwnPropertyDescriptor(e, t).enumerable
  309. })),
  310. i.push.apply(i, s)
  311. }
  312. return i
  313. }
  314. function _objectSpread2(e) {
  315. for (var t = 1; t < arguments.length; t++) {
  316. var i = null != arguments[t] ? arguments[t] : {}
  317. t % 2
  318. ? ownKeys(Object(i), !0).forEach(function (t) {
  319. _defineProperty(e, t, i[t])
  320. })
  321. : Object.getOwnPropertyDescriptors
  322. ? Object.defineProperties(
  323. e,
  324. Object.getOwnPropertyDescriptors(i)
  325. )
  326. : ownKeys(Object(i)).forEach(function (t) {
  327. Object.defineProperty(
  328. e,
  329. t,
  330. Object.getOwnPropertyDescriptor(i, t)
  331. )
  332. })
  333. }
  334. return e
  335. }
  336. var defaults$1 = { addCSS: !0, thumbWidth: 15, watch: !0 }
  337. function matches$1(e, t) {
  338. return function () {
  339. return Array.from(document.querySelectorAll(t)).includes(this)
  340. }.call(e, t)
  341. }
  342. function trigger(e, t) {
  343. if (e && t) {
  344. var i = new Event(t, { bubbles: !0 })
  345. e.dispatchEvent(i)
  346. }
  347. }
  348. var getConstructor$1 = function getConstructor$1(e) {
  349. return null != e ? e.constructor : null
  350. },
  351. instanceOf$1 = function instanceOf$1(e, t) {
  352. return !!(e && t && e instanceof t)
  353. },
  354. isNullOrUndefined$1 = function isNullOrUndefined$1(e) {
  355. return null == e
  356. },
  357. isObject$1 = function isObject$1(e) {
  358. return getConstructor$1(e) === Object
  359. },
  360. isNumber$1 = function isNumber$1(e) {
  361. return getConstructor$1(e) === Number && !Number.isNaN(e)
  362. },
  363. isString$1 = function isString$1(e) {
  364. return getConstructor$1(e) === String
  365. },
  366. isBoolean$1 = function isBoolean$1(e) {
  367. return getConstructor$1(e) === Boolean
  368. },
  369. isFunction$1 = function isFunction$1(e) {
  370. return getConstructor$1(e) === Function
  371. },
  372. isArray$1 = function isArray$1(e) {
  373. return Array.isArray(e)
  374. },
  375. isNodeList$1 = function isNodeList$1(e) {
  376. return instanceOf$1(e, NodeList)
  377. },
  378. isElement$1 = function isElement$1(e) {
  379. return instanceOf$1(e, Element)
  380. },
  381. isEvent$1 = function isEvent$1(e) {
  382. return instanceOf$1(e, Event)
  383. },
  384. isEmpty$1 = function isEmpty$1(e) {
  385. return (
  386. isNullOrUndefined$1(e) ||
  387. ((isString$1(e) || isArray$1(e) || isNodeList$1(e)) &&
  388. !e.length) ||
  389. (isObject$1(e) && !Object.keys(e).length)
  390. )
  391. },
  392. is$1 = {
  393. nullOrUndefined: isNullOrUndefined$1,
  394. object: isObject$1,
  395. number: isNumber$1,
  396. string: isString$1,
  397. boolean: isBoolean$1,
  398. function: isFunction$1,
  399. array: isArray$1,
  400. nodeList: isNodeList$1,
  401. element: isElement$1,
  402. event: isEvent$1,
  403. empty: isEmpty$1
  404. }
  405. function getDecimalPlaces(e) {
  406. var t = ''.concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/)
  407. return t
  408. ? Math.max(0, (t[1] ? t[1].length : 0) - (t[2] ? +t[2] : 0))
  409. : 0
  410. }
  411. function round(e, t) {
  412. if (1 > t) {
  413. var i = getDecimalPlaces(t)
  414. return parseFloat(e.toFixed(i))
  415. }
  416. return Math.round(e / t) * t
  417. }
  418. var RangeTouch = (function () {
  419. function e(t, i) {
  420. _classCallCheck(this, e),
  421. is$1.element(t)
  422. ? (this.element = t)
  423. : is$1.string(t) &&
  424. (this.element = document.querySelector(t)),
  425. is$1.element(this.element) &&
  426. is$1.empty(this.element.rangeTouch) &&
  427. ((this.config = _objectSpread2({}, defaults$1, {}, i)),
  428. this.init())
  429. }
  430. return (
  431. _createClass(
  432. e,
  433. [
  434. {
  435. key: 'init',
  436. value: function value() {
  437. e.enabled &&
  438. (this.config.addCSS &&
  439. ((this.element.style.userSelect = 'none'),
  440. (this.element.style.webKitUserSelect = 'none'),
  441. (this.element.style.touchAction = 'manipulation')),
  442. this.listeners(!0),
  443. (this.element.rangeTouch = this))
  444. }
  445. },
  446. {
  447. key: 'destroy',
  448. value: function value() {
  449. e.enabled &&
  450. (this.config.addCSS &&
  451. ((this.element.style.userSelect = ''),
  452. (this.element.style.webKitUserSelect = ''),
  453. (this.element.style.touchAction = '')),
  454. this.listeners(!1),
  455. (this.element.rangeTouch = null))
  456. }
  457. },
  458. {
  459. key: 'listeners',
  460. value: function value(e) {
  461. var t = this,
  462. i = e ? 'addEventListener' : 'removeEventListener'
  463. ;['touchstart', 'touchmove', 'touchend'].forEach(
  464. function (e) {
  465. t.element[i](
  466. e,
  467. function (e) {
  468. return t.set(e)
  469. },
  470. !1
  471. )
  472. }
  473. )
  474. }
  475. },
  476. {
  477. key: 'get',
  478. value: function value(t) {
  479. if (!e.enabled || !is$1.event(t)) return null
  480. var i,
  481. s = t.target,
  482. n = t.changedTouches[0],
  483. r = parseFloat(s.getAttribute('min')) || 0,
  484. a = parseFloat(s.getAttribute('max')) || 100,
  485. o = parseFloat(s.getAttribute('step')) || 1,
  486. l = s.getBoundingClientRect(),
  487. c =
  488. ((100 / l.width) * (this.config.thumbWidth / 2)) / 100
  489. return (
  490. 0 > (i = (100 / l.width) * (n.clientX - l.left))
  491. ? (i = 0)
  492. : 100 < i && (i = 100),
  493. 50 > i
  494. ? (i -= (100 - 2 * i) * c)
  495. : 50 < i && (i += 2 * (i - 50) * c),
  496. r + round((i / 100) * (a - r), o)
  497. )
  498. }
  499. },
  500. {
  501. key: 'set',
  502. value: function value(t) {
  503. e.enabled &&
  504. is$1.event(t) &&
  505. !t.target.disabled &&
  506. (t.preventDefault(),
  507. (t.target.value = this.get(t)),
  508. trigger(
  509. t.target,
  510. 'touchend' === t.type ? 'change' : 'input'
  511. ))
  512. }
  513. }
  514. ],
  515. [
  516. {
  517. key: 'setup',
  518. value: function value(t) {
  519. var i =
  520. 1 < arguments.length && void 0 !== arguments[1]
  521. ? arguments[1]
  522. : {},
  523. s = null
  524. if (
  525. (is$1.empty(t) || is$1.string(t)
  526. ? (s = Array.from(
  527. document.querySelectorAll(
  528. is$1.string(t) ? t : 'input[type="range"]'
  529. )
  530. ))
  531. : is$1.element(t)
  532. ? (s = [t])
  533. : is$1.nodeList(t)
  534. ? (s = Array.from(t))
  535. : is$1.array(t) && (s = t.filter(is$1.element)),
  536. is$1.empty(s))
  537. )
  538. return null
  539. var n = _objectSpread2({}, defaults$1, {}, i)
  540. if (is$1.string(t) && n.watch) {
  541. var r = new MutationObserver(function (i) {
  542. Array.from(i).forEach(function (i) {
  543. Array.from(i.addedNodes).forEach(function (i) {
  544. is$1.element(i) && matches$1(i, t) && new e(i, n)
  545. })
  546. })
  547. })
  548. r.observe(document.body, { childList: !0, subtree: !0 })
  549. }
  550. return s.map(function (t) {
  551. return new e(t, i)
  552. })
  553. }
  554. },
  555. {
  556. key: 'enabled',
  557. get: function get() {
  558. return 'ontouchstart' in document.documentElement
  559. }
  560. }
  561. ]
  562. ),
  563. e
  564. )
  565. })()
  566. var getConstructor = function getConstructor(e) {
  567. return null != e ? e.constructor : null
  568. },
  569. instanceOf = function instanceOf(e, t) {
  570. return Boolean(e && t && e instanceof t)
  571. },
  572. isNullOrUndefined = function isNullOrUndefined(e) {
  573. return null == e
  574. },
  575. isObject = function isObject(e) {
  576. return getConstructor(e) === Object
  577. },
  578. isNumber = function isNumber(e) {
  579. return getConstructor(e) === Number && !Number.isNaN(e)
  580. },
  581. isString = function isString(e) {
  582. return getConstructor(e) === String
  583. },
  584. isBoolean = function isBoolean(e) {
  585. return getConstructor(e) === Boolean
  586. },
  587. isFunction = function isFunction(e) {
  588. return getConstructor(e) === Function
  589. },
  590. isArray = function isArray(e) {
  591. return Array.isArray(e)
  592. },
  593. isWeakMap = function isWeakMap(e) {
  594. return instanceOf(e, WeakMap)
  595. },
  596. isNodeList = function isNodeList(e) {
  597. return instanceOf(e, NodeList)
  598. },
  599. isTextNode = function isTextNode(e) {
  600. return getConstructor(e) === Text
  601. },
  602. isEvent = function isEvent(e) {
  603. return instanceOf(e, Event)
  604. },
  605. isKeyboardEvent = function isKeyboardEvent(e) {
  606. return instanceOf(e, KeyboardEvent)
  607. },
  608. isCue = function isCue(e) {
  609. return (
  610. instanceOf(e, window.TextTrackCue) ||
  611. instanceOf(e, window.VTTCue)
  612. )
  613. },
  614. isTrack = function isTrack(e) {
  615. return (
  616. instanceOf(e, TextTrack) ||
  617. (!isNullOrUndefined(e) && isString(e.kind))
  618. )
  619. },
  620. isPromise = function isPromise(e) {
  621. return instanceOf(e, Promise) && isFunction(e.then)
  622. },
  623. isElement = function isElement(e) {
  624. return (
  625. null !== e &&
  626. 'object' == _typeof(e) &&
  627. 1 === e.nodeType &&
  628. 'object' == _typeof(e.style) &&
  629. 'object' == _typeof(e.ownerDocument)
  630. )
  631. },
  632. isEmpty = function isEmpty(e) {
  633. return (
  634. isNullOrUndefined(e) ||
  635. ((isString(e) || isArray(e) || isNodeList(e)) && !e.length) ||
  636. (isObject(e) && !Object.keys(e).length)
  637. )
  638. },
  639. isUrl = function isUrl(e) {
  640. if (instanceOf(e, window.URL)) return !0
  641. if (!isString(e)) return !1
  642. var t = e
  643. ;(e.startsWith('http://') && e.startsWith('https://')) ||
  644. (t = 'http://'.concat(e))
  645. try {
  646. return !isEmpty(new URL(t).hostname)
  647. } catch (e) {
  648. return !1
  649. }
  650. }
  651. var is = {
  652. nullOrUndefined: isNullOrUndefined,
  653. object: isObject,
  654. number: isNumber,
  655. string: isString,
  656. boolean: isBoolean,
  657. function: isFunction,
  658. array: isArray,
  659. weakMap: isWeakMap,
  660. nodeList: isNodeList,
  661. element: isElement,
  662. textNode: isTextNode,
  663. event: isEvent,
  664. keyboardEvent: isKeyboardEvent,
  665. cue: isCue,
  666. track: isTrack,
  667. promise: isPromise,
  668. url: isUrl,
  669. empty: isEmpty
  670. }
  671. var transitionEndEvent = (function () {
  672. var e = document.createElement('span'),
  673. t = {
  674. WebkitTransition: 'webkitTransitionEnd',
  675. MozTransition: 'transitionend',
  676. OTransition: 'oTransitionEnd otransitionend',
  677. transition: 'transitionend'
  678. },
  679. i = Object.keys(t).find(function (t) {
  680. return void 0 !== e.style[t]
  681. })
  682. return !!is.string(i) && t[i]
  683. })()
  684. function repaint(e, t) {
  685. setTimeout(function () {
  686. try {
  687. ;(e.hidden = !0), e.offsetHeight, (e.hidden = !1)
  688. } catch (e) {}
  689. }, t)
  690. }
  691. var browser = {
  692. isIE: Boolean(window.document.documentMode),
  693. isEdge: window.navigator.userAgent.includes('Edge'),
  694. isWebkit:
  695. 'WebkitAppearance' in document.documentElement.style &&
  696. !/Edge/.test(navigator.userAgent),
  697. isIPhone: /(iPhone|iPod)/gi.test(navigator.platform),
  698. isIos:
  699. ('MacIntel' === navigator.platform &&
  700. navigator.maxTouchPoints > 1) ||
  701. /(iPad|iPhone|iPod)/gi.test(navigator.platform)
  702. }
  703. function cloneDeep(e) {
  704. return JSON.parse(JSON.stringify(e))
  705. }
  706. function getDeep(e, t) {
  707. return t.split('.').reduce(function (e, t) {
  708. return e && e[t]
  709. }, e)
  710. }
  711. function extend() {
  712. var e =
  713. arguments.length > 0 && arguments[0] !== undefined
  714. ? arguments[0]
  715. : {}
  716. for (
  717. var _len = arguments.length,
  718. t = new Array(_len > 1 ? _len - 1 : 0),
  719. _key = 1;
  720. _key < _len;
  721. _key++
  722. ) {
  723. t[_key - 1] = arguments[_key]
  724. }
  725. if (!t.length) return e
  726. var i = t.shift()
  727. return is.object(i)
  728. ? (Object.keys(i).forEach(function (t) {
  729. is.object(i[t])
  730. ? (Object.keys(e).includes(t) ||
  731. Object.assign(e, _defineProperty2({}, t, {})),
  732. extend(e[t], i[t]))
  733. : Object.assign(e, _defineProperty2({}, t, i[t]))
  734. }),
  735. extend.apply(void 0, [e].concat(t)))
  736. : e
  737. }
  738. function wrap(e, t) {
  739. var i = e.length ? e : [e]
  740. Array.from(i)
  741. .reverse()
  742. .forEach(function (e, i) {
  743. var s = i > 0 ? t.cloneNode(!0) : t,
  744. n = e.parentNode,
  745. r = e.nextSibling
  746. s.appendChild(e), r ? n.insertBefore(s, r) : n.appendChild(s)
  747. })
  748. }
  749. function setAttributes(e, t) {
  750. is.element(e) &&
  751. !is.empty(t) &&
  752. Object.entries(t)
  753. .filter(function (_ref) {
  754. var _ref2 = _slicedToArray(_ref, 2),
  755. e = _ref2[1]
  756. return !is.nullOrUndefined(e)
  757. })
  758. .forEach(function (_ref3) {
  759. var _ref4 = _slicedToArray(_ref3, 2),
  760. t = _ref4[0],
  761. i = _ref4[1]
  762. return e.setAttribute(t, i)
  763. })
  764. }
  765. function createElement(e, t, i) {
  766. var s = document.createElement(e)
  767. return (
  768. is.object(t) && setAttributes(s, t),
  769. is.string(i) && (s.innerText = i),
  770. s
  771. )
  772. }
  773. function insertAfter(e, t) {
  774. is.element(e) &&
  775. is.element(t) &&
  776. t.parentNode.insertBefore(e, t.nextSibling)
  777. }
  778. function insertElement(e, t, i, s) {
  779. is.element(t) && t.appendChild(createElement(e, i, s))
  780. }
  781. function removeElement(e) {
  782. is.nodeList(e) || is.array(e)
  783. ? Array.from(e).forEach(removeElement)
  784. : is.element(e) &&
  785. is.element(e.parentNode) &&
  786. e.parentNode.removeChild(e)
  787. }
  788. function emptyElement(e) {
  789. if (!is.element(e)) return
  790. var t = e.childNodes.length
  791. for (; t > 0; ) {
  792. e.removeChild(e.lastChild), (t -= 1)
  793. }
  794. }
  795. function replaceElement(e, t) {
  796. return is.element(t) && is.element(t.parentNode) && is.element(e)
  797. ? (t.parentNode.replaceChild(e, t), e)
  798. : null
  799. }
  800. function getAttributesFromSelector(e, t) {
  801. if (!is.string(e) || is.empty(e)) return {}
  802. var i = {},
  803. s = extend({}, t)
  804. return (
  805. e.split(',').forEach(function (e) {
  806. var t = e.trim(),
  807. n = t.replace('.', ''),
  808. r = t.replace(/[[\]]/g, '').split('='),
  809. _r = _slicedToArray(r, 1),
  810. a = _r[0],
  811. o = r.length > 1 ? r[1].replace(/["']/g, '') : ''
  812. switch (t.charAt(0)) {
  813. case '.':
  814. is.string(s.class)
  815. ? (i.class = ''.concat(s.class, ' ').concat(n))
  816. : (i.class = n)
  817. break
  818. case '#':
  819. i.id = t.replace('#', '')
  820. break
  821. case '[':
  822. i[a] = o
  823. }
  824. }),
  825. extend(s, i)
  826. )
  827. }
  828. function toggleHidden(e, t) {
  829. if (!is.element(e)) return
  830. var i = t
  831. is.boolean(i) || (i = !e.hidden), (e.hidden = i)
  832. }
  833. function toggleClass(e, t, i) {
  834. if (is.nodeList(e))
  835. return Array.from(e).map(function (e) {
  836. return toggleClass(e, t, i)
  837. })
  838. if (is.element(e)) {
  839. var s = 'toggle'
  840. return (
  841. void 0 !== i && (s = i ? 'add' : 'remove'),
  842. e.classList[s](t),
  843. e.classList.contains(t)
  844. )
  845. }
  846. return !1
  847. }
  848. function hasClass(e, t) {
  849. return is.element(e) && e.classList.contains(t)
  850. }
  851. function matches(e, t) {
  852. var _Element = Element,
  853. i = _Element.prototype
  854. return (
  855. i.matches ||
  856. i.webkitMatchesSelector ||
  857. i.mozMatchesSelector ||
  858. i.msMatchesSelector ||
  859. function () {
  860. return Array.from(document.querySelectorAll(t)).includes(this)
  861. }
  862. ).call(e, t)
  863. }
  864. function closest$1(e, t) {
  865. var _Element2 = Element,
  866. i = _Element2.prototype
  867. return (
  868. i.closest ||
  869. function () {
  870. var e = this
  871. do {
  872. if (matches.matches(e, t)) return e
  873. e = e.parentElement || e.parentNode
  874. } while (null !== e && 1 === e.nodeType)
  875. return null
  876. }
  877. ).call(e, t)
  878. }
  879. function getElements(e) {
  880. return this.elements.container.querySelectorAll(e)
  881. }
  882. function getElement(e) {
  883. return this.elements.container.querySelector(e)
  884. }
  885. function setFocus() {
  886. var e =
  887. arguments.length > 0 && arguments[0] !== undefined
  888. ? arguments[0]
  889. : null
  890. var t =
  891. arguments.length > 1 && arguments[1] !== undefined
  892. ? arguments[1]
  893. : !1
  894. is.element(e) &&
  895. (e.focus({ preventScroll: !0 }),
  896. t && toggleClass(e, this.config.classNames.tabFocus))
  897. }
  898. var defaultCodecs = {
  899. 'audio/ogg': 'vorbis',
  900. 'audio/wav': '1',
  901. 'video/webm': 'vp8, vorbis',
  902. 'video/mp4': 'avc1.42E01E, mp4a.40.2',
  903. 'video/ogg': 'theora'
  904. },
  905. support = {
  906. audio: 'canPlayType' in document.createElement('audio'),
  907. video: 'canPlayType' in document.createElement('video'),
  908. check: function check(e, t, i) {
  909. var s = browser.isIPhone && i && support.playsinline,
  910. n = support[e] || 'html5' !== t
  911. return {
  912. api: n,
  913. ui:
  914. n &&
  915. support.rangeInput &&
  916. ('video' !== e || !browser.isIPhone || s)
  917. }
  918. },
  919. pip: !(
  920. browser.isIPhone ||
  921. (!is.function(
  922. createElement('video').webkitSetPresentationMode
  923. ) &&
  924. (!document.pictureInPictureEnabled ||
  925. createElement('video').disablePictureInPicture))
  926. ),
  927. airplay: is.function(
  928. window.WebKitPlaybackTargetAvailabilityEvent
  929. ),
  930. playsinline: 'playsInline' in document.createElement('video'),
  931. mime: function mime(e) {
  932. if (is.empty(e)) return !1
  933. var _e$split = e.split('/'),
  934. _e$split2 = _slicedToArray(_e$split, 1),
  935. t = _e$split2[0]
  936. var i = e
  937. if (!this.isHTML5 || t !== this.type) return !1
  938. Object.keys(defaultCodecs).includes(i) &&
  939. (i += '; codecs="'.concat(defaultCodecs[e], '"'))
  940. try {
  941. return Boolean(
  942. i && this.media.canPlayType(i).replace(/no/, '')
  943. )
  944. } catch (e) {
  945. return !1
  946. }
  947. },
  948. textTracks: 'textTracks' in document.createElement('video'),
  949. rangeInput: (function () {
  950. var e = document.createElement('input')
  951. return (e.type = 'range'), 'range' === e.type
  952. })(),
  953. touch: 'ontouchstart' in document.documentElement,
  954. transitions: !1 !== transitionEndEvent,
  955. reducedMotion:
  956. 'matchMedia' in window &&
  957. window.matchMedia('(prefers-reduced-motion)').matches
  958. },
  959. supportsPassiveListeners = (function () {
  960. var e = !1
  961. try {
  962. var t = Object.defineProperty({}, 'passive', {
  963. get: function get() {
  964. return (e = !0), null
  965. }
  966. })
  967. window.addEventListener('test', null, t),
  968. window.removeEventListener('test', null, t)
  969. } catch (e) {}
  970. return e
  971. })()
  972. function toggleListener(e, t, i) {
  973. var _this2 = this
  974. var s =
  975. arguments.length > 3 && arguments[3] !== undefined
  976. ? arguments[3]
  977. : !1
  978. var n =
  979. arguments.length > 4 && arguments[4] !== undefined
  980. ? arguments[4]
  981. : !0
  982. var r =
  983. arguments.length > 5 && arguments[5] !== undefined
  984. ? arguments[5]
  985. : !1
  986. if (
  987. !e ||
  988. !('addEventListener' in e) ||
  989. is.empty(t) ||
  990. !is.function(i)
  991. )
  992. return
  993. var a = t.split(' ')
  994. var o = r
  995. supportsPassiveListeners && (o = { passive: n, capture: r }),
  996. a.forEach(function (t) {
  997. _this2 &&
  998. _this2.eventListeners &&
  999. s &&
  1000. _this2.eventListeners.push({
  1001. element: e,
  1002. type: t,
  1003. callback: i,
  1004. options: o
  1005. }),
  1006. e[s ? 'addEventListener' : 'removeEventListener'](t, i, o)
  1007. })
  1008. }
  1009. function on(e) {
  1010. var t =
  1011. arguments.length > 1 && arguments[1] !== undefined
  1012. ? arguments[1]
  1013. : ''
  1014. var i = arguments.length > 2 ? arguments[2] : undefined
  1015. var s =
  1016. arguments.length > 3 && arguments[3] !== undefined
  1017. ? arguments[3]
  1018. : !0
  1019. var n =
  1020. arguments.length > 4 && arguments[4] !== undefined
  1021. ? arguments[4]
  1022. : !1
  1023. toggleListener.call(this, e, t, i, !0, s, n)
  1024. }
  1025. function off(e) {
  1026. var t =
  1027. arguments.length > 1 && arguments[1] !== undefined
  1028. ? arguments[1]
  1029. : ''
  1030. var i = arguments.length > 2 ? arguments[2] : undefined
  1031. var s =
  1032. arguments.length > 3 && arguments[3] !== undefined
  1033. ? arguments[3]
  1034. : !0
  1035. var n =
  1036. arguments.length > 4 && arguments[4] !== undefined
  1037. ? arguments[4]
  1038. : !1
  1039. toggleListener.call(this, e, t, i, !1, s, n)
  1040. }
  1041. function once(e) {
  1042. var _this3 = this
  1043. var t =
  1044. arguments.length > 1 && arguments[1] !== undefined
  1045. ? arguments[1]
  1046. : ''
  1047. var i = arguments.length > 2 ? arguments[2] : undefined
  1048. var s =
  1049. arguments.length > 3 && arguments[3] !== undefined
  1050. ? arguments[3]
  1051. : !0
  1052. var n =
  1053. arguments.length > 4 && arguments[4] !== undefined
  1054. ? arguments[4]
  1055. : !1
  1056. var r = function r() {
  1057. for (
  1058. var _len2 = arguments.length, a = new Array(_len2), _key2 = 0;
  1059. _key2 < _len2;
  1060. _key2++
  1061. ) {
  1062. a[_key2] = arguments[_key2]
  1063. }
  1064. off(e, t, r, s, n), i.apply(_this3, a)
  1065. }
  1066. toggleListener.call(this, e, t, r, !0, s, n)
  1067. }
  1068. function triggerEvent(e) {
  1069. var t =
  1070. arguments.length > 1 && arguments[1] !== undefined
  1071. ? arguments[1]
  1072. : ''
  1073. var i =
  1074. arguments.length > 2 && arguments[2] !== undefined
  1075. ? arguments[2]
  1076. : !1
  1077. var s =
  1078. arguments.length > 3 && arguments[3] !== undefined
  1079. ? arguments[3]
  1080. : {}
  1081. if (!is.element(e) || is.empty(t)) return
  1082. var n = new CustomEvent(t, {
  1083. bubbles: i,
  1084. detail: _objectSpread(_objectSpread({}, s), {}, { plyr: this })
  1085. })
  1086. e.dispatchEvent(n)
  1087. }
  1088. function unbindListeners() {
  1089. this &&
  1090. this.eventListeners &&
  1091. (this.eventListeners.forEach(function (e) {
  1092. var t = e.element,
  1093. i = e.type,
  1094. s = e.callback,
  1095. n = e.options
  1096. t.removeEventListener(i, s, n)
  1097. }),
  1098. (this.eventListeners = []))
  1099. }
  1100. function ready() {
  1101. var _this4 = this
  1102. return new Promise(function (e) {
  1103. return _this4.ready
  1104. ? setTimeout(e, 0)
  1105. : on.call(_this4, _this4.elements.container, 'ready', e)
  1106. }).then(function () {})
  1107. }
  1108. function silencePromise(e) {
  1109. is.promise(e) && e.then(null, function () {})
  1110. }
  1111. function dedupe(e) {
  1112. return is.array(e)
  1113. ? e.filter(function (t, i) {
  1114. return e.indexOf(t) === i
  1115. })
  1116. : e
  1117. }
  1118. function closest(e, t) {
  1119. return is.array(e) && e.length
  1120. ? e.reduce(function (e, i) {
  1121. return Math.abs(i - t) < Math.abs(e - t) ? i : e
  1122. })
  1123. : null
  1124. }
  1125. function supportsCSS(e) {
  1126. return !(!window || !window.CSS) && window.CSS.supports(e)
  1127. }
  1128. var standardRatios = [
  1129. [1, 1],
  1130. [4, 3],
  1131. [3, 4],
  1132. [5, 4],
  1133. [4, 5],
  1134. [3, 2],
  1135. [2, 3],
  1136. [16, 10],
  1137. [10, 16],
  1138. [16, 9],
  1139. [9, 16],
  1140. [21, 9],
  1141. [9, 21],
  1142. [32, 9],
  1143. [9, 32]
  1144. ].reduce(function (e, _ref5) {
  1145. var _ref6 = _slicedToArray(_ref5, 2),
  1146. t = _ref6[0],
  1147. i = _ref6[1]
  1148. return _objectSpread(
  1149. _objectSpread({}, e),
  1150. {},
  1151. _defineProperty2({}, t / i, [t, i])
  1152. )
  1153. }, {})
  1154. function validateAspectRatio(e) {
  1155. if (!(is.array(e) || (is.string(e) && e.includes(':')))) return !1
  1156. return (is.array(e) ? e : e.split(':')).map(Number).every(is.number)
  1157. }
  1158. function reduceAspectRatio(e) {
  1159. if (!is.array(e) || !e.every(is.number)) return null
  1160. var _e2 = _slicedToArray(e, 2),
  1161. t = _e2[0],
  1162. i = _e2[1],
  1163. s = function s(e, t) {
  1164. return 0 === t ? e : s(t, e % t)
  1165. },
  1166. n = s(t, i)
  1167. return [t / n, i / n]
  1168. }
  1169. function getAspectRatio(e) {
  1170. var _this$embed
  1171. var t = function t(e) {
  1172. return validateAspectRatio(e) ? e.split(':').map(Number) : null
  1173. }
  1174. var i = t(e)
  1175. if (
  1176. (null === i && (i = t(this.config.ratio)),
  1177. null === i &&
  1178. !is.empty(this.embed) &&
  1179. is.array(this.embed.ratio) &&
  1180. ((_this$embed = this.embed),
  1181. (i = _this$embed.ratio),
  1182. _this$embed),
  1183. null === i && this.isHTML5)
  1184. ) {
  1185. var _this$media = this.media,
  1186. _e3 = _this$media.videoWidth,
  1187. _t = _this$media.videoHeight
  1188. i = [_e3, _t]
  1189. }
  1190. return reduceAspectRatio(i)
  1191. }
  1192. function setAspectRatio(e) {
  1193. if (!this.isVideo) return {}
  1194. var t = this.elements.wrapper,
  1195. i = getAspectRatio.call(this, e)
  1196. if (!is.array(i)) return {}
  1197. var _reduceAspectRatio = reduceAspectRatio(i),
  1198. _reduceAspectRatio2 = _slicedToArray(_reduceAspectRatio, 2),
  1199. s = _reduceAspectRatio2[0],
  1200. n = _reduceAspectRatio2[1],
  1201. r = (100 / s) * n
  1202. if (
  1203. (supportsCSS('aspect-ratio: '.concat(s, '/').concat(n))
  1204. ? (t.style.aspectRatio = ''.concat(s, '/').concat(n))
  1205. : (t.style.paddingBottom = ''.concat(r, '%')),
  1206. this.isVimeo && !this.config.vimeo.premium && this.supported.ui)
  1207. ) {
  1208. var _e4 =
  1209. (100 / this.media.offsetWidth) *
  1210. parseInt(
  1211. window.getComputedStyle(this.media).paddingBottom,
  1212. 10
  1213. ),
  1214. _i2 = (_e4 - r) / (_e4 / 50)
  1215. this.fullscreen.active
  1216. ? (t.style.paddingBottom = null)
  1217. : (this.media.style.transform = 'translateY(-'.concat(
  1218. _i2,
  1219. '%)'
  1220. ))
  1221. } else
  1222. this.isHTML5 &&
  1223. t.classList.add(this.config.classNames.videoFixedRatio)
  1224. return { padding: r, ratio: i }
  1225. }
  1226. function roundAspectRatio(e, t) {
  1227. var i =
  1228. arguments.length > 2 && arguments[2] !== undefined
  1229. ? arguments[2]
  1230. : 0.05
  1231. var s = e / t,
  1232. n = closest(Object.keys(standardRatios), s)
  1233. return Math.abs(n - s) <= i ? standardRatios[n] : [e, t]
  1234. }
  1235. function getViewportSize() {
  1236. return [
  1237. Math.max(
  1238. document.documentElement.clientWidth || 0,
  1239. window.innerWidth || 0
  1240. ),
  1241. Math.max(
  1242. document.documentElement.clientHeight || 0,
  1243. window.innerHeight || 0
  1244. )
  1245. ]
  1246. }
  1247. var html5 = {
  1248. getSources: function getSources() {
  1249. var _this5 = this
  1250. if (!this.isHTML5) return []
  1251. return Array.from(this.media.querySelectorAll('source')).filter(
  1252. function (e) {
  1253. var t = e.getAttribute('type')
  1254. return !!is.empty(t) || support.mime.call(_this5, t)
  1255. }
  1256. )
  1257. },
  1258. getQualityOptions: function getQualityOptions() {
  1259. return this.config.quality.forced
  1260. ? this.config.quality.options
  1261. : html5.getSources
  1262. .call(this)
  1263. .map(function (e) {
  1264. return Number(e.getAttribute('size'))
  1265. })
  1266. .filter(Boolean)
  1267. },
  1268. setup: function setup() {
  1269. if (!this.isHTML5) return
  1270. var e = this
  1271. ;(e.options.speed = e.config.speed.options),
  1272. is.empty(this.config.ratio) || setAspectRatio.call(e),
  1273. Object.defineProperty(e.media, 'quality', {
  1274. get: function get() {
  1275. var t = html5.getSources.call(e).find(function (t) {
  1276. return t.getAttribute('src') === e.source
  1277. })
  1278. return t && Number(t.getAttribute('size'))
  1279. },
  1280. set: function set(t) {
  1281. if (e.quality !== t) {
  1282. if (
  1283. e.config.quality.forced &&
  1284. is.function(e.config.quality.onChange)
  1285. )
  1286. e.config.quality.onChange(t)
  1287. else {
  1288. var i = html5.getSources.call(e).find(function (e) {
  1289. return Number(e.getAttribute('size')) === t
  1290. })
  1291. if (!i) return
  1292. var _e$media = e.media,
  1293. s = _e$media.currentTime,
  1294. n = _e$media.paused,
  1295. r = _e$media.preload,
  1296. a = _e$media.readyState,
  1297. o = _e$media.playbackRate
  1298. ;(e.media.src = i.getAttribute('src')),
  1299. ('none' !== r || a) &&
  1300. (e.once('loadedmetadata', function () {
  1301. ;(e.speed = o),
  1302. (e.currentTime = s),
  1303. n || silencePromise(e.play())
  1304. }),
  1305. e.media.load())
  1306. }
  1307. triggerEvent.call(e, e.media, 'qualitychange', !1, {
  1308. quality: t
  1309. })
  1310. }
  1311. }
  1312. })
  1313. },
  1314. cancelRequests: function cancelRequests() {
  1315. this.isHTML5 &&
  1316. (removeElement(html5.getSources.call(this)),
  1317. this.media.setAttribute('src', this.config.blankVideo),
  1318. this.media.load(),
  1319. this.debug.log('Cancelled network requests'))
  1320. }
  1321. }
  1322. function generateId(e) {
  1323. return ''.concat(e, '-').concat(Math.floor(1e4 * Math.random()))
  1324. }
  1325. function format(e) {
  1326. for (
  1327. var _len3 = arguments.length,
  1328. t = new Array(_len3 > 1 ? _len3 - 1 : 0),
  1329. _key3 = 1;
  1330. _key3 < _len3;
  1331. _key3++
  1332. ) {
  1333. t[_key3 - 1] = arguments[_key3]
  1334. }
  1335. return is.empty(e)
  1336. ? e
  1337. : e.toString().replace(/{(\d+)}/g, function (e, i) {
  1338. return t[i].toString()
  1339. })
  1340. }
  1341. function getPercentage(e, t) {
  1342. return 0 === e || 0 === t || Number.isNaN(e) || Number.isNaN(t)
  1343. ? 0
  1344. : ((e / t) * 100).toFixed(2)
  1345. }
  1346. var replaceAll = function replaceAll() {
  1347. var e =
  1348. arguments.length > 0 && arguments[0] !== undefined
  1349. ? arguments[0]
  1350. : ''
  1351. var t =
  1352. arguments.length > 1 && arguments[1] !== undefined
  1353. ? arguments[1]
  1354. : ''
  1355. var i =
  1356. arguments.length > 2 && arguments[2] !== undefined
  1357. ? arguments[2]
  1358. : ''
  1359. return e.replace(
  1360. new RegExp(
  1361. t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g, '\\$1'),
  1362. 'g'
  1363. ),
  1364. i.toString()
  1365. )
  1366. },
  1367. toTitleCase = function toTitleCase() {
  1368. var e =
  1369. arguments.length > 0 && arguments[0] !== undefined
  1370. ? arguments[0]
  1371. : ''
  1372. return e.toString().replace(/\w\S*/g, function (e) {
  1373. return e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()
  1374. })
  1375. }
  1376. function toPascalCase() {
  1377. var e =
  1378. arguments.length > 0 && arguments[0] !== undefined
  1379. ? arguments[0]
  1380. : ''
  1381. var t = e.toString()
  1382. return (
  1383. (t = replaceAll(t, '-', ' ')),
  1384. (t = replaceAll(t, '_', ' ')),
  1385. (t = toTitleCase(t)),
  1386. replaceAll(t, ' ', '')
  1387. )
  1388. }
  1389. function toCamelCase() {
  1390. var e =
  1391. arguments.length > 0 && arguments[0] !== undefined
  1392. ? arguments[0]
  1393. : ''
  1394. var t = e.toString()
  1395. return (t = toPascalCase(t)), t.charAt(0).toLowerCase() + t.slice(1)
  1396. }
  1397. function stripHTML(e) {
  1398. var t = document.createDocumentFragment(),
  1399. i = document.createElement('div')
  1400. return t.appendChild(i), (i.innerHTML = e), t.firstChild.innerText
  1401. }
  1402. function getHTML(e) {
  1403. var t = document.createElement('div')
  1404. return t.appendChild(e), t.innerHTML
  1405. }
  1406. var resources = {
  1407. pip: 'PIP',
  1408. airplay: 'AirPlay',
  1409. html5: 'HTML5',
  1410. vimeo: 'Vimeo',
  1411. youtube: 'YouTube'
  1412. },
  1413. i18n = {
  1414. get: function get() {
  1415. var e =
  1416. arguments.length > 0 && arguments[0] !== undefined
  1417. ? arguments[0]
  1418. : ''
  1419. var t =
  1420. arguments.length > 1 && arguments[1] !== undefined
  1421. ? arguments[1]
  1422. : {}
  1423. if (is.empty(e) || is.empty(t)) return ''
  1424. var i = getDeep(t.i18n, e)
  1425. if (is.empty(i))
  1426. return Object.keys(resources).includes(e) ? resources[e] : ''
  1427. var s = { '{seektime}': t.seekTime, '{title}': t.title }
  1428. return (
  1429. Object.entries(s).forEach(function (_ref7) {
  1430. var _ref8 = _slicedToArray(_ref7, 2),
  1431. e = _ref8[0],
  1432. t = _ref8[1]
  1433. i = replaceAll(i, e, t)
  1434. }),
  1435. i
  1436. )
  1437. }
  1438. }
  1439. var Storage = /*#__PURE__*/ (function () {
  1440. function Storage(e) {
  1441. var _this6 = this
  1442. _classCallCheck2(this, Storage)
  1443. _defineProperty$1(this, 'get', function (e) {
  1444. if (!Storage.supported || !_this6.enabled) return null
  1445. var t = window.localStorage.getItem(_this6.key)
  1446. if (is.empty(t)) return null
  1447. var i = JSON.parse(t)
  1448. return is.string(e) && e.length ? i[e] : i
  1449. }),
  1450. _defineProperty$1(this, 'set', function (e) {
  1451. if (!Storage.supported || !_this6.enabled) return
  1452. if (!is.object(e)) return
  1453. var t = _this6.get()
  1454. is.empty(t) && (t = {}), extend(t, e)
  1455. try {
  1456. window.localStorage.setItem(_this6.key, JSON.stringify(t))
  1457. } catch (e) {}
  1458. }),
  1459. (this.enabled = e.config.storage.enabled),
  1460. (this.key = e.config.storage.key)
  1461. }
  1462. _createClass2(Storage, null, [
  1463. {
  1464. key: 'supported',
  1465. get: function get() {
  1466. try {
  1467. if (!('localStorage' in window)) return !1
  1468. var e = '___test'
  1469. return (
  1470. window.localStorage.setItem(e, e),
  1471. window.localStorage.removeItem(e),
  1472. !0
  1473. )
  1474. } catch (e) {
  1475. return !1
  1476. }
  1477. }
  1478. }
  1479. ])
  1480. return Storage
  1481. })()
  1482. function fetch(e) {
  1483. var t =
  1484. arguments.length > 1 && arguments[1] !== undefined
  1485. ? arguments[1]
  1486. : 'text'
  1487. return new Promise(function (i, s) {
  1488. try {
  1489. var _s2 = new XMLHttpRequest()
  1490. if (!('withCredentials' in _s2)) return
  1491. _s2.addEventListener('load', function () {
  1492. if ('text' === t)
  1493. try {
  1494. i(JSON.parse(_s2.responseText))
  1495. } catch (e) {
  1496. i(_s2.responseText)
  1497. }
  1498. else i(_s2.response)
  1499. }),
  1500. _s2.addEventListener('error', function () {
  1501. throw new Error(_s2.status)
  1502. }),
  1503. _s2.open('GET', e, !0),
  1504. (_s2.responseType = t),
  1505. _s2.send()
  1506. } catch (e) {
  1507. s(e)
  1508. }
  1509. })
  1510. }
  1511. function _loadSprite(e, t) {
  1512. if (!is.string(e)) return
  1513. var i = is.string(t)
  1514. var s = !1
  1515. var n = function n() {
  1516. return null !== document.getElementById(t)
  1517. },
  1518. r = function r(e, t) {
  1519. ;(e.innerHTML = t),
  1520. (i && n()) ||
  1521. document.body.insertAdjacentElement('afterbegin', e)
  1522. }
  1523. if (!i || !n()) {
  1524. var _n2 = Storage.supported,
  1525. a = document.createElement('div')
  1526. if (
  1527. (a.setAttribute('hidden', ''),
  1528. i && a.setAttribute('id', t),
  1529. _n2)
  1530. ) {
  1531. var _e5 = window.localStorage.getItem('cache-'.concat(t))
  1532. if (((s = null !== _e5), s)) {
  1533. var _t2 = JSON.parse(_e5)
  1534. r(a, _t2.content)
  1535. }
  1536. }
  1537. fetch(e)
  1538. .then(function (e) {
  1539. if (!is.empty(e)) {
  1540. if (_n2)
  1541. try {
  1542. window.localStorage.setItem(
  1543. 'cache-'.concat(t),
  1544. JSON.stringify({ content: e })
  1545. )
  1546. } catch (e) {}
  1547. r(a, e)
  1548. }
  1549. })
  1550. .catch(function () {})
  1551. }
  1552. }
  1553. var getHours = function getHours(e) {
  1554. return Math.trunc((e / 60 / 60) % 60, 10)
  1555. },
  1556. getSeconds = function getSeconds(e) {
  1557. return Math.trunc(e % 60, 10)
  1558. }
  1559. function _formatTime() {
  1560. var e =
  1561. arguments.length > 0 && arguments[0] !== undefined
  1562. ? arguments[0]
  1563. : 0
  1564. var t =
  1565. arguments.length > 1 && arguments[1] !== undefined
  1566. ? arguments[1]
  1567. : !1
  1568. var i =
  1569. arguments.length > 2 && arguments[2] !== undefined
  1570. ? arguments[2]
  1571. : !1
  1572. if (!is.number(e)) return _formatTime(void 0, t, i)
  1573. var s = function s(e) {
  1574. return '0'.concat(e).slice(-2)
  1575. }
  1576. var n = getHours(e)
  1577. var r = ((a = e), Math.trunc((a / 60) % 60, 10))
  1578. var a
  1579. var o = getSeconds(e)
  1580. return (
  1581. (n = t || n > 0 ? ''.concat(n, ':') : ''),
  1582. ''
  1583. .concat(i && e > 0 ? '-' : '')
  1584. .concat(n)
  1585. .concat(s(r), ':')
  1586. .concat(s(o))
  1587. )
  1588. }
  1589. var controls = {
  1590. getIconUrl: function getIconUrl() {
  1591. var e = new URL(this.config.iconUrl, window.location),
  1592. t = window.location.host
  1593. ? window.location.host
  1594. : window.top.location.host,
  1595. i = e.host !== t || (browser.isIE && !window.svg4everybody)
  1596. return { url: this.config.iconUrl, cors: i }
  1597. },
  1598. findElements: function findElements() {
  1599. try {
  1600. return (
  1601. (this.elements.controls = getElement.call(
  1602. this,
  1603. this.config.selectors.controls.wrapper
  1604. )),
  1605. (this.elements.buttons = {
  1606. play: getElements.call(
  1607. this,
  1608. this.config.selectors.buttons.play
  1609. ),
  1610. pause: getElement.call(
  1611. this,
  1612. this.config.selectors.buttons.pause
  1613. ),
  1614. restart: getElement.call(
  1615. this,
  1616. this.config.selectors.buttons.restart
  1617. ),
  1618. rewind: getElement.call(
  1619. this,
  1620. this.config.selectors.buttons.rewind
  1621. ),
  1622. fastForward: getElement.call(
  1623. this,
  1624. this.config.selectors.buttons.fastForward
  1625. ),
  1626. mute: getElement.call(
  1627. this,
  1628. this.config.selectors.buttons.mute
  1629. ),
  1630. pip: getElement.call(
  1631. this,
  1632. this.config.selectors.buttons.pip
  1633. ),
  1634. airplay: getElement.call(
  1635. this,
  1636. this.config.selectors.buttons.airplay
  1637. ),
  1638. settings: getElement.call(
  1639. this,
  1640. this.config.selectors.buttons.settings
  1641. ),
  1642. captions: getElement.call(
  1643. this,
  1644. this.config.selectors.buttons.captions
  1645. ),
  1646. fullscreen: getElement.call(
  1647. this,
  1648. this.config.selectors.buttons.fullscreen
  1649. )
  1650. }),
  1651. (this.elements.progress = getElement.call(
  1652. this,
  1653. this.config.selectors.progress
  1654. )),
  1655. (this.elements.inputs = {
  1656. seek: getElement.call(
  1657. this,
  1658. this.config.selectors.inputs.seek
  1659. ),
  1660. volume: getElement.call(
  1661. this,
  1662. this.config.selectors.inputs.volume
  1663. )
  1664. }),
  1665. (this.elements.display = {
  1666. buffer: getElement.call(
  1667. this,
  1668. this.config.selectors.display.buffer
  1669. ),
  1670. currentTime: getElement.call(
  1671. this,
  1672. this.config.selectors.display.currentTime
  1673. ),
  1674. duration: getElement.call(
  1675. this,
  1676. this.config.selectors.display.duration
  1677. )
  1678. }),
  1679. is.element(this.elements.progress) &&
  1680. (this.elements.display.seekTooltip =
  1681. this.elements.progress.querySelector(
  1682. '.'.concat(this.config.classNames.tooltip)
  1683. )),
  1684. !0
  1685. )
  1686. } catch (e) {
  1687. return (
  1688. this.debug.warn(
  1689. 'It looks like there is a problem with your custom controls HTML',
  1690. e
  1691. ),
  1692. this.toggleNativeControls(!0),
  1693. !1
  1694. )
  1695. }
  1696. },
  1697. createIcon: function createIcon(e, t) {
  1698. var i = 'http://www.w3.org/2000/svg',
  1699. s = controls.getIconUrl.call(this),
  1700. n = ''
  1701. .concat(s.cors ? '' : s.url, '#')
  1702. .concat(this.config.iconPrefix),
  1703. r = document.createElementNS(i, 'svg')
  1704. setAttributes(
  1705. r,
  1706. extend(t, { 'aria-hidden': 'true', focusable: 'false' })
  1707. )
  1708. var a = document.createElementNS(i, 'use'),
  1709. o = ''.concat(n, '-').concat(e)
  1710. return (
  1711. 'href' in a &&
  1712. a.setAttributeNS('http://www.w3.org/1999/xlink', 'href', o),
  1713. a.setAttributeNS(
  1714. 'http://www.w3.org/1999/xlink',
  1715. 'xlink:href',
  1716. o
  1717. ),
  1718. r.appendChild(a),
  1719. r
  1720. )
  1721. },
  1722. createLabel: function createLabel(e) {
  1723. var t =
  1724. arguments.length > 1 && arguments[1] !== undefined
  1725. ? arguments[1]
  1726. : {}
  1727. var i = i18n.get(e, this.config)
  1728. return createElement(
  1729. 'span',
  1730. _objectSpread(
  1731. _objectSpread({}, t),
  1732. {},
  1733. {
  1734. class: [t.class, this.config.classNames.hidden]
  1735. .filter(Boolean)
  1736. .join(' ')
  1737. }
  1738. ),
  1739. i
  1740. )
  1741. },
  1742. createBadge: function createBadge(e) {
  1743. if (is.empty(e)) return null
  1744. var t = createElement('span', {
  1745. class: this.config.classNames.menu.value
  1746. })
  1747. return (
  1748. t.appendChild(
  1749. createElement(
  1750. 'span',
  1751. { class: this.config.classNames.menu.badge },
  1752. e
  1753. )
  1754. ),
  1755. t
  1756. )
  1757. },
  1758. createButton: function createButton(e, t) {
  1759. var _this7 = this
  1760. var i = extend({}, t)
  1761. var s = toCamelCase(e)
  1762. var n = {
  1763. element: 'button',
  1764. toggle: !1,
  1765. label: null,
  1766. icon: null,
  1767. labelPressed: null,
  1768. iconPressed: null
  1769. }
  1770. switch (
  1771. (['element', 'icon', 'label'].forEach(function (e) {
  1772. Object.keys(i).includes(e) && ((n[e] = i[e]), delete i[e])
  1773. }),
  1774. 'button' !== n.element ||
  1775. Object.keys(i).includes('type') ||
  1776. (i.type = 'button'),
  1777. Object.keys(i).includes('class')
  1778. ? i.class.split(' ').some(function (e) {
  1779. return e === _this7.config.classNames.control
  1780. }) ||
  1781. extend(i, {
  1782. class: ''
  1783. .concat(i.class, ' ')
  1784. .concat(this.config.classNames.control)
  1785. })
  1786. : (i.class = this.config.classNames.control),
  1787. e)
  1788. ) {
  1789. case 'play':
  1790. ;(n.toggle = !0),
  1791. (n.label = 'play'),
  1792. (n.labelPressed = 'pause'),
  1793. (n.icon = 'play'),
  1794. (n.iconPressed = 'pause')
  1795. break
  1796. case 'mute':
  1797. ;(n.toggle = !0),
  1798. (n.label = 'mute'),
  1799. (n.labelPressed = 'unmute'),
  1800. (n.icon = 'volume'),
  1801. (n.iconPressed = 'muted')
  1802. break
  1803. case 'captions':
  1804. ;(n.toggle = !0),
  1805. (n.label = 'enableCaptions'),
  1806. (n.labelPressed = 'disableCaptions'),
  1807. (n.icon = 'captions-off'),
  1808. (n.iconPressed = 'captions-on')
  1809. break
  1810. case 'fullscreen':
  1811. ;(n.toggle = !0),
  1812. (n.label = 'enterFullscreen'),
  1813. (n.labelPressed = 'exitFullscreen'),
  1814. (n.icon = 'enter-fullscreen'),
  1815. (n.iconPressed = 'exit-fullscreen')
  1816. break
  1817. case 'play-large':
  1818. ;(i.class += ' '.concat(
  1819. this.config.classNames.control,
  1820. '--overlaid'
  1821. )),
  1822. (s = 'play'),
  1823. (n.label = 'play'),
  1824. (n.icon = 'play')
  1825. break
  1826. default:
  1827. is.empty(n.label) && (n.label = s),
  1828. is.empty(n.icon) && (n.icon = e)
  1829. }
  1830. var r = createElement(n.element)
  1831. return (
  1832. n.toggle
  1833. ? (r.appendChild(
  1834. controls.createIcon.call(this, n.iconPressed, {
  1835. class: 'icon--pressed'
  1836. })
  1837. ),
  1838. r.appendChild(
  1839. controls.createIcon.call(this, n.icon, {
  1840. class: 'icon--not-pressed'
  1841. })
  1842. ),
  1843. r.appendChild(
  1844. controls.createLabel.call(this, n.labelPressed, {
  1845. class: 'label--pressed'
  1846. })
  1847. ),
  1848. r.appendChild(
  1849. controls.createLabel.call(this, n.label, {
  1850. class: 'label--not-pressed'
  1851. })
  1852. ))
  1853. : (r.appendChild(controls.createIcon.call(this, n.icon)),
  1854. r.appendChild(controls.createLabel.call(this, n.label))),
  1855. extend(
  1856. i,
  1857. getAttributesFromSelector(this.config.selectors.buttons[s], i)
  1858. ),
  1859. setAttributes(r, i),
  1860. 'play' === s
  1861. ? (is.array(this.elements.buttons[s]) ||
  1862. (this.elements.buttons[s] = []),
  1863. this.elements.buttons[s].push(r))
  1864. : (this.elements.buttons[s] = r),
  1865. r
  1866. )
  1867. },
  1868. createRange: function createRange(e, t) {
  1869. var i = createElement(
  1870. 'input',
  1871. extend(
  1872. getAttributesFromSelector(this.config.selectors.inputs[e]),
  1873. {
  1874. type: 'range',
  1875. min: 0,
  1876. max: 100,
  1877. step: 0.01,
  1878. value: 0,
  1879. autocomplete: 'off',
  1880. role: 'slider',
  1881. 'aria-label': i18n.get(e, this.config),
  1882. 'aria-valuemin': 0,
  1883. 'aria-valuemax': 100,
  1884. 'aria-valuenow': 0
  1885. },
  1886. t
  1887. )
  1888. )
  1889. return (
  1890. (this.elements.inputs[e] = i),
  1891. controls.updateRangeFill.call(this, i),
  1892. RangeTouch.setup(i),
  1893. i
  1894. )
  1895. },
  1896. createProgress: function createProgress(e, t) {
  1897. var i = createElement(
  1898. 'progress',
  1899. extend(
  1900. getAttributesFromSelector(this.config.selectors.display[e]),
  1901. {
  1902. min: 0,
  1903. max: 100,
  1904. value: 0,
  1905. role: 'progressbar',
  1906. 'aria-hidden': !0
  1907. },
  1908. t
  1909. )
  1910. )
  1911. if ('volume' !== e) {
  1912. i.appendChild(createElement('span', null, '0'))
  1913. var _t3 = { played: 'played', buffer: 'buffered' }[e],
  1914. s = _t3 ? i18n.get(_t3, this.config) : ''
  1915. i.innerText = '% '.concat(s.toLowerCase())
  1916. }
  1917. return (this.elements.display[e] = i), i
  1918. },
  1919. createTime: function createTime(e, t) {
  1920. var i = getAttributesFromSelector(
  1921. this.config.selectors.display[e],
  1922. t
  1923. ),
  1924. s = createElement(
  1925. 'div',
  1926. extend(i, {
  1927. class: ''
  1928. .concat(i.class ? i.class : '', ' ')
  1929. .concat(this.config.classNames.display.time, ' ')
  1930. .trim(),
  1931. 'aria-label': i18n.get(e, this.config)
  1932. }),
  1933. '00:00'
  1934. )
  1935. return (this.elements.display[e] = s), s
  1936. },
  1937. bindMenuItemShortcuts: function bindMenuItemShortcuts(e, t) {
  1938. var _this8 = this
  1939. on.call(
  1940. this,
  1941. e,
  1942. 'keydown keyup',
  1943. function (i) {
  1944. if (
  1945. !['Space', 'ArrowUp', 'ArrowDown', 'ArrowRight'].includes(
  1946. i.key
  1947. )
  1948. )
  1949. return
  1950. if (
  1951. (i.preventDefault(),
  1952. i.stopPropagation(),
  1953. 'keydown' === i.type)
  1954. )
  1955. return
  1956. var s = matches(e, '[role="menuitemradio"]')
  1957. if (!s && ['Space', 'ArrowRight'].includes(i.key))
  1958. controls.showMenuPanel.call(_this8, t, !0)
  1959. else {
  1960. var _t4
  1961. 'Space' !== i.key &&
  1962. ('ArrowDown' === i.key || (s && 'ArrowRight' === i.key)
  1963. ? ((_t4 = e.nextElementSibling),
  1964. is.element(_t4) ||
  1965. (_t4 = e.parentNode.firstElementChild))
  1966. : ((_t4 = e.previousElementSibling),
  1967. is.element(_t4) ||
  1968. (_t4 = e.parentNode.lastElementChild)),
  1969. setFocus.call(_this8, _t4, !0))
  1970. }
  1971. },
  1972. !1
  1973. ),
  1974. on.call(this, e, 'keyup', function (e) {
  1975. 'Return' === e.key &&
  1976. controls.focusFirstMenuItem.call(_this8, null, !0)
  1977. })
  1978. },
  1979. createMenuItem: function createMenuItem(_ref9) {
  1980. var _this9 = this
  1981. var e = _ref9.value,
  1982. t = _ref9.list,
  1983. i = _ref9.type,
  1984. s = _ref9.title,
  1985. _ref9$badge = _ref9.badge,
  1986. n = _ref9$badge === void 0 ? null : _ref9$badge,
  1987. _ref9$checked = _ref9.checked,
  1988. r = _ref9$checked === void 0 ? !1 : _ref9$checked
  1989. var a = getAttributesFromSelector(
  1990. this.config.selectors.inputs[i]
  1991. ),
  1992. o = createElement(
  1993. 'button',
  1994. extend(a, {
  1995. type: 'button',
  1996. role: 'menuitemradio',
  1997. class: ''
  1998. .concat(this.config.classNames.control, ' ')
  1999. .concat(a.class ? a.class : '')
  2000. .trim(),
  2001. 'aria-checked': r,
  2002. value: e
  2003. })
  2004. ),
  2005. l = createElement('span')
  2006. ;(l.innerHTML = s),
  2007. is.element(n) && l.appendChild(n),
  2008. o.appendChild(l),
  2009. Object.defineProperty(o, 'checked', {
  2010. enumerable: !0,
  2011. get: function get() {
  2012. return 'true' === o.getAttribute('aria-checked')
  2013. },
  2014. set: function set(e) {
  2015. e &&
  2016. Array.from(o.parentNode.children)
  2017. .filter(function (e) {
  2018. return matches(e, '[role="menuitemradio"]')
  2019. })
  2020. .forEach(function (e) {
  2021. return e.setAttribute('aria-checked', 'false')
  2022. }),
  2023. o.setAttribute('aria-checked', e ? 'true' : 'false')
  2024. }
  2025. }),
  2026. this.listeners.bind(
  2027. o,
  2028. 'click keyup',
  2029. function (t) {
  2030. if (!is.keyboardEvent(t) || 'Space' === t.key) {
  2031. switch (
  2032. (t.preventDefault(),
  2033. t.stopPropagation(),
  2034. (o.checked = !0),
  2035. i)
  2036. ) {
  2037. case 'language':
  2038. _this9.currentTrack = Number(e)
  2039. break
  2040. case 'quality':
  2041. _this9.quality = e
  2042. break
  2043. case 'speed':
  2044. _this9.speed = parseFloat(e)
  2045. }
  2046. controls.showMenuPanel.call(
  2047. _this9,
  2048. 'home',
  2049. is.keyboardEvent(t)
  2050. )
  2051. }
  2052. },
  2053. i,
  2054. !1
  2055. ),
  2056. controls.bindMenuItemShortcuts.call(this, o, i),
  2057. t.appendChild(o)
  2058. },
  2059. formatTime: function formatTime() {
  2060. var e =
  2061. arguments.length > 0 && arguments[0] !== undefined
  2062. ? arguments[0]
  2063. : 0
  2064. var t =
  2065. arguments.length > 1 && arguments[1] !== undefined
  2066. ? arguments[1]
  2067. : !1
  2068. if (!is.number(e)) return e
  2069. return _formatTime(e, getHours(this.duration) > 0, t)
  2070. },
  2071. updateTimeDisplay: function updateTimeDisplay() {
  2072. var e =
  2073. arguments.length > 0 && arguments[0] !== undefined
  2074. ? arguments[0]
  2075. : null
  2076. var t =
  2077. arguments.length > 1 && arguments[1] !== undefined
  2078. ? arguments[1]
  2079. : 0
  2080. var i =
  2081. arguments.length > 2 && arguments[2] !== undefined
  2082. ? arguments[2]
  2083. : !1
  2084. is.element(e) &&
  2085. is.number(t) &&
  2086. (e.innerText = controls.formatTime(t, i))
  2087. },
  2088. updateVolume: function updateVolume() {
  2089. this.supported.ui &&
  2090. (is.element(this.elements.inputs.volume) &&
  2091. controls.setRange.call(
  2092. this,
  2093. this.elements.inputs.volume,
  2094. this.muted ? 0 : this.volume
  2095. ),
  2096. is.element(this.elements.buttons.mute) &&
  2097. (this.elements.buttons.mute.pressed =
  2098. this.muted || 0 === this.volume))
  2099. },
  2100. setRange: function setRange(e) {
  2101. var t =
  2102. arguments.length > 1 && arguments[1] !== undefined
  2103. ? arguments[1]
  2104. : 0
  2105. is.element(e) &&
  2106. ((e.value = t), controls.updateRangeFill.call(this, e))
  2107. },
  2108. updateProgress: function updateProgress(e) {
  2109. var _this10 = this
  2110. if (!this.supported.ui || !is.event(e)) return
  2111. var t = 0
  2112. var i = function i(e, t) {
  2113. var i = is.number(t) ? t : 0,
  2114. s = is.element(e) ? e : _this10.elements.display.buffer
  2115. if (is.element(s)) {
  2116. s.value = i
  2117. var _e6 = s.getElementsByTagName('span')[0]
  2118. is.element(_e6) && (_e6.childNodes[0].nodeValue = i)
  2119. }
  2120. }
  2121. if (e)
  2122. switch (e.type) {
  2123. case 'timeupdate':
  2124. case 'seeking':
  2125. case 'seeked':
  2126. ;(t = getPercentage(this.currentTime, this.duration)),
  2127. 'timeupdate' === e.type &&
  2128. controls.setRange.call(
  2129. this,
  2130. this.elements.inputs.seek,
  2131. t
  2132. )
  2133. break
  2134. case 'playing':
  2135. case 'progress':
  2136. i(this.elements.display.buffer, 100 * this.buffered)
  2137. }
  2138. },
  2139. updateRangeFill: function updateRangeFill(e) {
  2140. var t = is.event(e) ? e.target : e
  2141. if (is.element(t) && 'range' === t.getAttribute('type')) {
  2142. if (matches(t, this.config.selectors.inputs.seek)) {
  2143. t.setAttribute('aria-valuenow', this.currentTime)
  2144. var _e7 = controls.formatTime(this.currentTime),
  2145. i = controls.formatTime(this.duration),
  2146. s = i18n.get('seekLabel', this.config)
  2147. t.setAttribute(
  2148. 'aria-valuetext',
  2149. s.replace('{currentTime}', _e7).replace('{duration}', i)
  2150. )
  2151. } else if (matches(t, this.config.selectors.inputs.volume)) {
  2152. var _e8 = 100 * t.value
  2153. t.setAttribute('aria-valuenow', _e8),
  2154. t.setAttribute(
  2155. 'aria-valuetext',
  2156. ''.concat(_e8.toFixed(1), '%')
  2157. )
  2158. } else t.setAttribute('aria-valuenow', t.value)
  2159. browser.isWebkit &&
  2160. t.style.setProperty('--value', (t.value / t.max) * 100 + '%')
  2161. }
  2162. },
  2163. updateSeekTooltip: function updateSeekTooltip(e) {
  2164. var t, i
  2165. if (
  2166. !this.config.tooltips.seek ||
  2167. !is.element(this.elements.inputs.seek) ||
  2168. !is.element(this.elements.display.seekTooltip) ||
  2169. 0 === this.duration
  2170. )
  2171. return
  2172. var s = this.elements.display.seekTooltip,
  2173. n = ''.concat(this.config.classNames.tooltip, '--visible'),
  2174. r = function r(e) {
  2175. return toggleClass(s, n, e)
  2176. }
  2177. if (this.touch) return void r(!1)
  2178. var a = 0
  2179. var o = this.elements.progress.getBoundingClientRect()
  2180. if (is.event(e)) a = (100 / o.width) * (e.pageX - o.left)
  2181. else {
  2182. if (!hasClass(s, n)) return
  2183. a = parseFloat(s.style.left, 10)
  2184. }
  2185. a < 0 ? (a = 0) : a > 100 && (a = 100)
  2186. var l = (this.duration / 100) * a
  2187. s.innerText = controls.formatTime(l)
  2188. var c =
  2189. null === (t = this.config.markers) ||
  2190. void 0 === t ||
  2191. null === (i = t.points) ||
  2192. void 0 === i
  2193. ? void 0
  2194. : i.find(function (_ref10) {
  2195. var e = _ref10.time
  2196. return e === Math.round(l)
  2197. })
  2198. c &&
  2199. s.insertAdjacentHTML('afterbegin', ''.concat(c.label, '<br>')),
  2200. (s.style.left = ''.concat(a, '%')),
  2201. is.event(e) &&
  2202. ['mouseenter', 'mouseleave'].includes(e.type) &&
  2203. r('mouseenter' === e.type)
  2204. },
  2205. timeUpdate: function timeUpdate(e) {
  2206. var t =
  2207. !is.element(this.elements.display.duration) &&
  2208. this.config.invertTime
  2209. controls.updateTimeDisplay.call(
  2210. this,
  2211. this.elements.display.currentTime,
  2212. t ? this.duration - this.currentTime : this.currentTime,
  2213. t
  2214. ),
  2215. (e && 'timeupdate' === e.type && this.media.seeking) ||
  2216. controls.updateProgress.call(this, e)
  2217. },
  2218. durationUpdate: function durationUpdate() {
  2219. if (
  2220. !this.supported.ui ||
  2221. (!this.config.invertTime && this.currentTime)
  2222. )
  2223. return
  2224. if (this.duration >= Math.pow(2, 32))
  2225. return (
  2226. toggleHidden(this.elements.display.currentTime, !0),
  2227. void toggleHidden(this.elements.progress, !0)
  2228. )
  2229. is.element(this.elements.inputs.seek) &&
  2230. this.elements.inputs.seek.setAttribute(
  2231. 'aria-valuemax',
  2232. this.duration
  2233. )
  2234. var e = is.element(this.elements.display.duration)
  2235. !e &&
  2236. this.config.displayDuration &&
  2237. this.paused &&
  2238. controls.updateTimeDisplay.call(
  2239. this,
  2240. this.elements.display.currentTime,
  2241. this.duration
  2242. ),
  2243. e &&
  2244. controls.updateTimeDisplay.call(
  2245. this,
  2246. this.elements.display.duration,
  2247. this.duration
  2248. ),
  2249. this.config.markers.enabled && controls.setMarkers.call(this),
  2250. controls.updateSeekTooltip.call(this)
  2251. },
  2252. toggleMenuButton: function toggleMenuButton(e, t) {
  2253. toggleHidden(this.elements.settings.buttons[e], !t)
  2254. },
  2255. updateSetting: function updateSetting(e, t, i) {
  2256. var s = this.elements.settings.panels[e]
  2257. var n = null,
  2258. r = t
  2259. if ('captions' === e) n = this.currentTrack
  2260. else {
  2261. if (
  2262. ((n = is.empty(i) ? this[e] : i),
  2263. is.empty(n) && (n = this.config[e].default),
  2264. !is.empty(this.options[e]) && !this.options[e].includes(n))
  2265. )
  2266. return void this.debug.warn(
  2267. "Unsupported value of '".concat(n, "' for ").concat(e)
  2268. )
  2269. if (!this.config[e].options.includes(n))
  2270. return void this.debug.warn(
  2271. "Disabled value of '".concat(n, "' for ").concat(e)
  2272. )
  2273. }
  2274. if (
  2275. (is.element(r) || (r = s && s.querySelector('[role="menu"]')),
  2276. !is.element(r))
  2277. )
  2278. return
  2279. this.elements.settings.buttons[e].querySelector(
  2280. '.'.concat(this.config.classNames.menu.value)
  2281. ).innerHTML = controls.getLabel.call(this, e, n)
  2282. var a = r && r.querySelector('[value="'.concat(n, '"]'))
  2283. is.element(a) && (a.checked = !0)
  2284. },
  2285. getLabel: function getLabel(e, t) {
  2286. switch (e) {
  2287. case 'speed':
  2288. return 1 === t
  2289. ? i18n.get('normal', this.config)
  2290. : ''.concat(t, '&times;')
  2291. case 'quality':
  2292. if (is.number(t)) {
  2293. var _e9 = i18n.get('qualityLabel.'.concat(t), this.config)
  2294. return _e9.length ? _e9 : ''.concat(t, 'p')
  2295. }
  2296. return toTitleCase(t)
  2297. case 'captions':
  2298. return captions.getLabel.call(this)
  2299. default:
  2300. return null
  2301. }
  2302. },
  2303. setQualityMenu: function setQualityMenu(e) {
  2304. var _this11 = this
  2305. if (!is.element(this.elements.settings.panels.quality)) return
  2306. var t = 'quality',
  2307. i =
  2308. this.elements.settings.panels.quality.querySelector(
  2309. '[role="menu"]'
  2310. )
  2311. is.array(e) &&
  2312. (this.options.quality = dedupe(e).filter(function (e) {
  2313. return _this11.config.quality.options.includes(e)
  2314. }))
  2315. var s =
  2316. !is.empty(this.options.quality) &&
  2317. this.options.quality.length > 1
  2318. if (
  2319. (controls.toggleMenuButton.call(this, t, s),
  2320. emptyElement(i),
  2321. controls.checkMenu.call(this),
  2322. !s)
  2323. )
  2324. return
  2325. var n = function n(e) {
  2326. var t = i18n.get('qualityBadge.'.concat(e), _this11.config)
  2327. return t.length ? controls.createBadge.call(_this11, t) : null
  2328. }
  2329. this.options.quality
  2330. .sort(function (e, t) {
  2331. var i = _this11.config.quality.options
  2332. return i.indexOf(e) > i.indexOf(t) ? 1 : -1
  2333. })
  2334. .forEach(function (e) {
  2335. controls.createMenuItem.call(_this11, {
  2336. value: e,
  2337. list: i,
  2338. type: t,
  2339. title: controls.getLabel.call(_this11, 'quality', e),
  2340. badge: n(e)
  2341. })
  2342. }),
  2343. controls.updateSetting.call(this, t, i)
  2344. },
  2345. setCaptionsMenu: function setCaptionsMenu() {
  2346. var _this12 = this
  2347. if (!is.element(this.elements.settings.panels.captions)) return
  2348. var e = 'captions',
  2349. t =
  2350. this.elements.settings.panels.captions.querySelector(
  2351. '[role="menu"]'
  2352. ),
  2353. i = captions.getTracks.call(this),
  2354. s = Boolean(i.length)
  2355. if (
  2356. (controls.toggleMenuButton.call(this, e, s),
  2357. emptyElement(t),
  2358. controls.checkMenu.call(this),
  2359. !s)
  2360. )
  2361. return
  2362. var n = i.map(function (e, i) {
  2363. return {
  2364. value: i,
  2365. checked:
  2366. _this12.captions.toggled && _this12.currentTrack === i,
  2367. title: captions.getLabel.call(_this12, e),
  2368. badge:
  2369. e.language &&
  2370. controls.createBadge.call(
  2371. _this12,
  2372. e.language.toUpperCase()
  2373. ),
  2374. list: t,
  2375. type: 'language'
  2376. }
  2377. })
  2378. n.unshift({
  2379. value: -1,
  2380. checked: !this.captions.toggled,
  2381. title: i18n.get('disabled', this.config),
  2382. list: t,
  2383. type: 'language'
  2384. }),
  2385. n.forEach(controls.createMenuItem.bind(this)),
  2386. controls.updateSetting.call(this, e, t)
  2387. },
  2388. setSpeedMenu: function setSpeedMenu() {
  2389. var _this13 = this
  2390. if (!is.element(this.elements.settings.panels.speed)) return
  2391. var e = 'speed',
  2392. t =
  2393. this.elements.settings.panels.speed.querySelector(
  2394. '[role="menu"]'
  2395. )
  2396. this.options.speed = this.options.speed.filter(function (e) {
  2397. return e >= _this13.minimumSpeed && e <= _this13.maximumSpeed
  2398. })
  2399. var i =
  2400. !is.empty(this.options.speed) && this.options.speed.length > 1
  2401. controls.toggleMenuButton.call(this, e, i),
  2402. emptyElement(t),
  2403. controls.checkMenu.call(this),
  2404. i &&
  2405. (this.options.speed.forEach(function (i) {
  2406. controls.createMenuItem.call(_this13, {
  2407. value: i,
  2408. list: t,
  2409. type: e,
  2410. title: controls.getLabel.call(_this13, 'speed', i)
  2411. })
  2412. }),
  2413. controls.updateSetting.call(this, e, t))
  2414. },
  2415. checkMenu: function checkMenu() {
  2416. var e = this.elements.settings.buttons,
  2417. t =
  2418. !is.empty(e) &&
  2419. Object.values(e).some(function (e) {
  2420. return !e.hidden
  2421. })
  2422. toggleHidden(this.elements.settings.menu, !t)
  2423. },
  2424. focusFirstMenuItem: function focusFirstMenuItem(e) {
  2425. var t =
  2426. arguments.length > 1 && arguments[1] !== undefined
  2427. ? arguments[1]
  2428. : !1
  2429. if (this.elements.settings.popup.hidden) return
  2430. var i = e
  2431. is.element(i) ||
  2432. (i = Object.values(this.elements.settings.panels).find(
  2433. function (e) {
  2434. return !e.hidden
  2435. }
  2436. ))
  2437. var s = i.querySelector('[role^="menuitem"]')
  2438. setFocus.call(this, s, t)
  2439. },
  2440. toggleMenu: function toggleMenu(e) {
  2441. var t = this.elements.settings.popup,
  2442. i = this.elements.buttons.settings
  2443. if (!is.element(t) || !is.element(i)) return
  2444. var s = t.hidden
  2445. var n = s
  2446. if (is.boolean(e)) n = e
  2447. else if (is.keyboardEvent(e) && 'Escape' === e.key) n = !1
  2448. else if (is.event(e)) {
  2449. var _s3 = is.function(e.composedPath)
  2450. ? e.composedPath()[0]
  2451. : e.target,
  2452. r = t.contains(_s3)
  2453. if (r || (!r && e.target !== i && n)) return
  2454. }
  2455. i.setAttribute('aria-expanded', n),
  2456. toggleHidden(t, !n),
  2457. toggleClass(
  2458. this.elements.container,
  2459. this.config.classNames.menu.open,
  2460. n
  2461. ),
  2462. n && is.keyboardEvent(e)
  2463. ? controls.focusFirstMenuItem.call(this, null, !0)
  2464. : n || s || setFocus.call(this, i, is.keyboardEvent(e))
  2465. },
  2466. getMenuSize: function getMenuSize(e) {
  2467. var t = e.cloneNode(!0)
  2468. ;(t.style.position = 'absolute'),
  2469. (t.style.opacity = 0),
  2470. t.removeAttribute('hidden'),
  2471. e.parentNode.appendChild(t)
  2472. var i = t.scrollWidth,
  2473. s = t.scrollHeight
  2474. return removeElement(t), { width: i, height: s }
  2475. },
  2476. showMenuPanel: function showMenuPanel() {
  2477. var _this14 = this
  2478. var e =
  2479. arguments.length > 0 && arguments[0] !== undefined
  2480. ? arguments[0]
  2481. : ''
  2482. var t =
  2483. arguments.length > 1 && arguments[1] !== undefined
  2484. ? arguments[1]
  2485. : !1
  2486. var i = this.elements.container.querySelector(
  2487. '#plyr-settings-'.concat(this.id, '-').concat(e)
  2488. )
  2489. if (!is.element(i)) return
  2490. var s = i.parentNode,
  2491. n = Array.from(s.children).find(function (e) {
  2492. return !e.hidden
  2493. })
  2494. if (support.transitions && !support.reducedMotion) {
  2495. ;(s.style.width = ''.concat(n.scrollWidth, 'px')),
  2496. (s.style.height = ''.concat(n.scrollHeight, 'px'))
  2497. var _e10 = controls.getMenuSize.call(this, i),
  2498. _t5 = function _t5(e) {
  2499. e.target === s &&
  2500. ['width', 'height'].includes(e.propertyName) &&
  2501. ((s.style.width = ''),
  2502. (s.style.height = ''),
  2503. off.call(_this14, s, transitionEndEvent, _t5))
  2504. }
  2505. on.call(this, s, transitionEndEvent, _t5),
  2506. (s.style.width = ''.concat(_e10.width, 'px')),
  2507. (s.style.height = ''.concat(_e10.height, 'px'))
  2508. }
  2509. toggleHidden(n, !0),
  2510. toggleHidden(i, !1),
  2511. controls.focusFirstMenuItem.call(this, i, t)
  2512. },
  2513. setDownloadUrl: function setDownloadUrl() {
  2514. var e = this.elements.buttons.download
  2515. is.element(e) && e.setAttribute('href', this.download)
  2516. },
  2517. create: function create(e) {
  2518. var _this15 = this
  2519. var t = controls.bindMenuItemShortcuts,
  2520. i = controls.createButton,
  2521. s = controls.createProgress,
  2522. n = controls.createRange,
  2523. r = controls.createTime,
  2524. a = controls.setQualityMenu,
  2525. o = controls.setSpeedMenu,
  2526. l = controls.showMenuPanel
  2527. ;(this.elements.controls = null),
  2528. is.array(this.config.controls) &&
  2529. this.config.controls.includes('play-large') &&
  2530. this.elements.container.appendChild(
  2531. i.call(this, 'play-large')
  2532. )
  2533. var c = createElement(
  2534. 'div',
  2535. getAttributesFromSelector(
  2536. this.config.selectors.controls.wrapper
  2537. )
  2538. )
  2539. this.elements.controls = c
  2540. var u = { class: 'plyr__controls__item' }
  2541. return (
  2542. dedupe(
  2543. is.array(this.config.controls) ? this.config.controls : []
  2544. ).forEach(function (a) {
  2545. if (
  2546. ('restart' === a &&
  2547. c.appendChild(i.call(_this15, 'restart', u)),
  2548. 'rewind' === a &&
  2549. c.appendChild(i.call(_this15, 'rewind', u)),
  2550. 'play' === a && c.appendChild(i.call(_this15, 'play', u)),
  2551. 'fast-forward' === a &&
  2552. c.appendChild(i.call(_this15, 'fast-forward', u)),
  2553. 'progress' === a)
  2554. ) {
  2555. var _t6 = createElement('div', {
  2556. class: ''.concat(u.class, ' plyr__progress__container')
  2557. }),
  2558. _i3 = createElement(
  2559. 'div',
  2560. getAttributesFromSelector(
  2561. _this15.config.selectors.progress
  2562. )
  2563. )
  2564. if (
  2565. (_i3.appendChild(
  2566. n.call(_this15, 'seek', {
  2567. id: 'plyr-seek-'.concat(e.id)
  2568. })
  2569. ),
  2570. _i3.appendChild(s.call(_this15, 'buffer')),
  2571. _this15.config.tooltips.seek)
  2572. ) {
  2573. var _e11 = createElement(
  2574. 'span',
  2575. { class: _this15.config.classNames.tooltip },
  2576. '00:00'
  2577. )
  2578. _i3.appendChild(_e11),
  2579. (_this15.elements.display.seekTooltip = _e11)
  2580. }
  2581. ;(_this15.elements.progress = _i3),
  2582. _t6.appendChild(_this15.elements.progress),
  2583. c.appendChild(_t6)
  2584. }
  2585. if (
  2586. ('current-time' === a &&
  2587. c.appendChild(r.call(_this15, 'currentTime', u)),
  2588. 'duration' === a &&
  2589. c.appendChild(r.call(_this15, 'duration', u)),
  2590. 'mute' === a || 'volume' === a)
  2591. ) {
  2592. var _t7 = _this15.elements.volume
  2593. if (
  2594. ((is.element(_t7) && c.contains(_t7)) ||
  2595. ((_t7 = createElement(
  2596. 'div',
  2597. extend({}, u, {
  2598. class: ''.concat(u.class, ' plyr__volume').trim()
  2599. })
  2600. )),
  2601. (_this15.elements.volume = _t7),
  2602. c.appendChild(_t7)),
  2603. 'mute' === a && _t7.appendChild(i.call(_this15, 'mute')),
  2604. 'volume' === a && !browser.isIos)
  2605. ) {
  2606. var _i4 = {
  2607. max: 1,
  2608. step: 0.05,
  2609. value: _this15.config.volume
  2610. }
  2611. _t7.appendChild(
  2612. n.call(
  2613. _this15,
  2614. 'volume',
  2615. extend(_i4, { id: 'plyr-volume-'.concat(e.id) })
  2616. )
  2617. )
  2618. }
  2619. }
  2620. if (
  2621. ('captions' === a &&
  2622. c.appendChild(i.call(_this15, 'captions', u)),
  2623. 'settings' === a && !is.empty(_this15.config.settings))
  2624. ) {
  2625. var _s4 = createElement(
  2626. 'div',
  2627. extend({}, u, {
  2628. class: ''.concat(u.class, ' plyr__menu').trim(),
  2629. hidden: ''
  2630. })
  2631. )
  2632. _s4.appendChild(
  2633. i.call(_this15, 'settings', {
  2634. 'aria-haspopup': !0,
  2635. 'aria-controls': 'plyr-settings-'.concat(e.id),
  2636. 'aria-expanded': !1
  2637. })
  2638. )
  2639. var _n3 = createElement('div', {
  2640. class: 'plyr__menu__container',
  2641. id: 'plyr-settings-'.concat(e.id),
  2642. hidden: ''
  2643. }),
  2644. _r2 = createElement('div'),
  2645. _a = createElement('div', {
  2646. id: 'plyr-settings-'.concat(e.id, '-home')
  2647. }),
  2648. _o = createElement('div', { role: 'menu' })
  2649. _a.appendChild(_o),
  2650. _r2.appendChild(_a),
  2651. (_this15.elements.settings.panels.home = _a),
  2652. _this15.config.settings.forEach(function (i) {
  2653. var s = createElement(
  2654. 'button',
  2655. extend(
  2656. getAttributesFromSelector(
  2657. _this15.config.selectors.buttons.settings
  2658. ),
  2659. {
  2660. type: 'button',
  2661. class: ''
  2662. .concat(_this15.config.classNames.control, ' ')
  2663. .concat(
  2664. _this15.config.classNames.control,
  2665. '--forward'
  2666. ),
  2667. role: 'menuitem',
  2668. 'aria-haspopup': !0,
  2669. hidden: ''
  2670. }
  2671. )
  2672. )
  2673. t.call(_this15, s, i),
  2674. on.call(_this15, s, 'click', function () {
  2675. l.call(_this15, i, !1)
  2676. })
  2677. var n = createElement(
  2678. 'span',
  2679. null,
  2680. i18n.get(i, _this15.config)
  2681. ),
  2682. a = createElement('span', {
  2683. class: _this15.config.classNames.menu.value
  2684. })
  2685. ;(a.innerHTML = e[i]),
  2686. n.appendChild(a),
  2687. s.appendChild(n),
  2688. _o.appendChild(s)
  2689. var c = createElement('div', {
  2690. id: 'plyr-settings-'.concat(e.id, '-').concat(i),
  2691. hidden: ''
  2692. }),
  2693. u = createElement('button', {
  2694. type: 'button',
  2695. class: ''
  2696. .concat(_this15.config.classNames.control, ' ')
  2697. .concat(
  2698. _this15.config.classNames.control,
  2699. '--back'
  2700. )
  2701. })
  2702. u.appendChild(
  2703. createElement(
  2704. 'span',
  2705. { 'aria-hidden': !0 },
  2706. i18n.get(i, _this15.config)
  2707. )
  2708. ),
  2709. u.appendChild(
  2710. createElement(
  2711. 'span',
  2712. { class: _this15.config.classNames.hidden },
  2713. i18n.get('menuBack', _this15.config)
  2714. )
  2715. ),
  2716. on.call(
  2717. _this15,
  2718. c,
  2719. 'keydown',
  2720. function (e) {
  2721. 'ArrowLeft' === e.key &&
  2722. (e.preventDefault(),
  2723. e.stopPropagation(),
  2724. l.call(_this15, 'home', !0))
  2725. },
  2726. !1
  2727. ),
  2728. on.call(_this15, u, 'click', function () {
  2729. l.call(_this15, 'home', !1)
  2730. }),
  2731. c.appendChild(u),
  2732. c.appendChild(createElement('div', { role: 'menu' })),
  2733. _r2.appendChild(c),
  2734. (_this15.elements.settings.buttons[i] = s),
  2735. (_this15.elements.settings.panels[i] = c)
  2736. }),
  2737. _n3.appendChild(_r2),
  2738. _s4.appendChild(_n3),
  2739. c.appendChild(_s4),
  2740. (_this15.elements.settings.popup = _n3),
  2741. (_this15.elements.settings.menu = _s4)
  2742. }
  2743. if (
  2744. ('pip' === a &&
  2745. support.pip &&
  2746. c.appendChild(i.call(_this15, 'pip', u)),
  2747. 'airplay' === a &&
  2748. support.airplay &&
  2749. c.appendChild(i.call(_this15, 'airplay', u)),
  2750. 'download' === a)
  2751. ) {
  2752. var _e12 = extend({}, u, {
  2753. element: 'a',
  2754. href: _this15.download,
  2755. target: '_blank'
  2756. })
  2757. _this15.isHTML5 && (_e12.download = '')
  2758. var _t8 = _this15.config.urls.download
  2759. !is.url(_t8) &&
  2760. _this15.isEmbed &&
  2761. extend(_e12, {
  2762. icon: 'logo-'.concat(_this15.provider),
  2763. label: _this15.provider
  2764. }),
  2765. c.appendChild(i.call(_this15, 'download', _e12))
  2766. }
  2767. 'fullscreen' === a &&
  2768. c.appendChild(i.call(_this15, 'fullscreen', u))
  2769. }),
  2770. this.isHTML5 &&
  2771. a.call(this, html5.getQualityOptions.call(this)),
  2772. o.call(this),
  2773. c
  2774. )
  2775. },
  2776. inject: function inject() {
  2777. var _this16 = this
  2778. if (this.config.loadSprite) {
  2779. var _e13 = controls.getIconUrl.call(this)
  2780. _e13.cors && _loadSprite(_e13.url, 'sprite-plyr')
  2781. }
  2782. this.id = Math.floor(1e4 * Math.random())
  2783. var e = null
  2784. this.elements.controls = null
  2785. var t = {
  2786. id: this.id,
  2787. seektime: this.config.seekTime,
  2788. title: this.config.title
  2789. }
  2790. var i = !0
  2791. is.function(this.config.controls) &&
  2792. (this.config.controls = this.config.controls.call(this, t)),
  2793. this.config.controls || (this.config.controls = []),
  2794. is.element(this.config.controls) ||
  2795. is.string(this.config.controls)
  2796. ? (e = this.config.controls)
  2797. : ((e = controls.create.call(this, {
  2798. id: this.id,
  2799. seektime: this.config.seekTime,
  2800. speed: this.speed,
  2801. quality: this.quality,
  2802. captions: captions.getLabel.call(this)
  2803. })),
  2804. (i = !1))
  2805. var s
  2806. i &&
  2807. is.string(this.config.controls) &&
  2808. (e = (function (e) {
  2809. var i = e
  2810. return (
  2811. Object.entries(t).forEach(function (_ref11) {
  2812. var _ref12 = _slicedToArray(_ref11, 2),
  2813. e = _ref12[0],
  2814. t = _ref12[1]
  2815. i = replaceAll(i, '{'.concat(e, '}'), t)
  2816. }),
  2817. i
  2818. )
  2819. })(e)),
  2820. is.string(this.config.selectors.controls.container) &&
  2821. (s = document.querySelector(
  2822. this.config.selectors.controls.container
  2823. )),
  2824. is.element(s) || (s = this.elements.container)
  2825. if (
  2826. (s[
  2827. is.element(e) ? 'insertAdjacentElement' : 'insertAdjacentHTML'
  2828. ]('afterbegin', e),
  2829. is.element(this.elements.controls) ||
  2830. controls.findElements.call(this),
  2831. !is.empty(this.elements.buttons))
  2832. ) {
  2833. var _e14 = function _e14(e) {
  2834. var t = _this16.config.classNames.controlPressed
  2835. Object.defineProperty(e, 'pressed', {
  2836. enumerable: !0,
  2837. get: function get() {
  2838. return hasClass(e, t)
  2839. },
  2840. set: function set() {
  2841. var i =
  2842. arguments.length > 0 && arguments[0] !== undefined
  2843. ? arguments[0]
  2844. : !1
  2845. toggleClass(e, t, i)
  2846. }
  2847. })
  2848. }
  2849. Object.values(this.elements.buttons)
  2850. .filter(Boolean)
  2851. .forEach(function (t) {
  2852. is.array(t) || is.nodeList(t)
  2853. ? Array.from(t).filter(Boolean).forEach(_e14)
  2854. : _e14(t)
  2855. })
  2856. }
  2857. if (
  2858. (browser.isEdge && repaint(s), this.config.tooltips.controls)
  2859. ) {
  2860. var _this$config = this.config,
  2861. _e15 = _this$config.classNames,
  2862. _t9 = _this$config.selectors,
  2863. _i5 = ''
  2864. .concat(_t9.controls.wrapper, ' ')
  2865. .concat(_t9.labels, ' .')
  2866. .concat(_e15.hidden),
  2867. _s5 = getElements.call(this, _i5)
  2868. Array.from(_s5).forEach(function (e) {
  2869. toggleClass(e, _this16.config.classNames.hidden, !1),
  2870. toggleClass(e, _this16.config.classNames.tooltip, !0)
  2871. })
  2872. }
  2873. },
  2874. setMediaMetadata: function setMediaMetadata() {
  2875. try {
  2876. 'mediaSession' in navigator &&
  2877. (navigator.mediaSession.metadata = new window.MediaMetadata({
  2878. title: this.config.mediaMetadata.title,
  2879. artist: this.config.mediaMetadata.artist,
  2880. album: this.config.mediaMetadata.album,
  2881. artwork: this.config.mediaMetadata.artwork
  2882. }))
  2883. } catch (e) {}
  2884. },
  2885. setMarkers: function setMarkers() {
  2886. var _this17 = this
  2887. var e, t
  2888. if (!this.duration || this.elements.markers) return
  2889. var i =
  2890. null === (e = this.config.markers) ||
  2891. void 0 === e ||
  2892. null === (t = e.points) ||
  2893. void 0 === t
  2894. ? void 0
  2895. : t.filter(function (_ref13) {
  2896. var e = _ref13.time
  2897. return e > 0 && e < _this17.duration
  2898. })
  2899. if (null == i || !i.length) return
  2900. var s = document.createDocumentFragment(),
  2901. n = document.createDocumentFragment()
  2902. var r = null
  2903. var a = ''.concat(this.config.classNames.tooltip, '--visible'),
  2904. o = function o(e) {
  2905. return toggleClass(r, a, e)
  2906. }
  2907. i.forEach(function (e) {
  2908. var t = createElement(
  2909. 'span',
  2910. { class: _this17.config.classNames.marker },
  2911. ''
  2912. ),
  2913. i = (e.time / _this17.duration) * 100 + '%'
  2914. r &&
  2915. (t.addEventListener('mouseenter', function () {
  2916. e.label ||
  2917. ((r.style.left = i), (r.innerHTML = e.label), o(!0))
  2918. }),
  2919. t.addEventListener('mouseleave', function () {
  2920. o(!1)
  2921. })),
  2922. t.addEventListener('click', function () {
  2923. _this17.currentTime = e.time
  2924. }),
  2925. (t.style.left = i),
  2926. n.appendChild(t)
  2927. }),
  2928. s.appendChild(n),
  2929. this.config.tooltips.seek ||
  2930. ((r = createElement(
  2931. 'span',
  2932. { class: this.config.classNames.tooltip },
  2933. ''
  2934. )),
  2935. s.appendChild(r)),
  2936. (this.elements.markers = { points: n, tip: r }),
  2937. this.elements.progress.appendChild(s)
  2938. }
  2939. }
  2940. function parseUrl(e) {
  2941. var t =
  2942. arguments.length > 1 && arguments[1] !== undefined
  2943. ? arguments[1]
  2944. : !0
  2945. var i = e
  2946. if (t) {
  2947. var _e16 = document.createElement('a')
  2948. ;(_e16.href = i), (i = _e16.href)
  2949. }
  2950. try {
  2951. return new URL(i)
  2952. } catch (e) {
  2953. return null
  2954. }
  2955. }
  2956. function buildUrlParams(e) {
  2957. var t = new URLSearchParams()
  2958. return (
  2959. is.object(e) &&
  2960. Object.entries(e).forEach(function (_ref14) {
  2961. var _ref15 = _slicedToArray(_ref14, 2),
  2962. e = _ref15[0],
  2963. i = _ref15[1]
  2964. t.set(e, i)
  2965. }),
  2966. t
  2967. )
  2968. }
  2969. var captions = {
  2970. setup: function setup() {
  2971. var _e18, _e19, _this$config$captions
  2972. if (!this.supported.ui) return
  2973. if (
  2974. !this.isVideo ||
  2975. this.isYouTube ||
  2976. (this.isHTML5 && !support.textTracks)
  2977. )
  2978. return void (
  2979. is.array(this.config.controls) &&
  2980. this.config.controls.includes('settings') &&
  2981. this.config.settings.includes('captions') &&
  2982. controls.setCaptionsMenu.call(this)
  2983. )
  2984. if (
  2985. (is.element(this.elements.captions) ||
  2986. ((this.elements.captions = createElement(
  2987. 'div',
  2988. getAttributesFromSelector(this.config.selectors.captions)
  2989. )),
  2990. insertAfter(this.elements.captions, this.elements.wrapper)),
  2991. browser.isIE && window.URL)
  2992. ) {
  2993. var _e17 = this.media.querySelectorAll('track')
  2994. Array.from(_e17).forEach(function (e) {
  2995. var t = e.getAttribute('src'),
  2996. i = parseUrl(t)
  2997. null !== i &&
  2998. i.hostname !== window.location.href.hostname &&
  2999. ['http:', 'https:'].includes(i.protocol) &&
  3000. fetch(t, 'blob')
  3001. .then(function (t) {
  3002. e.setAttribute('src', window.URL.createObjectURL(t))
  3003. })
  3004. .catch(function () {
  3005. removeElement(e)
  3006. })
  3007. })
  3008. }
  3009. var e = dedupe(
  3010. (
  3011. navigator.languages || [
  3012. navigator.language || navigator.userLanguage || 'en'
  3013. ]
  3014. ).map(function (e) {
  3015. return e.split('-')[0]
  3016. })
  3017. )
  3018. var t = (
  3019. this.storage.get('language') ||
  3020. this.config.captions.language ||
  3021. 'auto'
  3022. ).toLowerCase()
  3023. 'auto' === t &&
  3024. ((_e18 = e),
  3025. (_e19 = _slicedToArray(_e18, 1)),
  3026. (t = _e19[0]),
  3027. _e18)
  3028. var i = this.storage.get('captions')
  3029. if (
  3030. (is.boolean(i) ||
  3031. ((_this$config$captions = this.config.captions),
  3032. (i = _this$config$captions.active),
  3033. _this$config$captions),
  3034. Object.assign(this.captions, {
  3035. toggled: !1,
  3036. active: i,
  3037. language: t,
  3038. languages: e
  3039. }),
  3040. this.isHTML5)
  3041. ) {
  3042. var _e20 = this.config.captions.update
  3043. ? 'addtrack removetrack'
  3044. : 'removetrack'
  3045. on.call(
  3046. this,
  3047. this.media.textTracks,
  3048. _e20,
  3049. captions.update.bind(this)
  3050. )
  3051. }
  3052. setTimeout(captions.update.bind(this), 0)
  3053. },
  3054. update: function update() {
  3055. var _this18 = this
  3056. var e = captions.getTracks.call(this, !0),
  3057. _this$captions = this.captions,
  3058. t = _this$captions.active,
  3059. i = _this$captions.language,
  3060. s = _this$captions.meta,
  3061. n = _this$captions.currentTrackNode,
  3062. r = Boolean(
  3063. e.find(function (e) {
  3064. return e.language === i
  3065. })
  3066. )
  3067. this.isHTML5 &&
  3068. this.isVideo &&
  3069. e
  3070. .filter(function (e) {
  3071. return !s.get(e)
  3072. })
  3073. .forEach(function (e) {
  3074. _this18.debug.log('Track added', e),
  3075. s.set(e, { default: 'showing' === e.mode }),
  3076. 'showing' === e.mode && (e.mode = 'hidden'),
  3077. on.call(_this18, e, 'cuechange', function () {
  3078. return captions.updateCues.call(_this18)
  3079. })
  3080. }),
  3081. ((r && this.language !== i) || !e.includes(n)) &&
  3082. (captions.setLanguage.call(this, i),
  3083. captions.toggle.call(this, t && r)),
  3084. this.elements &&
  3085. toggleClass(
  3086. this.elements.container,
  3087. this.config.classNames.captions.enabled,
  3088. !is.empty(e)
  3089. ),
  3090. is.array(this.config.controls) &&
  3091. this.config.controls.includes('settings') &&
  3092. this.config.settings.includes('captions') &&
  3093. controls.setCaptionsMenu.call(this)
  3094. },
  3095. toggle: function toggle(e) {
  3096. var _this19 = this
  3097. var t =
  3098. arguments.length > 1 && arguments[1] !== undefined
  3099. ? arguments[1]
  3100. : !0
  3101. if (!this.supported.ui) return
  3102. var i = this.captions.toggled,
  3103. s = this.config.classNames.captions.active,
  3104. n = is.nullOrUndefined(e) ? !i : e
  3105. if (n !== i) {
  3106. if (
  3107. (t ||
  3108. ((this.captions.active = n),
  3109. this.storage.set({ captions: n })),
  3110. !this.language && n && !t)
  3111. ) {
  3112. var _e21 = captions.getTracks.call(this),
  3113. _t10 = captions.findTrack.call(
  3114. this,
  3115. [this.captions.language].concat(
  3116. _toConsumableArray(this.captions.languages)
  3117. ),
  3118. !0
  3119. )
  3120. return (
  3121. (this.captions.language = _t10.language),
  3122. void captions.set.call(this, _e21.indexOf(_t10))
  3123. )
  3124. }
  3125. this.elements.buttons.captions &&
  3126. (this.elements.buttons.captions.pressed = n),
  3127. toggleClass(this.elements.container, s, n),
  3128. (this.captions.toggled = n),
  3129. controls.updateSetting.call(this, 'captions'),
  3130. triggerEvent.call(
  3131. this,
  3132. this.media,
  3133. n ? 'captionsenabled' : 'captionsdisabled'
  3134. )
  3135. }
  3136. setTimeout(function () {
  3137. n &&
  3138. _this19.captions.toggled &&
  3139. (_this19.captions.currentTrackNode.mode = 'hidden')
  3140. })
  3141. },
  3142. set: function set(e) {
  3143. var t =
  3144. arguments.length > 1 && arguments[1] !== undefined
  3145. ? arguments[1]
  3146. : !0
  3147. var i = captions.getTracks.call(this)
  3148. if (-1 !== e) {
  3149. if (is.number(e)) {
  3150. if (e in i) {
  3151. if (this.captions.currentTrack !== e) {
  3152. this.captions.currentTrack = e
  3153. var s = i[e],
  3154. _ref16 = s || {},
  3155. n = _ref16.language
  3156. ;(this.captions.currentTrackNode = s),
  3157. controls.updateSetting.call(this, 'captions'),
  3158. t ||
  3159. ((this.captions.language = n),
  3160. this.storage.set({ language: n })),
  3161. this.isVimeo && this.embed.enableTextTrack(n),
  3162. triggerEvent.call(this, this.media, 'languagechange')
  3163. }
  3164. captions.toggle.call(this, !0, t),
  3165. this.isHTML5 &&
  3166. this.isVideo &&
  3167. captions.updateCues.call(this)
  3168. } else this.debug.warn('Track not found', e)
  3169. } else this.debug.warn('Invalid caption argument', e)
  3170. } else captions.toggle.call(this, !1, t)
  3171. },
  3172. setLanguage: function setLanguage(e) {
  3173. var t =
  3174. arguments.length > 1 && arguments[1] !== undefined
  3175. ? arguments[1]
  3176. : !0
  3177. if (!is.string(e))
  3178. return void this.debug.warn('Invalid language argument', e)
  3179. var i = e.toLowerCase()
  3180. this.captions.language = i
  3181. var s = captions.getTracks.call(this),
  3182. n = captions.findTrack.call(this, [i])
  3183. captions.set.call(this, s.indexOf(n), t)
  3184. },
  3185. getTracks: function getTracks() {
  3186. var _this20 = this
  3187. var e =
  3188. arguments.length > 0 && arguments[0] !== undefined
  3189. ? arguments[0]
  3190. : !1
  3191. return Array.from((this.media || {}).textTracks || [])
  3192. .filter(function (t) {
  3193. return !_this20.isHTML5 || e || _this20.captions.meta.has(t)
  3194. })
  3195. .filter(function (e) {
  3196. return ['captions', 'subtitles'].includes(e.kind)
  3197. })
  3198. },
  3199. findTrack: function findTrack(e) {
  3200. var _this21 = this
  3201. var t =
  3202. arguments.length > 1 && arguments[1] !== undefined
  3203. ? arguments[1]
  3204. : !1
  3205. var i = captions.getTracks.call(this),
  3206. s = function s(e) {
  3207. return Number((_this21.captions.meta.get(e) || {}).default)
  3208. },
  3209. n = Array.from(i).sort(function (e, t) {
  3210. return s(t) - s(e)
  3211. })
  3212. var r
  3213. return (
  3214. e.every(function (e) {
  3215. return (
  3216. (r = n.find(function (t) {
  3217. return t.language === e
  3218. })),
  3219. !r
  3220. )
  3221. }),
  3222. r || (t ? n[0] : void 0)
  3223. )
  3224. },
  3225. getCurrentTrack: function getCurrentTrack() {
  3226. return captions.getTracks.call(this)[this.currentTrack]
  3227. },
  3228. getLabel: function getLabel(e) {
  3229. var t = e
  3230. return (
  3231. !is.track(t) &&
  3232. support.textTracks &&
  3233. this.captions.toggled &&
  3234. (t = captions.getCurrentTrack.call(this)),
  3235. is.track(t)
  3236. ? is.empty(t.label)
  3237. ? is.empty(t.language)
  3238. ? i18n.get('enabled', this.config)
  3239. : e.language.toUpperCase()
  3240. : t.label
  3241. : i18n.get('disabled', this.config)
  3242. )
  3243. },
  3244. updateCues: function updateCues(e) {
  3245. if (!this.supported.ui) return
  3246. if (!is.element(this.elements.captions))
  3247. return void this.debug.warn(
  3248. 'No captions element to render to'
  3249. )
  3250. if (!is.nullOrUndefined(e) && !Array.isArray(e))
  3251. return void this.debug.warn('updateCues: Invalid input', e)
  3252. var t = e
  3253. if (!t) {
  3254. var _e22 = captions.getCurrentTrack.call(this)
  3255. t = Array.from((_e22 || {}).activeCues || [])
  3256. .map(function (e) {
  3257. return e.getCueAsHTML()
  3258. })
  3259. .map(getHTML)
  3260. }
  3261. var i = t
  3262. .map(function (e) {
  3263. return e.trim()
  3264. })
  3265. .join('\n')
  3266. if (i !== this.elements.captions.innerHTML) {
  3267. emptyElement(this.elements.captions)
  3268. var _e23 = createElement(
  3269. 'span',
  3270. getAttributesFromSelector(this.config.selectors.caption)
  3271. )
  3272. ;(_e23.innerHTML = i),
  3273. this.elements.captions.appendChild(_e23),
  3274. triggerEvent.call(this, this.media, 'cuechange')
  3275. }
  3276. }
  3277. },
  3278. defaults = {
  3279. enabled: !0,
  3280. title: '',
  3281. debug: !1,
  3282. autoplay: !1,
  3283. autopause: !0,
  3284. playsinline: !0,
  3285. seekTime: 10,
  3286. volume: 1,
  3287. muted: !1,
  3288. duration: null,
  3289. displayDuration: !0,
  3290. invertTime: !0,
  3291. toggleInvert: !0,
  3292. ratio: null,
  3293. clickToPlay: !0,
  3294. hideControls: !0,
  3295. resetOnEnd: !1,
  3296. disableContextMenu: !0,
  3297. loadSprite: !0,
  3298. iconPrefix: 'plyr',
  3299. iconUrl: 'https://cdn.plyr.io/3.7.2/plyr.svg',
  3300. blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
  3301. quality: {
  3302. default: 576,
  3303. options: [
  3304. 4320, 2880, 2160, 1440, 1080, 720, 576, 480, 360, 240
  3305. ],
  3306. forced: !1,
  3307. onChange: null
  3308. },
  3309. loop: { active: !1 },
  3310. speed: {
  3311. selected: 1,
  3312. options: [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 4]
  3313. },
  3314. keyboard: { focused: !0, global: !1 },
  3315. tooltips: { controls: !1, seek: !0 },
  3316. captions: { active: !1, language: 'auto', update: !1 },
  3317. fullscreen: { enabled: !0, fallback: !0, iosNative: !1 },
  3318. storage: { enabled: !0, key: 'plyr' },
  3319. controls: [
  3320. 'play-large',
  3321. 'play',
  3322. 'progress',
  3323. 'current-time',
  3324. 'mute',
  3325. 'volume',
  3326. 'captions',
  3327. 'settings',
  3328. 'pip',
  3329. 'airplay',
  3330. 'fullscreen'
  3331. ],
  3332. settings: ['captions', 'quality', 'speed'],
  3333. i18n: {
  3334. restart: 'Restart',
  3335. rewind: 'Rewind {seektime}s',
  3336. play: 'Play',
  3337. pause: 'Pause',
  3338. fastForward: 'Forward {seektime}s',
  3339. seek: 'Seek',
  3340. seekLabel: '{currentTime} of {duration}',
  3341. played: 'Played',
  3342. buffered: 'Buffered',
  3343. currentTime: 'Current time',
  3344. duration: 'Duration',
  3345. volume: 'Volume',
  3346. mute: 'Mute',
  3347. unmute: 'Unmute',
  3348. enableCaptions: 'Enable captions',
  3349. disableCaptions: 'Disable captions',
  3350. download: 'Download',
  3351. enterFullscreen: 'Enter fullscreen',
  3352. exitFullscreen: 'Exit fullscreen',
  3353. frameTitle: 'Player for {title}',
  3354. captions: 'Captions',
  3355. settings: 'Settings',
  3356. pip: 'PIP',
  3357. menuBack: 'Go back to previous menu',
  3358. speed: 'Speed',
  3359. normal: 'Normal',
  3360. quality: 'Quality',
  3361. loop: 'Loop',
  3362. start: 'Start',
  3363. end: 'End',
  3364. all: 'All',
  3365. reset: 'Reset',
  3366. disabled: 'Disabled',
  3367. enabled: 'Enabled',
  3368. advertisement: 'Ad',
  3369. qualityBadge: {
  3370. 2160: '4K',
  3371. 1440: 'HD',
  3372. 1080: 'HD',
  3373. 720: 'HD',
  3374. 576: 'SD',
  3375. 480: 'SD'
  3376. }
  3377. },
  3378. urls: {
  3379. download: null,
  3380. vimeo: {
  3381. sdk: 'https://player.vimeo.com/api/player.js',
  3382. iframe: 'https://player.vimeo.com/video/{0}?{1}',
  3383. api: 'https://vimeo.com/api/oembed.json?url={0}'
  3384. },
  3385. youtube: {
  3386. sdk: 'https://www.youtube.com/iframe_api',
  3387. api: 'https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}'
  3388. },
  3389. googleIMA: {
  3390. sdk: 'https://imasdk.googleapis.com/js/sdkloader/ima3.js'
  3391. }
  3392. },
  3393. listeners: {
  3394. seek: null,
  3395. play: null,
  3396. pause: null,
  3397. restart: null,
  3398. rewind: null,
  3399. fastForward: null,
  3400. mute: null,
  3401. volume: null,
  3402. captions: null,
  3403. download: null,
  3404. fullscreen: null,
  3405. pip: null,
  3406. airplay: null,
  3407. speed: null,
  3408. quality: null,
  3409. loop: null,
  3410. language: null
  3411. },
  3412. events: [
  3413. 'ended',
  3414. 'progress',
  3415. 'stalled',
  3416. 'playing',
  3417. 'waiting',
  3418. 'canplay',
  3419. 'canplaythrough',
  3420. 'loadstart',
  3421. 'loadeddata',
  3422. 'loadedmetadata',
  3423. 'timeupdate',
  3424. 'volumechange',
  3425. 'play',
  3426. 'pause',
  3427. 'error',
  3428. 'seeking',
  3429. 'seeked',
  3430. 'emptied',
  3431. 'ratechange',
  3432. 'cuechange',
  3433. 'download',
  3434. 'enterfullscreen',
  3435. 'exitfullscreen',
  3436. 'captionsenabled',
  3437. 'captionsdisabled',
  3438. 'languagechange',
  3439. 'controlshidden',
  3440. 'controlsshown',
  3441. 'ready',
  3442. 'statechange',
  3443. 'qualitychange',
  3444. 'adsloaded',
  3445. 'adscontentpause',
  3446. 'adscontentresume',
  3447. 'adstarted',
  3448. 'adsmidpoint',
  3449. 'adscomplete',
  3450. 'adsallcomplete',
  3451. 'adsimpression',
  3452. 'adsclick'
  3453. ],
  3454. selectors: {
  3455. editable: 'input, textarea, select, [contenteditable]',
  3456. container: '.plyr',
  3457. controls: { container: null, wrapper: '.plyr__controls' },
  3458. labels: '[data-plyr]',
  3459. buttons: {
  3460. play: '[data-plyr="play"]',
  3461. pause: '[data-plyr="pause"]',
  3462. restart: '[data-plyr="restart"]',
  3463. rewind: '[data-plyr="rewind"]',
  3464. fastForward: '[data-plyr="fast-forward"]',
  3465. mute: '[data-plyr="mute"]',
  3466. captions: '[data-plyr="captions"]',
  3467. download: '[data-plyr="download"]',
  3468. fullscreen: '[data-plyr="fullscreen"]',
  3469. pip: '[data-plyr="pip"]',
  3470. airplay: '[data-plyr="airplay"]',
  3471. settings: '[data-plyr="settings"]',
  3472. loop: '[data-plyr="loop"]'
  3473. },
  3474. inputs: {
  3475. seek: '[data-plyr="seek"]',
  3476. volume: '[data-plyr="volume"]',
  3477. speed: '[data-plyr="speed"]',
  3478. language: '[data-plyr="language"]',
  3479. quality: '[data-plyr="quality"]'
  3480. },
  3481. display: {
  3482. currentTime: '.plyr__time--current',
  3483. duration: '.plyr__time--duration',
  3484. buffer: '.plyr__progress__buffer',
  3485. loop: '.plyr__progress__loop',
  3486. volume: '.plyr__volume--display'
  3487. },
  3488. progress: '.plyr__progress',
  3489. captions: '.plyr__captions',
  3490. caption: '.plyr__caption'
  3491. },
  3492. classNames: {
  3493. type: 'plyr--{0}',
  3494. provider: 'plyr--{0}',
  3495. video: 'plyr__video-wrapper',
  3496. embed: 'plyr__video-embed',
  3497. videoFixedRatio: 'plyr__video-wrapper--fixed-ratio',
  3498. embedContainer: 'plyr__video-embed__container',
  3499. poster: 'plyr__poster',
  3500. posterEnabled: 'plyr__poster-enabled',
  3501. ads: 'plyr__ads',
  3502. control: 'plyr__control',
  3503. controlPressed: 'plyr__control--pressed',
  3504. playing: 'plyr--playing',
  3505. paused: 'plyr--paused',
  3506. stopped: 'plyr--stopped',
  3507. loading: 'plyr--loading',
  3508. hover: 'plyr--hover',
  3509. tooltip: 'plyr__tooltip',
  3510. cues: 'plyr__cues',
  3511. marker: 'plyr__progress__marker',
  3512. hidden: 'plyr__sr-only',
  3513. hideControls: 'plyr--hide-controls',
  3514. isIos: 'plyr--is-ios',
  3515. isTouch: 'plyr--is-touch',
  3516. uiSupported: 'plyr--full-ui',
  3517. noTransition: 'plyr--no-transition',
  3518. display: { time: 'plyr__time' },
  3519. menu: {
  3520. value: 'plyr__menu__value',
  3521. badge: 'plyr__badge',
  3522. open: 'plyr--menu-open'
  3523. },
  3524. captions: {
  3525. enabled: 'plyr--captions-enabled',
  3526. active: 'plyr--captions-active'
  3527. },
  3528. fullscreen: {
  3529. enabled: 'plyr--fullscreen-enabled',
  3530. fallback: 'plyr--fullscreen-fallback'
  3531. },
  3532. pip: {
  3533. supported: 'plyr--pip-supported',
  3534. active: 'plyr--pip-active'
  3535. },
  3536. airplay: {
  3537. supported: 'plyr--airplay-supported',
  3538. active: 'plyr--airplay-active'
  3539. },
  3540. tabFocus: 'plyr__tab-focus',
  3541. previewThumbnails: {
  3542. thumbContainer: 'plyr__preview-thumb',
  3543. thumbContainerShown: 'plyr__preview-thumb--is-shown',
  3544. imageContainer: 'plyr__preview-thumb__image-container',
  3545. timeContainer: 'plyr__preview-thumb__time-container',
  3546. scrubbingContainer: 'plyr__preview-scrubbing',
  3547. scrubbingContainerShown: 'plyr__preview-scrubbing--is-shown'
  3548. }
  3549. },
  3550. attributes: {
  3551. embed: {
  3552. provider: 'data-plyr-provider',
  3553. id: 'data-plyr-embed-id',
  3554. hash: 'data-plyr-embed-hash'
  3555. }
  3556. },
  3557. ads: { enabled: !1, publisherId: '', tagUrl: '' },
  3558. previewThumbnails: { enabled: !1, src: '' },
  3559. vimeo: {
  3560. byline: !1,
  3561. portrait: !1,
  3562. title: !1,
  3563. speed: !0,
  3564. transparent: !1,
  3565. customControls: !0,
  3566. referrerPolicy: null,
  3567. premium: !1
  3568. },
  3569. youtube: {
  3570. rel: 0,
  3571. showinfo: 0,
  3572. iv_load_policy: 3,
  3573. modestbranding: 1,
  3574. customControls: !0,
  3575. noCookie: !1
  3576. },
  3577. mediaMetadata: { title: '', artist: '', album: '', artwork: [] },
  3578. markers: { enabled: !1, points: [] }
  3579. },
  3580. pip = { active: 'picture-in-picture', inactive: 'inline' },
  3581. providers = { html5: 'html5', youtube: 'youtube', vimeo: 'vimeo' },
  3582. types = { audio: 'audio', video: 'video' }
  3583. function getProviderByUrl(e) {
  3584. return /^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(
  3585. e
  3586. )
  3587. ? providers.youtube
  3588. : /^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)
  3589. ? providers.vimeo
  3590. : null
  3591. }
  3592. var noop = function noop() {}
  3593. var Console = /*#__PURE__*/ (function () {
  3594. function Console() {
  3595. var e =
  3596. arguments.length > 0 && arguments[0] !== undefined
  3597. ? arguments[0]
  3598. : !1
  3599. _classCallCheck2(this, Console)
  3600. ;(this.enabled = window.console && e),
  3601. this.enabled && this.log('Debugging enabled')
  3602. }
  3603. _createClass2(Console, [
  3604. {
  3605. key: 'log',
  3606. get: function get() {
  3607. return this.enabled
  3608. ? Function.prototype.bind.call(console.log, console)
  3609. : noop
  3610. }
  3611. },
  3612. {
  3613. key: 'warn',
  3614. get: function get() {
  3615. return this.enabled
  3616. ? Function.prototype.bind.call(console.warn, console)
  3617. : noop
  3618. }
  3619. },
  3620. {
  3621. key: 'error',
  3622. get: function get() {
  3623. return this.enabled
  3624. ? Function.prototype.bind.call(console.error, console)
  3625. : noop
  3626. }
  3627. }
  3628. ])
  3629. return Console
  3630. })()
  3631. var Fullscreen = /*#__PURE__*/ (function () {
  3632. function Fullscreen(e) {
  3633. var _this22 = this
  3634. _classCallCheck2(this, Fullscreen)
  3635. _defineProperty$1(this, 'onChange', function () {
  3636. if (!_this22.enabled) return
  3637. var e = _this22.player.elements.buttons.fullscreen
  3638. is.element(e) && (e.pressed = _this22.active)
  3639. var t =
  3640. _this22.target === _this22.player.media
  3641. ? _this22.target
  3642. : _this22.player.elements.container
  3643. triggerEvent.call(
  3644. _this22.player,
  3645. t,
  3646. _this22.active ? 'enterfullscreen' : 'exitfullscreen',
  3647. !0
  3648. )
  3649. }),
  3650. _defineProperty$1(this, 'toggleFallback', function () {
  3651. var e =
  3652. arguments.length > 0 && arguments[0] !== undefined
  3653. ? arguments[0]
  3654. : !1
  3655. if (
  3656. (e
  3657. ? (_this22.scrollPosition = {
  3658. x: window.scrollX || 0,
  3659. y: window.scrollY || 0
  3660. })
  3661. : window.scrollTo(
  3662. _this22.scrollPosition.x,
  3663. _this22.scrollPosition.y
  3664. ),
  3665. (document.body.style.overflow = e ? 'hidden' : ''),
  3666. toggleClass(
  3667. _this22.target,
  3668. _this22.player.config.classNames.fullscreen.fallback,
  3669. e
  3670. ),
  3671. browser.isIos)
  3672. ) {
  3673. var t = document.head.querySelector('meta[name="viewport"]')
  3674. var i = 'viewport-fit=cover'
  3675. t ||
  3676. ((t = document.createElement('meta')),
  3677. t.setAttribute('name', 'viewport'))
  3678. var s = is.string(t.content) && t.content.includes(i)
  3679. e
  3680. ? ((_this22.cleanupViewport = !s),
  3681. s || (t.content += ','.concat(i)))
  3682. : _this22.cleanupViewport &&
  3683. (t.content = t.content
  3684. .split(',')
  3685. .filter(function (e) {
  3686. return e.trim() !== i
  3687. })
  3688. .join(','))
  3689. }
  3690. _this22.onChange()
  3691. }),
  3692. _defineProperty$1(this, 'trapFocus', function (e) {
  3693. if (browser.isIos || !_this22.active || 'Tab' !== e.key)
  3694. return
  3695. var t = document.activeElement,
  3696. i = getElements.call(
  3697. _this22.player,
  3698. 'a[href], button:not(:disabled), input:not(:disabled), [tabindex]'
  3699. ),
  3700. _i6 = _slicedToArray(i, 1),
  3701. s = _i6[0],
  3702. n = i[i.length - 1]
  3703. t !== n || e.shiftKey
  3704. ? t === s && e.shiftKey && (n.focus(), e.preventDefault())
  3705. : (s.focus(), e.preventDefault())
  3706. }),
  3707. _defineProperty$1(this, 'update', function () {
  3708. if (_this22.enabled) {
  3709. var _e24
  3710. ;(_e24 = _this22.forceFallback
  3711. ? 'Fallback (forced)'
  3712. : Fullscreen.native
  3713. ? 'Native'
  3714. : 'Fallback'),
  3715. _this22.player.debug.log(
  3716. ''.concat(_e24, ' fullscreen enabled')
  3717. )
  3718. } else _this22.player.debug.log('Fullscreen not supported and fallback disabled')
  3719. toggleClass(
  3720. _this22.player.elements.container,
  3721. _this22.player.config.classNames.fullscreen.enabled,
  3722. _this22.enabled
  3723. )
  3724. }),
  3725. _defineProperty$1(this, 'enter', function () {
  3726. _this22.enabled &&
  3727. (browser.isIos && _this22.player.config.fullscreen.iosNative
  3728. ? _this22.player.isVimeo
  3729. ? _this22.player.embed.requestFullscreen()
  3730. : _this22.target.webkitEnterFullscreen()
  3731. : !Fullscreen.native || _this22.forceFallback
  3732. ? _this22.toggleFallback(!0)
  3733. : _this22.prefix
  3734. ? is.empty(_this22.prefix) ||
  3735. _this22.target[
  3736. ''
  3737. .concat(_this22.prefix, 'Request')
  3738. .concat(_this22.property)
  3739. ]()
  3740. : _this22.target.requestFullscreen({
  3741. navigationUI: 'hide'
  3742. }))
  3743. }),
  3744. _defineProperty$1(this, 'exit', function () {
  3745. if (_this22.enabled)
  3746. if (
  3747. browser.isIos &&
  3748. _this22.player.config.fullscreen.iosNative
  3749. )
  3750. _this22.target.webkitExitFullscreen(),
  3751. silencePromise(_this22.player.play())
  3752. else if (!Fullscreen.native || _this22.forceFallback)
  3753. _this22.toggleFallback(!1)
  3754. else if (_this22.prefix) {
  3755. if (!is.empty(_this22.prefix)) {
  3756. var _e25 = 'moz' === _this22.prefix ? 'Cancel' : 'Exit'
  3757. document[
  3758. ''
  3759. .concat(_this22.prefix)
  3760. .concat(_e25)
  3761. .concat(_this22.property)
  3762. ]()
  3763. }
  3764. } else
  3765. (
  3766. document.cancelFullScreen || document.exitFullscreen
  3767. ).call(document)
  3768. }),
  3769. _defineProperty$1(this, 'toggle', function () {
  3770. _this22.active ? _this22.exit() : _this22.enter()
  3771. }),
  3772. (this.player = e),
  3773. (this.prefix = Fullscreen.prefix),
  3774. (this.property = Fullscreen.property),
  3775. (this.scrollPosition = { x: 0, y: 0 }),
  3776. (this.forceFallback = 'force' === e.config.fullscreen.fallback),
  3777. (this.player.elements.fullscreen =
  3778. e.config.fullscreen.container &&
  3779. closest$1(
  3780. this.player.elements.container,
  3781. e.config.fullscreen.container
  3782. )),
  3783. on.call(
  3784. this.player,
  3785. document,
  3786. 'ms' === this.prefix
  3787. ? 'MSFullscreenChange'
  3788. : ''.concat(this.prefix, 'fullscreenchange'),
  3789. function () {
  3790. _this22.onChange()
  3791. }
  3792. ),
  3793. on.call(
  3794. this.player,
  3795. this.player.elements.container,
  3796. 'dblclick',
  3797. function (e) {
  3798. ;(is.element(_this22.player.elements.controls) &&
  3799. _this22.player.elements.controls.contains(e.target)) ||
  3800. _this22.player.listeners.proxy(
  3801. e,
  3802. _this22.toggle,
  3803. 'fullscreen'
  3804. )
  3805. }
  3806. ),
  3807. on.call(
  3808. this,
  3809. this.player.elements.container,
  3810. 'keydown',
  3811. function (e) {
  3812. return _this22.trapFocus(e)
  3813. }
  3814. ),
  3815. this.update()
  3816. }
  3817. _createClass2(
  3818. Fullscreen,
  3819. [
  3820. {
  3821. key: 'usingNative',
  3822. get: function get() {
  3823. return Fullscreen.native && !this.forceFallback
  3824. }
  3825. },
  3826. {
  3827. key: 'enabled',
  3828. get: function get() {
  3829. return (
  3830. (Fullscreen.native ||
  3831. this.player.config.fullscreen.fallback) &&
  3832. this.player.config.fullscreen.enabled &&
  3833. this.player.supported.ui &&
  3834. this.player.isVideo
  3835. )
  3836. }
  3837. },
  3838. {
  3839. key: 'active',
  3840. get: function get() {
  3841. if (!this.enabled) return !1
  3842. if (!Fullscreen.native || this.forceFallback)
  3843. return hasClass(
  3844. this.target,
  3845. this.player.config.classNames.fullscreen.fallback
  3846. )
  3847. var e = this.prefix
  3848. ? this.target.getRootNode()[
  3849. ''
  3850. .concat(this.prefix)
  3851. .concat(this.property, 'Element')
  3852. ]
  3853. : this.target.getRootNode().fullscreenElement
  3854. return e && e.shadowRoot
  3855. ? e === this.target.getRootNode().host
  3856. : e === this.target
  3857. }
  3858. },
  3859. {
  3860. key: 'target',
  3861. get: function get() {
  3862. return browser.isIos &&
  3863. this.player.config.fullscreen.iosNative
  3864. ? this.player.media
  3865. : this.player.elements.fullscreen ||
  3866. this.player.elements.container
  3867. }
  3868. }
  3869. ],
  3870. [
  3871. {
  3872. key: 'native',
  3873. get: function get() {
  3874. return !!(
  3875. document.fullscreenEnabled ||
  3876. document.webkitFullscreenEnabled ||
  3877. document.mozFullScreenEnabled ||
  3878. document.msFullscreenEnabled
  3879. )
  3880. }
  3881. },
  3882. {
  3883. key: 'prefix',
  3884. get: function get() {
  3885. if (is.function(document.exitFullscreen)) return ''
  3886. var e = ''
  3887. return (
  3888. ['webkit', 'moz', 'ms'].some(function (t) {
  3889. return (
  3890. !(
  3891. !is.function(
  3892. document[''.concat(t, 'ExitFullscreen')]
  3893. ) &&
  3894. !is.function(
  3895. document[''.concat(t, 'CancelFullScreen')]
  3896. )
  3897. ) && ((e = t), !0)
  3898. )
  3899. }),
  3900. e
  3901. )
  3902. }
  3903. },
  3904. {
  3905. key: 'property',
  3906. get: function get() {
  3907. return 'moz' === this.prefix ? 'FullScreen' : 'Fullscreen'
  3908. }
  3909. }
  3910. ]
  3911. )
  3912. return Fullscreen
  3913. })()
  3914. function loadImage(e) {
  3915. var t =
  3916. arguments.length > 1 && arguments[1] !== undefined
  3917. ? arguments[1]
  3918. : 1
  3919. return new Promise(function (i, s) {
  3920. var n = new Image(),
  3921. r = function r() {
  3922. delete n.onload,
  3923. delete n.onerror,
  3924. (n.naturalWidth >= t ? i : s)(n)
  3925. }
  3926. Object.assign(n, { onload: r, onerror: r, src: e })
  3927. })
  3928. }
  3929. var ui = {
  3930. addStyleHook: function addStyleHook() {
  3931. toggleClass(
  3932. this.elements.container,
  3933. this.config.selectors.container.replace('.', ''),
  3934. !0
  3935. ),
  3936. toggleClass(
  3937. this.elements.container,
  3938. this.config.classNames.uiSupported,
  3939. this.supported.ui
  3940. )
  3941. },
  3942. toggleNativeControls: function toggleNativeControls() {
  3943. var e =
  3944. arguments.length > 0 && arguments[0] !== undefined
  3945. ? arguments[0]
  3946. : !1
  3947. e && this.isHTML5
  3948. ? this.media.setAttribute('controls', '')
  3949. : this.media.removeAttribute('controls')
  3950. },
  3951. build: function build() {
  3952. var _this23 = this
  3953. if ((this.listeners.media(), !this.supported.ui))
  3954. return (
  3955. this.debug.warn(
  3956. 'Basic support only for '
  3957. .concat(this.provider, ' ')
  3958. .concat(this.type)
  3959. ),
  3960. void ui.toggleNativeControls.call(this, !0)
  3961. )
  3962. is.element(this.elements.controls) ||
  3963. (controls.inject.call(this), this.listeners.controls()),
  3964. ui.toggleNativeControls.call(this),
  3965. this.isHTML5 && captions.setup.call(this),
  3966. (this.volume = null),
  3967. (this.muted = null),
  3968. (this.loop = null),
  3969. (this.quality = null),
  3970. (this.speed = null),
  3971. controls.updateVolume.call(this),
  3972. controls.timeUpdate.call(this),
  3973. controls.durationUpdate.call(this),
  3974. ui.checkPlaying.call(this),
  3975. toggleClass(
  3976. this.elements.container,
  3977. this.config.classNames.pip.supported,
  3978. support.pip && this.isHTML5 && this.isVideo
  3979. ),
  3980. toggleClass(
  3981. this.elements.container,
  3982. this.config.classNames.airplay.supported,
  3983. support.airplay && this.isHTML5
  3984. ),
  3985. toggleClass(
  3986. this.elements.container,
  3987. this.config.classNames.isIos,
  3988. browser.isIos
  3989. ),
  3990. toggleClass(
  3991. this.elements.container,
  3992. this.config.classNames.isTouch,
  3993. this.touch
  3994. ),
  3995. (this.ready = !0),
  3996. setTimeout(function () {
  3997. triggerEvent.call(_this23, _this23.media, 'ready')
  3998. }, 0),
  3999. ui.setTitle.call(this),
  4000. this.poster &&
  4001. ui.setPoster
  4002. .call(this, this.poster, !1)
  4003. .catch(function () {}),
  4004. this.config.duration && controls.durationUpdate.call(this),
  4005. this.config.mediaMetadata &&
  4006. controls.setMediaMetadata.call(this)
  4007. },
  4008. setTitle: function setTitle() {
  4009. var e = i18n.get('play', this.config)
  4010. if (
  4011. (is.string(this.config.title) &&
  4012. !is.empty(this.config.title) &&
  4013. (e += ', '.concat(this.config.title)),
  4014. Array.from(this.elements.buttons.play || []).forEach(function (
  4015. t
  4016. ) {
  4017. t.setAttribute('aria-label', e)
  4018. }),
  4019. this.isEmbed)
  4020. ) {
  4021. var _e26 = getElement.call(this, 'iframe')
  4022. if (!is.element(_e26)) return
  4023. var t = is.empty(this.config.title)
  4024. ? 'video'
  4025. : this.config.title,
  4026. i = i18n.get('frameTitle', this.config)
  4027. _e26.setAttribute('title', i.replace('{title}', t))
  4028. }
  4029. },
  4030. togglePoster: function togglePoster(e) {
  4031. toggleClass(
  4032. this.elements.container,
  4033. this.config.classNames.posterEnabled,
  4034. e
  4035. )
  4036. },
  4037. setPoster: function setPoster(e) {
  4038. var _this24 = this
  4039. var t =
  4040. arguments.length > 1 && arguments[1] !== undefined
  4041. ? arguments[1]
  4042. : !0
  4043. return t && this.poster
  4044. ? Promise.reject(new Error('Poster already set'))
  4045. : (this.media.setAttribute('data-poster', e),
  4046. this.elements.poster.removeAttribute('hidden'),
  4047. ready
  4048. .call(this)
  4049. .then(function () {
  4050. return loadImage(e)
  4051. })
  4052. .catch(function (t) {
  4053. throw (
  4054. (e === _this24.poster &&
  4055. ui.togglePoster.call(_this24, !1),
  4056. t)
  4057. )
  4058. })
  4059. .then(function () {
  4060. if (e !== _this24.poster)
  4061. throw new Error(
  4062. 'setPoster cancelled by later call to setPoster'
  4063. )
  4064. })
  4065. .then(function () {
  4066. return (
  4067. Object.assign(_this24.elements.poster.style, {
  4068. backgroundImage: "url('".concat(e, "')"),
  4069. backgroundSize: ''
  4070. }),
  4071. ui.togglePoster.call(_this24, !0),
  4072. e
  4073. )
  4074. }))
  4075. },
  4076. checkPlaying: function checkPlaying(e) {
  4077. var _this25 = this
  4078. toggleClass(
  4079. this.elements.container,
  4080. this.config.classNames.playing,
  4081. this.playing
  4082. ),
  4083. toggleClass(
  4084. this.elements.container,
  4085. this.config.classNames.paused,
  4086. this.paused
  4087. ),
  4088. toggleClass(
  4089. this.elements.container,
  4090. this.config.classNames.stopped,
  4091. this.stopped
  4092. ),
  4093. Array.from(this.elements.buttons.play || []).forEach(function (
  4094. e
  4095. ) {
  4096. Object.assign(e, { pressed: _this25.playing }),
  4097. e.setAttribute(
  4098. 'aria-label',
  4099. i18n.get(
  4100. _this25.playing ? 'pause' : 'play',
  4101. _this25.config
  4102. )
  4103. )
  4104. }),
  4105. (is.event(e) && 'timeupdate' === e.type) ||
  4106. ui.toggleControls.call(this)
  4107. },
  4108. checkLoading: function checkLoading(e) {
  4109. var _this26 = this
  4110. ;(this.loading = ['stalled', 'waiting'].includes(e.type)),
  4111. clearTimeout(this.timers.loading),
  4112. (this.timers.loading = setTimeout(
  4113. function () {
  4114. toggleClass(
  4115. _this26.elements.container,
  4116. _this26.config.classNames.loading,
  4117. _this26.loading
  4118. ),
  4119. ui.toggleControls.call(_this26)
  4120. },
  4121. this.loading ? 250 : 0
  4122. ))
  4123. },
  4124. toggleControls: function toggleControls(e) {
  4125. var t = this.elements.controls
  4126. if (t && this.config.hideControls) {
  4127. var i = this.touch && this.lastSeekTime + 2e3 > Date.now()
  4128. this.toggleControls(
  4129. Boolean(
  4130. e ||
  4131. this.loading ||
  4132. this.paused ||
  4133. t.pressed ||
  4134. t.hover ||
  4135. i
  4136. )
  4137. )
  4138. }
  4139. },
  4140. migrateStyles: function migrateStyles() {
  4141. var _this27 = this
  4142. Object.values(_objectSpread({}, this.media.style))
  4143. .filter(function (e) {
  4144. return !is.empty(e) && is.string(e) && e.startsWith('--plyr')
  4145. })
  4146. .forEach(function (e) {
  4147. _this27.elements.container.style.setProperty(
  4148. e,
  4149. _this27.media.style.getPropertyValue(e)
  4150. ),
  4151. _this27.media.style.removeProperty(e)
  4152. }),
  4153. is.empty(this.media.style) &&
  4154. this.media.removeAttribute('style')
  4155. }
  4156. }
  4157. var Listeners = /*#__PURE__*/ (function () {
  4158. function Listeners(e) {
  4159. var _this28 = this
  4160. _classCallCheck2(this, Listeners)
  4161. _defineProperty$1(this, 'firstTouch', function () {
  4162. var e = _this28.player,
  4163. t = e.elements
  4164. ;(e.touch = !0),
  4165. toggleClass(t.container, e.config.classNames.isTouch, !0)
  4166. }),
  4167. _defineProperty$1(this, 'setTabFocus', function (e) {
  4168. var t = _this28.player,
  4169. i = t.elements,
  4170. s = e.key,
  4171. n = e.type,
  4172. r = e.timeStamp
  4173. if (
  4174. (clearTimeout(_this28.focusTimer),
  4175. 'keydown' === n && 'Tab' !== s)
  4176. )
  4177. return
  4178. 'keydown' === n && (_this28.lastKeyDown = r)
  4179. var a = r - _this28.lastKeyDown <= 20
  4180. ;('focus' !== n || a) &&
  4181. ((function () {
  4182. var e = t.config.classNames.tabFocus
  4183. toggleClass(getElements.call(t, '.'.concat(e)), e, !1)
  4184. })(),
  4185. 'focusout' !== n &&
  4186. (_this28.focusTimer = setTimeout(function () {
  4187. var e = document.activeElement
  4188. i.container.contains(e) &&
  4189. toggleClass(
  4190. document.activeElement,
  4191. t.config.classNames.tabFocus,
  4192. !0
  4193. )
  4194. }, 10)))
  4195. }),
  4196. _defineProperty$1(this, 'global', function () {
  4197. var e =
  4198. arguments.length > 0 && arguments[0] !== undefined
  4199. ? arguments[0]
  4200. : !0
  4201. var t = _this28.player
  4202. t.config.keyboard.global &&
  4203. toggleListener.call(
  4204. t,
  4205. window,
  4206. 'keydown keyup',
  4207. _this28.handleKey,
  4208. e,
  4209. !1
  4210. ),
  4211. toggleListener.call(
  4212. t,
  4213. document.body,
  4214. 'click',
  4215. _this28.toggleMenu,
  4216. e
  4217. ),
  4218. once.call(
  4219. t,
  4220. document.body,
  4221. 'touchstart',
  4222. _this28.firstTouch
  4223. ),
  4224. toggleListener.call(
  4225. t,
  4226. document.body,
  4227. 'keydown focus blur focusout',
  4228. _this28.setTabFocus,
  4229. e,
  4230. !1,
  4231. !0
  4232. )
  4233. }),
  4234. _defineProperty$1(this, 'container', function () {
  4235. var e = _this28.player,
  4236. t = e.config,
  4237. i = e.elements,
  4238. s = e.timers
  4239. !t.keyboard.global &&
  4240. t.keyboard.focused &&
  4241. on.call(
  4242. e,
  4243. i.container,
  4244. 'keydown keyup',
  4245. _this28.handleKey,
  4246. !1
  4247. ),
  4248. on.call(
  4249. e,
  4250. i.container,
  4251. 'mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen',
  4252. function (t) {
  4253. var n = i.controls
  4254. n &&
  4255. 'enterfullscreen' === t.type &&
  4256. ((n.pressed = !1), (n.hover = !1))
  4257. var r = 0
  4258. ;['touchstart', 'touchmove', 'mousemove'].includes(
  4259. t.type
  4260. ) &&
  4261. (ui.toggleControls.call(e, !0),
  4262. (r = e.touch ? 3e3 : 2e3)),
  4263. clearTimeout(s.controls),
  4264. (s.controls = setTimeout(function () {
  4265. return ui.toggleControls.call(e, !1)
  4266. }, r))
  4267. }
  4268. )
  4269. var n = function n() {
  4270. if (!e.isVimeo || e.config.vimeo.premium) return
  4271. var t = i.wrapper,
  4272. s = e.fullscreen.active,
  4273. _getAspectRatio$call = getAspectRatio.call(e),
  4274. _getAspectRatio$call2 = _slicedToArray(
  4275. _getAspectRatio$call,
  4276. 2
  4277. ),
  4278. n = _getAspectRatio$call2[0],
  4279. r = _getAspectRatio$call2[1],
  4280. a = supportsCSS(
  4281. 'aspect-ratio: '.concat(n, ' / ').concat(r)
  4282. )
  4283. if (!s)
  4284. return void (a
  4285. ? ((t.style.width = null), (t.style.height = null))
  4286. : ((t.style.maxWidth = null),
  4287. (t.style.margin = null)))
  4288. var _getViewportSize = getViewportSize(),
  4289. _getViewportSize2 = _slicedToArray(_getViewportSize, 2),
  4290. o = _getViewportSize2[0],
  4291. l = _getViewportSize2[1],
  4292. c = o / l > n / r
  4293. a
  4294. ? ((t.style.width = c ? 'auto' : '100%'),
  4295. (t.style.height = c ? '100%' : 'auto'))
  4296. : ((t.style.maxWidth = c ? (l / r) * n + 'px' : null),
  4297. (t.style.margin = c ? '0 auto' : null))
  4298. },
  4299. r = function r() {
  4300. clearTimeout(s.resized), (s.resized = setTimeout(n, 50))
  4301. }
  4302. on.call(
  4303. e,
  4304. i.container,
  4305. 'enterfullscreen exitfullscreen',
  4306. function (t) {
  4307. var s = e.fullscreen.target
  4308. if (s !== i.container) return
  4309. if (!e.isEmbed && is.empty(e.config.ratio)) return
  4310. n()
  4311. ;('enterfullscreen' === t.type ? on : off).call(
  4312. e,
  4313. window,
  4314. 'resize',
  4315. r
  4316. )
  4317. }
  4318. )
  4319. }),
  4320. _defineProperty$1(this, 'media', function () {
  4321. var e = _this28.player,
  4322. t = e.elements
  4323. if (
  4324. (on.call(
  4325. e,
  4326. e.media,
  4327. 'timeupdate seeking seeked',
  4328. function (t) {
  4329. return controls.timeUpdate.call(e, t)
  4330. }
  4331. ),
  4332. on.call(
  4333. e,
  4334. e.media,
  4335. 'durationchange loadeddata loadedmetadata',
  4336. function (t) {
  4337. return controls.durationUpdate.call(e, t)
  4338. }
  4339. ),
  4340. on.call(e, e.media, 'ended', function () {
  4341. e.isHTML5 &&
  4342. e.isVideo &&
  4343. e.config.resetOnEnd &&
  4344. (e.restart(), e.pause())
  4345. }),
  4346. on.call(
  4347. e,
  4348. e.media,
  4349. 'progress playing seeking seeked',
  4350. function (t) {
  4351. return controls.updateProgress.call(e, t)
  4352. }
  4353. ),
  4354. on.call(e, e.media, 'volumechange', function (t) {
  4355. return controls.updateVolume.call(e, t)
  4356. }),
  4357. on.call(
  4358. e,
  4359. e.media,
  4360. 'playing play pause ended emptied timeupdate',
  4361. function (t) {
  4362. return ui.checkPlaying.call(e, t)
  4363. }
  4364. ),
  4365. on.call(
  4366. e,
  4367. e.media,
  4368. 'waiting canplay seeked playing',
  4369. function (t) {
  4370. return ui.checkLoading.call(e, t)
  4371. }
  4372. ),
  4373. e.supported.ui && e.config.clickToPlay && !e.isAudio)
  4374. ) {
  4375. var _i7 = getElement.call(
  4376. e,
  4377. '.'.concat(e.config.classNames.video)
  4378. )
  4379. if (!is.element(_i7)) return
  4380. on.call(e, t.container, 'click', function (s) {
  4381. ;([t.container, _i7].includes(s.target) ||
  4382. _i7.contains(s.target)) &&
  4383. ((e.touch && e.config.hideControls) ||
  4384. (e.ended
  4385. ? (_this28.proxy(s, e.restart, 'restart'),
  4386. _this28.proxy(
  4387. s,
  4388. function () {
  4389. silencePromise(e.play())
  4390. },
  4391. 'play'
  4392. ))
  4393. : _this28.proxy(
  4394. s,
  4395. function () {
  4396. silencePromise(e.togglePlay())
  4397. },
  4398. 'play'
  4399. )))
  4400. })
  4401. }
  4402. e.supported.ui &&
  4403. e.config.disableContextMenu &&
  4404. on.call(
  4405. e,
  4406. t.wrapper,
  4407. 'contextmenu',
  4408. function (e) {
  4409. e.preventDefault()
  4410. },
  4411. !1
  4412. ),
  4413. on.call(e, e.media, 'volumechange', function () {
  4414. e.storage.set({ volume: e.volume, muted: e.muted })
  4415. }),
  4416. on.call(e, e.media, 'ratechange', function () {
  4417. controls.updateSetting.call(e, 'speed'),
  4418. e.storage.set({ speed: e.speed })
  4419. }),
  4420. on.call(e, e.media, 'qualitychange', function (t) {
  4421. controls.updateSetting.call(
  4422. e,
  4423. 'quality',
  4424. null,
  4425. t.detail.quality
  4426. )
  4427. }),
  4428. on.call(e, e.media, 'ready qualitychange', function () {
  4429. controls.setDownloadUrl.call(e)
  4430. })
  4431. var i = e.config.events.concat(['keyup', 'keydown']).join(' ')
  4432. on.call(e, e.media, i, function (i) {
  4433. var _i$detail = i.detail,
  4434. s = _i$detail === void 0 ? {} : _i$detail
  4435. 'error' === i.type && (s = e.media.error),
  4436. triggerEvent.call(e, t.container, i.type, !0, s)
  4437. })
  4438. }),
  4439. _defineProperty$1(this, 'proxy', function (e, t, i) {
  4440. var s = _this28.player,
  4441. n = s.config.listeners[i]
  4442. var r = !0
  4443. is.function(n) && (r = n.call(s, e)),
  4444. !1 !== r && is.function(t) && t.call(s, e)
  4445. }),
  4446. _defineProperty$1(this, 'bind', function (e, t, i, s) {
  4447. var n =
  4448. arguments.length > 4 && arguments[4] !== undefined
  4449. ? arguments[4]
  4450. : !0
  4451. var r = _this28.player,
  4452. a = r.config.listeners[s],
  4453. o = is.function(a)
  4454. on.call(
  4455. r,
  4456. e,
  4457. t,
  4458. function (e) {
  4459. return _this28.proxy(e, i, s)
  4460. },
  4461. n && !o
  4462. )
  4463. }),
  4464. _defineProperty$1(this, 'controls', function () {
  4465. var e = _this28.player,
  4466. t = e.elements,
  4467. i = browser.isIE ? 'change' : 'input'
  4468. if (
  4469. (t.buttons.play &&
  4470. Array.from(t.buttons.play).forEach(function (t) {
  4471. _this28.bind(
  4472. t,
  4473. 'click',
  4474. function () {
  4475. silencePromise(e.togglePlay())
  4476. },
  4477. 'play'
  4478. )
  4479. }),
  4480. _this28.bind(
  4481. t.buttons.restart,
  4482. 'click',
  4483. e.restart,
  4484. 'restart'
  4485. ),
  4486. _this28.bind(
  4487. t.buttons.rewind,
  4488. 'click',
  4489. function () {
  4490. ;(e.lastSeekTime = Date.now()), e.rewind()
  4491. },
  4492. 'rewind'
  4493. ),
  4494. _this28.bind(
  4495. t.buttons.fastForward,
  4496. 'click',
  4497. function () {
  4498. ;(e.lastSeekTime = Date.now()), e.forward()
  4499. },
  4500. 'fastForward'
  4501. ),
  4502. _this28.bind(
  4503. t.buttons.mute,
  4504. 'click',
  4505. function () {
  4506. e.muted = !e.muted
  4507. },
  4508. 'mute'
  4509. ),
  4510. _this28.bind(t.buttons.captions, 'click', function () {
  4511. return e.toggleCaptions()
  4512. }),
  4513. _this28.bind(
  4514. t.buttons.download,
  4515. 'click',
  4516. function () {
  4517. triggerEvent.call(e, e.media, 'download')
  4518. },
  4519. 'download'
  4520. ),
  4521. _this28.bind(
  4522. t.buttons.fullscreen,
  4523. 'click',
  4524. function () {
  4525. e.fullscreen.toggle()
  4526. },
  4527. 'fullscreen'
  4528. ),
  4529. _this28.bind(
  4530. t.buttons.pip,
  4531. 'click',
  4532. function () {
  4533. e.pip = 'toggle'
  4534. },
  4535. 'pip'
  4536. ),
  4537. _this28.bind(
  4538. t.buttons.airplay,
  4539. 'click',
  4540. e.airplay,
  4541. 'airplay'
  4542. ),
  4543. _this28.bind(
  4544. t.buttons.settings,
  4545. 'click',
  4546. function (t) {
  4547. t.stopPropagation(),
  4548. t.preventDefault(),
  4549. controls.toggleMenu.call(e, t)
  4550. },
  4551. null,
  4552. !1
  4553. ),
  4554. _this28.bind(
  4555. t.buttons.settings,
  4556. 'keyup',
  4557. function (t) {
  4558. ;['Space', 'Enter'].includes(t.key) &&
  4559. ('Enter' !== t.key
  4560. ? (t.preventDefault(),
  4561. t.stopPropagation(),
  4562. controls.toggleMenu.call(e, t))
  4563. : controls.focusFirstMenuItem.call(e, null, !0))
  4564. },
  4565. null,
  4566. !1
  4567. ),
  4568. _this28.bind(t.settings.menu, 'keydown', function (t) {
  4569. 'Escape' === t.key && controls.toggleMenu.call(e, t)
  4570. }),
  4571. _this28.bind(
  4572. t.inputs.seek,
  4573. 'mousedown mousemove',
  4574. function (e) {
  4575. var i = t.progress.getBoundingClientRect(),
  4576. s = (100 / i.width) * (e.pageX - i.left)
  4577. e.currentTarget.setAttribute('seek-value', s)
  4578. }
  4579. ),
  4580. _this28.bind(
  4581. t.inputs.seek,
  4582. 'mousedown mouseup keydown keyup touchstart touchend',
  4583. function (t) {
  4584. var i = t.currentTarget,
  4585. s = 'play-on-seeked'
  4586. if (
  4587. is.keyboardEvent(t) &&
  4588. !['ArrowLeft', 'ArrowRight'].includes(t.key)
  4589. )
  4590. return
  4591. e.lastSeekTime = Date.now()
  4592. var n = i.hasAttribute(s),
  4593. r = ['mouseup', 'touchend', 'keyup'].includes(t.type)
  4594. n && r
  4595. ? (i.removeAttribute(s), silencePromise(e.play()))
  4596. : !r &&
  4597. e.playing &&
  4598. (i.setAttribute(s, ''), e.pause())
  4599. }
  4600. ),
  4601. browser.isIos)
  4602. ) {
  4603. var _t11 = getElements.call(e, 'input[type="range"]')
  4604. Array.from(_t11).forEach(function (e) {
  4605. return _this28.bind(e, i, function (e) {
  4606. return repaint(e.target)
  4607. })
  4608. })
  4609. }
  4610. _this28.bind(
  4611. t.inputs.seek,
  4612. i,
  4613. function (t) {
  4614. var i = t.currentTarget
  4615. var s = i.getAttribute('seek-value')
  4616. is.empty(s) && (s = i.value),
  4617. i.removeAttribute('seek-value'),
  4618. (e.currentTime = (s / i.max) * e.duration)
  4619. },
  4620. 'seek'
  4621. ),
  4622. _this28.bind(
  4623. t.progress,
  4624. 'mouseenter mouseleave mousemove',
  4625. function (t) {
  4626. return controls.updateSeekTooltip.call(e, t)
  4627. }
  4628. ),
  4629. _this28.bind(
  4630. t.progress,
  4631. 'mousemove touchmove',
  4632. function (t) {
  4633. var i = e.previewThumbnails
  4634. i && i.loaded && i.startMove(t)
  4635. }
  4636. ),
  4637. _this28.bind(
  4638. t.progress,
  4639. 'mouseleave touchend click',
  4640. function () {
  4641. var t = e.previewThumbnails
  4642. t && t.loaded && t.endMove(!1, !0)
  4643. }
  4644. ),
  4645. _this28.bind(
  4646. t.progress,
  4647. 'mousedown touchstart',
  4648. function (t) {
  4649. var i = e.previewThumbnails
  4650. i && i.loaded && i.startScrubbing(t)
  4651. }
  4652. ),
  4653. _this28.bind(t.progress, 'mouseup touchend', function (t) {
  4654. var i = e.previewThumbnails
  4655. i && i.loaded && i.endScrubbing(t)
  4656. }),
  4657. browser.isWebkit &&
  4658. Array.from(
  4659. getElements.call(e, 'input[type="range"]')
  4660. ).forEach(function (t) {
  4661. _this28.bind(t, 'input', function (t) {
  4662. return controls.updateRangeFill.call(e, t.target)
  4663. })
  4664. }),
  4665. e.config.toggleInvert &&
  4666. !is.element(t.display.duration) &&
  4667. _this28.bind(t.display.currentTime, 'click', function () {
  4668. 0 !== e.currentTime &&
  4669. ((e.config.invertTime = !e.config.invertTime),
  4670. controls.timeUpdate.call(e))
  4671. }),
  4672. _this28.bind(
  4673. t.inputs.volume,
  4674. i,
  4675. function (t) {
  4676. e.volume = t.target.value
  4677. },
  4678. 'volume'
  4679. ),
  4680. _this28.bind(
  4681. t.controls,
  4682. 'mouseenter mouseleave',
  4683. function (i) {
  4684. t.controls.hover = !e.touch && 'mouseenter' === i.type
  4685. }
  4686. ),
  4687. t.fullscreen &&
  4688. Array.from(t.fullscreen.children)
  4689. .filter(function (e) {
  4690. return !e.contains(t.container)
  4691. })
  4692. .forEach(function (i) {
  4693. _this28.bind(
  4694. i,
  4695. 'mouseenter mouseleave',
  4696. function (i) {
  4697. t.controls &&
  4698. (t.controls.hover =
  4699. !e.touch && 'mouseenter' === i.type)
  4700. }
  4701. )
  4702. }),
  4703. _this28.bind(
  4704. t.controls,
  4705. 'mousedown mouseup touchstart touchend touchcancel',
  4706. function (e) {
  4707. t.controls.pressed = [
  4708. 'mousedown',
  4709. 'touchstart'
  4710. ].includes(e.type)
  4711. }
  4712. ),
  4713. _this28.bind(t.controls, 'focusin', function () {
  4714. var i = e.config,
  4715. s = e.timers
  4716. toggleClass(t.controls, i.classNames.noTransition, !0),
  4717. ui.toggleControls.call(e, !0),
  4718. setTimeout(function () {
  4719. toggleClass(t.controls, i.classNames.noTransition, !1)
  4720. }, 0)
  4721. var n = _this28.touch ? 3e3 : 4e3
  4722. clearTimeout(s.controls),
  4723. (s.controls = setTimeout(function () {
  4724. return ui.toggleControls.call(e, !1)
  4725. }, n))
  4726. }),
  4727. _this28.bind(
  4728. t.inputs.volume,
  4729. 'wheel',
  4730. function (t) {
  4731. var i = t.webkitDirectionInvertedFromDevice,
  4732. _map = [t.deltaX, -t.deltaY].map(function (e) {
  4733. return i ? -e : e
  4734. }),
  4735. _map2 = _slicedToArray(_map, 2),
  4736. s = _map2[0],
  4737. n = _map2[1],
  4738. r = Math.sign(Math.abs(s) > Math.abs(n) ? s : n)
  4739. e.increaseVolume(r / 50)
  4740. var a = e.media.volume
  4741. ;((1 === r && a < 1) || (-1 === r && a > 0)) &&
  4742. t.preventDefault()
  4743. },
  4744. 'volume',
  4745. !1
  4746. )
  4747. }),
  4748. (this.player = e),
  4749. (this.lastKey = null),
  4750. (this.focusTimer = null),
  4751. (this.lastKeyDown = null),
  4752. (this.handleKey = this.handleKey.bind(this)),
  4753. (this.toggleMenu = this.toggleMenu.bind(this)),
  4754. (this.setTabFocus = this.setTabFocus.bind(this)),
  4755. (this.firstTouch = this.firstTouch.bind(this))
  4756. }
  4757. _createClass2(Listeners, [
  4758. {
  4759. key: 'handleKey',
  4760. value: function handleKey(e) {
  4761. var t = this.player,
  4762. i = t.elements,
  4763. s = e.key,
  4764. n = e.type,
  4765. r = e.altKey,
  4766. a = e.ctrlKey,
  4767. o = e.metaKey,
  4768. l = e.shiftKey,
  4769. c = 'keydown' === n,
  4770. u = c && s === this.lastKey
  4771. if (r || a || o || l) return
  4772. if (!s) return
  4773. if (c) {
  4774. var _n4 = document.activeElement
  4775. if (is.element(_n4)) {
  4776. var _s6 = t.config.selectors.editable,
  4777. _r3 = i.inputs.seek
  4778. if (_n4 !== _r3 && matches(_n4, _s6)) return
  4779. if (
  4780. 'Space' === e.key &&
  4781. matches(_n4, 'button, [role^="menuitem"]')
  4782. )
  4783. return
  4784. }
  4785. switch (
  4786. ([
  4787. 'Space',
  4788. 'ArrowLeft',
  4789. 'ArrowUp',
  4790. 'ArrowRight',
  4791. 'ArrowDown',
  4792. '0',
  4793. '1',
  4794. '2',
  4795. '3',
  4796. '4',
  4797. '5',
  4798. '6',
  4799. '7',
  4800. '8',
  4801. '9',
  4802. 'c',
  4803. 'f',
  4804. 'k',
  4805. 'l',
  4806. 'm'
  4807. ].includes(s) &&
  4808. (e.preventDefault(), e.stopPropagation()),
  4809. s)
  4810. ) {
  4811. case '0':
  4812. case '1':
  4813. case '2':
  4814. case '3':
  4815. case '4':
  4816. case '5':
  4817. case '6':
  4818. case '7':
  4819. case '8':
  4820. case '9':
  4821. u ||
  4822. ((d = parseInt(s, 10)),
  4823. (t.currentTime = (t.duration / 10) * d))
  4824. break
  4825. case 'Space':
  4826. case 'k':
  4827. u || silencePromise(t.togglePlay())
  4828. break
  4829. case 'ArrowUp':
  4830. t.increaseVolume(0.1)
  4831. break
  4832. case 'ArrowDown':
  4833. t.decreaseVolume(0.1)
  4834. break
  4835. case 'm':
  4836. u || (t.muted = !t.muted)
  4837. break
  4838. case 'ArrowRight':
  4839. t.forward()
  4840. break
  4841. case 'ArrowLeft':
  4842. t.rewind()
  4843. break
  4844. case 'f':
  4845. t.fullscreen.toggle()
  4846. break
  4847. case 'c':
  4848. u || t.toggleCaptions()
  4849. break
  4850. case 'l':
  4851. t.loop = !t.loop
  4852. }
  4853. 'Escape' === s &&
  4854. !t.fullscreen.usingNative &&
  4855. t.fullscreen.active &&
  4856. t.fullscreen.toggle(),
  4857. (this.lastKey = s)
  4858. } else this.lastKey = null
  4859. var d
  4860. }
  4861. },
  4862. {
  4863. key: 'toggleMenu',
  4864. value: function toggleMenu(e) {
  4865. controls.toggleMenu.call(this.player, e)
  4866. }
  4867. }
  4868. ])
  4869. return Listeners
  4870. })()
  4871. function createCommonjsModule(e, t) {
  4872. return e((t = { exports: {} }), t.exports), t.exports
  4873. }
  4874. var loadjs_umd = createCommonjsModule(function (e, t) {
  4875. e.exports = (function () {
  4876. var e = function e() {},
  4877. t = {},
  4878. i = {},
  4879. s = {}
  4880. function n(e, t) {
  4881. e = e.push ? e : [e]
  4882. var n,
  4883. r,
  4884. a,
  4885. o = [],
  4886. l = e.length,
  4887. c = l
  4888. for (
  4889. n = function n(e, i) {
  4890. i.length && o.push(e), --c || t(o)
  4891. };
  4892. l--;
  4893. ) {
  4894. ;(r = e[l]),
  4895. (a = i[r]) ? n(r, a) : (s[r] = s[r] || []).push(n)
  4896. }
  4897. }
  4898. function r(e, t) {
  4899. if (e) {
  4900. var n = s[e]
  4901. if (((i[e] = t), n))
  4902. for (; n.length; ) {
  4903. n[0](e, t), n.splice(0, 1)
  4904. }
  4905. }
  4906. }
  4907. function a(t, i) {
  4908. t.call && (t = { success: t }),
  4909. i.length ? (t.error || e)(i) : (t.success || e)(t)
  4910. }
  4911. function o(t, i, s, n) {
  4912. var r,
  4913. a,
  4914. l = document,
  4915. c = s.async,
  4916. u = (s.numRetries || 0) + 1,
  4917. d = s.before || e,
  4918. h = t.replace(/[\?|#].*$/, ''),
  4919. m = t.replace(/^(css|img)!/, '')
  4920. ;(n = n || 0),
  4921. /(^css!|\.css$)/.test(h)
  4922. ? (((a = l.createElement('link')).rel = 'stylesheet'),
  4923. (a.href = m),
  4924. (r = 'hideFocus' in a) &&
  4925. a.relList &&
  4926. ((r = 0), (a.rel = 'preload'), (a.as = 'style')))
  4927. : /(^img!|\.(png|gif|jpg|svg|webp)$)/.test(h)
  4928. ? ((a = l.createElement('img')).src = m)
  4929. : (((a = l.createElement('script')).src = t),
  4930. (a.async = void 0 === c || c)),
  4931. (a.onload =
  4932. a.onerror =
  4933. a.onbeforeload =
  4934. function (e) {
  4935. var l = e.type[0]
  4936. if (r)
  4937. try {
  4938. a.sheet.cssText.length || (l = 'e')
  4939. } catch (e) {
  4940. 18 != e.code && (l = 'e')
  4941. }
  4942. if ('e' == l) {
  4943. if ((n += 1) < u) return o(t, i, s, n)
  4944. } else if ('preload' == a.rel && 'style' == a.as)
  4945. return (a.rel = 'stylesheet')
  4946. i(t, l, e.defaultPrevented)
  4947. }),
  4948. !1 !== d(t, a) && l.head.appendChild(a)
  4949. }
  4950. function l(e, t, i) {
  4951. var s,
  4952. n,
  4953. r = (e = e.push ? e : [e]).length,
  4954. a = r,
  4955. l = []
  4956. for (
  4957. s = function s(e, i, _s7) {
  4958. if (('e' == i && l.push(e), 'b' == i)) {
  4959. if (!_s7) return
  4960. l.push(e)
  4961. }
  4962. --r || t(l)
  4963. },
  4964. n = 0;
  4965. n < a;
  4966. n++
  4967. ) {
  4968. o(e[n], s, i)
  4969. }
  4970. }
  4971. function c(e, i, s) {
  4972. var n, o
  4973. if ((i && i.trim && (n = i), (o = (n ? s : i) || {}), n)) {
  4974. if (n in t) throw 'LoadJS'
  4975. t[n] = !0
  4976. }
  4977. function c(t, i) {
  4978. l(
  4979. e,
  4980. function (e) {
  4981. a(o, e), t && a({ success: t, error: i }, e), r(n, e)
  4982. },
  4983. o
  4984. )
  4985. }
  4986. if (o.returnPromise) return new Promise(c)
  4987. c()
  4988. }
  4989. return (
  4990. (c.ready = function (e, t) {
  4991. return (
  4992. n(e, function (e) {
  4993. a(t, e)
  4994. }),
  4995. c
  4996. )
  4997. }),
  4998. (c.done = function (e) {
  4999. r(e, [])
  5000. }),
  5001. (c.reset = function () {
  5002. ;(t = {}), (i = {}), (s = {})
  5003. }),
  5004. (c.isDefined = function (e) {
  5005. return e in t
  5006. }),
  5007. c
  5008. )
  5009. })()
  5010. })
  5011. function loadScript(e) {
  5012. return new Promise(function (t, i) {
  5013. loadjs_umd(e, { success: t, error: i })
  5014. })
  5015. }
  5016. function parseId$1(e) {
  5017. if (is.empty(e)) return null
  5018. if (is.number(Number(e))) return e
  5019. return e.match(/^.*(vimeo.com\/|video\/)(\d+).*/) ? RegExp.$2 : e
  5020. }
  5021. function parseHash(e) {
  5022. var t = e.match(
  5023. /^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/
  5024. )
  5025. return t && 5 === t.length ? t[4] : null
  5026. }
  5027. function assurePlaybackState$1(e) {
  5028. e && !this.embed.hasPlayed && (this.embed.hasPlayed = !0),
  5029. this.media.paused === e &&
  5030. ((this.media.paused = !e),
  5031. triggerEvent.call(this, this.media, e ? 'play' : 'pause'))
  5032. }
  5033. var vimeo = {
  5034. setup: function setup() {
  5035. var e = this
  5036. toggleClass(e.elements.wrapper, e.config.classNames.embed, !0),
  5037. (e.options.speed = e.config.speed.options),
  5038. setAspectRatio.call(e),
  5039. is.object(window.Vimeo)
  5040. ? vimeo.ready.call(e)
  5041. : loadScript(e.config.urls.vimeo.sdk)
  5042. .then(function () {
  5043. vimeo.ready.call(e)
  5044. })
  5045. .catch(function (t) {
  5046. e.debug.warn('Vimeo SDK (player.js) failed to load', t)
  5047. })
  5048. },
  5049. ready: function ready() {
  5050. var _this29 = this
  5051. var e = this,
  5052. t = e.config.vimeo,
  5053. i = t.premium,
  5054. s = t.referrerPolicy,
  5055. n = _objectWithoutProperties(t, _excluded)
  5056. var r = e.media.getAttribute('src'),
  5057. a = ''
  5058. is.empty(r)
  5059. ? ((r = e.media.getAttribute(e.config.attributes.embed.id)),
  5060. (a = e.media.getAttribute(e.config.attributes.embed.hash)))
  5061. : (a = parseHash(r))
  5062. var o = a ? { h: a } : {}
  5063. i && Object.assign(n, { controls: !1, sidedock: !1 })
  5064. var l = buildUrlParams(
  5065. _objectSpread(
  5066. _objectSpread(
  5067. {
  5068. loop: e.config.loop.active,
  5069. autoplay: e.autoplay,
  5070. muted: e.muted,
  5071. gesture: 'media',
  5072. playsinline: !this.config.fullscreen.iosNative
  5073. },
  5074. o
  5075. ),
  5076. n
  5077. )
  5078. ),
  5079. c = parseId$1(r),
  5080. u = createElement('iframe'),
  5081. d = format(e.config.urls.vimeo.iframe, c, l)
  5082. if (
  5083. (u.setAttribute('src', d),
  5084. u.setAttribute('allowfullscreen', ''),
  5085. u.setAttribute(
  5086. 'allow',
  5087. [
  5088. 'autoplay',
  5089. 'fullscreen',
  5090. 'picture-in-picture',
  5091. 'encrypted-media',
  5092. 'accelerometer',
  5093. 'gyroscope'
  5094. ].join('; ')
  5095. ),
  5096. is.empty(s) || u.setAttribute('referrerPolicy', s),
  5097. i || !t.customControls)
  5098. )
  5099. u.setAttribute('data-poster', e.poster),
  5100. (e.media = replaceElement(u, e.media))
  5101. else {
  5102. var _t12 = createElement('div', {
  5103. class: e.config.classNames.embedContainer,
  5104. 'data-poster': e.poster
  5105. })
  5106. _t12.appendChild(u), (e.media = replaceElement(_t12, e.media))
  5107. }
  5108. t.customControls ||
  5109. fetch(format(e.config.urls.vimeo.api, d)).then(function (t) {
  5110. !is.empty(t) &&
  5111. t.thumbnail_url &&
  5112. ui.setPoster.call(e, t.thumbnail_url).catch(function () {})
  5113. }),
  5114. (e.embed = new window.Vimeo.Player(u, {
  5115. autopause: e.config.autopause,
  5116. muted: e.muted
  5117. })),
  5118. (e.media.paused = !0),
  5119. (e.media.currentTime = 0),
  5120. e.supported.ui && e.embed.disableTextTrack(),
  5121. (e.media.play = function () {
  5122. return assurePlaybackState$1.call(e, !0), e.embed.play()
  5123. }),
  5124. (e.media.pause = function () {
  5125. return assurePlaybackState$1.call(e, !1), e.embed.pause()
  5126. }),
  5127. (e.media.stop = function () {
  5128. e.pause(), (e.currentTime = 0)
  5129. })
  5130. var h = e.media.currentTime
  5131. Object.defineProperty(e.media, 'currentTime', {
  5132. get: function get() {
  5133. return h
  5134. },
  5135. set: function set(t) {
  5136. var i = e.embed,
  5137. s = e.media,
  5138. n = e.paused,
  5139. r = e.volume,
  5140. a = n && !i.hasPlayed
  5141. ;(s.seeking = !0),
  5142. triggerEvent.call(e, s, 'seeking'),
  5143. Promise.resolve(a && i.setVolume(0))
  5144. .then(function () {
  5145. return i.setCurrentTime(t)
  5146. })
  5147. .then(function () {
  5148. return a && i.pause()
  5149. })
  5150. .then(function () {
  5151. return a && i.setVolume(r)
  5152. })
  5153. .catch(function () {})
  5154. }
  5155. })
  5156. var m = e.config.speed.selected
  5157. Object.defineProperty(e.media, 'playbackRate', {
  5158. get: function get() {
  5159. return m
  5160. },
  5161. set: function set(t) {
  5162. e.embed
  5163. .setPlaybackRate(t)
  5164. .then(function () {
  5165. ;(m = t), triggerEvent.call(e, e.media, 'ratechange')
  5166. })
  5167. .catch(function () {
  5168. e.options.speed = [1]
  5169. })
  5170. }
  5171. })
  5172. var p = e.config.volume
  5173. Object.defineProperty(e.media, 'volume', {
  5174. get: function get() {
  5175. return p
  5176. },
  5177. set: function set(t) {
  5178. e.embed.setVolume(t).then(function () {
  5179. ;(p = t), triggerEvent.call(e, e.media, 'volumechange')
  5180. })
  5181. }
  5182. })
  5183. var g = e.config.muted
  5184. Object.defineProperty(e.media, 'muted', {
  5185. get: function get() {
  5186. return g
  5187. },
  5188. set: function set(t) {
  5189. var i = !!is.boolean(t) && t
  5190. e.embed.setVolume(i ? 0 : e.config.volume).then(function () {
  5191. ;(g = i), triggerEvent.call(e, e.media, 'volumechange')
  5192. })
  5193. }
  5194. })
  5195. var f,
  5196. y = e.config.loop
  5197. Object.defineProperty(e.media, 'loop', {
  5198. get: function get() {
  5199. return y
  5200. },
  5201. set: function set(t) {
  5202. var i = is.boolean(t) ? t : e.config.loop.active
  5203. e.embed.setLoop(i).then(function () {
  5204. y = i
  5205. })
  5206. }
  5207. }),
  5208. e.embed
  5209. .getVideoUrl()
  5210. .then(function (t) {
  5211. ;(f = t), controls.setDownloadUrl.call(e)
  5212. })
  5213. .catch(function (e) {
  5214. _this29.debug.warn(e)
  5215. }),
  5216. Object.defineProperty(e.media, 'currentSrc', {
  5217. get: function get() {
  5218. return f
  5219. }
  5220. }),
  5221. Object.defineProperty(e.media, 'ended', {
  5222. get: function get() {
  5223. return e.currentTime === e.duration
  5224. }
  5225. }),
  5226. Promise.all([
  5227. e.embed.getVideoWidth(),
  5228. e.embed.getVideoHeight()
  5229. ]).then(function (t) {
  5230. var _t13 = _slicedToArray(t, 2),
  5231. i = _t13[0],
  5232. s = _t13[1]
  5233. ;(e.embed.ratio = roundAspectRatio(i, s)),
  5234. setAspectRatio.call(_this29)
  5235. }),
  5236. e.embed.setAutopause(e.config.autopause).then(function (t) {
  5237. e.config.autopause = t
  5238. }),
  5239. e.embed.getVideoTitle().then(function (t) {
  5240. ;(e.config.title = t), ui.setTitle.call(_this29)
  5241. }),
  5242. e.embed.getCurrentTime().then(function (t) {
  5243. ;(h = t), triggerEvent.call(e, e.media, 'timeupdate')
  5244. }),
  5245. e.embed.getDuration().then(function (t) {
  5246. ;(e.media.duration = t),
  5247. triggerEvent.call(e, e.media, 'durationchange')
  5248. }),
  5249. e.embed.getTextTracks().then(function (t) {
  5250. ;(e.media.textTracks = t), captions.setup.call(e)
  5251. }),
  5252. e.embed.on('cuechange', function (_ref17) {
  5253. var _ref17$cues = _ref17.cues,
  5254. t = _ref17$cues === void 0 ? [] : _ref17$cues
  5255. var i = t.map(function (e) {
  5256. return stripHTML(e.text)
  5257. })
  5258. captions.updateCues.call(e, i)
  5259. }),
  5260. e.embed.on('loaded', function () {
  5261. if (
  5262. (e.embed.getPaused().then(function (t) {
  5263. assurePlaybackState$1.call(e, !t),
  5264. t || triggerEvent.call(e, e.media, 'playing')
  5265. }),
  5266. is.element(e.embed.element) && e.supported.ui)
  5267. ) {
  5268. e.embed.element.setAttribute('tabindex', -1)
  5269. }
  5270. }),
  5271. e.embed.on('bufferstart', function () {
  5272. triggerEvent.call(e, e.media, 'waiting')
  5273. }),
  5274. e.embed.on('bufferend', function () {
  5275. triggerEvent.call(e, e.media, 'playing')
  5276. }),
  5277. e.embed.on('play', function () {
  5278. assurePlaybackState$1.call(e, !0),
  5279. triggerEvent.call(e, e.media, 'playing')
  5280. }),
  5281. e.embed.on('pause', function () {
  5282. assurePlaybackState$1.call(e, !1)
  5283. }),
  5284. e.embed.on('timeupdate', function (t) {
  5285. ;(e.media.seeking = !1),
  5286. (h = t.seconds),
  5287. triggerEvent.call(e, e.media, 'timeupdate')
  5288. }),
  5289. e.embed.on('progress', function (t) {
  5290. ;(e.media.buffered = t.percent),
  5291. triggerEvent.call(e, e.media, 'progress'),
  5292. 1 === parseInt(t.percent, 10) &&
  5293. triggerEvent.call(e, e.media, 'canplaythrough'),
  5294. e.embed.getDuration().then(function (t) {
  5295. t !== e.media.duration &&
  5296. ((e.media.duration = t),
  5297. triggerEvent.call(e, e.media, 'durationchange'))
  5298. })
  5299. }),
  5300. e.embed.on('seeked', function () {
  5301. ;(e.media.seeking = !1),
  5302. triggerEvent.call(e, e.media, 'seeked')
  5303. }),
  5304. e.embed.on('ended', function () {
  5305. ;(e.media.paused = !0), triggerEvent.call(e, e.media, 'ended')
  5306. }),
  5307. e.embed.on('error', function (t) {
  5308. ;(e.media.error = t), triggerEvent.call(e, e.media, 'error')
  5309. }),
  5310. t.customControls &&
  5311. setTimeout(function () {
  5312. return ui.build.call(e)
  5313. }, 0)
  5314. }
  5315. }
  5316. function parseId(e) {
  5317. if (is.empty(e)) return null
  5318. return e.match(
  5319. /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/
  5320. )
  5321. ? RegExp.$2
  5322. : e
  5323. }
  5324. function assurePlaybackState(e) {
  5325. e && !this.embed.hasPlayed && (this.embed.hasPlayed = !0),
  5326. this.media.paused === e &&
  5327. ((this.media.paused = !e),
  5328. triggerEvent.call(this, this.media, e ? 'play' : 'pause'))
  5329. }
  5330. function getHost(e) {
  5331. return e.noCookie
  5332. ? 'https://www.youtube-nocookie.com'
  5333. : 'http:' === window.location.protocol
  5334. ? 'http://www.youtube.com'
  5335. : void 0
  5336. }
  5337. var youtube = {
  5338. setup: function setup() {
  5339. var _this30 = this
  5340. if (
  5341. (toggleClass(
  5342. this.elements.wrapper,
  5343. this.config.classNames.embed,
  5344. !0
  5345. ),
  5346. is.object(window.YT) && is.function(window.YT.Player))
  5347. )
  5348. youtube.ready.call(this)
  5349. else {
  5350. var e = window.onYouTubeIframeAPIReady
  5351. ;(window.onYouTubeIframeAPIReady = function () {
  5352. is.function(e) && e(), youtube.ready.call(_this30)
  5353. }),
  5354. loadScript(this.config.urls.youtube.sdk).catch(function (
  5355. e
  5356. ) {
  5357. _this30.debug.warn('YouTube API failed to load', e)
  5358. })
  5359. }
  5360. },
  5361. getTitle: function getTitle(e) {
  5362. var _this31 = this
  5363. fetch(format(this.config.urls.youtube.api, e))
  5364. .then(function (e) {
  5365. if (is.object(e)) {
  5366. var t = e.title,
  5367. i = e.height,
  5368. s = e.width
  5369. ;(_this31.config.title = t),
  5370. ui.setTitle.call(_this31),
  5371. (_this31.embed.ratio = roundAspectRatio(s, i))
  5372. }
  5373. setAspectRatio.call(_this31)
  5374. })
  5375. .catch(function () {
  5376. setAspectRatio.call(_this31)
  5377. })
  5378. },
  5379. ready: function ready() {
  5380. var e = this,
  5381. t = e.config.youtube,
  5382. i = e.media && e.media.getAttribute('id')
  5383. if (!is.empty(i) && i.startsWith('youtube-')) return
  5384. var s = e.media.getAttribute('src')
  5385. is.empty(s) &&
  5386. (s = e.media.getAttribute(this.config.attributes.embed.id))
  5387. var n = parseId(s),
  5388. r = createElement('div', {
  5389. id: generateId(e.provider),
  5390. 'data-poster': t.customControls ? e.poster : void 0
  5391. })
  5392. if (
  5393. ((e.media = replaceElement(r, e.media)), t.customControls)
  5394. ) {
  5395. var _t14 = function _t14(e) {
  5396. return 'https://i.ytimg.com/vi/'
  5397. .concat(n, '/')
  5398. .concat(e, 'default.jpg')
  5399. }
  5400. loadImage(_t14('maxres'), 121)
  5401. .catch(function () {
  5402. return loadImage(_t14('sd'), 121)
  5403. })
  5404. .catch(function () {
  5405. return loadImage(_t14('hq'))
  5406. })
  5407. .then(function (t) {
  5408. return ui.setPoster.call(e, t.src)
  5409. })
  5410. .then(function (t) {
  5411. t.includes('maxres') ||
  5412. (e.elements.poster.style.backgroundSize = 'cover')
  5413. })
  5414. .catch(function () {})
  5415. }
  5416. e.embed = new window.YT.Player(e.media, {
  5417. videoId: n,
  5418. host: getHost(t),
  5419. playerVars: extend(
  5420. {},
  5421. {
  5422. autoplay: e.config.autoplay ? 1 : 0,
  5423. hl: e.config.hl,
  5424. controls: e.supported.ui && t.customControls ? 0 : 1,
  5425. disablekb: 1,
  5426. playsinline: e.config.fullscreen.iosNative ? 0 : 1,
  5427. cc_load_policy: e.captions.active ? 1 : 0,
  5428. cc_lang_pref: e.config.captions.language,
  5429. widget_referrer: window ? window.location.href : null
  5430. },
  5431. t
  5432. ),
  5433. events: {
  5434. onError: function onError(t) {
  5435. if (!e.media.error) {
  5436. var _i8 = t.data,
  5437. _s8 =
  5438. {
  5439. 2: 'The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.',
  5440. 5: 'The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.',
  5441. 100: 'The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.',
  5442. 101: 'The owner of the requested video does not allow it to be played in embedded players.',
  5443. 150: 'The owner of the requested video does not allow it to be played in embedded players.'
  5444. }[_i8] || 'An unknown error occured'
  5445. ;(e.media.error = { code: _i8, message: _s8 }),
  5446. triggerEvent.call(e, e.media, 'error')
  5447. }
  5448. },
  5449. onPlaybackRateChange: function onPlaybackRateChange(t) {
  5450. var i = t.target
  5451. ;(e.media.playbackRate = i.getPlaybackRate()),
  5452. triggerEvent.call(e, e.media, 'ratechange')
  5453. },
  5454. onReady: function onReady(i) {
  5455. if (is.function(e.media.play)) return
  5456. var s = i.target
  5457. youtube.getTitle.call(e, n),
  5458. (e.media.play = function () {
  5459. assurePlaybackState.call(e, !0), s.playVideo()
  5460. }),
  5461. (e.media.pause = function () {
  5462. assurePlaybackState.call(e, !1), s.pauseVideo()
  5463. }),
  5464. (e.media.stop = function () {
  5465. s.stopVideo()
  5466. }),
  5467. (e.media.duration = s.getDuration()),
  5468. (e.media.paused = !0),
  5469. (e.media.currentTime = 0),
  5470. Object.defineProperty(e.media, 'currentTime', {
  5471. get: function get() {
  5472. return Number(s.getCurrentTime())
  5473. },
  5474. set: function set(t) {
  5475. e.paused && !e.embed.hasPlayed && e.embed.mute(),
  5476. (e.media.seeking = !0),
  5477. triggerEvent.call(e, e.media, 'seeking'),
  5478. s.seekTo(t)
  5479. }
  5480. }),
  5481. Object.defineProperty(e.media, 'playbackRate', {
  5482. get: function get() {
  5483. return s.getPlaybackRate()
  5484. },
  5485. set: function set(e) {
  5486. s.setPlaybackRate(e)
  5487. }
  5488. })
  5489. var r = e.config.volume
  5490. Object.defineProperty(e.media, 'volume', {
  5491. get: function get() {
  5492. return r
  5493. },
  5494. set: function set(t) {
  5495. ;(r = t),
  5496. s.setVolume(100 * r),
  5497. triggerEvent.call(e, e.media, 'volumechange')
  5498. }
  5499. })
  5500. var a = e.config.muted
  5501. Object.defineProperty(e.media, 'muted', {
  5502. get: function get() {
  5503. return a
  5504. },
  5505. set: function set(t) {
  5506. var i = is.boolean(t) ? t : a
  5507. ;(a = i),
  5508. s[i ? 'mute' : 'unMute'](),
  5509. s.setVolume(100 * r),
  5510. triggerEvent.call(e, e.media, 'volumechange')
  5511. }
  5512. }),
  5513. Object.defineProperty(e.media, 'currentSrc', {
  5514. get: function get() {
  5515. return s.getVideoUrl()
  5516. }
  5517. }),
  5518. Object.defineProperty(e.media, 'ended', {
  5519. get: function get() {
  5520. return e.currentTime === e.duration
  5521. }
  5522. })
  5523. var o = s.getAvailablePlaybackRates()
  5524. ;(e.options.speed = o.filter(function (t) {
  5525. return e.config.speed.options.includes(t)
  5526. })),
  5527. e.supported.ui &&
  5528. t.customControls &&
  5529. e.media.setAttribute('tabindex', -1),
  5530. triggerEvent.call(e, e.media, 'timeupdate'),
  5531. triggerEvent.call(e, e.media, 'durationchange'),
  5532. clearInterval(e.timers.buffering),
  5533. (e.timers.buffering = setInterval(function () {
  5534. ;(e.media.buffered = s.getVideoLoadedFraction()),
  5535. (null === e.media.lastBuffered ||
  5536. e.media.lastBuffered < e.media.buffered) &&
  5537. triggerEvent.call(e, e.media, 'progress'),
  5538. (e.media.lastBuffered = e.media.buffered),
  5539. 1 === e.media.buffered &&
  5540. (clearInterval(e.timers.buffering),
  5541. triggerEvent.call(e, e.media, 'canplaythrough'))
  5542. }, 200)),
  5543. t.customControls &&
  5544. setTimeout(function () {
  5545. return ui.build.call(e)
  5546. }, 50)
  5547. },
  5548. onStateChange: function onStateChange(i) {
  5549. var s = i.target
  5550. clearInterval(e.timers.playing)
  5551. switch (
  5552. (e.media.seeking &&
  5553. [1, 2].includes(i.data) &&
  5554. ((e.media.seeking = !1),
  5555. triggerEvent.call(e, e.media, 'seeked')),
  5556. i.data)
  5557. ) {
  5558. case -1:
  5559. triggerEvent.call(e, e.media, 'timeupdate'),
  5560. (e.media.buffered = s.getVideoLoadedFraction()),
  5561. triggerEvent.call(e, e.media, 'progress')
  5562. break
  5563. case 0:
  5564. assurePlaybackState.call(e, !1),
  5565. e.media.loop
  5566. ? (s.stopVideo(), s.playVideo())
  5567. : triggerEvent.call(e, e.media, 'ended')
  5568. break
  5569. case 1:
  5570. t.customControls &&
  5571. !e.config.autoplay &&
  5572. e.media.paused &&
  5573. !e.embed.hasPlayed
  5574. ? e.media.pause()
  5575. : (assurePlaybackState.call(e, !0),
  5576. triggerEvent.call(e, e.media, 'playing'),
  5577. (e.timers.playing = setInterval(function () {
  5578. triggerEvent.call(e, e.media, 'timeupdate')
  5579. }, 50)),
  5580. e.media.duration !== s.getDuration() &&
  5581. ((e.media.duration = s.getDuration()),
  5582. triggerEvent.call(
  5583. e,
  5584. e.media,
  5585. 'durationchange'
  5586. )))
  5587. break
  5588. case 2:
  5589. e.muted || e.embed.unMute(),
  5590. assurePlaybackState.call(e, !1)
  5591. break
  5592. case 3:
  5593. triggerEvent.call(e, e.media, 'waiting')
  5594. }
  5595. triggerEvent.call(
  5596. e,
  5597. e.elements.container,
  5598. 'statechange',
  5599. !1,
  5600. { code: i.data }
  5601. )
  5602. }
  5603. }
  5604. })
  5605. }
  5606. },
  5607. media = {
  5608. setup: function setup() {
  5609. this.media
  5610. ? (toggleClass(
  5611. this.elements.container,
  5612. this.config.classNames.type.replace('{0}', this.type),
  5613. !0
  5614. ),
  5615. toggleClass(
  5616. this.elements.container,
  5617. this.config.classNames.provider.replace(
  5618. '{0}',
  5619. this.provider
  5620. ),
  5621. !0
  5622. ),
  5623. this.isEmbed &&
  5624. toggleClass(
  5625. this.elements.container,
  5626. this.config.classNames.type.replace('{0}', 'video'),
  5627. !0
  5628. ),
  5629. this.isVideo &&
  5630. ((this.elements.wrapper = createElement('div', {
  5631. class: this.config.classNames.video
  5632. })),
  5633. wrap(this.media, this.elements.wrapper),
  5634. (this.elements.poster = createElement('div', {
  5635. class: this.config.classNames.poster
  5636. })),
  5637. this.elements.wrapper.appendChild(this.elements.poster)),
  5638. this.isHTML5
  5639. ? html5.setup.call(this)
  5640. : this.isYouTube
  5641. ? youtube.setup.call(this)
  5642. : this.isVimeo && vimeo.setup.call(this))
  5643. : this.debug.warn('No media element found!')
  5644. }
  5645. }
  5646. var Ads = /*#__PURE__*/ (function () {
  5647. function Ads(e) {
  5648. var _this32 = this
  5649. _classCallCheck2(this, Ads)
  5650. _defineProperty$1(this, 'load', function () {
  5651. _this32.enabled &&
  5652. (is.object(window.google) && is.object(window.google.ima)
  5653. ? _this32.ready()
  5654. : loadScript(_this32.player.config.urls.googleIMA.sdk)
  5655. .then(function () {
  5656. _this32.ready()
  5657. })
  5658. .catch(function () {
  5659. _this32.trigger(
  5660. 'error',
  5661. new Error('Google IMA SDK failed to load')
  5662. )
  5663. }))
  5664. }),
  5665. _defineProperty$1(this, 'ready', function () {
  5666. var e
  5667. _this32.enabled ||
  5668. ((e = _this32).manager && e.manager.destroy(),
  5669. e.elements.displayContainer &&
  5670. e.elements.displayContainer.destroy(),
  5671. e.elements.container.remove()),
  5672. _this32.startSafetyTimer(12e3, 'ready()'),
  5673. _this32.managerPromise.then(function () {
  5674. _this32.clearSafetyTimer('onAdsManagerLoaded()')
  5675. }),
  5676. _this32.listeners(),
  5677. _this32.setupIMA()
  5678. }),
  5679. _defineProperty$1(this, 'setupIMA', function () {
  5680. ;(_this32.elements.container = createElement('div', {
  5681. class: _this32.player.config.classNames.ads
  5682. })),
  5683. _this32.player.elements.container.appendChild(
  5684. _this32.elements.container
  5685. ),
  5686. google.ima.settings.setVpaidMode(
  5687. google.ima.ImaSdkSettings.VpaidMode.ENABLED
  5688. ),
  5689. google.ima.settings.setLocale(
  5690. _this32.player.config.ads.language
  5691. ),
  5692. google.ima.settings.setDisableCustomPlaybackForIOS10Plus(
  5693. _this32.player.config.playsinline
  5694. ),
  5695. (_this32.elements.displayContainer =
  5696. new google.ima.AdDisplayContainer(
  5697. _this32.elements.container,
  5698. _this32.player.media
  5699. )),
  5700. (_this32.loader = new google.ima.AdsLoader(
  5701. _this32.elements.displayContainer
  5702. )),
  5703. _this32.loader.addEventListener(
  5704. google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
  5705. function (e) {
  5706. return _this32.onAdsManagerLoaded(e)
  5707. },
  5708. !1
  5709. ),
  5710. _this32.loader.addEventListener(
  5711. google.ima.AdErrorEvent.Type.AD_ERROR,
  5712. function (e) {
  5713. return _this32.onAdError(e)
  5714. },
  5715. !1
  5716. ),
  5717. _this32.requestAds()
  5718. }),
  5719. _defineProperty$1(this, 'requestAds', function () {
  5720. var e = _this32.player.elements.container
  5721. try {
  5722. var t = new google.ima.AdsRequest()
  5723. ;(t.adTagUrl = _this32.tagUrl),
  5724. (t.linearAdSlotWidth = e.offsetWidth),
  5725. (t.linearAdSlotHeight = e.offsetHeight),
  5726. (t.nonLinearAdSlotWidth = e.offsetWidth),
  5727. (t.nonLinearAdSlotHeight = e.offsetHeight),
  5728. (t.forceNonLinearFullSlot = !1),
  5729. t.setAdWillPlayMuted(!_this32.player.muted),
  5730. _this32.loader.requestAds(t)
  5731. } catch (e) {
  5732. _this32.onAdError(e)
  5733. }
  5734. }),
  5735. _defineProperty$1(this, 'pollCountdown', function () {
  5736. var e =
  5737. arguments.length > 0 && arguments[0] !== undefined
  5738. ? arguments[0]
  5739. : !1
  5740. if (!e)
  5741. return (
  5742. clearInterval(_this32.countdownTimer),
  5743. void _this32.elements.container.removeAttribute(
  5744. 'data-badge-text'
  5745. )
  5746. )
  5747. _this32.countdownTimer = setInterval(function () {
  5748. var e = _formatTime(
  5749. Math.max(_this32.manager.getRemainingTime(), 0)
  5750. ),
  5751. t = ''
  5752. .concat(
  5753. i18n.get('advertisement', _this32.player.config),
  5754. ' - '
  5755. )
  5756. .concat(e)
  5757. _this32.elements.container.setAttribute(
  5758. 'data-badge-text',
  5759. t
  5760. )
  5761. }, 100)
  5762. }),
  5763. _defineProperty$1(this, 'onAdsManagerLoaded', function (e) {
  5764. if (!_this32.enabled) return
  5765. var t = new google.ima.AdsRenderingSettings()
  5766. ;(t.restoreCustomPlaybackStateOnAdBreakComplete = !0),
  5767. (t.enablePreloading = !0),
  5768. (_this32.manager = e.getAdsManager(_this32.player, t)),
  5769. (_this32.cuePoints = _this32.manager.getCuePoints()),
  5770. _this32.manager.addEventListener(
  5771. google.ima.AdErrorEvent.Type.AD_ERROR,
  5772. function (e) {
  5773. return _this32.onAdError(e)
  5774. }
  5775. ),
  5776. Object.keys(google.ima.AdEvent.Type).forEach(function (e) {
  5777. _this32.manager.addEventListener(
  5778. google.ima.AdEvent.Type[e],
  5779. function (e) {
  5780. return _this32.onAdEvent(e)
  5781. }
  5782. )
  5783. }),
  5784. _this32.trigger('loaded')
  5785. }),
  5786. _defineProperty$1(this, 'addCuePoints', function () {
  5787. is.empty(_this32.cuePoints) ||
  5788. _this32.cuePoints.forEach(function (e) {
  5789. if (0 !== e && -1 !== e && e < _this32.player.duration) {
  5790. var t = _this32.player.elements.progress
  5791. if (is.element(t)) {
  5792. var i = (100 / _this32.player.duration) * e,
  5793. s = createElement('span', {
  5794. class: _this32.player.config.classNames.cues
  5795. })
  5796. ;(s.style.left = ''.concat(i.toString(), '%')),
  5797. t.appendChild(s)
  5798. }
  5799. }
  5800. })
  5801. }),
  5802. _defineProperty$1(this, 'onAdEvent', function (e) {
  5803. var t = _this32.player.elements.container,
  5804. i = e.getAd(),
  5805. s = e.getAdData()
  5806. switch (
  5807. ((function (e) {
  5808. triggerEvent.call(
  5809. _this32.player,
  5810. _this32.player.media,
  5811. 'ads'.concat(e.replace(/_/g, '').toLowerCase())
  5812. )
  5813. })(e.type),
  5814. e.type)
  5815. ) {
  5816. case google.ima.AdEvent.Type.LOADED:
  5817. _this32.trigger('loaded'),
  5818. _this32.pollCountdown(!0),
  5819. i.isLinear() ||
  5820. ((i.width = t.offsetWidth),
  5821. (i.height = t.offsetHeight))
  5822. break
  5823. case google.ima.AdEvent.Type.STARTED:
  5824. _this32.manager.setVolume(_this32.player.volume)
  5825. break
  5826. case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:
  5827. _this32.player.ended
  5828. ? _this32.loadAds()
  5829. : _this32.loader.contentComplete()
  5830. break
  5831. case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:
  5832. _this32.pauseContent()
  5833. break
  5834. case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:
  5835. _this32.pollCountdown(), _this32.resumeContent()
  5836. break
  5837. case google.ima.AdEvent.Type.LOG:
  5838. s.adError &&
  5839. _this32.player.debug.warn(
  5840. 'Non-fatal ad error: '.concat(s.adError.getMessage())
  5841. )
  5842. }
  5843. }),
  5844. _defineProperty$1(this, 'onAdError', function (e) {
  5845. _this32.cancel(), _this32.player.debug.warn('Ads error', e)
  5846. }),
  5847. _defineProperty$1(this, 'listeners', function () {
  5848. var e = _this32.player.elements.container
  5849. var t
  5850. _this32.player.on('canplay', function () {
  5851. _this32.addCuePoints()
  5852. }),
  5853. _this32.player.on('ended', function () {
  5854. _this32.loader.contentComplete()
  5855. }),
  5856. _this32.player.on('timeupdate', function () {
  5857. t = _this32.player.currentTime
  5858. }),
  5859. _this32.player.on('seeked', function () {
  5860. var e = _this32.player.currentTime
  5861. is.empty(_this32.cuePoints) ||
  5862. _this32.cuePoints.forEach(function (i, s) {
  5863. t < i &&
  5864. i < e &&
  5865. (_this32.manager.discardAdBreak(),
  5866. _this32.cuePoints.splice(s, 1))
  5867. })
  5868. }),
  5869. window.addEventListener('resize', function () {
  5870. _this32.manager &&
  5871. _this32.manager.resize(
  5872. e.offsetWidth,
  5873. e.offsetHeight,
  5874. google.ima.ViewMode.NORMAL
  5875. )
  5876. })
  5877. }),
  5878. _defineProperty$1(this, 'play', function () {
  5879. var e = _this32.player.elements.container
  5880. _this32.managerPromise || _this32.resumeContent(),
  5881. _this32.managerPromise
  5882. .then(function () {
  5883. _this32.manager.setVolume(_this32.player.volume),
  5884. _this32.elements.displayContainer.initialize()
  5885. try {
  5886. _this32.initialized ||
  5887. (_this32.manager.init(
  5888. e.offsetWidth,
  5889. e.offsetHeight,
  5890. google.ima.ViewMode.NORMAL
  5891. ),
  5892. _this32.manager.start()),
  5893. (_this32.initialized = !0)
  5894. } catch (e) {
  5895. _this32.onAdError(e)
  5896. }
  5897. })
  5898. .catch(function () {})
  5899. }),
  5900. _defineProperty$1(this, 'resumeContent', function () {
  5901. ;(_this32.elements.container.style.zIndex = ''),
  5902. (_this32.playing = !1),
  5903. silencePromise(_this32.player.media.play())
  5904. }),
  5905. _defineProperty$1(this, 'pauseContent', function () {
  5906. ;(_this32.elements.container.style.zIndex = 3),
  5907. (_this32.playing = !0),
  5908. _this32.player.media.pause()
  5909. }),
  5910. _defineProperty$1(this, 'cancel', function () {
  5911. _this32.initialized && _this32.resumeContent(),
  5912. _this32.trigger('error'),
  5913. _this32.loadAds()
  5914. }),
  5915. _defineProperty$1(this, 'loadAds', function () {
  5916. _this32.managerPromise
  5917. .then(function () {
  5918. _this32.manager && _this32.manager.destroy(),
  5919. (_this32.managerPromise = new Promise(function (e) {
  5920. _this32.on('loaded', e),
  5921. _this32.player.debug.log(_this32.manager)
  5922. })),
  5923. (_this32.initialized = !1),
  5924. _this32.requestAds()
  5925. })
  5926. .catch(function () {})
  5927. }),
  5928. _defineProperty$1(this, 'trigger', function (e) {
  5929. for (
  5930. var _len4 = arguments.length,
  5931. t = new Array(_len4 > 1 ? _len4 - 1 : 0),
  5932. _key4 = 1;
  5933. _key4 < _len4;
  5934. _key4++
  5935. ) {
  5936. t[_key4 - 1] = arguments[_key4]
  5937. }
  5938. var i = _this32.events[e]
  5939. is.array(i) &&
  5940. i.forEach(function (e) {
  5941. is.function(e) && e.apply(_this32, t)
  5942. })
  5943. }),
  5944. _defineProperty$1(this, 'on', function (e, t) {
  5945. return (
  5946. is.array(_this32.events[e]) || (_this32.events[e] = []),
  5947. _this32.events[e].push(t),
  5948. _this32
  5949. )
  5950. }),
  5951. _defineProperty$1(this, 'startSafetyTimer', function (e, t) {
  5952. _this32.player.debug.log(
  5953. 'Safety timer invoked from: '.concat(t)
  5954. ),
  5955. (_this32.safetyTimer = setTimeout(function () {
  5956. _this32.cancel(),
  5957. _this32.clearSafetyTimer('startSafetyTimer()')
  5958. }, e))
  5959. }),
  5960. _defineProperty$1(this, 'clearSafetyTimer', function (e) {
  5961. is.nullOrUndefined(_this32.safetyTimer) ||
  5962. (_this32.player.debug.log(
  5963. 'Safety timer cleared from: '.concat(e)
  5964. ),
  5965. clearTimeout(_this32.safetyTimer),
  5966. (_this32.safetyTimer = null))
  5967. }),
  5968. (this.player = e),
  5969. (this.config = e.config.ads),
  5970. (this.playing = !1),
  5971. (this.initialized = !1),
  5972. (this.elements = { container: null, displayContainer: null }),
  5973. (this.manager = null),
  5974. (this.loader = null),
  5975. (this.cuePoints = null),
  5976. (this.events = {}),
  5977. (this.safetyTimer = null),
  5978. (this.countdownTimer = null),
  5979. (this.managerPromise = new Promise(function (e, t) {
  5980. _this32.on('loaded', e), _this32.on('error', t)
  5981. })),
  5982. this.load()
  5983. }
  5984. _createClass2(Ads, [
  5985. {
  5986. key: 'enabled',
  5987. get: function get() {
  5988. var e = this.config
  5989. return (
  5990. this.player.isHTML5 &&
  5991. this.player.isVideo &&
  5992. e.enabled &&
  5993. (!is.empty(e.publisherId) || is.url(e.tagUrl))
  5994. )
  5995. }
  5996. },
  5997. {
  5998. key: 'tagUrl',
  5999. get: function get() {
  6000. var e = this.config
  6001. if (is.url(e.tagUrl)) return e.tagUrl
  6002. return 'https://go.aniview.com/api/adserver6/vast/?'.concat(
  6003. buildUrlParams({
  6004. AV_PUBLISHERID: '58c25bb0073ef448b1087ad6',
  6005. AV_CHANNELID: '5a0458dc28a06145e4519d21',
  6006. AV_URL: window.location.hostname,
  6007. cb: Date.now(),
  6008. AV_WIDTH: 640,
  6009. AV_HEIGHT: 480,
  6010. AV_CDIM2: e.publisherId
  6011. })
  6012. )
  6013. }
  6014. }
  6015. ])
  6016. return Ads
  6017. })()
  6018. function clamp() {
  6019. var e =
  6020. arguments.length > 0 && arguments[0] !== undefined
  6021. ? arguments[0]
  6022. : 0
  6023. var t =
  6024. arguments.length > 1 && arguments[1] !== undefined
  6025. ? arguments[1]
  6026. : 0
  6027. var i =
  6028. arguments.length > 2 && arguments[2] !== undefined
  6029. ? arguments[2]
  6030. : 255
  6031. return Math.min(Math.max(e, t), i)
  6032. }
  6033. var parseVtt = function parseVtt(e) {
  6034. var t = []
  6035. return (
  6036. e.split(/\r\n\r\n|\n\n|\r\r/).forEach(function (e) {
  6037. var i = {}
  6038. e.split(/\r\n|\n|\r/).forEach(function (e) {
  6039. if (is.number(i.startTime)) {
  6040. if (!is.empty(e.trim()) && is.empty(i.text)) {
  6041. var _t16, _t17, _t15$1$split, _t15$1$split2
  6042. var _t15 = e.trim().split('#xywh=')
  6043. ;((_t16 = _t15),
  6044. (_t17 = _slicedToArray(_t16, 1)),
  6045. (i.text = _t17[0]),
  6046. _t16),
  6047. _t15[1] &&
  6048. ((_t15$1$split = _t15[1].split(',')),
  6049. (_t15$1$split2 = _slicedToArray(_t15$1$split, 4)),
  6050. (i.x = _t15$1$split2[0]),
  6051. (i.y = _t15$1$split2[1]),
  6052. (i.w = _t15$1$split2[2]),
  6053. (i.h = _t15$1$split2[3]),
  6054. _t15$1$split)
  6055. }
  6056. } else {
  6057. var _t18 = e.match(
  6058. /([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/
  6059. )
  6060. _t18 &&
  6061. ((i.startTime =
  6062. 60 * Number(_t18[1] || 0) * 60 +
  6063. 60 * Number(_t18[2]) +
  6064. Number(_t18[3]) +
  6065. Number('0.'.concat(_t18[4]))),
  6066. (i.endTime =
  6067. 60 * Number(_t18[6] || 0) * 60 +
  6068. 60 * Number(_t18[7]) +
  6069. Number(_t18[8]) +
  6070. Number('0.'.concat(_t18[9]))))
  6071. }
  6072. }),
  6073. i.text && t.push(i)
  6074. }),
  6075. t
  6076. )
  6077. },
  6078. fitRatio = function fitRatio(e, t) {
  6079. var i = {}
  6080. return (
  6081. e > t.width / t.height
  6082. ? ((i.width = t.width), (i.height = (1 / e) * t.width))
  6083. : ((i.height = t.height), (i.width = e * t.height)),
  6084. i
  6085. )
  6086. }
  6087. var PreviewThumbnails = /*#__PURE__*/ (function () {
  6088. function PreviewThumbnails(e) {
  6089. var _this33 = this
  6090. _classCallCheck2(this, PreviewThumbnails)
  6091. _defineProperty$1(this, 'load', function () {
  6092. _this33.player.elements.display.seekTooltip &&
  6093. (_this33.player.elements.display.seekTooltip.hidden =
  6094. _this33.enabled),
  6095. _this33.enabled &&
  6096. _this33.getThumbnails().then(function () {
  6097. _this33.enabled &&
  6098. (_this33.render(),
  6099. _this33.determineContainerAutoSizing(),
  6100. (_this33.loaded = !0))
  6101. })
  6102. }),
  6103. _defineProperty$1(this, 'getThumbnails', function () {
  6104. return new Promise(function (e) {
  6105. var t = _this33.player.config.previewThumbnails.src
  6106. if (is.empty(t))
  6107. throw new Error(
  6108. 'Missing previewThumbnails.src config attribute'
  6109. )
  6110. var i = function i() {
  6111. _this33.thumbnails.sort(function (e, t) {
  6112. return e.height - t.height
  6113. }),
  6114. _this33.player.debug.log(
  6115. 'Preview thumbnails',
  6116. _this33.thumbnails
  6117. ),
  6118. e()
  6119. }
  6120. if (is.function(t))
  6121. t(function (e) {
  6122. ;(_this33.thumbnails = e), i()
  6123. })
  6124. else {
  6125. var _e27 = (is.string(t) ? [t] : t).map(function (e) {
  6126. return _this33.getThumbnail(e)
  6127. })
  6128. Promise.all(_e27).then(i)
  6129. }
  6130. })
  6131. }),
  6132. _defineProperty$1(this, 'getThumbnail', function (e) {
  6133. return new Promise(function (t) {
  6134. fetch(e).then(function (i) {
  6135. var s = {
  6136. frames: parseVtt(i),
  6137. height: null,
  6138. urlPrefix: ''
  6139. }
  6140. s.frames[0].text.startsWith('/') ||
  6141. s.frames[0].text.startsWith('http://') ||
  6142. s.frames[0].text.startsWith('https://') ||
  6143. (s.urlPrefix = e.substring(0, e.lastIndexOf('/') + 1))
  6144. var n = new Image()
  6145. ;(n.onload = function () {
  6146. ;(s.height = n.naturalHeight),
  6147. (s.width = n.naturalWidth),
  6148. _this33.thumbnails.push(s),
  6149. t()
  6150. }),
  6151. (n.src = s.urlPrefix + s.frames[0].text)
  6152. })
  6153. })
  6154. }),
  6155. _defineProperty$1(this, 'startMove', function (e) {
  6156. if (
  6157. _this33.loaded &&
  6158. is.event(e) &&
  6159. ['touchmove', 'mousemove'].includes(e.type) &&
  6160. _this33.player.media.duration
  6161. ) {
  6162. if ('touchmove' === e.type)
  6163. _this33.seekTime =
  6164. _this33.player.media.duration *
  6165. (_this33.player.elements.inputs.seek.value / 100)
  6166. else {
  6167. var t, i
  6168. var s =
  6169. _this33.player.elements.progress.getBoundingClientRect(),
  6170. n = (100 / s.width) * (e.pageX - s.left)
  6171. ;(_this33.seekTime =
  6172. _this33.player.media.duration * (n / 100)),
  6173. _this33.seekTime < 0 && (_this33.seekTime = 0),
  6174. _this33.seekTime > _this33.player.media.duration - 1 &&
  6175. (_this33.seekTime =
  6176. _this33.player.media.duration - 1),
  6177. (_this33.mousePosX = e.pageX),
  6178. (_this33.elements.thumb.time.innerText = _formatTime(
  6179. _this33.seekTime
  6180. ))
  6181. var r =
  6182. null === (t = _this33.player.config.markers) ||
  6183. void 0 === t ||
  6184. null === (i = t.points) ||
  6185. void 0 === i
  6186. ? void 0
  6187. : i.find(function (_ref18) {
  6188. var e = _ref18.time
  6189. return e === Math.round(_this33.seekTime)
  6190. })
  6191. r &&
  6192. _this33.elements.thumb.time.insertAdjacentHTML(
  6193. 'afterbegin',
  6194. ''.concat(r.label, '<br>')
  6195. )
  6196. }
  6197. _this33.showImageAtCurrentTime()
  6198. }
  6199. }),
  6200. _defineProperty$1(this, 'endMove', function () {
  6201. _this33.toggleThumbContainer(!1, !0)
  6202. }),
  6203. _defineProperty$1(this, 'startScrubbing', function (e) {
  6204. ;(is.nullOrUndefined(e.button) ||
  6205. !1 === e.button ||
  6206. 0 === e.button) &&
  6207. ((_this33.mouseDown = !0),
  6208. _this33.player.media.duration &&
  6209. (_this33.toggleScrubbingContainer(!0),
  6210. _this33.toggleThumbContainer(!1, !0),
  6211. _this33.showImageAtCurrentTime()))
  6212. }),
  6213. _defineProperty$1(this, 'endScrubbing', function () {
  6214. ;(_this33.mouseDown = !1),
  6215. Math.ceil(_this33.lastTime) ===
  6216. Math.ceil(_this33.player.media.currentTime)
  6217. ? _this33.toggleScrubbingContainer(!1)
  6218. : once.call(
  6219. _this33.player,
  6220. _this33.player.media,
  6221. 'timeupdate',
  6222. function () {
  6223. _this33.mouseDown ||
  6224. _this33.toggleScrubbingContainer(!1)
  6225. }
  6226. )
  6227. }),
  6228. _defineProperty$1(this, 'listeners', function () {
  6229. _this33.player.on('play', function () {
  6230. _this33.toggleThumbContainer(!1, !0)
  6231. }),
  6232. _this33.player.on('seeked', function () {
  6233. _this33.toggleThumbContainer(!1)
  6234. }),
  6235. _this33.player.on('timeupdate', function () {
  6236. _this33.lastTime = _this33.player.media.currentTime
  6237. })
  6238. }),
  6239. _defineProperty$1(this, 'render', function () {
  6240. ;(_this33.elements.thumb.container = createElement('div', {
  6241. class:
  6242. _this33.player.config.classNames.previewThumbnails
  6243. .thumbContainer
  6244. })),
  6245. (_this33.elements.thumb.imageContainer = createElement(
  6246. 'div',
  6247. {
  6248. class:
  6249. _this33.player.config.classNames.previewThumbnails
  6250. .imageContainer
  6251. }
  6252. )),
  6253. _this33.elements.thumb.container.appendChild(
  6254. _this33.elements.thumb.imageContainer
  6255. )
  6256. var e = createElement('div', {
  6257. class:
  6258. _this33.player.config.classNames.previewThumbnails
  6259. .timeContainer
  6260. })
  6261. ;(_this33.elements.thumb.time = createElement(
  6262. 'span',
  6263. {},
  6264. '00:00'
  6265. )),
  6266. e.appendChild(_this33.elements.thumb.time),
  6267. _this33.elements.thumb.imageContainer.appendChild(e),
  6268. is.element(_this33.player.elements.progress) &&
  6269. _this33.player.elements.progress.appendChild(
  6270. _this33.elements.thumb.container
  6271. ),
  6272. (_this33.elements.scrubbing.container = createElement(
  6273. 'div',
  6274. {
  6275. class:
  6276. _this33.player.config.classNames.previewThumbnails
  6277. .scrubbingContainer
  6278. }
  6279. )),
  6280. _this33.player.elements.wrapper.appendChild(
  6281. _this33.elements.scrubbing.container
  6282. )
  6283. }),
  6284. _defineProperty$1(this, 'destroy', function () {
  6285. _this33.elements.thumb.container &&
  6286. _this33.elements.thumb.container.remove(),
  6287. _this33.elements.scrubbing.container &&
  6288. _this33.elements.scrubbing.container.remove()
  6289. }),
  6290. _defineProperty$1(this, 'showImageAtCurrentTime', function () {
  6291. _this33.mouseDown
  6292. ? _this33.setScrubbingContainerSize()
  6293. : _this33.setThumbContainerSizeAndPos()
  6294. var e = _this33.thumbnails[0].frames.findIndex(function (e) {
  6295. return (
  6296. _this33.seekTime >= e.startTime &&
  6297. _this33.seekTime <= e.endTime
  6298. )
  6299. }),
  6300. t = e >= 0
  6301. var i = 0
  6302. _this33.mouseDown || _this33.toggleThumbContainer(t),
  6303. t &&
  6304. (_this33.thumbnails.forEach(function (t, s) {
  6305. _this33.loadedImages.includes(t.frames[e].text) &&
  6306. (i = s)
  6307. }),
  6308. e !== _this33.showingThumb &&
  6309. ((_this33.showingThumb = e), _this33.loadImage(i)))
  6310. }),
  6311. _defineProperty$1(this, 'loadImage', function () {
  6312. var e =
  6313. arguments.length > 0 && arguments[0] !== undefined
  6314. ? arguments[0]
  6315. : 0
  6316. var t = _this33.showingThumb,
  6317. i = _this33.thumbnails[e],
  6318. s = i.urlPrefix,
  6319. n = i.frames[t],
  6320. r = i.frames[t].text,
  6321. a = s + r
  6322. if (
  6323. _this33.currentImageElement &&
  6324. _this33.currentImageElement.dataset.filename === r
  6325. )
  6326. _this33.showImage(
  6327. _this33.currentImageElement,
  6328. n,
  6329. e,
  6330. t,
  6331. r,
  6332. !1
  6333. ),
  6334. (_this33.currentImageElement.dataset.index = t),
  6335. _this33.removeOldImages(_this33.currentImageElement)
  6336. else {
  6337. _this33.loadingImage &&
  6338. _this33.usingSprites &&
  6339. (_this33.loadingImage.onload = null)
  6340. var _i9 = new Image()
  6341. ;(_i9.src = a),
  6342. (_i9.dataset.index = t),
  6343. (_i9.dataset.filename = r),
  6344. (_this33.showingThumbFilename = r),
  6345. _this33.player.debug.log('Loading image: '.concat(a)),
  6346. (_i9.onload = function () {
  6347. return _this33.showImage(_i9, n, e, t, r, !0)
  6348. }),
  6349. (_this33.loadingImage = _i9),
  6350. _this33.removeOldImages(_i9)
  6351. }
  6352. }),
  6353. _defineProperty$1(this, 'showImage', function (e, t, i, s, n) {
  6354. var r =
  6355. arguments.length > 5 && arguments[5] !== undefined
  6356. ? arguments[5]
  6357. : !0
  6358. _this33.player.debug.log(
  6359. 'Showing thumb: '
  6360. .concat(n, '. num: ')
  6361. .concat(s, '. qual: ')
  6362. .concat(i, '. newimg: ')
  6363. .concat(r)
  6364. ),
  6365. _this33.setImageSizeAndOffset(e, t),
  6366. r &&
  6367. (_this33.currentImageContainer.appendChild(e),
  6368. (_this33.currentImageElement = e),
  6369. _this33.loadedImages.includes(n) ||
  6370. _this33.loadedImages.push(n)),
  6371. _this33
  6372. .preloadNearby(s, !0)
  6373. .then(_this33.preloadNearby(s, !1))
  6374. .then(_this33.getHigherQuality(i, e, t, n))
  6375. }),
  6376. _defineProperty$1(this, 'removeOldImages', function (e) {
  6377. Array.from(_this33.currentImageContainer.children).forEach(
  6378. function (t) {
  6379. if ('img' !== t.tagName.toLowerCase()) return
  6380. var i = _this33.usingSprites ? 500 : 1e3
  6381. if (
  6382. t.dataset.index !== e.dataset.index &&
  6383. !t.dataset.deleting
  6384. ) {
  6385. t.dataset.deleting = !0
  6386. var _e28 = _this33.currentImageContainer
  6387. setTimeout(function () {
  6388. _e28.removeChild(t),
  6389. _this33.player.debug.log(
  6390. 'Removing thumb: '.concat(t.dataset.filename)
  6391. )
  6392. }, i)
  6393. }
  6394. }
  6395. )
  6396. }),
  6397. _defineProperty$1(this, 'preloadNearby', function (e) {
  6398. var t =
  6399. arguments.length > 1 && arguments[1] !== undefined
  6400. ? arguments[1]
  6401. : !0
  6402. return new Promise(function (i) {
  6403. setTimeout(function () {
  6404. var s = _this33.thumbnails[0].frames[e].text
  6405. if (_this33.showingThumbFilename === s) {
  6406. var n
  6407. n = t
  6408. ? _this33.thumbnails[0].frames.slice(e)
  6409. : _this33.thumbnails[0].frames.slice(0, e).reverse()
  6410. var r = !1
  6411. n.forEach(function (e) {
  6412. var t = e.text
  6413. if (t !== s && !_this33.loadedImages.includes(t)) {
  6414. ;(r = !0),
  6415. _this33.player.debug.log(
  6416. 'Preloading thumb filename: '.concat(t)
  6417. )
  6418. var _e29 = _this33.thumbnails[0].urlPrefix,
  6419. _s9 = _e29 + t,
  6420. _n5 = new Image()
  6421. ;(_n5.src = _s9),
  6422. (_n5.onload = function () {
  6423. _this33.player.debug.log(
  6424. 'Preloaded thumb filename: '.concat(t)
  6425. ),
  6426. _this33.loadedImages.includes(t) ||
  6427. _this33.loadedImages.push(t),
  6428. i()
  6429. })
  6430. }
  6431. }),
  6432. r || i()
  6433. }
  6434. }, 300)
  6435. })
  6436. }),
  6437. _defineProperty$1(
  6438. this,
  6439. 'getHigherQuality',
  6440. function (e, t, i, s) {
  6441. if (e < _this33.thumbnails.length - 1) {
  6442. var n = t.naturalHeight
  6443. _this33.usingSprites && (n = i.h),
  6444. n < _this33.thumbContainerHeight &&
  6445. setTimeout(function () {
  6446. _this33.showingThumbFilename === s &&
  6447. (_this33.player.debug.log(
  6448. 'Showing higher quality thumb for: '.concat(s)
  6449. ),
  6450. _this33.loadImage(e + 1))
  6451. }, 300)
  6452. }
  6453. }
  6454. ),
  6455. _defineProperty$1(this, 'toggleThumbContainer', function () {
  6456. var e =
  6457. arguments.length > 0 && arguments[0] !== undefined
  6458. ? arguments[0]
  6459. : !1
  6460. var t =
  6461. arguments.length > 1 && arguments[1] !== undefined
  6462. ? arguments[1]
  6463. : !1
  6464. var i =
  6465. _this33.player.config.classNames.previewThumbnails
  6466. .thumbContainerShown
  6467. _this33.elements.thumb.container.classList.toggle(i, e),
  6468. !e &&
  6469. t &&
  6470. ((_this33.showingThumb = null),
  6471. (_this33.showingThumbFilename = null))
  6472. }),
  6473. _defineProperty$1(
  6474. this,
  6475. 'toggleScrubbingContainer',
  6476. function () {
  6477. var e =
  6478. arguments.length > 0 && arguments[0] !== undefined
  6479. ? arguments[0]
  6480. : !1
  6481. var t =
  6482. _this33.player.config.classNames.previewThumbnails
  6483. .scrubbingContainerShown
  6484. _this33.elements.scrubbing.container.classList.toggle(t, e),
  6485. e ||
  6486. ((_this33.showingThumb = null),
  6487. (_this33.showingThumbFilename = null))
  6488. }
  6489. ),
  6490. _defineProperty$1(
  6491. this,
  6492. 'determineContainerAutoSizing',
  6493. function () {
  6494. ;(_this33.elements.thumb.imageContainer.clientHeight > 20 ||
  6495. _this33.elements.thumb.imageContainer.clientWidth > 20) &&
  6496. (_this33.sizeSpecifiedInCSS = !0)
  6497. }
  6498. ),
  6499. _defineProperty$1(
  6500. this,
  6501. 'setThumbContainerSizeAndPos',
  6502. function () {
  6503. var e = _this33.elements.thumb.imageContainer
  6504. if (_this33.sizeSpecifiedInCSS) {
  6505. if (e.clientHeight > 20 && e.clientWidth < 20) {
  6506. var t = Math.floor(
  6507. e.clientHeight * _this33.thumbAspectRatio
  6508. )
  6509. e.style.width = ''.concat(t, 'px')
  6510. } else if (e.clientHeight < 20 && e.clientWidth > 20) {
  6511. var _t19 = Math.floor(
  6512. e.clientWidth / _this33.thumbAspectRatio
  6513. )
  6514. e.style.height = ''.concat(_t19, 'px')
  6515. }
  6516. } else {
  6517. var _t20 = Math.floor(
  6518. _this33.thumbContainerHeight * _this33.thumbAspectRatio
  6519. )
  6520. ;(e.style.height = ''.concat(
  6521. _this33.thumbContainerHeight,
  6522. 'px'
  6523. )),
  6524. (e.style.width = ''.concat(_t20, 'px'))
  6525. }
  6526. _this33.setThumbContainerPos()
  6527. }
  6528. ),
  6529. _defineProperty$1(this, 'setThumbContainerPos', function () {
  6530. var e =
  6531. _this33.player.elements.progress.getBoundingClientRect(),
  6532. t =
  6533. _this33.player.elements.container.getBoundingClientRect(),
  6534. i = _this33.elements.thumb.container,
  6535. s = t.left - e.left + 10,
  6536. n = t.right - e.left - i.clientWidth - 10,
  6537. r = _this33.mousePosX - e.left - i.clientWidth / 2,
  6538. a = clamp(r, s, n)
  6539. ;(i.style.left = ''.concat(a, 'px')),
  6540. i.style.setProperty('--preview-arrow-offset', r - a + 'px')
  6541. }),
  6542. _defineProperty$1(
  6543. this,
  6544. 'setScrubbingContainerSize',
  6545. function () {
  6546. var _fitRatio = fitRatio(_this33.thumbAspectRatio, {
  6547. width: _this33.player.media.clientWidth,
  6548. height: _this33.player.media.clientHeight
  6549. }),
  6550. e = _fitRatio.width,
  6551. t = _fitRatio.height
  6552. ;(_this33.elements.scrubbing.container.style.width =
  6553. ''.concat(e, 'px')),
  6554. (_this33.elements.scrubbing.container.style.height =
  6555. ''.concat(t, 'px'))
  6556. }
  6557. ),
  6558. _defineProperty$1(
  6559. this,
  6560. 'setImageSizeAndOffset',
  6561. function (e, t) {
  6562. if (!_this33.usingSprites) return
  6563. var i = _this33.thumbContainerHeight / t.h
  6564. ;(e.style.height = e.naturalHeight * i + 'px'),
  6565. (e.style.width = e.naturalWidth * i + 'px'),
  6566. (e.style.left = '-'.concat(t.x * i, 'px')),
  6567. (e.style.top = '-'.concat(t.y * i, 'px'))
  6568. }
  6569. ),
  6570. (this.player = e),
  6571. (this.thumbnails = []),
  6572. (this.loaded = !1),
  6573. (this.lastMouseMoveTime = Date.now()),
  6574. (this.mouseDown = !1),
  6575. (this.loadedImages = []),
  6576. (this.elements = { thumb: {}, scrubbing: {} }),
  6577. this.load()
  6578. }
  6579. _createClass2(PreviewThumbnails, [
  6580. {
  6581. key: 'enabled',
  6582. get: function get() {
  6583. return (
  6584. this.player.isHTML5 &&
  6585. this.player.isVideo &&
  6586. this.player.config.previewThumbnails.enabled
  6587. )
  6588. }
  6589. },
  6590. {
  6591. key: 'currentImageContainer',
  6592. get: function get() {
  6593. return this.mouseDown
  6594. ? this.elements.scrubbing.container
  6595. : this.elements.thumb.imageContainer
  6596. }
  6597. },
  6598. {
  6599. key: 'usingSprites',
  6600. get: function get() {
  6601. return Object.keys(this.thumbnails[0].frames[0]).includes('w')
  6602. }
  6603. },
  6604. {
  6605. key: 'thumbAspectRatio',
  6606. get: function get() {
  6607. return this.usingSprites
  6608. ? this.thumbnails[0].frames[0].w /
  6609. this.thumbnails[0].frames[0].h
  6610. : this.thumbnails[0].width / this.thumbnails[0].height
  6611. }
  6612. },
  6613. {
  6614. key: 'thumbContainerHeight',
  6615. get: function get() {
  6616. if (this.mouseDown) {
  6617. var _fitRatio2 = fitRatio(this.thumbAspectRatio, {
  6618. width: this.player.media.clientWidth,
  6619. height: this.player.media.clientHeight
  6620. }),
  6621. e = _fitRatio2.height
  6622. return e
  6623. }
  6624. return this.sizeSpecifiedInCSS
  6625. ? this.elements.thumb.imageContainer.clientHeight
  6626. : Math.floor(
  6627. this.player.media.clientWidth /
  6628. this.thumbAspectRatio /
  6629. 4
  6630. )
  6631. }
  6632. },
  6633. {
  6634. key: 'currentImageElement',
  6635. get: function get() {
  6636. return this.mouseDown
  6637. ? this.currentScrubbingImageElement
  6638. : this.currentThumbnailImageElement
  6639. },
  6640. set: function set(e) {
  6641. this.mouseDown
  6642. ? (this.currentScrubbingImageElement = e)
  6643. : (this.currentThumbnailImageElement = e)
  6644. }
  6645. }
  6646. ])
  6647. return PreviewThumbnails
  6648. })()
  6649. var source = {
  6650. insertElements: function insertElements(e, t) {
  6651. var _this34 = this
  6652. is.string(t)
  6653. ? insertElement(e, this.media, { src: t })
  6654. : is.array(t) &&
  6655. t.forEach(function (t) {
  6656. insertElement(e, _this34.media, t)
  6657. })
  6658. },
  6659. change: function change(e) {
  6660. var _this35 = this
  6661. getDeep(e, 'sources.length')
  6662. ? (html5.cancelRequests.call(this),
  6663. this.destroy.call(
  6664. this,
  6665. function () {
  6666. ;(_this35.options.quality = []),
  6667. removeElement(_this35.media),
  6668. (_this35.media = null),
  6669. is.element(_this35.elements.container) &&
  6670. _this35.elements.container.removeAttribute('class')
  6671. var t = e.sources,
  6672. i = e.type,
  6673. _t21 = _slicedToArray(t, 1),
  6674. _t21$ = _t21[0],
  6675. _t21$$provider = _t21$.provider,
  6676. s =
  6677. _t21$$provider === void 0
  6678. ? providers.html5
  6679. : _t21$$provider,
  6680. n = _t21$.src,
  6681. r = 'html5' === s ? i : 'div',
  6682. a = 'html5' === s ? {} : { src: n }
  6683. Object.assign(_this35, {
  6684. provider: s,
  6685. type: i,
  6686. supported: support.check(
  6687. i,
  6688. s,
  6689. _this35.config.playsinline
  6690. ),
  6691. media: createElement(r, a)
  6692. }),
  6693. _this35.elements.container.appendChild(_this35.media),
  6694. is.boolean(e.autoplay) &&
  6695. (_this35.config.autoplay = e.autoplay),
  6696. _this35.isHTML5 &&
  6697. (_this35.config.crossorigin &&
  6698. _this35.media.setAttribute('crossorigin', ''),
  6699. _this35.config.autoplay &&
  6700. _this35.media.setAttribute('autoplay', ''),
  6701. is.empty(e.poster) || (_this35.poster = e.poster),
  6702. _this35.config.loop.active &&
  6703. _this35.media.setAttribute('loop', ''),
  6704. _this35.config.muted &&
  6705. _this35.media.setAttribute('muted', ''),
  6706. _this35.config.playsinline &&
  6707. _this35.media.setAttribute('playsinline', '')),
  6708. ui.addStyleHook.call(_this35),
  6709. _this35.isHTML5 &&
  6710. source.insertElements.call(_this35, 'source', t),
  6711. (_this35.config.title = e.title),
  6712. media.setup.call(_this35),
  6713. _this35.isHTML5 &&
  6714. Object.keys(e).includes('tracks') &&
  6715. source.insertElements.call(
  6716. _this35,
  6717. 'track',
  6718. e.tracks
  6719. ),
  6720. (_this35.isHTML5 ||
  6721. (_this35.isEmbed && !_this35.supported.ui)) &&
  6722. ui.build.call(_this35),
  6723. _this35.isHTML5 && _this35.media.load(),
  6724. is.empty(e.previewThumbnails) ||
  6725. (Object.assign(
  6726. _this35.config.previewThumbnails,
  6727. e.previewThumbnails
  6728. ),
  6729. _this35.previewThumbnails &&
  6730. _this35.previewThumbnails.loaded &&
  6731. (_this35.previewThumbnails.destroy(),
  6732. (_this35.previewThumbnails = null)),
  6733. _this35.config.previewThumbnails.enabled &&
  6734. (_this35.previewThumbnails = new PreviewThumbnails(
  6735. _this35
  6736. ))),
  6737. _this35.fullscreen.update()
  6738. },
  6739. !0
  6740. ))
  6741. : this.debug.warn('Invalid source format')
  6742. }
  6743. }
  6744. var Plyr = /*#__PURE__*/ (function () {
  6745. function Plyr(e, t) {
  6746. var _this36 = this
  6747. _classCallCheck2(this, Plyr)
  6748. if (
  6749. (_defineProperty$1(this, 'play', function () {
  6750. return is.function(_this36.media.play)
  6751. ? (_this36.ads &&
  6752. _this36.ads.enabled &&
  6753. _this36.ads.managerPromise
  6754. .then(function () {
  6755. return _this36.ads.play()
  6756. })
  6757. .catch(function () {
  6758. return silencePromise(_this36.media.play())
  6759. }),
  6760. _this36.media.play())
  6761. : null
  6762. }),
  6763. _defineProperty$1(this, 'pause', function () {
  6764. return _this36.playing && is.function(_this36.media.pause)
  6765. ? _this36.media.pause()
  6766. : null
  6767. }),
  6768. _defineProperty$1(this, 'togglePlay', function (e) {
  6769. return (is.boolean(e) ? e : !_this36.playing)
  6770. ? _this36.play()
  6771. : _this36.pause()
  6772. }),
  6773. _defineProperty$1(this, 'stop', function () {
  6774. _this36.isHTML5
  6775. ? (_this36.pause(), _this36.restart())
  6776. : is.function(_this36.media.stop) && _this36.media.stop()
  6777. }),
  6778. _defineProperty$1(this, 'restart', function () {
  6779. _this36.currentTime = 0
  6780. }),
  6781. _defineProperty$1(this, 'rewind', function (e) {
  6782. _this36.currentTime -= is.number(e)
  6783. ? e
  6784. : _this36.config.seekTime
  6785. }),
  6786. _defineProperty$1(this, 'forward', function (e) {
  6787. _this36.currentTime += is.number(e)
  6788. ? e
  6789. : _this36.config.seekTime
  6790. }),
  6791. _defineProperty$1(this, 'increaseVolume', function (e) {
  6792. var t = _this36.media.muted ? 0 : _this36.volume
  6793. _this36.volume = t + (is.number(e) ? e : 0)
  6794. }),
  6795. _defineProperty$1(this, 'decreaseVolume', function (e) {
  6796. _this36.increaseVolume(-e)
  6797. }),
  6798. _defineProperty$1(this, 'airplay', function () {
  6799. support.airplay &&
  6800. _this36.media.webkitShowPlaybackTargetPicker()
  6801. }),
  6802. _defineProperty$1(this, 'toggleControls', function (e) {
  6803. if (_this36.supported.ui && !_this36.isAudio) {
  6804. var _t22 = hasClass(
  6805. _this36.elements.container,
  6806. _this36.config.classNames.hideControls
  6807. ),
  6808. _i10 = void 0 === e ? void 0 : !e,
  6809. _s10 = toggleClass(
  6810. _this36.elements.container,
  6811. _this36.config.classNames.hideControls,
  6812. _i10
  6813. )
  6814. if (
  6815. (_s10 &&
  6816. is.array(_this36.config.controls) &&
  6817. _this36.config.controls.includes('settings') &&
  6818. !is.empty(_this36.config.settings) &&
  6819. controls.toggleMenu.call(_this36, !1),
  6820. _s10 !== _t22)
  6821. ) {
  6822. var _e30 = _s10 ? 'controlshidden' : 'controlsshown'
  6823. triggerEvent.call(_this36, _this36.media, _e30)
  6824. }
  6825. return !_s10
  6826. }
  6827. return !1
  6828. }),
  6829. _defineProperty$1(this, 'on', function (e, t) {
  6830. on.call(_this36, _this36.elements.container, e, t)
  6831. }),
  6832. _defineProperty$1(this, 'once', function (e, t) {
  6833. once.call(_this36, _this36.elements.container, e, t)
  6834. }),
  6835. _defineProperty$1(this, 'off', function (e, t) {
  6836. off(_this36.elements.container, e, t)
  6837. }),
  6838. _defineProperty$1(this, 'destroy', function (e) {
  6839. var t =
  6840. arguments.length > 1 && arguments[1] !== undefined
  6841. ? arguments[1]
  6842. : !1
  6843. if (!_this36.ready) return
  6844. var i = function i() {
  6845. ;(document.body.style.overflow = ''),
  6846. (_this36.embed = null),
  6847. t
  6848. ? (Object.keys(_this36.elements).length &&
  6849. (removeElement(_this36.elements.buttons.play),
  6850. removeElement(_this36.elements.captions),
  6851. removeElement(_this36.elements.controls),
  6852. removeElement(_this36.elements.wrapper),
  6853. (_this36.elements.buttons.play = null),
  6854. (_this36.elements.captions = null),
  6855. (_this36.elements.controls = null),
  6856. (_this36.elements.wrapper = null)),
  6857. is.function(e) && e())
  6858. : (unbindListeners.call(_this36),
  6859. html5.cancelRequests.call(_this36),
  6860. replaceElement(
  6861. _this36.elements.original,
  6862. _this36.elements.container
  6863. ),
  6864. triggerEvent.call(
  6865. _this36,
  6866. _this36.elements.original,
  6867. 'destroyed',
  6868. !0
  6869. ),
  6870. is.function(e) && e.call(_this36.elements.original),
  6871. (_this36.ready = !1),
  6872. setTimeout(function () {
  6873. ;(_this36.elements = null), (_this36.media = null)
  6874. }, 200))
  6875. }
  6876. _this36.stop(),
  6877. clearTimeout(_this36.timers.loading),
  6878. clearTimeout(_this36.timers.controls),
  6879. clearTimeout(_this36.timers.resized),
  6880. _this36.isHTML5
  6881. ? (ui.toggleNativeControls.call(_this36, !0), i())
  6882. : _this36.isYouTube
  6883. ? (clearInterval(_this36.timers.buffering),
  6884. clearInterval(_this36.timers.playing),
  6885. null !== _this36.embed &&
  6886. is.function(_this36.embed.destroy) &&
  6887. _this36.embed.destroy(),
  6888. i())
  6889. : _this36.isVimeo &&
  6890. (null !== _this36.embed &&
  6891. _this36.embed.unload().then(i),
  6892. setTimeout(i, 200))
  6893. }),
  6894. _defineProperty$1(this, 'supports', function (e) {
  6895. return support.mime.call(_this36, e)
  6896. }),
  6897. (this.timers = {}),
  6898. (this.ready = !1),
  6899. (this.loading = !1),
  6900. (this.failed = !1),
  6901. (this.touch = support.touch),
  6902. (this.media = e),
  6903. is.string(this.media) &&
  6904. (this.media = document.querySelectorAll(this.media)),
  6905. ((window.jQuery && this.media instanceof jQuery) ||
  6906. is.nodeList(this.media) ||
  6907. is.array(this.media)) &&
  6908. (this.media = this.media[0]),
  6909. (this.config = extend(
  6910. {},
  6911. defaults,
  6912. Plyr.defaults,
  6913. t || {},
  6914. (function () {
  6915. try {
  6916. return JSON.parse(
  6917. _this36.media.getAttribute('data-plyr-config')
  6918. )
  6919. } catch (e) {
  6920. return {}
  6921. }
  6922. })()
  6923. )),
  6924. (this.elements = {
  6925. container: null,
  6926. fullscreen: null,
  6927. captions: null,
  6928. buttons: {},
  6929. display: {},
  6930. progress: {},
  6931. inputs: {},
  6932. settings: { popup: null, menu: null, panels: {}, buttons: {} }
  6933. }),
  6934. (this.captions = {
  6935. active: null,
  6936. currentTrack: -1,
  6937. meta: new WeakMap()
  6938. }),
  6939. (this.fullscreen = { active: !1 }),
  6940. (this.options = { speed: [], quality: [] }),
  6941. (this.debug = new Console(this.config.debug)),
  6942. this.debug.log('Config', this.config),
  6943. this.debug.log('Support', support),
  6944. is.nullOrUndefined(this.media) || !is.element(this.media))
  6945. )
  6946. return void this.debug.error(
  6947. 'Setup failed: no suitable element passed'
  6948. )
  6949. if (this.media.plyr)
  6950. return void this.debug.warn('Target already setup')
  6951. if (!this.config.enabled)
  6952. return void this.debug.error('Setup failed: disabled by config')
  6953. if (!support.check().api)
  6954. return void this.debug.error('Setup failed: no support')
  6955. var i = this.media.cloneNode(!0)
  6956. ;(i.autoplay = !1), (this.elements.original = i)
  6957. var s = this.media.tagName.toLowerCase()
  6958. var n = null,
  6959. r = null
  6960. switch (s) {
  6961. case 'div':
  6962. if (
  6963. ((n = this.media.querySelector('iframe')), is.element(n))
  6964. ) {
  6965. if (
  6966. ((r = parseUrl(n.getAttribute('src'))),
  6967. (this.provider = getProviderByUrl(r.toString())),
  6968. (this.elements.container = this.media),
  6969. (this.media = n),
  6970. (this.elements.container.className = ''),
  6971. r.search.length)
  6972. ) {
  6973. var _e31 = ['1', 'true']
  6974. _e31.includes(r.searchParams.get('autoplay')) &&
  6975. (this.config.autoplay = !0),
  6976. _e31.includes(r.searchParams.get('loop')) &&
  6977. (this.config.loop.active = !0),
  6978. this.isYouTube
  6979. ? ((this.config.playsinline = _e31.includes(
  6980. r.searchParams.get('playsinline')
  6981. )),
  6982. (this.config.youtube.hl = r.searchParams.get('hl')))
  6983. : (this.config.playsinline = !0)
  6984. }
  6985. } else
  6986. (this.provider = this.media.getAttribute(
  6987. this.config.attributes.embed.provider
  6988. )),
  6989. this.media.removeAttribute(
  6990. this.config.attributes.embed.provider
  6991. )
  6992. if (
  6993. is.empty(this.provider) ||
  6994. !Object.values(providers).includes(this.provider)
  6995. )
  6996. return void this.debug.error(
  6997. 'Setup failed: Invalid provider'
  6998. )
  6999. this.type = types.video
  7000. break
  7001. case 'video':
  7002. case 'audio':
  7003. ;(this.type = s),
  7004. (this.provider = providers.html5),
  7005. this.media.hasAttribute('crossorigin') &&
  7006. (this.config.crossorigin = !0),
  7007. this.media.hasAttribute('autoplay') &&
  7008. (this.config.autoplay = !0),
  7009. (this.media.hasAttribute('playsinline') ||
  7010. this.media.hasAttribute('webkit-playsinline')) &&
  7011. (this.config.playsinline = !0),
  7012. this.media.hasAttribute('muted') &&
  7013. (this.config.muted = !0),
  7014. this.media.hasAttribute('loop') &&
  7015. (this.config.loop.active = !0)
  7016. break
  7017. default:
  7018. return void this.debug.error('Setup failed: unsupported type')
  7019. }
  7020. ;(this.supported = support.check(
  7021. this.type,
  7022. this.provider,
  7023. this.config.playsinline
  7024. )),
  7025. this.supported.api
  7026. ? ((this.eventListeners = []),
  7027. (this.listeners = new Listeners(this)),
  7028. (this.storage = new Storage(this)),
  7029. (this.media.plyr = this),
  7030. is.element(this.elements.container) ||
  7031. ((this.elements.container = createElement('div', {
  7032. tabindex: 0
  7033. })),
  7034. wrap(this.media, this.elements.container)),
  7035. ui.migrateStyles.call(this),
  7036. ui.addStyleHook.call(this),
  7037. media.setup.call(this),
  7038. this.config.debug &&
  7039. on.call(
  7040. this,
  7041. this.elements.container,
  7042. this.config.events.join(' '),
  7043. function (e) {
  7044. _this36.debug.log('event: '.concat(e.type))
  7045. }
  7046. ),
  7047. (this.fullscreen = new Fullscreen(this)),
  7048. (this.isHTML5 || (this.isEmbed && !this.supported.ui)) &&
  7049. ui.build.call(this),
  7050. this.listeners.container(),
  7051. this.listeners.global(),
  7052. this.config.ads.enabled && (this.ads = new Ads(this)),
  7053. this.isHTML5 &&
  7054. this.config.autoplay &&
  7055. this.once('canplay', function () {
  7056. return silencePromise(_this36.play())
  7057. }),
  7058. (this.lastSeekTime = 0),
  7059. this.config.previewThumbnails.enabled &&
  7060. (this.previewThumbnails = new PreviewThumbnails(this)))
  7061. : this.debug.error('Setup failed: no support')
  7062. }
  7063. _createClass2(
  7064. Plyr,
  7065. [
  7066. {
  7067. key: 'isHTML5',
  7068. get: function get() {
  7069. return this.provider === providers.html5
  7070. }
  7071. },
  7072. {
  7073. key: 'isEmbed',
  7074. get: function get() {
  7075. return this.isYouTube || this.isVimeo
  7076. }
  7077. },
  7078. {
  7079. key: 'isYouTube',
  7080. get: function get() {
  7081. return this.provider === providers.youtube
  7082. }
  7083. },
  7084. {
  7085. key: 'isVimeo',
  7086. get: function get() {
  7087. return this.provider === providers.vimeo
  7088. }
  7089. },
  7090. {
  7091. key: 'isVideo',
  7092. get: function get() {
  7093. return this.type === types.video
  7094. }
  7095. },
  7096. {
  7097. key: 'isAudio',
  7098. get: function get() {
  7099. return this.type === types.audio
  7100. }
  7101. },
  7102. {
  7103. key: 'playing',
  7104. get: function get() {
  7105. return Boolean(this.ready && !this.paused && !this.ended)
  7106. }
  7107. },
  7108. {
  7109. key: 'paused',
  7110. get: function get() {
  7111. return Boolean(this.media.paused)
  7112. }
  7113. },
  7114. {
  7115. key: 'stopped',
  7116. get: function get() {
  7117. return Boolean(this.paused && 0 === this.currentTime)
  7118. }
  7119. },
  7120. {
  7121. key: 'ended',
  7122. get: function get() {
  7123. return Boolean(this.media.ended)
  7124. }
  7125. },
  7126. {
  7127. key: 'currentTime',
  7128. get: function get() {
  7129. return Number(this.media.currentTime)
  7130. },
  7131. set: function set(e) {
  7132. if (!this.duration) return
  7133. var t = is.number(e) && e > 0
  7134. ;(this.media.currentTime = t
  7135. ? Math.min(e, this.duration)
  7136. : 0),
  7137. this.debug.log(
  7138. 'Seeking to '.concat(this.currentTime, ' seconds')
  7139. )
  7140. }
  7141. },
  7142. {
  7143. key: 'buffered',
  7144. get: function get() {
  7145. var e = this.media.buffered
  7146. return is.number(e)
  7147. ? e
  7148. : e && e.length && this.duration > 0
  7149. ? e.end(0) / this.duration
  7150. : 0
  7151. }
  7152. },
  7153. {
  7154. key: 'seeking',
  7155. get: function get() {
  7156. return Boolean(this.media.seeking)
  7157. }
  7158. },
  7159. {
  7160. key: 'duration',
  7161. get: function get() {
  7162. var e = parseFloat(this.config.duration),
  7163. t = (this.media || {}).duration,
  7164. i = is.number(t) && t !== 1 / 0 ? t : 0
  7165. return e || i
  7166. }
  7167. },
  7168. {
  7169. key: 'volume',
  7170. get: function get() {
  7171. return Number(this.media.volume)
  7172. },
  7173. set: function set(e) {
  7174. var _this$config2
  7175. var t = e
  7176. is.string(t) && (t = Number(t)),
  7177. is.number(t) || (t = this.storage.get('volume')),
  7178. is.number(t) ||
  7179. ((_this$config2 = this.config),
  7180. (t = _this$config2.volume),
  7181. _this$config2),
  7182. t > 1 && (t = 1),
  7183. t < 0 && (t = 0),
  7184. (this.config.volume = t),
  7185. (this.media.volume = t),
  7186. !is.empty(e) && this.muted && t > 0 && (this.muted = !1)
  7187. }
  7188. },
  7189. {
  7190. key: 'muted',
  7191. get: function get() {
  7192. return Boolean(this.media.muted)
  7193. },
  7194. set: function set(e) {
  7195. var t = e
  7196. is.boolean(t) || (t = this.storage.get('muted')),
  7197. is.boolean(t) || (t = this.config.muted),
  7198. (this.config.muted = t),
  7199. (this.media.muted = t)
  7200. }
  7201. },
  7202. {
  7203. key: 'hasAudio',
  7204. get: function get() {
  7205. return (
  7206. !this.isHTML5 ||
  7207. !!this.isAudio ||
  7208. Boolean(this.media.mozHasAudio) ||
  7209. Boolean(this.media.webkitAudioDecodedByteCount) ||
  7210. Boolean(
  7211. this.media.audioTracks && this.media.audioTracks.length
  7212. )
  7213. )
  7214. }
  7215. },
  7216. {
  7217. key: 'speed',
  7218. get: function get() {
  7219. return Number(this.media.playbackRate)
  7220. },
  7221. set: function set(e) {
  7222. var _this37 = this
  7223. var t = null
  7224. is.number(e) && (t = e),
  7225. is.number(t) || (t = this.storage.get('speed')),
  7226. is.number(t) || (t = this.config.speed.selected)
  7227. var i = this.minimumSpeed,
  7228. s = this.maximumSpeed
  7229. ;(t = clamp(t, i, s)),
  7230. (this.config.speed.selected = t),
  7231. setTimeout(function () {
  7232. _this37.media && (_this37.media.playbackRate = t)
  7233. }, 0)
  7234. }
  7235. },
  7236. {
  7237. key: 'minimumSpeed',
  7238. get: function get() {
  7239. return this.isYouTube
  7240. ? Math.min.apply(
  7241. Math,
  7242. _toConsumableArray(this.options.speed)
  7243. )
  7244. : this.isVimeo
  7245. ? 0.5
  7246. : 0.0625
  7247. }
  7248. },
  7249. {
  7250. key: 'maximumSpeed',
  7251. get: function get() {
  7252. return this.isYouTube
  7253. ? Math.max.apply(
  7254. Math,
  7255. _toConsumableArray(this.options.speed)
  7256. )
  7257. : this.isVimeo
  7258. ? 2
  7259. : 16
  7260. }
  7261. },
  7262. {
  7263. key: 'quality',
  7264. get: function get() {
  7265. return this.media.quality
  7266. },
  7267. set: function set(e) {
  7268. var t = this.config.quality,
  7269. i = this.options.quality
  7270. if (!i.length) return
  7271. var s = [
  7272. !is.empty(e) && Number(e),
  7273. this.storage.get('quality'),
  7274. t.selected,
  7275. t.default
  7276. ].find(is.number),
  7277. n = !0
  7278. if (!i.includes(s)) {
  7279. var _e32 = closest(i, s)
  7280. this.debug.warn(
  7281. 'Unsupported quality option: '
  7282. .concat(s, ', using ')
  7283. .concat(_e32, ' instead')
  7284. ),
  7285. (s = _e32),
  7286. (n = !1)
  7287. }
  7288. ;(t.selected = s),
  7289. (this.media.quality = s),
  7290. n && this.storage.set({ quality: s })
  7291. }
  7292. },
  7293. {
  7294. key: 'loop',
  7295. get: function get() {
  7296. return Boolean(this.media.loop)
  7297. },
  7298. set: function set(e) {
  7299. var t = is.boolean(e) ? e : this.config.loop.active
  7300. ;(this.config.loop.active = t), (this.media.loop = t)
  7301. }
  7302. },
  7303. {
  7304. key: 'source',
  7305. get: function get() {
  7306. return this.media.currentSrc
  7307. },
  7308. set: function set(e) {
  7309. source.change.call(this, e)
  7310. }
  7311. },
  7312. {
  7313. key: 'download',
  7314. get: function get() {
  7315. var e = this.config.urls.download
  7316. return is.url(e) ? e : this.source
  7317. },
  7318. set: function set(e) {
  7319. is.url(e) &&
  7320. ((this.config.urls.download = e),
  7321. controls.setDownloadUrl.call(this))
  7322. }
  7323. },
  7324. {
  7325. key: 'poster',
  7326. get: function get() {
  7327. return this.isVideo
  7328. ? this.media.getAttribute('poster') ||
  7329. this.media.getAttribute('data-poster')
  7330. : null
  7331. },
  7332. set: function set(e) {
  7333. this.isVideo
  7334. ? ui.setPoster.call(this, e, !1).catch(function () {})
  7335. : this.debug.warn('Poster can only be set for video')
  7336. }
  7337. },
  7338. {
  7339. key: 'ratio',
  7340. get: function get() {
  7341. if (!this.isVideo) return null
  7342. var e = reduceAspectRatio(getAspectRatio.call(this))
  7343. return is.array(e) ? e.join(':') : e
  7344. },
  7345. set: function set(e) {
  7346. this.isVideo
  7347. ? is.string(e) && validateAspectRatio(e)
  7348. ? ((this.config.ratio = reduceAspectRatio(e)),
  7349. setAspectRatio.call(this))
  7350. : this.debug.error(
  7351. 'Invalid aspect ratio specified ('.concat(e, ')')
  7352. )
  7353. : this.debug.warn(
  7354. 'Aspect ratio can only be set for video'
  7355. )
  7356. }
  7357. },
  7358. {
  7359. key: 'autoplay',
  7360. get: function get() {
  7361. return Boolean(this.config.autoplay)
  7362. },
  7363. set: function set(e) {
  7364. this.config.autoplay = is.boolean(e)
  7365. ? e
  7366. : this.config.autoplay
  7367. }
  7368. },
  7369. {
  7370. key: 'toggleCaptions',
  7371. value: function toggleCaptions(e) {
  7372. captions.toggle.call(this, e, !1)
  7373. }
  7374. },
  7375. {
  7376. key: 'currentTrack',
  7377. get: function get() {
  7378. var _this$captions2 = this.captions,
  7379. e = _this$captions2.toggled,
  7380. t = _this$captions2.currentTrack
  7381. return e ? t : -1
  7382. },
  7383. set: function set(e) {
  7384. captions.set.call(this, e, !1), captions.setup.call(this)
  7385. }
  7386. },
  7387. {
  7388. key: 'language',
  7389. get: function get() {
  7390. return (captions.getCurrentTrack.call(this) || {}).language
  7391. },
  7392. set: function set(e) {
  7393. captions.setLanguage.call(this, e, !1)
  7394. }
  7395. },
  7396. {
  7397. key: 'pip',
  7398. get: function get() {
  7399. return support.pip
  7400. ? is.empty(this.media.webkitPresentationMode)
  7401. ? this.media === document.pictureInPictureElement
  7402. : this.media.webkitPresentationMode === pip.active
  7403. : null
  7404. },
  7405. set: function set(e) {
  7406. if (!support.pip) return
  7407. var t = is.boolean(e) ? e : !this.pip
  7408. is.function(this.media.webkitSetPresentationMode) &&
  7409. this.media.webkitSetPresentationMode(
  7410. t ? pip.active : pip.inactive
  7411. ),
  7412. is.function(this.media.requestPictureInPicture) &&
  7413. (!this.pip && t
  7414. ? this.media.requestPictureInPicture()
  7415. : this.pip && !t && document.exitPictureInPicture())
  7416. }
  7417. },
  7418. {
  7419. key: 'setPreviewThumbnails',
  7420. value: function setPreviewThumbnails(e) {
  7421. this.previewThumbnails &&
  7422. this.previewThumbnails.loaded &&
  7423. (this.previewThumbnails.destroy(),
  7424. (this.previewThumbnails = null)),
  7425. Object.assign(this.config.previewThumbnails, e),
  7426. this.config.previewThumbnails.enabled &&
  7427. (this.previewThumbnails = new PreviewThumbnails(this))
  7428. }
  7429. }
  7430. ],
  7431. [
  7432. {
  7433. key: 'supported',
  7434. value: function supported(e, t, i) {
  7435. return support.check(e, t, i)
  7436. }
  7437. },
  7438. {
  7439. key: 'loadSprite',
  7440. value: function loadSprite(e, t) {
  7441. return _loadSprite(e, t)
  7442. }
  7443. },
  7444. {
  7445. key: 'setup',
  7446. value: function setup(e) {
  7447. var t =
  7448. arguments.length > 1 && arguments[1] !== undefined
  7449. ? arguments[1]
  7450. : {}
  7451. var i = null
  7452. return (
  7453. is.string(e)
  7454. ? (i = Array.from(document.querySelectorAll(e)))
  7455. : is.nodeList(e)
  7456. ? (i = Array.from(e))
  7457. : is.array(e) && (i = e.filter(is.element)),
  7458. is.empty(i)
  7459. ? null
  7460. : i.map(function (e) {
  7461. return new Plyr(e, t)
  7462. })
  7463. )
  7464. }
  7465. }
  7466. ]
  7467. )
  7468. return Plyr
  7469. })()
  7470. Plyr.defaults = cloneDeep(defaults)
  7471. var plyr = ''
  7472. var iconVideoPlay =
  7473. 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFIAAABSCAMAAADw8nOpAAAAAXNSR0IArs4c6QAAAapQTFRFAAAA////////////2NjY2dnZ9vb2////9vb23Nzc3d3d3t7e39/f////4+Pj4+Pj6+vr7Ozs5+fn6Ojo7u7u6enp6enp7+/v8fHx7Ozs8fHx7e3t7+/v8/Pz8PDw8/Pz9PT0+/v78PDw8PDw9PT09PT0////9fX1/Pz89fX19fX19fX18vLy/Pz89vb29vb2/Pz8+fn59/f3////9/f3+vr69/f3+vr6////+Pj4+/v7////+/v7+/v7+Pj4+fn5/////f39+/v7+/v7+/v7+fn5+/v7+/v7/f39////+/v7////+/v7/f39/Pz8/Pz8/////Pz8/////Pz8/f39/f39/Pz8/f39/v7+/Pz8/v7+/////Pz8/v7+/v7+/v7+/v7+/Pz8/v7+/////v7+/v7+/v7+/v7+/v7+/v7+/////v7+/v7+/v7+/////v7+/////v7+/v7+/////v7+/////v7+/////////////////v7+/////v7+/////////////v7+/////////////////////v7+////////////////////////lZ+FUgAAAI10Uk5TAAYSFRobGxscHR4fICMkJScpKywsLi8vNTY2OD5BQkJDQ0RGRkhISktMTlBRUlNVWFlbXF1gY29wcXJyc3R1d3p7fH+AgoSFhoaHj5CTlJWXmJifn6WoqKusr6+0tLi5ury/v8LDyMvMzdTV1tjY2trb3ODh4eLj5ejs7e3u7u/w8vT19vj5+vr7/P3+n1NMJwAAA5RJREFUWMO1metfEkEUhg86lrZZRBeVitJSsVIkKym7KFqYqJGXLiplCWUYBKllRiaQa7Lz/s998Bqyu7ML+37eeX47t3Pec4ZIR9VuX2gutpSW5fRSbC7kc1dTKaroHEtyFIgnxzorzPFs7VMbADLRCb/X5XRIksPp8vonohkAG1PtNsPAysFVIB8JtNawAtW0BiJ5YHWw0hDwaDALxAbqmIrqBmJANnhEfMq9OfDZNqaptlmOXK/g9Bvj4DNNTFdNMxzxRpFfHOFIeZiQPCnwEd0frZ2HPCQxQUlDMuZrtYkt61hsZgbUvIj1Fi1i1ybCdmZI9jA2u9SJPQpGmWGNQulRJULpZybUr0CF2aUo3cyUuhWl6NxbNtHPTKofm0X2qHbdzDrur+f6obNkm0eYlaAw5gvP/AgW7aUg7YsYKbjXXG5mJalZ5v/dd1sCQ6xEDSFxcOp9SEmlIqUU+g5E3Bz3sJLl4bn9mBzEDCuDZhDcyzNZrhpxT104Loxs4tndfDSIWbX1mdzCr8fHRJmzGNzZ7lWo5ZlhAMDna4LINqxub3o7YmrffN12A8qkQ4wZQzsREU1jQO2TH7sW4+ddIeQApomIKuR8nS4S+HBRAFmX36ggok5EmAASf5+d0GdG0ElEYwgIIYHvt3WRAYwRURKtgkjgbb0OshVJomqeqRFGIhfQPqQ1GV5Nbo2lPIwEEjd0FtNNPowbQoK/PKOBHIePQvAbQwJrD6pUR/gRojl4jSKBj5fVRngxRwtwGUdi6/nJ4iNcWKBlNJhAAis3i45owDKl4TCFRL6j2AgH0iRDMocsnvclyCUg36shTU8c99QmvgSnKWR+uOgIJ5YoZuoQ4dOV4iMuIWbuqP9+VKVx1E1cSP7qrOaFNBw28KVDI2xMwEduRA0h/2hXRVG4DYZgvDuvH4INJYqVOyKJwkA6Uw0/helMNOlqBMnCpCtoDdbuVwlbAyEDw1+cFjMwU3o269sOMX7dmM3SMIOvt5P3E0GHuWcGNSzruTiAN/VMUHuWVctYS7ceXjVjrC2w/1YUKdRbnlKq92DBFy9HwRe3WVuWWlE8W1HiW9CIsKJdYkVTx4rWkxUNMivaeFY0G61oiVrRuCWixoR4eznRKNgE7xNtgveJvwEcKXernoio8mmZHxS2nz2mZQCZyLjf62pwSJKjweX1j0cyAORpE88eljzOHHxCWlhOy3J6eUHoCekfdmynrwwsFL4AAAAASUVORK5CYII='
  7474. var ColVideo = exports(
  7475. 'C',
  7476. defineComponent({
  7477. name: 'col-video',
  7478. props: {
  7479. trySee: {
  7480. // 是否试看
  7481. type: Boolean,
  7482. default: false
  7483. },
  7484. freeTitleStatus: { type: Boolean, default: true }, // 试看比例
  7485. freeRate: { type: Number, default: 100 },
  7486. setting: { type: Object, default: function _default() {} },
  7487. controls: Boolean,
  7488. height: String,
  7489. src: { type: String, default: '' },
  7490. poster: { type: String, default: '' },
  7491. styleValue: {
  7492. type: Object,
  7493. default: function _default() {
  7494. return {}
  7495. }
  7496. },
  7497. preload: { type: String, default: 'auto' },
  7498. currentTime: { type: Boolean, default: true },
  7499. playsinline: { type: Boolean, default: true },
  7500. onPlay: { type: Function, default: function _default() {} }
  7501. },
  7502. data: function data() {
  7503. return {
  7504. player: null, // playTime: 0,
  7505. loading: true, // 首次进入加载中
  7506. trySeeOver: false, // 试看是否结束
  7507. showSeeStatus: true // 是否显示试看状态
  7508. }
  7509. },
  7510. mounted: function mounted() {
  7511. var _this38 = this
  7512. this._init()
  7513. listenerMessage('setVideoPlayer', function (result) {
  7514. var content =
  7515. result === null || result === void 0
  7516. ? void 0
  7517. : result.content
  7518. if (content.status === 'pause') {
  7519. _this38.player.pause()
  7520. }
  7521. })
  7522. },
  7523. computed: {
  7524. computedSeeStatus: function computedSeeStatus() {
  7525. console.log(
  7526. this.showSeeStatus,
  7527. this.trySee,
  7528. this.trySeeOver,
  7529. 'this.showSeeStatus, this.trySee'
  7530. )
  7531. return this.showSeeStatus && this.trySee
  7532. },
  7533. playTime: function playTime() {
  7534. // 允许播放时间
  7535. var player = this.player
  7536. var playTime = (player.duration * this.freeRate) / 100
  7537. return playTime || 0
  7538. }
  7539. },
  7540. methods: {
  7541. _init: function _init() {
  7542. var _this39 = this // controls: [
  7543. // 'play-large' , // 中间的大播放按钮
  7544. // 'restart' , // 重新开始播放
  7545. // 'rewind' , // 按寻道时间倒带(默认 10 秒)
  7546. // 'play' , // 播放/暂停播放
  7547. // 'fast-forward' , // 快进查找时间(默认 10 秒)
  7548. // 'progress' , // 播放和缓冲的进度条和滑动条
  7549. // 'current-time' , // 播放的当前时间
  7550. // ' duration' , // 媒体的完整持续时间
  7551. // 'mute' , // 切换静音
  7552. // 'volume', // 音量控制
  7553. // 'captions' , // 切换字幕
  7554. // 'settings' , // 设置菜单
  7555. // 'pip' , // 画中画(当前仅 Safari)
  7556. // 'airplay' , // Airplay(当前仅 Safari)
  7557. // 'download ' , // 显示一个下载按钮,其中包含指向当前源或您在选项中指定的自定义 URL 的链接
  7558. // 'fullscreen' , // 切换全屏
  7559. // ] ;
  7560. var controls = [
  7561. 'play-large',
  7562. 'play',
  7563. 'progress',
  7564. 'captions',
  7565. 'fullscreen'
  7566. ]
  7567. if (this.currentTime) {
  7568. controls.push('current-time')
  7569. }
  7570. var params = _objectSpread(
  7571. _objectSpread({ controls: controls }, this.setting),
  7572. {},
  7573. { invertTime: false }
  7574. )
  7575. if (browser$1().iPhone) {
  7576. params.fullscreen = {
  7577. enabled: true,
  7578. fallback: 'force',
  7579. iosNative: true
  7580. }
  7581. }
  7582. this.player = new Plyr(this.$refs.video, params) // fullscreen: {
  7583. // enabled: true,
  7584. // fallback: 'force',
  7585. // iosNative: true
  7586. // }
  7587. this.player.elements.container
  7588. ? (this.player.elements.container.style.height =
  7589. this.height || '210px')
  7590. : null
  7591. if (this.preload === 'none') {
  7592. this.loading = false
  7593. }
  7594. this.player.on('loadedmetadata', function () {
  7595. _this39.loading = false
  7596. console.log('loading 1111')
  7597. if (_this39.trySee) {
  7598. _this39.domPlayVisibility()
  7599. } else {
  7600. _this39.domPlayVisibility(false)
  7601. } // 监听播放事件
  7602. var _this = _this39
  7603. _this39.player.on('timeupdate', function () {
  7604. var players = _this.player
  7605. if (
  7606. players.currentTime >= _this39.playTime &&
  7607. _this.trySee
  7608. ) {
  7609. players.pause()
  7610. _this.trySeeOver = true
  7611. _this.showSeeStatus = true
  7612. _this.domPlayVisibility() // 试看结束后隐藏播放按钮
  7613. }
  7614. })
  7615. })
  7616. this.player.on('play', function () {
  7617. postMessage(
  7618. { api: 'getDeviceStatus', content: { type: 'video' } },
  7619. function (res) {
  7620. // 判断是否在录屏中, 如果在录屏则不允许播放
  7621. if (res.content.status == '1') {
  7622. Toast('为了保证数据安全,请不要录屏')
  7623. _this39.player.pause()
  7624. }
  7625. }
  7626. )
  7627. _this39.onPlay && _this39.onPlay()
  7628. })
  7629. this.player.on('enterfullscreen', function () {
  7630. console.log('fullscreen')
  7631. var i = document.createElement('i')
  7632. i.id = 'fullscreen-back'
  7633. i.className = 'van-icon van-icon-arrow-left video-back'
  7634. i.addEventListener('click', function () {
  7635. _this39.player.fullscreen.exit()
  7636. })
  7637. console.log(document.getElementsByClassName('plyr'))
  7638. document.getElementsByClassName('plyr')[0].appendChild(i)
  7639. })
  7640. this.player.on('exitfullscreen', function () {
  7641. console.log('exitfullscreen')
  7642. var i = document.getElementById('fullscreen-back')
  7643. i && i.remove()
  7644. })
  7645. }, // 操作功能
  7646. domPlayVisibility: function domPlayVisibility() {
  7647. var hide =
  7648. arguments.length > 0 && arguments[0] !== undefined
  7649. ? arguments[0]
  7650. : true
  7651. var controls = document.querySelector('.plyr__controls')
  7652. var controls2 = document.querySelector(
  7653. '.plyr__control--overlaid'
  7654. )
  7655. if (hide) {
  7656. controls === null || controls === void 0
  7657. ? void 0
  7658. : controls.setAttribute('style', 'display:none')
  7659. controls2 === null || controls2 === void 0
  7660. ? void 0
  7661. : controls2.setAttribute('style', 'display:none')
  7662. } else {
  7663. controls === null || controls === void 0
  7664. ? void 0
  7665. : controls.removeAttribute('style')
  7666. setTimeout(function () {
  7667. controls2 === null || controls2 === void 0
  7668. ? void 0
  7669. : controls2.removeAttribute('style')
  7670. }, 200)
  7671. }
  7672. },
  7673. onClickPlay: function onClickPlay() {
  7674. this.player.play()
  7675. this.domPlayVisibility(false)
  7676. this.showSeeStatus = false
  7677. },
  7678. onBuy: function onBuy() {
  7679. this.$router.back()
  7680. },
  7681. onReplay: function onReplay() {
  7682. this.player.restart()
  7683. this.player.play()
  7684. this.domPlayVisibility(false)
  7685. this.trySeeOver = false
  7686. this.showSeeStatus = false
  7687. }
  7688. },
  7689. unmounted: function unmounted() {
  7690. var _this$player
  7691. ;(_this$player = this.player) === null ||
  7692. _this$player === void 0
  7693. ? void 0
  7694. : _this$player.destroy()
  7695. },
  7696. render: function render() {
  7697. var _this40 = this
  7698. return createVNode(
  7699. 'div',
  7700. { class: styles['video-container'] },
  7701. [
  7702. createVNode(
  7703. 'video',
  7704. {
  7705. ref: 'video',
  7706. class: styles['video'],
  7707. src: this.src,
  7708. playsinline: this.playsinline,
  7709. poster: this.poster,
  7710. preload: this.preload,
  7711. style: _objectSpread({}, this.styleValue)
  7712. },
  7713. null
  7714. ),
  7715. this.loading &&
  7716. createVNode(
  7717. 'div',
  7718. {
  7719. class: styles.loadingVideo,
  7720. style: { height: this.height || '210px' }
  7721. },
  7722. [
  7723. createVNode(
  7724. Loading,
  7725. {
  7726. size: 36,
  7727. color: '#01C1B5',
  7728. vertical: true,
  7729. style: {
  7730. height: '100%',
  7731. justifyContent: 'center'
  7732. }
  7733. },
  7734. {
  7735. default: function _default() {
  7736. return [
  7737. createTextVNode('\u52A0\u8F7D\u4E2D...')
  7738. ]
  7739. }
  7740. }
  7741. )
  7742. ]
  7743. ),
  7744. this.trySee &&
  7745. this.computedSeeStatus &&
  7746. !this.loading &&
  7747. createVNode(
  7748. 'div',
  7749. {
  7750. class: [styles.loadingVideo, styles.playOver],
  7751. style: { height: this.height || '210px' }
  7752. },
  7753. [
  7754. !this.trySeeOver
  7755. ? createVNode(Fragment, null, [
  7756. createVNode(
  7757. Icon,
  7758. {
  7759. name: iconVideoPlay,
  7760. size: 50,
  7761. onClick: this.onClickPlay
  7762. },
  7763. null
  7764. ),
  7765. createVNode('p', { class: styles.freeTxt }, [
  7766. createTextVNode('\u514D\u8D39'),
  7767. this.freeTitleStatus ? '试看' : '领取'
  7768. ])
  7769. ])
  7770. : createVNode(Fragment, null, [
  7771. createVNode('p', { class: styles.tips }, [
  7772. this.freeTitleStatus
  7773. ? '免费试看结束,购买完整课程后继续学习'
  7774. : '试看结束,领取课程后继续学习'
  7775. ]),
  7776. createVNode(
  7777. Button,
  7778. {
  7779. class: styles.btn,
  7780. type: 'primary',
  7781. round: true,
  7782. size: 'small',
  7783. onClick: this.onBuy
  7784. },
  7785. {
  7786. default: function _default() {
  7787. return [
  7788. state.platformType === 'STUDENT'
  7789. ? _this40.freeTitleStatus
  7790. ? '立即购买'
  7791. : '免费领取'
  7792. : '返回'
  7793. ]
  7794. }
  7795. }
  7796. ),
  7797. createVNode(
  7798. 'div',
  7799. {
  7800. class: styles.replay,
  7801. onClick: this.onReplay
  7802. },
  7803. [
  7804. createVNode(
  7805. Icon,
  7806. {
  7807. name: 'replay',
  7808. style: { marginRight: '5px' },
  7809. size: 16
  7810. },
  7811. null
  7812. ),
  7813. createTextVNode('\u91CD\u64AD')
  7814. ]
  7815. )
  7816. ])
  7817. ]
  7818. )
  7819. ]
  7820. )
  7821. }
  7822. })
  7823. )
  7824. }
  7825. }
  7826. }
  7827. )
  7828. })()