jt3d.es1.js 5.1 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776587775877858779587805878158782587835878458785587865878758788587895879058791587925879358794587955879658797587985879958800588015880258803588045880558806588075880858809588105881158812588135881458815588165881758818588195882058821588225882358824588255882658827588285882958830588315883258833588345883558836588375883858839588405884158842588435884458845588465884758848588495885058851588525885358854588555885658857588585885958860588615886258863588645886558866588675886858869588705887158872588735887458875588765887758878588795888058881588825888358884588855888658887588885888958890588915889258893588945889558896588975889858899589005890158902589035890458905589065890758908589095891058911589125891358914589155891658917589185891958920589215892258923589245892558926589275892858929589305893158932589335893458935589365893758938589395894058941589425894358944589455894658947589485894958950589515895258953589545895558956589575895858959589605896158962589635896458965589665896758968589695897058971589725897358974589755897658977589785897958980589815898258983589845898558986589875898858989589905899158992589935899458995589965899758998589995900059001590025900359004590055900659007590085900959010590115901259013590145901559016590175901859019590205902159022590235902459025590265902759028590295903059031590325903359034590355903659037590385903959040590415904259043590445904559046590475904859049590505905159052590535905459055590565905759058590595906059061590625906359064590655906659067590685906959070590715907259073590745907559076590775907859079590805908159082590835908459085590865908759088590895909059091590925909359094590955909659097590985909959100591015910259103591045910559106591075910859109591105911159112591135911459115591165911759118591195912059121591225912359124591255912659127591285912959130591315913259133591345913559136591375913859139591405914159142591435914459145591465914759148591495915059151591525915359154591555915659157591585915959160591615916259163591645916559166591675916859169591705917159172591735917459175591765917759178591795918059181591825918359184591855918659187591885918959190591915919259193591945919559196591975919859199592005920159202592035920459205592065920759208592095921059211592125921359214592155921659217592185921959220592215922259223592245922559226592275922859229592305923159232592335923459235592365923759238592395924059241592425924359244592455924659247592485924959250592515925259253592545925559256592575925859259592605926159262592635926459265592665926759268592695927059271592725927359274592755927659277592785927959280592815928259283592845928559286592875928859289592905929159292592935929459295592965929759298592995930059301593025930359304593055930659307593085930959310593115931259313593145931559316593175931859319593205932159322593235932459325593265932759328593295933059331593325933359334593355933659337593385933959340593415934259343593445934559346593475934859349593505935159352593535935459355593565935759358593595936059361593625936359364593655936659367593685936959370593715937259373593745937559376593775937859379593805938159382593835938459385593865938759388593895939059391593925939359394593955939659397593985939959400594015940259403594045940559406594075940859409594105941159412594135941459415594165941759418594195942059421594225942359424594255942659427594285942959430594315943259433594345943559436594375943859439594405944159442594435944459445594465944759448594495945059451594525945359454594555945659457594585945959460594615946259463594645946559466594675946859469594705947159472594735947459475594765947759478594795948059481594825948359484594855948659487594885948959490594915949259493594945949559496594975949859499595005950159502595035950459505595065950759508595095951059511595125951359514595155951659517595185951959520595215952259523595245952559526595275952859529595305953159532595335953459535595365953759538595395954059541595425954359544595455954659547595485954959550595515955259553595545955559556595575955859559595605956159562595635956459565595665956759568595695957059571595725957359574595755957659577595785957959580595815958259583595845958559586595875958859589595905959159592595935959459595595965959759598595995960059601596025960359604596055960659607596085960959610596115961259613596145961559616596175961859619596205962159622596235962459625596265962759628596295963059631596325963359634596355963659637596385963959640596415964259643596445964559646596475964859649596505965159652596535965459655596565965759658596595966059661596625966359664596655966659667596685966959670596715967259673596745967559676596775967859679596805968159682596835968459685596865968759688596895969059691596925969359694596955969659697596985969959700597015970259703597045970559706597075970859709597105971159712597135971459715597165971759718597195972059721597225972359724597255972659727597285972959730597315973259733597345973559736597375973859739597405974159742597435974459745597465974759748597495975059751597525975359754597555975659757597585975959760597615976259763597645976559766597675976859769597705977159772597735977459775597765977759778597795978059781597825978359784597855978659787597885978959790597915979259793597945979559796597975979859799598005980159802598035980459805598065980759808598095981059811598125981359814598155981659817598185981959820598215982259823598245982559826598275982859829598305983159832598335983459835598365983759838598395984059841598425984359844598455984659847598485984959850598515985259853598545985559856598575985859859598605986159862598635986459865598665986759868598695987059871598725987359874598755987659877598785987959880598815988259883598845988559886598875988859889598905989159892598935989459895598965989759898598995990059901599025990359904599055990659907599085990959910599115991259913599145991559916599175991859919599205992159922599235992459925599265992759928599295993059931599325993359934599355993659937599385993959940599415994259943599445994559946599475994859949599505995159952599535995459955599565995759958599595996059961599625996359964599655996659967599685996959970599715997259973599745997559976599775997859979599805998159982599835998459985599865998759988599895999059991599925999359994599955999659997599985999960000600016000260003600046000560006600076000860009600106001160012600136001460015600166001760018600196002060021600226002360024600256002660027600286002960030600316003260033600346003560036600376003860039600406004160042600436004460045600466004760048600496005060051600526005360054600556005660057600586005960060600616006260063600646006560066600676006860069600706007160072600736007460075600766007760078600796008060081600826008360084600856008660087600886008960090600916009260093600946009560096600976009860099601006010160102601036010460105601066010760108601096011060111601126011360114601156011660117601186011960120601216012260123601246012560126601276012860129601306013160132601336013460135601366013760138601396014060141601426014360144601456014660147601486014960150601516015260153601546015560156601576015860159601606016160162601636016460165601666016760168601696017060171601726017360174601756017660177601786017960180601816018260183601846018560186601876018860189601906019160192601936019460195601966019760198601996020060201602026020360204602056020660207602086020960210602116021260213602146021560216602176021860219602206022160222602236022460225602266022760228602296023060231602326023360234602356023660237602386023960240602416024260243602446024560246602476024860249602506025160252602536025460255602566025760258602596026060261602626026360264602656026660267602686026960270602716027260273602746027560276602776027860279602806028160282602836028460285602866028760288602896029060291602926029360294602956029660297602986029960300603016030260303603046030560306603076030860309603106031160312603136031460315603166031760318603196032060321603226032360324603256032660327603286032960330603316033260333603346033560336603376033860339603406034160342603436034460345603466034760348603496035060351603526035360354603556035660357603586035960360603616036260363603646036560366603676036860369603706037160372603736037460375603766037760378603796038060381603826038360384603856038660387603886038960390603916039260393603946039560396603976039860399604006040160402604036040460405604066040760408604096041060411604126041360414604156041660417604186041960420604216042260423604246042560426604276042860429604306043160432604336043460435604366043760438604396044060441604426044360444604456044660447604486044960450604516045260453604546045560456604576045860459604606046160462604636046460465604666046760468604696047060471604726047360474604756047660477604786047960480604816048260483604846048560486604876048860489604906049160492604936049460495604966049760498604996050060501605026050360504605056050660507605086050960510605116051260513605146051560516605176051860519605206052160522605236052460525605266052760528605296053060531605326053360534605356053660537605386053960540605416054260543605446054560546605476054860549605506055160552605536055460555605566055760558605596056060561605626056360564605656056660567605686056960570605716057260573605746057560576605776057860579605806058160582605836058460585605866058760588605896059060591605926059360594605956059660597605986059960600606016060260603606046060560606606076060860609606106061160612606136061460615606166061760618606196062060621606226062360624606256062660627606286062960630606316063260633606346063560636606376063860639606406064160642606436064460645606466064760648606496065060651606526065360654606556065660657606586065960660606616066260663606646066560666606676066860669606706067160672606736067460675606766067760678606796068060681606826068360684606856068660687606886068960690606916069260693606946069560696606976069860699607006070160702607036070460705607066070760708607096071060711607126071360714607156071660717607186071960720607216072260723607246072560726607276072860729607306073160732607336073460735607366073760738607396074060741607426074360744607456074660747607486074960750607516075260753607546075560756607576075860759607606076160762607636076460765607666076760768607696077060771607726077360774607756077660777607786077960780607816078260783607846078560786607876078860789607906079160792607936079460795607966079760798607996080060801608026080360804608056080660807608086080960810608116081260813608146081560816608176081860819608206082160822608236082460825608266082760828608296083060831608326083360834608356083660837608386083960840608416084260843608446084560846608476084860849608506085160852608536085460855608566085760858608596086060861608626086360864608656086660867608686086960870608716087260873608746087560876608776087860879608806088160882608836088460885608866088760888608896089060891608926089360894608956089660897608986089960900609016090260903609046090560906609076090860909609106091160912609136091460915609166091760918609196092060921609226092360924609256092660927609286092960930609316093260933609346093560936609376093860939609406094160942609436094460945609466094760948609496095060951609526095360954609556095660957609586095960960609616096260963609646096560966609676096860969609706097160972609736097460975609766097760978609796098060981609826098360984609856098660987609886098960990609916099260993609946099560996609976099860999610006100161002610036100461005610066100761008610096101061011610126101361014610156101661017610186101961020610216102261023610246102561026610276102861029610306103161032610336103461035610366103761038610396104061041610426104361044610456104661047610486104961050610516105261053610546105561056610576105861059610606106161062610636106461065610666106761068610696107061071610726107361074610756107661077610786107961080610816108261083610846108561086610876108861089610906109161092610936109461095610966109761098610996110061101611026110361104611056110661107611086110961110611116111261113611146111561116611176111861119611206112161122611236112461125611266112761128611296113061131611326113361134611356113661137611386113961140611416114261143611446114561146611476114861149611506115161152611536115461155611566115761158611596116061161611626116361164611656116661167611686116961170611716117261173611746117561176611776117861179611806118161182611836118461185611866118761188611896119061191611926119361194611956119661197611986119961200612016120261203612046120561206612076120861209612106121161212612136121461215612166121761218612196122061221612226122361224612256122661227612286122961230612316123261233612346123561236612376123861239612406124161242612436124461245612466124761248612496125061251612526125361254612556125661257612586125961260612616126261263612646126561266612676126861269612706127161272612736127461275612766127761278612796128061281612826128361284612856128661287612886128961290612916129261293612946129561296612976129861299613006130161302613036130461305613066130761308613096131061311613126131361314613156131661317613186131961320613216132261323613246132561326613276132861329613306133161332613336133461335613366133761338613396134061341613426134361344613456134661347613486134961350613516135261353613546135561356613576135861359613606136161362613636136461365613666136761368613696137061371613726137361374613756137661377613786137961380613816138261383613846138561386613876138861389613906139161392613936139461395613966139761398613996140061401614026140361404614056140661407614086140961410614116141261413614146141561416614176141861419614206142161422614236142461425614266142761428614296143061431614326143361434614356143661437614386143961440614416144261443614446144561446614476144861449614506145161452614536145461455614566145761458614596146061461614626146361464614656146661467614686146961470614716147261473614746147561476614776147861479614806148161482614836148461485614866148761488614896149061491614926149361494614956149661497614986149961500615016150261503615046150561506615076150861509615106151161512615136151461515615166151761518615196152061521615226152361524615256152661527615286152961530615316153261533615346153561536615376153861539615406154161542615436154461545615466154761548615496155061551615526155361554615556155661557615586155961560615616156261563615646156561566615676156861569615706157161572615736157461575615766157761578615796158061581615826158361584615856158661587615886158961590615916159261593615946159561596615976159861599616006160161602616036160461605616066160761608616096161061611616126161361614616156161661617616186161961620616216162261623616246162561626616276162861629616306163161632616336163461635616366163761638616396164061641616426164361644616456164661647616486164961650616516165261653616546165561656616576165861659616606166161662616636166461665616666166761668616696167061671616726167361674616756167661677616786167961680616816168261683616846168561686616876168861689616906169161692616936169461695616966169761698616996170061701617026170361704617056170661707617086170961710617116171261713617146171561716617176171861719617206172161722617236172461725617266172761728617296173061731617326173361734617356173661737617386173961740617416174261743617446174561746617476174861749617506175161752617536175461755617566175761758617596176061761617626176361764617656176661767617686176961770617716177261773617746177561776617776177861779617806178161782617836178461785617866178761788617896179061791617926179361794617956179661797617986179961800618016180261803618046180561806618076180861809618106181161812618136181461815618166181761818618196182061821618226182361824618256182661827618286182961830618316183261833618346183561836618376183861839618406184161842618436184461845618466184761848618496185061851618526185361854618556185661857618586185961860618616186261863618646186561866618676186861869618706187161872618736187461875618766187761878618796188061881618826188361884618856188661887618886188961890618916189261893618946189561896618976189861899619006190161902619036190461905619066190761908619096191061911619126191361914619156191661917619186191961920619216192261923619246192561926619276192861929619306193161932619336193461935619366193761938619396194061941619426194361944619456194661947619486194961950619516195261953619546195561956619576195861959619606196161962619636196461965619666196761968619696197061971619726197361974619756197661977619786197961980619816198261983619846198561986619876198861989619906199161992619936199461995619966199761998619996200062001620026200362004620056200662007620086200962010620116201262013620146201562016620176201862019620206202162022620236202462025620266202762028620296203062031620326203362034620356203662037620386203962040620416204262043620446204562046620476204862049620506205162052620536205462055620566205762058620596206062061620626206362064620656206662067620686206962070620716207262073620746207562076620776207862079620806208162082620836208462085620866208762088620896209062091620926209362094620956209662097620986209962100621016210262103621046210562106621076210862109621106211162112621136211462115621166211762118621196212062121621226212362124621256212662127621286212962130621316213262133621346213562136621376213862139621406214162142621436214462145621466214762148621496215062151621526215362154621556215662157621586215962160621616216262163621646216562166621676216862169621706217162172621736217462175621766217762178621796218062181621826218362184621856218662187621886218962190621916219262193621946219562196621976219862199622006220162202622036220462205622066220762208622096221062211622126221362214622156221662217622186221962220622216222262223622246222562226622276222862229622306223162232622336223462235622366223762238622396224062241622426224362244622456224662247622486224962250622516225262253622546225562256622576225862259622606226162262622636226462265622666226762268622696227062271622726227362274622756227662277622786227962280622816228262283622846228562286622876228862289622906229162292622936229462295622966229762298622996230062301623026230362304623056230662307623086230962310623116231262313623146231562316623176231862319623206232162322623236232462325623266232762328623296233062331623326233362334623356233662337623386233962340623416234262343623446234562346623476234862349623506235162352623536235462355623566235762358623596236062361623626236362364623656236662367623686236962370623716237262373623746237562376623776237862379623806238162382623836238462385623866238762388623896239062391623926239362394623956239662397623986239962400624016240262403624046240562406624076240862409624106241162412624136241462415624166241762418624196242062421624226242362424624256242662427624286242962430624316243262433624346243562436624376243862439624406244162442624436244462445624466244762448624496245062451624526245362454624556245662457624586245962460624616246262463624646246562466624676246862469624706247162472624736247462475624766247762478624796248062481624826248362484624856248662487624886248962490624916249262493624946249562496624976249862499625006250162502625036250462505625066250762508625096251062511625126251362514625156251662517625186251962520625216252262523625246252562526625276252862529625306253162532625336253462535625366253762538625396254062541625426254362544625456254662547625486254962550625516255262553625546255562556625576255862559625606256162562625636256462565625666256762568625696257062571625726257362574625756257662577625786257962580625816258262583625846258562586625876258862589625906259162592625936259462595625966259762598625996260062601626026260362604626056260662607626086260962610626116261262613626146261562616626176261862619626206262162622626236262462625626266262762628626296263062631626326263362634626356263662637626386263962640626416264262643626446264562646626476264862649626506265162652626536265462655626566265762658626596266062661626626266362664626656266662667626686266962670626716267262673626746267562676626776267862679626806268162682626836268462685626866268762688626896269062691626926269362694626956269662697626986269962700627016270262703627046270562706627076270862709627106271162712627136271462715627166271762718627196272062721627226272362724627256272662727627286272962730627316273262733627346273562736627376273862739627406274162742627436274462745627466274762748627496275062751627526275362754627556275662757627586275962760627616276262763627646276562766627676276862769627706277162772627736277462775627766277762778627796278062781627826278362784627856278662787627886278962790627916279262793627946279562796627976279862799628006280162802628036280462805628066280762808628096281062811628126281362814628156281662817628186281962820628216282262823628246282562826628276282862829628306283162832628336283462835628366283762838628396284062841628426284362844628456284662847628486284962850628516285262853628546285562856628576285862859628606286162862628636286462865628666286762868628696287062871628726287362874628756287662877628786287962880628816288262883628846288562886628876288862889628906289162892628936289462895628966289762898628996290062901629026290362904629056290662907629086290962910629116291262913629146291562916629176291862919629206292162922629236292462925629266292762928629296293062931629326293362934629356293662937629386293962940629416294262943629446294562946629476294862949629506295162952629536295462955629566295762958629596296062961629626296362964629656296662967629686296962970629716297262973629746297562976629776297862979629806298162982629836298462985629866298762988629896299062991629926299362994629956299662997629986299963000630016300263003630046300563006630076300863009630106301163012630136301463015630166301763018630196302063021630226302363024630256302663027630286302963030630316303263033630346303563036630376303863039630406304163042630436304463045630466304763048630496305063051630526305363054630556305663057630586305963060630616306263063630646306563066630676306863069630706307163072630736307463075630766307763078630796308063081630826308363084630856308663087630886308963090630916309263093630946309563096630976309863099631006310163102631036310463105631066310763108631096311063111631126311363114631156311663117631186311963120631216312263123631246312563126631276312863129631306313163132631336313463135631366313763138631396314063141631426314363144631456314663147631486314963150631516315263153631546315563156631576315863159631606316163162631636316463165631666316763168631696317063171631726317363174631756317663177631786317963180631816318263183631846318563186631876318863189631906319163192631936319463195631966319763198631996320063201632026320363204632056320663207632086320963210632116321263213632146321563216632176321863219632206322163222632236322463225632266322763228632296323063231632326323363234632356323663237632386323963240632416324263243632446324563246632476324863249632506325163252632536325463255632566325763258632596326063261632626326363264632656326663267632686326963270632716327263273632746327563276632776327863279632806328163282632836328463285632866328763288632896329063291632926329363294632956329663297632986329963300633016330263303633046330563306633076330863309633106331163312633136331463315633166331763318633196332063321633226332363324633256332663327633286332963330633316333263333633346333563336633376333863339633406334163342633436334463345633466334763348633496335063351633526335363354633556335663357633586335963360633616336263363633646336563366633676336863369633706337163372633736337463375633766337763378633796338063381633826338363384633856338663387633886338963390633916339263393633946339563396633976339863399634006340163402634036340463405634066340763408634096341063411634126341363414634156341663417634186341963420634216342263423634246342563426634276342863429634306343163432634336343463435634366343763438634396344063441634426344363444634456344663447634486344963450634516345263453634546345563456634576345863459634606346163462634636346463465634666346763468634696347063471634726347363474634756347663477634786347963480634816348263483634846348563486634876348863489634906349163492634936349463495634966349763498634996350063501635026350363504635056350663507635086350963510635116351263513635146351563516635176351863519635206352163522635236352463525635266352763528635296353063531635326353363534635356353663537635386353963540635416354263543635446354563546635476354863549635506355163552635536355463555635566355763558635596356063561635626356363564635656356663567635686356963570635716357263573635746357563576635776357863579635806358163582635836358463585635866358763588635896359063591635926359363594635956359663597635986359963600636016360263603636046360563606636076360863609636106361163612636136361463615636166361763618636196362063621636226362363624636256362663627636286362963630636316363263633636346363563636636376363863639636406364163642636436364463645636466364763648636496365063651636526365363654636556365663657636586365963660636616366263663636646366563666636676366863669636706367163672636736367463675636766367763678636796368063681636826368363684636856368663687636886368963690636916369263693636946369563696636976369863699637006370163702637036370463705637066370763708637096371063711637126371363714637156371663717637186371963720637216372263723637246372563726637276372863729637306373163732637336373463735637366373763738637396374063741637426374363744637456374663747637486374963750637516375263753637546375563756637576375863759637606376163762637636376463765637666376763768637696377063771637726377363774637756377663777637786377963780637816378263783637846378563786637876378863789637906379163792637936379463795637966379763798637996380063801638026380363804638056380663807638086380963810638116381263813638146381563816638176381863819638206382163822638236382463825638266382763828638296383063831638326383363834638356383663837638386383963840638416384263843638446384563846638476384863849638506385163852638536385463855638566385763858638596386063861638626386363864638656386663867638686386963870638716387263873638746387563876638776387863879638806388163882638836388463885638866388763888638896389063891638926389363894638956389663897638986389963900639016390263903639046390563906639076390863909639106391163912639136391463915639166391763918639196392063921639226392363924639256392663927639286392963930639316393263933639346393563936639376393863939639406394163942639436394463945639466394763948639496395063951639526395363954639556395663957639586395963960639616396263963639646396563966639676396863969639706397163972639736397463975639766397763978639796398063981639826398363984639856398663987639886398963990639916399263993639946399563996639976399863999640006400164002640036400464005640066400764008640096401064011640126401364014640156401664017640186401964020640216402264023640246402564026640276402864029640306403164032640336403464035640366403764038640396404064041640426404364044640456404664047640486404964050640516405264053640546405564056640576405864059640606406164062640636406464065640666406764068640696407064071640726407364074640756407664077640786407964080640816408264083640846408564086640876408864089640906409164092640936409464095640966409764098640996410064101641026410364104641056410664107641086410964110641116411264113641146411564116641176411864119641206412164122641236412464125641266412764128641296413064131641326413364134641356413664137641386413964140641416414264143641446414564146641476414864149641506415164152641536415464155641566415764158641596416064161641626416364164641656416664167641686416964170641716417264173641746417564176641776417864179641806418164182641836418464185641866418764188641896419064191641926419364194641956419664197641986419964200642016420264203642046420564206642076420864209642106421164212642136421464215642166421764218642196422064221642226422364224642256422664227642286422964230642316423264233642346423564236642376423864239642406424164242642436424464245642466424764248642496425064251642526425364254642556425664257642586425964260642616426264263642646426564266642676426864269642706427164272642736427464275642766427764278642796428064281642826428364284642856428664287642886428964290642916429264293642946429564296642976429864299643006430164302643036430464305643066430764308643096431064311643126431364314643156431664317643186431964320643216432264323643246432564326643276432864329643306433164332643336433464335643366433764338643396434064341643426434364344643456434664347643486434964350643516435264353643546435564356643576435864359643606436164362643636436464365643666436764368643696437064371643726437364374643756437664377643786437964380643816438264383643846438564386643876438864389643906439164392643936439464395643966439764398643996440064401644026440364404644056440664407644086440964410644116441264413644146441564416644176441864419644206442164422644236442464425644266442764428644296443064431644326443364434644356443664437644386443964440644416444264443644446444564446644476444864449644506445164452644536445464455644566445764458644596446064461644626446364464644656446664467644686446964470644716447264473644746447564476644776447864479644806448164482644836448464485644866448764488644896449064491644926449364494644956449664497644986449964500645016450264503645046450564506645076450864509645106451164512645136451464515645166451764518645196452064521645226452364524645256452664527645286452964530645316453264533645346453564536645376453864539645406454164542645436454464545645466454764548645496455064551645526455364554645556455664557645586455964560645616456264563645646456564566645676456864569645706457164572645736457464575645766457764578645796458064581645826458364584645856458664587645886458964590645916459264593645946459564596645976459864599646006460164602646036460464605646066460764608646096461064611646126461364614646156461664617646186461964620646216462264623646246462564626646276462864629646306463164632646336463464635646366463764638646396464064641646426464364644646456464664647646486464964650646516465264653646546465564656646576465864659646606466164662646636466464665646666466764668646696467064671646726467364674646756467664677646786467964680646816468264683646846468564686646876468864689646906469164692646936469464695646966469764698646996470064701647026470364704647056470664707647086470964710647116471264713647146471564716647176471864719647206472164722647236472464725647266472764728647296473064731647326473364734647356473664737647386473964740647416474264743647446474564746647476474864749647506475164752647536475464755647566475764758647596476064761647626476364764647656476664767647686476964770647716477264773647746477564776647776477864779647806478164782647836478464785647866478764788647896479064791647926479364794647956479664797647986479964800648016480264803648046480564806648076480864809648106481164812648136481464815648166481764818648196482064821648226482364824648256482664827648286482964830648316483264833648346483564836648376483864839648406484164842648436484464845648466484764848648496485064851648526485364854648556485664857648586485964860648616486264863648646486564866648676486864869648706487164872648736487464875648766487764878648796488064881648826488364884648856488664887648886488964890648916489264893648946489564896648976489864899649006490164902649036490464905649066490764908649096491064911649126491364914649156491664917649186491964920649216492264923649246492564926649276492864929649306493164932649336493464935649366493764938649396494064941649426494364944649456494664947649486494964950649516495264953649546495564956649576495864959649606496164962649636496464965649666496764968649696497064971649726497364974649756497664977649786497964980649816498264983649846498564986649876498864989649906499164992649936499464995649966499764998649996500065001650026500365004650056500665007650086500965010650116501265013650146501565016650176501865019650206502165022650236502465025650266502765028650296503065031650326503365034650356503665037650386503965040650416504265043650446504565046650476504865049650506505165052650536505465055650566505765058650596506065061650626506365064650656506665067650686506965070650716507265073650746507565076650776507865079650806508165082650836508465085650866508765088650896509065091650926509365094650956509665097650986509965100651016510265103651046510565106651076510865109651106511165112651136511465115651166511765118651196512065121651226512365124651256512665127651286512965130651316513265133651346513565136651376513865139651406514165142651436514465145651466514765148651496515065151651526515365154651556515665157651586515965160651616516265163651646516565166651676516865169651706517165172651736517465175651766517765178651796518065181651826518365184651856518665187651886518965190651916519265193651946519565196651976519865199652006520165202652036520465205652066520765208652096521065211652126521365214652156521665217652186521965220652216522265223652246522565226652276522865229652306523165232652336523465235652366523765238652396524065241652426524365244652456524665247652486524965250652516525265253652546525565256652576525865259652606526165262652636526465265652666526765268652696527065271652726527365274652756527665277652786527965280652816528265283652846528565286652876528865289652906529165292652936529465295652966529765298652996530065301653026530365304653056530665307653086530965310653116531265313653146531565316653176531865319653206532165322653236532465325653266532765328653296533065331653326533365334653356533665337653386533965340653416534265343653446534565346653476534865349653506535165352653536535465355653566535765358653596536065361653626536365364653656536665367653686536965370653716537265373653746537565376653776537865379653806538165382653836538465385653866538765388653896539065391653926539365394653956539665397653986539965400654016540265403654046540565406654076540865409654106541165412654136541465415654166541765418654196542065421654226542365424654256542665427654286542965430654316543265433654346543565436654376543865439654406544165442654436544465445654466544765448654496545065451654526545365454654556545665457654586545965460654616546265463654646546565466654676546865469654706547165472654736547465475654766547765478654796548065481654826548365484654856548665487654886548965490654916549265493654946549565496654976549865499655006550165502655036550465505655066550765508655096551065511655126551365514655156551665517655186551965520655216552265523655246552565526655276552865529655306553165532655336553465535655366553765538655396554065541655426554365544655456554665547655486554965550655516555265553655546555565556655576555865559655606556165562655636556465565655666556765568655696557065571655726557365574655756557665577655786557965580655816558265583655846558565586655876558865589655906559165592655936559465595655966559765598655996560065601656026560365604656056560665607656086560965610656116561265613656146561565616656176561865619656206562165622656236562465625656266562765628656296563065631656326563365634656356563665637656386563965640656416564265643656446564565646656476564865649656506565165652656536565465655656566565765658656596566065661656626566365664656656566665667656686566965670656716567265673656746567565676656776567865679656806568165682656836568465685656866568765688656896569065691656926569365694656956569665697656986569965700657016570265703657046570565706657076570865709657106571165712657136571465715657166571765718657196572065721657226572365724657256572665727657286572965730657316573265733657346573565736657376573865739657406574165742657436574465745657466574765748657496575065751657526575365754657556575665757657586575965760657616576265763657646576565766657676576865769657706577165772657736577465775657766577765778657796578065781657826578365784657856578665787657886578965790657916579265793657946579565796657976579865799658006580165802658036580465805658066580765808658096581065811658126581365814658156581665817658186581965820658216582265823658246582565826658276582865829658306583165832658336583465835658366583765838658396584065841658426584365844658456584665847658486584965850658516585265853658546585565856658576585865859658606586165862658636586465865658666586765868658696587065871658726587365874658756587665877658786587965880658816588265883658846588565886658876588865889658906589165892658936589465895658966589765898658996590065901659026590365904659056590665907659086590965910659116591265913659146591565916659176591865919659206592165922659236592465925659266592765928659296593065931659326593365934659356593665937659386593965940659416594265943659446594565946659476594865949659506595165952659536595465955659566595765958659596596065961659626596365964659656596665967659686596965970659716597265973659746597565976659776597865979659806598165982659836598465985659866598765988659896599065991659926599365994659956599665997659986599966000660016600266003660046600566006660076600866009660106601166012660136601466015660166601766018660196602066021660226602366024660256602666027660286602966030660316603266033660346603566036660376603866039660406604166042660436604466045660466604766048660496605066051660526605366054660556605666057660586605966060660616606266063660646606566066660676606866069660706607166072660736607466075660766607766078660796608066081660826608366084660856608666087660886608966090660916609266093660946609566096660976609866099661006610166102661036610466105661066610766108661096611066111661126611366114661156611666117661186611966120661216612266123661246612566126661276612866129661306613166132661336613466135661366613766138661396614066141661426614366144661456614666147661486614966150661516615266153661546615566156661576615866159661606616166162661636616466165661666616766168661696617066171661726617366174661756617666177661786617966180661816618266183661846618566186661876618866189661906619166192661936619466195661966619766198661996620066201662026620366204662056620666207662086620966210662116621266213662146621566216662176621866219662206622166222662236622466225662266622766228662296623066231662326623366234662356623666237662386623966240662416624266243662446624566246662476624866249662506625166252662536625466255662566625766258662596626066261662626626366264662656626666267662686626966270662716627266273662746627566276662776627866279662806628166282662836628466285662866628766288662896629066291662926629366294662956629666297662986629966300663016630266303663046630566306663076630866309663106631166312663136631466315663166631766318663196632066321663226632366324663256632666327663286632966330663316633266333663346633566336663376633866339663406634166342663436634466345663466634766348663496635066351663526635366354663556635666357663586635966360663616636266363663646636566366663676636866369663706637166372663736637466375663766637766378663796638066381663826638366384663856638666387663886638966390663916639266393663946639566396663976639866399664006640166402664036640466405664066640766408664096641066411664126641366414664156641666417664186641966420664216642266423664246642566426664276642866429664306643166432664336643466435664366643766438664396644066441664426644366444664456644666447664486644966450664516645266453664546645566456664576645866459664606646166462664636646466465664666646766468664696647066471664726647366474664756647666477664786647966480664816648266483664846648566486664876648866489664906649166492664936649466495664966649766498664996650066501665026650366504665056650666507665086650966510665116651266513665146651566516665176651866519665206652166522665236652466525665266652766528665296653066531665326653366534665356653666537665386653966540665416654266543665446654566546665476654866549665506655166552665536655466555665566655766558665596656066561665626656366564665656656666567665686656966570665716657266573665746657566576665776657866579665806658166582665836658466585665866658766588665896659066591665926659366594665956659666597665986659966600666016660266603666046660566606666076660866609666106661166612666136661466615666166661766618666196662066621666226662366624666256662666627666286662966630666316663266633666346663566636666376663866639666406664166642666436664466645666466664766648666496665066651666526665366654666556665666657666586665966660666616666266663666646666566666666676666866669666706667166672666736667466675666766667766678666796668066681666826668366684666856668666687666886668966690666916669266693666946669566696666976669866699667006670166702667036670466705667066670766708667096671066711667126671366714667156671666717667186671966720667216672266723667246672566726667276672866729667306673166732667336673466735667366673766738667396674066741667426674366744667456674666747667486674966750667516675266753667546675566756667576675866759667606676166762667636676466765667666676766768667696677066771667726677366774667756677666777667786677966780667816678266783667846678566786667876678866789667906679166792667936679466795667966679766798667996680066801668026680366804668056680666807668086680966810668116681266813668146681566816668176681866819668206682166822668236682466825668266682766828668296683066831668326683366834668356683666837668386683966840668416684266843668446684566846668476684866849668506685166852668536685466855668566685766858668596686066861668626686366864668656686666867668686686966870668716687266873668746687566876668776687866879668806688166882668836688466885668866688766888668896689066891668926689366894668956689666897668986689966900669016690266903669046690566906669076690866909669106691166912669136691466915669166691766918669196692066921669226692366924669256692666927669286692966930669316693266933669346693566936669376693866939669406694166942669436694466945669466694766948669496695066951669526695366954669556695666957669586695966960669616696266963669646696566966669676696866969669706697166972669736697466975669766697766978669796698066981669826698366984669856698666987669886698966990669916699266993669946699566996669976699866999670006700167002670036700467005670066700767008670096701067011670126701367014670156701667017670186701967020670216702267023670246702567026670276702867029670306703167032670336703467035670366703767038670396704067041670426704367044670456704667047670486704967050670516705267053670546705567056670576705867059670606706167062670636706467065670666706767068670696707067071670726707367074670756707667077670786707967080670816708267083670846708567086670876708867089670906709167092670936709467095670966709767098670996710067101671026710367104671056710667107671086710967110671116711267113671146711567116671176711867119671206712167122671236712467125671266712767128671296713067131671326713367134671356713667137671386713967140671416714267143671446714567146671476714867149671506715167152671536715467155671566715767158671596716067161671626716367164671656716667167671686716967170671716717267173671746717567176671776717867179671806718167182671836718467185671866718767188671896719067191671926719367194671956719667197671986719967200672016720267203672046720567206672076720867209672106721167212672136721467215672166721767218672196722067221672226722367224672256722667227672286722967230672316723267233672346723567236672376723867239672406724167242672436724467245672466724767248672496725067251672526725367254672556725667257672586725967260672616726267263672646726567266672676726867269672706727167272672736727467275672766727767278672796728067281672826728367284672856728667287672886728967290672916729267293672946729567296672976729867299673006730167302673036730467305673066730767308673096731067311673126731367314673156731667317673186731967320673216732267323673246732567326673276732867329673306733167332673336733467335673366733767338673396734067341673426734367344673456734667347673486734967350673516735267353673546735567356673576735867359673606736167362673636736467365673666736767368673696737067371673726737367374673756737667377673786737967380673816738267383673846738567386673876738867389673906739167392673936739467395673966739767398673996740067401674026740367404674056740667407674086740967410674116741267413674146741567416674176741867419674206742167422674236742467425674266742767428674296743067431674326743367434674356743667437674386743967440674416744267443674446744567446674476744867449674506745167452674536745467455674566745767458674596746067461674626746367464674656746667467674686746967470674716747267473674746747567476674776747867479674806748167482674836748467485674866748767488674896749067491674926749367494674956749667497674986749967500675016750267503675046750567506675076750867509675106751167512675136751467515675166751767518675196752067521675226752367524675256752667527675286752967530675316753267533675346753567536675376753867539675406754167542675436754467545675466754767548675496755067551675526755367554675556755667557675586755967560675616756267563675646756567566675676756867569675706757167572675736757467575675766757767578675796758067581675826758367584675856758667587675886758967590675916759267593675946759567596675976759867599676006760167602676036760467605676066760767608676096761067611676126761367614676156761667617676186761967620676216762267623676246762567626676276762867629676306763167632676336763467635676366763767638676396764067641676426764367644676456764667647676486764967650676516765267653676546765567656676576765867659676606766167662676636766467665676666766767668676696767067671676726767367674676756767667677676786767967680676816768267683676846768567686676876768867689676906769167692676936769467695676966769767698676996770067701677026770367704677056770667707677086770967710677116771267713677146771567716677176771867719677206772167722677236772467725677266772767728677296773067731677326773367734677356773667737677386773967740677416774267743677446774567746677476774867749677506775167752677536775467755677566775767758677596776067761677626776367764677656776667767677686776967770677716777267773677746777567776677776777867779677806778167782677836778467785677866778767788677896779067791677926779367794677956779667797677986779967800678016780267803678046780567806678076780867809678106781167812678136781467815678166781767818678196782067821678226782367824678256782667827678286782967830678316783267833678346783567836678376783867839678406784167842678436784467845678466784767848678496785067851678526785367854678556785667857678586785967860678616786267863678646786567866678676786867869678706787167872678736787467875678766787767878678796788067881678826788367884678856788667887678886788967890678916789267893678946789567896678976789867899679006790167902679036790467905679066790767908679096791067911679126791367914679156791667917679186791967920679216792267923679246792567926679276792867929679306793167932679336793467935679366793767938679396794067941679426794367944679456794667947679486794967950679516795267953679546795567956679576795867959679606796167962679636796467965679666796767968679696797067971679726797367974679756797667977679786797967980679816798267983679846798567986679876798867989679906799167992679936799467995679966799767998679996800068001680026800368004680056800668007680086800968010680116801268013680146801568016680176801868019680206802168022680236802468025680266802768028680296803068031680326803368034680356803668037680386803968040680416804268043680446804568046680476804868049680506805168052680536805468055680566805768058680596806068061680626806368064680656806668067680686806968070680716807268073680746807568076680776807868079680806808168082680836808468085680866808768088680896809068091680926809368094680956809668097680986809968100681016810268103681046810568106681076810868109681106811168112681136811468115681166811768118681196812068121681226812368124681256812668127681286812968130681316813268133681346813568136681376813868139681406814168142681436814468145681466814768148681496815068151681526815368154681556815668157681586815968160681616816268163681646816568166681676816868169681706817168172681736817468175681766817768178681796818068181681826818368184681856818668187681886818968190681916819268193681946819568196681976819868199682006820168202682036820468205682066820768208682096821068211682126821368214682156821668217682186821968220682216822268223682246822568226682276822868229682306823168232682336823468235682366823768238682396824068241682426824368244682456824668247682486824968250682516825268253682546825568256682576825868259682606826168262682636826468265682666826768268682696827068271682726827368274682756827668277682786827968280682816828268283682846828568286682876828868289682906829168292682936829468295682966829768298682996830068301683026830368304683056830668307683086830968310683116831268313683146831568316683176831868319683206832168322683236832468325683266832768328683296833068331683326833368334683356833668337683386833968340683416834268343683446834568346683476834868349683506835168352683536835468355683566835768358683596836068361683626836368364683656836668367683686836968370683716837268373683746837568376683776837868379683806838168382683836838468385683866838768388683896839068391683926839368394683956839668397683986839968400684016840268403684046840568406684076840868409684106841168412684136841468415684166841768418684196842068421684226842368424684256842668427684286842968430684316843268433684346843568436684376843868439684406844168442684436844468445684466844768448684496845068451684526845368454684556845668457684586845968460684616846268463684646846568466684676846868469684706847168472684736847468475684766847768478684796848068481684826848368484684856848668487684886848968490684916849268493684946849568496684976849868499685006850168502685036850468505685066850768508685096851068511685126851368514685156851668517685186851968520685216852268523685246852568526685276852868529685306853168532685336853468535685366853768538685396854068541685426854368544685456854668547685486854968550685516855268553685546855568556685576855868559685606856168562685636856468565685666856768568685696857068571685726857368574685756857668577685786857968580685816858268583685846858568586685876858868589685906859168592685936859468595685966859768598685996860068601686026860368604686056860668607686086860968610686116861268613686146861568616686176861868619686206862168622686236862468625686266862768628686296863068631686326863368634686356863668637686386863968640686416864268643686446864568646686476864868649686506865168652686536865468655686566865768658686596866068661686626866368664686656866668667686686866968670686716867268673686746867568676686776867868679686806868168682686836868468685686866868768688686896869068691686926869368694686956869668697686986869968700687016870268703687046870568706687076870868709687106871168712687136871468715687166871768718687196872068721687226872368724687256872668727687286872968730687316873268733687346873568736687376873868739687406874168742687436874468745687466874768748687496875068751687526875368754687556875668757687586875968760687616876268763687646876568766687676876868769687706877168772687736877468775687766877768778687796878068781687826878368784687856878668787687886878968790687916879268793687946879568796687976879868799688006880168802688036880468805688066880768808688096881068811688126881368814688156881668817688186881968820688216882268823688246882568826688276882868829688306883168832688336883468835688366883768838688396884068841688426884368844688456884668847688486884968850688516885268853688546885568856688576885868859688606886168862688636886468865688666886768868688696887068871688726887368874688756887668877688786887968880688816888268883688846888568886688876888868889688906889168892688936889468895688966889768898688996890068901689026890368904689056890668907689086890968910689116891268913689146891568916689176891868919689206892168922689236892468925689266892768928689296893068931689326893368934689356893668937689386893968940689416894268943689446894568946689476894868949689506895168952689536895468955689566895768958689596896068961689626896368964689656896668967689686896968970689716897268973689746897568976689776897868979689806898168982689836898468985689866898768988689896899068991689926899368994689956899668997689986899969000690016900269003690046900569006690076900869009690106901169012690136901469015690166901769018690196902069021690226902369024690256902669027690286902969030690316903269033690346903569036690376903869039690406904169042690436904469045690466904769048690496905069051690526905369054690556905669057690586905969060690616906269063690646906569066690676906869069690706907169072690736907469075690766907769078690796908069081690826908369084690856908669087690886908969090690916909269093690946909569096690976909869099691006910169102691036910469105691066910769108691096911069111691126911369114691156911669117691186911969120691216912269123691246912569126691276912869129691306913169132691336913469135691366913769138691396914069141691426914369144691456914669147691486914969150691516915269153691546915569156691576915869159691606916169162691636916469165691666916769168691696917069171691726917369174691756917669177691786917969180691816918269183691846918569186691876918869189691906919169192691936919469195691966919769198691996920069201692026920369204692056920669207692086920969210692116921269213692146921569216692176921869219692206922169222692236922469225692266922769228692296923069231692326923369234692356923669237692386923969240692416924269243692446924569246692476924869249692506925169252692536925469255692566925769258692596926069261692626926369264692656926669267692686926969270692716927269273692746927569276692776927869279692806928169282692836928469285692866928769288692896929069291692926929369294692956929669297692986929969300693016930269303693046930569306693076930869309693106931169312693136931469315693166931769318693196932069321693226932369324693256932669327693286932969330693316933269333693346933569336693376933869339693406934169342693436934469345693466934769348693496935069351693526935369354693556935669357693586935969360693616936269363693646936569366693676936869369693706937169372693736937469375693766937769378693796938069381693826938369384693856938669387693886938969390693916939269393693946939569396693976939869399694006940169402694036940469405694066940769408694096941069411694126941369414694156941669417694186941969420694216942269423694246942569426694276942869429694306943169432694336943469435694366943769438694396944069441694426944369444694456944669447694486944969450694516945269453694546945569456694576945869459694606946169462694636946469465694666946769468694696947069471694726947369474694756947669477694786947969480694816948269483694846948569486694876948869489694906949169492694936949469495694966949769498694996950069501695026950369504695056950669507695086950969510695116951269513695146951569516695176951869519695206952169522695236952469525695266952769528695296953069531695326953369534695356953669537695386953969540695416954269543695446954569546695476954869549695506955169552695536955469555695566955769558695596956069561695626956369564695656956669567695686956969570695716957269573695746957569576695776957869579695806958169582695836958469585695866958769588695896959069591695926959369594695956959669597695986959969600696016960269603696046960569606696076960869609696106961169612696136961469615696166961769618696196962069621696226962369624696256962669627696286962969630696316963269633696346963569636696376963869639696406964169642696436964469645696466964769648696496965069651696526965369654696556965669657696586965969660696616966269663696646966569666696676966869669696706967169672696736967469675696766967769678696796968069681696826968369684696856968669687696886968969690696916969269693696946969569696696976969869699697006970169702697036970469705697066970769708697096971069711697126971369714697156971669717697186971969720697216972269723697246972569726697276972869729697306973169732697336973469735697366973769738697396974069741697426974369744697456974669747697486974969750697516975269753697546975569756697576975869759697606976169762697636976469765697666976769768697696977069771697726977369774697756977669777697786977969780697816978269783697846978569786697876978869789697906979169792697936979469795697966979769798697996980069801698026980369804698056980669807698086980969810698116981269813698146981569816698176981869819698206982169822698236982469825698266982769828698296983069831698326983369834698356983669837698386983969840698416984269843698446984569846698476984869849698506985169852698536985469855698566985769858698596986069861698626986369864698656986669867698686986969870698716987269873698746987569876698776987869879698806988169882698836988469885698866988769888698896989069891698926989369894698956989669897698986989969900699016990269903699046990569906699076990869909699106991169912699136991469915699166991769918699196992069921699226992369924699256992669927699286992969930699316993269933699346993569936699376993869939699406994169942699436994469945699466994769948699496995069951699526995369954699556995669957699586995969960699616996269963699646996569966699676996869969699706997169972699736997469975699766997769978699796998069981699826998369984699856998669987699886998969990699916999269993699946999569996699976999869999700007000170002700037000470005700067000770008700097001070011700127001370014700157001670017700187001970020700217002270023700247002570026700277002870029700307003170032700337003470035700367003770038700397004070041700427004370044700457004670047700487004970050700517005270053700547005570056700577005870059700607006170062700637006470065700667006770068700697007070071700727007370074700757007670077700787007970080700817008270083700847008570086700877008870089700907009170092700937009470095700967009770098700997010070101701027010370104701057010670107701087010970110701117011270113701147011570116701177011870119701207012170122701237012470125701267012770128701297013070131701327013370134701357013670137701387013970140701417014270143701447014570146701477014870149701507015170152701537015470155701567015770158701597016070161701627016370164701657016670167701687016970170701717017270173701747017570176701777017870179701807018170182701837018470185701867018770188701897019070191701927019370194701957019670197701987019970200702017020270203702047020570206702077020870209702107021170212702137021470215702167021770218702197022070221702227022370224702257022670227702287022970230702317023270233702347023570236702377023870239702407024170242702437024470245702467024770248702497025070251702527025370254702557025670257702587025970260702617026270263702647026570266702677026870269702707027170272702737027470275702767027770278702797028070281702827028370284702857028670287702887028970290702917029270293702947029570296702977029870299703007030170302703037030470305703067030770308703097031070311703127031370314703157031670317703187031970320703217032270323703247032570326703277032870329703307033170332703337033470335703367033770338703397034070341703427034370344703457034670347703487034970350703517035270353703547035570356703577035870359703607036170362703637036470365703667036770368703697037070371703727037370374703757037670377703787037970380703817038270383703847038570386703877038870389703907039170392703937039470395703967039770398703997040070401704027040370404704057040670407704087040970410704117041270413704147041570416704177041870419704207042170422704237042470425704267042770428704297043070431704327043370434704357043670437704387043970440704417044270443704447044570446704477044870449704507045170452704537045470455704567045770458704597046070461704627046370464704657046670467704687046970470704717047270473704747047570476704777047870479704807048170482704837048470485704867048770488704897049070491704927049370494704957049670497704987049970500705017050270503705047050570506705077050870509705107051170512705137051470515705167051770518705197052070521705227052370524705257052670527705287052970530705317053270533705347053570536705377053870539705407054170542705437054470545705467054770548705497055070551705527055370554705557055670557705587055970560705617056270563705647056570566705677056870569705707057170572705737057470575705767057770578705797058070581705827058370584705857058670587705887058970590705917059270593705947059570596705977059870599706007060170602706037060470605706067060770608706097061070611706127061370614706157061670617706187061970620706217062270623706247062570626706277062870629706307063170632706337063470635706367063770638706397064070641706427064370644706457064670647706487064970650706517065270653706547065570656706577065870659706607066170662706637066470665706667066770668706697067070671706727067370674706757067670677706787067970680706817068270683706847068570686706877068870689706907069170692706937069470695706967069770698706997070070701707027070370704707057070670707707087070970710707117071270713707147071570716707177071870719707207072170722707237072470725707267072770728707297073070731707327073370734707357073670737707387073970740707417074270743707447074570746707477074870749707507075170752707537075470755707567075770758707597076070761707627076370764707657076670767707687076970770707717077270773707747077570776707777077870779707807078170782707837078470785707867078770788707897079070791707927079370794707957079670797707987079970800708017080270803708047080570806708077080870809708107081170812708137081470815708167081770818708197082070821708227082370824708257082670827708287082970830708317083270833708347083570836708377083870839708407084170842708437084470845708467084770848708497085070851708527085370854708557085670857708587085970860708617086270863708647086570866708677086870869708707087170872708737087470875708767087770878708797088070881708827088370884708857088670887708887088970890708917089270893708947089570896708977089870899709007090170902709037090470905709067090770908709097091070911709127091370914709157091670917709187091970920709217092270923709247092570926709277092870929709307093170932709337093470935709367093770938709397094070941709427094370944709457094670947709487094970950709517095270953709547095570956709577095870959709607096170962709637096470965709667096770968709697097070971709727097370974709757097670977709787097970980709817098270983709847098570986709877098870989709907099170992709937099470995709967099770998709997100071001710027100371004710057100671007710087100971010710117101271013710147101571016710177101871019710207102171022710237102471025710267102771028710297103071031710327103371034710357103671037710387103971040710417104271043710447104571046710477104871049710507105171052710537105471055710567105771058710597106071061710627106371064710657106671067710687106971070710717107271073710747107571076710777107871079710807108171082710837108471085710867108771088710897109071091710927109371094710957109671097710987109971100711017110271103711047110571106711077110871109711107111171112711137111471115711167111771118711197112071121711227112371124711257112671127711287112971130711317113271133711347113571136711377113871139711407114171142711437114471145711467114771148711497115071151711527115371154711557115671157711587115971160711617116271163711647116571166711677116871169711707117171172711737117471175711767117771178711797118071181711827118371184711857118671187711887118971190711917119271193711947119571196711977119871199712007120171202712037120471205712067120771208712097121071211712127121371214712157121671217712187121971220712217122271223712247122571226712277122871229712307123171232712337123471235712367123771238712397124071241712427124371244712457124671247712487124971250712517125271253712547125571256712577125871259712607126171262712637126471265712667126771268712697127071271712727127371274712757127671277712787127971280712817128271283712847128571286712877128871289712907129171292712937129471295712967129771298712997130071301713027130371304713057130671307713087130971310713117131271313713147131571316713177131871319713207132171322713237132471325713267132771328713297133071331713327133371334713357133671337713387133971340713417134271343713447134571346713477134871349713507135171352713537135471355713567135771358713597136071361713627136371364713657136671367713687136971370713717137271373713747137571376713777137871379713807138171382713837138471385713867138771388713897139071391713927139371394713957139671397713987139971400714017140271403714047140571406714077140871409714107141171412714137141471415714167141771418714197142071421714227142371424714257142671427714287142971430714317143271433714347143571436714377143871439714407144171442714437144471445714467144771448714497145071451714527145371454714557145671457714587145971460714617146271463714647146571466714677146871469714707147171472714737147471475714767147771478714797148071481714827148371484714857148671487714887148971490714917149271493714947149571496714977149871499715007150171502715037150471505715067150771508715097151071511715127151371514715157151671517715187151971520715217152271523715247152571526715277152871529715307153171532715337153471535715367153771538715397154071541715427154371544715457154671547715487154971550715517155271553715547155571556715577155871559715607156171562715637156471565715667156771568715697157071571715727157371574715757157671577715787157971580715817158271583715847158571586715877158871589715907159171592715937159471595715967159771598715997160071601716027160371604716057160671607716087160971610716117161271613716147161571616716177161871619716207162171622716237162471625716267162771628716297163071631716327163371634716357163671637716387163971640716417164271643716447164571646716477164871649716507165171652716537165471655716567165771658716597166071661716627166371664716657166671667716687166971670716717167271673716747167571676716777167871679716807168171682716837168471685716867168771688716897169071691716927169371694716957169671697716987169971700717017170271703717047170571706717077170871709717107171171712717137171471715717167171771718717197172071721717227172371724717257172671727717287172971730717317173271733717347173571736717377173871739717407174171742717437174471745717467174771748717497175071751717527175371754717557175671757717587175971760717617176271763717647176571766717677176871769717707177171772717737177471775717767177771778717797178071781717827178371784717857178671787717887178971790717917179271793717947179571796717977179871799718007180171802718037180471805718067180771808718097181071811718127181371814718157181671817718187181971820718217182271823718247182571826718277182871829718307183171832718337183471835718367183771838718397184071841718427184371844718457184671847718487184971850718517185271853718547185571856718577185871859718607186171862718637186471865718667186771868718697187071871718727187371874718757187671877718787187971880718817188271883718847188571886718877188871889718907189171892718937189471895718967189771898718997190071901719027190371904719057190671907719087190971910719117191271913719147191571916719177191871919719207192171922719237192471925719267192771928719297193071931719327193371934719357193671937719387193971940719417194271943719447194571946719477194871949719507195171952719537195471955719567195771958719597196071961719627196371964719657196671967719687196971970719717197271973719747197571976719777197871979719807198171982719837198471985719867198771988719897199071991719927199371994719957199671997719987199972000720017200272003720047200572006720077200872009720107201172012720137201472015720167201772018720197202072021720227202372024720257202672027720287202972030720317203272033720347203572036720377203872039720407204172042720437204472045720467204772048720497205072051720527205372054720557205672057720587205972060720617206272063720647206572066720677206872069720707207172072720737207472075720767207772078720797208072081720827208372084720857208672087720887208972090720917209272093720947209572096720977209872099721007210172102721037210472105721067210772108721097211072111721127211372114721157211672117721187211972120721217212272123721247212572126721277212872129721307213172132721337213472135721367213772138721397214072141721427214372144721457214672147721487214972150721517215272153721547215572156721577215872159721607216172162721637216472165721667216772168721697217072171721727217372174721757217672177721787217972180721817218272183721847218572186721877218872189721907219172192721937219472195721967219772198721997220072201722027220372204722057220672207722087220972210722117221272213722147221572216722177221872219722207222172222722237222472225722267222772228722297223072231722327223372234722357223672237722387223972240722417224272243722447224572246722477224872249722507225172252722537225472255722567225772258722597226072261722627226372264722657226672267722687226972270722717227272273722747227572276722777227872279722807228172282722837228472285722867228772288722897229072291722927229372294722957229672297722987229972300723017230272303723047230572306723077230872309723107231172312723137231472315723167231772318723197232072321723227232372324723257232672327723287232972330723317233272333723347233572336723377233872339723407234172342723437234472345723467234772348723497235072351723527235372354723557235672357723587235972360723617236272363723647236572366723677236872369723707237172372723737237472375723767237772378723797238072381723827238372384723857238672387723887238972390723917239272393723947239572396723977239872399724007240172402724037240472405724067240772408724097241072411724127241372414724157241672417724187241972420724217242272423724247242572426724277242872429724307243172432724337243472435724367243772438724397244072441724427244372444724457244672447724487244972450724517245272453724547245572456724577245872459724607246172462724637246472465724667246772468724697247072471724727247372474724757247672477724787247972480724817248272483724847248572486724877248872489724907249172492724937249472495724967249772498724997250072501725027250372504725057250672507725087250972510725117251272513725147251572516725177251872519725207252172522725237252472525725267252772528725297253072531725327253372534725357253672537725387253972540725417254272543725447254572546725477254872549725507255172552725537255472555725567255772558725597256072561725627256372564725657256672567725687256972570725717257272573725747257572576725777257872579725807258172582725837258472585725867258772588725897259072591725927259372594725957259672597725987259972600726017260272603726047260572606726077260872609726107261172612726137261472615726167261772618726197262072621726227262372624726257262672627726287262972630726317263272633726347263572636726377263872639726407264172642726437264472645726467264772648726497265072651726527265372654726557265672657726587265972660726617266272663726647266572666726677266872669726707267172672726737267472675726767267772678726797268072681726827268372684726857268672687726887268972690726917269272693726947269572696726977269872699727007270172702727037270472705727067270772708727097271072711727127271372714727157271672717727187271972720727217272272723727247272572726727277272872729727307273172732727337273472735727367273772738727397274072741727427274372744727457274672747727487274972750727517275272753727547275572756727577275872759727607276172762727637276472765727667276772768727697277072771727727277372774727757277672777727787277972780727817278272783727847278572786727877278872789727907279172792727937279472795727967279772798727997280072801728027280372804728057280672807728087280972810728117281272813728147281572816728177281872819728207282172822728237282472825728267282772828728297283072831728327283372834728357283672837728387283972840728417284272843728447284572846728477284872849728507285172852728537285472855728567285772858728597286072861728627286372864728657286672867728687286972870728717287272873728747287572876728777287872879728807288172882728837288472885728867288772888728897289072891728927289372894728957289672897728987289972900729017290272903729047290572906729077290872909729107291172912729137291472915729167291772918729197292072921729227292372924729257292672927729287292972930729317293272933729347293572936729377293872939729407294172942729437294472945729467294772948729497295072951729527295372954729557295672957729587295972960729617296272963729647296572966729677296872969729707297172972729737297472975729767297772978729797298072981729827298372984729857298672987729887298972990729917299272993729947299572996729977299872999730007300173002730037300473005730067300773008730097301073011730127301373014730157301673017730187301973020730217302273023730247302573026730277302873029730307303173032730337303473035730367303773038730397304073041730427304373044730457304673047730487304973050730517305273053730547305573056730577305873059730607306173062730637306473065730667306773068730697307073071730727307373074730757307673077730787307973080730817308273083730847308573086730877308873089730907309173092730937309473095730967309773098730997310073101731027310373104731057310673107731087310973110731117311273113731147311573116731177311873119731207312173122731237312473125731267312773128731297313073131731327313373134731357313673137731387313973140731417314273143731447314573146731477314873149731507315173152731537315473155731567315773158731597316073161731627316373164731657316673167731687316973170731717317273173731747317573176731777317873179731807318173182731837318473185731867318773188731897319073191731927319373194731957319673197731987319973200732017320273203732047320573206732077320873209732107321173212732137321473215732167321773218732197322073221732227322373224732257322673227732287322973230732317323273233732347323573236732377323873239732407324173242732437324473245732467324773248732497325073251732527325373254732557325673257732587325973260732617326273263732647326573266732677326873269732707327173272732737327473275732767327773278732797328073281732827328373284732857328673287732887328973290732917329273293732947329573296732977329873299733007330173302733037330473305733067330773308733097331073311733127331373314733157331673317733187331973320733217332273323733247332573326733277332873329733307333173332733337333473335733367333773338733397334073341733427334373344733457334673347733487334973350733517335273353733547335573356733577335873359733607336173362733637336473365733667336773368733697337073371733727337373374733757337673377733787337973380733817338273383733847338573386733877338873389733907339173392733937339473395733967339773398733997340073401734027340373404734057340673407734087340973410734117341273413734147341573416734177341873419734207342173422734237342473425734267342773428734297343073431734327343373434734357343673437734387343973440734417344273443734447344573446734477344873449734507345173452734537345473455734567345773458734597346073461734627346373464734657346673467734687346973470734717347273473734747347573476734777347873479734807348173482734837348473485734867348773488734897349073491734927349373494734957349673497734987349973500735017350273503735047350573506735077350873509735107351173512735137351473515735167351773518735197352073521735227352373524735257352673527735287352973530735317353273533735347353573536735377353873539735407354173542735437354473545735467354773548735497355073551735527355373554735557355673557735587355973560735617356273563735647356573566735677356873569735707357173572735737357473575735767357773578735797358073581735827358373584735857358673587735887358973590735917359273593735947359573596735977359873599736007360173602736037360473605736067360773608736097361073611736127361373614736157361673617736187361973620736217362273623736247362573626736277362873629736307363173632736337363473635736367363773638736397364073641736427364373644736457364673647736487364973650736517365273653736547365573656736577365873659736607366173662736637366473665736667366773668736697367073671736727367373674736757367673677736787367973680736817368273683736847368573686736877368873689736907369173692736937369473695736967369773698736997370073701737027370373704737057370673707737087370973710737117371273713737147371573716737177371873719737207372173722737237372473725737267372773728737297373073731737327373373734737357373673737737387373973740737417374273743737447374573746737477374873749737507375173752737537375473755737567375773758737597376073761737627376373764737657376673767737687376973770737717377273773737747377573776737777377873779737807378173782737837378473785737867378773788737897379073791737927379373794737957379673797737987379973800738017380273803738047380573806738077380873809738107381173812738137381473815738167381773818738197382073821738227382373824738257382673827738287382973830738317383273833738347383573836738377383873839738407384173842738437384473845738467384773848738497385073851738527385373854738557385673857738587385973860738617386273863738647386573866738677386873869738707387173872738737387473875738767387773878738797388073881738827388373884738857388673887738887388973890738917389273893738947389573896738977389873899739007390173902739037390473905739067390773908739097391073911739127391373914739157391673917739187391973920739217392273923739247392573926739277392873929739307393173932739337393473935739367393773938739397394073941739427394373944739457394673947739487394973950739517395273953739547395573956739577395873959739607396173962739637396473965739667396773968739697397073971739727397373974739757397673977739787397973980739817398273983739847398573986739877398873989739907399173992739937399473995739967399773998739997400074001740027400374004740057400674007740087400974010740117401274013740147401574016740177401874019740207402174022740237402474025740267402774028740297403074031740327403374034740357403674037740387403974040740417404274043740447404574046740477404874049740507405174052740537405474055740567405774058740597406074061740627406374064740657406674067740687406974070740717407274073740747407574076740777407874079740807408174082740837408474085740867408774088740897409074091740927409374094740957409674097740987409974100741017410274103741047410574106741077410874109741107411174112741137411474115741167411774118741197412074121741227412374124741257412674127741287412974130741317413274133741347413574136741377413874139741407414174142741437414474145741467414774148741497415074151741527415374154741557415674157741587415974160741617416274163741647416574166741677416874169741707417174172741737417474175741767417774178741797418074181741827418374184741857418674187741887418974190741917419274193741947419574196741977419874199742007420174202742037420474205742067420774208742097421074211742127421374214742157421674217742187421974220742217422274223742247422574226742277422874229742307423174232742337423474235742367423774238742397424074241742427424374244742457424674247742487424974250742517425274253742547425574256742577425874259742607426174262742637426474265742667426774268742697427074271742727427374274742757427674277742787427974280742817428274283742847428574286742877428874289742907429174292742937429474295742967429774298742997430074301743027430374304743057430674307743087430974310743117431274313743147431574316743177431874319743207432174322743237432474325743267432774328743297433074331743327433374334743357433674337743387433974340743417434274343743447434574346743477434874349743507435174352743537435474355743567435774358743597436074361743627436374364743657436674367743687436974370743717437274373743747437574376743777437874379743807438174382743837438474385743867438774388743897439074391743927439374394743957439674397743987439974400744017440274403744047440574406744077440874409744107441174412744137441474415744167441774418744197442074421744227442374424744257442674427744287442974430744317443274433744347443574436744377443874439744407444174442744437444474445744467444774448744497445074451744527445374454744557445674457744587445974460744617446274463744647446574466744677446874469744707447174472744737447474475744767447774478744797448074481744827448374484744857448674487744887448974490744917449274493744947449574496744977449874499745007450174502745037450474505745067450774508745097451074511745127451374514745157451674517745187451974520745217452274523745247452574526745277452874529745307453174532745337453474535745367453774538745397454074541745427454374544745457454674547745487454974550745517455274553745547455574556745577455874559745607456174562745637456474565745667456774568745697457074571745727457374574745757457674577745787457974580745817458274583745847458574586745877458874589745907459174592745937459474595745967459774598745997460074601746027460374604746057460674607746087460974610746117461274613746147461574616746177461874619746207462174622746237462474625746267462774628746297463074631746327463374634746357463674637746387463974640746417464274643746447464574646746477464874649746507465174652746537465474655746567465774658746597466074661746627466374664746657466674667746687466974670746717467274673746747467574676746777467874679746807468174682746837468474685746867468774688746897469074691746927469374694746957469674697746987469974700747017470274703747047470574706747077470874709747107471174712747137471474715747167471774718747197472074721747227472374724747257472674727747287472974730747317473274733747347473574736747377473874739747407474174742747437474474745747467474774748747497475074751747527475374754747557475674757747587475974760747617476274763747647476574766747677476874769747707477174772747737477474775747767477774778747797478074781747827478374784747857478674787747887478974790747917479274793747947479574796747977479874799748007480174802748037480474805748067480774808748097481074811748127481374814748157481674817748187481974820748217482274823748247482574826748277482874829748307483174832748337483474835748367483774838748397484074841748427484374844748457484674847748487484974850748517485274853748547485574856748577485874859748607486174862748637486474865748667486774868748697487074871748727487374874748757487674877748787487974880748817488274883748847488574886748877488874889748907489174892748937489474895748967489774898748997490074901749027490374904749057490674907749087490974910749117491274913749147491574916749177491874919749207492174922749237492474925749267492774928749297493074931749327493374934749357493674937749387493974940749417494274943749447494574946749477494874949749507495174952749537495474955749567495774958749597496074961749627496374964749657496674967749687496974970749717497274973749747497574976749777497874979749807498174982749837498474985749867498774988749897499074991749927499374994749957499674997749987499975000750017500275003750047500575006750077500875009750107501175012750137501475015750167501775018750197502075021750227502375024750257502675027750287502975030750317503275033750347503575036750377503875039750407504175042750437504475045750467504775048750497505075051750527505375054750557505675057750587505975060750617506275063750647506575066750677506875069750707507175072750737507475075750767507775078750797508075081750827508375084750857508675087750887508975090750917509275093750947509575096750977509875099751007510175102751037510475105751067510775108751097511075111751127511375114751157511675117751187511975120751217512275123751247512575126751277512875129751307513175132751337513475135751367513775138751397514075141751427514375144751457514675147751487514975150751517515275153751547515575156751577515875159751607516175162751637516475165751667516775168751697517075171751727517375174751757517675177751787517975180751817518275183751847518575186751877518875189751907519175192751937519475195751967519775198751997520075201752027520375204752057520675207752087520975210752117521275213752147521575216752177521875219752207522175222752237522475225752267522775228752297523075231752327523375234752357523675237752387523975240752417524275243752447524575246752477524875249752507525175252752537525475255752567525775258752597526075261752627526375264752657526675267752687526975270752717527275273752747527575276752777527875279752807528175282752837528475285752867528775288752897529075291752927529375294752957529675297752987529975300753017530275303753047530575306753077530875309753107531175312753137531475315753167531775318753197532075321753227532375324753257532675327753287532975330753317533275333753347533575336753377533875339753407534175342753437534475345753467534775348753497535075351753527535375354753557535675357753587535975360753617536275363753647536575366753677536875369753707537175372753737537475375753767537775378753797538075381753827538375384753857538675387753887538975390753917539275393753947539575396753977539875399754007540175402754037540475405754067540775408754097541075411754127541375414754157541675417754187541975420754217542275423754247542575426754277542875429754307543175432754337543475435754367543775438754397544075441754427544375444754457544675447754487544975450754517545275453754547545575456754577545875459754607546175462754637546475465754667546775468754697547075471754727547375474754757547675477754787547975480754817548275483754847548575486754877548875489754907549175492754937549475495754967549775498754997550075501755027550375504755057550675507755087550975510755117551275513755147551575516755177551875519755207552175522755237552475525755267552775528755297553075531755327553375534755357553675537755387553975540755417554275543755447554575546755477554875549755507555175552755537555475555755567555775558755597556075561755627556375564755657556675567755687556975570755717557275573755747557575576755777557875579755807558175582755837558475585755867558775588755897559075591755927559375594755957559675597755987559975600756017560275603756047560575606756077560875609756107561175612756137561475615756167561775618756197562075621756227562375624756257562675627756287562975630756317563275633756347563575636756377563875639756407564175642756437564475645756467564775648756497565075651756527565375654756557565675657756587565975660756617566275663756647566575666756677566875669756707567175672756737567475675756767567775678756797568075681756827568375684756857568675687756887568975690756917569275693756947569575696756977569875699757007570175702757037570475705757067570775708757097571075711757127571375714757157571675717757187571975720757217572275723757247572575726757277572875729757307573175732757337573475735757367573775738757397574075741757427574375744757457574675747757487574975750757517575275753757547575575756757577575875759757607576175762757637576475765757667576775768757697577075771757727577375774757757577675777757787577975780757817578275783757847578575786757877578875789757907579175792757937579475795757967579775798757997580075801758027580375804758057580675807758087580975810758117581275813758147581575816758177581875819758207582175822758237582475825758267582775828758297583075831758327583375834758357583675837758387583975840758417584275843758447584575846758477584875849758507585175852758537585475855758567585775858758597586075861758627586375864758657586675867758687586975870758717587275873758747587575876758777587875879758807588175882758837588475885758867588775888758897589075891758927589375894758957589675897758987589975900759017590275903759047590575906759077590875909759107591175912759137591475915759167591775918759197592075921759227592375924759257592675927759287592975930759317593275933759347593575936759377593875939759407594175942759437594475945759467594775948759497595075951759527595375954759557595675957759587595975960759617596275963759647596575966759677596875969759707597175972759737597475975759767597775978759797598075981759827598375984759857598675987759887598975990759917599275993759947599575996759977599875999760007600176002760037600476005760067600776008760097601076011760127601376014760157601676017760187601976020760217602276023760247602576026760277602876029760307603176032760337603476035760367603776038760397604076041760427604376044760457604676047760487604976050760517605276053760547605576056760577605876059760607606176062760637606476065760667606776068760697607076071760727607376074760757607676077760787607976080760817608276083760847608576086760877608876089760907609176092760937609476095760967609776098760997610076101761027610376104761057610676107761087610976110761117611276113761147611576116761177611876119761207612176122761237612476125761267612776128761297613076131761327613376134761357613676137761387613976140761417614276143761447614576146761477614876149761507615176152761537615476155761567615776158761597616076161761627616376164761657616676167761687616976170761717617276173761747617576176761777617876179761807618176182761837618476185761867618776188761897619076191761927619376194761957619676197761987619976200762017620276203762047620576206762077620876209762107621176212762137621476215762167621776218762197622076221762227622376224762257622676227762287622976230762317623276233762347623576236762377623876239762407624176242762437624476245762467624776248762497625076251762527625376254762557625676257762587625976260762617626276263762647626576266762677626876269762707627176272762737627476275762767627776278762797628076281762827628376284762857628676287762887628976290762917629276293762947629576296762977629876299763007630176302763037630476305763067630776308763097631076311763127631376314763157631676317763187631976320763217632276323763247632576326763277632876329763307633176332763337633476335763367633776338763397634076341763427634376344763457634676347763487634976350763517635276353763547635576356763577635876359763607636176362763637636476365763667636776368763697637076371763727637376374763757637676377763787637976380763817638276383763847638576386763877638876389763907639176392763937639476395763967639776398763997640076401764027640376404764057640676407764087640976410764117641276413764147641576416764177641876419764207642176422764237642476425764267642776428764297643076431764327643376434764357643676437764387643976440764417644276443764447644576446764477644876449764507645176452764537645476455764567645776458764597646076461764627646376464764657646676467764687646976470764717647276473764747647576476764777647876479764807648176482764837648476485764867648776488764897649076491764927649376494764957649676497764987649976500765017650276503765047650576506765077650876509765107651176512765137651476515765167651776518765197652076521765227652376524765257652676527765287652976530765317653276533765347653576536765377653876539765407654176542765437654476545765467654776548765497655076551765527655376554765557655676557765587655976560765617656276563765647656576566765677656876569765707657176572765737657476575765767657776578765797658076581765827658376584765857658676587765887658976590765917659276593765947659576596765977659876599766007660176602766037660476605766067660776608766097661076611766127661376614766157661676617766187661976620766217662276623766247662576626766277662876629766307663176632766337663476635766367663776638766397664076641766427664376644766457664676647766487664976650766517665276653766547665576656766577665876659766607666176662766637666476665766667666776668766697667076671766727667376674766757667676677766787667976680766817668276683766847668576686766877668876689766907669176692766937669476695766967669776698766997670076701767027670376704767057670676707767087670976710767117671276713767147671576716767177671876719767207672176722767237672476725767267672776728767297673076731767327673376734767357673676737767387673976740767417674276743767447674576746767477674876749767507675176752767537675476755767567675776758767597676076761767627676376764767657676676767767687676976770767717677276773767747677576776767777677876779767807678176782767837678476785767867678776788767897679076791767927679376794767957679676797767987679976800768017680276803768047680576806768077680876809768107681176812768137681476815768167681776818768197682076821768227682376824768257682676827768287682976830768317683276833768347683576836768377683876839768407684176842768437684476845768467684776848768497685076851768527685376854768557685676857768587685976860768617686276863768647686576866768677686876869768707687176872768737687476875768767687776878768797688076881768827688376884768857688676887768887688976890768917689276893768947689576896768977689876899769007690176902769037690476905769067690776908769097691076911769127691376914769157691676917769187691976920769217692276923769247692576926769277692876929769307693176932769337693476935769367693776938769397694076941769427694376944769457694676947769487694976950769517695276953769547695576956769577695876959769607696176962769637696476965769667696776968769697697076971769727697376974769757697676977769787697976980769817698276983769847698576986769877698876989769907699176992769937699476995769967699776998769997700077001770027700377004770057700677007770087700977010770117701277013770147701577016770177701877019770207702177022770237702477025770267702777028770297703077031770327703377034770357703677037770387703977040770417704277043770447704577046770477704877049770507705177052770537705477055770567705777058770597706077061770627706377064770657706677067770687706977070770717707277073770747707577076770777707877079770807708177082770837708477085770867708777088770897709077091770927709377094770957709677097770987709977100771017710277103771047710577106771077710877109771107711177112771137711477115771167711777118771197712077121771227712377124771257712677127771287712977130771317713277133771347713577136771377713877139771407714177142771437714477145771467714777148771497715077151771527715377154771557715677157771587715977160771617716277163771647716577166771677716877169771707717177172771737717477175771767717777178771797718077181771827718377184771857718677187771887718977190771917719277193771947719577196771977719877199772007720177202772037720477205772067720777208772097721077211772127721377214772157721677217772187721977220772217722277223772247722577226772277722877229772307723177232772337723477235772367723777238772397724077241772427724377244772457724677247772487724977250772517725277253772547725577256772577725877259772607726177262772637726477265772667726777268772697727077271772727727377274772757727677277772787727977280772817728277283772847728577286772877728877289772907729177292772937729477295772967729777298772997730077301773027730377304773057730677307773087730977310773117731277313773147731577316773177731877319773207732177322773237732477325773267732777328773297733077331773327733377334773357733677337773387733977340773417734277343773447734577346773477734877349773507735177352773537735477355773567735777358773597736077361773627736377364773657736677367773687736977370773717737277373773747737577376773777737877379773807738177382773837738477385773867738777388773897739077391773927739377394773957739677397773987739977400774017740277403774047740577406774077740877409774107741177412774137741477415774167741777418774197742077421774227742377424774257742677427774287742977430774317743277433774347743577436774377743877439774407744177442774437744477445774467744777448774497745077451774527745377454774557745677457774587745977460774617746277463774647746577466774677746877469774707747177472774737747477475774767747777478774797748077481774827748377484774857748677487774887748977490774917749277493774947749577496774977749877499775007750177502775037750477505775067750777508775097751077511775127751377514775157751677517775187751977520775217752277523775247752577526775277752877529775307753177532775337753477535775367753777538775397754077541775427754377544775457754677547775487754977550775517755277553775547755577556775577755877559775607756177562775637756477565775667756777568775697757077571775727757377574775757757677577775787757977580775817758277583775847758577586775877758877589775907759177592775937759477595775967759777598775997760077601776027760377604776057760677607776087760977610776117761277613776147761577616776177761877619776207762177622776237762477625776267762777628776297763077631776327763377634776357763677637776387763977640776417764277643776447764577646776477764877649776507765177652776537765477655776567765777658776597766077661776627766377664776657766677667776687766977670776717767277673776747767577676776777767877679776807768177682776837768477685776867768777688776897769077691776927769377694776957769677697776987769977700777017770277703777047770577706777077770877709777107771177712777137771477715777167771777718777197772077721777227772377724777257772677727777287772977730777317773277733777347773577736777377773877739777407774177742777437774477745777467774777748777497775077751777527775377754777557775677757777587775977760777617776277763777647776577766777677776877769777707777177772777737777477775777767777777778777797778077781777827778377784777857778677787777887778977790777917779277793777947779577796777977779877799778007780177802778037780477805778067780777808778097781077811778127781377814778157781677817778187781977820778217782277823778247782577826778277782877829778307783177832778337783477835778367783777838778397784077841778427784377844778457784677847778487784977850778517785277853778547785577856778577785877859778607786177862778637786477865778667786777868778697787077871778727787377874778757787677877778787787977880778817788277883778847788577886778877788877889778907789177892778937789477895778967789777898778997790077901779027790377904779057790677907779087790977910779117791277913779147791577916779177791877919779207792177922779237792477925779267792777928779297793077931779327793377934779357793677937779387793977940779417794277943779447794577946779477794877949779507795177952779537795477955779567795777958779597796077961779627796377964779657796677967779687796977970779717797277973779747797577976779777797877979779807798177982779837798477985779867798777988779897799077991779927799377994779957799677997779987799978000780017800278003780047800578006780077800878009780107801178012780137801478015780167801778018780197802078021780227802378024780257802678027780287802978030780317803278033780347803578036780377803878039780407804178042780437804478045780467804778048780497805078051780527805378054780557805678057780587805978060780617806278063780647806578066780677806878069780707807178072780737807478075780767807778078780797808078081780827808378084780857808678087780887808978090780917809278093780947809578096780977809878099781007810178102781037810478105781067810778108781097811078111781127811378114781157811678117781187811978120781217812278123781247812578126781277812878129781307813178132781337813478135781367813778138781397814078141781427814378144781457814678147781487814978150781517815278153781547815578156781577815878159781607816178162781637816478165781667816778168781697817078171781727817378174781757817678177781787817978180781817818278183781847818578186781877818878189781907819178192781937819478195781967819778198781997820078201782027820378204782057820678207782087820978210782117821278213782147821578216782177821878219782207822178222782237822478225782267822778228782297823078231782327823378234782357823678237782387823978240782417824278243782447824578246782477824878249782507825178252782537825478255782567825778258782597826078261782627826378264782657826678267782687826978270782717827278273782747827578276782777827878279782807828178282782837828478285782867828778288782897829078291782927829378294782957829678297782987829978300783017830278303783047830578306783077830878309783107831178312783137831478315783167831778318783197832078321783227832378324783257832678327783287832978330783317833278333783347833578336783377833878339783407834178342783437834478345783467834778348783497835078351783527835378354783557835678357783587835978360783617836278363783647836578366783677836878369783707837178372783737837478375783767837778378783797838078381783827838378384783857838678387783887838978390783917839278393783947839578396783977839878399784007840178402784037840478405784067840778408784097841078411784127841378414784157841678417784187841978420784217842278423784247842578426784277842878429784307843178432784337843478435784367843778438784397844078441784427844378444784457844678447784487844978450784517845278453784547845578456784577845878459784607846178462784637846478465784667846778468784697847078471784727847378474784757847678477784787847978480784817848278483784847848578486784877848878489784907849178492784937849478495784967849778498784997850078501785027850378504785057850678507785087850978510785117851278513785147851578516785177851878519785207852178522785237852478525785267852778528785297853078531785327853378534785357853678537785387853978540785417854278543785447854578546785477854878549785507855178552785537855478555785567855778558785597856078561785627856378564785657856678567785687856978570785717857278573785747857578576785777857878579785807858178582785837858478585785867858778588785897859078591785927859378594785957859678597785987859978600786017860278603786047860578606786077860878609786107861178612786137861478615786167861778618786197862078621786227862378624786257862678627786287862978630786317863278633786347863578636786377863878639786407864178642786437864478645786467864778648786497865078651786527865378654786557865678657786587865978660786617866278663786647866578666786677866878669786707867178672786737867478675786767867778678786797868078681786827868378684786857868678687786887868978690786917869278693786947869578696786977869878699787007870178702787037870478705787067870778708787097871078711787127871378714787157871678717787187871978720787217872278723787247872578726787277872878729787307873178732787337873478735787367873778738787397874078741787427874378744787457874678747787487874978750787517875278753787547875578756787577875878759787607876178762787637876478765787667876778768787697877078771787727877378774787757877678777787787877978780787817878278783787847878578786787877878878789787907879178792787937879478795787967879778798787997880078801788027880378804788057880678807788087880978810788117881278813788147881578816788177881878819788207882178822788237882478825788267882778828788297883078831788327883378834788357883678837788387883978840788417884278843788447884578846788477884878849788507885178852788537885478855788567885778858788597886078861788627886378864788657886678867788687886978870788717887278873788747887578876788777887878879788807888178882788837888478885788867888778888788897889078891788927889378894788957889678897788987889978900789017890278903789047890578906789077890878909789107891178912789137891478915789167891778918789197892078921789227892378924789257892678927789287892978930789317893278933789347893578936789377893878939789407894178942789437894478945789467894778948789497895078951789527895378954789557895678957789587895978960789617896278963789647896578966789677896878969789707897178972789737897478975789767897778978789797898078981789827898378984789857898678987789887898978990789917899278993789947899578996789977899878999790007900179002790037900479005790067900779008790097901079011790127901379014790157901679017790187901979020790217902279023790247902579026790277902879029790307903179032790337903479035790367903779038790397904079041790427904379044790457904679047790487904979050790517905279053790547905579056790577905879059790607906179062790637906479065790667906779068790697907079071790727907379074790757907679077790787907979080790817908279083790847908579086790877908879089790907909179092790937909479095790967909779098790997910079101791027910379104791057910679107791087910979110791117911279113791147911579116791177911879119791207912179122791237912479125791267912779128791297913079131791327913379134791357913679137791387913979140791417914279143791447914579146791477914879149791507915179152791537915479155791567915779158791597916079161791627916379164791657916679167791687916979170791717917279173791747917579176791777917879179791807918179182791837918479185791867918779188791897919079191791927919379194791957919679197791987919979200792017920279203792047920579206792077920879209792107921179212792137921479215792167921779218792197922079221792227922379224792257922679227792287922979230792317923279233792347923579236792377923879239792407924179242792437924479245792467924779248792497925079251792527925379254792557925679257792587925979260792617926279263792647926579266792677926879269792707927179272792737927479275792767927779278792797928079281792827928379284792857928679287792887928979290792917929279293792947929579296792977929879299793007930179302793037930479305793067930779308793097931079311793127931379314793157931679317793187931979320793217932279323793247932579326793277932879329793307933179332793337933479335793367933779338793397934079341793427934379344793457934679347793487934979350793517935279353793547935579356793577935879359793607936179362793637936479365793667936779368793697937079371793727937379374793757937679377793787937979380793817938279383793847938579386793877938879389793907939179392793937939479395793967939779398793997940079401794027940379404794057940679407794087940979410794117941279413794147941579416794177941879419794207942179422794237942479425794267942779428794297943079431794327943379434794357943679437794387943979440794417944279443794447944579446794477944879449794507945179452794537945479455794567945779458794597946079461794627946379464794657946679467794687946979470794717947279473794747947579476794777947879479794807948179482794837948479485794867948779488794897949079491794927949379494794957949679497794987949979500795017950279503795047950579506795077950879509795107951179512795137951479515795167951779518795197952079521795227952379524795257952679527795287952979530795317953279533795347953579536795377953879539795407954179542795437954479545795467954779548795497955079551795527955379554795557955679557795587955979560795617956279563795647956579566795677956879569795707957179572795737957479575795767957779578795797958079581795827958379584795857958679587795887958979590795917959279593795947959579596795977959879599796007960179602796037960479605796067960779608796097961079611796127961379614796157961679617796187961979620796217962279623796247962579626796277962879629796307963179632796337963479635796367963779638796397964079641796427964379644796457964679647796487964979650796517965279653796547965579656796577965879659796607966179662796637966479665796667966779668796697967079671796727967379674796757967679677796787967979680796817968279683796847968579686796877968879689796907969179692796937969479695796967969779698796997970079701797027970379704797057970679707797087970979710797117971279713797147971579716797177971879719797207972179722797237972479725797267972779728797297973079731797327973379734797357973679737797387973979740797417974279743797447974579746797477974879749797507975179752797537975479755797567975779758797597976079761797627976379764797657976679767797687976979770797717977279773797747977579776797777977879779797807978179782797837978479785797867978779788797897979079791797927979379794797957979679797797987979979800798017980279803798047980579806798077980879809798107981179812798137981479815798167981779818798197982079821798227982379824798257982679827798287982979830798317983279833798347983579836798377983879839798407984179842798437984479845798467984779848798497985079851798527985379854798557985679857798587985979860798617986279863798647986579866798677986879869798707987179872798737987479875798767987779878798797988079881798827988379884798857988679887798887988979890798917989279893798947989579896798977989879899799007990179902799037990479905799067990779908799097991079911799127991379914799157991679917799187991979920799217992279923799247992579926799277992879929799307993179932799337993479935799367993779938799397994079941799427994379944799457994679947799487994979950799517995279953799547995579956799577995879959799607996179962799637996479965799667996779968799697997079971799727997379974799757997679977799787997979980799817998279983799847998579986799877998879989799907999179992799937999479995799967999779998799998000080001800028000380004800058000680007800088000980010800118001280013800148001580016800178001880019800208002180022800238002480025800268002780028800298003080031800328003380034800358003680037800388003980040800418004280043800448004580046800478004880049800508005180052800538005480055800568005780058800598006080061800628006380064800658006680067800688006980070800718007280073800748007580076800778007880079800808008180082800838008480085800868008780088800898009080091800928009380094800958009680097800988009980100801018010280103801048010580106801078010880109801108011180112801138011480115801168011780118801198012080121801228012380124801258012680127801288012980130801318013280133801348013580136801378013880139801408014180142801438014480145801468014780148801498015080151801528015380154801558015680157801588015980160801618016280163801648016580166801678016880169801708017180172801738017480175801768017780178801798018080181801828018380184801858018680187801888018980190801918019280193801948019580196801978019880199802008020180202802038020480205802068020780208802098021080211802128021380214802158021680217802188021980220802218022280223802248022580226802278022880229802308023180232802338023480235802368023780238802398024080241802428024380244802458024680247802488024980250802518025280253802548025580256802578025880259802608026180262802638026480265802668026780268802698027080271802728027380274802758027680277802788027980280802818028280283802848028580286802878028880289802908029180292802938029480295802968029780298802998030080301803028030380304803058030680307803088030980310803118031280313803148031580316803178031880319803208032180322803238032480325803268032780328803298033080331803328033380334803358033680337803388033980340803418034280343803448034580346803478034880349803508035180352803538035480355803568035780358803598036080361803628036380364803658036680367803688036980370803718037280373803748037580376803778037880379803808038180382803838038480385803868038780388803898039080391803928039380394803958039680397803988039980400804018040280403804048040580406804078040880409804108041180412804138041480415804168041780418804198042080421804228042380424804258042680427804288042980430804318043280433804348043580436804378043880439804408044180442804438044480445804468044780448804498045080451804528045380454804558045680457804588045980460804618046280463804648046580466804678046880469804708047180472804738047480475804768047780478804798048080481804828048380484804858048680487804888048980490804918049280493804948049580496804978049880499805008050180502805038050480505805068050780508805098051080511805128051380514805158051680517805188051980520805218052280523805248052580526805278052880529805308053180532805338053480535805368053780538805398054080541805428054380544805458054680547805488054980550805518055280553805548055580556805578055880559805608056180562805638056480565805668056780568805698057080571805728057380574805758057680577805788057980580805818058280583805848058580586805878058880589805908059180592805938059480595805968059780598805998060080601806028060380604806058060680607806088060980610806118061280613806148061580616806178061880619806208062180622806238062480625806268062780628806298063080631806328063380634806358063680637806388063980640806418064280643806448064580646806478064880649806508065180652806538065480655806568065780658806598066080661806628066380664806658066680667806688066980670806718067280673806748067580676806778067880679806808068180682806838068480685806868068780688806898069080691806928069380694806958069680697806988069980700807018070280703807048070580706807078070880709807108071180712807138071480715807168071780718807198072080721807228072380724807258072680727807288072980730807318073280733807348073580736807378073880739807408074180742807438074480745807468074780748807498075080751807528075380754807558075680757807588075980760807618076280763807648076580766807678076880769807708077180772807738077480775807768077780778807798078080781807828078380784807858078680787807888078980790807918079280793807948079580796807978079880799808008080180802808038080480805808068080780808808098081080811808128081380814808158081680817808188081980820808218082280823808248082580826808278082880829808308083180832808338083480835808368083780838808398084080841808428084380844808458084680847808488084980850808518085280853808548085580856808578085880859808608086180862808638086480865808668086780868808698087080871808728087380874808758087680877808788087980880808818088280883808848088580886808878088880889808908089180892808938089480895808968089780898808998090080901809028090380904809058090680907809088090980910809118091280913809148091580916809178091880919809208092180922809238092480925809268092780928809298093080931809328093380934809358093680937809388093980940809418094280943809448094580946809478094880949809508095180952809538095480955809568095780958809598096080961809628096380964809658096680967809688096980970809718097280973809748097580976809778097880979809808098180982809838098480985809868098780988809898099080991809928099380994809958099680997809988099981000810018100281003810048100581006810078100881009810108101181012810138101481015810168101781018810198102081021810228102381024810258102681027810288102981030810318103281033810348103581036810378103881039810408104181042810438104481045810468104781048810498105081051810528105381054810558105681057810588105981060810618106281063810648106581066810678106881069810708107181072810738107481075810768107781078810798108081081810828108381084810858108681087810888108981090810918109281093810948109581096810978109881099811008110181102811038110481105811068110781108811098111081111811128111381114811158111681117811188111981120811218112281123811248112581126811278112881129811308113181132811338113481135811368113781138811398114081141811428114381144811458114681147811488114981150811518115281153811548115581156811578115881159811608116181162811638116481165811668116781168811698117081171811728117381174811758117681177811788117981180811818118281183811848118581186811878118881189811908119181192811938119481195811968119781198811998120081201812028120381204812058120681207812088120981210812118121281213812148121581216812178121881219812208122181222812238122481225812268122781228812298123081231812328123381234812358123681237812388123981240812418124281243812448124581246812478124881249812508125181252812538125481255812568125781258812598126081261812628126381264812658126681267812688126981270812718127281273812748127581276812778127881279812808128181282812838128481285812868128781288812898129081291812928129381294812958129681297812988129981300813018130281303813048130581306813078130881309813108131181312813138131481315813168131781318813198132081321813228132381324813258132681327813288132981330813318133281333813348133581336813378133881339813408134181342813438134481345813468134781348813498135081351813528135381354813558135681357813588135981360813618136281363813648136581366813678136881369813708137181372813738137481375813768137781378813798138081381813828138381384813858138681387813888138981390813918139281393813948139581396813978139881399814008140181402814038140481405814068140781408814098141081411814128141381414814158141681417814188141981420814218142281423814248142581426814278142881429814308143181432814338143481435814368143781438814398144081441814428144381444814458144681447814488144981450814518145281453814548145581456814578145881459814608146181462814638146481465814668146781468814698147081471814728147381474814758147681477814788147981480814818148281483814848148581486814878148881489814908149181492814938149481495814968149781498814998150081501815028150381504815058150681507815088150981510815118151281513815148151581516815178151881519815208152181522815238152481525815268152781528815298153081531815328153381534815358153681537815388153981540815418154281543815448154581546815478154881549815508155181552815538155481555815568155781558815598156081561815628156381564815658156681567815688156981570815718157281573815748157581576815778157881579815808158181582815838158481585815868158781588815898159081591815928159381594815958159681597815988159981600816018160281603816048160581606816078160881609816108161181612816138161481615816168161781618816198162081621816228162381624816258162681627816288162981630816318163281633816348163581636816378163881639816408164181642816438164481645816468164781648816498165081651816528165381654816558165681657816588165981660816618166281663816648166581666816678166881669816708167181672816738167481675816768167781678816798168081681816828168381684816858168681687816888168981690816918169281693816948169581696816978169881699817008170181702817038170481705817068170781708817098171081711817128171381714817158171681717817188171981720817218172281723817248172581726817278172881729817308173181732817338173481735817368173781738817398174081741817428174381744817458174681747817488174981750817518175281753817548175581756817578175881759817608176181762817638176481765817668176781768817698177081771817728177381774817758177681777817788177981780817818178281783817848178581786817878178881789817908179181792817938179481795817968179781798817998180081801818028180381804818058180681807818088180981810818118181281813818148181581816818178181881819818208182181822818238182481825818268182781828818298183081831818328183381834818358183681837818388183981840818418184281843818448184581846818478184881849818508185181852818538185481855818568185781858818598186081861818628186381864818658186681867818688186981870818718187281873818748187581876818778187881879818808188181882818838188481885818868188781888818898189081891818928189381894818958189681897818988189981900819018190281903819048190581906819078190881909819108191181912819138191481915819168191781918819198192081921819228192381924819258192681927819288192981930819318193281933819348193581936819378193881939819408194181942819438194481945819468194781948819498195081951819528195381954819558195681957819588195981960819618196281963819648196581966819678196881969819708197181972819738197481975819768197781978819798198081981819828198381984819858198681987819888198981990819918199281993819948199581996819978199881999820008200182002820038200482005820068200782008820098201082011820128201382014820158201682017820188201982020820218202282023820248202582026820278202882029820308203182032820338203482035820368203782038820398204082041820428204382044820458204682047820488204982050820518205282053820548205582056820578205882059820608206182062820638206482065820668206782068820698207082071820728207382074820758207682077820788207982080820818208282083820848208582086820878208882089820908209182092820938209482095820968209782098820998210082101821028210382104821058210682107821088210982110821118211282113821148211582116821178211882119821208212182122821238212482125821268212782128821298213082131821328213382134821358213682137821388213982140821418214282143821448214582146821478214882149821508215182152821538215482155821568215782158821598216082161821628216382164821658216682167821688216982170821718217282173821748217582176821778217882179821808218182182821838218482185821868218782188821898219082191821928219382194821958219682197821988219982200822018220282203822048220582206822078220882209822108221182212822138221482215822168221782218822198222082221822228222382224822258222682227822288222982230822318223282233822348223582236822378223882239822408224182242822438224482245822468224782248822498225082251822528225382254822558225682257822588225982260822618226282263822648226582266822678226882269822708227182272822738227482275822768227782278822798228082281822828228382284822858228682287822888228982290822918229282293822948229582296822978229882299823008230182302823038230482305823068230782308823098231082311823128231382314823158231682317823188231982320823218232282323823248232582326823278232882329823308233182332823338233482335823368233782338823398234082341823428234382344823458234682347823488234982350823518235282353823548235582356823578235882359823608236182362823638236482365823668236782368823698237082371823728237382374823758237682377823788237982380823818238282383823848238582386823878238882389823908239182392823938239482395823968239782398823998240082401824028240382404824058240682407824088240982410824118241282413824148241582416824178241882419824208242182422824238242482425824268242782428824298243082431824328243382434824358243682437824388243982440824418244282443824448244582446824478244882449824508245182452824538245482455824568245782458824598246082461824628246382464824658246682467824688246982470824718247282473824748247582476824778247882479824808248182482824838248482485824868248782488824898249082491824928249382494824958249682497824988249982500825018250282503825048250582506825078250882509825108251182512825138251482515825168251782518825198252082521825228252382524825258252682527825288252982530825318253282533825348253582536825378253882539825408254182542825438254482545825468254782548825498255082551825528255382554825558255682557825588255982560825618256282563825648256582566825678256882569825708257182572825738257482575825768257782578825798258082581825828258382584825858258682587825888258982590825918259282593825948259582596825978259882599826008260182602826038260482605826068260782608826098261082611826128261382614826158261682617826188261982620826218262282623826248262582626826278262882629826308263182632826338263482635826368263782638826398264082641826428264382644826458264682647826488264982650826518265282653826548265582656826578265882659826608266182662826638266482665826668266782668826698267082671826728267382674826758267682677826788267982680826818268282683826848268582686826878268882689826908269182692826938269482695826968269782698826998270082701827028270382704827058270682707827088270982710827118271282713827148271582716827178271882719827208272182722827238272482725827268272782728827298273082731827328273382734827358273682737827388273982740827418274282743827448274582746827478274882749827508275182752827538275482755827568275782758827598276082761827628276382764827658276682767827688276982770827718277282773827748277582776827778277882779827808278182782827838278482785827868278782788827898279082791827928279382794827958279682797827988279982800828018280282803828048280582806828078280882809828108281182812828138281482815828168281782818828198282082821828228282382824828258282682827828288282982830828318283282833828348283582836828378283882839828408284182842828438284482845828468284782848828498285082851828528285382854828558285682857828588285982860828618286282863828648286582866828678286882869828708287182872828738287482875828768287782878828798288082881828828288382884828858288682887828888288982890828918289282893828948289582896828978289882899829008290182902829038290482905829068290782908829098291082911829128291382914829158291682917829188291982920829218292282923829248292582926829278292882929829308293182932829338293482935829368293782938829398294082941829428294382944829458294682947829488294982950829518295282953829548295582956829578295882959829608296182962829638296482965829668296782968829698297082971829728297382974829758297682977829788297982980829818298282983829848298582986829878298882989829908299182992829938299482995829968299782998829998300083001830028300383004830058300683007830088300983010830118301283013830148301583016830178301883019830208302183022830238302483025830268302783028830298303083031830328303383034830358303683037830388303983040830418304283043830448304583046830478304883049830508305183052830538305483055830568305783058830598306083061830628306383064830658306683067830688306983070830718307283073830748307583076830778307883079830808308183082830838308483085830868308783088830898309083091830928309383094830958309683097830988309983100831018310283103831048310583106831078310883109831108311183112831138311483115831168311783118831198312083121831228312383124831258312683127831288312983130831318313283133831348313583136831378313883139831408314183142831438314483145831468314783148831498315083151831528315383154831558315683157831588315983160831618316283163831648316583166831678316883169831708317183172831738317483175831768317783178831798318083181831828318383184831858318683187831888318983190831918319283193831948319583196831978319883199832008320183202832038320483205832068320783208832098321083211832128321383214832158321683217832188321983220832218322283223832248322583226832278322883229832308323183232832338323483235832368323783238832398324083241832428324383244832458324683247832488324983250832518325283253832548325583256832578325883259832608326183262832638326483265832668326783268832698327083271832728327383274832758327683277832788327983280832818328283283832848328583286832878328883289832908329183292832938329483295832968329783298832998330083301833028330383304833058330683307833088330983310833118331283313833148331583316833178331883319833208332183322833238332483325833268332783328833298333083331833328333383334833358333683337833388333983340833418334283343833448334583346833478334883349833508335183352833538335483355833568335783358833598336083361833628336383364833658336683367833688336983370833718337283373833748337583376833778337883379833808338183382833838338483385833868338783388833898339083391833928339383394833958339683397833988339983400834018340283403834048340583406834078340883409834108341183412834138341483415834168341783418834198342083421834228342383424834258342683427834288342983430834318343283433834348343583436834378343883439834408344183442834438344483445834468344783448834498345083451834528345383454834558345683457834588345983460834618346283463834648346583466834678346883469834708347183472834738347483475834768347783478834798348083481834828348383484834858348683487834888348983490834918349283493834948349583496834978349883499835008350183502835038350483505835068350783508835098351083511835128351383514835158351683517835188351983520835218352283523835248352583526835278352883529835308353183532835338353483535835368353783538835398354083541835428354383544835458354683547835488354983550835518355283553835548355583556835578355883559835608356183562835638356483565835668356783568835698357083571835728357383574835758357683577835788357983580835818358283583835848358583586835878358883589835908359183592835938359483595835968359783598835998360083601836028360383604836058360683607836088360983610836118361283613836148361583616836178361883619836208362183622836238362483625836268362783628836298363083631836328363383634836358363683637836388363983640836418364283643836448364583646836478364883649836508365183652836538365483655836568365783658836598366083661836628366383664836658366683667836688366983670836718367283673836748367583676836778367883679836808368183682836838368483685836868368783688836898369083691836928369383694836958369683697836988369983700837018370283703837048370583706837078370883709837108371183712837138371483715837168371783718837198372083721837228372383724837258372683727837288372983730837318373283733837348373583736837378373883739837408374183742837438374483745837468374783748837498375083751837528375383754837558375683757837588375983760837618376283763837648376583766837678376883769837708377183772837738377483775837768377783778837798378083781837828378383784837858378683787837888378983790837918379283793837948379583796837978379883799838008380183802838038380483805838068380783808838098381083811838128381383814838158381683817838188381983820838218382283823838248382583826838278382883829838308383183832838338383483835838368383783838838398384083841838428384383844838458384683847838488384983850838518385283853838548385583856838578385883859838608386183862838638386483865838668386783868838698387083871838728387383874838758387683877838788387983880838818388283883838848388583886838878388883889838908389183892838938389483895838968389783898838998390083901839028390383904839058390683907839088390983910839118391283913839148391583916839178391883919839208392183922839238392483925839268392783928839298393083931839328393383934839358393683937839388393983940839418394283943839448394583946839478394883949839508395183952839538395483955839568395783958839598396083961839628396383964839658396683967839688396983970839718397283973839748397583976839778397883979839808398183982839838398483985839868398783988839898399083991839928399383994839958399683997839988399984000840018400284003840048400584006840078400884009840108401184012840138401484015840168401784018840198402084021840228402384024840258402684027840288402984030840318403284033840348403584036840378403884039840408404184042840438404484045840468404784048840498405084051840528405384054840558405684057840588405984060840618406284063840648406584066840678406884069840708407184072840738407484075840768407784078840798408084081840828408384084840858408684087840888408984090840918409284093840948409584096840978409884099841008410184102841038410484105841068410784108841098411084111841128411384114841158411684117841188411984120841218412284123841248412584126841278412884129841308413184132841338413484135841368413784138841398414084141841428414384144841458414684147841488414984150841518415284153841548415584156841578415884159841608416184162841638416484165841668416784168841698417084171841728417384174841758417684177841788417984180841818418284183841848418584186841878418884189841908419184192841938419484195841968419784198841998420084201842028420384204842058420684207842088420984210842118421284213842148421584216842178421884219842208422184222842238422484225842268422784228842298423084231842328423384234842358423684237842388423984240842418424284243842448424584246842478424884249842508425184252842538425484255842568425784258842598426084261842628426384264842658426684267842688426984270842718427284273842748427584276842778427884279842808428184282842838428484285842868428784288842898429084291842928429384294842958429684297842988429984300843018430284303843048430584306843078430884309843108431184312843138431484315843168431784318843198432084321843228432384324843258432684327843288432984330843318433284333843348433584336843378433884339843408434184342843438434484345843468434784348843498435084351843528435384354843558435684357843588435984360843618436284363843648436584366843678436884369843708437184372843738437484375843768437784378843798438084381843828438384384843858438684387843888438984390843918439284393843948439584396843978439884399844008440184402844038440484405844068440784408844098441084411844128441384414844158441684417844188441984420844218442284423844248442584426844278442884429844308443184432844338443484435844368443784438844398444084441844428444384444844458444684447844488444984450844518445284453844548445584456844578445884459844608446184462844638446484465844668446784468844698447084471844728447384474844758447684477844788447984480844818448284483844848448584486844878448884489844908449184492844938449484495844968449784498844998450084501845028450384504845058450684507845088450984510845118451284513845148451584516845178451884519845208452184522845238452484525845268452784528845298453084531845328453384534845358453684537845388453984540845418454284543845448454584546845478454884549845508455184552845538455484555845568455784558845598456084561845628456384564845658456684567845688456984570845718457284573845748457584576845778457884579845808458184582845838458484585845868458784588845898459084591845928459384594845958459684597845988459984600846018460284603846048460584606846078460884609846108461184612846138461484615846168461784618846198462084621846228462384624846258462684627846288462984630846318463284633846348463584636846378463884639846408464184642846438464484645846468464784648846498465084651846528465384654846558465684657846588465984660846618466284663846648466584666846678466884669846708467184672846738467484675846768467784678846798468084681846828468384684846858468684687846888468984690846918469284693846948469584696846978469884699847008470184702847038470484705847068470784708847098471084711847128471384714847158471684717847188471984720847218472284723847248472584726847278472884729847308473184732847338473484735847368473784738847398474084741847428474384744847458474684747847488474984750847518475284753847548475584756847578475884759847608476184762847638476484765847668476784768847698477084771847728477384774847758477684777847788477984780847818478284783847848478584786847878478884789847908479184792847938479484795847968479784798847998480084801848028480384804848058480684807848088480984810848118481284813848148481584816848178481884819848208482184822848238482484825848268482784828848298483084831848328483384834848358483684837848388483984840848418484284843848448484584846848478484884849848508485184852848538485484855848568485784858848598486084861848628486384864848658486684867848688486984870848718487284873848748487584876848778487884879848808488184882848838488484885848868488784888848898489084891848928489384894848958489684897848988489984900849018490284903849048490584906849078490884909849108491184912849138491484915849168491784918849198492084921849228492384924849258492684927849288492984930849318493284933849348493584936849378493884939849408494184942849438494484945849468494784948849498495084951849528495384954849558495684957849588495984960849618496284963849648496584966849678496884969849708497184972849738497484975849768497784978849798498084981849828498384984849858498684987849888498984990849918499284993849948499584996849978499884999850008500185002850038500485005850068500785008850098501085011850128501385014850158501685017850188501985020850218502285023850248502585026850278502885029850308503185032850338503485035850368503785038850398504085041850428504385044850458504685047850488504985050850518505285053850548505585056850578505885059850608506185062850638506485065850668506785068850698507085071850728507385074850758507685077850788507985080850818508285083850848508585086850878508885089850908509185092850938509485095850968509785098850998510085101851028510385104851058510685107851088510985110851118511285113851148511585116851178511885119851208512185122851238512485125851268512785128851298513085131851328513385134851358513685137851388513985140851418514285143851448514585146851478514885149851508515185152851538515485155851568515785158851598516085161851628516385164851658516685167851688516985170851718517285173851748517585176851778517885179851808518185182851838518485185851868518785188851898519085191851928519385194851958519685197851988519985200852018520285203852048520585206852078520885209852108521185212852138521485215852168521785218852198522085221852228522385224852258522685227852288522985230852318523285233852348523585236852378523885239852408524185242852438524485245852468524785248852498525085251852528525385254852558525685257852588525985260852618526285263852648526585266852678526885269852708527185272852738527485275852768527785278852798528085281852828528385284852858528685287852888528985290852918529285293852948529585296852978529885299853008530185302853038530485305853068530785308853098531085311853128531385314853158531685317853188531985320853218532285323853248532585326853278532885329853308533185332853338533485335853368533785338853398534085341853428534385344853458534685347853488534985350853518535285353853548535585356853578535885359853608536185362853638536485365853668536785368853698537085371853728537385374853758537685377853788537985380853818538285383853848538585386853878538885389853908539185392853938539485395853968539785398853998540085401854028540385404854058540685407854088540985410854118541285413854148541585416854178541885419854208542185422854238542485425854268542785428854298543085431854328543385434854358543685437854388543985440854418544285443854448544585446854478544885449854508545185452854538545485455854568545785458854598546085461854628546385464854658546685467854688546985470854718547285473854748547585476854778547885479854808548185482854838548485485854868548785488854898549085491854928549385494854958549685497854988549985500855018550285503855048550585506855078550885509855108551185512855138551485515855168551785518855198552085521855228552385524855258552685527855288552985530855318553285533855348553585536855378553885539855408554185542855438554485545855468554785548855498555085551855528555385554855558555685557855588555985560855618556285563855648556585566855678556885569855708557185572855738557485575855768557785578855798558085581855828558385584855858558685587855888558985590855918559285593855948559585596855978559885599856008560185602856038560485605856068560785608856098561085611856128561385614856158561685617856188561985620856218562285623856248562585626856278562885629856308563185632856338563485635856368563785638856398564085641856428564385644856458564685647856488564985650856518565285653856548565585656856578565885659856608566185662856638566485665856668566785668856698567085671856728567385674856758567685677856788567985680856818568285683856848568585686856878568885689856908569185692856938569485695856968569785698856998570085701857028570385704857058570685707857088570985710857118571285713857148571585716857178571885719857208572185722857238572485725857268572785728857298573085731857328573385734857358573685737857388573985740857418574285743857448574585746857478574885749857508575185752857538575485755857568575785758857598576085761857628576385764857658576685767857688576985770857718577285773857748577585776857778577885779857808578185782857838578485785857868578785788857898579085791857928579385794857958579685797857988579985800858018580285803858048580585806858078580885809858108581185812858138581485815858168581785818858198582085821858228582385824858258582685827858288582985830858318583285833858348583585836858378583885839858408584185842858438584485845858468584785848858498585085851858528585385854858558585685857858588585985860858618586285863858648586585866858678586885869858708587185872858738587485875858768587785878858798588085881858828588385884858858588685887858888588985890858918589285893858948589585896858978589885899859008590185902859038590485905859068590785908859098591085911859128591385914859158591685917859188591985920859218592285923859248592585926859278592885929859308593185932859338593485935859368593785938859398594085941859428594385944859458594685947859488594985950859518595285953859548595585956859578595885959859608596185962859638596485965859668596785968859698597085971859728597385974859758597685977859788597985980859818598285983859848598585986859878598885989859908599185992859938599485995859968599785998859998600086001860028600386004860058600686007860088600986010860118601286013860148601586016860178601886019860208602186022860238602486025860268602786028860298603086031860328603386034860358603686037860388603986040860418604286043860448604586046860478604886049860508605186052860538605486055860568605786058860598606086061860628606386064860658606686067860688606986070860718607286073860748607586076860778607886079860808608186082860838608486085860868608786088860898609086091860928609386094860958609686097860988609986100861018610286103861048610586106861078610886109861108611186112861138611486115861168611786118861198612086121861228612386124861258612686127861288612986130861318613286133861348613586136861378613886139861408614186142861438614486145861468614786148861498615086151861528615386154861558615686157861588615986160861618616286163861648616586166861678616886169861708617186172861738617486175861768617786178861798618086181861828618386184861858618686187861888618986190861918619286193861948619586196861978619886199862008620186202862038620486205862068620786208862098621086211862128621386214862158621686217862188621986220862218622286223862248622586226862278622886229862308623186232862338623486235862368623786238862398624086241862428624386244862458624686247862488624986250862518625286253862548625586256862578625886259862608626186262862638626486265862668626786268862698627086271862728627386274862758627686277862788627986280862818628286283862848628586286862878628886289862908629186292862938629486295862968629786298862998630086301863028630386304863058630686307863088630986310863118631286313863148631586316863178631886319863208632186322863238632486325863268632786328863298633086331863328633386334863358633686337863388633986340863418634286343863448634586346863478634886349863508635186352863538635486355863568635786358863598636086361863628636386364863658636686367863688636986370863718637286373863748637586376863778637886379863808638186382863838638486385863868638786388863898639086391863928639386394863958639686397863988639986400864018640286403864048640586406864078640886409864108641186412864138641486415864168641786418864198642086421864228642386424864258642686427864288642986430864318643286433864348643586436864378643886439864408644186442864438644486445864468644786448864498645086451864528645386454864558645686457864588645986460864618646286463864648646586466864678646886469864708647186472864738647486475864768647786478864798648086481864828648386484864858648686487864888648986490864918649286493864948649586496864978649886499865008650186502865038650486505865068650786508865098651086511865128651386514865158651686517865188651986520865218652286523865248652586526865278652886529865308653186532865338653486535865368653786538865398654086541865428654386544865458654686547865488654986550865518655286553865548655586556865578655886559865608656186562865638656486565865668656786568865698657086571865728657386574865758657686577865788657986580865818658286583865848658586586865878658886589865908659186592865938659486595865968659786598865998660086601866028660386604866058660686607866088660986610866118661286613866148661586616866178661886619866208662186622866238662486625866268662786628866298663086631866328663386634866358663686637866388663986640866418664286643866448664586646866478664886649866508665186652866538665486655866568665786658866598666086661866628666386664866658666686667866688666986670866718667286673866748667586676866778667886679866808668186682866838668486685866868668786688866898669086691866928669386694866958669686697866988669986700867018670286703867048670586706867078670886709867108671186712867138671486715867168671786718867198672086721867228672386724867258672686727867288672986730867318673286733867348673586736867378673886739867408674186742867438674486745867468674786748867498675086751867528675386754867558675686757867588675986760867618676286763867648676586766867678676886769867708677186772867738677486775867768677786778867798678086781867828678386784867858678686787867888678986790867918679286793867948679586796867978679886799868008680186802868038680486805868068680786808868098681086811868128681386814868158681686817868188681986820868218682286823868248682586826868278682886829868308683186832868338683486835868368683786838868398684086841868428684386844868458684686847868488684986850868518685286853868548685586856868578685886859868608686186862868638686486865868668686786868868698687086871868728687386874868758687686877868788687986880868818688286883868848688586886868878688886889868908689186892868938689486895868968689786898868998690086901869028690386904869058690686907869088690986910869118691286913869148691586916869178691886919869208692186922869238692486925869268692786928869298693086931869328693386934869358693686937869388693986940869418694286943869448694586946869478694886949869508695186952869538695486955869568695786958869598696086961869628696386964869658696686967869688696986970869718697286973869748697586976869778697886979869808698186982869838698486985869868698786988869898699086991869928699386994869958699686997869988699987000870018700287003870048700587006870078700887009870108701187012870138701487015870168701787018870198702087021870228702387024870258702687027870288702987030870318703287033870348703587036870378703887039870408704187042870438704487045870468704787048870498705087051870528705387054870558705687057870588705987060870618706287063870648706587066870678706887069870708707187072870738707487075870768707787078870798708087081870828708387084870858708687087870888708987090870918709287093870948709587096870978709887099871008710187102871038710487105871068710787108871098711087111871128711387114871158711687117871188711987120871218712287123871248712587126871278712887129871308713187132871338713487135871368713787138871398714087141871428714387144871458714687147871488714987150871518715287153871548715587156871578715887159871608716187162871638716487165871668716787168871698717087171871728717387174871758717687177871788717987180871818718287183871848718587186871878718887189871908719187192871938719487195871968719787198871998720087201872028720387204872058720687207872088720987210872118721287213872148721587216872178721887219872208722187222872238722487225872268722787228872298723087231872328723387234872358723687237872388723987240872418724287243872448724587246872478724887249872508725187252872538725487255872568725787258872598726087261872628726387264872658726687267872688726987270872718727287273872748727587276872778727887279872808728187282872838728487285872868728787288872898729087291872928729387294872958729687297872988729987300873018730287303873048730587306873078730887309873108731187312873138731487315873168731787318873198732087321873228732387324873258732687327873288732987330873318733287333873348733587336873378733887339873408734187342873438734487345873468734787348873498735087351873528735387354873558735687357873588735987360873618736287363873648736587366873678736887369873708737187372873738737487375873768737787378873798738087381873828738387384873858738687387873888738987390873918739287393873948739587396873978739887399874008740187402874038740487405874068740787408874098741087411874128741387414874158741687417874188741987420874218742287423874248742587426874278742887429874308743187432874338743487435874368743787438874398744087441874428744387444874458744687447874488744987450874518745287453874548745587456874578745887459874608746187462874638746487465874668746787468874698747087471874728747387474874758747687477874788747987480874818748287483874848748587486874878748887489874908749187492874938749487495874968749787498874998750087501875028750387504875058750687507875088750987510875118751287513875148751587516875178751887519875208752187522875238752487525875268752787528875298753087531875328753387534875358753687537875388753987540875418754287543875448754587546875478754887549875508755187552875538755487555875568755787558875598756087561875628756387564875658756687567875688756987570875718757287573875748757587576875778757887579875808758187582875838758487585875868758787588875898759087591875928759387594875958759687597875988759987600876018760287603876048760587606876078760887609876108761187612876138761487615876168761787618876198762087621876228762387624876258762687627876288762987630876318763287633876348763587636876378763887639876408764187642876438764487645876468764787648876498765087651876528765387654876558765687657876588765987660876618766287663876648766587666876678766887669876708767187672876738767487675876768767787678876798768087681876828768387684876858768687687876888768987690876918769287693876948769587696876978769887699877008770187702877038770487705877068770787708877098771087711877128771387714877158771687717877188771987720877218772287723877248772587726877278772887729877308773187732877338773487735877368773787738877398774087741877428774387744877458774687747877488774987750877518775287753877548775587756877578775887759877608776187762877638776487765877668776787768877698777087771877728777387774877758777687777877788777987780877818778287783877848778587786877878778887789877908779187792877938779487795877968779787798877998780087801878028780387804878058780687807878088780987810878118781287813878148781587816878178781887819878208782187822878238782487825878268782787828878298783087831878328783387834878358783687837878388783987840878418784287843878448784587846878478784887849878508785187852878538785487855878568785787858878598786087861878628786387864878658786687867878688786987870878718787287873878748787587876878778787887879878808788187882878838788487885878868788787888878898789087891878928789387894878958789687897878988789987900879018790287903879048790587906879078790887909879108791187912879138791487915879168791787918879198792087921879228792387924879258792687927879288792987930879318793287933879348793587936879378793887939879408794187942879438794487945879468794787948879498795087951879528795387954879558795687957879588795987960879618796287963879648796587966879678796887969879708797187972879738797487975879768797787978879798798087981879828798387984879858798687987879888798987990879918799287993879948799587996879978799887999880008800188002880038800488005880068800788008880098801088011880128801388014880158801688017880188801988020880218802288023880248802588026880278802888029880308803188032880338803488035880368803788038880398804088041880428804388044880458804688047880488804988050880518805288053880548805588056880578805888059880608806188062880638806488065880668806788068880698807088071880728807388074880758807688077880788807988080880818808288083880848808588086880878808888089880908809188092880938809488095880968809788098880998810088101881028810388104881058810688107881088810988110881118811288113881148811588116881178811888119881208812188122881238812488125881268812788128881298813088131881328813388134881358813688137881388813988140881418814288143881448814588146881478814888149881508815188152881538815488155881568815788158881598816088161881628816388164881658816688167881688816988170881718817288173881748817588176881778817888179881808818188182881838818488185881868818788188881898819088191881928819388194881958819688197881988819988200882018820288203882048820588206882078820888209882108821188212882138821488215882168821788218882198822088221882228822388224882258822688227882288822988230882318823288233882348823588236882378823888239882408824188242882438824488245882468824788248882498825088251882528825388254882558825688257882588825988260882618826288263882648826588266882678826888269882708827188272882738827488275882768827788278882798828088281882828828388284882858828688287882888828988290882918829288293882948829588296882978829888299883008830188302883038830488305883068830788308883098831088311883128831388314883158831688317883188831988320883218832288323883248832588326883278832888329883308833188332883338833488335883368833788338883398834088341883428834388344883458834688347883488834988350883518835288353883548835588356883578835888359883608836188362883638836488365883668836788368883698837088371883728837388374883758837688377883788837988380883818838288383883848838588386883878838888389883908839188392883938839488395883968839788398883998840088401884028840388404884058840688407884088840988410884118841288413884148841588416884178841888419884208842188422884238842488425884268842788428884298843088431884328843388434884358843688437884388843988440884418844288443884448844588446884478844888449884508845188452884538845488455884568845788458884598846088461884628846388464884658846688467884688846988470884718847288473884748847588476884778847888479884808848188482884838848488485884868848788488884898849088491884928849388494884958849688497884988849988500885018850288503885048850588506885078850888509885108851188512885138851488515885168851788518885198852088521885228852388524885258852688527885288852988530885318853288533885348853588536885378853888539885408854188542885438854488545885468854788548885498855088551885528855388554885558855688557885588855988560885618856288563885648856588566885678856888569885708857188572885738857488575885768857788578885798858088581885828858388584885858858688587885888858988590885918859288593885948859588596885978859888599886008860188602886038860488605886068860788608886098861088611886128861388614886158861688617886188861988620886218862288623886248862588626886278862888629886308863188632886338863488635886368863788638886398864088641886428864388644886458864688647886488864988650886518865288653886548865588656886578865888659886608866188662886638866488665886668866788668886698867088671886728867388674886758867688677886788867988680886818868288683886848868588686886878868888689886908869188692886938869488695886968869788698886998870088701887028870388704887058870688707887088870988710887118871288713887148871588716887178871888719887208872188722887238872488725887268872788728887298873088731887328873388734887358873688737887388873988740887418874288743887448874588746887478874888749887508875188752887538875488755887568875788758887598876088761887628876388764887658876688767887688876988770887718877288773887748877588776887778877888779887808878188782887838878488785887868878788788887898879088791887928879388794887958879688797887988879988800888018880288803888048880588806888078880888809888108881188812888138881488815888168881788818888198882088821888228882388824888258882688827888288882988830888318883288833888348883588836888378883888839888408884188842888438884488845888468884788848888498885088851888528885388854888558885688857888588885988860888618886288863888648886588866888678886888869888708887188872888738887488875888768887788878888798888088881888828888388884888858888688887888888888988890888918889288893888948889588896888978889888899889008890188902889038890488905889068890788908889098891088911889128891388914889158891688917889188891988920889218892288923889248892588926889278892888929889308893188932889338893488935889368893788938889398894088941889428894388944889458894688947889488894988950889518895288953889548895588956889578895888959889608896188962889638896488965889668896788968889698897088971889728897388974889758897688977889788897988980889818898288983889848898588986889878898888989889908899188992889938899488995889968899788998889998900089001890028900389004890058900689007890088900989010890118901289013890148901589016890178901889019890208902189022890238902489025890268902789028890298903089031890328903389034890358903689037890388903989040890418904289043890448904589046890478904889049890508905189052890538905489055890568905789058890598906089061890628906389064890658906689067890688906989070890718907289073890748907589076890778907889079890808908189082890838908489085890868908789088890898909089091890928909389094890958909689097890988909989100891018910289103891048910589106891078910889109891108911189112891138911489115891168911789118891198912089121891228912389124891258912689127891288912989130891318913289133891348913589136891378913889139891408914189142891438914489145891468914789148891498915089151891528915389154891558915689157891588915989160891618916289163891648916589166891678916889169891708917189172891738917489175891768917789178891798918089181891828918389184891858918689187891888918989190891918919289193891948919589196891978919889199892008920189202892038920489205892068920789208892098921089211892128921389214892158921689217892188921989220892218922289223892248922589226892278922889229892308923189232892338923489235892368923789238892398924089241892428924389244892458924689247892488924989250892518925289253892548925589256892578925889259892608926189262892638926489265892668926789268892698927089271892728927389274892758927689277892788927989280892818928289283892848928589286892878928889289892908929189292892938929489295892968929789298892998930089301893028930389304893058930689307893088930989310893118931289313893148931589316893178931889319893208932189322893238932489325893268932789328893298933089331893328933389334893358933689337893388933989340893418934289343893448934589346893478934889349893508935189352893538935489355893568935789358893598936089361893628936389364893658936689367893688936989370893718937289373893748937589376893778937889379893808938189382893838938489385893868938789388893898939089391893928939389394893958939689397893988939989400894018940289403894048940589406894078940889409894108941189412894138941489415894168941789418894198942089421894228942389424894258942689427894288942989430894318943289433894348943589436894378943889439894408944189442894438944489445894468944789448894498945089451894528945389454894558945689457894588945989460894618946289463894648946589466894678946889469894708947189472894738947489475894768947789478894798948089481894828948389484894858948689487894888948989490894918949289493894948949589496894978949889499895008950189502895038950489505895068950789508895098951089511895128951389514895158951689517895188951989520895218952289523895248952589526895278952889529895308953189532895338953489535895368953789538895398954089541895428954389544895458954689547895488954989550895518955289553895548955589556895578955889559895608956189562895638956489565895668956789568895698957089571895728957389574895758957689577895788957989580895818958289583895848958589586895878958889589895908959189592895938959489595895968959789598895998960089601896028960389604896058960689607896088960989610896118961289613896148961589616896178961889619896208962189622896238962489625896268962789628896298963089631896328963389634896358963689637896388963989640896418964289643896448964589646896478964889649896508965189652896538965489655896568965789658896598966089661896628966389664896658966689667896688966989670896718967289673896748967589676896778967889679896808968189682896838968489685896868968789688896898969089691896928969389694896958969689697896988969989700897018970289703897048970589706897078970889709897108971189712897138971489715897168971789718897198972089721897228972389724897258972689727897288972989730897318973289733897348973589736897378973889739897408974189742897438974489745897468974789748897498975089751897528975389754897558975689757897588975989760897618976289763897648976589766897678976889769897708977189772897738977489775897768977789778897798978089781897828978389784897858978689787897888978989790897918979289793897948979589796897978979889799898008980189802898038980489805898068980789808898098981089811898128981389814898158981689817898188981989820898218982289823898248982589826898278982889829898308983189832898338983489835898368983789838898398984089841898428984389844898458984689847898488984989850898518985289853898548985589856898578985889859898608986189862898638986489865898668986789868898698987089871898728987389874898758987689877898788987989880898818988289883898848988589886898878988889889898908989189892898938989489895898968989789898898998990089901899028990389904899058990689907899088990989910899118991289913899148991589916899178991889919899208992189922899238992489925899268992789928899298993089931899328993389934899358993689937899388993989940899418994289943899448994589946899478994889949899508995189952899538995489955899568995789958899598996089961899628996389964899658996689967899688996989970899718997289973899748997589976899778997889979899808998189982899838998489985899868998789988899898999089991899928999389994899958999689997899988999990000900019000290003900049000590006900079000890009900109001190012900139001490015900169001790018900199002090021900229002390024900259002690027900289002990030900319003290033900349003590036900379003890039900409004190042900439004490045900469004790048900499005090051900529005390054900559005690057900589005990060900619006290063900649006590066900679006890069900709007190072900739007490075900769007790078900799008090081900829008390084900859008690087900889008990090900919009290093900949009590096900979009890099901009010190102901039010490105901069010790108901099011090111901129011390114901159011690117901189011990120901219012290123901249012590126901279012890129901309013190132901339013490135901369013790138901399014090141901429014390144901459014690147901489014990150901519015290153901549015590156901579015890159901609016190162901639016490165901669016790168901699017090171901729017390174901759017690177901789017990180901819018290183901849018590186901879018890189901909019190192901939019490195901969019790198901999020090201902029020390204902059020690207902089020990210902119021290213902149021590216902179021890219902209022190222902239022490225902269022790228902299023090231902329023390234902359023690237902389023990240902419024290243902449024590246902479024890249902509025190252902539025490255902569025790258902599026090261902629026390264902659026690267902689026990270902719027290273902749027590276902779027890279902809028190282902839028490285902869028790288902899029090291902929029390294902959029690297902989029990300903019030290303903049030590306903079030890309903109031190312903139031490315903169031790318903199032090321903229032390324903259032690327903289032990330903319033290333903349033590336903379033890339903409034190342903439034490345903469034790348903499035090351903529035390354903559035690357903589035990360903619036290363903649036590366903679036890369903709037190372903739037490375903769037790378903799038090381903829038390384903859038690387903889038990390903919039290393903949039590396903979039890399904009040190402904039040490405904069040790408904099041090411904129041390414904159041690417904189041990420904219042290423904249042590426904279042890429904309043190432904339043490435904369043790438904399044090441904429044390444904459044690447904489044990450904519045290453904549045590456904579045890459904609046190462904639046490465904669046790468904699047090471904729047390474904759047690477904789047990480904819048290483904849048590486904879048890489904909049190492904939049490495904969049790498904999050090501905029050390504905059050690507905089050990510905119051290513905149051590516905179051890519905209052190522905239052490525905269052790528905299053090531905329053390534905359053690537905389053990540905419054290543905449054590546905479054890549905509055190552905539055490555905569055790558905599056090561905629056390564905659056690567905689056990570905719057290573905749057590576905779057890579905809058190582905839058490585905869058790588905899059090591905929059390594905959059690597905989059990600906019060290603906049060590606906079060890609906109061190612906139061490615906169061790618906199062090621906229062390624906259062690627906289062990630906319063290633906349063590636906379063890639906409064190642906439064490645906469064790648906499065090651906529065390654906559065690657906589065990660906619066290663906649066590666906679066890669906709067190672906739067490675906769067790678906799068090681906829068390684906859068690687906889068990690906919069290693906949069590696906979069890699907009070190702907039070490705907069070790708907099071090711907129071390714907159071690717907189071990720907219072290723907249072590726907279072890729907309073190732907339073490735907369073790738907399074090741907429074390744907459074690747907489074990750907519075290753907549075590756907579075890759907609076190762907639076490765907669076790768907699077090771907729077390774907759077690777907789077990780907819078290783907849078590786907879078890789907909079190792907939079490795907969079790798907999080090801908029080390804908059080690807908089080990810908119081290813908149081590816908179081890819908209082190822908239082490825908269082790828908299083090831908329083390834908359083690837908389083990840908419084290843908449084590846908479084890849908509085190852908539085490855908569085790858908599086090861908629086390864908659086690867908689086990870908719087290873908749087590876908779087890879908809088190882908839088490885908869088790888908899089090891908929089390894908959089690897908989089990900909019090290903909049090590906909079090890909909109091190912909139091490915909169091790918909199092090921909229092390924909259092690927909289092990930909319093290933909349093590936909379093890939909409094190942909439094490945909469094790948909499095090951909529095390954909559095690957909589095990960909619096290963909649096590966909679096890969909709097190972909739097490975909769097790978909799098090981909829098390984909859098690987909889098990990909919099290993909949099590996909979099890999910009100191002910039100491005910069100791008910099101091011910129101391014910159101691017910189101991020910219102291023910249102591026910279102891029910309103191032910339103491035910369103791038910399104091041910429104391044910459104691047910489104991050910519105291053910549105591056910579105891059910609106191062910639106491065910669106791068910699107091071910729107391074910759107691077910789107991080910819108291083910849108591086910879108891089910909109191092910939109491095910969109791098910999110091101911029110391104911059110691107911089110991110911119111291113911149111591116911179111891119911209112191122911239112491125911269112791128911299113091131911329113391134911359113691137911389113991140911419114291143911449114591146911479114891149911509115191152911539115491155911569115791158911599116091161911629116391164911659116691167911689116991170911719117291173911749117591176911779117891179911809118191182911839118491185911869118791188911899119091191911929119391194911959119691197911989119991200912019120291203912049120591206912079120891209912109121191212912139121491215912169121791218912199122091221912229122391224912259122691227912289122991230912319123291233912349123591236912379123891239912409124191242912439124491245912469124791248912499125091251912529125391254912559125691257912589125991260912619126291263912649126591266912679126891269912709127191272912739127491275912769127791278912799128091281912829128391284912859128691287912889128991290912919129291293912949129591296912979129891299913009130191302913039130491305913069130791308913099131091311913129131391314913159131691317913189131991320913219132291323913249132591326913279132891329913309133191332913339133491335913369133791338913399134091341913429134391344913459134691347913489134991350913519135291353913549135591356913579135891359913609136191362913639136491365913669136791368913699137091371913729137391374913759137691377913789137991380913819138291383913849138591386913879138891389913909139191392913939139491395913969139791398913999140091401914029140391404914059140691407914089140991410914119141291413914149141591416914179141891419914209142191422914239142491425914269142791428914299143091431914329143391434914359143691437914389143991440914419144291443914449144591446914479144891449914509145191452914539145491455914569145791458914599146091461914629146391464914659146691467914689146991470914719147291473914749147591476914779147891479914809148191482914839148491485914869148791488914899149091491914929149391494914959149691497914989149991500915019150291503915049150591506915079150891509915109151191512915139151491515915169151791518915199152091521915229152391524915259152691527915289152991530915319153291533915349153591536915379153891539915409154191542915439154491545915469154791548915499155091551915529155391554915559155691557915589155991560915619156291563915649156591566915679156891569915709157191572915739157491575915769157791578915799158091581915829158391584915859158691587915889158991590915919159291593915949159591596915979159891599916009160191602916039160491605916069160791608916099161091611916129161391614916159161691617916189161991620916219162291623916249162591626916279162891629916309163191632916339163491635916369163791638916399164091641916429164391644916459164691647916489164991650916519165291653916549165591656916579165891659916609166191662916639166491665916669166791668916699167091671916729167391674916759167691677916789167991680916819168291683916849168591686916879168891689916909169191692916939169491695916969169791698916999170091701917029170391704917059170691707917089170991710917119171291713917149171591716917179171891719917209172191722917239172491725917269172791728917299173091731917329173391734917359173691737917389173991740917419174291743917449174591746917479174891749917509175191752917539175491755917569175791758917599176091761917629176391764917659176691767917689176991770917719177291773917749177591776917779177891779917809178191782917839178491785917869178791788917899179091791917929179391794917959179691797917989179991800918019180291803918049180591806918079180891809918109181191812918139181491815918169181791818918199182091821918229182391824918259182691827918289182991830918319183291833918349183591836918379183891839918409184191842918439184491845918469184791848918499185091851918529185391854918559185691857918589185991860918619186291863918649186591866918679186891869918709187191872918739187491875918769187791878918799188091881918829188391884918859188691887918889188991890918919189291893918949189591896918979189891899919009190191902919039190491905919069190791908919099191091911919129191391914919159191691917919189191991920919219192291923919249192591926919279192891929919309193191932919339193491935919369193791938919399194091941919429194391944919459194691947919489194991950919519195291953919549195591956919579195891959919609196191962919639196491965919669196791968919699197091971919729197391974919759197691977919789197991980919819198291983919849198591986919879198891989919909199191992919939199491995919969199791998919999200092001920029200392004920059200692007920089200992010920119201292013920149201592016920179201892019920209202192022920239202492025920269202792028920299203092031920329203392034920359203692037920389203992040920419204292043920449204592046920479204892049920509205192052920539205492055920569205792058920599206092061920629206392064920659206692067920689206992070920719207292073920749207592076920779207892079920809208192082920839208492085920869208792088920899209092091920929209392094920959209692097920989209992100921019210292103921049210592106921079210892109921109211192112921139211492115921169211792118921199212092121921229212392124921259212692127921289212992130921319213292133921349213592136921379213892139921409214192142921439214492145921469214792148921499215092151921529215392154921559215692157921589215992160921619216292163921649216592166921679216892169921709217192172921739217492175921769217792178921799218092181921829218392184921859218692187921889218992190921919219292193921949219592196921979219892199922009220192202922039220492205922069220792208922099221092211922129221392214922159221692217922189221992220922219222292223922249222592226922279222892229922309223192232922339223492235922369223792238922399224092241922429224392244922459224692247922489224992250922519225292253922549225592256922579225892259922609226192262922639226492265922669226792268922699227092271922729227392274922759227692277922789227992280922819228292283922849228592286922879228892289922909229192292922939229492295922969229792298922999230092301923029230392304923059230692307923089230992310923119231292313923149231592316923179231892319923209232192322923239232492325923269232792328923299233092331923329233392334923359233692337923389233992340923419234292343923449234592346923479234892349923509235192352923539235492355923569235792358923599236092361923629236392364923659236692367923689236992370923719237292373923749237592376923779237892379923809238192382923839238492385923869238792388923899239092391923929239392394923959239692397923989239992400924019240292403924049240592406924079240892409924109241192412924139241492415924169241792418924199242092421924229242392424924259242692427924289242992430924319243292433924349243592436924379243892439924409244192442924439244492445924469244792448924499245092451924529245392454924559245692457924589245992460924619246292463924649246592466924679246892469924709247192472924739247492475924769247792478924799248092481924829248392484924859248692487924889248992490924919249292493924949249592496924979249892499925009250192502925039250492505925069250792508925099251092511925129251392514925159251692517925189251992520925219252292523925249252592526925279252892529925309253192532925339253492535925369253792538925399254092541925429254392544925459254692547925489254992550925519255292553925549255592556925579255892559925609256192562925639256492565925669256792568925699257092571925729257392574925759257692577925789257992580925819258292583925849258592586925879258892589925909259192592925939259492595925969259792598925999260092601926029260392604926059260692607926089260992610926119261292613926149261592616926179261892619926209262192622926239262492625926269262792628926299263092631926329263392634926359263692637926389263992640926419264292643926449264592646926479264892649926509265192652926539265492655926569265792658926599266092661926629266392664926659266692667926689266992670926719267292673926749267592676926779267892679926809268192682926839268492685926869268792688926899269092691926929269392694926959269692697926989269992700927019270292703927049270592706927079270892709927109271192712927139271492715927169271792718927199272092721927229272392724927259272692727927289272992730927319273292733927349273592736927379273892739927409274192742927439274492745927469274792748927499275092751927529275392754927559275692757927589275992760927619276292763927649276592766927679276892769927709277192772927739277492775927769277792778927799278092781927829278392784927859278692787927889278992790927919279292793927949279592796927979279892799928009280192802928039280492805928069280792808928099281092811928129281392814928159281692817928189281992820928219282292823928249282592826928279282892829928309283192832928339283492835928369283792838928399284092841928429284392844928459284692847928489284992850928519285292853928549285592856928579285892859928609286192862928639286492865928669286792868928699287092871928729287392874928759287692877928789287992880928819288292883928849288592886928879288892889928909289192892928939289492895928969289792898928999290092901929029290392904929059290692907929089290992910929119291292913929149291592916929179291892919929209292192922929239292492925929269292792928929299293092931929329293392934929359293692937929389293992940929419294292943929449294592946929479294892949929509295192952929539295492955929569295792958929599296092961929629296392964929659296692967929689296992970929719297292973929749297592976929779297892979929809298192982929839298492985929869298792988929899299092991929929299392994929959299692997929989299993000930019300293003930049300593006930079300893009930109301193012930139301493015930169301793018930199302093021930229302393024930259302693027930289302993030930319303293033930349303593036930379303893039930409304193042930439304493045930469304793048930499305093051930529305393054930559305693057930589305993060930619306293063930649306593066930679306893069930709307193072930739307493075930769307793078930799308093081930829308393084930859308693087930889308993090930919309293093930949309593096930979309893099931009310193102931039310493105931069310793108931099311093111931129311393114931159311693117931189311993120931219312293123931249312593126931279312893129931309313193132931339313493135931369313793138931399314093141931429314393144931459314693147931489314993150931519315293153931549315593156931579315893159931609316193162931639316493165931669316793168931699317093171931729317393174931759317693177931789317993180931819318293183931849318593186931879318893189931909319193192931939319493195931969319793198931999320093201932029320393204932059320693207932089320993210932119321293213932149321593216932179321893219932209322193222932239322493225932269322793228932299323093231932329323393234932359323693237932389323993240932419324293243932449324593246932479324893249932509325193252932539325493255932569325793258932599326093261932629326393264932659326693267932689326993270932719327293273932749327593276932779327893279932809328193282932839328493285932869328793288932899329093291932929329393294932959329693297932989329993300933019330293303933049330593306933079330893309933109331193312933139331493315933169331793318933199332093321933229332393324933259332693327933289332993330933319333293333933349333593336933379333893339933409334193342933439334493345933469334793348933499335093351933529335393354933559335693357933589335993360933619336293363933649336593366933679336893369933709337193372933739337493375933769337793378933799338093381933829338393384933859338693387933889338993390933919339293393933949339593396933979339893399934009340193402934039340493405934069340793408934099341093411934129341393414934159341693417934189341993420934219342293423934249342593426934279342893429934309343193432934339343493435934369343793438934399344093441934429344393444934459344693447934489344993450934519345293453934549345593456934579345893459934609346193462934639346493465934669346793468934699347093471934729347393474934759347693477934789347993480934819348293483934849348593486934879348893489934909349193492934939349493495934969349793498934999350093501935029350393504935059350693507935089350993510935119351293513935149351593516935179351893519935209352193522935239352493525935269352793528935299353093531935329353393534935359353693537935389353993540935419354293543935449354593546935479354893549935509355193552935539355493555935569355793558935599356093561935629356393564935659356693567935689356993570935719357293573935749357593576935779357893579935809358193582935839358493585935869358793588935899359093591935929359393594935959359693597935989359993600936019360293603936049360593606936079360893609936109361193612936139361493615936169361793618936199362093621936229362393624936259362693627936289362993630936319363293633936349363593636936379363893639936409364193642936439364493645936469364793648936499365093651936529365393654936559365693657936589365993660936619366293663936649366593666936679366893669936709367193672936739367493675936769367793678936799368093681936829368393684936859368693687936889368993690936919369293693936949369593696936979369893699937009370193702937039370493705937069370793708937099371093711937129371393714937159371693717937189371993720937219372293723937249372593726937279372893729937309373193732937339373493735937369373793738937399374093741937429374393744937459374693747937489374993750937519375293753937549375593756937579375893759937609376193762937639376493765937669376793768937699377093771937729377393774937759377693777937789377993780937819378293783937849378593786937879378893789937909379193792937939379493795937969379793798937999380093801938029380393804938059380693807938089380993810938119381293813938149381593816938179381893819938209382193822938239382493825938269382793828938299383093831938329383393834938359383693837938389383993840938419384293843938449384593846938479384893849938509385193852938539385493855938569385793858938599386093861938629386393864938659386693867938689386993870938719387293873938749387593876938779387893879938809388193882938839388493885938869388793888938899389093891938929389393894938959389693897938989389993900939019390293903939049390593906939079390893909939109391193912939139391493915939169391793918939199392093921939229392393924939259392693927939289392993930939319393293933939349393593936939379393893939939409394193942939439394493945939469394793948939499395093951939529395393954939559395693957939589395993960939619396293963939649396593966939679396893969939709397193972939739397493975939769397793978939799398093981939829398393984939859398693987939889398993990939919399293993939949399593996939979399893999940009400194002940039400494005940069400794008940099401094011940129401394014940159401694017940189401994020940219402294023940249402594026940279402894029940309403194032940339403494035940369403794038940399404094041940429404394044940459404694047940489404994050940519405294053940549405594056940579405894059940609406194062940639406494065940669406794068940699407094071940729407394074940759407694077940789407994080940819408294083940849408594086940879408894089940909409194092940939409494095940969409794098940999410094101941029410394104941059410694107941089410994110941119411294113941149411594116941179411894119941209412194122941239412494125941269412794128941299413094131941329413394134941359413694137941389413994140941419414294143941449414594146941479414894149941509415194152941539415494155941569415794158941599416094161941629416394164941659416694167941689416994170941719417294173941749417594176941779417894179941809418194182941839418494185941869418794188941899419094191941929419394194941959419694197941989419994200942019420294203942049420594206942079420894209942109421194212942139421494215942169421794218942199422094221942229422394224942259422694227942289422994230942319423294233942349423594236942379423894239942409424194242942439424494245942469424794248942499425094251942529425394254942559425694257942589425994260942619426294263942649426594266942679426894269942709427194272942739427494275942769427794278942799428094281942829428394284942859428694287942889428994290942919429294293942949429594296942979429894299943009430194302943039430494305943069430794308943099431094311943129431394314943159431694317943189431994320943219432294323943249432594326943279432894329943309433194332943339433494335943369433794338943399434094341943429434394344943459434694347943489434994350943519435294353943549435594356943579435894359943609436194362943639436494365943669436794368943699437094371943729437394374943759437694377943789437994380943819438294383943849438594386943879438894389943909439194392943939439494395943969439794398943999440094401944029440394404944059440694407944089440994410944119441294413944149441594416944179441894419944209442194422944239442494425944269442794428944299443094431944329443394434944359443694437944389443994440944419444294443944449444594446944479444894449944509445194452944539445494455944569445794458944599446094461944629446394464944659446694467944689446994470944719447294473944749447594476944779447894479944809448194482944839448494485944869448794488944899449094491944929449394494944959449694497944989449994500945019450294503945049450594506945079450894509945109451194512945139451494515945169451794518945199452094521945229452394524945259452694527945289452994530945319453294533945349453594536945379453894539945409454194542945439454494545945469454794548945499455094551945529455394554945559455694557945589455994560945619456294563945649456594566945679456894569945709457194572945739457494575945769457794578945799458094581945829458394584945859458694587945889458994590945919459294593945949459594596945979459894599946009460194602946039460494605946069460794608946099461094611946129461394614946159461694617946189461994620946219462294623946249462594626946279462894629946309463194632946339463494635946369463794638946399464094641946429464394644946459464694647946489464994650946519465294653946549465594656946579465894659946609466194662946639466494665946669466794668946699467094671946729467394674946759467694677946789467994680946819468294683946849468594686946879468894689946909469194692946939469494695946969469794698946999470094701947029470394704947059470694707947089470994710947119471294713947149471594716947179471894719947209472194722947239472494725947269472794728947299473094731947329473394734947359473694737947389473994740947419474294743947449474594746947479474894749947509475194752947539475494755947569475794758947599476094761947629476394764947659476694767947689476994770947719477294773947749477594776947779477894779947809478194782947839478494785947869478794788947899479094791947929479394794947959479694797947989479994800948019480294803948049480594806948079480894809948109481194812948139481494815948169481794818948199482094821948229482394824948259482694827948289482994830948319483294833948349483594836948379483894839948409484194842948439484494845948469484794848948499485094851948529485394854948559485694857948589485994860948619486294863948649486594866948679486894869948709487194872948739487494875948769487794878948799488094881948829488394884948859488694887948889488994890948919489294893948949489594896948979489894899949009490194902949039490494905949069490794908949099491094911949129491394914949159491694917949189491994920949219492294923949249492594926949279492894929949309493194932949339493494935949369493794938949399494094941949429494394944949459494694947949489494994950949519495294953949549495594956949579495894959949609496194962949639496494965949669496794968949699497094971949729497394974949759497694977949789497994980949819498294983949849498594986949879498894989949909499194992949939499494995949969499794998949999500095001950029500395004950059500695007950089500995010950119501295013950149501595016950179501895019950209502195022950239502495025950269502795028950299503095031950329503395034950359503695037950389503995040950419504295043950449504595046950479504895049950509505195052950539505495055950569505795058950599506095061950629506395064950659506695067950689506995070950719507295073950749507595076950779507895079950809508195082950839508495085950869508795088950899509095091950929509395094950959509695097950989509995100951019510295103951049510595106951079510895109951109511195112951139511495115951169511795118951199512095121951229512395124951259512695127951289512995130951319513295133951349513595136951379513895139951409514195142951439514495145951469514795148951499515095151951529515395154951559515695157951589515995160951619516295163951649516595166951679516895169951709517195172951739517495175951769517795178951799518095181951829518395184951859518695187951889518995190951919519295193951949519595196951979519895199952009520195202952039520495205952069520795208952099521095211952129521395214952159521695217952189521995220952219522295223952249522595226952279522895229952309523195232952339523495235952369523795238952399524095241952429524395244952459524695247952489524995250952519525295253952549525595256952579525895259952609526195262952639526495265952669526795268952699527095271952729527395274952759527695277952789527995280952819528295283952849528595286952879528895289952909529195292952939529495295952969529795298952999530095301953029530395304953059530695307953089530995310953119531295313953149531595316953179531895319953209532195322953239532495325953269532795328953299533095331953329533395334953359533695337953389533995340953419534295343953449534595346953479534895349953509535195352953539535495355953569535795358953599536095361953629536395364953659536695367953689536995370953719537295373953749537595376953779537895379953809538195382953839538495385953869538795388953899539095391953929539395394953959539695397953989539995400954019540295403954049540595406954079540895409954109541195412954139541495415954169541795418954199542095421954229542395424954259542695427954289542995430954319543295433954349543595436954379543895439954409544195442954439544495445954469544795448954499545095451954529545395454954559545695457954589545995460954619546295463954649546595466954679546895469954709547195472954739547495475954769547795478954799548095481954829548395484954859548695487954889548995490954919549295493954949549595496954979549895499955009550195502955039550495505955069550795508955099551095511955129551395514955159551695517955189551995520955219552295523955249552595526955279552895529955309553195532955339553495535955369553795538955399554095541955429554395544955459554695547955489554995550955519555295553955549555595556955579555895559955609556195562955639556495565955669556795568955699557095571955729557395574955759557695577955789557995580955819558295583955849558595586955879558895589955909559195592955939559495595955969559795598955999560095601956029560395604956059560695607956089560995610956119561295613956149561595616956179561895619956209562195622956239562495625956269562795628956299563095631956329563395634956359563695637956389563995640956419564295643956449564595646956479564895649956509565195652956539565495655956569565795658956599566095661956629566395664956659566695667956689566995670956719567295673956749567595676956779567895679956809568195682956839568495685956869568795688956899569095691956929569395694956959569695697956989569995700957019570295703957049570595706957079570895709957109571195712957139571495715957169571795718957199572095721957229572395724957259572695727957289572995730957319573295733957349573595736957379573895739957409574195742957439574495745957469574795748957499575095751957529575395754957559575695757957589575995760957619576295763957649576595766957679576895769957709577195772957739577495775957769577795778957799578095781957829578395784957859578695787957889578995790957919579295793957949579595796957979579895799958009580195802958039580495805958069580795808958099581095811958129581395814958159581695817958189581995820958219582295823958249582595826958279582895829958309583195832958339583495835958369583795838958399584095841958429584395844958459584695847958489584995850958519585295853958549585595856958579585895859958609586195862958639586495865958669586795868958699587095871958729587395874958759587695877958789587995880958819588295883958849588595886958879588895889958909589195892958939589495895958969589795898958999590095901959029590395904959059590695907959089590995910959119591295913959149591595916959179591895919959209592195922959239592495925959269592795928959299593095931959329593395934959359593695937959389593995940959419594295943959449594595946959479594895949959509595195952959539595495955959569595795958959599596095961959629596395964959659596695967959689596995970959719597295973959749597595976959779597895979959809598195982959839598495985959869598795988959899599095991959929599395994959959599695997959989599996000960019600296003960049600596006960079600896009960109601196012960139601496015960169601796018960199602096021960229602396024960259602696027960289602996030960319603296033960349603596036960379603896039960409604196042960439604496045960469604796048960499605096051960529605396054960559605696057960589605996060960619606296063960649606596066960679606896069960709607196072960739607496075960769607796078960799608096081960829608396084960859608696087960889608996090960919609296093960949609596096960979609896099961009610196102961039610496105961069610796108961099611096111961129611396114961159611696117961189611996120961219612296123961249612596126961279612896129961309613196132961339613496135961369613796138961399614096141961429614396144961459614696147961489614996150961519615296153961549615596156961579615896159961609616196162961639616496165961669616796168961699617096171961729617396174961759617696177961789617996180961819618296183961849618596186961879618896189961909619196192961939619496195961969619796198961999620096201962029620396204962059620696207962089620996210962119621296213962149621596216962179621896219962209622196222962239622496225962269622796228962299623096231962329623396234962359623696237962389623996240962419624296243962449624596246962479624896249962509625196252962539625496255962569625796258962599626096261962629626396264962659626696267962689626996270962719627296273962749627596276962779627896279962809628196282962839628496285962869628796288962899629096291962929629396294962959629696297962989629996300963019630296303963049630596306963079630896309963109631196312963139631496315963169631796318963199632096321963229632396324963259632696327963289632996330963319633296333963349633596336963379633896339963409634196342963439634496345963469634796348963499635096351963529635396354963559635696357963589635996360963619636296363963649636596366963679636896369963709637196372963739637496375963769637796378963799638096381963829638396384963859638696387963889638996390963919639296393963949639596396963979639896399964009640196402964039640496405964069640796408964099641096411964129641396414964159641696417964189641996420964219642296423964249642596426964279642896429964309643196432964339643496435964369643796438964399644096441964429644396444964459644696447964489644996450964519645296453964549645596456964579645896459964609646196462964639646496465964669646796468964699647096471964729647396474964759647696477964789647996480964819648296483964849648596486964879648896489964909649196492964939649496495964969649796498964999650096501965029650396504965059650696507965089650996510965119651296513965149651596516965179651896519965209652196522965239652496525965269652796528965299653096531965329653396534965359653696537965389653996540965419654296543965449654596546965479654896549965509655196552965539655496555965569655796558965599656096561965629656396564965659656696567965689656996570965719657296573965749657596576965779657896579965809658196582965839658496585965869658796588965899659096591965929659396594965959659696597965989659996600966019660296603966049660596606966079660896609966109661196612966139661496615966169661796618966199662096621966229662396624966259662696627966289662996630966319663296633966349663596636966379663896639966409664196642966439664496645966469664796648966499665096651966529665396654966559665696657966589665996660966619666296663966649666596666966679666896669966709667196672966739667496675966769667796678966799668096681966829668396684966859668696687966889668996690966919669296693966949669596696966979669896699967009670196702967039670496705967069670796708967099671096711967129671396714967159671696717967189671996720967219672296723967249672596726967279672896729967309673196732967339673496735967369673796738967399674096741967429674396744967459674696747967489674996750967519675296753967549675596756967579675896759967609676196762967639676496765967669676796768967699677096771967729677396774967759677696777967789677996780967819678296783967849678596786967879678896789967909679196792967939679496795967969679796798967999680096801968029680396804968059680696807968089680996810968119681296813968149681596816968179681896819968209682196822968239682496825968269682796828968299683096831968329683396834968359683696837968389683996840968419684296843968449684596846968479684896849968509685196852968539685496855968569685796858968599686096861968629686396864968659686696867968689686996870968719687296873968749687596876968779687896879968809688196882968839688496885968869688796888968899689096891968929689396894968959689696897968989689996900969019690296903969049690596906969079690896909969109691196912969139691496915969169691796918969199692096921969229692396924969259692696927969289692996930969319693296933969349693596936969379693896939969409694196942969439694496945969469694796948969499695096951969529695396954969559695696957969589695996960969619696296963969649696596966969679696896969969709697196972969739697496975969769697796978969799698096981969829698396984969859698696987969889698996990969919699296993969949699596996969979699896999970009700197002970039700497005970069700797008970099701097011970129701397014970159701697017970189701997020970219702297023970249702597026970279702897029970309703197032970339703497035970369703797038970399704097041970429704397044970459704697047970489704997050970519705297053970549705597056970579705897059970609706197062970639706497065970669706797068970699707097071970729707397074970759707697077970789707997080970819708297083970849708597086970879708897089970909709197092970939709497095970969709797098970999710097101971029710397104971059710697107971089710997110971119711297113971149711597116971179711897119971209712197122971239712497125971269712797128971299713097131971329713397134971359713697137971389713997140971419714297143971449714597146971479714897149971509715197152971539715497155971569715797158971599716097161971629716397164971659716697167971689716997170971719717297173971749717597176971779717897179971809718197182971839718497185971869718797188971899719097191971929719397194971959719697197971989719997200972019720297203972049720597206972079720897209972109721197212972139721497215972169721797218972199722097221972229722397224972259722697227972289722997230972319723297233972349723597236972379723897239972409724197242972439724497245972469724797248972499725097251972529725397254972559725697257972589725997260972619726297263972649726597266972679726897269972709727197272972739727497275972769727797278972799728097281972829728397284972859728697287972889728997290972919729297293972949729597296972979729897299973009730197302973039730497305973069730797308973099731097311973129731397314973159731697317973189731997320973219732297323973249732597326973279732897329973309733197332973339733497335973369733797338973399734097341973429734397344973459734697347973489734997350973519735297353973549735597356973579735897359973609736197362973639736497365973669736797368973699737097371973729737397374973759737697377973789737997380973819738297383973849738597386973879738897389973909739197392973939739497395973969739797398973999740097401974029740397404974059740697407974089740997410974119741297413974149741597416974179741897419974209742197422974239742497425974269742797428974299743097431974329743397434974359743697437974389743997440974419744297443974449744597446974479744897449974509745197452974539745497455974569745797458974599746097461974629746397464974659746697467974689746997470974719747297473974749747597476974779747897479974809748197482974839748497485974869748797488974899749097491974929749397494974959749697497974989749997500975019750297503975049750597506975079750897509975109751197512975139751497515975169751797518975199752097521975229752397524975259752697527975289752997530975319753297533975349753597536975379753897539975409754197542975439754497545975469754797548975499755097551975529755397554975559755697557975589755997560975619756297563975649756597566975679756897569975709757197572975739757497575975769757797578975799758097581975829758397584975859758697587975889758997590975919759297593975949759597596975979759897599976009760197602976039760497605976069760797608976099761097611976129761397614976159761697617976189761997620976219762297623976249762597626976279762897629976309763197632976339763497635976369763797638976399764097641976429764397644976459764697647976489764997650976519765297653976549765597656976579765897659976609766197662976639766497665976669766797668976699767097671976729767397674976759767697677976789767997680976819768297683976849768597686976879768897689976909769197692976939769497695976969769797698976999770097701977029770397704977059770697707977089770997710977119771297713977149771597716977179771897719977209772197722977239772497725977269772797728977299773097731977329773397734977359773697737977389773997740977419774297743977449774597746977479774897749977509775197752977539775497755977569775797758977599776097761977629776397764977659776697767977689776997770977719777297773977749777597776977779777897779977809778197782977839778497785977869778797788977899779097791977929779397794977959779697797977989779997800978019780297803978049780597806978079780897809978109781197812978139781497815978169781797818978199782097821978229782397824978259782697827978289782997830978319783297833978349783597836978379783897839978409784197842978439784497845978469784797848978499785097851978529785397854978559785697857978589785997860978619786297863978649786597866978679786897869978709787197872978739787497875978769787797878978799788097881978829788397884978859788697887978889788997890978919789297893978949789597896978979789897899979009790197902979039790497905979069790797908979099791097911979129791397914979159791697917979189791997920979219792297923979249792597926979279792897929979309793197932979339793497935979369793797938979399794097941979429794397944979459794697947979489794997950979519795297953979549795597956979579795897959979609796197962979639796497965979669796797968979699797097971979729797397974979759797697977979789797997980979819798297983979849798597986979879798897989979909799197992979939799497995979969799797998979999800098001980029800398004980059800698007980089800998010980119801298013980149801598016980179801898019980209802198022980239802498025980269802798028980299803098031980329803398034980359803698037980389803998040980419804298043980449804598046980479804898049980509805198052980539805498055980569805798058980599806098061980629806398064980659806698067980689806998070980719807298073980749807598076980779807898079980809808198082980839808498085980869808798088980899809098091980929809398094980959809698097980989809998100981019810298103981049810598106981079810898109981109811198112981139811498115981169811798118981199812098121981229812398124981259812698127981289812998130981319813298133981349813598136981379813898139981409814198142981439814498145981469814798148981499815098151981529815398154981559815698157981589815998160981619816298163981649816598166981679816898169981709817198172981739817498175981769817798178981799818098181981829818398184981859818698187981889818998190981919819298193981949819598196981979819898199982009820198202982039820498205982069820798208982099821098211982129821398214982159821698217982189821998220982219822298223982249822598226982279822898229982309823198232982339823498235982369823798238982399824098241982429824398244982459824698247982489824998250982519825298253982549825598256982579825898259982609826198262982639826498265982669826798268982699827098271982729827398274982759827698277982789827998280982819828298283982849828598286982879828898289982909829198292982939829498295982969829798298982999830098301983029830398304983059830698307983089830998310983119831298313983149831598316983179831898319983209832198322983239832498325983269832798328983299833098331983329833398334983359833698337983389833998340983419834298343983449834598346983479834898349983509835198352983539835498355983569835798358983599836098361983629836398364983659836698367983689836998370983719837298373983749837598376983779837898379983809838198382983839838498385983869838798388983899839098391983929839398394983959839698397983989839998400984019840298403984049840598406984079840898409984109841198412984139841498415984169841798418984199842098421984229842398424984259842698427984289842998430984319843298433984349843598436984379843898439984409844198442984439844498445984469844798448984499845098451984529845398454984559845698457984589845998460984619846298463984649846598466984679846898469984709847198472984739847498475984769847798478984799848098481984829848398484984859848698487984889848998490984919849298493984949849598496984979849898499985009850198502985039850498505985069850798508985099851098511985129851398514985159851698517985189851998520985219852298523985249852598526985279852898529985309853198532985339853498535985369853798538985399854098541985429854398544985459854698547985489854998550985519855298553985549855598556985579855898559985609856198562985639856498565985669856798568985699857098571985729857398574985759857698577985789857998580985819858298583985849858598586985879858898589985909859198592985939859498595985969859798598985999860098601986029860398604986059860698607986089860998610986119861298613986149861598616986179861898619986209862198622986239862498625986269862798628986299863098631986329863398634986359863698637986389863998640986419864298643986449864598646986479864898649986509865198652986539865498655986569865798658986599866098661986629866398664986659866698667986689866998670986719867298673986749867598676986779867898679986809868198682986839868498685986869868798688986899869098691986929869398694986959869698697986989869998700987019870298703987049870598706987079870898709987109871198712987139871498715987169871798718987199872098721987229872398724987259872698727987289872998730987319873298733987349873598736987379873898739987409874198742987439874498745987469874798748987499875098751987529875398754987559875698757987589875998760987619876298763987649876598766987679876898769987709877198772987739877498775987769877798778987799878098781987829878398784987859878698787987889878998790987919879298793987949879598796987979879898799988009880198802988039880498805988069880798808988099881098811988129881398814988159881698817988189881998820988219882298823988249882598826988279882898829988309883198832988339883498835988369883798838988399884098841988429884398844988459884698847988489884998850988519885298853988549885598856988579885898859988609886198862988639886498865988669886798868988699887098871988729887398874988759887698877988789887998880988819888298883988849888598886988879888898889988909889198892988939889498895988969889798898988999890098901989029890398904989059890698907989089890998910989119891298913989149891598916989179891898919989209892198922989239892498925989269892798928989299893098931989329893398934989359893698937989389893998940989419894298943989449894598946989479894898949989509895198952989539895498955989569895798958989599896098961989629896398964989659896698967989689896998970989719897298973989749897598976989779897898979989809898198982989839898498985989869898798988989899899098991989929899398994989959899698997989989899999000990019900299003990049900599006990079900899009990109901199012990139901499015990169901799018990199902099021990229902399024990259902699027990289902999030990319903299033990349903599036990379903899039990409904199042990439904499045990469904799048990499905099051990529905399054990559905699057990589905999060990619906299063990649906599066990679906899069990709907199072990739907499075990769907799078990799908099081990829908399084990859908699087990889908999090990919909299093990949909599096990979909899099991009910199102991039910499105991069910799108991099911099111991129911399114991159911699117991189911999120991219912299123991249912599126991279912899129991309913199132991339913499135991369913799138991399914099141991429914399144991459914699147991489914999150991519915299153991549915599156991579915899159991609916199162991639916499165991669916799168991699917099171991729917399174991759917699177991789917999180991819918299183991849918599186991879918899189991909919199192991939919499195991969919799198991999920099201992029920399204992059920699207992089920999210992119921299213992149921599216992179921899219992209922199222992239922499225992269922799228992299923099231992329923399234992359923699237992389923999240992419924299243992449924599246992479924899249992509925199252992539925499255992569925799258992599926099261992629926399264992659926699267992689926999270992719927299273992749927599276992779927899279992809928199282992839928499285992869928799288992899929099291992929929399294992959929699297992989929999300993019930299303993049930599306993079930899309993109931199312993139931499315993169931799318993199932099321993229932399324993259932699327993289932999330993319933299333993349933599336993379933899339993409934199342993439934499345993469934799348993499935099351993529935399354993559935699357993589935999360993619936299363993649936599366993679936899369993709937199372993739937499375993769937799378993799938099381993829938399384993859938699387993889938999390993919939299393993949939599396993979939899399994009940199402994039940499405994069940799408994099941099411994129941399414994159941699417994189941999420994219942299423994249942599426994279942899429994309943199432994339943499435994369943799438994399944099441994429944399444994459944699447994489944999450994519945299453994549945599456994579945899459994609946199462994639946499465994669946799468994699947099471994729947399474994759947699477994789947999480994819948299483994849948599486994879948899489994909949199492994939949499495994969949799498994999950099501995029950399504995059950699507995089950999510995119951299513995149951599516995179951899519995209952199522995239952499525995269952799528995299953099531995329953399534995359953699537995389953999540995419954299543995449954599546995479954899549995509955199552995539955499555995569955799558995599956099561995629956399564995659956699567995689956999570995719957299573995749957599576995779957899579995809958199582995839958499585995869958799588995899959099591995929959399594995959959699597995989959999600996019960299603996049960599606996079960899609996109961199612996139961499615996169961799618996199962099621996229962399624996259962699627996289962999630996319963299633996349963599636996379963899639996409964199642996439964499645996469964799648996499965099651996529965399654996559965699657996589965999660996619966299663996649966599666996679966899669996709967199672996739967499675996769967799678996799968099681996829968399684996859968699687996889968999690996919969299693996949969599696996979969899699997009970199702997039970499705997069970799708997099971099711997129971399714997159971699717997189971999720997219972299723997249972599726997279972899729997309973199732997339973499735997369973799738997399974099741997429974399744997459974699747997489974999750997519975299753997549975599756997579975899759997609976199762997639976499765997669976799768997699977099771997729977399774997759977699777997789977999780997819978299783997849978599786997879978899789997909979199792997939979499795997969979799798997999980099801998029980399804998059980699807998089980999810998119981299813998149981599816998179981899819998209982199822998239982499825998269982799828998299983099831998329983399834998359983699837998389983999840998419984299843998449984599846998479984899849998509985199852998539985499855998569985799858998599986099861998629986399864998659986699867998689986999870998719987299873998749987599876998779987899879998809988199882998839988499885998869988799888998899989099891998929989399894998959989699897998989989999900999019990299903999049990599906999079990899909999109991199912999139991499915999169991799918999199992099921999229992399924999259992699927999289992999930999319993299933999349993599936999379993899939999409994199942999439994499945999469994799948999499995099951999529995399954999559995699957999589995999960999619996299963999649996599966999679996899969999709997199972999739997499975999769997799978999799998099981999829998399984999859998699987999889998999990999919999299993999949999599996999979999899999100000100001100002100003100004100005100006100007100008100009100010100011100012100013100014100015100016100017100018100019100020100021100022100023100024100025100026100027100028100029100030100031100032100033100034100035100036100037100038100039100040100041100042100043100044100045100046100047100048100049100050100051100052100053100054100055100056100057100058100059100060100061100062100063100064100065100066100067100068100069100070100071100072100073100074100075100076100077100078100079100080100081100082100083100084100085100086100087100088100089100090100091100092100093100094100095100096100097100098100099100100100101100102100103100104100105100106100107100108100109100110100111100112100113100114100115100116100117100118100119100120100121100122100123100124100125100126100127100128100129100130100131100132100133100134100135100136100137100138100139100140100141100142100143100144100145100146100147100148100149100150100151100152100153100154100155100156100157100158100159100160100161100162100163100164100165100166100167100168100169100170100171100172100173100174100175100176100177100178100179100180100181100182100183100184100185100186100187100188100189100190100191100192100193100194100195100196100197100198100199100200100201100202100203100204100205100206100207100208100209100210100211100212100213100214100215100216100217100218100219100220100221100222100223100224100225100226100227100228100229100230100231100232100233100234100235100236100237100238100239100240100241100242100243100244100245100246100247100248100249100250100251100252100253100254100255100256100257100258100259100260100261100262100263100264100265100266100267100268100269100270100271100272100273100274100275100276100277100278100279100280100281100282100283100284100285100286100287100288100289100290100291100292100293100294100295100296100297100298100299100300100301100302100303100304100305100306100307100308100309100310100311100312100313100314100315100316100317100318100319100320100321100322100323100324100325100326100327100328100329100330100331100332100333100334100335100336100337100338100339100340100341100342100343100344100345100346100347100348100349100350100351100352100353100354100355100356100357100358100359100360100361100362100363100364100365100366100367100368100369100370100371100372100373100374100375100376100377100378100379100380100381100382100383100384100385100386100387100388100389100390100391100392100393100394100395100396100397100398100399100400100401100402100403100404100405100406100407100408100409100410100411100412100413100414100415100416100417100418100419100420100421100422100423100424100425100426100427100428100429100430100431100432100433100434100435100436100437100438100439100440100441100442100443100444100445100446100447100448100449100450100451100452100453100454100455100456100457100458100459100460100461100462100463100464100465100466100467100468100469100470100471100472100473100474100475100476100477100478100479100480100481100482100483100484100485100486100487100488100489100490100491100492100493100494100495100496100497100498100499100500100501100502100503100504100505100506100507100508100509100510100511100512100513100514100515100516100517100518100519100520100521100522100523100524100525100526100527100528100529100530100531100532100533100534100535100536100537100538100539100540100541100542100543100544100545100546100547100548100549100550100551100552100553100554100555100556100557100558100559100560100561100562100563100564100565100566100567100568100569100570100571100572100573100574100575100576100577100578100579100580100581100582100583100584100585100586100587100588100589100590100591100592100593100594100595100596100597100598100599100600100601100602100603100604100605100606100607100608100609100610100611100612100613100614100615100616100617100618100619100620100621100622100623100624100625100626100627100628100629100630100631100632100633100634100635100636100637100638100639100640100641100642100643100644100645100646100647100648100649100650100651100652100653100654100655100656100657100658100659100660100661100662100663100664100665100666100667100668100669100670100671100672100673100674100675100676100677100678100679100680100681100682100683100684100685100686100687100688100689100690100691100692100693100694100695100696100697100698100699100700100701100702100703100704100705100706100707100708100709100710100711100712100713100714100715100716100717100718100719100720100721100722100723100724100725100726100727100728100729100730100731100732100733100734100735100736100737100738100739100740100741100742100743100744100745100746100747100748100749100750100751100752100753100754100755100756100757100758100759100760100761100762100763100764100765100766100767100768100769100770100771100772100773100774100775100776100777100778100779100780100781100782100783100784100785100786100787100788100789100790100791100792100793100794100795100796100797100798100799100800100801100802100803100804100805100806100807100808100809100810100811100812100813100814100815100816100817100818100819100820100821100822100823100824100825100826100827100828100829100830100831100832100833100834100835100836100837100838100839100840100841100842100843100844100845100846100847100848100849100850100851100852100853100854100855100856100857100858100859100860100861100862100863100864100865100866100867100868100869100870100871100872100873100874100875100876100877100878100879100880100881100882100883100884100885100886100887100888100889100890100891100892100893100894100895100896100897100898100899100900100901100902100903100904100905100906100907100908100909100910100911100912100913100914100915100916100917100918100919100920100921100922100923100924100925100926100927100928100929100930100931100932100933100934100935100936100937100938100939100940100941100942100943100944100945100946100947100948100949100950100951100952100953100954100955100956100957100958100959100960100961100962100963100964100965100966100967100968100969100970100971100972100973100974100975100976100977100978100979100980100981100982100983100984100985100986100987100988100989100990100991100992100993100994100995100996100997100998100999101000101001101002101003101004101005101006101007101008101009101010101011101012101013101014101015101016101017101018101019101020101021101022101023101024101025101026101027101028101029101030101031101032101033101034101035101036101037101038101039101040101041101042101043101044101045101046101047101048101049101050101051101052101053101054101055101056101057101058101059101060101061101062101063101064101065101066101067101068101069101070101071101072101073101074101075101076101077101078101079101080101081101082101083101084101085101086101087101088101089101090101091101092101093101094101095101096101097101098101099101100101101101102101103101104101105101106101107101108101109101110101111101112101113101114101115101116101117101118101119101120101121101122101123101124101125101126101127101128101129101130101131101132101133101134101135101136101137101138101139101140101141101142101143101144101145101146101147101148101149101150101151101152101153101154101155101156101157101158101159101160101161101162101163101164101165101166101167101168101169101170101171101172101173101174101175101176101177101178101179101180101181101182101183101184101185101186101187101188101189101190101191101192101193101194101195101196101197101198101199101200101201101202101203101204101205101206101207101208101209101210101211101212101213101214101215101216101217101218101219101220101221101222101223101224101225101226101227101228101229101230101231101232101233101234101235101236101237101238101239101240101241101242101243101244101245101246101247101248101249101250101251101252101253101254101255101256101257101258101259101260101261101262101263101264101265101266101267101268101269101270101271101272101273101274101275101276101277101278101279101280101281101282101283101284101285101286101287101288101289101290101291101292101293101294101295101296101297101298101299101300101301101302101303101304101305101306101307101308101309101310101311101312101313101314101315101316101317101318101319101320101321101322101323101324101325101326101327101328101329101330101331101332101333101334101335101336101337101338101339101340101341101342101343101344101345101346101347101348101349101350101351101352101353101354101355101356101357101358101359101360101361101362101363101364101365101366101367101368101369101370101371101372101373101374101375101376101377101378101379101380101381101382101383101384101385101386101387101388101389101390101391101392101393101394101395101396101397101398101399101400101401101402101403101404101405101406101407101408101409101410101411101412101413101414101415101416101417101418101419101420101421101422101423101424101425101426101427101428101429101430101431101432101433101434101435101436101437101438101439101440101441101442101443101444101445101446101447101448101449101450101451101452101453101454101455101456101457101458101459101460101461101462101463101464101465101466101467101468101469101470101471101472101473101474101475101476101477101478101479101480101481101482101483101484101485101486101487101488101489101490101491101492101493101494101495101496101497101498101499101500101501101502101503101504101505101506101507101508101509101510101511101512101513101514101515101516101517101518101519101520101521101522101523101524101525101526101527101528101529101530101531101532101533101534101535101536101537101538101539101540101541101542101543101544101545101546101547101548101549101550101551101552101553101554101555101556101557101558101559101560101561101562101563101564101565101566101567101568101569101570101571101572101573101574101575101576101577101578101579101580101581101582101583101584101585101586101587101588101589101590101591101592101593101594101595101596101597101598101599101600101601101602101603101604101605101606101607101608101609101610101611101612101613101614101615101616101617101618101619101620101621101622101623101624101625101626101627101628101629101630101631101632101633101634101635101636101637101638101639101640101641101642101643101644101645101646101647101648101649101650101651101652101653101654101655101656101657101658101659101660101661101662101663101664101665101666101667101668101669101670101671101672101673101674101675101676101677101678101679101680101681101682101683101684101685101686101687101688101689101690101691101692101693101694101695101696101697101698101699101700101701101702101703101704101705101706101707101708101709101710101711101712101713101714101715101716101717101718101719101720101721101722101723101724101725101726101727101728101729101730101731101732101733101734101735101736101737101738101739101740101741101742101743101744101745101746101747101748101749101750101751101752101753101754101755101756101757101758101759101760101761101762101763101764101765101766101767101768101769101770101771101772101773101774101775101776101777101778101779101780101781101782101783101784101785101786101787101788101789101790101791101792101793101794101795101796101797101798101799101800101801101802101803101804101805101806101807101808101809101810101811101812101813101814101815101816101817101818101819101820101821101822101823101824101825101826101827101828101829101830101831101832101833101834101835101836101837101838101839101840101841101842101843101844101845101846101847101848101849101850101851101852101853101854101855101856101857101858101859101860101861101862101863101864101865101866101867101868101869101870101871101872101873101874101875101876101877101878101879101880101881101882101883101884101885101886101887101888101889101890101891101892101893101894101895101896101897101898101899101900101901101902101903101904101905101906101907101908101909101910101911101912101913101914101915101916101917101918101919101920101921101922101923101924101925101926101927101928101929101930101931101932101933101934101935101936101937101938101939101940101941101942101943101944101945101946101947101948101949101950101951101952101953101954101955101956101957101958101959101960101961101962101963101964101965101966101967101968101969101970101971101972101973101974101975101976101977101978101979101980101981101982101983101984101985101986101987101988101989101990101991101992101993101994101995101996101997101998101999102000102001102002102003102004102005102006102007102008102009102010102011102012102013102014102015102016102017102018102019102020102021102022102023102024102025102026102027102028102029102030102031102032102033102034102035102036102037102038102039102040102041102042102043102044102045102046102047102048102049102050102051102052102053102054102055102056102057102058102059102060102061102062102063102064102065102066102067102068102069102070102071102072102073102074102075102076102077102078102079102080102081102082102083102084102085102086102087102088102089102090102091102092102093102094102095102096102097102098102099102100102101102102102103102104102105102106102107102108102109102110102111102112102113102114102115102116102117102118102119102120102121102122102123102124102125102126102127102128102129102130102131102132102133102134102135102136102137102138102139102140102141102142102143102144102145102146102147102148102149102150102151102152102153102154102155102156102157102158102159102160102161102162102163102164102165102166102167102168102169102170102171102172102173102174102175102176102177102178102179102180102181102182102183102184102185102186102187102188102189102190102191102192102193102194102195102196102197102198102199102200102201102202102203102204102205102206102207102208102209102210102211102212102213102214102215102216102217102218102219102220102221102222102223102224102225102226102227102228102229102230102231102232102233102234102235102236102237102238102239102240102241102242102243102244102245102246102247102248102249102250102251102252102253102254102255102256102257102258102259102260102261102262102263102264102265102266102267102268102269102270102271102272102273102274102275102276102277102278102279102280102281102282102283102284102285102286102287102288102289102290102291102292102293102294102295102296102297102298102299102300102301102302102303102304102305102306102307102308102309102310102311102312102313102314102315102316102317102318102319102320102321102322102323102324102325102326102327102328102329102330102331102332102333102334102335102336102337102338102339102340102341102342102343102344102345102346102347102348102349102350102351102352102353102354102355102356102357102358102359102360102361102362102363102364102365102366102367102368102369102370102371102372102373102374102375102376102377102378102379102380102381102382102383102384102385102386102387102388102389102390102391102392102393102394102395102396102397102398102399102400102401102402102403102404102405102406102407102408102409102410102411102412102413102414102415102416102417102418102419102420102421102422102423102424102425102426102427102428102429102430102431102432102433102434102435102436102437102438102439102440102441102442102443102444102445102446102447102448102449102450102451102452102453102454102455102456102457102458102459102460102461102462102463102464102465102466102467102468102469102470102471102472102473102474102475102476102477102478102479102480102481102482102483102484102485102486102487102488102489102490102491102492102493102494102495102496102497102498102499102500102501102502102503102504102505102506102507102508102509102510102511102512102513102514102515102516102517102518102519102520102521102522102523102524102525102526102527102528102529102530102531102532102533102534102535102536102537102538102539102540102541102542102543102544102545102546102547102548102549102550102551102552102553102554102555102556102557102558102559102560102561102562102563102564102565102566102567102568102569102570102571102572102573102574102575102576102577102578102579102580102581102582102583102584102585102586102587102588102589102590102591102592102593102594102595102596102597102598102599102600102601102602102603102604102605102606102607102608102609102610102611102612102613102614102615102616102617102618102619102620102621102622102623102624102625102626102627102628102629102630102631102632102633102634102635102636102637102638102639102640102641102642102643102644102645102646102647102648102649102650102651102652102653102654102655102656102657102658102659102660102661102662102663102664102665102666102667102668102669102670102671102672102673102674102675102676102677102678102679102680102681102682102683102684102685102686102687102688102689102690102691102692102693102694102695102696102697102698102699102700102701102702102703102704102705102706102707102708102709102710102711102712102713102714102715102716102717102718102719102720102721102722102723102724102725102726102727102728102729102730102731102732102733102734102735102736102737102738102739102740102741102742102743102744102745102746102747102748102749102750102751102752102753102754102755102756102757102758102759102760102761102762102763102764102765102766102767102768102769102770102771102772102773102774102775102776102777102778102779102780102781102782102783102784102785102786102787102788102789102790102791102792102793102794102795102796102797102798102799102800102801102802102803102804102805102806102807102808102809102810102811102812102813102814102815102816102817102818102819102820102821102822102823102824102825102826102827102828102829102830102831102832102833102834102835102836102837102838102839102840102841102842102843102844102845102846102847102848102849102850102851102852102853102854102855102856102857102858102859102860102861102862102863102864102865102866102867102868102869102870102871102872102873102874102875102876102877102878102879102880102881102882102883102884102885102886102887102888102889102890102891102892102893102894102895102896102897102898102899102900102901102902102903102904102905102906102907102908102909102910102911102912102913102914102915102916102917102918102919102920102921102922102923102924102925102926102927102928102929102930102931102932102933102934102935102936102937102938102939102940102941102942102943102944102945102946102947102948102949102950102951102952102953102954102955102956102957102958102959102960102961102962102963102964102965102966102967102968102969102970102971102972102973102974102975102976102977102978102979102980102981102982102983102984102985102986102987102988102989102990102991102992102993102994102995102996102997102998102999103000103001103002103003103004103005103006103007103008103009103010103011103012103013103014103015103016103017103018103019103020103021103022103023103024103025103026103027103028103029103030103031103032103033103034103035103036103037103038103039103040103041103042103043103044103045103046103047103048103049103050103051103052103053103054103055103056103057103058103059103060103061103062103063103064103065103066103067103068103069103070103071103072103073103074103075103076103077103078103079103080103081103082103083103084103085103086103087103088103089103090103091103092103093103094103095103096103097103098103099103100103101103102103103103104103105103106103107103108103109103110103111103112103113103114103115103116103117103118103119103120103121103122103123103124103125103126103127103128103129103130103131103132103133103134103135103136103137103138103139103140103141103142103143103144103145103146103147103148103149103150103151103152103153103154103155103156103157103158103159103160103161103162103163103164103165103166103167103168103169103170103171103172103173103174103175103176103177103178103179103180103181103182103183103184103185103186103187103188103189103190103191103192103193103194103195103196103197103198103199103200103201103202103203103204103205103206103207103208103209103210103211103212103213103214103215103216103217103218103219103220103221103222103223103224103225103226103227103228103229103230103231103232103233103234103235103236103237103238103239103240103241103242103243103244103245103246103247103248103249103250103251103252103253103254103255103256103257103258103259103260103261103262103263103264103265103266103267103268103269103270103271103272103273103274103275103276103277103278103279103280103281103282103283103284103285103286103287103288103289103290103291103292103293103294103295103296103297103298103299103300103301103302103303103304103305103306103307103308103309103310103311103312103313103314103315103316103317103318103319103320103321103322103323103324103325103326103327103328103329103330103331103332103333103334103335103336103337103338103339103340103341103342103343103344103345103346103347103348103349103350103351103352103353103354103355103356103357103358103359103360103361103362103363103364103365103366103367103368103369103370103371103372103373103374103375103376103377103378103379103380103381103382103383103384103385103386103387103388103389103390103391103392103393103394103395103396103397103398103399103400103401103402103403103404103405103406103407103408103409103410103411103412103413103414103415103416103417103418103419103420103421103422103423103424103425103426103427103428103429103430103431103432103433103434103435103436103437103438103439103440103441103442103443103444103445103446103447103448103449103450103451103452103453103454103455103456103457103458103459103460103461103462103463103464103465103466103467103468103469103470103471103472103473103474103475103476103477103478103479103480103481103482103483103484103485103486103487103488103489103490103491103492103493103494103495103496103497103498103499103500103501103502103503103504103505103506103507103508103509103510103511103512103513103514103515103516103517103518103519103520103521103522103523103524103525103526103527103528103529103530103531103532103533103534103535103536103537103538103539103540103541103542103543103544103545103546103547103548103549103550103551103552103553103554103555103556103557103558103559103560103561103562103563103564103565103566103567103568103569103570103571103572103573103574103575103576103577103578103579103580103581103582103583103584103585103586103587103588103589103590103591103592103593103594103595103596103597103598103599103600103601103602103603103604103605103606103607103608103609103610103611103612103613103614103615103616103617103618103619103620103621103622103623103624103625103626103627103628103629103630103631103632103633103634103635103636103637103638103639103640103641103642103643103644103645103646103647103648103649103650103651103652103653103654103655103656103657103658103659103660103661103662103663103664103665103666103667103668103669103670103671103672103673103674103675103676103677103678103679103680103681103682103683103684103685103686103687103688103689103690103691103692103693103694103695103696103697103698103699103700103701103702103703103704103705103706103707103708103709103710103711103712103713103714103715103716103717103718103719103720103721103722103723103724103725103726103727103728103729103730103731103732103733103734103735103736103737103738103739103740103741103742103743103744103745103746103747103748103749103750103751103752103753103754103755103756103757103758103759103760103761103762103763103764103765103766103767103768103769103770103771103772103773103774103775103776103777103778103779103780103781103782103783103784103785103786103787103788103789103790103791103792103793103794103795103796103797103798103799103800103801103802103803103804103805103806103807103808103809103810103811103812103813103814103815103816103817103818103819103820103821103822103823103824103825103826103827103828103829103830103831103832103833103834103835103836103837103838103839103840103841103842103843103844103845103846103847103848103849103850103851103852103853103854103855103856103857103858103859103860103861103862103863103864103865103866103867103868103869103870103871103872103873103874103875103876103877103878103879103880103881103882103883103884103885103886103887103888103889103890103891103892103893103894103895103896103897103898103899103900103901103902103903103904103905103906103907103908103909103910103911103912103913103914103915103916103917103918103919103920103921103922103923103924103925103926103927103928103929103930103931103932103933103934103935103936103937103938103939103940103941103942103943103944103945103946103947103948103949103950103951103952103953103954103955103956103957103958103959103960103961103962103963103964103965103966103967103968103969103970103971103972103973103974103975103976103977103978103979103980103981103982103983103984103985103986103987103988103989103990103991103992103993103994103995103996103997103998103999104000104001104002104003104004104005104006104007104008104009104010104011104012104013104014104015104016104017104018104019104020104021104022104023104024104025104026104027104028104029104030104031104032104033104034104035104036104037104038104039104040104041104042104043104044104045104046104047104048104049104050104051104052104053104054104055104056104057104058104059104060104061104062104063104064104065104066104067104068104069104070104071104072104073104074104075104076104077104078104079104080104081104082104083104084104085104086104087104088104089104090104091104092104093104094104095104096104097104098104099104100104101104102104103104104104105104106104107104108104109104110104111104112104113104114104115104116104117104118104119104120104121104122104123104124104125104126104127104128104129104130104131104132104133104134104135104136104137104138104139104140104141104142104143104144104145104146104147104148104149104150104151104152104153104154104155104156104157104158104159104160104161104162104163104164104165104166104167104168104169104170104171104172104173104174104175104176104177104178104179104180104181104182104183104184104185104186104187104188104189104190104191104192104193104194104195104196104197104198104199104200104201104202104203104204104205104206104207104208104209104210104211104212104213104214104215104216104217104218104219104220104221104222104223104224104225104226104227104228104229104230104231104232104233104234104235104236104237104238104239104240104241104242104243104244104245104246104247104248104249104250104251104252104253104254104255104256104257104258104259104260104261104262104263104264104265104266104267104268104269104270104271104272104273104274104275104276104277104278104279104280104281104282104283104284104285104286104287104288104289104290104291104292104293104294104295104296104297104298104299104300104301104302104303104304104305104306104307104308104309104310104311104312104313104314104315104316104317104318104319104320104321104322104323104324104325104326104327104328104329104330104331104332104333104334104335104336104337104338104339104340104341104342104343104344104345104346104347104348104349104350104351104352104353104354104355104356104357104358104359104360104361104362104363104364104365104366104367104368104369104370104371104372104373104374104375104376104377104378104379104380104381104382104383104384104385104386104387104388104389104390104391104392104393104394104395104396104397104398104399104400104401104402104403104404104405104406104407104408104409104410104411104412104413104414104415104416104417104418104419104420104421104422104423104424104425104426104427104428104429104430104431104432104433104434104435104436104437104438104439104440104441104442104443104444104445104446104447104448104449104450104451104452104453104454104455104456104457104458104459104460104461104462104463104464104465104466104467104468104469104470104471104472104473104474104475104476104477104478104479104480104481104482104483104484104485104486104487104488104489104490104491104492104493104494104495104496104497104498104499104500104501104502104503104504104505104506104507104508104509104510104511104512104513104514104515104516104517104518104519104520104521104522104523104524104525104526104527104528104529104530104531104532104533104534104535104536104537104538104539104540104541104542104543104544104545104546104547104548104549104550104551104552104553104554104555104556104557104558104559104560104561104562104563104564104565104566104567104568104569104570104571104572104573104574104575104576104577104578104579104580104581104582104583104584104585104586104587104588104589104590104591104592104593104594104595104596104597104598104599104600104601104602104603104604104605104606104607104608104609104610104611104612104613104614104615104616104617104618104619104620104621104622104623104624104625104626104627104628104629104630104631104632104633104634104635104636104637104638104639104640104641104642104643104644104645104646104647104648104649104650104651104652104653104654104655104656104657104658104659104660104661104662104663104664104665104666104667104668104669104670104671104672104673104674104675104676104677104678104679104680104681104682104683104684104685104686104687104688104689104690104691104692104693104694104695104696104697104698104699104700104701104702104703104704104705104706104707104708104709104710104711104712104713104714104715104716104717104718104719104720104721104722104723104724104725104726104727104728104729104730104731104732104733104734104735104736104737104738104739104740104741104742104743104744104745104746104747104748104749104750104751104752104753104754104755104756104757104758104759104760104761104762104763104764104765104766104767104768104769104770104771104772104773104774104775104776104777104778104779104780104781104782104783104784104785104786104787104788104789104790104791104792104793104794104795104796104797104798104799104800104801104802104803104804104805104806104807104808104809104810104811104812104813104814104815104816104817104818104819104820104821104822104823104824104825104826104827104828104829104830104831104832104833104834104835104836104837104838104839104840104841104842104843104844104845104846104847104848104849104850104851104852104853104854104855104856104857104858104859104860104861104862104863104864104865104866104867104868104869104870104871104872104873104874104875104876104877104878104879104880104881104882104883104884104885104886104887104888104889104890104891104892104893104894104895104896104897104898104899104900104901104902104903104904104905104906104907104908104909104910104911104912104913104914104915104916104917104918104919104920104921104922104923104924104925104926104927104928104929104930104931104932104933104934104935104936104937104938104939104940104941104942104943104944104945104946104947104948104949104950104951104952104953104954104955104956104957104958104959104960104961104962104963104964104965104966104967104968104969104970104971104972104973104974104975104976104977104978104979104980104981104982104983104984104985104986104987104988104989104990104991104992104993104994104995104996104997104998104999105000105001105002105003105004105005105006105007105008105009105010105011105012105013105014105015105016105017105018105019105020105021105022105023105024105025105026105027105028105029105030105031105032105033105034105035105036105037105038105039105040105041105042105043105044105045105046105047105048105049105050105051105052105053105054105055105056105057105058105059105060105061105062105063105064105065105066105067105068105069105070105071105072105073105074105075105076105077105078105079105080105081105082105083105084105085105086105087105088105089105090105091105092105093105094105095105096105097105098105099105100105101105102105103105104105105105106105107105108105109105110105111105112105113105114105115105116105117105118105119105120105121105122105123105124105125105126105127105128105129105130105131105132105133105134105135105136105137105138105139105140105141105142105143105144105145105146105147105148105149105150105151105152105153105154105155105156105157105158105159105160105161105162105163105164105165105166105167105168105169105170105171105172105173105174105175105176105177105178105179105180105181105182105183105184105185105186105187105188105189105190105191105192105193105194105195105196105197105198105199105200105201105202105203105204105205105206105207105208105209105210105211105212105213105214105215105216105217105218105219105220105221105222105223105224105225105226105227105228105229105230105231105232105233105234105235105236105237105238105239105240105241105242105243105244105245105246105247105248105249105250105251105252105253105254105255105256105257105258105259105260105261105262105263105264105265105266105267105268105269105270105271105272105273105274105275105276105277105278105279105280105281105282105283105284105285105286105287105288105289105290105291105292105293105294105295105296105297105298105299105300105301105302105303105304105305105306105307105308105309105310105311105312105313105314105315105316105317105318105319105320105321105322105323105324105325105326105327105328105329105330105331105332105333105334105335105336105337105338105339105340105341105342105343105344105345105346105347105348105349105350105351105352105353105354105355105356105357105358105359105360105361105362105363105364105365105366105367105368105369105370105371105372105373105374105375105376105377105378105379105380105381105382105383105384105385105386105387105388105389105390105391105392105393105394105395105396105397105398105399105400105401105402105403105404105405105406105407105408105409105410105411105412105413105414105415105416105417105418105419105420105421105422105423105424105425105426105427105428105429105430105431105432105433105434105435105436105437105438105439105440105441105442105443105444105445105446105447105448105449105450105451105452105453105454105455105456105457105458105459105460105461105462105463105464105465105466105467105468105469105470105471105472105473105474105475105476105477105478105479105480105481105482105483105484105485105486105487105488105489105490105491105492105493105494105495105496105497105498105499105500105501105502105503105504105505105506105507105508105509105510105511105512105513105514105515105516105517105518105519105520105521105522105523105524105525105526105527105528105529105530105531105532105533105534105535105536105537105538105539105540105541105542105543105544105545105546105547105548105549105550105551105552105553105554105555105556105557105558105559105560105561105562105563105564105565105566105567105568105569105570105571105572105573105574105575105576105577105578105579105580105581105582105583105584105585105586105587105588105589105590105591105592105593105594105595105596105597105598105599105600105601105602105603105604105605105606105607105608105609105610105611105612105613105614105615105616105617105618105619105620105621105622105623105624105625105626105627105628105629105630105631105632105633105634105635105636105637105638105639105640105641105642105643105644105645105646105647105648105649105650105651105652105653105654105655105656105657105658105659105660105661105662105663105664105665105666105667105668105669105670105671105672105673105674105675105676105677105678105679105680105681105682105683105684105685105686105687105688105689105690105691105692105693105694105695105696105697105698105699105700105701105702105703105704105705105706105707105708105709105710105711105712105713105714105715105716105717105718105719105720105721105722105723105724105725105726105727105728105729105730105731105732105733105734105735105736105737105738105739105740105741105742105743105744105745105746105747105748105749105750105751105752105753105754105755105756105757105758105759105760105761105762105763105764105765105766105767105768105769105770105771105772105773105774105775105776105777105778105779105780105781105782105783105784105785105786105787105788105789105790105791105792105793105794105795105796105797105798105799105800105801105802105803105804105805105806105807105808105809105810105811105812105813105814105815105816105817105818105819105820105821105822105823105824105825105826105827105828105829105830105831105832105833105834105835105836105837105838105839105840105841105842105843105844105845105846105847105848105849105850105851105852105853105854105855105856105857105858105859105860105861105862105863105864105865105866105867105868105869105870105871105872105873105874105875105876105877105878105879105880105881105882105883105884105885105886105887105888105889105890105891105892105893105894105895105896105897105898105899105900105901105902105903105904105905105906105907105908105909105910105911105912105913105914105915105916105917105918105919105920105921105922105923105924105925105926105927105928105929105930105931105932105933105934105935105936105937105938105939105940105941105942105943105944105945105946105947105948105949105950105951105952105953105954105955105956105957105958105959105960105961105962105963105964105965105966105967105968105969105970105971105972105973105974105975105976105977105978105979105980105981105982105983105984105985105986105987105988105989105990105991105992105993105994105995105996105997105998105999106000106001106002106003106004106005106006106007106008106009106010106011106012106013106014106015106016106017106018106019106020106021106022106023106024106025106026106027106028106029106030106031106032106033106034106035106036106037106038106039106040106041106042106043106044106045106046106047106048106049106050106051106052106053106054106055106056106057106058106059106060106061106062106063106064106065106066106067106068106069106070106071106072106073106074106075106076106077106078106079106080106081106082106083106084106085106086106087106088106089106090106091106092106093106094106095106096106097106098106099106100106101106102106103106104106105106106106107106108106109106110106111106112106113106114106115106116106117106118106119106120106121106122106123106124106125106126106127106128106129106130106131106132106133106134106135106136106137106138106139106140106141106142106143106144106145106146106147106148106149106150106151106152106153106154106155106156106157106158106159106160106161106162106163106164106165106166106167106168106169106170106171106172106173106174106175106176106177106178106179106180106181106182106183106184106185106186106187106188106189106190106191106192106193106194106195106196106197106198106199106200106201106202106203106204106205106206106207106208106209106210106211106212106213106214106215106216106217106218106219106220106221106222106223106224106225106226106227106228106229106230106231106232106233106234106235106236106237106238106239106240106241106242106243106244106245106246106247106248106249106250106251106252106253106254106255106256106257106258106259106260106261106262106263106264106265106266106267106268106269106270106271106272106273106274106275106276106277106278106279106280106281106282106283106284106285106286106287106288106289106290106291106292106293106294106295106296106297106298106299106300106301106302106303106304106305106306106307106308106309106310106311106312106313106314106315106316106317106318106319106320106321106322106323106324106325106326106327106328106329106330106331106332106333106334106335106336106337106338106339106340106341106342106343106344106345106346106347106348106349106350106351106352106353106354106355106356106357106358106359106360106361106362106363106364106365106366106367106368106369106370106371106372106373106374106375106376106377106378106379106380106381106382106383106384106385106386106387106388106389106390106391106392106393106394106395106396106397106398106399106400106401106402106403106404106405106406106407106408106409106410106411106412106413106414106415106416106417106418106419106420106421106422106423106424106425106426106427106428106429106430106431106432106433106434106435106436106437106438106439106440106441106442106443106444106445106446106447106448106449106450106451106452106453106454106455106456106457106458106459106460106461106462106463106464106465106466106467106468106469106470106471106472106473106474106475106476106477106478106479106480106481106482106483106484106485106486106487106488106489106490106491106492106493106494106495106496106497106498106499106500106501106502106503106504106505106506106507106508106509106510106511106512106513106514106515106516106517106518106519106520106521106522106523106524106525106526106527106528106529106530106531106532106533106534106535106536106537106538106539106540106541106542106543106544106545106546106547106548106549106550106551106552106553106554106555106556106557106558106559106560106561106562106563106564106565106566106567106568106569106570106571106572106573106574106575106576106577106578106579106580106581106582106583106584106585106586106587106588106589106590106591106592106593106594106595106596106597106598106599106600106601106602106603106604106605106606106607106608106609106610106611106612106613106614106615106616106617106618106619106620106621106622106623106624106625106626106627106628106629106630106631106632106633106634106635106636106637106638106639106640106641106642106643106644106645106646106647106648106649106650106651106652106653106654106655106656106657106658106659106660106661106662106663106664106665106666106667106668106669106670106671106672106673106674106675106676106677106678106679106680106681106682106683106684106685106686106687106688106689106690106691106692106693106694106695106696106697106698106699106700106701106702106703106704106705106706106707106708106709106710106711106712106713106714106715106716106717106718106719106720106721106722106723106724106725106726106727106728106729106730106731106732106733106734106735106736106737106738106739106740106741106742106743106744106745106746106747106748106749106750106751106752106753106754106755106756106757106758106759106760106761106762106763106764106765106766106767106768106769106770106771106772106773106774106775106776106777106778106779106780106781106782106783106784106785106786106787106788106789106790106791106792106793106794106795106796106797106798106799106800106801106802106803106804106805106806106807106808106809106810106811106812106813106814106815106816106817106818106819106820106821106822106823106824106825106826106827106828106829106830106831106832106833106834106835106836106837106838106839106840106841106842106843106844106845106846106847106848106849106850106851106852106853106854106855106856106857106858106859106860106861106862106863106864106865106866106867106868106869106870106871106872106873106874106875106876106877106878106879106880106881106882106883106884106885106886106887106888106889106890106891106892106893106894106895106896106897106898106899106900106901106902106903106904106905106906106907106908106909106910106911106912106913106914106915106916106917106918106919106920106921106922106923106924106925106926106927106928106929106930106931106932106933106934106935106936106937106938106939106940106941106942106943106944106945106946106947106948106949106950106951106952106953106954106955106956106957106958106959106960106961106962106963106964106965106966106967106968106969106970106971106972106973106974106975106976106977106978106979106980106981106982106983106984106985106986106987106988106989106990106991106992106993106994106995106996106997106998106999107000107001107002107003107004107005107006107007107008107009107010107011107012107013107014107015107016107017107018107019107020107021107022107023107024107025107026107027107028107029107030107031107032107033107034107035107036107037107038107039107040107041107042107043107044107045107046107047107048107049107050107051107052107053107054107055107056107057107058107059107060107061107062107063107064107065107066107067107068107069107070107071107072107073107074107075107076107077107078107079107080107081107082107083107084107085107086107087107088107089107090107091107092107093107094107095107096107097107098107099107100107101107102107103107104107105107106107107107108107109107110107111107112107113107114107115107116107117107118107119107120107121107122107123107124107125107126107127107128107129107130107131107132107133107134107135107136107137107138107139107140107141107142107143107144107145107146107147107148107149107150107151107152107153107154107155107156107157107158107159107160107161107162107163107164107165107166107167107168107169107170107171107172107173107174107175107176107177107178107179107180107181107182107183107184107185107186107187107188107189107190107191107192107193107194107195107196107197107198107199107200107201107202107203107204107205107206107207107208107209107210107211107212107213107214107215107216107217107218107219107220107221107222107223107224107225107226107227107228107229107230107231107232107233107234107235107236107237107238107239107240107241107242107243107244107245107246107247107248107249107250107251107252107253107254107255107256107257107258107259107260107261107262107263107264107265107266107267107268107269107270107271107272107273107274107275107276107277107278107279107280107281107282107283107284107285107286107287107288107289107290107291107292107293107294107295107296107297107298107299107300107301107302107303107304107305107306107307107308107309107310107311107312107313107314107315107316107317107318107319107320107321107322107323107324107325107326107327107328107329107330107331107332107333107334107335107336107337107338107339107340107341107342107343107344107345107346107347107348107349107350107351107352107353107354107355107356107357107358107359107360107361107362107363107364107365107366107367107368107369107370107371107372107373107374107375107376107377107378107379107380107381107382107383107384107385107386107387107388107389107390107391107392107393107394107395107396107397107398107399107400107401107402107403107404107405107406107407107408107409107410107411107412107413107414107415107416107417107418107419107420107421107422107423107424107425107426107427107428107429107430107431107432107433107434107435107436107437107438107439107440107441107442107443107444107445107446107447107448107449107450107451107452107453107454107455107456107457107458107459107460107461107462107463107464107465107466107467107468107469107470107471107472107473107474107475107476107477107478107479107480107481107482107483107484107485107486107487107488107489107490107491107492107493107494107495107496107497107498107499107500107501107502107503107504107505107506107507107508107509107510107511107512107513107514107515107516107517107518107519107520107521107522107523107524107525107526107527107528107529107530107531107532107533107534107535107536107537107538107539107540107541107542107543107544107545107546107547107548107549107550107551107552107553107554107555107556107557107558107559107560107561107562107563107564107565107566107567107568107569107570107571107572107573107574107575107576107577107578107579107580107581107582107583107584107585107586107587107588107589107590107591107592107593107594107595107596107597107598107599107600107601107602107603107604107605107606107607107608107609107610107611107612107613107614107615107616107617107618107619107620107621107622107623107624107625107626107627107628107629107630107631107632107633107634107635107636107637107638107639107640107641107642107643107644107645107646107647107648107649107650107651107652107653107654107655107656107657107658107659107660107661107662107663107664107665107666107667107668107669107670107671107672107673107674107675107676107677107678107679107680107681107682107683107684107685107686107687107688107689107690107691107692107693107694107695107696107697107698107699107700107701107702107703107704107705107706107707107708107709107710107711107712107713107714107715107716107717107718107719107720107721107722107723107724107725107726107727107728107729107730107731107732107733107734107735107736107737107738107739107740107741107742107743107744107745107746107747107748107749107750107751107752107753107754107755107756107757107758107759107760107761107762107763107764107765107766107767107768107769107770107771107772107773107774107775107776107777107778107779107780107781107782107783107784107785107786107787107788107789107790107791107792107793107794107795107796107797107798107799107800107801107802107803107804107805107806107807107808107809107810107811107812107813107814107815107816107817107818107819107820107821107822107823107824107825107826107827107828107829107830107831107832107833107834107835107836107837107838107839107840107841107842107843107844107845107846107847107848107849107850107851107852107853107854107855107856107857107858107859107860107861107862107863107864107865107866107867107868107869107870107871107872107873107874107875107876107877107878107879107880107881107882107883107884107885107886107887107888107889107890107891107892107893107894107895107896107897107898107899107900107901107902107903107904107905107906107907107908107909107910107911107912107913107914107915107916107917107918107919107920107921107922107923107924107925107926107927107928107929107930107931107932107933107934107935107936107937107938107939107940107941107942107943107944107945107946107947107948107949107950107951107952107953107954107955107956107957107958107959107960107961107962107963107964107965107966107967107968107969107970107971107972107973107974107975107976107977107978107979107980107981107982107983107984107985107986107987107988107989107990107991107992107993107994107995107996107997107998107999108000108001108002108003108004108005108006108007108008108009108010108011108012108013108014108015108016108017108018108019108020108021108022108023108024108025108026108027108028108029108030108031108032108033108034108035108036108037108038108039108040108041108042108043108044108045108046108047108048108049108050108051108052108053108054108055108056108057108058108059108060108061108062108063108064108065108066108067108068108069108070108071108072108073108074108075108076108077108078108079108080108081108082108083108084108085108086108087108088108089108090108091108092108093108094108095108096108097108098108099108100108101108102108103108104108105108106108107108108108109108110108111108112108113108114108115108116108117108118108119108120108121108122108123108124108125108126108127108128108129108130108131108132108133108134108135108136108137108138108139108140108141108142108143108144108145108146108147108148108149108150108151108152108153108154108155108156108157108158108159108160108161108162108163108164108165108166108167108168108169108170108171108172108173108174108175108176108177108178108179108180108181108182108183108184108185108186108187108188108189108190108191108192108193108194108195108196108197108198108199108200108201108202108203108204108205108206108207108208108209108210108211108212108213108214108215108216108217108218108219108220108221108222108223108224108225108226108227108228108229108230108231108232108233108234108235108236108237108238108239108240108241108242108243108244108245108246108247108248108249108250108251108252108253108254108255108256108257108258108259108260108261108262108263108264108265108266108267108268108269108270108271108272108273108274108275108276108277108278108279108280108281108282108283108284108285108286108287108288108289108290108291108292108293108294108295108296108297108298108299108300108301108302108303108304108305108306108307108308108309108310108311108312108313108314108315108316108317108318108319108320108321108322108323108324108325108326108327108328108329108330108331108332108333108334108335108336108337108338108339108340108341108342108343108344108345108346108347108348108349108350108351108352108353108354108355108356108357108358108359108360108361108362108363108364108365108366108367108368108369108370108371108372108373108374108375108376108377108378108379108380108381108382108383108384108385108386108387108388108389108390108391108392108393108394108395108396108397108398108399108400108401108402108403108404108405108406108407108408108409108410108411108412108413108414108415108416108417108418108419108420108421108422108423108424108425108426108427108428108429108430108431108432108433108434108435108436108437108438108439108440108441108442108443108444108445108446108447108448108449108450108451108452108453108454108455108456108457108458108459108460108461108462108463108464108465108466108467108468108469108470108471108472108473108474108475108476108477108478108479108480108481108482108483108484108485108486108487108488108489108490108491108492108493108494108495108496108497108498108499108500108501108502108503108504108505108506108507108508108509108510108511108512108513108514108515108516108517108518108519108520108521108522108523108524108525108526108527108528108529108530108531108532108533108534108535108536108537108538108539108540108541108542108543108544108545108546108547108548108549108550108551108552108553108554108555108556108557108558108559108560108561108562108563108564108565108566108567108568108569108570108571108572108573108574108575108576108577108578108579108580108581108582108583108584108585108586108587108588108589108590108591108592108593108594108595108596108597108598108599108600108601108602108603108604108605108606108607108608108609108610108611108612108613108614108615108616108617108618108619108620108621108622108623108624108625108626108627108628108629108630108631108632108633108634108635108636108637108638108639108640108641108642108643108644108645108646108647108648108649108650108651108652108653108654108655108656108657108658108659108660108661108662108663108664108665108666108667108668108669108670108671108672108673108674108675108676108677108678108679108680108681108682108683108684108685108686108687108688108689108690108691108692108693108694108695108696108697108698108699108700108701108702108703108704108705108706108707108708108709108710108711108712108713108714108715108716108717108718108719108720108721108722108723108724108725108726108727108728108729108730108731108732108733108734108735108736108737108738108739108740108741108742108743108744108745108746108747108748108749108750108751108752108753108754108755108756108757108758108759108760108761108762108763108764108765108766108767108768108769108770108771108772108773108774108775108776108777108778108779108780108781108782108783108784108785108786108787108788108789108790108791108792108793108794108795108796108797108798108799108800108801108802108803108804108805108806108807108808108809108810108811108812108813108814108815108816108817108818108819108820108821108822108823108824108825108826108827108828108829108830108831108832108833108834108835108836108837108838108839108840108841108842108843108844108845108846108847108848108849108850108851108852108853108854108855108856108857108858108859108860108861108862108863108864108865108866108867108868108869108870108871108872108873108874108875108876108877108878108879108880108881108882108883108884108885108886108887108888108889108890108891108892108893108894108895108896108897108898108899108900108901108902108903108904108905108906108907108908108909108910108911108912108913108914108915108916108917108918108919108920108921108922108923108924108925108926108927108928108929108930108931108932108933108934108935108936108937108938108939108940108941108942108943108944108945108946108947108948108949108950108951108952108953108954108955108956108957108958108959108960108961108962108963108964108965108966108967108968108969108970108971108972108973108974108975108976108977108978108979108980108981108982108983108984108985108986108987108988108989108990108991108992108993108994108995108996108997108998108999109000109001109002109003109004109005109006109007109008109009109010109011109012109013109014109015109016109017109018109019109020109021109022109023109024109025109026109027109028109029109030109031109032109033109034109035109036109037109038109039109040109041109042109043109044109045109046109047109048109049109050109051109052109053109054109055109056109057109058109059109060109061109062109063109064109065109066109067109068109069109070109071109072109073109074109075109076109077109078109079109080109081109082109083109084109085109086109087109088109089109090109091109092109093109094109095109096109097109098109099109100109101109102109103109104109105109106109107109108109109109110109111109112109113109114109115109116109117109118109119109120109121109122109123109124109125109126109127109128109129109130109131109132109133109134109135109136109137109138109139109140109141109142109143109144109145109146109147109148109149109150109151109152109153109154109155109156109157109158109159109160109161109162109163109164109165109166109167109168109169109170109171109172109173109174109175109176109177109178109179109180109181109182109183109184109185109186109187109188109189109190109191109192109193109194109195109196109197109198109199109200109201109202109203109204109205109206109207109208109209109210109211109212109213109214109215109216109217109218109219109220109221109222109223109224109225109226109227109228109229109230109231109232109233109234109235109236109237109238109239109240109241109242109243109244109245109246109247109248109249109250109251109252109253109254109255109256109257109258109259109260109261109262109263109264109265109266109267109268109269109270109271109272109273109274109275109276109277109278109279109280109281109282109283109284109285109286109287109288109289109290109291109292109293109294109295109296109297109298109299109300109301109302109303109304109305109306109307109308109309109310109311109312109313109314109315109316109317109318109319109320109321109322109323109324109325109326109327109328109329109330109331109332109333109334109335109336109337109338109339109340109341109342109343109344109345109346109347109348109349109350109351109352109353109354109355109356109357109358109359109360109361109362109363109364109365109366109367109368109369109370109371109372109373109374109375109376109377109378109379109380109381109382109383109384109385109386109387109388109389109390109391109392109393109394109395109396109397109398109399109400109401109402109403109404109405109406109407109408109409109410109411109412109413109414109415109416109417109418109419109420109421109422109423109424109425109426109427109428109429109430109431109432109433109434109435109436109437109438109439109440109441109442109443109444109445109446109447109448109449109450109451109452109453109454109455109456109457109458109459109460109461109462109463109464109465109466109467109468109469109470109471109472109473109474109475109476109477109478109479109480109481109482109483109484109485109486109487109488109489109490109491109492109493109494109495109496109497109498109499109500109501109502109503109504109505109506109507109508109509109510109511109512109513109514109515109516109517109518109519109520109521109522109523109524109525109526109527109528109529109530109531109532109533109534109535109536109537109538109539109540109541109542109543109544109545109546109547109548109549109550109551109552109553109554109555109556109557109558109559109560109561109562109563109564109565109566109567109568109569109570109571109572109573109574109575109576109577109578109579109580109581109582109583109584109585109586109587109588109589109590109591109592109593109594109595109596109597109598109599109600109601109602109603109604109605109606109607109608109609109610109611109612109613109614109615109616109617109618109619109620109621109622109623109624109625109626109627109628109629109630109631109632109633109634109635109636109637109638109639109640109641109642109643109644109645109646109647109648109649109650109651109652109653109654109655109656109657109658109659109660109661109662109663109664109665109666109667109668109669109670109671109672109673109674109675109676109677109678109679109680109681109682109683109684109685109686109687109688109689109690109691109692109693109694109695109696109697109698109699109700109701109702109703109704109705109706109707109708109709109710109711109712109713109714109715109716109717109718109719109720109721109722109723109724109725109726109727109728109729109730109731109732109733109734109735109736109737109738109739109740109741109742109743109744109745109746109747109748109749109750109751109752109753109754109755109756109757109758109759109760109761109762109763109764109765109766109767109768109769109770109771109772109773109774109775109776109777109778109779109780109781109782109783109784109785109786109787109788109789109790109791109792109793109794109795109796109797109798109799109800109801109802109803109804109805109806109807109808109809109810109811109812109813109814109815109816109817109818109819109820109821109822109823109824109825109826109827109828109829109830109831109832109833109834109835109836109837109838109839109840109841109842109843109844109845109846109847109848109849109850109851109852109853109854109855109856109857109858109859109860109861109862109863109864109865109866109867109868109869109870109871109872109873109874109875109876109877109878109879109880109881109882109883109884109885109886109887109888109889109890109891109892109893109894109895109896109897109898109899109900109901109902109903109904109905109906109907109908109909109910109911109912109913109914109915109916109917109918109919109920109921109922109923109924109925109926109927109928109929109930109931109932109933109934109935109936109937109938109939109940109941109942109943109944109945109946109947109948109949109950109951109952109953109954109955109956109957109958109959109960109961109962109963109964109965109966109967109968109969109970109971109972109973109974109975109976109977109978109979109980109981109982109983109984109985109986109987109988109989109990109991109992109993109994109995109996109997109998109999110000110001110002110003110004110005110006110007110008110009110010110011110012110013110014110015110016110017110018110019110020110021110022110023110024110025110026110027110028110029110030110031110032110033110034110035110036110037110038110039110040110041110042110043110044110045110046110047110048110049110050110051110052110053110054110055110056110057110058110059110060110061110062110063110064110065110066110067110068110069110070110071110072110073110074110075110076110077110078110079110080110081110082110083110084110085110086110087110088110089110090110091110092110093110094110095110096110097110098110099110100110101110102110103110104110105110106110107110108110109110110110111110112110113110114110115110116110117110118110119110120110121110122110123110124110125110126110127110128110129110130110131110132110133110134110135110136110137110138110139110140110141110142110143110144110145110146110147110148110149110150110151110152110153110154110155110156110157110158110159110160110161110162110163110164110165110166110167110168110169110170110171110172110173110174110175110176110177110178110179110180110181110182110183110184110185110186110187110188110189110190110191110192110193110194110195110196110197110198110199110200110201110202110203110204110205110206110207110208110209110210110211110212110213110214110215110216110217110218110219110220110221110222110223110224110225110226110227110228110229110230110231110232110233110234110235110236110237110238110239110240110241110242110243110244110245110246110247110248110249110250110251110252110253110254110255110256110257110258110259110260110261110262110263110264110265110266110267110268110269110270110271110272110273110274110275110276110277110278110279110280110281110282110283110284110285110286110287110288110289110290110291110292110293110294110295110296110297110298110299110300110301110302110303110304110305110306110307110308110309110310110311110312110313110314110315110316110317110318110319110320110321110322110323110324110325110326110327110328110329110330110331110332110333110334110335110336110337110338110339110340110341110342110343110344110345110346110347110348110349110350110351110352110353110354110355110356110357110358110359110360110361110362110363110364110365110366110367110368110369110370110371110372110373110374110375110376110377110378110379110380110381110382110383110384110385110386110387110388110389110390110391110392110393110394110395110396110397110398110399110400110401110402110403110404110405110406110407110408110409110410110411110412110413110414110415110416110417110418110419110420110421110422110423110424110425110426110427110428110429110430110431110432110433110434110435110436110437110438110439110440110441110442110443110444110445110446110447110448110449110450110451110452110453110454110455110456110457110458110459110460110461110462110463110464110465110466110467110468110469110470110471110472110473110474110475110476110477110478110479110480110481110482110483110484110485110486110487110488110489110490110491110492110493110494110495110496110497110498110499110500110501110502110503110504110505110506110507110508110509110510110511110512110513110514110515110516110517110518110519110520110521110522110523110524110525110526110527110528110529110530110531110532110533110534110535110536110537110538110539110540110541110542110543110544110545110546110547110548110549110550110551110552110553110554110555110556110557110558110559110560110561110562110563110564110565110566110567110568110569110570110571110572110573110574110575110576110577110578110579110580110581110582110583110584110585110586110587110588110589110590110591110592110593110594110595110596110597110598110599110600110601110602110603110604110605110606110607110608110609110610110611110612110613110614110615110616110617110618110619110620110621110622110623110624110625110626110627110628110629110630110631110632110633110634110635110636110637110638110639110640110641110642110643110644110645110646110647110648110649110650110651110652110653110654110655110656110657110658110659110660110661110662110663110664110665110666110667110668110669110670110671110672110673110674110675110676110677110678110679110680110681110682110683110684110685110686110687110688110689110690110691110692110693110694110695110696110697110698110699110700110701110702110703110704110705110706110707110708110709110710110711110712110713110714110715110716110717110718110719110720110721110722110723110724110725110726110727110728110729110730110731110732110733110734110735110736110737110738110739110740110741110742110743110744110745110746110747110748110749110750110751110752110753110754110755110756110757110758110759110760110761110762110763110764110765110766110767110768110769110770110771110772110773110774110775110776110777110778110779110780110781110782110783110784110785110786110787110788110789110790110791110792110793110794110795110796110797110798110799110800110801110802110803110804110805110806110807110808110809110810110811110812110813110814110815110816110817110818110819110820110821110822110823110824110825110826110827110828110829110830110831110832110833110834110835110836110837110838110839110840110841110842110843110844110845110846110847110848110849110850110851110852110853110854110855110856110857110858110859110860110861110862110863110864110865110866110867110868110869110870110871110872110873110874110875110876110877110878110879110880110881110882110883110884110885110886110887110888110889110890110891110892110893110894110895110896110897110898110899110900110901110902110903110904110905110906110907110908110909110910110911110912110913110914110915110916110917110918110919110920110921110922110923110924110925110926110927110928110929110930110931110932110933110934110935110936110937110938110939110940110941110942110943110944110945110946110947110948110949110950110951110952110953110954110955110956110957110958110959110960110961110962110963110964110965110966110967110968110969110970110971110972110973110974110975110976110977110978110979110980110981110982110983110984110985110986110987110988110989110990110991110992110993110994110995110996110997110998110999111000111001111002111003111004111005111006111007111008111009111010111011111012111013111014111015111016111017111018111019111020111021111022111023111024111025111026111027111028111029111030111031111032111033111034111035111036111037111038111039111040111041111042111043111044111045111046111047111048111049111050111051111052111053111054111055111056111057111058111059111060111061111062111063111064111065111066111067111068111069111070111071111072111073111074111075111076111077111078111079111080111081111082111083111084111085111086111087111088111089111090111091111092111093111094111095111096111097111098111099111100111101111102111103111104111105111106111107111108111109111110111111111112111113111114111115111116111117111118111119111120111121111122111123111124111125111126111127111128111129111130111131111132111133111134111135111136111137111138111139111140111141111142111143111144111145111146111147111148111149111150111151111152111153111154111155111156111157111158111159111160111161111162111163111164111165111166111167111168111169111170111171111172111173111174111175111176111177111178111179111180111181111182111183111184111185111186111187111188111189111190111191111192111193111194111195111196111197111198111199111200111201111202111203111204111205111206111207111208111209111210111211111212111213111214111215111216111217111218111219111220111221111222111223111224111225111226111227111228111229111230111231111232111233111234111235111236111237111238111239111240111241111242111243111244111245111246111247111248111249111250111251111252111253111254111255111256111257111258111259111260111261111262111263111264111265111266111267111268111269111270111271111272111273111274111275111276111277111278111279111280111281111282111283111284111285111286111287111288111289111290111291111292111293111294111295111296111297111298111299111300111301111302111303111304111305111306111307111308111309111310111311111312111313111314111315111316111317111318111319111320111321111322111323111324111325111326111327111328111329111330111331111332111333111334111335111336111337111338111339111340111341111342111343111344111345111346111347111348111349111350111351111352111353111354111355111356111357111358111359111360111361111362111363111364111365111366111367111368111369111370111371111372111373111374111375111376111377111378111379111380111381111382111383111384111385111386111387111388111389111390111391111392111393111394111395111396111397111398111399111400111401111402111403111404111405111406111407111408111409111410111411111412111413111414111415111416111417111418111419111420111421111422111423111424111425111426111427111428111429111430111431111432111433111434111435111436111437111438111439111440111441111442111443111444111445111446111447111448111449111450111451111452111453111454111455111456111457111458111459111460111461111462111463111464111465111466111467111468111469111470111471111472111473111474111475111476111477111478111479111480111481111482111483111484111485111486111487111488111489111490111491111492111493111494111495111496111497111498111499111500111501111502111503111504111505111506111507111508111509111510111511111512111513111514111515111516111517111518111519111520111521111522111523111524111525111526111527111528111529111530111531111532111533111534111535111536111537111538111539111540111541111542111543111544111545111546111547111548111549111550111551111552111553111554111555111556111557111558111559111560111561111562111563111564111565111566111567111568111569111570111571111572111573111574111575111576111577111578111579111580111581111582111583111584111585111586111587111588111589111590111591111592111593111594111595111596111597111598111599111600111601111602111603111604111605111606111607111608111609111610111611111612111613111614111615111616111617111618111619111620111621111622111623111624111625111626111627111628111629111630111631111632111633111634111635111636111637111638111639111640111641111642111643111644111645111646111647111648111649111650111651111652111653111654111655111656111657111658111659111660111661111662111663111664111665111666111667111668111669111670111671111672111673111674111675111676111677111678111679111680111681111682111683111684111685111686111687111688111689111690111691111692111693111694111695111696111697111698111699111700111701111702111703111704111705111706111707111708111709111710111711111712111713111714111715111716111717111718111719111720111721111722111723111724111725111726111727111728111729111730111731111732111733111734111735111736111737111738111739111740111741111742111743111744111745111746111747111748111749111750111751111752111753111754111755111756111757111758111759111760111761111762111763111764111765111766111767111768111769111770111771111772111773111774111775111776111777111778111779111780111781111782111783111784111785111786111787111788111789111790111791111792111793111794111795111796111797111798111799111800111801111802111803111804111805111806111807111808111809111810111811111812111813111814111815111816111817111818111819111820111821111822111823111824111825111826111827111828111829111830111831111832111833111834111835111836111837111838111839111840111841111842111843111844111845111846111847111848111849111850111851111852111853111854111855111856111857111858111859111860111861111862111863111864111865111866111867111868111869111870111871111872111873111874111875111876111877111878111879111880111881111882111883111884111885111886111887111888111889111890111891111892111893111894111895111896111897111898111899111900111901111902111903111904111905111906111907111908111909111910111911111912111913111914111915111916111917111918111919111920111921111922111923111924111925111926111927111928111929111930111931111932111933111934111935111936111937111938111939111940111941111942111943111944111945111946111947111948111949111950111951111952111953111954111955111956111957111958111959111960111961111962111963111964111965111966111967111968111969111970111971111972111973111974111975111976111977111978111979111980111981111982111983111984111985111986111987111988111989111990111991111992111993111994111995111996111997111998111999112000112001112002112003112004112005112006112007112008112009112010112011112012112013112014112015112016112017112018112019112020112021112022112023112024112025112026112027112028112029112030112031112032112033112034112035112036112037112038112039112040112041112042112043112044112045112046112047112048112049112050112051112052112053112054112055112056112057112058112059112060112061112062112063112064112065112066112067112068112069112070112071112072112073112074112075112076112077112078112079112080112081112082112083112084112085112086112087112088112089112090112091112092112093112094112095112096112097112098112099112100112101112102112103112104112105112106112107112108112109112110112111112112112113112114112115112116112117112118112119112120112121112122112123112124112125112126112127112128112129112130112131112132112133112134112135112136112137112138112139112140112141112142112143112144112145112146112147112148112149112150112151112152112153112154112155112156112157112158112159112160112161112162112163112164112165112166112167112168112169112170112171112172112173112174112175112176112177112178112179112180112181112182112183112184112185112186112187112188112189112190112191112192112193112194112195112196112197112198112199112200112201112202112203112204112205112206112207112208112209112210112211112212112213112214112215112216112217112218112219112220112221112222112223112224112225112226112227112228112229112230112231112232112233112234112235112236112237112238112239112240112241112242112243112244112245112246112247112248112249112250112251112252112253112254112255112256112257112258112259112260112261112262112263112264112265112266112267112268112269112270112271112272112273112274112275112276112277112278112279112280112281112282112283112284112285112286112287112288112289112290112291112292112293112294112295112296112297112298112299112300112301112302112303112304112305112306112307112308112309112310112311112312112313112314112315112316112317112318112319112320112321112322112323112324112325112326112327112328112329112330112331112332112333112334112335112336112337112338112339112340112341112342112343112344112345112346112347112348112349112350112351112352112353112354112355112356112357112358112359112360112361112362112363112364112365112366112367112368112369112370112371112372112373112374112375112376112377112378112379112380112381112382112383112384112385112386112387112388112389112390112391112392112393112394112395112396112397112398112399112400112401112402112403112404112405112406112407112408112409112410112411112412112413112414112415112416112417112418112419112420112421112422112423112424112425112426112427112428112429112430112431112432112433112434112435112436112437112438112439112440112441112442112443112444112445112446112447112448112449112450112451112452112453112454112455112456112457112458112459112460112461112462112463112464112465112466112467112468112469112470112471112472112473112474112475112476112477112478112479112480112481112482112483112484112485112486112487112488112489112490112491112492112493112494112495112496112497112498112499112500112501112502112503112504112505112506112507112508112509112510112511112512112513112514112515112516112517112518112519112520112521112522112523112524112525112526112527112528112529112530112531112532112533112534112535112536112537112538112539112540112541112542112543112544112545112546112547112548112549112550112551112552112553112554112555112556112557112558112559112560112561112562112563112564112565112566112567112568112569112570112571112572112573112574112575112576112577112578112579112580112581112582112583112584112585112586112587112588112589112590112591112592112593112594112595112596112597112598112599112600112601112602112603112604112605112606112607112608112609112610112611112612112613112614112615112616112617112618112619112620112621112622112623112624112625112626112627112628112629112630112631112632112633112634112635112636112637112638112639112640112641112642112643112644112645112646112647112648112649112650112651112652112653112654112655112656112657112658112659112660112661112662112663112664112665112666112667112668112669112670112671112672112673112674112675112676112677112678112679112680112681112682112683112684112685112686112687112688112689112690112691112692112693112694112695112696112697112698112699112700112701112702112703112704112705112706112707112708112709112710112711112712112713112714112715112716112717112718112719112720112721112722112723112724112725112726112727112728112729112730112731112732112733112734112735112736112737112738112739112740112741112742112743112744112745112746112747112748112749112750112751112752112753112754112755112756112757112758112759112760112761112762112763112764112765112766112767112768112769112770112771112772112773112774112775112776112777112778112779112780112781112782112783112784112785112786112787112788112789112790112791112792112793112794112795112796112797112798112799112800112801112802112803112804112805112806112807112808112809112810112811112812112813112814112815112816112817112818112819112820112821112822112823112824112825112826112827112828112829112830112831112832112833112834112835112836112837112838112839112840112841112842112843112844112845112846112847112848112849112850112851112852112853112854112855112856112857112858112859112860112861112862112863112864112865112866112867112868112869112870112871112872112873112874112875112876112877112878112879112880112881112882112883112884112885112886112887112888112889112890112891112892112893112894112895112896112897112898112899112900112901112902112903112904112905112906112907112908112909112910112911112912112913112914112915112916112917112918112919112920112921112922112923112924112925112926112927112928112929112930112931112932112933112934112935112936112937112938112939112940112941112942112943112944112945112946112947112948112949112950112951112952112953112954112955112956112957112958112959112960112961112962112963112964112965112966112967112968112969112970112971112972112973112974112975112976112977112978112979112980112981112982112983112984112985112986112987112988112989112990112991112992112993112994112995112996112997112998112999113000113001113002113003113004113005113006113007113008113009113010113011113012113013113014113015113016113017113018113019113020113021113022113023113024113025113026113027113028113029113030113031113032113033113034113035113036113037113038113039113040113041113042113043113044113045113046113047113048113049113050113051113052113053113054113055113056113057113058113059113060113061113062113063113064113065113066113067113068113069113070113071113072113073113074113075113076113077113078113079113080113081113082113083113084113085113086113087113088113089113090113091113092113093113094113095113096113097113098113099113100113101113102113103113104113105113106113107113108113109113110113111113112113113113114113115113116113117113118113119113120113121113122113123113124113125113126113127113128113129113130113131113132113133113134113135113136113137113138113139113140113141113142113143113144113145113146113147113148113149113150113151113152113153113154113155113156113157113158113159113160113161113162113163113164113165113166113167113168113169113170113171113172113173113174113175113176113177113178113179113180113181113182113183113184113185113186113187113188113189113190113191113192113193113194113195113196113197113198113199113200113201113202113203113204113205113206113207113208113209113210113211113212113213113214113215113216113217113218113219113220113221113222113223113224113225113226113227113228113229113230113231113232113233113234113235113236113237113238113239113240113241113242113243113244113245113246113247113248113249113250113251113252113253113254113255113256113257113258113259113260113261113262113263113264113265113266113267113268113269113270113271113272113273113274113275113276113277113278113279113280113281113282113283113284113285113286113287113288113289113290113291113292113293113294113295113296113297113298113299113300113301113302113303113304113305113306113307113308113309113310113311113312113313113314113315113316113317113318113319113320113321113322113323113324113325113326113327113328113329113330113331113332113333113334113335113336113337113338113339113340113341113342113343113344113345113346113347113348113349113350113351113352113353113354113355113356113357113358113359113360113361113362113363113364113365113366113367113368113369113370113371113372113373113374113375113376113377113378113379113380113381113382113383113384113385113386113387113388113389113390113391113392113393113394113395113396113397113398113399113400113401113402113403113404113405113406113407113408113409113410113411113412113413113414113415113416113417113418113419113420113421113422113423113424113425113426113427113428113429113430113431113432113433113434113435113436113437113438113439113440113441113442113443113444113445113446113447113448113449113450113451113452113453113454113455113456113457113458113459113460113461113462113463113464113465113466113467113468113469113470113471113472113473113474113475113476113477113478113479113480113481113482113483113484113485113486113487113488113489113490113491113492113493113494113495113496113497113498113499113500113501113502113503113504113505113506113507113508113509113510113511113512113513113514113515113516113517113518113519113520113521113522113523113524113525113526113527113528113529113530113531113532113533113534113535113536113537113538113539113540113541113542113543113544113545113546113547113548113549113550113551113552113553113554113555113556113557113558113559113560113561113562113563113564113565113566113567113568113569113570113571113572113573113574113575113576113577113578113579113580113581113582113583113584113585113586113587113588113589113590113591113592113593113594113595113596113597113598113599113600113601113602113603113604113605113606113607113608113609113610113611113612113613113614113615113616113617113618113619113620113621113622113623113624113625113626113627113628113629113630113631113632113633113634113635113636113637113638113639113640113641113642113643113644113645113646113647113648113649113650113651113652113653113654113655113656113657113658113659113660113661113662113663113664113665113666113667113668113669113670113671113672113673113674113675113676113677113678113679113680113681113682113683113684113685113686113687113688113689113690113691113692113693113694113695113696113697113698113699113700113701113702113703113704113705113706113707113708113709113710113711113712113713113714113715113716113717113718113719113720113721113722113723113724113725113726113727113728113729113730113731113732113733113734113735113736113737113738113739113740113741113742113743113744113745113746113747113748113749113750113751113752113753113754113755113756113757113758113759113760113761113762113763113764113765113766113767113768113769113770113771113772113773113774113775113776113777113778113779113780113781113782113783113784113785113786113787113788113789113790113791113792113793113794113795113796113797113798113799113800113801113802113803113804113805113806113807113808113809113810113811113812113813113814113815113816113817113818113819113820113821113822113823113824113825113826113827113828113829113830113831113832113833113834113835113836113837113838113839113840113841113842113843113844113845113846113847113848113849113850113851113852113853113854113855113856113857113858113859113860113861113862113863113864113865113866113867113868113869113870113871113872113873113874113875113876113877113878113879113880113881113882113883113884113885113886113887113888113889113890113891113892113893113894113895113896113897113898113899113900113901113902113903113904113905113906113907113908113909113910113911113912113913113914113915113916113917113918113919113920113921113922113923113924113925113926113927113928113929113930113931113932113933113934113935113936113937113938113939113940113941113942113943113944113945113946113947113948113949113950113951113952113953113954113955113956113957113958113959113960113961113962113963113964113965113966113967113968113969113970113971113972113973113974113975113976113977113978113979113980113981113982113983113984113985113986113987113988113989113990113991113992113993113994113995113996113997113998113999114000114001114002114003114004114005114006114007114008114009114010114011114012114013114014114015114016114017114018114019114020114021114022114023114024114025114026114027114028114029114030114031114032114033114034114035114036114037114038114039114040114041114042114043114044114045114046114047114048114049114050114051114052114053114054114055114056114057114058114059114060114061114062114063114064114065114066114067114068114069114070114071114072114073114074114075114076114077114078114079114080114081114082114083114084114085114086114087114088114089114090114091114092114093114094114095114096114097114098114099114100114101114102114103114104114105114106114107114108114109114110114111114112114113114114114115114116114117114118114119114120114121114122114123114124114125114126114127114128114129114130114131114132114133114134114135114136114137114138114139114140114141114142114143114144114145114146114147114148114149114150114151114152114153114154114155114156114157114158114159114160114161114162114163114164114165114166114167114168114169114170114171114172114173114174114175114176114177114178114179114180114181114182114183114184114185114186114187114188114189114190114191114192114193114194114195114196114197114198114199114200114201114202114203114204114205114206114207114208114209114210114211114212114213114214114215114216114217114218114219114220114221114222114223114224114225114226114227114228114229114230114231114232114233114234114235114236114237114238114239114240114241114242114243114244114245114246114247114248114249114250114251114252114253114254114255114256114257114258114259114260114261114262114263114264114265114266114267114268114269114270114271114272114273114274114275114276114277114278114279114280114281114282114283114284114285114286114287114288114289114290114291114292114293114294114295114296114297114298114299114300114301114302114303114304114305114306114307114308114309114310114311114312114313114314114315114316114317114318114319114320114321114322114323114324114325114326114327114328114329114330114331114332114333114334114335114336114337114338114339114340114341114342114343114344114345114346114347114348114349114350114351114352114353114354114355114356114357114358114359114360114361114362114363114364114365114366114367114368114369114370114371114372114373114374114375114376114377114378114379114380114381114382114383114384114385114386114387114388114389114390114391114392114393114394114395114396114397114398114399114400114401114402114403114404114405114406114407114408114409114410114411114412114413114414114415114416114417114418114419114420114421114422114423114424114425114426114427114428114429114430114431114432114433114434114435114436114437114438114439114440114441114442114443114444114445114446114447114448114449114450114451114452114453114454114455114456114457114458114459114460114461114462114463114464114465114466114467114468114469114470114471114472114473114474114475114476114477114478114479114480114481114482114483114484114485114486114487114488114489114490114491114492114493114494114495114496114497114498114499114500114501114502114503114504114505114506114507114508114509114510114511114512114513114514114515114516114517114518114519114520114521114522114523114524114525114526114527114528114529114530114531114532114533114534114535114536114537114538114539114540114541114542114543114544114545114546114547114548114549114550114551114552114553114554114555114556114557114558114559114560114561114562114563114564114565114566114567114568114569114570114571114572114573114574114575114576114577114578114579114580114581114582114583114584114585114586114587114588114589114590114591114592114593114594114595114596114597114598114599114600114601114602114603114604114605114606114607114608114609114610114611114612114613114614114615114616114617114618114619114620114621114622114623114624114625114626114627114628114629114630114631114632114633114634114635114636114637114638114639114640114641114642114643114644114645114646114647114648114649114650114651114652114653114654114655114656114657114658114659114660114661114662114663114664114665114666114667114668114669114670114671114672114673114674114675114676114677114678114679114680114681114682114683114684114685114686114687114688114689114690114691114692114693114694114695114696114697114698114699114700114701114702114703114704114705114706114707114708114709114710114711114712114713114714114715114716114717114718114719114720114721114722114723114724114725114726114727114728114729114730114731114732114733114734114735114736114737114738114739114740114741114742114743114744114745114746114747114748114749114750114751114752114753114754114755114756114757114758114759114760114761114762114763114764114765114766114767114768114769114770114771114772114773114774114775114776114777114778114779114780114781114782114783114784114785114786114787114788114789114790114791114792114793114794114795114796114797114798114799114800114801114802114803114804114805114806114807114808114809114810114811114812114813114814114815114816114817114818114819114820114821114822114823114824114825114826114827114828114829114830114831114832114833114834114835114836114837114838114839114840114841114842114843114844114845114846114847114848114849114850114851114852114853114854114855114856114857114858114859114860114861114862114863114864114865114866114867114868114869114870114871114872114873114874114875114876114877114878114879114880114881114882114883114884114885114886114887114888114889114890114891114892114893114894114895114896114897114898114899114900114901114902114903114904114905114906114907114908114909114910114911114912114913114914114915114916114917114918114919114920114921114922114923114924114925114926114927114928114929114930114931114932114933114934114935114936114937114938114939114940114941114942114943114944114945114946114947114948114949114950114951114952114953114954114955114956114957114958114959114960114961114962114963114964114965114966114967114968114969114970114971114972114973114974114975114976114977114978114979114980114981114982114983114984114985114986114987114988114989114990114991114992114993114994114995114996114997114998114999115000115001115002115003115004115005115006115007115008115009115010115011115012115013115014115015115016115017115018115019115020115021115022115023115024115025115026115027115028115029115030115031115032115033115034115035115036115037115038115039115040115041115042115043115044115045115046115047115048115049115050115051115052115053115054115055115056115057115058115059115060115061115062115063115064115065115066115067115068115069115070115071115072115073115074115075115076115077115078115079115080115081115082115083115084115085115086115087115088115089115090115091115092115093115094115095115096115097115098115099115100115101115102115103115104115105115106115107115108115109115110115111115112115113115114115115115116115117115118115119115120115121115122115123115124115125115126115127115128115129115130115131115132115133115134115135115136115137115138115139115140115141115142115143115144115145115146115147115148115149115150115151115152115153115154115155115156115157115158115159115160115161115162115163115164115165115166115167115168115169115170115171115172115173115174115175115176115177115178115179115180115181115182115183115184115185115186115187115188115189115190115191115192115193115194115195115196115197115198115199115200115201115202115203115204115205115206115207115208115209115210115211115212115213115214115215115216115217115218115219115220115221115222115223115224115225115226115227115228115229115230115231115232115233115234115235115236115237115238115239115240115241115242115243115244115245115246115247115248115249115250115251115252115253115254115255115256115257115258115259115260115261115262115263115264115265115266115267115268115269115270115271115272115273115274115275115276115277115278115279115280115281115282115283115284115285115286115287115288115289115290115291115292115293115294115295115296115297115298115299115300115301115302115303115304115305115306115307115308115309115310115311115312115313115314115315115316115317115318115319115320115321115322115323115324115325115326115327115328115329115330115331115332115333115334115335115336115337115338115339115340115341115342115343115344115345115346115347115348115349115350115351115352115353115354115355115356115357115358115359115360115361115362115363115364115365115366115367115368115369115370115371115372115373115374115375115376115377115378115379115380115381115382115383115384115385115386115387115388115389115390115391115392115393115394115395115396115397115398115399115400115401115402115403115404115405115406115407115408115409115410115411115412115413115414115415115416115417115418115419115420115421115422115423115424115425115426115427115428115429115430115431115432115433115434115435115436115437115438115439115440115441115442115443115444115445115446115447115448115449115450115451115452115453115454115455115456115457115458115459115460115461115462115463115464115465115466115467115468115469115470115471115472115473115474115475115476115477115478115479115480115481115482115483115484115485115486115487115488115489115490115491115492115493115494115495115496115497115498115499115500115501115502115503115504115505115506115507115508115509115510115511115512115513115514115515115516115517115518115519115520115521115522115523115524115525115526115527115528115529115530115531115532115533115534115535115536115537115538115539115540115541115542115543115544115545115546115547115548115549115550115551115552115553115554115555115556115557115558115559115560115561115562115563115564115565115566115567115568115569115570115571115572115573115574115575115576115577115578115579115580115581115582115583115584115585115586115587115588115589115590115591115592115593115594115595115596115597115598115599115600115601115602115603115604115605115606115607115608115609115610115611115612115613115614115615115616115617115618115619115620115621115622115623115624115625115626115627115628115629115630115631115632115633115634115635115636115637115638115639115640115641115642115643115644115645115646115647115648115649115650115651115652115653115654115655115656115657115658115659115660115661115662115663115664115665115666115667115668115669115670115671115672115673115674115675115676115677115678115679115680115681115682115683115684115685115686115687115688115689115690115691115692115693115694115695115696115697115698115699115700115701115702115703115704115705115706115707115708115709115710115711115712115713115714115715115716115717115718115719115720115721115722115723115724115725115726115727115728115729115730115731115732115733115734115735115736115737115738115739115740115741115742115743115744115745115746115747115748115749115750115751115752115753115754115755115756115757115758115759115760115761115762115763115764115765115766115767115768115769115770115771115772115773115774115775115776115777115778115779115780115781115782115783115784115785115786115787115788115789115790115791115792115793115794115795115796115797115798115799115800115801115802115803115804115805115806115807115808115809115810115811115812115813115814115815115816115817115818115819115820115821115822115823115824115825115826115827115828115829115830115831115832115833115834115835115836115837115838115839115840115841115842115843115844115845115846115847115848115849115850115851115852115853115854115855115856115857115858115859115860115861115862115863115864115865115866115867115868115869115870115871115872115873115874115875115876115877115878115879115880115881115882115883115884115885115886115887115888115889115890115891115892115893115894115895115896115897115898115899115900115901115902115903115904115905115906115907115908115909115910115911115912115913115914115915115916115917115918115919115920115921115922115923115924115925115926115927115928115929115930115931115932115933115934115935115936115937115938115939115940115941115942115943115944115945115946115947115948115949115950115951115952115953115954115955115956115957115958115959115960115961115962115963115964115965115966115967115968115969115970115971115972115973115974115975115976115977115978115979115980115981115982115983115984115985115986115987115988115989115990115991115992115993115994115995115996115997115998115999116000116001116002116003116004116005116006116007116008116009116010116011116012116013116014116015116016116017116018116019116020116021116022116023116024116025116026116027116028116029116030116031116032116033116034116035116036116037116038116039116040116041116042116043116044116045116046116047116048116049116050116051116052116053116054116055116056116057116058116059116060116061116062116063116064116065116066116067116068116069116070116071116072116073116074116075116076116077116078116079116080116081116082116083116084116085116086116087116088116089116090116091116092116093116094116095116096116097116098116099116100116101116102116103116104116105116106116107116108116109116110116111116112116113116114116115116116116117116118116119116120116121116122116123116124116125116126116127116128116129116130116131116132116133116134116135116136116137116138116139116140116141116142116143116144116145116146116147116148116149116150116151116152116153116154116155116156116157116158116159116160116161116162116163116164116165116166116167116168116169116170116171116172116173116174116175116176116177116178116179116180116181116182116183116184116185116186116187116188116189116190116191116192116193116194116195116196116197116198116199116200116201116202116203116204116205116206116207116208116209116210116211116212116213116214116215116216116217116218116219116220116221116222116223116224116225116226116227116228116229116230116231116232116233116234116235116236116237116238116239116240116241116242116243116244116245116246116247116248116249116250116251116252116253116254116255116256116257116258116259116260116261116262116263116264116265116266116267116268116269116270116271116272116273116274116275116276116277116278116279116280116281116282116283116284116285116286116287116288116289116290116291116292116293116294116295116296116297116298116299116300116301116302116303116304116305116306116307116308116309116310116311116312116313116314116315116316116317116318116319116320116321116322116323116324116325116326116327116328116329116330116331116332116333116334116335116336116337116338116339116340116341116342116343116344116345116346116347116348116349116350116351116352116353116354116355116356116357116358116359116360116361116362116363116364116365116366116367116368116369116370116371116372116373116374116375116376116377116378116379116380116381116382116383116384116385116386116387116388116389116390116391116392116393116394116395116396116397116398116399116400116401116402116403116404116405116406116407116408116409116410116411116412116413116414116415116416116417116418116419116420116421116422116423116424116425116426116427116428116429116430116431116432116433116434116435116436116437116438116439116440116441116442116443116444116445116446116447116448116449116450116451116452116453116454116455116456116457116458116459116460116461116462116463116464116465116466116467116468116469116470116471116472116473116474116475116476116477116478116479116480116481116482116483116484116485116486116487116488116489116490116491116492116493116494116495116496116497116498116499116500116501116502116503116504116505116506116507116508116509116510116511116512116513116514116515116516116517116518116519116520116521116522116523116524116525116526116527116528116529116530116531116532116533116534116535116536116537116538116539116540116541116542116543116544116545116546116547116548116549116550116551116552116553116554116555116556116557116558116559116560116561116562116563116564116565116566116567116568116569116570116571116572116573116574116575116576116577116578116579116580116581116582116583116584116585116586116587116588116589116590116591116592116593116594116595116596116597116598116599116600116601116602116603116604116605116606116607116608116609116610116611116612116613116614116615116616116617116618116619116620116621116622116623116624116625116626116627116628116629116630116631116632116633116634116635116636116637116638116639116640116641116642116643116644116645116646116647116648116649116650116651116652116653116654116655116656116657116658116659116660116661116662116663116664116665116666116667116668116669116670116671116672116673116674116675116676116677116678116679116680116681116682116683116684116685116686116687116688116689116690116691116692116693116694116695116696116697116698116699116700116701116702116703116704116705116706116707116708116709116710116711116712116713116714116715116716116717116718116719116720116721116722116723116724116725116726116727116728116729116730116731116732116733116734116735116736116737116738116739116740116741116742116743116744116745116746116747116748116749116750116751116752116753116754116755116756116757116758116759116760116761116762116763116764116765116766116767116768116769116770116771116772116773116774116775116776116777116778116779116780116781116782116783116784116785116786116787116788116789116790116791116792116793116794116795116796116797116798116799116800116801116802116803116804116805116806116807116808116809116810116811116812116813116814116815116816116817116818116819116820116821116822116823116824116825116826116827116828116829116830116831116832116833116834116835116836116837116838116839116840116841116842116843116844116845116846116847116848116849116850116851116852116853116854116855116856116857116858116859116860116861116862116863116864116865116866116867116868116869116870116871116872116873116874116875116876116877116878116879116880116881116882116883116884116885116886116887116888116889116890116891116892116893116894116895116896116897116898116899116900116901116902116903116904116905116906116907116908116909116910116911116912116913116914116915116916116917116918116919116920116921116922116923116924116925116926116927116928116929116930116931116932116933116934116935116936116937116938116939116940116941116942116943116944116945116946116947116948116949116950116951116952116953116954116955116956116957116958116959116960116961116962116963116964116965116966116967116968116969116970116971116972116973116974116975116976116977116978116979116980116981116982116983116984116985116986116987116988116989116990116991116992116993116994116995116996116997116998116999117000117001117002117003117004117005117006117007117008117009117010117011117012117013117014117015117016117017117018117019117020117021117022117023117024117025117026117027117028117029117030117031117032117033117034117035117036117037117038117039117040117041117042117043117044117045117046117047117048117049117050117051117052117053117054117055117056117057117058117059117060117061117062117063117064117065117066117067117068117069117070117071117072117073117074117075117076117077117078117079117080117081117082117083117084117085117086117087117088117089117090117091117092117093117094117095117096117097117098117099117100117101117102117103117104117105117106117107117108117109117110117111117112117113117114117115117116117117117118117119117120117121117122117123117124117125117126117127117128117129117130117131117132117133117134117135117136117137117138117139117140117141117142117143117144117145117146117147117148117149117150117151117152117153117154117155117156117157117158117159117160117161117162117163117164117165117166117167117168117169117170117171117172117173117174117175117176117177117178117179117180117181117182117183117184117185117186117187117188117189117190117191117192117193117194117195117196117197117198117199117200117201117202117203117204117205117206117207117208117209117210117211117212117213117214117215117216117217117218117219117220117221117222117223117224117225117226117227117228117229117230117231117232117233117234117235117236117237117238117239117240117241117242117243117244117245117246117247117248117249117250117251117252117253117254117255117256117257117258117259117260117261117262117263117264117265117266117267117268117269117270117271117272117273117274117275117276117277117278117279117280117281117282117283117284117285117286117287117288117289117290117291117292117293117294117295117296117297117298117299117300117301117302117303117304117305117306117307117308117309117310117311117312117313117314117315117316117317117318117319117320117321117322117323117324117325117326117327117328117329117330117331117332117333117334117335117336117337117338117339117340117341117342117343117344117345117346117347117348117349117350117351117352117353117354117355117356117357117358117359117360117361117362117363117364117365117366117367117368117369117370117371117372117373117374117375117376117377117378117379117380117381117382117383117384117385117386117387117388117389117390117391117392117393117394117395117396117397117398117399117400117401117402117403117404117405117406117407117408117409117410117411117412117413117414117415117416117417117418117419117420117421117422117423117424117425117426117427117428117429117430117431117432117433117434117435117436117437117438117439117440117441117442117443117444117445117446117447117448117449117450117451117452117453117454117455117456117457117458117459117460117461117462117463117464117465117466117467117468117469117470117471117472117473117474117475117476117477117478117479117480117481117482117483117484117485117486117487117488117489117490117491117492117493117494117495117496117497117498117499117500117501117502117503117504117505117506117507117508117509117510117511117512117513117514117515117516117517117518117519117520117521117522117523117524117525117526117527117528117529117530117531117532117533117534117535117536117537117538117539117540117541117542117543117544117545117546117547117548117549117550117551117552117553117554117555117556117557117558117559117560117561117562117563117564117565117566117567117568117569117570117571117572117573117574117575117576117577117578117579117580117581117582117583117584117585117586117587117588117589117590117591117592117593117594117595117596117597117598117599117600117601117602117603117604117605117606117607117608117609117610117611117612117613117614117615117616117617117618117619117620117621117622117623117624117625117626117627117628117629117630117631117632117633117634117635117636117637117638117639117640117641117642117643117644117645117646117647117648117649117650117651117652117653117654117655117656117657117658117659117660117661117662117663117664117665117666117667117668117669117670117671117672117673117674117675117676117677117678117679117680117681117682117683117684117685117686117687117688117689117690117691117692117693117694117695117696117697117698117699117700117701117702117703117704117705117706117707117708117709117710117711117712117713117714117715117716117717117718117719117720117721117722117723117724117725117726117727117728117729117730117731117732117733117734117735117736117737117738117739117740117741117742117743117744117745117746117747117748117749117750117751117752117753117754117755117756117757117758117759117760117761117762117763117764117765117766117767117768117769117770117771117772117773117774117775117776117777117778117779117780117781117782117783117784117785117786117787117788117789117790117791117792117793117794117795117796117797117798117799117800117801117802117803117804117805117806117807117808117809117810117811117812117813117814117815117816117817117818117819117820117821117822117823117824117825117826117827117828117829117830117831117832117833117834117835117836117837117838117839117840117841117842117843117844117845117846117847117848117849117850117851117852117853117854117855117856117857117858117859117860117861117862117863117864117865117866117867117868117869117870117871117872117873117874117875117876117877117878117879117880117881117882117883117884117885117886117887117888117889117890117891117892117893117894117895117896117897117898117899117900117901117902117903117904117905117906117907117908117909117910117911117912117913117914117915117916117917117918117919117920117921117922117923117924117925117926117927117928117929117930117931117932117933117934117935117936117937117938117939117940117941117942117943117944117945117946117947117948117949117950117951117952117953117954117955117956117957117958117959117960117961117962117963117964117965117966117967117968117969117970117971117972117973117974117975117976117977117978117979117980117981117982117983117984117985117986117987117988117989117990117991117992117993117994117995117996117997117998117999118000118001118002118003118004118005118006118007118008118009118010118011118012118013118014118015118016118017118018118019118020118021118022118023118024118025118026118027118028118029118030118031118032118033118034118035118036118037118038118039118040118041118042118043118044118045118046118047118048118049118050118051118052118053118054118055118056118057118058118059118060118061118062118063118064118065118066118067118068118069118070118071118072118073118074118075118076118077118078118079118080118081118082118083118084118085118086118087118088118089118090118091118092118093118094118095118096118097118098118099118100118101118102118103118104118105118106118107118108118109118110118111118112118113118114118115118116118117118118118119118120118121118122118123118124118125118126118127118128118129118130118131118132118133118134118135118136118137118138118139118140118141118142118143118144118145118146118147118148118149118150118151118152118153118154118155118156118157118158118159118160118161118162118163118164118165118166118167118168118169118170118171118172118173118174118175118176118177118178118179118180118181118182118183118184118185118186118187118188118189118190118191118192118193118194118195118196118197118198118199118200118201118202118203118204118205118206118207118208118209118210118211118212118213118214118215118216118217118218118219118220118221118222118223118224118225118226118227118228118229118230118231118232118233118234118235118236118237118238118239118240118241118242118243118244118245118246118247118248118249118250118251118252118253118254118255118256118257118258118259118260118261118262118263118264118265118266118267118268118269118270118271118272118273118274118275118276118277118278118279118280118281118282118283118284118285118286118287118288118289118290118291118292118293118294118295118296118297118298118299118300118301118302118303118304118305118306118307118308118309118310118311118312118313118314118315118316118317118318118319118320118321118322118323118324118325118326118327118328118329118330118331118332118333118334118335118336118337118338118339118340118341118342118343118344118345118346118347118348118349118350118351118352118353118354118355118356118357118358118359118360118361118362118363118364118365118366118367118368118369118370118371118372118373118374118375118376118377118378118379118380118381118382118383118384118385118386118387118388118389118390118391118392118393118394118395118396118397118398118399118400118401118402118403118404118405118406118407118408118409118410118411118412118413118414118415118416118417118418118419118420118421118422118423118424118425118426118427118428118429118430118431118432118433118434118435118436118437118438118439118440118441118442118443118444118445118446118447118448118449118450118451118452118453118454118455118456118457118458118459118460118461118462118463118464118465118466118467118468118469118470118471118472118473118474118475118476118477118478118479118480118481118482118483118484118485118486118487118488118489118490118491118492118493118494118495118496118497118498118499118500118501118502118503118504118505118506118507118508118509118510118511118512118513118514118515118516118517118518118519118520118521118522118523118524118525118526118527118528118529118530118531118532118533118534118535118536118537118538118539118540118541118542118543118544118545118546118547118548118549118550118551118552118553118554118555118556118557118558118559118560118561118562118563118564118565118566118567118568118569118570118571118572118573118574118575118576118577118578118579118580118581118582118583118584118585118586118587118588118589118590118591118592118593118594118595118596118597118598118599118600118601118602118603118604118605118606118607118608118609118610118611118612118613118614118615118616118617118618118619118620118621118622118623118624118625118626118627118628118629118630118631118632118633118634118635118636118637118638118639118640118641118642118643118644118645118646118647118648118649118650118651118652118653118654118655118656118657118658118659118660118661118662118663118664118665118666118667118668118669118670118671118672118673118674118675118676118677118678118679118680118681118682118683118684118685118686118687118688118689118690118691118692118693118694118695118696118697118698118699118700118701118702118703118704118705118706118707118708118709118710118711118712118713118714118715118716118717118718118719118720118721118722118723118724118725118726118727118728118729118730118731118732118733118734118735118736118737118738118739118740118741118742118743118744118745118746118747118748118749118750118751118752118753118754118755118756118757118758118759118760118761118762118763118764118765118766118767118768118769118770118771118772118773118774118775118776118777118778118779118780118781118782118783118784118785118786118787118788118789118790118791118792118793118794118795118796118797118798118799118800118801118802118803118804118805118806118807118808118809118810118811118812118813118814118815118816118817118818118819118820118821118822118823118824118825118826118827118828118829118830118831118832118833118834118835118836118837118838118839118840118841118842118843118844118845118846118847118848118849118850118851118852118853118854118855118856118857118858118859118860118861118862118863118864118865118866118867118868118869118870118871118872118873118874118875118876118877118878118879118880118881118882118883118884118885118886118887118888118889118890118891118892118893118894118895118896118897118898118899118900118901118902118903118904118905118906118907118908118909118910118911118912118913118914118915118916118917118918118919118920118921118922118923118924118925118926118927118928118929118930118931118932118933118934118935118936118937118938118939118940118941118942118943118944118945118946118947118948118949118950118951118952118953118954118955118956118957118958118959118960118961118962118963118964118965118966118967118968118969118970118971118972118973118974118975118976118977118978118979118980118981118982118983118984118985118986118987118988118989118990118991118992118993118994118995118996118997118998118999119000119001119002119003119004119005119006119007119008119009119010119011119012119013119014119015119016119017119018119019119020119021119022119023119024119025119026119027119028119029119030119031119032119033119034119035119036119037119038119039119040119041119042119043119044119045119046119047119048119049119050119051119052119053119054119055119056119057119058119059119060119061119062119063119064119065119066119067119068119069119070119071119072119073119074119075119076119077119078119079119080119081119082119083119084119085119086119087119088119089119090119091119092119093119094119095119096119097119098119099119100119101119102119103119104119105119106119107119108119109119110119111119112119113119114119115119116119117119118119119119120119121119122119123119124119125119126119127119128119129119130119131119132119133119134119135119136119137119138119139119140119141119142119143119144119145119146119147119148119149119150119151119152119153119154119155119156119157119158119159119160119161119162119163119164119165119166119167119168119169119170119171119172119173119174119175119176119177119178119179119180119181119182119183119184119185119186119187119188119189119190119191119192119193119194119195119196119197119198119199119200119201119202119203119204119205119206119207119208119209119210119211119212119213119214119215119216119217119218119219119220119221119222119223119224119225119226119227119228119229119230119231119232119233119234119235119236119237119238119239119240119241119242119243119244119245119246119247119248119249119250119251119252119253119254119255119256119257119258119259119260119261119262119263119264119265119266119267119268119269119270119271119272119273119274119275119276119277119278119279119280119281119282119283119284119285119286119287119288119289119290119291119292119293119294119295119296119297119298119299119300119301119302119303119304119305119306119307119308119309119310119311119312119313119314119315119316119317119318119319119320119321119322119323119324119325119326119327119328119329119330119331119332119333119334119335119336119337119338119339119340119341119342119343119344119345119346119347119348119349119350119351119352119353119354119355119356119357119358119359119360119361119362119363119364119365119366119367119368119369119370119371119372119373119374119375119376119377119378119379119380119381119382119383119384119385119386119387119388119389119390119391119392119393119394119395119396119397119398119399119400119401119402119403119404119405119406119407119408119409119410119411119412119413119414119415119416119417119418119419119420119421119422119423119424119425119426119427119428119429119430119431119432119433119434119435119436119437119438119439119440119441119442119443119444119445119446119447119448119449119450119451119452119453119454119455119456119457119458119459119460119461119462119463119464119465119466119467119468119469119470119471119472119473119474119475119476119477119478119479119480119481119482119483119484119485119486119487119488119489119490119491119492119493119494119495119496119497119498119499119500119501119502119503119504119505119506119507119508119509119510119511119512119513119514119515119516119517119518119519119520119521119522119523119524119525119526119527119528119529119530119531119532119533119534119535119536119537119538119539119540119541119542119543119544119545119546119547119548119549119550119551119552119553119554119555119556119557119558119559119560119561119562119563119564119565119566119567119568119569119570119571119572119573119574119575119576119577119578119579119580119581119582119583119584119585119586119587119588119589119590119591119592119593119594119595119596119597119598119599119600119601119602119603119604119605119606119607119608119609119610119611119612119613119614119615119616119617119618119619119620119621119622119623119624119625119626119627119628119629119630119631119632119633119634119635119636119637119638119639119640119641119642119643119644119645119646119647119648119649119650119651119652119653119654119655119656119657119658119659119660119661119662119663119664119665119666119667119668119669119670119671119672119673119674119675119676119677119678119679119680119681119682119683119684119685119686119687119688119689119690119691119692119693119694119695119696119697119698119699119700119701119702119703119704119705119706119707119708119709119710119711119712119713119714119715119716119717119718119719119720119721119722119723119724119725119726119727119728119729119730119731119732119733119734119735119736119737119738119739119740119741119742119743119744119745119746119747119748119749119750119751119752119753119754119755119756119757119758119759119760119761119762119763119764119765119766119767119768119769119770119771119772119773119774119775119776119777119778119779119780119781119782119783119784119785119786119787119788119789119790119791119792119793119794119795119796119797119798119799119800119801119802119803119804119805119806119807119808119809119810119811119812119813119814119815119816119817119818119819119820119821119822119823119824119825119826119827119828119829119830119831119832119833119834119835119836119837119838119839119840119841119842119843119844119845119846119847119848119849119850119851119852119853119854119855119856119857119858119859119860119861119862119863119864119865119866119867119868119869119870119871119872119873119874119875119876119877119878119879119880119881119882119883119884119885119886119887119888119889119890119891119892119893119894119895119896119897119898119899119900119901119902119903119904119905119906119907119908119909119910119911119912119913119914119915119916119917119918119919119920119921119922119923119924119925119926119927119928119929119930119931119932119933119934119935119936119937119938119939119940119941119942119943119944119945119946119947119948119949119950119951119952119953119954119955119956119957119958119959119960119961119962119963119964119965119966119967119968119969119970119971119972119973119974119975119976119977119978119979119980119981119982119983119984119985119986119987119988119989119990119991119992119993119994119995119996119997119998119999120000120001120002120003120004120005120006120007120008120009120010120011120012120013120014120015120016120017120018120019120020120021120022120023120024120025120026120027120028120029120030120031120032120033120034120035120036120037120038120039120040120041120042120043120044120045120046120047120048120049120050120051120052120053120054120055120056120057120058120059120060120061120062120063120064120065120066120067120068120069120070120071120072120073120074120075120076120077120078120079120080120081120082120083120084120085120086120087120088120089120090120091120092120093120094120095120096120097120098120099120100120101120102120103120104120105120106120107120108120109120110120111120112120113120114120115120116120117120118120119120120120121120122120123120124120125120126120127120128120129120130120131120132120133120134120135120136120137120138120139120140120141120142120143120144120145120146120147120148120149120150120151120152120153120154120155120156120157120158120159120160120161120162120163120164120165120166120167120168120169120170120171120172120173120174120175120176120177120178120179120180120181120182120183120184120185120186120187120188120189120190120191120192120193120194120195120196120197120198120199120200120201120202120203120204120205120206120207120208120209120210120211120212120213120214120215120216120217120218120219120220120221120222120223120224120225120226120227120228120229120230120231120232120233120234120235120236120237120238120239120240120241120242120243120244120245120246120247120248120249120250120251120252120253120254120255120256120257120258120259120260120261120262120263120264120265120266120267120268120269120270120271120272120273120274120275120276120277120278120279120280120281120282120283120284120285120286120287120288120289120290120291120292120293120294120295120296120297120298120299120300120301120302120303120304120305120306120307120308120309120310120311120312120313120314120315120316120317120318120319120320120321120322120323120324120325120326120327120328120329120330120331120332120333120334120335120336120337120338120339120340120341120342120343120344120345120346120347120348120349120350120351120352120353120354120355120356120357120358120359120360120361120362120363120364120365120366120367120368120369120370120371120372120373120374120375120376120377120378120379120380120381120382120383120384120385120386120387120388120389120390120391120392120393120394120395120396120397120398120399120400120401120402120403120404120405120406120407120408120409120410120411120412120413120414120415120416120417120418120419120420120421120422120423120424120425120426120427120428120429120430120431120432120433120434120435120436120437120438120439120440120441120442120443120444120445120446120447120448120449120450120451120452120453120454120455120456120457120458120459120460120461120462120463120464120465120466120467120468120469120470120471120472120473120474120475120476120477120478120479120480120481120482120483120484120485120486120487120488120489120490120491120492120493120494120495120496120497120498120499120500120501120502120503120504120505120506120507120508120509120510120511120512120513120514120515120516120517120518120519120520120521120522120523120524120525120526120527120528120529120530120531120532120533120534120535120536120537120538120539120540120541120542120543120544120545120546120547120548120549120550120551120552120553120554120555120556120557120558120559120560120561120562120563120564120565120566120567120568120569120570120571120572120573120574120575120576120577120578120579120580120581120582120583120584120585120586120587120588120589120590120591120592120593120594120595120596120597120598120599120600120601120602120603120604120605120606120607120608120609120610120611120612120613120614120615120616120617120618120619120620120621120622120623120624120625120626120627120628120629120630120631120632120633120634120635120636120637120638120639120640120641120642120643120644120645120646120647120648120649120650120651120652120653120654120655120656120657120658120659120660120661120662120663120664120665120666120667120668120669120670120671120672120673120674120675120676120677120678120679120680120681120682120683120684120685120686120687120688120689120690120691120692120693120694120695120696120697120698120699120700120701120702120703120704120705120706120707120708120709120710120711120712120713120714120715120716120717120718120719120720120721120722120723120724120725120726120727120728120729120730120731120732120733120734120735120736120737120738120739120740120741120742120743120744120745120746120747120748120749120750120751120752120753120754120755120756120757120758120759120760120761120762120763120764120765120766120767120768120769120770120771120772120773120774120775120776120777120778120779120780120781120782120783120784120785120786120787120788120789120790120791120792120793120794120795120796120797120798120799120800120801120802120803120804120805120806120807120808120809120810120811120812120813120814120815120816120817120818120819120820120821120822120823120824120825120826120827120828120829120830120831120832120833120834120835120836120837120838120839120840120841120842120843120844120845120846120847120848120849120850120851120852120853120854120855120856120857120858120859120860120861120862120863120864120865120866120867120868120869120870120871120872120873120874120875120876120877120878120879120880120881120882120883120884120885120886120887120888120889120890120891120892120893120894120895120896120897120898120899120900120901120902120903120904120905120906120907120908120909120910120911120912120913120914120915120916120917120918120919120920120921120922120923120924120925120926120927120928120929120930120931120932120933120934120935120936120937120938120939120940120941120942120943120944120945120946120947120948120949120950120951120952120953120954120955120956120957120958120959120960120961120962120963120964120965120966120967120968120969120970120971120972120973120974120975120976120977120978120979120980120981120982120983120984120985120986120987120988120989120990120991120992120993120994120995120996120997120998120999121000121001121002121003121004121005121006121007121008121009121010121011121012121013121014121015121016121017121018121019121020121021121022121023121024121025121026121027121028121029121030121031121032121033121034121035121036121037121038121039121040121041121042121043121044121045121046121047121048121049121050121051121052121053121054121055121056121057121058121059121060121061121062121063121064121065121066121067121068121069121070121071121072121073121074121075121076121077121078121079121080121081121082121083121084121085121086121087121088121089121090121091121092121093121094121095121096121097121098121099121100121101121102121103121104121105121106121107121108121109121110121111121112121113121114121115121116121117121118121119121120121121121122121123121124121125121126121127121128121129121130121131121132121133121134121135121136121137121138121139121140121141121142121143121144121145121146121147121148121149121150121151121152121153121154121155121156121157121158121159121160121161121162121163121164121165121166121167121168121169121170121171121172121173121174121175121176121177121178121179121180121181121182121183121184121185121186121187121188121189121190121191121192121193121194121195121196121197121198121199121200121201121202121203121204121205121206121207121208121209121210121211121212121213121214121215121216121217121218121219121220121221121222121223121224121225121226121227121228121229121230121231121232121233121234121235121236121237121238121239121240121241121242121243121244121245121246121247121248121249121250121251121252121253121254121255121256121257121258121259121260121261121262121263121264121265121266121267121268121269121270121271121272121273121274121275121276121277121278121279121280121281121282121283121284121285121286121287121288121289121290121291121292121293121294121295121296121297121298121299121300121301121302121303121304121305121306121307121308121309121310121311121312121313121314121315121316121317121318121319121320121321121322121323121324121325121326121327121328121329121330121331121332121333121334121335121336121337121338121339121340121341121342121343121344121345121346121347121348121349121350121351121352121353121354121355121356121357121358121359121360121361121362121363121364121365121366121367121368121369121370121371121372121373121374121375121376121377121378121379121380121381121382121383121384121385121386121387121388121389121390121391121392121393121394121395121396121397121398121399121400121401121402121403121404121405121406121407121408121409121410121411121412121413121414121415121416121417121418121419121420121421121422121423121424121425121426121427121428121429121430121431121432121433121434121435121436121437121438121439121440121441121442121443121444121445121446121447121448121449121450121451121452121453121454121455121456121457121458121459121460121461121462121463121464121465121466121467121468121469121470121471121472121473121474121475121476121477121478121479121480121481121482121483121484121485121486121487121488121489121490121491121492121493121494121495121496121497121498121499121500121501121502121503121504121505121506121507121508121509121510121511121512121513121514121515121516121517121518121519121520121521121522121523121524121525121526121527121528121529121530121531121532121533121534121535121536121537121538121539121540121541121542121543121544121545121546121547121548121549121550121551121552121553121554121555121556121557121558121559121560121561121562121563121564121565121566121567121568121569121570121571121572121573121574121575121576121577121578121579121580121581121582121583121584121585121586121587121588121589121590121591121592121593121594121595121596121597121598121599121600121601121602121603121604121605121606121607121608121609121610121611121612121613121614121615121616121617121618121619121620121621121622121623121624121625121626121627121628121629121630121631121632121633121634121635121636121637121638121639121640121641121642121643121644121645121646121647121648121649121650121651121652121653121654121655121656121657121658121659121660121661121662121663121664121665121666121667121668121669121670121671121672121673121674121675121676121677121678121679121680121681121682121683121684121685121686121687121688121689121690121691121692121693121694121695121696121697121698121699121700121701121702121703121704121705121706121707121708121709121710121711121712121713121714121715121716121717121718121719121720121721121722121723121724121725121726121727121728121729121730121731121732121733121734121735121736121737121738121739121740121741121742121743121744121745121746121747121748121749121750121751121752121753121754121755121756121757121758121759121760121761121762121763121764121765121766121767121768121769121770121771121772121773121774121775121776121777121778121779121780121781121782121783121784121785121786121787121788121789121790121791121792121793121794121795121796121797121798121799121800121801121802121803121804121805121806121807121808121809121810121811121812121813121814121815121816121817121818121819121820121821121822121823121824121825121826121827121828121829121830121831121832121833121834121835121836121837121838121839121840121841121842121843121844121845121846121847121848121849121850121851121852121853
  1. var __defProp = Object.defineProperty;
  2. var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  3. var __publicField = (obj, key, value) => {
  4. __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  5. return value;
  6. };
  7. import { getCurrentScope, onScopeDispose, unref, getCurrentInstance, onMounted, nextTick, ref, readonly, watch, openBlock, createElementBlock, createElementVNode, warn, computed as computed$1, watchEffect, onBeforeUnmount, inject, isRef, shallowRef, onBeforeMount, provide, defineComponent, renderSlot, mergeProps, toRef, onUnmounted, useAttrs as useAttrs$1, useSlots, withDirectives, createCommentVNode, Fragment, normalizeClass, createBlock, withCtx, resolveDynamicComponent, withModifiers, createVNode, toDisplayString, normalizeStyle, vShow, Transition, reactive, onUpdated, cloneVNode, Text as Text$1, Comment as Comment$1, Teleport, onDeactivated, vModelRadio, createTextVNode, toRefs, toHandlers, withKeys, renderList, h, createSlots, toRaw as toRaw$1, triggerRef, resolveComponent, resolveDirective, vModelText, defineCustomElement } from "vue";
  8. const CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
  9. class Util {
  10. static uuid(prefix = "D") {
  11. let uuid = [];
  12. uuid[8] = uuid[13] = uuid[18] = uuid[23] = "-";
  13. uuid[14] = "4";
  14. let r2;
  15. for (let i2 = 0; i2 < 36; i2++) {
  16. if (!uuid[i2]) {
  17. r2 = 0 | Math.random() * 16;
  18. uuid[i2] = CHARS[i2 == 19 ? r2 & 3 | 8 : r2];
  19. }
  20. }
  21. return prefix + "-" + uuid.join("");
  22. }
  23. static merge(dest, ...sources) {
  24. let i2, j, len, src;
  25. for (j = 0, len = sources.length; j < len; j++) {
  26. src = sources[j];
  27. for (i2 in src) {
  28. dest[i2] = src[i2];
  29. }
  30. }
  31. return dest;
  32. }
  33. static trim(str) {
  34. return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
  35. }
  36. static splitWords(str) {
  37. return this.trim(str).split(/\s+/);
  38. }
  39. static setOptions(obj, options2) {
  40. if (!obj.hasOwnProperty("options")) {
  41. obj.options = obj.options ? create(obj.options) : {};
  42. }
  43. for (var i2 in options2) {
  44. obj.options[i2] = options2[i2];
  45. }
  46. return obj.options;
  47. }
  48. static checkPosition(position2) {
  49. return position2 && position2.hasOwnProperty("_lng") && position2.hasOwnProperty("_lat") && position2.hasOwnProperty("_alt");
  50. }
  51. static checkPositions(positions) {
  52. return positions && (typeof positions === "string" || Array.isArray(positions));
  53. }
  54. static checkViewer(viewer2) {
  55. return viewer2 && viewer2.delegate && viewer2.canvas;
  56. }
  57. }
  58. class DomUtil {
  59. static get(id) {
  60. return typeof id === "string" ? document.getElementById(id) : id;
  61. }
  62. static getStyle(el, style) {
  63. var value = el.style[style] || el.currentStyle && el.currentStyle[style];
  64. if ((!value || value === "auto") && document.defaultView) {
  65. var css = document.defaultView.getComputedStyle(el, null);
  66. value = css ? css[style] : null;
  67. }
  68. return value === "auto" ? null : value;
  69. }
  70. static create(tagName, className, container) {
  71. var el = document.createElement(tagName);
  72. el.className = className || "";
  73. if (container) {
  74. container.appendChild(el);
  75. }
  76. return el;
  77. }
  78. static remove(el) {
  79. var parent = el.parentNode;
  80. if (parent) {
  81. parent.removeChild(el);
  82. }
  83. }
  84. static empty(el) {
  85. while (el.firstChild) {
  86. el.removeChild(el.firstChild);
  87. }
  88. }
  89. hasClass(el, name) {
  90. if (el.classList !== void 0) {
  91. return el.classList.contains(name);
  92. }
  93. var className = getClass(el);
  94. return className.length > 0 && new RegExp("(^|\\s)" + name + "(\\s|$)").test(className);
  95. }
  96. static addClass(el, name) {
  97. if (el.classList !== void 0) {
  98. let classes = Util.splitWords(name);
  99. for (let i2 = 0, len = classes.length; i2 < len; i2++) {
  100. el.classList.add(classes[i2]);
  101. }
  102. } else if (!this.hasClass(el, name)) {
  103. let className = this.getClass(el);
  104. this.setClass(el, (className ? className + " " : "") + name);
  105. }
  106. }
  107. static removeClass(el, name) {
  108. if (el.classList !== void 0) {
  109. el.classList.remove(name);
  110. } else {
  111. this.setClass(
  112. el,
  113. Util.trim(
  114. (" " + this.getClass(el) + " ").replace(" " + name + " ", " ")
  115. )
  116. );
  117. }
  118. }
  119. static setClass(el, name) {
  120. if (el.className.baseVal === void 0) {
  121. el.className = name;
  122. } else {
  123. el.className.baseVal = name;
  124. }
  125. }
  126. static getClass(el) {
  127. if (el.correspondingElement) {
  128. el = el.correspondingElement;
  129. }
  130. return el.className.baseVal === void 0 ? el.className : el.className.baseVal;
  131. }
  132. static createSvg(width2, height2, path, container) {
  133. let svg = document.createElementNS("http://www.w3.org/2000/svg", "svg:svg");
  134. svg.setAttribute("class", "svg-path");
  135. svg.setAttribute("width", width2);
  136. svg.setAttribute("height", height2);
  137. svg.setAttribute("viewBox", `0 0 ${width2} ${height2}`);
  138. let pathEl = document.createElementNS("http://www.w3.org/2000/svg", "path");
  139. pathEl.setAttribute("d", path);
  140. svg.appendChild(pathEl);
  141. if (container) {
  142. container.appendChild(svg);
  143. }
  144. return svg;
  145. }
  146. }
  147. var StatusBar$1 = "";
  148. class StatusBar {
  149. constructor(viewer2) {
  150. if (!viewer2)
  151. throw new Error("viewer is required!");
  152. this._viewer = viewer2;
  153. this._show = false;
  154. this._handler;
  155. this._posX;
  156. this._posY;
  157. this._posZ;
  158. this._cameraHeight;
  159. this._pitch;
  160. this._heading;
  161. this._scale;
  162. this.initListener();
  163. }
  164. get params() {
  165. return {
  166. posX: this._posX,
  167. posY: this._posY,
  168. posZ: this._posZ,
  169. cameraHeight: this._cameraHeight,
  170. pitch: this._pitch,
  171. heading: this._heading,
  172. scale: this._scale
  173. };
  174. }
  175. get statusDom() {
  176. let innerHtml = `
  177. <span class="status-scale">
  178. \u6BD4\u4F8B\u5C3A\uFF1A
  179. <span class="scale-border">
  180. ${this._scale}
  181. </span>
  182. </span>
  183. <span class="status-position">
  184. <span id="status_spaceInfo">\u7A7A\u95F4\u4FE1\u606F</span>
  185. \u5237\u5E27\u7387\uFF1A<span id="status_ms"></span>|<span id="status_fps"></span>
  186. </span>
  187. `;
  188. return innerHtml;
  189. }
  190. get show() {
  191. return this._show;
  192. }
  193. set show(bool) {
  194. bool ? this.createStatusBar() : this.removeStatusBar();
  195. this._show = bool;
  196. }
  197. initListener() {
  198. const $this = this;
  199. const scene = this._viewer.scene;
  200. this._scaleListener = function() {
  201. let width2 = scene.canvas.clientWidth;
  202. let height2 = scene.canvas.clientHeight;
  203. let left = scene.camera.getPickRay(
  204. new Cesium.Cartesian2(width2 / 2 | 0, height2 - 1)
  205. );
  206. let right = scene.camera.getPickRay(
  207. new Cesium.Cartesian2(1 + width2 / 2 | 0, height2 - 1)
  208. );
  209. let globe = scene.globe;
  210. let leftPosition = globe.pick(left, scene);
  211. let rightPosition = globe.pick(right, scene);
  212. if (leftPosition && rightPosition) {
  213. let geodesic = new Cesium.EllipsoidGeodesic();
  214. let leftCartographic = globe.ellipsoid.cartesianToCartographic(leftPosition);
  215. let rightCartographic = globe.ellipsoid.cartesianToCartographic(rightPosition);
  216. geodesic.setEndPoints(leftCartographic, rightCartographic);
  217. let distance2 = geodesic.surfaceDistance;
  218. let curScaleNum = $this.closest(distance2 / 10);
  219. if (curScaleNum < 1) {
  220. $this._scale = curScaleNum * 1e3 + "m";
  221. } else {
  222. $this._scale = curScaleNum + "km";
  223. }
  224. }
  225. document.getElementsByClassName("scale-border")[0].innerText = $this._scale;
  226. if (document.getElementsByClassName("cesium-performanceDisplay-ms").length > 0) {
  227. document.getElementById("status_ms").innerText = document.getElementsByClassName("cesium-performanceDisplay-ms")[0].innerText;
  228. }
  229. if (document.getElementsByClassName("cesium-performanceDisplay-fps").length > 0) {
  230. document.getElementById("status_fps").innerText = document.getElementsByClassName("cesium-performanceDisplay-fps")[0].innerText;
  231. }
  232. };
  233. }
  234. createStatusBar() {
  235. const _delegate = this._viewer;
  236. this.initHandler(_delegate);
  237. this.initScale(_delegate, true);
  238. this._domContainer = DomUtil.create(
  239. "div",
  240. "lk-status-bar",
  241. document.getElementById(this._viewer._container.id)
  242. );
  243. this._domContainer.innerHTML = this.statusDom;
  244. }
  245. removeStatusBar() {
  246. this.initScale(this._viewer, false);
  247. if (this._handler) {
  248. this._handler.destroy();
  249. }
  250. if (this._domContainer) {
  251. DomUtil.remove(this._domContainer);
  252. }
  253. }
  254. initHandler(viewer2) {
  255. const $this = this;
  256. this._handler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  257. const mouseOverHandler = function(movement) {
  258. let loc2 = $this._getScreenClickPositionAndHeight(movement.endPosition);
  259. if (!Cesium.defined(loc2))
  260. return;
  261. if (!loc2.lng)
  262. return;
  263. $this._posX = loc2.lng.toFixed(8);
  264. $this._posY = loc2.lat.toFixed(8);
  265. $this._posZ = loc2.height.toFixed(2);
  266. document.getElementById("status_spaceInfo").innerHTML = `
  267. <span>\u7ECF\u5EA6\uFF1A${$this._posX}</span>
  268. <span>\u7EAC\u5EA6\uFF1A${$this._posY}</span>
  269. <span>\u9AD8\u5EA6\uFF1A${$this._posZ}</span>
  270. `;
  271. };
  272. this._handler.setInputAction(
  273. mouseOverHandler,
  274. Cesium.ScreenSpaceEventType.MOUSE_MOVE
  275. );
  276. }
  277. initScale(viewer2, bool) {
  278. const scene = viewer2.scene;
  279. bool ? scene.postRender.addEventListener(this._scaleListener) : scene.postRender.removeEventListener(this._scaleListener);
  280. }
  281. closest(num) {
  282. const scaleList = [
  283. 1e-3,
  284. 2e-3,
  285. 3e-3,
  286. 5e-3,
  287. 0.01,
  288. 0.015,
  289. 0.02,
  290. 0.025,
  291. 0.03,
  292. 0.035,
  293. 0.04,
  294. 0.045,
  295. 0.05,
  296. 0.06,
  297. 0.07,
  298. 0.08,
  299. 0.09,
  300. 0.1,
  301. 0.12,
  302. 0.15,
  303. 0.2,
  304. 0.25,
  305. 0.3,
  306. 0.5,
  307. 1,
  308. 2,
  309. 3,
  310. 5,
  311. 10,
  312. 15,
  313. 20,
  314. 25,
  315. 30,
  316. 35,
  317. 40,
  318. 45,
  319. 50,
  320. 60,
  321. 70,
  322. 80,
  323. 90,
  324. 100,
  325. 120,
  326. 150,
  327. 200,
  328. 250,
  329. 300,
  330. 500,
  331. 1e3,
  332. 2e3,
  333. 5e3,
  334. 1e4,
  335. 1e5,
  336. 5e5,
  337. 1e6
  338. ];
  339. let ret = scaleList[0];
  340. let distance2 = Math.abs(ret - num);
  341. for (let i2 = 1; i2 < scaleList.length; i2++) {
  342. let newDistance = Math.abs(scaleList[i2] - num);
  343. if (newDistance < distance2) {
  344. distance2 = newDistance;
  345. ret = scaleList[i2];
  346. }
  347. }
  348. return ret;
  349. }
  350. _getScreenClickPositionAndHeight(screenPoint) {
  351. var lng = void 0, lat = void 0, height2 = void 0;
  352. var ray = this._viewer.scene.camera.getPickRay(screenPoint);
  353. var position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  354. if (position2) {
  355. var cartographic = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  356. cartographic = Cesium.Cartographic.fromCartesian(position2);
  357. var feature2 = this._viewer.scene.pick(screenPoint);
  358. if (feature2 === void 0 && Cesium.defined(cartographic)) {
  359. lng = this._arcToDegree(cartographic.longitude);
  360. lat = this._arcToDegree(cartographic.latitude);
  361. height2 = cartographic.height;
  362. } else {
  363. var cartesian = this._viewer.scene.pickPosition(screenPoint);
  364. if (Cesium.defined(cartesian)) {
  365. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  366. if (Cesium.defined(cartographic)) {
  367. lng = this._arcToDegree(cartographic.longitude);
  368. lat = this._arcToDegree(cartographic.latitude);
  369. height2 = cartographic.height;
  370. }
  371. }
  372. }
  373. }
  374. return {
  375. lng,
  376. lat,
  377. height: height2
  378. };
  379. }
  380. _arcToDegree(arc) {
  381. return arc / Math.PI * 180;
  382. }
  383. }
  384. var base = "";
  385. class jtMap3d {
  386. constructor(options2) {
  387. if (!Cesium.defined(options2) || !Cesium.defined(options2.container)) {
  388. throw new Cesium.DeveloperError("options.container is required.");
  389. }
  390. Cesium.Ion.defaultAccessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIxNzM5YjQ3MC03YmMxLTRmMjAtOTk4Yi0yNDMyMDZlOTQzYTYiLCJpZCI6NTU5MjAsImlhdCI6MTYyNDI0NTM5NX0.diydVWFzw5C5rQlHaFYkdDJoSorcdex81KpWcntyICo";
  391. this._viewer = this._initMap(options2);
  392. this._imageryLayers = this._viewer.imageryLayers;
  393. this._primitives = this._viewer.scene.primitives;
  394. this._entities = this._viewer.entities;
  395. this._dataSources = this._viewer.dataSources;
  396. this._defaultSkyBox = this._viewer.scene.skyBox;
  397. this.statusBar = new StatusBar(this._viewer);
  398. console.log(Cesium.buildModuleUrl.getCesiumBaseUrl());
  399. }
  400. _initMap(options2) {
  401. let viewer2 = new Cesium.Viewer(options2.container, {
  402. animation: true,
  403. timeline: true,
  404. shadows: false,
  405. shouldAnimate: true,
  406. baseLayerPicker: false,
  407. navigationHelpButton: false,
  408. homeButton: false,
  409. fullscreenButton: false,
  410. sceneModePicker: false,
  411. scene3DOnly: true,
  412. infoBox: false,
  413. clampToGround: true,
  414. geocoder: false,
  415. selectionIndicator: false,
  416. contextOptions: {
  417. webgl: {
  418. alpha: true,
  419. depth: true,
  420. stencil: true,
  421. antialias: true,
  422. premultipliedAlpha: true,
  423. preserveDrawingBuffer: true,
  424. failIfMajorPerformanceCaveat: true
  425. }
  426. }
  427. });
  428. viewer2._cesiumWidget._creditContainer.style.display = "none";
  429. viewer2.scene.globe.show = true;
  430. viewer2.scene.globe.depthTestAgainstTerrain = true;
  431. viewer2.scene.globe.enableLighting = false;
  432. viewer2.scene.requestRenderMode = false;
  433. viewer2.scene.debugShowFramesPerSecond = true;
  434. viewer2.scene.skyAtmosphere.show = false;
  435. viewer2.scene.skyBox.show = true;
  436. viewer2.scene.sun.show = true;
  437. viewer2.scene.moon.show = false;
  438. viewer2.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  439. viewer2.animation.viewModel.dateFormatter = localeDateTimeFormatter;
  440. viewer2.animation.viewModel.timeFormatter = localeTimeFormatter;
  441. viewer2.timeline.makeLabel = localeDateTimeFormatter;
  442. function localeDateTimeFormatter(datetime, viewModel, ignoredate) {
  443. var julianDT = new Cesium.JulianDate();
  444. Cesium.JulianDate.addHours(datetime, 8, julianDT);
  445. var gregorianDT = Cesium.JulianDate.toGregorianDate(julianDT);
  446. var objDT;
  447. if (ignoredate) {
  448. objDT = "";
  449. } else {
  450. objDT = new Date(gregorianDT.year, gregorianDT.month - 1, gregorianDT.day);
  451. objDT = gregorianDT.year + "-" + objDT.toLocaleString("zh-cn", {
  452. month: "short"
  453. }).split("\u6708").join("-") + gregorianDT.day + " ";
  454. if (viewModel || gregorianDT.hour + gregorianDT.minute === 0) {
  455. return objDT;
  456. }
  457. }
  458. let hour, minute, second;
  459. if (gregorianDT.hour < 10) {
  460. hour = `0${gregorianDT.hour}`;
  461. } else {
  462. hour = gregorianDT.hour;
  463. }
  464. if (gregorianDT.minute < 10) {
  465. minute = `0${gregorianDT.minute}`;
  466. } else {
  467. minute = gregorianDT.minute;
  468. }
  469. if (gregorianDT.second < 10) {
  470. second = `0${gregorianDT.second}`;
  471. } else {
  472. second = gregorianDT.second;
  473. }
  474. return objDT + hour + ":" + minute + ":" + second;
  475. }
  476. function localeTimeFormatter(time, viewModel) {
  477. return localeDateTimeFormatter(time, viewModel, true);
  478. }
  479. return viewer2;
  480. }
  481. _setView(options2) {
  482. if (!Cesium.defined(options2.longitude) && !Cesium.defined(options2.latitude)) {
  483. throw new Cesium.DeveloperError("longitude and latitude are required.");
  484. }
  485. Cesium.Check.typeOf.number("longitude", options2.longitude);
  486. Cesium.Check.typeOf.number("latitude", options2.latitude);
  487. this._viewer.camera.setView({
  488. destination: Cesium.Cartesian3.fromDegrees(
  489. options2.longitude,
  490. options2.latitude,
  491. options2.height
  492. ),
  493. orientation: {
  494. heading: Cesium.Math.toRadians(Cesium.defaultValue(options2.heading, 0)),
  495. pitch: Cesium.Math.toRadians(Cesium.defaultValue(options2.pitch, -90)),
  496. roll: options2.roll
  497. }
  498. });
  499. }
  500. _getChinaPostion() {
  501. return Cesium.Cartesian3.fromDegrees(116.435314, 40.960521, 1e7);
  502. }
  503. }
  504. Object.assign(jtMap3d.prototype, {
  505. flytoChina() {
  506. this._viewer.camera.flyTo({
  507. destination: this._getChinaPostion(),
  508. duration: 3
  509. });
  510. },
  511. setViewChina: function() {
  512. this._setView({
  513. longitude: 103.84,
  514. latitude: 31.15,
  515. height: 24e6,
  516. heading: 0,
  517. pitch: -90,
  518. roll: 0
  519. });
  520. },
  521. fullMap: function(options2) {
  522. return new Promise((resolve2, reject2) => {
  523. let _self = this;
  524. this._entities.removeById("fullMapRectangle");
  525. options2.isRemove = Cesium.defaultValue(options2.isRemove, true);
  526. options2.duration = Cesium.defaultValue(options2.duration, 3);
  527. options2.heading = Cesium.defaultValue(options2.heading, 0);
  528. options2.pitch = Cesium.defaultValue(options2.pitch, -90);
  529. options2.range = Cesium.defaultValue(options2.range, 0);
  530. var rectangle = Cesium.Rectangle.fromDegrees(
  531. options2.west,
  532. options2.south,
  533. options2.east,
  534. options2.north
  535. );
  536. var fullMapEntity = this._entities.add({
  537. id: "fullMapRectangle",
  538. name: "fullMapRectangle",
  539. rectangle: {
  540. coordinates: rectangle,
  541. material: Cesium.Color.GREEN.withAlpha(0),
  542. height: 10,
  543. outline: false
  544. }
  545. });
  546. var flyPromise = this._viewer.flyTo(fullMapEntity, {
  547. duration: options2.duration,
  548. offset: {
  549. heading: Cesium.Math.toRadians(options2.heading),
  550. pitch: Cesium.Math.toRadians(options2.pitch),
  551. range: options2.range
  552. }
  553. });
  554. flyPromise.then(function(flyPromise2) {
  555. if (flyPromise2) {
  556. if (options2.isRemove) {
  557. fullMapEntity && (_self._entities.remove(fullMapEntity), fullMapEntity = null);
  558. }
  559. resolve2(true);
  560. }
  561. }).catch(function(error) {
  562. console.log(error);
  563. });
  564. });
  565. },
  566. setMapNorth() {
  567. let viewer2 = this._viewer;
  568. let pitch = Cesium.Math.toDegrees(viewer2.camera.pitch).toFixed(0);
  569. var center2 = viewer2.camera.pickEllipsoid(new Cesium.Cartesian2(viewer2.canvas.clientWidth / 2, viewer2.canvas.clientHeight / 2));
  570. var curPosition = Cesium.Ellipsoid.WGS84.cartesianToCartographic(center2);
  571. let centerX = curPosition.longitude * 180 / Math.PI;
  572. let centerY = curPosition.latitude * 180 / Math.PI;
  573. let cameraPointX = viewer2.camera.positionCartographic.longitude * 180 / Math.PI;
  574. let cameraPointY = viewer2.camera.positionCartographic.latitude * 180 / Math.PI;
  575. let cameraPointZ = viewer2.camera.positionCartographic.height.toFixed(0);
  576. var satrt = Cesium.Cartographic.fromDegrees(cameraPointX, cameraPointY, cameraPointZ);
  577. var end = Cesium.Cartographic.fromDegrees(centerX, centerY, 0);
  578. var geodesic = new Cesium.EllipsoidGeodesic();
  579. geodesic.setEndPoints(satrt, end);
  580. var distance2 = geodesic.surfaceDistance;
  581. let range3 = Math.sqrt(Math.pow(distance2, 2) + Math.pow(cameraPointZ - 0, 2));
  582. if (this.centerEntity) {
  583. viewer2.entities.remove(this.centerEntity);
  584. }
  585. this.centerEntity = viewer2.entities.add({
  586. position: Cesium.Cartesian3.fromDegrees(centerX, centerY, 0),
  587. point: {
  588. color: Cesium.Color.RED,
  589. pixelSize: 1
  590. }
  591. });
  592. let offset = new Cesium.HeadingPitchRange(Cesium.Math.toRadians(0), Cesium.Math.toRadians(pitch), range3);
  593. viewer2.zoomTo(this.centerEntity, offset);
  594. },
  595. setMapSpinByPoint(points2, options2) {
  596. let viewer2 = this._viewer;
  597. if (!Cesium.defined(points2)) {
  598. throw new Cesium.DeveloperError("points is required.");
  599. }
  600. options2 = options2 || {};
  601. options2.speed = Cesium.defaultValue(options2.speed, 30);
  602. var position2 = points2;
  603. if (points2 instanceof Cesium.Cartesian3) {
  604. position2 = points2;
  605. } else {
  606. position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], points2[2] || 0);
  607. }
  608. var entity = viewer2.entities.add(
  609. new Cesium.Entity({
  610. point: new Cesium.PointGraphics({
  611. color: new Cesium.Color(1, 1, 0),
  612. pixelSize: 6,
  613. outlineColor: new Cesium.Color(0, 1, 1)
  614. }),
  615. position: position2
  616. })
  617. );
  618. var angle = 360 / options2.speed;
  619. var initialHeading = viewer2.camera.heading;
  620. var pitch = viewer2.camera.pitch;
  621. if (options2.pitch) {
  622. pitch = Cesium.Math.toRadians(options2.pitch);
  623. }
  624. var distance2 = viewer2.camera.positionCartographic.height;
  625. if (options2.height) {
  626. distance2 = options2.height;
  627. }
  628. var startTime = Cesium.JulianDate.fromDate(new Date());
  629. viewer2.clock.startTime = startTime.clone();
  630. viewer2.clock.currentTime = startTime.clone();
  631. viewer2.clock.clockRange = Cesium.ClockRange.CLAMPED;
  632. viewer2.clock.clockStep = Cesium.ClockStep.SYSTEM_CLOCK;
  633. var Exection = function TimeExecution() {
  634. var delTime = Cesium.JulianDate.secondsDifference(viewer2.clock.currentTime, viewer2.clock.startTime);
  635. var heading = Cesium.Math.toRadians(delTime * angle) + initialHeading;
  636. viewer2.scene.camera.setView({
  637. destination: position2,
  638. orientation: {
  639. heading,
  640. pitch
  641. }
  642. });
  643. viewer2.scene.camera.moveBackward(distance2);
  644. if (Cesium.JulianDate.compare(viewer2.clock.currentTime, viewer2.clock.stopTime) >= 0) {
  645. viewer2.clock.onTick.removeEventListener(Exection);
  646. }
  647. var handler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  648. handler.setInputAction(function(click) {
  649. viewer2.clock.onTick.removeEventListener(Exection);
  650. viewer2.entities.remove(entity);
  651. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  652. };
  653. viewer2.clock.onTick.addEventListener(Exection);
  654. }
  655. });
  656. const BD_FACTOR = 3.141592653589793 * 3e3 / 180;
  657. const PI = 3.141592653589793;
  658. const RADIUS = 6378245;
  659. const EE = 0.006693421622965943;
  660. class CoordTransform {
  661. static BD09ToGCJ02(lng, lat) {
  662. let x = +lng - 65e-4;
  663. let y = +lat - 6e-3;
  664. let z = Math.sqrt(x * x + y * y) - 2e-5 * Math.sin(y * BD_FACTOR);
  665. let theta = Math.atan2(y, x) - 3e-6 * Math.cos(x * BD_FACTOR);
  666. let gg_lng = z * Math.cos(theta);
  667. let gg_lat = z * Math.sin(theta);
  668. return [gg_lng, gg_lat];
  669. }
  670. static GCJ02ToBD09(lng, lat) {
  671. lat = +lat;
  672. lng = +lng;
  673. let z = Math.sqrt(lng * lng + lat * lat) + 2e-5 * Math.sin(lat * BD_FACTOR);
  674. let theta = Math.atan2(lat, lng) + 3e-6 * Math.cos(lng * BD_FACTOR);
  675. let bd_lng = z * Math.cos(theta) + 65e-4;
  676. let bd_lat = z * Math.sin(theta) + 6e-3;
  677. return [bd_lng, bd_lat];
  678. }
  679. static WGS84ToGCJ02(lng, lat) {
  680. lat = +lat;
  681. lng = +lng;
  682. if (this.out_of_china(lng, lat)) {
  683. return [lng, lat];
  684. } else {
  685. let d2 = this.delta(lng, lat);
  686. return [lng + d2[0], lat + d2[1]];
  687. }
  688. }
  689. static GCJ02ToWGS84(lng, lat) {
  690. lat = +lat;
  691. lng = +lng;
  692. if (this.out_of_china(lng, lat)) {
  693. return [lng, lat];
  694. } else {
  695. let d2 = this.delta(lng, lat);
  696. let mgLng = lng + d2[0];
  697. let mgLat = lat + d2[1];
  698. return [lng * 2 - mgLng, lat * 2 - mgLat];
  699. }
  700. }
  701. static delta(lng, lat) {
  702. let dLng = this.transformLng(lng - 105, lat - 35);
  703. let dLat = this.transformLat(lng - 105, lat - 35);
  704. const radLat = lat / 180 * PI;
  705. let magic = Math.sin(radLat);
  706. magic = 1 - EE * magic * magic;
  707. const sqrtMagic = Math.sqrt(magic);
  708. dLng = dLng * 180 / (RADIUS / sqrtMagic * Math.cos(radLat) * PI);
  709. dLat = dLat * 180 / (RADIUS * (1 - EE) / (magic * sqrtMagic) * PI);
  710. return [dLng, dLat];
  711. }
  712. static transformLng(lng, lat) {
  713. lat = +lat;
  714. lng = +lng;
  715. let ret = 300 + lng + 2 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.sqrt(Math.abs(lng));
  716. ret += (20 * Math.sin(6 * lng * PI) + 20 * Math.sin(2 * lng * PI)) * 2 / 3;
  717. ret += (20 * Math.sin(lng * PI) + 40 * Math.sin(lng / 3 * PI)) * 2 / 3;
  718. ret += (150 * Math.sin(lng / 12 * PI) + 300 * Math.sin(lng / 30 * PI)) * 2 / 3;
  719. return ret;
  720. }
  721. static transformLat(lng, lat) {
  722. lat = +lat;
  723. lng = +lng;
  724. let ret = -100 + 2 * lng + 3 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng));
  725. ret += (20 * Math.sin(6 * lng * PI) + 20 * Math.sin(2 * lng * PI)) * 2 / 3;
  726. ret += (20 * Math.sin(lat * PI) + 40 * Math.sin(lat / 3 * PI)) * 2 / 3;
  727. ret += (160 * Math.sin(lat / 12 * PI) + 320 * Math.sin(lat * PI / 30)) * 2 / 3;
  728. return ret;
  729. }
  730. static out_of_china(lng, lat) {
  731. lat = +lat;
  732. lng = +lng;
  733. return !(lng > 73.66 && lng < 135.05 && lat > 3.86 && lat < 53.55);
  734. }
  735. static getCatesian3FromPX(viewer2, px) {
  736. let picks = viewer2.scene.drillPick(px);
  737. let cartesian = null;
  738. let isOn3dtiles = false, isOnTerrain = false;
  739. for (let i2 in picks) {
  740. let pick = picks[i2];
  741. if (pick && pick.primitive instanceof Cesium.Cesium3DTileFeature || pick && pick.primitive instanceof Cesium.Cesium3DTileset || pick && pick.primitive instanceof Cesium.Model) {
  742. isOn3dtiles = true;
  743. }
  744. if (isOn3dtiles) {
  745. viewer2.scene.pick(px);
  746. cartesian = viewer2.scene.pickPosition(px);
  747. if (cartesian) {
  748. let cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  749. if (cartographic.height < 0)
  750. cartographic.height = 0;
  751. let lon = Cesium.Math.toDegrees(cartographic.longitude), lat = Cesium.Math.toDegrees(cartographic.latitude), height2 = cartographic.height;
  752. cartesian = this.transformWGS84ToCartesian({
  753. lng: lon,
  754. lat,
  755. alt: height2
  756. });
  757. }
  758. }
  759. }
  760. let boolTerrain = viewer2.terrainProvider instanceof Cesium.EllipsoidTerrainProvider;
  761. if (!isOn3dtiles && !boolTerrain) {
  762. let ray = viewer2.scene.camera.getPickRay(px);
  763. if (!ray)
  764. return null;
  765. cartesian = viewer2.scene.globe.pick(ray, viewer2.scene);
  766. isOnTerrain = true;
  767. }
  768. if (!isOn3dtiles && !isOnTerrain && boolTerrain) {
  769. cartesian = viewer2.scene.camera.pickEllipsoid(
  770. px,
  771. viewer2.scene.globe.ellipsoid
  772. );
  773. }
  774. if (cartesian) {
  775. let position2 = this.transformCartesianToWGS84(cartesian);
  776. if (position2.alt < 0) {
  777. cartesian = this.transformWGS84ToCartesian(position2, 0.1);
  778. }
  779. return cartesian;
  780. }
  781. return false;
  782. }
  783. static transformWGS84ToCartesian(position2, alt) {
  784. return position2 ? Cesium.Cartesian3.fromDegrees(
  785. position2.lng || position2.lon,
  786. position2.lat,
  787. position2.alt = alt || position2.alt,
  788. Cesium.Ellipsoid.WGS84
  789. ) : Cesium.Cartesian3.ZERO;
  790. }
  791. static transformCartesianToWGS84(cartesian) {
  792. let ellipsoid = Cesium.Ellipsoid.WGS84;
  793. let cartographic = ellipsoid.cartesianToCartographic(cartesian);
  794. return {
  795. lng: Cesium.Math.toDegrees(cartographic.longitude),
  796. lat: Cesium.Math.toDegrees(cartographic.latitude),
  797. alt: cartographic.height
  798. };
  799. }
  800. static Cartesian3ListToWGS84(cartesianList) {
  801. let ellipsoid = Cesium.Ellipsoid.WGS84;
  802. let result = [];
  803. for (let index2 = 0; index2 < cartesianList.length; index2++) {
  804. const cartesian = cartesianList[index2];
  805. let cartographic = ellipsoid.cartesianToCartographic(cartesian);
  806. result.push({
  807. lng: Cesium.Math.toDegrees(cartographic.longitude),
  808. lat: Cesium.Math.toDegrees(cartographic.latitude),
  809. alt: cartographic.height
  810. });
  811. }
  812. return result;
  813. }
  814. static Degrees2DMS(value) {
  815. let degrees = Math.floor(value);
  816. let rem = (value - degrees) * 60;
  817. let minutes = Math.floor(rem);
  818. let _second = (rem - minutes) * 60;
  819. let seconds = Math.round(_second);
  820. var _radians = Cesium.Math.toRadians(value);
  821. var _degrees = Cesium.Math.toDegrees(value);
  822. console.log(_radians);
  823. console.log(_degrees);
  824. let DMS = {
  825. degrees,
  826. minutes,
  827. seconds
  828. };
  829. return DMS;
  830. }
  831. static DMS2Degrees(DMS) {
  832. let _double = parseFloat(DMS.degrees) + parseFloat(DMS.minutes) / 60 + parseFloat(DMS.seconds) / 3600;
  833. return parseFloat(_double).toFixed(6);
  834. }
  835. static _cartesian3ToGeo(position2) {
  836. let g = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  837. return {
  838. longitude: Cesium.Math.toDegrees(g.longitude),
  839. latitude: Cesium.Math.toDegrees(g.latitude),
  840. height: g.height
  841. };
  842. }
  843. static _arcToDegree(arc) {
  844. return arc / Math.PI * 180;
  845. }
  846. static _getScreenClickPositionAndHeight(viewer2, screenPoint) {
  847. this._viewer = viewer2;
  848. var lng = void 0, lat = void 0, height2 = void 0;
  849. var ray = this._viewer.scene.camera.getPickRay(screenPoint);
  850. var position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  851. var cartographic = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  852. var feature2 = this._viewer.scene.pick(screenPoint);
  853. if (feature2 == void 0) {
  854. lng = this._arcToDegree(cartographic.longitude);
  855. lat = this._arcToDegree(cartographic.latitude);
  856. height2 = cartographic.height;
  857. } else {
  858. var cartesian = this._viewer.scene.pickPosition(screenPoint);
  859. if (Cesium.defined(cartesian)) {
  860. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  861. lng = this._arcToDegree(cartographic.longitude);
  862. lat = this._arcToDegree(cartographic.latitude);
  863. height2 = cartographic.height;
  864. }
  865. }
  866. return {
  867. lng,
  868. lat,
  869. height: height2
  870. };
  871. }
  872. static _transfromFromScreenPoint(viewer2, screenPosition) {
  873. let location = this._getScreenClickPositionAndHeight(viewer2, screenPosition);
  874. var cartesian = Cesium.Cartesian3.fromDegrees(location.lng, location.lat, location.height);
  875. return {
  876. gLocation: location,
  877. sLocation: cartesian
  878. };
  879. }
  880. }
  881. class PolylineDirectionMaterialProperty {
  882. constructor(options2) {
  883. this.defaultColor = new Cesium.Color(255 / 255, 0, 0, 0);
  884. options2 = options2 || {};
  885. options2.isImageAlpha = Cesium.defaultValue(options2.isImageAlpha, true);
  886. options2.imgUrl = Cesium.defaultValue(options2.imgUrl, "jt3dSDK/imgs/polylinematerial/spriteline1.png");
  887. options2.duration = Cesium.defaultValue(options2.duration, 3e3);
  888. options2.count = Cesium.defaultValue(options2.count, 1);
  889. options2.direction = Cesium.defaultValue(options2.direction, "horizontal");
  890. options2.order = Cesium.defaultValue(options2.order, "-");
  891. if (options2.isImageAlpha) {
  892. options2.color = this.defaultColor;
  893. } else {
  894. if (options2.color instanceof Array) {
  895. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  896. } else if (typeof options2.color === "string") {
  897. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  898. } else {
  899. options2.color = this.defaultColor;
  900. }
  901. }
  902. this._definitionChanged = new Cesium.Event();
  903. this._color = void 0;
  904. this._image = void 0;
  905. this.color = options2.color;
  906. this.image = options2.imgUrl;
  907. this._isImageAlpha = options2.isImageAlpha;
  908. this._duration = options2.duration;
  909. this._count = options2.count;
  910. this._direction = options2.direction;
  911. this._order = options2.order;
  912. this._time = performance.now();
  913. this.addMaterial();
  914. }
  915. addMaterial() {
  916. Cesium.Material.PolylineTrailType = "PolylineTrail";
  917. Cesium.Material.Polylineimage = "images/colors.png";
  918. if (this._direction === "vertical") {
  919. if (this._isImageAlpha) {
  920. Cesium.Material.PolylineTrailSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture2D(image, vec2(fract(st.t " + this._order + " time), st.s));\n material.alpha = colorImage.a;\n material.diffuse = colorImage.rgb* 1.5 ;\n return material;\n }";
  921. } else {
  922. Cesium.Material.PolylineTrailSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture2D(image, vec2(fract(st.t " + this._order + " time), st.s));\n material.alpha = colorImage.a * color.a;\n material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\n return material;\n }";
  923. }
  924. } else if (this._direction === "horizontal") {
  925. if (this._isImageAlpha) {
  926. Cesium.Material.PolylineTrailSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture2D(image, vec2(fract(st.s " + this._order + " time), st.t));\n material.alpha = colorImage.a;\n material.diffuse = colorImage.rgb * 1.5 ;\n return material;\n }";
  927. } else {
  928. Cesium.Material.PolylineTrailSource = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = repeat * materialInput.st;\n vec4 colorImage = texture2D(image, vec2(fract(st.s " + this._order + " time), st.t));\n material.alpha = colorImage.a * color.a;\n material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\n return material;\n }";
  929. }
  930. }
  931. Cesium.Material._materialCache.addMaterial(Cesium.Material.PolylineTrailType, {
  932. fabric: {
  933. type: Cesium.Material.PolylineTrailType,
  934. uniforms: {
  935. color: new Cesium.Color(1, 0, 0, 0.5),
  936. image: Cesium.Material.Polylineimage,
  937. time: 0,
  938. repeat: new Cesium.Cartesian2(5, 1),
  939. order: "-"
  940. },
  941. source: Cesium.Material.PolylineTrailSource
  942. },
  943. translucent: function(material) {
  944. return true;
  945. }
  946. });
  947. }
  948. }
  949. PolylineDirectionMaterialProperty.prototype.getType = function(time) {
  950. return "PolylineTrail";
  951. };
  952. PolylineDirectionMaterialProperty.prototype.getValue = function(time, result) {
  953. if (!Cesium.defined(result)) {
  954. result = {};
  955. }
  956. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, this.defaultColor, result.color);
  957. result.image = Cesium.Property.getValueOrUndefined(this._image, time);
  958. result.time = (performance.now() - this._time) % this._duration / this._duration;
  959. result.repeat = new Cesium.Cartesian2(this._count, 1);
  960. result.order = this._order;
  961. return result;
  962. };
  963. PolylineDirectionMaterialProperty.prototype.equals = function(other) {
  964. return this === other || other instanceof PolylineDirectionMaterialProperty && Cesium.Property.equals(this._color, other._color);
  965. };
  966. Object.defineProperties(PolylineDirectionMaterialProperty.prototype, {
  967. isConstant: {
  968. get: function() {
  969. return false;
  970. }
  971. },
  972. definitionChanged: {
  973. get: function() {
  974. return this._definitionChanged;
  975. }
  976. },
  977. color: Cesium.createPropertyDescriptor("color"),
  978. image: Cesium.createPropertyDescriptor("image")
  979. });
  980. class WallMaterialProperty$1 {
  981. constructor(viewer2, options2) {
  982. this._viewer = viewer2;
  983. options2 = options2 || {};
  984. this._definitionChanged = new Cesium.Event();
  985. this._color = void 0;
  986. this.color = options2.color || Cesium.Color.BLUE;
  987. this.duration = options2.duration || 1e3;
  988. this.count = options2.duration || 1;
  989. this.direction = options2.duration || "vertical";
  990. this.order = options2.duration || "-";
  991. this.trailImage = Cesium.defaultValue(options2.trailImage, "jt3dSDK/imgs/wallmaterial/wl.png");
  992. this._time = new Date().getTime();
  993. this._materialTypeName = "WallMaterial" + this._guid();
  994. this._param = {
  995. color: this.color._value.toCssColorString(),
  996. image: this.trailImage,
  997. duration: this.duration,
  998. count: this.count,
  999. direction: this.direction,
  1000. order: this.order
  1001. };
  1002. Cesium.Material._materialCache.addMaterial(this._materialTypeName, {
  1003. fabric: {
  1004. type: this._materialTypeName,
  1005. uniforms: {
  1006. time: -20,
  1007. color: new Cesium.Color(1, 0, 0, 0.5),
  1008. image: options2.trailImage
  1009. },
  1010. source: this._getDirectionWallShader(options2.param)
  1011. },
  1012. translucent: function(material) {
  1013. return true;
  1014. }
  1015. });
  1016. }
  1017. _guid() {
  1018. function S4() {
  1019. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  1020. }
  1021. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  1022. }
  1023. getType(time) {
  1024. return this._materialTypeName;
  1025. }
  1026. getValue(time, result) {
  1027. if (!Cesium.defined(result)) {
  1028. result = {};
  1029. }
  1030. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.BLUE, result.color);
  1031. result.image = this.trailImage;
  1032. if (this.duration) {
  1033. result.time = (new Date().getTime() - this._time) % this.duration / this.duration;
  1034. }
  1035. this._viewer.scene.requestRender();
  1036. return result;
  1037. }
  1038. equals(other) {
  1039. return this === other || other instanceof WallMaterialProperty$1 && Cesium.Property.equals(this._color, other._color) && other._param.order === this._param.order && other._param.count === this._param.count && other._param.direction === this._param.direction && other.duration === this.duration;
  1040. }
  1041. _getDirectionWallShader(options2) {
  1042. let op = Cesium.defaultValue(options2, {});
  1043. let count = op.count !== void 0 && typeof op.count === "number" && op.count > 0 ? op.count : 1;
  1044. let direction = op.direction === "horizontal" ? "horizontal" : "vertical";
  1045. let order = op.order === "+" ? "+" : "-";
  1046. this._param.count = count;
  1047. this._param.direction = direction;
  1048. this._param.order = order;
  1049. let materail = "";
  1050. materail += "czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n";
  1051. if (direction === "vertical") {
  1052. materail += " vec4 colorImage = texture2D(image,vec2(st.s,fract(float(" + count + ")*st.t " + order + " time)));\n";
  1053. } else if (direction === "horizontal") {
  1054. materail += " vec4 colorImage = texture2D(image, vec2(fract(float(" + count + ")*st.s " + order + " time), st.t));\n";
  1055. }
  1056. materail += " vec4 fragColor;\n fragColor.rgb = color.rgb / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.alpha = colorImage.a * color.a;\n material.diffuse = color.rgb;\n material.emission = fragColor.rgb;\n return material;\n}";
  1057. return materail;
  1058. }
  1059. }
  1060. Object.defineProperties(WallMaterialProperty$1.prototype, {
  1061. isConstant: {
  1062. get: function() {
  1063. return false;
  1064. }
  1065. },
  1066. definitionChanged: {
  1067. get: function() {
  1068. return this._definitionChanged;
  1069. }
  1070. },
  1071. color: Cesium.createPropertyDescriptor("color")
  1072. });
  1073. var tooltip = "";
  1074. function setSessionid$1(num) {
  1075. let len = num || 32;
  1076. let chars = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678";
  1077. let maxPos = chars.length;
  1078. let pwd = "";
  1079. for (let i2 = 0; i2 < len; i2++) {
  1080. pwd += chars.charAt(Math.floor(Math.random() * maxPos));
  1081. }
  1082. return pwd;
  1083. }
  1084. function guid() {
  1085. function S4() {
  1086. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  1087. }
  1088. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  1089. }
  1090. function getGuid(removeMinus) {
  1091. let d2 = new Date().getTime();
  1092. let uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(c) {
  1093. const r2 = (d2 + Math.random() * 16) % 16 | 0;
  1094. d2 = Math.floor(d2 / 16);
  1095. return (c === "x" ? r2 : r2 & 3 | 8).toString(16);
  1096. });
  1097. if (removeMinus) {
  1098. uuid = uuid.replace(/-/g, "");
  1099. }
  1100. return uuid;
  1101. }
  1102. function getHeigthByLngLat(viewer2, options2) {
  1103. if (!viewer2)
  1104. throw new Cesium.DeveloperError("no viewer object!");
  1105. if (!Cesium.defined(options2.longitude) && !Cesium.defined(options2.latitude)) {
  1106. throw new Cesium.DeveloperError("longitude and latitude are required.");
  1107. }
  1108. options2.level = Cesium.defaultValue(options2.level, 11);
  1109. let positions = Cesium.Cartographic.fromDegrees(options2.longitude, options2.latitude);
  1110. let terrainProvider = viewer2.terrainProvider;
  1111. return new Promise((resolve2, reject2) => {
  1112. new Cesium.sampleTerrain(terrainProvider, options2.level, [positions]).then(function(updatedPositions) {
  1113. if (updatedPositions) {
  1114. resolve2(updatedPositions[0].height);
  1115. }
  1116. });
  1117. });
  1118. }
  1119. function getHeigthByPoints(viewer2, options2) {
  1120. if (!viewer2)
  1121. throw new Cesium.DeveloperError("no viewer object!");
  1122. if (!Cesium.defined(options2)) {
  1123. throw new Cesium.DeveloperError("options is required.");
  1124. }
  1125. options2.level = Cesium.defaultValue(options2.level, 11);
  1126. let positions = [];
  1127. let points2 = options2.points;
  1128. for (let i2 = 0; i2 < points2.length; i2++) {
  1129. let pointX = points2[i2][0];
  1130. let pointY = points2[i2][1];
  1131. positions.push(
  1132. Cesium.Cartographic.fromDegrees(pointX, pointY)
  1133. );
  1134. }
  1135. let terrainProvider = viewer2.terrainProvider;
  1136. return new Promise((resolve2, reject2) => {
  1137. new Cesium.sampleTerrain(terrainProvider, options2.level, positions).then(function(updatedPositions) {
  1138. if (updatedPositions) {
  1139. resolve2(updatedPositions);
  1140. }
  1141. });
  1142. });
  1143. }
  1144. function getHeigthByPointsMostDetailed(viewer2, points2) {
  1145. if (!viewer2)
  1146. throw new Cesium.DeveloperError("no viewer object!");
  1147. if (!Cesium.defined(points2)) {
  1148. throw new Cesium.DeveloperError("points is required.");
  1149. }
  1150. let positions = [];
  1151. for (let i2 = 0; i2 < points2.length; i2++) {
  1152. let pointX = points2[i2][0];
  1153. let pointY = points2[i2][1];
  1154. positions.push(Cesium.Cartographic.fromDegrees(pointX, pointY));
  1155. }
  1156. let terrainProvider = viewer2.terrainProvider;
  1157. return new Promise((resolve2, reject2) => {
  1158. let promise = new Cesium.sampleTerrainMostDetailed(terrainProvider, positions);
  1159. promise.then(function(updatedPositions) {
  1160. resolve2(updatedPositions);
  1161. });
  1162. });
  1163. }
  1164. function getHeigthByPointMostDetailed(viewer2, points2) {
  1165. if (!viewer2)
  1166. throw new Cesium.DeveloperError("no viewer object!");
  1167. if (!Cesium.defined(points2)) {
  1168. throw new Cesium.DeveloperError("points is required.");
  1169. }
  1170. let positions = Cesium.Cartographic.fromDegrees(points2[0], points2[1]);
  1171. let terrainProvider = viewer2.terrainProvider;
  1172. return new Promise((resolve2, reject2) => {
  1173. let promise = new Cesium.sampleTerrainMostDetailed(terrainProvider, positions);
  1174. promise.then(function(updatedPositions) {
  1175. resolve2(updatedPositions);
  1176. });
  1177. });
  1178. }
  1179. function createTooltip(frameDiv) {
  1180. var tooltip2 = function(frameDiv2) {
  1181. var div = document.createElement("DIV");
  1182. div.className = "twipsy right";
  1183. var arrow = document.createElement("DIV");
  1184. arrow.className = "twipsy-arrow";
  1185. div.appendChild(arrow);
  1186. var title = document.createElement("DIV");
  1187. title.className = "twipsy-inner";
  1188. div.appendChild(title);
  1189. this._div = div;
  1190. this._title = title;
  1191. frameDiv2.appendChild(div);
  1192. };
  1193. tooltip2.prototype.setVisible = function(visible) {
  1194. this._div.style.display = visible ? "block" : "none";
  1195. };
  1196. tooltip2.prototype.showAt = function(position2, message) {
  1197. if (position2 && message) {
  1198. this.setVisible(true);
  1199. this._title.innerHTML = message;
  1200. this._div.style.left = position2.x + 10 + "px";
  1201. this._div.style.top = position2.y - this._div.clientHeight / 2 + "px";
  1202. }
  1203. };
  1204. return new tooltip2(frameDiv);
  1205. }
  1206. var common = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  1207. __proto__: null,
  1208. setSessionid: setSessionid$1,
  1209. guid,
  1210. getGuid,
  1211. getHeigthByLngLat,
  1212. getHeigthByPoints,
  1213. getHeigthByPointsMostDetailed,
  1214. getHeigthByPointMostDetailed,
  1215. createTooltip
  1216. }, Symbol.toStringTag, { value: "Module" }));
  1217. class PointObject {
  1218. constructor(viewer2) {
  1219. if (!viewer2)
  1220. throw new Cesium.DeveloperError("no viewer object!");
  1221. this._viewer = viewer2;
  1222. }
  1223. }
  1224. Object.assign(PointObject.prototype, {
  1225. addLabel(points2, options2) {
  1226. return new Promise((resolve2, reject2) => {
  1227. if (!Cesium.defined(points2)) {
  1228. throw new Cesium.DeveloperError("points is required.");
  1229. }
  1230. let position2;
  1231. if (points2 instanceof Cesium.Cartesian3) {
  1232. position2 = points2;
  1233. } else {
  1234. position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], points2[2] || 0);
  1235. }
  1236. options2 = options2 || {};
  1237. options2.id = options2.id || setSessionid$1();
  1238. let label = options2.label || {};
  1239. label.text = Cesium.defaultValue(label.text, "\u91D1\u7530CIM\u4E09\u7EF4\u57FA\u7840\u5E73\u53F0");
  1240. label.font = Cesium.defaultValue(label.font, "24px Helvetica");
  1241. if (label.fillColor instanceof Array) {
  1242. label.fillColor = new Cesium.Color(label.fillColor[0] / 255, label.fillColor[1] / 255, label.fillColor[2] / 255, label.fillColor[3]);
  1243. } else if (typeof label.fillColor === "string") {
  1244. label.fillColor = new Cesium.Color.fromCssColorString(label.fillColor);
  1245. } else {
  1246. label.fillColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1247. }
  1248. if (label.outlineColor instanceof Array) {
  1249. label.outlineColor = new Cesium.Color(label.outlineColor[0] / 255, label.outlineColor[1] / 255, label.outlineColor[2] / 255, label.outlineColor[3]);
  1250. } else if (typeof label.outlineColor === "string") {
  1251. label.outlineColor = new Cesium.Color.fromCssColorString(label.outlineColor);
  1252. } else {
  1253. label.outlineColor = new Cesium.Color.fromCssColorString("#FFF");
  1254. }
  1255. label.outlineWidth = Cesium.defaultValue(label.outlineWidth, 1);
  1256. label.showBackground = Cesium.defaultValue(label.showBackground, false);
  1257. if (label.backgroundColor instanceof Array) {
  1258. label.backgroundColor = new Cesium.Color(label.backgroundColor[0] / 255, label.backgroundColor[1] / 255, label.backgroundColor[2] / 255, label.backgroundColor[3]);
  1259. } else if (typeof label.backgroundColor === "string") {
  1260. label.backgroundColor = new Cesium.Color.fromCssColorString(label.backgroundColor);
  1261. } else {
  1262. label.backgroundColor = new Cesium.Color.fromCssColorString("#FFF");
  1263. }
  1264. if (label.backgroundPadding) {
  1265. label.backgroundPadding = new Cesium.Cartesian2(label.backgroundPadding, label.backgroundPadding);
  1266. }
  1267. let entity = new Cesium.Entity({
  1268. position: position2,
  1269. label: {
  1270. text: label.text,
  1271. font: label.font,
  1272. fillColor: label.fillColor,
  1273. outlineColor: label.outlineColor,
  1274. outlineWidth: label.outlineWidth,
  1275. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  1276. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1277. showBackground: label.showBackground,
  1278. backgroundColor: label.backgroundColor,
  1279. backgroundPadding: label.backgroundPadding,
  1280. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  1281. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  1282. }
  1283. });
  1284. if (label.pixelOffset) {
  1285. label.pixelOffset.x = Cesium.defaultValue(label.pixelOffset.x, 0);
  1286. label.pixelOffset.y = Cesium.defaultValue(label.pixelOffset.y, 0);
  1287. entity.label.pixelOffset = new Cesium.Cartesian2(label.pixelOffset.x, label.pixelOffset.y);
  1288. }
  1289. if (label.scaleByDistance) {
  1290. label.scaleByDistance.near = Cesium.defaultValue(label.scaleByDistance.near, 0);
  1291. label.scaleByDistance.nearValue = Cesium.defaultValue(label.scaleByDistance.nearValue, 0);
  1292. label.scaleByDistance.far = Cesium.defaultValue(label.scaleByDistance.far, 1);
  1293. label.scaleByDistance.farValue = Cesium.defaultValue(label.scaleByDistance.farValue, 0);
  1294. entity.label.scaleByDistance = new Cesium.NearFarScalar(label.scaleByDistance.near, label.scaleByDistance.nearValue, label.scaleByDistance.far, label.scaleByDistance.farValue);
  1295. }
  1296. resolve2(entity);
  1297. });
  1298. },
  1299. addPoint(points2, options2) {
  1300. return new Promise((resolve2, reject2) => {
  1301. if (!Cesium.defined(points2)) {
  1302. throw new Cesium.DeveloperError("points is required.");
  1303. }
  1304. let position2;
  1305. if (points2 instanceof Cesium.Cartesian3) {
  1306. position2 = points2;
  1307. } else {
  1308. position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], points2[2] || 0);
  1309. }
  1310. options2 = options2 || {};
  1311. options2.id = options2.id || setSessionid$1();
  1312. let point2 = options2.point || {};
  1313. point2.pixelSize = Cesium.defaultValue(point2.pixelSize, 10);
  1314. if (point2.color instanceof Array) {
  1315. point2.color = new Cesium.Color(point2.color[0] / 255, point2.color[1] / 255, point2.color[2] / 255, point2.color[3]);
  1316. } else if (typeof point2.color === "string") {
  1317. point2.color = new Cesium.Color.fromCssColorString(point2.color);
  1318. } else {
  1319. point2.color = new Cesium.Color.fromCssColorString("#FFF");
  1320. }
  1321. if (point2.outlineColor instanceof Array) {
  1322. point2.outlineColor = new Cesium.Color(point2.outlineColor[0] / 255, point2.outlineColor[1] / 255, point2.outlineColor[2] / 255, point2.outlineColor[3]);
  1323. } else if (typeof point2.outlineColor === "string") {
  1324. point2.outlineColor = new Cesium.Color.fromCssColorString(point2.outlineColor);
  1325. } else {
  1326. point2.outlineColor = new Cesium.Color.fromCssColorString("#FFF");
  1327. }
  1328. point2.outlineWidth = Cesium.defaultValue(point2.outlineWidth, 1);
  1329. let entity = new Cesium.Entity({
  1330. position: position2,
  1331. point: {
  1332. pixelSize: point2.pixelSize,
  1333. color: point2.color,
  1334. outlineColor: point2.outlineColor,
  1335. outlineWidth: point2.outlineWidth,
  1336. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  1337. disableDepthTestDistance: Number.POSITIVE_INFINITY
  1338. }
  1339. });
  1340. if (options2.label) {
  1341. let label = options2.label || {};
  1342. label.text = Cesium.defaultValue(label.text, "");
  1343. label.font = Cesium.defaultValue(label.font, "24px Helvetica");
  1344. if (label.fillColor instanceof Array) {
  1345. label.fillColor = new Cesium.Color(label.fillColor[0] / 255, label.fillColor[1] / 255, label.fillColor[2] / 255, label.fillColor[3]);
  1346. } else if (typeof label.fillColor === "string") {
  1347. label.fillColor = new Cesium.Color.fromCssColorString(label.fillColor);
  1348. } else {
  1349. label.fillColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1350. }
  1351. if (label.outlineColor instanceof Array) {
  1352. label.outlineColor = new Cesium.Color(label.outlineColor[0] / 255, label.outlineColor[1] / 255, label.outlineColor[2] / 255, label.outlineColor[3]);
  1353. } else if (typeof label.outlineColor === "string") {
  1354. label.outlineColor = new Cesium.Color.fromCssColorString(label.outlineColor);
  1355. } else {
  1356. label.outlineColor = new Cesium.Color.fromCssColorString("#FFF");
  1357. }
  1358. label.outlineWidth = Cesium.defaultValue(label.outlineWidth, 1);
  1359. label.showBackground = Cesium.defaultValue(label.showBackground, false);
  1360. if (label.backgroundColor instanceof Array) {
  1361. label.backgroundColor = new Cesium.Color(label.backgroundColor[0] / 255, label.backgroundColor[1] / 255, label.backgroundColor[2] / 255, label.backgroundColor[3]);
  1362. } else if (typeof label.backgroundColor === "string") {
  1363. label.backgroundColor = new Cesium.Color.fromCssColorString(label.backgroundColor);
  1364. } else {
  1365. label.backgroundColor = new Cesium.Color.fromCssColorString("#FFF");
  1366. }
  1367. if (label.backgroundPadding) {
  1368. label.backgroundPadding = new Cesium.Cartesian2(label.backgroundPadding, label.backgroundPadding);
  1369. }
  1370. entity.label = {
  1371. text: label.text,
  1372. font: label.font,
  1373. fillColor: label.fillColor,
  1374. outlineColor: label.outlineColor,
  1375. outlineWidth: label.outlineWidth,
  1376. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  1377. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1378. showBackground: label.showBackground,
  1379. backgroundColor: label.backgroundColor,
  1380. backgroundPadding: new Cesium.Cartesian2(6, 6),
  1381. disableDepthTestDistance: Number.POSITIVE_INFINITY
  1382. };
  1383. if (label.pixelOffset) {
  1384. label.pixelOffset.x = Cesium.defaultValue(label.pixelOffset.x, 0);
  1385. label.pixelOffset.y = Cesium.defaultValue(label.pixelOffset.y, 0);
  1386. entity.label.pixelOffset = new Cesium.Cartesian2(label.pixelOffset.x, label.pixelOffset.y);
  1387. }
  1388. if (label.scaleByDistance) {
  1389. label.scaleByDistance.near = Cesium.defaultValue(label.scaleByDistance.near, 0);
  1390. label.scaleByDistance.nearValue = Cesium.defaultValue(label.scaleByDistance.nearValue, 0);
  1391. label.scaleByDistance.far = Cesium.defaultValue(label.scaleByDistance.far, 1);
  1392. label.scaleByDistance.farValue = Cesium.defaultValue(label.scaleByDistance.farValue, 0);
  1393. entity.label.scaleByDistance = new Cesium.NearFarScalar(label.scaleByDistance.near, label.scaleByDistance.nearValue, label.scaleByDistance.far, label.scaleByDistance.farValue);
  1394. }
  1395. }
  1396. resolve2(entity);
  1397. });
  1398. },
  1399. addBillboard(points2, options2) {
  1400. return new Promise((resolve2, reject2) => {
  1401. if (!Cesium.defined(points2)) {
  1402. throw new Cesium.DeveloperError("points is required.");
  1403. }
  1404. let position2;
  1405. if (points2 instanceof Cesium.Cartesian3) {
  1406. position2 = points2;
  1407. } else {
  1408. position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], points2[2] || 0);
  1409. }
  1410. options2 = options2 || {};
  1411. options2.id = options2.id || setSessionid$1();
  1412. let billboard = options2.billboard || {};
  1413. billboard.image = billboard.imgUrl || "jt3dSDK/imgs/point/point3.png";
  1414. billboard.scale = Cesium.defaultValue(billboard.scale, 1);
  1415. let entity = new Cesium.Entity({
  1416. name: "add billboard",
  1417. position: position2,
  1418. billboard: {
  1419. image: billboard.image,
  1420. horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
  1421. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1422. scale: billboard.scale,
  1423. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  1424. disableDepthTestDistance: Number.POSITIVE_INFINITY
  1425. }
  1426. });
  1427. if (options2.properties) {
  1428. entity.properties = options2.properties;
  1429. }
  1430. if (billboard.pixelOffset) {
  1431. billboard.pixelOffset.x = Cesium.defaultValue(billboard.pixelOffset.x, 0);
  1432. billboard.pixelOffset.y = Cesium.defaultValue(billboard.pixelOffset.y, 0);
  1433. entity.billboard.pixelOffset = new Cesium.Cartesian2(billboard.pixelOffset.x, billboard.pixelOffset.y);
  1434. }
  1435. if (billboard.scaleByDistance) {
  1436. billboard.scaleByDistance.near = Cesium.defaultValue(billboard.scaleByDistance.near, 0);
  1437. billboard.scaleByDistance.nearValue = Cesium.defaultValue(billboard.scaleByDistance.nearValue, 0);
  1438. billboard.scaleByDistance.far = Cesium.defaultValue(billboard.scaleByDistance.far, 1);
  1439. billboard.scaleByDistance.farValue = Cesium.defaultValue(billboard.scaleByDistance.farValue, 0);
  1440. entity.billboard.scaleByDistance = new Cesium.NearFarScalar(billboard.scaleByDistance.near, billboard.scaleByDistance.nearValue, billboard.scaleByDistance.far, billboard.scaleByDistance.farValue);
  1441. }
  1442. if (options2.label) {
  1443. let label = options2.label || {};
  1444. label.text = Cesium.defaultValue(label.text, "");
  1445. label.font = Cesium.defaultValue(label.font, "24px Helvetica");
  1446. if (label.fillColor instanceof Array) {
  1447. label.fillColor = new Cesium.Color(label.fillColor[0] / 255, label.fillColor[1] / 255, label.fillColor[2] / 255, label.fillColor[3]);
  1448. } else if (typeof label.fillColor === "string") {
  1449. label.fillColor = new Cesium.Color.fromCssColorString(label.fillColor);
  1450. } else {
  1451. label.fillColor = new Cesium.Color.fromCssColorString("#ff0000");
  1452. }
  1453. if (label.outlineColor instanceof Array) {
  1454. label.outlineColor = new Cesium.Color(label.outlineColor[0] / 255, label.outlineColor[1] / 255, label.outlineColor[2] / 255, label.outlineColor[3]);
  1455. } else if (typeof label.outlineColor === "string") {
  1456. label.outlineColor = new Cesium.Color.fromCssColorString(label.outlineColor);
  1457. } else {
  1458. label.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1459. }
  1460. label.outlineWidth = Cesium.defaultValue(label.outlineWidth, 1);
  1461. label.showBackground = Cesium.defaultValue(label.showBackground, false);
  1462. if (label.backgroundColor instanceof Array) {
  1463. label.backgroundColor = new Cesium.Color(label.backgroundColor[0] / 255, label.backgroundColor[1] / 255, label.backgroundColor[2] / 255, label.backgroundColor[3]);
  1464. } else if (typeof label.backgroundColor === "string") {
  1465. label.backgroundColor = new Cesium.Color.fromCssColorString(label.backgroundColor);
  1466. } else {
  1467. label.backgroundColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1468. }
  1469. if (label.backgroundPadding) {
  1470. label.backgroundPadding = new Cesium.Cartesian2(label.backgroundPadding, label.backgroundPadding);
  1471. }
  1472. entity.label = {
  1473. text: label.text,
  1474. font: label.font,
  1475. fillColor: label.fillColor,
  1476. outlineColor: label.outlineColor,
  1477. outlineWidth: label.outlineWidth,
  1478. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  1479. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1480. showBackground: label.showBackground,
  1481. backgroundColor: label.backgroundColor,
  1482. backgroundPadding: label.backgroundPadding,
  1483. disableDepthTestDistance: Number.POSITIVE_INFINITY
  1484. };
  1485. if (label.pixelOffset) {
  1486. label.pixelOffset.x = Cesium.defaultValue(label.pixelOffset.x, 0);
  1487. label.pixelOffset.y = Cesium.defaultValue(label.pixelOffset.y, 0);
  1488. entity.label.pixelOffset = new Cesium.Cartesian2(label.pixelOffset.x, label.pixelOffset.y);
  1489. }
  1490. if (label.scaleByDistance) {
  1491. label.scaleByDistance.near = Cesium.defaultValue(label.scaleByDistance.near, 0);
  1492. label.scaleByDistance.nearValue = Cesium.defaultValue(label.scaleByDistance.nearValue, 0);
  1493. label.scaleByDistance.far = Cesium.defaultValue(label.scaleByDistance.far, 1);
  1494. label.scaleByDistance.farValue = Cesium.defaultValue(label.scaleByDistance.farValue, 0);
  1495. entity.label.scaleByDistance = new Cesium.NearFarScalar(label.scaleByDistance.near, label.scaleByDistance.nearValue, label.scaleByDistance.far, label.scaleByDistance.farValue);
  1496. }
  1497. }
  1498. resolve2(entity);
  1499. });
  1500. },
  1501. addModel: function(points2, options2) {
  1502. this._viewer;
  1503. return new Promise((resolve2, reject2) => {
  1504. if (!Cesium.defined(points2)) {
  1505. throw new Cesium.DeveloperError("points is required.");
  1506. }
  1507. let position2;
  1508. if (points2 instanceof Cesium.Cartesian3) {
  1509. position2 = points2;
  1510. } else {
  1511. position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], points2[2] || 0);
  1512. }
  1513. options2 = options2 || {};
  1514. options2.id = options2.id || setSessionid$1();
  1515. let model = options2.model || {};
  1516. model.alpha = Cesium.defaultValue(model.alpha, 1);
  1517. model.heading = Cesium.defaultValue(model.heading, 0);
  1518. model.pitch = Cesium.defaultValue(model.pitch, 0);
  1519. model.roll = Cesium.defaultValue(model.roll, 0);
  1520. var heading = Cesium.Math.toRadians(model.heading);
  1521. var pitch = model.pitch;
  1522. var roll = model.roll;
  1523. new Cesium.HeadingPitchRoll(heading, pitch, roll);
  1524. let entity = new Cesium.Entity({
  1525. position: position2,
  1526. model: {
  1527. uri: model.url,
  1528. incrementallyLoadTextures: true,
  1529. colorBlendMode: Cesium.ColorBlendMode["HIGHLIGHT"],
  1530. colorBlendAmount: 0.1,
  1531. color: Cesium.Color.WHITE.withAlpha(model.alpha),
  1532. imageBasedLightingFactor: new Cesium.Cartesian2(12, 13),
  1533. runAnimations: true,
  1534. show: true,
  1535. debugWireframe: false,
  1536. debugShowBoundingVolume: false,
  1537. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
  1538. disableDepthTestDistance: Number.POSITIVE_INFINITY
  1539. }
  1540. });
  1541. if (model.minimumPixelSize) {
  1542. entity.model.minimumPixelSize = model.minimumPixelSize;
  1543. }
  1544. if (model.maximumScale) {
  1545. entity.model.maximumScale = model.maximumScale;
  1546. }
  1547. if (model.silhouetteColor) {
  1548. if (model.silhouetteColor instanceof Array) {
  1549. entity.model.silhouetteColor = new Cesium.Color(model.silhouetteColor[0] / 255, model.silhouetteColor[1] / 255, model.silhouetteColor[2] / 255, model.silhouetteColor[3]);
  1550. } else if (typeof model.silhouetteColor === "string") {
  1551. entity.model.silhouetteColor = new Cesium.Color.fromCssColorString(model.silhouetteColor);
  1552. }
  1553. }
  1554. model.silhouetteSize = Cesium.defaultValue(model.silhouetteSize, 1);
  1555. resolve2(entity);
  1556. });
  1557. },
  1558. generatePoint(points2, options2) {
  1559. return new Promise((resolve2, reject2) => {
  1560. let _self = this;
  1561. if (!Cesium.defined(points2)) {
  1562. throw new Cesium.DeveloperError("points is required.");
  1563. }
  1564. options2 = options2 || {};
  1565. options2.id = options2.id || setSessionid$1();
  1566. let point2 = options2.point || {};
  1567. point2.pixelSize = Cesium.defaultValue(point2.pixelSize, 10);
  1568. if (point2.color instanceof Array) {
  1569. point2.color = new Cesium.Color(point2.color[0] / 255, point2.color[1] / 255, point2.color[2] / 255, point2.color[3]);
  1570. } else if (typeof point2.color === "string") {
  1571. point2.color = new Cesium.Color.fromCssColorString(point2.color);
  1572. } else {
  1573. point2.color = new Cesium.Color.fromCssColorString("#FFF");
  1574. }
  1575. if (point2.outlineColor instanceof Array) {
  1576. point2.outlineColor = new Cesium.Color(point2.outlineColor[0] / 255, point2.outlineColor[1] / 255, point2.outlineColor[2] / 255, point2.outlineColor[3]);
  1577. } else if (typeof point2.outlineColor === "string") {
  1578. point2.outlineColor = new Cesium.Color.fromCssColorString(point2.outlineColor);
  1579. } else {
  1580. point2.outlineColor = new Cesium.Color.fromCssColorString("#FFF");
  1581. }
  1582. point2.outlineWidth = Cesium.defaultValue(point2.outlineWidth, 1);
  1583. let terrainAltitude = getHeigthByPointsMostDetailed(_self._viewer, [points2]);
  1584. terrainAltitude.then(function(updatedPositions) {
  1585. let position2 = Cesium.Cartesian3.fromDegrees(points2[0], points2[1], updatedPositions[0].height);
  1586. let entity = new Cesium.Entity({
  1587. id: options2.id,
  1588. position: position2,
  1589. point: {
  1590. pixelSize: point2.pixelSize,
  1591. color: point2.color,
  1592. outlineColor: point2.outlineColor,
  1593. outlineWidth: point2.outlineWidth,
  1594. heightReference: Cesium.HeightReference.NONE,
  1595. disableDepthTestDistance: updatedPositions[0].height
  1596. }
  1597. });
  1598. if (options2.label) {
  1599. let label = options2.label || {};
  1600. label.text = Cesium.defaultValue(label.text, "");
  1601. label.font = Cesium.defaultValue(label.font, "24px Helvetica");
  1602. if (label.fillColor instanceof Array) {
  1603. label.fillColor = new Cesium.Color(label.fillColor[0] / 255, label.fillColor[1] / 255, label.fillColor[2] / 255, label.fillColor[3]);
  1604. } else if (typeof label.fillColor === "string") {
  1605. label.fillColor = new Cesium.Color.fromCssColorString(label.fillColor);
  1606. } else {
  1607. label.fillColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1608. }
  1609. if (label.outlineColor instanceof Array) {
  1610. label.outlineColor = new Cesium.Color(label.outlineColor[0] / 255, label.outlineColor[1] / 255, label.outlineColor[2] / 255, label.outlineColor[3]);
  1611. } else if (typeof label.outlineColor === "string") {
  1612. label.outlineColor = new Cesium.Color.fromCssColorString(label.outlineColor);
  1613. } else {
  1614. label.outlineColor = new Cesium.Color.fromCssColorString("#FFF");
  1615. }
  1616. label.outlineWidth = Cesium.defaultValue(label.outlineWidth, 1);
  1617. label.showBackground = Cesium.defaultValue(label.showBackground, false);
  1618. if (label.backgroundColor instanceof Array) {
  1619. label.backgroundColor = new Cesium.Color(label.backgroundColor[0] / 255, label.backgroundColor[1] / 255, label.backgroundColor[2] / 255, label.backgroundColor[3]);
  1620. } else if (typeof label.backgroundColor === "string") {
  1621. label.backgroundColor = new Cesium.Color.fromCssColorString(label.backgroundColor);
  1622. } else {
  1623. label.backgroundColor = new Cesium.Color.fromCssColorString("#FFF");
  1624. }
  1625. label.scale = Cesium.defaultValue(label.scale, 1);
  1626. entity.label = {
  1627. text: label.text,
  1628. font: label.font,
  1629. fillColor: label.fillColor,
  1630. outlineColor: label.outlineColor,
  1631. outlineWidth: label.outlineWidth,
  1632. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  1633. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1634. showBackground: label.showBackground,
  1635. backgroundColor: label.backgroundColor,
  1636. backgroundPadding: new Cesium.Cartesian2(6, 6),
  1637. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  1638. scale: label.scale
  1639. };
  1640. if (label.pixelOffset) {
  1641. label.pixelOffset.x = Cesium.defaultValue(label.pixelOffset.x, 0);
  1642. label.pixelOffset.y = Cesium.defaultValue(label.pixelOffset.y, 0);
  1643. entity.label.pixelOffset = new Cesium.Cartesian2(label.pixelOffset.x, label.pixelOffset.y);
  1644. }
  1645. if (label.scaleByDistance) {
  1646. label.scaleByDistance.near = Cesium.defaultValue(label.scaleByDistance.near, 0);
  1647. label.scaleByDistance.nearValue = Cesium.defaultValue(label.scaleByDistance.nearValue, 0);
  1648. label.scaleByDistance.far = Cesium.defaultValue(label.scaleByDistance.far, 1);
  1649. label.scaleByDistance.farValue = Cesium.defaultValue(label.scaleByDistance.farValue, 0);
  1650. entity.label.scaleByDistance = new Cesium.NearFarScalar(label.scaleByDistance.near, label.scaleByDistance.nearValue, label.scaleByDistance.far, label.scaleByDistance.farValue);
  1651. }
  1652. }
  1653. resolve2(entity);
  1654. });
  1655. });
  1656. },
  1657. addBillboardByGeoJson: function(geoJsonUrl, options2) {
  1658. return new Promise((resolve2, reject2) => {
  1659. let viewer2 = this._viewer;
  1660. if (!Cesium.defined(geoJsonUrl)) {
  1661. throw new Cesium.DeveloperError("geoJsonUrl is required.");
  1662. }
  1663. options2 = options2 || {};
  1664. options2.id = options2.id || setSessionid$1();
  1665. let billboard = options2.billboard || {};
  1666. billboard.imgUrl = Cesium.defaultValue(billboard.imgUrl, "jt3dSDK/imgs/point/point3.png");
  1667. billboard.scale = Cesium.defaultValue(billboard.scale, 1);
  1668. let label = options2.label || {};
  1669. label.text = Cesium.defaultValue(label.text, "");
  1670. label.textField = Cesium.defaultValue(label.textField, "");
  1671. label.font = Cesium.defaultValue(label.font, "24px Helvetica");
  1672. if (label.fillColor instanceof Array) {
  1673. label.fillColor = new Cesium.Color(label.fillColor[0] / 255, label.fillColor[1] / 255, label.fillColor[2] / 255, label.fillColor[3]);
  1674. } else if (typeof label.fillColor === "string") {
  1675. label.fillColor = new Cesium.Color.fromCssColorString(label.fillColor);
  1676. } else {
  1677. label.fillColor = new Cesium.Color.fromCssColorString("#ff0000");
  1678. }
  1679. if (label.outlineColor instanceof Array) {
  1680. label.outlineColor = new Cesium.Color(label.outlineColor[0] / 255, label.outlineColor[1] / 255, label.outlineColor[2] / 255, label.outlineColor[3]);
  1681. } else if (typeof label.outlineColor === "string") {
  1682. label.outlineColor = new Cesium.Color.fromCssColorString(label.outlineColor);
  1683. } else {
  1684. label.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1685. }
  1686. label.outlineWidth = Cesium.defaultValue(label.outlineWidth, 1);
  1687. label.showBackground = Cesium.defaultValue(label.showBackground, false);
  1688. if (label.backgroundColor instanceof Array) {
  1689. label.backgroundColor = new Cesium.Color(label.backgroundColor[0] / 255, label.backgroundColor[1] / 255, label.backgroundColor[2] / 255, label.backgroundColor[3]);
  1690. } else if (typeof label.backgroundColor === "string") {
  1691. label.backgroundColor = new Cesium.Color.fromCssColorString(label.backgroundColor);
  1692. } else {
  1693. label.backgroundColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1694. }
  1695. label.scale = Cesium.defaultValue(label.scale, 1);
  1696. const dataSource = new Cesium.GeoJsonDataSource(options2.id);
  1697. dataSource.load(geoJsonUrl, {
  1698. clampToGround: true
  1699. }).then(function(data) {
  1700. viewer2.dataSources.add(data);
  1701. const entities2 = data.entities.values;
  1702. entities2.forEach((entity) => {
  1703. entity.billboard = {
  1704. image: billboard.imgUrl,
  1705. horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
  1706. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1707. scale: billboard.scale,
  1708. disableDepthTestDistance: Number.POSITIVE_INFINITY
  1709. };
  1710. let labelText = label.text;
  1711. if (entity.properties[label.textField]) {
  1712. labelText = entity.properties[label.textField]._value;
  1713. }
  1714. if (labelText === "") {
  1715. labelText = (i + 1).toString();
  1716. }
  1717. entity.label = {
  1718. text: labelText.toString(),
  1719. font: label.font,
  1720. fillColor: label.fillColor,
  1721. outlineColor: label.outlineColor,
  1722. outlineWidth: label.outlineWidth,
  1723. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  1724. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  1725. showBackground: label.showBackground,
  1726. backgroundColor: label.backgroundColor,
  1727. backgroundPadding: new Cesium.Cartesian2(6, 6),
  1728. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  1729. scale: label.scale
  1730. };
  1731. if (label.scaleByDistance) {
  1732. label.scaleByDistance.near = Cesium.defaultValue(label.scaleByDistance.near, 0);
  1733. label.scaleByDistance.nearValue = Cesium.defaultValue(label.scaleByDistance.nearValue, 0);
  1734. label.scaleByDistance.far = Cesium.defaultValue(label.scaleByDistance.far, 1);
  1735. label.scaleByDistance.farValue = Cesium.defaultValue(label.scaleByDistance.farValue, 0);
  1736. entity.label.scaleByDistance = new Cesium.NearFarScalar(label.scaleByDistance.near, label.scaleByDistance.nearValue, label.scaleByDistance.far, label.scaleByDistance.farValue);
  1737. }
  1738. });
  1739. });
  1740. });
  1741. },
  1742. addGltf: function(options2) {
  1743. let viewer2 = this._viewer;
  1744. return new Promise((resolve2, reject2) => {
  1745. if (!Cesium.defined(options2.points)) {
  1746. resolve2("options.points is required.");
  1747. throw new Cesium.DeveloperError("options.points is required.");
  1748. }
  1749. if (!Cesium.defined(options2.url)) {
  1750. resolve2("options.url is required.");
  1751. throw new Cesium.DeveloperError("options.url is required.");
  1752. }
  1753. options2.id = options2.id || setSessionid$1();
  1754. options2.heading = Cesium.defaultValue(options2.heading, 0);
  1755. options2.pitch = Cesium.defaultValue(options2.pitch, 0);
  1756. options2.roll = Cesium.defaultValue(options2.roll, 0);
  1757. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  1758. let position2 = void 0;
  1759. if (options2.points instanceof Cesium.Cartesian3) {
  1760. position2 = options2.points;
  1761. } else {
  1762. position2 = Cesium.Cartesian3.fromDegrees(options2.points[0], options2.points[1], options2.points[2] || 0);
  1763. }
  1764. var heading = Cesium.Math.toRadians(options2.heading);
  1765. var pitch = options2.pitch;
  1766. var roll = options2.roll;
  1767. var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
  1768. var modelGltf = viewer2.entities.add({
  1769. id: options2.id,
  1770. position: position2,
  1771. orientation: Cesium.Transforms.headingPitchRollQuaternion(position2, hpr),
  1772. model: {
  1773. uri: options2.url,
  1774. incrementallyLoadTextures: true,
  1775. colorBlendMode: Cesium.ColorBlendMode["HIGHLIGHT"],
  1776. colorBlendAmount: 0.1,
  1777. color: Cesium.Color.WHITE.withAlpha(options2.alpha),
  1778. imageBasedLightingFactor: new Cesium.Cartesian2(12, 13),
  1779. runAnimations: true,
  1780. show: true,
  1781. debugWireframe: false,
  1782. debugShowBoundingVolume: false
  1783. }
  1784. });
  1785. if (options2.minimumPixelSize) {
  1786. modelGltf.model.minimumPixelSize = options2.minimumPixelSize;
  1787. }
  1788. if (options2.maximumScale) {
  1789. modelGltf.model.maximumScale = options2.maximumScale;
  1790. }
  1791. if (options2.silhouetteColor) {
  1792. if (options2.silhouetteColor instanceof Array) {
  1793. options2.silhouetteColor = new Cesium.Color(options2.silhouetteColor[0] / 255, options2.silhouetteColor[1] / 255, options2.silhouetteColor[2] / 255, options2.silhouetteColor[3]);
  1794. } else if (typeof options2.silhouetteColor === "string") {
  1795. options2.silhouetteColor = new Cesium.Color.fromCssColorString(options2.silhouetteColor);
  1796. } else {
  1797. options2.silhouetteColor = new Cesium.Color.fromCssColorString("#FFFF00");
  1798. }
  1799. }
  1800. window[options2.id] = modelGltf;
  1801. resolve2(options2.id);
  1802. });
  1803. },
  1804. addModelFromGltf(points2, options2) {
  1805. let viewer2 = this._viewer;
  1806. return new Promise((resolve2, reject2) => {
  1807. if (!Cesium.defined(options2.points)) {
  1808. resolve2("options.points is required.");
  1809. throw new Cesium.DeveloperError("options.points is required.");
  1810. }
  1811. if (!Cesium.defined(options2.url)) {
  1812. resolve2("options.url is required.");
  1813. throw new Cesium.DeveloperError("options.url is required.");
  1814. }
  1815. options2.id = options2.id || setSessionid$1();
  1816. options2.scale = Cesium.defaultValue(options2.scale, 1);
  1817. let position2 = void 0;
  1818. if (options2.points instanceof Cesium.Cartesian3) {
  1819. position2 = options2.points;
  1820. } else {
  1821. position2 = Cesium.Cartesian3.fromDegrees(options2.points[0], options2.points[1], options2.points[2] || 0);
  1822. }
  1823. const modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(position2);
  1824. let model = viewer2.scene.primitives.add(
  1825. Cesium.Model.fromGltf({
  1826. show: true,
  1827. url: options2.url,
  1828. modelMatrix,
  1829. lightColor: new Cesium.Cartesian3(10, 10, 10),
  1830. debugWireframe: false,
  1831. debugShowBoundingVolume: false
  1832. })
  1833. );
  1834. model.readyPromise.then(function() {
  1835. var rotationX = Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(0)));
  1836. Cesium.Matrix4.multiply(model.modelMatrix, rotationX, model.modelMatrix);
  1837. });
  1838. window[options2.id] = model;
  1839. resolve2(options2.id);
  1840. });
  1841. }
  1842. });
  1843. class PolylineObject {
  1844. constructor(viewer2) {
  1845. if (!viewer2)
  1846. throw new Cesium.DeveloperError("no viewer object!");
  1847. this._viewer = viewer2;
  1848. }
  1849. }
  1850. Object.assign(PolylineObject.prototype, {
  1851. addPolyline: function(points2, options2) {
  1852. this._viewer;
  1853. return new Promise((resolve2, reject2) => {
  1854. if (!Cesium.defined(points2)) {
  1855. throw new Cesium.DeveloperError("points is required.");
  1856. }
  1857. if (points2.length < 2) {
  1858. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  1859. }
  1860. let positions;
  1861. if (points2[0] instanceof Cesium.Cartesian3) {
  1862. positions = points2;
  1863. } else {
  1864. positions = points2.map((point2) => {
  1865. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  1866. });
  1867. }
  1868. options2 = options2 || {};
  1869. options2 = options2 || {};
  1870. options2.id = options2.id || setSessionid$1();
  1871. options2.clampToGround = Cesium.defaultValue(options2.clampToGround, true);
  1872. options2.width = Cesium.defaultValue(options2.width, 3);
  1873. options2.minHeigh = Cesium.defaultValue(options2.minHeigh, 0);
  1874. options2.maxHeigh = Cesium.defaultValue(options2.maxHeigh, 2e8);
  1875. let distanceDisplayCondition = new Cesium.DistanceDisplayCondition(options2.minHeigh, options2.maxHeigh);
  1876. let material = new PolylineDirectionMaterialProperty(options2);
  1877. let entity = new Cesium.Entity({
  1878. name: "line",
  1879. polyline: {
  1880. positions,
  1881. width: options2.width,
  1882. material,
  1883. distanceDisplayCondition
  1884. }
  1885. });
  1886. if (options2.clampToGround) {
  1887. entity.polyline.clampToGround = true;
  1888. }
  1889. resolve2(entity);
  1890. });
  1891. },
  1892. drawPolylineByGeoJson: function(geoJsonUrl, options2) {
  1893. return new Promise((resolve2, reject2) => {
  1894. let viewer2 = this._viewer;
  1895. if (!Cesium.defined(geoJsonUrl)) {
  1896. throw new Cesium.DeveloperError("geoJsonUrl is required.");
  1897. }
  1898. options2 = options2 || {};
  1899. options2.id = options2.id || setSessionid$1();
  1900. options2.clampToGround = Cesium.defaultValue(options2.clampToGround, true);
  1901. options2.width = Cesium.defaultValue(options2.width, 3);
  1902. options2.minHeigh = Cesium.defaultValue(options2.minHeigh, 0);
  1903. options2.maxHeigh = Cesium.defaultValue(options2.maxHeigh, 2e8);
  1904. let promise = Cesium.GeoJsonDataSource.load(geoJsonUrl, {
  1905. clampToGround: options2.clampToGround
  1906. });
  1907. promise.then((dataSource) => {
  1908. viewer2.dataSources.add(dataSource);
  1909. dataSource.name = options2.id;
  1910. let entities2 = dataSource.entities.values;
  1911. let distanceDisplayCondition = new Cesium.DistanceDisplayCondition(options2.minHeigh, options2.maxHeigh);
  1912. let material = new PolylineDirectionMaterialProperty(options2);
  1913. for (var i2 = 0; i2 < entities2.length; i2++) {
  1914. var entity = entities2[i2];
  1915. entity.polyline.distanceDisplayCondition = distanceDisplayCondition;
  1916. entity.polyline.material = material;
  1917. entity.polyline.width = options2.width;
  1918. if (options2.clampToGround) {
  1919. entity.polyline.clampToGround = true;
  1920. }
  1921. }
  1922. resolve2(entities2);
  1923. });
  1924. });
  1925. },
  1926. PolylineLinkPulseMaterialProperty: function(points2, options2) {
  1927. return new Promise((resolve2, reject2) => {
  1928. if (!Cesium.defined(points2)) {
  1929. throw new Cesium.DeveloperError("points is required.");
  1930. }
  1931. if (points2.length < 2) {
  1932. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  1933. }
  1934. let positions = points2.map((point2) => {
  1935. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  1936. });
  1937. options2 = options2 || {};
  1938. options2.id = options2.id || setSessionid$1();
  1939. options2.width = options2.width || 5;
  1940. let material = new PolylineDirectionMaterialProperty(options2);
  1941. let entity = this._viewer.entities.add({
  1942. id: options2.id,
  1943. name: "Pulse line",
  1944. polyline: {
  1945. positions,
  1946. width: options2.width,
  1947. material,
  1948. clampToGround: true
  1949. }
  1950. });
  1951. resolve2(entity);
  1952. });
  1953. },
  1954. PolylineArrowMaterialProperty: function(points2, options2) {
  1955. return new Promise((resolve2, reject2) => {
  1956. if (!Cesium.defined(points2)) {
  1957. throw new Cesium.DeveloperError("points is required.");
  1958. }
  1959. if (points2.length < 2) {
  1960. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  1961. }
  1962. let positions = points2.map((point2) => {
  1963. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  1964. });
  1965. options2 = options2 || {};
  1966. options2.id = options2.id || setSessionid$1();
  1967. options2.width = options2.width || 5;
  1968. let material = new PolylineDirectionMaterialProperty(options2);
  1969. let entity = this._viewer.entities.add({
  1970. id: options2.id,
  1971. name: "Pulse line",
  1972. polyline: {
  1973. positions,
  1974. width: options2.width,
  1975. material,
  1976. clampToGround: true
  1977. }
  1978. });
  1979. resolve2(entity);
  1980. });
  1981. },
  1982. drawGlowingLine(points2, options2) {
  1983. return new Promise((resolve2, reject2) => {
  1984. if (!Cesium.defined(points2)) {
  1985. throw new Cesium.DeveloperError("points is required.");
  1986. }
  1987. if (points2.length < 2) {
  1988. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  1989. }
  1990. let positions = points2.map((point2) => {
  1991. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  1992. });
  1993. options2 = options2 || {};
  1994. options2.id = options2.id || setSessionid$1();
  1995. if (options2.color) {
  1996. if (options2.color instanceof Array) {
  1997. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  1998. } else if (typeof options2.color === "string") {
  1999. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2000. } else {
  2001. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2002. }
  2003. }
  2004. options2.width = options2.width || 5;
  2005. options2.glowPower = options2.glowPower || 0.25;
  2006. options2.taperPower = options2.taperPower || 1;
  2007. let entity = this._viewer.entities.add({
  2008. id: options2.id,
  2009. name: "Glowing blue line on the surface",
  2010. polyline: {
  2011. clampToGround: true,
  2012. positions,
  2013. width: options2.width,
  2014. followSurface: true,
  2015. material: new Cesium.PolylineGlowMaterialProperty({
  2016. color: options2.color,
  2017. glowPower: options2.glowPower,
  2018. taperPower: options2.taperPower
  2019. })
  2020. }
  2021. });
  2022. resolve2(entity);
  2023. });
  2024. },
  2025. drawSpecifyColorLine(points2, options2) {
  2026. return new Promise((resolve2, reject2) => {
  2027. if (!Cesium.defined(points2)) {
  2028. reject2("points is required.");
  2029. }
  2030. if (points2.length < 2) {
  2031. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2032. }
  2033. let positions = points2.map((point2) => {
  2034. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2035. });
  2036. options2 = options2 || {};
  2037. options2.id = options2.id || setSessionid$1();
  2038. if (options2.color) {
  2039. if (options2.color instanceof Array) {
  2040. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  2041. } else if (typeof options2.color === "string") {
  2042. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2043. } else {
  2044. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2045. }
  2046. }
  2047. options2.width = options2.width || 5;
  2048. let entity = this._viewer.entities.add({
  2049. id: options2.id,
  2050. name: "Red line on the surface",
  2051. polyline: {
  2052. clampToGround: true,
  2053. positions,
  2054. width: options2.width,
  2055. material: options2.color
  2056. }
  2057. });
  2058. resolve2(entity);
  2059. });
  2060. },
  2061. drawSpecifyColorAndOutlineColorLine(points2, options2) {
  2062. return new Promise((resolve2, reject2) => {
  2063. if (!Cesium.defined(points2)) {
  2064. throw new Cesium.DeveloperError("points is required.");
  2065. }
  2066. if (points2.length < 2) {
  2067. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2068. }
  2069. let positions = points2.map((point2) => {
  2070. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2071. });
  2072. options2 = options2 || {};
  2073. options2.id = options2.id || setSessionid$1();
  2074. if (options2.color) {
  2075. if (options2.color instanceof Array) {
  2076. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  2077. } else if (typeof options2.color === "string") {
  2078. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2079. } else {
  2080. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2081. }
  2082. }
  2083. options2.width = options2.width || 5;
  2084. if (options2.outlineColor) {
  2085. if (options2.outlineColor instanceof Array) {
  2086. options2.outlineColor = new Cesium.Color(options2.outlineColor[0] / 255, options2.outlineColor[1] / 255, options2.outlineColor[2] / 255, options2.outlineColor[3]);
  2087. } else if (typeof options2.outlineColor === "string") {
  2088. options2.outlineColor = new Cesium.Color.fromCssColorString(options2.outlineColor);
  2089. } else {
  2090. options2.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  2091. }
  2092. }
  2093. options2.outlineWidth = Cesium.defaultValue(options2.outlineWidth, 1);
  2094. let entity = this._viewer.entities.add({
  2095. id: options2.id,
  2096. name: "Orange line with black outline at height and following the surface",
  2097. polyline: {
  2098. clampToGround: true,
  2099. positions,
  2100. width: options2.width,
  2101. material: new Cesium.PolylineOutlineMaterialProperty({
  2102. color: options2.color,
  2103. outlineWidth: options2.outlineWidth,
  2104. outlineColor: options2.outlineColor
  2105. })
  2106. }
  2107. });
  2108. resolve2(entity);
  2109. });
  2110. },
  2111. drawSpecifyColorArrowStaticStateLine(points2, options2) {
  2112. return new Promise((resolve2, reject2) => {
  2113. if (!Cesium.defined(points2)) {
  2114. throw new Cesium.DeveloperError("points is required.");
  2115. }
  2116. if (points2.length < 2) {
  2117. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2118. }
  2119. let positions = points2.map((point2) => {
  2120. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2121. });
  2122. options2 = options2 || {};
  2123. options2.id = options2.id || setSessionid$1();
  2124. if (options2.color) {
  2125. if (options2.color instanceof Array) {
  2126. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  2127. } else if (typeof options2.color === "string") {
  2128. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2129. } else {
  2130. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2131. }
  2132. }
  2133. options2.width = options2.width || 5;
  2134. let entity = this._viewer.entities.add({
  2135. id: options2.id,
  2136. name: "Purple straight arrow at height",
  2137. polyline: {
  2138. clampToGround: true,
  2139. positions,
  2140. width: options2.width,
  2141. followSurface: false,
  2142. material: new Cesium.PolylineArrowMaterialProperty(options2.color)
  2143. }
  2144. });
  2145. resolve2(entity);
  2146. });
  2147. },
  2148. drawDashedLine(points2, options2) {
  2149. return new Promise((resolve2, reject2) => {
  2150. if (!Cesium.defined(points2)) {
  2151. throw new Cesium.DeveloperError("points is required.");
  2152. }
  2153. if (points2.length < 2) {
  2154. reject2("\u7EBF\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2155. }
  2156. let positions = points2.map((point2) => {
  2157. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2158. });
  2159. options2 = options2 || {};
  2160. options2.id = options2.id || setSessionid$1();
  2161. if (options2.color) {
  2162. if (options2.color instanceof Array) {
  2163. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  2164. } else if (typeof options2.color === "string") {
  2165. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2166. } else {
  2167. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2168. }
  2169. }
  2170. options2.width = options2.width || 5;
  2171. if (options2.gapColor) {
  2172. if (options2.gapColor instanceof Array) {
  2173. options2.gapColor = new Cesium.Color(options2.gapColor[0] / 255, options2.gapColor[1] / 255, options2.gapColor[2] / 255, options2.gapColor[3]);
  2174. } else if (typeof options2.gapColor === "string") {
  2175. options2.gapColor = new Cesium.Color.fromCssColorString(options2.gapColor);
  2176. } else {
  2177. options2.gapColor = new Cesium.Color.fromCssColorString("#FFFF00");
  2178. }
  2179. }
  2180. options2.dashLength = options2.dashLength || 16;
  2181. options2.dashPattern = options2.dashPattern || 255;
  2182. let entity = this._viewer.entities.add({
  2183. id: options2.id,
  2184. name: "CYAN dashed line",
  2185. polyline: {
  2186. clampToGround: true,
  2187. positions,
  2188. width: options2.width,
  2189. material: new Cesium.PolylineDashMaterialProperty({
  2190. color: options2.color,
  2191. gapColor: options2.gapColor,
  2192. dashLength: options2.dashLength,
  2193. dashPattern: options2.dashPattern
  2194. })
  2195. }
  2196. });
  2197. resolve2(entity);
  2198. });
  2199. }
  2200. });
  2201. function DynamicWallMaterialProperty(options2) {
  2202. this._definitionChanged = new Cesium.Event();
  2203. this._color = void 0;
  2204. this._colorSubscription = void 0;
  2205. this.color = options2.color || Color.BLUE;
  2206. this.duration = options2.duration || 1e3;
  2207. this.trailImage = options2.trailImage;
  2208. this._time = new Date().getTime();
  2209. }
  2210. function _getDirectionWallShader(options2) {
  2211. if (options2 && options2.get) {
  2212. var materail = "czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;";
  2213. if (options2.direction == "vertical") {
  2214. materail += "vec4 colorImage = texture2D(image, vec2(fract(st.s), fract(float(" + options2.count + ")*st.t" + options2.order + " time)));\n ";
  2215. } else {
  2216. materail += "vec4 colorImage = texture2D(image, vec2(fract(float(" + options2.count + ")*st.s " + options2.order + " time), fract(st.t)));\n ";
  2217. }
  2218. materail += "vec4 fragColor;\n fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = colorImage.rgb;\n material.alpha = colorImage.a;\n material.emission = fragColor.rgb;\n return material;\n }";
  2219. return materail;
  2220. }
  2221. }
  2222. Object.defineProperties(DynamicWallMaterialProperty.prototype, {
  2223. isConstant: {
  2224. get: function() {
  2225. return false;
  2226. }
  2227. },
  2228. definitionChanged: {
  2229. get: function() {
  2230. return this._definitionChanged;
  2231. }
  2232. },
  2233. color: Cesium.createPropertyDescriptor("color")
  2234. });
  2235. var MaterialType = "wallType" + parseInt(Math.random() * 1e3);
  2236. DynamicWallMaterialProperty.prototype.getType = function(time) {
  2237. return MaterialType;
  2238. };
  2239. DynamicWallMaterialProperty.prototype.getValue = function(time, result) {
  2240. if (!Cesium.defined(result)) {
  2241. result = {};
  2242. }
  2243. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.WHITE, result.color);
  2244. result.image = this.trailImage;
  2245. if (this.duration) {
  2246. result.time = (new Date().getTime() - this._time) % this.duration / this.duration;
  2247. }
  2248. viewer.scene.requestRender();
  2249. return result;
  2250. };
  2251. DynamicWallMaterialProperty.prototype.equals = function(other) {
  2252. return this === other || other instanceof DynamicWallMaterialProperty && Cesium.Property.equals(this._color, other._color);
  2253. };
  2254. Cesium.Material._materialCache.addMaterial(MaterialType, {
  2255. fabric: {
  2256. type: MaterialType,
  2257. uniforms: {
  2258. color: new Cesium.Color(1, 0, 0, 0.5),
  2259. image: Cesium.Material.DefaultImageId,
  2260. time: -20
  2261. },
  2262. source: _getDirectionWallShader({
  2263. get: true,
  2264. count: 3,
  2265. direction: "vertical",
  2266. order: "-"
  2267. })
  2268. },
  2269. translucent: function(material) {
  2270. return true;
  2271. }
  2272. });
  2273. Cesium.DynamicWallMaterialProperty = DynamicWallMaterialProperty;
  2274. class WallDiffuseMaterialProperty {
  2275. constructor(options2) {
  2276. this._definitionChanged = new Cesium.Event();
  2277. this._color = void 0;
  2278. this.color = options2.color;
  2279. }
  2280. get isConstant() {
  2281. return false;
  2282. }
  2283. get definitionChanged() {
  2284. return this._definitionChanged;
  2285. }
  2286. getType(time) {
  2287. return Cesium.Material.WallDiffuseMaterialType;
  2288. }
  2289. getValue(time, result) {
  2290. if (!Cesium.defined(result)) {
  2291. result = {};
  2292. }
  2293. result.color = Cesium.Property.getValueOrDefault(this._color, time, Cesium.Color.RED, result.color);
  2294. return result;
  2295. }
  2296. equals(other) {
  2297. return this === other || other instanceof WallDiffuseMaterialProperty && Cesium.Property.equals(this._color, other._color);
  2298. }
  2299. }
  2300. Object.defineProperties(WallDiffuseMaterialProperty.prototype, {
  2301. color: Cesium.createPropertyDescriptor("color")
  2302. });
  2303. Cesium.WallDiffuseMaterialProperty = WallDiffuseMaterialProperty;
  2304. Cesium.Material.WallDiffuseMaterialProperty = "WallDiffuseMaterialProperty";
  2305. Cesium.Material.WallDiffuseMaterialType = "WallDiffuseMaterialType";
  2306. Cesium.Material.WallDiffuseMaterialSource = `
  2307. uniform vec4 color;
  2308. czm_material czm_getMaterial(czm_materialInput materialInput){
  2309. czm_material material = czm_getDefaultMaterial(materialInput);
  2310. vec2 st = materialInput.st;
  2311. material.diffuse = color.rgb * 2.0;
  2312. material.alpha = color.a * (1.0 - fract(st.t)) * 0.8;
  2313. return material;
  2314. }
  2315. `;
  2316. Cesium.Material._materialCache.addMaterial(Cesium.Material.WallDiffuseMaterialType, {
  2317. fabric: {
  2318. type: Cesium.Material.WallDiffuseMaterialType,
  2319. uniforms: {
  2320. color: new Cesium.Color(1, 0, 0, 1)
  2321. },
  2322. source: Cesium.Material.WallDiffuseMaterialSource
  2323. },
  2324. translucent: function(material) {
  2325. return true;
  2326. }
  2327. });
  2328. class WallObject {
  2329. constructor(viewer2) {
  2330. if (!viewer2)
  2331. throw new Cesium.DeveloperError("no viewer object!");
  2332. this._viewer = viewer2;
  2333. }
  2334. }
  2335. Object.assign(WallObject.prototype, {
  2336. drawWallByGeoJson: function(geoJsonUrl, options2) {
  2337. return new Promise((resolve2, reject2) => {
  2338. let _self = this;
  2339. let viewer2 = this._viewer;
  2340. if (!Cesium.defined(geoJsonUrl)) {
  2341. throw new Cesium.DeveloperError("geoJsonUrl is required.");
  2342. }
  2343. options2 = options2 || {};
  2344. options2.id = options2.id || setSessionid$1();
  2345. fetch(geoJsonUrl).then((res) => {
  2346. return res.json();
  2347. }).then((res) => {
  2348. let wall = new Cesium.CustomDataSource(options2.id);
  2349. viewer2.dataSources.add(wall);
  2350. for (var i2 = 0; i2 < res.features.length; i2++) {
  2351. if (res.features[i2].geometry) {
  2352. if (res.features[i2].geometry.type === "MultiLineString") {
  2353. let coordinatesList = res.features[i2].geometry.coordinates;
  2354. for (var j = 0; j < coordinatesList.length; j++) {
  2355. let coordinates = coordinatesList[j];
  2356. let positions = coordinates.map((point2) => {
  2357. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2358. });
  2359. _self.addWall(positions, options2).then((entity) => {
  2360. wall.entities.add(entity);
  2361. });
  2362. }
  2363. } else {
  2364. let coordinates = res.features[i2].geometry.coordinates;
  2365. let positions = coordinates.map((point2) => {
  2366. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2367. });
  2368. _self.addWall(positions, options2).then((entity) => {
  2369. wall.entities.add(entity);
  2370. });
  2371. }
  2372. }
  2373. }
  2374. resolve2(options2.id);
  2375. });
  2376. });
  2377. },
  2378. addWall(points2, options2) {
  2379. return new Promise((resolve2, reject2) => {
  2380. if (!Cesium.defined(points2)) {
  2381. throw new Cesium.DeveloperError("points is required.");
  2382. }
  2383. if (points2.length < 2) {
  2384. reject2("\u5899\u4F53\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  2385. }
  2386. let positions;
  2387. if (points2[0] instanceof Cesium.Cartesian3) {
  2388. positions = points2;
  2389. } else {
  2390. positions = points2.map((point2) => {
  2391. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2392. });
  2393. }
  2394. options2 = options2 || {};
  2395. options2.id = options2.id || setSessionid$1();
  2396. options2.clampToGround = Cesium.defaultValue(options2.clampToGround, true);
  2397. options2.minimunHeights = options2.minimunHeights !== void 0 && typeof options2.minimunHeights === "number" ? options2.minimunHeights : 0;
  2398. options2.maximumHeights = options2.maximumHeights !== void 0 && typeof options2.maximumHeights === "number" ? options2.maximumHeights : 1e3;
  2399. if (options2.color) {
  2400. if (options2.color instanceof Cesium.Color) {
  2401. options2.color = options2.color;
  2402. } else if (options2.color instanceof Array) {
  2403. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  2404. } else if (typeof options2.color === "string") {
  2405. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  2406. } else {
  2407. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  2408. }
  2409. }
  2410. options2.trailImage = Cesium.defaultValue(options2.trailImage, "jt3dSDK/imgs/wallmaterial/wl.png");
  2411. options2.duration = Cesium.defaultValue(options2.duration, 3e3);
  2412. options2.count = Cesium.defaultValue(options2.count, 1);
  2413. options2.direction = Cesium.defaultValue(options2.direction, "vertical");
  2414. options2.order = Cesium.defaultValue(options2.order, "-");
  2415. let entity = new Cesium.Entity({
  2416. name: "\u7ACB\u4F53\u5899\u6548\u679C",
  2417. wall: {
  2418. positions,
  2419. maximumHeights: new Array(positions.length).fill(options2.maximumHeights),
  2420. minimunHeights: new Array(positions.length).fill(options2.minimunHeights),
  2421. material: new WallMaterialProperty$1(viewer, {
  2422. trailImage: options2.trailImage,
  2423. color: options2.color,
  2424. duration: options2.duration,
  2425. param: {
  2426. count: options2.count,
  2427. direction: options2.direction,
  2428. order: options2.order
  2429. }
  2430. })
  2431. }
  2432. });
  2433. resolve2(entity);
  2434. });
  2435. }
  2436. });
  2437. class LoadMapData {
  2438. constructor(viewer2) {
  2439. if (!viewer2)
  2440. throw new Cesium.DeveloperError("no viewer object!");
  2441. this._viewer = viewer2;
  2442. this._pointObject = new PointObject(viewer2);
  2443. this._polylineObject = new PolylineObject(viewer2);
  2444. this._wallObject = new WallObject(viewer2);
  2445. }
  2446. _addImageryProvider(id, provider) {
  2447. window[id] = this._viewer.imageryLayers.addImageryProvider(provider);
  2448. }
  2449. _removeImageryProvider(serviceId) {
  2450. this._viewer.imageryLayers.remove(window[serviceId]);
  2451. window[serviceId] = null;
  2452. }
  2453. _addTerrainProvider(provider) {
  2454. this._viewer.terrainProvider = provider;
  2455. }
  2456. _setEllipsoidTerrain() {
  2457. this._viewer.terrainProvider = new Cesium.EllipsoidTerrainProvider({});
  2458. }
  2459. _addScenePrimitives(scenePrimitives) {
  2460. this._viewer.scene.primitives.add(scenePrimitives);
  2461. }
  2462. _removeScenePrimitives(serviceId) {
  2463. this._viewer.scene.primitives.remove(window[serviceId]);
  2464. window[serviceId] = null;
  2465. }
  2466. _guid() {
  2467. function S4() {
  2468. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  2469. }
  2470. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  2471. }
  2472. _transformProjection(provider) {
  2473. let webMercatorTilingScheme = provider.tilingScheme;
  2474. let projection = webMercatorTilingScheme._projection;
  2475. projection.x_project = projection.project;
  2476. projection.project = function(cartographic) {
  2477. let point2;
  2478. return point2 = CoordTransform.WGS84ToGCJ02(
  2479. Cesium.Math.toDegrees(cartographic.longitude),
  2480. Cesium.Math.toDegrees(cartographic.latitude)
  2481. ), projection.x_project(
  2482. new Cesium.Cartographic(
  2483. Cesium.Math.toRadians(point2[0]),
  2484. Cesium.Math.toRadians(point2[1])
  2485. )
  2486. );
  2487. };
  2488. projection.x_unproject = projection.unproject;
  2489. projection.unproject = function(cartesian) {
  2490. let point2, cartographic = projection.x_unproject(cartesian);
  2491. return point2 = CoordTransform.GCJ02ToWGS84(
  2492. Cesium.Math.toDegrees(cartographic.longitude),
  2493. Cesium.Math.toDegrees(cartographic.latitude)
  2494. ), new Cesium.Cartographic(
  2495. Cesium.Math.toRadians(point2[0]),
  2496. Cesium.Math.toRadians(point2[1])
  2497. );
  2498. };
  2499. return provider;
  2500. }
  2501. }
  2502. Object.assign(LoadMapData.prototype, {
  2503. addTerrain(options2) {
  2504. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2505. throw new Cesium.DeveloperError("options.url is required.");
  2506. }
  2507. let _ConstructorOptions = {
  2508. url: options2.url
  2509. };
  2510. if (options2.requestVertexNormals) {
  2511. _ConstructorOptions.requestVertexNormals = options2.requestVertexNormals;
  2512. } else {
  2513. _ConstructorOptions.requestVertexNormals = false;
  2514. }
  2515. if (options2.requestWaterMask) {
  2516. _ConstructorOptions.requestWaterMask = options2.requestWaterMask;
  2517. } else {
  2518. _ConstructorOptions.requestWaterMask = false;
  2519. }
  2520. var terrainProvider = new Cesium.CesiumTerrainProvider(_ConstructorOptions);
  2521. this._addTerrainProvider(terrainProvider);
  2522. this.setTerrainExaggeration(options2);
  2523. },
  2524. addMapboxLayer(options2, callSuccess) {
  2525. if (!Cesium.defined(options2) || !Cesium.defined(options2.styleId)) {
  2526. throw new Cesium.DeveloperError("options.styleId is required.");
  2527. }
  2528. if (!Cesium.defined(options2.accessToken)) {
  2529. throw new Cesium.DeveloperError("options.accessToken is required.");
  2530. }
  2531. options2.id = options2.id || this._guid();
  2532. var imageryProvider = new Cesium.MapboxStyleImageryProvider({
  2533. url: options2.url,
  2534. username: options2.username,
  2535. styleId: options2.styleId,
  2536. accessToken: options2.accessToken,
  2537. scaleFactor: options2.scaleFactor
  2538. });
  2539. this._addImageryProvider(options2.id, imageryProvider);
  2540. this.setLayersStyle({
  2541. serviceId: options2.id,
  2542. alpha: options2.alpha
  2543. });
  2544. if (callSuccess)
  2545. callSuccess(options2.id);
  2546. },
  2547. addUrlTemplateImagery: function(options2, callSuccess) {
  2548. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2549. throw new Cesium.DeveloperError("options.url is required.");
  2550. }
  2551. options2.id = options2.id || this._guid();
  2552. options2.CRS = options2.CRS || "";
  2553. let _ConstructorOptions = {
  2554. url: options2.url
  2555. };
  2556. if (options2.minimumLevel) {
  2557. _ConstructorOptions.minimumLevel = options2.minimumLevel;
  2558. }
  2559. if (options2.maximumLevel) {
  2560. _ConstructorOptions.maximumLevel = options2.maximumLevel;
  2561. } else {
  2562. _ConstructorOptions.maximumLevel = 18;
  2563. }
  2564. var imageryProvider = new Cesium.UrlTemplateImageryProvider(_ConstructorOptions);
  2565. if (options2.CRS.toUpperCase() === "WGS84") {
  2566. imageryProvider.readyPromise.then(() => {
  2567. this._transformProjection(imageryProvider);
  2568. });
  2569. }
  2570. this._addImageryProvider(options2.id, imageryProvider);
  2571. this.setLayersStyle({
  2572. serviceId: options2.id,
  2573. alpha: options2.alpha
  2574. });
  2575. if (callSuccess)
  2576. callSuccess(options2.id);
  2577. },
  2578. addTileMapServiceImagery: function(options2, callSuccess) {
  2579. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2580. throw new Cesium.DeveloperError("options.url is required.");
  2581. }
  2582. options2.id = options2.id || this._guid();
  2583. let _ConstructorOptions = {
  2584. url: options2.url
  2585. };
  2586. if (options2.minimumLevel) {
  2587. _ConstructorOptions.minimumLevel = options2.minimumLevel;
  2588. }
  2589. if (options2.maximumLevel) {
  2590. _ConstructorOptions.maximumLevel = options2.maximumLevel;
  2591. } else {
  2592. _ConstructorOptions.maximumLevel = 18;
  2593. }
  2594. var imageryProvider = new Cesium.TileMapServiceImageryProvider(_ConstructorOptions);
  2595. this._addImageryProvider(options2.id, imageryProvider);
  2596. this.setLayersStyle({
  2597. serviceId: options2.id,
  2598. alpha: options2.alpha
  2599. });
  2600. if (callSuccess)
  2601. callSuccess(options2.id);
  2602. },
  2603. addWebMapTileService: function(options2, callSuccess) {
  2604. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2605. throw new Cesium.DeveloperError("options.url is required.");
  2606. }
  2607. if (!Cesium.defined(options2.layers)) {
  2608. throw new Cesium.DeveloperError("options.layers is required.");
  2609. }
  2610. if (!Cesium.defined(options2.style)) {
  2611. throw new Cesium.DeveloperError("options.style is required.");
  2612. }
  2613. if (!Cesium.defined(options2.tileMatrixSetID)) {
  2614. throw new Cesium.DeveloperError("options.tileMatrixSetID is required.");
  2615. }
  2616. options2.id = options2.id || this._guid();
  2617. let _ConstructorOptions = {
  2618. url: options2.url,
  2619. layer: options2.layers,
  2620. style: options2.style,
  2621. tileMatrixSetID: options2.tileMatrixSetID,
  2622. format: Cesium.defaultValue(options2.format, "image/png")
  2623. };
  2624. if (options2.tileMatrixLabels) {
  2625. _ConstructorOptions.tileMatrixLabels = options2.tileMatrixLabels;
  2626. }
  2627. if (options2.minimumLevel) {
  2628. _ConstructorOptions.minimumLevel = options2.minimumLevel;
  2629. }
  2630. if (options2.maximumLevel) {
  2631. _ConstructorOptions.maximumLevel = options2.maximumLevel;
  2632. } else {
  2633. _ConstructorOptions.maximumLevel = 18;
  2634. }
  2635. let imageryProvider = new Cesium.WebMapTileServiceImageryProvider(_ConstructorOptions);
  2636. this._addImageryProvider(options2.id, imageryProvider);
  2637. this.setLayersStyle({
  2638. serviceId: options2.id,
  2639. alpha: options2.alpha
  2640. });
  2641. if (callSuccess)
  2642. callSuccess(options2.id);
  2643. },
  2644. addWebMapService: function(options2, callSuccess) {
  2645. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2646. throw new Cesium.DeveloperError("options.url is required.");
  2647. }
  2648. if (!Cesium.defined(options2.layers)) {
  2649. throw new Cesium.DeveloperError("options.layers is required.");
  2650. }
  2651. options2.id = options2.id || this._guid();
  2652. let _ConstructorOptions = {
  2653. url: options2.url,
  2654. layers: options2.layers
  2655. };
  2656. if (options2.parameters) {
  2657. _ConstructorOptions.parameters = options2.parameters;
  2658. } else {
  2659. _ConstructorOptions.parameters = {
  2660. service: "WMS",
  2661. transparent: true,
  2662. request: "GetMap",
  2663. format: "image/png"
  2664. };
  2665. }
  2666. if (options2.minimumLevel) {
  2667. _ConstructorOptions.minimumLevel = options2.minimumLevel;
  2668. }
  2669. if (options2.maximumLevel) {
  2670. _ConstructorOptions.maximumLevel = options2.maximumLevel;
  2671. } else {
  2672. _ConstructorOptions.maximumLevel = 18;
  2673. }
  2674. let imageryProvider = new Cesium.WebMapServiceImageryProvider(_ConstructorOptions);
  2675. this._addImageryProvider(options2.id, imageryProvider);
  2676. this.setLayersStyle({
  2677. serviceId: options2.id,
  2678. alpha: options2.alpha
  2679. });
  2680. if (callSuccess)
  2681. callSuccess(options2.id);
  2682. },
  2683. addArcGisMapServer: function(options2, callSuccess) {
  2684. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2685. throw new Cesium.DeveloperError("options.url is required.");
  2686. }
  2687. options2.id = options2.id || this._guid();
  2688. let _ConstructorOptions = {
  2689. url: options2.url
  2690. };
  2691. if (options2.layers) {
  2692. _ConstructorOptions.layers = options2.layers;
  2693. }
  2694. let imageryProvider = new Cesium.ArcGisMapServerImageryProvider(_ConstructorOptions);
  2695. this._addImageryProvider(options2.id, imageryProvider);
  2696. this.setLayersStyle({
  2697. serviceId: options2.id,
  2698. alpha: options2.alpha
  2699. });
  2700. if (callSuccess)
  2701. callSuccess(options2.id);
  2702. },
  2703. addCesium3DTileset: function(options2, callSuccess) {
  2704. let _self = this;
  2705. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2706. throw new Cesium.DeveloperError("options.url is required.");
  2707. }
  2708. options2.id = options2.id || this._guid();
  2709. let _ConstructorOptions = {
  2710. url: options2.url,
  2711. skipLevelOfDetail: true
  2712. };
  2713. let tileSetModel = new Cesium.Cesium3DTileset(_ConstructorOptions);
  2714. tileSetModel.readyPromise.then((tileset) => {
  2715. console.log("\u52A0\u8F7D\u5B8C\u6210");
  2716. window[options2.id] = tileset;
  2717. _self._addScenePrimitives(tileset);
  2718. _self.set3DTilePosition({
  2719. serviceId: options2.id,
  2720. height: options2.height
  2721. });
  2722. _self.set3DTileStyle({
  2723. serviceId: options2.id,
  2724. alpha: options2.alpha
  2725. });
  2726. if (callSuccess)
  2727. callSuccess(options2.id);
  2728. }).catch(function(error) {
  2729. console.log(error);
  2730. });
  2731. },
  2732. addCesium3DTilesetBm: function(options2, callSuccess) {
  2733. let _self = this;
  2734. if (!Cesium.defined(options2) || !Cesium.defined(options2.url)) {
  2735. throw new Cesium.DeveloperError("options.url is required.");
  2736. }
  2737. options2.id = options2.id || this._guid();
  2738. let _ConstructorOptions = {
  2739. url: options2.url,
  2740. skipLevelOfDetail: true
  2741. };
  2742. let tileSetModel = new Cesium.Cesium3DTileset(_ConstructorOptions);
  2743. tileSetModel.readyPromise.then((tileset) => {
  2744. console.log("\u52A0\u8F7D\u5B8C\u6210");
  2745. window[options2.id] = tileset;
  2746. _self._addScenePrimitives(tileset);
  2747. _self.set3DTileBMStyle({
  2748. serviceId: options2.id,
  2749. color: options2.color
  2750. });
  2751. if (callSuccess)
  2752. callSuccess(options2.id);
  2753. }).catch(function(error) {
  2754. console.log(error);
  2755. });
  2756. },
  2757. addPolygonImageMaterial: function(options2, callSuccess) {
  2758. if (!Cesium.defined(options2.points)) {
  2759. throw new Cesium.DeveloperError("options.points is required.");
  2760. }
  2761. if (options2.points.length < 3) {
  2762. reject("\u9762\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C113\u4E2A");
  2763. }
  2764. let positions = [];
  2765. if (options2.points instanceof Cesium.Cartesian3) {
  2766. positions = options2.points;
  2767. } else {
  2768. positions = options2.points.map((point2) => {
  2769. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2770. });
  2771. }
  2772. options2.id = options2.id || this._guid();
  2773. options2.alpha = options2.alpha || 1;
  2774. this.classificationType = Cesium.ClassificationType.BOTH;
  2775. if (options2.classificationType === "Terrain") {
  2776. this.classificationType = Cesium.ClassificationType.TERRAIN;
  2777. } else if (options2.classificationType === "3DTiles") {
  2778. this.classificationType = Cesium.ClassificationType.CESIUM_3D_TILE;
  2779. }
  2780. if (options2.url) {
  2781. if (!Cesium.Entity.supportsMaterialsforEntitiesOnTerrain(this._viewer.scene)) {
  2782. window.alert("Terrain Entity materials are not supported on this platform");
  2783. }
  2784. this.material = new Cesium.ImageMaterialProperty({
  2785. image: options2.url,
  2786. repeat: Cesium.Cartesian2(1, 1),
  2787. transparent: true,
  2788. color: Cesium.Color.WHITE.withAlpha(options2.alpha)
  2789. });
  2790. } else {
  2791. this.material = Cesium.Color.RED.withAlpha(options2.alpha);
  2792. }
  2793. window[options2.id] = this._viewer.entities.add({
  2794. id: options2.id,
  2795. polygon: {
  2796. hierarchy: positions,
  2797. material: this.material,
  2798. classificationType: this.classificationType
  2799. }
  2800. });
  2801. if (callSuccess)
  2802. callSuccess(options2.id);
  2803. },
  2804. addEntitiesGltf: function(options2, callSuccess) {
  2805. let viewer2 = this._viewer;
  2806. if (!Cesium.defined(options2.points)) {
  2807. resolve("options.points is required.");
  2808. throw new Cesium.DeveloperError("options.points is required.");
  2809. }
  2810. if (!Cesium.defined(options2.url)) {
  2811. resolve("options.url is required.");
  2812. throw new Cesium.DeveloperError("options.url is required.");
  2813. }
  2814. options2.id = options2.id || this._guid();
  2815. options2.heading = Cesium.defaultValue(options2.heading, 0);
  2816. options2.pitch = Cesium.defaultValue(options2.pitch, 0);
  2817. options2.roll = Cesium.defaultValue(options2.roll, 0);
  2818. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  2819. let position2 = void 0;
  2820. if (options2.points instanceof Cesium.Cartesian3) {
  2821. position2 = options2.points;
  2822. } else {
  2823. position2 = Cesium.Cartesian3.fromDegrees(options2.points[0], options2.points[1], options2.points[2] || 0);
  2824. }
  2825. var heading = Cesium.Math.toRadians(options2.heading);
  2826. var pitch = options2.pitch;
  2827. var roll = options2.roll;
  2828. var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
  2829. var modelGltf = viewer2.entities.add({
  2830. id: options2.id,
  2831. position: position2,
  2832. orientation: Cesium.Transforms.headingPitchRollQuaternion(position2, hpr),
  2833. model: {
  2834. uri: options2.url,
  2835. incrementallyLoadTextures: true,
  2836. colorBlendMode: Cesium.ColorBlendMode["HIGHLIGHT"],
  2837. colorBlendAmount: 0.1,
  2838. color: Cesium.Color.WHITE.withAlpha(options2.alpha),
  2839. imageBasedLightingFactor: new Cesium.Cartesian2(12, 13),
  2840. runAnimations: true,
  2841. show: true,
  2842. debugWireframe: false,
  2843. debugShowBoundingVolume: false
  2844. }
  2845. });
  2846. if (options2.minimumPixelSize) {
  2847. modelGltf.model.minimumPixelSize = options2.minimumPixelSize;
  2848. }
  2849. if (options2.maximumScale) {
  2850. modelGltf.model.maximumScale = options2.maximumScale;
  2851. }
  2852. if (options2.silhouetteColor) {
  2853. modelGltf.model.silhouetteColor = new Cesium.Color(options2.silhouetteColor[0] / 255, options2.silhouetteColor[1] / 255, options2.silhouetteColor[2] / 255, options2.silhouetteColor[3]);
  2854. }
  2855. window[options2.id] = modelGltf;
  2856. if (callSuccess)
  2857. callSuccess(options2.id);
  2858. },
  2859. addScenePrimitivesGltf(options2, callSuccess) {
  2860. let viewer2 = this._viewer;
  2861. if (!Cesium.defined(options2.points)) {
  2862. resolve("options.points is required.");
  2863. throw new Cesium.DeveloperError("options.points is required.");
  2864. }
  2865. if (!Cesium.defined(options2.url)) {
  2866. resolve("options.url is required.");
  2867. throw new Cesium.DeveloperError("options.url is required.");
  2868. }
  2869. options2.id = options2.id || this._guid();
  2870. options2.scale = Cesium.defaultValue(options2.scale, 1);
  2871. let position2 = void 0;
  2872. if (options2.points instanceof Cesium.Cartesian3) {
  2873. position2 = options2.points;
  2874. } else {
  2875. position2 = Cesium.Cartesian3.fromDegrees(options2.points[0], options2.points[1], options2.points[2] || 0);
  2876. }
  2877. const modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(position2);
  2878. let model = viewer2.scene.primitives.add(
  2879. Cesium.Model.fromGltf({
  2880. show: true,
  2881. url: options2.url,
  2882. modelMatrix,
  2883. lightColor: new Cesium.Cartesian3(10, 10, 10),
  2884. scale: options2.scale,
  2885. debugWireframe: false,
  2886. debugShowBoundingVolume: false
  2887. })
  2888. );
  2889. model.readyPromise.then(function() {
  2890. var rotationX = Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromRotationZ(Cesium.Math.toRadians(0)));
  2891. Cesium.Matrix4.multiply(model.modelMatrix, rotationX, model.modelMatrix);
  2892. });
  2893. window[options2.id] = model;
  2894. if (callSuccess)
  2895. callSuccess(options2.id);
  2896. },
  2897. addPolylineByGeoJson(options2, callSuccess) {
  2898. let _self = this;
  2899. this._viewer;
  2900. if (!Cesium.defined(options2.url)) {
  2901. resolve("options.url is required.");
  2902. throw new Cesium.DeveloperError("options.url is required.");
  2903. }
  2904. options2 = options2 || {};
  2905. options2.id = options2.id || this._guid();
  2906. let promise = Cesium.GeoJsonDataSource.load(options2.url, {
  2907. clampToGround: options2.clampToGround
  2908. });
  2909. promise.then((dataSource) => {
  2910. _self._viewer.dataSources.add(dataSource);
  2911. dataSource.name = options2.id;
  2912. let entities2 = dataSource.entities.values;
  2913. let material = new PolylineDirectionMaterialProperty(options2);
  2914. for (var i2 = 0; i2 < entities2.length; i2++) {
  2915. var entity = entities2[i2];
  2916. entity.polyline.material = material;
  2917. entity.polyline.width = options2.width;
  2918. if (options2.clampToGround) {
  2919. entity.polyline.clampToGround = true;
  2920. }
  2921. }
  2922. if (callSuccess)
  2923. callSuccess(options2.id);
  2924. });
  2925. },
  2926. addPolylineByJson(options2, callSuccess) {
  2927. let _self = this;
  2928. let viewer2 = this._viewer;
  2929. if (!Cesium.defined(options2.url)) {
  2930. resolve("options.url is required.");
  2931. throw new Cesium.DeveloperError("options.url is required.");
  2932. }
  2933. options2 = options2 || {};
  2934. options2.id = options2.id || this._guid();
  2935. fetch(options2.url).then((res) => {
  2936. return res.json();
  2937. }).then((res) => {
  2938. let dataSource = new Cesium.CustomDataSource(options2.id);
  2939. viewer2.dataSources.add(dataSource);
  2940. for (var i2 = 0; i2 < res.features.length; i2++) {
  2941. if (res.features[i2].geometry) {
  2942. if (res.features[i2].geometry.type === "MultiLineString") {
  2943. let coordinatesList = res.features[i2].geometry.coordinates;
  2944. for (var j = 0; j < coordinatesList.length; j++) {
  2945. let coordinates = coordinatesList[j];
  2946. let positions = coordinates.map((point2) => {
  2947. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2948. });
  2949. _self._polylineObject.addPolyline(positions, options2).then((entity) => {
  2950. dataSource.entities.add(entity);
  2951. });
  2952. }
  2953. } else {
  2954. let coordinates = res.features[i2].geometry.coordinates;
  2955. let positions = coordinates.map((point2) => {
  2956. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  2957. });
  2958. _self._polylineObject.addPolyline(positions, options2).then((entity) => {
  2959. dataSource.entities.add(entity);
  2960. });
  2961. }
  2962. }
  2963. }
  2964. if (callSuccess)
  2965. callSuccess(options2.id);
  2966. });
  2967. },
  2968. addBillboardByGeoJson(options2, callSuccess) {
  2969. let viewer2 = this._viewer;
  2970. if (!Cesium.defined(options2.url)) {
  2971. resolve("options.url is required.");
  2972. throw new Cesium.DeveloperError("options.url is required.");
  2973. }
  2974. options2 = options2 || {};
  2975. options2.id = options2.id || this._guid();
  2976. let billboard = options2.billboard || {};
  2977. billboard.imgUrl = Cesium.defaultValue(billboard.imgUrl, "jt3dSDK/imgs/point/point3.png");
  2978. billboard.scale = Cesium.defaultValue(billboard.scale, 1);
  2979. billboard.pixelOffset = Cesium.defaultValue(billboard.pixelOffset, 0);
  2980. const dataSource = new Cesium.GeoJsonDataSource(options2.id);
  2981. dataSource.load(options2.url, {
  2982. clampToGround: true
  2983. }).then(function(data) {
  2984. viewer2.dataSources.add(data);
  2985. const entities2 = data.entities.values;
  2986. entities2.forEach((entity) => {
  2987. entity.billboard = {
  2988. image: billboard.imgUrl,
  2989. horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
  2990. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  2991. scale: billboard.scale,
  2992. pixelOffset: new Cesium.Cartesian2(0, billboard.pixelOffset),
  2993. disableDepthTestDistance: Number.POSITIVE_INFINITY
  2994. };
  2995. if (billboard.scaleByDistance) {
  2996. billboard.scaleByDistance.near = Cesium.defaultValue(billboard.scaleByDistance.near, 0);
  2997. billboard.scaleByDistance.nearValue = Cesium.defaultValue(billboard.scaleByDistance.nearValue, 0);
  2998. billboard.scaleByDistance.far = Cesium.defaultValue(billboard.scaleByDistance.far, 1);
  2999. billboard.scaleByDistance.farValue = Cesium.defaultValue(billboard.scaleByDistance.farValue, 0);
  3000. entity.billboard.scaleByDistance = new Cesium.NearFarScalar(billboard.scaleByDistance.near, billboard.scaleByDistance.nearValue, billboard.scaleByDistance.far, billboard.scaleByDistance.farValue);
  3001. }
  3002. if (options2.label) {
  3003. let label = options2.label || {};
  3004. label.text = Cesium.defaultValue(label.text, "");
  3005. label.textField = Cesium.defaultValue(label.textField, "");
  3006. label.font = Cesium.defaultValue(label.font, "24px Helvetica");
  3007. if (label.fillColor instanceof Array) {
  3008. label.fillColor = new Cesium.Color(label.fillColor[0] / 255, label.fillColor[1] / 255, label.fillColor[2] / 255, label.fillColor[3]);
  3009. } else if (typeof options2.color === "string") {
  3010. label.fillColor = new Cesium.Color.fromCssColorString(label.fillColor);
  3011. } else {
  3012. label.fillColor = new Cesium.Color.fromCssColorString("#ff0000");
  3013. }
  3014. if (label.outlineColor instanceof Array) {
  3015. label.outlineColor = new Cesium.Color(label.outlineColor[0] / 255, label.outlineColor[1] / 255, label.outlineColor[2] / 255, label.outlineColor[3]);
  3016. } else if (label.outlineColor instanceof String) {
  3017. label.outlineColor = new Cesium.Color.fromCssColorString(label.outlineColor);
  3018. } else {
  3019. label.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  3020. }
  3021. label.outlineWidth = Cesium.defaultValue(label.outlineWidth, 1);
  3022. label.showBackground = Cesium.defaultValue(label.showBackground, false);
  3023. if (label.backgroundColor instanceof Array) {
  3024. label.backgroundColor = new Cesium.Color(label.backgroundColor[0] / 255, label.backgroundColor[1] / 255, label.backgroundColor[2] / 255, label.backgroundColor[3]);
  3025. } else if (label.backgroundColor instanceof String) {
  3026. label.backgroundColor = new Cesium.Color.fromCssColorString(label.backgroundColor);
  3027. } else {
  3028. label.backgroundColor = new Cesium.Color.fromCssColorString("#FFFF00");
  3029. }
  3030. label.pixelOffset = Cesium.defaultValue(label.pixelOffset, 0);
  3031. label.scale = Cesium.defaultValue(label.scale, 1);
  3032. label.near = Cesium.defaultValue(label.near, 150);
  3033. label.nearValue = Cesium.defaultValue(label.nearValue, 1);
  3034. label.far = Cesium.defaultValue(label.far, 2400);
  3035. label.farValue = Cesium.defaultValue(label.farValue, 0);
  3036. let labelText = label.text;
  3037. if (entity.properties[label.textField]) {
  3038. labelText = entity.properties[label.textField]._value;
  3039. }
  3040. if (labelText === "") {
  3041. labelText = (i + 1).toString();
  3042. }
  3043. entity.label = {
  3044. text: labelText.toString(),
  3045. font: label.font,
  3046. fillColor: label.fillColor,
  3047. outlineColor: label.outlineColor,
  3048. outlineWidth: label.outlineWidth,
  3049. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  3050. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  3051. showBackground: label.showBackground,
  3052. backgroundColor: label.backgroundColor,
  3053. backgroundPadding: new Cesium.Cartesian2(6, 6),
  3054. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  3055. pixelOffset: new Cesium.Cartesian2(0, label.pixelOffset),
  3056. scale: label.scale
  3057. };
  3058. if (label.scaleByDistance) {
  3059. label.scaleByDistance.near = Cesium.defaultValue(label.scaleByDistance.near, 0);
  3060. label.scaleByDistance.nearValue = Cesium.defaultValue(label.scaleByDistance.nearValue, 0);
  3061. label.scaleByDistance.far = Cesium.defaultValue(label.scaleByDistance.far, 1);
  3062. label.scaleByDistance.farValue = Cesium.defaultValue(label.scaleByDistance.farValue, 0);
  3063. entity.label.scaleByDistance = new Cesium.NearFarScalar(label.scaleByDistance.near, label.scaleByDistance.nearValue, label.scaleByDistance.far, label.scaleByDistance.farValue);
  3064. }
  3065. }
  3066. });
  3067. if (callSuccess)
  3068. callSuccess(options2.id);
  3069. });
  3070. },
  3071. addBillboardByJson(options2, callSuccess) {
  3072. let _self = this;
  3073. let viewer2 = this._viewer;
  3074. if (!Cesium.defined(options2.url)) {
  3075. resolve("options.url is required.");
  3076. throw new Cesium.DeveloperError("options.url is required.");
  3077. }
  3078. options2 = options2 || {};
  3079. options2.id = options2.id || this._guid();
  3080. fetch(options2.url).then((res) => {
  3081. return res.json();
  3082. }).then((res) => {
  3083. let dataSource = new Cesium.CustomDataSource(options2.id);
  3084. viewer2.dataSources.add(dataSource);
  3085. for (var i2 = 0; i2 < res.features.length; i2++) {
  3086. if (res.features[i2].geometry) {
  3087. if (res.features[i2].properties) {
  3088. options2.properties = res.features[i2].properties;
  3089. }
  3090. if (res.features[i2].geometry.type === "MultiPoint") {
  3091. let coordinatesList = res.features[i2].geometry.coordinates;
  3092. for (var j = 0; j < coordinatesList.length; j++) {
  3093. let coordinates = coordinatesList[j];
  3094. let position2 = Cesium.Cartesian3.fromDegrees(coordinates[0], coordinates[1], coordinates[2] || 0);
  3095. _self._pointObject.addBillboard(position2, options2).then((entity) => {
  3096. dataSource.entities.add(entity);
  3097. });
  3098. }
  3099. } else {
  3100. let coordinates = res.features[i2].geometry.coordinates;
  3101. let position2 = Cesium.Cartesian3.fromDegrees(coordinates[0], coordinates[1], coordinates[2] || 0);
  3102. _self._pointObject.addBillboard(position2, options2).then((entity) => {
  3103. dataSource.entities.add(entity);
  3104. });
  3105. }
  3106. }
  3107. }
  3108. if (callSuccess)
  3109. callSuccess(options2.id);
  3110. });
  3111. },
  3112. addWallByJson(options2, callSuccess) {
  3113. let _self = this;
  3114. let viewer2 = this._viewer;
  3115. if (!Cesium.defined(options2.url)) {
  3116. resolve("options.url is required.");
  3117. throw new Cesium.DeveloperError("options.url is required.");
  3118. }
  3119. options2 = options2 || {};
  3120. options2.id = options2.id || setSessionid();
  3121. fetch(options2.url).then((res) => {
  3122. return res.json();
  3123. }).then((res) => {
  3124. let dataSource = new Cesium.CustomDataSource(options2.id);
  3125. viewer2.dataSources.add(dataSource);
  3126. for (var i2 = 0; i2 < res.features.length; i2++) {
  3127. if (res.features[i2].geometry) {
  3128. if (res.features[i2].geometry.type === "MultiLineString") {
  3129. let coordinatesList = res.features[i2].geometry.coordinates;
  3130. for (var j = 0; j < coordinatesList.length; j++) {
  3131. let coordinates = coordinatesList[j];
  3132. let positions = coordinates.map((point2) => {
  3133. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  3134. });
  3135. _self._wallObject.addWall(positions, options2).then((entity) => {
  3136. dataSource.entities.add(entity);
  3137. });
  3138. }
  3139. } else {
  3140. let coordinates = res.features[i2].geometry.coordinates;
  3141. let positions = coordinates.map((point2) => {
  3142. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  3143. });
  3144. _self._wallObject.addWall(positions, options2).then((entity) => {
  3145. dataSource.entities.add(entity);
  3146. });
  3147. }
  3148. }
  3149. }
  3150. if (callSuccess)
  3151. callSuccess(options2.id);
  3152. });
  3153. }
  3154. });
  3155. Object.assign(LoadMapData.prototype, {
  3156. set3DTileStyle(options2) {
  3157. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3158. throw new Cesium.DeveloperError("options.serviceId is required.");
  3159. }
  3160. if (Cesium.defined(options2.alpha)) {
  3161. Cesium.Check.typeOf.number("alpha", options2.alpha);
  3162. }
  3163. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  3164. let tileset = window[options2.serviceId];
  3165. tileset.style = new Cesium.Cesium3DTileStyle({
  3166. color: "color('rgba(255,255,255," + options2.alpha + ")')"
  3167. });
  3168. },
  3169. set3DTileBMStyle: function(options2) {
  3170. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3171. throw new Cesium.DeveloperError("options.serviceId is required.");
  3172. }
  3173. options2.color = options2.color ? "vec4(" + options2.color[0] + "/255, " + options2.color[1] + "/255, " + options2.color[2] + "/255, " + options2.color[3] + ")" : "vec4(0.0, 0.58, 0.86, 1.0)";
  3174. let tileset = window[options2.serviceId];
  3175. tileset.readyPromise.then((tileset2) => {
  3176. tileset2.boundingSphere.radius;
  3177. if (tileset2.boundingSphere.radius > 1e4) {
  3178. tileset2.boundingSphere.radius / 10;
  3179. }
  3180. tileset2.style = new Cesium.Cesium3DTileStyle({
  3181. color: options2.color
  3182. });
  3183. tileset2.tileVisible.addEventListener((tile) => {
  3184. let content = tile.content;
  3185. let featuresLength = content.featuresLength;
  3186. for (let i2 = 0; i2 < featuresLength; i2 += 2) {
  3187. const feature2 = content.getFeature(i2);
  3188. const model = feature2.content._model;
  3189. if (model && model._sourcePrograms && model._rendererResources) {
  3190. Object.keys(model._sourcePrograms).forEach((key) => {
  3191. const program = model._sourcePrograms[key];
  3192. const fragmentShader = model._rendererResources.sourceShaders[program.fragmentShader];
  3193. let vPosition = "";
  3194. if (fragmentShader.indexOf(" v_positionEC;") !== -1) {
  3195. vPosition = "v_positionEC";
  3196. } else if (fragmentShader.indexOf(" v_pos;") !== -1) {
  3197. vPosition = "v_pos";
  3198. }
  3199. const color2 = `vec4(${feature2.color.toString()})`;
  3200. model._rendererResources.sourceShaders[program.fragmentShader] = `
  3201. varying vec3 ${vPosition};
  3202. void main(void){
  3203. vec4 v_helsing_position = czm_inverseModelView * vec4(${vPosition},1);
  3204. float _baseHeight = -30.0;
  3205. float vtxf_height = v_helsing_position.z - _baseHeight;
  3206. float stc_pl = fract(czm_frameNumber / 120.0) * 3.14159265 * 2.0;
  3207. float stc_sd = vtxf_height / 30.0 + sin(stc_pl) * 0.1;
  3208. gl_FragColor = ${color2};
  3209. gl_FragColor *= vec4(stc_sd, stc_sd, stc_sd, 1.0);
  3210. /* \u626B\u63CF\u7EBF */
  3211. float glowRange = 80.0;
  3212. float stc_a13 = fract(czm_frameNumber / 460.0);
  3213. float stc_h = clamp(v_helsing_position.z / glowRange, 0.0, 1.0);
  3214. stc_a13 = abs(stc_a13 - 0.5) * 1.0;
  3215. float stc_diff = step(0.003, abs(stc_h - stc_a13));
  3216. gl_FragColor.rgb += gl_FragColor.rgb * (1.0 - stc_diff);
  3217. }
  3218. `;
  3219. });
  3220. model._shouldRegenerateShaders = true;
  3221. }
  3222. }
  3223. });
  3224. });
  3225. this._viewer.scene.requestRender();
  3226. },
  3227. set3DTilePosition: function(options2) {
  3228. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3229. throw new Cesium.DeveloperError("options.serviceId is required.");
  3230. }
  3231. options2.height = Cesium.defaultValue(options2.height, 0);
  3232. let boundingSphere = window[options2.serviceId].boundingSphere;
  3233. let cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
  3234. let left = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, options2.height);
  3235. let right = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0);
  3236. let translation = Cesium.Cartesian3.subtract(left, right, new Cesium.Cartesian3());
  3237. window[options2.serviceId].modelMatrix = Cesium.Matrix4.fromTranslation(translation);
  3238. this._viewer.scene.requestRender();
  3239. },
  3240. setLayersStyle(options2) {
  3241. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3242. throw new Cesium.DeveloperError("options.serviceId is required.");
  3243. }
  3244. let layer = window[options2.serviceId];
  3245. if (Cesium.defined(options2.alpha)) {
  3246. Cesium.Check.typeOf.number("alpha", options2.alpha);
  3247. }
  3248. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  3249. layer.alpha = options2.alpha;
  3250. if (Cesium.defined(options2.brightness)) {
  3251. Cesium.Check.typeOf.number("brightness", options2.brightness);
  3252. }
  3253. options2.brightness = Cesium.defaultValue(options2.brightness, 1);
  3254. layer.brightness = options2.brightness;
  3255. if (Cesium.defined(options2.contrast)) {
  3256. Cesium.Check.typeOf.number("contrast", options2.contrast);
  3257. }
  3258. options2.contrast = Cesium.defaultValue(options2.contrast, 1);
  3259. layer.contrast = options2.contrast;
  3260. if (Cesium.defined(options2.gamma)) {
  3261. Cesium.Check.typeOf.number("gamma", options2.gamma);
  3262. }
  3263. options2.gamma = Cesium.defaultValue(options2.gamma, 1);
  3264. layer.gamma = options2.gamma;
  3265. if (Cesium.defined(options2.hue)) {
  3266. Cesium.Check.typeOf.number("hue", options2.hue);
  3267. }
  3268. options2.hue = Cesium.defaultValue(options2.hue, 0);
  3269. layer.hue = options2.hue;
  3270. if (Cesium.defined(options2.saturation)) {
  3271. Cesium.Check.typeOf.number("saturation", options2.saturation);
  3272. }
  3273. options2.saturation = Cesium.defaultValue(options2.saturation, 1);
  3274. layer.saturation = options2.saturation;
  3275. },
  3276. setPolygonImageMaterial(options2) {
  3277. if (Cesium.defined(options2.alpha)) {
  3278. Cesium.Check.typeOf.number("alpha", options2.alpha);
  3279. }
  3280. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  3281. let entity = window[options2.serviceId];
  3282. entity.polygon.material.color._value.alpha = options2.alpha;
  3283. },
  3284. setModelStyle(options2) {
  3285. if (Cesium.defined(options2.alpha)) {
  3286. Cesium.Check.typeOf.number("alpha", options2.alpha);
  3287. }
  3288. options2.alpha = Cesium.defaultValue(options2.alpha, 1);
  3289. let entity = window[options2.serviceId];
  3290. if (entity.model) {
  3291. entity.model.color._value.alpha = options2.alpha;
  3292. } else {
  3293. entity.color._value.alpha = options2.alpha;
  3294. }
  3295. },
  3296. setTerrainExaggeration(options2) {
  3297. if (Cesium.defined(options2.terrainExaggeration)) {
  3298. Cesium.Check.typeOf.number("terrainExaggeration", options2.terrainExaggeration);
  3299. }
  3300. options2.terrainExaggeration = Cesium.defaultValue(options2.terrainExaggeration, 1);
  3301. this._viewer.scene.globe.terrainExaggeration = options2.terrainExaggeration;
  3302. }
  3303. });
  3304. Object.assign(LoadMapData.prototype, {
  3305. removeImageryProvider(options2) {
  3306. return new Promise((resolve2, reject2) => {
  3307. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3308. throw new Cesium.DeveloperError("options.serviceId is required.");
  3309. }
  3310. this._removeImageryProvider(options2.serviceId);
  3311. resolve2(true);
  3312. });
  3313. },
  3314. removeTerrain() {
  3315. return new Promise((resolve2, reject2) => {
  3316. this._setEllipsoidTerrain();
  3317. resolve2(true);
  3318. });
  3319. },
  3320. removeScenePrimitives(options2) {
  3321. return new Promise((resolve2, reject2) => {
  3322. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3323. throw new Cesium.DeveloperError("options.serviceId is required.");
  3324. }
  3325. this._removeScenePrimitives(options2.serviceId);
  3326. resolve2(true);
  3327. });
  3328. },
  3329. removeEntity(options2) {
  3330. return new Promise((resolve2, reject2) => {
  3331. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3332. throw new Cesium.DeveloperError("options.serviceId is required.");
  3333. }
  3334. this._viewer.entities.remove(window[options2.serviceId]);
  3335. window[options2.serviceId] = null;
  3336. resolve2(true);
  3337. });
  3338. },
  3339. removeDataSources(options2) {
  3340. let viewer2 = this._viewer;
  3341. return new Promise((resolve2, reject2) => {
  3342. if (!Cesium.defined(options2) || !Cesium.defined(options2.serviceId)) {
  3343. throw new Cesium.DeveloperError("options.serviceId is required.");
  3344. }
  3345. let list = viewer2.dataSources.getByName(options2.serviceId);
  3346. list.forEach((res, index2) => {
  3347. viewer2.dataSources.remove(res);
  3348. if (index2 === list.length - 1) {
  3349. resolve2(true);
  3350. }
  3351. });
  3352. });
  3353. }
  3354. });
  3355. Date.prototype.Format = function(fmt) {
  3356. var o = {
  3357. "M+": this.getMonth() + 1,
  3358. "d+": this.getDate(),
  3359. "h+": this.getHours(),
  3360. "m+": this.getMinutes(),
  3361. "s+": this.getSeconds(),
  3362. "q+": Math.floor((this.getMonth() + 3) / 3),
  3363. "S": this.getMilliseconds()
  3364. };
  3365. if (/(y+)/.test(fmt))
  3366. fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  3367. for (var k in o)
  3368. if (new RegExp("(" + k + ")").test(fmt))
  3369. fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
  3370. return fmt;
  3371. };
  3372. class CrImageServerLayer {
  3373. constructor({
  3374. viewer: viewer2,
  3375. url,
  3376. opacity = 0.75,
  3377. show = true
  3378. } = {}) {
  3379. this._viewer = viewer2;
  3380. this._url = url;
  3381. this._opacity = opacity;
  3382. this._renderName = this._guid();
  3383. let dataSource = new Cesium.CustomDataSource(this._renderName);
  3384. this._viewer.dataSources.add(dataSource);
  3385. this._entities = dataSource.entities;
  3386. this._renderEntities = /* @__PURE__ */ new Map();
  3387. this._isUpdateTile = show;
  3388. this._isDebug = false;
  3389. this._init();
  3390. }
  3391. _init() {
  3392. let _self = this;
  3393. this._provider = new Cesium.ArcGisMapServerImageryProvider({
  3394. url: _self._url
  3395. });
  3396. this._provider.readyPromise.then(function(result) {
  3397. _self._rectangle = _self._provider.rectangle;
  3398. if (_self._isDebug)
  3399. _self._printDebug();
  3400. _self._viewer.scene.postRender.addEventListener(() => {
  3401. if (_self._isUpdateTile) {
  3402. _self._isUpdateTile = false;
  3403. _self._renderTiles();
  3404. }
  3405. });
  3406. });
  3407. }
  3408. _guid() {
  3409. function S4() {
  3410. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  3411. }
  3412. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  3413. }
  3414. _printDebug() {
  3415. this._provider.tilingScheme;
  3416. let tiling84 = new Cesium.GeographicTilingScheme();
  3417. this._drawDebugRectangle(this._rectangle, Cesium.Color.GREEN);
  3418. tiling84.tileXYToRectangle(1696, 312, 10);
  3419. }
  3420. _drawDebugRectangle(rectangle, color2) {
  3421. let positions = this._calculateRectangleOutlineCoordinates(rectangle);
  3422. let rectEntity = new Cesium.Entity({
  3423. name: this._renderName,
  3424. polyline: {
  3425. positions,
  3426. material: color2,
  3427. width: 10,
  3428. clampToGround: true
  3429. }
  3430. });
  3431. this._entities.add(rectEntity);
  3432. }
  3433. _console(...rest) {
  3434. if (this._isDebug)
  3435. console.log("===" + new Date().Format("yyyy-MM-dd HH:mm:ss") + ">>>", rest);
  3436. }
  3437. _renderTiles() {
  3438. let _self = this;
  3439. let tilesToRender = this._viewer.scene.globe._surface._tilesToRender;
  3440. if (tilesToRender === void 0 || tilesToRender.length === 0) {
  3441. this._isUpdateTile = true;
  3442. return;
  3443. } else {
  3444. new Promise((resolve2, reject2) => {
  3445. tilesToRender.sort(function(obj1, obj2) {
  3446. let level1 = parseInt(obj1.level);
  3447. let level2 = parseInt(obj2.level);
  3448. return level1 - level2;
  3449. });
  3450. resolve2(tilesToRender);
  3451. }).then((tiles) => {
  3452. _self._asyncProjectionTiles(tiles);
  3453. });
  3454. }
  3455. }
  3456. _createKey(x, y, level) {
  3457. let key = `${this._renderName}_${x}_${y}_${level}`;
  3458. return key;
  3459. }
  3460. _asyncProjectionTiles(tiles) {
  3461. let renderTiles = [];
  3462. for (let tile of tiles) {
  3463. let proTiles = this._projectionTile(tile);
  3464. for (let proTile of proTiles) {
  3465. let key = this._createKey(proTile.x, proTile.y, proTile.level);
  3466. let subTile = renderTiles.find((obj) => {
  3467. return obj.x === proTile.x && obj.y === proTile.y;
  3468. });
  3469. if (subTile === void 0) {
  3470. let isExists = false;
  3471. for (let eTile of renderTiles) {
  3472. if (Cesium.Rectangle.intersection(eTile.rectangle, proTile.rectangle)) {
  3473. eTile.childTiles.push(key);
  3474. isExists = true;
  3475. break;
  3476. }
  3477. }
  3478. if (!isExists) {
  3479. renderTiles.push({
  3480. key,
  3481. x: proTile.x,
  3482. y: proTile.y,
  3483. level: proTile.level,
  3484. rectangle: proTile.rectangle,
  3485. childTiles: []
  3486. });
  3487. }
  3488. }
  3489. }
  3490. }
  3491. let i2 = renderTiles.length;
  3492. let appendTiles = [];
  3493. while (i2--) {
  3494. let findTile = renderTiles[i2];
  3495. if (findTile.childTiles.length >= 1) {
  3496. let tiles2 = this._createFourTiles(findTile);
  3497. for (let tile of tiles2) {
  3498. appendTiles.push(tile);
  3499. }
  3500. renderTiles.splice(i2, 1);
  3501. }
  3502. }
  3503. for (let appendTile of appendTiles) {
  3504. renderTiles.push(appendTile);
  3505. }
  3506. renderTiles.sort(function(obj1, obj2) {
  3507. let level1 = parseInt(obj1.level);
  3508. let level2 = parseInt(obj2.level);
  3509. return level1 - level2;
  3510. });
  3511. this._renderTilesToViewer(renderTiles);
  3512. }
  3513. _createTileByRectangleAndLevel(rectangle, level) {
  3514. let center2 = Cesium.Rectangle.center(rectangle);
  3515. let nLevel = parseInt(level) + 1;
  3516. let query = this._provider.tilingScheme.positionToTileXY(center2, nLevel);
  3517. if (query === void 0)
  3518. return void 0;
  3519. return {
  3520. key: this._createKey(query.x, query.y, nLevel),
  3521. x: query.x,
  3522. y: query.y,
  3523. level: nLevel,
  3524. rectangle,
  3525. childTiles: []
  3526. };
  3527. }
  3528. _createFourTiles(tile) {
  3529. let rects = [];
  3530. let results = [];
  3531. let rectangle = tile.rectangle;
  3532. rects.push(Cesium.Rectangle.subsection(rectangle, 0, 0, 0.5, 0.5));
  3533. rects.push(Cesium.Rectangle.subsection(rectangle, 0.5, 0, 1, 0.5));
  3534. rects.push(Cesium.Rectangle.subsection(rectangle, 0, 0.5, 0.5, 1));
  3535. rects.push(Cesium.Rectangle.subsection(rectangle, 0.5, 0.5, 1, 1));
  3536. for (let rect of rects) {
  3537. if (Cesium.Rectangle.intersection(rect, this._rectangle)) {
  3538. let newTile = this._createTileByRectangleAndLevel(rect, tile.level);
  3539. if (newTile !== void 0)
  3540. results.push(newTile);
  3541. }
  3542. }
  3543. return results;
  3544. }
  3545. _renderTilesToViewer(tiles) {
  3546. let _self = this;
  3547. let deleteKeys = [];
  3548. for (let [key, tile] of this._renderEntities) {
  3549. let findTile = tiles.find((obj) => {
  3550. return obj.key === key;
  3551. });
  3552. if (findTile === void 0) {
  3553. deleteKeys.push(key);
  3554. }
  3555. }
  3556. for (let key of deleteKeys) {
  3557. this._renderEntities.delete(key);
  3558. this._entities.removeById(key);
  3559. }
  3560. for (let tile of tiles) {
  3561. if (!this._renderEntities.has(tile.key)) {
  3562. let entity = this._renderSimpleTileToViewer(tile);
  3563. this._renderEntities.set(tile.key, entity);
  3564. let workBlob = new Blob([`(${downloadWorker.toString()})()`]);
  3565. let worker = new Worker(URL.createObjectURL(workBlob));
  3566. worker.postMessage({
  3567. key: tile.key,
  3568. url: this._url,
  3569. x: tile.x,
  3570. y: tile.y,
  3571. level: tile.level
  3572. });
  3573. worker.onmessage = function(event2) {
  3574. _self._console(`render x:${event2.data.x} y:${event2.data.y} level:${event2.data.level}`);
  3575. let renderEntity = _self._entities.getById(event2.data.key);
  3576. if (renderEntity !== void 0) {
  3577. event2.data.key;
  3578. const canvas = _self._createCanvas(event2.data, event2.data.image, _self._isDebug);
  3579. renderEntity.rectangle.material = canvas;
  3580. }
  3581. worker.terminate();
  3582. };
  3583. }
  3584. }
  3585. this._isUpdateTile = true;
  3586. }
  3587. _renderSimpleTileToViewer(tile) {
  3588. const canvas = this._createCanvas(tile, void 0, this._isDebug);
  3589. let bjPositions = this._calculateRectangleOutlineCoordinates(tile.rectangle);
  3590. let tileEntity = new Cesium.Entity({
  3591. name: this._renderName,
  3592. id: tile.key,
  3593. rectangle: {
  3594. coordinates: tile.rectangle,
  3595. material: canvas
  3596. },
  3597. polyline: {
  3598. positions: bjPositions,
  3599. material: Cesium.Color.YELLOW.withAlpha(this._isDebug ? 1 : 0),
  3600. width: 1,
  3601. clampToGround: true
  3602. }
  3603. });
  3604. return this._entities.add(tileEntity);
  3605. }
  3606. _createCanvas(tile, image, islabel) {
  3607. let provider = this._provider;
  3608. const canvas = document.createElement("canvas");
  3609. canvas.width = provider.tileWidth;
  3610. canvas.height = provider.tileHeight;
  3611. const context = canvas.getContext("2d");
  3612. if (image !== void 0) {
  3613. context.globalAlpha = this._opacity;
  3614. context.drawImage(event.data.image, 0, 0, canvas.width, canvas.height);
  3615. }
  3616. if (islabel !== void 0 && islabel === true) {
  3617. context.globalAlpha = 1;
  3618. context.font = "20px Arial";
  3619. context.textAlign = "center";
  3620. context.fillStyle = "rgba(255,255,0)";
  3621. context.strokeStyle = "rgba(255,255,255,1)";
  3622. context.lineWidth = 2;
  3623. context.strokeText(`L: ${tile.level}`, 126, 86);
  3624. context.fillText(`L: ${tile.level}`, 126, 86);
  3625. context.strokeText(`X: ${tile.x}`, 126, 136);
  3626. context.fillText(`X: ${tile.x}`, 126, 136);
  3627. context.strokeText(`Y: ${tile.y}`, 126, 186);
  3628. context.fillText(`Y: ${tile.y}`, 126, 186);
  3629. }
  3630. return canvas;
  3631. }
  3632. _projectionTile(tile) {
  3633. let rectangle = tile._rectangle;
  3634. let imageryLevel = parseInt(tile.level);
  3635. let mercatorTilingScheme = this._provider.tilingScheme;
  3636. let res = [];
  3637. let interRectangle = Cesium.Rectangle.intersection(rectangle, this._rectangle);
  3638. if (interRectangle === void 0)
  3639. return res;
  3640. let northwestTileCoordinates = mercatorTilingScheme.positionToTileXY(
  3641. Cesium.Rectangle.northwest(rectangle),
  3642. imageryLevel
  3643. );
  3644. let southeastTileCoordinates = mercatorTilingScheme.positionToTileXY(
  3645. Cesium.Rectangle.southeast(rectangle),
  3646. imageryLevel
  3647. );
  3648. if (northwestTileCoordinates !== void 0 && southeastTileCoordinates !== void 0) {
  3649. for (let i2 = northwestTileCoordinates.x; i2 <= southeastTileCoordinates.x; i2++) {
  3650. for (let j = northwestTileCoordinates.y; j <= southeastTileCoordinates.y; j++) {
  3651. let _webRectangle = mercatorTilingScheme.tileXYToRectangle(i2, j, imageryLevel);
  3652. if (Cesium.Rectangle.intersection(_webRectangle, this._rectangle)) {
  3653. res.push({
  3654. x: i2,
  3655. y: j,
  3656. level: imageryLevel,
  3657. rectangle: _webRectangle
  3658. });
  3659. }
  3660. }
  3661. }
  3662. } else if (northwestTileCoordinates !== void 0) {
  3663. let _webRectangle = mercatorTilingScheme.tileXYToRectangle(
  3664. northwestTileCoordinates.x,
  3665. northwestTileCoordinates.y,
  3666. imageryLevel
  3667. );
  3668. if (Cesium.Rectangle.intersection(_webRectangle, this._rectangle)) {
  3669. res.push({
  3670. x: northwestTileCoordinates.x,
  3671. y: northwestTileCoordinates.y,
  3672. level: imageryLevel,
  3673. rectangle: _webRectangle
  3674. });
  3675. }
  3676. } else if (southeastTileCoordinates !== void 0) {
  3677. let _webRectangle = mercatorTilingScheme.tileXYToRectangle(
  3678. southeastTileCoordinates.x,
  3679. southeastTileCoordinates.y,
  3680. imageryLevel
  3681. );
  3682. if (Cesium.Rectangle.intersection(_webRectangle, this._rectangle)) {
  3683. res.push({
  3684. x: southeastTileCoordinates.x,
  3685. y: southeastTileCoordinates.y,
  3686. level: imageryLevel,
  3687. rectangle: _webRectangle
  3688. });
  3689. }
  3690. }
  3691. return res;
  3692. }
  3693. _calculateRectangleOutlineCoordinates(rectangle) {
  3694. let south_east = Cesium.Rectangle.southeast(rectangle);
  3695. let se2 = Cesium.Cartographic.toCartesian(south_east);
  3696. let south_west = Cesium.Rectangle.southwest(rectangle);
  3697. let sw = Cesium.Cartographic.toCartesian(south_west);
  3698. let north_east = Cesium.Rectangle.northeast(rectangle);
  3699. let ne2 = Cesium.Cartographic.toCartesian(north_east);
  3700. let north_west = Cesium.Rectangle.northwest(rectangle);
  3701. let nw = Cesium.Cartographic.toCartesian(north_west);
  3702. return [sw, se2, ne2, nw, sw];
  3703. }
  3704. _removeEntityByName(entityName) {
  3705. var entities2 = this._entities;
  3706. if (!entities2 || !entities2.values)
  3707. return;
  3708. var delEntitys = [];
  3709. for (var i2 = 0; i2 < entities2.values.length; i2++) {
  3710. if (entities2.values[i2].name == entityName) {
  3711. delEntitys.push(entities2.values[i2]);
  3712. }
  3713. }
  3714. for (var i2 = 0; i2 < delEntitys.length; i2++) {
  3715. entities2.remove(delEntitys[i2]);
  3716. }
  3717. }
  3718. }
  3719. Object.assign(CrImageServerLayer.prototype, {
  3720. hide: function() {
  3721. this._console("\u9690\u85CF");
  3722. this._isUpdateTile = false;
  3723. this._removeEntityByName(this._renderName);
  3724. this._renderEntities.clear();
  3725. },
  3726. show: function() {
  3727. this._console("\u663E\u793A");
  3728. this._isUpdateTile = true;
  3729. },
  3730. setOpacity: function(opacity) {
  3731. if (opacity === void 0 || typeof opacity !== "number")
  3732. return;
  3733. if (opacity >= 1)
  3734. this._opacity = 1;
  3735. if (opacity <= 0)
  3736. this._opacity = 0;
  3737. this._opacity = parseFloat(opacity);
  3738. }
  3739. });
  3740. function downloadWorker() {
  3741. onmessage = function(event2) {
  3742. let data = event2.data;
  3743. let url = data.url + "/tile/" + data.level + "/" + data.y + "/" + data.x;
  3744. let xhr = new XMLHttpRequest();
  3745. xhr.open("get", url, true);
  3746. xhr.responseType = "blob";
  3747. xhr.onload = function() {
  3748. if (this.status === 200) {
  3749. var blob = this.response;
  3750. var bmpPromise = createImageBitmap(blob, {
  3751. imageOrientation: "none",
  3752. premultiplyAlpha: "none",
  3753. colorSpaceConversion: "default"
  3754. });
  3755. bmpPromise.then(function(image) {
  3756. let outObj = {
  3757. key: data.key,
  3758. x: data.x,
  3759. y: data.y,
  3760. level: data.level,
  3761. image
  3762. };
  3763. postMessage(outObj);
  3764. });
  3765. } else {
  3766. console.log("===>>>", url + " Not found");
  3767. }
  3768. };
  3769. xhr.send();
  3770. };
  3771. }
  3772. class LocateUtil {
  3773. constructor(viewer2) {
  3774. if (!viewer2)
  3775. throw new Cesium.DeveloperError("no viewer object!");
  3776. this._viewer = viewer2;
  3777. this._locationEntity = null;
  3778. }
  3779. }
  3780. Object.assign(LocateUtil.prototype, {
  3781. flyToPoint: function(options2) {
  3782. return new Promise((resolve2, reject2) => {
  3783. if (!Cesium.defined(options2) || !Cesium.defined(options2.longitude) || !Cesium.defined(options2.latitude)) {
  3784. throw new Cesium.DeveloperError("options.longitude and options.latitude are required.");
  3785. }
  3786. options2.height = Cesium.defaultValue(options2.height, 0);
  3787. options2.heading = Cesium.defaultValue(options2.heading, 0);
  3788. options2.pitch = Cesium.defaultValue(options2.pitch, -90);
  3789. options2.range = Cesium.defaultValue(options2.range, 0);
  3790. options2.duration = Cesium.defaultValue(options2.duration, 3);
  3791. var boundingSphere = new Cesium.BoundingSphere(Cesium.Cartesian3.fromDegrees(options2.longitude, options2.latitude, options2.height), 0);
  3792. this._viewer.camera.flyToBoundingSphere(boundingSphere, {
  3793. duration: options2.duration,
  3794. complete: function() {
  3795. resolve2(true);
  3796. },
  3797. offset: {
  3798. heading: Cesium.Math.toRadians(options2.heading),
  3799. pitch: Cesium.Math.toRadians(options2.pitch),
  3800. range: options2.range
  3801. }
  3802. });
  3803. });
  3804. },
  3805. flyToEntityByPoints: function(points2, type2, options2) {
  3806. return new Promise((resolve2, reject2) => {
  3807. let _self = this;
  3808. options2 = options2 || {};
  3809. if (points2 === void 0 || points2.length === void 0) {
  3810. reject2("\u8F93\u5165\u7684\u5750\u6807\u96C6\u5408\u5F02\u5E38\uFF01");
  3811. return;
  3812. }
  3813. let pointsArray = points2.map((point2) => {
  3814. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  3815. });
  3816. if (_self._locationEntity) {
  3817. _self._viewer.entities.remove(_self._locationEntity);
  3818. }
  3819. switch (type2) {
  3820. case "point":
  3821. _self._locationEntity = _self._viewer.entities.add({
  3822. position: pointsArray[0],
  3823. point: {
  3824. pixelSize: 1
  3825. }
  3826. });
  3827. break;
  3828. case "polyline":
  3829. if (pointsArray.length < 2) {
  3830. reject2("\u7EBF\u5BF9\u8C61\u5B9A\u4F4D\uFF0C\u70B9\u6570\u81F3\u5C112\u4E2A");
  3831. } else {
  3832. _self._locationEntity = _self._viewer.entities.add({
  3833. polyline: {
  3834. positions: pointsArray,
  3835. clampToGround: true,
  3836. material: new Cesium.Color(255, 0, 0, 0.5),
  3837. width: 1
  3838. }
  3839. });
  3840. }
  3841. break;
  3842. case "polygon":
  3843. if (pointsArray.length < 3) {
  3844. reject2("\u9762\u5BF9\u8C61\u5B9A\u4F4D\uFF0C\u70B9\u6570\u81F3\u5C113\u4E2A");
  3845. } else {
  3846. _self._locationEntity = _self._viewer.entities.add({
  3847. polygon: {
  3848. hierarchy: {
  3849. positions: pointsArray
  3850. },
  3851. material: new Cesium.Color(255, 0, 0, 0.5),
  3852. outline: true
  3853. }
  3854. });
  3855. }
  3856. break;
  3857. default:
  3858. reject2("\u5750\u6807\u5F02\u5E38\uFF01");
  3859. break;
  3860. }
  3861. options2.duration = Cesium.defaultValue(options2.duration, 3);
  3862. options2.heading = Cesium.defaultValue(options2.heading, 0);
  3863. options2.pitch = Cesium.defaultValue(options2.pitch, -90);
  3864. options2.range = Cesium.defaultValue(options2.range, 0);
  3865. let flyPromise = _self._viewer.flyTo(_self._locationEntity, {
  3866. duration: options2.duration,
  3867. offset: {
  3868. heading: Cesium.Math.toRadians(options2.heading),
  3869. pitch: Cesium.Math.toRadians(options2.pitch),
  3870. range: options2.range
  3871. }
  3872. });
  3873. flyPromise.then(function(flag) {
  3874. if (flag) {
  3875. resolve2(_self._locationEntity);
  3876. }
  3877. });
  3878. });
  3879. },
  3880. flyToEntity: function(entity, options2) {
  3881. return new Promise((resolve2, reject2) => {
  3882. let _self = this;
  3883. options2 = options2 || {};
  3884. if (_self._locationEntity) {
  3885. _self._viewer.entities.remove(_self._locationEntity);
  3886. }
  3887. _self._locationEntity = entity;
  3888. options2.duration = Cesium.defaultValue(options2.duration, 3);
  3889. options2.heading = Cesium.defaultValue(options2.heading, 0);
  3890. options2.pitch = Cesium.defaultValue(options2.pitch, -90);
  3891. options2.range = Cesium.defaultValue(options2.range, 0);
  3892. let flyPromise = _self._viewer.flyTo(_self._locationEntity, {
  3893. duration: options2.duration,
  3894. offset: {
  3895. heading: Cesium.Math.toRadians(options2.heading),
  3896. pitch: Cesium.Math.toRadians(options2.pitch),
  3897. range: options2.range
  3898. }
  3899. });
  3900. flyPromise.then(function(flag) {
  3901. if (flag) {
  3902. resolve2(_self._locationEntity);
  3903. }
  3904. });
  3905. });
  3906. },
  3907. zoomToTilesets(tileset, options2) {
  3908. return new Promise((resolve2, reject2) => {
  3909. let _self = this;
  3910. if (!Cesium.defined(tileset)) {
  3911. throw new Cesium.DeveloperError("tileset is required.");
  3912. }
  3913. options2 = options2 || {};
  3914. options2.heading = Cesium.defaultValue(options2.heading, 120);
  3915. options2.pitch = Cesium.defaultValue(options2.pitch, -10);
  3916. options2.range = Cesium.defaultValue(options2.range, 450);
  3917. options2.duration = Cesium.defaultValue(options2.duration, 3);
  3918. let boundingSphere = tileset.boundingSphere;
  3919. _self._viewer.camera.flyToBoundingSphere(boundingSphere, {
  3920. duration: options2.duration,
  3921. complete: function() {
  3922. resolve2(true);
  3923. },
  3924. offset: {
  3925. heading: Cesium.Math.toRadians(options2.heading),
  3926. pitch: Cesium.Math.toRadians(options2.pitch),
  3927. range: options2.range
  3928. }
  3929. });
  3930. });
  3931. },
  3932. flyToTileset(tileset, options2) {
  3933. return new Promise((resolve2, reject2) => {
  3934. let _self = this;
  3935. if (!Cesium.defined(tileset)) {
  3936. throw new Cesium.DeveloperError("tileset is required.");
  3937. }
  3938. options2 = options2 || {};
  3939. options2.heading = Cesium.defaultValue(options2.heading, 120);
  3940. options2.pitch = Cesium.defaultValue(options2.pitch, -10);
  3941. options2.range = Cesium.defaultValue(options2.range, 450);
  3942. options2.duration = Cesium.defaultValue(options2.duration, 3);
  3943. let flyPromise = _self._viewer.flyTo(tileset, {
  3944. duration: options2.duration,
  3945. offset: {
  3946. heading: Cesium.Math.toRadians(options2.heading),
  3947. pitch: Cesium.Math.toRadians(options2.pitch),
  3948. range: options2.range
  3949. }
  3950. });
  3951. flyPromise.then(function(flag) {
  3952. if (flag) {
  3953. resolve2(true);
  3954. }
  3955. });
  3956. });
  3957. }
  3958. });
  3959. const CreateRemindertip = function(arr, position2, show) {
  3960. let tooltip2 = document.getElementById("toolTip");
  3961. let style, _x, _y, _color;
  3962. if (arr && typeof arr === "object") {
  3963. style = arr;
  3964. }
  3965. if (style && style.origin) {
  3966. style.origin === "center" && (_x = 15, _y = -12);
  3967. style.origin === "top" && (_x = 15, _y = -44);
  3968. style.origin === "bottom" && (_x = 15, _y = 20);
  3969. } else {
  3970. _x = 15, _y = 20;
  3971. }
  3972. if (style && style.color) {
  3973. style.color === "white" && (_color = "background: rgba(255, 255, 255, 0.8);color: black;");
  3974. style.color === "black" && (_color = "background: rgba(0, 0, 0, 0.65);color: white;");
  3975. style.color === "yellow" && (_color = "color: black;background-color: #ffcc33;border: 1px solid white;");
  3976. } else {
  3977. _color = "background: rgba(0, 0, 0, 0.65);color: white;";
  3978. }
  3979. if (!tooltip2) {
  3980. const viewerDom = document.getElementsByClassName("cesium-viewer")[0];
  3981. let elementbottom = document.createElement("div");
  3982. viewerDom.append(elementbottom);
  3983. let html = '<div id="toolTip" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;' + _color + '"></div>';
  3984. viewerDom.insertAdjacentHTML("beforeend", html);
  3985. tooltip2 = document.getElementById("toolTip");
  3986. }
  3987. if (show) {
  3988. tooltip2.innerHTML = arr;
  3989. tooltip2.style.left = position2.x + _x + "px";
  3990. tooltip2.style.top = position2.y + _y + "px";
  3991. tooltip2.style.display = "block";
  3992. } else {
  3993. tooltip2.style.display = "none";
  3994. }
  3995. return {
  3996. tooltip: tooltip2,
  3997. style,
  3998. showAt: function(position3, text) {
  3999. this.tooltip.innerHTML = text;
  4000. if (this.style && this.style.origin) {
  4001. this.style.origin === "center" && (_x = 15, _y = -this.tooltip.offsetHeight / 2);
  4002. this.style.origin === "top" && (_x = 15, _y = -this.tooltip.offsetHeight - 20);
  4003. this.style.origin === "bottom" && (_x = 15, _y = 20);
  4004. } else {
  4005. _x = 15, _y = -this.tooltip.offsetHeight / 2;
  4006. }
  4007. this.tooltip.style.left = position3.x + _x + "px";
  4008. this.tooltip.style.top = position3.y + _y + "px";
  4009. this.tooltip.style.display = "block";
  4010. },
  4011. show: function(show2) {
  4012. if (show2) {
  4013. this.tooltip.style.display = "block";
  4014. } else {
  4015. this.tooltip.style.display = "none";
  4016. }
  4017. }
  4018. };
  4019. };
  4020. class SightLine {
  4021. constructor(viewer2) {
  4022. if (!viewer2)
  4023. throw new Cesium.DeveloperError("no viewer object!");
  4024. this._viewer = viewer2;
  4025. this._resultObject = {
  4026. viewPoint: void 0,
  4027. targetPoints: [],
  4028. targetPoint: void 0,
  4029. objectExclude: [],
  4030. entities: []
  4031. };
  4032. }
  4033. _distance(point1, point2) {
  4034. let point1cartographic = Cesium.Cartographic.fromCartesian(point1);
  4035. let point2cartographic = Cesium.Cartographic.fromCartesian(point2);
  4036. let geodesic = new Cesium.EllipsoidGeodesic();
  4037. geodesic.setEndPoints(point1cartographic, point2cartographic);
  4038. let s = geodesic.surfaceDistance;
  4039. s = Math.sqrt(
  4040. Math.pow(s, 2) + Math.pow(point2cartographic.height - point1cartographic.height, 2)
  4041. );
  4042. return s;
  4043. }
  4044. _checkAppOrWeb() {
  4045. if (window.navigator.userAgent.match(
  4046. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  4047. )) {
  4048. return SightLine.RuntimeEnvironment.App;
  4049. } else {
  4050. return SightLine.RuntimeEnvironment.Web;
  4051. }
  4052. }
  4053. _isRuntimeApp() {
  4054. if (this._checkAppOrWeb() === SightLine.RuntimeEnvironment.App) {
  4055. return true;
  4056. }
  4057. return false;
  4058. }
  4059. _isRuntimeWeb() {
  4060. if (this._checkAppOrWeb() === SightLine.RuntimeEnvironment.Web) {
  4061. return true;
  4062. }
  4063. return false;
  4064. }
  4065. _createOperationMainDom() {
  4066. let buttonDiv = document.createElement("div");
  4067. buttonDiv.id = "drawButtonDiv";
  4068. buttonDiv.style.width = "80px";
  4069. buttonDiv.style.backgroundColor = "rgba(5, 45, 155, 0.7)";
  4070. buttonDiv.style.borderRadius = "5px";
  4071. buttonDiv.style.display = "flex";
  4072. buttonDiv.style.flexDirection = "column";
  4073. buttonDiv.style.padding = "8px";
  4074. buttonDiv.style.justifyContent = "center";
  4075. buttonDiv.style.position = "absolute";
  4076. buttonDiv.style.bottom = "150px";
  4077. buttonDiv.style.right = "10px";
  4078. let btnCompletion = document.createElement("button");
  4079. btnCompletion.id = "btnDrawComplete";
  4080. btnCompletion.style.height = "30px";
  4081. btnCompletion.style.backgroundColor = "rgba(88, 185, 45, 1.0)";
  4082. btnCompletion.style.color = "rgb(255, 255, 255)";
  4083. btnCompletion.style.border = "0px solid red";
  4084. btnCompletion.style.borderRadius = "5px";
  4085. btnCompletion.innerHTML = "\u5B8C\u6210";
  4086. btnCompletion.style.fontSize = "13px";
  4087. btnCompletion.style.cursor = "pointer";
  4088. buttonDiv.appendChild(btnCompletion);
  4089. document.body.appendChild(buttonDiv);
  4090. }
  4091. _showTooltipMessage(message) {
  4092. let msgMainDom = document.getElementById("messageMainDom");
  4093. if (msgMainDom !== null && msgMainDom !== void 0) {
  4094. document.body.removeChild(msgMainDom);
  4095. }
  4096. msgMainDom = document.createElement("div");
  4097. msgMainDom.style.width = "30%";
  4098. msgMainDom.style.backgroundColor = "rgba(237, 248, 230, 1.0)";
  4099. msgMainDom.style.height = "45px";
  4100. msgMainDom.style.border = "solid 2px rgb(219, 241, 208)";
  4101. msgMainDom.style.borderRadius = "8px";
  4102. msgMainDom.style.display = "flex";
  4103. msgMainDom.style.alignItems = "center";
  4104. msgMainDom.style.paddingLeft = "10px";
  4105. msgMainDom.style.color = "rgb(91, 188, 48)";
  4106. msgMainDom.style.fontSize = "14px";
  4107. msgMainDom.style.fontWeight = "600";
  4108. msgMainDom.style.position = "absolute";
  4109. msgMainDom.style.left = "35%";
  4110. msgMainDom.style.transition = "transform 1s";
  4111. msgMainDom.style.transform = "translateY(-90px)";
  4112. msgMainDom.style.top = "0px";
  4113. msgMainDom.style.zIndex = 1e3;
  4114. document.body.appendChild(msgMainDom);
  4115. let strHtml = "";
  4116. strHtml += "<div style='";
  4117. strHtml += "background-color: rgb(88, 185, 45);";
  4118. strHtml += "color: rgb(255, 255, 255);";
  4119. strHtml += "height: 24px;";
  4120. strHtml += "width: 24px;";
  4121. strHtml += "border-radius: 20px;";
  4122. strHtml += "display: flex;";
  4123. strHtml += "justify-content: center;";
  4124. strHtml += "align-items: center;";
  4125. strHtml += "font-size: 14px;";
  4126. strHtml += "margin-right: 18px;";
  4127. strHtml += "'>&#10003</div>";
  4128. strHtml += "<div>" + message + "</div>";
  4129. msgMainDom.innerHTML = strHtml;
  4130. msgMainDom.addEventListener("transitionend", function() {
  4131. setTimeout(function() {
  4132. document.body.removeChild(msgMainDom);
  4133. }, 1e3);
  4134. }, false);
  4135. setTimeout(function() {
  4136. msgMainDom.style.transform = "translateY(50px)";
  4137. }, 100);
  4138. }
  4139. }
  4140. Object.assign(SightLine.prototype, {
  4141. startSightLine() {
  4142. let _self = this;
  4143. _self.clearAll();
  4144. let toolTip = "\u5DE6\u952E\u5355\u51FB\u521B\u5EFA\u89C6\u89D2\u8D77\u70B9";
  4145. if (this._isRuntimeApp()) {
  4146. toolTip = "\u5355\u51FB\u521B\u5EFA\u89C6\u89D2\u8D77\u70B9";
  4147. _self._showTooltipMessage(toolTip);
  4148. }
  4149. _self.handler = new Cesium.ScreenSpaceEventHandler(_self._viewer.canvas);
  4150. _self.handler.setInputAction((event2) => {
  4151. let loc2 = CoordTransform._transfromFromScreenPoint(_self._viewer, event2.position);
  4152. toolTip = "\u5DE6\u952E\u521B\u5EFA\u89C6\u89D2\u7EC8\u70B9\uFF0C\u53F3\u952E\u7ED3\u675F\u901A\u89C6\u5206\u6790";
  4153. if (this._isRuntimeApp()) {
  4154. toolTip = "\u518D\u6B21\u5355\u51FB\u521B\u5EFA\u89C6\u89D2\u7EC8\u70B9";
  4155. _self._showTooltipMessage(toolTip);
  4156. }
  4157. if (!Cesium.defined(loc2.sLocation))
  4158. return;
  4159. let cartesian = loc2.sLocation;
  4160. if (!_self._resultObject.viewPoint) {
  4161. _self._resultObject.viewPoint = cartesian;
  4162. let pointEntity = _self._viewer.entities.add({
  4163. position: cartesian,
  4164. point: {
  4165. color: Cesium.Color.YELLOW,
  4166. pixelSize: 5
  4167. },
  4168. label: {
  4169. text: "\u89C2\u5BDF\u4F4D\u7F6E",
  4170. font: "12px sans-serif",
  4171. fillColor: new Cesium.Color(255 / 255, 255 / 255, 255 / 255, 1),
  4172. outlineColor: new Cesium.Color(0, 154 / 255, 94 / 255, 1),
  4173. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  4174. outlineWidth: 1,
  4175. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  4176. pixelOffset: new Cesium.Cartesian2(0, -28),
  4177. showBackground: true,
  4178. backgroundColor: new Cesium.Color(0, 0, 0, 0.6),
  4179. disableDepthTestDistance: Number.POSITIVE_INFINITY
  4180. }
  4181. });
  4182. _self._resultObject.objectExclude.push(pointEntity);
  4183. _self._resultObject.entities.push(pointEntity);
  4184. } else {
  4185. _self._resultObject.targetPoint = cartesian;
  4186. let pointEntity = _self._viewer.entities.add({
  4187. position: cartesian,
  4188. point: {
  4189. color: Cesium.Color.YELLOW,
  4190. pixelSize: 5
  4191. },
  4192. label: {
  4193. text: "\u76EE\u6807\u4F4D\u7F6E",
  4194. font: "12px sans-serif",
  4195. fillColor: new Cesium.Color(255 / 255, 255 / 255, 255 / 255, 1),
  4196. outlineColor: new Cesium.Color(0, 154 / 255, 94 / 255, 1),
  4197. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  4198. outlineWidth: 1,
  4199. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  4200. pixelOffset: new Cesium.Cartesian2(0, -28),
  4201. showBackground: true,
  4202. backgroundColor: new Cesium.Color(0, 0, 0, 0.6),
  4203. disableDepthTestDistance: Number.POSITIVE_INFINITY
  4204. }
  4205. });
  4206. _self._resultObject.objectExclude.push(pointEntity);
  4207. _self._resultObject.entities.push(pointEntity);
  4208. let direction = Cesium.Cartesian3.normalize(
  4209. Cesium.Cartesian3.subtract(
  4210. _self._resultObject.targetPoint,
  4211. _self._resultObject.viewPoint,
  4212. new Cesium.Cartesian3()
  4213. ),
  4214. new Cesium.Cartesian3()
  4215. );
  4216. let ray = new Cesium.Ray(_self._resultObject.viewPoint, direction);
  4217. let result = _self._viewer.scene.pickFromRay(ray, _self._resultObject.objectExclude);
  4218. if (result) {
  4219. let dis0 = _self._distance(
  4220. _self._resultObject.viewPoint,
  4221. _self._resultObject.targetPoint
  4222. );
  4223. let dis1 = _self._distance(
  4224. _self._resultObject.viewPoint,
  4225. result.position
  4226. );
  4227. let dis2 = _self._distance(
  4228. result.position,
  4229. _self._resultObject.targetPoint
  4230. );
  4231. console.log(dis0, dis1, dis2);
  4232. if (dis0 > dis1) {
  4233. let _poly0 = _self._viewer.entities.add({
  4234. polyline: {
  4235. positions: [_self._resultObject.viewPoint, result.position],
  4236. material: Cesium.Color.GREEN,
  4237. width: 3
  4238. }
  4239. });
  4240. _self._resultObject.entities.push(_poly0);
  4241. let _poly1 = _self._viewer.entities.add({
  4242. polyline: {
  4243. positions: [result.position, _self._resultObject.targetPoint],
  4244. material: Cesium.Color.RED,
  4245. width: 3
  4246. }
  4247. });
  4248. _self._resultObject.entities.push(_poly1);
  4249. _self._resultObject.targetPoints.push({
  4250. targetPoint: cartesian,
  4251. visual: false,
  4252. distance: [dis0, dis1, dis2]
  4253. });
  4254. } else {
  4255. let _poly2 = _self._viewer.entities.add({
  4256. polyline: {
  4257. positions: [
  4258. _self._resultObject.viewPoint,
  4259. _self._resultObject.targetPoint
  4260. ],
  4261. material: Cesium.Color.GREEN,
  4262. width: 3
  4263. }
  4264. });
  4265. _self._resultObject.entities.push(_poly2);
  4266. _self._resultObject.targetPoints.push({
  4267. targetPoint: cartesian,
  4268. visual: true,
  4269. distance: [dis0, dis1, dis2]
  4270. });
  4271. }
  4272. }
  4273. }
  4274. if (_self._resultObject.objectExclude.length === 2) {
  4275. if (this._isRuntimeApp()) {
  4276. _self._createOperationMainDom();
  4277. document.getElementById("btnDrawComplete").onclick = () => {
  4278. CreateRemindertip(toolTip, event2.endPosition, false);
  4279. _self.handler.destroy();
  4280. let buttonDiv = document.getElementById("drawButtonDiv");
  4281. if (buttonDiv) {
  4282. document.body.removeChild(buttonDiv);
  4283. }
  4284. };
  4285. }
  4286. }
  4287. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  4288. _self.handler.setInputAction(function(move) {
  4289. if (_self._isRuntimeApp())
  4290. return;
  4291. CreateRemindertip(toolTip, move.endPosition, true);
  4292. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  4293. _self.handler.setInputAction((event2) => {
  4294. CreateRemindertip(toolTip, event2.endPosition, false);
  4295. _self.handler.destroy();
  4296. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  4297. },
  4298. clearAll() {
  4299. this._resultObject.entities.forEach((element) => {
  4300. this._viewer.entities.remove(element);
  4301. });
  4302. this._resultObject = {
  4303. viewPoint: void 0,
  4304. targetPoints: [],
  4305. targetPoint: void 0,
  4306. objectExclude: [],
  4307. entities: []
  4308. };
  4309. if (this.handler) {
  4310. this.handler.destroy();
  4311. }
  4312. let buttonDiv = document.getElementById("drawButtonDiv");
  4313. if (buttonDiv) {
  4314. document.body.removeChild(buttonDiv);
  4315. }
  4316. }
  4317. });
  4318. SightLine.RuntimeEnvironment = Object.freeze({
  4319. App: "app",
  4320. Web: "web"
  4321. });
  4322. /*!
  4323. * author: [object Object]
  4324. * @sakitam-gis/kriging v0.1.0
  4325. * build-time: 2019-7-6 20:41
  4326. * LICENSE: MIT
  4327. * (c) 2019-2019 https://github.com/sakitam-gis/kriging.js
  4328. */
  4329. function max(source) {
  4330. return Math.max.apply(null, source);
  4331. }
  4332. function min(source) {
  4333. return Math.min.apply(null, source);
  4334. }
  4335. function rep(source, n) {
  4336. var array = [];
  4337. for (var i2 = 0; i2 < n; i2++) {
  4338. array.push(source);
  4339. }
  4340. return array;
  4341. }
  4342. function pip(source, x, y) {
  4343. var i2 = 0;
  4344. var j = source.length - 1;
  4345. var c = false;
  4346. var length = source.length;
  4347. for (; i2 < length; j = i2++) {
  4348. if (source[i2][1] > y !== source[j][1] > y && x < (source[j][0] - source[i2][0]) * (y - source[i2][1]) / (source[j][1] - source[i2][1]) + source[i2][0]) {
  4349. c = !c;
  4350. }
  4351. }
  4352. return c;
  4353. }
  4354. function matrixDiag(c, n) {
  4355. var i2 = 0;
  4356. var Z2 = rep(0, n * n);
  4357. for (; i2 < n; i2++) {
  4358. Z2[i2 * n + i2] = c;
  4359. }
  4360. return Z2;
  4361. }
  4362. function matrixTranspose(X2, n, m) {
  4363. var i2 = 0;
  4364. var j;
  4365. var Z2 = Array(m * n);
  4366. for (; i2 < n; i2++) {
  4367. j = 0;
  4368. for (; j < m; j++) {
  4369. Z2[j * n + i2] = X2[i2 * m + j];
  4370. }
  4371. }
  4372. return Z2;
  4373. }
  4374. function matrixAdd(X2, Y, n, m) {
  4375. var i2 = 0;
  4376. var j;
  4377. var Z2 = Array(n * m);
  4378. for (; i2 < n; i2++) {
  4379. j = 0;
  4380. for (; j < m; j++) {
  4381. Z2[i2 * m + j] = X2[i2 * m + j] + Y[i2 * m + j];
  4382. }
  4383. }
  4384. return Z2;
  4385. }
  4386. function matrixMultiply(X2, Y, n, m, p) {
  4387. var i2 = 0;
  4388. var j;
  4389. var k;
  4390. var Z2 = Array(n * p);
  4391. for (; i2 < n; i2++) {
  4392. j = 0;
  4393. for (; j < p; j++) {
  4394. Z2[i2 * p + j] = 0;
  4395. k = 0;
  4396. for (; k < m; k++) {
  4397. Z2[i2 * p + j] += X2[i2 * m + k] * Y[k * p + j];
  4398. }
  4399. }
  4400. }
  4401. return Z2;
  4402. }
  4403. function matrixChol(X2, n) {
  4404. var i2;
  4405. var j;
  4406. var k;
  4407. var p = Array(n);
  4408. for (i2 = 0; i2 < n; i2++)
  4409. p[i2] = X2[i2 * n + i2];
  4410. for (i2 = 0; i2 < n; i2++) {
  4411. for (j = 0; j < i2; j++)
  4412. p[i2] -= X2[i2 * n + j] * X2[i2 * n + j];
  4413. if (p[i2] <= 0)
  4414. return false;
  4415. p[i2] = Math.sqrt(p[i2]);
  4416. for (j = i2 + 1; j < n; j++) {
  4417. for (k = 0; k < i2; k++)
  4418. X2[j * n + i2] -= X2[j * n + k] * X2[i2 * n + k];
  4419. X2[j * n + i2] /= p[i2];
  4420. }
  4421. }
  4422. for (i2 = 0; i2 < n; i2++)
  4423. X2[i2 * n + i2] = p[i2];
  4424. return true;
  4425. }
  4426. function matrixChol2inv(X2, n) {
  4427. var i2;
  4428. var j;
  4429. var k;
  4430. var sum;
  4431. for (i2 = 0; i2 < n; i2++) {
  4432. X2[i2 * n + i2] = 1 / X2[i2 * n + i2];
  4433. for (j = i2 + 1; j < n; j++) {
  4434. sum = 0;
  4435. for (k = i2; k < j; k++)
  4436. sum -= X2[j * n + k] * X2[k * n + i2];
  4437. X2[j * n + i2] = sum / X2[j * n + j];
  4438. }
  4439. }
  4440. for (i2 = 0; i2 < n; i2++)
  4441. for (j = i2 + 1; j < n; j++)
  4442. X2[i2 * n + j] = 0;
  4443. for (i2 = 0; i2 < n; i2++) {
  4444. X2[i2 * n + i2] *= X2[i2 * n + i2];
  4445. for (k = i2 + 1; k < n; k++)
  4446. X2[i2 * n + i2] += X2[k * n + i2] * X2[k * n + i2];
  4447. for (j = i2 + 1; j < n; j++)
  4448. for (k = j; k < n; k++)
  4449. X2[i2 * n + j] += X2[k * n + i2] * X2[k * n + j];
  4450. }
  4451. for (i2 = 0; i2 < n; i2++)
  4452. for (j = 0; j < i2; j++)
  4453. X2[i2 * n + j] = X2[j * n + i2];
  4454. }
  4455. function matrixSolve(X2, n) {
  4456. var m = n;
  4457. var b = Array(n * n);
  4458. var indxc = Array(n);
  4459. var indxr = Array(n);
  4460. var ipiv = Array(n);
  4461. var i2;
  4462. var icol = 0;
  4463. var irow = 0;
  4464. var j;
  4465. var k;
  4466. var l;
  4467. var ll;
  4468. var big;
  4469. var dum;
  4470. var pivinv;
  4471. var temp;
  4472. for (i2 = 0; i2 < n; i2++) {
  4473. for (j = 0; j < n; j++) {
  4474. if (i2 === j)
  4475. b[i2 * n + j] = 1;
  4476. else
  4477. b[i2 * n + j] = 0;
  4478. }
  4479. }
  4480. for (j = 0; j < n; j++)
  4481. ipiv[j] = 0;
  4482. for (i2 = 0; i2 < n; i2++) {
  4483. big = 0;
  4484. for (j = 0; j < n; j++) {
  4485. if (ipiv[j] !== 1) {
  4486. for (k = 0; k < n; k++) {
  4487. if (ipiv[k] === 0) {
  4488. if (Math.abs(X2[j * n + k]) >= big) {
  4489. big = Math.abs(X2[j * n + k]);
  4490. irow = j;
  4491. icol = k;
  4492. }
  4493. }
  4494. }
  4495. }
  4496. }
  4497. ++ipiv[icol];
  4498. if (irow !== icol) {
  4499. for (l = 0; l < n; l++) {
  4500. temp = X2[irow * n + l];
  4501. X2[irow * n + l] = X2[icol * n + l];
  4502. X2[icol * n + l] = temp;
  4503. }
  4504. for (l = 0; l < m; l++) {
  4505. temp = b[irow * n + l];
  4506. b[irow * n + l] = b[icol * n + l];
  4507. b[icol * n + l] = temp;
  4508. }
  4509. }
  4510. indxr[i2] = irow;
  4511. indxc[i2] = icol;
  4512. if (X2[icol * n + icol] === 0)
  4513. return false;
  4514. pivinv = 1 / X2[icol * n + icol];
  4515. X2[icol * n + icol] = 1;
  4516. for (l = 0; l < n; l++)
  4517. X2[icol * n + l] *= pivinv;
  4518. for (l = 0; l < m; l++)
  4519. b[icol * n + l] *= pivinv;
  4520. for (ll = 0; ll < n; ll++) {
  4521. if (ll !== icol) {
  4522. dum = X2[ll * n + icol];
  4523. X2[ll * n + icol] = 0;
  4524. for (l = 0; l < n; l++)
  4525. X2[ll * n + l] -= X2[icol * n + l] * dum;
  4526. for (l = 0; l < m; l++)
  4527. b[ll * n + l] -= b[icol * n + l] * dum;
  4528. }
  4529. }
  4530. }
  4531. for (l = n - 1; l >= 0; l--) {
  4532. if (indxr[l] !== indxc[l]) {
  4533. for (k = 0; k < n; k++) {
  4534. temp = X2[k * n + indxr[l]];
  4535. X2[k * n + indxr[l]] = X2[k * n + indxc[l]];
  4536. X2[k * n + indxc[l]] = temp;
  4537. }
  4538. }
  4539. }
  4540. return true;
  4541. }
  4542. function variogramGaussian(h2, nugget, range3, sill, A) {
  4543. return nugget + (sill - nugget) / range3 * (1 - Math.exp(-(1 / A) * Math.pow(h2 / range3, 2)));
  4544. }
  4545. function variogramExponential(h2, nugget, range3, sill, A) {
  4546. return nugget + (sill - nugget) / range3 * (1 - Math.exp(-(1 / A) * (h2 / range3)));
  4547. }
  4548. function variogramSpherical(h2, nugget, range3, sill) {
  4549. if (h2 > range3)
  4550. return nugget + (sill - nugget) / range3;
  4551. return nugget + (sill - nugget) / range3 * (1.5 * (h2 / range3) - 0.5 * Math.pow(h2 / range3, 3));
  4552. }
  4553. function train(t2, x, y, model, sigma2, alpha) {
  4554. var variogram = {
  4555. t: t2,
  4556. x,
  4557. y,
  4558. nugget: 0,
  4559. range: 0,
  4560. sill: 0,
  4561. A: 1 / 3,
  4562. n: 0,
  4563. model: variogramExponential,
  4564. K: [],
  4565. M: []
  4566. };
  4567. switch (model) {
  4568. case "gaussian":
  4569. variogram.model = variogramGaussian;
  4570. break;
  4571. case "exponential":
  4572. variogram.model = variogramExponential;
  4573. break;
  4574. case "spherical":
  4575. variogram.model = variogramSpherical;
  4576. break;
  4577. default:
  4578. variogram.model = variogramExponential;
  4579. }
  4580. var i2;
  4581. var j;
  4582. var k;
  4583. var l;
  4584. var n = t2.length;
  4585. var distance2 = Array((n * n - n) / 2);
  4586. for (i2 = 0, k = 0; i2 < n; i2++) {
  4587. for (j = 0; j < i2; j++, k++) {
  4588. distance2[k] = Array(2);
  4589. distance2[k][0] = Math.pow(Math.pow(x[i2] - x[j], 2) + Math.pow(y[i2] - y[j], 2), 0.5);
  4590. distance2[k][1] = Math.abs(t2[i2] - t2[j]);
  4591. }
  4592. }
  4593. distance2.sort(function(a, b) {
  4594. return a[0] - b[0];
  4595. });
  4596. variogram.range = distance2[(n * n - n) / 2 - 1][0];
  4597. var lags = (n * n - n) / 2 > 30 ? 30 : (n * n - n) / 2;
  4598. var tolerance = variogram.range / lags;
  4599. var lag = rep(0, lags);
  4600. var semi = rep(0, lags);
  4601. if (lags < 30) {
  4602. for (l = 0; l < lags; l++) {
  4603. lag[l] = distance2[l][0];
  4604. semi[l] = distance2[l][1];
  4605. }
  4606. } else {
  4607. for (i2 = 0, j = 0, k = 0, l = 0; i2 < lags && j < (n * n - n) / 2; i2++, k = 0) {
  4608. while (distance2[j][0] <= (i2 + 1) * tolerance) {
  4609. lag[l] += distance2[j][0];
  4610. semi[l] += distance2[j][1];
  4611. j++;
  4612. k++;
  4613. if (j >= (n * n - n) / 2)
  4614. break;
  4615. }
  4616. if (k > 0) {
  4617. lag[l] /= k;
  4618. semi[l] /= k;
  4619. l++;
  4620. }
  4621. }
  4622. if (l < 2)
  4623. return variogram;
  4624. }
  4625. n = l;
  4626. variogram.range = lag[n - 1] - lag[0];
  4627. var X2 = rep(1, 2 * n);
  4628. var Y = Array(n);
  4629. var A = variogram.A;
  4630. for (i2 = 0; i2 < n; i2++) {
  4631. switch (model) {
  4632. case "gaussian":
  4633. X2[i2 * 2 + 1] = 1 - Math.exp(-(1 / A) * Math.pow(lag[i2] / variogram.range, 2));
  4634. break;
  4635. case "exponential":
  4636. X2[i2 * 2 + 1] = 1 - Math.exp(-(1 / A) * lag[i2] / variogram.range);
  4637. break;
  4638. case "spherical":
  4639. X2[i2 * 2 + 1] = 1.5 * (lag[i2] / variogram.range) - 0.5 * Math.pow(lag[i2] / variogram.range, 3);
  4640. break;
  4641. }
  4642. Y[i2] = semi[i2];
  4643. }
  4644. var Xt2 = matrixTranspose(X2, n, 2);
  4645. var Z2 = matrixMultiply(Xt2, X2, 2, n, 2);
  4646. Z2 = matrixAdd(Z2, matrixDiag(1 / alpha, 2), 2, 2);
  4647. var cloneZ = Z2.slice(0);
  4648. if (matrixChol(Z2, 2)) {
  4649. matrixChol2inv(Z2, 2);
  4650. } else {
  4651. matrixSolve(cloneZ, 2);
  4652. Z2 = cloneZ;
  4653. }
  4654. var W2 = matrixMultiply(matrixMultiply(Z2, Xt2, 2, 2, n), Y, 2, n, 1);
  4655. variogram.nugget = W2[0];
  4656. variogram.sill = W2[1] * variogram.range + variogram.nugget;
  4657. variogram.n = x.length;
  4658. n = x.length;
  4659. var K2 = Array(n * n);
  4660. for (i2 = 0; i2 < n; i2++) {
  4661. for (j = 0; j < i2; j++) {
  4662. K2[i2 * n + j] = variogram.model(Math.pow(Math.pow(x[i2] - x[j], 2) + Math.pow(y[i2] - y[j], 2), 0.5), variogram.nugget, variogram.range, variogram.sill, variogram.A);
  4663. K2[j * n + i2] = K2[i2 * n + j];
  4664. }
  4665. K2[i2 * n + i2] = variogram.model(0, variogram.nugget, variogram.range, variogram.sill, variogram.A);
  4666. }
  4667. var C2 = matrixAdd(K2, matrixDiag(sigma2, n), n, n);
  4668. var cloneC = C2.slice(0);
  4669. if (matrixChol(C2, n)) {
  4670. matrixChol2inv(C2, n);
  4671. } else {
  4672. matrixSolve(cloneC, n);
  4673. C2 = cloneC;
  4674. }
  4675. var K1 = C2.slice(0);
  4676. var M = matrixMultiply(C2, t2, n, n, 1);
  4677. variogram.K = K1;
  4678. variogram.M = M;
  4679. return variogram;
  4680. }
  4681. function predict(x, y, variogram) {
  4682. var i2;
  4683. var k = Array(variogram.n);
  4684. for (i2 = 0; i2 < variogram.n; i2++) {
  4685. k[i2] = variogram.model(Math.pow(Math.pow(x - variogram.x[i2], 2) + Math.pow(y - variogram.y[i2], 2), 0.5), variogram.nugget, variogram.range, variogram.sill, variogram.A);
  4686. }
  4687. return matrixMultiply(k, variogram.M, 1, variogram.n, 1)[0];
  4688. }
  4689. function variance(x, y, variogram) {
  4690. var i2;
  4691. var k = Array(variogram.n);
  4692. for (i2 = 0; i2 < variogram.n; i2++) {
  4693. k[i2] = variogram.model(Math.pow(Math.pow(x - variogram.x[i2], 2) + Math.pow(y - variogram.y[i2], 2), 0.5), variogram.nugget, variogram.range, variogram.sill, variogram.A);
  4694. }
  4695. var val = matrixMultiply(matrixMultiply(k, variogram.K, 1, variogram.n, variogram.n), k, 1, variogram.n, 1)[0];
  4696. return variogram.model(0, variogram.nugget, variogram.range, variogram.sill, variogram.A) + val;
  4697. }
  4698. function grid(polygons2, variogram, width2) {
  4699. var i2;
  4700. var j;
  4701. var k;
  4702. var n = polygons2.length;
  4703. if (n === 0)
  4704. return;
  4705. var xlim = [polygons2[0][0][0], polygons2[0][0][0]];
  4706. var ylim = [polygons2[0][0][1], polygons2[0][0][1]];
  4707. for (i2 = 0; i2 < n; i2++) {
  4708. for (j = 0; j < polygons2[i2].length; j++) {
  4709. if (polygons2[i2][j][0] < xlim[0])
  4710. xlim[0] = polygons2[i2][j][0];
  4711. if (polygons2[i2][j][0] > xlim[1])
  4712. xlim[1] = polygons2[i2][j][0];
  4713. if (polygons2[i2][j][1] < ylim[0])
  4714. ylim[0] = polygons2[i2][j][1];
  4715. if (polygons2[i2][j][1] > ylim[1])
  4716. ylim[1] = polygons2[i2][j][1];
  4717. }
  4718. }
  4719. var xtarget;
  4720. var ytarget;
  4721. var a = Array(2);
  4722. var b = Array(2);
  4723. var lxlim = Array(2);
  4724. var lylim = Array(2);
  4725. var x = Math.ceil((xlim[1] - xlim[0]) / width2);
  4726. var y = Math.ceil((ylim[1] - ylim[0]) / width2);
  4727. var A = Array(x + 1);
  4728. for (i2 = 0; i2 <= x; i2++)
  4729. A[i2] = Array(y + 1);
  4730. for (i2 = 0; i2 < n; i2++) {
  4731. lxlim[0] = polygons2[i2][0][0];
  4732. lxlim[1] = lxlim[0];
  4733. lylim[0] = polygons2[i2][0][1];
  4734. lylim[1] = lylim[0];
  4735. for (j = 1; j < polygons2[i2].length; j++) {
  4736. if (polygons2[i2][j][0] < lxlim[0])
  4737. lxlim[0] = polygons2[i2][j][0];
  4738. if (polygons2[i2][j][0] > lxlim[1])
  4739. lxlim[1] = polygons2[i2][j][0];
  4740. if (polygons2[i2][j][1] < lylim[0])
  4741. lylim[0] = polygons2[i2][j][1];
  4742. if (polygons2[i2][j][1] > lylim[1])
  4743. lylim[1] = polygons2[i2][j][1];
  4744. }
  4745. a[0] = Math.floor((lxlim[0] - (lxlim[0] - xlim[0]) % width2 - xlim[0]) / width2);
  4746. a[1] = Math.ceil((lxlim[1] - (lxlim[1] - xlim[1]) % width2 - xlim[0]) / width2);
  4747. b[0] = Math.floor((lylim[0] - (lylim[0] - ylim[0]) % width2 - ylim[0]) / width2);
  4748. b[1] = Math.ceil((lylim[1] - (lylim[1] - ylim[1]) % width2 - ylim[0]) / width2);
  4749. for (j = a[0]; j <= a[1]; j++) {
  4750. for (k = b[0]; k <= b[1]; k++) {
  4751. xtarget = xlim[0] + j * width2;
  4752. ytarget = ylim[0] + k * width2;
  4753. if (pip(polygons2[i2], xtarget, ytarget)) {
  4754. A[j][k] = predict(xtarget, ytarget, variogram);
  4755. }
  4756. }
  4757. }
  4758. }
  4759. return {
  4760. xlim,
  4761. ylim,
  4762. width: width2,
  4763. data: A,
  4764. zlim: [min(variogram.t), max(variogram.t)]
  4765. };
  4766. }
  4767. function plot(canvas, grid2, xlim, ylim, colors) {
  4768. var ctx = canvas.getContext("2d");
  4769. var data = grid2.data, zlim = grid2.zlim, width2 = grid2.width;
  4770. if (ctx) {
  4771. ctx.clearRect(0, 0, canvas.width, canvas.height);
  4772. var range3 = [xlim[1] - xlim[0], ylim[1] - ylim[0], zlim[1] - zlim[0]];
  4773. var i2 = void 0;
  4774. var j = void 0;
  4775. var x = void 0;
  4776. var y = void 0;
  4777. var z = void 0;
  4778. var n = data.length;
  4779. var m = data[0].length;
  4780. var wx = Math.ceil(width2 * canvas.width / (xlim[1] - xlim[0]));
  4781. var wy = Math.ceil(width2 * canvas.height / (ylim[1] - ylim[0]));
  4782. for (i2 = 0; i2 < n; i2++) {
  4783. for (j = 0; j < m; j++) {
  4784. if (data[i2][j] === void 0)
  4785. continue;
  4786. x = canvas.width * (i2 * width2 + grid2.xlim[0] - xlim[0]) / range3[0];
  4787. y = canvas.height * (1 - (j * width2 + grid2.ylim[0] - ylim[0]) / range3[1]);
  4788. z = (data[i2][j] - zlim[0]) / range3[2];
  4789. if (z < 0)
  4790. z = 0;
  4791. if (z > 1)
  4792. z = 1;
  4793. ctx.fillStyle = colors[Math.floor((colors.length - 1) * z)];
  4794. ctx.fillRect(Math.round(x - wx / 2), Math.round(y - wy / 2), wx, wy);
  4795. }
  4796. }
  4797. }
  4798. }
  4799. var index = {
  4800. train,
  4801. predict,
  4802. variance,
  4803. grid,
  4804. plot,
  4805. max,
  4806. min,
  4807. pip,
  4808. rep,
  4809. matrixDiag,
  4810. matrixTranspose,
  4811. matrixAdd,
  4812. matrixMultiply,
  4813. matrixChol,
  4814. matrixChol2inv,
  4815. matrixSolve,
  4816. variogramGaussian,
  4817. variogramExponential,
  4818. variogramSpherical
  4819. };
  4820. var earthRadius = 63710088e-1;
  4821. var factors = {
  4822. centimeters: earthRadius * 100,
  4823. centimetres: earthRadius * 100,
  4824. degrees: earthRadius / 111325,
  4825. feet: earthRadius * 3.28084,
  4826. inches: earthRadius * 39.37,
  4827. kilometers: earthRadius / 1e3,
  4828. kilometres: earthRadius / 1e3,
  4829. meters: earthRadius,
  4830. metres: earthRadius,
  4831. miles: earthRadius / 1609.344,
  4832. millimeters: earthRadius * 1e3,
  4833. millimetres: earthRadius * 1e3,
  4834. nauticalmiles: earthRadius / 1852,
  4835. radians: 1,
  4836. yards: earthRadius * 1.0936
  4837. };
  4838. var unitsFactors = {
  4839. centimeters: 100,
  4840. centimetres: 100,
  4841. degrees: 1 / 111325,
  4842. feet: 3.28084,
  4843. inches: 39.37,
  4844. kilometers: 1 / 1e3,
  4845. kilometres: 1 / 1e3,
  4846. meters: 1,
  4847. metres: 1,
  4848. miles: 1 / 1609.344,
  4849. millimeters: 1e3,
  4850. millimetres: 1e3,
  4851. nauticalmiles: 1 / 1852,
  4852. radians: 1 / earthRadius,
  4853. yards: 1.0936133
  4854. };
  4855. var areaFactors = {
  4856. acres: 247105e-9,
  4857. centimeters: 1e4,
  4858. centimetres: 1e4,
  4859. feet: 10.763910417,
  4860. hectares: 1e-4,
  4861. inches: 1550.003100006,
  4862. kilometers: 1e-6,
  4863. kilometres: 1e-6,
  4864. meters: 1,
  4865. metres: 1,
  4866. miles: 386e-9,
  4867. millimeters: 1e6,
  4868. millimetres: 1e6,
  4869. yards: 1.195990046
  4870. };
  4871. function feature(geom, properties, options2) {
  4872. if (options2 === void 0) {
  4873. options2 = {};
  4874. }
  4875. var feat = { type: "Feature" };
  4876. if (options2.id === 0 || options2.id) {
  4877. feat.id = options2.id;
  4878. }
  4879. if (options2.bbox) {
  4880. feat.bbox = options2.bbox;
  4881. }
  4882. feat.properties = properties || {};
  4883. feat.geometry = geom;
  4884. return feat;
  4885. }
  4886. function geometry(type2, coordinates, _options) {
  4887. switch (type2) {
  4888. case "Point":
  4889. return point(coordinates).geometry;
  4890. case "LineString":
  4891. return lineString(coordinates).geometry;
  4892. case "Polygon":
  4893. return polygon(coordinates).geometry;
  4894. case "MultiPoint":
  4895. return multiPoint(coordinates).geometry;
  4896. case "MultiLineString":
  4897. return multiLineString(coordinates).geometry;
  4898. case "MultiPolygon":
  4899. return multiPolygon(coordinates).geometry;
  4900. default:
  4901. throw new Error(type2 + " is invalid");
  4902. }
  4903. }
  4904. function point(coordinates, properties, options2) {
  4905. if (options2 === void 0) {
  4906. options2 = {};
  4907. }
  4908. if (!coordinates) {
  4909. throw new Error("coordinates is required");
  4910. }
  4911. if (!Array.isArray(coordinates)) {
  4912. throw new Error("coordinates must be an Array");
  4913. }
  4914. if (coordinates.length < 2) {
  4915. throw new Error("coordinates must be at least 2 numbers long");
  4916. }
  4917. if (!isNumber$1(coordinates[0]) || !isNumber$1(coordinates[1])) {
  4918. throw new Error("coordinates must contain numbers");
  4919. }
  4920. var geom = {
  4921. type: "Point",
  4922. coordinates
  4923. };
  4924. return feature(geom, properties, options2);
  4925. }
  4926. function points(coordinates, properties, options2) {
  4927. if (options2 === void 0) {
  4928. options2 = {};
  4929. }
  4930. return featureCollection$1(coordinates.map(function(coords) {
  4931. return point(coords, properties);
  4932. }), options2);
  4933. }
  4934. function polygon(coordinates, properties, options2) {
  4935. if (options2 === void 0) {
  4936. options2 = {};
  4937. }
  4938. for (var _i = 0, coordinates_1 = coordinates; _i < coordinates_1.length; _i++) {
  4939. var ring = coordinates_1[_i];
  4940. if (ring.length < 4) {
  4941. throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");
  4942. }
  4943. for (var j = 0; j < ring[ring.length - 1].length; j++) {
  4944. if (ring[ring.length - 1][j] !== ring[0][j]) {
  4945. throw new Error("First and last Position are not equivalent.");
  4946. }
  4947. }
  4948. }
  4949. var geom = {
  4950. type: "Polygon",
  4951. coordinates
  4952. };
  4953. return feature(geom, properties, options2);
  4954. }
  4955. function polygons(coordinates, properties, options2) {
  4956. if (options2 === void 0) {
  4957. options2 = {};
  4958. }
  4959. return featureCollection$1(coordinates.map(function(coords) {
  4960. return polygon(coords, properties);
  4961. }), options2);
  4962. }
  4963. function lineString(coordinates, properties, options2) {
  4964. if (options2 === void 0) {
  4965. options2 = {};
  4966. }
  4967. if (coordinates.length < 2) {
  4968. throw new Error("coordinates must be an array of two or more positions");
  4969. }
  4970. var geom = {
  4971. type: "LineString",
  4972. coordinates
  4973. };
  4974. return feature(geom, properties, options2);
  4975. }
  4976. function lineStrings(coordinates, properties, options2) {
  4977. if (options2 === void 0) {
  4978. options2 = {};
  4979. }
  4980. return featureCollection$1(coordinates.map(function(coords) {
  4981. return lineString(coords, properties);
  4982. }), options2);
  4983. }
  4984. function featureCollection$1(features, options2) {
  4985. if (options2 === void 0) {
  4986. options2 = {};
  4987. }
  4988. var fc = { type: "FeatureCollection" };
  4989. if (options2.id) {
  4990. fc.id = options2.id;
  4991. }
  4992. if (options2.bbox) {
  4993. fc.bbox = options2.bbox;
  4994. }
  4995. fc.features = features;
  4996. return fc;
  4997. }
  4998. function multiLineString(coordinates, properties, options2) {
  4999. if (options2 === void 0) {
  5000. options2 = {};
  5001. }
  5002. var geom = {
  5003. type: "MultiLineString",
  5004. coordinates
  5005. };
  5006. return feature(geom, properties, options2);
  5007. }
  5008. function multiPoint(coordinates, properties, options2) {
  5009. if (options2 === void 0) {
  5010. options2 = {};
  5011. }
  5012. var geom = {
  5013. type: "MultiPoint",
  5014. coordinates
  5015. };
  5016. return feature(geom, properties, options2);
  5017. }
  5018. function multiPolygon(coordinates, properties, options2) {
  5019. if (options2 === void 0) {
  5020. options2 = {};
  5021. }
  5022. var geom = {
  5023. type: "MultiPolygon",
  5024. coordinates
  5025. };
  5026. return feature(geom, properties, options2);
  5027. }
  5028. function geometryCollection(geometries, properties, options2) {
  5029. if (options2 === void 0) {
  5030. options2 = {};
  5031. }
  5032. var geom = {
  5033. type: "GeometryCollection",
  5034. geometries
  5035. };
  5036. return feature(geom, properties, options2);
  5037. }
  5038. function round(num, precision) {
  5039. if (precision === void 0) {
  5040. precision = 0;
  5041. }
  5042. if (precision && !(precision >= 0)) {
  5043. throw new Error("precision must be a positive number");
  5044. }
  5045. var multiplier = Math.pow(10, precision || 0);
  5046. return Math.round(num * multiplier) / multiplier;
  5047. }
  5048. function radiansToLength(radians, units) {
  5049. if (units === void 0) {
  5050. units = "kilometers";
  5051. }
  5052. var factor = factors[units];
  5053. if (!factor) {
  5054. throw new Error(units + " units is invalid");
  5055. }
  5056. return radians * factor;
  5057. }
  5058. function lengthToRadians(distance2, units) {
  5059. if (units === void 0) {
  5060. units = "kilometers";
  5061. }
  5062. var factor = factors[units];
  5063. if (!factor) {
  5064. throw new Error(units + " units is invalid");
  5065. }
  5066. return distance2 / factor;
  5067. }
  5068. function lengthToDegrees(distance2, units) {
  5069. return radiansToDegrees(lengthToRadians(distance2, units));
  5070. }
  5071. function bearingToAzimuth(bearing2) {
  5072. var angle = bearing2 % 360;
  5073. if (angle < 0) {
  5074. angle += 360;
  5075. }
  5076. return angle;
  5077. }
  5078. function radiansToDegrees(radians) {
  5079. var degrees = radians % (2 * Math.PI);
  5080. return degrees * 180 / Math.PI;
  5081. }
  5082. function degreesToRadians(degrees) {
  5083. var radians = degrees % 360;
  5084. return radians * Math.PI / 180;
  5085. }
  5086. function convertLength(length, originalUnit, finalUnit) {
  5087. if (originalUnit === void 0) {
  5088. originalUnit = "kilometers";
  5089. }
  5090. if (finalUnit === void 0) {
  5091. finalUnit = "kilometers";
  5092. }
  5093. if (!(length >= 0)) {
  5094. throw new Error("length must be a positive number");
  5095. }
  5096. return radiansToLength(lengthToRadians(length, originalUnit), finalUnit);
  5097. }
  5098. function convertArea(area, originalUnit, finalUnit) {
  5099. if (originalUnit === void 0) {
  5100. originalUnit = "meters";
  5101. }
  5102. if (finalUnit === void 0) {
  5103. finalUnit = "kilometers";
  5104. }
  5105. if (!(area >= 0)) {
  5106. throw new Error("area must be a positive number");
  5107. }
  5108. var startFactor = areaFactors[originalUnit];
  5109. if (!startFactor) {
  5110. throw new Error("invalid original units");
  5111. }
  5112. var finalFactor = areaFactors[finalUnit];
  5113. if (!finalFactor) {
  5114. throw new Error("invalid final units");
  5115. }
  5116. return area / startFactor * finalFactor;
  5117. }
  5118. function isNumber$1(num) {
  5119. return !isNaN(num) && num !== null && !Array.isArray(num);
  5120. }
  5121. function isObject$6(input) {
  5122. return !!input && input.constructor === Object;
  5123. }
  5124. function validateBBox(bbox2) {
  5125. if (!bbox2) {
  5126. throw new Error("bbox is required");
  5127. }
  5128. if (!Array.isArray(bbox2)) {
  5129. throw new Error("bbox must be an Array");
  5130. }
  5131. if (bbox2.length !== 4 && bbox2.length !== 6) {
  5132. throw new Error("bbox must be an Array of 4 or 6 numbers");
  5133. }
  5134. bbox2.forEach(function(num) {
  5135. if (!isNumber$1(num)) {
  5136. throw new Error("bbox must only contain numbers");
  5137. }
  5138. });
  5139. }
  5140. function validateId(id) {
  5141. if (!id) {
  5142. throw new Error("id is required");
  5143. }
  5144. if (["string", "number"].indexOf(typeof id) === -1) {
  5145. throw new Error("id must be a number or a string");
  5146. }
  5147. }
  5148. var es$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  5149. __proto__: null,
  5150. earthRadius,
  5151. factors,
  5152. unitsFactors,
  5153. areaFactors,
  5154. feature,
  5155. geometry,
  5156. point,
  5157. points,
  5158. polygon,
  5159. polygons,
  5160. lineString,
  5161. lineStrings,
  5162. featureCollection: featureCollection$1,
  5163. multiLineString,
  5164. multiPoint,
  5165. multiPolygon,
  5166. geometryCollection,
  5167. round,
  5168. radiansToLength,
  5169. lengthToRadians,
  5170. lengthToDegrees,
  5171. bearingToAzimuth,
  5172. radiansToDegrees,
  5173. degreesToRadians,
  5174. convertLength,
  5175. convertArea,
  5176. isNumber: isNumber$1,
  5177. isObject: isObject$6,
  5178. validateBBox,
  5179. validateId
  5180. }, Symbol.toStringTag, { value: "Module" }));
  5181. function coordEach(geojson, callback2, excludeWrapCoord) {
  5182. if (geojson === null)
  5183. return;
  5184. var j, k, l, geometry2, stopG, coords, geometryMaybeCollection, wrapShrink = 0, coordIndex = 0, isGeometryCollection, type2 = geojson.type, isFeatureCollection = type2 === "FeatureCollection", isFeature = type2 === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
  5185. for (var featureIndex = 0; featureIndex < stop; featureIndex++) {
  5186. geometryMaybeCollection = isFeatureCollection ? geojson.features[featureIndex].geometry : isFeature ? geojson.geometry : geojson;
  5187. isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === "GeometryCollection" : false;
  5188. stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;
  5189. for (var geomIndex = 0; geomIndex < stopG; geomIndex++) {
  5190. var multiFeatureIndex = 0;
  5191. var geometryIndex = 0;
  5192. geometry2 = isGeometryCollection ? geometryMaybeCollection.geometries[geomIndex] : geometryMaybeCollection;
  5193. if (geometry2 === null)
  5194. continue;
  5195. coords = geometry2.coordinates;
  5196. var geomType = geometry2.type;
  5197. wrapShrink = excludeWrapCoord && (geomType === "Polygon" || geomType === "MultiPolygon") ? 1 : 0;
  5198. switch (geomType) {
  5199. case null:
  5200. break;
  5201. case "Point":
  5202. if (callback2(
  5203. coords,
  5204. coordIndex,
  5205. featureIndex,
  5206. multiFeatureIndex,
  5207. geometryIndex
  5208. ) === false)
  5209. return false;
  5210. coordIndex++;
  5211. multiFeatureIndex++;
  5212. break;
  5213. case "LineString":
  5214. case "MultiPoint":
  5215. for (j = 0; j < coords.length; j++) {
  5216. if (callback2(
  5217. coords[j],
  5218. coordIndex,
  5219. featureIndex,
  5220. multiFeatureIndex,
  5221. geometryIndex
  5222. ) === false)
  5223. return false;
  5224. coordIndex++;
  5225. if (geomType === "MultiPoint")
  5226. multiFeatureIndex++;
  5227. }
  5228. if (geomType === "LineString")
  5229. multiFeatureIndex++;
  5230. break;
  5231. case "Polygon":
  5232. case "MultiLineString":
  5233. for (j = 0; j < coords.length; j++) {
  5234. for (k = 0; k < coords[j].length - wrapShrink; k++) {
  5235. if (callback2(
  5236. coords[j][k],
  5237. coordIndex,
  5238. featureIndex,
  5239. multiFeatureIndex,
  5240. geometryIndex
  5241. ) === false)
  5242. return false;
  5243. coordIndex++;
  5244. }
  5245. if (geomType === "MultiLineString")
  5246. multiFeatureIndex++;
  5247. if (geomType === "Polygon")
  5248. geometryIndex++;
  5249. }
  5250. if (geomType === "Polygon")
  5251. multiFeatureIndex++;
  5252. break;
  5253. case "MultiPolygon":
  5254. for (j = 0; j < coords.length; j++) {
  5255. geometryIndex = 0;
  5256. for (k = 0; k < coords[j].length; k++) {
  5257. for (l = 0; l < coords[j][k].length - wrapShrink; l++) {
  5258. if (callback2(
  5259. coords[j][k][l],
  5260. coordIndex,
  5261. featureIndex,
  5262. multiFeatureIndex,
  5263. geometryIndex
  5264. ) === false)
  5265. return false;
  5266. coordIndex++;
  5267. }
  5268. geometryIndex++;
  5269. }
  5270. multiFeatureIndex++;
  5271. }
  5272. break;
  5273. case "GeometryCollection":
  5274. for (j = 0; j < geometry2.geometries.length; j++)
  5275. if (coordEach(geometry2.geometries[j], callback2, excludeWrapCoord) === false)
  5276. return false;
  5277. break;
  5278. default:
  5279. throw new Error("Unknown Geometry Type");
  5280. }
  5281. }
  5282. }
  5283. }
  5284. function coordReduce(geojson, callback2, initialValue, excludeWrapCoord) {
  5285. var previousValue = initialValue;
  5286. coordEach(
  5287. geojson,
  5288. function(currentCoord, coordIndex, featureIndex, multiFeatureIndex, geometryIndex) {
  5289. if (coordIndex === 0 && initialValue === void 0)
  5290. previousValue = currentCoord;
  5291. else
  5292. previousValue = callback2(
  5293. previousValue,
  5294. currentCoord,
  5295. coordIndex,
  5296. featureIndex,
  5297. multiFeatureIndex,
  5298. geometryIndex
  5299. );
  5300. },
  5301. excludeWrapCoord
  5302. );
  5303. return previousValue;
  5304. }
  5305. function propEach(geojson, callback2) {
  5306. var i2;
  5307. switch (geojson.type) {
  5308. case "FeatureCollection":
  5309. for (i2 = 0; i2 < geojson.features.length; i2++) {
  5310. if (callback2(geojson.features[i2].properties, i2) === false)
  5311. break;
  5312. }
  5313. break;
  5314. case "Feature":
  5315. callback2(geojson.properties, 0);
  5316. break;
  5317. }
  5318. }
  5319. function propReduce(geojson, callback2, initialValue) {
  5320. var previousValue = initialValue;
  5321. propEach(geojson, function(currentProperties, featureIndex) {
  5322. if (featureIndex === 0 && initialValue === void 0)
  5323. previousValue = currentProperties;
  5324. else
  5325. previousValue = callback2(previousValue, currentProperties, featureIndex);
  5326. });
  5327. return previousValue;
  5328. }
  5329. function featureEach$1(geojson, callback2) {
  5330. if (geojson.type === "Feature") {
  5331. callback2(geojson, 0);
  5332. } else if (geojson.type === "FeatureCollection") {
  5333. for (var i2 = 0; i2 < geojson.features.length; i2++) {
  5334. if (callback2(geojson.features[i2], i2) === false)
  5335. break;
  5336. }
  5337. }
  5338. }
  5339. function featureReduce(geojson, callback2, initialValue) {
  5340. var previousValue = initialValue;
  5341. featureEach$1(geojson, function(currentFeature, featureIndex) {
  5342. if (featureIndex === 0 && initialValue === void 0)
  5343. previousValue = currentFeature;
  5344. else
  5345. previousValue = callback2(previousValue, currentFeature, featureIndex);
  5346. });
  5347. return previousValue;
  5348. }
  5349. function coordAll(geojson) {
  5350. var coords = [];
  5351. coordEach(geojson, function(coord) {
  5352. coords.push(coord);
  5353. });
  5354. return coords;
  5355. }
  5356. function geomEach(geojson, callback2) {
  5357. var i2, j, g, geometry2, stopG, geometryMaybeCollection, isGeometryCollection, featureProperties, featureBBox, featureId, featureIndex = 0, isFeatureCollection = geojson.type === "FeatureCollection", isFeature = geojson.type === "Feature", stop = isFeatureCollection ? geojson.features.length : 1;
  5358. for (i2 = 0; i2 < stop; i2++) {
  5359. geometryMaybeCollection = isFeatureCollection ? geojson.features[i2].geometry : isFeature ? geojson.geometry : geojson;
  5360. featureProperties = isFeatureCollection ? geojson.features[i2].properties : isFeature ? geojson.properties : {};
  5361. featureBBox = isFeatureCollection ? geojson.features[i2].bbox : isFeature ? geojson.bbox : void 0;
  5362. featureId = isFeatureCollection ? geojson.features[i2].id : isFeature ? geojson.id : void 0;
  5363. isGeometryCollection = geometryMaybeCollection ? geometryMaybeCollection.type === "GeometryCollection" : false;
  5364. stopG = isGeometryCollection ? geometryMaybeCollection.geometries.length : 1;
  5365. for (g = 0; g < stopG; g++) {
  5366. geometry2 = isGeometryCollection ? geometryMaybeCollection.geometries[g] : geometryMaybeCollection;
  5367. if (geometry2 === null) {
  5368. if (callback2(
  5369. null,
  5370. featureIndex,
  5371. featureProperties,
  5372. featureBBox,
  5373. featureId
  5374. ) === false)
  5375. return false;
  5376. continue;
  5377. }
  5378. switch (geometry2.type) {
  5379. case "Point":
  5380. case "LineString":
  5381. case "MultiPoint":
  5382. case "Polygon":
  5383. case "MultiLineString":
  5384. case "MultiPolygon": {
  5385. if (callback2(
  5386. geometry2,
  5387. featureIndex,
  5388. featureProperties,
  5389. featureBBox,
  5390. featureId
  5391. ) === false)
  5392. return false;
  5393. break;
  5394. }
  5395. case "GeometryCollection": {
  5396. for (j = 0; j < geometry2.geometries.length; j++) {
  5397. if (callback2(
  5398. geometry2.geometries[j],
  5399. featureIndex,
  5400. featureProperties,
  5401. featureBBox,
  5402. featureId
  5403. ) === false)
  5404. return false;
  5405. }
  5406. break;
  5407. }
  5408. default:
  5409. throw new Error("Unknown Geometry Type");
  5410. }
  5411. }
  5412. featureIndex++;
  5413. }
  5414. }
  5415. function geomReduce(geojson, callback2, initialValue) {
  5416. var previousValue = initialValue;
  5417. geomEach(
  5418. geojson,
  5419. function(currentGeometry, featureIndex, featureProperties, featureBBox, featureId) {
  5420. if (featureIndex === 0 && initialValue === void 0)
  5421. previousValue = currentGeometry;
  5422. else
  5423. previousValue = callback2(
  5424. previousValue,
  5425. currentGeometry,
  5426. featureIndex,
  5427. featureProperties,
  5428. featureBBox,
  5429. featureId
  5430. );
  5431. }
  5432. );
  5433. return previousValue;
  5434. }
  5435. function flattenEach(geojson, callback2) {
  5436. geomEach(geojson, function(geometry2, featureIndex, properties, bbox2, id) {
  5437. var type2 = geometry2 === null ? null : geometry2.type;
  5438. switch (type2) {
  5439. case null:
  5440. case "Point":
  5441. case "LineString":
  5442. case "Polygon":
  5443. if (callback2(
  5444. feature(geometry2, properties, { bbox: bbox2, id }),
  5445. featureIndex,
  5446. 0
  5447. ) === false)
  5448. return false;
  5449. return;
  5450. }
  5451. var geomType;
  5452. switch (type2) {
  5453. case "MultiPoint":
  5454. geomType = "Point";
  5455. break;
  5456. case "MultiLineString":
  5457. geomType = "LineString";
  5458. break;
  5459. case "MultiPolygon":
  5460. geomType = "Polygon";
  5461. break;
  5462. }
  5463. for (var multiFeatureIndex = 0; multiFeatureIndex < geometry2.coordinates.length; multiFeatureIndex++) {
  5464. var coordinate = geometry2.coordinates[multiFeatureIndex];
  5465. var geom = {
  5466. type: geomType,
  5467. coordinates: coordinate
  5468. };
  5469. if (callback2(feature(geom, properties), featureIndex, multiFeatureIndex) === false)
  5470. return false;
  5471. }
  5472. });
  5473. }
  5474. function flattenReduce(geojson, callback2, initialValue) {
  5475. var previousValue = initialValue;
  5476. flattenEach(
  5477. geojson,
  5478. function(currentFeature, featureIndex, multiFeatureIndex) {
  5479. if (featureIndex === 0 && multiFeatureIndex === 0 && initialValue === void 0)
  5480. previousValue = currentFeature;
  5481. else
  5482. previousValue = callback2(
  5483. previousValue,
  5484. currentFeature,
  5485. featureIndex,
  5486. multiFeatureIndex
  5487. );
  5488. }
  5489. );
  5490. return previousValue;
  5491. }
  5492. function segmentEach(geojson, callback2) {
  5493. flattenEach(geojson, function(feature2, featureIndex, multiFeatureIndex) {
  5494. var segmentIndex = 0;
  5495. if (!feature2.geometry)
  5496. return;
  5497. var type2 = feature2.geometry.type;
  5498. if (type2 === "Point" || type2 === "MultiPoint")
  5499. return;
  5500. var previousCoords;
  5501. var previousFeatureIndex = 0;
  5502. var previousMultiIndex = 0;
  5503. var prevGeomIndex = 0;
  5504. if (coordEach(
  5505. feature2,
  5506. function(currentCoord, coordIndex, featureIndexCoord, multiPartIndexCoord, geometryIndex) {
  5507. if (previousCoords === void 0 || featureIndex > previousFeatureIndex || multiPartIndexCoord > previousMultiIndex || geometryIndex > prevGeomIndex) {
  5508. previousCoords = currentCoord;
  5509. previousFeatureIndex = featureIndex;
  5510. previousMultiIndex = multiPartIndexCoord;
  5511. prevGeomIndex = geometryIndex;
  5512. segmentIndex = 0;
  5513. return;
  5514. }
  5515. var currentSegment = lineString(
  5516. [previousCoords, currentCoord],
  5517. feature2.properties
  5518. );
  5519. if (callback2(
  5520. currentSegment,
  5521. featureIndex,
  5522. multiFeatureIndex,
  5523. geometryIndex,
  5524. segmentIndex
  5525. ) === false)
  5526. return false;
  5527. segmentIndex++;
  5528. previousCoords = currentCoord;
  5529. }
  5530. ) === false)
  5531. return false;
  5532. });
  5533. }
  5534. function segmentReduce(geojson, callback2, initialValue) {
  5535. var previousValue = initialValue;
  5536. var started = false;
  5537. segmentEach(
  5538. geojson,
  5539. function(currentSegment, featureIndex, multiFeatureIndex, geometryIndex, segmentIndex) {
  5540. if (started === false && initialValue === void 0)
  5541. previousValue = currentSegment;
  5542. else
  5543. previousValue = callback2(
  5544. previousValue,
  5545. currentSegment,
  5546. featureIndex,
  5547. multiFeatureIndex,
  5548. geometryIndex,
  5549. segmentIndex
  5550. );
  5551. started = true;
  5552. }
  5553. );
  5554. return previousValue;
  5555. }
  5556. function lineEach(geojson, callback2) {
  5557. if (!geojson)
  5558. throw new Error("geojson is required");
  5559. flattenEach(geojson, function(feature2, featureIndex, multiFeatureIndex) {
  5560. if (feature2.geometry === null)
  5561. return;
  5562. var type2 = feature2.geometry.type;
  5563. var coords = feature2.geometry.coordinates;
  5564. switch (type2) {
  5565. case "LineString":
  5566. if (callback2(feature2, featureIndex, multiFeatureIndex, 0, 0) === false)
  5567. return false;
  5568. break;
  5569. case "Polygon":
  5570. for (var geometryIndex = 0; geometryIndex < coords.length; geometryIndex++) {
  5571. if (callback2(
  5572. lineString(coords[geometryIndex], feature2.properties),
  5573. featureIndex,
  5574. multiFeatureIndex,
  5575. geometryIndex
  5576. ) === false)
  5577. return false;
  5578. }
  5579. break;
  5580. }
  5581. });
  5582. }
  5583. function lineReduce(geojson, callback2, initialValue) {
  5584. var previousValue = initialValue;
  5585. lineEach(
  5586. geojson,
  5587. function(currentLine, featureIndex, multiFeatureIndex, geometryIndex) {
  5588. if (featureIndex === 0 && initialValue === void 0)
  5589. previousValue = currentLine;
  5590. else
  5591. previousValue = callback2(
  5592. previousValue,
  5593. currentLine,
  5594. featureIndex,
  5595. multiFeatureIndex,
  5596. geometryIndex
  5597. );
  5598. }
  5599. );
  5600. return previousValue;
  5601. }
  5602. function findSegment(geojson, options2) {
  5603. options2 = options2 || {};
  5604. if (!isObject$6(options2))
  5605. throw new Error("options is invalid");
  5606. var featureIndex = options2.featureIndex || 0;
  5607. var multiFeatureIndex = options2.multiFeatureIndex || 0;
  5608. var geometryIndex = options2.geometryIndex || 0;
  5609. var segmentIndex = options2.segmentIndex || 0;
  5610. var properties = options2.properties;
  5611. var geometry2;
  5612. switch (geojson.type) {
  5613. case "FeatureCollection":
  5614. if (featureIndex < 0)
  5615. featureIndex = geojson.features.length + featureIndex;
  5616. properties = properties || geojson.features[featureIndex].properties;
  5617. geometry2 = geojson.features[featureIndex].geometry;
  5618. break;
  5619. case "Feature":
  5620. properties = properties || geojson.properties;
  5621. geometry2 = geojson.geometry;
  5622. break;
  5623. case "Point":
  5624. case "MultiPoint":
  5625. return null;
  5626. case "LineString":
  5627. case "Polygon":
  5628. case "MultiLineString":
  5629. case "MultiPolygon":
  5630. geometry2 = geojson;
  5631. break;
  5632. default:
  5633. throw new Error("geojson is invalid");
  5634. }
  5635. if (geometry2 === null)
  5636. return null;
  5637. var coords = geometry2.coordinates;
  5638. switch (geometry2.type) {
  5639. case "Point":
  5640. case "MultiPoint":
  5641. return null;
  5642. case "LineString":
  5643. if (segmentIndex < 0)
  5644. segmentIndex = coords.length + segmentIndex - 1;
  5645. return lineString(
  5646. [coords[segmentIndex], coords[segmentIndex + 1]],
  5647. properties,
  5648. options2
  5649. );
  5650. case "Polygon":
  5651. if (geometryIndex < 0)
  5652. geometryIndex = coords.length + geometryIndex;
  5653. if (segmentIndex < 0)
  5654. segmentIndex = coords[geometryIndex].length + segmentIndex - 1;
  5655. return lineString(
  5656. [
  5657. coords[geometryIndex][segmentIndex],
  5658. coords[geometryIndex][segmentIndex + 1]
  5659. ],
  5660. properties,
  5661. options2
  5662. );
  5663. case "MultiLineString":
  5664. if (multiFeatureIndex < 0)
  5665. multiFeatureIndex = coords.length + multiFeatureIndex;
  5666. if (segmentIndex < 0)
  5667. segmentIndex = coords[multiFeatureIndex].length + segmentIndex - 1;
  5668. return lineString(
  5669. [
  5670. coords[multiFeatureIndex][segmentIndex],
  5671. coords[multiFeatureIndex][segmentIndex + 1]
  5672. ],
  5673. properties,
  5674. options2
  5675. );
  5676. case "MultiPolygon":
  5677. if (multiFeatureIndex < 0)
  5678. multiFeatureIndex = coords.length + multiFeatureIndex;
  5679. if (geometryIndex < 0)
  5680. geometryIndex = coords[multiFeatureIndex].length + geometryIndex;
  5681. if (segmentIndex < 0)
  5682. segmentIndex = coords[multiFeatureIndex][geometryIndex].length - segmentIndex - 1;
  5683. return lineString(
  5684. [
  5685. coords[multiFeatureIndex][geometryIndex][segmentIndex],
  5686. coords[multiFeatureIndex][geometryIndex][segmentIndex + 1]
  5687. ],
  5688. properties,
  5689. options2
  5690. );
  5691. }
  5692. throw new Error("geojson is invalid");
  5693. }
  5694. function findPoint(geojson, options2) {
  5695. options2 = options2 || {};
  5696. if (!isObject$6(options2))
  5697. throw new Error("options is invalid");
  5698. var featureIndex = options2.featureIndex || 0;
  5699. var multiFeatureIndex = options2.multiFeatureIndex || 0;
  5700. var geometryIndex = options2.geometryIndex || 0;
  5701. var coordIndex = options2.coordIndex || 0;
  5702. var properties = options2.properties;
  5703. var geometry2;
  5704. switch (geojson.type) {
  5705. case "FeatureCollection":
  5706. if (featureIndex < 0)
  5707. featureIndex = geojson.features.length + featureIndex;
  5708. properties = properties || geojson.features[featureIndex].properties;
  5709. geometry2 = geojson.features[featureIndex].geometry;
  5710. break;
  5711. case "Feature":
  5712. properties = properties || geojson.properties;
  5713. geometry2 = geojson.geometry;
  5714. break;
  5715. case "Point":
  5716. case "MultiPoint":
  5717. return null;
  5718. case "LineString":
  5719. case "Polygon":
  5720. case "MultiLineString":
  5721. case "MultiPolygon":
  5722. geometry2 = geojson;
  5723. break;
  5724. default:
  5725. throw new Error("geojson is invalid");
  5726. }
  5727. if (geometry2 === null)
  5728. return null;
  5729. var coords = geometry2.coordinates;
  5730. switch (geometry2.type) {
  5731. case "Point":
  5732. return point(coords, properties, options2);
  5733. case "MultiPoint":
  5734. if (multiFeatureIndex < 0)
  5735. multiFeatureIndex = coords.length + multiFeatureIndex;
  5736. return point(coords[multiFeatureIndex], properties, options2);
  5737. case "LineString":
  5738. if (coordIndex < 0)
  5739. coordIndex = coords.length + coordIndex;
  5740. return point(coords[coordIndex], properties, options2);
  5741. case "Polygon":
  5742. if (geometryIndex < 0)
  5743. geometryIndex = coords.length + geometryIndex;
  5744. if (coordIndex < 0)
  5745. coordIndex = coords[geometryIndex].length + coordIndex;
  5746. return point(coords[geometryIndex][coordIndex], properties, options2);
  5747. case "MultiLineString":
  5748. if (multiFeatureIndex < 0)
  5749. multiFeatureIndex = coords.length + multiFeatureIndex;
  5750. if (coordIndex < 0)
  5751. coordIndex = coords[multiFeatureIndex].length + coordIndex;
  5752. return point(coords[multiFeatureIndex][coordIndex], properties, options2);
  5753. case "MultiPolygon":
  5754. if (multiFeatureIndex < 0)
  5755. multiFeatureIndex = coords.length + multiFeatureIndex;
  5756. if (geometryIndex < 0)
  5757. geometryIndex = coords[multiFeatureIndex].length + geometryIndex;
  5758. if (coordIndex < 0)
  5759. coordIndex = coords[multiFeatureIndex][geometryIndex].length - coordIndex;
  5760. return point(
  5761. coords[multiFeatureIndex][geometryIndex][coordIndex],
  5762. properties,
  5763. options2
  5764. );
  5765. }
  5766. throw new Error("geojson is invalid");
  5767. }
  5768. var es$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  5769. __proto__: null,
  5770. coordAll,
  5771. coordEach,
  5772. coordReduce,
  5773. featureEach: featureEach$1,
  5774. featureReduce,
  5775. findPoint,
  5776. findSegment,
  5777. flattenEach,
  5778. flattenReduce,
  5779. geomEach,
  5780. geomReduce,
  5781. lineEach,
  5782. lineReduce,
  5783. propEach,
  5784. propReduce,
  5785. segmentEach,
  5786. segmentReduce
  5787. }, Symbol.toStringTag, { value: "Module" }));
  5788. function bbox$1(geojson) {
  5789. var result = [Infinity, Infinity, -Infinity, -Infinity];
  5790. coordEach(geojson, function(coord) {
  5791. if (result[0] > coord[0]) {
  5792. result[0] = coord[0];
  5793. }
  5794. if (result[1] > coord[1]) {
  5795. result[1] = coord[1];
  5796. }
  5797. if (result[2] < coord[0]) {
  5798. result[2] = coord[0];
  5799. }
  5800. if (result[3] < coord[1]) {
  5801. result[3] = coord[1];
  5802. }
  5803. });
  5804. return result;
  5805. }
  5806. bbox$1["default"] = bbox$1;
  5807. var es = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  5808. __proto__: null,
  5809. "default": bbox$1
  5810. }, Symbol.toStringTag, { value: "Module" }));
  5811. function getCoord(coord) {
  5812. if (!coord) {
  5813. throw new Error("coord is required");
  5814. }
  5815. if (!Array.isArray(coord)) {
  5816. if (coord.type === "Feature" && coord.geometry !== null && coord.geometry.type === "Point") {
  5817. return coord.geometry.coordinates;
  5818. }
  5819. if (coord.type === "Point") {
  5820. return coord.coordinates;
  5821. }
  5822. }
  5823. if (Array.isArray(coord) && coord.length >= 2 && !Array.isArray(coord[0]) && !Array.isArray(coord[1])) {
  5824. return coord;
  5825. }
  5826. throw new Error("coord must be GeoJSON Point or an Array of numbers");
  5827. }
  5828. function getCoords(coords) {
  5829. if (Array.isArray(coords)) {
  5830. return coords;
  5831. }
  5832. if (coords.type === "Feature") {
  5833. if (coords.geometry !== null) {
  5834. return coords.geometry.coordinates;
  5835. }
  5836. } else {
  5837. if (coords.coordinates) {
  5838. return coords.coordinates;
  5839. }
  5840. }
  5841. throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array");
  5842. }
  5843. function getGeom(geojson) {
  5844. if (geojson.type === "Feature") {
  5845. return geojson.geometry;
  5846. }
  5847. return geojson;
  5848. }
  5849. function getType(geojson, _name) {
  5850. if (geojson.type === "FeatureCollection") {
  5851. return "FeatureCollection";
  5852. }
  5853. if (geojson.type === "GeometryCollection") {
  5854. return "GeometryCollection";
  5855. }
  5856. if (geojson.type === "Feature" && geojson.geometry !== null) {
  5857. return geojson.geometry.type;
  5858. }
  5859. return geojson.type;
  5860. }
  5861. var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  5862. function getDefaultExportFromCjs(x) {
  5863. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
  5864. }
  5865. function getAugmentedNamespace(n) {
  5866. if (n.__esModule)
  5867. return n;
  5868. var a = Object.defineProperty({}, "__esModule", { value: true });
  5869. Object.keys(n).forEach(function(k) {
  5870. var d2 = Object.getOwnPropertyDescriptor(n, k);
  5871. Object.defineProperty(a, k, d2.get ? d2 : {
  5872. enumerable: true,
  5873. get: function() {
  5874. return n[k];
  5875. }
  5876. });
  5877. });
  5878. return a;
  5879. }
  5880. var concaveman$2 = { exports: {} };
  5881. var rbush_min$1 = { exports: {} };
  5882. (function(module2, exports2) {
  5883. !function(t2, i2) {
  5884. module2.exports = i2();
  5885. }(commonjsGlobal, function() {
  5886. function t2(t3, r3, e2, a2, h3) {
  5887. !function t4(n2, r4, e3, a3, h4) {
  5888. for (; a3 > e3; ) {
  5889. if (a3 - e3 > 600) {
  5890. var o2 = a3 - e3 + 1, s2 = r4 - e3 + 1, l2 = Math.log(o2), f2 = 0.5 * Math.exp(2 * l2 / 3), u2 = 0.5 * Math.sqrt(l2 * f2 * (o2 - f2) / o2) * (s2 - o2 / 2 < 0 ? -1 : 1), m2 = Math.max(e3, Math.floor(r4 - s2 * f2 / o2 + u2)), c2 = Math.min(a3, Math.floor(r4 + (o2 - s2) * f2 / o2 + u2));
  5891. t4(n2, r4, m2, c2, h4);
  5892. }
  5893. var p2 = n2[r4], d3 = e3, x = a3;
  5894. for (i2(n2, e3, r4), h4(n2[a3], p2) > 0 && i2(n2, e3, a3); d3 < x; ) {
  5895. for (i2(n2, d3, x), d3++, x--; h4(n2[d3], p2) < 0; )
  5896. d3++;
  5897. for (; h4(n2[x], p2) > 0; )
  5898. x--;
  5899. }
  5900. 0 === h4(n2[e3], p2) ? i2(n2, e3, x) : i2(n2, ++x, a3), x <= r4 && (e3 = x + 1), r4 <= x && (a3 = x - 1);
  5901. }
  5902. }(t3, r3, e2 || 0, a2 || t3.length - 1, h3 || n);
  5903. }
  5904. function i2(t3, i3, n2) {
  5905. var r3 = t3[i3];
  5906. t3[i3] = t3[n2], t3[n2] = r3;
  5907. }
  5908. function n(t3, i3) {
  5909. return t3 < i3 ? -1 : t3 > i3 ? 1 : 0;
  5910. }
  5911. var r2 = function(t3) {
  5912. void 0 === t3 && (t3 = 9), this._maxEntries = Math.max(4, t3), this._minEntries = Math.max(2, Math.ceil(0.4 * this._maxEntries)), this.clear();
  5913. };
  5914. function e(t3, i3, n2) {
  5915. if (!n2)
  5916. return i3.indexOf(t3);
  5917. for (var r3 = 0; r3 < i3.length; r3++)
  5918. if (n2(t3, i3[r3]))
  5919. return r3;
  5920. return -1;
  5921. }
  5922. function a(t3, i3) {
  5923. h2(t3, 0, t3.children.length, i3, t3);
  5924. }
  5925. function h2(t3, i3, n2, r3, e2) {
  5926. e2 || (e2 = p(null)), e2.minX = 1 / 0, e2.minY = 1 / 0, e2.maxX = -1 / 0, e2.maxY = -1 / 0;
  5927. for (var a2 = i3; a2 < n2; a2++) {
  5928. var h3 = t3.children[a2];
  5929. o(e2, t3.leaf ? r3(h3) : h3);
  5930. }
  5931. return e2;
  5932. }
  5933. function o(t3, i3) {
  5934. return t3.minX = Math.min(t3.minX, i3.minX), t3.minY = Math.min(t3.minY, i3.minY), t3.maxX = Math.max(t3.maxX, i3.maxX), t3.maxY = Math.max(t3.maxY, i3.maxY), t3;
  5935. }
  5936. function s(t3, i3) {
  5937. return t3.minX - i3.minX;
  5938. }
  5939. function l(t3, i3) {
  5940. return t3.minY - i3.minY;
  5941. }
  5942. function f(t3) {
  5943. return (t3.maxX - t3.minX) * (t3.maxY - t3.minY);
  5944. }
  5945. function u(t3) {
  5946. return t3.maxX - t3.minX + (t3.maxY - t3.minY);
  5947. }
  5948. function m(t3, i3) {
  5949. return t3.minX <= i3.minX && t3.minY <= i3.minY && i3.maxX <= t3.maxX && i3.maxY <= t3.maxY;
  5950. }
  5951. function c(t3, i3) {
  5952. return i3.minX <= t3.maxX && i3.minY <= t3.maxY && i3.maxX >= t3.minX && i3.maxY >= t3.minY;
  5953. }
  5954. function p(t3) {
  5955. return { children: t3, height: 1, leaf: true, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 };
  5956. }
  5957. function d2(i3, n2, r3, e2, a2) {
  5958. for (var h3 = [n2, r3]; h3.length; )
  5959. if (!((r3 = h3.pop()) - (n2 = h3.pop()) <= e2)) {
  5960. var o2 = n2 + Math.ceil((r3 - n2) / e2 / 2) * e2;
  5961. t2(i3, o2, n2, r3, a2), h3.push(n2, o2, o2, r3);
  5962. }
  5963. }
  5964. return r2.prototype.all = function() {
  5965. return this._all(this.data, []);
  5966. }, r2.prototype.search = function(t3) {
  5967. var i3 = this.data, n2 = [];
  5968. if (!c(t3, i3))
  5969. return n2;
  5970. for (var r3 = this.toBBox, e2 = []; i3; ) {
  5971. for (var a2 = 0; a2 < i3.children.length; a2++) {
  5972. var h3 = i3.children[a2], o2 = i3.leaf ? r3(h3) : h3;
  5973. c(t3, o2) && (i3.leaf ? n2.push(h3) : m(t3, o2) ? this._all(h3, n2) : e2.push(h3));
  5974. }
  5975. i3 = e2.pop();
  5976. }
  5977. return n2;
  5978. }, r2.prototype.collides = function(t3) {
  5979. var i3 = this.data;
  5980. if (!c(t3, i3))
  5981. return false;
  5982. for (var n2 = []; i3; ) {
  5983. for (var r3 = 0; r3 < i3.children.length; r3++) {
  5984. var e2 = i3.children[r3], a2 = i3.leaf ? this.toBBox(e2) : e2;
  5985. if (c(t3, a2)) {
  5986. if (i3.leaf || m(t3, a2))
  5987. return true;
  5988. n2.push(e2);
  5989. }
  5990. }
  5991. i3 = n2.pop();
  5992. }
  5993. return false;
  5994. }, r2.prototype.load = function(t3) {
  5995. if (!t3 || !t3.length)
  5996. return this;
  5997. if (t3.length < this._minEntries) {
  5998. for (var i3 = 0; i3 < t3.length; i3++)
  5999. this.insert(t3[i3]);
  6000. return this;
  6001. }
  6002. var n2 = this._build(t3.slice(), 0, t3.length - 1, 0);
  6003. if (this.data.children.length)
  6004. if (this.data.height === n2.height)
  6005. this._splitRoot(this.data, n2);
  6006. else {
  6007. if (this.data.height < n2.height) {
  6008. var r3 = this.data;
  6009. this.data = n2, n2 = r3;
  6010. }
  6011. this._insert(n2, this.data.height - n2.height - 1, true);
  6012. }
  6013. else
  6014. this.data = n2;
  6015. return this;
  6016. }, r2.prototype.insert = function(t3) {
  6017. return t3 && this._insert(t3, this.data.height - 1), this;
  6018. }, r2.prototype.clear = function() {
  6019. return this.data = p([]), this;
  6020. }, r2.prototype.remove = function(t3, i3) {
  6021. if (!t3)
  6022. return this;
  6023. for (var n2, r3, a2, h3 = this.data, o2 = this.toBBox(t3), s2 = [], l2 = []; h3 || s2.length; ) {
  6024. if (h3 || (h3 = s2.pop(), r3 = s2[s2.length - 1], n2 = l2.pop(), a2 = true), h3.leaf) {
  6025. var f2 = e(t3, h3.children, i3);
  6026. if (-1 !== f2)
  6027. return h3.children.splice(f2, 1), s2.push(h3), this._condense(s2), this;
  6028. }
  6029. a2 || h3.leaf || !m(h3, o2) ? r3 ? (n2++, h3 = r3.children[n2], a2 = false) : h3 = null : (s2.push(h3), l2.push(n2), n2 = 0, r3 = h3, h3 = h3.children[0]);
  6030. }
  6031. return this;
  6032. }, r2.prototype.toBBox = function(t3) {
  6033. return t3;
  6034. }, r2.prototype.compareMinX = function(t3, i3) {
  6035. return t3.minX - i3.minX;
  6036. }, r2.prototype.compareMinY = function(t3, i3) {
  6037. return t3.minY - i3.minY;
  6038. }, r2.prototype.toJSON = function() {
  6039. return this.data;
  6040. }, r2.prototype.fromJSON = function(t3) {
  6041. return this.data = t3, this;
  6042. }, r2.prototype._all = function(t3, i3) {
  6043. for (var n2 = []; t3; )
  6044. t3.leaf ? i3.push.apply(i3, t3.children) : n2.push.apply(n2, t3.children), t3 = n2.pop();
  6045. return i3;
  6046. }, r2.prototype._build = function(t3, i3, n2, r3) {
  6047. var e2, h3 = n2 - i3 + 1, o2 = this._maxEntries;
  6048. if (h3 <= o2)
  6049. return a(e2 = p(t3.slice(i3, n2 + 1)), this.toBBox), e2;
  6050. r3 || (r3 = Math.ceil(Math.log(h3) / Math.log(o2)), o2 = Math.ceil(h3 / Math.pow(o2, r3 - 1))), (e2 = p([])).leaf = false, e2.height = r3;
  6051. var s2 = Math.ceil(h3 / o2), l2 = s2 * Math.ceil(Math.sqrt(o2));
  6052. d2(t3, i3, n2, l2, this.compareMinX);
  6053. for (var f2 = i3; f2 <= n2; f2 += l2) {
  6054. var u2 = Math.min(f2 + l2 - 1, n2);
  6055. d2(t3, f2, u2, s2, this.compareMinY);
  6056. for (var m2 = f2; m2 <= u2; m2 += s2) {
  6057. var c2 = Math.min(m2 + s2 - 1, u2);
  6058. e2.children.push(this._build(t3, m2, c2, r3 - 1));
  6059. }
  6060. }
  6061. return a(e2, this.toBBox), e2;
  6062. }, r2.prototype._chooseSubtree = function(t3, i3, n2, r3) {
  6063. for (; r3.push(i3), !i3.leaf && r3.length - 1 !== n2; ) {
  6064. for (var e2 = 1 / 0, a2 = 1 / 0, h3 = void 0, o2 = 0; o2 < i3.children.length; o2++) {
  6065. var s2 = i3.children[o2], l2 = f(s2), u2 = (m2 = t3, c2 = s2, (Math.max(c2.maxX, m2.maxX) - Math.min(c2.minX, m2.minX)) * (Math.max(c2.maxY, m2.maxY) - Math.min(c2.minY, m2.minY)) - l2);
  6066. u2 < a2 ? (a2 = u2, e2 = l2 < e2 ? l2 : e2, h3 = s2) : u2 === a2 && l2 < e2 && (e2 = l2, h3 = s2);
  6067. }
  6068. i3 = h3 || i3.children[0];
  6069. }
  6070. var m2, c2;
  6071. return i3;
  6072. }, r2.prototype._insert = function(t3, i3, n2) {
  6073. var r3 = n2 ? t3 : this.toBBox(t3), e2 = [], a2 = this._chooseSubtree(r3, this.data, i3, e2);
  6074. for (a2.children.push(t3), o(a2, r3); i3 >= 0 && e2[i3].children.length > this._maxEntries; )
  6075. this._split(e2, i3), i3--;
  6076. this._adjustParentBBoxes(r3, e2, i3);
  6077. }, r2.prototype._split = function(t3, i3) {
  6078. var n2 = t3[i3], r3 = n2.children.length, e2 = this._minEntries;
  6079. this._chooseSplitAxis(n2, e2, r3);
  6080. var h3 = this._chooseSplitIndex(n2, e2, r3), o2 = p(n2.children.splice(h3, n2.children.length - h3));
  6081. o2.height = n2.height, o2.leaf = n2.leaf, a(n2, this.toBBox), a(o2, this.toBBox), i3 ? t3[i3 - 1].children.push(o2) : this._splitRoot(n2, o2);
  6082. }, r2.prototype._splitRoot = function(t3, i3) {
  6083. this.data = p([t3, i3]), this.data.height = t3.height + 1, this.data.leaf = false, a(this.data, this.toBBox);
  6084. }, r2.prototype._chooseSplitIndex = function(t3, i3, n2) {
  6085. for (var r3, e2, a2, o2, s2, l2, u2, m2 = 1 / 0, c2 = 1 / 0, p2 = i3; p2 <= n2 - i3; p2++) {
  6086. var d3 = h2(t3, 0, p2, this.toBBox), x = h2(t3, p2, n2, this.toBBox), v = (e2 = d3, a2 = x, o2 = void 0, s2 = void 0, l2 = void 0, u2 = void 0, o2 = Math.max(e2.minX, a2.minX), s2 = Math.max(e2.minY, a2.minY), l2 = Math.min(e2.maxX, a2.maxX), u2 = Math.min(e2.maxY, a2.maxY), Math.max(0, l2 - o2) * Math.max(0, u2 - s2)), M = f(d3) + f(x);
  6087. v < m2 ? (m2 = v, r3 = p2, c2 = M < c2 ? M : c2) : v === m2 && M < c2 && (c2 = M, r3 = p2);
  6088. }
  6089. return r3 || n2 - i3;
  6090. }, r2.prototype._chooseSplitAxis = function(t3, i3, n2) {
  6091. var r3 = t3.leaf ? this.compareMinX : s, e2 = t3.leaf ? this.compareMinY : l;
  6092. this._allDistMargin(t3, i3, n2, r3) < this._allDistMargin(t3, i3, n2, e2) && t3.children.sort(r3);
  6093. }, r2.prototype._allDistMargin = function(t3, i3, n2, r3) {
  6094. t3.children.sort(r3);
  6095. for (var e2 = this.toBBox, a2 = h2(t3, 0, i3, e2), s2 = h2(t3, n2 - i3, n2, e2), l2 = u(a2) + u(s2), f2 = i3; f2 < n2 - i3; f2++) {
  6096. var m2 = t3.children[f2];
  6097. o(a2, t3.leaf ? e2(m2) : m2), l2 += u(a2);
  6098. }
  6099. for (var c2 = n2 - i3 - 1; c2 >= i3; c2--) {
  6100. var p2 = t3.children[c2];
  6101. o(s2, t3.leaf ? e2(p2) : p2), l2 += u(s2);
  6102. }
  6103. return l2;
  6104. }, r2.prototype._adjustParentBBoxes = function(t3, i3, n2) {
  6105. for (var r3 = n2; r3 >= 0; r3--)
  6106. o(i3[r3], t3);
  6107. }, r2.prototype._condense = function(t3) {
  6108. for (var i3 = t3.length - 1, n2 = void 0; i3 >= 0; i3--)
  6109. 0 === t3[i3].children.length ? i3 > 0 ? (n2 = t3[i3 - 1].children).splice(n2.indexOf(t3[i3]), 1) : this.clear() : a(t3[i3], this.toBBox);
  6110. }, r2;
  6111. });
  6112. })(rbush_min$1);
  6113. class TinyQueue {
  6114. constructor(data = [], compare = defaultCompare) {
  6115. this.data = data;
  6116. this.length = this.data.length;
  6117. this.compare = compare;
  6118. if (this.length > 0) {
  6119. for (let i2 = (this.length >> 1) - 1; i2 >= 0; i2--)
  6120. this._down(i2);
  6121. }
  6122. }
  6123. push(item) {
  6124. this.data.push(item);
  6125. this.length++;
  6126. this._up(this.length - 1);
  6127. }
  6128. pop() {
  6129. if (this.length === 0)
  6130. return void 0;
  6131. const top = this.data[0];
  6132. const bottom = this.data.pop();
  6133. this.length--;
  6134. if (this.length > 0) {
  6135. this.data[0] = bottom;
  6136. this._down(0);
  6137. }
  6138. return top;
  6139. }
  6140. peek() {
  6141. return this.data[0];
  6142. }
  6143. _up(pos) {
  6144. const { data, compare } = this;
  6145. const item = data[pos];
  6146. while (pos > 0) {
  6147. const parent = pos - 1 >> 1;
  6148. const current = data[parent];
  6149. if (compare(item, current) >= 0)
  6150. break;
  6151. data[pos] = current;
  6152. pos = parent;
  6153. }
  6154. data[pos] = item;
  6155. }
  6156. _down(pos) {
  6157. const { data, compare } = this;
  6158. const halfLength = this.length >> 1;
  6159. const item = data[pos];
  6160. while (pos < halfLength) {
  6161. let left = (pos << 1) + 1;
  6162. let best = data[left];
  6163. const right = left + 1;
  6164. if (right < this.length && compare(data[right], best) < 0) {
  6165. left = right;
  6166. best = data[right];
  6167. }
  6168. if (compare(best, item) >= 0)
  6169. break;
  6170. data[pos] = best;
  6171. pos = left;
  6172. }
  6173. data[pos] = item;
  6174. }
  6175. }
  6176. function defaultCompare(a, b) {
  6177. return a < b ? -1 : a > b ? 1 : 0;
  6178. }
  6179. var tinyqueue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  6180. __proto__: null,
  6181. "default": TinyQueue
  6182. }, Symbol.toStringTag, { value: "Module" }));
  6183. var require$$1$2 = /* @__PURE__ */ getAugmentedNamespace(tinyqueue);
  6184. var pointInPolygon$1 = { exports: {} };
  6185. var flat = function pointInPolygonFlat(point2, vs, start2, end) {
  6186. var x = point2[0], y = point2[1];
  6187. var inside2 = false;
  6188. if (start2 === void 0)
  6189. start2 = 0;
  6190. if (end === void 0)
  6191. end = vs.length;
  6192. var len = (end - start2) / 2;
  6193. for (var i2 = 0, j = len - 1; i2 < len; j = i2++) {
  6194. var xi = vs[start2 + i2 * 2 + 0], yi = vs[start2 + i2 * 2 + 1];
  6195. var xj = vs[start2 + j * 2 + 0], yj = vs[start2 + j * 2 + 1];
  6196. var intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
  6197. if (intersect)
  6198. inside2 = !inside2;
  6199. }
  6200. return inside2;
  6201. };
  6202. var nested = function pointInPolygonNested(point2, vs, start2, end) {
  6203. var x = point2[0], y = point2[1];
  6204. var inside2 = false;
  6205. if (start2 === void 0)
  6206. start2 = 0;
  6207. if (end === void 0)
  6208. end = vs.length;
  6209. var len = end - start2;
  6210. for (var i2 = 0, j = len - 1; i2 < len; j = i2++) {
  6211. var xi = vs[i2 + start2][0], yi = vs[i2 + start2][1];
  6212. var xj = vs[j + start2][0], yj = vs[j + start2][1];
  6213. var intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;
  6214. if (intersect)
  6215. inside2 = !inside2;
  6216. }
  6217. return inside2;
  6218. };
  6219. var pointInPolygonFlat2 = flat;
  6220. var pointInPolygonNested2 = nested;
  6221. pointInPolygon$1.exports = function pointInPolygon(point2, vs, start2, end) {
  6222. if (vs.length > 0 && Array.isArray(vs[0])) {
  6223. return pointInPolygonNested2(point2, vs, start2, end);
  6224. } else {
  6225. return pointInPolygonFlat2(point2, vs, start2, end);
  6226. }
  6227. };
  6228. pointInPolygon$1.exports.nested = pointInPolygonNested2;
  6229. pointInPolygon$1.exports.flat = pointInPolygonFlat2;
  6230. var orient2d_min = { exports: {} };
  6231. (function(module2, exports2) {
  6232. !function(t2, e) {
  6233. e(exports2);
  6234. }(commonjsGlobal, function(t2) {
  6235. const e = 134217729, n = 33306690738754706e-32;
  6236. function r2(t3, e2, n2, r3, o2) {
  6237. let f2, i3, u2, c2, s2 = e2[0], a2 = r3[0], d3 = 0, l2 = 0;
  6238. a2 > s2 == a2 > -s2 ? (f2 = s2, s2 = e2[++d3]) : (f2 = a2, a2 = r3[++l2]);
  6239. let p = 0;
  6240. if (d3 < t3 && l2 < n2)
  6241. for (a2 > s2 == a2 > -s2 ? (u2 = f2 - ((i3 = s2 + f2) - s2), s2 = e2[++d3]) : (u2 = f2 - ((i3 = a2 + f2) - a2), a2 = r3[++l2]), f2 = i3, 0 !== u2 && (o2[p++] = u2); d3 < t3 && l2 < n2; )
  6242. a2 > s2 == a2 > -s2 ? (u2 = f2 - ((i3 = f2 + s2) - (c2 = i3 - f2)) + (s2 - c2), s2 = e2[++d3]) : (u2 = f2 - ((i3 = f2 + a2) - (c2 = i3 - f2)) + (a2 - c2), a2 = r3[++l2]), f2 = i3, 0 !== u2 && (o2[p++] = u2);
  6243. for (; d3 < t3; )
  6244. u2 = f2 - ((i3 = f2 + s2) - (c2 = i3 - f2)) + (s2 - c2), s2 = e2[++d3], f2 = i3, 0 !== u2 && (o2[p++] = u2);
  6245. for (; l2 < n2; )
  6246. u2 = f2 - ((i3 = f2 + a2) - (c2 = i3 - f2)) + (a2 - c2), a2 = r3[++l2], f2 = i3, 0 !== u2 && (o2[p++] = u2);
  6247. return 0 === f2 && 0 !== p || (o2[p++] = f2), p;
  6248. }
  6249. function o(t3) {
  6250. return new Float64Array(t3);
  6251. }
  6252. const f = 33306690738754716e-32, i2 = 22204460492503146e-32, u = 11093356479670487e-47, c = o(4), s = o(8), a = o(12), d2 = o(16), l = o(4);
  6253. t2.orient2d = function(t3, o2, p, b, y, h2) {
  6254. const M = (o2 - h2) * (p - y), x = (t3 - y) * (b - h2), j = M - x;
  6255. if (0 === M || 0 === x || M > 0 != x > 0)
  6256. return j;
  6257. const m = Math.abs(M + x);
  6258. return Math.abs(j) >= f * m ? j : -function(t4, o3, f2, p2, b2, y2, h3) {
  6259. let M2, x2, j2, m2, _, v, w, A, F, O, P2, g, k, q2, z, B2, C2, D;
  6260. const E2 = t4 - b2, G2 = f2 - b2, H2 = o3 - y2, I2 = p2 - y2;
  6261. _ = (z = (A = E2 - (w = (v = e * E2) - (v - E2))) * (O = I2 - (F = (v = e * I2) - (v - I2))) - ((q2 = E2 * I2) - w * F - A * F - w * O)) - (P2 = z - (C2 = (A = H2 - (w = (v = e * H2) - (v - H2))) * (O = G2 - (F = (v = e * G2) - (v - G2))) - ((B2 = H2 * G2) - w * F - A * F - w * O))), c[0] = z - (P2 + _) + (_ - C2), _ = (k = q2 - ((g = q2 + P2) - (_ = g - q2)) + (P2 - _)) - (P2 = k - B2), c[1] = k - (P2 + _) + (_ - B2), _ = (D = g + P2) - g, c[2] = g - (D - _) + (P2 - _), c[3] = D;
  6262. let J2 = function(t5, e2) {
  6263. let n2 = e2[0];
  6264. for (let r3 = 1; r3 < t5; r3++)
  6265. n2 += e2[r3];
  6266. return n2;
  6267. }(4, c), K2 = i2 * h3;
  6268. if (J2 >= K2 || -J2 >= K2)
  6269. return J2;
  6270. if (M2 = t4 - (E2 + (_ = t4 - E2)) + (_ - b2), j2 = f2 - (G2 + (_ = f2 - G2)) + (_ - b2), x2 = o3 - (H2 + (_ = o3 - H2)) + (_ - y2), m2 = p2 - (I2 + (_ = p2 - I2)) + (_ - y2), 0 === M2 && 0 === x2 && 0 === j2 && 0 === m2)
  6271. return J2;
  6272. if (K2 = u * h3 + n * Math.abs(J2), (J2 += E2 * m2 + I2 * M2 - (H2 * j2 + G2 * x2)) >= K2 || -J2 >= K2)
  6273. return J2;
  6274. _ = (z = (A = M2 - (w = (v = e * M2) - (v - M2))) * (O = I2 - (F = (v = e * I2) - (v - I2))) - ((q2 = M2 * I2) - w * F - A * F - w * O)) - (P2 = z - (C2 = (A = x2 - (w = (v = e * x2) - (v - x2))) * (O = G2 - (F = (v = e * G2) - (v - G2))) - ((B2 = x2 * G2) - w * F - A * F - w * O))), l[0] = z - (P2 + _) + (_ - C2), _ = (k = q2 - ((g = q2 + P2) - (_ = g - q2)) + (P2 - _)) - (P2 = k - B2), l[1] = k - (P2 + _) + (_ - B2), _ = (D = g + P2) - g, l[2] = g - (D - _) + (P2 - _), l[3] = D;
  6275. const L = r2(4, c, 4, l, s);
  6276. _ = (z = (A = E2 - (w = (v = e * E2) - (v - E2))) * (O = m2 - (F = (v = e * m2) - (v - m2))) - ((q2 = E2 * m2) - w * F - A * F - w * O)) - (P2 = z - (C2 = (A = H2 - (w = (v = e * H2) - (v - H2))) * (O = j2 - (F = (v = e * j2) - (v - j2))) - ((B2 = H2 * j2) - w * F - A * F - w * O))), l[0] = z - (P2 + _) + (_ - C2), _ = (k = q2 - ((g = q2 + P2) - (_ = g - q2)) + (P2 - _)) - (P2 = k - B2), l[1] = k - (P2 + _) + (_ - B2), _ = (D = g + P2) - g, l[2] = g - (D - _) + (P2 - _), l[3] = D;
  6277. const N2 = r2(L, s, 4, l, a);
  6278. _ = (z = (A = M2 - (w = (v = e * M2) - (v - M2))) * (O = m2 - (F = (v = e * m2) - (v - m2))) - ((q2 = M2 * m2) - w * F - A * F - w * O)) - (P2 = z - (C2 = (A = x2 - (w = (v = e * x2) - (v - x2))) * (O = j2 - (F = (v = e * j2) - (v - j2))) - ((B2 = x2 * j2) - w * F - A * F - w * O))), l[0] = z - (P2 + _) + (_ - C2), _ = (k = q2 - ((g = q2 + P2) - (_ = g - q2)) + (P2 - _)) - (P2 = k - B2), l[1] = k - (P2 + _) + (_ - B2), _ = (D = g + P2) - g, l[2] = g - (D - _) + (P2 - _), l[3] = D;
  6279. const Q2 = r2(N2, a, 4, l, d2);
  6280. return d2[Q2 - 1];
  6281. }(t3, o2, p, b, y, h2, m);
  6282. }, t2.orient2dfast = function(t3, e2, n2, r3, o2, f2) {
  6283. return (e2 - f2) * (n2 - o2) - (t3 - o2) * (r3 - f2);
  6284. }, Object.defineProperty(t2, "__esModule", { value: true });
  6285. });
  6286. })(orient2d_min, orient2d_min.exports);
  6287. var RBush = rbush_min$1.exports;
  6288. var Queue = require$$1$2;
  6289. var pointInPolygon2 = pointInPolygon$1.exports;
  6290. var orient = orient2d_min.exports.orient2d;
  6291. if (Queue.default) {
  6292. Queue = Queue.default;
  6293. }
  6294. concaveman$2.exports = concaveman;
  6295. concaveman$2.exports.default = concaveman;
  6296. function concaveman(points2, concavity, lengthThreshold) {
  6297. concavity = Math.max(0, concavity === void 0 ? 2 : concavity);
  6298. lengthThreshold = lengthThreshold || 0;
  6299. var hull = fastConvexHull(points2);
  6300. var tree = new RBush(16);
  6301. tree.toBBox = function(a2) {
  6302. return {
  6303. minX: a2[0],
  6304. minY: a2[1],
  6305. maxX: a2[0],
  6306. maxY: a2[1]
  6307. };
  6308. };
  6309. tree.compareMinX = function(a2, b2) {
  6310. return a2[0] - b2[0];
  6311. };
  6312. tree.compareMinY = function(a2, b2) {
  6313. return a2[1] - b2[1];
  6314. };
  6315. tree.load(points2);
  6316. var queue = [];
  6317. for (var i2 = 0, last; i2 < hull.length; i2++) {
  6318. var p = hull[i2];
  6319. tree.remove(p);
  6320. last = insertNode(p, last);
  6321. queue.push(last);
  6322. }
  6323. var segTree = new RBush(16);
  6324. for (i2 = 0; i2 < queue.length; i2++)
  6325. segTree.insert(updateBBox(queue[i2]));
  6326. var sqConcavity = concavity * concavity;
  6327. var sqLenThreshold = lengthThreshold * lengthThreshold;
  6328. while (queue.length) {
  6329. var node = queue.shift();
  6330. var a = node.p;
  6331. var b = node.next.p;
  6332. var sqLen = getSqDist(a, b);
  6333. if (sqLen < sqLenThreshold)
  6334. continue;
  6335. var maxSqLen = sqLen / sqConcavity;
  6336. p = findCandidate(tree, node.prev.p, a, b, node.next.next.p, maxSqLen, segTree);
  6337. if (p && Math.min(getSqDist(p, a), getSqDist(p, b)) <= maxSqLen) {
  6338. queue.push(node);
  6339. queue.push(insertNode(p, node));
  6340. tree.remove(p);
  6341. segTree.remove(node);
  6342. segTree.insert(updateBBox(node));
  6343. segTree.insert(updateBBox(node.next));
  6344. }
  6345. }
  6346. node = last;
  6347. var concave = [];
  6348. do {
  6349. concave.push(node.p);
  6350. node = node.next;
  6351. } while (node !== last);
  6352. concave.push(node.p);
  6353. return concave;
  6354. }
  6355. function findCandidate(tree, a, b, c, d2, maxDist, segTree) {
  6356. var queue = new Queue([], compareDist);
  6357. var node = tree.data;
  6358. while (node) {
  6359. for (var i2 = 0; i2 < node.children.length; i2++) {
  6360. var child = node.children[i2];
  6361. var dist = node.leaf ? sqSegDist(child, b, c) : sqSegBoxDist(b, c, child);
  6362. if (dist > maxDist)
  6363. continue;
  6364. queue.push({
  6365. node: child,
  6366. dist
  6367. });
  6368. }
  6369. while (queue.length && !queue.peek().node.children) {
  6370. var item = queue.pop();
  6371. var p = item.node;
  6372. var d0 = sqSegDist(p, a, b);
  6373. var d1 = sqSegDist(p, c, d2);
  6374. if (item.dist < d0 && item.dist < d1 && noIntersections(b, p, segTree) && noIntersections(c, p, segTree))
  6375. return p;
  6376. }
  6377. node = queue.pop();
  6378. if (node)
  6379. node = node.node;
  6380. }
  6381. return null;
  6382. }
  6383. function compareDist(a, b) {
  6384. return a.dist - b.dist;
  6385. }
  6386. function sqSegBoxDist(a, b, bbox2) {
  6387. if (inside(a, bbox2) || inside(b, bbox2))
  6388. return 0;
  6389. var d1 = sqSegSegDist(a[0], a[1], b[0], b[1], bbox2.minX, bbox2.minY, bbox2.maxX, bbox2.minY);
  6390. if (d1 === 0)
  6391. return 0;
  6392. var d2 = sqSegSegDist(a[0], a[1], b[0], b[1], bbox2.minX, bbox2.minY, bbox2.minX, bbox2.maxY);
  6393. if (d2 === 0)
  6394. return 0;
  6395. var d3 = sqSegSegDist(a[0], a[1], b[0], b[1], bbox2.maxX, bbox2.minY, bbox2.maxX, bbox2.maxY);
  6396. if (d3 === 0)
  6397. return 0;
  6398. var d4 = sqSegSegDist(a[0], a[1], b[0], b[1], bbox2.minX, bbox2.maxY, bbox2.maxX, bbox2.maxY);
  6399. if (d4 === 0)
  6400. return 0;
  6401. return Math.min(d1, d2, d3, d4);
  6402. }
  6403. function inside(a, bbox2) {
  6404. return a[0] >= bbox2.minX && a[0] <= bbox2.maxX && a[1] >= bbox2.minY && a[1] <= bbox2.maxY;
  6405. }
  6406. function noIntersections(a, b, segTree) {
  6407. var minX = Math.min(a[0], b[0]);
  6408. var minY = Math.min(a[1], b[1]);
  6409. var maxX = Math.max(a[0], b[0]);
  6410. var maxY = Math.max(a[1], b[1]);
  6411. var edges = segTree.search({ minX, minY, maxX, maxY });
  6412. for (var i2 = 0; i2 < edges.length; i2++) {
  6413. if (intersects$1(edges[i2].p, edges[i2].next.p, a, b))
  6414. return false;
  6415. }
  6416. return true;
  6417. }
  6418. function cross(p1, p2, p3) {
  6419. return orient(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);
  6420. }
  6421. function intersects$1(p1, q1, p2, q2) {
  6422. return p1 !== q2 && q1 !== p2 && cross(p1, q1, p2) > 0 !== cross(p1, q1, q2) > 0 && cross(p2, q2, p1) > 0 !== cross(p2, q2, q1) > 0;
  6423. }
  6424. function updateBBox(node) {
  6425. var p1 = node.p;
  6426. var p2 = node.next.p;
  6427. node.minX = Math.min(p1[0], p2[0]);
  6428. node.minY = Math.min(p1[1], p2[1]);
  6429. node.maxX = Math.max(p1[0], p2[0]);
  6430. node.maxY = Math.max(p1[1], p2[1]);
  6431. return node;
  6432. }
  6433. function fastConvexHull(points2) {
  6434. var left = points2[0];
  6435. var top = points2[0];
  6436. var right = points2[0];
  6437. var bottom = points2[0];
  6438. for (var i2 = 0; i2 < points2.length; i2++) {
  6439. var p = points2[i2];
  6440. if (p[0] < left[0])
  6441. left = p;
  6442. if (p[0] > right[0])
  6443. right = p;
  6444. if (p[1] < top[1])
  6445. top = p;
  6446. if (p[1] > bottom[1])
  6447. bottom = p;
  6448. }
  6449. var cull = [left, top, right, bottom];
  6450. var filtered = cull.slice();
  6451. for (i2 = 0; i2 < points2.length; i2++) {
  6452. if (!pointInPolygon2(points2[i2], cull))
  6453. filtered.push(points2[i2]);
  6454. }
  6455. return convexHull(filtered);
  6456. }
  6457. function insertNode(p, prev) {
  6458. var node = {
  6459. p,
  6460. prev: null,
  6461. next: null,
  6462. minX: 0,
  6463. minY: 0,
  6464. maxX: 0,
  6465. maxY: 0
  6466. };
  6467. if (!prev) {
  6468. node.prev = node;
  6469. node.next = node;
  6470. } else {
  6471. node.next = prev.next;
  6472. node.prev = prev;
  6473. prev.next.prev = node;
  6474. prev.next = node;
  6475. }
  6476. return node;
  6477. }
  6478. function getSqDist(p1, p2) {
  6479. var dx = p1[0] - p2[0], dy = p1[1] - p2[1];
  6480. return dx * dx + dy * dy;
  6481. }
  6482. function sqSegDist(p, p1, p2) {
  6483. var x = p1[0], y = p1[1], dx = p2[0] - x, dy = p2[1] - y;
  6484. if (dx !== 0 || dy !== 0) {
  6485. var t2 = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy);
  6486. if (t2 > 1) {
  6487. x = p2[0];
  6488. y = p2[1];
  6489. } else if (t2 > 0) {
  6490. x += dx * t2;
  6491. y += dy * t2;
  6492. }
  6493. }
  6494. dx = p[0] - x;
  6495. dy = p[1] - y;
  6496. return dx * dx + dy * dy;
  6497. }
  6498. function sqSegSegDist(x0, y0, x1, y1, x2, y2, x3, y3) {
  6499. var ux = x1 - x0;
  6500. var uy = y1 - y0;
  6501. var vx = x3 - x2;
  6502. var vy = y3 - y2;
  6503. var wx = x0 - x2;
  6504. var wy = y0 - y2;
  6505. var a = ux * ux + uy * uy;
  6506. var b = ux * vx + uy * vy;
  6507. var c = vx * vx + vy * vy;
  6508. var d2 = ux * wx + uy * wy;
  6509. var e = vx * wx + vy * wy;
  6510. var D = a * c - b * b;
  6511. var sc, sN, tc, tN;
  6512. var sD = D;
  6513. var tD = D;
  6514. if (D === 0) {
  6515. sN = 0;
  6516. sD = 1;
  6517. tN = e;
  6518. tD = c;
  6519. } else {
  6520. sN = b * e - c * d2;
  6521. tN = a * e - b * d2;
  6522. if (sN < 0) {
  6523. sN = 0;
  6524. tN = e;
  6525. tD = c;
  6526. } else if (sN > sD) {
  6527. sN = sD;
  6528. tN = e + b;
  6529. tD = c;
  6530. }
  6531. }
  6532. if (tN < 0) {
  6533. tN = 0;
  6534. if (-d2 < 0)
  6535. sN = 0;
  6536. else if (-d2 > a)
  6537. sN = sD;
  6538. else {
  6539. sN = -d2;
  6540. sD = a;
  6541. }
  6542. } else if (tN > tD) {
  6543. tN = tD;
  6544. if (-d2 + b < 0)
  6545. sN = 0;
  6546. else if (-d2 + b > a)
  6547. sN = sD;
  6548. else {
  6549. sN = -d2 + b;
  6550. sD = a;
  6551. }
  6552. }
  6553. sc = sN === 0 ? 0 : sN / sD;
  6554. tc = tN === 0 ? 0 : tN / tD;
  6555. var cx = (1 - sc) * x0 + sc * x1;
  6556. var cy = (1 - sc) * y0 + sc * y1;
  6557. var cx2 = (1 - tc) * x2 + tc * x3;
  6558. var cy2 = (1 - tc) * y2 + tc * y3;
  6559. var dx = cx2 - cx;
  6560. var dy = cy2 - cy;
  6561. return dx * dx + dy * dy;
  6562. }
  6563. function compareByX(a, b) {
  6564. return a[0] === b[0] ? a[1] - b[1] : a[0] - b[0];
  6565. }
  6566. function convexHull(points2) {
  6567. points2.sort(compareByX);
  6568. var lower = [];
  6569. for (var i2 = 0; i2 < points2.length; i2++) {
  6570. while (lower.length >= 2 && cross(lower[lower.length - 2], lower[lower.length - 1], points2[i2]) <= 0) {
  6571. lower.pop();
  6572. }
  6573. lower.push(points2[i2]);
  6574. }
  6575. var upper = [];
  6576. for (var ii = points2.length - 1; ii >= 0; ii--) {
  6577. while (upper.length >= 2 && cross(upper[upper.length - 2], upper[upper.length - 1], points2[ii]) <= 0) {
  6578. upper.pop();
  6579. }
  6580. upper.push(points2[ii]);
  6581. }
  6582. upper.pop();
  6583. lower.pop();
  6584. return lower.concat(upper);
  6585. }
  6586. var concaveman$1 = concaveman$2.exports;
  6587. function convex(geojson, options2) {
  6588. if (options2 === void 0) {
  6589. options2 = {};
  6590. }
  6591. options2.concavity = options2.concavity || Infinity;
  6592. var points2 = [];
  6593. coordEach(geojson, function(coord) {
  6594. points2.push([coord[0], coord[1]]);
  6595. });
  6596. if (!points2.length) {
  6597. return null;
  6598. }
  6599. var convexHull2 = concaveman$1(points2, options2.concavity);
  6600. if (convexHull2.length > 3) {
  6601. return polygon([convexHull2]);
  6602. }
  6603. return null;
  6604. }
  6605. function booleanPointInPolygon(point2, polygon2, options2) {
  6606. if (options2 === void 0) {
  6607. options2 = {};
  6608. }
  6609. if (!point2) {
  6610. throw new Error("point is required");
  6611. }
  6612. if (!polygon2) {
  6613. throw new Error("polygon is required");
  6614. }
  6615. var pt2 = getCoord(point2);
  6616. var geom = getGeom(polygon2);
  6617. var type2 = geom.type;
  6618. var bbox2 = polygon2.bbox;
  6619. var polys = geom.coordinates;
  6620. if (bbox2 && inBBox(pt2, bbox2) === false) {
  6621. return false;
  6622. }
  6623. if (type2 === "Polygon") {
  6624. polys = [polys];
  6625. }
  6626. var insidePoly = false;
  6627. for (var i2 = 0; i2 < polys.length && !insidePoly; i2++) {
  6628. if (inRing(pt2, polys[i2][0], options2.ignoreBoundary)) {
  6629. var inHole = false;
  6630. var k = 1;
  6631. while (k < polys[i2].length && !inHole) {
  6632. if (inRing(pt2, polys[i2][k], !options2.ignoreBoundary)) {
  6633. inHole = true;
  6634. }
  6635. k++;
  6636. }
  6637. if (!inHole) {
  6638. insidePoly = true;
  6639. }
  6640. }
  6641. }
  6642. return insidePoly;
  6643. }
  6644. function inRing(pt2, ring, ignoreBoundary) {
  6645. var isInside = false;
  6646. if (ring[0][0] === ring[ring.length - 1][0] && ring[0][1] === ring[ring.length - 1][1]) {
  6647. ring = ring.slice(0, ring.length - 1);
  6648. }
  6649. for (var i2 = 0, j = ring.length - 1; i2 < ring.length; j = i2++) {
  6650. var xi = ring[i2][0];
  6651. var yi = ring[i2][1];
  6652. var xj = ring[j][0];
  6653. var yj = ring[j][1];
  6654. var onBoundary = pt2[1] * (xi - xj) + yi * (xj - pt2[0]) + yj * (pt2[0] - xi) === 0 && (xi - pt2[0]) * (xj - pt2[0]) <= 0 && (yi - pt2[1]) * (yj - pt2[1]) <= 0;
  6655. if (onBoundary) {
  6656. return !ignoreBoundary;
  6657. }
  6658. var intersect = yi > pt2[1] !== yj > pt2[1] && pt2[0] < (xj - xi) * (pt2[1] - yi) / (yj - yi) + xi;
  6659. if (intersect) {
  6660. isInside = !isInside;
  6661. }
  6662. }
  6663. return isInside;
  6664. }
  6665. function inBBox(pt2, bbox2) {
  6666. return bbox2[0] <= pt2[0] && bbox2[1] <= pt2[1] && bbox2[2] >= pt2[0] && bbox2[3] >= pt2[1];
  6667. }
  6668. function distance(from3, to, options2) {
  6669. if (options2 === void 0) {
  6670. options2 = {};
  6671. }
  6672. var coordinates1 = getCoord(from3);
  6673. var coordinates2 = getCoord(to);
  6674. var dLat = degreesToRadians(coordinates2[1] - coordinates1[1]);
  6675. var dLon = degreesToRadians(coordinates2[0] - coordinates1[0]);
  6676. var lat1 = degreesToRadians(coordinates1[1]);
  6677. var lat2 = degreesToRadians(coordinates2[1]);
  6678. var a = Math.pow(Math.sin(dLat / 2), 2) + Math.pow(Math.sin(dLon / 2), 2) * Math.cos(lat1) * Math.cos(lat2);
  6679. return radiansToLength(2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)), options2.units);
  6680. }
  6681. function bboxPolygon(bbox2, options2) {
  6682. if (options2 === void 0) {
  6683. options2 = {};
  6684. }
  6685. var west = Number(bbox2[0]);
  6686. var south = Number(bbox2[1]);
  6687. var east = Number(bbox2[2]);
  6688. var north = Number(bbox2[3]);
  6689. if (bbox2.length === 6) {
  6690. throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");
  6691. }
  6692. var lowLeft = [west, south];
  6693. var topLeft = [west, north];
  6694. var topRight = [east, north];
  6695. var lowRight = [east, south];
  6696. return polygon([[lowLeft, lowRight, topRight, topLeft, lowLeft]], options2.properties, { bbox: bbox2, id: options2.id });
  6697. }
  6698. function destination(origin, distance2, bearing2, options2) {
  6699. if (options2 === void 0) {
  6700. options2 = {};
  6701. }
  6702. var coordinates1 = getCoord(origin);
  6703. var longitude1 = degreesToRadians(coordinates1[0]);
  6704. var latitude1 = degreesToRadians(coordinates1[1]);
  6705. var bearingRad = degreesToRadians(bearing2);
  6706. var radians = lengthToRadians(distance2, options2.units);
  6707. var latitude2 = Math.asin(Math.sin(latitude1) * Math.cos(radians) + Math.cos(latitude1) * Math.sin(radians) * Math.cos(bearingRad));
  6708. var longitude2 = longitude1 + Math.atan2(Math.sin(bearingRad) * Math.sin(radians) * Math.cos(latitude1), Math.cos(radians) - Math.sin(latitude1) * Math.sin(latitude2));
  6709. var lng = radiansToDegrees(longitude2);
  6710. var lat = radiansToDegrees(latitude2);
  6711. return point([lng, lat], options2.properties);
  6712. }
  6713. function bearing(start2, end, options2) {
  6714. if (options2 === void 0) {
  6715. options2 = {};
  6716. }
  6717. if (options2.final === true) {
  6718. return calculateFinalBearing(start2, end);
  6719. }
  6720. var coordinates1 = getCoord(start2);
  6721. var coordinates2 = getCoord(end);
  6722. var lon1 = degreesToRadians(coordinates1[0]);
  6723. var lon2 = degreesToRadians(coordinates2[0]);
  6724. var lat1 = degreesToRadians(coordinates1[1]);
  6725. var lat2 = degreesToRadians(coordinates2[1]);
  6726. var a = Math.sin(lon2 - lon1) * Math.cos(lat2);
  6727. var b = Math.cos(lat1) * Math.sin(lat2) - Math.sin(lat1) * Math.cos(lat2) * Math.cos(lon2 - lon1);
  6728. return radiansToDegrees(Math.atan2(a, b));
  6729. }
  6730. function calculateFinalBearing(start2, end) {
  6731. var bear = bearing(end, start2);
  6732. bear = (bear + 180) % 360;
  6733. return bear;
  6734. }
  6735. function midpoint(point1, point2) {
  6736. var dist = distance(point1, point2);
  6737. var heading = bearing(point1, point2);
  6738. var midpoint2 = destination(point1, dist / 2, heading);
  6739. return midpoint2;
  6740. }
  6741. function center(geojson, options2) {
  6742. if (options2 === void 0) {
  6743. options2 = {};
  6744. }
  6745. var ext = bbox$1(geojson);
  6746. var x = (ext[0] + ext[2]) / 2;
  6747. var y = (ext[1] + ext[3]) / 2;
  6748. return point([x, y], options2.properties, options2);
  6749. }
  6750. function centroid(geojson, options2) {
  6751. if (options2 === void 0) {
  6752. options2 = {};
  6753. }
  6754. var xSum = 0;
  6755. var ySum = 0;
  6756. var len = 0;
  6757. coordEach(geojson, function(coord) {
  6758. xSum += coord[0];
  6759. ySum += coord[1];
  6760. len++;
  6761. }, true);
  6762. return point([xSum / len, ySum / len], options2.properties);
  6763. }
  6764. function centerOfMass(geojson, options2) {
  6765. if (options2 === void 0) {
  6766. options2 = {};
  6767. }
  6768. switch (getType(geojson)) {
  6769. case "Point":
  6770. return point(getCoord(geojson), options2.properties);
  6771. case "Polygon":
  6772. var coords = [];
  6773. coordEach(geojson, function(coord) {
  6774. coords.push(coord);
  6775. });
  6776. var centre = centroid(geojson, { properties: options2.properties });
  6777. var translation = centre.geometry.coordinates;
  6778. var sx = 0;
  6779. var sy = 0;
  6780. var sArea = 0;
  6781. var i2, pi, pj, xi, xj, yi, yj, a;
  6782. var neutralizedPoints = coords.map(function(point2) {
  6783. return [point2[0] - translation[0], point2[1] - translation[1]];
  6784. });
  6785. for (i2 = 0; i2 < coords.length - 1; i2++) {
  6786. pi = neutralizedPoints[i2];
  6787. xi = pi[0];
  6788. yi = pi[1];
  6789. pj = neutralizedPoints[i2 + 1];
  6790. xj = pj[0];
  6791. yj = pj[1];
  6792. a = xi * yj - xj * yi;
  6793. sArea += a;
  6794. sx += (xi + xj) * a;
  6795. sy += (yi + yj) * a;
  6796. }
  6797. if (sArea === 0) {
  6798. return centre;
  6799. } else {
  6800. var area = sArea * 0.5;
  6801. var areaFactor = 1 / (6 * area);
  6802. return point([translation[0] + areaFactor * sx, translation[1] + areaFactor * sy], options2.properties);
  6803. }
  6804. default:
  6805. var hull = convex(geojson);
  6806. if (hull)
  6807. return centerOfMass(hull, { properties: options2.properties });
  6808. else
  6809. return centroid(geojson, { properties: options2.properties });
  6810. }
  6811. }
  6812. function lineSegment(geojson) {
  6813. if (!geojson) {
  6814. throw new Error("geojson is required");
  6815. }
  6816. var results = [];
  6817. flattenEach(geojson, function(feature2) {
  6818. lineSegmentFeature(feature2, results);
  6819. });
  6820. return featureCollection$1(results);
  6821. }
  6822. function lineSegmentFeature(geojson, results) {
  6823. var coords = [];
  6824. var geometry2 = geojson.geometry;
  6825. if (geometry2 !== null) {
  6826. switch (geometry2.type) {
  6827. case "Polygon":
  6828. coords = getCoords(geometry2);
  6829. break;
  6830. case "LineString":
  6831. coords = [getCoords(geometry2)];
  6832. }
  6833. coords.forEach(function(coord) {
  6834. var segments = createSegments(coord, geojson.properties);
  6835. segments.forEach(function(segment) {
  6836. segment.id = results.length;
  6837. results.push(segment);
  6838. });
  6839. });
  6840. }
  6841. }
  6842. function createSegments(coords, properties) {
  6843. var segments = [];
  6844. coords.reduce(function(previousCoords, currentCoords) {
  6845. var segment = lineString([previousCoords, currentCoords], properties);
  6846. segment.bbox = bbox(previousCoords, currentCoords);
  6847. segments.push(segment);
  6848. return currentCoords;
  6849. });
  6850. return segments;
  6851. }
  6852. function bbox(coords1, coords2) {
  6853. var x1 = coords1[0];
  6854. var y1 = coords1[1];
  6855. var x2 = coords2[0];
  6856. var y2 = coords2[1];
  6857. var west = x1 < x2 ? x1 : x2;
  6858. var south = y1 < y2 ? y1 : y2;
  6859. var east = x1 > x2 ? x1 : x2;
  6860. var north = y1 > y2 ? y1 : y2;
  6861. return [west, south, east, north];
  6862. }
  6863. var geojsonRbush$1 = { exports: {} };
  6864. var rbush_min = { exports: {} };
  6865. (function(module2, exports2) {
  6866. !function(t2, i2) {
  6867. module2.exports = i2();
  6868. }(commonjsGlobal, function() {
  6869. function t2(t3, r3, e2, a2, h3) {
  6870. !function t4(n2, r4, e3, a3, h4) {
  6871. for (; a3 > e3; ) {
  6872. if (a3 - e3 > 600) {
  6873. var o2 = a3 - e3 + 1, s2 = r4 - e3 + 1, l2 = Math.log(o2), f2 = 0.5 * Math.exp(2 * l2 / 3), u2 = 0.5 * Math.sqrt(l2 * f2 * (o2 - f2) / o2) * (s2 - o2 / 2 < 0 ? -1 : 1), m2 = Math.max(e3, Math.floor(r4 - s2 * f2 / o2 + u2)), c2 = Math.min(a3, Math.floor(r4 + (o2 - s2) * f2 / o2 + u2));
  6874. t4(n2, r4, m2, c2, h4);
  6875. }
  6876. var p2 = n2[r4], d3 = e3, x = a3;
  6877. for (i2(n2, e3, r4), h4(n2[a3], p2) > 0 && i2(n2, e3, a3); d3 < x; ) {
  6878. for (i2(n2, d3, x), d3++, x--; h4(n2[d3], p2) < 0; )
  6879. d3++;
  6880. for (; h4(n2[x], p2) > 0; )
  6881. x--;
  6882. }
  6883. 0 === h4(n2[e3], p2) ? i2(n2, e3, x) : i2(n2, ++x, a3), x <= r4 && (e3 = x + 1), r4 <= x && (a3 = x - 1);
  6884. }
  6885. }(t3, r3, e2 || 0, a2 || t3.length - 1, h3 || n);
  6886. }
  6887. function i2(t3, i3, n2) {
  6888. var r3 = t3[i3];
  6889. t3[i3] = t3[n2], t3[n2] = r3;
  6890. }
  6891. function n(t3, i3) {
  6892. return t3 < i3 ? -1 : t3 > i3 ? 1 : 0;
  6893. }
  6894. var r2 = function(t3) {
  6895. void 0 === t3 && (t3 = 9), this._maxEntries = Math.max(4, t3), this._minEntries = Math.max(2, Math.ceil(0.4 * this._maxEntries)), this.clear();
  6896. };
  6897. function e(t3, i3, n2) {
  6898. if (!n2)
  6899. return i3.indexOf(t3);
  6900. for (var r3 = 0; r3 < i3.length; r3++)
  6901. if (n2(t3, i3[r3]))
  6902. return r3;
  6903. return -1;
  6904. }
  6905. function a(t3, i3) {
  6906. h2(t3, 0, t3.children.length, i3, t3);
  6907. }
  6908. function h2(t3, i3, n2, r3, e2) {
  6909. e2 || (e2 = p(null)), e2.minX = 1 / 0, e2.minY = 1 / 0, e2.maxX = -1 / 0, e2.maxY = -1 / 0;
  6910. for (var a2 = i3; a2 < n2; a2++) {
  6911. var h3 = t3.children[a2];
  6912. o(e2, t3.leaf ? r3(h3) : h3);
  6913. }
  6914. return e2;
  6915. }
  6916. function o(t3, i3) {
  6917. return t3.minX = Math.min(t3.minX, i3.minX), t3.minY = Math.min(t3.minY, i3.minY), t3.maxX = Math.max(t3.maxX, i3.maxX), t3.maxY = Math.max(t3.maxY, i3.maxY), t3;
  6918. }
  6919. function s(t3, i3) {
  6920. return t3.minX - i3.minX;
  6921. }
  6922. function l(t3, i3) {
  6923. return t3.minY - i3.minY;
  6924. }
  6925. function f(t3) {
  6926. return (t3.maxX - t3.minX) * (t3.maxY - t3.minY);
  6927. }
  6928. function u(t3) {
  6929. return t3.maxX - t3.minX + (t3.maxY - t3.minY);
  6930. }
  6931. function m(t3, i3) {
  6932. return t3.minX <= i3.minX && t3.minY <= i3.minY && i3.maxX <= t3.maxX && i3.maxY <= t3.maxY;
  6933. }
  6934. function c(t3, i3) {
  6935. return i3.minX <= t3.maxX && i3.minY <= t3.maxY && i3.maxX >= t3.minX && i3.maxY >= t3.minY;
  6936. }
  6937. function p(t3) {
  6938. return { children: t3, height: 1, leaf: true, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 };
  6939. }
  6940. function d2(i3, n2, r3, e2, a2) {
  6941. for (var h3 = [n2, r3]; h3.length; )
  6942. if (!((r3 = h3.pop()) - (n2 = h3.pop()) <= e2)) {
  6943. var o2 = n2 + Math.ceil((r3 - n2) / e2 / 2) * e2;
  6944. t2(i3, o2, n2, r3, a2), h3.push(n2, o2, o2, r3);
  6945. }
  6946. }
  6947. return r2.prototype.all = function() {
  6948. return this._all(this.data, []);
  6949. }, r2.prototype.search = function(t3) {
  6950. var i3 = this.data, n2 = [];
  6951. if (!c(t3, i3))
  6952. return n2;
  6953. for (var r3 = this.toBBox, e2 = []; i3; ) {
  6954. for (var a2 = 0; a2 < i3.children.length; a2++) {
  6955. var h3 = i3.children[a2], o2 = i3.leaf ? r3(h3) : h3;
  6956. c(t3, o2) && (i3.leaf ? n2.push(h3) : m(t3, o2) ? this._all(h3, n2) : e2.push(h3));
  6957. }
  6958. i3 = e2.pop();
  6959. }
  6960. return n2;
  6961. }, r2.prototype.collides = function(t3) {
  6962. var i3 = this.data;
  6963. if (!c(t3, i3))
  6964. return false;
  6965. for (var n2 = []; i3; ) {
  6966. for (var r3 = 0; r3 < i3.children.length; r3++) {
  6967. var e2 = i3.children[r3], a2 = i3.leaf ? this.toBBox(e2) : e2;
  6968. if (c(t3, a2)) {
  6969. if (i3.leaf || m(t3, a2))
  6970. return true;
  6971. n2.push(e2);
  6972. }
  6973. }
  6974. i3 = n2.pop();
  6975. }
  6976. return false;
  6977. }, r2.prototype.load = function(t3) {
  6978. if (!t3 || !t3.length)
  6979. return this;
  6980. if (t3.length < this._minEntries) {
  6981. for (var i3 = 0; i3 < t3.length; i3++)
  6982. this.insert(t3[i3]);
  6983. return this;
  6984. }
  6985. var n2 = this._build(t3.slice(), 0, t3.length - 1, 0);
  6986. if (this.data.children.length)
  6987. if (this.data.height === n2.height)
  6988. this._splitRoot(this.data, n2);
  6989. else {
  6990. if (this.data.height < n2.height) {
  6991. var r3 = this.data;
  6992. this.data = n2, n2 = r3;
  6993. }
  6994. this._insert(n2, this.data.height - n2.height - 1, true);
  6995. }
  6996. else
  6997. this.data = n2;
  6998. return this;
  6999. }, r2.prototype.insert = function(t3) {
  7000. return t3 && this._insert(t3, this.data.height - 1), this;
  7001. }, r2.prototype.clear = function() {
  7002. return this.data = p([]), this;
  7003. }, r2.prototype.remove = function(t3, i3) {
  7004. if (!t3)
  7005. return this;
  7006. for (var n2, r3, a2, h3 = this.data, o2 = this.toBBox(t3), s2 = [], l2 = []; h3 || s2.length; ) {
  7007. if (h3 || (h3 = s2.pop(), r3 = s2[s2.length - 1], n2 = l2.pop(), a2 = true), h3.leaf) {
  7008. var f2 = e(t3, h3.children, i3);
  7009. if (-1 !== f2)
  7010. return h3.children.splice(f2, 1), s2.push(h3), this._condense(s2), this;
  7011. }
  7012. a2 || h3.leaf || !m(h3, o2) ? r3 ? (n2++, h3 = r3.children[n2], a2 = false) : h3 = null : (s2.push(h3), l2.push(n2), n2 = 0, r3 = h3, h3 = h3.children[0]);
  7013. }
  7014. return this;
  7015. }, r2.prototype.toBBox = function(t3) {
  7016. return t3;
  7017. }, r2.prototype.compareMinX = function(t3, i3) {
  7018. return t3.minX - i3.minX;
  7019. }, r2.prototype.compareMinY = function(t3, i3) {
  7020. return t3.minY - i3.minY;
  7021. }, r2.prototype.toJSON = function() {
  7022. return this.data;
  7023. }, r2.prototype.fromJSON = function(t3) {
  7024. return this.data = t3, this;
  7025. }, r2.prototype._all = function(t3, i3) {
  7026. for (var n2 = []; t3; )
  7027. t3.leaf ? i3.push.apply(i3, t3.children) : n2.push.apply(n2, t3.children), t3 = n2.pop();
  7028. return i3;
  7029. }, r2.prototype._build = function(t3, i3, n2, r3) {
  7030. var e2, h3 = n2 - i3 + 1, o2 = this._maxEntries;
  7031. if (h3 <= o2)
  7032. return a(e2 = p(t3.slice(i3, n2 + 1)), this.toBBox), e2;
  7033. r3 || (r3 = Math.ceil(Math.log(h3) / Math.log(o2)), o2 = Math.ceil(h3 / Math.pow(o2, r3 - 1))), (e2 = p([])).leaf = false, e2.height = r3;
  7034. var s2 = Math.ceil(h3 / o2), l2 = s2 * Math.ceil(Math.sqrt(o2));
  7035. d2(t3, i3, n2, l2, this.compareMinX);
  7036. for (var f2 = i3; f2 <= n2; f2 += l2) {
  7037. var u2 = Math.min(f2 + l2 - 1, n2);
  7038. d2(t3, f2, u2, s2, this.compareMinY);
  7039. for (var m2 = f2; m2 <= u2; m2 += s2) {
  7040. var c2 = Math.min(m2 + s2 - 1, u2);
  7041. e2.children.push(this._build(t3, m2, c2, r3 - 1));
  7042. }
  7043. }
  7044. return a(e2, this.toBBox), e2;
  7045. }, r2.prototype._chooseSubtree = function(t3, i3, n2, r3) {
  7046. for (; r3.push(i3), !i3.leaf && r3.length - 1 !== n2; ) {
  7047. for (var e2 = 1 / 0, a2 = 1 / 0, h3 = void 0, o2 = 0; o2 < i3.children.length; o2++) {
  7048. var s2 = i3.children[o2], l2 = f(s2), u2 = (m2 = t3, c2 = s2, (Math.max(c2.maxX, m2.maxX) - Math.min(c2.minX, m2.minX)) * (Math.max(c2.maxY, m2.maxY) - Math.min(c2.minY, m2.minY)) - l2);
  7049. u2 < a2 ? (a2 = u2, e2 = l2 < e2 ? l2 : e2, h3 = s2) : u2 === a2 && l2 < e2 && (e2 = l2, h3 = s2);
  7050. }
  7051. i3 = h3 || i3.children[0];
  7052. }
  7053. var m2, c2;
  7054. return i3;
  7055. }, r2.prototype._insert = function(t3, i3, n2) {
  7056. var r3 = n2 ? t3 : this.toBBox(t3), e2 = [], a2 = this._chooseSubtree(r3, this.data, i3, e2);
  7057. for (a2.children.push(t3), o(a2, r3); i3 >= 0 && e2[i3].children.length > this._maxEntries; )
  7058. this._split(e2, i3), i3--;
  7059. this._adjustParentBBoxes(r3, e2, i3);
  7060. }, r2.prototype._split = function(t3, i3) {
  7061. var n2 = t3[i3], r3 = n2.children.length, e2 = this._minEntries;
  7062. this._chooseSplitAxis(n2, e2, r3);
  7063. var h3 = this._chooseSplitIndex(n2, e2, r3), o2 = p(n2.children.splice(h3, n2.children.length - h3));
  7064. o2.height = n2.height, o2.leaf = n2.leaf, a(n2, this.toBBox), a(o2, this.toBBox), i3 ? t3[i3 - 1].children.push(o2) : this._splitRoot(n2, o2);
  7065. }, r2.prototype._splitRoot = function(t3, i3) {
  7066. this.data = p([t3, i3]), this.data.height = t3.height + 1, this.data.leaf = false, a(this.data, this.toBBox);
  7067. }, r2.prototype._chooseSplitIndex = function(t3, i3, n2) {
  7068. for (var r3, e2, a2, o2, s2, l2, u2, m2 = 1 / 0, c2 = 1 / 0, p2 = i3; p2 <= n2 - i3; p2++) {
  7069. var d3 = h2(t3, 0, p2, this.toBBox), x = h2(t3, p2, n2, this.toBBox), v = (e2 = d3, a2 = x, o2 = void 0, s2 = void 0, l2 = void 0, u2 = void 0, o2 = Math.max(e2.minX, a2.minX), s2 = Math.max(e2.minY, a2.minY), l2 = Math.min(e2.maxX, a2.maxX), u2 = Math.min(e2.maxY, a2.maxY), Math.max(0, l2 - o2) * Math.max(0, u2 - s2)), M = f(d3) + f(x);
  7070. v < m2 ? (m2 = v, r3 = p2, c2 = M < c2 ? M : c2) : v === m2 && M < c2 && (c2 = M, r3 = p2);
  7071. }
  7072. return r3 || n2 - i3;
  7073. }, r2.prototype._chooseSplitAxis = function(t3, i3, n2) {
  7074. var r3 = t3.leaf ? this.compareMinX : s, e2 = t3.leaf ? this.compareMinY : l;
  7075. this._allDistMargin(t3, i3, n2, r3) < this._allDistMargin(t3, i3, n2, e2) && t3.children.sort(r3);
  7076. }, r2.prototype._allDistMargin = function(t3, i3, n2, r3) {
  7077. t3.children.sort(r3);
  7078. for (var e2 = this.toBBox, a2 = h2(t3, 0, i3, e2), s2 = h2(t3, n2 - i3, n2, e2), l2 = u(a2) + u(s2), f2 = i3; f2 < n2 - i3; f2++) {
  7079. var m2 = t3.children[f2];
  7080. o(a2, t3.leaf ? e2(m2) : m2), l2 += u(a2);
  7081. }
  7082. for (var c2 = n2 - i3 - 1; c2 >= i3; c2--) {
  7083. var p2 = t3.children[c2];
  7084. o(s2, t3.leaf ? e2(p2) : p2), l2 += u(s2);
  7085. }
  7086. return l2;
  7087. }, r2.prototype._adjustParentBBoxes = function(t3, i3, n2) {
  7088. for (var r3 = n2; r3 >= 0; r3--)
  7089. o(i3[r3], t3);
  7090. }, r2.prototype._condense = function(t3) {
  7091. for (var i3 = t3.length - 1, n2 = void 0; i3 >= 0; i3--)
  7092. 0 === t3[i3].children.length ? i3 > 0 ? (n2 = t3[i3 - 1].children).splice(n2.indexOf(t3[i3]), 1) : this.clear() : a(t3[i3], this.toBBox);
  7093. }, r2;
  7094. });
  7095. })(rbush_min);
  7096. var require$$1$1 = /* @__PURE__ */ getAugmentedNamespace(es$2);
  7097. var require$$2 = /* @__PURE__ */ getAugmentedNamespace(es$1);
  7098. var require$$3 = /* @__PURE__ */ getAugmentedNamespace(es);
  7099. var rbush = rbush_min.exports;
  7100. var helpers = require$$1$1;
  7101. var meta = require$$2;
  7102. var turfBBox = require$$3.default;
  7103. var featureEach = meta.featureEach;
  7104. meta.coordEach;
  7105. helpers.polygon;
  7106. var featureCollection = helpers.featureCollection;
  7107. function geojsonRbush(maxEntries) {
  7108. var tree = new rbush(maxEntries);
  7109. tree.insert = function(feature2) {
  7110. if (feature2.type !== "Feature")
  7111. throw new Error("invalid feature");
  7112. feature2.bbox = feature2.bbox ? feature2.bbox : turfBBox(feature2);
  7113. return rbush.prototype.insert.call(this, feature2);
  7114. };
  7115. tree.load = function(features) {
  7116. var load = [];
  7117. if (Array.isArray(features)) {
  7118. features.forEach(function(feature2) {
  7119. if (feature2.type !== "Feature")
  7120. throw new Error("invalid features");
  7121. feature2.bbox = feature2.bbox ? feature2.bbox : turfBBox(feature2);
  7122. load.push(feature2);
  7123. });
  7124. } else {
  7125. featureEach(features, function(feature2) {
  7126. if (feature2.type !== "Feature")
  7127. throw new Error("invalid features");
  7128. feature2.bbox = feature2.bbox ? feature2.bbox : turfBBox(feature2);
  7129. load.push(feature2);
  7130. });
  7131. }
  7132. return rbush.prototype.load.call(this, load);
  7133. };
  7134. tree.remove = function(feature2, equals) {
  7135. if (feature2.type !== "Feature")
  7136. throw new Error("invalid feature");
  7137. feature2.bbox = feature2.bbox ? feature2.bbox : turfBBox(feature2);
  7138. return rbush.prototype.remove.call(this, feature2, equals);
  7139. };
  7140. tree.clear = function() {
  7141. return rbush.prototype.clear.call(this);
  7142. };
  7143. tree.search = function(geojson) {
  7144. var features = rbush.prototype.search.call(this, this.toBBox(geojson));
  7145. return featureCollection(features);
  7146. };
  7147. tree.collides = function(geojson) {
  7148. return rbush.prototype.collides.call(this, this.toBBox(geojson));
  7149. };
  7150. tree.all = function() {
  7151. var features = rbush.prototype.all.call(this);
  7152. return featureCollection(features);
  7153. };
  7154. tree.toJSON = function() {
  7155. return rbush.prototype.toJSON.call(this);
  7156. };
  7157. tree.fromJSON = function(json) {
  7158. return rbush.prototype.fromJSON.call(this, json);
  7159. };
  7160. tree.toBBox = function(geojson) {
  7161. var bbox2;
  7162. if (geojson.bbox)
  7163. bbox2 = geojson.bbox;
  7164. else if (Array.isArray(geojson) && geojson.length === 4)
  7165. bbox2 = geojson;
  7166. else if (Array.isArray(geojson) && geojson.length === 6)
  7167. bbox2 = [geojson[0], geojson[1], geojson[3], geojson[4]];
  7168. else if (geojson.type === "Feature")
  7169. bbox2 = turfBBox(geojson);
  7170. else if (geojson.type === "FeatureCollection")
  7171. bbox2 = turfBBox(geojson);
  7172. else
  7173. throw new Error("invalid geojson");
  7174. return {
  7175. minX: bbox2[0],
  7176. minY: bbox2[1],
  7177. maxX: bbox2[2],
  7178. maxY: bbox2[3]
  7179. };
  7180. };
  7181. return tree;
  7182. }
  7183. geojsonRbush$1.exports = geojsonRbush;
  7184. geojsonRbush$1.exports.default = geojsonRbush;
  7185. var rbush$1 = geojsonRbush$1.exports;
  7186. function lineIntersect(line1, line2) {
  7187. var unique = {};
  7188. var results = [];
  7189. if (line1.type === "LineString") {
  7190. line1 = feature(line1);
  7191. }
  7192. if (line2.type === "LineString") {
  7193. line2 = feature(line2);
  7194. }
  7195. if (line1.type === "Feature" && line2.type === "Feature" && line1.geometry !== null && line2.geometry !== null && line1.geometry.type === "LineString" && line2.geometry.type === "LineString" && line1.geometry.coordinates.length === 2 && line2.geometry.coordinates.length === 2) {
  7196. var intersect = intersects(line1, line2);
  7197. if (intersect) {
  7198. results.push(intersect);
  7199. }
  7200. return featureCollection$1(results);
  7201. }
  7202. var tree = rbush$1();
  7203. tree.load(lineSegment(line2));
  7204. featureEach$1(lineSegment(line1), function(segment) {
  7205. featureEach$1(tree.search(segment), function(match) {
  7206. var intersect2 = intersects(segment, match);
  7207. if (intersect2) {
  7208. var key = getCoords(intersect2).join(",");
  7209. if (!unique[key]) {
  7210. unique[key] = true;
  7211. results.push(intersect2);
  7212. }
  7213. }
  7214. });
  7215. });
  7216. return featureCollection$1(results);
  7217. }
  7218. function intersects(line1, line2) {
  7219. var coords1 = getCoords(line1);
  7220. var coords2 = getCoords(line2);
  7221. if (coords1.length !== 2) {
  7222. throw new Error("<intersects> line1 must only contain 2 coordinates");
  7223. }
  7224. if (coords2.length !== 2) {
  7225. throw new Error("<intersects> line2 must only contain 2 coordinates");
  7226. }
  7227. var x1 = coords1[0][0];
  7228. var y1 = coords1[0][1];
  7229. var x2 = coords1[1][0];
  7230. var y2 = coords1[1][1];
  7231. var x3 = coords2[0][0];
  7232. var y3 = coords2[0][1];
  7233. var x4 = coords2[1][0];
  7234. var y4 = coords2[1][1];
  7235. var denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);
  7236. var numeA = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3);
  7237. var numeB = (x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3);
  7238. if (denom === 0) {
  7239. if (numeA === 0 && numeB === 0) {
  7240. return null;
  7241. }
  7242. return null;
  7243. }
  7244. var uA = numeA / denom;
  7245. var uB = numeB / denom;
  7246. if (uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1) {
  7247. var x = x1 + uA * (x2 - x1);
  7248. var y = y1 + uA * (y2 - y1);
  7249. return point([x, y]);
  7250. }
  7251. return null;
  7252. }
  7253. function booleanPointOnLine(pt2, line, options2) {
  7254. if (options2 === void 0) {
  7255. options2 = {};
  7256. }
  7257. var ptCoords = getCoord(pt2);
  7258. var lineCoords = getCoords(line);
  7259. for (var i2 = 0; i2 < lineCoords.length - 1; i2++) {
  7260. var ignoreBoundary = false;
  7261. if (options2.ignoreEndVertices) {
  7262. if (i2 === 0) {
  7263. ignoreBoundary = "start";
  7264. }
  7265. if (i2 === lineCoords.length - 2) {
  7266. ignoreBoundary = "end";
  7267. }
  7268. if (i2 === 0 && i2 + 1 === lineCoords.length - 1) {
  7269. ignoreBoundary = "both";
  7270. }
  7271. }
  7272. if (isPointOnLineSegment$1(lineCoords[i2], lineCoords[i2 + 1], ptCoords, ignoreBoundary, typeof options2.epsilon === "undefined" ? null : options2.epsilon)) {
  7273. return true;
  7274. }
  7275. }
  7276. return false;
  7277. }
  7278. function isPointOnLineSegment$1(lineSegmentStart, lineSegmentEnd, pt2, excludeBoundary, epsilon) {
  7279. var x = pt2[0];
  7280. var y = pt2[1];
  7281. var x1 = lineSegmentStart[0];
  7282. var y1 = lineSegmentStart[1];
  7283. var x2 = lineSegmentEnd[0];
  7284. var y2 = lineSegmentEnd[1];
  7285. var dxc = pt2[0] - x1;
  7286. var dyc = pt2[1] - y1;
  7287. var dxl = x2 - x1;
  7288. var dyl = y2 - y1;
  7289. var cross2 = dxc * dyl - dyc * dxl;
  7290. if (epsilon !== null) {
  7291. if (Math.abs(cross2) > epsilon) {
  7292. return false;
  7293. }
  7294. } else if (cross2 !== 0) {
  7295. return false;
  7296. }
  7297. if (!excludeBoundary) {
  7298. if (Math.abs(dxl) >= Math.abs(dyl)) {
  7299. return dxl > 0 ? x1 <= x && x <= x2 : x2 <= x && x <= x1;
  7300. }
  7301. return dyl > 0 ? y1 <= y && y <= y2 : y2 <= y && y <= y1;
  7302. } else if (excludeBoundary === "start") {
  7303. if (Math.abs(dxl) >= Math.abs(dyl)) {
  7304. return dxl > 0 ? x1 < x && x <= x2 : x2 <= x && x < x1;
  7305. }
  7306. return dyl > 0 ? y1 < y && y <= y2 : y2 <= y && y < y1;
  7307. } else if (excludeBoundary === "end") {
  7308. if (Math.abs(dxl) >= Math.abs(dyl)) {
  7309. return dxl > 0 ? x1 <= x && x < x2 : x2 < x && x <= x1;
  7310. }
  7311. return dyl > 0 ? y1 <= y && y < y2 : y2 < y && y <= y1;
  7312. } else if (excludeBoundary === "both") {
  7313. if (Math.abs(dxl) >= Math.abs(dyl)) {
  7314. return dxl > 0 ? x1 < x && x < x2 : x2 < x && x < x1;
  7315. }
  7316. return dyl > 0 ? y1 < y && y < y2 : y2 < y && y < y1;
  7317. }
  7318. return false;
  7319. }
  7320. function booleanWithin(feature1, feature2) {
  7321. var geom1 = getGeom(feature1);
  7322. var geom2 = getGeom(feature2);
  7323. var type1 = geom1.type;
  7324. var type2 = geom2.type;
  7325. switch (type1) {
  7326. case "Point":
  7327. switch (type2) {
  7328. case "MultiPoint":
  7329. return isPointInMultiPoint(geom1, geom2);
  7330. case "LineString":
  7331. return booleanPointOnLine(geom1, geom2, { ignoreEndVertices: true });
  7332. case "Polygon":
  7333. case "MultiPolygon":
  7334. return booleanPointInPolygon(geom1, geom2, { ignoreBoundary: true });
  7335. default:
  7336. throw new Error("feature2 " + type2 + " geometry not supported");
  7337. }
  7338. case "MultiPoint":
  7339. switch (type2) {
  7340. case "MultiPoint":
  7341. return isMultiPointInMultiPoint(geom1, geom2);
  7342. case "LineString":
  7343. return isMultiPointOnLine(geom1, geom2);
  7344. case "Polygon":
  7345. case "MultiPolygon":
  7346. return isMultiPointInPoly(geom1, geom2);
  7347. default:
  7348. throw new Error("feature2 " + type2 + " geometry not supported");
  7349. }
  7350. case "LineString":
  7351. switch (type2) {
  7352. case "LineString":
  7353. return isLineOnLine$1(geom1, geom2);
  7354. case "Polygon":
  7355. case "MultiPolygon":
  7356. return isLineInPoly$1(geom1, geom2);
  7357. default:
  7358. throw new Error("feature2 " + type2 + " geometry not supported");
  7359. }
  7360. case "Polygon":
  7361. switch (type2) {
  7362. case "Polygon":
  7363. case "MultiPolygon":
  7364. return isPolyInPoly$1(geom1, geom2);
  7365. default:
  7366. throw new Error("feature2 " + type2 + " geometry not supported");
  7367. }
  7368. default:
  7369. throw new Error("feature1 " + type1 + " geometry not supported");
  7370. }
  7371. }
  7372. function isPointInMultiPoint(point2, multiPoint2) {
  7373. var i2;
  7374. var output = false;
  7375. for (i2 = 0; i2 < multiPoint2.coordinates.length; i2++) {
  7376. if (compareCoords$1(multiPoint2.coordinates[i2], point2.coordinates)) {
  7377. output = true;
  7378. break;
  7379. }
  7380. }
  7381. return output;
  7382. }
  7383. function isMultiPointInMultiPoint(multiPoint1, multiPoint2) {
  7384. for (var i2 = 0; i2 < multiPoint1.coordinates.length; i2++) {
  7385. var anyMatch = false;
  7386. for (var i22 = 0; i22 < multiPoint2.coordinates.length; i22++) {
  7387. if (compareCoords$1(multiPoint1.coordinates[i2], multiPoint2.coordinates[i22])) {
  7388. anyMatch = true;
  7389. }
  7390. }
  7391. if (!anyMatch) {
  7392. return false;
  7393. }
  7394. }
  7395. return true;
  7396. }
  7397. function isMultiPointOnLine(multiPoint2, lineString2) {
  7398. var foundInsidePoint = false;
  7399. for (var i2 = 0; i2 < multiPoint2.coordinates.length; i2++) {
  7400. if (!booleanPointOnLine(multiPoint2.coordinates[i2], lineString2)) {
  7401. return false;
  7402. }
  7403. if (!foundInsidePoint) {
  7404. foundInsidePoint = booleanPointOnLine(multiPoint2.coordinates[i2], lineString2, { ignoreEndVertices: true });
  7405. }
  7406. }
  7407. return foundInsidePoint;
  7408. }
  7409. function isMultiPointInPoly(multiPoint2, polygon2) {
  7410. var output = true;
  7411. var isInside = false;
  7412. for (var i2 = 0; i2 < multiPoint2.coordinates.length; i2++) {
  7413. isInside = booleanPointInPolygon(multiPoint2.coordinates[1], polygon2);
  7414. if (!isInside) {
  7415. output = false;
  7416. break;
  7417. }
  7418. {
  7419. isInside = booleanPointInPolygon(multiPoint2.coordinates[1], polygon2, {
  7420. ignoreBoundary: true
  7421. });
  7422. }
  7423. }
  7424. return output && isInside;
  7425. }
  7426. function isLineOnLine$1(lineString1, lineString2) {
  7427. for (var i2 = 0; i2 < lineString1.coordinates.length; i2++) {
  7428. if (!booleanPointOnLine(lineString1.coordinates[i2], lineString2)) {
  7429. return false;
  7430. }
  7431. }
  7432. return true;
  7433. }
  7434. function isLineInPoly$1(linestring, polygon2) {
  7435. var polyBbox = bbox$1(polygon2);
  7436. var lineBbox = bbox$1(linestring);
  7437. if (!doBBoxOverlap(polyBbox, lineBbox)) {
  7438. return false;
  7439. }
  7440. var foundInsidePoint = false;
  7441. for (var i2 = 0; i2 < linestring.coordinates.length - 1; i2++) {
  7442. if (!booleanPointInPolygon(linestring.coordinates[i2], polygon2)) {
  7443. return false;
  7444. }
  7445. if (!foundInsidePoint) {
  7446. foundInsidePoint = booleanPointInPolygon(linestring.coordinates[i2], polygon2, { ignoreBoundary: true });
  7447. }
  7448. if (!foundInsidePoint) {
  7449. var midpoint2 = getMidpoint(linestring.coordinates[i2], linestring.coordinates[i2 + 1]);
  7450. foundInsidePoint = booleanPointInPolygon(midpoint2, polygon2, {
  7451. ignoreBoundary: true
  7452. });
  7453. }
  7454. }
  7455. return foundInsidePoint;
  7456. }
  7457. function isPolyInPoly$1(geometry1, geometry2) {
  7458. var poly1Bbox = bbox$1(geometry1);
  7459. var poly2Bbox = bbox$1(geometry2);
  7460. if (!doBBoxOverlap(poly2Bbox, poly1Bbox)) {
  7461. return false;
  7462. }
  7463. for (var i2 = 0; i2 < geometry1.coordinates[0].length; i2++) {
  7464. if (!booleanPointInPolygon(geometry1.coordinates[0][i2], geometry2)) {
  7465. return false;
  7466. }
  7467. }
  7468. return true;
  7469. }
  7470. function doBBoxOverlap(bbox1, bbox2) {
  7471. if (bbox1[0] > bbox2[0])
  7472. return false;
  7473. if (bbox1[2] < bbox2[2])
  7474. return false;
  7475. if (bbox1[1] > bbox2[1])
  7476. return false;
  7477. if (bbox1[3] < bbox2[3])
  7478. return false;
  7479. return true;
  7480. }
  7481. function compareCoords$1(pair1, pair2) {
  7482. return pair1[0] === pair2[0] && pair1[1] === pair2[1];
  7483. }
  7484. function getMidpoint(pair1, pair2) {
  7485. return [(pair1[0] + pair2[0]) / 2, (pair1[1] + pair2[1]) / 2];
  7486. }
  7487. function pointGrid(bbox2, cellSide, options2) {
  7488. if (options2 === void 0) {
  7489. options2 = {};
  7490. }
  7491. if (options2.mask && !options2.units)
  7492. options2.units = "kilometers";
  7493. var results = [];
  7494. var west = bbox2[0];
  7495. var south = bbox2[1];
  7496. var east = bbox2[2];
  7497. var north = bbox2[3];
  7498. var xFraction = cellSide / distance([west, south], [east, south], options2);
  7499. var cellWidth = xFraction * (east - west);
  7500. var yFraction = cellSide / distance([west, south], [west, north], options2);
  7501. var cellHeight = yFraction * (north - south);
  7502. var bboxWidth = east - west;
  7503. var bboxHeight = north - south;
  7504. var columns = Math.floor(bboxWidth / cellWidth);
  7505. var rows = Math.floor(bboxHeight / cellHeight);
  7506. var deltaX = (bboxWidth - columns * cellWidth) / 2;
  7507. var deltaY = (bboxHeight - rows * cellHeight) / 2;
  7508. var currentX = west + deltaX;
  7509. while (currentX <= east) {
  7510. var currentY = south + deltaY;
  7511. while (currentY <= north) {
  7512. var cellPt = point([currentX, currentY], options2.properties);
  7513. if (options2.mask) {
  7514. if (booleanWithin(cellPt, options2.mask))
  7515. results.push(cellPt);
  7516. } else {
  7517. results.push(cellPt);
  7518. }
  7519. currentY += cellHeight;
  7520. }
  7521. currentX += cellWidth;
  7522. }
  7523. return featureCollection$1(results);
  7524. }
  7525. function polygonToLine(poly, options2) {
  7526. if (options2 === void 0) {
  7527. options2 = {};
  7528. }
  7529. var geom = getGeom(poly);
  7530. if (!options2.properties && poly.type === "Feature") {
  7531. options2.properties = poly.properties;
  7532. }
  7533. switch (geom.type) {
  7534. case "Polygon":
  7535. return polygonToLine$1(geom, options2);
  7536. case "MultiPolygon":
  7537. return multiPolygonToLine(geom, options2);
  7538. default:
  7539. throw new Error("invalid poly");
  7540. }
  7541. }
  7542. function polygonToLine$1(poly, options2) {
  7543. if (options2 === void 0) {
  7544. options2 = {};
  7545. }
  7546. var geom = getGeom(poly);
  7547. var coords = geom.coordinates;
  7548. var properties = options2.properties ? options2.properties : poly.type === "Feature" ? poly.properties : {};
  7549. return coordsToLine(coords, properties);
  7550. }
  7551. function multiPolygonToLine(multiPoly, options2) {
  7552. if (options2 === void 0) {
  7553. options2 = {};
  7554. }
  7555. var geom = getGeom(multiPoly);
  7556. var coords = geom.coordinates;
  7557. var properties = options2.properties ? options2.properties : multiPoly.type === "Feature" ? multiPoly.properties : {};
  7558. var lines = [];
  7559. coords.forEach(function(coord) {
  7560. lines.push(coordsToLine(coord, properties));
  7561. });
  7562. return featureCollection$1(lines);
  7563. }
  7564. function coordsToLine(coords, properties) {
  7565. if (coords.length > 1) {
  7566. return multiLineString(coords, properties);
  7567. }
  7568. return lineString(coords[0], properties);
  7569. }
  7570. function booleanClockwise(line) {
  7571. var ring = getCoords(line);
  7572. var sum = 0;
  7573. var i2 = 1;
  7574. var prev;
  7575. var cur;
  7576. while (i2 < ring.length) {
  7577. prev = cur || ring[0];
  7578. cur = ring[i2];
  7579. sum += (cur[0] - prev[0]) * (cur[1] + prev[1]);
  7580. i2++;
  7581. }
  7582. return sum > 0;
  7583. }
  7584. function booleanDisjoint(feature1, feature2) {
  7585. var bool = true;
  7586. flattenEach(feature1, function(flatten1) {
  7587. flattenEach(feature2, function(flatten22) {
  7588. if (bool === false) {
  7589. return false;
  7590. }
  7591. bool = disjoint(flatten1.geometry, flatten22.geometry);
  7592. });
  7593. });
  7594. return bool;
  7595. }
  7596. function disjoint(geom1, geom2) {
  7597. switch (geom1.type) {
  7598. case "Point":
  7599. switch (geom2.type) {
  7600. case "Point":
  7601. return !compareCoords(geom1.coordinates, geom2.coordinates);
  7602. case "LineString":
  7603. return !isPointOnLine(geom2, geom1);
  7604. case "Polygon":
  7605. return !booleanPointInPolygon(geom1, geom2);
  7606. }
  7607. break;
  7608. case "LineString":
  7609. switch (geom2.type) {
  7610. case "Point":
  7611. return !isPointOnLine(geom1, geom2);
  7612. case "LineString":
  7613. return !isLineOnLine(geom1, geom2);
  7614. case "Polygon":
  7615. return !isLineInPoly(geom2, geom1);
  7616. }
  7617. break;
  7618. case "Polygon":
  7619. switch (geom2.type) {
  7620. case "Point":
  7621. return !booleanPointInPolygon(geom2, geom1);
  7622. case "LineString":
  7623. return !isLineInPoly(geom1, geom2);
  7624. case "Polygon":
  7625. return !isPolyInPoly(geom2, geom1);
  7626. }
  7627. }
  7628. return false;
  7629. }
  7630. function isPointOnLine(lineString2, pt2) {
  7631. for (var i2 = 0; i2 < lineString2.coordinates.length - 1; i2++) {
  7632. if (isPointOnLineSegment(lineString2.coordinates[i2], lineString2.coordinates[i2 + 1], pt2.coordinates)) {
  7633. return true;
  7634. }
  7635. }
  7636. return false;
  7637. }
  7638. function isLineOnLine(lineString1, lineString2) {
  7639. var doLinesIntersect = lineIntersect(lineString1, lineString2);
  7640. if (doLinesIntersect.features.length > 0) {
  7641. return true;
  7642. }
  7643. return false;
  7644. }
  7645. function isLineInPoly(polygon2, lineString2) {
  7646. for (var _i = 0, _a2 = lineString2.coordinates; _i < _a2.length; _i++) {
  7647. var coord = _a2[_i];
  7648. if (booleanPointInPolygon(coord, polygon2)) {
  7649. return true;
  7650. }
  7651. }
  7652. var doLinesIntersect = lineIntersect(lineString2, polygonToLine(polygon2));
  7653. if (doLinesIntersect.features.length > 0) {
  7654. return true;
  7655. }
  7656. return false;
  7657. }
  7658. function isPolyInPoly(feature1, feature2) {
  7659. for (var _i = 0, _a2 = feature1.coordinates[0]; _i < _a2.length; _i++) {
  7660. var coord1 = _a2[_i];
  7661. if (booleanPointInPolygon(coord1, feature2)) {
  7662. return true;
  7663. }
  7664. }
  7665. for (var _b = 0, _c = feature2.coordinates[0]; _b < _c.length; _b++) {
  7666. var coord2 = _c[_b];
  7667. if (booleanPointInPolygon(coord2, feature1)) {
  7668. return true;
  7669. }
  7670. }
  7671. var doLinesIntersect = lineIntersect(polygonToLine(feature1), polygonToLine(feature2));
  7672. if (doLinesIntersect.features.length > 0) {
  7673. return true;
  7674. }
  7675. return false;
  7676. }
  7677. function isPointOnLineSegment(lineSegmentStart, lineSegmentEnd, pt2) {
  7678. var dxc = pt2[0] - lineSegmentStart[0];
  7679. var dyc = pt2[1] - lineSegmentStart[1];
  7680. var dxl = lineSegmentEnd[0] - lineSegmentStart[0];
  7681. var dyl = lineSegmentEnd[1] - lineSegmentStart[1];
  7682. var cross2 = dxc * dyl - dyc * dxl;
  7683. if (cross2 !== 0) {
  7684. return false;
  7685. }
  7686. if (Math.abs(dxl) >= Math.abs(dyl)) {
  7687. if (dxl > 0) {
  7688. return lineSegmentStart[0] <= pt2[0] && pt2[0] <= lineSegmentEnd[0];
  7689. } else {
  7690. return lineSegmentEnd[0] <= pt2[0] && pt2[0] <= lineSegmentStart[0];
  7691. }
  7692. } else if (dyl > 0) {
  7693. return lineSegmentStart[1] <= pt2[1] && pt2[1] <= lineSegmentEnd[1];
  7694. } else {
  7695. return lineSegmentEnd[1] <= pt2[1] && pt2[1] <= lineSegmentStart[1];
  7696. }
  7697. }
  7698. function compareCoords(pair1, pair2) {
  7699. return pair1[0] === pair2[0] && pair1[1] === pair2[1];
  7700. }
  7701. function booleanIntersects(feature1, feature2) {
  7702. var bool = false;
  7703. flattenEach(feature1, function(flatten1) {
  7704. flattenEach(feature2, function(flatten22) {
  7705. if (bool === true) {
  7706. return true;
  7707. }
  7708. bool = !booleanDisjoint(flatten1.geometry, flatten22.geometry);
  7709. });
  7710. });
  7711. return bool;
  7712. }
  7713. function rectangleGrid(bbox2, cellWidth, cellHeight, options2) {
  7714. if (options2 === void 0) {
  7715. options2 = {};
  7716. }
  7717. var results = [];
  7718. var west = bbox2[0];
  7719. var south = bbox2[1];
  7720. var east = bbox2[2];
  7721. var north = bbox2[3];
  7722. var xFraction = cellWidth / distance([west, south], [east, south], options2);
  7723. var cellWidthDeg = xFraction * (east - west);
  7724. var yFraction = cellHeight / distance([west, south], [west, north], options2);
  7725. var cellHeightDeg = yFraction * (north - south);
  7726. var bboxWidth = east - west;
  7727. var bboxHeight = north - south;
  7728. var columns = Math.floor(bboxWidth / cellWidthDeg);
  7729. var rows = Math.floor(bboxHeight / cellHeightDeg);
  7730. var deltaX = (bboxWidth - columns * cellWidthDeg) / 2;
  7731. var deltaY = (bboxHeight - rows * cellHeightDeg) / 2;
  7732. var currentX = west + deltaX;
  7733. for (var column = 0; column < columns; column++) {
  7734. var currentY = south + deltaY;
  7735. for (var row = 0; row < rows; row++) {
  7736. var cellPoly = polygon([
  7737. [
  7738. [currentX, currentY],
  7739. [currentX, currentY + cellHeightDeg],
  7740. [currentX + cellWidthDeg, currentY + cellHeightDeg],
  7741. [currentX + cellWidthDeg, currentY],
  7742. [currentX, currentY]
  7743. ]
  7744. ], options2.properties);
  7745. if (options2.mask) {
  7746. if (booleanIntersects(options2.mask, cellPoly)) {
  7747. results.push(cellPoly);
  7748. }
  7749. } else {
  7750. results.push(cellPoly);
  7751. }
  7752. currentY += cellHeightDeg;
  7753. }
  7754. currentX += cellWidthDeg;
  7755. }
  7756. return featureCollection$1(results);
  7757. }
  7758. function squareGrid(bbox2, cellSide, options2) {
  7759. if (options2 === void 0) {
  7760. options2 = {};
  7761. }
  7762. return rectangleGrid(bbox2, cellSide, cellSide, options2);
  7763. }
  7764. class ViewShed {
  7765. constructor(viewer2) {
  7766. if (!viewer2)
  7767. throw new Cesium.DeveloperError("no viewer object!");
  7768. this.viewer = viewer2;
  7769. this.handler = void 0;
  7770. this.lightCamera;
  7771. this.pyramid;
  7772. this.frustumPrimitive;
  7773. this.viewershedPolygon;
  7774. }
  7775. initHandler() {
  7776. if (this.handler) {
  7777. this.handler.destroy();
  7778. this.handler = void 0;
  7779. }
  7780. let canvas = document.getElementById("canvasMap");
  7781. if (canvas == null) {
  7782. canvas = document.createElement("canvas");
  7783. canvas.id = "canvasMap";
  7784. canvas.style.display = "none";
  7785. canvas.style.top = "0px";
  7786. canvas.style.position = "absolute";
  7787. document.body.append(canvas);
  7788. }
  7789. this.canvasEle = canvas;
  7790. }
  7791. ReturnDistance(pos0, pos1) {
  7792. let point1cartographic = Cesium.Cartographic.fromCartesian(pos0);
  7793. let point2cartographic = Cesium.Cartographic.fromCartesian(pos1);
  7794. let geodesic = new Cesium.EllipsoidGeodesic();
  7795. geodesic.setEndPoints(point1cartographic, point2cartographic);
  7796. let s = geodesic.surfaceDistance;
  7797. return s;
  7798. }
  7799. getHeight(x, y, objectsToExclude) {
  7800. let endCartographic = Cesium.Cartographic.fromDegrees(x, y);
  7801. let endHeight = this.viewer.scene.sampleHeight(
  7802. endCartographic,
  7803. objectsToExclude
  7804. );
  7805. return endHeight;
  7806. }
  7807. cartesian3ToDegree(Cartesian32) {
  7808. let _ellipsoid = this.viewer.scene.globe.ellipsoid;
  7809. let _cartographic = _ellipsoid.cartesianToCartographic(Cartesian32);
  7810. let _lat = Cesium.Math.toDegrees(_cartographic.latitude);
  7811. let _lng = Cesium.Math.toDegrees(_cartographic.longitude);
  7812. let _alt = _cartographic.height;
  7813. return [_lng, _lat, _alt];
  7814. }
  7815. getAngle(lng1, lat1, lng2, lat2) {
  7816. let dRotateAngle = Math.atan2(Math.abs(lng1 - lng2), Math.abs(lat1 - lat2));
  7817. if (lng2 >= lng1) {
  7818. dRotateAngle = lat2 < lat1 ? Math.PI - dRotateAngle : dRotateAngle;
  7819. } else {
  7820. dRotateAngle = lat2 >= lat1 ? 2 * Math.PI - dRotateAngle : Math.PI + dRotateAngle;
  7821. }
  7822. dRotateAngle = dRotateAngle * 180 / Math.PI;
  7823. return dRotateAngle;
  7824. }
  7825. getPitch(pointA, pointB) {
  7826. let transfrom = Cesium.Transforms.eastNorthUpToFixedFrame(pointA);
  7827. const vector = Cesium.Cartesian3.subtract(
  7828. pointB,
  7829. pointA,
  7830. new Cesium.Cartesian3()
  7831. );
  7832. let direction = Cesium.Matrix4.multiplyByPointAsVector(
  7833. Cesium.Matrix4.inverse(transfrom, transfrom),
  7834. vector,
  7835. vector
  7836. );
  7837. Cesium.Cartesian3.normalize(direction, direction);
  7838. return Cesium.Math.PI_OVER_TWO - Cesium.Math.acosClamped(direction.z);
  7839. }
  7840. updateViewShed() {
  7841. this.clear();
  7842. this.setLightCamera();
  7843. this.addVisualPyramid();
  7844. this.createFrustum();
  7845. }
  7846. clear() {
  7847. if (this.pyramid) {
  7848. this.viewer.entities.removeById(this.pyramid.id);
  7849. this.pyramid = void 0;
  7850. }
  7851. if (this.frustumPrimitive) {
  7852. this.viewer.scene.primitives.remove(this.frustumPrimitive);
  7853. this.frustumPrimitive = void 0;
  7854. }
  7855. if (this.debugModelMatrixPrimitive) {
  7856. this.viewer.scene.primitives.remove(this.debugModelMatrixPrimitive);
  7857. this.debugModelMatrixPrimitive = void 0;
  7858. }
  7859. }
  7860. addVisualPyramid() {
  7861. let options2 = this.ViewShedOptions;
  7862. let position2 = options2.viewPosition;
  7863. let visualRange = Number(options2.visualRange);
  7864. let transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(position2);
  7865. this.debugModelMatrixPrimitive = this.viewer.scene.primitives.add(
  7866. new Cesium.DebugModelMatrixPrimitive({
  7867. modelMatrix: transform3,
  7868. length: 5
  7869. })
  7870. );
  7871. const halfClock = options2.horizontalViewAngle / 2;
  7872. const halfCone = options2.verticalViewAngle / 2;
  7873. const pitch = Cesium.Math.toDegrees(options2.pitch);
  7874. const ellipsoid = new Cesium.EllipsoidGraphics({
  7875. radii: new Cesium.Cartesian3(visualRange, visualRange, visualRange),
  7876. minimumClock: Cesium.Math.toRadians(90 - options2.direction - halfClock),
  7877. maximumClock: Cesium.Math.toRadians(90 - options2.direction + halfClock),
  7878. minimumCone: Cesium.Math.toRadians(90 - pitch - halfCone),
  7879. maximumCone: Cesium.Math.toRadians(90 - pitch + halfCone),
  7880. fill: false,
  7881. outline: true,
  7882. subdivisions: 256,
  7883. stackPartitions: 64,
  7884. slicePartitions: 64,
  7885. outlineColor: Cesium.Color.YELLOWGREEN.withAlpha(0.5)
  7886. });
  7887. const pyramidEntity = new Cesium.Entity({
  7888. position: position2,
  7889. ellipsoid
  7890. });
  7891. this.pyramid = this.viewer.entities.add(pyramidEntity);
  7892. }
  7893. setLightCamera() {
  7894. if (!this.lightCamera) {
  7895. this.lightCamera = new Cesium.Camera(this.viewer.scene);
  7896. }
  7897. let options2 = this.ViewShedOptions;
  7898. let visualRange = Number(options2.visualRange);
  7899. this.lightCamera.position = options2.viewPosition;
  7900. this.lightCamera.frustum.near = 0.1;
  7901. this.lightCamera.frustum.far = visualRange;
  7902. const hr = Cesium.Math.toRadians(options2.horizontalViewAngle);
  7903. const vr = Cesium.Math.toRadians(options2.verticalViewAngle);
  7904. this.lightCamera.frustum.aspectRatio = visualRange * Math.tan(hr / 2) * 2 / (visualRange * Math.tan(vr / 2) * 2);
  7905. this.lightCamera.frustum.fov = hr > vr ? hr : vr;
  7906. this.lightCamera.setView({
  7907. destination: options2.viewPosition,
  7908. orientation: {
  7909. heading: Cesium.Math.toRadians(options2.direction || 0),
  7910. pitch: options2.pitch || 0,
  7911. roll: 0
  7912. }
  7913. });
  7914. }
  7915. createFrustum() {
  7916. const scratchRight = new Cesium.Cartesian3();
  7917. const scratchRotation = new Cesium.Matrix3();
  7918. const scratchOrientation = new Cesium.Quaternion();
  7919. const direction = this.lightCamera.directionWC;
  7920. const up = this.lightCamera.upWC;
  7921. let right = this.lightCamera.rightWC;
  7922. right = Cesium.Cartesian3.negate(right, scratchRight);
  7923. let rotation = scratchRotation;
  7924. Cesium.Matrix3.setColumn(rotation, 0, right, rotation);
  7925. Cesium.Matrix3.setColumn(rotation, 1, up, rotation);
  7926. Cesium.Matrix3.setColumn(rotation, 2, direction, rotation);
  7927. let orientation = Cesium.Quaternion.fromRotationMatrix(
  7928. rotation,
  7929. scratchOrientation
  7930. );
  7931. let instanceOutline = new Cesium.GeometryInstance({
  7932. geometry: new Cesium.FrustumOutlineGeometry({
  7933. frustum: this.lightCamera.frustum,
  7934. origin: this.ViewShedOptions.viewPosition,
  7935. orientation
  7936. }),
  7937. id: "\u89C6\u690E\u4F53\u8F6E\u5ED3\u7EBF" + Math.random().toString(36).substr(2),
  7938. attributes: {
  7939. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  7940. new Cesium.Color(0, 1, 0, 1)
  7941. ),
  7942. show: new Cesium.ShowGeometryInstanceAttribute(true)
  7943. }
  7944. });
  7945. this.frustumPrimitive = this.viewer.scene.primitives.add(
  7946. new Cesium.Primitive({
  7947. geometryInstances: instanceOutline,
  7948. appearance: new Cesium.PerInstanceColorAppearance({
  7949. flat: true,
  7950. translucent: false,
  7951. closed: true
  7952. })
  7953. })
  7954. );
  7955. }
  7956. addViewershedPolygon(positionArr) {
  7957. let polygon2 = new Cesium.PolygonGeometry({
  7958. polygonHierarchy: new Cesium.PolygonHierarchy(
  7959. Cesium.Cartesian3.fromDegreesArray(positionArr)
  7960. ),
  7961. height: 0,
  7962. extrudedHeight: 0,
  7963. vertexFormat: Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,
  7964. stRotation: 0,
  7965. ellipsoid: Cesium.Ellipsoid.WGS84,
  7966. granularity: Cesium.Math.RADIANS_PER_DEGREE,
  7967. perPositionHeight: false,
  7968. closeTop: true,
  7969. closeBottom: true,
  7970. arcType: Cesium.ArcType.GEODESIC
  7971. });
  7972. let polygonInstance = new Cesium.GeometryInstance({
  7973. geometry: polygon2,
  7974. name: "ViewershedPolygon",
  7975. attributes: {
  7976. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  7977. Cesium.Color.BLUE.withAlpha(0.6)
  7978. ),
  7979. show: new Cesium.ShowGeometryInstanceAttribute(true)
  7980. }
  7981. });
  7982. this.viewershedPolygon = this.viewer.scene.primitives.add(
  7983. new Cesium.GroundPrimitive({
  7984. geometryInstances: polygonInstance,
  7985. appearance: new Cesium.EllipsoidSurfaceAppearance({
  7986. aboveGround: true,
  7987. material: new Cesium.Material({
  7988. fabric: {
  7989. type: "Image",
  7990. uniforms: {
  7991. image: this.returnImgae()
  7992. }
  7993. }
  7994. })
  7995. })
  7996. })
  7997. );
  7998. }
  7999. drawViewershed(precision) {
  8000. const pos = this.cartesian3ToDegree(this.ViewShedOptions.viewPosition);
  8001. const radius = this.ViewShedOptions.visualRange;
  8002. const direction = this.ViewShedOptions.direction;
  8003. let boundary = this.computeBoundaryOptions(pos, radius, direction);
  8004. const bbox2 = boundary.bbox;
  8005. let mask = polygon([boundary.boundaryPoints]);
  8006. const dis = this.ViewShedOptions.visualRange / (precision * 1e3);
  8007. let gridPoints = pointGrid(bbox2, dis, {
  8008. mask
  8009. });
  8010. console.log(this.ViewShedOptions.visualRange, precision, dis);
  8011. let pointsResult = this.createTargetPoints(gridPoints, dis, pos);
  8012. let variogram = index.train(
  8013. pointsResult.values,
  8014. pointsResult.lngs,
  8015. pointsResult.lats,
  8016. "exponential",
  8017. 0,
  8018. 100
  8019. );
  8020. let grid2 = index.grid([boundary.boundaryPoints], variogram, dis / 1e3);
  8021. const colors = [
  8022. "#ff000080",
  8023. "#ff000080",
  8024. "#ff000080",
  8025. "#ff000080",
  8026. "#ff000080",
  8027. "#ff000080",
  8028. "#00ff0080",
  8029. "#00ff0080",
  8030. "#00ff0080",
  8031. "#00ff0080",
  8032. "#00ff0080",
  8033. "#00ff0080"
  8034. ];
  8035. this.canvasEle.width = 3840;
  8036. this.canvasEle.height = 2160;
  8037. index.plot(
  8038. this.canvasEle,
  8039. grid2,
  8040. [bbox2[0], bbox2[2]],
  8041. [bbox2[1], bbox2[3]],
  8042. colors
  8043. );
  8044. this.addViewershedPolygon(boundary.positionArr);
  8045. }
  8046. computeBoundaryOptions(pos, radius, angle) {
  8047. let Ea = 6378137;
  8048. let Eb = 6356725;
  8049. const lng = pos[0], lat = pos[1];
  8050. const bbox2 = [lng, lat, lng, lat];
  8051. let positionArr = [];
  8052. let boundaryPoints = [];
  8053. positionArr.push(lng, lat);
  8054. boundaryPoints.push([lng, lat]);
  8055. let start2 = angle + 45 > 360 ? angle - 45 - 360 : angle - 45;
  8056. let end = start2 + 90;
  8057. for (let i2 = start2; i2 <= end; i2++) {
  8058. let dx = radius * Math.sin(i2 * Math.PI / 180);
  8059. let dy = radius * Math.cos(i2 * Math.PI / 180);
  8060. let ec = Eb + (Ea - Eb) * (90 - lat) / 90;
  8061. let ed = ec * Math.cos(lat * Math.PI / 180);
  8062. let BJD = lng + dx / ed * 180 / Math.PI;
  8063. let BWD = lat + dy / ec * 180 / Math.PI;
  8064. positionArr.push(BJD, BWD);
  8065. boundaryPoints.push([BJD, BWD]);
  8066. this.refreshBBox(bbox2, BJD, BWD);
  8067. }
  8068. boundaryPoints.push([lng, lat]);
  8069. return {
  8070. positionArr,
  8071. boundaryPoints,
  8072. bbox: bbox2
  8073. };
  8074. }
  8075. refreshBBox(result, x, y) {
  8076. result[0] = x < result[0] ? x : result[0];
  8077. result[1] = y < result[1] ? y : result[1];
  8078. result[2] = x > result[2] ? x : result[2];
  8079. result[3] = y > result[3] ? y : result[3];
  8080. }
  8081. createTargetPoints(gridPoints, step, sourcePos) {
  8082. let positionArr = [];
  8083. let objectsToExclude = [
  8084. this.frustumPrimitive,
  8085. this.pyramid,
  8086. this.debugModelMatrixPrimitive
  8087. ];
  8088. let values3 = [], lngs = [], lats = [];
  8089. let height2 = this.getHeight(sourcePos[0], sourcePos[1], objectsToExclude);
  8090. positionArr.push({
  8091. x: sourcePos[0],
  8092. y: sourcePos[1],
  8093. z: height2
  8094. });
  8095. let viewPoint = this.ViewShedOptions.viewPosition;
  8096. for (let index2 = 0; index2 < gridPoints.features.length; index2++) {
  8097. const feature2 = gridPoints.features[index2];
  8098. const coords = feature2.geometry.coordinates;
  8099. const x = coords[0], y = coords[1];
  8100. let h2 = this.getHeight(x, y, objectsToExclude);
  8101. let endPoint = Cesium.Cartesian3.fromDegrees(x, y, h2);
  8102. let direction = Cesium.Cartesian3.normalize(
  8103. Cesium.Cartesian3.subtract(
  8104. endPoint,
  8105. viewPoint,
  8106. new Cesium.Cartesian3()
  8107. ),
  8108. new Cesium.Cartesian3()
  8109. );
  8110. let ray = new Cesium.Ray(viewPoint, direction);
  8111. let result = this.viewer.scene.pickFromRay(ray, objectsToExclude);
  8112. if (result) {
  8113. let buffer = this.ReturnDistance(endPoint, result.position);
  8114. if (buffer > step) {
  8115. values3.push(0);
  8116. } else {
  8117. values3.push(1);
  8118. }
  8119. lngs.push(x);
  8120. lats.push(y);
  8121. }
  8122. }
  8123. return {
  8124. values: values3,
  8125. lngs,
  8126. lats
  8127. };
  8128. }
  8129. returnImgae() {
  8130. return this.canvasEle.toDataURL("image/png");
  8131. }
  8132. }
  8133. Object.assign(ViewShed.prototype, {
  8134. createViewshed: function(precision) {
  8135. let _self = this;
  8136. let scene = _self.viewer.scene;
  8137. _self.initHandler();
  8138. _self.clearAll();
  8139. let count = 0;
  8140. let toolTip = "\u5DE6\u952E\u70B9\u51FB\u521B\u5EFA\u8D77\u70B9";
  8141. _self.handler = new Cesium.ScreenSpaceEventHandler(_self.viewer.canvas);
  8142. _self.handler.setInputAction((event2) => {
  8143. count++;
  8144. if (count === 1) {
  8145. toolTip = "\u5DE6\u952E\u70B9\u51FB\u521B\u5EFA\u7EC8\u70B9";
  8146. let earthPosition = scene.pickPosition(event2.position);
  8147. let pos = _self.cartesian3ToDegree(earthPosition);
  8148. _self.handler.setInputAction(function(move) {
  8149. CreateRemindertip(toolTip, move.endPosition, true);
  8150. let newPosition = scene.pickPosition(move.endPosition);
  8151. if (Cesium.defined(newPosition)) {
  8152. let pos1 = _self.cartesian3ToDegree(newPosition);
  8153. let distance2 = Cesium.Cartesian3.distance(newPosition, earthPosition);
  8154. let angle = _self.getAngle(pos[0], pos[1], pos1[0], pos1[1]);
  8155. let pitch = _self.getPitch(earthPosition, newPosition);
  8156. _self.ViewShedOptions = {
  8157. viewPosition: earthPosition,
  8158. endPosition: newPosition,
  8159. direction: angle,
  8160. pitch,
  8161. horizontalViewAngle: 90,
  8162. verticalViewAngle: 60,
  8163. visibleAreaColor: Cesium.Color.GREEN,
  8164. invisibleAreaColor: Cesium.Color.RED,
  8165. visualRange: distance2
  8166. };
  8167. _self.updateViewShed();
  8168. }
  8169. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  8170. }
  8171. if (count === 2) {
  8172. _self.initHandler();
  8173. _self.drawViewershed(precision);
  8174. CreateRemindertip(toolTip, event2.endPosition, false);
  8175. }
  8176. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  8177. _self.handler.setInputAction(function(move) {
  8178. CreateRemindertip(toolTip, move.endPosition, true);
  8179. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  8180. },
  8181. clearAll: function() {
  8182. this.clear();
  8183. if (this.viewershedPolygon) {
  8184. this.viewer.scene.primitives.remove(this.viewershedPolygon);
  8185. this.viewershedPolygon = void 0;
  8186. }
  8187. }
  8188. });
  8189. class SunshineShadow {
  8190. constructor(viewer2) {
  8191. if (!viewer2)
  8192. throw new Cesium.DeveloperError("no viewer object!");
  8193. this._viewer = viewer2;
  8194. this._stopTime = null;
  8195. }
  8196. }
  8197. Object.assign(SunshineShadow.prototype, {
  8198. startSunShine(options2) {
  8199. options2 = options2 || {};
  8200. if (!Cesium.defined(options2.startTime)) {
  8201. options2.startTime = new Date().getTime();
  8202. }
  8203. if (!Cesium.defined(options2.stopTime)) {
  8204. options2.stopTime = new Date().getTime() + 1e3;
  8205. }
  8206. if (!Cesium.defined(options2.speed)) {
  8207. options2.speed = 1600;
  8208. }
  8209. if (this._stopTime) {
  8210. this._viewer.clock.shouldAnimate = true;
  8211. this._viewer.clock.currentTime = this._stopTime;
  8212. } else {
  8213. this._viewer.scene.globe.enableLighting = true;
  8214. this._viewer.shadows = true;
  8215. this._viewer.clock.startTime = Cesium.JulianDate.fromDate(new Date(options2.startTime));
  8216. this._viewer.clock.currentTime = Cesium.JulianDate.fromDate(new Date(options2.startTime));
  8217. this._viewer.clock.stopTime = Cesium.JulianDate.fromDate(new Date(options2.stopTime));
  8218. console.log(this._viewer.clock.currentTime);
  8219. this._viewer.clock.clockRange = Cesium.ClockRange.LOOP_STOP;
  8220. this._viewer.clock.clockStep = Cesium.ClockStep.SYSTEM_CLOCK_MULTIPLIER;
  8221. this._viewer.clock.multiplier = options2.speed;
  8222. this._viewer.clock.canAnimate = true;
  8223. this._viewer.clock.shouldAnimate = true;
  8224. }
  8225. },
  8226. stopSunShine() {
  8227. this._stopTime = this._viewer.clock.currentTime;
  8228. console.log(this._viewer.clock.currentTime);
  8229. this._viewer.clock.shouldAnimate = false;
  8230. },
  8231. removeSunShine() {
  8232. if (this._stopTime) {
  8233. this._viewer.clock.shouldAnimate = true;
  8234. this._viewer.clock.currentTime = this._stopTime;
  8235. console.log(this._viewer.clock.currentTime);
  8236. }
  8237. this._viewer.scene.globe.enableLighting = false;
  8238. this._viewer.shadows = false;
  8239. this._stopTime = null;
  8240. }
  8241. });
  8242. Object.assign(SunshineShadow.prototype, {
  8243. start(options2) {
  8244. if (document.getElementsByClassName("cesium-viewer-animationContainer").length > 0) {
  8245. document.getElementsByClassName("cesium-viewer-animationContainer")[0].style.display = "block";
  8246. }
  8247. if (document.getElementsByClassName("cesium-viewer-timelineContainer").length > 0) {
  8248. document.getElementsByClassName("cesium-viewer-timelineContainer")[0].style.display = "block";
  8249. }
  8250. this._viewer.shadows = true;
  8251. options2 = options2 || {};
  8252. if (!Cesium.defined(options2.startTime)) {
  8253. options2.startTime = new Date(new Date().toLocaleDateString()).getTime();
  8254. console.log("\u5F53\u5929\u51CC\u66680\u70B9", new Date(new Date().toLocaleDateString()));
  8255. }
  8256. if (!Cesium.defined(options2.stopTime)) {
  8257. options2.stopTime = new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1e3 - 1;
  8258. console.log("\u5F53\u592923\u70B959\u520659\u79D2", new Date(new Date(new Date().toLocaleDateString()).getTime() + 4 * 60 * 60 * 1e3));
  8259. }
  8260. if (!Cesium.defined(options2.speed)) {
  8261. options2.speed = 1600;
  8262. }
  8263. let start2 = Cesium.JulianDate.fromDate(new Date(options2.startTime));
  8264. let stop = Cesium.JulianDate.fromDate(new Date(options2.stopTime));
  8265. viewer.timeline.zoomTo(start2, stop);
  8266. let clock2 = viewer.clock;
  8267. clock2.shouldAnimate = false;
  8268. clock2.startTime = start2;
  8269. clock2.stopTime = stop;
  8270. clock2.currentTime = start2;
  8271. clock2.clockRange = Cesium.ClockRange.UNBOUNDED;
  8272. clock2.multiplier = options2.speed;
  8273. },
  8274. remove() {
  8275. if (document.getElementsByClassName("cesium-viewer-animationContainer").length > 0) {
  8276. document.getElementsByClassName("cesium-viewer-animationContainer")[0].style.display = "none";
  8277. }
  8278. if (document.getElementsByClassName("cesium-viewer-timelineContainer").length > 0) {
  8279. document.getElementsByClassName("cesium-viewer-timelineContainer")[0].style.display = "none";
  8280. }
  8281. this._viewer.shadows = false;
  8282. this._viewer.clock.currentTime = Cesium.JulianDate.fromDate(new Date(new Date().getTime()));
  8283. this._viewer.clock.shouldAnimate = false;
  8284. }
  8285. });
  8286. class Profile {
  8287. constructor(viewer2) {
  8288. if (!viewer2)
  8289. throw new Cesium.DeveloperError("no viewer object!");
  8290. this._viewer = viewer2;
  8291. this._profileEntities = [];
  8292. }
  8293. _interPoints(positions, objectsToExclude) {
  8294. let positionsCartographic = [];
  8295. let terrainSamplePositions = [];
  8296. for (let index2 = 0; index2 < positions.length; index2++) {
  8297. const element = positions[index2];
  8298. let ellipsoid = this._viewer.scene.globe.ellipsoid;
  8299. let cartographic = ellipsoid.cartesianToCartographic(element);
  8300. positionsCartographic.push(cartographic);
  8301. }
  8302. for (let i2 = 0; i2 < positionsCartographic.length; i2++) {
  8303. const m_Cartographic0 = positionsCartographic[i2];
  8304. const m_Cartographic1 = positionsCartographic[i2 + 1];
  8305. if (m_Cartographic1) {
  8306. let a = Math.abs(m_Cartographic0.longitude - m_Cartographic1.longitude) * 1e7;
  8307. let b = Math.abs(m_Cartographic0.latitude - m_Cartographic1.latitude) * 1e7;
  8308. if (a > b)
  8309. b = a;
  8310. let length = parseInt(b / 2);
  8311. if (length > 1e3)
  8312. length = 1e3;
  8313. if (length < 2)
  8314. length = 2;
  8315. for (let j = 0; j < length; j++) {
  8316. terrainSamplePositions.push(
  8317. new Cesium.Cartographic(
  8318. Cesium.Math.lerp(
  8319. m_Cartographic0.longitude,
  8320. m_Cartographic1.longitude,
  8321. j / (length - 1)
  8322. ),
  8323. Cesium.Math.lerp(
  8324. m_Cartographic0.latitude,
  8325. m_Cartographic1.latitude,
  8326. j / (length - 1)
  8327. )
  8328. )
  8329. );
  8330. }
  8331. terrainSamplePositions.pop();
  8332. } else {
  8333. terrainSamplePositions.push(m_Cartographic0);
  8334. }
  8335. }
  8336. let positions_Inter = [];
  8337. let distance2 = 0;
  8338. for (let n = 0; n < terrainSamplePositions.length; n++) {
  8339. let curCartographic = terrainSamplePositions[n];
  8340. let height2 = this._viewer.scene.sampleHeight(curCartographic, objectsToExclude);
  8341. const lon = curCartographic.longitude / Math.PI * 180;
  8342. const lat = curCartographic.latitude / Math.PI * 180;
  8343. let point2 = Cesium.Cartesian3.fromDegrees(lon, lat, height2);
  8344. let preCartographic = terrainSamplePositions[n - 1];
  8345. if (preCartographic) {
  8346. const lon1 = preCartographic.longitude / Math.PI * 180;
  8347. const lat1 = preCartographic.latitude / Math.PI * 180;
  8348. let point1 = Cesium.Cartesian3.fromDegrees(lon1, lat1, height2);
  8349. let curDis = Cesium.Cartesian3.distance(point1, point2);
  8350. distance2 += curDis;
  8351. }
  8352. positions_Inter.push({
  8353. position: {
  8354. lon,
  8355. lat,
  8356. height: height2
  8357. },
  8358. distance: distance2
  8359. });
  8360. }
  8361. return positions_Inter;
  8362. }
  8363. }
  8364. Object.assign(Profile.prototype, {
  8365. startProfileAnalysis(points2, entity) {
  8366. return new Promise((resolve2, reject2) => {
  8367. let _self = this;
  8368. let positions = points2.map((point2) => {
  8369. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  8370. });
  8371. _self.removeProfileAnalysis();
  8372. entity.clampToGround = true;
  8373. console.log(positions);
  8374. let pointsList = _self._interPoints(positions, [entity]);
  8375. console.log(pointsList);
  8376. resolve2(pointsList);
  8377. });
  8378. },
  8379. removeProfileAnalysis() {
  8380. let _self = this;
  8381. if (_self._profileEntities && _self._profileEntities.length > 0) {
  8382. _self._profileEntities.forEach((element) => {
  8383. _self._viewer.entities.remove(element);
  8384. });
  8385. }
  8386. _self._profileEntities = [];
  8387. }
  8388. });
  8389. class CutFill {
  8390. constructor(viewer2) {
  8391. if (!viewer2)
  8392. throw new Cesium.DeveloperError("no viewer object!");
  8393. this._viewer = viewer2;
  8394. this.delEntitys = [];
  8395. this.maxHeigh = -1e6;
  8396. }
  8397. _VolumeAnalysis(options2) {
  8398. let _self = this;
  8399. let cutArea = 0, cutVolume = 0, fillArea = 0, fillVolume = 0;
  8400. const indices = options2.geom.indices;
  8401. const positions = options2.geom.attributes.position.values;
  8402. for (let index2 = 0; index2 < indices.length; index2 += 3) {
  8403. const pos0 = _self._returnPosition(positions, indices[index2]);
  8404. const pos1 = _self._returnPosition(positions, indices[index2 + 1]);
  8405. const pos2 = _self._returnPosition(positions, indices[index2 + 2]);
  8406. let _entities = _self._viewer.entities.add({
  8407. name: "\u4E09\u89D2\u9762",
  8408. polygon: {
  8409. hierarchy: [pos0.heightPos, pos1.heightPos, pos2.heightPos],
  8410. perPositionHeight: true,
  8411. material: Cesium.Color.fromRandom(),
  8412. extrudedHeight: options2.height,
  8413. outline: true,
  8414. outlineColor: Cesium.Color.BLACK
  8415. }
  8416. });
  8417. _self.delEntitys.push(_entities);
  8418. const area = _self._computeArea4Triangle(
  8419. pos0.noHeightPos,
  8420. pos1.noHeightPos,
  8421. pos2.noHeightPos
  8422. );
  8423. const height2 = (pos0.height + pos1.height + pos2.height) / 3;
  8424. if (height2 < options2.height) {
  8425. fillArea += area;
  8426. const volume = area * (options2.height - height2);
  8427. fillVolume += volume;
  8428. } else {
  8429. cutArea += area;
  8430. const volume = area * (height2 - options2.height);
  8431. cutVolume += volume;
  8432. }
  8433. }
  8434. let allArea = cutArea + fillArea;
  8435. allArea = allArea.toFixed(2);
  8436. cutArea = cutArea.toFixed(2);
  8437. cutVolume = cutVolume.toFixed(2);
  8438. fillArea = fillArea.toFixed(2);
  8439. fillVolume = fillVolume.toFixed(2);
  8440. let result = {
  8441. allArea,
  8442. cutArea,
  8443. cutVolume,
  8444. fillArea,
  8445. fillVolume
  8446. };
  8447. return result;
  8448. }
  8449. _computeArea4Triangle(pos1, pos2, pos3) {
  8450. let a = Cesium.Cartesian3.distance(pos1, pos2);
  8451. let b = Cesium.Cartesian3.distance(pos2, pos3);
  8452. let c = Cesium.Cartesian3.distance(pos3, pos1);
  8453. let S = (a + b + c) / 2;
  8454. return Math.sqrt(S * (S - a) * (S - b) * (S - c));
  8455. }
  8456. _returnPosition(positions, index2) {
  8457. let cartesian = new Cesium.Cartesian3(
  8458. positions[index2 * 3],
  8459. positions[index2 * 3 + 1],
  8460. positions[index2 * 3 + 2]
  8461. );
  8462. let cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  8463. let height2 = this._viewer.scene.sampleHeightSupported ? this._viewer.scene.sampleHeight(cartographic) : this._viewer.scene.globe.getHeight(cartographic);
  8464. if (height2 > this.maxHeigh) {
  8465. this.maxHeigh = height2;
  8466. }
  8467. return {
  8468. heightPos: Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, height2),
  8469. noHeightPos: Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, 0),
  8470. height: height2
  8471. };
  8472. }
  8473. }
  8474. Object.assign(CutFill.prototype, {
  8475. createPolygonGeo(points2, options2) {
  8476. return new Promise((resolve2, reject2) => {
  8477. let _self = this;
  8478. options2 = options2 || {};
  8479. options2.precision = Cesium.defaultValue(options2.precision, 256);
  8480. options2.height = Cesium.defaultValue(options2.height, 10);
  8481. _self.remove();
  8482. let positions = [];
  8483. for (let i2 = 0; i2 < points2.length; i2++) {
  8484. if (points2[i2] instanceof Cesium.Cartesian3) {
  8485. positions.push(points2[i2]);
  8486. } else {
  8487. positions.push(Cesium.Cartesian3.fromDegrees(points2[i2][0], points2[i2][1], points2[i2][1] || 0));
  8488. }
  8489. }
  8490. let granularity = Math.PI / Math.pow(2, 11);
  8491. granularity = granularity / options2.precision;
  8492. let polygonGeometry = new Cesium.PolygonGeometry.fromPositions({
  8493. positions,
  8494. vertexFormat: Cesium.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,
  8495. granularity
  8496. });
  8497. options2.geom = new Cesium.PolygonGeometry.createGeometry(polygonGeometry);
  8498. let result = _self._VolumeAnalysis(options2);
  8499. _self._viewer.scene.globe.baseColor = new Cesium.Color(1, 1, 1, 0.9);
  8500. _self._viewer.scene.screenSpaceCameraController.enableCollisionDetection = false;
  8501. _self._viewer.scene.globe.translucency.enabled = true;
  8502. resolve2(result);
  8503. });
  8504. },
  8505. remove() {
  8506. for (var i2 = 0; i2 < this.delEntitys.length; i2++) {
  8507. this._viewer.entities.remove(this.delEntitys[i2]);
  8508. }
  8509. this._viewer.scene.screenSpaceCameraController.enableCollisionDetection = true;
  8510. this._viewer.scene.globe.translucency.enabled = false;
  8511. }
  8512. });
  8513. class HeightLimit {
  8514. constructor(viewer2) {
  8515. if (!viewer2)
  8516. throw new Cesium.DeveloperError("no viewer object!");
  8517. this._viewer = viewer2;
  8518. this.targetY = 0;
  8519. }
  8520. _setPolygon(options2) {
  8521. let _self = this;
  8522. _self.HiePolygon = _self._viewer.entities.add({
  8523. polygon: {
  8524. hierarchy: new Cesium.PolygonHierarchy(_self.data),
  8525. material: _self._handleColor("#FFF8DC", options2.alpha),
  8526. height: new Cesium.CallbackProperty(_self._createPolygonUpdateFunction(), false),
  8527. perPositionHeight: false,
  8528. outline: true,
  8529. outlineColor: _self._handleColor("red", options2.alpha),
  8530. outlineWidth: 1
  8531. }
  8532. });
  8533. }
  8534. _createPolygonUpdateFunction() {
  8535. let _self = this;
  8536. return function() {
  8537. return _self.targetY;
  8538. };
  8539. }
  8540. _handleColor(color2, alpha) {
  8541. return Cesium.Color.fromCssColorString(color2).withAlpha(alpha || 1);
  8542. }
  8543. _getMinHeight(points2) {
  8544. let height2 = 0;
  8545. points2.map((point2) => {
  8546. let _height = point2[2] || 0;
  8547. height2 = _height;
  8548. if (_height < height2) {
  8549. height2 = _height;
  8550. }
  8551. });
  8552. return height2;
  8553. }
  8554. }
  8555. Object.assign(HeightLimit.prototype, {
  8556. addPrimitive(points2, options2) {
  8557. this.removePrimitive();
  8558. options2 = options2 || {};
  8559. options2.height = Cesium.defaultValue(options2.height, 50);
  8560. options2.baseHeight = Cesium.defaultValue(options2.baseHeight, 50);
  8561. options2.color = Cesium.defaultValue(options2.color, "red");
  8562. options2.alpha = Cesium.defaultValue(options2.alpha, 0.6);
  8563. let positions = points2.map((point2) => {
  8564. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  8565. });
  8566. let _self = this;
  8567. _self.data = positions;
  8568. _self.baseHeight = options2.baseHeight;
  8569. _self.targetY = options2.baseHeight + options2.height;
  8570. let polygonInstance = new Cesium.GeometryInstance({
  8571. geometry: new Cesium.PolygonGeometry({
  8572. polygonHierarchy: new Cesium.PolygonHierarchy(_self.data),
  8573. height: _self.baseHeight,
  8574. extrudedHeight: _self.baseHeight + 3e3
  8575. }),
  8576. attributes: {
  8577. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  8578. Cesium.Color.fromCssColorString(options2.color).withAlpha(options2.alpha)
  8579. ),
  8580. show: new Cesium.ShowGeometryInstanceAttribute(true)
  8581. }
  8582. });
  8583. _self.limitHeightPrimitive = _self._viewer.scene.primitives.add(
  8584. new Cesium.ClassificationPrimitive({
  8585. geometryInstances: polygonInstance,
  8586. releaseGeometryInstances: false,
  8587. classificationType: Cesium.ClassificationType.CESIUM_3D_TILE
  8588. })
  8589. );
  8590. _self._setPolygon(options2);
  8591. },
  8592. removePrimitive() {
  8593. if (this.HiePolygon) {
  8594. this._viewer.entities.remove(this.HiePolygon);
  8595. }
  8596. if (this.limitHeightPrimitive) {
  8597. this._viewer.scene.primitives.remove(this.limitHeightPrimitive);
  8598. }
  8599. },
  8600. changeHeight(height2) {
  8601. if (!this.limitHeightPrimitive)
  8602. return;
  8603. this.targetY = this.baseHeight + height2;
  8604. let cartographic = Cesium.Cartographic.fromCartesian(this.limitHeightPrimitive._primitive._boundingSpheres[0].center);
  8605. let surface = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, this.baseHeight);
  8606. let offset = Cesium.Cartesian3.fromRadians(cartographic.longitude, cartographic.latitude, this.baseHeight + height2);
  8607. let translation = Cesium.Cartesian3.subtract(offset, surface, new Cesium.Cartesian3());
  8608. this.limitHeightPrimitive._primitive.modelMatrix = Cesium.Matrix4.fromTranslation(translation);
  8609. }
  8610. });
  8611. class Cutting {
  8612. constructor(viewer2) {
  8613. if (!viewer2)
  8614. throw new Cesium.DeveloperError("no viewer object!");
  8615. this._viewer = viewer2;
  8616. this._camera = this._viewer.camera;
  8617. this._scene = this._viewer.scene;
  8618. this.targetY = 0;
  8619. this._mouseHandler();
  8620. }
  8621. _mouseHandler() {
  8622. let _self = this;
  8623. let viewer2 = _self._viewer;
  8624. let scene = _self._scene;
  8625. let selectedPlane;
  8626. let downHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8627. downHandler.setInputAction(function(movement) {
  8628. let pickedObject = scene.pick(movement.position);
  8629. if (Cesium.defined(pickedObject) && Cesium.defined(pickedObject.id) && Cesium.defined(pickedObject.id.plane)) {
  8630. selectedPlane = pickedObject.id.plane;
  8631. selectedPlane.material = Cesium.Color.RED.withAlpha(0.05);
  8632. selectedPlane.outlineColor = Cesium.Color.RED;
  8633. scene.screenSpaceCameraController.enableInputs = false;
  8634. }
  8635. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  8636. let upHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8637. upHandler.setInputAction(function() {
  8638. if (Cesium.defined(selectedPlane)) {
  8639. selectedPlane.material = Cesium.Color.RED.withAlpha(0.1);
  8640. selectedPlane.outlineColor = Cesium.Color.RED;
  8641. selectedPlane = void 0;
  8642. }
  8643. scene.screenSpaceCameraController.enableInputs = true;
  8644. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  8645. let moveHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8646. moveHandler.setInputAction(function(movement) {
  8647. if (Cesium.defined(selectedPlane)) {
  8648. let deltaY = movement.startPosition.y - movement.endPosition.y;
  8649. _self.targetY += deltaY;
  8650. }
  8651. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  8652. }
  8653. _createPlaneUpdateFunction(plane) {
  8654. let _self = this;
  8655. return function() {
  8656. plane.distance = _self.targetY;
  8657. return plane;
  8658. };
  8659. }
  8660. _createPlane(p1, p2, inverseTransform) {
  8661. let _self = this;
  8662. let p1C3 = _self._getOriginCoordinateSystemPoint(p1, inverseTransform);
  8663. let p2C3 = _self._getOriginCoordinateSystemPoint(p2, inverseTransform);
  8664. let up = new Cesium.Cartesian3(0, 0, 10);
  8665. let right = Cesium.Cartesian3.subtract(p2C3, p1C3, new Cesium.Cartesian3());
  8666. let normal = Cesium.Cartesian3.cross(right, up, new Cesium.Cartesian3());
  8667. normal = Cesium.Cartesian3.normalize(normal, normal);
  8668. let planeTmp = Cesium.Plane.fromPointNormal(p1C3, normal);
  8669. return Cesium.ClippingPlane.fromPlane(planeTmp);
  8670. }
  8671. _getOriginCoordinateSystemPoint(point2, inverseTransform) {
  8672. let val = Cesium.Cartesian3.fromDegrees(point2[0], point2[1]);
  8673. return Cesium.Matrix4.multiplyByPoint(
  8674. inverseTransform,
  8675. val,
  8676. new Cesium.Cartesian3(0, 0, 0)
  8677. );
  8678. }
  8679. _getInverseTransform(tileSet) {
  8680. let transform3;
  8681. const tmp = tileSet.root.transform;
  8682. if (tmp && tmp.equals(Cesium.Matrix4.IDENTITY) || !tmp) {
  8683. transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(tileSet.boundingSphere.center);
  8684. } else {
  8685. transform3 = Cesium.Matrix4.fromArray(tileSet.root.transform);
  8686. }
  8687. return Cesium.Matrix4.inverseTransformation(transform3, new Cesium.Matrix4());
  8688. }
  8689. _isDirRes(polygon2, isClockwise) {
  8690. var lineStringList = [];
  8691. polygon2.forEach((p) => {
  8692. lineStringList.push([p.lng, p.lat]);
  8693. });
  8694. var clockwiseRing = lineString(lineStringList);
  8695. let isR = booleanClockwise(clockwiseRing);
  8696. var points2 = [];
  8697. if (isClockwise) {
  8698. if (!isR) {
  8699. points2 = polygon2;
  8700. } else {
  8701. var count = 0;
  8702. for (var ii = polygon2.length - 1; ii >= 0; ii--) {
  8703. points2[count] = polygon2[ii];
  8704. count++;
  8705. }
  8706. }
  8707. } else {
  8708. if (isR) {
  8709. points2 = polygon2;
  8710. } else {
  8711. var count = 0;
  8712. for (var ii = polygon2.length - 1; ii >= 0; ii--) {
  8713. points2[count] = polygon2[ii];
  8714. count++;
  8715. }
  8716. }
  8717. }
  8718. return points2;
  8719. }
  8720. }
  8721. Object.assign(Cutting.prototype, {
  8722. activate(tileset) {
  8723. let _self = this;
  8724. let viewer2 = _self._viewer;
  8725. let inverseTransform = _self._getInverseTransform(tileset);
  8726. const clippingPlanes1 = [];
  8727. clippingPlanes1.push(_self._createPlane([121.55814450142213, 37.39658788787028], [121.65814450142213, 37.49658788787028], inverseTransform));
  8728. let clippingPlanes = new Cesium.ClippingPlaneCollection({
  8729. planes: [
  8730. new Cesium.ClippingPlane(
  8731. new Cesium.Cartesian3(0, 1, 0),
  8732. -10
  8733. )
  8734. ],
  8735. edgeWidth: 1
  8736. });
  8737. _self.tileset = tileset;
  8738. tileset.clippingPlanes = clippingPlanes;
  8739. tileset.debugShowBoundingVolume = false;
  8740. return tileset.readyPromise.then(function() {
  8741. let boundingSphere = tileset.boundingSphere;
  8742. let radius = boundingSphere.radius;
  8743. viewer2.zoomTo(
  8744. tileset,
  8745. new Cesium.HeadingPitchRange(0.5, -0.2, radius / 5)
  8746. );
  8747. if (!Cesium.Matrix4.equals(
  8748. tileset.root.transform,
  8749. Cesium.Matrix4.IDENTITY
  8750. )) {
  8751. const transformCenter = Cesium.Matrix4.getTranslation(tileset.root.transform, new Cesium.Cartesian3());
  8752. const transformCartographic = Cesium.Cartographic.fromCartesian(transformCenter);
  8753. const boundingSphereCartographic = Cesium.Cartographic.fromCartesian(tileset.boundingSphere.center);
  8754. const height2 = boundingSphereCartographic.height - transformCartographic.height;
  8755. clippingPlanes.modelMatrix = Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0, 0, height2));
  8756. }
  8757. for (let i2 = 0; i2 < clippingPlanes.length; ++i2) {
  8758. const plane = clippingPlanes.get(i2);
  8759. viewer2.entities.add({
  8760. position: boundingSphere.center,
  8761. plane: {
  8762. dimensions: new Cesium.Cartesian2(
  8763. radius / 10,
  8764. radius / 10
  8765. ),
  8766. material: Cesium.Color.WHITE.withAlpha(0.1),
  8767. plane: new Cesium.CallbackProperty(
  8768. _self._createPlaneUpdateFunction(plane),
  8769. false
  8770. ),
  8771. outline: true,
  8772. outlineColor: Cesium.Color.WHITE
  8773. }
  8774. });
  8775. }
  8776. return tileset;
  8777. });
  8778. },
  8779. addTiles(my3dtiles, pointsArray) {
  8780. let _self = this;
  8781. let viewer2 = _self._viewer;
  8782. let tileset = my3dtiles;
  8783. _self.polygon = pointsArray;
  8784. _self.tileset = tileset;
  8785. return tileset.readyPromise.then(function() {
  8786. let inverseTransform = _self._getInverseTransform(tileset);
  8787. _self.polygon = _self._isDirRes(_self.polygon, false);
  8788. const clippingPlanes1 = [];
  8789. for (let i2 = 0; i2 < _self.polygon.length; i2++) {
  8790. if (i2 === _self.polygon.length - 1) {
  8791. clippingPlanes1.push(_self._createPlane(_self.polygon[i2], _self.polygon[0], inverseTransform));
  8792. } else {
  8793. clippingPlanes1.push(_self._createPlane(_self.polygon[i2], _self.polygon[i2 + 1], inverseTransform));
  8794. }
  8795. }
  8796. let clippingPlanes = new Cesium.ClippingPlaneCollection({
  8797. planes: clippingPlanes1,
  8798. edgeWidth: 1,
  8799. edgeColor: Cesium.Color.RED,
  8800. unionClippingRegions: false
  8801. });
  8802. _self.clippingPlanes = clippingPlanes;
  8803. tileset.clippingPlanes = clippingPlanes;
  8804. tileset.debugShowBoundingVolume = false;
  8805. let boundingSphere = tileset.boundingSphere;
  8806. let radius = boundingSphere.radius;
  8807. for (let i2 = 0; i2 < clippingPlanes.length; ++i2) {
  8808. let plane = clippingPlanes.get(i2);
  8809. viewer2.entities.add({
  8810. position: boundingSphere.center,
  8811. plane: {
  8812. dimensions: new Cesium.Cartesian2(
  8813. radius / 10,
  8814. radius / 10
  8815. ),
  8816. material: Cesium.Color.RED.withAlpha(0.1),
  8817. plane: new Cesium.CallbackProperty(
  8818. _self._createPlaneUpdateFunction(plane),
  8819. false
  8820. ),
  8821. outline: true,
  8822. outlineColor: Cesium.Color.RED
  8823. }
  8824. });
  8825. }
  8826. return tileset;
  8827. });
  8828. },
  8829. addTiles2(my3dtiles, pointsArray) {
  8830. let _self = this;
  8831. _self._viewer;
  8832. let tileset = my3dtiles;
  8833. _self.polygon = pointsArray;
  8834. _self.tileset = tileset;
  8835. Cesium.Matrix4.fromArray(
  8836. [
  8837. 1,
  8838. 5551115123125783e-31,
  8839. 5898416033378595e-24,
  8840. 0,
  8841. -6106226635438361e-31,
  8842. 1,
  8843. -11355608731111744e-24,
  8844. 0,
  8845. -5898416061134171e-24,
  8846. 11355608731111744e-24,
  8847. 0.9999999999999999,
  8848. 0,
  8849. 9.912469893228263,
  8850. -19.08345020748675,
  8851. -14.613607150502503,
  8852. 1
  8853. ]
  8854. );
  8855. let transform3 = Cesium.Matrix4.fromArray(
  8856. [
  8857. -0.8874246461620654,
  8858. -0.46095281470464317,
  8859. 0,
  8860. 0,
  8861. 0.2602796082288922,
  8862. -0.5010893346724129,
  8863. 0.8253266045740758,
  8864. 0,
  8865. -0.3804366214290463,
  8866. 0.7324151700322881,
  8867. 0.5646556435405804,
  8868. 0,
  8869. -2429070591483741e-9,
  8870. 467643767731705e-8,
  8871. 3581165448379543e-9,
  8872. 1
  8873. ]
  8874. );
  8875. let inverseTransform = Cesium.Matrix4.inverseTransformation(transform3, new Cesium.Matrix4());
  8876. let clippingPlanes1 = [];
  8877. for (let i2 = 0; i2 < _self.polygon.length - 1; i2++) {
  8878. let plane = _self.createPlane(_self.polygon[i2], _self.polygon[i2 + 1], inverseTransform);
  8879. clippingPlanes1.push(plane);
  8880. }
  8881. let clippingPlanes = new Cesium.ClippingPlaneCollection({
  8882. planes: clippingPlanes1,
  8883. edgeWidth: 1,
  8884. edgeColor: Cesium.Color.RED,
  8885. unionClippingRegions: false
  8886. });
  8887. _self.clippingPlanes = clippingPlanes;
  8888. return tileset.readyPromise.then(function() {
  8889. tileset.clippingPlanes = clippingPlanes;
  8890. tileset.debugShowBoundingVolume = false;
  8891. let boundingSphere = tileset.boundingSphere;
  8892. boundingSphere.radius;
  8893. return tileset;
  8894. });
  8895. },
  8896. toggleClipping() {
  8897. let _self = this;
  8898. _self.tileset = null;
  8899. }
  8900. });
  8901. class GeologyClipPlan {
  8902. constructor(viewer2) {
  8903. if (!viewer2)
  8904. throw new Cesium.DeveloperError("no viewer object!");
  8905. this._viewer = viewer2;
  8906. this._camera = this._viewer.camera;
  8907. this._scene = this._viewer.scene;
  8908. this.tileset = void 0;
  8909. this.targetY = 0;
  8910. this.planeEntities = [];
  8911. this._mouseHandler();
  8912. }
  8913. _mouseHandler() {
  8914. let _self = this;
  8915. let viewer2 = _self._viewer;
  8916. let scene = _self._scene;
  8917. let selectedPlane;
  8918. let downHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8919. downHandler.setInputAction(function(movement) {
  8920. let pickedObject = scene.pick(movement.position);
  8921. if (Cesium.defined(pickedObject) && Cesium.defined(pickedObject.id) && Cesium.defined(pickedObject.id.plane)) {
  8922. selectedPlane = pickedObject.id.plane;
  8923. selectedPlane.material = Cesium.Color.RED.withAlpha(0.05);
  8924. selectedPlane.outlineColor = Cesium.Color.RED;
  8925. scene.screenSpaceCameraController.enableInputs = false;
  8926. }
  8927. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  8928. let upHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8929. upHandler.setInputAction(function() {
  8930. if (Cesium.defined(selectedPlane)) {
  8931. selectedPlane.material = Cesium.Color.RED.withAlpha(0.1);
  8932. selectedPlane.outlineColor = Cesium.Color.RED;
  8933. selectedPlane = void 0;
  8934. }
  8935. scene.screenSpaceCameraController.enableInputs = true;
  8936. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  8937. let moveHandler = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  8938. moveHandler.setInputAction(function(movement) {
  8939. if (Cesium.defined(selectedPlane)) {
  8940. let deltaY = movement.startPosition.y - movement.endPosition.y;
  8941. _self.targetY += deltaY;
  8942. }
  8943. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  8944. }
  8945. _createPlaneUpdateFunction(plane) {
  8946. let _self = this;
  8947. return function() {
  8948. plane.distance = _self.targetY;
  8949. return plane;
  8950. };
  8951. }
  8952. }
  8953. Object.assign(GeologyClipPlan.prototype, {
  8954. activate(tileset, options2) {
  8955. let _self = this;
  8956. let viewer2 = _self._viewer;
  8957. let distance2 = 1e5;
  8958. let clippingPlanes = new Cesium.ClippingPlaneCollection({
  8959. planes: [
  8960. new Cesium.ClippingPlane(
  8961. new Cesium.Cartesian3(0, 0, -1),
  8962. distance2
  8963. )
  8964. ],
  8965. edgeWidth: 1
  8966. });
  8967. _self.tileset = tileset;
  8968. tileset.clippingPlanes = clippingPlanes;
  8969. tileset.debugShowBoundingVolume = false;
  8970. return tileset.readyPromise.then(function() {
  8971. let boundingSphere = tileset.boundingSphere;
  8972. let radius = boundingSphere.radius;
  8973. if (!Cesium.Matrix4.equals(
  8974. tileset.root.transform,
  8975. Cesium.Matrix4.IDENTITY
  8976. )) {
  8977. const transformCenter = Cesium.Matrix4.getTranslation(
  8978. tileset.root.transform,
  8979. new Cesium.Cartesian3()
  8980. );
  8981. const transformCartographic = Cesium.Cartographic.fromCartesian(
  8982. transformCenter
  8983. );
  8984. const boundingSphereCartographic = Cesium.Cartographic.fromCartesian(
  8985. tileset.boundingSphere.center
  8986. );
  8987. const height2 = boundingSphereCartographic.height - transformCartographic.height;
  8988. clippingPlanes.modelMatrix = Cesium.Matrix4.fromTranslation(new Cesium.Cartesian3(0, 0, height2));
  8989. }
  8990. viewer2.zoomTo(
  8991. tileset,
  8992. new Cesium.HeadingPitchRange(0.5, -0.2, radius / 10)
  8993. );
  8994. let cartographic = Cesium.Cartographic.fromCartesian(boundingSphere.center);
  8995. let lng = Cesium.Math.toDegrees(cartographic.longitude);
  8996. let lat = Cesium.Math.toDegrees(cartographic.latitude);
  8997. cartographic.height;
  8998. var Cartesian33 = Cesium.Cartesian3.fromDegrees(lng, lat, 105);
  8999. for (let i2 = 0; i2 < clippingPlanes.length; ++i2) {
  9000. let plane = clippingPlanes.get(i2);
  9001. let planeEntity = viewer2.entities.add({
  9002. position: Cartesian33,
  9003. plane: {
  9004. dimensions: new Cesium.Cartesian2(
  9005. radius / 10,
  9006. radius / 20
  9007. ),
  9008. material: Cesium.Color.RED.withAlpha(0.1),
  9009. plane: new Cesium.CallbackProperty(
  9010. _self._createPlaneUpdateFunction(plane),
  9011. false
  9012. ),
  9013. outline: true,
  9014. outlineColor: Cesium.Color.RED
  9015. }
  9016. });
  9017. _self.planeEntities.push(planeEntity);
  9018. }
  9019. return tileset;
  9020. });
  9021. },
  9022. toggleClipping() {
  9023. let _self = this;
  9024. for (let i2 = 0; i2 < _self.planeEntities.length; i2++) {
  9025. _self._viewer.entities.remove(_self.planeEntities[i2]);
  9026. }
  9027. _self.planeEntities = [];
  9028. _self.targetY = 0;
  9029. let boundingSphere = _self.tileset.boundingSphere;
  9030. _self._camera.viewBoundingSphere(boundingSphere, new Cesium.HeadingPitchRange(Cesium.Math.toRadians(120), Cesium.Math.toRadians(-10), boundingSphere.radius * 2.5));
  9031. _self._camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
  9032. },
  9033. reset() {
  9034. this.planeEntities = [];
  9035. this.targetY = 0;
  9036. }
  9037. });
  9038. let SpatialAnalysis = {
  9039. SightLine,
  9040. ViewShed,
  9041. SunshineShadow,
  9042. Profile,
  9043. CutFill,
  9044. HeightLimit,
  9045. Cutting,
  9046. GeologyClipPlan
  9047. };
  9048. class TerrainExcavation {
  9049. constructor(viewer2) {
  9050. if (!viewer2)
  9051. throw new Error("no viewer object!");
  9052. this.viewer = viewer2;
  9053. }
  9054. prepareWell(activePoints) {
  9055. let pointLength = activePoints.length;
  9056. let heightDiff = this.excavateMinHeight - this.height;
  9057. let no_height_top = [], bottom_pos = [], lerp_pos = [];
  9058. for (let l = 0; l < pointLength; l++) {
  9059. let u = l == pointLength - 1 ? 0 : l + 1;
  9060. let point0 = [
  9061. Cesium.Cartographic.fromCartesian(activePoints[l]).longitude,
  9062. Cesium.Cartographic.fromCartesian(activePoints[l]).latitude
  9063. ];
  9064. let point1 = [
  9065. Cesium.Cartographic.fromCartesian(activePoints[u]).longitude,
  9066. Cesium.Cartographic.fromCartesian(activePoints[u]).latitude
  9067. ];
  9068. if (0 == l) {
  9069. lerp_pos.push(new Cesium.Cartographic(point0[0], point0[1]));
  9070. bottom_pos.push(
  9071. Cesium.Cartesian3.fromRadians(point0[0], point0[1], heightDiff)
  9072. );
  9073. no_height_top.push(
  9074. Cesium.Cartesian3.fromRadians(point0[0], point0[1], 0)
  9075. );
  9076. }
  9077. for (let p = 1; p <= this.splitNum; p++) {
  9078. let m = Cesium.Math.lerp(point0[0], point1[0], p / this.splitNum);
  9079. let g = Cesium.Math.lerp(point0[1], point1[1], p / this.splitNum);
  9080. l == pointLength - 1 && p == this.splitNum || (lerp_pos.push(new Cesium.Cartographic(m, g)), bottom_pos.push(Cesium.Cartesian3.fromRadians(m, g, heightDiff)), no_height_top.push(Cesium.Cartesian3.fromRadians(m, g, 0)));
  9081. }
  9082. }
  9083. this.wellData = {
  9084. lerp_pos,
  9085. bottom_pos,
  9086. no_height_top
  9087. };
  9088. }
  9089. createWell(wallData) {
  9090. let $this = this;
  9091. if (this.viewer.terrainProvider._layers) {
  9092. this.createBottomSurface(wallData.bottom_pos);
  9093. let positions = Cesium.sampleTerrainMostDetailed(
  9094. this.viewer.terrainProvider,
  9095. wallData.lerp_pos
  9096. );
  9097. positions.then(function(pos) {
  9098. let positionList = [];
  9099. for (let index2 = 0; index2 < pos.length; index2++) {
  9100. const element = pos[index2];
  9101. let curPos = Cesium.Cartesian3.fromRadians(
  9102. element.longitude,
  9103. element.latitude,
  9104. element.height
  9105. );
  9106. positionList.push(curPos);
  9107. }
  9108. $this.createWellWall(wallData.bottom_pos, positionList);
  9109. });
  9110. } else {
  9111. this.createBottomSurface(wallData.bottom_pos);
  9112. this.createWellWall(wallData.bottom_pos, wallData.no_height_top);
  9113. }
  9114. }
  9115. ellipsoidToDegree(pos) {
  9116. let cartesian3 = new Cesium.Cartesian3(pos.x, pos.y, pos.z);
  9117. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian3);
  9118. return {
  9119. longitude: Cesium.Math.toDegrees(cartographic.longitude),
  9120. latitude: Cesium.Math.toDegrees(cartographic.latitude),
  9121. altitude: cartographic.height
  9122. };
  9123. }
  9124. createBottomSurface(points2) {
  9125. if (points2.length) {
  9126. let minHeight = this.getMinHeight(points2);
  9127. let positions = [];
  9128. for (let i2 = 0; i2 < points2.length; i2++) {
  9129. let curPoint = this.ellipsoidToDegree(points2[i2]);
  9130. positions.push(curPoint.longitude, curPoint.latitude, minHeight);
  9131. }
  9132. let polygon2 = new Cesium.PolygonGeometry({
  9133. polygonHierarchy: new Cesium.PolygonHierarchy(
  9134. Cesium.Cartesian3.fromDegreesArrayHeights(positions)
  9135. ),
  9136. perPositionHeight: true
  9137. });
  9138. let material = new Cesium.Material({
  9139. fabric: {
  9140. type: "Image",
  9141. uniforms: {
  9142. image: this.bottomImg
  9143. }
  9144. }
  9145. });
  9146. let appearance = new Cesium.MaterialAppearance({
  9147. translucent: false,
  9148. flat: true,
  9149. material
  9150. });
  9151. this.bottomSurface = new Cesium.Primitive({
  9152. geometryInstances: new Cesium.GeometryInstance({
  9153. geometry: Cesium.PolygonGeometry.createGeometry(polygon2)
  9154. }),
  9155. appearance,
  9156. asynchronous: false
  9157. });
  9158. this.viewer.scene.primitives.add(this.bottomSurface);
  9159. }
  9160. }
  9161. createWellWall(bottomPos, positionList) {
  9162. let minHeight = this.getMinHeight(bottomPos);
  9163. let maxHeights = [], minHeights = [];
  9164. for (let i2 = 0; i2 < positionList.length; i2++) {
  9165. maxHeights.push(this.ellipsoidToDegree(positionList[i2]).altitude);
  9166. minHeights.push(minHeight);
  9167. }
  9168. let wall = new Cesium.WallGeometry({
  9169. positions: positionList,
  9170. maximumHeights: maxHeights,
  9171. minimumHeights: minHeights
  9172. });
  9173. let geometry2 = Cesium.WallGeometry.createGeometry(wall);
  9174. let material = new Cesium.Material({
  9175. fabric: {
  9176. type: "Image",
  9177. uniforms: {
  9178. image: this.wallImg
  9179. }
  9180. }
  9181. });
  9182. let appearance = new Cesium.MaterialAppearance({
  9183. translucent: false,
  9184. flat: true,
  9185. material
  9186. });
  9187. this.wellWall = new Cesium.Primitive({
  9188. geometryInstances: new Cesium.GeometryInstance({
  9189. geometry: geometry2,
  9190. attributes: {
  9191. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  9192. Cesium.Color.GREY
  9193. )
  9194. },
  9195. id: "PitWall"
  9196. }),
  9197. appearance,
  9198. asynchronous: false
  9199. });
  9200. this.viewer.scene.primitives.add(this.wellWall);
  9201. }
  9202. getMinHeight(points2) {
  9203. let minHeight = 5e6;
  9204. let minPoint = null;
  9205. for (let i2 = 0; i2 < points2.length; i2++) {
  9206. let height2 = points2[i2]["z"];
  9207. if (height2 < minHeight) {
  9208. minHeight = height2;
  9209. minPoint = this.ellipsoidToDegree(points2[i2]);
  9210. }
  9211. }
  9212. return minPoint.altitude;
  9213. }
  9214. switchExcavate(show) {
  9215. if (show) {
  9216. this.viewer.scene.globe.material = null;
  9217. this.wellWall.show = true;
  9218. this.bottomSurface.show = true;
  9219. } else {
  9220. this.viewer.scene.globe.material = null;
  9221. this.wellWall.show = false;
  9222. this.bottomSurface.show = false;
  9223. }
  9224. }
  9225. updateExcavateDepth(height2) {
  9226. this.viewer.scene.primitives.remove(this.bottomSurface);
  9227. this.viewer.scene.primitives.remove(this.wellWall);
  9228. console.log(this.wellData, this.excavateMinHeight);
  9229. let lerp_pos = this.wellData.lerp_pos;
  9230. let posList = [];
  9231. for (let n = 0; n < lerp_pos.length; n++) {
  9232. posList.push(
  9233. Cesium.Cartesian3.fromRadians(
  9234. lerp_pos[n].longitude,
  9235. lerp_pos[n].latitude,
  9236. this.excavateMinHeight - height2
  9237. )
  9238. );
  9239. }
  9240. this.wellData.bottom_pos = posList;
  9241. this.createWell(this.wellData);
  9242. }
  9243. }
  9244. Object.defineProperties(TerrainExcavation.prototype, {
  9245. show: {
  9246. get: function() {
  9247. return this._show;
  9248. },
  9249. set: function(e) {
  9250. this._show = e;
  9251. this.switchExcavate(e);
  9252. }
  9253. },
  9254. height: {
  9255. get: function() {
  9256. return this._height;
  9257. },
  9258. set: function(e) {
  9259. this._height = e;
  9260. this.updateExcavateDepth(e);
  9261. }
  9262. }
  9263. });
  9264. Object.assign(TerrainExcavation.prototype, {
  9265. add(activePoints, options2) {
  9266. options2 = options2 || {};
  9267. this._height = options2.excavateDepth || 10;
  9268. this.bottomImg = options2.bottomImg || "jt3dSDK/imgs/polygon/ground.png";
  9269. this.wallImg = options2.wallImg || "jt3dSDK/imgs/polygon/ground.png";
  9270. this.splitNum = Cesium.defaultValue(options2.splitNum, 50);
  9271. activePoints = activePoints.map((point2) => {
  9272. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  9273. });
  9274. let viewer2 = this.viewer;
  9275. this.clear();
  9276. let clippingPlanesList = [];
  9277. let car3Difference = Cesium.Cartesian3.subtract(
  9278. activePoints[0],
  9279. activePoints[1],
  9280. new Cesium.Cartesian3()
  9281. );
  9282. let boolDiff = car3Difference.x > 0;
  9283. this.excavateMinHeight = 999999999;
  9284. for (let index2 = 0; index2 < activePoints.length; ++index2) {
  9285. let s = (index2 + 1) % activePoints.length;
  9286. let curMidPoint = Cesium.Cartesian3.midpoint(
  9287. activePoints[index2],
  9288. activePoints[s],
  9289. new Cesium.Cartesian3()
  9290. );
  9291. let cartographic = Cesium.Cartographic.fromCartesian(activePoints[index2]);
  9292. let curHeight = viewer2.scene.globe.getHeight(cartographic) || cartographic.height;
  9293. console.log(curHeight);
  9294. if (curHeight < this.excavateMinHeight) {
  9295. this.excavateMinHeight = curHeight;
  9296. }
  9297. let curMidPointNormal = Cesium.Cartesian3.normalize(
  9298. curMidPoint,
  9299. new Cesium.Cartesian3()
  9300. );
  9301. let curMidPointDifference = boolDiff ? Cesium.Cartesian3.subtract(
  9302. activePoints[index2],
  9303. curMidPoint,
  9304. new Cesium.Cartesian3()
  9305. ) : Cesium.Cartesian3.subtract(
  9306. activePoints[s],
  9307. curMidPoint,
  9308. new Cesium.Cartesian3()
  9309. );
  9310. curMidPointDifference = Cesium.Cartesian3.normalize(
  9311. curMidPointDifference,
  9312. curMidPointDifference
  9313. );
  9314. let curMidPointCross = Cesium.Cartesian3.cross(
  9315. curMidPointDifference,
  9316. curMidPointNormal,
  9317. new Cesium.Cartesian3()
  9318. );
  9319. curMidPointCross = Cesium.Cartesian3.normalize(
  9320. curMidPointCross,
  9321. curMidPointCross
  9322. );
  9323. let plane = new Cesium.Plane(curMidPointCross, 0);
  9324. let distance2 = Cesium.Plane.getPointDistance(plane, curMidPoint);
  9325. clippingPlanesList.push(
  9326. new Cesium.ClippingPlane(curMidPointCross, distance2)
  9327. );
  9328. }
  9329. this.viewer.scene.globe.clippingPlanes = new Cesium.ClippingPlaneCollection({
  9330. planes: clippingPlanesList,
  9331. edgeWidth: 1,
  9332. edgeColor: Cesium.Color.WHITE,
  9333. enabled: true
  9334. });
  9335. this.prepareWell(activePoints);
  9336. this.createWell(this.wellData);
  9337. },
  9338. clear() {
  9339. if (this.viewer.scene.globe.clippingPlanes) {
  9340. this.viewer.scene.globe.clippingPlanes.removeAll();
  9341. this.viewer.scene.primitives.remove(this.bottomSurface);
  9342. this.viewer.scene.primitives.remove(this.wellWall);
  9343. this.viewer.scene.render();
  9344. }
  9345. }
  9346. });
  9347. class SlopeAspect {
  9348. constructor(viewer2) {
  9349. if (!viewer2)
  9350. throw new Cesium.DeveloperError("no viewer object!");
  9351. this._viewer = viewer2;
  9352. this.result = [];
  9353. this.handler = void 0;
  9354. this.toolTip = "";
  9355. }
  9356. _openTip() {
  9357. let _self = this;
  9358. this.handler = new Cesium.ScreenSpaceEventHandler(_self._viewer.canvas);
  9359. this.handler.setInputAction(function(movement) {
  9360. let endPos = movement.endPosition;
  9361. var pick = _self._viewer.scene.pick(endPos);
  9362. if (pick && pick.id && pick.id.type === "SlopeAspect") {
  9363. _self.toolTip = pick.id.value.toFixed(2);
  9364. CreateRemindertip(_self.toolTip, endPos, true);
  9365. } else {
  9366. _self.toolTip = "";
  9367. CreateRemindertip(_self.toolTip, endPos, false);
  9368. }
  9369. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  9370. }
  9371. _createEllipse(gridSquare) {
  9372. let _self = this;
  9373. let boxResults = [];
  9374. for (let index2 = 0; index2 < gridSquare.features.length; index2++) {
  9375. const feature2 = gridSquare.features[index2];
  9376. const coordinates = feature2.geometry.coordinates[0];
  9377. const centerdegree = [
  9378. (coordinates[0][0] + coordinates[2][0]) / 2,
  9379. (coordinates[0][1] + coordinates[2][1]) / 2
  9380. ];
  9381. let centerCartographic = Cesium.Cartographic.fromDegrees(
  9382. centerdegree[0],
  9383. centerdegree[1]
  9384. );
  9385. boxResults.push(centerCartographic);
  9386. for (let i2 = 0; i2 < coordinates.length; i2++) {
  9387. const coord = coordinates[i2];
  9388. let cartographic = Cesium.Cartographic.fromDegrees(coord[0], coord[1]);
  9389. boxResults.push(cartographic);
  9390. const coord1 = coordinates[i2 + 1];
  9391. if (coord1) {
  9392. let newCoord = [(coord[0] + coord1[0]) / 2, (coord[1] + coord1[1]) / 2];
  9393. let newCartographic = Cesium.Cartographic.fromDegrees(newCoord[0], newCoord[1]);
  9394. boxResults.push(newCartographic);
  9395. }
  9396. }
  9397. }
  9398. Cesium.sampleTerrainMostDetailed(
  9399. _self._viewer.scene.terrainProvider,
  9400. boxResults
  9401. ).then((updatePositions) => {
  9402. let arrr = [];
  9403. let ellipseResults = updatePositions.reduce(function(pre, item, index2, updatePositions2) {
  9404. var begin = index2 * 10;
  9405. var end = begin + 10;
  9406. var res = updatePositions2.slice(begin, end);
  9407. if (res.length != 0) {
  9408. arrr[index2] = res;
  9409. }
  9410. return arrr;
  9411. }, []);
  9412. _self._calculateSlope(ellipseResults);
  9413. _self._openTip();
  9414. });
  9415. }
  9416. _createPolygonInsrance(points2, color2) {
  9417. let positions = [];
  9418. for (let index2 = 1; index2 < points2.length - 1; index2++) {
  9419. const element = points2[index2];
  9420. positions.push(Cesium.Cartographic.toCartesian(element));
  9421. }
  9422. let polygon2 = new Cesium.PolygonGeometry({
  9423. polygonHierarchy: new Cesium.PolygonHierarchy(positions)
  9424. });
  9425. let polygonInstance = new Cesium.GeometryInstance({
  9426. geometry: polygon2,
  9427. attributes: {
  9428. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  9429. Cesium.Color.fromCssColorString(color2)
  9430. ),
  9431. show: new Cesium.ShowGeometryInstanceAttribute(true)
  9432. }
  9433. });
  9434. return polygonInstance;
  9435. }
  9436. _createArrowInstance(targetPoint, center2, diagonalPoint, heightDifference, curSlope) {
  9437. let cartographic_0 = new Cesium.Cartographic(
  9438. (targetPoint.longitude + center2.longitude) / 2,
  9439. (targetPoint.latitude + center2.latitude) / 2,
  9440. (targetPoint.height + center2.height) / 2
  9441. );
  9442. let cartographic_1 = new Cesium.Cartographic(
  9443. (diagonalPoint.longitude + center2.longitude) / 2,
  9444. (diagonalPoint.latitude + center2.latitude) / 2,
  9445. (diagonalPoint.height + center2.height) / 2
  9446. );
  9447. let positions1 = heightDifference > 0 ? [
  9448. Cesium.Cartographic.toCartesian(cartographic_0),
  9449. Cesium.Cartographic.toCartesian(cartographic_1)
  9450. ] : [
  9451. Cesium.Cartographic.toCartesian(cartographic_1),
  9452. Cesium.Cartographic.toCartesian(cartographic_0)
  9453. ];
  9454. const instance = new Cesium.GeometryInstance({
  9455. id: {
  9456. type: "SlopeAspect",
  9457. value: curSlope
  9458. },
  9459. geometry: new Cesium.GroundPolylineGeometry({
  9460. positions: positions1,
  9461. width: this.arrowWidth
  9462. }),
  9463. attributes: {
  9464. color: Cesium.ColorGeometryInstanceAttribute.fromColor(
  9465. Cesium.Color.BLUE.withAlpha(0.6)
  9466. ),
  9467. show: new Cesium.ShowGeometryInstanceAttribute(true)
  9468. }
  9469. });
  9470. return instance;
  9471. }
  9472. _calculateSlope(ellipseResults) {
  9473. let _self = this;
  9474. let instances = [];
  9475. let polygonInstance = [];
  9476. for (let index2 = 0; index2 < ellipseResults.length; index2++) {
  9477. const ellipse = ellipseResults[index2];
  9478. const center2 = ellipse[0];
  9479. let heightDifference = 0;
  9480. let maxIndex = 0;
  9481. for (let i2 = 1; i2 < ellipse.length - 1; i2++) {
  9482. const point2 = ellipse[i2];
  9483. let curHD = point2.height - center2.height;
  9484. if (Math.abs(curHD) > heightDifference) {
  9485. heightDifference = curHD;
  9486. maxIndex = i2;
  9487. }
  9488. }
  9489. let pos0 = new Cesium.Cartographic(center2.longitude, center2.latitude, 0);
  9490. let pos1 = new Cesium.Cartographic(
  9491. ellipse[maxIndex].longitude,
  9492. ellipse[maxIndex].latitude,
  9493. 0
  9494. );
  9495. let distance2 = Cesium.Cartesian3.distance(
  9496. Cesium.Cartographic.toCartesian(pos0),
  9497. Cesium.Cartographic.toCartesian(pos1)
  9498. );
  9499. let curSlope = Math.abs(heightDifference / distance2);
  9500. let curColor = _self._calculateSlopeColor(curSlope, 0.4);
  9501. const curPolygonInstance = _self._createPolygonInsrance(ellipse, curColor);
  9502. polygonInstance.push(curPolygonInstance);
  9503. let diagonalPoint = maxIndex > 4 ? ellipse[maxIndex - 4] : ellipse[maxIndex + 4];
  9504. let targetPoint = ellipse[maxIndex];
  9505. const arrowInstance = _self._createArrowInstance(targetPoint, center2, diagonalPoint, heightDifference, curSlope);
  9506. instances.push(arrowInstance);
  9507. }
  9508. const mapPrimitive = _self._viewer.scene.primitives.add(
  9509. new Cesium.GroundPrimitive({
  9510. geometryInstances: polygonInstance,
  9511. appearance: new Cesium.PerInstanceColorAppearance({
  9512. translucent: true,
  9513. closed: false
  9514. })
  9515. })
  9516. );
  9517. const arrowPrimitive = _self._viewer.scene.primitives.add(
  9518. new Cesium.GroundPolylinePrimitive({
  9519. geometryInstances: instances,
  9520. appearance: new Cesium.PolylineMaterialAppearance({
  9521. material: new Cesium.Material({
  9522. fabric: {
  9523. type: "PolylineArrow",
  9524. uniforms: {
  9525. color: new Cesium.Color(1, 1, 0, 0.8)
  9526. }
  9527. }
  9528. })
  9529. })
  9530. })
  9531. );
  9532. _self.result.push(arrowPrimitive, mapPrimitive);
  9533. }
  9534. _calculateSlopeColor(value, alpha) {
  9535. if (value < 0.00872686779075879) {
  9536. return "rgba(85,182,43," + alpha + ")";
  9537. } else if (value < 0.03492076949174773) {
  9538. return "rgba(135,211,43," + alpha + ")";
  9539. } else if (value < 0.08748866352592401) {
  9540. return "rgba(204,244,44," + alpha + ")";
  9541. } else if (value < 0.2679491924311227) {
  9542. return "rgba(245,233,44," + alpha + ")";
  9543. } else if (value < 0.7002075382097097) {
  9544. return "rgba(255,138,43," + alpha + ")";
  9545. } else if (value < 1.4281480067421144) {
  9546. return "rgba(255,84,43," + alpha + ")";
  9547. } else {
  9548. return "rgba(255,32,43," + alpha + ")";
  9549. }
  9550. }
  9551. }
  9552. Object.assign(SlopeAspect.prototype, {
  9553. createNew4Distance(points2, polygon$1, options2) {
  9554. let _self = this;
  9555. options2 = options2 || {};
  9556. options2.distance = options2.distance || 0.1;
  9557. let width2 = options2.distance * 200 > 35 ? 35 : options2.distance * 200;
  9558. _self.arrowWidth = width2 < 15 ? 15 : width2;
  9559. let positions = points2.map((point2) => {
  9560. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  9561. });
  9562. _self.clearAll();
  9563. let degrees = CoordTransform.Cartesian3ListToWGS84(positions);
  9564. let boundary = [];
  9565. let minX = 1e4, minY = 1e4, maxX = -1e4, maxY = -1e3;
  9566. for (let index2 = 0; index2 < degrees.length; index2++) {
  9567. const element = degrees[index2];
  9568. const x = element.lng;
  9569. const y = element.lat;
  9570. boundary.push([x, y]);
  9571. minX = x < minX ? x : minX;
  9572. minY = y < minY ? y : minY;
  9573. maxX = x > maxX ? x : maxX;
  9574. maxY = y > maxY ? y : maxY;
  9575. }
  9576. boundary.push(boundary[0]);
  9577. let bbox2 = [minX, minY, maxX, maxY];
  9578. polygon([boundary]);
  9579. let gridSquare = squareGrid(bbox2, options2.distance, {});
  9580. _self._createEllipse(gridSquare);
  9581. },
  9582. createNew4Num(points2, polygon$1, options2) {
  9583. let _self = this;
  9584. options2 = options2 || {};
  9585. options2.num = Cesium.defaultValue(options2.num, 10);
  9586. let positions = points2.map((point2) => {
  9587. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  9588. });
  9589. _self.clearAll();
  9590. let degrees = CoordTransform.Cartesian3ListToWGS84(positions);
  9591. let boundary = [];
  9592. let minX = 1e4, minY = 1e4, maxX = -1e4, maxY = -1e3;
  9593. for (let index2 = 0; index2 < degrees.length; index2++) {
  9594. const element = degrees[index2];
  9595. const x = element.lng;
  9596. const y = element.lat;
  9597. boundary.push([x, y]);
  9598. minX = x < minX ? x : minX;
  9599. minY = y < minY ? y : minY;
  9600. maxX = x > maxX ? x : maxX;
  9601. maxY = y > maxY ? y : maxY;
  9602. }
  9603. boundary.push(boundary[0]);
  9604. let bbox2 = [minX, minY, maxX, maxY];
  9605. let a = maxX - minX;
  9606. let b = maxY - minY;
  9607. b = b > a ? b : a;
  9608. const step = b / options2.num;
  9609. let width2 = step * 2e3 > 35 ? 35 : step * 2e3;
  9610. _self.arrowWidth = width2 < 15 ? 15 : width2;
  9611. polygon([boundary]);
  9612. let gridSquare = squareGrid(bbox2, step, {
  9613. units: "degrees"
  9614. });
  9615. _self._createEllipse(gridSquare);
  9616. },
  9617. clearAll() {
  9618. this.result.forEach((element) => {
  9619. this._viewer.scene.primitives.remove(element);
  9620. });
  9621. this.result = [];
  9622. if (this.handler) {
  9623. this.handler.destroy();
  9624. this.handler = void 0;
  9625. }
  9626. }
  9627. });
  9628. let TerrainAnalysis = {
  9629. TerrainExcavation,
  9630. SlopeAspect
  9631. };
  9632. class Weather {
  9633. constructor(viewer2) {
  9634. if (!viewer2)
  9635. throw new Cesium.DeveloperError("no viewer object!");
  9636. this._viewer = viewer2;
  9637. }
  9638. _initRain() {
  9639. this.rainStage = new Cesium.PostProcessStage({
  9640. name: "jt_rain",
  9641. fragmentShader: this._rain(),
  9642. uniforms: {
  9643. tiltAngle: () => {
  9644. return this.tiltAngle;
  9645. },
  9646. rainSize: () => {
  9647. return this.rainSize;
  9648. },
  9649. rainSpeed: () => {
  9650. return this.rainSpeed;
  9651. }
  9652. }
  9653. });
  9654. this._viewer.scene.postProcessStages.add(this.rainStage);
  9655. }
  9656. _initSnow() {
  9657. this.snowStage = new Cesium.PostProcessStage({
  9658. name: "jt_snow",
  9659. fragmentShader: this._snow(),
  9660. uniforms: {
  9661. snowSize: () => {
  9662. return this.snowSize;
  9663. },
  9664. snowSpeed: () => {
  9665. return this.snowSpeed;
  9666. }
  9667. }
  9668. });
  9669. this._viewer.scene.postProcessStages.add(this.snowStage);
  9670. }
  9671. _initFog() {
  9672. this.fogStage = new Cesium.PostProcessStage({
  9673. name: "jt_fog",
  9674. fragmentShader: this._fog(),
  9675. uniforms: {
  9676. visibility: () => {
  9677. return this.visibility;
  9678. },
  9679. fogColor: () => {
  9680. return this.color;
  9681. }
  9682. }
  9683. });
  9684. this._viewer.scene.postProcessStages.add(this.fogStage);
  9685. }
  9686. _rain() {
  9687. return "uniform sampler2D colorTexture;\n varying vec2 v_textureCoordinates;\n uniform float tiltAngle;\n uniform float rainSize;\n uniform float rainSpeed;\n float hash(float x) {\n return fract(sin(x * 133.3) * 13.13);\n }\n void main(void) {\n float time = czm_frameNumber / rainSpeed;\n vec2 resolution = czm_viewport.zw;\n vec2 uv = (gl_FragCoord.xy * 2. - resolution.xy) / min(resolution.x, resolution.y);\n vec3 c = vec3(.6, .7, .8);\n float a = tiltAngle;\n float si = sin(a), co = cos(a);\n uv *= mat2(co, -si, si, co);\n uv *= length(uv + vec2(0, 4.9)) * rainSize + 1.;\n float v = 1. - sin(hash(floor(uv.x * 100.)) * 2.);\n float b = clamp(abs(sin(20. * time * v + uv.y * (5. / (2. + v)))) - .95, 0., 1.) * 20.;\n c *= v * b;\n gl_FragColor = mix(texture2D(colorTexture, v_textureCoordinates), vec4(c, 1), .5);\n }\n ";
  9688. }
  9689. _snow() {
  9690. return "uniform sampler2D colorTexture;\n varying vec2 v_textureCoordinates;\n uniform float snowSpeed;\n uniform float snowSize;\n float snow(vec2 uv,float scale)\n {\n float time=czm_frameNumber/snowSpeed;\n float w=smoothstep(1.,0.,-uv.y*(scale/10.));if(w<.1)return 0.;\n uv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale;\n uv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d;\n p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k);\n k=smoothstep(0.,k,sin(f.x+f.y)*snowSize);\n return k*w;\n }\n void main(void){\n vec2 resolution=czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 finalColor=vec3(0);\n //float c=smoothstep(1.,0.3,clamp(uv.y*.3+.8,0.,.75));\n float c=0.;\n c+=snow(uv,30.)*.0;\n c+=snow(uv,20.)*.0;\n c+=snow(uv,15.)*.0;\n c+=snow(uv,10.);\n c+=snow(uv,8.);\n c+=snow(uv,6.);\n c+=snow(uv,5.);\n finalColor=(vec3(c));\n gl_FragColor=mix(texture2D(colorTexture,v_textureCoordinates),vec4(finalColor,1),.5);\n }\n ";
  9691. }
  9692. _fog() {
  9693. return "uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n uniform float visibility;\n uniform vec4 fogColor;\n varying vec2 v_textureCoordinates; \n void main(void) \n { \n vec4 origcolor = texture2D(colorTexture, v_textureCoordinates); \n float depth = czm_readDepth(depthTexture, v_textureCoordinates); \n vec4 depthcolor = texture2D(depthTexture, v_textureCoordinates); \n float f = visibility * (depthcolor.r - 0.3) / 0.2; \n if (f < 0.0) f = 0.0; \n else if (f > 1.0) f = 1.0; \n gl_FragColor = mix(origcolor, fogColor, f); \n }\n";
  9694. }
  9695. _removeSnow() {
  9696. if (!this._viewer || !this.snowStage)
  9697. return;
  9698. this._viewer.scene.postProcessStages.remove(this.snowStage);
  9699. delete this.snowSize;
  9700. delete this.snowSpeed;
  9701. }
  9702. _removeRain() {
  9703. if (!this._viewer || !this.rainStage)
  9704. return;
  9705. this._viewer.scene.postProcessStages.remove(this.rainStage);
  9706. delete this.tiltAngle;
  9707. delete this.rainSize;
  9708. delete this.rainSpeed;
  9709. }
  9710. _removeFog() {
  9711. if (!this._viewer || !this.fogStage)
  9712. return;
  9713. this._viewer.scene.postProcessStages.remove(this.fogStage);
  9714. delete this.visibility;
  9715. delete this.color;
  9716. }
  9717. }
  9718. Object.assign(Weather.prototype, {
  9719. addRainEffect(options2) {
  9720. options2 = options2 || {};
  9721. this.tiltAngle = Cesium.defaultValue(options2.tiltAngle, -0.6);
  9722. this.rainSize = Cesium.defaultValue(options2.rainSize, 0.3);
  9723. this.rainSpeed = Cesium.defaultValue(options2.rainSpeed, 60);
  9724. this._initRain();
  9725. },
  9726. addSnowEffect(options2) {
  9727. options2 = options2 || {};
  9728. this.snowSize = Cesium.defaultValue(options2.snowSize, 0.02);
  9729. this.snowSpeed = Cesium.defaultValue(options2.snowSpeed, 60);
  9730. this._initSnow();
  9731. },
  9732. addFogEffect(options2) {
  9733. options2 = options2 || {};
  9734. this.visibility = Cesium.defaultValue(options2.visibility, 0.1);
  9735. this.color = Cesium.defaultValue(options2.color, new Cesium.Color(0.8, 0.8, 0.8, 0.5));
  9736. this._show = Cesium.defaultValue(options2.show, true);
  9737. this._initFog();
  9738. },
  9739. removeEffect() {
  9740. if (this.snowStage) {
  9741. this._removeSnow();
  9742. }
  9743. if (this.rainStage) {
  9744. this._removeRain();
  9745. }
  9746. if (this.fogStage) {
  9747. this._removeFog();
  9748. }
  9749. }
  9750. });
  9751. const BoxGeometry = Cesium.BoxGeometry;
  9752. const Cartesian3 = Cesium.Cartesian3;
  9753. const defaultValue = Cesium.defaultValue;
  9754. const defined = Cesium.defined;
  9755. const destroyObject = Cesium.destroyObject;
  9756. const DeveloperError$1 = Cesium.DeveloperError;
  9757. const GeometryPipeline = Cesium.GeometryPipeline;
  9758. const Matrix3 = Cesium.Matrix3;
  9759. const Matrix4 = Cesium.Matrix4;
  9760. const Transforms = Cesium.Transforms;
  9761. const VertexFormat = Cesium.VertexFormat;
  9762. const BufferUsage = Cesium.BufferUsage;
  9763. const CubeMap = Cesium.CubeMap;
  9764. const DrawCommand = Cesium.DrawCommand;
  9765. const loadCubeMap = Cesium.loadCubeMap;
  9766. const RenderState = Cesium.RenderState;
  9767. const VertexArray = Cesium.VertexArray;
  9768. const BlendingState = Cesium.BlendingState;
  9769. const SceneMode = Cesium.SceneMode;
  9770. const ShaderProgram = Cesium.ShaderProgram;
  9771. const ShaderSource = Cesium.ShaderSource;
  9772. const SkyBoxFS = "uniform samplerCube u_cubeMap;\n varying vec3 v_texCoord;\n void main()\n {\n vec4 color = textureCube(u_cubeMap, normalize(v_texCoord));\n gl_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n }\n ";
  9773. const SkyBoxVS = "attribute vec3 position;\n varying vec3 v_texCoord;\n uniform mat3 u_rotateMatrix;\n void main()\n {\n vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\n gl_Position = czm_projection * vec4(p, 1.0);\n v_texCoord = position.xyz;\n }\n ";
  9774. if (!Cesium.defined(Cesium.Matrix4.getRotation)) {
  9775. Cesium.Matrix4.getRotation = Cesium.Matrix4.getMatrix3;
  9776. }
  9777. class SkyBoxOnGround {
  9778. constructor(options2) {
  9779. this.sources = options2.sources;
  9780. this._sources = void 0;
  9781. this.show = defaultValue(options2.show, true);
  9782. this._command = new DrawCommand({
  9783. modelMatrix: Matrix4.clone(Matrix4.IDENTITY),
  9784. owner: this
  9785. });
  9786. this._cubeMap = void 0;
  9787. this._attributeLocations = void 0;
  9788. this._useHdr = void 0;
  9789. }
  9790. }
  9791. const skyboxMatrix3 = new Matrix3();
  9792. SkyBoxOnGround.prototype.update = function(frameState, useHdr) {
  9793. const that = this;
  9794. if (!this.show) {
  9795. return void 0;
  9796. }
  9797. if (frameState.mode !== SceneMode.SCENE3D && frameState.mode !== SceneMode.MORPHING) {
  9798. return void 0;
  9799. }
  9800. if (!frameState.passes.render) {
  9801. return void 0;
  9802. }
  9803. const context = frameState.context;
  9804. if (this._sources !== this.sources) {
  9805. this._sources = this.sources;
  9806. const sources = this.sources;
  9807. if (!defined(sources.positiveX) || !defined(sources.negativeX) || !defined(sources.positiveY) || !defined(sources.negativeY) || !defined(sources.positiveZ) || !defined(sources.negativeZ)) {
  9808. throw new DeveloperError$1(
  9809. "this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties."
  9810. );
  9811. }
  9812. if (typeof sources.positiveX !== typeof sources.negativeX || typeof sources.positiveX !== typeof sources.positiveY || typeof sources.positiveX !== typeof sources.negativeY || typeof sources.positiveX !== typeof sources.positiveZ || typeof sources.positiveX !== typeof sources.negativeZ) {
  9813. throw new DeveloperError$1(
  9814. "this.sources properties must all be the same type."
  9815. );
  9816. }
  9817. if (typeof sources.positiveX === "string") {
  9818. loadCubeMap(context, this._sources).then(function(cubeMap) {
  9819. that._cubeMap = that._cubeMap && that._cubeMap.destroy();
  9820. that._cubeMap = cubeMap;
  9821. });
  9822. } else {
  9823. this._cubeMap = this._cubeMap && this._cubeMap.destroy();
  9824. this._cubeMap = new CubeMap({
  9825. context,
  9826. source: sources
  9827. });
  9828. }
  9829. }
  9830. const command = this._command;
  9831. command.modelMatrix = Transforms.eastNorthUpToFixedFrame(
  9832. frameState.camera._positionWC
  9833. );
  9834. if (!defined(command.vertexArray)) {
  9835. command.uniformMap = {
  9836. u_cubeMap: function() {
  9837. return that._cubeMap;
  9838. },
  9839. u_rotateMatrix: function() {
  9840. return Matrix4.getRotation(command.modelMatrix, skyboxMatrix3);
  9841. }
  9842. };
  9843. const geometry2 = BoxGeometry.createGeometry(
  9844. BoxGeometry.fromDimensions({
  9845. dimensions: new Cartesian3(2, 2, 2),
  9846. vertexFormat: VertexFormat.POSITION_ONLY
  9847. })
  9848. );
  9849. const attributeLocations = this._attributeLocations = GeometryPipeline.createAttributeLocations(
  9850. geometry2
  9851. );
  9852. command.vertexArray = VertexArray.fromGeometry({
  9853. context,
  9854. geometry: geometry2,
  9855. attributeLocations,
  9856. bufferUsage: BufferUsage._DRAW
  9857. });
  9858. command.renderState = RenderState.fromCache({
  9859. blending: BlendingState.ALPHA_BLEND
  9860. });
  9861. }
  9862. if (!defined(command.shaderProgram) || this._useHdr !== useHdr) {
  9863. const fs = new ShaderSource({
  9864. defines: [useHdr ? "HDR" : ""],
  9865. sources: [SkyBoxFS]
  9866. });
  9867. command.shaderProgram = ShaderProgram.fromCache({
  9868. context,
  9869. vertexShaderSource: SkyBoxVS,
  9870. fragmentShaderSource: fs,
  9871. attributeLocations: this._attributeLocations
  9872. });
  9873. this._useHdr = useHdr;
  9874. }
  9875. if (!defined(this._cubeMap)) {
  9876. return void 0;
  9877. }
  9878. return command;
  9879. };
  9880. SkyBoxOnGround.prototype.isDestroyed = function() {
  9881. return false;
  9882. };
  9883. SkyBoxOnGround.prototype.destroy = function() {
  9884. const command = this._command;
  9885. command.vertexArray = command.vertexArray && command.vertexArray.destroy();
  9886. command.shaderProgram = command.shaderProgram && command.shaderProgram.destroy();
  9887. this._cubeMap = this._cubeMap && this._cubeMap.destroy();
  9888. return destroyObject(this);
  9889. };
  9890. class SkyBox {
  9891. constructor(viewer2) {
  9892. if (!viewer2)
  9893. throw new Cesium.DeveloperError("no viewer object!");
  9894. this._viewer = viewer2;
  9895. this._farSkyBox = viewer2.scene.skyBox;
  9896. }
  9897. }
  9898. Object.assign(SkyBox.prototype, {
  9899. setGroundSkyBox(options2) {
  9900. options2 = options2 || {};
  9901. options2.height = options2.height || 2e5;
  9902. options2.type = options2.type || "\u84DD\u5929";
  9903. if (!options2.sources) {
  9904. switch (options2.type) {
  9905. case "\u665A\u971E":
  9906. options2.sources = {
  9907. positiveX: "jt3dSDK/imgs/skybox/01/px.png",
  9908. negativeX: "jt3dSDK/imgs/skybox/01/nx.png",
  9909. positiveY: "jt3dSDK/imgs/skybox/01/py.png",
  9910. negativeY: "jt3dSDK/imgs/skybox/01/ny.png",
  9911. positiveZ: "jt3dSDK/imgs/skybox/01/pz.png",
  9912. negativeZ: "jt3dSDK/imgs/skybox/01/nz.png"
  9913. };
  9914. break;
  9915. case "\u9634\u5929":
  9916. options2.sources = {
  9917. positiveX: "jt3dSDK/imgs/skybox/02/px.jpg",
  9918. negativeX: "jt3dSDK/imgs/skybox/02/nx.jpg",
  9919. positiveY: "jt3dSDK/imgs/skybox/02/py.jpg",
  9920. negativeY: "jt3dSDK/imgs/skybox/02/ny.jpg",
  9921. positiveZ: "jt3dSDK/imgs/skybox/02/pz.jpg",
  9922. negativeZ: "jt3dSDK/imgs/skybox/02/nz.jpg"
  9923. };
  9924. break;
  9925. case "\u84DD\u5929":
  9926. options2.sources = {
  9927. positiveX: "jt3dSDK/imgs/skybox/03/px.jpg",
  9928. negativeX: "jt3dSDK/imgs/skybox/03/nx.jpg",
  9929. positiveY: "jt3dSDK/imgs/skybox/03/py.jpg",
  9930. negativeY: "jt3dSDK/imgs/skybox/03/ny.jpg",
  9931. positiveZ: "jt3dSDK/imgs/skybox/03/pz.jpg",
  9932. negativeZ: "jt3dSDK/imgs/skybox/03/nz.jpg"
  9933. };
  9934. break;
  9935. case "\u7D2B\u8272\u661F\u7A7A":
  9936. options2.sources = {
  9937. positiveX: "jt3dSDK/imgs/skybox/04/px.jpg",
  9938. negativeX: "jt3dSDK/imgs/skybox/04/nx.jpg",
  9939. positiveY: "jt3dSDK/imgs/skybox/04/py.jpg",
  9940. negativeY: "jt3dSDK/imgs/skybox/04/ny.jpg",
  9941. positiveZ: "jt3dSDK/imgs/skybox/04/pz.jpg",
  9942. negativeZ: "jt3dSDK/imgs/skybox/04/nz.jpg"
  9943. };
  9944. break;
  9945. case "\u84DD\u8272\u661F\u7A7A":
  9946. options2.sources = {
  9947. positiveX: "jt3dSDK/imgs/skybox/05/px.jpg",
  9948. negativeX: "jt3dSDK/imgs/skybox/05/nx.jpg",
  9949. positiveY: "jt3dSDK/imgs/skybox/05/py.jpg",
  9950. negativeY: "jt3dSDK/imgs/skybox/05/ny.jpg",
  9951. positiveZ: "jt3dSDK/imgs/skybox/05/pz.jpg",
  9952. negativeZ: "jt3dSDK/imgs/skybox/05/nz.jpg"
  9953. };
  9954. break;
  9955. }
  9956. } else if (!Cesium.defined(options2.sources.positiveX) || !Cesium.defined(options2.sources.negativeX) || !Cesium.defined(options2.sources.positiveY) || !Cesium.defined(options2.sources.negativeY) || !Cesium.defined(options2.sources.positiveZ) || !Cesium.defined(options2.sources.negativeZ)) {
  9957. throw new Cesium.DeveloperError(
  9958. "options.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties."
  9959. );
  9960. }
  9961. let _self = this;
  9962. let groundSkyBox = new SkyBoxOnGround({
  9963. sources: options2.sources,
  9964. show: true
  9965. });
  9966. _self._viewer.scene.postRender.addEventListener(() => {
  9967. var e = _self._viewer.camera.position;
  9968. if (Cesium.Cartographic.fromCartesian(e).height < options2.height) {
  9969. _self._viewer.scene.skyBox = groundSkyBox;
  9970. } else {
  9971. _self._viewer.scene.skyBox = _self._defaultSkyBox;
  9972. }
  9973. });
  9974. }
  9975. });
  9976. class ParticleSystem {
  9977. constructor(viewer2) {
  9978. if (!viewer2)
  9979. throw new DeveloperError("no viewer object!");
  9980. this.viewer = viewer2;
  9981. }
  9982. }
  9983. Object.assign(ParticleSystem.prototype, {
  9984. createParticleFire: function(coordinates) {
  9985. this.viewer.clock.shouldAnimate = true;
  9986. var position2 = Cesium.Cartesian3.fromDegrees(coordinates[0], coordinates[1], coordinates[2] || 0);
  9987. var entity = this.viewer.entities.add({
  9988. position: position2
  9989. });
  9990. function computeModelMatrix(entity2, time) {
  9991. var position3 = Cesium.Property.getValueOrUndefined(entity2.position);
  9992. var modelMatrix = Cesium.Transforms.eastNorthUpToFixedFrame(position3);
  9993. return modelMatrix;
  9994. }
  9995. var viewModel = {
  9996. startScale: 3,
  9997. endScale: 1.5,
  9998. minimumParticleLife: 1.5,
  9999. maximumParticleLife: 1.8,
  10000. minimumSpeed: 7,
  10001. maximumSpeed: 9,
  10002. particleSize: 2,
  10003. emissionRate: 200
  10004. };
  10005. var primitive = this.viewer.scene.primitives.add(
  10006. new Cesium.ParticleSystem({
  10007. image: "jt3dSDK/imgs/particlesystem/fire.png",
  10008. imageSize: new Cesium.Cartesian2(viewModel.particleSize, viewModel.particleSize),
  10009. startColor: new Cesium.Color(1, 1, 1, 1),
  10010. endColor: new Cesium.Color(0.5, 0, 0, 0),
  10011. startScale: viewModel.startScale,
  10012. endScale: viewModel.endScale,
  10013. minimumParticleLife: viewModel.minimumParticleLife,
  10014. maximumParticleLife: viewModel.maximumParticleLife,
  10015. minimumSpeed: viewModel.minimumSpeed,
  10016. maximumSpeed: viewModel.maximumSpeed,
  10017. emissionRate: viewModel.emissionRate,
  10018. lifetime: 16,
  10019. loop: true,
  10020. sizeInMeters: true,
  10021. emitter: new Cesium.ConeEmitter(Cesium.Math.toRadians(45)),
  10022. modelMatrix: computeModelMatrix(entity, Cesium.JulianDate.now())
  10023. })
  10024. );
  10025. entity.remove = function() {
  10026. viewer.entities.remove(entity);
  10027. viewer.scene.primitives.remove(primitive);
  10028. };
  10029. return entity;
  10030. },
  10031. createParticleWater: function(coordinates) {
  10032. let viewer2 = this.viewer;
  10033. this.viewer.clock.shouldAnimate = true;
  10034. var position2 = Cesium.Cartesian3.fromDegrees(coordinates[0], coordinates[1], coordinates[2] || 0);
  10035. var entity = this.viewer.entities.add({
  10036. position: position2
  10037. });
  10038. function computeModelMatrix(entity2, time) {
  10039. return entity2.computeModelMatrix(time, new Cesium.Matrix4());
  10040. }
  10041. function computeEmitterModelMatrix() {
  10042. let hpr = Cesium.HeadingPitchRoll.fromDegrees(viewModel.heading, viewModel.pitch, viewModel.roll);
  10043. let trs = new Cesium.TranslationRotationScale();
  10044. trs.translation = Cesium.Cartesian3.fromElements(0, 0, 1);
  10045. trs.rotation = Cesium.Quaternion.fromHeadingPitchRoll(hpr);
  10046. let Matrix42 = Cesium.Matrix4.fromTranslationRotationScale(trs);
  10047. return Matrix42;
  10048. }
  10049. function updateCallback(p, dt2) {
  10050. var gravityScratch = new Cesium.Cartesian3();
  10051. var position3 = p.position;
  10052. Cesium.Cartesian3.normalize(position3, gravityScratch);
  10053. Cesium.Cartesian3.multiplyByScalar(gravityScratch, viewModel.gravity * dt2, gravityScratch);
  10054. p.velocity = Cesium.Cartesian3.add(p.velocity, gravityScratch, p.velocity);
  10055. }
  10056. function update(scene, time) {
  10057. waterParticleSystem.modelMatrix = computeModelMatrix(entity, time);
  10058. waterParticleSystem.emitterModelMatrix = computeEmitterModelMatrix();
  10059. }
  10060. viewer2.scene.preUpdate.addEventListener(update);
  10061. var viewModel = {
  10062. startScale: 1,
  10063. endScale: 7,
  10064. minimumParticleLife: 6,
  10065. maximumParticleLife: 7,
  10066. minimumSpeed: 9,
  10067. maximumSpeed: 9.5,
  10068. particleSize: 1,
  10069. emissionRate: 60,
  10070. gravity: -4,
  10071. heading: 110,
  10072. pitch: 30,
  10073. roll: 0
  10074. };
  10075. var waterParticleSystem = new Cesium.ParticleSystem({
  10076. image: "jt3dSDK/imgs/particlesystem/water.png",
  10077. imageSize: new Cesium.Cartesian2(viewModel.particleSize, viewModel.particleSize),
  10078. startColor: new Cesium.Color(1, 1, 1, 0.6),
  10079. endColor: new Cesium.Color(0.8, 0.86, 1, 0.4),
  10080. startScale: viewModel.startScale,
  10081. endScale: viewModel.endScale,
  10082. minimumParticleLife: viewModel.minimumParticleLife,
  10083. maximumParticleLife: viewModel.maximumParticleLife,
  10084. minimumSpeed: viewModel.minimumSpeed,
  10085. maximumSpeed: viewModel.maximumSpeed,
  10086. emissionRate: viewModel.emissionRate,
  10087. sizeInMeters: true,
  10088. emitter: new Cesium.CircleEmitter(0.2),
  10089. modelMatrix: computeModelMatrix(entity),
  10090. emitterModelMatrix: computeEmitterModelMatrix(),
  10091. updateCallback
  10092. });
  10093. viewer2.scene.primitives.add(waterParticleSystem);
  10094. entity.remove = function() {
  10095. viewer2.entities.remove(entity);
  10096. viewer2.scene.primitives.remove(waterParticleSystem);
  10097. };
  10098. return entity;
  10099. }
  10100. });
  10101. let SceneEffects = {
  10102. Weather,
  10103. SkyBox,
  10104. ParticleSystem
  10105. };
  10106. class ImageLayerSplit {
  10107. constructor(viewer2) {
  10108. if (!viewer2)
  10109. throw new Cesium.DeveloperError("no viewer object!");
  10110. this._viewer = viewer2;
  10111. }
  10112. }
  10113. Object.assign(ImageLayerSplit.prototype, {
  10114. initSplit() {
  10115. let _self = this;
  10116. this.viewer = this._viewer;
  10117. let sliderDiv = document.getElementById("image_slider");
  10118. if (sliderDiv == null) {
  10119. sliderDiv = document.createElement("div");
  10120. sliderDiv.id = "image_slider";
  10121. sliderDiv.style.position = "absolute";
  10122. sliderDiv.style.left = "50%";
  10123. sliderDiv.style.top = "0px";
  10124. sliderDiv.style.backgroundColor = "#d3d3d3";
  10125. sliderDiv.style.width = "5px";
  10126. sliderDiv.style.height = "100%";
  10127. sliderDiv.style.zIndex = "9999";
  10128. sliderDiv.onmouseover = function() {
  10129. this.style.cursor = "ew-resize";
  10130. };
  10131. document.body.appendChild(sliderDiv);
  10132. }
  10133. this.slider = sliderDiv;
  10134. viewer.scene.splitPosition = this.slider.offsetLeft / this.slider.parentElement.offsetWidth;
  10135. if (this.handler) {
  10136. this.handler.destroy();
  10137. this.handler = null;
  10138. }
  10139. this.handler = new Cesium.ScreenSpaceEventHandler(this.slider);
  10140. var moveActive = false;
  10141. function move(movement) {
  10142. if (!moveActive) {
  10143. return;
  10144. }
  10145. var relativeOffset = movement.endPosition.x;
  10146. var splitPosition = (_self.slider.offsetLeft + relativeOffset) / _self.slider.parentElement.offsetWidth;
  10147. _self.slider.style.left = `${100 * splitPosition}%`;
  10148. viewer.scene.splitPosition = splitPosition;
  10149. }
  10150. this.handler.setInputAction(function() {
  10151. moveActive = true;
  10152. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  10153. this.handler.setInputAction(function() {
  10154. moveActive = true;
  10155. }, Cesium.ScreenSpaceEventType.PINCH_START);
  10156. this.handler.setInputAction(move, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  10157. this.handler.setInputAction(move, Cesium.ScreenSpaceEventType.PINCH_MOVE);
  10158. this.handler.setInputAction(function() {
  10159. moveActive = false;
  10160. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  10161. this.handler.setInputAction(function() {
  10162. moveActive = false;
  10163. }, Cesium.ScreenSpaceEventType.PINCH_END);
  10164. },
  10165. addSplitLayer(earthAtLeft, earthAtRight) {
  10166. if (this.earthAtLeft) {
  10167. this._viewer.imageryLayers.remove(this.earthAtLeft);
  10168. }
  10169. if (this.earthAtRight) {
  10170. this._viewer.imageryLayers.remove(this.earthAtRight);
  10171. }
  10172. this.earthAtLeft = earthAtLeft;
  10173. this.earthAtRight = earthAtRight;
  10174. this.earthAtLeft.splitDirection = Cesium.SplitDirection.LEFT;
  10175. this.earthAtRight.splitDirection = Cesium.SplitDirection.RIGHT;
  10176. },
  10177. removeSplitLayer() {
  10178. document.body.removeChild(this.slider);
  10179. if (this.earthAtLeft) {
  10180. this._viewer.imageryLayers.remove(this.earthAtLeft);
  10181. }
  10182. if (this.earthAtRight) {
  10183. this._viewer.imageryLayers.remove(this.earthAtRight);
  10184. }
  10185. }
  10186. });
  10187. class ViewerSplitScreen {
  10188. constructor() {
  10189. }
  10190. }
  10191. Object.assign(ViewerSplitScreen.prototype, {
  10192. initHandler(viewer1, viewer2) {
  10193. var _self = this;
  10194. if (_self.handler1 && _self.handler1.getInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE)) {
  10195. return;
  10196. }
  10197. _self.handler1 = new Cesium.ScreenSpaceEventHandler(viewer1.scene.canvas);
  10198. _self.handler2 = new Cesium.ScreenSpaceEventHandler(viewer2.scene.canvas);
  10199. _self.handler1.setInputAction(function(movement) {
  10200. var _camerca = viewer1.camera;
  10201. viewer2.camera.setView({
  10202. destination: _camerca.position,
  10203. orientation: {
  10204. direction: _camerca._direction,
  10205. up: _camerca.up,
  10206. heading: _camerca.heading,
  10207. pitch: _camerca.pitch,
  10208. roll: _camerca.roll
  10209. }
  10210. });
  10211. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  10212. _self.handler1.setInputAction(function(movement) {
  10213. var _camerca = viewer1.camera;
  10214. viewer2.camera.setView({
  10215. destination: _camerca.position,
  10216. orientation: {
  10217. direction: _camerca._direction,
  10218. up: _camerca.up,
  10219. heading: _camerca.heading,
  10220. pitch: _camerca.pitch,
  10221. roll: _camerca.roll
  10222. }
  10223. });
  10224. }, Cesium.ScreenSpaceEventType.WHEEL);
  10225. _self.handler2.setInputAction(function(movement) {
  10226. var _camerca = viewer2.camera;
  10227. viewer1.camera.setView({
  10228. destination: _camerca.position,
  10229. orientation: {
  10230. direction: _camerca._direction,
  10231. up: _camerca.up,
  10232. heading: _camerca.heading,
  10233. pitch: _camerca.pitch,
  10234. roll: _camerca.roll
  10235. }
  10236. });
  10237. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  10238. _self.handler2.setInputAction(function(movement) {
  10239. var _camerca = viewer2.camera;
  10240. viewer1.camera.setView({
  10241. destination: _camerca.position,
  10242. orientation: {
  10243. direction: _camerca._direction,
  10244. up: _camerca.up,
  10245. heading: _camerca.heading,
  10246. pitch: _camerca.pitch,
  10247. roll: _camerca.roll
  10248. }
  10249. });
  10250. }, Cesium.ScreenSpaceEventType.WHEEL);
  10251. },
  10252. clearHandler() {
  10253. var _self = this;
  10254. if (_self.handler1) {
  10255. _self.handler1.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  10256. _self.handler1.removeInputAction(Cesium.ScreenSpaceEventType.WHEEL);
  10257. }
  10258. if (_self.handler2) {
  10259. _self.handler2.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  10260. _self.handler2.removeInputAction(Cesium.ScreenSpaceEventType.WHEEL);
  10261. }
  10262. }
  10263. });
  10264. let SceneControl = {
  10265. ImageLayerSplit,
  10266. ViewerSplitScreen
  10267. };
  10268. class TrackRoam {
  10269. constructor(viewer2) {
  10270. if (!viewer2)
  10271. throw new Cesium.DeveloperError("no viewer object!");
  10272. this._viewer = viewer2;
  10273. this._draw3DObj = null;
  10274. }
  10275. _startFly(pathsData, options2) {
  10276. var _self = this;
  10277. options2 = options2 || {};
  10278. options2.time = Cesium.defaultValue(options2.time, 360);
  10279. options2.isPathShow = Cesium.defaultValue(options2.isPathShow, true);
  10280. options2.height = Cesium.defaultValue(options2.height, 5);
  10281. options2.role = Cesium.defaultValue(options2.role, 1);
  10282. this.url = options2.modelUrl;
  10283. this.time = options2.time;
  10284. this.isPathShow = options2.isPathShow;
  10285. this.height = options2.height;
  10286. this.role = options2.role;
  10287. _self.clearFlyPaths();
  10288. _self._viewer.camera.setView({
  10289. destination: pathsData.position,
  10290. orientation: pathsData.orientation
  10291. });
  10292. setTimeout(function() {
  10293. executeFly3D();
  10294. }, 200);
  10295. function executeFly3D() {
  10296. if (pathsData && pathsData.geometry) {
  10297. var positionA = pathsData.geometry.coordinates;
  10298. let positions = positionA.map((point2) => {
  10299. return Cesium.Cartesian3.fromDegrees(point2.lng, point2.lat, point2.height);
  10300. });
  10301. let distance2 = [];
  10302. for (let i2 = 0; i2 < positions.length - 1; i2++) {
  10303. let dis = Cesium.Cartesian3.distance(positions[i2], positions[i2 + 1]);
  10304. distance2.push(dis);
  10305. }
  10306. let times = [Cesium.JulianDate.fromDate(new Date())];
  10307. times.push(Cesium.JulianDate.addSeconds(times[0], _self.time, new Cesium.JulianDate()));
  10308. for (let i2 = 1; i2 < positions.length - 1; i2++) {
  10309. let s = Cesium.JulianDate.addSeconds(times[i2], _self.time * (distance2[i2] / distance2[0]), new Cesium.JulianDate());
  10310. times.push(s);
  10311. }
  10312. let oriSamples = new Cesium.SampledProperty(Cesium.Cartesian3);
  10313. oriSamples.addSamples(times, positions);
  10314. let startTime = times[0];
  10315. let stopTime = times[times.length - 1];
  10316. _self._viewer.clock.startTime = startTime.clone();
  10317. _self._viewer.clock.stopTime = stopTime.clone();
  10318. _self._viewer.clock.currentTime = startTime.clone();
  10319. _self._viewer.clock.clockRange = Cesium.ClockRange.LOOP_STOP;
  10320. _self._viewer.clock.multiplier = 10;
  10321. let timeOfResolution = 6;
  10322. let samplesNum = Math.floor(
  10323. Cesium.JulianDate.secondsDifference(stopTime, startTime) / timeOfResolution
  10324. );
  10325. let sampledPositions = [];
  10326. let sampledTimes = [];
  10327. for (let i2 = 0; i2 < samplesNum + 1; i2++) {
  10328. let sampleTime = Cesium.JulianDate.addSeconds(
  10329. startTime,
  10330. i2 * timeOfResolution,
  10331. new Cesium.JulianDate()
  10332. );
  10333. let tmpPos = oriSamples.getValue(sampleTime);
  10334. sampledPositions.push(Cesium.Cartographic.fromCartesian(tmpPos));
  10335. sampledTimes.push(sampleTime);
  10336. }
  10337. Cesium.sampleTerrainMostDetailed(
  10338. _self._viewer.terrainProvider,
  10339. sampledPositions
  10340. ).then(() => {
  10341. let carPositionProperty = new Cesium.SampledPositionProperty();
  10342. for (let i2 = 0; i2 < sampledPositions.length; i2++) {
  10343. sampledPositions[i2].height = sampledPositions[i2].height + _self.height;
  10344. }
  10345. for (let i2 = 0; i2 < samplesNum + 1; i2++) {
  10346. carPositionProperty.addSample(
  10347. sampledTimes[i2],
  10348. Cesium.Ellipsoid.WGS84.cartographicToCartesian(sampledPositions[i2])
  10349. );
  10350. }
  10351. var position2 = carPositionProperty;
  10352. _self.entityFly = _self._viewer.entities.add({
  10353. availability: new Cesium.TimeIntervalCollection([
  10354. new Cesium.TimeInterval({
  10355. start: startTime,
  10356. stop: stopTime
  10357. })
  10358. ]),
  10359. position: position2,
  10360. orientation: new Cesium.VelocityOrientationProperty(position2),
  10361. point: {
  10362. color: Cesium.Color.RED,
  10363. outlineColor: Cesium.Color.WHITE,
  10364. outlineWidth: 2,
  10365. pixelSize: 10
  10366. },
  10367. path: {
  10368. show: _self.isPathShow,
  10369. resolution: 1,
  10370. material: new Cesium.PolylineGlowMaterialProperty({
  10371. glowPower: 0.1,
  10372. color: Cesium.Color.YELLOW
  10373. }),
  10374. width: 10
  10375. }
  10376. });
  10377. if (_self.role == 0)
  10378. ;
  10379. else if (_self.role == 1) {
  10380. _self._viewer.trackedEntity = _self.entityFly;
  10381. } else if (_self.role == 2) {
  10382. _self._viewer.trackedEntity = _self.entityFly;
  10383. let exection = function TimeExecution() {
  10384. if (_self._viewer.clock.shouldAnimate === true) {
  10385. let center2 = _self.entity.position.getValue(
  10386. _self._viewer.clock.currentTime
  10387. );
  10388. let orientation = _self.entity.orientation.getValue(
  10389. _self._viewer.clock.currentTime
  10390. );
  10391. let transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(center2);
  10392. transform3 = Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromQuaternion(orientation), center2);
  10393. _self._viewer.camera.lookAtTransform(transform3, new Cesium.Cartesian3(-50, 0, 250));
  10394. }
  10395. };
  10396. _self._viewer.clock.onTick.addEventListener(exection);
  10397. } else if (_self.role == 3) {
  10398. _self._viewer.trackedEntity = _self.entityFly;
  10399. let exection = function TimeExecution() {
  10400. if (_self._viewer.clock.shouldAnimate === true) {
  10401. let center2 = _self.entity.position.getValue(
  10402. _self._viewer.clock.currentTime
  10403. );
  10404. _self._viewer.camera.lookAt(center2, new Cesium.Cartesian3(0, 0, 1e3));
  10405. }
  10406. };
  10407. _self._viewer.clock.onTick.addEventListener(exection);
  10408. }
  10409. });
  10410. } else {
  10411. return;
  10412. }
  10413. }
  10414. }
  10415. }
  10416. Object.assign(TrackRoam.prototype, {
  10417. drawFlyPaths(coordinates, options2) {
  10418. return new Promise((resolve2, reject2) => {
  10419. let _self = this;
  10420. _self.clearFlyPaths();
  10421. let position2 = _self._viewer.camera.position;
  10422. let heading = _self._viewer.camera.heading;
  10423. let pitch = _self._viewer.camera.pitch;
  10424. let roll = _self._viewer.camera.roll;
  10425. var pathsData = {
  10426. "orientation": {
  10427. "heading": heading,
  10428. "pitch": pitch,
  10429. "roll": roll
  10430. },
  10431. "position": position2,
  10432. "clampToGround": true,
  10433. "geometry": {
  10434. "type": "LineString",
  10435. "coordinates": coordinates
  10436. }
  10437. };
  10438. _self._draw3DObj = pathsData;
  10439. resolve2(true);
  10440. });
  10441. },
  10442. clearFlyPaths() {
  10443. this._draw3DObj = null;
  10444. this._viewer.trackedEntity = void 0;
  10445. this._viewer.entities.remove(this.entityFly);
  10446. },
  10447. startFly(options2, callError) {
  10448. if (this._draw3DObj) {
  10449. this._startFly(this._draw3DObj, options2);
  10450. } else {
  10451. if (callError)
  10452. callError("\u6F2B\u6E38\u8DEF\u7EBF\u4E0D\u5B58\u5728");
  10453. }
  10454. },
  10455. pauseFly() {
  10456. var clockViewModel = this._viewer.clockViewModel;
  10457. if (clockViewModel.shouldAnimate) {
  10458. clockViewModel.shouldAnimate = false;
  10459. } else if (this._viewer.clockViewModel.canAnimate) {
  10460. clockViewModel.shouldAnimate = true;
  10461. }
  10462. },
  10463. forwardFly() {
  10464. var clockViewModel = this._viewer.clockViewModel;
  10465. var multiplier = clockViewModel.multiplier;
  10466. if (multiplier < 0) {
  10467. clockViewModel.multiplier = -multiplier;
  10468. }
  10469. clockViewModel.shouldAnimate = true;
  10470. },
  10471. backwardsFly() {
  10472. var clockViewModel = this._viewer.clockViewModel;
  10473. var multiplier = clockViewModel.multiplier;
  10474. if (multiplier > 0) {
  10475. clockViewModel.multiplier = -multiplier;
  10476. }
  10477. clockViewModel.shouldAnimate = true;
  10478. },
  10479. outFly() {
  10480. var start2 = Cesium.JulianDate.fromDate(new Date());
  10481. this._viewer.clock.startTime = start2.clone();
  10482. var stop = Cesium.JulianDate.addSeconds(start2, 3e8, new Cesium.JulianDate());
  10483. this._viewer.clock.stopTime = stop.clone();
  10484. this.clearFlyPaths();
  10485. }
  10486. });
  10487. class Roaming {
  10488. constructor(viewer2, positions, options2) {
  10489. if (!viewer2)
  10490. throw new Cesium.DeveloperError("no viewer object!");
  10491. if (!positions)
  10492. throw new Cesium.DeveloperError("no positions Array!");
  10493. this.viewer = viewer2;
  10494. this.entity = void 0;
  10495. options2 = options2 || {};
  10496. options2.time = Cesium.defaultValue(options2.time, 360);
  10497. options2.speed = Cesium.defaultValue(options2.speed, 10);
  10498. options2.isPathShow = Cesium.defaultValue(options2.isPathShow, true);
  10499. options2.height = Cesium.defaultValue(options2.height, 5);
  10500. options2.role = Cesium.defaultValue(options2.role, 1);
  10501. options2.followedX = Cesium.defaultValue(options2.followedX, 50);
  10502. options2.followedZ = Cesium.defaultValue(options2.followedZ, 10);
  10503. this.time = options2.time;
  10504. this.speed = options2.speed;
  10505. this.isPathShow = options2.isPathShow;
  10506. this.height = options2.height;
  10507. this.role = options2.role;
  10508. this.followedX = options2.followedX;
  10509. this.followedZ = options2.followedZ;
  10510. this.model = options2.model;
  10511. this.billboard = options2.billboard;
  10512. this.point = options2.point;
  10513. this.label = options2.label;
  10514. this.property = this.ComputeRoamingLineProperty(positions, this.time);
  10515. }
  10516. ComputeRoamingLineProperty(Lines, time) {
  10517. let positions = [];
  10518. if (Lines[0] instanceof Cesium.Cartesian3) {
  10519. positions = Lines;
  10520. } else {
  10521. positions = Lines.map((point2) => {
  10522. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  10523. });
  10524. }
  10525. let distance2 = [];
  10526. for (let i2 = 0; i2 < positions.length - 1; i2++) {
  10527. let dis = Cesium.Cartesian3.distance(positions[i2], positions[i2 + 1]);
  10528. distance2.push(dis);
  10529. }
  10530. let times = [Cesium.JulianDate.fromDate(new Date())];
  10531. times.push(Cesium.JulianDate.addSeconds(times[0], time, new Cesium.JulianDate()));
  10532. for (let i2 = 1; i2 < positions.length - 1; i2++) {
  10533. let s = Cesium.JulianDate.addSeconds(times[i2], time * (distance2[i2] / distance2[0]), new Cesium.JulianDate());
  10534. times.push(s);
  10535. }
  10536. let oriSamples = new Cesium.SampledProperty(Cesium.Cartesian3);
  10537. oriSamples.addSamples(times, positions);
  10538. let startTime = times[0];
  10539. let stopTime = times[times.length - 1];
  10540. this.viewer.clock.startTime = startTime.clone();
  10541. this.viewer.clock.stopTime = stopTime.clone();
  10542. this.viewer.clock.currentTime = startTime.clone();
  10543. this.viewer.clock.clockRange = Cesium.ClockRange.LOOP_STOP;
  10544. this.viewer.clock.multiplier = this.speed;
  10545. let timeOfResolution = 6;
  10546. let samplesNum = Math.floor(
  10547. Cesium.JulianDate.secondsDifference(stopTime, startTime) / timeOfResolution
  10548. );
  10549. let sampledPositions = [];
  10550. let sampledTimes = [];
  10551. for (let i2 = 0; i2 < samplesNum + 1; i2++) {
  10552. let sampleTime = Cesium.JulianDate.addSeconds(
  10553. startTime,
  10554. i2 * timeOfResolution,
  10555. new Cesium.JulianDate()
  10556. );
  10557. let tmpPos = oriSamples.getValue(sampleTime);
  10558. sampledPositions.push(Cesium.Cartographic.fromCartesian(tmpPos));
  10559. sampledTimes.push(sampleTime);
  10560. }
  10561. Cesium.sampleTerrainMostDetailed(
  10562. this.viewer.terrainProvider,
  10563. sampledPositions
  10564. ).then((updatedPositions) => {
  10565. let carPositionProperty = new Cesium.SampledPositionProperty();
  10566. for (let i2 = 0; i2 < sampledPositions.length; i2++) {
  10567. sampledPositions[i2].height = sampledPositions[i2].height + this.height;
  10568. }
  10569. for (let i2 = 0; i2 < samplesNum + 1; i2++) {
  10570. carPositionProperty.addSample(
  10571. sampledTimes[i2],
  10572. Cesium.Ellipsoid.WGS84.cartographicToCartesian(sampledPositions[i2])
  10573. );
  10574. }
  10575. var position2 = carPositionProperty;
  10576. this.InitRoaming(position2, startTime, stopTime, this.isPathShow);
  10577. });
  10578. }
  10579. InitRoaming(position2, start2, stop, isPathShow) {
  10580. this.entity = this.viewer.entities.add({
  10581. availability: new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({
  10582. start: start2,
  10583. stop
  10584. })]),
  10585. position: position2,
  10586. orientation: new Cesium.VelocityOrientationProperty(position2),
  10587. path: {
  10588. resolution: 1,
  10589. material: new Cesium.PolylineGlowMaterialProperty({
  10590. glowPower: 0.1,
  10591. color: Cesium.Color.YELLOW
  10592. }),
  10593. width: 10,
  10594. show: isPathShow
  10595. }
  10596. });
  10597. if (this.model) {
  10598. let model = this.model;
  10599. this.entity.model = {
  10600. uri: model.url,
  10601. minimumPixelSize: 64,
  10602. maximumSize: 128,
  10603. maximumScale: 200,
  10604. show: true,
  10605. silhouetteColor: Cesium.Color.WHITE,
  10606. debugWireframe: false,
  10607. debugShowBoundingVolume: false,
  10608. scale: 20,
  10609. runAnimations: true
  10610. };
  10611. } else if (this.billboard) {
  10612. let billboard = this.billboard;
  10613. billboard.imgUrl = Cesium.defaultValue(billboard.imgUrl, "jt3dSDK/imgs/point/point3.png");
  10614. this.entity.billboard = {
  10615. image: billboard.imgUrl,
  10616. show: true,
  10617. width: 30,
  10618. scale: 1,
  10619. height: 30,
  10620. pixelOffset: new Cesium.Cartesian2(0, -14)
  10621. };
  10622. } else {
  10623. let point2 = {};
  10624. if (this.point) {
  10625. point2 = this.point;
  10626. }
  10627. point2.pixelSize = Cesium.defaultValue(point2.pixelSize, 10);
  10628. if (point2.color) {
  10629. if (point2.color instanceof Array) {
  10630. point2.color = new Cesium.Color(point2.color[0] / 255, point2.color[1] / 255, point2.color[2] / 255, point2.color[3]);
  10631. } else if (typeof point2.color === "string") {
  10632. point2.color = new Cesium.Color.fromCssColorString(point2.color);
  10633. } else {
  10634. point2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  10635. }
  10636. }
  10637. if (point2.outlineColor) {
  10638. if (point2.outlineColor instanceof Array) {
  10639. point2.outlineColor = new Cesium.Color(point2.outlineColor[0] / 255, point2.outlineColor[1] / 255, point2.outlineColor[2] / 255, point2.outlineColor[3]);
  10640. } else if (typeof point2.outlineColor === "string") {
  10641. point2.outlineColor = new Cesium.Color.fromCssColorString(point2.outlineColor);
  10642. } else {
  10643. point2.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  10644. }
  10645. }
  10646. point2.outlineWidth = Cesium.defaultValue(point2.outlineWidth, 2);
  10647. this.entity.point = point2;
  10648. }
  10649. if (this.label) {
  10650. let label = this.label;
  10651. label.text = Cesium.defaultValue(label.text, "");
  10652. label.font = Cesium.defaultValue(label.font, "24px Helvetica");
  10653. if (label.fillColor) {
  10654. if (label.fillColor instanceof Array) {
  10655. label.fillColor = new Cesium.Color(label.fillColor[0] / 255, label.fillColor[1] / 255, label.fillColor[2] / 255, label.fillColor[3]);
  10656. } else if (typeof label.fillColor === "string") {
  10657. label.fillColor = new Cesium.Color.fromCssColorString(label.fillColor);
  10658. } else {
  10659. label.fillColor = new Cesium.Color.fromCssColorString("#FFFF00");
  10660. }
  10661. }
  10662. if (label.outlineColor) {
  10663. if (label.outlineColor instanceof Array) {
  10664. label.outlineColor = new Cesium.Color(label.outlineColor[0] / 255, label.outlineColor[1] / 255, label.outlineColor[2] / 255, label.outlineColor[3]);
  10665. } else if (typeof label.outlineColor === "string") {
  10666. label.outlineColor = new Cesium.Color.fromCssColorString(label.outlineColor);
  10667. } else {
  10668. label.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  10669. }
  10670. }
  10671. label.outlineWidth = Cesium.defaultValue(label.outlineWidth, 1);
  10672. label.showBackground = Cesium.defaultValue(label.showBackground, false);
  10673. if (label.backgroundColor) {
  10674. if (label.backgroundColor instanceof Array) {
  10675. label.backgroundColor = new Cesium.Color(label.backgroundColor[0] / 255, label.backgroundColor[1] / 255, label.backgroundColor[2] / 255, label.backgroundColor[3]);
  10676. } else if (typeof label.backgroundColor === "string") {
  10677. label.backgroundColor = new Cesium.Color.fromCssColorString(label.backgroundColor);
  10678. } else {
  10679. label.backgroundColor = new Cesium.Color.fromCssColorString("#FFFF00");
  10680. }
  10681. }
  10682. label.pixelOffset = Cesium.defaultValue(label.pixelOffset, 0);
  10683. label.scale = Cesium.defaultValue(label.scale, 1);
  10684. label.near = Cesium.defaultValue(label.near, 150);
  10685. label.nearValue = Cesium.defaultValue(label.nearValue, 1);
  10686. label.far = Cesium.defaultValue(label.far, 2400);
  10687. label.farValue = Cesium.defaultValue(label.farValue, 0);
  10688. this.entity.label = {
  10689. text: label.text,
  10690. font: label.font,
  10691. fillColor: label.fillColor,
  10692. outlineColor: label.outlineColor,
  10693. outlineWidth: label.outlineWidth,
  10694. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  10695. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  10696. showBackground: label.showBackground,
  10697. backgroundColor: label.backgroundColor,
  10698. backgroundPadding: new Cesium.Cartesian2(6, 6),
  10699. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  10700. pixelOffset: new Cesium.Cartesian2(0, label.pixelOffset),
  10701. scale: label.scale
  10702. };
  10703. }
  10704. this.entity.position.setInterpolationOptions({
  10705. interpolationDegree: 5,
  10706. interpolationAlgorithm: Cesium.LagrangePolynomialApproximation
  10707. });
  10708. this.initRole(this.role);
  10709. }
  10710. initRole(role) {
  10711. let _self = this;
  10712. if (role == 0) {
  10713. this.viewer.trackedEntity = void 0;
  10714. let len = _self.viewer.clock.onTick.numberOfListeners;
  10715. for (let i2 = 0; i2 < len; i2++) {
  10716. _self.viewer.clock.onTick.removeEventListener(_self.viewer.clock.onTick._listeners[i2]);
  10717. }
  10718. } else if (role == 1) {
  10719. this.viewer.trackedEntity = this.entity;
  10720. let len = _self.viewer.clock.onTick.numberOfListeners;
  10721. for (let i2 = 0; i2 < len; i2++) {
  10722. _self.viewer.clock.onTick.removeEventListener(_self.viewer.clock.onTick._listeners[i2]);
  10723. }
  10724. } else if (role == 2) {
  10725. this.viewer.trackedEntity = this.entity;
  10726. let exection = function TimeExecution() {
  10727. if (_self.viewer.clock.shouldAnimate === true) {
  10728. let center2 = _self.entity.position.getValue(
  10729. _self.viewer.clock.currentTime
  10730. );
  10731. let orientation = _self.entity.orientation.getValue(
  10732. _self.viewer.clock.currentTime
  10733. );
  10734. let transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(center2);
  10735. transform3 = Cesium.Matrix4.fromRotationTranslation(Cesium.Matrix3.fromQuaternion(orientation), center2);
  10736. var transformX = _self.followedX || 50;
  10737. var transformZ = _self.followedZ || 10;
  10738. _self.viewer.camera.lookAtTransform(transform3, new Cesium.Cartesian3(transformX, 0, transformZ));
  10739. }
  10740. };
  10741. this.viewer.clock.onTick.addEventListener(exection);
  10742. } else if (role == 3) {
  10743. this.viewer.trackedEntity = this.entity;
  10744. let exection = function TimeExecution() {
  10745. if (_self.viewer.clock.shouldAnimate === true) {
  10746. let center2 = _self.entity.position.getValue(
  10747. _self.viewer.clock.currentTime
  10748. );
  10749. _self.viewer.camera.lookAt(center2, new Cesium.Cartesian3(0, 0, 1e3));
  10750. }
  10751. };
  10752. this.viewer.clock.onTick.addEventListener(exection);
  10753. }
  10754. }
  10755. PauseOrContinue(state) {
  10756. this.viewer.clock.shouldAnimate = state;
  10757. }
  10758. forwardFly() {
  10759. var multiplier = this.viewer.clock.multiplier;
  10760. if (multiplier < 0) {
  10761. this.viewer.clock.multiplier = -multiplier;
  10762. }
  10763. this.viewer.clock.shouldAnimate = true;
  10764. }
  10765. backwardsFly() {
  10766. var multiplier = this.viewer.clock.multiplier;
  10767. if (multiplier > 0) {
  10768. this.viewer.clock.multiplier = -multiplier;
  10769. }
  10770. this.viewer.clock.shouldAnimate = true;
  10771. }
  10772. ChangeRoamingSpeed(value) {
  10773. this.viewer.clock.multiplier = value;
  10774. }
  10775. EndRoaming() {
  10776. if (this.entity !== void 0) {
  10777. this.viewer.entities.remove(this.entity);
  10778. }
  10779. this.viewer.trackedEntity = void 0;
  10780. this.viewer.clock.shouldAnimate = false;
  10781. let len = this.viewer.clock.onTick.numberOfListeners;
  10782. for (let i2 = 0; i2 < len; i2++) {
  10783. this.viewer.clock.onTick.removeEventListener(this.viewer.clock.onTick._listeners[i2]);
  10784. }
  10785. }
  10786. }
  10787. class PolygonObject {
  10788. constructor(viewer2) {
  10789. if (!viewer2)
  10790. throw new Cesium.DeveloperError("no viewer object!");
  10791. this._viewer = viewer2;
  10792. this._drawEntities = [];
  10793. this._polygonEntity = null;
  10794. }
  10795. }
  10796. Object.assign(PolygonObject.prototype, {
  10797. drawPolygonByGeoJson(geoJsonUrl, options2) {
  10798. return new Promise((resolve2, reject2) => {
  10799. let _self = this;
  10800. if (!Cesium.defined(geoJsonUrl)) {
  10801. throw new Cesium.DeveloperError("geoJsonUrl is required.");
  10802. }
  10803. options2 = options2 || {};
  10804. options2.id = options2.id || setSessionid$1();
  10805. options2.clampToGround = Cesium.defaultValue(options2.clampToGround, true);
  10806. options2.color = Cesium.defaultValue(options2.color, "#FF0000");
  10807. options2.outlineColor = Cesium.defaultValue(options2.outlineColor, "#FFFF00");
  10808. options2.outlineWidth = Cesium.defaultValue(options2.outlineWidth, 1);
  10809. options2.extrudedHeight = Cesium.defaultValue(options2.extrudedHeight, 0);
  10810. let promise = Cesium.GeoJsonDataSource.load(geoJsonUrl, {
  10811. clampToGround: true,
  10812. stroke: Cesium.Color.WHITE,
  10813. strokeWidth: 3,
  10814. fill: Cesium.Color.RED.withAlpha(0.5)
  10815. });
  10816. promise.then((dataSource) => {
  10817. _self._viewer.dataSources.add(dataSource);
  10818. dataSource.name = options2.id;
  10819. let entities2 = dataSource.entities.values;
  10820. for (let index2 = 0; index2 < entities2.length; index2++) {
  10821. let entity = entities2[index2];
  10822. entity.polygon.material = new Cesium.Color.fromCssColorString(color).withAlpha(0.1);
  10823. entity.polygon.extrudedHeight = options2.extrudedHeight;
  10824. entity.polygon.fill = false;
  10825. entity.polygon.outline = false;
  10826. entity.polygon.outlineWidth = options2.outlineWidth;
  10827. entity.polygon.outlineColor = options2.outlineColor;
  10828. entity.polyline = {
  10829. positions: entity.polygon.hierarchy._value.positions,
  10830. width: entity.polygon.outlineWidth,
  10831. material: new Cesium.Color.fromCssColorString(color).withAlpha(0.1)
  10832. };
  10833. if (options2.clampToGround) {
  10834. entity.polyline.clampToGround = true;
  10835. }
  10836. }
  10837. resolve2(entities2);
  10838. });
  10839. });
  10840. },
  10841. generatePolygonByPoints(points2, options2) {
  10842. return new Promise((resolve2, reject2) => {
  10843. let _self = this;
  10844. if (!Cesium.defined(points2)) {
  10845. throw new Cesium.DeveloperError("points is required.");
  10846. }
  10847. if (points2.length < 3) {
  10848. reject2("\u9762\u5BF9\u8C61\uFF0C\u70B9\u6570\u81F3\u5C113\u4E2A");
  10849. }
  10850. let positions = points2.map((point2) => {
  10851. return Cesium.Cartesian3.fromDegrees(point2[0], point2[1], point2[2] || 0);
  10852. });
  10853. options2 = options2 || {};
  10854. options2.id = options2.id || setSessionid$1();
  10855. options2.fill = options2.fill || true;
  10856. if (options2.color) {
  10857. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  10858. } else {
  10859. options2.color = new Cesium.Color.fromCssColorString("#ff0000");
  10860. }
  10861. options2.outline = options2.outline || false;
  10862. if (options2.outlineColor) {
  10863. options2.outlineColor = new Cesium.Color(options2.outlineColor[0] / 255, options2.outlineColor[1] / 255, options2.outlineColor[2] / 255, options2.outlineColor[3]);
  10864. } else {
  10865. options2.outlineColor = new Cesium.Color.fromCssColorString("#000");
  10866. }
  10867. options2.outlineWidth = Cesium.defaultValue(options2.outlineWidth, 1);
  10868. let entity = new Cesium.Entity({
  10869. id: options2.id,
  10870. name: "Generate surfaces based on coordinate points",
  10871. polygon: {
  10872. hierarchy: positions,
  10873. material: options2.color,
  10874. fill: options2.fill,
  10875. outline: options2.outline,
  10876. outlineWidth: options2.outlineWidth,
  10877. outlineColor: options2.outlineColor
  10878. }
  10879. });
  10880. if (options2.outline) {
  10881. entity.polyline = {
  10882. positions: entity.polygon.hierarchy._value.positions,
  10883. width: options2.outlineWidth,
  10884. material: options2.outlineColor,
  10885. clampToGround: true
  10886. };
  10887. }
  10888. _self._viewer.entities.add(entity);
  10889. resolve2(entity);
  10890. });
  10891. }
  10892. });
  10893. class CircleMaterialProperty$1 {
  10894. constructor(options2) {
  10895. this._viewer = options2.viewer;
  10896. this._definitionChanged = new Cesium.Event();
  10897. this._color = void 0;
  10898. this.color = options2.color || Cesium.Color.BLUE;
  10899. this.count = options2.count || 1;
  10900. this.duration = options2.duration || 1e3;
  10901. this._time = new Date().getTime();
  10902. this._materialTypeName = "jtCircleMaterial";
  10903. this._param = {
  10904. color: this.color._value.toCssColorString(),
  10905. duration: this.duration,
  10906. count: this.count
  10907. };
  10908. Cesium.Material._materialCache.addMaterial(this._materialTypeName, {
  10909. fabric: {
  10910. type: this._materialTypeName,
  10911. uniforms: {
  10912. time: 0,
  10913. color: new Cesium.Color(1, 0, 0, 0.5),
  10914. count: 1
  10915. },
  10916. source: this._getCircleMaterial()
  10917. },
  10918. translucent: function(material) {
  10919. return true;
  10920. }
  10921. });
  10922. }
  10923. _getCircleMaterial() {
  10924. let circleMaterial = "czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n vec3 str = materialInput.str;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(time);\n if (abs(str.z) > 0.001)\n {\n //\u7740\u8272\u5668\u6E32\u67D3\u505C\u6B62\uFF0C\u4E0D\u5728\u7ED8\u5236\u5185\u5BB9 \n discard;\n }\n if (dis > 0.5)\n {\n //\u8D85\u51FA\u534A\u5F84\u8303\u56F4\u65F6\uFF0C\u7740\u8272\u5668\u6E32\u67D3\u505C\u6B62 \n discard;\n } else {\n //\u628A\u534A\u5F84\u5206\u6210count\u4EFD\uFF0C\u6BCF\u4E24\u4EFD\u4E4B\u95F4\u7684\u95F4\u9694\u8DDD\u79BB \n float perDis = 0.5 / count;\n float disNum;\n float bl = 0.0;\n //\u5FAA\u73AF\uFF0C\u6700\u591A999\u4E2A\u73AF \n for (int i = 0; i <= 999; i++)\n {\n //\u5224\u65AD\u662F\u5426\u5C5E\u4E8E\u6570\u91CF\u5185\u7684\u73AF \n if (float(i) <= count)\n {\n disNum = perDis * float(i) - dis + per / count;\n if (disNum > 0.0)\n {\n if (disNum < perDis)\n {\n bl = 1.0 - disNum / perDis;\n } else if (disNum - perDis < perDis) {\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = color.a * pow(bl, 3.0);\n }\n }\n }\n }\n return material;\n}\n";
  10925. return circleMaterial;
  10926. }
  10927. }
  10928. Object.assign(CircleMaterialProperty$1.prototype, {
  10929. getType: function(time) {
  10930. return this._materialTypeName;
  10931. },
  10932. getValue: function(time, result) {
  10933. if (!Cesium.defined(result)) {
  10934. result = {};
  10935. }
  10936. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.BLUE, result.color);
  10937. result.count = this.count;
  10938. if (this.duration) {
  10939. result.time = (new Date().getTime() - this._time) % this.duration / this.duration;
  10940. }
  10941. this._viewer.scene.requestRender();
  10942. return result;
  10943. },
  10944. equals: function(other) {
  10945. return this === other || other instanceof CircleMaterialProperty$1 && Cesium.Property.equals(this._color, other._color);
  10946. }
  10947. });
  10948. Object.defineProperties(CircleMaterialProperty$1.prototype, {
  10949. isConstant: {
  10950. get: function() {
  10951. return false;
  10952. }
  10953. },
  10954. definitionChanged: {
  10955. get: function() {
  10956. return this._definitionChanged;
  10957. }
  10958. },
  10959. color: Cesium.createPropertyDescriptor("color")
  10960. });
  10961. class CircleRippleMaterialProperty {
  10962. constructor(options2) {
  10963. this._definitionChanged = new Cesium.Event();
  10964. this._color = void 0;
  10965. this._speed = void 0;
  10966. this.color = options2.color;
  10967. this.speed = options2.speed;
  10968. this.count = options2.count;
  10969. this.gradient = options2.gradient;
  10970. }
  10971. get isConstant() {
  10972. return false;
  10973. }
  10974. get definitionChanged() {
  10975. return this._definitionChanged;
  10976. }
  10977. getType(time) {
  10978. return Cesium.Material.CircleRippleMaterialType;
  10979. }
  10980. getValue(time, result) {
  10981. if (!Cesium.defined(result)) {
  10982. result = {};
  10983. }
  10984. result.color = Cesium.Property.getValueOrDefault(this._color, time, Cesium.Color.RED, result.color);
  10985. result.speed = Cesium.Property.getValueOrDefault(this._speed, time, 10, result.speed);
  10986. result.count = this.count;
  10987. result.gradient = this.gradient;
  10988. return result;
  10989. }
  10990. equals(other) {
  10991. return this === other || other instanceof CircleRippleMaterialProperty && Cesium.Property.equals(this._color, other._color) && Cesium.Property.equals(this._speed, other._speed) && Cesium.Property.equals(this.count, other.count) && Cesium.Property.equals(this.gradient, other.gradient);
  10992. }
  10993. }
  10994. Object.defineProperties(CircleRippleMaterialProperty.prototype, {
  10995. color: Cesium.createPropertyDescriptor("color"),
  10996. speed: Cesium.createPropertyDescriptor("speed"),
  10997. count: Cesium.createPropertyDescriptor("count"),
  10998. gradient: Cesium.createPropertyDescriptor("gradient")
  10999. });
  11000. Cesium.CircleRippleMaterialProperty = CircleRippleMaterialProperty;
  11001. Cesium.Material.CircleRippleMaterialProperty = "CircleRippleMaterialProperty";
  11002. Cesium.Material.CircleRippleMaterialType = "CircleRippleMaterialType";
  11003. Cesium.Material.CircleRippleMaterialSource = `
  11004. uniform vec4 color;
  11005. uniform float speed;
  11006. uniform float count;
  11007. uniform float gradient;
  11008. czm_material czm_getMaterial(czm_materialInput materialInput)
  11009. {
  11010. czm_material material = czm_getDefaultMaterial(materialInput);
  11011. material.diffuse = 1.5 * color.rgb;
  11012. vec2 st = materialInput.st;
  11013. float dis = distance(st, vec2(0.5, 0.5));
  11014. float per = fract(czm_frameNumber * speed / 1000.0);
  11015. if(count == 1.0){
  11016. if(dis > per * 0.5){
  11017. discard;
  11018. }else {
  11019. material.alpha = color.a * dis / per / 2.0;
  11020. }
  11021. } else {
  11022. vec3 str = materialInput.str;
  11023. if(abs(str.z) > 0.001){
  11024. discard;
  11025. }
  11026. if(dis > 0.5){
  11027. discard;
  11028. } else {
  11029. float perDis = 0.5 / count;
  11030. float disNum;
  11031. float bl = 0.0;
  11032. for(int i = 0; i <= 999; i++){
  11033. if(float(i) <= count){
  11034. disNum = perDis * float(i) - dis + per / count;
  11035. if(disNum > 0.0){
  11036. if(disNum < perDis){
  11037. bl = 1.0 - disNum / perDis;
  11038. }
  11039. else if(disNum - perDis < perDis){
  11040. bl = 1.0 - abs(1.0 - disNum / perDis);
  11041. }
  11042. material.alpha = pow(bl,(1.0 + 10.0 * (1.0 - gradient)));
  11043. }
  11044. }
  11045. }
  11046. }
  11047. }
  11048. return material;
  11049. }
  11050. `;
  11051. Cesium.Material._materialCache.addMaterial(Cesium.Material.CircleRippleMaterialType, {
  11052. fabric: {
  11053. type: Cesium.Material.CircleRippleMaterialType,
  11054. uniforms: {
  11055. color: new Cesium.Color(1, 0, 0, 1),
  11056. speed: 3,
  11057. count: 4,
  11058. gradient: 0.2
  11059. },
  11060. source: Cesium.Material.CircleRippleMaterialSource
  11061. },
  11062. translucent: function(material) {
  11063. return true;
  11064. }
  11065. });
  11066. class CircleObject {
  11067. constructor(viewer2) {
  11068. if (!viewer2)
  11069. throw new Cesium.DeveloperError("no viewer object!");
  11070. this._viewer = viewer2;
  11071. }
  11072. }
  11073. Object.assign(CircleObject.prototype, {
  11074. drawCircle: function(centerPoint, radius, options2) {
  11075. return new Promise((resolve2, reject2) => {
  11076. let viewer2 = this._viewer;
  11077. if (!Cesium.defined(centerPoint)) {
  11078. throw new Cesium.DeveloperError("centerPoint is required.");
  11079. }
  11080. if (!Cesium.defined(radius)) {
  11081. throw new Cesium.DeveloperError("radius is required.");
  11082. }
  11083. let position2;
  11084. if (centerPoint instanceof Cesium.Cartesian3) {
  11085. position2 = centerPoint;
  11086. } else {
  11087. position2 = Cesium.Cartesian3.fromDegrees(centerPoint[0], centerPoint[1], centerPoint[2] || 0);
  11088. }
  11089. if (typeof radius === "number" && radius > 0) {
  11090. radius = radius;
  11091. } else {
  11092. radius = 100;
  11093. }
  11094. options2 = options2 || {};
  11095. options2.id = options2.id || setSessionid$1();
  11096. options2.clampToGround = Cesium.defaultValue(options2.clampToGround, true);
  11097. options2.CircleType = Cesium.defaultValue(options2.CircleType, "ColorCircle");
  11098. options2.duration = Cesium.defaultValue(options2.duration, 3e3);
  11099. options2.count = Cesium.defaultValue(options2.count, 1);
  11100. if (options2.color) {
  11101. if (options2.color instanceof Array) {
  11102. options2.color = new Cesium.Color(options2.color[0] / 255, options2.color[1] / 255, options2.color[2] / 255, options2.color[3]);
  11103. } else if (typeof options2.color === "string") {
  11104. options2.color = new Cesium.Color.fromCssColorString(options2.color);
  11105. } else {
  11106. options2.color = new Cesium.Color.fromCssColorString("#FFFF00");
  11107. }
  11108. }
  11109. if (options2.outlineColor) {
  11110. if (options2.outlineColor instanceof Array) {
  11111. options2.outlineColor = new Cesium.Color(options2.outlineColor[0] / 255, options2.outlineColor[1] / 255, options2.outlineColor[2] / 255, options2.outlineColor[3]);
  11112. } else if (typeof options2.outlineColor === "string") {
  11113. options2.outlineColor = new Cesium.Color.fromCssColorString(options2.outlineColor);
  11114. } else {
  11115. options2.outlineColor = new Cesium.Color.fromCssColorString("#FFFF00");
  11116. }
  11117. }
  11118. options2.outlineWidth = Cesium.defaultValue(options2.outlineWidth, 0);
  11119. let polygonMaterial = options2.color;
  11120. options2.outlineColor;
  11121. if (options2.CircleType === "DynamicCircle") {
  11122. polygonMaterial = new Cesium.CircleRippleMaterialProperty({
  11123. color: options2.color,
  11124. speed: options2.duration / 1e3,
  11125. count: options2.count,
  11126. gradient: 0.2
  11127. });
  11128. }
  11129. let entity = new Cesium.Entity({
  11130. id: options2.id,
  11131. position: position2,
  11132. ellipse: {
  11133. semiMinorAxis: radius,
  11134. semiMajorAxis: radius,
  11135. material: polygonMaterial,
  11136. outline: true,
  11137. outlineColor: options2.outlineColor,
  11138. outlineWidth: options2.outlineWidth
  11139. }
  11140. });
  11141. let flyEntity = viewer2.entities.add(entity);
  11142. resolve2(entity, flyEntity);
  11143. });
  11144. }
  11145. });
  11146. Cesium.Primitive.prototype.setUseGeometry = function(geometry2) {
  11147. this._useGeometry = geometry2;
  11148. };
  11149. Cesium.Primitive.prototype.getUseGeometry = function() {
  11150. return this._useGeometry;
  11151. };
  11152. class SketchViewModel {
  11153. constructor(viewer2, options2) {
  11154. this._viewer = viewer2;
  11155. this._init(options2);
  11156. }
  11157. _init(options2) {
  11158. this._viewer.scene.globe.depthTestAgainstTerrain = true;
  11159. this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  11160. this._entities = this._viewer.entities;
  11161. this._pointEntitys = [];
  11162. this._sketchPointImage = void 0;
  11163. this._iconNormal = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcEAYAAAAinQPXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAAB2FJREFUWMO9mHtQlNcZxn/nW65GxHtEqTEajUxVoLYRSIyipHG4qG0lajtxVIRFubgqXuOI28ZE7FAvCLKLSNKxg/FSIzdvqNE62kaRitqpYMxovBGigo4I4n6nfwjsCrsLrtjnn53vnPe87/Oc9/2+854VdBhCd6ZP6dMHlAXO/lOngrzMLz/8EEQ0ASNGANNY2aOHxYIdfHr3LuBCwPnzQIKcf/AgiJ8pQV99BfmvR4+orHxZVsLxpZFT0qd07gyP7zqrej3IInF47lwQkTLV3d1xv3KXWPT4MYhLzMzIgHpn10+Sk+Gw74w+jx79HwSGnzUYhg4FED4FBcBq/jtokOOC2oSb0FZUgHpKVoeHQ9GtGM/y8lcgMLxf5juDBwNDlOWnTgGvUdWz5wsQ7c179fUWzz9y0tX1BdZPILeqCpTtil9QEOT9c876K1faWqS07XeMzJFuboCXkpaX1w5hqxl14QJIKYRWCzLV5OXtDQXbon3c3c2/TeMoYvncucAgPrl40Y7fA0zv1QtMydKwb58FL7toRwbDYo3/0utB3OD8qlX2hIkLqalwO0b9+fLlUHJOG9vQ0P4EjfyFIdPZGfqsURampIBIlxsWLLBtL/NltF4PhUIrVq92QGDIeEOmpye4pYju164Bq6n29LTiopy8tDTIL48pSExsDq/Oj9is/eAD4CRbli1DMEFUBAYCewnUaJD8jr2lpQjpJ7M2bBBi0+L47Tt2mP2G5xhNaWnAHrLj461tKF1rasA0rW5b//6w/0rigQcPWhrZKVFXP8TkybaFyb3kXbkCbiO6fpyU1Dwq58vNG3U6BJvEiYMHEcwQW8aNA3pT7O4OaPmTiwuCnlwcNQrEDRGYmytloilj5vr1Zv+mNXVhSUnmOFYEVnt6gtM9t+8mTbKlwo5AoWdySIjteWUcIwwG2LX7o6lPnkiZULTlj/7+wEThm5oKbCBeCOANUisqkNRxLCEBSSzrYmOB3jw6c8Yi3kL5K51OyvkZGXUTJz7LSH09CIPwMBpt85CHhMf48Q4IJFPofHzsbMAAJfjIEQtXC9TZWi0wkEuKAmjEyspKpNN2pyVBQULZaIjbvXmzUDb6xF0zGJCqv+no6NGAK5fLyiz8JssVcXEWgQLUsZZxWmGbrLTN057Agfh7eNiefhpRb7h922LgOzFp2DDzxnJXrsvLE0rqOW3sTz+12h4lLfRZhuQybuXmWmQkgPzhwy0o1jlV37ljh+e3/L1LF0cEXqX04UPb0075rlovLwtBHuqZ5845T5Z37UqbEAPkzOfsUvlHXZ35saFnQ4++fe04eIfftv64tEfgdvkXeweprFIvBQaaebJH+f3x4xbPvsRPnixlQlHGtDFjWq2Wuqj0yz4+QKk4FxNjMVXD2998Y0FRKEsCAuzwzBKv2eZpR6DspxQcPWpnvrNYoNNBZOTOnRoN0ilJMzYjA3ibsKoqoIxezs6gLJbpxcVSTbyePurwYSkT76VPKSgAWQslJcAmenTrBszgP7W1wBlRmZICY2SydHIC8ZCvdTo7Ak+ri44dcySDNDTs2mVufluhThoGD4bHp6or4uOb3zWJnoqwMGAVLnfuACHscHJCiFRmhISA0BMcFob52PDC/8EDkLfkR5GRQmycN8/t8mXw8O73WVwctnvdJ3SqrQXNSJeY3bttaWhHJxMxzDh97VqQAwheutR2IC6pm/z8oOBm7LcVFVJNKNo0oUsXhBKmGR0VBfI0vkFBINzExxoNEKP+ePYsktefFmVnC2Vjvm5SZSVEpGUNefNNUH8ti8rKQCziaOfOVuL2563PP4eCjJhxK1a8hMCJJ7NTPDxAXWIaefEi0J2r/ftbMfyryDhxAkZ2u1EaHAx6oReq2rb/JiTLZKkoUHLf2//YMWCGnPf++1YM7zHw+nVQ1mlKhg2DvPeiltr+GLaj2W524Kd6zZ4NhGOQ0ophI6GSkr4Gq61VGyjx7vdZQoIdYY1xVZ06RKttS1gTHLkPLjVmGo3AJZToaCsGjSWrPFBKfH3bvta0uyR3ySlGIxS4a7trte1l244MtoRpT93XSUk0l0oruFDbqROYUtQ9X3xhLr2WaBpX4+WnOTl2hHkw9eZN0Li5dLP6Dehogc1dexslK/7MynffhbNDvZXnWq9GNJWyiKC69TlphvobtWbOHNgnZonq6hdl+xL/yTQhbKUxeOtWEP9melSUFYMWJSv/IAtNprZLUu4Rf9u6FQpdo49bfRXaBQcy2BL1p+XURYtAZrLwhx+sGDSWrDpc3ZeVBbJMPt22zY6wRj/1oep08zXMUXRABpsQFmqcHhICYiLlhw4BBWiFA/5FOXmhoc8u0Pv3vyyrDshgEwqLYnKLi4FO5OfkvPh66UdudnZHCXsFAptQ96XMW7jQTsm2xAF23roFlD6NXLy4o9m8AoHFR7SxNTWgjGOsVovtxqBxXAzEbc4cKCycN+/+/Y7n88oRvjarcNYsCDtprP/+ewjvZ1xz9SpERBp3zpz5qqP/D5zQE33tptaiAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTA0LTA5VDE2OjQyOjI5KzA4OjAwjRBbGwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wNC0wOVQxNjo0MjoyOSswODowMPxN46cAAABKdEVYdHN2ZzpiYXNlLXVyaQBmaWxlOi8vL2hvbWUvYWRtaW4vaWNvbi1mb250L3RtcC9pY29uXzJhcHo1b3VpcnV4L2Rpbmd3ZWkuc3ZncY9vkgAAAABJRU5ErkJggg==";
  11164. this._iconBlue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkEyMUE1MDg3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkEyMUE1MDc3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/grmkAAAhxSURBVHjazFoLUFVFGN49597LBdFUEpEQI0IpyxIfqU1ZkY/pNZg1RZlWY2lW4yMncxq18oHZ0+lhOaWZUo0zPjIr8W1NiubI+AxBIkRQQsQE7us8tv3P7qGL7gXOPRdzZ3bmcnf3+7/v/Lv/+f/lYkIIMpur2yBktQVO5yM7LRybIvsOFKFGCeHyQz/dFO2Ousflcg6UJSlVlqVEjHEMjNMH5tE0vVLT9ZJAQNnn9fm3d+9z3xEYioR9bNcjW9Z8Gtv35l7PUAFjnU5HLytrFUU9TgV9XXD4+PJhoyfV2/GIFO4TGD8my1lVuGXSHYNuPdyhfbv5VkVAgzWwFjAACzAvp0fwoV++uz6lxzXLolzOW1AEmz+gHCwtq3i2z52Pn2jtlgvXI1LpgQ0jeqYm74y0CGiACdjUxkir3KxMlsoKNj6WmNAlV5Kk9qiNGmBTG6vAlhV+rd1aUuGeNSNSeiSuolGo2X1cdDogbThQ79h21CMfP6NKtR4dw/edYiTSK8GhZ/aO0R7KiFV7dnPpzeFQXkppWeWY9MGj8+ifektbqzVC8KbVH6UNHdJvOw2nHUIB7vrDI89df861p0SRsUSjuiSzB4qxyYzx0TVEdBUNTnVqs7I6B4beEKOFwqThuu7X/IJ7hj/yYlGoM9NqIakpSVH7t67c3C4muq8IyKcQ9EpuddSK3xqcSHJR7g7WsSkCm8+YiSEgRuU9gMbd3k5578kufrcTC8U0eLwF/e99anhJ6Sm/HSHSid/Xv5CclJAjAjlXr+GHP6x07z9JZCSDCBfzBJapBomJabJfdKqFCiGa4RkQgrQA6p+MtbVTEn2dY2XhUz956szM6wdkLRFtsVZFrReeeaRTQte46aIxT4DgrA9ABJKRw42QTLsjimqATgUZwpxNO/0OGz3KmMvWuBFgABZgimwBB+ASbtSSp0zIHutyOuNEg9NW/e06UE49YRBi5LFB2NxaMoQg5iGJfza+Y+MwlwlmogALMIXpD+UAXIBTOEKi4rt0zg51sFft8TjN7YQbnzrbVpeeD8Q+w3fYFCQba9ha5kHABGyRTcrlCeBkVQjO/Wxeb3rA00WDb62rcbHzAARML0hBAloK+lyQ4TEHx2B4BragUS69vl06/6aLnk6LQuQ+vdMyRQMHT/ql/D9VGfEQi00PGFDYwqsP8/AsMQyJbTvABhuiFb3TU+8Otb1CCXFd1SF2gGhg/f56Bw4+B9iCJ0J5Bv93fgAbbIimd7yq/UDgZklITLQ7RTSwp9grs7MgBYXYMEQ0OTtBWBR7d5FX+NQ5J0tCHG63K0GYglSpkrklGkXY1GGKMbdo8d+qkBfn5LB0RpwOeDlc2mo9NNYHbyOMIuCRptvNsCGqXxgnS2dEoslhxMrgSDXOSbL0HlFVzSv6vlMMJigorWGpnJ2ymzRdTrENGxY4NSeE+PwBYQ3ds6tDN1IewvvFRMLQwTBMPB2lxTuEaTvnRKwI0S/U1ZeLBganRWtGwteYAOoR8EgQFsUe3DNamNpzTroVIWp1TW2xaCCrf6xKzDScaP89SRKGGBLkCSMjVo1aZRS1IZrOOalWhCgHjxTvEw3ckhylD7rOobF6ghZJphhk1TO80DK8Yab1KgJssCHMKhgnxYqQQM7i5bv9AaVONDh7VFzAqCWMekLhRZIFzzQWWLzIMjAY3qwsii2+YakDTsDNkkdoRVZbXHLyN9EglKdjh8QoUBSBcaIDEYU91cbtRi7yUFCF2OgBha9lBRZg3nWjuPQFLsDJqkfAtfWfr1jzDSHiR/zuk/GBjO5YQyqtQDU/5WYKCjo/Oicd/JmPw1xYA2sBA7AAM8RFBAEuwMnqYTei3Q95vx47U1VzTJj3uDBZNzXRl9EdUTE+SshnECJcFPOWwraNxj0GYo3OyLM1PgQYgAWYIlvAAbgAp3AKK6XyTPXZ56bOm0f3p/BFFEdr7LwZSd5xQ9wKUukUo/u4h8SdecCHzPmwdtOMJF9ciHodbE+cvmA+cAm1rVoSAsD1m3fmH127cfvSUJOiXRh98nS8/8dpXb0DknWNKB5qzsOIKlwYdIULpWMwB+ZunNrVC2tDeQIa2P552+4jfFsROxd0sbRfm5/31dyMPumZLQWkwsqA9EOTCzqCzdTGvKB7MCNWTU9s/oIOWsHh41tvGz5uNv34Fxdi64IOvNaxQ/t2aXvzVixKTUnqezkSRBqhCm4bMW7GhboGuJw7H+qQW7nEBoALFPCvOx8cP+toYUl+W4v4o6h0L9iiNkvBdnNXplYvsSEtOFddc75owLCxc6jLd7aVCMDulzlmDtgCm6FSEju38RAxztJUumTkoy+9faqyqjDSIgDzgezJi6gN+P9Is1HKjpBGz9T+U1cy+ulXZ9XU/lMRKRGABZjUEyeseCJcIY1i6BY4NmHagjlen/+CXREUow6wADMcEeEKQTxxq96wadfvCz9cvpBuBSVcEbCWYuQAFmCGSgrbSojx0qW9KmfxV5u/zP1+MTEqI6vlCNFhLWAAFsdEl1sIvIAgdTn98muL1mzZtXe1VYCtv+xbDWsBg2OR/0OIKaaB9ooHsqcsoXt8h4Uwu+P+xyfD/zwqOIatHw7YFQJvVthSUICVDxs9Kae0rOJwS2vKyk8fgbmwhq/V7fKwLYSLgWLoPLz9s59//c3mwjKMPTZ+5hswl6ceWiQ4REQIF2OE5QOHCo9NfCVndoPHW3vxHPgOxmAOzOVr0BUlhIuB0Hn2+5937p/77hcLgsMyfF7wwbKFMAZz+Fx0RQoJDsvvL8ndYYZlM8y+8/HKbXbDbKgW8ftd+qQJLQcglFZCaE3qFn81wogEh1mYE/F74bb64RnFAm/DDwy6mPdrkJLzKGfLpsj+vwIMACSZzfDJFmOPAAAAAElFTkSuQmCC";
  11165. this._iconGreen = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MjI1NDIwOUU3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MjI1NDIwOUQ3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgEE4igAAAgKSURBVHjazFoJbFRVFP3L/OlMoQXKImAFm0JbFtFKShEQI6UsggmkGKghIKTIIgZUohIDKEuLaFTQiIKyKKghqSyyF0pZbcHQsJVpoRkKbYFAW+iU2f78/313+qY+hvc78+dPkZfcMJ377rn3/Pve/fe9gVUUhfENY5eBjNbhvlnI6Bmh+KT5NzBhGigg9sb5vX3NpohhRqMwgOe4eJ7nurIsGwl69MDskiRXS7Jc7naLpx1OV/4z/V67CKpw+Gf1ZiQv9/vWyc8lTkMEpgiCIVGLrSh6ShGhX4ovlG5Mz5jToCcjXKhPIGvyOOG2JW/OywNfuBAd1WqFVhIwwAZsAQOwAPNxZoQ9f+yPHnHdn94QYRSeZ8I4XG7xnLWianq/oZOuBrvkQs0IZz27a2RCfLeCcJOAAZiAjXyM0hqblslcRfHuiV07d9zKcVwU00IDsJGPLeBLS3zBLi3O8nfuyLjuXbegKtTsOrY4Ldz22u2GPFue4bL7MlfrqWXh+xhDjNLL2EtOj0r3jI8Z70kyJcnN4aC4RGtF9eSklzIOoD/lQEsrGCLs/m3f9nxlUP98VE6j1QDz6/P5xZWLI06KJ3lGwIWdB2tfZEgkJB4oVwwzWBgsLY1d6hoWPUxSw0Tl2na8sHjYiAnvlKntmaD3SHxcrDG1f9/1aiScspOZYZ1hGm4dHnmSRyRglk+i/ITQwVywAVvAoA3kMyolufc6iEHv0uKuntkxu1ts5xyacY2nhh1TNsZcpBTxjBl2K4AQ2eD8MiITWXFDmULiYJhUNlXak7DH0d7QnvrUr1feWtgjZdxa2hILKiOzp01o1/mp9gtoOrtsZ0eXjjYXMYhEa/RFKyxmLCaCmBF/NhF633xkCxiABZg0XxADxBJq1eLnz8ycYhSE9jTl3Iq5EWeYM/wjwUPQvj1CEwHP8SMFWIBJbX9QDBALzrNmIhGdOsZkqm3sTfWbhKbgTcSSMhBLiiYcMc9I2CMswARsmk8Uy5s4r5qIsFt/WN6nVaQ5iaZcVLkoQjEpjbD++4IM+hFUQniCDMYBTMCm+USxJP6+bkVfFWRVIny/Pj3TaIpiezF3SjzFN619AaNwRLABSwzhnSOWGxLABh80sz5J8a+qLS81IsY20a1TaIrc2lzhoX3A+2Ui6FcxkRn+4f3j9UEZbdtEDcCUgycSaTbF0RQnGk7wTY79S2xIbSvGIDCPNxynPnUckyYiBpPJ2JmmKBVLuSYCXIA9EWxWWAIPYZeJZdS4cEwGTXtEMBhMNEWthHonVieB5gix2Aft/NIYk6Y9wqHmMGzH4HANHBOn6T3i8UgO2vcxfIzibTdI0Tv88Lw+NMTUHBHF6XJTz9CJQqLs7ZdkLHoIkbbyf71YgpBAbdtxTIoWInK9reEGTTGk9RCpqfGTCDJ6skE2kxL2QRk4JlkLEc+dmrorNEVGTIbo7VxFgowUQlYU4oxCnFMAe0LMBJFmgmPyaCEinrt45TRNkRyZLA8SBkleMj5CMvGclCBJMIQdJgAC2OCDZoZjErUQcees3njK5RZtNOWy2GUu1sk2nidcOAiPX2aUAHvC/1yCBDDh1Khyw2KDmLBF8Bkpt1bWXSm/fpKmhOPp9OjpIhyKGCcWHxkPpQj4b2oPQcJnj7AAMy06jbo/IBaISWtGwF3Dj5tzf1PIIyQx1nRf40phUiTmQWMQTaTI/ePx2wPEPvAF7xWEAViAqXIRoUAsEJPWze6tdn8dOF5y63ZNCbXv4SKVvYl7HSkKItPQGMwjpFx+4he8V5AtYAAWYNJ8QQwQC0bQfLASq2/duTvjveXL0fqkvog6GDooR3sdtWdFZomsjW18Xj5SdhXBwYOADdgW9CpwAJbK3nDMWpC9AmJRW1aBiABww8GCwkt/7s5fpzbJzJmZ9XHrnYfiDtkHSgMlph59CSXC9y8phA7m5sXl2cFWLRMwwPe+w6cuYvqKngs6uFp4tvDApmUv9ktKC1RZSxwl3I66HYaD9QcNFtHC+RpAaDuShCR5RPQIz7h24zy9zb3lQFjFF0oPpY6Yuhh9vIaJ6Lqgg6y1jY5q1bPowOZV8XGxyY+jQUQVqjh15NSP6m0P4HLuntom13KJDQD1CPDa0NezFl2ylBe2NInLZdYi8IV8WvGCDJi9YC+JoXDW3qm5V5aSPmUJSnlBS5EA7P5pk5eAL/Cp1pLouY2HinEXtdLlo96Y+3ll9W1LuEkA5tjMeauQD/h9pNkqpYdIU2bq7tvKM976cFFN3f2qcJEALMBEmbiqJROhEmkig5ZAycz3s5c4nK56vSQQhg2wADMUEqESYXCTcWfX/qNnVn6zcSVaCmKoJMAWYeQAFmCqNYUtRYTBTcftnNWbDv68dedqVMZlrQBgA7aAAVgYk3ncRBTcNd189+NVuXlHi7ZpBTh07PQ2sAUMjKX8H0R8ZKB7qhqbOX8tWuNHNJTZI2MmzYPfPKowhq5rDL1E4M0q4w7qRnrGnBxrRdWFQDYVN25ehLlgg21lvXHoJoLJwInjHrz9M9/+5LPmyjLoJmYt/BTm4tZDCkcMYSGCyXjL8tnzlpJZH+QsfmB31PnPge9AB3NgLrZhnigimAyUzrs79xX8s+zLn7LJsgyfs7/esBJ0MAfPZZ5IImRZ/mrt1iO+suwrs1989+thvWVWbYT9fhc9aQUdB6CUVkNpje3SqQPDMgpZZmFO2O+FW+o/niEsyDb8qt7Rd78GLTmucrp80vz/K8AAYAEv1AHM/GwAAAAASUVORK5CYII=";
  11166. this._iconViolet = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzFDREU3Mjk3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzFDREU3Mjg3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ppb+WxIAAAhcSURBVHjazFoLcFTVGb6vvdnNY0lEEJOIxhCSKTEFKSC1osIgjqIyA62mZfAxWJU+tC3TVh2lHSGhtNOKOqK0ii+0QwcfFB+IAsKIITpJhUBDHhMiSSBCTMgm2d377PnungubnXOT3L0b6rlzmM2e83/n+87/n/+ecxbeNE3OLvLFV3Fui3KiivNSkhmTNb7EpagQQvzxg++VBvxpc2XZN1MUhEJRFHJ5nk9HO5mwAV03OnTDaFYUtTocie66pOymOjSlYnzeq0d2bn02c9oVxXcTAct8PqnYja2qakeJoFdqDx3dNH/xij4vHhGSnYHlSxf5Out3rrjmqqmHglkZa9yKQIENbIEBLGCeT4/wB/f+c1LBpXkvpsm+73IpLFFF/bKltf2esjl3NI005JL1iNBSs23B5MKJe1ItAgWYwCZj3OiWm5vOQmvt9ttzJ4zbLAhCFjdKBdhkjNcwlht+Iw0tof6zrQsKLs19jWShIeM40hASure3S727O0WloV/QehTeSo/ZsilPzjCC11+k5yzM0/yTs4yhcAgvtaW1Y2nJ7MU7yJ/GcKE1EiH8B1ueLrr2+9N3kXQadAIM7f1abK84LEcOnBFFXuREMpk8TyrHx4jhMQ1OJ5x0U+f8s8boeY9MUbLmjNedMEm6Du2rqp17w5KfNTitmRGvkcKCfHnW9NK/O4kwIjp37JdfpDUv+jSgVw+IASHAofpRef/gSttQ0Rc2sAUGq5Axs2ZM+85GcPAaWkLT528/MDF/QiXLWPtG4Rt/tM+v1vSLMi9zPl4iniCVeASeEPjB82QQj8Az8IjOaZxqapxiKpzvygy9aMs1EekCmTnrX7WdfHjSjEUbWCE2Io88cPeSnAkXjV3J9ERY5xuX7PNrNQOin0/j0kiVUQUI8llVSnjs79FHpjawBQawgMkaCxzAJdmsJT50X/ky2ecby5yllTWy+p9+MY2PkYonb60RUuER1udBoixBMgcsYDK3P4QDuIBTMkLSxo+7oNxpYfe80eaLhZPMSSSkUAU8vPWvFVr2QrdimD7xfWw7nzUZMgdMYLPGJFx+DE5uhfCbn1s9JSM9UMJqbF9TJ5O5tNZEooh48o4Lk66fwWJIJZjAZtkQLsVvbFxTapm7ECKWTSmax2oYONgjRKp7RSluYbsRwRITS9cxQcDGGCybKSWF1zuFl5MQeUwwcwaroXtbmyTRWLdFkJekKxGDwo3nz4nB+iEVY7D6Z4/JmgluroSkB/wFrIa+z7rE2DyeWwfJiEhcO2fXD3n69p9mzjrl5EqI5PfLE5hv0qZ+gach4TacRhJmwFaaB5i8KCfJ1RrxSZKfuW3oUflE8l49kvg3xmCeX2KcXK0RMut8yo7BqSqUk+DqPaJpepjpqmyfaSbs30wPx24WFsZww2koIWYkqjDP0PKkDAO7WOuheyevBRgGxQS2XJjO3LZTTqYbIUZvqO84qyFz9lidyohtzenjRYT92LiZsy9kbocpJ8ONEO1UV3cjqyHn1nxNw+6V1tgsJicmdkaJCbDxgJ1zW77G6k85aW6EqF/WNVYzc3lZtuGfGdQ1sgXHVtwW4zbM4sPJ3tYDE9gYg2VDOaluhCiV6zftjypqiNWY92iponKKdZ7QaHUjJl6EbQ8sYOY+Uqo43LCEwAncXHmkuaWtu7H5q09ZjTieZv/kEhWHIpXURDHx6ydxLcT3OSdCsQ5YwAxeyz76ggs4ufUIXNv3/MtbXzfjj5BxZeK6aYpvaoYetUhECRnVqhoNNyvkTIP5WbNOh7H+sAUGsIDpcBFhggs4uV3sVrb79459R052dh1hGgZEs+hfP4hIU9P1iEUmapFSDGWQqPjnLHlDoQKiHGyBASxgssYCB3ABp2QOVmrHyVOn7/3V6tUkPpkvImlsmln83nXh4NJcNWKGuYgRIxcTpcQIx1fynd2OvrCBbfG710WA5bA2wvevrFgDLk5hNZwQAPd9uKfq8Jvbd210BPCL3GVPfS9a+PbVYWF6QA8bEBSrYYgzI1a1Ptvfk4q+l791dRi2Tp5Awdjvf7y/joaV6eWCLpPUy6p2vPTElWUl84bLSOH6XqHn3Xapd9fXotLUJ+jdmrUBFHMkU56UaQTnkkRxc54WKAkaw2HVHjr60awb7nycfDxGhXi6oIPXsoNZGUUHdry8rrAgf9r52CCSDFU7a8Gdv+sN9eNyrsdpkbu5xAZALwE8NueW5Y8drm+uGm0R/21oOYCxyJgtGHuoK1O3l9jYFnxzqqunYcb8ZauIy/eMlghgT5+3dBXGwphOWxIvt/HIGKfJVrr5xh/+/E9tHZ31qRYBzIXlD64jY+D3kSGzlBchZz3TfSbUvPiu3z7W1X2mPVUigAVM4okmN55IVshZMSQEjtz364pV4Ui016sIghECFjCTEZGsEI5u3E5t++CTz9c+uWktCQU1WRGwJRiVwAKm06ZwtIRYL11SOyvXv/ThC5vfWW/iaOf2PEJsYAsMYFFM7nwLwQsIW5cTv/j9uq07PzmwxS3AR3urt8AWGBTL/H8IscX04zp4YflDG0iM73aRZnfffMeD+M2jnWJ4Ovx7FYI3K0IKB7Dj8xevqGxpbT80nE3r8RN16Asbamt45eFZCBWDw1AP3v7lP330j0OlZbTdvvzhP6Av3XroqeCQEiFUjJWWaw7WH7n/N5WP9w+EuxP74Du0oQ/6UhvuWyWEikHqPP3O+3u+eOIv/6iIT8v4XPG3F9eiDX1oX+5bKSQ+Lf91w+bddlq20+yfn3n1Y69p1qmk/H6XzLRJjgNIpR1IrfkXj7+Q4zkzPs2iT8rvhUfrP54RLHgbv82Ps+/XsCWnWc7TmKzx/yfAAHo1CtU9myPWAAAAAElFTkSuQmCC";
  11167. this._sketchEntityName = "sketchEntity";
  11168. this._sketchTempPoints = [];
  11169. this._sketchPoints = [];
  11170. this._sketchOutputPoints = [];
  11171. this._sketchTempPolyline = void 0;
  11172. this._sketchPolyline = void 0;
  11173. this._sketchTempPolygon = void 0;
  11174. this._sketchPolygon = void 0;
  11175. this._sketchTempAltituePolyline = void 0;
  11176. this._sketchAltitudePolyline = void 0;
  11177. this._sketchAltitudeInitHeight = 0;
  11178. this._sketchTempSpatialPolyline = void 0;
  11179. this._sketchSpatialPolyline = void 0;
  11180. this._sketchTempCircle = void 0;
  11181. this._sketchCircle = void 0;
  11182. this._sketchTempRectangle = void 0;
  11183. this._sketchRectangle = void 0;
  11184. this._sketchTempTriangleAltitudePolyline = void 0;
  11185. this._sketchTriangleAltituePolyline = void 0;
  11186. this._sketchTempSpatialTriangle = void 0;
  11187. this._sketchSpatialTriangle = void 0;
  11188. this._lineLabel = void 0;
  11189. this._polygonLabel = void 0;
  11190. options2 = options2 || {};
  11191. if (options2.isDrawPoint) {
  11192. this._isDrawPoint = options2.isDrawPoint;
  11193. } else {
  11194. this._isDrawPoint = false;
  11195. }
  11196. if (options2.isRetainDrawPoint) {
  11197. this._isRetainDrawPoint = options2.isRetainDrawPoint;
  11198. } else {
  11199. this._isRetainDrawPoint = false;
  11200. }
  11201. this._param = {
  11202. moveLineWidth: 2,
  11203. lineWidth: 2,
  11204. moveAltitudeLineWidth: 2,
  11205. altitudeLineWidth: 2,
  11206. spatialLineWidth: 2,
  11207. moveEllipseColor: [0, 255, 0, 0.5],
  11208. moveEllipseOutline: true,
  11209. moveEllipseOutlineColor: [255, 0, 0, 0.5],
  11210. moveEllipseOutlineWidth: 1,
  11211. spatialLineWidth: 2,
  11212. ellipseColor: [0, 0, 255, 0.5],
  11213. ellipseOutline: true,
  11214. ellipseOutlineColor: [255, 0, 0, 0.5],
  11215. ellipseOutlineWidth: 1
  11216. };
  11217. this._setMoveLineStyle(void 0);
  11218. this._setLineStyle(void 0);
  11219. this._setMovePolygonStyle(void 0);
  11220. this._setPolygonStyle(void 0);
  11221. this._setMoveAltitudeLineStyle(void 0);
  11222. this._setAltitudeLineStyle(void 0);
  11223. this._setMoveEllipseStyle(void 0);
  11224. this._setEllipseStyle(void 0);
  11225. this._setSpatialLineStyle(void 0);
  11226. if (options2 && options2.iconType) {
  11227. switch (options2.iconType) {
  11228. case SketchViewModel.SketchIconType.Normal:
  11229. this._sketchPointImage = this._iconNormal;
  11230. break;
  11231. case SketchViewModel.SketchIconType.Blue:
  11232. this._sketchPointImage = this._iconBlue;
  11233. break;
  11234. case SketchViewModel.SketchIconType.Green:
  11235. this._sketchPointImage = this._iconGreen;
  11236. break;
  11237. case SketchViewModel.SketchIconType.Violet:
  11238. this._sketchPointImage = this._iconViolet;
  11239. break;
  11240. default:
  11241. this._sketchPointImage = this._iconNormal;
  11242. break;
  11243. }
  11244. } else {
  11245. this._sketchPointImage = this._iconNormal;
  11246. }
  11247. }
  11248. _arcToDegree(arc) {
  11249. return arc / Math.PI * 180;
  11250. }
  11251. _toColor(red, green, blue, alpha) {
  11252. let normalColor = new Cesium.Color(0, 0, 0, 1);
  11253. if (typeof red != "number")
  11254. return normalColor;
  11255. if (typeof green != "number")
  11256. return normalColor;
  11257. if (typeof blue != "number")
  11258. return normalColor;
  11259. if (typeof alpha != "number")
  11260. return normalColor;
  11261. if (red < 0 || red > 255 || green < 0 || green > 255 || blue < 0 || blue > 255 || alpha < 0 || alpha > 1)
  11262. return normalColor;
  11263. return new Cesium.Color(red / 255, green / 255, blue / 255, alpha);
  11264. }
  11265. _toColorFromArray(array) {
  11266. if (!array || array.length === void 0 || array.length === 0)
  11267. return new Cesium.Color(255 / 255, 255 / 255, 255 / 255, 1);
  11268. let r2 = 255, g = 255, b = 255, a = 1;
  11269. if (array.length === 1) {
  11270. r2 = parseInt(array[0]);
  11271. } else if (array.length === 2) {
  11272. r2 = parseInt(array[0]);
  11273. g = parseInt(array[1]);
  11274. } else if (array.length === 3) {
  11275. r2 = parseInt(array[0]);
  11276. g = parseInt(array[1]);
  11277. b = parseInt(array[2]);
  11278. } else if (array.length >= 4) {
  11279. r2 = parseInt(array[0]);
  11280. g = parseInt(array[1]);
  11281. b = parseInt(array[2]);
  11282. a = parseFloat(array[3]);
  11283. }
  11284. return new Cesium.Color(r2 / 255, g / 255, b / 255, a);
  11285. }
  11286. _updateScene() {
  11287. this._viewer.scene.requestRender();
  11288. }
  11289. _getScreenClickPosition(screenPosition) {
  11290. let resCartesian = void 0;
  11291. let ray = this._viewer.scene.camera.getPickRay(screenPosition);
  11292. let position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  11293. Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  11294. if (Cesium.defined(position2)) {
  11295. resCartesian = {
  11296. x: position2.x,
  11297. y: position2.y,
  11298. z: position2.z
  11299. };
  11300. }
  11301. return resCartesian;
  11302. }
  11303. _getScreenClickPositionAndHeight(screenPoint) {
  11304. var lng = void 0, lat = void 0, height2 = void 0;
  11305. var ray = this._viewer.scene.camera.getPickRay(screenPoint);
  11306. var position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  11307. var cartographic = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  11308. var feature2 = this._viewer.scene.pick(screenPoint);
  11309. if (feature2 == void 0) {
  11310. lng = this._arcToDegree(cartographic.longitude);
  11311. lat = this._arcToDegree(cartographic.latitude);
  11312. height2 = cartographic.height;
  11313. } else {
  11314. var cartesian = this._viewer.scene.pickPosition(screenPoint);
  11315. if (Cesium.defined(cartesian)) {
  11316. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  11317. lng = this._arcToDegree(cartographic.longitude);
  11318. lat = this._arcToDegree(cartographic.latitude);
  11319. height2 = cartographic.height;
  11320. }
  11321. }
  11322. return {
  11323. lng,
  11324. lat,
  11325. height: height2
  11326. };
  11327. }
  11328. _transfromFromScreenPoint(screenPosition) {
  11329. let location = this._getScreenClickPositionAndHeight(screenPosition);
  11330. var cartesian = Cesium.Cartesian3.fromDegrees(location.lng, location.lat, location.height);
  11331. return {
  11332. gLocation: location,
  11333. sLocation: cartesian
  11334. };
  11335. }
  11336. _removeEntityByName(entityName) {
  11337. var entities2 = this._entities;
  11338. if (!entities2 || !entities2.values)
  11339. return;
  11340. var delEntitys = [];
  11341. for (var i2 = 0; i2 < entities2.values.length; i2++) {
  11342. if (entities2.values[i2].name == entityName) {
  11343. delEntitys.push(entities2.values[i2]);
  11344. }
  11345. }
  11346. for (var i2 = 0; i2 < delEntitys.length; i2++) {
  11347. entities2.remove(delEntitys[i2]);
  11348. }
  11349. this._updateScene();
  11350. }
  11351. _removeEntityByObject(objEntity) {
  11352. if (!Cesium.defined(objEntity))
  11353. return;
  11354. this._entities.remove(objEntity);
  11355. }
  11356. _createPoint(coord, label) {
  11357. let _self = this;
  11358. let entity = new Cesium.Entity({
  11359. name: _self._sketchEntityName + "_Point",
  11360. position: coord,
  11361. billboard: {
  11362. image: _self._sketchPointImage,
  11363. horizontalOrigin: Cesium.HorizontalOrigin.center,
  11364. verticalOrigin: Cesium.VerticalOrigin.bottom,
  11365. scale: 0.5,
  11366. pixelOffset: new Cesium.Cartesian2(0, -11),
  11367. disableDepthTestDistance: Number.POSITIVE_INFINITY
  11368. }
  11369. });
  11370. if (label) {
  11371. entity.label = {
  11372. text: label,
  11373. font: "12px sans-serif",
  11374. fillColor: this._toColor(255, 255, 255, 1),
  11375. outlineColor: this._toColor(0, 154, 94, 1),
  11376. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  11377. outlineWidth: 1,
  11378. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  11379. pixelOffset: new Cesium.Cartesian2(0, -28),
  11380. showBackground: true,
  11381. backgroundColor: this._toColor(0, 0, 0, 0.6),
  11382. disableDepthTestDistance: Number.POSITIVE_INFINITY
  11383. };
  11384. }
  11385. this._entities.add(entity);
  11386. this._pointEntitys.push(entity);
  11387. this._updateScene();
  11388. }
  11389. _removePointEntitys() {
  11390. this._removeEntityByName(this._sketchEntityName + "_Point");
  11391. this._pointEntitys = [];
  11392. }
  11393. _createTempPolyline() {
  11394. let _self = this;
  11395. if (!Cesium.defined(this._sketchTempPolyline)) {
  11396. this._sketchTempPolyline = new Cesium.Entity({
  11397. name: _self._sketchEntityName,
  11398. polyline: {
  11399. show: true,
  11400. positions: new Cesium.CallbackProperty(function() {
  11401. return _self._sketchTempPoints;
  11402. }, false),
  11403. material: _self._tempLineMaterial,
  11404. width: _self._param.moveLineWidth,
  11405. clampToGround: true
  11406. }
  11407. });
  11408. this._entities.add(this._sketchTempPolyline);
  11409. this._updateScene();
  11410. }
  11411. }
  11412. _createPolyline() {
  11413. let _self = this;
  11414. if (!Cesium.defined(this._sketchPolyline)) {
  11415. this._sketchPolyline = new Cesium.Entity({
  11416. name: _self._sketchEntityName,
  11417. polyline: {
  11418. show: true,
  11419. positions: _self._sketchPoints,
  11420. material: _self._lineMaterial,
  11421. width: _self._param.lineWidth,
  11422. clampToGround: true
  11423. }
  11424. });
  11425. this._entities.add(this._sketchPolyline);
  11426. this._updateScene();
  11427. }
  11428. }
  11429. _createTempSpatialPolyline() {
  11430. let _self = this;
  11431. if (!Cesium.defined(this._sketchTempSpatialPolyline)) {
  11432. this._sketchTempSpatialPolyline = new Cesium.Entity({
  11433. name: _self._sketchEntityName,
  11434. polyline: {
  11435. show: true,
  11436. positions: new Cesium.CallbackProperty(function() {
  11437. return _self._sketchTempPoints;
  11438. }, false),
  11439. material: _self._tempLineMaterial,
  11440. width: _self._param.moveLineWidth,
  11441. clampToGround: false
  11442. }
  11443. });
  11444. this._entities.add(this._sketchTempSpatialPolyline);
  11445. this._updateScene();
  11446. }
  11447. }
  11448. _createSpatialPolyline() {
  11449. let _self = this;
  11450. if (!Cesium.defined(this._sketchSpatialPolyline)) {
  11451. this._sketchSpatialPolyline = new Cesium.Entity({
  11452. name: _self._sketchEntityName,
  11453. polyline: {
  11454. show: true,
  11455. positions: _self._sketchPoints,
  11456. material: _self._spatialLineMaterial,
  11457. width: _self._param.spatialLineWidth,
  11458. clampToGround: false
  11459. }
  11460. });
  11461. this._entities.add(this._sketchSpatialPolyline);
  11462. this._updateScene();
  11463. }
  11464. }
  11465. _createTempPolygon() {
  11466. let _self = this;
  11467. if (!Cesium.defined(this._sketchTempPolygon)) {
  11468. this._sketchTempPolygon = new Cesium.Entity({
  11469. name: _self._sketchEntityName,
  11470. polygon: {
  11471. show: true,
  11472. hierarchy: new Cesium.CallbackProperty(function() {
  11473. return {
  11474. positions: _self._sketchTempPoints
  11475. };
  11476. }, false),
  11477. material: _self._tempPolygonMaterial,
  11478. classificationType: Cesium.ClassificationType.BOTH
  11479. }
  11480. });
  11481. this._entities.add(this._sketchTempPolygon);
  11482. this._updateScene();
  11483. }
  11484. }
  11485. _createPolygon() {
  11486. let _self = this;
  11487. if (!Cesium.defined(this._sketchPolygon)) {
  11488. this._sketchPoints.push(this._sketchPoints[0]);
  11489. this._sketchPolygon = new Cesium.Entity({
  11490. name: _self._sketchEntityName,
  11491. polygon: {
  11492. show: true,
  11493. hierarchy: {
  11494. positions: _self._sketchPoints
  11495. },
  11496. material: _self._polygonMaterial,
  11497. classificationType: Cesium.ClassificationType.BOTH
  11498. },
  11499. polyline: {
  11500. show: true,
  11501. positions: _self._sketchPoints,
  11502. material: _self._lineMaterial,
  11503. width: _self._param.lineWidth,
  11504. clampToGround: true
  11505. }
  11506. });
  11507. this._entities.add(this._sketchPolygon);
  11508. this._updateScene();
  11509. }
  11510. }
  11511. _createPolygonBody(options2) {
  11512. let _self = this;
  11513. let appendHeight = parseFloat(100);
  11514. if (options2 && options2.height && typeof options2.height === "number")
  11515. appendHeight = parseFloat(options2.height);
  11516. let wallColor = [255, 255, 0, 1];
  11517. let polygonColor = [0, 0, 255, 0.65];
  11518. if (options2 && options2.color && this._checkColorAndAlpha(options2.color))
  11519. polygonColor = this._checkColorAndAlpha(options2.color);
  11520. if (!Cesium.defined(this._sketchPolygon)) {
  11521. let shaderSource = "czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec3 str = materialInput.str;\n material.diffuse = color.rgb;\n material.alpha = color.a;\n return material;\n}";
  11522. let wallMaterial = new Cesium.Material({
  11523. fabric: {
  11524. type: "wallMaterial",
  11525. uniforms: {
  11526. color: _self._toColorFromArray(wallColor),
  11527. speed: 100
  11528. },
  11529. source: shaderSource
  11530. }
  11531. });
  11532. new Cesium.MaterialAppearance({
  11533. material: wallMaterial
  11534. });
  11535. let polygonAppearance = new Cesium.MaterialAppearance({
  11536. material: new Cesium.Material({
  11537. fabric: {
  11538. type: "Color",
  11539. uniforms: {
  11540. color: _self._toColorFromArray(polygonColor)
  11541. }
  11542. }
  11543. })
  11544. });
  11545. let wallMinimumHeights = [];
  11546. let wallMaximumHeights = [];
  11547. for (let i2 = 0; i2 < _self._sketchOutputPoints.length; i2++) {
  11548. let height3 = parseFloat(_self._sketchOutputPoints[i2].height);
  11549. wallMinimumHeights.push(height3);
  11550. wallMaximumHeights.push(height3 + appendHeight);
  11551. }
  11552. let height2 = parseFloat(_self._sketchOutputPoints[0].height);
  11553. wallMinimumHeights.push(height2);
  11554. wallMaximumHeights.push(height2 + appendHeight);
  11555. let tempPoints = [];
  11556. for (let i2 = 0; i2 < _self._sketchPoints.length; i2++) {
  11557. tempPoints.push(_self._sketchPoints[i2]);
  11558. }
  11559. tempPoints.push(_self._sketchPoints[0]);
  11560. new Cesium.WallGeometry({
  11561. positions: tempPoints,
  11562. maximumHeights: wallMaximumHeights,
  11563. minimumHeights: wallMinimumHeights
  11564. });
  11565. let polygonGeometry = new Cesium.PolygonGeometry({
  11566. polygonHierarchy: new Cesium.PolygonHierarchy(tempPoints),
  11567. perPositionHeight: true,
  11568. extrudedHeight: Math.max.apply(null, wallMaximumHeights)
  11569. });
  11570. let polygonPrimitive = new Cesium.Primitive({
  11571. geometryInstances: new Cesium.GeometryInstance({
  11572. geometry: polygonGeometry
  11573. }),
  11574. appearance: polygonAppearance,
  11575. releaseGeometryInstances: false
  11576. });
  11577. polygonPrimitive.setUseGeometry({
  11578. cPoints: _self._sketchPoints,
  11579. gPoints: _self._sketchOutputPoints,
  11580. height: appendHeight,
  11581. color: polygonColor
  11582. });
  11583. this._viewer.scene.primitives.add(polygonPrimitive);
  11584. }
  11585. }
  11586. _callUpdaeEllipseCenterPosition() {
  11587. let _self = this;
  11588. return function() {
  11589. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  11590. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11591. _self._sketchEllipseCenterPosition = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  11592. return _self._sketchEllipseCenterPosition;
  11593. };
  11594. }
  11595. _callUpdateAltitudePolylinePositions() {
  11596. let _self = this;
  11597. return function() {
  11598. _self._sketchAltitudePolylinePostions = [];
  11599. _self._sketchAltitudePolylinePostions.push(_self._sketchTempPoints[0]);
  11600. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  11601. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11602. let point_temp = Cesium.Cartesian3.fromDegrees(
  11603. Cesium.Math.toDegrees(
  11604. point1cartographic.longitude
  11605. ),
  11606. Cesium.Math.toDegrees(point1cartographic.latitude),
  11607. point2cartographic.height
  11608. );
  11609. _self._sketchAltitudePolylinePostions.push(point_temp);
  11610. return _self._sketchAltitudePolylinePostions;
  11611. };
  11612. }
  11613. _callUpdateEllipseMinorAxis() {
  11614. let _self = this;
  11615. return function() {
  11616. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  11617. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11618. let geodesic = new Cesium.EllipsoidGeodesic();
  11619. geodesic.setEndPoints(point1cartographic, point2cartographic);
  11620. _self._sketchEllipseRadius = geodesic.surfaceDistance;
  11621. if (_self._sketchEllipseRadius <= 0)
  11622. _self._sketchEllipseRadius = 1;
  11623. return _self._sketchEllipseRadius;
  11624. };
  11625. }
  11626. _callUpdateEllipseHeight() {
  11627. let _self = this;
  11628. return function() {
  11629. let cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  11630. let cartographic1 = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11631. let height_temp = cartographic1.height - cartographic.height;
  11632. _self._sketchEllipseHeight = height_temp + _self._sketchAltitudeInitHeight;
  11633. return _self._sketchEllipseHeight;
  11634. };
  11635. }
  11636. _createTempAltitudePolyline() {
  11637. let _self = this;
  11638. if (!Cesium.defined(this._sketchTempAltituePolyline)) {
  11639. this._sketchTempAltituePolyline = new Cesium.Entity({
  11640. name: _self._sketchEntityName,
  11641. position: new Cesium.CallbackProperty(
  11642. _self._callUpdaeEllipseCenterPosition(),
  11643. false
  11644. ),
  11645. polyline: {
  11646. show: true,
  11647. positions: new Cesium.CallbackProperty(
  11648. _self._callUpdateAltitudePolylinePositions(),
  11649. false
  11650. ),
  11651. material: _self._tempAlititudeLineMaterial,
  11652. width: _self._param.moveAltitudeLineWidth,
  11653. clampToGround: false
  11654. },
  11655. ellipse: {
  11656. show: true,
  11657. semiMinorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(), false),
  11658. semiMajorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(), false),
  11659. height: new Cesium.CallbackProperty(_self._callUpdateEllipseHeight(), false),
  11660. material: _self._toColorFromArray(_self._param.moveEllipseColor),
  11661. outline: _self._param.moveEllipseOutline,
  11662. outlineWidth: _self._param.moveEllipseOutlineWidth,
  11663. outlineColor: _self._toColorFromArray(_self._param.moveEllipseOutlineColor)
  11664. }
  11665. });
  11666. _self._entities.add(_self._sketchTempAltituePolyline);
  11667. }
  11668. }
  11669. _createAltitudePolyline() {
  11670. let _self = this;
  11671. if (!Cesium.defined(this._sketchAltitudePolyline)) {
  11672. this._sketchAltitudePolyline = new Cesium.Entity({
  11673. name: _self._sketchEntityName,
  11674. position: _self._sketchEllipseCenterPosition,
  11675. polyline: {
  11676. show: true,
  11677. positions: _self._sketchAltitudePolylinePostions,
  11678. material: _self._altitudeLineMaterial,
  11679. width: _self._param.altitudeLineWidth,
  11680. clampToGround: false
  11681. },
  11682. ellipse: {
  11683. show: true,
  11684. semiMinorAxis: _self._sketchEllipseRadius,
  11685. semiMajorAxis: _self._sketchEllipseRadius,
  11686. height: _self._sketchEllipseHeight,
  11687. material: _self._toColorFromArray(_self._param.ellipseColor),
  11688. outline: _self._param.ellipseOutline,
  11689. outlineWidth: _self._param.ellipseOutlineWidth,
  11690. outlineColor: _self._toColorFromArray(_self._param.ellipseOutlineColor)
  11691. }
  11692. });
  11693. _self._entities.add(_self._sketchAltitudePolyline);
  11694. }
  11695. }
  11696. _callEllipseOutlineCoordinate() {
  11697. let _self = this;
  11698. return function() {
  11699. let positionCenter = _self._sketchEllipseCenterPosition;
  11700. let positionRotate = _self._sketchTempPoints[1];
  11701. _self._ellipseOutlineCoordinates = [];
  11702. for (let angle = 5; angle < 360; ) {
  11703. let newPosition = _self._rotatedPointByAngle(positionRotate, positionCenter, angle);
  11704. _self._ellipseOutlineCoordinates.push(newPosition);
  11705. angle = angle + 5;
  11706. }
  11707. _self._ellipseOutlineCoordinates.push(_self._ellipseOutlineCoordinates[0]);
  11708. return _self._ellipseOutlineCoordinates;
  11709. };
  11710. }
  11711. _createTempCircle(centerPosition) {
  11712. let _self = this;
  11713. if (!Cesium.defined(this._sketchTempCircle)) {
  11714. _self._sketchEllipseCenterPosition = centerPosition.clone();
  11715. this._sketchTempCircle = new Cesium.Entity({
  11716. name: _self._sketchEntityName,
  11717. position: centerPosition,
  11718. polyline: {
  11719. show: true,
  11720. positions: new Cesium.CallbackProperty(_self._callEllipseOutlineCoordinate(), false),
  11721. material: _self._tempLineMaterial,
  11722. width: _self._param.moveLineWidth,
  11723. clampToGround: true
  11724. },
  11725. ellipse: {
  11726. show: true,
  11727. semiMinorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(), false),
  11728. semiMajorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(), false),
  11729. material: _self._tempPolygonMaterial,
  11730. classificationType: Cesium.ClassificationType.BOTH
  11731. }
  11732. });
  11733. _self._entities.add(_self._sketchTempCircle);
  11734. }
  11735. }
  11736. _rotatedPointByAngle(position_A, position_B, angle) {
  11737. var localToWorld_Matrix = Cesium.Transforms.eastNorthUpToFixedFrame(position_B);
  11738. var worldToLocal_Matrix = Cesium.Matrix4.inverse(localToWorld_Matrix, new Cesium.Matrix4());
  11739. Cesium.Matrix4.multiplyByPoint(worldToLocal_Matrix, position_B, new Cesium.Cartesian3());
  11740. var localPosition_A = Cesium.Matrix4.multiplyByPoint(worldToLocal_Matrix, position_A, new Cesium.Cartesian3());
  11741. var new_x = localPosition_A.x * Math.cos(Cesium.Math.toRadians(angle)) + localPosition_A.y * Math.sin(Cesium.Math.toRadians(angle));
  11742. var new_y = localPosition_A.y * Math.cos(Cesium.Math.toRadians(angle)) - localPosition_A.x * Math.sin(Cesium.Math.toRadians(angle));
  11743. var new_z = localPosition_A.z;
  11744. return Cesium.Matrix4.multiplyByPoint(
  11745. localToWorld_Matrix,
  11746. new Cesium.Cartesian3(new_x, new_y, new_z),
  11747. new Cesium.Cartesian3()
  11748. );
  11749. }
  11750. _createCircle() {
  11751. let _self = this;
  11752. if (!Cesium.defined(this._sketchCircle)) {
  11753. this._sketchCircle = new Cesium.Entity({
  11754. name: _self._sketchEntityName,
  11755. position: _self._sketchEllipseCenterPosition,
  11756. polyline: {
  11757. show: true,
  11758. positions: _self._ellipseOutlineCoordinates,
  11759. material: _self._lineMaterial,
  11760. width: _self._param.lineWidth,
  11761. clampToGround: true
  11762. },
  11763. ellipse: {
  11764. show: true,
  11765. semiMinorAxis: _self._sketchEllipseRadius,
  11766. semiMajorAxis: _self._sketchEllipseRadius,
  11767. material: _self._polygonMaterial,
  11768. classificationType: Cesium.ClassificationType.BOTH
  11769. }
  11770. });
  11771. _self._entities.add(_self._sketchCircle);
  11772. }
  11773. }
  11774. _callUpdateRectangleCoordinates() {
  11775. let _self = this;
  11776. return function() {
  11777. let lng0 = parseFloat(_self._sketchTempPoints[0].lng);
  11778. let lat0 = parseFloat(_self._sketchTempPoints[0].lat);
  11779. let lng1 = parseFloat(_self._sketchTempPoints[1].lng);
  11780. let lat1 = parseFloat(_self._sketchTempPoints[1].lat);
  11781. _self._rectangleCoordinates = [0, 0, 1, 1];
  11782. if (lng0 < lng1) {
  11783. _self._rectangleCoordinates[0] = lng0;
  11784. _self._rectangleCoordinates[2] = lng1;
  11785. } else {
  11786. _self._rectangleCoordinates[0] = lng1;
  11787. _self._rectangleCoordinates[2] = lng0;
  11788. }
  11789. if (lat0 < lat1) {
  11790. _self._rectangleCoordinates[1] = lat0;
  11791. _self._rectangleCoordinates[3] = lat1;
  11792. } else {
  11793. _self._rectangleCoordinates[1] = lat1;
  11794. _self._rectangleCoordinates[3] = lat0;
  11795. }
  11796. let rectangle = Cesium.Rectangle.fromDegrees(
  11797. _self._rectangleCoordinates[0],
  11798. _self._rectangleCoordinates[1],
  11799. _self._rectangleCoordinates[2],
  11800. _self._rectangleCoordinates[3]
  11801. );
  11802. let res = _self._calculateRectangleOutlineCoordinates(rectangle);
  11803. _self._rectangleOutlineCoordinates = res.cPoints;
  11804. _self._sketchOutputPoints = res.gPoints;
  11805. return rectangle;
  11806. };
  11807. }
  11808. _calculateRectangleOutlineCoordinates(rectangle) {
  11809. let south_east = Cesium.Rectangle.southeast(rectangle);
  11810. let se2 = Cesium.Cartographic.toCartesian(south_east);
  11811. let south_west = Cesium.Rectangle.southwest(rectangle);
  11812. let sw = Cesium.Cartographic.toCartesian(south_west);
  11813. let north_east = Cesium.Rectangle.northeast(rectangle);
  11814. let ne2 = Cesium.Cartographic.toCartesian(north_east);
  11815. let north_west = Cesium.Rectangle.northwest(rectangle);
  11816. let nw = Cesium.Cartographic.toCartesian(north_west);
  11817. let gPoints = [];
  11818. gPoints.push({
  11819. lng: Cesium.Math.toDegrees(south_west.longitude),
  11820. lat: Cesium.Math.toDegrees(south_west.latitude),
  11821. height: south_west.height
  11822. });
  11823. gPoints.push({
  11824. lng: Cesium.Math.toDegrees(south_east.longitude),
  11825. lat: Cesium.Math.toDegrees(south_east.latitude),
  11826. height: south_east.height
  11827. });
  11828. gPoints.push({
  11829. lng: Cesium.Math.toDegrees(north_east.longitude),
  11830. lat: Cesium.Math.toDegrees(north_east.latitude),
  11831. height: north_east.height
  11832. });
  11833. gPoints.push({
  11834. lng: Cesium.Math.toDegrees(north_west.longitude),
  11835. lat: Cesium.Math.toDegrees(north_west.latitude),
  11836. height: north_west.height
  11837. });
  11838. gPoints.push({
  11839. lng: Cesium.Math.toDegrees(south_west.longitude),
  11840. lat: Cesium.Math.toDegrees(south_west.latitude),
  11841. height: south_west.height
  11842. });
  11843. return {
  11844. cPoints: [sw, se2, ne2, nw, sw],
  11845. gPoints
  11846. };
  11847. }
  11848. _callUpdateRectangleOutlineCoordinates() {
  11849. let _self = this;
  11850. return function() {
  11851. return _self._rectangleOutlineCoordinates;
  11852. };
  11853. }
  11854. _createTempRectangle() {
  11855. let _self = this;
  11856. if (!Cesium.defined(this._sketchTempRectangle)) {
  11857. this._sketchTempRectangle = new Cesium.Entity({
  11858. name: _self._sketchEntityName,
  11859. polyline: {
  11860. show: true,
  11861. positions: new Cesium.CallbackProperty(_self._callUpdateRectangleOutlineCoordinates(), false),
  11862. material: _self._tempLineMaterial,
  11863. width: _self._param.moveLineWidth,
  11864. clampToGround: true
  11865. },
  11866. rectangle: {
  11867. show: true,
  11868. coordinates: new Cesium.CallbackProperty(_self._callUpdateRectangleCoordinates(), false),
  11869. material: _self._tempPolygonMaterial,
  11870. classificationType: Cesium.ClassificationType.BOTH
  11871. }
  11872. });
  11873. _self._entities.add(_self._sketchTempRectangle);
  11874. }
  11875. }
  11876. _createRectangle() {
  11877. let _self = this;
  11878. if (!Cesium.defined(this._sketchRectangle)) {
  11879. this._sketchRectangle = new Cesium.Entity({
  11880. name: _self._sketchEntityName,
  11881. polyline: {
  11882. show: true,
  11883. positions: _self._rectangleOutlineCoordinates,
  11884. material: _self._lineMaterial,
  11885. width: _self._param.lineWidth,
  11886. clampToGround: true
  11887. },
  11888. rectangle: {
  11889. show: true,
  11890. coordinates: Cesium.Rectangle.fromDegrees(_self._rectangleCoordinates[0], _self._rectangleCoordinates[1], _self._rectangleCoordinates[2], _self._rectangleCoordinates[3]),
  11891. material: _self._polygonMaterial,
  11892. classificationType: Cesium.ClassificationType.BOTH
  11893. }
  11894. });
  11895. _self._entities.add(_self._sketchRectangle);
  11896. }
  11897. }
  11898. _callUpdaeTriangleEllipseCenterPosition() {
  11899. let _self = this;
  11900. return function() {
  11901. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11902. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[2]);
  11903. _self._sketchEllipseCenterPosition = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  11904. return _self._sketchEllipseCenterPosition;
  11905. };
  11906. }
  11907. _callUpdateTriangleAltitudePolylinePositions() {
  11908. let _self = this;
  11909. return function() {
  11910. _self._sketchAltitudePolylinePostions = [];
  11911. _self._sketchAltitudePolylinePostions.push(_self._sketchTempPoints[1]);
  11912. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11913. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[2]);
  11914. let point_temp = Cesium.Cartesian3.fromDegrees(
  11915. Cesium.Math.toDegrees(
  11916. point1cartographic.longitude
  11917. ),
  11918. Cesium.Math.toDegrees(point1cartographic.latitude),
  11919. point2cartographic.height
  11920. );
  11921. _self._sketchAltitudePolylinePostions.push(point_temp);
  11922. return _self._sketchAltitudePolylinePostions;
  11923. };
  11924. }
  11925. _callUpdateTriangleEllipseMinorAxis() {
  11926. let _self = this;
  11927. return function() {
  11928. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11929. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[2]);
  11930. let geodesic = new Cesium.EllipsoidGeodesic();
  11931. geodesic.setEndPoints(point1cartographic, point2cartographic);
  11932. _self._sketchEllipseRadius = geodesic.surfaceDistance;
  11933. if (_self._sketchEllipseRadius <= 0)
  11934. _self._sketchEllipseRadius = 1;
  11935. return _self._sketchEllipseRadius;
  11936. };
  11937. }
  11938. _callUpdateTriangleEllipseHeight() {
  11939. let _self = this;
  11940. return function() {
  11941. let cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  11942. let cartographic1 = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[2]);
  11943. let height_temp = cartographic1.height - cartographic.height;
  11944. _self._sketchEllipseHeight = height_temp + _self._sketchAltitudeInitHeight;
  11945. return _self._sketchEllipseHeight;
  11946. };
  11947. }
  11948. _callUpdateTriangleSpatialPolylinePositions() {
  11949. let _self = this;
  11950. return function() {
  11951. _self._sketchTriangleSpatialPolylinePositions = [];
  11952. _self._sketchTriangleSpatialPolylinePositions.push(_self._sketchTempPoints[0]);
  11953. _self._sketchTriangleSpatialPolylinePositions.push(_self._sketchEllipseCenterPosition);
  11954. return _self._sketchTriangleSpatialPolylinePositions;
  11955. };
  11956. }
  11957. _createTriangleSpatialPolyline() {
  11958. let _self = this;
  11959. this._sketchSpatialPolyline = new Cesium.Entity({
  11960. name: _self._sketchEntityName,
  11961. polyline: {
  11962. show: true,
  11963. positions: _self._sketchTriangleSpatialPolylinePositions,
  11964. material: _self._spatialLineMaterial,
  11965. width: _self._param.spatialLineWidth,
  11966. clampToGround: false
  11967. }
  11968. });
  11969. this._entities.add(this._sketchSpatialPolyline);
  11970. }
  11971. _createTempTriangleAltitudePolylineAndSpatialPolyline() {
  11972. let _self = this;
  11973. if (!Cesium.defined(this._sketchTempTriangleAltitudePolyline) && !Cesium.defined(this._sketchTempSpatialPolyline)) {
  11974. this._sketchTempTriangleAltitudePolyline = new Cesium.Entity({
  11975. name: _self._sketchEntityName,
  11976. position: new Cesium.CallbackProperty(
  11977. _self._callUpdaeTriangleEllipseCenterPosition(),
  11978. false
  11979. ),
  11980. polyline: {
  11981. show: true,
  11982. positions: new Cesium.CallbackProperty(
  11983. _self._callUpdateTriangleAltitudePolylinePositions(),
  11984. false
  11985. ),
  11986. material: _self._tempAlititudeLineMaterial,
  11987. width: _self._param.moveAltitudeLineWidth,
  11988. clampToGround: false
  11989. },
  11990. ellipse: {
  11991. show: true,
  11992. semiMinorAxis: new Cesium.CallbackProperty(_self._callUpdateTriangleEllipseMinorAxis(), false),
  11993. semiMajorAxis: new Cesium.CallbackProperty(_self._callUpdateTriangleEllipseMinorAxis(), false),
  11994. height: new Cesium.CallbackProperty(_self._callUpdateTriangleEllipseHeight(), false),
  11995. material: _self._toColorFromArray(_self._param.moveEllipseColor),
  11996. outline: _self._param.moveEllipseOutline,
  11997. outlineWidth: _self._param.moveEllipseOutlineWidth,
  11998. outlineColor: _self._toColorFromArray(_self._param.moveEllipseOutlineColor)
  11999. }
  12000. });
  12001. _self._entities.add(_self._sketchTempTriangleAltitudePolyline);
  12002. _self._sketchTempSpatialPolyline = new Cesium.Entity({
  12003. name: _self._sketchEntityName,
  12004. polyline: {
  12005. show: true,
  12006. positions: new Cesium.CallbackProperty(_self._callUpdateTriangleSpatialPolylinePositions(), false),
  12007. material: _self._tempLineMaterial,
  12008. width: _self._param.moveLineWidth,
  12009. clampToGround: false
  12010. }
  12011. });
  12012. _self._entities.add(_self._sketchTempSpatialPolyline);
  12013. }
  12014. }
  12015. _createTempSpatialTriangle() {
  12016. let _self = this;
  12017. if (!Cesium.defined(this._sketchTempSpatialTriangle)) {
  12018. this._sketchTempSpatialTriangle = new Cesium.Entity({
  12019. name: _self._sketchEntityName,
  12020. polyline: {
  12021. show: true,
  12022. positions: new Cesium.CallbackProperty(function() {
  12023. _self._sketchSpatialTrianglePositions = [];
  12024. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[0].clone());
  12025. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[1].clone());
  12026. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  12027. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  12028. let point_temp = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  12029. _self._sketchSpatialTrianglePositions.push(point_temp);
  12030. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[0].clone());
  12031. return _self._sketchSpatialTrianglePositions;
  12032. }, false),
  12033. material: _self._tempLineMaterial,
  12034. width: _self._param.moveLineWidth,
  12035. clampToGround: false
  12036. }
  12037. });
  12038. this._entities.add(this._sketchTempSpatialTriangle);
  12039. this._updateScene();
  12040. }
  12041. }
  12042. _createSpatialTriangle() {
  12043. let _self = this;
  12044. if (!Cesium.defined(this._sketchSpatialTriangle)) {
  12045. this._sketchSpatialTriangle = new Cesium.Entity({
  12046. name: _self._sketchEntityName,
  12047. polyline: {
  12048. show: true,
  12049. positions: _self._sketchSpatialTrianglePositions,
  12050. material: _self._lineMaterial,
  12051. width: _self._param.lineWidth,
  12052. clampToGround: false
  12053. }
  12054. });
  12055. this._entities.add(this._sketchSpatialTriangle);
  12056. this._updateScene();
  12057. }
  12058. }
  12059. _setMoveLineStyle(options2) {
  12060. let _self = this;
  12061. let color2 = [255, 255, 255, 1];
  12062. let lineWidth = 3;
  12063. let isOutline = false;
  12064. let power = 0.2;
  12065. let outlineColor = [255, 0, 0, 1];
  12066. let outlineWidth = 1;
  12067. if (options2 && options2.color && options2.color.length === 4)
  12068. color2 = options2.color;
  12069. if (options2 && options2.outline && typeof options2.outline === "boolean")
  12070. isOutline = options2.outline;
  12071. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12072. outlineColor = options2.outlineColor;
  12073. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12074. outlineWidth = options2.outlineWidth;
  12075. if (options2 && options2.lineWidth && typeof options2.lineWidth === "number")
  12076. lineWidth = options2.lineWidth;
  12077. if (options2 && options2.power)
  12078. power = options2.power;
  12079. if (isOutline) {
  12080. this._tempLineMaterial = new Cesium.PolylineOutlineMaterialProperty({
  12081. color: _self._toColorFromArray(color2),
  12082. outlineColor: _self._toColorFromArray(outlineColor),
  12083. outlineWidth
  12084. });
  12085. } else {
  12086. if (power === void 0) {
  12087. this._tempLineMaterial = new Cesium.PolylineDashMaterialProperty({
  12088. color: _self._toColorFromArray(color2)
  12089. });
  12090. } else {
  12091. this._tempLineMaterial = new Cesium.PolylineGlowMaterialProperty({
  12092. color: _self._toColorFromArray(color2),
  12093. glowPower: power
  12094. });
  12095. }
  12096. }
  12097. this._param.moveLineWidth = lineWidth;
  12098. }
  12099. _setLineStyle(options2) {
  12100. let _self = this;
  12101. let color2 = [255, 255, 255, 1];
  12102. let lineWidth = 2;
  12103. let outlineColor = [0, 255, 0, 0.6];
  12104. let outlineWidth = 1;
  12105. if (options2 && options2.color && options2.color.length === 4)
  12106. color2 = options2.color;
  12107. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12108. outlineColor = options2.outlineColor;
  12109. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12110. outlineWidth = options2.outlineWidth;
  12111. if (options2 && options2.lineWidth && typeof options2.lineWidth === "number")
  12112. lineWidth = options2.lineWidth;
  12113. this._lineMaterial = new Cesium.PolylineOutlineMaterialProperty({
  12114. color: _self._toColorFromArray(color2),
  12115. outlineColor: _self._toColorFromArray(outlineColor),
  12116. outlineWidth
  12117. });
  12118. this._param.lineWidth = lineWidth;
  12119. }
  12120. _setSpatialLineStyle(options2) {
  12121. let _self = this;
  12122. let color2 = [255, 255, 0, 1];
  12123. let lineWidth = 2;
  12124. let outlineColor = [255, 255, 255, 1];
  12125. let outlineWidth = 1;
  12126. if (options2 && options2.color && options2.color.length === 4)
  12127. color2 = options2.color;
  12128. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12129. outlineColor = options2.outlineColor;
  12130. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12131. outlineWidth = options2.outlineWidth;
  12132. if (options2 && options2.lineWidth && typeof options2.lineWidth === "number")
  12133. lineWidth = options2.lineWidth;
  12134. this._spatialLineMaterial = new Cesium.PolylineOutlineMaterialProperty({
  12135. color: _self._toColorFromArray(color2),
  12136. outlineColor: _self._toColorFromArray(outlineColor),
  12137. outlineWidth
  12138. });
  12139. this._param.spatialLineWidth = lineWidth;
  12140. }
  12141. _setMovePolygonStyle(options2) {
  12142. let polygonColor = [255, 0, 0, 0.3];
  12143. if (options2 && options2.color && options2.color.length === 4)
  12144. polygonColor = options2.color;
  12145. this._tempPolygonMaterial = new Cesium.ColorMaterialProperty(this._toColorFromArray(polygonColor));
  12146. }
  12147. _setPolygonStyle(options2) {
  12148. let polygonColor = [0, 0, 255, 0.3];
  12149. if (options2 && options2.color && options2.color.length === 4)
  12150. polygonColor = options2.color;
  12151. this._polygonMaterial = new Cesium.ColorMaterialProperty(this._toColorFromArray(polygonColor));
  12152. }
  12153. _setMoveAltitudeLineStyle(options2) {
  12154. let _self = this;
  12155. let color2 = [255, 255, 255, 1];
  12156. let lineWidth = 2;
  12157. let isOutline = true;
  12158. let outlineColor = [255, 255, 0, 1];
  12159. let outlineWidth = 1;
  12160. if (options2 && options2.color && options2.color.length === 4)
  12161. color2 = options2.color;
  12162. if (options2 && options2.outline && typeof options2.outline === "boolean")
  12163. isOutline = options2.outline;
  12164. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12165. outlineColor = options2.outlineColor;
  12166. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12167. outlineWidth = options2.outlineWidth;
  12168. if (options2 && options2.lineWidth && typeof options2.lineWidth === "number")
  12169. lineWidth = options2.lineWidth;
  12170. if (isOutline) {
  12171. this._tempAlititudeLineMaterial = new Cesium.PolylineOutlineMaterialProperty({
  12172. color: _self._toColorFromArray(color2),
  12173. outlineColor: _self._toColorFromArray(outlineColor),
  12174. outlineWidth
  12175. });
  12176. } else {
  12177. this._tempAlititudeLineMaterial = new Cesium.PolylineDashMaterialProperty({
  12178. color: _self._toColorFromArray(color2)
  12179. });
  12180. }
  12181. this._param.moveAltitudeLineWidth = lineWidth;
  12182. }
  12183. _setAltitudeLineStyle(options2) {
  12184. let _self = this;
  12185. let color2 = [255, 255, 255, 1];
  12186. let lineWidth = 2;
  12187. let outlineColor = [0, 0, 255, 1];
  12188. let outlineWidth = 1;
  12189. if (options2 && options2.color && options2.color.length === 4)
  12190. color2 = options2.color;
  12191. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12192. outlineColor = options2.outlineColor;
  12193. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12194. outlineWidth = options2.outlineWidth;
  12195. if (options2 && options2.lineWidth && typeof options2.lineWidth === "number")
  12196. lineWidth = options2.lineWidth;
  12197. this._altitudeLineMaterial = new Cesium.PolylineOutlineMaterialProperty({
  12198. color: _self._toColorFromArray(color2),
  12199. outlineColor: _self._toColorFromArray(outlineColor),
  12200. outlineWidth
  12201. });
  12202. this._param.altitudeLineWidth = lineWidth;
  12203. }
  12204. _setMoveEllipseStyle(options2) {
  12205. if (options2 && options2.color && options2.color.length === 4)
  12206. this._param.moveEllipseColor = options2.color;
  12207. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12208. this._param.moveEllipseOutlineWidth = options2.outlineWidth;
  12209. if (options2 && options2.outline && typeof options2.outline === "boolean")
  12210. this._param.moveEllipseOutline = options2.outline;
  12211. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12212. this._param.moveEllipseOutlineColor = options2.outlineColor;
  12213. }
  12214. _setEllipseStyle(options2) {
  12215. if (options2 && options2.color && options2.color.length === 4)
  12216. this._param.ellipseColor = options2.color;
  12217. if (options2 && options2.outlineWidth && typeof options2.outlineWidth === "number")
  12218. this._param.ellipseOutlineWidth = options2.outlineWidth;
  12219. if (options2 && options2.outline && typeof options2.outline === "boolean")
  12220. this._param.ellipseOutline = options2.outline;
  12221. if (options2 && options2.outlineColor && options2.outlineColor.length === 4)
  12222. this._param.ellipseOutlineColor = options2.outlineColor;
  12223. }
  12224. _clear(isAll) {
  12225. if (isAll != void 0 && isAll === true) {
  12226. this._removeEntityByName(this._sketchEntityName);
  12227. this._removePointEntitys();
  12228. }
  12229. this._sketchTempPoints = [];
  12230. this._sketchPoints = [];
  12231. this._sketchOutputPoints = [];
  12232. this._sketchTempPolyline = void 0;
  12233. this._sketchPolyline = void 0;
  12234. this._sketchTempPolygon = void 0;
  12235. this._sketchPolygon = void 0;
  12236. this._sketchTempAltituePolyline = void 0;
  12237. this._sketchAltitudePolyline = void 0;
  12238. this._sketchTempSpatialPolyline = void 0;
  12239. this._sketchSpatialPolyline = void 0;
  12240. this._sketchTempCircle = void 0;
  12241. this._sketchCircle = void 0;
  12242. this._sketchTempRectangle = void 0;
  12243. this._sketchRectangle = void 0;
  12244. this._sketchTempTriangleAltitudePolyline = void 0;
  12245. this._sketchTriangleAltituePolyline = void 0;
  12246. this._sketchTempSpatialTriangle = void 0;
  12247. this._sketchSpatialTriangle = void 0;
  12248. }
  12249. _checkAppOrWeb() {
  12250. if (window.navigator.userAgent.match(
  12251. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  12252. )) {
  12253. return SketchViewModel.RuntimeEnvironment.App;
  12254. } else {
  12255. return SketchViewModel.RuntimeEnvironment.Web;
  12256. }
  12257. }
  12258. _isRuntimeApp() {
  12259. if (this._checkAppOrWeb() === SketchViewModel.RuntimeEnvironment.App) {
  12260. return true;
  12261. }
  12262. return false;
  12263. }
  12264. }
  12265. Object.assign(SketchViewModel.prototype, {
  12266. setMoveLineStyle: function(options2) {
  12267. this._setMoveLineStyle(options2);
  12268. },
  12269. setLineStyle: function(options2) {
  12270. this._setLineStyle(options2);
  12271. },
  12272. setSpatialLineStyle: function() {
  12273. this._setSpatialLineStyle(options);
  12274. },
  12275. setMovePolygonStyle: function(options2) {
  12276. this._setMovePolygonStyle(options2);
  12277. },
  12278. setPolygonStyle: function(options2) {
  12279. this._setPolygonStyle(options2);
  12280. },
  12281. setMoveAltitudeLineStyle: function(options2) {
  12282. this._setMoveAltitudeLineStyle(options2);
  12283. },
  12284. setAltitudeLineStyle: function(options2) {
  12285. this._setAltitudeLineStyle(options2);
  12286. },
  12287. setMoveEllipseStyle: function(options2) {
  12288. this._setMoveEllipseStyle(options2);
  12289. },
  12290. setEllipseStyle: function(options2) {
  12291. this._setEllipseStyle(options2);
  12292. },
  12293. setLabel: function(options2) {
  12294. if (!options2) {
  12295. options2 = {
  12296. lineLabel: void 0,
  12297. polygonLabel: void 0
  12298. };
  12299. }
  12300. if (options2.lineLabel)
  12301. this._lineLabel = options2.lineLabel;
  12302. if (options2.polygonLabel)
  12303. this._lineLabel = options2.polygonLabel;
  12304. }
  12305. });
  12306. Object.assign(SketchViewModel.prototype, {
  12307. _registerLeftClickEvent: function(handler, callChange) {
  12308. let _self = this;
  12309. if (!handler)
  12310. return;
  12311. handler.setInputAction(function(event2) {
  12312. _self._lock = true;
  12313. if (_self._timer != null)
  12314. clearTimeout(_self._timer);
  12315. _self._timer = setTimeout(function() {
  12316. if (callChange)
  12317. callChange(event2);
  12318. _self._lock = false;
  12319. }, 200);
  12320. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  12321. },
  12322. _registerLeftDoubleClickEvent: function(handler, callChange) {
  12323. let _self = this;
  12324. if (!handler)
  12325. return;
  12326. handler.setInputAction(function(event2) {
  12327. if (_self._timer != null)
  12328. clearTimeout(_self._timer);
  12329. _self._lock = false;
  12330. if (callChange)
  12331. callChange(event2);
  12332. }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  12333. },
  12334. _registerMouseMoveEvent: function(handler, callChange) {
  12335. let _self = this;
  12336. if (!handler)
  12337. return;
  12338. handler.setInputAction(function(event2) {
  12339. if (_self._lock === void 0 || _self._lock === false) {
  12340. if (callChange)
  12341. callChange(event2);
  12342. }
  12343. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  12344. },
  12345. _registerRightClickEvent: function(handler, callChange) {
  12346. if (!handler)
  12347. return;
  12348. handler.setInputAction(function(event2) {
  12349. if (callChange)
  12350. callChange(event2);
  12351. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  12352. },
  12353. _clearEvent: function(handler) {
  12354. if (!handler)
  12355. return;
  12356. handler.destroy();
  12357. handler = null;
  12358. }
  12359. });
  12360. Object.assign(SketchViewModel.prototype, {
  12361. _sketchDrawPoint(handler, options2) {
  12362. let _self = this;
  12363. this._registerLeftClickEvent(handler, function(event2) {
  12364. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12365. if (!Cesium.defined(loc2.sLocation))
  12366. return;
  12367. if (_self._isDrawPoint) {
  12368. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12369. }
  12370. _self._clearEvent(handler);
  12371. if (options2.onComplete)
  12372. options2.onComplete(loc2.sLocation, loc2.gLocation);
  12373. });
  12374. },
  12375. _sketchDrawMultiplePoint(handler, options2) {
  12376. let _self = this;
  12377. this._registerLeftClickEvent(handler, function(event2) {
  12378. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12379. if (!Cesium.defined(loc2.sLocation))
  12380. return;
  12381. if (_self._isDrawPoint) {
  12382. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12383. }
  12384. _self._sketchPoints.push(loc2.sLocation);
  12385. _self._sketchOutputPoints.push(loc2.gLocation);
  12386. if (options2.onAdded)
  12387. options2.onAdded(loc2.sLocation, loc2.gLocation);
  12388. });
  12389. this._registerRightClickEvent(handler, function(event2) {
  12390. if (_self._sketchPoints.length > 0) {
  12391. _self._sketchPoints.pop();
  12392. _self._sketchOutputPoints.pop();
  12393. if (options2.onUndo)
  12394. options2.onUndo();
  12395. }
  12396. });
  12397. this._registerLeftDoubleClickEvent(handler, function(event2) {
  12398. _self._clearEvent();
  12399. if (options2.onComplete)
  12400. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  12401. });
  12402. },
  12403. _sketchDrawPolyline(handler, options2) {
  12404. let _self = this;
  12405. this._registerLeftClickEvent(handler, function(event2) {
  12406. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12407. if (!Cesium.defined(loc2.sLocation))
  12408. return;
  12409. if (_self._isDrawPoint) {
  12410. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12411. }
  12412. if (_self._sketchTempPoints.length === 0) {
  12413. _self._createTempPolyline();
  12414. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12415. }
  12416. _self._sketchTempPoints.push(loc2.sLocation);
  12417. _self._sketchPoints.push(loc2.sLocation.clone());
  12418. _self._sketchOutputPoints.push(loc2.gLocation);
  12419. if (options2.onAdded)
  12420. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  12421. });
  12422. this._registerMouseMoveEvent(handler, function(event2) {
  12423. if (_self._isRuntimeApp())
  12424. return;
  12425. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  12426. if (!Cesium.defined(loc2.sLocation))
  12427. return;
  12428. if (Cesium.defined(_self._sketchTempPolyline)) {
  12429. _self._sketchTempPoints.pop();
  12430. _self._sketchTempPoints.push(loc2.sLocation);
  12431. if (options2.onMoving)
  12432. options2.onMoving(loc2.sLocation);
  12433. }
  12434. });
  12435. this._registerRightClickEvent(handler, function(event2) {
  12436. if (_self._sketchTempPoints.length > 2) {
  12437. _self._sketchPoints.pop();
  12438. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 2, 1);
  12439. if (_self._isDrawPoint) {
  12440. let lastPointEntity = _self._pointEntitys[_self._pointEntitys.length - 1];
  12441. _self._entities.remove(lastPointEntity);
  12442. _self._pointEntitys.pop();
  12443. }
  12444. if (options2.onUndo)
  12445. options2.onUndo();
  12446. }
  12447. });
  12448. this._registerLeftDoubleClickEvent(handler, function(event2) {
  12449. if (_self._isRuntimeApp())
  12450. return;
  12451. if (_self._sketchPoints.length < 2) {
  12452. if (options2.onError)
  12453. options2.onError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  12454. return;
  12455. }
  12456. _self._removeEntityByObject(_self._sketchTempPolyline);
  12457. _self._createPolyline();
  12458. if (!_self._isRetainDrawPoint)
  12459. _self._removePointEntitys();
  12460. _self._clearEvent(handler);
  12461. if (options2.onComplete)
  12462. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  12463. });
  12464. },
  12465. _sketchDrawSpatialPolyline(handler, options2) {
  12466. let _self = this;
  12467. this._registerLeftClickEvent(handler, function(event2) {
  12468. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12469. if (!Cesium.defined(loc2.sLocation))
  12470. return;
  12471. if (_self._isDrawPoint) {
  12472. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12473. }
  12474. if (_self._sketchTempPoints.length === 0) {
  12475. _self._createTempSpatialPolyline();
  12476. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12477. }
  12478. _self._sketchTempPoints.push(loc2.sLocation);
  12479. _self._sketchPoints.push(loc2.sLocation.clone());
  12480. _self._sketchOutputPoints.push(loc2.gLocation);
  12481. if (options2.onAdded)
  12482. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  12483. });
  12484. this._registerMouseMoveEvent(handler, function(event2) {
  12485. if (_self._isRuntimeApp())
  12486. return;
  12487. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  12488. if (!Cesium.defined(loc2.sLocation))
  12489. return;
  12490. if (Cesium.defined(_self._sketchTempSpatialPolyline)) {
  12491. _self._sketchTempPoints.pop();
  12492. _self._sketchTempPoints.push(loc2.sLocation);
  12493. if (options2.onMoving)
  12494. options2.onMoving(loc2.sLocation);
  12495. }
  12496. });
  12497. this._registerLeftDoubleClickEvent(handler, function(event2) {
  12498. if (_self._isRuntimeApp())
  12499. return;
  12500. if (_self._sketchPoints.length < 2) {
  12501. if (options2.onError)
  12502. options2.onError("\u7ED8\u5236\u70B9\u5C11\u4E8E2\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  12503. return;
  12504. }
  12505. _self._removeEntityByObject(_self._sketchTempSpatialPolyline);
  12506. _self._createSpatialPolyline();
  12507. _self._removePointEntitys();
  12508. _self._clearEvent(handler);
  12509. if (options2.onComplete)
  12510. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  12511. });
  12512. this._registerRightClickEvent(handler, function(event2) {
  12513. if (_self._sketchTempPoints.length > 2) {
  12514. _self._sketchPoints.pop();
  12515. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 2, 1);
  12516. if (options2.onUndo)
  12517. options2.onUndo();
  12518. }
  12519. });
  12520. },
  12521. _sketchDrawPolygon(handler, options2) {
  12522. let _self = this;
  12523. this._registerLeftClickEvent(handler, function(event2) {
  12524. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12525. if (!Cesium.defined(loc2.sLocation))
  12526. return;
  12527. if (_self._isDrawPoint) {
  12528. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12529. }
  12530. if (_self._sketchTempPoints.length === 0) {
  12531. _self._createTempPolygon();
  12532. _self._createTempPolyline();
  12533. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12534. }
  12535. _self._sketchTempPoints.push(loc2.sLocation);
  12536. _self._sketchPoints.push(loc2.sLocation.clone());
  12537. _self._sketchOutputPoints.push(loc2.gLocation);
  12538. if (options2.onAdded)
  12539. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  12540. });
  12541. this._registerMouseMoveEvent(handler, function(event2) {
  12542. if (_self._isRuntimeApp())
  12543. return;
  12544. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  12545. if (!Cesium.defined(loc2.sLocation))
  12546. return;
  12547. if (Cesium.defined(_self._sketchTempPolygon)) {
  12548. _self._sketchTempPoints.pop();
  12549. _self._sketchTempPoints.push(loc2.sLocation);
  12550. if (options2.onMoving)
  12551. options2.onMoving(loc2.sLocation);
  12552. }
  12553. });
  12554. this._registerRightClickEvent(handler, function(event2) {
  12555. if (_self._sketchTempPoints.length > 2) {
  12556. _self._sketchPoints.pop();
  12557. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 2, 1);
  12558. if (_self._isDrawPoint) {
  12559. let lastPointEntity = _self._pointEntitys[_self._pointEntitys.length - 1];
  12560. _self._entities.remove(lastPointEntity);
  12561. _self._pointEntitys.pop();
  12562. }
  12563. if (options2.onUndo)
  12564. options2.onUndo();
  12565. }
  12566. });
  12567. this._registerLeftDoubleClickEvent(handler, function(event2) {
  12568. if (_self._isRuntimeApp())
  12569. return;
  12570. if (_self._sketchPoints.length < 3) {
  12571. if (options2.onError)
  12572. options2.onError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  12573. return;
  12574. }
  12575. _self._removeEntityByObject(_self._sketchTempPolygon);
  12576. _self._removeEntityByObject(_self._sketchTempPolyline);
  12577. _self._createPolygon();
  12578. if (!_self._isRetainDrawPoint)
  12579. _self._removePointEntitys();
  12580. _self._clearEvent(handler);
  12581. if (options2.onComplete)
  12582. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  12583. });
  12584. },
  12585. _sketchDrawCircle: function(handler, options2) {
  12586. let _self = this;
  12587. this._registerLeftClickEvent(handler, function(event2) {
  12588. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12589. if (!Cesium.defined(loc2.sLocation))
  12590. return;
  12591. if (_self._sketchTempPoints.length === 0) {
  12592. if (_self._isDrawPoint) {
  12593. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  12594. }
  12595. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12596. _self._sketchTempPoints.push(loc2.sLocation);
  12597. _self._sketchPoints.push(loc2.sLocation.clone());
  12598. _self._sketchOutputPoints.push(loc2.gLocation);
  12599. _self._createTempCircle(loc2.sLocation);
  12600. if (options2.onAdded)
  12601. options2.onAdded(loc2.sLocation);
  12602. } else {
  12603. if (_self._isRuntimeApp()) {
  12604. _self._sketchTempPoints.pop();
  12605. _self._sketchTempPoints.push(loc2.sLocation);
  12606. let positionCenter = _self._sketchEllipseCenterPosition;
  12607. let positionRotate = _self._sketchTempPoints[1];
  12608. _self._ellipseOutlineCoordinates = [];
  12609. for (let angle = 5; angle < 360; ) {
  12610. let newPosition = _self._rotatedPointByAngle(positionRotate, positionCenter, angle);
  12611. _self._ellipseOutlineCoordinates.push(newPosition);
  12612. angle = angle + 5;
  12613. }
  12614. _self._ellipseOutlineCoordinates.push(_self._ellipseOutlineCoordinates[0]);
  12615. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  12616. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  12617. let geodesic = new Cesium.EllipsoidGeodesic();
  12618. geodesic.setEndPoints(point1cartographic, point2cartographic);
  12619. _self._sketchEllipseRadius = geodesic.surfaceDistance;
  12620. if (_self._sketchEllipseRadius <= 0)
  12621. _self._sketchEllipseRadius = 1;
  12622. }
  12623. _self._removePointEntitys();
  12624. _self._removeEntityByObject(_self._sketchTempCircle);
  12625. _self._createCircle();
  12626. _self._clearEvent(handler);
  12627. if (options2.onComplete)
  12628. options2.onComplete(_self._sketchOutputPoints[0], _self._sketchEllipseRadius);
  12629. }
  12630. });
  12631. this._registerMouseMoveEvent(handler, function(event2) {
  12632. if (_self._isRuntimeApp())
  12633. return;
  12634. if (!Cesium.defined(_self._sketchTempCircle))
  12635. return;
  12636. var cartesian = _self._viewer.scene.pickPosition(event2.endPosition);
  12637. if (cartesian == void 0)
  12638. return;
  12639. _self._sketchTempPoints.pop();
  12640. _self._sketchTempPoints.push(cartesian);
  12641. });
  12642. },
  12643. _sketchDrawHeightPolyline: function(handler, options2) {
  12644. let _self = this;
  12645. this._registerLeftClickEvent(handler, function(event2) {
  12646. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12647. if (!Cesium.defined(loc2.sLocation))
  12648. return;
  12649. if (_self._sketchTempPoints.length === 0) {
  12650. if (_self._isDrawPoint) {
  12651. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  12652. }
  12653. _self._sketchAltitudeInitHeight = loc2.gLocation.height;
  12654. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12655. _self._sketchTempPoints.push(loc2.sLocation);
  12656. _self._sketchPoints.push(loc2.sLocation.clone());
  12657. if (options2.onAdded)
  12658. options2.onAdded(loc2.sLocation);
  12659. } else {
  12660. if (_self._isRuntimeApp()) {
  12661. _self._sketchTempPoints.pop();
  12662. _self._sketchTempPoints.push(loc2.sLocation);
  12663. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  12664. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  12665. _self._sketchEllipseCenterPosition = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  12666. _self._sketchAltitudePolylinePostions = [];
  12667. _self._sketchAltitudePolylinePostions.push(_self._sketchTempPoints[0]);
  12668. let point_temp = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  12669. _self._sketchAltitudePolylinePostions.push(point_temp);
  12670. let geodesic = new Cesium.EllipsoidGeodesic();
  12671. geodesic.setEndPoints(point1cartographic, point2cartographic);
  12672. _self._sketchEllipseRadius = geodesic.surfaceDistance;
  12673. if (_self._sketchEllipseRadius <= 0)
  12674. _self._sketchEllipseRadius = 1;
  12675. let height_temp = point2cartographic.height - point1cartographic.height;
  12676. _self._sketchEllipseHeight = height_temp + _self._sketchAltitudeInitHeight;
  12677. }
  12678. _self._removePointEntitys();
  12679. _self._removeEntityByObject(_self._sketchTempAltituePolyline);
  12680. _self._createAltitudePolyline();
  12681. _self._clearEvent(handler);
  12682. if (options2.onComplete) {
  12683. options2.onComplete(_self._sketchAltitudePolylinePostions, _self._sketchEllipseCenterPosition);
  12684. }
  12685. }
  12686. });
  12687. this._registerMouseMoveEvent(handler, function(event2) {
  12688. if (_self._isRuntimeApp())
  12689. return;
  12690. if (_self._sketchTempPoints == void 0 || _self._sketchTempPoints.length == 0)
  12691. return;
  12692. var cartesian = _self._viewer.scene.pickPosition(event2.endPosition);
  12693. if (cartesian == void 0)
  12694. return;
  12695. if (_self._sketchTempPoints.length >= 2) {
  12696. if (!Cesium.defined(_self._sketchTempAltituePolyline)) {
  12697. _self._createTempAltitudePolyline();
  12698. } else {
  12699. _self._sketchTempPoints.pop();
  12700. _self._sketchTempPoints.push(cartesian);
  12701. }
  12702. if (options2.onMoving) {
  12703. options2.onMoving(_self._sketchAltitudePolylinePostions, _self._sketchEllipseCenterPosition);
  12704. }
  12705. }
  12706. });
  12707. },
  12708. _sketchDrawRectangle: function(handler, options2) {
  12709. let _self = this;
  12710. this._registerLeftClickEvent(handler, function(event2) {
  12711. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12712. if (!Cesium.defined(loc2.sLocation))
  12713. return;
  12714. if (_self._sketchTempPoints.length === 0) {
  12715. if (_self._isDrawPoint) {
  12716. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  12717. }
  12718. _self._sketchTempPoints.push(loc2.gLocation);
  12719. _self._sketchTempPoints.push(loc2.gLocation);
  12720. _self._sketchPoints.push(loc2.gLocation);
  12721. _self._createTempRectangle();
  12722. if (options2.onAdded)
  12723. options2.onAdded(loc2.sLocation);
  12724. } else {
  12725. if (_self._isRuntimeApp()) {
  12726. _self._sketchTempPoints.pop();
  12727. _self._sketchTempPoints.push(loc2.gLocation);
  12728. let lng0 = parseFloat(_self._sketchTempPoints[0].lng);
  12729. let lat0 = parseFloat(_self._sketchTempPoints[0].lat);
  12730. let lng1 = parseFloat(_self._sketchTempPoints[1].lng);
  12731. let lat1 = parseFloat(_self._sketchTempPoints[1].lat);
  12732. _self._rectangleCoordinates = [0, 0, 1, 1];
  12733. if (lng0 < lng1) {
  12734. _self._rectangleCoordinates[0] = lng0;
  12735. _self._rectangleCoordinates[2] = lng1;
  12736. } else {
  12737. _self._rectangleCoordinates[0] = lng1;
  12738. _self._rectangleCoordinates[2] = lng0;
  12739. }
  12740. if (lat0 < lat1) {
  12741. _self._rectangleCoordinates[1] = lat0;
  12742. _self._rectangleCoordinates[3] = lat1;
  12743. } else {
  12744. _self._rectangleCoordinates[1] = lat1;
  12745. _self._rectangleCoordinates[3] = lat0;
  12746. }
  12747. let rectangle = Cesium.Rectangle.fromDegrees(_self._rectangleCoordinates[0], _self._rectangleCoordinates[1], _self._rectangleCoordinates[2], _self._rectangleCoordinates[3]);
  12748. let res = _self._calculateRectangleOutlineCoordinates(rectangle);
  12749. _self._rectangleOutlineCoordinates = res.cPoints;
  12750. _self._sketchOutputPoints = res.gPoints;
  12751. }
  12752. _self._removePointEntitys();
  12753. _self._removeEntityByObject(_self._sketchTempRectangle);
  12754. _self._createRectangle();
  12755. handler.destroy();
  12756. handler = null;
  12757. if (options2.onComplete)
  12758. options2.onComplete(_self._sketchOutputPoints);
  12759. }
  12760. });
  12761. this._registerMouseMoveEvent(handler, function(event2) {
  12762. if (_self._isRuntimeApp())
  12763. return;
  12764. if (!Cesium.defined(_self._sketchTempRectangle))
  12765. return;
  12766. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  12767. if (!Cesium.defined(loc2.sLocation))
  12768. return;
  12769. _self._sketchTempPoints.pop();
  12770. _self._sketchTempPoints.push(loc2.gLocation);
  12771. });
  12772. },
  12773. _sketchDrawTriangle: function(handler, options2) {
  12774. let _self = this;
  12775. handler.setInputAction(function(event2) {
  12776. if (Cesium.defined(_self._sketchTempAltituePolyline))
  12777. return;
  12778. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12779. if (!Cesium.defined(loc2.sLocation))
  12780. return;
  12781. if (_self._sketchPoints.length == 0) {
  12782. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  12783. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12784. _self._sketchTempPoints.push(loc2.sLocation);
  12785. _self._sketchPoints.push(loc2.sLocation);
  12786. _self._createTempPolyline();
  12787. } else if (_self._sketchPoints.length === 1) {
  12788. _self._createPoint(loc2.sLocation, "\u9AD8\u5EA6\u8D77\u70B9");
  12789. _self._entities.remove(_self._sketchTempPolyline);
  12790. _self._sketchPoints.push(loc2.sLocation);
  12791. _self._createPolyline();
  12792. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12793. _self._sketchPoints.push(loc2.sLocation);
  12794. _self._sketchAltitudeInitHeight = loc2.gLocation.height;
  12795. _self._createTempTriangleAltitudePolylineAndSpatialPolyline();
  12796. }
  12797. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  12798. handler.setInputAction(function(event2) {
  12799. if (_self._sketchPoints === void 0 || _self._sketchPoints.length === 0)
  12800. return;
  12801. var cartesian = _self._viewer.scene.pickPosition(event2.endPosition);
  12802. if (cartesian == void 0)
  12803. return;
  12804. _self._sketchTempPoints.pop();
  12805. _self._sketchTempPoints.push(cartesian);
  12806. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  12807. handler.setInputAction(function(event2) {
  12808. if (_self._sketchPoints.length < 2) {
  12809. if (options2.onError)
  12810. options2.onError("\u7ED8\u5236\u56FE\u5F62\u4E0D\u5B8C\u6574\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  12811. return;
  12812. }
  12813. _self._removePointEntitys();
  12814. _self._removeEntityByObject(_self._sketchTempTriangleAltitudePolyline);
  12815. _self._removeEntityByObject(_self._sketchTempSpatialPolyline);
  12816. _self._createAltitudePolyline();
  12817. _self._createTriangleSpatialPolyline();
  12818. handler.destroy();
  12819. handler = null;
  12820. options2.onComplete(
  12821. _self._sketchPoints,
  12822. _self._sketchTriangleSpatialPolylinePositions,
  12823. _self._sketchAltitudePolylinePostions,
  12824. _self._sketchEllipseCenterPosition
  12825. );
  12826. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  12827. },
  12828. _sketchDrawPolygonBody(handler, options2) {
  12829. let _self = this;
  12830. this._registerLeftClickEvent(handler, function(event2) {
  12831. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12832. if (!Cesium.defined(loc2.sLocation))
  12833. return;
  12834. if (_self._isDrawPoint) {
  12835. _self._createPoint(loc2.sLocation, _self._lineLabel);
  12836. }
  12837. if (_self._sketchTempPoints.length === 0) {
  12838. _self._createTempPolygon();
  12839. _self._createTempPolyline();
  12840. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12841. }
  12842. _self._sketchTempPoints.push(loc2.sLocation);
  12843. _self._sketchPoints.push(loc2.sLocation.clone());
  12844. _self._sketchOutputPoints.push(loc2.gLocation);
  12845. if (options2.onAdded)
  12846. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  12847. });
  12848. this._registerMouseMoveEvent(handler, function(event2) {
  12849. if (_self._isRuntimeApp())
  12850. return;
  12851. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  12852. if (!Cesium.defined(loc2.sLocation))
  12853. return;
  12854. if (Cesium.defined(_self._sketchTempPolygon)) {
  12855. _self._sketchTempPoints.pop();
  12856. _self._sketchTempPoints.push(loc2.sLocation);
  12857. if (options2.onMoving)
  12858. options2.onMoving(loc2.sLocation);
  12859. }
  12860. });
  12861. this._registerRightClickEvent(handler, function(event2) {
  12862. if (_self._sketchTempPoints.length > 2) {
  12863. _self._sketchPoints.pop();
  12864. _self._sketchOutputPoints.pop();
  12865. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 2, 1);
  12866. if (options2.onUndo)
  12867. options2.onUndo(_self._sketchPoints);
  12868. }
  12869. });
  12870. this._registerLeftDoubleClickEvent(handler, function(event2) {
  12871. if (_self._isRuntimeApp())
  12872. return;
  12873. if (_self._sketchPoints.length < 3) {
  12874. if (options2.onError)
  12875. options2.onError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  12876. return;
  12877. }
  12878. _self._removeEntityByObject(_self._sketchTempPolygon);
  12879. _self._removeEntityByObject(_self._sketchTempPolyline);
  12880. _self._createPolygonBody({
  12881. height: 30,
  12882. color: [255, 255, 0, 0.9]
  12883. });
  12884. _self._removePointEntitys();
  12885. _self._clearEvent(handler);
  12886. if (options2.onComplete)
  12887. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  12888. });
  12889. },
  12890. _sketchDrawTriangleA: function(handler, options2) {
  12891. let _self = this;
  12892. this._registerLeftClickEvent(handler, function(event2) {
  12893. if (Cesium.defined(_self._sketchTempAltituePolyline))
  12894. return;
  12895. let loc2 = _self._transfromFromScreenPoint(event2.position);
  12896. if (!Cesium.defined(loc2.sLocation))
  12897. return;
  12898. if (_self._sketchPoints.length == 0) {
  12899. if (_self._isDrawPoint) {
  12900. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  12901. }
  12902. _self._sketchTempPoints.push(loc2.sLocation.clone());
  12903. _self._sketchTempPoints.push(loc2.sLocation);
  12904. _self._sketchPoints.push(loc2.sLocation);
  12905. _self._createTempSpatialTriangle();
  12906. if (options2.onAdded)
  12907. options2.onAdded(loc2.sLocation);
  12908. } else if (_self._sketchPoints.length > 0) {
  12909. if (_self._isRuntimeApp()) {
  12910. _self._sketchTempPoints.pop();
  12911. _self._sketchTempPoints.push(loc2.sLocation);
  12912. _self._sketchSpatialTrianglePositions = [];
  12913. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[0].clone());
  12914. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[1].clone());
  12915. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  12916. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  12917. let point_temp = Cesium.Cartesian3.fromDegrees(Cesium.Math.toDegrees(point1cartographic.longitude), Cesium.Math.toDegrees(point1cartographic.latitude), point2cartographic.height);
  12918. _self._sketchSpatialTrianglePositions.push(point_temp);
  12919. _self._sketchSpatialTrianglePositions.push(_self._sketchTempPoints[0].clone());
  12920. }
  12921. _self._removePointEntitys();
  12922. _self._removeEntityByObject(_self._sketchTempSpatialTriangle);
  12923. _self._createSpatialTriangle();
  12924. _self._clearEvent(handler);
  12925. if (options2.onComplete)
  12926. options2.onComplete(_self._sketchSpatialTrianglePositions);
  12927. }
  12928. });
  12929. this._registerMouseMoveEvent(handler, function(event2) {
  12930. if (_self._isRuntimeApp())
  12931. return;
  12932. if (_self._sketchPoints === void 0 || _self._sketchPoints.length === 0)
  12933. return;
  12934. var cartesian = _self._viewer.scene.pickPosition(event2.endPosition);
  12935. if (cartesian == void 0)
  12936. return;
  12937. _self._sketchTempPoints.pop();
  12938. _self._sketchTempPoints.push(cartesian);
  12939. if (options2.onMoving)
  12940. options2.onMoving(cartesian);
  12941. });
  12942. },
  12943. sketchTools: function(toolsType, options2) {
  12944. let _self = this;
  12945. this._clear();
  12946. _self._sketchEventHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  12947. switch (toolsType) {
  12948. case SketchViewModel.SketchType.Point:
  12949. _self._sketchDrawPoint(_self._sketchEventHandler, options2);
  12950. break;
  12951. case SketchViewModel.SketchType.Line:
  12952. _self._sketchDrawPolyline(_self._sketchEventHandler, options2);
  12953. break;
  12954. case SketchViewModel.SketchType.Polygon:
  12955. _self._sketchDrawPolygon(_self._sketchEventHandler, options2);
  12956. break;
  12957. case SketchViewModel.SketchType.Height:
  12958. _self._sketchDrawHeightPolyline(_self._sketchEventHandler, options2);
  12959. break;
  12960. case SketchViewModel.SketchType.Spatial:
  12961. _self._sketchDrawSpatialPolyline(_self._sketchEventHandler, options2);
  12962. break;
  12963. case SketchViewModel.SketchType.Circle:
  12964. _self._sketchDrawCircle(_self._sketchEventHandler, options2);
  12965. break;
  12966. case SketchViewModel.SketchType.Rectangle:
  12967. _self._sketchDrawRectangle(_self._sketchEventHandler, options2);
  12968. break;
  12969. case SketchViewModel.SketchType.Triangle:
  12970. _self._sketchDrawTriangleA(_self._sketchEventHandler, options2);
  12971. break;
  12972. case SketchViewModel.SketchType.PolygonBody:
  12973. _self._sketchDrawPolygonBody(_self._sketchEventHandler, options2);
  12974. break;
  12975. case SketchViewModel.SketchType.MultiplePoint:
  12976. _self._sketchDrawMultiplePoint(_self._sketchEventHandler, options2);
  12977. break;
  12978. }
  12979. },
  12980. sketchDrawFeacture: function(points2, type2, options2) {
  12981. let _self = this;
  12982. if (points2 === void 0 || points2.length === void 0 || points2.length < 2) {
  12983. if (options2 && options2.onError)
  12984. options2.onError("\u8F93\u5165\u7684\u5750\u6807\u96C6\u5408\u5F02\u5E38\uFF01");
  12985. return;
  12986. }
  12987. this._sketchPoints = [];
  12988. for (let i2 = 0; i2 < points2.length; ) {
  12989. this._sketchPoints.push(Cesium.Cartesian3.fromDegrees(points2[i2], points2[i2 + 1], points2[i2 + 2]));
  12990. i2 = i2 + 3;
  12991. }
  12992. switch (type2) {
  12993. case SketchViewModel.SketchType.DrawPoint:
  12994. _self._createPoint(_self._sketchPoints[0], _self._lineLabel);
  12995. if (options2 && options2.onComplete)
  12996. options2.onComplete(_self._pointEntitys);
  12997. break;
  12998. case SketchViewModel.SketchType.DrawMultiplePoint:
  12999. for (let i2 = 0; i2 < _self._sketchPoints.length; i2++) {
  13000. _self._createPoint(_self._sketchPoints[i2], _self._lineLabel);
  13001. }
  13002. if (options2 && options2.onComplete)
  13003. options2.onComplete(_self._pointEntitys);
  13004. break;
  13005. case SketchViewModel.SketchType.DrawPolyline:
  13006. if (_self._sketchPoints.length < 2) {
  13007. if (options2 && options2.onError)
  13008. options2.onError("\u70B9\u6570\u5C11\u4E8E2\u4E2A\uFF0C\u65E0\u6CD5\u7ED8\u5236\uFF01");
  13009. } else {
  13010. _self._createPolyline();
  13011. if (options2 && options2.onComplete)
  13012. options2.onComplete(_self._sketchPolyline);
  13013. }
  13014. break;
  13015. case SketchViewModel.SketchType.DrawPolygon:
  13016. if (_self._sketchPoints.length < 3) {
  13017. if (options2 && options2.onError)
  13018. options2.onError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u65E0\u6CD5\u7ED8\u5236\uFF01");
  13019. } else {
  13020. _self._createPolygon();
  13021. if (options2 && options2.onComplete)
  13022. options2.onComplete(_self._sketchPolygon);
  13023. }
  13024. break;
  13025. default:
  13026. if (options2 && options2.onError)
  13027. options2.onError("\u7ED8\u5236\u7C7B\u578B\u5F02\u5E38\uFF01");
  13028. break;
  13029. }
  13030. },
  13031. sketchClear: function() {
  13032. this._clear(true);
  13033. this._clearEvent(this._sketchEventHandler);
  13034. },
  13035. sketchInit: function() {
  13036. this._clear(false);
  13037. }
  13038. });
  13039. Object.assign(SketchViewModel.prototype, {
  13040. _checkColor: function(color2) {
  13041. if (color2 === void 0 || color2 === null)
  13042. return false;
  13043. if (typeof color2 != "number")
  13044. return false;
  13045. let intColor = parseInt(color2);
  13046. if (intColor < 0 || intColor > 255)
  13047. return false;
  13048. return true;
  13049. },
  13050. _checkAlpha: function(alpha) {
  13051. if (alpha === void 0 || alpha === null)
  13052. return false;
  13053. if (typeof alpha != "number")
  13054. return false;
  13055. let floatAlpha = parseFloat(alpha);
  13056. if (floatAlpha < 0 || floatAlpha > 1)
  13057. return false;
  13058. return true;
  13059. },
  13060. _checkColorAndAlpha: function(colorAndAlpah) {
  13061. let setColor = void 0;
  13062. if (!colorAndAlpah || colorAndAlpah.length === void 0 || colorAndAlpah.length === 0)
  13063. return void 0;
  13064. if (colorAndAlpah.length === 1 && this._checkColor(colorAndAlpah[0])) {
  13065. setColor = [colorAndAlpah[0], 0, 0, 1];
  13066. } else if (colorAndAlpah.length === 2 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  13067. colorAndAlpah[1]
  13068. )) {
  13069. setColor = [colorAndAlpah[0], colorAndAlpah[1], 0, 1];
  13070. } else if (colorAndAlpah.length === 3 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  13071. colorAndAlpah[1]
  13072. ) && this._checkColor(colorAndAlpah[2])) {
  13073. setColor = [colorAndAlpah[0], colorAndAlpah[1], colorAndAlpah[2], 1];
  13074. } else if (colorAndAlpah.length === 4 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  13075. colorAndAlpah[1]
  13076. ) && this._checkColor(colorAndAlpah[2]) && this._checkAlpha(
  13077. colorAndAlpah[3]
  13078. )) {
  13079. setColor = [colorAndAlpah[0], colorAndAlpah[1], colorAndAlpah[2], colorAndAlpah[3]];
  13080. }
  13081. return setColor;
  13082. },
  13083. sketchEditPickPolygonBody: function(options2) {
  13084. let _self = this;
  13085. let primitive = _self._sketchPickPolygonBody;
  13086. if (primitive === void 0) {
  13087. if (options2.onComplete)
  13088. options2.onComplete("\u672A\u62FE\u53D6\u5BF9\u8C61\u6216\u62FE\u53D6\u7684\u5BF9\u8C61\u4E0D\u7B26\u5408\u8981\u6C42\uFF01");
  13089. return;
  13090. }
  13091. let color2 = primitive._useGeometry.color;
  13092. let height2 = primitive._useGeometry.height;
  13093. this._sketchPoints = primitive._useGeometry.cPoints;
  13094. this._sketchOutputPoints = primitive._useGeometry.gPoints;
  13095. if (options2 && options2.height && typeof options2.height === "number")
  13096. height2 = parseInt(options2.height);
  13097. if (options2 && options2.color && this._checkColorAndAlpha(options2.color))
  13098. color2 = this._checkColorAndAlpha(options2.color);
  13099. this._viewer.scene.primitives.remove(primitive);
  13100. this._createPolygonBody({
  13101. color: color2,
  13102. height: height2
  13103. });
  13104. if (options2.onComplete)
  13105. options2.onComplete(void 0);
  13106. },
  13107. sketchRemovePickPolygonBody: function(onComplete) {
  13108. let _self = this;
  13109. let primitive = _self._sketchPickPolygonBody;
  13110. if (primitive === void 0) {
  13111. if (onComplete)
  13112. onComplete("\u672A\u62FE\u53D6\u5BF9\u8C61\u6216\u62FE\u53D6\u7684\u5BF9\u8C61\u4E0D\u7B26\u5408\u8981\u6C42\uFF01");
  13113. return;
  13114. }
  13115. this._viewer.scene.primitives.remove(primitive);
  13116. if (onComplete)
  13117. onComplete(void 0);
  13118. },
  13119. sketchPick: function(onComplete) {
  13120. let _self = this;
  13121. let handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  13122. handler.setInputAction(function(event2) {
  13123. let pickObj = _self._viewer.scene.pick(event2.position);
  13124. if (pickObj && pickObj.primitive && pickObj.primitive._useGeometry != void 0) {
  13125. _self._sketchPickPolygonBody = pickObj.primitive;
  13126. if (onComplete)
  13127. onComplete({
  13128. color: pickObj.primitive._useGeometry.color,
  13129. height: pickObj.primitive._useGeometry.height
  13130. });
  13131. } else {
  13132. _self._sketchPickPolygonBody = void 0;
  13133. if (onComplete)
  13134. onComplete(void 0);
  13135. }
  13136. handler.destroy();
  13137. handler = null;
  13138. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  13139. }
  13140. });
  13141. SketchViewModel.SketchType = Object.freeze({
  13142. Point: "point",
  13143. MultiplePoint: "multiplePoint",
  13144. Line: "line",
  13145. Polygon: "polygon",
  13146. Height: "height",
  13147. Spatial: "spatial",
  13148. Circle: "circle",
  13149. Rectangle: "rectangle",
  13150. Triangle: "triangle",
  13151. PolygonBody: "polygonBody",
  13152. DrawPoint: "drawPoint",
  13153. DrawMultiplePoint: "drawMultiplePoint",
  13154. DrawPolyline: "drawPolyline",
  13155. DrawPolygon: "drawPolygon"
  13156. });
  13157. SketchViewModel.SketchIconType = Object.freeze({
  13158. Normal: "normal",
  13159. Blue: "blue",
  13160. Green: "green",
  13161. Violet: "violter"
  13162. });
  13163. SketchViewModel.RuntimeEnvironment = Object.freeze({
  13164. App: "app",
  13165. Web: "web"
  13166. });
  13167. class CommonTools {
  13168. constructor(viewer2, options2) {
  13169. this._viewer = viewer2;
  13170. options2 = options2 || {};
  13171. if (options2.isDrawPoint) {
  13172. this._isDrawPoint = options2.isDrawPoint;
  13173. } else {
  13174. this._isDrawPoint = false;
  13175. }
  13176. if (options2.isRetainDrawPoint) {
  13177. this._isRetainDrawPoint = options2.isRetainDrawPoint;
  13178. } else {
  13179. this._isRetainDrawPoint = false;
  13180. }
  13181. if (options2.isClear) {
  13182. this._isClear = options2.isClear;
  13183. } else {
  13184. this._isClear = false;
  13185. }
  13186. this._sketchViewModel = new SketchViewModel(viewer2, {
  13187. iconType: SketchViewModel.SketchIconType.Blue,
  13188. isDrawPoint: this._isDrawPoint,
  13189. isRetainDrawPoint: this._isRetainDrawPoint
  13190. });
  13191. let buttonDiv = document.getElementById("drawButtonDiv");
  13192. if (buttonDiv) {
  13193. document.body.removeChild(buttonDiv);
  13194. }
  13195. this._init();
  13196. }
  13197. _init() {
  13198. this._measureEntityName = "MeasureEntity";
  13199. this._entities = this._viewer.entities;
  13200. this._measurePointImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcEAYAAAAinQPXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAAB2FJREFUWMO9mHtQlNcZxn/nW65GxHtEqTEajUxVoLYRSIyipHG4qG0lajtxVIRFubgqXuOI28ZE7FAvCLKLSNKxg/FSIzdvqNE62kaRitqpYMxovBGigo4I4n6nfwjsCrsLrtjnn53vnPe87/Oc9/2+854VdBhCd6ZP6dMHlAXO/lOngrzMLz/8EEQ0ASNGANNY2aOHxYIdfHr3LuBCwPnzQIKcf/AgiJ8pQV99BfmvR4+orHxZVsLxpZFT0qd07gyP7zqrej3IInF47lwQkTLV3d1xv3KXWPT4MYhLzMzIgHpn10+Sk+Gw74w+jx79HwSGnzUYhg4FED4FBcBq/jtokOOC2oSb0FZUgHpKVoeHQ9GtGM/y8lcgMLxf5juDBwNDlOWnTgGvUdWz5wsQ7c179fUWzz9y0tX1BdZPILeqCpTtil9QEOT9c876K1faWqS07XeMzJFuboCXkpaX1w5hqxl14QJIKYRWCzLV5OXtDQXbon3c3c2/TeMoYvncucAgPrl40Y7fA0zv1QtMydKwb58FL7toRwbDYo3/0utB3OD8qlX2hIkLqalwO0b9+fLlUHJOG9vQ0P4EjfyFIdPZGfqsURampIBIlxsWLLBtL/NltF4PhUIrVq92QGDIeEOmpye4pYju164Bq6n29LTiopy8tDTIL48pSExsDq/Oj9is/eAD4CRbli1DMEFUBAYCewnUaJD8jr2lpQjpJ7M2bBBi0+L47Tt2mP2G5xhNaWnAHrLj461tKF1rasA0rW5b//6w/0rigQcPWhrZKVFXP8TkybaFyb3kXbkCbiO6fpyU1Dwq58vNG3U6BJvEiYMHEcwQW8aNA3pT7O4OaPmTiwuCnlwcNQrEDRGYmytloilj5vr1Zv+mNXVhSUnmOFYEVnt6gtM9t+8mTbKlwo5AoWdySIjteWUcIwwG2LX7o6lPnkiZULTlj/7+wEThm5oKbCBeCOANUisqkNRxLCEBSSzrYmOB3jw6c8Yi3kL5K51OyvkZGXUTJz7LSH09CIPwMBpt85CHhMf48Q4IJFPofHzsbMAAJfjIEQtXC9TZWi0wkEuKAmjEyspKpNN2pyVBQULZaIjbvXmzUDb6xF0zGJCqv+no6NGAK5fLyiz8JssVcXEWgQLUsZZxWmGbrLTN057Agfh7eNiefhpRb7h922LgOzFp2DDzxnJXrsvLE0rqOW3sTz+12h4lLfRZhuQybuXmWmQkgPzhwy0o1jlV37ljh+e3/L1LF0cEXqX04UPb0075rlovLwtBHuqZ5845T5Z37UqbEAPkzOfsUvlHXZ35saFnQ4++fe04eIfftv64tEfgdvkXeweprFIvBQaaebJH+f3x4xbPvsRPnixlQlHGtDFjWq2Wuqj0yz4+QKk4FxNjMVXD2998Y0FRKEsCAuzwzBKv2eZpR6DspxQcPWpnvrNYoNNBZOTOnRoN0ilJMzYjA3ibsKoqoIxezs6gLJbpxcVSTbyePurwYSkT76VPKSgAWQslJcAmenTrBszgP7W1wBlRmZICY2SydHIC8ZCvdTo7Ak+ri44dcySDNDTs2mVufluhThoGD4bHp6or4uOb3zWJnoqwMGAVLnfuACHscHJCiFRmhISA0BMcFob52PDC/8EDkLfkR5GRQmycN8/t8mXw8O73WVwctnvdJ3SqrQXNSJeY3bttaWhHJxMxzDh97VqQAwheutR2IC6pm/z8oOBm7LcVFVJNKNo0oUsXhBKmGR0VBfI0vkFBINzExxoNEKP+ePYsktefFmVnC2Vjvm5SZSVEpGUNefNNUH8ti8rKQCziaOfOVuL2563PP4eCjJhxK1a8hMCJJ7NTPDxAXWIaefEi0J2r/ftbMfyryDhxAkZ2u1EaHAx6oReq2rb/JiTLZKkoUHLf2//YMWCGnPf++1YM7zHw+nVQ1mlKhg2DvPeiltr+GLaj2W524Kd6zZ4NhGOQ0ophI6GSkr4Gq61VGyjx7vdZQoIdYY1xVZ06RKttS1gTHLkPLjVmGo3AJZToaCsGjSWrPFBKfH3bvta0uyR3ySlGIxS4a7trte1l244MtoRpT93XSUk0l0oruFDbqROYUtQ9X3xhLr2WaBpX4+WnOTl2hHkw9eZN0Li5dLP6Dehogc1dexslK/7MynffhbNDvZXnWq9GNJWyiKC69TlphvobtWbOHNgnZonq6hdl+xL/yTQhbKUxeOtWEP9melSUFYMWJSv/IAtNprZLUu4Rf9u6FQpdo49bfRXaBQcy2BL1p+XURYtAZrLwhx+sGDSWrDpc3ZeVBbJMPt22zY6wRj/1oep08zXMUXRABpsQFmqcHhICYiLlhw4BBWiFA/5FOXmhoc8u0Pv3vyyrDshgEwqLYnKLi4FO5OfkvPh66UdudnZHCXsFAptQ96XMW7jQTsm2xAF23roFlD6NXLy4o9m8AoHFR7SxNTWgjGOsVovtxqBxXAzEbc4cKCycN+/+/Y7n88oRvjarcNYsCDtprP/+ewjvZ1xz9SpERBp3zpz5qqP/D5zQE33tptaiAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTA0LTA5VDE2OjQyOjI5KzA4OjAwjRBbGwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wNC0wOVQxNjo0MjoyOSswODowMPxN46cAAABKdEVYdHN2ZzpiYXNlLXVyaQBmaWxlOi8vL2hvbWUvYWRtaW4vaWNvbi1mb250L3RtcC9pY29uXzJhcHo1b3VpcnV4L2Rpbmd3ZWkuc3ZncY9vkgAAAABJRU5ErkJggg==";
  13201. this._iconBlue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkEyMUE1MDg3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkEyMUE1MDc3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/grmkAAAhxSURBVHjazFoLUFVFGN49597LBdFUEpEQI0IpyxIfqU1ZkY/pNZg1RZlWY2lW4yMncxq18oHZ0+lhOaWZUo0zPjIr8W1NiubI+AxBIkRQQsQE7us8tv3P7qGL7gXOPRdzZ3bmcnf3+7/v/Lv/+f/lYkIIMpur2yBktQVO5yM7LRybIvsOFKFGCeHyQz/dFO2Ousflcg6UJSlVlqVEjHEMjNMH5tE0vVLT9ZJAQNnn9fm3d+9z3xEYioR9bNcjW9Z8Gtv35l7PUAFjnU5HLytrFUU9TgV9XXD4+PJhoyfV2/GIFO4TGD8my1lVuGXSHYNuPdyhfbv5VkVAgzWwFjAACzAvp0fwoV++uz6lxzXLolzOW1AEmz+gHCwtq3i2z52Pn2jtlgvXI1LpgQ0jeqYm74y0CGiACdjUxkir3KxMlsoKNj6WmNAlV5Kk9qiNGmBTG6vAlhV+rd1aUuGeNSNSeiSuolGo2X1cdDogbThQ79h21CMfP6NKtR4dw/edYiTSK8GhZ/aO0R7KiFV7dnPpzeFQXkppWeWY9MGj8+ifektbqzVC8KbVH6UNHdJvOw2nHUIB7vrDI89df861p0SRsUSjuiSzB4qxyYzx0TVEdBUNTnVqs7I6B4beEKOFwqThuu7X/IJ7hj/yYlGoM9NqIakpSVH7t67c3C4muq8IyKcQ9EpuddSK3xqcSHJR7g7WsSkCm8+YiSEgRuU9gMbd3k5578kufrcTC8U0eLwF/e99anhJ6Sm/HSHSid/Xv5CclJAjAjlXr+GHP6x07z9JZCSDCBfzBJapBomJabJfdKqFCiGa4RkQgrQA6p+MtbVTEn2dY2XhUz956szM6wdkLRFtsVZFrReeeaRTQte46aIxT4DgrA9ABJKRw42QTLsjimqATgUZwpxNO/0OGz3KmMvWuBFgABZgimwBB+ASbtSSp0zIHutyOuNEg9NW/e06UE49YRBi5LFB2NxaMoQg5iGJfza+Y+MwlwlmogALMIXpD+UAXIBTOEKi4rt0zg51sFft8TjN7YQbnzrbVpeeD8Q+w3fYFCQba9ha5kHABGyRTcrlCeBkVQjO/Wxeb3rA00WDb62rcbHzAARML0hBAloK+lyQ4TEHx2B4BragUS69vl06/6aLnk6LQuQ+vdMyRQMHT/ql/D9VGfEQi00PGFDYwqsP8/AsMQyJbTvABhuiFb3TU+8Otb1CCXFd1SF2gGhg/f56Bw4+B9iCJ0J5Bv93fgAbbIimd7yq/UDgZklITLQ7RTSwp9grs7MgBYXYMEQ0OTtBWBR7d5FX+NQ5J0tCHG63K0GYglSpkrklGkXY1GGKMbdo8d+qkBfn5LB0RpwOeDlc2mo9NNYHbyOMIuCRptvNsCGqXxgnS2dEoslhxMrgSDXOSbL0HlFVzSv6vlMMJigorWGpnJ2ymzRdTrENGxY4NSeE+PwBYQ3ds6tDN1IewvvFRMLQwTBMPB2lxTuEaTvnRKwI0S/U1ZeLBganRWtGwteYAOoR8EgQFsUe3DNamNpzTroVIWp1TW2xaCCrf6xKzDScaP89SRKGGBLkCSMjVo1aZRS1IZrOOalWhCgHjxTvEw3ckhylD7rOobF6ghZJphhk1TO80DK8Yab1KgJssCHMKhgnxYqQQM7i5bv9AaVONDh7VFzAqCWMekLhRZIFzzQWWLzIMjAY3qwsii2+YakDTsDNkkdoRVZbXHLyN9EglKdjh8QoUBSBcaIDEYU91cbtRi7yUFCF2OgBha9lBRZg3nWjuPQFLsDJqkfAtfWfr1jzDSHiR/zuk/GBjO5YQyqtQDU/5WYKCjo/Oicd/JmPw1xYA2sBA7AAM8RFBAEuwMnqYTei3Q95vx47U1VzTJj3uDBZNzXRl9EdUTE+SshnECJcFPOWwraNxj0GYo3OyLM1PgQYgAWYIlvAAbgAp3AKK6XyTPXZ56bOm0f3p/BFFEdr7LwZSd5xQ9wKUukUo/u4h8SdecCHzPmwdtOMJF9ciHodbE+cvmA+cAm1rVoSAsD1m3fmH127cfvSUJOiXRh98nS8/8dpXb0DknWNKB5qzsOIKlwYdIULpWMwB+ZunNrVC2tDeQIa2P552+4jfFsROxd0sbRfm5/31dyMPumZLQWkwsqA9EOTCzqCzdTGvKB7MCNWTU9s/oIOWsHh41tvGz5uNv34Fxdi64IOvNaxQ/t2aXvzVixKTUnqezkSRBqhCm4bMW7GhboGuJw7H+qQW7nEBoALFPCvOx8cP+toYUl+W4v4o6h0L9iiNkvBdnNXplYvsSEtOFddc75owLCxc6jLd7aVCMDulzlmDtgCm6FSEju38RAxztJUumTkoy+9faqyqjDSIgDzgezJi6gN+P9Is1HKjpBGz9T+U1cy+ulXZ9XU/lMRKRGABZjUEyeseCJcIY1i6BY4NmHagjlen/+CXREUow6wADMcEeEKQTxxq96wadfvCz9cvpBuBSVcEbCWYuQAFmCGSgrbSojx0qW9KmfxV5u/zP1+MTEqI6vlCNFhLWAAFsdEl1sIvIAgdTn98muL1mzZtXe1VYCtv+xbDWsBg2OR/0OIKaaB9ooHsqcsoXt8h4Uwu+P+xyfD/zwqOIatHw7YFQJvVthSUICVDxs9Kae0rOJwS2vKyk8fgbmwhq/V7fKwLYSLgWLoPLz9s59//c3mwjKMPTZ+5hswl6ceWiQ4REQIF2OE5QOHCo9NfCVndoPHW3vxHPgOxmAOzOVr0BUlhIuB0Hn2+5937p/77hcLgsMyfF7wwbKFMAZz+Fx0RQoJDsvvL8ndYYZlM8y+8/HKbXbDbKgW8ftd+qQJLQcglFZCaE3qFn81wogEh1mYE/F74bb64RnFAm/DDwy6mPdrkJLzKGfLpsj+vwIMACSZzfDJFmOPAAAAAElFTkSuQmCC";
  13202. this._iconGreen = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MjI1NDIwOUU3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MjI1NDIwOUQ3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgEE4igAAAgKSURBVHjazFoJbFRVFP3L/OlMoQXKImAFm0JbFtFKShEQI6UsggmkGKghIKTIIgZUohIDKEuLaFTQiIKyKKghqSyyF0pZbcHQsJVpoRkKbYFAW+iU2f78/313+qY+hvc78+dPkZfcMJ377rn3/Pve/fe9gVUUhfENY5eBjNbhvlnI6Bmh+KT5NzBhGigg9sb5vX3NpohhRqMwgOe4eJ7nurIsGwl69MDskiRXS7Jc7naLpx1OV/4z/V67CKpw+Gf1ZiQv9/vWyc8lTkMEpgiCIVGLrSh6ShGhX4ovlG5Mz5jToCcjXKhPIGvyOOG2JW/OywNfuBAd1WqFVhIwwAZsAQOwAPNxZoQ9f+yPHnHdn94QYRSeZ8I4XG7xnLWianq/oZOuBrvkQs0IZz27a2RCfLeCcJOAAZiAjXyM0hqblslcRfHuiV07d9zKcVwU00IDsJGPLeBLS3zBLi3O8nfuyLjuXbegKtTsOrY4Ldz22u2GPFue4bL7MlfrqWXh+xhDjNLL2EtOj0r3jI8Z70kyJcnN4aC4RGtF9eSklzIOoD/lQEsrGCLs/m3f9nxlUP98VE6j1QDz6/P5xZWLI06KJ3lGwIWdB2tfZEgkJB4oVwwzWBgsLY1d6hoWPUxSw0Tl2na8sHjYiAnvlKntmaD3SHxcrDG1f9/1aiScspOZYZ1hGm4dHnmSRyRglk+i/ITQwVywAVvAoA3kMyolufc6iEHv0uKuntkxu1ts5xyacY2nhh1TNsZcpBTxjBl2K4AQ2eD8MiITWXFDmULiYJhUNlXak7DH0d7QnvrUr1feWtgjZdxa2hILKiOzp01o1/mp9gtoOrtsZ0eXjjYXMYhEa/RFKyxmLCaCmBF/NhF633xkCxiABZg0XxADxBJq1eLnz8ycYhSE9jTl3Iq5EWeYM/wjwUPQvj1CEwHP8SMFWIBJbX9QDBALzrNmIhGdOsZkqm3sTfWbhKbgTcSSMhBLiiYcMc9I2CMswARsmk8Uy5s4r5qIsFt/WN6nVaQ5iaZcVLkoQjEpjbD++4IM+hFUQniCDMYBTMCm+USxJP6+bkVfFWRVIny/Pj3TaIpiezF3SjzFN619AaNwRLABSwzhnSOWGxLABh80sz5J8a+qLS81IsY20a1TaIrc2lzhoX3A+2Ui6FcxkRn+4f3j9UEZbdtEDcCUgycSaTbF0RQnGk7wTY79S2xIbSvGIDCPNxynPnUckyYiBpPJ2JmmKBVLuSYCXIA9EWxWWAIPYZeJZdS4cEwGTXtEMBhMNEWthHonVieB5gix2Aft/NIYk6Y9wqHmMGzH4HANHBOn6T3i8UgO2vcxfIzibTdI0Tv88Lw+NMTUHBHF6XJTz9CJQqLs7ZdkLHoIkbbyf71YgpBAbdtxTIoWInK9reEGTTGk9RCpqfGTCDJ6skE2kxL2QRk4JlkLEc+dmrorNEVGTIbo7VxFgowUQlYU4oxCnFMAe0LMBJFmgmPyaCEinrt45TRNkRyZLA8SBkleMj5CMvGclCBJMIQdJgAC2OCDZoZjErUQcees3njK5RZtNOWy2GUu1sk2nidcOAiPX2aUAHvC/1yCBDDh1Khyw2KDmLBF8Bkpt1bWXSm/fpKmhOPp9OjpIhyKGCcWHxkPpQj4b2oPQcJnj7AAMy06jbo/IBaISWtGwF3Dj5tzf1PIIyQx1nRf40phUiTmQWMQTaTI/ePx2wPEPvAF7xWEAViAqXIRoUAsEJPWze6tdn8dOF5y63ZNCbXv4SKVvYl7HSkKItPQGMwjpFx+4he8V5AtYAAWYNJ8QQwQC0bQfLASq2/duTvjveXL0fqkvog6GDooR3sdtWdFZomsjW18Xj5SdhXBwYOADdgW9CpwAJbK3nDMWpC9AmJRW1aBiABww8GCwkt/7s5fpzbJzJmZ9XHrnYfiDtkHSgMlph59CSXC9y8phA7m5sXl2cFWLRMwwPe+w6cuYvqKngs6uFp4tvDApmUv9ktKC1RZSxwl3I66HYaD9QcNFtHC+RpAaDuShCR5RPQIz7h24zy9zb3lQFjFF0oPpY6Yuhh9vIaJ6Lqgg6y1jY5q1bPowOZV8XGxyY+jQUQVqjh15NSP6m0P4HLuntom13KJDQD1CPDa0NezFl2ylBe2NInLZdYi8IV8WvGCDJi9YC+JoXDW3qm5V5aSPmUJSnlBS5EA7P5pk5eAL/Cp1pLouY2HinEXtdLlo96Y+3ll9W1LuEkA5tjMeauQD/h9pNkqpYdIU2bq7tvKM976cFFN3f2qcJEALMBEmbiqJROhEmkig5ZAycz3s5c4nK56vSQQhg2wADMUEqESYXCTcWfX/qNnVn6zcSVaCmKoJMAWYeQAFmCqNYUtRYTBTcftnNWbDv68dedqVMZlrQBgA7aAAVgYk3ncRBTcNd189+NVuXlHi7ZpBTh07PQ2sAUMjKX8H0R8ZKB7qhqbOX8tWuNHNJTZI2MmzYPfPKowhq5rDL1E4M0q4w7qRnrGnBxrRdWFQDYVN25ehLlgg21lvXHoJoLJwInjHrz9M9/+5LPmyjLoJmYt/BTm4tZDCkcMYSGCyXjL8tnzlpJZH+QsfmB31PnPge9AB3NgLrZhnigimAyUzrs79xX8s+zLn7LJsgyfs7/esBJ0MAfPZZ5IImRZ/mrt1iO+suwrs1989+thvWVWbYT9fhc9aQUdB6CUVkNpje3SqQPDMgpZZmFO2O+FW+o/niEsyDb8qt7Rd78GLTmucrp80vz/K8AAYAEv1AHM/GwAAAAASUVORK5CYII=";
  13203. this._iconViolet = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzFDREU3Mjk3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzFDREU3Mjg3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ppb+WxIAAAhcSURBVHjazFoLcFTVGb6vvdnNY0lEEJOIxhCSKTEFKSC1osIgjqIyA62mZfAxWJU+tC3TVh2lHSGhtNOKOqK0ii+0QwcfFB+IAsKIITpJhUBDHhMiSSBCTMgm2d377PnungubnXOT3L0b6rlzmM2e83/n+87/n/+ecxbeNE3OLvLFV3Fui3KiivNSkhmTNb7EpagQQvzxg++VBvxpc2XZN1MUhEJRFHJ5nk9HO5mwAV03OnTDaFYUtTocie66pOymOjSlYnzeq0d2bn02c9oVxXcTAct8PqnYja2qakeJoFdqDx3dNH/xij4vHhGSnYHlSxf5Out3rrjmqqmHglkZa9yKQIENbIEBLGCeT4/wB/f+c1LBpXkvpsm+73IpLFFF/bKltf2esjl3NI005JL1iNBSs23B5MKJe1ItAgWYwCZj3OiWm5vOQmvt9ttzJ4zbLAhCFjdKBdhkjNcwlht+Iw0tof6zrQsKLs19jWShIeM40hASure3S727O0WloV/QehTeSo/ZsilPzjCC11+k5yzM0/yTs4yhcAgvtaW1Y2nJ7MU7yJ/GcKE1EiH8B1ueLrr2+9N3kXQadAIM7f1abK84LEcOnBFFXuREMpk8TyrHx4jhMQ1OJ5x0U+f8s8boeY9MUbLmjNedMEm6Du2rqp17w5KfNTitmRGvkcKCfHnW9NK/O4kwIjp37JdfpDUv+jSgVw+IASHAofpRef/gSttQ0Rc2sAUGq5Axs2ZM+85GcPAaWkLT528/MDF/QiXLWPtG4Rt/tM+v1vSLMi9zPl4iniCVeASeEPjB82QQj8Az8IjOaZxqapxiKpzvygy9aMs1EekCmTnrX7WdfHjSjEUbWCE2Io88cPeSnAkXjV3J9ERY5xuX7PNrNQOin0/j0kiVUQUI8llVSnjs79FHpjawBQawgMkaCxzAJdmsJT50X/ky2ecby5yllTWy+p9+MY2PkYonb60RUuER1udBoixBMgcsYDK3P4QDuIBTMkLSxo+7oNxpYfe80eaLhZPMSSSkUAU8vPWvFVr2QrdimD7xfWw7nzUZMgdMYLPGJFx+DE5uhfCbn1s9JSM9UMJqbF9TJ5O5tNZEooh48o4Lk66fwWJIJZjAZtkQLsVvbFxTapm7ECKWTSmax2oYONgjRKp7RSluYbsRwRITS9cxQcDGGCybKSWF1zuFl5MQeUwwcwaroXtbmyTRWLdFkJekKxGDwo3nz4nB+iEVY7D6Z4/JmgluroSkB/wFrIa+z7rE2DyeWwfJiEhcO2fXD3n69p9mzjrl5EqI5PfLE5hv0qZ+gach4TacRhJmwFaaB5i8KCfJ1RrxSZKfuW3oUflE8l49kvg3xmCeX2KcXK0RMut8yo7BqSqUk+DqPaJpepjpqmyfaSbs30wPx24WFsZww2koIWYkqjDP0PKkDAO7WOuheyevBRgGxQS2XJjO3LZTTqYbIUZvqO84qyFz9lidyohtzenjRYT92LiZsy9kbocpJ8ONEO1UV3cjqyHn1nxNw+6V1tgsJicmdkaJCbDxgJ1zW77G6k85aW6EqF/WNVYzc3lZtuGfGdQ1sgXHVtwW4zbM4sPJ3tYDE9gYg2VDOaluhCiV6zftjypqiNWY92iponKKdZ7QaHUjJl6EbQ8sYOY+Uqo43LCEwAncXHmkuaWtu7H5q09ZjTieZv/kEhWHIpXURDHx6ydxLcT3OSdCsQ5YwAxeyz76ggs4ufUIXNv3/MtbXzfjj5BxZeK6aYpvaoYetUhECRnVqhoNNyvkTIP5WbNOh7H+sAUGsIDpcBFhggs4uV3sVrb79459R052dh1hGgZEs+hfP4hIU9P1iEUmapFSDGWQqPjnLHlDoQKiHGyBASxgssYCB3ABp2QOVmrHyVOn7/3V6tUkPpkvImlsmln83nXh4NJcNWKGuYgRIxcTpcQIx1fynd2OvrCBbfG710WA5bA2wvevrFgDLk5hNZwQAPd9uKfq8Jvbd210BPCL3GVPfS9a+PbVYWF6QA8bEBSrYYgzI1a1Ptvfk4q+l791dRi2Tp5Awdjvf7y/joaV6eWCLpPUy6p2vPTElWUl84bLSOH6XqHn3Xapd9fXotLUJ+jdmrUBFHMkU56UaQTnkkRxc54WKAkaw2HVHjr60awb7nycfDxGhXi6oIPXsoNZGUUHdry8rrAgf9r52CCSDFU7a8Gdv+sN9eNyrsdpkbu5xAZALwE8NueW5Y8drm+uGm0R/21oOYCxyJgtGHuoK1O3l9jYFnxzqqunYcb8ZauIy/eMlghgT5+3dBXGwphOWxIvt/HIGKfJVrr5xh/+/E9tHZ31qRYBzIXlD64jY+D3kSGzlBchZz3TfSbUvPiu3z7W1X2mPVUigAVM4okmN55IVshZMSQEjtz364pV4Ui016sIghECFjCTEZGsEI5u3E5t++CTz9c+uWktCQU1WRGwJRiVwAKm06ZwtIRYL11SOyvXv/ThC5vfWW/iaOf2PEJsYAsMYFFM7nwLwQsIW5cTv/j9uq07PzmwxS3AR3urt8AWGBTL/H8IscX04zp4YflDG0iM73aRZnfffMeD+M2jnWJ4Ovx7FYI3K0IKB7Dj8xevqGxpbT80nE3r8RN16Asbamt45eFZCBWDw1AP3v7lP330j0OlZbTdvvzhP6Av3XroqeCQEiFUjJWWaw7WH7n/N5WP9w+EuxP74Du0oQ/6UhvuWyWEikHqPP3O+3u+eOIv/6iIT8v4XPG3F9eiDX1oX+5bKSQ+Lf91w+bddlq20+yfn3n1Y69p1qmk/H6XzLRJjgNIpR1IrfkXj7+Q4zkzPs2iT8rvhUfrP54RLHgbv82Ps+/XsCWnWc7TmKzx/yfAAHo1CtU9myPWAAAAAElFTkSuQmCC";
  13204. this._measureTempPoints = [];
  13205. }
  13206. _updateScene() {
  13207. this._viewer.scene.requestRender();
  13208. }
  13209. _removeEntityByName(entityName) {
  13210. let entities2 = this._entities;
  13211. if (!entities2 || !entities2.values)
  13212. return;
  13213. let delEntitys = [];
  13214. for (let i2 = 0; i2 < entities2.values.length; i2++) {
  13215. if (entities2.values[i2].name == entityName) {
  13216. delEntitys.push(entities2.values[i2]);
  13217. }
  13218. }
  13219. for (let i2 = 0; i2 < delEntitys.length; i2++) {
  13220. entities2.remove(delEntitys[i2]);
  13221. }
  13222. this._updateScene();
  13223. }
  13224. _clear(isAll) {
  13225. if (isAll != void 0 && isAll === true) {
  13226. this._removeEntityByName(this._measureEntityName);
  13227. if (this._sketchViewModel != void 0) {
  13228. this._sketchViewModel.sketchClear();
  13229. }
  13230. }
  13231. this._measureTempPoints = [];
  13232. this._altitudeDynamicLabel = void 0;
  13233. this._tooltipRemove();
  13234. let buttonDiv = document.getElementById("drawButtonDiv");
  13235. if (buttonDiv) {
  13236. document.body.removeChild(buttonDiv);
  13237. }
  13238. }
  13239. _toColor(red, green, blue, alpha) {
  13240. return new Cesium.Color(red / 255, green / 255, blue / 255, alpha);
  13241. }
  13242. _cartesianToGeography(cartesian) {
  13243. let ellipsoid = Cesium.Ellipsoid.WGS84;
  13244. let cartographic = ellipsoid.cartesianToCartographic(cartesian);
  13245. let latitude = Cesium.Math.toDegrees(cartographic.latitude);
  13246. let longitude = Cesium.Math.toDegrees(cartographic.longitude);
  13247. let altitude = cartographic.height;
  13248. return {
  13249. lon: longitude,
  13250. lat: latitude,
  13251. hei: altitude
  13252. };
  13253. }
  13254. _createPoint(coord, label) {
  13255. let _self = this;
  13256. let entity = new Cesium.Entity({
  13257. name: _self._measureEntityName,
  13258. position: coord,
  13259. billboard: {
  13260. image: _self._iconBlue,
  13261. horizontalOrigin: Cesium.HorizontalOrigin.center,
  13262. verticalOrigin: Cesium.VerticalOrigin.bottom,
  13263. scale: 0.5,
  13264. pixelOffset: new Cesium.Cartesian2(0, -11),
  13265. disableDepthTestDistance: Number.POSITIVE_INFINITY
  13266. }
  13267. });
  13268. if (label) {
  13269. entity.label = {
  13270. text: label,
  13271. font: "30px SimHei",
  13272. scale: 0.5,
  13273. fillColor: this._toColor(255, 255, 255, 1),
  13274. outlineColor: this._toColor(14, 30, 79, 1),
  13275. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  13276. outlineWidth: 2,
  13277. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  13278. showBackground: true,
  13279. backgroundColor: _self._toColor(0, 0, 0, 0.6),
  13280. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  13281. pixelOffset: new Cesium.Cartesian2(0, -28)
  13282. };
  13283. }
  13284. this._entities.add(entity);
  13285. this._updateScene();
  13286. return entity;
  13287. }
  13288. _createLabel(coord, label) {
  13289. let _self = this;
  13290. let entity = new Cesium.Entity({
  13291. name: _self._measureEntityName,
  13292. position: coord,
  13293. label: {
  13294. text: label,
  13295. font: "30px SimHei",
  13296. scale: 0.5,
  13297. fillColor: this._toColor(255, 255, 255, 1),
  13298. outlineColor: this._toColor(14, 30, 79, 1),
  13299. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  13300. outlineWidth: 2,
  13301. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  13302. showBackground: true,
  13303. backgroundColor: _self._toColor(0, 0, 0, 0.6),
  13304. disableDepthTestDistance: Number.POSITIVE_INFINITY,
  13305. pixelOffset: new Cesium.Cartesian2(0, -14)
  13306. }
  13307. });
  13308. this._entities.add(entity);
  13309. this._updateScene();
  13310. }
  13311. _createAltitudeDynamicLabel() {
  13312. let _self = this;
  13313. this._altitudeDynamicLabel = new Cesium.Entity({
  13314. name: _self._measureEntityName,
  13315. position: new Cesium.CallbackProperty(function() {
  13316. return _self._altitudeLabelPosition;
  13317. }, false),
  13318. label: {
  13319. text: new Cesium.CallbackProperty(function() {
  13320. return _self._altitudeLabelText;
  13321. }, false),
  13322. font: "12px sans-serif",
  13323. fillColor: this._toColor(255, 255, 255, 1),
  13324. outlineColor: this._toColor(0, 154, 94, 1),
  13325. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  13326. outlineWidth: 1,
  13327. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  13328. pixelOffset: new Cesium.Cartesian2(0, -28),
  13329. showBackground: true,
  13330. backgroundColor: this._toColor(0, 0, 0, 0.6),
  13331. disableDepthTestDistance: Number.POSITIVE_INFINITY
  13332. }
  13333. });
  13334. this._entities.add(this._altitudeDynamicLabel);
  13335. this._updateScene();
  13336. }
  13337. _measureDistance(positions) {
  13338. let distance2 = 0;
  13339. for (let i2 = 0; i2 < positions.length - 1; i2++) {
  13340. let point1cartographic = Cesium.Cartographic.fromCartesian(positions[i2]);
  13341. let point2cartographic = Cesium.Cartographic.fromCartesian(positions[i2 + 1]);
  13342. let geodesic = new Cesium.EllipsoidGeodesic();
  13343. geodesic.setEndPoints(point1cartographic, point2cartographic);
  13344. let s = geodesic.surfaceDistance;
  13345. s = Math.sqrt(Math.pow(s, 2) + Math.pow(
  13346. point2cartographic.height - point1cartographic.height,
  13347. 2
  13348. ));
  13349. distance2 = distance2 + s;
  13350. }
  13351. if (distance2 < 1e3)
  13352. return distance2.toFixed(2) + "\u7C73";
  13353. else
  13354. return (distance2 / 1e3).toFixed(2) + "\u516C\u91CC";
  13355. }
  13356. _measureSpaceDistance(positions) {
  13357. let distance2 = 0;
  13358. for (let i2 = 0; i2 < positions.length - 1; i2++) {
  13359. let point1 = positions[i2];
  13360. let point2 = positions[i2 + 1];
  13361. let sx = Math.abs(point1.x - point2.x);
  13362. let sy = Math.abs(point1.y - point2.y);
  13363. let sz = Math.abs(point1.z - point2.z);
  13364. let s = Math.sqrt(Math.pow(sx, 2) + Math.pow(sy, 2) + Math.pow(sz, 2));
  13365. distance2 = distance2 + s;
  13366. }
  13367. if (distance2 < 1e3)
  13368. return distance2.toFixed(2) + "\u7C73";
  13369. else
  13370. return (distance2 / 1e3).toFixed(2) + "\u516C\u91CC";
  13371. }
  13372. _measureAreaBearing(from3, to) {
  13373. let radiansPerDegree = Math.PI / 180;
  13374. let degreesPerRadian = 180 / Math.PI;
  13375. let lat1 = from3.lat * radiansPerDegree;
  13376. let lon1 = from3.lon * radiansPerDegree;
  13377. let lat2 = to.lat * radiansPerDegree;
  13378. let lon2 = to.lon * radiansPerDegree;
  13379. let angle = -Math.atan2(Math.sin(lon1 - lon2) * Math.cos(lat2), Math.cos(lat1) * Math.sin(
  13380. lat2
  13381. ) - Math.sin(lat1) * Math.cos(lat2) * Math.cos(lon1 - lon2));
  13382. if (angle < 0) {
  13383. angle += Math.PI * 2;
  13384. }
  13385. angle = angle * degreesPerRadian;
  13386. return angle;
  13387. }
  13388. _calculateAreaAngle(p1, p2, p3) {
  13389. let bearing21 = this._measureAreaBearing(p2, p1);
  13390. let bearing23 = this._measureAreaBearing(p2, p3);
  13391. let angle = bearing21 - bearing23;
  13392. if (angle < 0) {
  13393. angle += 360;
  13394. }
  13395. return angle;
  13396. }
  13397. _calculateDistance(point1, point2) {
  13398. let point1cartographic = Cesium.Cartographic.fromCartesian(point1);
  13399. let point2cartographic = Cesium.Cartographic.fromCartesian(point2);
  13400. let geodesic = new Cesium.EllipsoidGeodesic();
  13401. geodesic.setEndPoints(point1cartographic, point2cartographic);
  13402. let s = geodesic.surfaceDistance;
  13403. s = Math.sqrt(Math.pow(s, 2) + Math.pow(point2cartographic.height - point1cartographic.height, 2));
  13404. return s;
  13405. }
  13406. _measureArea(points2, cartesianPoints) {
  13407. let self2 = this;
  13408. let res = 0;
  13409. for (let i2 = 0; i2 < points2.length - 2; i2++) {
  13410. let j = (i2 + 1) % points2.length;
  13411. let k = (i2 + 2) % points2.length;
  13412. let totalAngle = self2._calculateAreaAngle(points2[i2], points2[j], points2[k]);
  13413. let dis_temp1 = self2._calculateDistance(cartesianPoints[i2], cartesianPoints[j]);
  13414. let dis_temp2 = self2._calculateDistance(cartesianPoints[j], cartesianPoints[k]);
  13415. res += dis_temp1 * dis_temp2 * Math.abs(Math.sin(totalAngle));
  13416. }
  13417. return res;
  13418. }
  13419. _calculatePolylineAltitudeHeight(points2) {
  13420. if (points2 === void 0 || points2.length < 2)
  13421. return -1;
  13422. let cartographic = Cesium.Cartographic.fromCartesian(points2[0]);
  13423. let cartographic1 = Cesium.Cartographic.fromCartesian(points2[1]);
  13424. let height_temp = cartographic1.height - cartographic.height;
  13425. return Math.abs(height_temp).toFixed(2) + "\u7C73";
  13426. }
  13427. _setMousePointerStyle() {
  13428. document.querySelector("body").style.cursor = "crosshair";
  13429. }
  13430. _initMousePointerStyle() {
  13431. document.querySelector("body").style.cursor = "default";
  13432. }
  13433. _checkAppOrWeb() {
  13434. if (window.navigator.userAgent.match(
  13435. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  13436. )) {
  13437. return CommonTools.RuntimeEnvironment.App;
  13438. } else {
  13439. return CommonTools.RuntimeEnvironment.Web;
  13440. }
  13441. }
  13442. _isRuntimeApp() {
  13443. if (this._checkAppOrWeb() === CommonTools.RuntimeEnvironment.App) {
  13444. return true;
  13445. }
  13446. return false;
  13447. }
  13448. _isRuntimeWeb() {
  13449. if (this._checkAppOrWeb() === CommonTools.RuntimeEnvironment.Web) {
  13450. return true;
  13451. }
  13452. return false;
  13453. }
  13454. _createOperationMainDom() {
  13455. let buttonDiv = document.createElement("div");
  13456. buttonDiv.id = "drawButtonDiv";
  13457. buttonDiv.style.width = "80px";
  13458. buttonDiv.style.backgroundColor = "rgba(5, 45, 155, 0.7)";
  13459. buttonDiv.style.borderRadius = "5px";
  13460. buttonDiv.style.display = "flex";
  13461. buttonDiv.style.flexDirection = "column";
  13462. buttonDiv.style.padding = "8px";
  13463. buttonDiv.style.justifyContent = "center";
  13464. buttonDiv.style.position = "absolute";
  13465. buttonDiv.style.bottom = "150px";
  13466. buttonDiv.style.right = "10px";
  13467. let btnUndo = document.createElement("button");
  13468. btnUndo.id = "btnDrawBackout";
  13469. btnUndo.style.height = "30px";
  13470. btnUndo.style.marginBottom = "8px";
  13471. btnUndo.style.backgroundColor = "rgba(52, 137, 255, 1.0)";
  13472. btnUndo.style.color = "rgb(255, 255, 255)";
  13473. btnUndo.style.border = "0px solid red";
  13474. btnUndo.style.borderRadius = "5px";
  13475. btnUndo.innerHTML = "\u56DE\u9000";
  13476. btnUndo.style.fontSize = "13px";
  13477. btnUndo.style.cursor = "pointer";
  13478. buttonDiv.appendChild(btnUndo);
  13479. let btnCompletion = document.createElement("button");
  13480. btnCompletion.id = "btnDrawComplete";
  13481. btnCompletion.style.height = "30px";
  13482. btnCompletion.style.backgroundColor = "rgba(88, 185, 45, 1.0)";
  13483. btnCompletion.style.color = "rgb(255, 255, 255)";
  13484. btnCompletion.style.border = "0px solid red";
  13485. btnCompletion.style.borderRadius = "5px";
  13486. btnCompletion.innerHTML = "\u5B8C\u6210";
  13487. btnCompletion.style.fontSize = "13px";
  13488. btnCompletion.style.cursor = "pointer";
  13489. buttonDiv.appendChild(btnCompletion);
  13490. document.body.appendChild(buttonDiv);
  13491. }
  13492. _showTooltipMessage(message) {
  13493. let msgMainDom = document.getElementById("messageMainDom");
  13494. if (msgMainDom !== null && msgMainDom !== void 0) {
  13495. document.body.removeChild(msgMainDom);
  13496. }
  13497. msgMainDom = document.createElement("div");
  13498. msgMainDom.style.width = "30%";
  13499. msgMainDom.style.backgroundColor = "rgba(237, 248, 230, 1.0)";
  13500. msgMainDom.style.height = "45px";
  13501. msgMainDom.style.border = "solid 2px rgb(219, 241, 208)";
  13502. msgMainDom.style.borderRadius = "8px";
  13503. msgMainDom.style.display = "flex";
  13504. msgMainDom.style.alignItems = "center";
  13505. msgMainDom.style.paddingLeft = "10px";
  13506. msgMainDom.style.color = "rgb(91, 188, 48)";
  13507. msgMainDom.style.fontSize = "14px";
  13508. msgMainDom.style.fontWeight = "600";
  13509. msgMainDom.style.position = "absolute";
  13510. msgMainDom.style.left = "35%";
  13511. msgMainDom.style.transition = "transform 1s";
  13512. msgMainDom.style.transform = "translateY(-90px)";
  13513. msgMainDom.style.top = "0px";
  13514. msgMainDom.style.zIndex = 1e3;
  13515. document.body.appendChild(msgMainDom);
  13516. let strHtml = "";
  13517. strHtml += "<div style='";
  13518. strHtml += "background-color: rgb(88, 185, 45);";
  13519. strHtml += "color: rgb(255, 255, 255);";
  13520. strHtml += "height: 24px;";
  13521. strHtml += "width: 24px;";
  13522. strHtml += "border-radius: 20px;";
  13523. strHtml += "display: flex;";
  13524. strHtml += "justify-content: center;";
  13525. strHtml += "align-items: center;";
  13526. strHtml += "font-size: 14px;";
  13527. strHtml += "margin-right: 18px;";
  13528. strHtml += "'>&#10003</div>";
  13529. strHtml += "<div>" + message + "</div>";
  13530. msgMainDom.innerHTML = strHtml;
  13531. msgMainDom.addEventListener("transitionend", function() {
  13532. setTimeout(function() {
  13533. document.body.removeChild(msgMainDom);
  13534. }, 1e3);
  13535. }, false);
  13536. setTimeout(function() {
  13537. msgMainDom.style.transform = "translateY(50px)";
  13538. }, 100);
  13539. }
  13540. }
  13541. Object.assign(CommonTools.prototype, {
  13542. _tooltipInit: function(text) {
  13543. this._tooltipId = "tooltipJt";
  13544. let tooltipObj = document.getElementById(this._tooltipId);
  13545. if (tooltipObj === null) {
  13546. tooltipObj = document.createElement("div");
  13547. tooltipObj.id = this._tooltipId;
  13548. document.body.appendChild(tooltipObj);
  13549. let divStyle = "";
  13550. divStyle += "top: 30px;";
  13551. divStyle += "left: 30px;";
  13552. divStyle += "position: absolute;";
  13553. divStyle += "display: flex;";
  13554. divStyle += "align-items: center;";
  13555. divStyle += "width: 12x0px;";
  13556. divStyle += "height: auto;";
  13557. divStyle += "background-color: rgba(0, 0, 0, 0.65);";
  13558. divStyle += "border-radius: 5px;";
  13559. divStyle += "color: rgb(255, 255, 255);";
  13560. divStyle += "font-size: 12px;";
  13561. divStyle += "font-family: 'Alimama_ShuHeiTi_Bold';";
  13562. divStyle += "padding: 8px;";
  13563. divStyle += "border:solid 1px rgb(255,0,0);";
  13564. tooltipObj.setAttribute("style", divStyle);
  13565. }
  13566. if (text != void 0)
  13567. tooltipObj.innerHTML = text;
  13568. document.onmousemove = function(event2) {
  13569. tooltipObj.style.left = event2.clientX + 10 + "px";
  13570. tooltipObj.style.top = event2.clientY - tooltipObj.offsetHeight / 2 + "px";
  13571. };
  13572. },
  13573. _tooltipRemove: function() {
  13574. let tooltipObj = document.getElementById(this._tooltipId);
  13575. if (tooltipObj != null) {
  13576. document.body.removeChild(tooltipObj);
  13577. }
  13578. },
  13579. _tooltipSetText: function(text) {
  13580. let tooltipObj = document.getElementById(this._tooltipId);
  13581. if (tooltipObj != null) {
  13582. tooltipObj.innerHTML = text;
  13583. }
  13584. }
  13585. });
  13586. Object.assign(CommonTools.prototype, {
  13587. clear: function() {
  13588. this._clear(true);
  13589. this._initMousePointerStyle();
  13590. }
  13591. });
  13592. Object.assign(CommonTools.prototype, {
  13593. measureLength: function(callError) {
  13594. let _self = this;
  13595. this._tempEntitys = [];
  13596. this._clear(this._isClear);
  13597. this._setMousePointerStyle();
  13598. if (this._isRuntimeApp()) {
  13599. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13600. } else {
  13601. this._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13602. }
  13603. if (this._isRuntimeWeb()) {
  13604. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Line, {
  13605. onAdded: function(cPoints, gPoints) {
  13606. if (cPoints.length === 1) {
  13607. _self._createPoint(cPoints[0], "\u8D77\u70B9");
  13608. } else {
  13609. let distince = _self._measureDistance(cPoints);
  13610. let tempPoints = [cPoints[cPoints.length - 2], cPoints[cPoints.length - 1]];
  13611. distince += " +" + _self._measureDistance(tempPoints);
  13612. _self._tempEntitys.push(_self._createPoint(
  13613. cPoints[cPoints.length - 1],
  13614. distince
  13615. ));
  13616. }
  13617. },
  13618. onUndo: function() {
  13619. _self._viewer.entities.remove(_self._tempEntitys[_self._tempEntitys.length - 1]);
  13620. _self._tempEntitys.pop();
  13621. },
  13622. onMoving: function(cPoint, scPoint) {
  13623. _self._tooltipSetText("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  13624. },
  13625. onError: function(error) {
  13626. if (callError)
  13627. callError(error);
  13628. },
  13629. onComplete: function(cPoints, gPoints) {
  13630. _self._initMousePointerStyle();
  13631. _self._tooltipRemove();
  13632. }
  13633. });
  13634. } else {
  13635. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Line, {
  13636. onAdded: function(cPoints, gPoints) {
  13637. if (cPoints.length === 1) {
  13638. _self._tooltipRemove();
  13639. _self._createPoint(cPoints[0], "\u8D77\u70B9");
  13640. let buttonDiv = document.getElementById("drawButtonDiv");
  13641. if (buttonDiv == null) {
  13642. _self._createOperationMainDom();
  13643. document.getElementById("btnDrawBackout").onclick = () => {
  13644. if (_self._sketchViewModel._sketchTempPoints.length > 2) {
  13645. _self._sketchViewModel._sketchPoints.pop();
  13646. _self._sketchViewModel._sketchTempPoints.splice(_self._sketchViewModel._sketchTempPoints.length - 1, 1);
  13647. if (_self._sketchViewModel._isDrawPoint) {
  13648. let lastPointEntity = _self._sketchViewModel._pointEntitys[_self._sketchViewModel._pointEntitys.length - 1];
  13649. _self._sketchViewModel._entities.remove(lastPointEntity);
  13650. _self._sketchViewModel._pointEntitys.pop();
  13651. }
  13652. _self._viewer.entities.remove(_self._tempEntitys[_self._tempEntitys.length - 1]);
  13653. _self._tempEntitys.pop();
  13654. }
  13655. };
  13656. document.getElementById("btnDrawComplete").onclick = () => {
  13657. if (_self._sketchViewModel._sketchPoints.length < 2) {
  13658. if (callError)
  13659. callError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  13660. return;
  13661. }
  13662. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolyline);
  13663. _self._sketchViewModel._createPolyline();
  13664. if (!_self._sketchViewModel._isRetainDrawPoint)
  13665. _self._sketchViewModel._removePointEntitys();
  13666. _self._sketchViewModel._clearEvent(_self._sketchViewModel._sketchEventHandler);
  13667. _self._initMousePointerStyle();
  13668. _self._tooltipRemove();
  13669. let buttonDiv2 = document.getElementById("drawButtonDiv");
  13670. if (buttonDiv2) {
  13671. document.body.removeChild(buttonDiv2);
  13672. }
  13673. };
  13674. }
  13675. } else {
  13676. let distince = _self._measureDistance(cPoints);
  13677. let tempPoints = [cPoints[cPoints.length - 2], cPoints[cPoints.length - 1]];
  13678. distince += " +" + _self._measureDistance(tempPoints);
  13679. _self._tempEntitys.push(_self._createPoint(cPoints[cPoints.length - 1], distince));
  13680. }
  13681. }
  13682. });
  13683. }
  13684. },
  13685. measureSpatialLength: function(callError) {
  13686. let _self = this;
  13687. this._clear(this._isClear);
  13688. this._setMousePointerStyle();
  13689. if (this._isRuntimeApp()) {
  13690. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13691. } else {
  13692. this._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13693. }
  13694. this._tempEntitys = [];
  13695. if (this._isRuntimeWeb()) {
  13696. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Spatial, {
  13697. onAdded: function(cPoints, gPoints) {
  13698. if (cPoints.length === 1) {
  13699. _self._createPoint(cPoints[0], "\u8D77\u70B9");
  13700. } else {
  13701. let distince = _self._measureSpaceDistance(cPoints);
  13702. _self._tempEntitys.push(_self._createPoint(
  13703. cPoints[cPoints.length - 1],
  13704. distince
  13705. ));
  13706. }
  13707. },
  13708. onUndo: function() {
  13709. _self._viewer.entities.remove(_self._tempEntitys[_self._tempEntitys.length - 1]);
  13710. _self._tempEntitys.pop();
  13711. },
  13712. onMoving: function(cPoint, scPoint) {
  13713. _self._tooltipSetText("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  13714. },
  13715. onError: function(error) {
  13716. if (callError)
  13717. callError(error);
  13718. },
  13719. onComplete: function(cPoints, gPoints) {
  13720. _self._initMousePointerStyle();
  13721. _self._tooltipRemove();
  13722. }
  13723. });
  13724. } else {
  13725. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Spatial, {
  13726. onAdded: function(cPoints, gPoints) {
  13727. if (cPoints.length === 1) {
  13728. _self._tooltipRemove();
  13729. _self._createPoint(cPoints[0], "\u8D77\u70B9");
  13730. let buttonDiv = document.getElementById("drawButtonDiv");
  13731. if (buttonDiv == null) {
  13732. _self._createOperationMainDom();
  13733. document.getElementById("btnDrawBackout").onclick = () => {
  13734. if (_self._sketchViewModel._sketchTempPoints.length > 2) {
  13735. _self._sketchViewModel._sketchPoints.pop();
  13736. _self._sketchViewModel._sketchTempPoints.splice(_self._sketchViewModel._sketchTempPoints.length - 1, 1);
  13737. _self._viewer.entities.remove(_self._tempEntitys[_self._tempEntitys.length - 1]);
  13738. _self._tempEntitys.pop();
  13739. }
  13740. };
  13741. document.getElementById("btnDrawComplete").onclick = () => {
  13742. if (_self._sketchViewModel._sketchPoints.length < 2) {
  13743. if (callError)
  13744. callError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  13745. return;
  13746. }
  13747. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempSpatialPolyline);
  13748. _self._sketchViewModel._createSpatialPolyline();
  13749. _self._sketchViewModel._removePointEntitys();
  13750. _self._sketchViewModel._clearEvent(_self._sketchViewModel._sketchEventHandler);
  13751. _self._initMousePointerStyle();
  13752. _self._tooltipRemove();
  13753. let buttonDiv2 = document.getElementById("drawButtonDiv");
  13754. if (buttonDiv2) {
  13755. document.body.removeChild(buttonDiv2);
  13756. }
  13757. };
  13758. }
  13759. } else {
  13760. let distince = _self._measureSpaceDistance(cPoints);
  13761. _self._tempEntitys.push(_self._createPoint(cPoints[cPoints.length - 1], distince));
  13762. }
  13763. }
  13764. });
  13765. }
  13766. },
  13767. measureArea: function(callError) {
  13768. let _self = this;
  13769. this._clear(this._isClear);
  13770. this._setMousePointerStyle();
  13771. if (this._isRuntimeApp()) {
  13772. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13773. } else {
  13774. this._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u6D4B\u91CF");
  13775. }
  13776. var _areaLabel = "";
  13777. if (this._isRuntimeWeb()) {
  13778. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Polygon, {
  13779. onAdded: function(cPoints, gPoints) {
  13780. _self._measureTempPoints.push(_self._cartesianToGeography(cPoints[cPoints.length - 1]));
  13781. if (cPoints.length === 1) {
  13782. _areaLabel = "\u8D77\u70B9";
  13783. _self._createPoint(cPoints[0], new Cesium.CallbackProperty(function() {
  13784. var lable = _areaLabel;
  13785. return lable;
  13786. }, false));
  13787. } else if (cPoints.length >= 3) {
  13788. let area = _self._measureArea(_self._measureTempPoints, cPoints);
  13789. if (area > 1e5) {
  13790. _areaLabel = (area / 1e5).toFixed(2) + "km\xB2";
  13791. } else {
  13792. _areaLabel = area.toFixed(2) + "m\xB2";
  13793. }
  13794. }
  13795. },
  13796. onUndo: function() {
  13797. _self._measureTempPoints.pop();
  13798. if (_self._measureTempPoints.length === 1)
  13799. _self._areaLabel = "\u8D77\u70B9";
  13800. },
  13801. onMoving: function(cPoint, scPoint) {
  13802. _self._tooltipSetText("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  13803. },
  13804. onError: function(error) {
  13805. if (callError)
  13806. callError(error);
  13807. },
  13808. onComplete: function(cPoints, gPoints) {
  13809. _self._initMousePointerStyle();
  13810. _self._tooltipRemove();
  13811. }
  13812. });
  13813. } else {
  13814. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Polygon, {
  13815. onAdded: function(cPoints, gPoints) {
  13816. _self._measureTempPoints.push(_self._cartesianToGeography(cPoints[cPoints.length - 1]));
  13817. if (cPoints.length === 1) {
  13818. _self._tooltipRemove();
  13819. _areaLabel = "\u8D77\u70B9";
  13820. _self._createPoint(cPoints[0], new Cesium.CallbackProperty(function() {
  13821. var lable = _areaLabel;
  13822. return lable;
  13823. }, false));
  13824. let buttonDiv = document.getElementById("drawButtonDiv");
  13825. if (buttonDiv == null) {
  13826. _self._createOperationMainDom();
  13827. document.getElementById("btnDrawBackout").onclick = () => {
  13828. if (_self._sketchViewModel._sketchTempPoints.length > 2) {
  13829. _self._sketchViewModel._sketchPoints.pop();
  13830. _self._sketchViewModel._sketchTempPoints.splice(_self._sketchViewModel._sketchTempPoints.length - 1, 1);
  13831. if (_self._sketchViewModel._isDrawPoint) {
  13832. let lastPointEntity = _self._sketchViewModel._pointEntitys[_self._sketchViewModel._pointEntitys.length - 1];
  13833. _self._entities.remove(lastPointEntity);
  13834. _self._sketchViewModel._pointEntitys.pop();
  13835. }
  13836. _self._measureTempPoints.pop();
  13837. if (_self._measureTempPoints.length === 1)
  13838. _self._areaLabel = "\u8D77\u70B9";
  13839. }
  13840. };
  13841. document.getElementById("btnDrawComplete").onclick = () => {
  13842. if (_self._sketchViewModel._sketchPoints.length < 3) {
  13843. if (callError)
  13844. callError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  13845. return;
  13846. }
  13847. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolygon);
  13848. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolyline);
  13849. _self._sketchViewModel._createPolygon();
  13850. if (!_self._sketchViewModel._isRetainDrawPoint)
  13851. _self._sketchViewModel._removePointEntitys();
  13852. _self._sketchViewModel._clearEvent(_self._sketchViewModel._sketchEventHandler);
  13853. _self._initMousePointerStyle();
  13854. _self._tooltipRemove();
  13855. let buttonDiv2 = document.getElementById("drawButtonDiv");
  13856. if (buttonDiv2) {
  13857. document.body.removeChild(buttonDiv2);
  13858. }
  13859. };
  13860. }
  13861. } else if (cPoints.length >= 3) {
  13862. let area = _self._measureArea(_self._measureTempPoints, cPoints);
  13863. if (area > 1e5) {
  13864. _areaLabel = (area / 1e5).toFixed(2) + "km\xB2";
  13865. } else {
  13866. _areaLabel = area.toFixed(2) + "m\xB2";
  13867. }
  13868. }
  13869. }
  13870. });
  13871. }
  13872. },
  13873. measureHeight: function(callError) {
  13874. let _self = this;
  13875. this._clear(this._isClear);
  13876. this._setMousePointerStyle();
  13877. if (this._isRuntimeApp()) {
  13878. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  13879. } else {
  13880. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  13881. }
  13882. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Height, {
  13883. onAdded: function(cPoint) {
  13884. if (_self._isRuntimeApp()) {
  13885. _self._showTooltipMessage("\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u6D4B\u91CF");
  13886. } else {
  13887. _self._tooltipSetText("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u6D4B\u91CF");
  13888. }
  13889. },
  13890. onMoving: function(cPoints, centerPoint) {
  13891. let height2 = _self._calculatePolylineAltitudeHeight(cPoints);
  13892. _self._altitudeLabelPosition = centerPoint;
  13893. _self._altitudeLabelText = height2;
  13894. if (_self._altitudeDynamicLabel === void 0) {
  13895. _self._createAltitudeDynamicLabel();
  13896. }
  13897. },
  13898. onError: function(error) {
  13899. if (callError)
  13900. callError(error);
  13901. },
  13902. onComplete: function(cPoints, centerPoint) {
  13903. let height2 = _self._calculatePolylineAltitudeHeight(cPoints);
  13904. _self._entities.remove(_self._altitudeDynamicLabel);
  13905. _self._createLabel(centerPoint, height2);
  13906. _self._initMousePointerStyle();
  13907. _self._tooltipRemove();
  13908. }
  13909. });
  13910. },
  13911. measureTriangle: function(callError) {
  13912. let _self = this;
  13913. this._clear(this._isClear);
  13914. this._setMousePointerStyle();
  13915. if (this._isRuntimeApp()) {
  13916. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  13917. } else {
  13918. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  13919. }
  13920. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Triangle, {
  13921. onAdded: function(cPoint) {
  13922. if (_self._isRuntimeApp()) {
  13923. _self._showTooltipMessage("\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u6D4B\u91CF");
  13924. } else {
  13925. _self._tooltipSetText("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u6D4B\u91CF");
  13926. }
  13927. },
  13928. onMoving: function(cPoint) {
  13929. _self._tooltipSetText("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u6D4B\u91CF");
  13930. },
  13931. onError: function(error) {
  13932. if (callError)
  13933. callError(error);
  13934. },
  13935. onComplete: function(positions) {
  13936. _self._initMousePointerStyle();
  13937. _self._tooltipRemove();
  13938. let sPoints = [positions[0], positions[1]];
  13939. let sDistince = _self._measureSpaceDistance(sPoints);
  13940. let hPoints = [positions[1], positions[2]];
  13941. let hDistince = _self._measureSpaceDistance(hPoints);
  13942. let hePoints = [positions[2], positions[0]];
  13943. let height2 = _self._calculatePolylineAltitudeHeight(hePoints);
  13944. _self._createLabel(positions[0], "\u659C\u8DDD:" + sDistince);
  13945. _self._createLabel(positions[1], "\u5E73\u8DDD:" + hDistince);
  13946. _self._createLabel(positions[2], "\u9AD8\u5EA6:" + height2);
  13947. }
  13948. });
  13949. }
  13950. });
  13951. Object.assign(CommonTools.prototype, {
  13952. queryByPoint: function(callComplete) {
  13953. let _self = this;
  13954. this._setMousePointerStyle();
  13955. this._clear(this._isClear);
  13956. if (this._isRuntimeApp()) {
  13957. this._showTooltipMessage("\u70B9\u51FB\u4F4D\u7F6E\u8FDB\u884C\u67E5\u8BE2");
  13958. } else {
  13959. this._tooltipInit("\u5355\u51FB\u4F4D\u7F6E\u8FDB\u884C\u67E5\u8BE2");
  13960. }
  13961. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Point, {
  13962. onComplete: function(cPoint, gPoint) {
  13963. _self._initMousePointerStyle();
  13964. _self._tooltipRemove();
  13965. _self._createPoint(cPoint);
  13966. let coordinates = gPoint.lng + "," + gPoint.lat;
  13967. if (callComplete)
  13968. callComplete(coordinates);
  13969. }
  13970. });
  13971. },
  13972. queryByMultiplePoint: function(callComplete) {
  13973. let _self = this;
  13974. this._setMousePointerStyle();
  13975. this._clear(this._isClear);
  13976. this._tooltipInit("\u70B9\u51FB\u4F4D\u7F6E\u7ED8\u5236<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  13977. this._tempEntitys = [];
  13978. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.MultiplePoint, {
  13979. onAdded: function(cPoint, gPoint) {
  13980. let res = gPoint.lng.toFixed(6) + "," + gPoint.lat.toFixed(6);
  13981. _self._tempEntitys.push(_self._createPoint(cPoint, res));
  13982. },
  13983. onUndo: function() {
  13984. _self._viewer.entities.remove(_self._tempEntitys[_self._tempEntitys.length - 1]);
  13985. _self._tempEntitys.pop();
  13986. },
  13987. onComplete: function(cPoints, gPoints) {
  13988. _self._initMousePointerStyle();
  13989. _self._tooltipRemove();
  13990. let res = [];
  13991. for (let i2 = 0; i2 < gPoints.length; i2++) {
  13992. res.push(gPoints[i2].lng);
  13993. res.push(gPoints[i2].lat);
  13994. }
  13995. if (callComplete)
  13996. callComplete(res);
  13997. }
  13998. });
  13999. },
  14000. queryByLine: function(callComplete, callError) {
  14001. let _self = this;
  14002. this._clear(this._isClear);
  14003. this._setMousePointerStyle();
  14004. if (this._isRuntimeApp()) {
  14005. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  14006. } else {
  14007. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u7EBF");
  14008. }
  14009. if (this._isRuntimeWeb()) {
  14010. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Line, {
  14011. onAdded: function(cPoints, gPoints) {
  14012. },
  14013. onMoving: function(cPoint, scPoint) {
  14014. _self._tooltipSetText("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236\u5F00\u59CB\u67E5\u8BE2");
  14015. },
  14016. onError: function(error) {
  14017. if (callError)
  14018. callError(error);
  14019. },
  14020. onComplete: function(cPoints, gPoints) {
  14021. _self._initMousePointerStyle();
  14022. _self._tooltipRemove();
  14023. let coordinates = void 0;
  14024. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14025. let point2 = gPoints[i2];
  14026. if (coordinates === void 0)
  14027. coordinates = point2.lng + "," + point2.lat;
  14028. else
  14029. coordinates += "," + point2.lng + "," + point2.lat;
  14030. }
  14031. if (callComplete)
  14032. callComplete(coordinates);
  14033. }
  14034. });
  14035. } else {
  14036. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Line, {
  14037. onAdded: function(cPoints, gPoints) {
  14038. if (cPoints.length === 1) {
  14039. _self._tooltipRemove();
  14040. let buttonDiv = document.getElementById("drawButtonDiv");
  14041. if (buttonDiv == null) {
  14042. _self._createOperationMainDom();
  14043. document.getElementById("btnDrawBackout").onclick = () => {
  14044. if (_self._sketchViewModel._sketchTempPoints.length > 2) {
  14045. _self._sketchViewModel._sketchPoints.pop();
  14046. _self._sketchViewModel._sketchTempPoints.splice(_self._sketchViewModel._sketchTempPoints.length - 1, 1);
  14047. if (_self._sketchViewModel._isDrawPoint) {
  14048. let lastPointEntity = _self._sketchViewModel._pointEntitys[_self._sketchViewModel._pointEntitys.length - 1];
  14049. _self._sketchViewModel._entities.remove(lastPointEntity);
  14050. _self._sketchViewModel._pointEntitys.pop();
  14051. }
  14052. }
  14053. };
  14054. document.getElementById("btnDrawComplete").onclick = () => {
  14055. if (_self._sketchViewModel._sketchPoints.length < 2) {
  14056. if (callError)
  14057. callError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  14058. return;
  14059. }
  14060. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolyline);
  14061. _self._sketchViewModel._createPolyline();
  14062. if (!_self._sketchViewModel._isRetainDrawPoint)
  14063. _self._sketchViewModel._removePointEntitys();
  14064. _self._sketchViewModel._clearEvent(_self._sketchViewModel._sketchEventHandler);
  14065. _self._initMousePointerStyle();
  14066. _self._tooltipRemove();
  14067. let coordinates = void 0;
  14068. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14069. let point2 = gPoints[i2];
  14070. if (coordinates === void 0)
  14071. coordinates = point2.lng + "," + point2.lat;
  14072. else
  14073. coordinates += "," + point2.lng + "," + point2.lat;
  14074. }
  14075. let buttonDiv2 = document.getElementById("drawButtonDiv");
  14076. if (buttonDiv2) {
  14077. document.body.removeChild(buttonDiv2);
  14078. }
  14079. if (callComplete)
  14080. callComplete(coordinates);
  14081. };
  14082. }
  14083. }
  14084. }
  14085. });
  14086. }
  14087. },
  14088. queryByPolygon: function(callComplete, callError) {
  14089. let _self = this;
  14090. this._clear(this._isClear);
  14091. this._setMousePointerStyle();
  14092. if (this._isRuntimeApp()) {
  14093. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u533A\u57DF");
  14094. } else {
  14095. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u533A\u57DF");
  14096. }
  14097. if (this._isRuntimeWeb()) {
  14098. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Polygon, {
  14099. onMoving: function(cPoint, scPoint) {
  14100. _self._tooltipSetText("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236\u5F00\u59CB\u67E5\u8BE2");
  14101. },
  14102. onError: function(error) {
  14103. if (callError)
  14104. callError(error);
  14105. },
  14106. onComplete: function(cPoints, gPoints) {
  14107. _self._initMousePointerStyle();
  14108. _self._tooltipRemove();
  14109. let coordinates = void 0;
  14110. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14111. let point2 = gPoints[i2];
  14112. if (coordinates === void 0)
  14113. coordinates = point2.lng + "," + point2.lat;
  14114. else
  14115. coordinates += "," + point2.lng + "," + point2.lat;
  14116. }
  14117. coordinates += "," + gPoints[0].lng + "," + gPoints[0].lat;
  14118. if (callComplete)
  14119. callComplete(coordinates);
  14120. }
  14121. });
  14122. } else {
  14123. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Polygon, {
  14124. onAdded: function(cPoints, gPoints) {
  14125. if (cPoints.length === 1) {
  14126. _self._tooltipRemove();
  14127. let buttonDiv = document.getElementById("drawButtonDiv");
  14128. if (buttonDiv == null) {
  14129. _self._createOperationMainDom();
  14130. document.getElementById("btnDrawBackout").onclick = () => {
  14131. if (_self._sketchViewModel._sketchTempPoints.length > 2) {
  14132. _self._sketchViewModel._sketchPoints.pop();
  14133. _self._sketchViewModel._sketchTempPoints.splice(_self._sketchViewModel._sketchTempPoints.length - 1, 1);
  14134. if (_self._sketchViewModel._isDrawPoint) {
  14135. let lastPointEntity = _self._sketchViewModel._pointEntitys[_self._sketchViewModel._pointEntitys.length - 1];
  14136. _self._entities.remove(lastPointEntity);
  14137. _self._sketchViewModel._pointEntitys.pop();
  14138. }
  14139. }
  14140. };
  14141. document.getElementById("btnDrawComplete").onclick = () => {
  14142. if (_self._sketchViewModel._sketchPoints.length < 3) {
  14143. if (callError)
  14144. callError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  14145. return;
  14146. }
  14147. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolygon);
  14148. _self._sketchViewModel._removeEntityByObject(_self._sketchViewModel._sketchTempPolyline);
  14149. _self._sketchViewModel._createPolygon();
  14150. if (!_self._sketchViewModel._isRetainDrawPoint)
  14151. _self._sketchViewModel._removePointEntitys();
  14152. _self._sketchViewModel._clearEvent(_self._sketchViewModel._sketchEventHandler);
  14153. _self._initMousePointerStyle();
  14154. _self._tooltipRemove();
  14155. let coordinates = void 0;
  14156. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14157. let point2 = gPoints[i2];
  14158. if (coordinates === void 0)
  14159. coordinates = point2.lng + "," + point2.lat;
  14160. else
  14161. coordinates += "," + point2.lng + "," + point2.lat;
  14162. }
  14163. coordinates += "," + gPoints[0].lng + "," + gPoints[0].lat;
  14164. let buttonDiv2 = document.getElementById("drawButtonDiv");
  14165. if (buttonDiv2) {
  14166. document.body.removeChild(buttonDiv2);
  14167. }
  14168. if (callComplete)
  14169. callComplete(coordinates);
  14170. };
  14171. }
  14172. }
  14173. }
  14174. });
  14175. }
  14176. },
  14177. queryByCircle: function(callComplete) {
  14178. let _self = this;
  14179. this._clear(this._isClear);
  14180. this._setMousePointerStyle();
  14181. if (this._isRuntimeApp()) {
  14182. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u5706");
  14183. } else {
  14184. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u5706");
  14185. }
  14186. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Circle, {
  14187. onAdded: function(center2) {
  14188. if (_self._isRuntimeApp()) {
  14189. _self._showTooltipMessage("\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236");
  14190. } else {
  14191. _self._tooltipInit("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u7ED8\u5236");
  14192. }
  14193. },
  14194. onComplete: function(center2, radius) {
  14195. _self._initMousePointerStyle();
  14196. _self._tooltipRemove();
  14197. if (callComplete)
  14198. callComplete(center2.lng + "," + center2.lat, radius);
  14199. }
  14200. });
  14201. },
  14202. queryByRectangle: function(callComplete) {
  14203. let _self = this;
  14204. this._clear(this._isClear);
  14205. this._setMousePointerStyle();
  14206. if (this._isRuntimeApp()) {
  14207. this._showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u77E9\u5F62");
  14208. } else {
  14209. this._tooltipInit("\u5355\u51FB\u5F00\u59CB\u7ED8\u5236\u77E9\u5F62");
  14210. }
  14211. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.Rectangle, {
  14212. onAdded: function(center2) {
  14213. if (_self._isRuntimeApp()) {
  14214. _self._showTooltipMessage("\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236");
  14215. } else {
  14216. _self._tooltipInit("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u7ED8\u5236");
  14217. }
  14218. },
  14219. onComplete: function(gPoints) {
  14220. _self._initMousePointerStyle();
  14221. _self._tooltipRemove();
  14222. let coordinates = void 0;
  14223. for (let i2 = 0; i2 < gPoints.length; i2++) {
  14224. let point2 = gPoints[i2];
  14225. if (coordinates === void 0)
  14226. coordinates = point2.lng + "," + point2.lat;
  14227. else
  14228. coordinates += "," + point2.lng + "," + point2.lat;
  14229. }
  14230. if (callComplete)
  14231. callComplete(coordinates);
  14232. }
  14233. });
  14234. }
  14235. });
  14236. Object.assign(CommonTools.prototype, {
  14237. drawPolygonBody: function(callComplete) {
  14238. let _self = this;
  14239. this._clear(this._isClear);
  14240. this._setMousePointerStyle();
  14241. this._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  14242. this._sketchViewModel.sketchTools(SketchViewModel.SketchType.PolygonBody, {
  14243. onAdded: function(cPoints, gPoints) {
  14244. if (cPoints.length === 0) {
  14245. _self._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  14246. } else if (cPoints.length < 3) {
  14247. _self._tooltipInit("\u53F3\u952E\u5355\u51FB\u56DE\u9000");
  14248. } else {
  14249. _self._tooltipInit("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  14250. }
  14251. },
  14252. onUndo: function(cPoints) {
  14253. if (cPoints.length === 0) {
  14254. _self._tooltipInit("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  14255. } else if (cPoints.length < 3) {
  14256. _self._tooltipInit("\u53F3\u952E\u5355\u51FB\u56DE\u9000");
  14257. } else {
  14258. _self._tooltipInit("\u53F3\u952E\u5355\u51FB\u56DE\u9000<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  14259. }
  14260. },
  14261. onComplete: function(cPoints, gPoints) {
  14262. _self._initMousePointerStyle();
  14263. _self._tooltipRemove();
  14264. if (callComplete)
  14265. callComplete();
  14266. }
  14267. });
  14268. },
  14269. drawPointFeacture: function(points2, options2) {
  14270. this._sketchViewModel.sketchDrawFeacture(points2, SketchViewModel.SketchType.DrawPoint, options2);
  14271. },
  14272. drawMultiplePointFeacture: function(points2, options2) {
  14273. this._sketchViewModel.sketchDrawFeacture(points2, SketchViewModel.SketchType.DrawMultiplePoint, options2);
  14274. },
  14275. drawPolylineFeacture: function(points2, options2) {
  14276. this._sketchViewModel.sketchDrawFeacture(points2, SketchViewModel.SketchType.DrawPolyline, options2);
  14277. },
  14278. drawPolygonFeacture: function(points2, options2) {
  14279. this._sketchViewModel.sketchDrawFeacture(points2, SketchViewModel.SketchType.DrawPolygon, options2);
  14280. }
  14281. });
  14282. Object.assign(CommonTools.prototype, {
  14283. tooltipInit: function(text) {
  14284. this._tooltipInit(text);
  14285. },
  14286. tooltipRemove: function() {
  14287. this._tooltipRemove();
  14288. },
  14289. tooltipSetText: function(text) {
  14290. this._tooltipSetText(text);
  14291. }
  14292. });
  14293. Object.assign(CommonTools.prototype, {
  14294. pickPolygonBody: function(callComplete) {
  14295. this._sketchViewModel.sketchPick(function(options2) {
  14296. if (options2 === void 0) {
  14297. if (callComplete)
  14298. callComplete(void 0);
  14299. } else {
  14300. if (callComplete)
  14301. callComplete({
  14302. color: options2.color,
  14303. height: options2.height
  14304. });
  14305. }
  14306. });
  14307. },
  14308. setPolygonBody: function(options2) {
  14309. this._sketchViewModel.sketchEditPickPolygonBody({
  14310. color: options2.color,
  14311. height: options2.height,
  14312. onComplete: options2.onComplete
  14313. });
  14314. },
  14315. removePolygonBody: function(onComplete) {
  14316. this._sketchViewModel.sketchRemovePickPolygonBody(onComplete);
  14317. }
  14318. });
  14319. CommonTools.RuntimeEnvironment = Object.freeze({
  14320. App: "app",
  14321. Web: "web"
  14322. });
  14323. const composeEventHandlers = (theirsHandler, oursHandler, { checkForDefaultPrevented = true } = {}) => {
  14324. const handleEvent = (event2) => {
  14325. const shouldPrevent = theirsHandler == null ? void 0 : theirsHandler(event2);
  14326. if (checkForDefaultPrevented === false || !shouldPrevent) {
  14327. return oursHandler == null ? void 0 : oursHandler(event2);
  14328. }
  14329. };
  14330. return handleEvent;
  14331. };
  14332. var _a;
  14333. const isClient = typeof window !== "undefined";
  14334. const isString$1 = (val) => typeof val === "string";
  14335. const noop$3 = () => {
  14336. };
  14337. const isIOS = isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
  14338. function resolveUnref(r2) {
  14339. return typeof r2 === "function" ? r2() : unref(r2);
  14340. }
  14341. function identity(arg) {
  14342. return arg;
  14343. }
  14344. function tryOnScopeDispose(fn2) {
  14345. if (getCurrentScope()) {
  14346. onScopeDispose(fn2);
  14347. return true;
  14348. }
  14349. return false;
  14350. }
  14351. function tryOnMounted(fn2, sync = true) {
  14352. if (getCurrentInstance())
  14353. onMounted(fn2);
  14354. else if (sync)
  14355. fn2();
  14356. else
  14357. nextTick(fn2);
  14358. }
  14359. function useTimeoutFn(cb, interval, options2 = {}) {
  14360. const {
  14361. immediate = true
  14362. } = options2;
  14363. const isPending = ref(false);
  14364. let timer = null;
  14365. function clear() {
  14366. if (timer) {
  14367. clearTimeout(timer);
  14368. timer = null;
  14369. }
  14370. }
  14371. function stop() {
  14372. isPending.value = false;
  14373. clear();
  14374. }
  14375. function start2(...args) {
  14376. clear();
  14377. isPending.value = true;
  14378. timer = setTimeout(() => {
  14379. isPending.value = false;
  14380. timer = null;
  14381. cb(...args);
  14382. }, resolveUnref(interval));
  14383. }
  14384. if (immediate) {
  14385. isPending.value = true;
  14386. if (isClient)
  14387. start2();
  14388. }
  14389. tryOnScopeDispose(stop);
  14390. return {
  14391. isPending: readonly(isPending),
  14392. start: start2,
  14393. stop
  14394. };
  14395. }
  14396. function unrefElement(elRef) {
  14397. var _a2;
  14398. const plain = resolveUnref(elRef);
  14399. return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
  14400. }
  14401. const defaultWindow = isClient ? window : void 0;
  14402. function useEventListener(...args) {
  14403. let target;
  14404. let events;
  14405. let listeners;
  14406. let options2;
  14407. if (isString$1(args[0]) || Array.isArray(args[0])) {
  14408. [events, listeners, options2] = args;
  14409. target = defaultWindow;
  14410. } else {
  14411. [target, events, listeners, options2] = args;
  14412. }
  14413. if (!target)
  14414. return noop$3;
  14415. if (!Array.isArray(events))
  14416. events = [events];
  14417. if (!Array.isArray(listeners))
  14418. listeners = [listeners];
  14419. const cleanups = [];
  14420. const cleanup = () => {
  14421. cleanups.forEach((fn2) => fn2());
  14422. cleanups.length = 0;
  14423. };
  14424. const register = (el, event2, listener, options22) => {
  14425. el.addEventListener(event2, listener, options22);
  14426. return () => el.removeEventListener(event2, listener, options22);
  14427. };
  14428. const stopWatch = watch(() => [unrefElement(target), resolveUnref(options2)], ([el, options22]) => {
  14429. cleanup();
  14430. if (!el)
  14431. return;
  14432. cleanups.push(...events.flatMap((event2) => {
  14433. return listeners.map((listener) => register(el, event2, listener, options22));
  14434. }));
  14435. }, { immediate: true, flush: "post" });
  14436. const stop = () => {
  14437. stopWatch();
  14438. cleanup();
  14439. };
  14440. tryOnScopeDispose(stop);
  14441. return stop;
  14442. }
  14443. let _iOSWorkaround = false;
  14444. function onClickOutside(target, handler, options2 = {}) {
  14445. const { window: window2 = defaultWindow, ignore = [], capture = true, detectIframe = false } = options2;
  14446. if (!window2)
  14447. return;
  14448. if (isIOS && !_iOSWorkaround) {
  14449. _iOSWorkaround = true;
  14450. Array.from(window2.document.body.children).forEach((el) => el.addEventListener("click", noop$3));
  14451. }
  14452. let shouldListen = true;
  14453. const shouldIgnore = (event2) => {
  14454. return ignore.some((target2) => {
  14455. if (typeof target2 === "string") {
  14456. return Array.from(window2.document.querySelectorAll(target2)).some((el) => el === event2.target || event2.composedPath().includes(el));
  14457. } else {
  14458. const el = unrefElement(target2);
  14459. return el && (event2.target === el || event2.composedPath().includes(el));
  14460. }
  14461. });
  14462. };
  14463. const listener = (event2) => {
  14464. const el = unrefElement(target);
  14465. if (!el || el === event2.target || event2.composedPath().includes(el))
  14466. return;
  14467. if (event2.detail === 0)
  14468. shouldListen = !shouldIgnore(event2);
  14469. if (!shouldListen) {
  14470. shouldListen = true;
  14471. return;
  14472. }
  14473. handler(event2);
  14474. };
  14475. const cleanup = [
  14476. useEventListener(window2, "click", listener, { passive: true, capture }),
  14477. useEventListener(window2, "pointerdown", (e) => {
  14478. const el = unrefElement(target);
  14479. if (el)
  14480. shouldListen = !e.composedPath().includes(el) && !shouldIgnore(e);
  14481. }, { passive: true }),
  14482. detectIframe && useEventListener(window2, "blur", (event2) => {
  14483. var _a2;
  14484. const el = unrefElement(target);
  14485. if (((_a2 = window2.document.activeElement) == null ? void 0 : _a2.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(window2.document.activeElement)))
  14486. handler(event2);
  14487. })
  14488. ].filter(Boolean);
  14489. const stop = () => cleanup.forEach((fn2) => fn2());
  14490. return stop;
  14491. }
  14492. function useSupported(callback2, sync = false) {
  14493. const isSupported = ref();
  14494. const update = () => isSupported.value = Boolean(callback2());
  14495. update();
  14496. tryOnMounted(update, sync);
  14497. return isSupported;
  14498. }
  14499. const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  14500. const globalKey = "__vueuse_ssr_handlers__";
  14501. _global[globalKey] = _global[globalKey] || {};
  14502. _global[globalKey];
  14503. var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
  14504. var __hasOwnProp$g = Object.prototype.hasOwnProperty;
  14505. var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
  14506. var __objRest$2 = (source, exclude) => {
  14507. var target = {};
  14508. for (var prop in source)
  14509. if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)
  14510. target[prop] = source[prop];
  14511. if (source != null && __getOwnPropSymbols$g)
  14512. for (var prop of __getOwnPropSymbols$g(source)) {
  14513. if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))
  14514. target[prop] = source[prop];
  14515. }
  14516. return target;
  14517. };
  14518. function useResizeObserver(target, callback2, options2 = {}) {
  14519. const _a2 = options2, { window: window2 = defaultWindow } = _a2, observerOptions = __objRest$2(_a2, ["window"]);
  14520. let observer;
  14521. const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
  14522. const cleanup = () => {
  14523. if (observer) {
  14524. observer.disconnect();
  14525. observer = void 0;
  14526. }
  14527. };
  14528. const stopWatch = watch(() => unrefElement(target), (el) => {
  14529. cleanup();
  14530. if (isSupported.value && window2 && el) {
  14531. observer = new ResizeObserver(callback2);
  14532. observer.observe(el, observerOptions);
  14533. }
  14534. }, { immediate: true, flush: "post" });
  14535. const stop = () => {
  14536. cleanup();
  14537. stopWatch();
  14538. };
  14539. tryOnScopeDispose(stop);
  14540. return {
  14541. isSupported,
  14542. stop
  14543. };
  14544. }
  14545. var SwipeDirection;
  14546. (function(SwipeDirection2) {
  14547. SwipeDirection2["UP"] = "UP";
  14548. SwipeDirection2["RIGHT"] = "RIGHT";
  14549. SwipeDirection2["DOWN"] = "DOWN";
  14550. SwipeDirection2["LEFT"] = "LEFT";
  14551. SwipeDirection2["NONE"] = "NONE";
  14552. })(SwipeDirection || (SwipeDirection = {}));
  14553. var __defProp2 = Object.defineProperty;
  14554. var __getOwnPropSymbols = Object.getOwnPropertySymbols;
  14555. var __hasOwnProp = Object.prototype.hasOwnProperty;
  14556. var __propIsEnum = Object.prototype.propertyIsEnumerable;
  14557. var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  14558. var __spreadValues = (a, b) => {
  14559. for (var prop in b || (b = {}))
  14560. if (__hasOwnProp.call(b, prop))
  14561. __defNormalProp2(a, prop, b[prop]);
  14562. if (__getOwnPropSymbols)
  14563. for (var prop of __getOwnPropSymbols(b)) {
  14564. if (__propIsEnum.call(b, prop))
  14565. __defNormalProp2(a, prop, b[prop]);
  14566. }
  14567. return a;
  14568. };
  14569. const _TransitionPresets = {
  14570. easeInSine: [0.12, 0, 0.39, 0],
  14571. easeOutSine: [0.61, 1, 0.88, 1],
  14572. easeInOutSine: [0.37, 0, 0.63, 1],
  14573. easeInQuad: [0.11, 0, 0.5, 0],
  14574. easeOutQuad: [0.5, 1, 0.89, 1],
  14575. easeInOutQuad: [0.45, 0, 0.55, 1],
  14576. easeInCubic: [0.32, 0, 0.67, 0],
  14577. easeOutCubic: [0.33, 1, 0.68, 1],
  14578. easeInOutCubic: [0.65, 0, 0.35, 1],
  14579. easeInQuart: [0.5, 0, 0.75, 0],
  14580. easeOutQuart: [0.25, 1, 0.5, 1],
  14581. easeInOutQuart: [0.76, 0, 0.24, 1],
  14582. easeInQuint: [0.64, 0, 0.78, 0],
  14583. easeOutQuint: [0.22, 1, 0.36, 1],
  14584. easeInOutQuint: [0.83, 0, 0.17, 1],
  14585. easeInExpo: [0.7, 0, 0.84, 0],
  14586. easeOutExpo: [0.16, 1, 0.3, 1],
  14587. easeInOutExpo: [0.87, 0, 0.13, 1],
  14588. easeInCirc: [0.55, 0, 1, 0.45],
  14589. easeOutCirc: [0, 0.55, 0.45, 1],
  14590. easeInOutCirc: [0.85, 0, 0.15, 1],
  14591. easeInBack: [0.36, 0, 0.66, -0.56],
  14592. easeOutBack: [0.34, 1.56, 0.64, 1],
  14593. easeInOutBack: [0.68, -0.6, 0.32, 1.6]
  14594. };
  14595. __spreadValues({
  14596. linear: identity
  14597. }, _TransitionPresets);
  14598. const isFirefox = () => isClient && /firefox/i.test(window.navigator.userAgent);
  14599. const getClientXY = (event2) => {
  14600. let clientX;
  14601. let clientY;
  14602. if (event2.type === "touchend") {
  14603. clientY = event2.changedTouches[0].clientY;
  14604. clientX = event2.changedTouches[0].clientX;
  14605. } else if (event2.type.startsWith("touch")) {
  14606. clientY = event2.touches[0].clientY;
  14607. clientX = event2.touches[0].clientX;
  14608. } else {
  14609. clientY = event2.clientY;
  14610. clientX = event2.clientX;
  14611. }
  14612. return {
  14613. clientX,
  14614. clientY
  14615. };
  14616. };
  14617. const NOOP = () => {
  14618. };
  14619. const hasOwnProperty$9 = Object.prototype.hasOwnProperty;
  14620. const hasOwn = (val, key) => hasOwnProperty$9.call(val, key);
  14621. const isArray$2 = Array.isArray;
  14622. const isFunction$3 = (val) => typeof val === "function";
  14623. const isString = (val) => typeof val === "string";
  14624. const isObject$5 = (val) => val !== null && typeof val === "object";
  14625. const isPromise$2 = (val) => {
  14626. return isObject$5(val) && isFunction$3(val.then) && isFunction$3(val.catch);
  14627. };
  14628. const objectToString$1 = Object.prototype.toString;
  14629. const toTypeString = (value) => objectToString$1.call(value);
  14630. const toRawType = (value) => {
  14631. return toTypeString(value).slice(8, -1);
  14632. };
  14633. const cacheStringFunction = (fn2) => {
  14634. const cache = /* @__PURE__ */ Object.create(null);
  14635. return (str) => {
  14636. const hit = cache[str];
  14637. return hit || (cache[str] = fn2(str));
  14638. };
  14639. };
  14640. const camelizeRE = /-(\w)/g;
  14641. const camelize = cacheStringFunction((str) => {
  14642. return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  14643. });
  14644. var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
  14645. var freeGlobal$1 = freeGlobal;
  14646. var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  14647. var root = freeGlobal$1 || freeSelf || Function("return this")();
  14648. var root$1 = root;
  14649. var Symbol$1 = root$1.Symbol;
  14650. var Symbol$2 = Symbol$1;
  14651. var objectProto$b = Object.prototype;
  14652. var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
  14653. var nativeObjectToString$1 = objectProto$b.toString;
  14654. var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
  14655. function getRawTag(value) {
  14656. var isOwn = hasOwnProperty$8.call(value, symToStringTag$1), tag = value[symToStringTag$1];
  14657. try {
  14658. value[symToStringTag$1] = void 0;
  14659. var unmasked = true;
  14660. } catch (e) {
  14661. }
  14662. var result = nativeObjectToString$1.call(value);
  14663. if (unmasked) {
  14664. if (isOwn) {
  14665. value[symToStringTag$1] = tag;
  14666. } else {
  14667. delete value[symToStringTag$1];
  14668. }
  14669. }
  14670. return result;
  14671. }
  14672. var objectProto$a = Object.prototype;
  14673. var nativeObjectToString = objectProto$a.toString;
  14674. function objectToString(value) {
  14675. return nativeObjectToString.call(value);
  14676. }
  14677. var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
  14678. var symToStringTag = Symbol$2 ? Symbol$2.toStringTag : void 0;
  14679. function baseGetTag(value) {
  14680. if (value == null) {
  14681. return value === void 0 ? undefinedTag : nullTag;
  14682. }
  14683. return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
  14684. }
  14685. function isObjectLike(value) {
  14686. return value != null && typeof value == "object";
  14687. }
  14688. var symbolTag$1 = "[object Symbol]";
  14689. function isSymbol(value) {
  14690. return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$1;
  14691. }
  14692. function arrayMap(array, iteratee) {
  14693. var index2 = -1, length = array == null ? 0 : array.length, result = Array(length);
  14694. while (++index2 < length) {
  14695. result[index2] = iteratee(array[index2], index2, array);
  14696. }
  14697. return result;
  14698. }
  14699. var isArray = Array.isArray;
  14700. var isArray$1 = isArray;
  14701. var INFINITY$1 = 1 / 0;
  14702. var symbolProto$1 = Symbol$2 ? Symbol$2.prototype : void 0, symbolToString = symbolProto$1 ? symbolProto$1.toString : void 0;
  14703. function baseToString(value) {
  14704. if (typeof value == "string") {
  14705. return value;
  14706. }
  14707. if (isArray$1(value)) {
  14708. return arrayMap(value, baseToString) + "";
  14709. }
  14710. if (isSymbol(value)) {
  14711. return symbolToString ? symbolToString.call(value) : "";
  14712. }
  14713. var result = value + "";
  14714. return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
  14715. }
  14716. var reWhitespace = /\s/;
  14717. function trimmedEndIndex(string) {
  14718. var index2 = string.length;
  14719. while (index2-- && reWhitespace.test(string.charAt(index2))) {
  14720. }
  14721. return index2;
  14722. }
  14723. var reTrimStart = /^\s+/;
  14724. function baseTrim(string) {
  14725. return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
  14726. }
  14727. function isObject$4(value) {
  14728. var type2 = typeof value;
  14729. return value != null && (type2 == "object" || type2 == "function");
  14730. }
  14731. var NAN = 0 / 0;
  14732. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  14733. var reIsBinary = /^0b[01]+$/i;
  14734. var reIsOctal = /^0o[0-7]+$/i;
  14735. var freeParseInt = parseInt;
  14736. function toNumber(value) {
  14737. if (typeof value == "number") {
  14738. return value;
  14739. }
  14740. if (isSymbol(value)) {
  14741. return NAN;
  14742. }
  14743. if (isObject$4(value)) {
  14744. var other = typeof value.valueOf == "function" ? value.valueOf() : value;
  14745. value = isObject$4(other) ? other + "" : other;
  14746. }
  14747. if (typeof value != "string") {
  14748. return value === 0 ? value : +value;
  14749. }
  14750. value = baseTrim(value);
  14751. var isBinary = reIsBinary.test(value);
  14752. return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
  14753. }
  14754. var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
  14755. function isFunction$2(value) {
  14756. if (!isObject$4(value)) {
  14757. return false;
  14758. }
  14759. var tag = baseGetTag(value);
  14760. return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
  14761. }
  14762. var coreJsData = root$1["__core-js_shared__"];
  14763. var coreJsData$1 = coreJsData;
  14764. var maskSrcKey = function() {
  14765. var uid = /[^.]+$/.exec(coreJsData$1 && coreJsData$1.keys && coreJsData$1.keys.IE_PROTO || "");
  14766. return uid ? "Symbol(src)_1." + uid : "";
  14767. }();
  14768. function isMasked(func) {
  14769. return !!maskSrcKey && maskSrcKey in func;
  14770. }
  14771. var funcProto$1 = Function.prototype;
  14772. var funcToString$1 = funcProto$1.toString;
  14773. function toSource(func) {
  14774. if (func != null) {
  14775. try {
  14776. return funcToString$1.call(func);
  14777. } catch (e) {
  14778. }
  14779. try {
  14780. return func + "";
  14781. } catch (e) {
  14782. }
  14783. }
  14784. return "";
  14785. }
  14786. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  14787. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  14788. var funcProto = Function.prototype, objectProto$9 = Object.prototype;
  14789. var funcToString = funcProto.toString;
  14790. var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
  14791. var reIsNative = RegExp(
  14792. "^" + funcToString.call(hasOwnProperty$7).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
  14793. );
  14794. function baseIsNative(value) {
  14795. if (!isObject$4(value) || isMasked(value)) {
  14796. return false;
  14797. }
  14798. var pattern = isFunction$2(value) ? reIsNative : reIsHostCtor;
  14799. return pattern.test(toSource(value));
  14800. }
  14801. function getValue(object, key) {
  14802. return object == null ? void 0 : object[key];
  14803. }
  14804. function getNative(object, key) {
  14805. var value = getValue(object, key);
  14806. return baseIsNative(value) ? value : void 0;
  14807. }
  14808. var WeakMap$1 = getNative(root$1, "WeakMap");
  14809. var WeakMap$2 = WeakMap$1;
  14810. var MAX_SAFE_INTEGER$1 = 9007199254740991;
  14811. var reIsUint = /^(?:0|[1-9]\d*)$/;
  14812. function isIndex(value, length) {
  14813. var type2 = typeof value;
  14814. length = length == null ? MAX_SAFE_INTEGER$1 : length;
  14815. return !!length && (type2 == "number" || type2 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
  14816. }
  14817. function eq(value, other) {
  14818. return value === other || value !== value && other !== other;
  14819. }
  14820. var MAX_SAFE_INTEGER = 9007199254740991;
  14821. function isLength(value) {
  14822. return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  14823. }
  14824. function isArrayLike(value) {
  14825. return value != null && isLength(value.length) && !isFunction$2(value);
  14826. }
  14827. var objectProto$8 = Object.prototype;
  14828. function isPrototype(value) {
  14829. var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$8;
  14830. return value === proto;
  14831. }
  14832. function baseTimes(n, iteratee) {
  14833. var index2 = -1, result = Array(n);
  14834. while (++index2 < n) {
  14835. result[index2] = iteratee(index2);
  14836. }
  14837. return result;
  14838. }
  14839. var argsTag$2 = "[object Arguments]";
  14840. function baseIsArguments(value) {
  14841. return isObjectLike(value) && baseGetTag(value) == argsTag$2;
  14842. }
  14843. var objectProto$7 = Object.prototype;
  14844. var hasOwnProperty$6 = objectProto$7.hasOwnProperty;
  14845. var propertyIsEnumerable$1 = objectProto$7.propertyIsEnumerable;
  14846. var isArguments = baseIsArguments(function() {
  14847. return arguments;
  14848. }()) ? baseIsArguments : function(value) {
  14849. return isObjectLike(value) && hasOwnProperty$6.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
  14850. };
  14851. var isArguments$1 = isArguments;
  14852. function stubFalse() {
  14853. return false;
  14854. }
  14855. var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
  14856. var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
  14857. var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
  14858. var Buffer$1 = moduleExports$1 ? root$1.Buffer : void 0;
  14859. var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0;
  14860. var isBuffer = nativeIsBuffer || stubFalse;
  14861. var isBuffer$1 = isBuffer;
  14862. var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", mapTag$2 = "[object Map]", numberTag$1 = "[object Number]", objectTag$2 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$2 = "[object Set]", stringTag$1 = "[object String]", weakMapTag$1 = "[object WeakMap]";
  14863. var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
  14864. var typedArrayTags = {};
  14865. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
  14866. typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] = typedArrayTags[arrayBufferTag$1] = typedArrayTags[boolTag$1] = typedArrayTags[dataViewTag$2] = typedArrayTags[dateTag$1] = typedArrayTags[errorTag$1] = typedArrayTags[funcTag] = typedArrayTags[mapTag$2] = typedArrayTags[numberTag$1] = typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$1] = typedArrayTags[setTag$2] = typedArrayTags[stringTag$1] = typedArrayTags[weakMapTag$1] = false;
  14867. function baseIsTypedArray(value) {
  14868. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  14869. }
  14870. function baseUnary(func) {
  14871. return function(value) {
  14872. return func(value);
  14873. };
  14874. }
  14875. var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
  14876. var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
  14877. var moduleExports = freeModule && freeModule.exports === freeExports;
  14878. var freeProcess = moduleExports && freeGlobal$1.process;
  14879. var nodeUtil = function() {
  14880. try {
  14881. var types = freeModule && freeModule.require && freeModule.require("util").types;
  14882. if (types) {
  14883. return types;
  14884. }
  14885. return freeProcess && freeProcess.binding && freeProcess.binding("util");
  14886. } catch (e) {
  14887. }
  14888. }();
  14889. var nodeUtil$1 = nodeUtil;
  14890. var nodeIsTypedArray = nodeUtil$1 && nodeUtil$1.isTypedArray;
  14891. var isTypedArray$2 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  14892. var isTypedArray$3 = isTypedArray$2;
  14893. var objectProto$6 = Object.prototype;
  14894. var hasOwnProperty$5 = objectProto$6.hasOwnProperty;
  14895. function arrayLikeKeys(value, inherited) {
  14896. var isArr = isArray$1(value), isArg = !isArr && isArguments$1(value), isBuff = !isArr && !isArg && isBuffer$1(value), isType = !isArr && !isArg && !isBuff && isTypedArray$3(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
  14897. for (var key in value) {
  14898. if ((inherited || hasOwnProperty$5.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
  14899. result.push(key);
  14900. }
  14901. }
  14902. return result;
  14903. }
  14904. function overArg(func, transform3) {
  14905. return function(arg) {
  14906. return func(transform3(arg));
  14907. };
  14908. }
  14909. var nativeKeys = overArg(Object.keys, Object);
  14910. var nativeKeys$1 = nativeKeys;
  14911. var objectProto$5 = Object.prototype;
  14912. var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
  14913. function baseKeys(object) {
  14914. if (!isPrototype(object)) {
  14915. return nativeKeys$1(object);
  14916. }
  14917. var result = [];
  14918. for (var key in Object(object)) {
  14919. if (hasOwnProperty$4.call(object, key) && key != "constructor") {
  14920. result.push(key);
  14921. }
  14922. }
  14923. return result;
  14924. }
  14925. function keys$2(object) {
  14926. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  14927. }
  14928. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
  14929. function isKey(value, object) {
  14930. if (isArray$1(value)) {
  14931. return false;
  14932. }
  14933. var type2 = typeof value;
  14934. if (type2 == "number" || type2 == "symbol" || type2 == "boolean" || value == null || isSymbol(value)) {
  14935. return true;
  14936. }
  14937. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
  14938. }
  14939. var nativeCreate = getNative(Object, "create");
  14940. var nativeCreate$1 = nativeCreate;
  14941. function hashClear() {
  14942. this.__data__ = nativeCreate$1 ? nativeCreate$1(null) : {};
  14943. this.size = 0;
  14944. }
  14945. function hashDelete(key) {
  14946. var result = this.has(key) && delete this.__data__[key];
  14947. this.size -= result ? 1 : 0;
  14948. return result;
  14949. }
  14950. var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
  14951. var objectProto$4 = Object.prototype;
  14952. var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
  14953. function hashGet(key) {
  14954. var data = this.__data__;
  14955. if (nativeCreate$1) {
  14956. var result = data[key];
  14957. return result === HASH_UNDEFINED$2 ? void 0 : result;
  14958. }
  14959. return hasOwnProperty$3.call(data, key) ? data[key] : void 0;
  14960. }
  14961. var objectProto$3 = Object.prototype;
  14962. var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
  14963. function hashHas(key) {
  14964. var data = this.__data__;
  14965. return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty$2.call(data, key);
  14966. }
  14967. var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
  14968. function hashSet(key, value) {
  14969. var data = this.__data__;
  14970. this.size += this.has(key) ? 0 : 1;
  14971. data[key] = nativeCreate$1 && value === void 0 ? HASH_UNDEFINED$1 : value;
  14972. return this;
  14973. }
  14974. function Hash(entries) {
  14975. var index2 = -1, length = entries == null ? 0 : entries.length;
  14976. this.clear();
  14977. while (++index2 < length) {
  14978. var entry = entries[index2];
  14979. this.set(entry[0], entry[1]);
  14980. }
  14981. }
  14982. Hash.prototype.clear = hashClear;
  14983. Hash.prototype["delete"] = hashDelete;
  14984. Hash.prototype.get = hashGet;
  14985. Hash.prototype.has = hashHas;
  14986. Hash.prototype.set = hashSet;
  14987. function listCacheClear() {
  14988. this.__data__ = [];
  14989. this.size = 0;
  14990. }
  14991. function assocIndexOf(array, key) {
  14992. var length = array.length;
  14993. while (length--) {
  14994. if (eq(array[length][0], key)) {
  14995. return length;
  14996. }
  14997. }
  14998. return -1;
  14999. }
  15000. var arrayProto = Array.prototype;
  15001. var splice = arrayProto.splice;
  15002. function listCacheDelete(key) {
  15003. var data = this.__data__, index2 = assocIndexOf(data, key);
  15004. if (index2 < 0) {
  15005. return false;
  15006. }
  15007. var lastIndex = data.length - 1;
  15008. if (index2 == lastIndex) {
  15009. data.pop();
  15010. } else {
  15011. splice.call(data, index2, 1);
  15012. }
  15013. --this.size;
  15014. return true;
  15015. }
  15016. function listCacheGet(key) {
  15017. var data = this.__data__, index2 = assocIndexOf(data, key);
  15018. return index2 < 0 ? void 0 : data[index2][1];
  15019. }
  15020. function listCacheHas(key) {
  15021. return assocIndexOf(this.__data__, key) > -1;
  15022. }
  15023. function listCacheSet(key, value) {
  15024. var data = this.__data__, index2 = assocIndexOf(data, key);
  15025. if (index2 < 0) {
  15026. ++this.size;
  15027. data.push([key, value]);
  15028. } else {
  15029. data[index2][1] = value;
  15030. }
  15031. return this;
  15032. }
  15033. function ListCache(entries) {
  15034. var index2 = -1, length = entries == null ? 0 : entries.length;
  15035. this.clear();
  15036. while (++index2 < length) {
  15037. var entry = entries[index2];
  15038. this.set(entry[0], entry[1]);
  15039. }
  15040. }
  15041. ListCache.prototype.clear = listCacheClear;
  15042. ListCache.prototype["delete"] = listCacheDelete;
  15043. ListCache.prototype.get = listCacheGet;
  15044. ListCache.prototype.has = listCacheHas;
  15045. ListCache.prototype.set = listCacheSet;
  15046. var Map$2 = getNative(root$1, "Map");
  15047. var Map$3 = Map$2;
  15048. function mapCacheClear() {
  15049. this.size = 0;
  15050. this.__data__ = {
  15051. "hash": new Hash(),
  15052. "map": new (Map$3 || ListCache)(),
  15053. "string": new Hash()
  15054. };
  15055. }
  15056. function isKeyable(value) {
  15057. var type2 = typeof value;
  15058. return type2 == "string" || type2 == "number" || type2 == "symbol" || type2 == "boolean" ? value !== "__proto__" : value === null;
  15059. }
  15060. function getMapData(map, key) {
  15061. var data = map.__data__;
  15062. return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
  15063. }
  15064. function mapCacheDelete(key) {
  15065. var result = getMapData(this, key)["delete"](key);
  15066. this.size -= result ? 1 : 0;
  15067. return result;
  15068. }
  15069. function mapCacheGet(key) {
  15070. return getMapData(this, key).get(key);
  15071. }
  15072. function mapCacheHas(key) {
  15073. return getMapData(this, key).has(key);
  15074. }
  15075. function mapCacheSet(key, value) {
  15076. var data = getMapData(this, key), size = data.size;
  15077. data.set(key, value);
  15078. this.size += data.size == size ? 0 : 1;
  15079. return this;
  15080. }
  15081. function MapCache(entries) {
  15082. var index2 = -1, length = entries == null ? 0 : entries.length;
  15083. this.clear();
  15084. while (++index2 < length) {
  15085. var entry = entries[index2];
  15086. this.set(entry[0], entry[1]);
  15087. }
  15088. }
  15089. MapCache.prototype.clear = mapCacheClear;
  15090. MapCache.prototype["delete"] = mapCacheDelete;
  15091. MapCache.prototype.get = mapCacheGet;
  15092. MapCache.prototype.has = mapCacheHas;
  15093. MapCache.prototype.set = mapCacheSet;
  15094. var FUNC_ERROR_TEXT$1 = "Expected a function";
  15095. function memoize(func, resolver) {
  15096. if (typeof func != "function" || resolver != null && typeof resolver != "function") {
  15097. throw new TypeError(FUNC_ERROR_TEXT$1);
  15098. }
  15099. var memoized = function() {
  15100. var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
  15101. if (cache.has(key)) {
  15102. return cache.get(key);
  15103. }
  15104. var result = func.apply(this, args);
  15105. memoized.cache = cache.set(key, result) || cache;
  15106. return result;
  15107. };
  15108. memoized.cache = new (memoize.Cache || MapCache)();
  15109. return memoized;
  15110. }
  15111. memoize.Cache = MapCache;
  15112. var MAX_MEMOIZE_SIZE = 500;
  15113. function memoizeCapped(func) {
  15114. var result = memoize(func, function(key) {
  15115. if (cache.size === MAX_MEMOIZE_SIZE) {
  15116. cache.clear();
  15117. }
  15118. return key;
  15119. });
  15120. var cache = result.cache;
  15121. return result;
  15122. }
  15123. var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  15124. var reEscapeChar = /\\(\\)?/g;
  15125. var stringToPath = memoizeCapped(function(string) {
  15126. var result = [];
  15127. if (string.charCodeAt(0) === 46) {
  15128. result.push("");
  15129. }
  15130. string.replace(rePropName, function(match, number, quote, subString) {
  15131. result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
  15132. });
  15133. return result;
  15134. });
  15135. var stringToPath$1 = stringToPath;
  15136. function toString$3(value) {
  15137. return value == null ? "" : baseToString(value);
  15138. }
  15139. function castPath(value, object) {
  15140. if (isArray$1(value)) {
  15141. return value;
  15142. }
  15143. return isKey(value, object) ? [value] : stringToPath$1(toString$3(value));
  15144. }
  15145. var INFINITY = 1 / 0;
  15146. function toKey(value) {
  15147. if (typeof value == "string" || isSymbol(value)) {
  15148. return value;
  15149. }
  15150. var result = value + "";
  15151. return result == "0" && 1 / value == -INFINITY ? "-0" : result;
  15152. }
  15153. function baseGet(object, path) {
  15154. path = castPath(path, object);
  15155. var index2 = 0, length = path.length;
  15156. while (object != null && index2 < length) {
  15157. object = object[toKey(path[index2++])];
  15158. }
  15159. return index2 && index2 == length ? object : void 0;
  15160. }
  15161. function get$2(object, path, defaultValue2) {
  15162. var result = object == null ? void 0 : baseGet(object, path);
  15163. return result === void 0 ? defaultValue2 : result;
  15164. }
  15165. function arrayPush(array, values3) {
  15166. var index2 = -1, length = values3.length, offset = array.length;
  15167. while (++index2 < length) {
  15168. array[offset + index2] = values3[index2];
  15169. }
  15170. return array;
  15171. }
  15172. function castArray() {
  15173. if (!arguments.length) {
  15174. return [];
  15175. }
  15176. var value = arguments[0];
  15177. return isArray$1(value) ? value : [value];
  15178. }
  15179. function stackClear() {
  15180. this.__data__ = new ListCache();
  15181. this.size = 0;
  15182. }
  15183. function stackDelete(key) {
  15184. var data = this.__data__, result = data["delete"](key);
  15185. this.size = data.size;
  15186. return result;
  15187. }
  15188. function stackGet(key) {
  15189. return this.__data__.get(key);
  15190. }
  15191. function stackHas(key) {
  15192. return this.__data__.has(key);
  15193. }
  15194. var LARGE_ARRAY_SIZE = 200;
  15195. function stackSet(key, value) {
  15196. var data = this.__data__;
  15197. if (data instanceof ListCache) {
  15198. var pairs = data.__data__;
  15199. if (!Map$3 || pairs.length < LARGE_ARRAY_SIZE - 1) {
  15200. pairs.push([key, value]);
  15201. this.size = ++data.size;
  15202. return this;
  15203. }
  15204. data = this.__data__ = new MapCache(pairs);
  15205. }
  15206. data.set(key, value);
  15207. this.size = data.size;
  15208. return this;
  15209. }
  15210. function Stack(entries) {
  15211. var data = this.__data__ = new ListCache(entries);
  15212. this.size = data.size;
  15213. }
  15214. Stack.prototype.clear = stackClear;
  15215. Stack.prototype["delete"] = stackDelete;
  15216. Stack.prototype.get = stackGet;
  15217. Stack.prototype.has = stackHas;
  15218. Stack.prototype.set = stackSet;
  15219. function arrayFilter(array, predicate) {
  15220. var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
  15221. while (++index2 < length) {
  15222. var value = array[index2];
  15223. if (predicate(value, index2, array)) {
  15224. result[resIndex++] = value;
  15225. }
  15226. }
  15227. return result;
  15228. }
  15229. function stubArray() {
  15230. return [];
  15231. }
  15232. var objectProto$2 = Object.prototype;
  15233. var propertyIsEnumerable = objectProto$2.propertyIsEnumerable;
  15234. var nativeGetSymbols = Object.getOwnPropertySymbols;
  15235. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  15236. if (object == null) {
  15237. return [];
  15238. }
  15239. object = Object(object);
  15240. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  15241. return propertyIsEnumerable.call(object, symbol);
  15242. });
  15243. };
  15244. var getSymbols$1 = getSymbols;
  15245. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  15246. var result = keysFunc(object);
  15247. return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
  15248. }
  15249. function getAllKeys(object) {
  15250. return baseGetAllKeys(object, keys$2, getSymbols$1);
  15251. }
  15252. var DataView$1 = getNative(root$1, "DataView");
  15253. var DataView$2 = DataView$1;
  15254. var Promise$1 = getNative(root$1, "Promise");
  15255. var Promise$2 = Promise$1;
  15256. var Set$2 = getNative(root$1, "Set");
  15257. var Set$3 = Set$2;
  15258. var mapTag$1 = "[object Map]", objectTag$1 = "[object Object]", promiseTag = "[object Promise]", setTag$1 = "[object Set]", weakMapTag = "[object WeakMap]";
  15259. var dataViewTag$1 = "[object DataView]";
  15260. var dataViewCtorString = toSource(DataView$2), mapCtorString = toSource(Map$3), promiseCtorString = toSource(Promise$2), setCtorString = toSource(Set$3), weakMapCtorString = toSource(WeakMap$2);
  15261. var getTag = baseGetTag;
  15262. if (DataView$2 && getTag(new DataView$2(new ArrayBuffer(1))) != dataViewTag$1 || Map$3 && getTag(new Map$3()) != mapTag$1 || Promise$2 && getTag(Promise$2.resolve()) != promiseTag || Set$3 && getTag(new Set$3()) != setTag$1 || WeakMap$2 && getTag(new WeakMap$2()) != weakMapTag) {
  15263. getTag = function(value) {
  15264. var result = baseGetTag(value), Ctor = result == objectTag$1 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
  15265. if (ctorString) {
  15266. switch (ctorString) {
  15267. case dataViewCtorString:
  15268. return dataViewTag$1;
  15269. case mapCtorString:
  15270. return mapTag$1;
  15271. case promiseCtorString:
  15272. return promiseTag;
  15273. case setCtorString:
  15274. return setTag$1;
  15275. case weakMapCtorString:
  15276. return weakMapTag;
  15277. }
  15278. }
  15279. return result;
  15280. };
  15281. }
  15282. var getTag$1 = getTag;
  15283. var Uint8Array$1 = root$1.Uint8Array;
  15284. var Uint8Array$2 = Uint8Array$1;
  15285. var HASH_UNDEFINED = "__lodash_hash_undefined__";
  15286. function setCacheAdd(value) {
  15287. this.__data__.set(value, HASH_UNDEFINED);
  15288. return this;
  15289. }
  15290. function setCacheHas(value) {
  15291. return this.__data__.has(value);
  15292. }
  15293. function SetCache(values3) {
  15294. var index2 = -1, length = values3 == null ? 0 : values3.length;
  15295. this.__data__ = new MapCache();
  15296. while (++index2 < length) {
  15297. this.add(values3[index2]);
  15298. }
  15299. }
  15300. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  15301. SetCache.prototype.has = setCacheHas;
  15302. function arraySome(array, predicate) {
  15303. var index2 = -1, length = array == null ? 0 : array.length;
  15304. while (++index2 < length) {
  15305. if (predicate(array[index2], index2, array)) {
  15306. return true;
  15307. }
  15308. }
  15309. return false;
  15310. }
  15311. function cacheHas(cache, key) {
  15312. return cache.has(key);
  15313. }
  15314. var COMPARE_PARTIAL_FLAG$3 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
  15315. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  15316. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, arrLength = array.length, othLength = other.length;
  15317. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  15318. return false;
  15319. }
  15320. var arrStacked = stack.get(array);
  15321. var othStacked = stack.get(other);
  15322. if (arrStacked && othStacked) {
  15323. return arrStacked == other && othStacked == array;
  15324. }
  15325. var index2 = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$1 ? new SetCache() : void 0;
  15326. stack.set(array, other);
  15327. stack.set(other, array);
  15328. while (++index2 < arrLength) {
  15329. var arrValue = array[index2], othValue = other[index2];
  15330. if (customizer) {
  15331. var compared = isPartial ? customizer(othValue, arrValue, index2, other, array, stack) : customizer(arrValue, othValue, index2, array, other, stack);
  15332. }
  15333. if (compared !== void 0) {
  15334. if (compared) {
  15335. continue;
  15336. }
  15337. result = false;
  15338. break;
  15339. }
  15340. if (seen) {
  15341. if (!arraySome(other, function(othValue2, othIndex) {
  15342. if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
  15343. return seen.push(othIndex);
  15344. }
  15345. })) {
  15346. result = false;
  15347. break;
  15348. }
  15349. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  15350. result = false;
  15351. break;
  15352. }
  15353. }
  15354. stack["delete"](array);
  15355. stack["delete"](other);
  15356. return result;
  15357. }
  15358. function mapToArray(map) {
  15359. var index2 = -1, result = Array(map.size);
  15360. map.forEach(function(value, key) {
  15361. result[++index2] = [key, value];
  15362. });
  15363. return result;
  15364. }
  15365. function setToArray(set4) {
  15366. var index2 = -1, result = Array(set4.size);
  15367. set4.forEach(function(value) {
  15368. result[++index2] = value;
  15369. });
  15370. return result;
  15371. }
  15372. var COMPARE_PARTIAL_FLAG$2 = 1, COMPARE_UNORDERED_FLAG = 2;
  15373. var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
  15374. var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
  15375. var symbolProto = Symbol$2 ? Symbol$2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
  15376. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  15377. switch (tag) {
  15378. case dataViewTag:
  15379. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
  15380. return false;
  15381. }
  15382. object = object.buffer;
  15383. other = other.buffer;
  15384. case arrayBufferTag:
  15385. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$2(object), new Uint8Array$2(other))) {
  15386. return false;
  15387. }
  15388. return true;
  15389. case boolTag:
  15390. case dateTag:
  15391. case numberTag:
  15392. return eq(+object, +other);
  15393. case errorTag:
  15394. return object.name == other.name && object.message == other.message;
  15395. case regexpTag:
  15396. case stringTag:
  15397. return object == other + "";
  15398. case mapTag:
  15399. var convert = mapToArray;
  15400. case setTag:
  15401. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
  15402. convert || (convert = setToArray);
  15403. if (object.size != other.size && !isPartial) {
  15404. return false;
  15405. }
  15406. var stacked = stack.get(object);
  15407. if (stacked) {
  15408. return stacked == other;
  15409. }
  15410. bitmask |= COMPARE_UNORDERED_FLAG;
  15411. stack.set(object, other);
  15412. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  15413. stack["delete"](object);
  15414. return result;
  15415. case symbolTag:
  15416. if (symbolValueOf) {
  15417. return symbolValueOf.call(object) == symbolValueOf.call(other);
  15418. }
  15419. }
  15420. return false;
  15421. }
  15422. var COMPARE_PARTIAL_FLAG$1 = 1;
  15423. var objectProto$1 = Object.prototype;
  15424. var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
  15425. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  15426. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
  15427. if (objLength != othLength && !isPartial) {
  15428. return false;
  15429. }
  15430. var index2 = objLength;
  15431. while (index2--) {
  15432. var key = objProps[index2];
  15433. if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
  15434. return false;
  15435. }
  15436. }
  15437. var objStacked = stack.get(object);
  15438. var othStacked = stack.get(other);
  15439. if (objStacked && othStacked) {
  15440. return objStacked == other && othStacked == object;
  15441. }
  15442. var result = true;
  15443. stack.set(object, other);
  15444. stack.set(other, object);
  15445. var skipCtor = isPartial;
  15446. while (++index2 < objLength) {
  15447. key = objProps[index2];
  15448. var objValue = object[key], othValue = other[key];
  15449. if (customizer) {
  15450. var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
  15451. }
  15452. if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
  15453. result = false;
  15454. break;
  15455. }
  15456. skipCtor || (skipCtor = key == "constructor");
  15457. }
  15458. if (result && !skipCtor) {
  15459. var objCtor = object.constructor, othCtor = other.constructor;
  15460. if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
  15461. result = false;
  15462. }
  15463. }
  15464. stack["delete"](object);
  15465. stack["delete"](other);
  15466. return result;
  15467. }
  15468. var COMPARE_PARTIAL_FLAG = 1;
  15469. var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
  15470. var objectProto = Object.prototype;
  15471. var hasOwnProperty = objectProto.hasOwnProperty;
  15472. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  15473. var objIsArr = isArray$1(object), othIsArr = isArray$1(other), objTag = objIsArr ? arrayTag : getTag$1(object), othTag = othIsArr ? arrayTag : getTag$1(other);
  15474. objTag = objTag == argsTag ? objectTag : objTag;
  15475. othTag = othTag == argsTag ? objectTag : othTag;
  15476. var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
  15477. if (isSameTag && isBuffer$1(object)) {
  15478. if (!isBuffer$1(other)) {
  15479. return false;
  15480. }
  15481. objIsArr = true;
  15482. objIsObj = false;
  15483. }
  15484. if (isSameTag && !objIsObj) {
  15485. stack || (stack = new Stack());
  15486. return objIsArr || isTypedArray$3(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  15487. }
  15488. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  15489. var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
  15490. if (objIsWrapped || othIsWrapped) {
  15491. var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
  15492. stack || (stack = new Stack());
  15493. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  15494. }
  15495. }
  15496. if (!isSameTag) {
  15497. return false;
  15498. }
  15499. stack || (stack = new Stack());
  15500. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  15501. }
  15502. function baseIsEqual(value, other, bitmask, customizer, stack) {
  15503. if (value === other) {
  15504. return true;
  15505. }
  15506. if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
  15507. return value !== value && other !== other;
  15508. }
  15509. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  15510. }
  15511. var now = function() {
  15512. return root$1.Date.now();
  15513. };
  15514. var now$1 = now;
  15515. var FUNC_ERROR_TEXT = "Expected a function";
  15516. var nativeMax = Math.max, nativeMin = Math.min;
  15517. function debounce$2(func, wait, options2) {
  15518. var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
  15519. if (typeof func != "function") {
  15520. throw new TypeError(FUNC_ERROR_TEXT);
  15521. }
  15522. wait = toNumber(wait) || 0;
  15523. if (isObject$4(options2)) {
  15524. leading = !!options2.leading;
  15525. maxing = "maxWait" in options2;
  15526. maxWait = maxing ? nativeMax(toNumber(options2.maxWait) || 0, wait) : maxWait;
  15527. trailing = "trailing" in options2 ? !!options2.trailing : trailing;
  15528. }
  15529. function invokeFunc(time) {
  15530. var args = lastArgs, thisArg = lastThis;
  15531. lastArgs = lastThis = void 0;
  15532. lastInvokeTime = time;
  15533. result = func.apply(thisArg, args);
  15534. return result;
  15535. }
  15536. function leadingEdge(time) {
  15537. lastInvokeTime = time;
  15538. timerId = setTimeout(timerExpired, wait);
  15539. return leading ? invokeFunc(time) : result;
  15540. }
  15541. function remainingWait(time) {
  15542. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
  15543. return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
  15544. }
  15545. function shouldInvoke(time) {
  15546. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
  15547. return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
  15548. }
  15549. function timerExpired() {
  15550. var time = now$1();
  15551. if (shouldInvoke(time)) {
  15552. return trailingEdge(time);
  15553. }
  15554. timerId = setTimeout(timerExpired, remainingWait(time));
  15555. }
  15556. function trailingEdge(time) {
  15557. timerId = void 0;
  15558. if (trailing && lastArgs) {
  15559. return invokeFunc(time);
  15560. }
  15561. lastArgs = lastThis = void 0;
  15562. return result;
  15563. }
  15564. function cancel() {
  15565. if (timerId !== void 0) {
  15566. clearTimeout(timerId);
  15567. }
  15568. lastInvokeTime = 0;
  15569. lastArgs = lastCallTime = lastThis = timerId = void 0;
  15570. }
  15571. function flush() {
  15572. return timerId === void 0 ? result : trailingEdge(now$1());
  15573. }
  15574. function debounced() {
  15575. var time = now$1(), isInvoking = shouldInvoke(time);
  15576. lastArgs = arguments;
  15577. lastThis = this;
  15578. lastCallTime = time;
  15579. if (isInvoking) {
  15580. if (timerId === void 0) {
  15581. return leadingEdge(lastCallTime);
  15582. }
  15583. if (maxing) {
  15584. clearTimeout(timerId);
  15585. timerId = setTimeout(timerExpired, wait);
  15586. return invokeFunc(lastCallTime);
  15587. }
  15588. }
  15589. if (timerId === void 0) {
  15590. timerId = setTimeout(timerExpired, wait);
  15591. }
  15592. return result;
  15593. }
  15594. debounced.cancel = cancel;
  15595. debounced.flush = flush;
  15596. return debounced;
  15597. }
  15598. function fromPairs(pairs) {
  15599. var index2 = -1, length = pairs == null ? 0 : pairs.length, result = {};
  15600. while (++index2 < length) {
  15601. var pair = pairs[index2];
  15602. result[pair[0]] = pair[1];
  15603. }
  15604. return result;
  15605. }
  15606. function isEqual(value, other) {
  15607. return baseIsEqual(value, other);
  15608. }
  15609. function isNil(value) {
  15610. return value == null;
  15611. }
  15612. function isUndefined$1(value) {
  15613. return value === void 0;
  15614. }
  15615. const isUndefined = (val) => val === void 0;
  15616. const isBoolean = (val) => typeof val === "boolean";
  15617. const isNumber = (val) => typeof val === "number";
  15618. const isElement = (e) => {
  15619. if (typeof Element === "undefined")
  15620. return false;
  15621. return e instanceof Element;
  15622. };
  15623. const isStringNumber = (val) => {
  15624. if (!isString(val)) {
  15625. return false;
  15626. }
  15627. return !Number.isNaN(Number(val));
  15628. };
  15629. const escapeStringRegexp = (string = "") => string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
  15630. const keysOf = (arr) => Object.keys(arr);
  15631. class ElementPlusError extends Error {
  15632. constructor(m) {
  15633. super(m);
  15634. this.name = "ElementPlusError";
  15635. }
  15636. }
  15637. function throwError(scope, m) {
  15638. throw new ElementPlusError(`[${scope}] ${m}`);
  15639. }
  15640. function debugWarn(scope, message) {
  15641. }
  15642. const classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim());
  15643. const hasClass$2 = (el, cls) => {
  15644. if (!el || !cls)
  15645. return false;
  15646. if (cls.includes(" "))
  15647. throw new Error("className should not contain space.");
  15648. return el.classList.contains(cls);
  15649. };
  15650. const addClass$2 = (el, cls) => {
  15651. if (!el || !cls.trim())
  15652. return;
  15653. el.classList.add(...classNameToArray(cls));
  15654. };
  15655. const removeClass$2 = (el, cls) => {
  15656. if (!el || !cls.trim())
  15657. return;
  15658. el.classList.remove(...classNameToArray(cls));
  15659. };
  15660. const getStyle = (element, styleName) => {
  15661. var _a2;
  15662. if (!isClient || !element || !styleName)
  15663. return "";
  15664. let key = camelize(styleName);
  15665. if (key === "float")
  15666. key = "cssFloat";
  15667. try {
  15668. const style = element.style[key];
  15669. if (style)
  15670. return style;
  15671. const computed2 = (_a2 = document.defaultView) == null ? void 0 : _a2.getComputedStyle(element, "");
  15672. return computed2 ? computed2[key] : "";
  15673. } catch (e) {
  15674. return element.style[key];
  15675. }
  15676. };
  15677. function addUnit(value, defaultUnit = "px") {
  15678. if (!value)
  15679. return "";
  15680. if (isNumber(value) || isStringNumber(value)) {
  15681. return `${value}${defaultUnit}`;
  15682. } else if (isString(value)) {
  15683. return value;
  15684. }
  15685. }
  15686. let scrollBarWidth;
  15687. const getScrollBarWidth = (namespace) => {
  15688. var _a2;
  15689. if (!isClient)
  15690. return 0;
  15691. if (scrollBarWidth !== void 0)
  15692. return scrollBarWidth;
  15693. const outer = document.createElement("div");
  15694. outer.className = `${namespace}-scrollbar__wrap`;
  15695. outer.style.visibility = "hidden";
  15696. outer.style.width = "100px";
  15697. outer.style.position = "absolute";
  15698. outer.style.top = "-9999px";
  15699. document.body.appendChild(outer);
  15700. const widthNoScroll = outer.offsetWidth;
  15701. outer.style.overflow = "scroll";
  15702. const inner = document.createElement("div");
  15703. inner.style.width = "100%";
  15704. outer.appendChild(inner);
  15705. const widthWithScroll = inner.offsetWidth;
  15706. (_a2 = outer.parentNode) == null ? void 0 : _a2.removeChild(outer);
  15707. scrollBarWidth = widthNoScroll - widthWithScroll;
  15708. return scrollBarWidth;
  15709. };
  15710. function scrollIntoView(container, selected) {
  15711. if (!isClient)
  15712. return;
  15713. if (!selected) {
  15714. container.scrollTop = 0;
  15715. return;
  15716. }
  15717. const offsetParents = [];
  15718. let pointer = selected.offsetParent;
  15719. while (pointer !== null && container !== pointer && container.contains(pointer)) {
  15720. offsetParents.push(pointer);
  15721. pointer = pointer.offsetParent;
  15722. }
  15723. const top = selected.offsetTop + offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0);
  15724. const bottom = top + selected.offsetHeight;
  15725. const viewRectTop = container.scrollTop;
  15726. const viewRectBottom = viewRectTop + container.clientHeight;
  15727. if (top < viewRectTop) {
  15728. container.scrollTop = top;
  15729. } else if (bottom > viewRectBottom) {
  15730. container.scrollTop = bottom - container.clientHeight;
  15731. }
  15732. }
  15733. /*! Element Plus Icons Vue v2.1.0 */
  15734. var export_helper_default = (sfc, props) => {
  15735. let target = sfc.__vccOpts || sfc;
  15736. for (let [key, val] of props)
  15737. target[key] = val;
  15738. return target;
  15739. };
  15740. var arrow_down_vue_vue_type_script_lang_default = {
  15741. name: "ArrowDown"
  15742. };
  15743. var _hoisted_16$2 = {
  15744. xmlns: "http://www.w3.org/2000/svg",
  15745. viewBox: "0 0 1024 1024"
  15746. }, _hoisted_26$2 = /* @__PURE__ */ createElementVNode(
  15747. "path",
  15748. {
  15749. fill: "currentColor",
  15750. d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"
  15751. },
  15752. null,
  15753. -1
  15754. ), _hoisted_36$2 = [
  15755. _hoisted_26$2
  15756. ];
  15757. function _sfc_render6(_ctx, _cache, $props, $setup, $data, $options) {
  15758. return openBlock(), createElementBlock("svg", _hoisted_16$2, _hoisted_36$2);
  15759. }
  15760. var arrow_down_default = /* @__PURE__ */ export_helper_default(arrow_down_vue_vue_type_script_lang_default, [["render", _sfc_render6], ["__file", "arrow-down.vue"]]);
  15761. var arrow_right_vue_vue_type_script_lang_default = {
  15762. name: "ArrowRight"
  15763. };
  15764. var _hoisted_110 = {
  15765. xmlns: "http://www.w3.org/2000/svg",
  15766. viewBox: "0 0 1024 1024"
  15767. }, _hoisted_210 = /* @__PURE__ */ createElementVNode(
  15768. "path",
  15769. {
  15770. fill: "currentColor",
  15771. d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
  15772. },
  15773. null,
  15774. -1
  15775. ), _hoisted_310 = [
  15776. _hoisted_210
  15777. ];
  15778. function _sfc_render10(_ctx, _cache, $props, $setup, $data, $options) {
  15779. return openBlock(), createElementBlock("svg", _hoisted_110, _hoisted_310);
  15780. }
  15781. var arrow_right_default = /* @__PURE__ */ export_helper_default(arrow_right_vue_vue_type_script_lang_default, [["render", _sfc_render10], ["__file", "arrow-right.vue"]]);
  15782. var arrow_up_vue_vue_type_script_lang_default = {
  15783. name: "ArrowUp"
  15784. };
  15785. var _hoisted_112 = {
  15786. xmlns: "http://www.w3.org/2000/svg",
  15787. viewBox: "0 0 1024 1024"
  15788. }, _hoisted_212 = /* @__PURE__ */ createElementVNode(
  15789. "path",
  15790. {
  15791. fill: "currentColor",
  15792. d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0z"
  15793. },
  15794. null,
  15795. -1
  15796. ), _hoisted_312 = [
  15797. _hoisted_212
  15798. ];
  15799. function _sfc_render12(_ctx, _cache, $props, $setup, $data, $options) {
  15800. return openBlock(), createElementBlock("svg", _hoisted_112, _hoisted_312);
  15801. }
  15802. var arrow_up_default = /* @__PURE__ */ export_helper_default(arrow_up_vue_vue_type_script_lang_default, [["render", _sfc_render12], ["__file", "arrow-up.vue"]]);
  15803. var circle_check_vue_vue_type_script_lang_default = {
  15804. name: "CircleCheck"
  15805. };
  15806. var _hoisted_149 = {
  15807. xmlns: "http://www.w3.org/2000/svg",
  15808. viewBox: "0 0 1024 1024"
  15809. }, _hoisted_249 = /* @__PURE__ */ createElementVNode(
  15810. "path",
  15811. {
  15812. fill: "currentColor",
  15813. d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"
  15814. },
  15815. null,
  15816. -1
  15817. ), _hoisted_348 = /* @__PURE__ */ createElementVNode(
  15818. "path",
  15819. {
  15820. fill: "currentColor",
  15821. d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"
  15822. },
  15823. null,
  15824. -1
  15825. ), _hoisted_415 = [
  15826. _hoisted_249,
  15827. _hoisted_348
  15828. ];
  15829. function _sfc_render49(_ctx, _cache, $props, $setup, $data, $options) {
  15830. return openBlock(), createElementBlock("svg", _hoisted_149, _hoisted_415);
  15831. }
  15832. var circle_check_default = /* @__PURE__ */ export_helper_default(circle_check_vue_vue_type_script_lang_default, [["render", _sfc_render49], ["__file", "circle-check.vue"]]);
  15833. var circle_close_vue_vue_type_script_lang_default = {
  15834. name: "CircleClose"
  15835. };
  15836. var _hoisted_151 = {
  15837. xmlns: "http://www.w3.org/2000/svg",
  15838. viewBox: "0 0 1024 1024"
  15839. }, _hoisted_251 = /* @__PURE__ */ createElementVNode(
  15840. "path",
  15841. {
  15842. fill: "currentColor",
  15843. d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248L466.752 512z"
  15844. },
  15845. null,
  15846. -1
  15847. ), _hoisted_350 = /* @__PURE__ */ createElementVNode(
  15848. "path",
  15849. {
  15850. fill: "currentColor",
  15851. d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"
  15852. },
  15853. null,
  15854. -1
  15855. ), _hoisted_416 = [
  15856. _hoisted_251,
  15857. _hoisted_350
  15858. ];
  15859. function _sfc_render51(_ctx, _cache, $props, $setup, $data, $options) {
  15860. return openBlock(), createElementBlock("svg", _hoisted_151, _hoisted_416);
  15861. }
  15862. var circle_close_default = /* @__PURE__ */ export_helper_default(circle_close_vue_vue_type_script_lang_default, [["render", _sfc_render51], ["__file", "circle-close.vue"]]);
  15863. var close_vue_vue_type_script_lang_default = {
  15864. name: "Close"
  15865. };
  15866. var _hoisted_156 = {
  15867. xmlns: "http://www.w3.org/2000/svg",
  15868. viewBox: "0 0 1024 1024"
  15869. }, _hoisted_256 = /* @__PURE__ */ createElementVNode(
  15870. "path",
  15871. {
  15872. fill: "currentColor",
  15873. d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
  15874. },
  15875. null,
  15876. -1
  15877. ), _hoisted_355 = [
  15878. _hoisted_256
  15879. ];
  15880. function _sfc_render56(_ctx, _cache, $props, $setup, $data, $options) {
  15881. return openBlock(), createElementBlock("svg", _hoisted_156, _hoisted_355);
  15882. }
  15883. var close_default = /* @__PURE__ */ export_helper_default(close_vue_vue_type_script_lang_default, [["render", _sfc_render56], ["__file", "close.vue"]]);
  15884. var delete_vue_vue_type_script_lang_default = {
  15885. name: "Delete"
  15886. };
  15887. var _hoisted_180 = {
  15888. xmlns: "http://www.w3.org/2000/svg",
  15889. viewBox: "0 0 1024 1024"
  15890. }, _hoisted_280 = /* @__PURE__ */ createElementVNode(
  15891. "path",
  15892. {
  15893. fill: "currentColor",
  15894. d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32zm192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32z"
  15895. },
  15896. null,
  15897. -1
  15898. ), _hoisted_379 = [
  15899. _hoisted_280
  15900. ];
  15901. function _sfc_render80(_ctx, _cache, $props, $setup, $data, $options) {
  15902. return openBlock(), createElementBlock("svg", _hoisted_180, _hoisted_379);
  15903. }
  15904. var delete_default = /* @__PURE__ */ export_helper_default(delete_vue_vue_type_script_lang_default, [["render", _sfc_render80], ["__file", "delete.vue"]]);
  15905. var edit_vue_vue_type_script_lang_default = {
  15906. name: "Edit"
  15907. };
  15908. var _hoisted_194 = {
  15909. xmlns: "http://www.w3.org/2000/svg",
  15910. viewBox: "0 0 1024 1024"
  15911. }, _hoisted_294 = /* @__PURE__ */ createElementVNode(
  15912. "path",
  15913. {
  15914. fill: "currentColor",
  15915. d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640V512z"
  15916. },
  15917. null,
  15918. -1
  15919. ), _hoisted_393 = /* @__PURE__ */ createElementVNode(
  15920. "path",
  15921. {
  15922. fill: "currentColor",
  15923. d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"
  15924. },
  15925. null,
  15926. -1
  15927. ), _hoisted_431 = [
  15928. _hoisted_294,
  15929. _hoisted_393
  15930. ];
  15931. function _sfc_render94(_ctx, _cache, $props, $setup, $data, $options) {
  15932. return openBlock(), createElementBlock("svg", _hoisted_194, _hoisted_431);
  15933. }
  15934. var edit_default = /* @__PURE__ */ export_helper_default(edit_vue_vue_type_script_lang_default, [["render", _sfc_render94], ["__file", "edit.vue"]]);
  15935. var hide_vue_vue_type_script_lang_default = {
  15936. name: "Hide"
  15937. };
  15938. var _hoisted_1133 = {
  15939. xmlns: "http://www.w3.org/2000/svg",
  15940. viewBox: "0 0 1024 1024"
  15941. }, _hoisted_2133 = /* @__PURE__ */ createElementVNode(
  15942. "path",
  15943. {
  15944. fill: "currentColor",
  15945. d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2L371.2 588.8ZM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"
  15946. },
  15947. null,
  15948. -1
  15949. ), _hoisted_3132 = /* @__PURE__ */ createElementVNode(
  15950. "path",
  15951. {
  15952. fill: "currentColor",
  15953. d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"
  15954. },
  15955. null,
  15956. -1
  15957. ), _hoisted_438 = [
  15958. _hoisted_2133,
  15959. _hoisted_3132
  15960. ];
  15961. function _sfc_render133(_ctx, _cache, $props, $setup, $data, $options) {
  15962. return openBlock(), createElementBlock("svg", _hoisted_1133, _hoisted_438);
  15963. }
  15964. var hide_default = /* @__PURE__ */ export_helper_default(hide_vue_vue_type_script_lang_default, [["render", _sfc_render133], ["__file", "hide.vue"]]);
  15965. var loading_vue_vue_type_script_lang_default = {
  15966. name: "Loading"
  15967. };
  15968. var _hoisted_1150 = {
  15969. xmlns: "http://www.w3.org/2000/svg",
  15970. viewBox: "0 0 1024 1024"
  15971. }, _hoisted_2150 = /* @__PURE__ */ createElementVNode(
  15972. "path",
  15973. {
  15974. fill: "currentColor",
  15975. d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"
  15976. },
  15977. null,
  15978. -1
  15979. ), _hoisted_3149 = [
  15980. _hoisted_2150
  15981. ];
  15982. function _sfc_render150(_ctx, _cache, $props, $setup, $data, $options) {
  15983. return openBlock(), createElementBlock("svg", _hoisted_1150, _hoisted_3149);
  15984. }
  15985. var loading_default = /* @__PURE__ */ export_helper_default(loading_vue_vue_type_script_lang_default, [["render", _sfc_render150], ["__file", "loading.vue"]]);
  15986. var minus_vue_vue_type_script_lang_default = {
  15987. name: "Minus"
  15988. };
  15989. var _hoisted_1169 = {
  15990. xmlns: "http://www.w3.org/2000/svg",
  15991. viewBox: "0 0 1024 1024"
  15992. }, _hoisted_2169 = /* @__PURE__ */ createElementVNode(
  15993. "path",
  15994. {
  15995. fill: "currentColor",
  15996. d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z"
  15997. },
  15998. null,
  15999. -1
  16000. ), _hoisted_3168 = [
  16001. _hoisted_2169
  16002. ];
  16003. function _sfc_render169(_ctx, _cache, $props, $setup, $data, $options) {
  16004. return openBlock(), createElementBlock("svg", _hoisted_1169, _hoisted_3168);
  16005. }
  16006. var minus_default = /* @__PURE__ */ export_helper_default(minus_vue_vue_type_script_lang_default, [["render", _sfc_render169], ["__file", "minus.vue"]]);
  16007. var plus_vue_vue_type_script_lang_default = {
  16008. name: "Plus"
  16009. };
  16010. var _hoisted_1201 = {
  16011. xmlns: "http://www.w3.org/2000/svg",
  16012. viewBox: "0 0 1024 1024"
  16013. }, _hoisted_2201 = /* @__PURE__ */ createElementVNode(
  16014. "path",
  16015. {
  16016. fill: "currentColor",
  16017. d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64h352z"
  16018. },
  16019. null,
  16020. -1
  16021. ), _hoisted_3200 = [
  16022. _hoisted_2201
  16023. ];
  16024. function _sfc_render201(_ctx, _cache, $props, $setup, $data, $options) {
  16025. return openBlock(), createElementBlock("svg", _hoisted_1201, _hoisted_3200);
  16026. }
  16027. var plus_default = /* @__PURE__ */ export_helper_default(plus_vue_vue_type_script_lang_default, [["render", _sfc_render201], ["__file", "plus.vue"]]);
  16028. var setting_vue_vue_type_script_lang_default = {
  16029. name: "Setting"
  16030. };
  16031. var _hoisted_1231 = {
  16032. xmlns: "http://www.w3.org/2000/svg",
  16033. viewBox: "0 0 1024 1024"
  16034. }, _hoisted_2231 = /* @__PURE__ */ createElementVNode(
  16035. "path",
  16036. {
  16037. fill: "currentColor",
  16038. d: "M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357.12 357.12 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a351.616 351.616 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357.12 357.12 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294.113 294.113 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293.12 293.12 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294.113 294.113 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288.282 288.282 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293.12 293.12 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a287.616 287.616 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384zm0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256z"
  16039. },
  16040. null,
  16041. -1
  16042. ), _hoisted_3230 = [
  16043. _hoisted_2231
  16044. ];
  16045. function _sfc_render231(_ctx, _cache, $props, $setup, $data, $options) {
  16046. return openBlock(), createElementBlock("svg", _hoisted_1231, _hoisted_3230);
  16047. }
  16048. var setting_default = /* @__PURE__ */ export_helper_default(setting_vue_vue_type_script_lang_default, [["render", _sfc_render231], ["__file", "setting.vue"]]);
  16049. var view_vue_vue_type_script_lang_default = {
  16050. name: "View"
  16051. };
  16052. var _hoisted_1283 = {
  16053. xmlns: "http://www.w3.org/2000/svg",
  16054. viewBox: "0 0 1024 1024"
  16055. }, _hoisted_2283 = /* @__PURE__ */ createElementVNode(
  16056. "path",
  16057. {
  16058. fill: "currentColor",
  16059. d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448zm0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"
  16060. },
  16061. null,
  16062. -1
  16063. ), _hoisted_3282 = [
  16064. _hoisted_2283
  16065. ];
  16066. function _sfc_render283(_ctx, _cache, $props, $setup, $data, $options) {
  16067. return openBlock(), createElementBlock("svg", _hoisted_1283, _hoisted_3282);
  16068. }
  16069. var view_default = /* @__PURE__ */ export_helper_default(view_vue_vue_type_script_lang_default, [["render", _sfc_render283], ["__file", "view.vue"]]);
  16070. const epPropKey = "__epPropKey";
  16071. const definePropType = (val) => val;
  16072. const isEpProp = (val) => isObject$5(val) && !!val[epPropKey];
  16073. const buildProp = (prop, key) => {
  16074. if (!isObject$5(prop) || isEpProp(prop))
  16075. return prop;
  16076. const { values: values3, required, default: defaultValue2, type: type2, validator } = prop;
  16077. const _validator = values3 || validator ? (val) => {
  16078. let valid = false;
  16079. let allowedValues = [];
  16080. if (values3) {
  16081. allowedValues = Array.from(values3);
  16082. if (hasOwn(prop, "default")) {
  16083. allowedValues.push(defaultValue2);
  16084. }
  16085. valid || (valid = allowedValues.includes(val));
  16086. }
  16087. if (validator)
  16088. valid || (valid = validator(val));
  16089. if (!valid && allowedValues.length > 0) {
  16090. const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
  16091. warn(`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`);
  16092. }
  16093. return valid;
  16094. } : void 0;
  16095. const epProp = {
  16096. type: type2,
  16097. required: !!required,
  16098. validator: _validator,
  16099. [epPropKey]: true
  16100. };
  16101. if (hasOwn(prop, "default"))
  16102. epProp.default = defaultValue2;
  16103. return epProp;
  16104. };
  16105. const buildProps = (props) => fromPairs(Object.entries(props).map(([key, option]) => [
  16106. key,
  16107. buildProp(option, key)
  16108. ]));
  16109. const iconPropType = definePropType([
  16110. String,
  16111. Object,
  16112. Function
  16113. ]);
  16114. const CloseComponents = {
  16115. Close: close_default
  16116. };
  16117. const ValidateComponentsMap = {
  16118. validating: loading_default,
  16119. success: circle_check_default,
  16120. error: circle_close_default
  16121. };
  16122. const withInstall = (main, extra) => {
  16123. main.install = (app) => {
  16124. for (const comp of [main, ...Object.values(extra != null ? extra : {})]) {
  16125. app.component(comp.name, comp);
  16126. }
  16127. };
  16128. if (extra) {
  16129. for (const [key, comp] of Object.entries(extra)) {
  16130. main[key] = comp;
  16131. }
  16132. }
  16133. return main;
  16134. };
  16135. const withNoopInstall = (component) => {
  16136. component.install = NOOP;
  16137. return component;
  16138. };
  16139. const composeRefs = (...refs) => {
  16140. return (el) => {
  16141. refs.forEach((ref2) => {
  16142. if (isFunction$3(ref2)) {
  16143. ref2(el);
  16144. } else {
  16145. ref2.value = el;
  16146. }
  16147. });
  16148. };
  16149. };
  16150. const EVENT_CODE = {
  16151. tab: "Tab",
  16152. enter: "Enter",
  16153. space: "Space",
  16154. left: "ArrowLeft",
  16155. up: "ArrowUp",
  16156. right: "ArrowRight",
  16157. down: "ArrowDown",
  16158. esc: "Escape",
  16159. delete: "Delete",
  16160. backspace: "Backspace",
  16161. numpadEnter: "NumpadEnter",
  16162. pageUp: "PageUp",
  16163. pageDown: "PageDown",
  16164. home: "Home",
  16165. end: "End"
  16166. };
  16167. const UPDATE_MODEL_EVENT = "update:modelValue";
  16168. const CHANGE_EVENT = "change";
  16169. const INPUT_EVENT = "input";
  16170. const componentSizes = ["", "default", "small", "large"];
  16171. const componentSizeMap = {
  16172. large: 40,
  16173. default: 32,
  16174. small: 24
  16175. };
  16176. const getComponentSize = (size) => {
  16177. return componentSizeMap[size || "default"];
  16178. };
  16179. const isValidComponentSize = (val) => ["", ...componentSizes].includes(val);
  16180. var PatchFlags = /* @__PURE__ */ ((PatchFlags2) => {
  16181. PatchFlags2[PatchFlags2["TEXT"] = 1] = "TEXT";
  16182. PatchFlags2[PatchFlags2["CLASS"] = 2] = "CLASS";
  16183. PatchFlags2[PatchFlags2["STYLE"] = 4] = "STYLE";
  16184. PatchFlags2[PatchFlags2["PROPS"] = 8] = "PROPS";
  16185. PatchFlags2[PatchFlags2["FULL_PROPS"] = 16] = "FULL_PROPS";
  16186. PatchFlags2[PatchFlags2["HYDRATE_EVENTS"] = 32] = "HYDRATE_EVENTS";
  16187. PatchFlags2[PatchFlags2["STABLE_FRAGMENT"] = 64] = "STABLE_FRAGMENT";
  16188. PatchFlags2[PatchFlags2["KEYED_FRAGMENT"] = 128] = "KEYED_FRAGMENT";
  16189. PatchFlags2[PatchFlags2["UNKEYED_FRAGMENT"] = 256] = "UNKEYED_FRAGMENT";
  16190. PatchFlags2[PatchFlags2["NEED_PATCH"] = 512] = "NEED_PATCH";
  16191. PatchFlags2[PatchFlags2["DYNAMIC_SLOTS"] = 1024] = "DYNAMIC_SLOTS";
  16192. PatchFlags2[PatchFlags2["HOISTED"] = -1] = "HOISTED";
  16193. PatchFlags2[PatchFlags2["BAIL"] = -2] = "BAIL";
  16194. return PatchFlags2;
  16195. })(PatchFlags || {});
  16196. const isKorean = (text) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(text);
  16197. const generateId = () => Math.floor(Math.random() * 1e4);
  16198. const mutable = (val) => val;
  16199. const DEFAULT_EXCLUDE_KEYS = ["class", "style"];
  16200. const LISTENER_PREFIX = /^on[A-Z]/;
  16201. const useAttrs = (params = {}) => {
  16202. const { excludeListeners = false, excludeKeys } = params;
  16203. const allExcludeKeys = computed$1(() => {
  16204. return ((excludeKeys == null ? void 0 : excludeKeys.value) || []).concat(DEFAULT_EXCLUDE_KEYS);
  16205. });
  16206. const instance = getCurrentInstance();
  16207. if (!instance) {
  16208. return computed$1(() => ({}));
  16209. }
  16210. return computed$1(() => {
  16211. var _a2;
  16212. return fromPairs(Object.entries((_a2 = instance.proxy) == null ? void 0 : _a2.$attrs).filter(([key]) => !allExcludeKeys.value.includes(key) && !(excludeListeners && LISTENER_PREFIX.test(key))));
  16213. });
  16214. };
  16215. const useDeprecated = ({ from: from3, replacement, scope, version: version2, ref: ref2, type: type2 = "API" }, condition) => {
  16216. watch(() => unref(condition), (val) => {
  16217. }, {
  16218. immediate: true
  16219. });
  16220. };
  16221. const useDraggable = (targetRef, dragRef, draggable2) => {
  16222. let transform3 = {
  16223. offsetX: 0,
  16224. offsetY: 0
  16225. };
  16226. const onMousedown = (e) => {
  16227. const downX = e.clientX;
  16228. const downY = e.clientY;
  16229. const { offsetX, offsetY } = transform3;
  16230. const targetRect = targetRef.value.getBoundingClientRect();
  16231. const targetLeft = targetRect.left;
  16232. const targetTop = targetRect.top;
  16233. const targetWidth = targetRect.width;
  16234. const targetHeight = targetRect.height;
  16235. const clientWidth = document.documentElement.clientWidth;
  16236. const clientHeight = document.documentElement.clientHeight;
  16237. const minLeft = -targetLeft + offsetX;
  16238. const minTop = -targetTop + offsetY;
  16239. const maxLeft = clientWidth - targetLeft - targetWidth + offsetX;
  16240. const maxTop = clientHeight - targetTop - targetHeight + offsetY;
  16241. const onMousemove = (e2) => {
  16242. const moveX = Math.min(Math.max(offsetX + e2.clientX - downX, minLeft), maxLeft);
  16243. const moveY = Math.min(Math.max(offsetY + e2.clientY - downY, minTop), maxTop);
  16244. transform3 = {
  16245. offsetX: moveX,
  16246. offsetY: moveY
  16247. };
  16248. targetRef.value.style.transform = `translate(${addUnit(moveX)}, ${addUnit(moveY)})`;
  16249. };
  16250. const onMouseup = () => {
  16251. document.removeEventListener("mousemove", onMousemove);
  16252. document.removeEventListener("mouseup", onMouseup);
  16253. };
  16254. document.addEventListener("mousemove", onMousemove);
  16255. document.addEventListener("mouseup", onMouseup);
  16256. };
  16257. const onDraggable = () => {
  16258. if (dragRef.value && targetRef.value) {
  16259. dragRef.value.addEventListener("mousedown", onMousedown);
  16260. }
  16261. };
  16262. const offDraggable = () => {
  16263. if (dragRef.value && targetRef.value) {
  16264. dragRef.value.removeEventListener("mousedown", onMousedown);
  16265. }
  16266. };
  16267. onMounted(() => {
  16268. watchEffect(() => {
  16269. if (draggable2.value) {
  16270. onDraggable();
  16271. } else {
  16272. offDraggable();
  16273. }
  16274. });
  16275. });
  16276. onBeforeUnmount(() => {
  16277. offDraggable();
  16278. });
  16279. };
  16280. const useFocus = (el) => {
  16281. return {
  16282. focus: () => {
  16283. var _a2, _b;
  16284. (_b = (_a2 = el.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b.call(_a2);
  16285. }
  16286. };
  16287. };
  16288. var English = {
  16289. name: "en",
  16290. el: {
  16291. colorpicker: {
  16292. confirm: "OK",
  16293. clear: "Clear",
  16294. defaultLabel: "color picker",
  16295. description: "current color is {color}. press enter to select a new color."
  16296. },
  16297. datepicker: {
  16298. now: "Now",
  16299. today: "Today",
  16300. cancel: "Cancel",
  16301. clear: "Clear",
  16302. confirm: "OK",
  16303. dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
  16304. monthTablePrompt: "Use the arrow keys and enter to select the month",
  16305. yearTablePrompt: "Use the arrow keys and enter to select the year",
  16306. selectedDate: "Selected date",
  16307. selectDate: "Select date",
  16308. selectTime: "Select time",
  16309. startDate: "Start Date",
  16310. startTime: "Start Time",
  16311. endDate: "End Date",
  16312. endTime: "End Time",
  16313. prevYear: "Previous Year",
  16314. nextYear: "Next Year",
  16315. prevMonth: "Previous Month",
  16316. nextMonth: "Next Month",
  16317. year: "",
  16318. month1: "January",
  16319. month2: "February",
  16320. month3: "March",
  16321. month4: "April",
  16322. month5: "May",
  16323. month6: "June",
  16324. month7: "July",
  16325. month8: "August",
  16326. month9: "September",
  16327. month10: "October",
  16328. month11: "November",
  16329. month12: "December",
  16330. week: "week",
  16331. weeks: {
  16332. sun: "Sun",
  16333. mon: "Mon",
  16334. tue: "Tue",
  16335. wed: "Wed",
  16336. thu: "Thu",
  16337. fri: "Fri",
  16338. sat: "Sat"
  16339. },
  16340. weeksFull: {
  16341. sun: "Sunday",
  16342. mon: "Monday",
  16343. tue: "Tuesday",
  16344. wed: "Wednesday",
  16345. thu: "Thursday",
  16346. fri: "Friday",
  16347. sat: "Saturday"
  16348. },
  16349. months: {
  16350. jan: "Jan",
  16351. feb: "Feb",
  16352. mar: "Mar",
  16353. apr: "Apr",
  16354. may: "May",
  16355. jun: "Jun",
  16356. jul: "Jul",
  16357. aug: "Aug",
  16358. sep: "Sep",
  16359. oct: "Oct",
  16360. nov: "Nov",
  16361. dec: "Dec"
  16362. }
  16363. },
  16364. inputNumber: {
  16365. decrease: "decrease number",
  16366. increase: "increase number"
  16367. },
  16368. select: {
  16369. loading: "Loading",
  16370. noMatch: "No matching data",
  16371. noData: "No data",
  16372. placeholder: "Select"
  16373. },
  16374. dropdown: {
  16375. toggleDropdown: "Toggle Dropdown"
  16376. },
  16377. cascader: {
  16378. noMatch: "No matching data",
  16379. loading: "Loading",
  16380. placeholder: "Select",
  16381. noData: "No data"
  16382. },
  16383. pagination: {
  16384. goto: "Go to",
  16385. pagesize: "/page",
  16386. total: "Total {total}",
  16387. pageClassifier: "",
  16388. page: "Page",
  16389. prev: "Go to previous page",
  16390. next: "Go to next page",
  16391. currentPage: "page {pager}",
  16392. prevPages: "Previous {pager} pages",
  16393. nextPages: "Next {pager} pages",
  16394. deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
  16395. },
  16396. dialog: {
  16397. close: "Close this dialog"
  16398. },
  16399. drawer: {
  16400. close: "Close this dialog"
  16401. },
  16402. messagebox: {
  16403. title: "Message",
  16404. confirm: "OK",
  16405. cancel: "Cancel",
  16406. error: "Illegal input",
  16407. close: "Close this dialog"
  16408. },
  16409. upload: {
  16410. deleteTip: "press delete to remove",
  16411. delete: "Delete",
  16412. preview: "Preview",
  16413. continue: "Continue"
  16414. },
  16415. slider: {
  16416. defaultLabel: "slider between {min} and {max}",
  16417. defaultRangeStartLabel: "pick start value",
  16418. defaultRangeEndLabel: "pick end value"
  16419. },
  16420. table: {
  16421. emptyText: "No Data",
  16422. confirmFilter: "Confirm",
  16423. resetFilter: "Reset",
  16424. clearFilter: "All",
  16425. sumText: "Sum"
  16426. },
  16427. tree: {
  16428. emptyText: "No Data"
  16429. },
  16430. transfer: {
  16431. noMatch: "No matching data",
  16432. noData: "No data",
  16433. titles: ["List 1", "List 2"],
  16434. filterPlaceholder: "Enter keyword",
  16435. noCheckedFormat: "{total} items",
  16436. hasCheckedFormat: "{checked}/{total} checked"
  16437. },
  16438. image: {
  16439. error: "FAILED"
  16440. },
  16441. pageHeader: {
  16442. title: "Back"
  16443. },
  16444. popconfirm: {
  16445. confirmButtonText: "Yes",
  16446. cancelButtonText: "No"
  16447. }
  16448. }
  16449. };
  16450. const buildTranslator = (locale) => (path, option) => translate(path, option, unref(locale));
  16451. const translate = (path, option, locale) => get$2(locale, path, path).replace(/\{(\w+)\}/g, (_, key) => {
  16452. var _a2;
  16453. return `${(_a2 = option == null ? void 0 : option[key]) != null ? _a2 : `{${key}}`}`;
  16454. });
  16455. const buildLocaleContext = (locale) => {
  16456. const lang = computed$1(() => unref(locale).name);
  16457. const localeRef = isRef(locale) ? locale : ref(locale);
  16458. return {
  16459. lang,
  16460. locale: localeRef,
  16461. t: buildTranslator(locale)
  16462. };
  16463. };
  16464. const localeContextKey = Symbol("localeContextKey");
  16465. const useLocale = (localeOverrides) => {
  16466. const locale = localeOverrides || inject(localeContextKey, ref());
  16467. return buildLocaleContext(computed$1(() => locale.value || English));
  16468. };
  16469. let activeEffectScope;
  16470. function recordEffectScope(effect, scope = activeEffectScope) {
  16471. if (scope && scope.active) {
  16472. scope.effects.push(effect);
  16473. }
  16474. }
  16475. const createDep = (effects) => {
  16476. const dep = new Set(effects);
  16477. dep.w = 0;
  16478. dep.n = 0;
  16479. return dep;
  16480. };
  16481. const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
  16482. const newTracked = (dep) => (dep.n & trackOpBit) > 0;
  16483. const initDepMarkers = ({ deps }) => {
  16484. if (deps.length) {
  16485. for (let i2 = 0; i2 < deps.length; i2++) {
  16486. deps[i2].w |= trackOpBit;
  16487. }
  16488. }
  16489. };
  16490. const finalizeDepMarkers = (effect) => {
  16491. const { deps } = effect;
  16492. if (deps.length) {
  16493. let ptr = 0;
  16494. for (let i2 = 0; i2 < deps.length; i2++) {
  16495. const dep = deps[i2];
  16496. if (wasTracked(dep) && !newTracked(dep)) {
  16497. dep.delete(effect);
  16498. } else {
  16499. deps[ptr++] = dep;
  16500. }
  16501. dep.w &= ~trackOpBit;
  16502. dep.n &= ~trackOpBit;
  16503. }
  16504. deps.length = ptr;
  16505. }
  16506. };
  16507. let effectTrackDepth = 0;
  16508. let trackOpBit = 1;
  16509. const maxMarkerBits = 30;
  16510. let activeEffect;
  16511. class ReactiveEffect {
  16512. constructor(fn2, scheduler = null, scope) {
  16513. this.fn = fn2;
  16514. this.scheduler = scheduler;
  16515. this.active = true;
  16516. this.deps = [];
  16517. this.parent = void 0;
  16518. recordEffectScope(this, scope);
  16519. }
  16520. run() {
  16521. if (!this.active) {
  16522. return this.fn();
  16523. }
  16524. let parent = activeEffect;
  16525. let lastShouldTrack = shouldTrack;
  16526. while (parent) {
  16527. if (parent === this) {
  16528. return;
  16529. }
  16530. parent = parent.parent;
  16531. }
  16532. try {
  16533. this.parent = activeEffect;
  16534. activeEffect = this;
  16535. shouldTrack = true;
  16536. trackOpBit = 1 << ++effectTrackDepth;
  16537. if (effectTrackDepth <= maxMarkerBits) {
  16538. initDepMarkers(this);
  16539. } else {
  16540. cleanupEffect(this);
  16541. }
  16542. return this.fn();
  16543. } finally {
  16544. if (effectTrackDepth <= maxMarkerBits) {
  16545. finalizeDepMarkers(this);
  16546. }
  16547. trackOpBit = 1 << --effectTrackDepth;
  16548. activeEffect = this.parent;
  16549. shouldTrack = lastShouldTrack;
  16550. this.parent = void 0;
  16551. if (this.deferStop) {
  16552. this.stop();
  16553. }
  16554. }
  16555. }
  16556. stop() {
  16557. if (activeEffect === this) {
  16558. this.deferStop = true;
  16559. } else if (this.active) {
  16560. cleanupEffect(this);
  16561. if (this.onStop) {
  16562. this.onStop();
  16563. }
  16564. this.active = false;
  16565. }
  16566. }
  16567. }
  16568. function cleanupEffect(effect2) {
  16569. const { deps } = effect2;
  16570. if (deps.length) {
  16571. for (let i2 = 0; i2 < deps.length; i2++) {
  16572. deps[i2].delete(effect2);
  16573. }
  16574. deps.length = 0;
  16575. }
  16576. }
  16577. let shouldTrack = true;
  16578. function trackEffects(dep, debuggerEventExtraInfo) {
  16579. let shouldTrack2 = false;
  16580. if (effectTrackDepth <= maxMarkerBits) {
  16581. if (!newTracked(dep)) {
  16582. dep.n |= trackOpBit;
  16583. shouldTrack2 = !wasTracked(dep);
  16584. }
  16585. } else {
  16586. shouldTrack2 = !dep.has(activeEffect);
  16587. }
  16588. if (shouldTrack2) {
  16589. dep.add(activeEffect);
  16590. activeEffect.deps.push(dep);
  16591. }
  16592. }
  16593. function triggerEffects(dep, debuggerEventExtraInfo) {
  16594. const effects = isArray$2(dep) ? dep : [...dep];
  16595. for (const effect2 of effects) {
  16596. if (effect2.computed) {
  16597. triggerEffect(effect2);
  16598. }
  16599. }
  16600. for (const effect2 of effects) {
  16601. if (!effect2.computed) {
  16602. triggerEffect(effect2);
  16603. }
  16604. }
  16605. }
  16606. function triggerEffect(effect2, debuggerEventExtraInfo) {
  16607. if (effect2 !== activeEffect || effect2.allowRecurse) {
  16608. if (effect2.scheduler) {
  16609. effect2.scheduler();
  16610. } else {
  16611. effect2.run();
  16612. }
  16613. }
  16614. }
  16615. function toRaw(observed) {
  16616. const raw = observed && observed["__v_raw"];
  16617. return raw ? toRaw(raw) : observed;
  16618. }
  16619. function trackRefValue(ref2) {
  16620. if (shouldTrack && activeEffect) {
  16621. ref2 = toRaw(ref2);
  16622. {
  16623. trackEffects(ref2.dep || (ref2.dep = createDep()));
  16624. }
  16625. }
  16626. }
  16627. function triggerRefValue(ref2, newVal) {
  16628. ref2 = toRaw(ref2);
  16629. const dep = ref2.dep;
  16630. if (dep) {
  16631. {
  16632. triggerEffects(dep);
  16633. }
  16634. }
  16635. }
  16636. class ComputedRefImpl {
  16637. constructor(getter, _setter, isReadonly, isSSR) {
  16638. this._setter = _setter;
  16639. this.dep = void 0;
  16640. this.__v_isRef = true;
  16641. this["__v_isReadonly"] = false;
  16642. this._dirty = true;
  16643. this.effect = new ReactiveEffect(getter, () => {
  16644. if (!this._dirty) {
  16645. this._dirty = true;
  16646. triggerRefValue(this);
  16647. }
  16648. });
  16649. this.effect.computed = this;
  16650. this.effect.active = this._cacheable = !isSSR;
  16651. this["__v_isReadonly"] = isReadonly;
  16652. }
  16653. get value() {
  16654. const self2 = toRaw(this);
  16655. trackRefValue(self2);
  16656. if (self2._dirty || !self2._cacheable) {
  16657. self2._dirty = false;
  16658. self2._value = self2.effect.run();
  16659. }
  16660. return self2._value;
  16661. }
  16662. set value(newValue) {
  16663. this._setter(newValue);
  16664. }
  16665. }
  16666. function computed(getterOrOptions, debugOptions, isSSR = false) {
  16667. let getter;
  16668. let setter;
  16669. const onlyGetter = isFunction$3(getterOrOptions);
  16670. if (onlyGetter) {
  16671. getter = getterOrOptions;
  16672. setter = NOOP;
  16673. } else {
  16674. getter = getterOrOptions.get;
  16675. setter = getterOrOptions.set;
  16676. }
  16677. const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  16678. return cRef;
  16679. }
  16680. const defaultNamespace = "el";
  16681. const statePrefix = "is-";
  16682. const _bem = (namespace, block, blockSuffix, element, modifier) => {
  16683. let cls = `${namespace}-${block}`;
  16684. if (blockSuffix) {
  16685. cls += `-${blockSuffix}`;
  16686. }
  16687. if (element) {
  16688. cls += `__${element}`;
  16689. }
  16690. if (modifier) {
  16691. cls += `--${modifier}`;
  16692. }
  16693. return cls;
  16694. };
  16695. const namespaceContextKey = Symbol("namespaceContextKey");
  16696. const useGetDerivedNamespace = (namespaceOverrides) => {
  16697. const derivedNamespace = namespaceOverrides || inject(namespaceContextKey, ref(defaultNamespace));
  16698. const namespace = computed$1(() => {
  16699. return unref(derivedNamespace) || defaultNamespace;
  16700. });
  16701. return namespace;
  16702. };
  16703. const useNamespace = (block, namespaceOverrides) => {
  16704. const namespace = useGetDerivedNamespace(namespaceOverrides);
  16705. const b = (blockSuffix = "") => _bem(namespace.value, block, blockSuffix, "", "");
  16706. const e = (element) => element ? _bem(namespace.value, block, "", element, "") : "";
  16707. const m = (modifier) => modifier ? _bem(namespace.value, block, "", "", modifier) : "";
  16708. const be2 = (blockSuffix, element) => blockSuffix && element ? _bem(namespace.value, block, blockSuffix, element, "") : "";
  16709. const em = (element, modifier) => element && modifier ? _bem(namespace.value, block, "", element, modifier) : "";
  16710. const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(namespace.value, block, blockSuffix, "", modifier) : "";
  16711. const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(namespace.value, block, blockSuffix, element, modifier) : "";
  16712. const is = (name, ...args) => {
  16713. const state = args.length >= 1 ? args[0] : true;
  16714. return name && state ? `${statePrefix}${name}` : "";
  16715. };
  16716. const cssVar = (object) => {
  16717. const styles = {};
  16718. for (const key in object) {
  16719. if (object[key]) {
  16720. styles[`--${namespace.value}-${key}`] = object[key];
  16721. }
  16722. }
  16723. return styles;
  16724. };
  16725. const cssVarBlock = (object) => {
  16726. const styles = {};
  16727. for (const key in object) {
  16728. if (object[key]) {
  16729. styles[`--${namespace.value}-${block}-${key}`] = object[key];
  16730. }
  16731. }
  16732. return styles;
  16733. };
  16734. const cssVarName = (name) => `--${namespace.value}-${name}`;
  16735. const cssVarBlockName = (name) => `--${namespace.value}-${block}-${name}`;
  16736. return {
  16737. namespace,
  16738. b,
  16739. e,
  16740. m,
  16741. be: be2,
  16742. em,
  16743. bm,
  16744. bem,
  16745. is,
  16746. cssVar,
  16747. cssVarName,
  16748. cssVarBlock,
  16749. cssVarBlockName
  16750. };
  16751. };
  16752. const useLockscreen = (trigger2, options2 = {}) => {
  16753. if (!isRef(trigger2)) {
  16754. throwError("[useLockscreen]", "You need to pass a ref param to this function");
  16755. }
  16756. const ns = options2.ns || useNamespace("popup");
  16757. const hiddenCls = computed(() => ns.bm("parent", "hidden"));
  16758. if (!isClient || hasClass$2(document.body, hiddenCls.value)) {
  16759. return;
  16760. }
  16761. let scrollBarWidth2 = 0;
  16762. let withoutHiddenClass = false;
  16763. let bodyWidth = "0";
  16764. const cleanup = () => {
  16765. setTimeout(() => {
  16766. removeClass$2(document == null ? void 0 : document.body, hiddenCls.value);
  16767. if (withoutHiddenClass && document) {
  16768. document.body.style.width = bodyWidth;
  16769. }
  16770. }, 200);
  16771. };
  16772. watch(trigger2, (val) => {
  16773. if (!val) {
  16774. cleanup();
  16775. return;
  16776. }
  16777. withoutHiddenClass = !hasClass$2(document.body, hiddenCls.value);
  16778. if (withoutHiddenClass) {
  16779. bodyWidth = document.body.style.width;
  16780. }
  16781. scrollBarWidth2 = getScrollBarWidth(ns.namespace.value);
  16782. const bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
  16783. const bodyOverflowY = getStyle(document.body, "overflowY");
  16784. if (scrollBarWidth2 > 0 && (bodyHasOverflow || bodyOverflowY === "scroll") && withoutHiddenClass) {
  16785. document.body.style.width = `calc(100% - ${scrollBarWidth2}px)`;
  16786. }
  16787. addClass$2(document.body, hiddenCls.value);
  16788. });
  16789. onScopeDispose(() => cleanup());
  16790. };
  16791. const _prop = buildProp({
  16792. type: definePropType(Boolean),
  16793. default: null
  16794. });
  16795. const _event = buildProp({
  16796. type: definePropType(Function)
  16797. });
  16798. const createModelToggleComposable = (name) => {
  16799. const updateEventKey = `update:${name}`;
  16800. const updateEventKeyRaw = `onUpdate:${name}`;
  16801. const useModelToggleEmits2 = [updateEventKey];
  16802. const useModelToggleProps2 = {
  16803. [name]: _prop,
  16804. [updateEventKeyRaw]: _event
  16805. };
  16806. const useModelToggle2 = ({
  16807. indicator,
  16808. toggleReason,
  16809. shouldHideWhenRouteChanges,
  16810. shouldProceed,
  16811. onShow,
  16812. onHide
  16813. }) => {
  16814. const instance = getCurrentInstance();
  16815. const { emit } = instance;
  16816. const props = instance.props;
  16817. const hasUpdateHandler = computed$1(() => isFunction$3(props[updateEventKeyRaw]));
  16818. const isModelBindingAbsent = computed$1(() => props[name] === null);
  16819. const doShow = (event2) => {
  16820. if (indicator.value === true) {
  16821. return;
  16822. }
  16823. indicator.value = true;
  16824. if (toggleReason) {
  16825. toggleReason.value = event2;
  16826. }
  16827. if (isFunction$3(onShow)) {
  16828. onShow(event2);
  16829. }
  16830. };
  16831. const doHide = (event2) => {
  16832. if (indicator.value === false) {
  16833. return;
  16834. }
  16835. indicator.value = false;
  16836. if (toggleReason) {
  16837. toggleReason.value = event2;
  16838. }
  16839. if (isFunction$3(onHide)) {
  16840. onHide(event2);
  16841. }
  16842. };
  16843. const show = (event2) => {
  16844. if (props.disabled === true || isFunction$3(shouldProceed) && !shouldProceed())
  16845. return;
  16846. const shouldEmit = hasUpdateHandler.value && isClient;
  16847. if (shouldEmit) {
  16848. emit(updateEventKey, true);
  16849. }
  16850. if (isModelBindingAbsent.value || !shouldEmit) {
  16851. doShow(event2);
  16852. }
  16853. };
  16854. const hide = (event2) => {
  16855. if (props.disabled === true || !isClient)
  16856. return;
  16857. const shouldEmit = hasUpdateHandler.value && isClient;
  16858. if (shouldEmit) {
  16859. emit(updateEventKey, false);
  16860. }
  16861. if (isModelBindingAbsent.value || !shouldEmit) {
  16862. doHide(event2);
  16863. }
  16864. };
  16865. const onChange = (val) => {
  16866. if (!isBoolean(val))
  16867. return;
  16868. if (props.disabled && val) {
  16869. if (hasUpdateHandler.value) {
  16870. emit(updateEventKey, false);
  16871. }
  16872. } else if (indicator.value !== val) {
  16873. if (val) {
  16874. doShow();
  16875. } else {
  16876. doHide();
  16877. }
  16878. }
  16879. };
  16880. const toggle = () => {
  16881. if (indicator.value) {
  16882. hide();
  16883. } else {
  16884. show();
  16885. }
  16886. };
  16887. watch(() => props[name], onChange);
  16888. if (shouldHideWhenRouteChanges && instance.appContext.config.globalProperties.$route !== void 0) {
  16889. watch(() => ({
  16890. ...instance.proxy.$route
  16891. }), () => {
  16892. if (shouldHideWhenRouteChanges.value && indicator.value) {
  16893. hide();
  16894. }
  16895. });
  16896. }
  16897. onMounted(() => {
  16898. onChange(props[name]);
  16899. });
  16900. return {
  16901. hide,
  16902. show,
  16903. toggle,
  16904. hasUpdateHandler
  16905. };
  16906. };
  16907. return {
  16908. useModelToggle: useModelToggle2,
  16909. useModelToggleProps: useModelToggleProps2,
  16910. useModelToggleEmits: useModelToggleEmits2
  16911. };
  16912. };
  16913. const useProp = (name) => {
  16914. const vm = getCurrentInstance();
  16915. return computed$1(() => {
  16916. var _a2, _b;
  16917. return (_b = (_a2 = vm == null ? void 0 : vm.proxy) == null ? void 0 : _a2.$props) == null ? void 0 : _b[name];
  16918. });
  16919. };
  16920. var E = "top", R = "bottom", W = "right", P = "left", me = "auto", G = [E, R, W, P], U = "start", J = "end", Xe = "clippingParents", je = "viewport", K = "popper", Ye = "reference", De = G.reduce(function(t2, e) {
  16921. return t2.concat([e + "-" + U, e + "-" + J]);
  16922. }, []), Ee = [].concat(G, [me]).reduce(function(t2, e) {
  16923. return t2.concat([e, e + "-" + U, e + "-" + J]);
  16924. }, []), Ge = "beforeRead", Je = "read", Ke = "afterRead", Qe = "beforeMain", Ze = "main", et = "afterMain", tt = "beforeWrite", nt = "write", rt = "afterWrite", ot = [Ge, Je, Ke, Qe, Ze, et, tt, nt, rt];
  16925. function C(t2) {
  16926. return t2 ? (t2.nodeName || "").toLowerCase() : null;
  16927. }
  16928. function H(t2) {
  16929. if (t2 == null)
  16930. return window;
  16931. if (t2.toString() !== "[object Window]") {
  16932. var e = t2.ownerDocument;
  16933. return e && e.defaultView || window;
  16934. }
  16935. return t2;
  16936. }
  16937. function Q(t2) {
  16938. var e = H(t2).Element;
  16939. return t2 instanceof e || t2 instanceof Element;
  16940. }
  16941. function B(t2) {
  16942. var e = H(t2).HTMLElement;
  16943. return t2 instanceof e || t2 instanceof HTMLElement;
  16944. }
  16945. function Pe(t2) {
  16946. if (typeof ShadowRoot == "undefined")
  16947. return false;
  16948. var e = H(t2).ShadowRoot;
  16949. return t2 instanceof e || t2 instanceof ShadowRoot;
  16950. }
  16951. function Mt(t2) {
  16952. var e = t2.state;
  16953. Object.keys(e.elements).forEach(function(n) {
  16954. var r2 = e.styles[n] || {}, o = e.attributes[n] || {}, i2 = e.elements[n];
  16955. !B(i2) || !C(i2) || (Object.assign(i2.style, r2), Object.keys(o).forEach(function(a) {
  16956. var s = o[a];
  16957. s === false ? i2.removeAttribute(a) : i2.setAttribute(a, s === true ? "" : s);
  16958. }));
  16959. });
  16960. }
  16961. function Rt(t2) {
  16962. var e = t2.state, n = { popper: { position: e.options.strategy, left: "0", top: "0", margin: "0" }, arrow: { position: "absolute" }, reference: {} };
  16963. return Object.assign(e.elements.popper.style, n.popper), e.styles = n, e.elements.arrow && Object.assign(e.elements.arrow.style, n.arrow), function() {
  16964. Object.keys(e.elements).forEach(function(r2) {
  16965. var o = e.elements[r2], i2 = e.attributes[r2] || {}, a = Object.keys(e.styles.hasOwnProperty(r2) ? e.styles[r2] : n[r2]), s = a.reduce(function(f, c) {
  16966. return f[c] = "", f;
  16967. }, {});
  16968. !B(o) || !C(o) || (Object.assign(o.style, s), Object.keys(i2).forEach(function(f) {
  16969. o.removeAttribute(f);
  16970. }));
  16971. });
  16972. };
  16973. }
  16974. var Ae = { name: "applyStyles", enabled: true, phase: "write", fn: Mt, effect: Rt, requires: ["computeStyles"] };
  16975. function q(t2) {
  16976. return t2.split("-")[0];
  16977. }
  16978. var X = Math.max, ve = Math.min, Z = Math.round;
  16979. function ee(t2, e) {
  16980. e === void 0 && (e = false);
  16981. var n = t2.getBoundingClientRect(), r2 = 1, o = 1;
  16982. if (B(t2) && e) {
  16983. var i2 = t2.offsetHeight, a = t2.offsetWidth;
  16984. a > 0 && (r2 = Z(n.width) / a || 1), i2 > 0 && (o = Z(n.height) / i2 || 1);
  16985. }
  16986. return { width: n.width / r2, height: n.height / o, top: n.top / o, right: n.right / r2, bottom: n.bottom / o, left: n.left / r2, x: n.left / r2, y: n.top / o };
  16987. }
  16988. function ke(t2) {
  16989. var e = ee(t2), n = t2.offsetWidth, r2 = t2.offsetHeight;
  16990. return Math.abs(e.width - n) <= 1 && (n = e.width), Math.abs(e.height - r2) <= 1 && (r2 = e.height), { x: t2.offsetLeft, y: t2.offsetTop, width: n, height: r2 };
  16991. }
  16992. function it(t2, e) {
  16993. var n = e.getRootNode && e.getRootNode();
  16994. if (t2.contains(e))
  16995. return true;
  16996. if (n && Pe(n)) {
  16997. var r2 = e;
  16998. do {
  16999. if (r2 && t2.isSameNode(r2))
  17000. return true;
  17001. r2 = r2.parentNode || r2.host;
  17002. } while (r2);
  17003. }
  17004. return false;
  17005. }
  17006. function N(t2) {
  17007. return H(t2).getComputedStyle(t2);
  17008. }
  17009. function Wt(t2) {
  17010. return ["table", "td", "th"].indexOf(C(t2)) >= 0;
  17011. }
  17012. function I(t2) {
  17013. return ((Q(t2) ? t2.ownerDocument : t2.document) || window.document).documentElement;
  17014. }
  17015. function ge(t2) {
  17016. return C(t2) === "html" ? t2 : t2.assignedSlot || t2.parentNode || (Pe(t2) ? t2.host : null) || I(t2);
  17017. }
  17018. function at(t2) {
  17019. return !B(t2) || N(t2).position === "fixed" ? null : t2.offsetParent;
  17020. }
  17021. function Bt(t2) {
  17022. var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1, n = navigator.userAgent.indexOf("Trident") !== -1;
  17023. if (n && B(t2)) {
  17024. var r2 = N(t2);
  17025. if (r2.position === "fixed")
  17026. return null;
  17027. }
  17028. var o = ge(t2);
  17029. for (Pe(o) && (o = o.host); B(o) && ["html", "body"].indexOf(C(o)) < 0; ) {
  17030. var i2 = N(o);
  17031. if (i2.transform !== "none" || i2.perspective !== "none" || i2.contain === "paint" || ["transform", "perspective"].indexOf(i2.willChange) !== -1 || e && i2.willChange === "filter" || e && i2.filter && i2.filter !== "none")
  17032. return o;
  17033. o = o.parentNode;
  17034. }
  17035. return null;
  17036. }
  17037. function se(t2) {
  17038. for (var e = H(t2), n = at(t2); n && Wt(n) && N(n).position === "static"; )
  17039. n = at(n);
  17040. return n && (C(n) === "html" || C(n) === "body" && N(n).position === "static") ? e : n || Bt(t2) || e;
  17041. }
  17042. function Le(t2) {
  17043. return ["top", "bottom"].indexOf(t2) >= 0 ? "x" : "y";
  17044. }
  17045. function fe(t2, e, n) {
  17046. return X(t2, ve(e, n));
  17047. }
  17048. function St(t2, e, n) {
  17049. var r2 = fe(t2, e, n);
  17050. return r2 > n ? n : r2;
  17051. }
  17052. function st() {
  17053. return { top: 0, right: 0, bottom: 0, left: 0 };
  17054. }
  17055. function ft(t2) {
  17056. return Object.assign({}, st(), t2);
  17057. }
  17058. function ct(t2, e) {
  17059. return e.reduce(function(n, r2) {
  17060. return n[r2] = t2, n;
  17061. }, {});
  17062. }
  17063. var Tt = function(t2, e) {
  17064. return t2 = typeof t2 == "function" ? t2(Object.assign({}, e.rects, { placement: e.placement })) : t2, ft(typeof t2 != "number" ? t2 : ct(t2, G));
  17065. };
  17066. function Ht(t2) {
  17067. var e, n = t2.state, r2 = t2.name, o = t2.options, i2 = n.elements.arrow, a = n.modifiersData.popperOffsets, s = q(n.placement), f = Le(s), c = [P, W].indexOf(s) >= 0, u = c ? "height" : "width";
  17068. if (!(!i2 || !a)) {
  17069. var m = Tt(o.padding, n), v = ke(i2), l = f === "y" ? E : P, h2 = f === "y" ? R : W, p = n.rects.reference[u] + n.rects.reference[f] - a[f] - n.rects.popper[u], g = a[f] - n.rects.reference[f], x = se(i2), y = x ? f === "y" ? x.clientHeight || 0 : x.clientWidth || 0 : 0, $2 = p / 2 - g / 2, d2 = m[l], b = y - v[u] - m[h2], w = y / 2 - v[u] / 2 + $2, O = fe(d2, w, b), j = f;
  17070. n.modifiersData[r2] = (e = {}, e[j] = O, e.centerOffset = O - w, e);
  17071. }
  17072. }
  17073. function Ct(t2) {
  17074. var e = t2.state, n = t2.options, r2 = n.element, o = r2 === void 0 ? "[data-popper-arrow]" : r2;
  17075. o != null && (typeof o == "string" && (o = e.elements.popper.querySelector(o), !o) || !it(e.elements.popper, o) || (e.elements.arrow = o));
  17076. }
  17077. var pt = { name: "arrow", enabled: true, phase: "main", fn: Ht, effect: Ct, requires: ["popperOffsets"], requiresIfExists: ["preventOverflow"] };
  17078. function te(t2) {
  17079. return t2.split("-")[1];
  17080. }
  17081. var qt = { top: "auto", right: "auto", bottom: "auto", left: "auto" };
  17082. function Vt(t2) {
  17083. var e = t2.x, n = t2.y, r2 = window, o = r2.devicePixelRatio || 1;
  17084. return { x: Z(e * o) / o || 0, y: Z(n * o) / o || 0 };
  17085. }
  17086. function ut(t2) {
  17087. var e, n = t2.popper, r2 = t2.popperRect, o = t2.placement, i2 = t2.variation, a = t2.offsets, s = t2.position, f = t2.gpuAcceleration, c = t2.adaptive, u = t2.roundOffsets, m = t2.isFixed, v = a.x, l = v === void 0 ? 0 : v, h2 = a.y, p = h2 === void 0 ? 0 : h2, g = typeof u == "function" ? u({ x: l, y: p }) : { x: l, y: p };
  17088. l = g.x, p = g.y;
  17089. var x = a.hasOwnProperty("x"), y = a.hasOwnProperty("y"), $2 = P, d2 = E, b = window;
  17090. if (c) {
  17091. var w = se(n), O = "clientHeight", j = "clientWidth";
  17092. if (w === H(n) && (w = I(n), N(w).position !== "static" && s === "absolute" && (O = "scrollHeight", j = "scrollWidth")), w = w, o === E || (o === P || o === W) && i2 === J) {
  17093. d2 = R;
  17094. var A = m && w === b && b.visualViewport ? b.visualViewport.height : w[O];
  17095. p -= A - r2.height, p *= f ? 1 : -1;
  17096. }
  17097. if (o === P || (o === E || o === R) && i2 === J) {
  17098. $2 = W;
  17099. var k = m && w === b && b.visualViewport ? b.visualViewport.width : w[j];
  17100. l -= k - r2.width, l *= f ? 1 : -1;
  17101. }
  17102. }
  17103. var D = Object.assign({ position: s }, c && qt), S = u === true ? Vt({ x: l, y: p }) : { x: l, y: p };
  17104. if (l = S.x, p = S.y, f) {
  17105. var L;
  17106. return Object.assign({}, D, (L = {}, L[d2] = y ? "0" : "", L[$2] = x ? "0" : "", L.transform = (b.devicePixelRatio || 1) <= 1 ? "translate(" + l + "px, " + p + "px)" : "translate3d(" + l + "px, " + p + "px, 0)", L));
  17107. }
  17108. return Object.assign({}, D, (e = {}, e[d2] = y ? p + "px" : "", e[$2] = x ? l + "px" : "", e.transform = "", e));
  17109. }
  17110. function Nt(t2) {
  17111. var e = t2.state, n = t2.options, r2 = n.gpuAcceleration, o = r2 === void 0 ? true : r2, i2 = n.adaptive, a = i2 === void 0 ? true : i2, s = n.roundOffsets, f = s === void 0 ? true : s, c = { placement: q(e.placement), variation: te(e.placement), popper: e.elements.popper, popperRect: e.rects.popper, gpuAcceleration: o, isFixed: e.options.strategy === "fixed" };
  17112. e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, ut(Object.assign({}, c, { offsets: e.modifiersData.popperOffsets, position: e.options.strategy, adaptive: a, roundOffsets: f })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, ut(Object.assign({}, c, { offsets: e.modifiersData.arrow, position: "absolute", adaptive: false, roundOffsets: f })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement });
  17113. }
  17114. var Me = { name: "computeStyles", enabled: true, phase: "beforeWrite", fn: Nt, data: {} }, ye = { passive: true };
  17115. function It(t2) {
  17116. var e = t2.state, n = t2.instance, r2 = t2.options, o = r2.scroll, i2 = o === void 0 ? true : o, a = r2.resize, s = a === void 0 ? true : a, f = H(e.elements.popper), c = [].concat(e.scrollParents.reference, e.scrollParents.popper);
  17117. return i2 && c.forEach(function(u) {
  17118. u.addEventListener("scroll", n.update, ye);
  17119. }), s && f.addEventListener("resize", n.update, ye), function() {
  17120. i2 && c.forEach(function(u) {
  17121. u.removeEventListener("scroll", n.update, ye);
  17122. }), s && f.removeEventListener("resize", n.update, ye);
  17123. };
  17124. }
  17125. var Re = { name: "eventListeners", enabled: true, phase: "write", fn: function() {
  17126. }, effect: It, data: {} }, _t = { left: "right", right: "left", bottom: "top", top: "bottom" };
  17127. function be(t2) {
  17128. return t2.replace(/left|right|bottom|top/g, function(e) {
  17129. return _t[e];
  17130. });
  17131. }
  17132. var zt = { start: "end", end: "start" };
  17133. function lt(t2) {
  17134. return t2.replace(/start|end/g, function(e) {
  17135. return zt[e];
  17136. });
  17137. }
  17138. function We(t2) {
  17139. var e = H(t2), n = e.pageXOffset, r2 = e.pageYOffset;
  17140. return { scrollLeft: n, scrollTop: r2 };
  17141. }
  17142. function Be(t2) {
  17143. return ee(I(t2)).left + We(t2).scrollLeft;
  17144. }
  17145. function Ft(t2) {
  17146. var e = H(t2), n = I(t2), r2 = e.visualViewport, o = n.clientWidth, i2 = n.clientHeight, a = 0, s = 0;
  17147. return r2 && (o = r2.width, i2 = r2.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (a = r2.offsetLeft, s = r2.offsetTop)), { width: o, height: i2, x: a + Be(t2), y: s };
  17148. }
  17149. function Ut(t2) {
  17150. var e, n = I(t2), r2 = We(t2), o = (e = t2.ownerDocument) == null ? void 0 : e.body, i2 = X(n.scrollWidth, n.clientWidth, o ? o.scrollWidth : 0, o ? o.clientWidth : 0), a = X(n.scrollHeight, n.clientHeight, o ? o.scrollHeight : 0, o ? o.clientHeight : 0), s = -r2.scrollLeft + Be(t2), f = -r2.scrollTop;
  17151. return N(o || n).direction === "rtl" && (s += X(n.clientWidth, o ? o.clientWidth : 0) - i2), { width: i2, height: a, x: s, y: f };
  17152. }
  17153. function Se(t2) {
  17154. var e = N(t2), n = e.overflow, r2 = e.overflowX, o = e.overflowY;
  17155. return /auto|scroll|overlay|hidden/.test(n + o + r2);
  17156. }
  17157. function dt(t2) {
  17158. return ["html", "body", "#document"].indexOf(C(t2)) >= 0 ? t2.ownerDocument.body : B(t2) && Se(t2) ? t2 : dt(ge(t2));
  17159. }
  17160. function ce(t2, e) {
  17161. var n;
  17162. e === void 0 && (e = []);
  17163. var r2 = dt(t2), o = r2 === ((n = t2.ownerDocument) == null ? void 0 : n.body), i2 = H(r2), a = o ? [i2].concat(i2.visualViewport || [], Se(r2) ? r2 : []) : r2, s = e.concat(a);
  17164. return o ? s : s.concat(ce(ge(a)));
  17165. }
  17166. function Te(t2) {
  17167. return Object.assign({}, t2, { left: t2.x, top: t2.y, right: t2.x + t2.width, bottom: t2.y + t2.height });
  17168. }
  17169. function Xt(t2) {
  17170. var e = ee(t2);
  17171. return e.top = e.top + t2.clientTop, e.left = e.left + t2.clientLeft, e.bottom = e.top + t2.clientHeight, e.right = e.left + t2.clientWidth, e.width = t2.clientWidth, e.height = t2.clientHeight, e.x = e.left, e.y = e.top, e;
  17172. }
  17173. function ht(t2, e) {
  17174. return e === je ? Te(Ft(t2)) : Q(e) ? Xt(e) : Te(Ut(I(t2)));
  17175. }
  17176. function Yt(t2) {
  17177. var e = ce(ge(t2)), n = ["absolute", "fixed"].indexOf(N(t2).position) >= 0, r2 = n && B(t2) ? se(t2) : t2;
  17178. return Q(r2) ? e.filter(function(o) {
  17179. return Q(o) && it(o, r2) && C(o) !== "body";
  17180. }) : [];
  17181. }
  17182. function Gt(t2, e, n) {
  17183. var r2 = e === "clippingParents" ? Yt(t2) : [].concat(e), o = [].concat(r2, [n]), i2 = o[0], a = o.reduce(function(s, f) {
  17184. var c = ht(t2, f);
  17185. return s.top = X(c.top, s.top), s.right = ve(c.right, s.right), s.bottom = ve(c.bottom, s.bottom), s.left = X(c.left, s.left), s;
  17186. }, ht(t2, i2));
  17187. return a.width = a.right - a.left, a.height = a.bottom - a.top, a.x = a.left, a.y = a.top, a;
  17188. }
  17189. function mt(t2) {
  17190. var e = t2.reference, n = t2.element, r2 = t2.placement, o = r2 ? q(r2) : null, i2 = r2 ? te(r2) : null, a = e.x + e.width / 2 - n.width / 2, s = e.y + e.height / 2 - n.height / 2, f;
  17191. switch (o) {
  17192. case E:
  17193. f = { x: a, y: e.y - n.height };
  17194. break;
  17195. case R:
  17196. f = { x: a, y: e.y + e.height };
  17197. break;
  17198. case W:
  17199. f = { x: e.x + e.width, y: s };
  17200. break;
  17201. case P:
  17202. f = { x: e.x - n.width, y: s };
  17203. break;
  17204. default:
  17205. f = { x: e.x, y: e.y };
  17206. }
  17207. var c = o ? Le(o) : null;
  17208. if (c != null) {
  17209. var u = c === "y" ? "height" : "width";
  17210. switch (i2) {
  17211. case U:
  17212. f[c] = f[c] - (e[u] / 2 - n[u] / 2);
  17213. break;
  17214. case J:
  17215. f[c] = f[c] + (e[u] / 2 - n[u] / 2);
  17216. break;
  17217. }
  17218. }
  17219. return f;
  17220. }
  17221. function ne(t2, e) {
  17222. e === void 0 && (e = {});
  17223. var n = e, r2 = n.placement, o = r2 === void 0 ? t2.placement : r2, i2 = n.boundary, a = i2 === void 0 ? Xe : i2, s = n.rootBoundary, f = s === void 0 ? je : s, c = n.elementContext, u = c === void 0 ? K : c, m = n.altBoundary, v = m === void 0 ? false : m, l = n.padding, h2 = l === void 0 ? 0 : l, p = ft(typeof h2 != "number" ? h2 : ct(h2, G)), g = u === K ? Ye : K, x = t2.rects.popper, y = t2.elements[v ? g : u], $2 = Gt(Q(y) ? y : y.contextElement || I(t2.elements.popper), a, f), d2 = ee(t2.elements.reference), b = mt({ reference: d2, element: x, strategy: "absolute", placement: o }), w = Te(Object.assign({}, x, b)), O = u === K ? w : d2, j = { top: $2.top - O.top + p.top, bottom: O.bottom - $2.bottom + p.bottom, left: $2.left - O.left + p.left, right: O.right - $2.right + p.right }, A = t2.modifiersData.offset;
  17224. if (u === K && A) {
  17225. var k = A[o];
  17226. Object.keys(j).forEach(function(D) {
  17227. var S = [W, R].indexOf(D) >= 0 ? 1 : -1, L = [E, R].indexOf(D) >= 0 ? "y" : "x";
  17228. j[D] += k[L] * S;
  17229. });
  17230. }
  17231. return j;
  17232. }
  17233. function Jt(t2, e) {
  17234. e === void 0 && (e = {});
  17235. var n = e, r2 = n.placement, o = n.boundary, i2 = n.rootBoundary, a = n.padding, s = n.flipVariations, f = n.allowedAutoPlacements, c = f === void 0 ? Ee : f, u = te(r2), m = u ? s ? De : De.filter(function(h2) {
  17236. return te(h2) === u;
  17237. }) : G, v = m.filter(function(h2) {
  17238. return c.indexOf(h2) >= 0;
  17239. });
  17240. v.length === 0 && (v = m);
  17241. var l = v.reduce(function(h2, p) {
  17242. return h2[p] = ne(t2, { placement: p, boundary: o, rootBoundary: i2, padding: a })[q(p)], h2;
  17243. }, {});
  17244. return Object.keys(l).sort(function(h2, p) {
  17245. return l[h2] - l[p];
  17246. });
  17247. }
  17248. function Kt(t2) {
  17249. if (q(t2) === me)
  17250. return [];
  17251. var e = be(t2);
  17252. return [lt(t2), e, lt(e)];
  17253. }
  17254. function Qt(t2) {
  17255. var e = t2.state, n = t2.options, r2 = t2.name;
  17256. if (!e.modifiersData[r2]._skip) {
  17257. for (var o = n.mainAxis, i2 = o === void 0 ? true : o, a = n.altAxis, s = a === void 0 ? true : a, f = n.fallbackPlacements, c = n.padding, u = n.boundary, m = n.rootBoundary, v = n.altBoundary, l = n.flipVariations, h2 = l === void 0 ? true : l, p = n.allowedAutoPlacements, g = e.options.placement, x = q(g), y = x === g, $2 = f || (y || !h2 ? [be(g)] : Kt(g)), d2 = [g].concat($2).reduce(function(z, V) {
  17258. return z.concat(q(V) === me ? Jt(e, { placement: V, boundary: u, rootBoundary: m, padding: c, flipVariations: h2, allowedAutoPlacements: p }) : V);
  17259. }, []), b = e.rects.reference, w = e.rects.popper, O = /* @__PURE__ */ new Map(), j = true, A = d2[0], k = 0; k < d2.length; k++) {
  17260. var D = d2[k], S = q(D), L = te(D) === U, re = [E, R].indexOf(S) >= 0, oe = re ? "width" : "height", M = ne(e, { placement: D, boundary: u, rootBoundary: m, altBoundary: v, padding: c }), T = re ? L ? W : P : L ? R : E;
  17261. b[oe] > w[oe] && (T = be(T));
  17262. var pe = be(T), _ = [];
  17263. if (i2 && _.push(M[S] <= 0), s && _.push(M[T] <= 0, M[pe] <= 0), _.every(function(z) {
  17264. return z;
  17265. })) {
  17266. A = D, j = false;
  17267. break;
  17268. }
  17269. O.set(D, _);
  17270. }
  17271. if (j)
  17272. for (var ue = h2 ? 3 : 1, xe = function(z) {
  17273. var V = d2.find(function(de) {
  17274. var ae = O.get(de);
  17275. if (ae)
  17276. return ae.slice(0, z).every(function(Y) {
  17277. return Y;
  17278. });
  17279. });
  17280. if (V)
  17281. return A = V, "break";
  17282. }, ie = ue; ie > 0; ie--) {
  17283. var le = xe(ie);
  17284. if (le === "break")
  17285. break;
  17286. }
  17287. e.placement !== A && (e.modifiersData[r2]._skip = true, e.placement = A, e.reset = true);
  17288. }
  17289. }
  17290. var vt = { name: "flip", enabled: true, phase: "main", fn: Qt, requiresIfExists: ["offset"], data: { _skip: false } };
  17291. function gt(t2, e, n) {
  17292. return n === void 0 && (n = { x: 0, y: 0 }), { top: t2.top - e.height - n.y, right: t2.right - e.width + n.x, bottom: t2.bottom - e.height + n.y, left: t2.left - e.width - n.x };
  17293. }
  17294. function yt(t2) {
  17295. return [E, W, R, P].some(function(e) {
  17296. return t2[e] >= 0;
  17297. });
  17298. }
  17299. function Zt(t2) {
  17300. var e = t2.state, n = t2.name, r2 = e.rects.reference, o = e.rects.popper, i2 = e.modifiersData.preventOverflow, a = ne(e, { elementContext: "reference" }), s = ne(e, { altBoundary: true }), f = gt(a, r2), c = gt(s, o, i2), u = yt(f), m = yt(c);
  17301. e.modifiersData[n] = { referenceClippingOffsets: f, popperEscapeOffsets: c, isReferenceHidden: u, hasPopperEscaped: m }, e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-reference-hidden": u, "data-popper-escaped": m });
  17302. }
  17303. var bt = { name: "hide", enabled: true, phase: "main", requiresIfExists: ["preventOverflow"], fn: Zt };
  17304. function en$1(t2, e, n) {
  17305. var r2 = q(t2), o = [P, E].indexOf(r2) >= 0 ? -1 : 1, i2 = typeof n == "function" ? n(Object.assign({}, e, { placement: t2 })) : n, a = i2[0], s = i2[1];
  17306. return a = a || 0, s = (s || 0) * o, [P, W].indexOf(r2) >= 0 ? { x: s, y: a } : { x: a, y: s };
  17307. }
  17308. function tn(t2) {
  17309. var e = t2.state, n = t2.options, r2 = t2.name, o = n.offset, i2 = o === void 0 ? [0, 0] : o, a = Ee.reduce(function(u, m) {
  17310. return u[m] = en$1(m, e.rects, i2), u;
  17311. }, {}), s = a[e.placement], f = s.x, c = s.y;
  17312. e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += f, e.modifiersData.popperOffsets.y += c), e.modifiersData[r2] = a;
  17313. }
  17314. var wt = { name: "offset", enabled: true, phase: "main", requires: ["popperOffsets"], fn: tn };
  17315. function nn(t2) {
  17316. var e = t2.state, n = t2.name;
  17317. e.modifiersData[n] = mt({ reference: e.rects.reference, element: e.rects.popper, strategy: "absolute", placement: e.placement });
  17318. }
  17319. var He = { name: "popperOffsets", enabled: true, phase: "read", fn: nn, data: {} };
  17320. function rn(t2) {
  17321. return t2 === "x" ? "y" : "x";
  17322. }
  17323. function on$2(t2) {
  17324. var e = t2.state, n = t2.options, r2 = t2.name, o = n.mainAxis, i2 = o === void 0 ? true : o, a = n.altAxis, s = a === void 0 ? false : a, f = n.boundary, c = n.rootBoundary, u = n.altBoundary, m = n.padding, v = n.tether, l = v === void 0 ? true : v, h2 = n.tetherOffset, p = h2 === void 0 ? 0 : h2, g = ne(e, { boundary: f, rootBoundary: c, padding: m, altBoundary: u }), x = q(e.placement), y = te(e.placement), $2 = !y, d2 = Le(x), b = rn(d2), w = e.modifiersData.popperOffsets, O = e.rects.reference, j = e.rects.popper, A = typeof p == "function" ? p(Object.assign({}, e.rects, { placement: e.placement })) : p, k = typeof A == "number" ? { mainAxis: A, altAxis: A } : Object.assign({ mainAxis: 0, altAxis: 0 }, A), D = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, S = { x: 0, y: 0 };
  17325. if (w) {
  17326. if (i2) {
  17327. var L, re = d2 === "y" ? E : P, oe = d2 === "y" ? R : W, M = d2 === "y" ? "height" : "width", T = w[d2], pe = T + g[re], _ = T - g[oe], ue = l ? -j[M] / 2 : 0, xe = y === U ? O[M] : j[M], ie = y === U ? -j[M] : -O[M], le = e.elements.arrow, z = l && le ? ke(le) : { width: 0, height: 0 }, V = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : st(), de = V[re], ae = V[oe], Y = fe(0, O[M], z[M]), jt = $2 ? O[M] / 2 - ue - Y - de - k.mainAxis : xe - Y - de - k.mainAxis, Dt = $2 ? -O[M] / 2 + ue + Y + ae + k.mainAxis : ie + Y + ae + k.mainAxis, Oe = e.elements.arrow && se(e.elements.arrow), Et = Oe ? d2 === "y" ? Oe.clientTop || 0 : Oe.clientLeft || 0 : 0, Ce = (L = D == null ? void 0 : D[d2]) != null ? L : 0, Pt = T + jt - Ce - Et, At = T + Dt - Ce, qe = fe(l ? ve(pe, Pt) : pe, T, l ? X(_, At) : _);
  17328. w[d2] = qe, S[d2] = qe - T;
  17329. }
  17330. if (s) {
  17331. var Ve, kt = d2 === "x" ? E : P, Lt = d2 === "x" ? R : W, F = w[b], he = b === "y" ? "height" : "width", Ne = F + g[kt], Ie = F - g[Lt], $e = [E, P].indexOf(x) !== -1, _e = (Ve = D == null ? void 0 : D[b]) != null ? Ve : 0, ze = $e ? Ne : F - O[he] - j[he] - _e + k.altAxis, Fe = $e ? F + O[he] + j[he] - _e - k.altAxis : Ie, Ue = l && $e ? St(ze, F, Fe) : fe(l ? ze : Ne, F, l ? Fe : Ie);
  17332. w[b] = Ue, S[b] = Ue - F;
  17333. }
  17334. e.modifiersData[r2] = S;
  17335. }
  17336. }
  17337. var xt = { name: "preventOverflow", enabled: true, phase: "main", fn: on$2, requiresIfExists: ["offset"] };
  17338. function an(t2) {
  17339. return { scrollLeft: t2.scrollLeft, scrollTop: t2.scrollTop };
  17340. }
  17341. function sn(t2) {
  17342. return t2 === H(t2) || !B(t2) ? We(t2) : an(t2);
  17343. }
  17344. function fn(t2) {
  17345. var e = t2.getBoundingClientRect(), n = Z(e.width) / t2.offsetWidth || 1, r2 = Z(e.height) / t2.offsetHeight || 1;
  17346. return n !== 1 || r2 !== 1;
  17347. }
  17348. function cn(t2, e, n) {
  17349. n === void 0 && (n = false);
  17350. var r2 = B(e), o = B(e) && fn(e), i2 = I(e), a = ee(t2, o), s = { scrollLeft: 0, scrollTop: 0 }, f = { x: 0, y: 0 };
  17351. return (r2 || !r2 && !n) && ((C(e) !== "body" || Se(i2)) && (s = sn(e)), B(e) ? (f = ee(e, true), f.x += e.clientLeft, f.y += e.clientTop) : i2 && (f.x = Be(i2))), { x: a.left + s.scrollLeft - f.x, y: a.top + s.scrollTop - f.y, width: a.width, height: a.height };
  17352. }
  17353. function pn(t2) {
  17354. var e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r2 = [];
  17355. t2.forEach(function(i2) {
  17356. e.set(i2.name, i2);
  17357. });
  17358. function o(i2) {
  17359. n.add(i2.name);
  17360. var a = [].concat(i2.requires || [], i2.requiresIfExists || []);
  17361. a.forEach(function(s) {
  17362. if (!n.has(s)) {
  17363. var f = e.get(s);
  17364. f && o(f);
  17365. }
  17366. }), r2.push(i2);
  17367. }
  17368. return t2.forEach(function(i2) {
  17369. n.has(i2.name) || o(i2);
  17370. }), r2;
  17371. }
  17372. function un(t2) {
  17373. var e = pn(t2);
  17374. return ot.reduce(function(n, r2) {
  17375. return n.concat(e.filter(function(o) {
  17376. return o.phase === r2;
  17377. }));
  17378. }, []);
  17379. }
  17380. function ln(t2) {
  17381. var e;
  17382. return function() {
  17383. return e || (e = new Promise(function(n) {
  17384. Promise.resolve().then(function() {
  17385. e = void 0, n(t2());
  17386. });
  17387. })), e;
  17388. };
  17389. }
  17390. function dn(t2) {
  17391. var e = t2.reduce(function(n, r2) {
  17392. var o = n[r2.name];
  17393. return n[r2.name] = o ? Object.assign({}, o, r2, { options: Object.assign({}, o.options, r2.options), data: Object.assign({}, o.data, r2.data) }) : r2, n;
  17394. }, {});
  17395. return Object.keys(e).map(function(n) {
  17396. return e[n];
  17397. });
  17398. }
  17399. var Ot = { placement: "bottom", modifiers: [], strategy: "absolute" };
  17400. function $t() {
  17401. for (var t2 = arguments.length, e = new Array(t2), n = 0; n < t2; n++)
  17402. e[n] = arguments[n];
  17403. return !e.some(function(r2) {
  17404. return !(r2 && typeof r2.getBoundingClientRect == "function");
  17405. });
  17406. }
  17407. function we(t2) {
  17408. t2 === void 0 && (t2 = {});
  17409. var e = t2, n = e.defaultModifiers, r2 = n === void 0 ? [] : n, o = e.defaultOptions, i2 = o === void 0 ? Ot : o;
  17410. return function(a, s, f) {
  17411. f === void 0 && (f = i2);
  17412. var c = { placement: "bottom", orderedModifiers: [], options: Object.assign({}, Ot, i2), modifiersData: {}, elements: { reference: a, popper: s }, attributes: {}, styles: {} }, u = [], m = false, v = { state: c, setOptions: function(p) {
  17413. var g = typeof p == "function" ? p(c.options) : p;
  17414. h2(), c.options = Object.assign({}, i2, c.options, g), c.scrollParents = { reference: Q(a) ? ce(a) : a.contextElement ? ce(a.contextElement) : [], popper: ce(s) };
  17415. var x = un(dn([].concat(r2, c.options.modifiers)));
  17416. return c.orderedModifiers = x.filter(function(y) {
  17417. return y.enabled;
  17418. }), l(), v.update();
  17419. }, forceUpdate: function() {
  17420. if (!m) {
  17421. var p = c.elements, g = p.reference, x = p.popper;
  17422. if ($t(g, x)) {
  17423. c.rects = { reference: cn(g, se(x), c.options.strategy === "fixed"), popper: ke(x) }, c.reset = false, c.placement = c.options.placement, c.orderedModifiers.forEach(function(j) {
  17424. return c.modifiersData[j.name] = Object.assign({}, j.data);
  17425. });
  17426. for (var y = 0; y < c.orderedModifiers.length; y++) {
  17427. if (c.reset === true) {
  17428. c.reset = false, y = -1;
  17429. continue;
  17430. }
  17431. var $2 = c.orderedModifiers[y], d2 = $2.fn, b = $2.options, w = b === void 0 ? {} : b, O = $2.name;
  17432. typeof d2 == "function" && (c = d2({ state: c, options: w, name: O, instance: v }) || c);
  17433. }
  17434. }
  17435. }
  17436. }, update: ln(function() {
  17437. return new Promise(function(p) {
  17438. v.forceUpdate(), p(c);
  17439. });
  17440. }), destroy: function() {
  17441. h2(), m = true;
  17442. } };
  17443. if (!$t(a, s))
  17444. return v;
  17445. v.setOptions(f).then(function(p) {
  17446. !m && f.onFirstUpdate && f.onFirstUpdate(p);
  17447. });
  17448. function l() {
  17449. c.orderedModifiers.forEach(function(p) {
  17450. var g = p.name, x = p.options, y = x === void 0 ? {} : x, $2 = p.effect;
  17451. if (typeof $2 == "function") {
  17452. var d2 = $2({ state: c, name: g, instance: v, options: y }), b = function() {
  17453. };
  17454. u.push(d2 || b);
  17455. }
  17456. });
  17457. }
  17458. function h2() {
  17459. u.forEach(function(p) {
  17460. return p();
  17461. }), u = [];
  17462. }
  17463. return v;
  17464. };
  17465. }
  17466. we();
  17467. var mn = [Re, He, Me, Ae];
  17468. we({ defaultModifiers: mn });
  17469. var gn = [Re, He, Me, Ae, wt, vt, xt, pt, bt], yn = we({ defaultModifiers: gn });
  17470. const usePopper = (referenceElementRef, popperElementRef, opts = {}) => {
  17471. const stateUpdater = {
  17472. name: "updateState",
  17473. enabled: true,
  17474. phase: "write",
  17475. fn: ({ state }) => {
  17476. const derivedState = deriveState(state);
  17477. Object.assign(states.value, derivedState);
  17478. },
  17479. requires: ["computeStyles"]
  17480. };
  17481. const options2 = computed$1(() => {
  17482. const { onFirstUpdate, placement, strategy, modifiers } = unref(opts);
  17483. return {
  17484. onFirstUpdate,
  17485. placement: placement || "bottom",
  17486. strategy: strategy || "absolute",
  17487. modifiers: [
  17488. ...modifiers || [],
  17489. stateUpdater,
  17490. { name: "applyStyles", enabled: false }
  17491. ]
  17492. };
  17493. });
  17494. const instanceRef = shallowRef();
  17495. const states = ref({
  17496. styles: {
  17497. popper: {
  17498. position: unref(options2).strategy,
  17499. left: "0",
  17500. top: "0"
  17501. },
  17502. arrow: {
  17503. position: "absolute"
  17504. }
  17505. },
  17506. attributes: {}
  17507. });
  17508. const destroy = () => {
  17509. if (!instanceRef.value)
  17510. return;
  17511. instanceRef.value.destroy();
  17512. instanceRef.value = void 0;
  17513. };
  17514. watch(options2, (newOptions) => {
  17515. const instance = unref(instanceRef);
  17516. if (instance) {
  17517. instance.setOptions(newOptions);
  17518. }
  17519. }, {
  17520. deep: true
  17521. });
  17522. watch([referenceElementRef, popperElementRef], ([referenceElement, popperElement]) => {
  17523. destroy();
  17524. if (!referenceElement || !popperElement)
  17525. return;
  17526. instanceRef.value = yn(referenceElement, popperElement, unref(options2));
  17527. });
  17528. onBeforeUnmount(() => {
  17529. destroy();
  17530. });
  17531. return {
  17532. state: computed$1(() => {
  17533. var _a2;
  17534. return { ...((_a2 = unref(instanceRef)) == null ? void 0 : _a2.state) || {} };
  17535. }),
  17536. styles: computed$1(() => unref(states).styles),
  17537. attributes: computed$1(() => unref(states).attributes),
  17538. update: () => {
  17539. var _a2;
  17540. return (_a2 = unref(instanceRef)) == null ? void 0 : _a2.update();
  17541. },
  17542. forceUpdate: () => {
  17543. var _a2;
  17544. return (_a2 = unref(instanceRef)) == null ? void 0 : _a2.forceUpdate();
  17545. },
  17546. instanceRef: computed$1(() => unref(instanceRef))
  17547. };
  17548. };
  17549. function deriveState(state) {
  17550. const elements = Object.keys(state.elements);
  17551. const styles = fromPairs(elements.map((element) => [element, state.styles[element] || {}]));
  17552. const attributes = fromPairs(elements.map((element) => [element, state.attributes[element]]));
  17553. return {
  17554. styles,
  17555. attributes
  17556. };
  17557. }
  17558. const useSameTarget = (handleClick) => {
  17559. if (!handleClick) {
  17560. return { onClick: NOOP, onMousedown: NOOP, onMouseup: NOOP };
  17561. }
  17562. let mousedownTarget = false;
  17563. let mouseupTarget = false;
  17564. const onClick = (e) => {
  17565. if (mousedownTarget && mouseupTarget) {
  17566. handleClick(e);
  17567. }
  17568. mousedownTarget = mouseupTarget = false;
  17569. };
  17570. const onMousedown = (e) => {
  17571. mousedownTarget = e.target === e.currentTarget;
  17572. };
  17573. const onMouseup = (e) => {
  17574. mouseupTarget = e.target === e.currentTarget;
  17575. };
  17576. return { onClick, onMousedown, onMouseup };
  17577. };
  17578. function useTimeout() {
  17579. let timeoutHandle;
  17580. const registerTimeout = (fn2, delay) => {
  17581. cancelTimeout();
  17582. timeoutHandle = window.setTimeout(fn2, delay);
  17583. };
  17584. const cancelTimeout = () => window.clearTimeout(timeoutHandle);
  17585. tryOnScopeDispose(() => cancelTimeout());
  17586. return {
  17587. registerTimeout,
  17588. cancelTimeout
  17589. };
  17590. }
  17591. const defaultIdInjection = {
  17592. prefix: Math.floor(Math.random() * 1e4),
  17593. current: 0
  17594. };
  17595. const ID_INJECTION_KEY = Symbol("elIdInjection");
  17596. const useIdInjection = () => {
  17597. return getCurrentInstance() ? inject(ID_INJECTION_KEY, defaultIdInjection) : defaultIdInjection;
  17598. };
  17599. const useId = (deterministicId) => {
  17600. const idInjection = useIdInjection();
  17601. const namespace = useGetDerivedNamespace();
  17602. const idRef = computed$1(() => unref(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`);
  17603. return idRef;
  17604. };
  17605. let registeredEscapeHandlers = [];
  17606. const cachedHandler = (e) => {
  17607. const event2 = e;
  17608. if (event2.key === EVENT_CODE.esc) {
  17609. registeredEscapeHandlers.forEach((registeredHandler) => registeredHandler(event2));
  17610. }
  17611. };
  17612. const useEscapeKeydown = (handler) => {
  17613. onMounted(() => {
  17614. if (registeredEscapeHandlers.length === 0) {
  17615. document.addEventListener("keydown", cachedHandler);
  17616. }
  17617. if (isClient)
  17618. registeredEscapeHandlers.push(handler);
  17619. });
  17620. onBeforeUnmount(() => {
  17621. registeredEscapeHandlers = registeredEscapeHandlers.filter((registeredHandler) => registeredHandler !== handler);
  17622. if (registeredEscapeHandlers.length === 0) {
  17623. if (isClient)
  17624. document.removeEventListener("keydown", cachedHandler);
  17625. }
  17626. });
  17627. };
  17628. let cachedContainer;
  17629. const usePopperContainerId = () => {
  17630. const namespace = useGetDerivedNamespace();
  17631. const idInjection = useIdInjection();
  17632. const id = computed$1(() => {
  17633. return `${namespace.value}-popper-container-${idInjection.prefix}`;
  17634. });
  17635. const selector = computed$1(() => `#${id.value}`);
  17636. return {
  17637. id,
  17638. selector
  17639. };
  17640. };
  17641. const createContainer = (id) => {
  17642. const container = document.createElement("div");
  17643. container.id = id;
  17644. document.body.appendChild(container);
  17645. return container;
  17646. };
  17647. const usePopperContainer = () => {
  17648. const { id, selector } = usePopperContainerId();
  17649. onBeforeMount(() => {
  17650. if (!isClient)
  17651. return;
  17652. if (!cachedContainer && !document.body.querySelector(selector.value)) {
  17653. cachedContainer = createContainer(id.value);
  17654. }
  17655. });
  17656. return {
  17657. id,
  17658. selector
  17659. };
  17660. };
  17661. const useDelayedToggleProps = buildProps({
  17662. showAfter: {
  17663. type: Number,
  17664. default: 0
  17665. },
  17666. hideAfter: {
  17667. type: Number,
  17668. default: 200
  17669. },
  17670. autoClose: {
  17671. type: Number,
  17672. default: 0
  17673. }
  17674. });
  17675. const useDelayedToggle = ({
  17676. showAfter,
  17677. hideAfter,
  17678. autoClose,
  17679. open,
  17680. close
  17681. }) => {
  17682. const { registerTimeout } = useTimeout();
  17683. const {
  17684. registerTimeout: registerTimeoutForAutoClose,
  17685. cancelTimeout: cancelTimeoutForAutoClose
  17686. } = useTimeout();
  17687. const onOpen = (event2) => {
  17688. registerTimeout(() => {
  17689. open(event2);
  17690. const _autoClose = unref(autoClose);
  17691. if (isNumber(_autoClose) && _autoClose > 0) {
  17692. registerTimeoutForAutoClose(() => {
  17693. close(event2);
  17694. }, _autoClose);
  17695. }
  17696. }, unref(showAfter));
  17697. };
  17698. const onClose = (event2) => {
  17699. cancelTimeoutForAutoClose();
  17700. registerTimeout(() => {
  17701. close(event2);
  17702. }, unref(hideAfter));
  17703. };
  17704. return {
  17705. onOpen,
  17706. onClose
  17707. };
  17708. };
  17709. const FORWARD_REF_INJECTION_KEY = Symbol("elForwardRef");
  17710. const useForwardRef = (forwardRef) => {
  17711. const setForwardRef = (el) => {
  17712. forwardRef.value = el;
  17713. };
  17714. provide(FORWARD_REF_INJECTION_KEY, {
  17715. setForwardRef
  17716. });
  17717. };
  17718. const useForwardRefDirective = (setForwardRef) => {
  17719. return {
  17720. mounted(el) {
  17721. setForwardRef(el);
  17722. },
  17723. updated(el) {
  17724. setForwardRef(el);
  17725. },
  17726. unmounted() {
  17727. setForwardRef(null);
  17728. }
  17729. };
  17730. };
  17731. const zIndex = ref(0);
  17732. const defaultInitialZIndex = 2e3;
  17733. const zIndexContextKey = Symbol("zIndexContextKey");
  17734. const useZIndex = (zIndexOverrides) => {
  17735. const zIndexInjection = zIndexOverrides || inject(zIndexContextKey, void 0);
  17736. const initialZIndex = computed$1(() => {
  17737. const zIndexFromInjection = unref(zIndexInjection);
  17738. return isNumber(zIndexFromInjection) ? zIndexFromInjection : defaultInitialZIndex;
  17739. });
  17740. const currentZIndex = computed$1(() => initialZIndex.value + zIndex.value);
  17741. const nextZIndex = () => {
  17742. zIndex.value++;
  17743. return currentZIndex.value;
  17744. };
  17745. return {
  17746. initialZIndex,
  17747. currentZIndex,
  17748. nextZIndex
  17749. };
  17750. };
  17751. function useCursor(input) {
  17752. const selectionRef = ref();
  17753. function recordCursor() {
  17754. if (input.value == void 0)
  17755. return;
  17756. const { selectionStart, selectionEnd, value } = input.value;
  17757. if (selectionStart == null || selectionEnd == null)
  17758. return;
  17759. const beforeTxt = value.slice(0, Math.max(0, selectionStart));
  17760. const afterTxt = value.slice(Math.max(0, selectionEnd));
  17761. selectionRef.value = {
  17762. selectionStart,
  17763. selectionEnd,
  17764. value,
  17765. beforeTxt,
  17766. afterTxt
  17767. };
  17768. }
  17769. function setCursor() {
  17770. if (input.value == void 0 || selectionRef.value == void 0)
  17771. return;
  17772. const { value } = input.value;
  17773. const { beforeTxt, afterTxt, selectionStart } = selectionRef.value;
  17774. if (beforeTxt == void 0 || afterTxt == void 0 || selectionStart == void 0)
  17775. return;
  17776. let startPos = value.length;
  17777. if (value.endsWith(afterTxt)) {
  17778. startPos = value.length - afterTxt.length;
  17779. } else if (value.startsWith(beforeTxt)) {
  17780. startPos = beforeTxt.length;
  17781. } else {
  17782. const beforeLastChar = beforeTxt[selectionStart - 1];
  17783. const newIndex = value.indexOf(beforeLastChar, selectionStart - 1);
  17784. if (newIndex !== -1) {
  17785. startPos = newIndex + 1;
  17786. }
  17787. }
  17788. input.value.setSelectionRange(startPos, startPos);
  17789. }
  17790. return [recordCursor, setCursor];
  17791. }
  17792. const useSizeProp = buildProp({
  17793. type: String,
  17794. values: componentSizes,
  17795. required: false
  17796. });
  17797. const SIZE_INJECTION_KEY = Symbol("size");
  17798. const useGlobalSize = () => {
  17799. const injectedSize = inject(SIZE_INJECTION_KEY, {});
  17800. return computed$1(() => {
  17801. return unref(injectedSize.size) || "";
  17802. });
  17803. };
  17804. const configProviderContextKey = Symbol();
  17805. const globalConfig = ref();
  17806. function useGlobalConfig(key, defaultValue2 = void 0) {
  17807. const config = getCurrentInstance() ? inject(configProviderContextKey, globalConfig) : globalConfig;
  17808. if (key) {
  17809. return computed$1(() => {
  17810. var _a2, _b;
  17811. return (_b = (_a2 = config.value) == null ? void 0 : _a2[key]) != null ? _b : defaultValue2;
  17812. });
  17813. } else {
  17814. return config;
  17815. }
  17816. }
  17817. const provideGlobalConfig = (config, app, global2 = false) => {
  17818. var _a2;
  17819. const inSetup = !!getCurrentInstance();
  17820. const oldConfig = inSetup ? useGlobalConfig() : void 0;
  17821. const provideFn = (_a2 = app == null ? void 0 : app.provide) != null ? _a2 : inSetup ? provide : void 0;
  17822. if (!provideFn) {
  17823. return;
  17824. }
  17825. const context = computed$1(() => {
  17826. const cfg = unref(config);
  17827. if (!(oldConfig == null ? void 0 : oldConfig.value))
  17828. return cfg;
  17829. return mergeConfig(oldConfig.value, cfg);
  17830. });
  17831. provideFn(configProviderContextKey, context);
  17832. provideFn(localeContextKey, computed$1(() => context.value.locale));
  17833. provideFn(namespaceContextKey, computed$1(() => context.value.namespace));
  17834. provideFn(zIndexContextKey, computed$1(() => context.value.zIndex));
  17835. provideFn(SIZE_INJECTION_KEY, {
  17836. size: computed$1(() => context.value.size || "")
  17837. });
  17838. if (global2 || !globalConfig.value) {
  17839. globalConfig.value = context.value;
  17840. }
  17841. return context;
  17842. };
  17843. const mergeConfig = (a, b) => {
  17844. var _a2;
  17845. const keys3 = [.../* @__PURE__ */ new Set([...keysOf(a), ...keysOf(b)])];
  17846. const obj = {};
  17847. for (const key of keys3) {
  17848. obj[key] = (_a2 = b[key]) != null ? _a2 : a[key];
  17849. }
  17850. return obj;
  17851. };
  17852. const configProviderProps = buildProps({
  17853. a11y: {
  17854. type: Boolean,
  17855. default: true
  17856. },
  17857. locale: {
  17858. type: definePropType(Object)
  17859. },
  17860. size: useSizeProp,
  17861. button: {
  17862. type: definePropType(Object)
  17863. },
  17864. experimentalFeatures: {
  17865. type: definePropType(Object)
  17866. },
  17867. keyboardNavigation: {
  17868. type: Boolean,
  17869. default: true
  17870. },
  17871. message: {
  17872. type: definePropType(Object)
  17873. },
  17874. zIndex: Number,
  17875. namespace: {
  17876. type: String,
  17877. default: "el"
  17878. }
  17879. });
  17880. const messageConfig = {};
  17881. const ConfigProvider = defineComponent({
  17882. name: "ElConfigProvider",
  17883. props: configProviderProps,
  17884. setup(props, { slots }) {
  17885. watch(() => props.message, (val) => {
  17886. Object.assign(messageConfig, val != null ? val : {});
  17887. }, { immediate: true, deep: true });
  17888. const config = provideGlobalConfig(props);
  17889. return () => renderSlot(slots, "default", { config: config == null ? void 0 : config.value });
  17890. }
  17891. });
  17892. const ElConfigProvider = withInstall(ConfigProvider);
  17893. var _export_sfc$1 = (sfc, props) => {
  17894. const target = sfc.__vccOpts || sfc;
  17895. for (const [key, val] of props) {
  17896. target[key] = val;
  17897. }
  17898. return target;
  17899. };
  17900. const iconProps = buildProps({
  17901. size: {
  17902. type: definePropType([Number, String])
  17903. },
  17904. color: {
  17905. type: String
  17906. }
  17907. });
  17908. const __default__$o = defineComponent({
  17909. name: "ElIcon",
  17910. inheritAttrs: false
  17911. });
  17912. const _sfc_main$B = /* @__PURE__ */ defineComponent({
  17913. ...__default__$o,
  17914. props: iconProps,
  17915. setup(__props) {
  17916. const props = __props;
  17917. const ns = useNamespace("icon");
  17918. const style = computed$1(() => {
  17919. const { size, color: color2 } = props;
  17920. if (!size && !color2)
  17921. return {};
  17922. return {
  17923. fontSize: isUndefined(size) ? void 0 : addUnit(size),
  17924. "--color": color2
  17925. };
  17926. });
  17927. return (_ctx, _cache) => {
  17928. return openBlock(), createElementBlock("i", mergeProps({
  17929. class: unref(ns).b(),
  17930. style: unref(style)
  17931. }, _ctx.$attrs), [
  17932. renderSlot(_ctx.$slots, "default")
  17933. ], 16);
  17934. };
  17935. }
  17936. });
  17937. var Icon = /* @__PURE__ */ _export_sfc$1(_sfc_main$B, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/icon/src/icon.vue"]]);
  17938. const ElIcon = withInstall(Icon);
  17939. const formContextKey = Symbol("formContextKey");
  17940. const formItemContextKey = Symbol("formItemContextKey");
  17941. const useFormSize = (fallback, ignore = {}) => {
  17942. const emptyRef = ref(void 0);
  17943. const size = ignore.prop ? emptyRef : useProp("size");
  17944. const globalConfig2 = ignore.global ? emptyRef : useGlobalSize();
  17945. const form = ignore.form ? { size: void 0 } : inject(formContextKey, void 0);
  17946. const formItem = ignore.formItem ? { size: void 0 } : inject(formItemContextKey, void 0);
  17947. return computed$1(() => size.value || unref(fallback) || (formItem == null ? void 0 : formItem.size) || (form == null ? void 0 : form.size) || globalConfig2.value || "");
  17948. };
  17949. const useFormDisabled = (fallback) => {
  17950. const disabled = useProp("disabled");
  17951. const form = inject(formContextKey, void 0);
  17952. return computed$1(() => disabled.value || unref(fallback) || (form == null ? void 0 : form.disabled) || false);
  17953. };
  17954. const useFormItem = () => {
  17955. const form = inject(formContextKey, void 0);
  17956. const formItem = inject(formItemContextKey, void 0);
  17957. return {
  17958. form,
  17959. formItem
  17960. };
  17961. };
  17962. const useFormItemInputId = (props, {
  17963. formItemContext,
  17964. disableIdGeneration,
  17965. disableIdManagement
  17966. }) => {
  17967. if (!disableIdGeneration) {
  17968. disableIdGeneration = ref(false);
  17969. }
  17970. if (!disableIdManagement) {
  17971. disableIdManagement = ref(false);
  17972. }
  17973. const inputId = ref();
  17974. let idUnwatch = void 0;
  17975. const isLabeledByFormItem = computed$1(() => {
  17976. var _a2;
  17977. return !!(!props.label && formItemContext && formItemContext.inputIds && ((_a2 = formItemContext.inputIds) == null ? void 0 : _a2.length) <= 1);
  17978. });
  17979. onMounted(() => {
  17980. idUnwatch = watch([toRef(props, "id"), disableIdGeneration], ([id, disableIdGeneration2]) => {
  17981. const newId = id != null ? id : !disableIdGeneration2 ? useId().value : void 0;
  17982. if (newId !== inputId.value) {
  17983. if (formItemContext == null ? void 0 : formItemContext.removeInputId) {
  17984. inputId.value && formItemContext.removeInputId(inputId.value);
  17985. if (!(disableIdManagement == null ? void 0 : disableIdManagement.value) && !disableIdGeneration2 && newId) {
  17986. formItemContext.addInputId(newId);
  17987. }
  17988. }
  17989. inputId.value = newId;
  17990. }
  17991. }, { immediate: true });
  17992. });
  17993. onUnmounted(() => {
  17994. idUnwatch && idUnwatch();
  17995. if (formItemContext == null ? void 0 : formItemContext.removeInputId) {
  17996. inputId.value && formItemContext.removeInputId(inputId.value);
  17997. }
  17998. });
  17999. return {
  18000. isLabeledByFormItem,
  18001. inputId
  18002. };
  18003. };
  18004. let hiddenTextarea = void 0;
  18005. const HIDDEN_STYLE = `
  18006. height:0 !important;
  18007. visibility:hidden !important;
  18008. ${isFirefox() ? "" : "overflow:hidden !important;"}
  18009. position:absolute !important;
  18010. z-index:-1000 !important;
  18011. top:0 !important;
  18012. right:0 !important;
  18013. `;
  18014. const CONTEXT_STYLE = [
  18015. "letter-spacing",
  18016. "line-height",
  18017. "padding-top",
  18018. "padding-bottom",
  18019. "font-family",
  18020. "font-weight",
  18021. "font-size",
  18022. "text-rendering",
  18023. "text-transform",
  18024. "width",
  18025. "text-indent",
  18026. "padding-left",
  18027. "padding-right",
  18028. "border-width",
  18029. "box-sizing"
  18030. ];
  18031. function calculateNodeStyling(targetElement) {
  18032. const style = window.getComputedStyle(targetElement);
  18033. const boxSizing = style.getPropertyValue("box-sizing");
  18034. const paddingSize = Number.parseFloat(style.getPropertyValue("padding-bottom")) + Number.parseFloat(style.getPropertyValue("padding-top"));
  18035. const borderSize = Number.parseFloat(style.getPropertyValue("border-bottom-width")) + Number.parseFloat(style.getPropertyValue("border-top-width"));
  18036. const contextStyle = CONTEXT_STYLE.map((name) => `${name}:${style.getPropertyValue(name)}`).join(";");
  18037. return { contextStyle, paddingSize, borderSize, boxSizing };
  18038. }
  18039. function calcTextareaHeight(targetElement, minRows = 1, maxRows) {
  18040. var _a2;
  18041. if (!hiddenTextarea) {
  18042. hiddenTextarea = document.createElement("textarea");
  18043. document.body.appendChild(hiddenTextarea);
  18044. }
  18045. const { paddingSize, borderSize, boxSizing, contextStyle } = calculateNodeStyling(targetElement);
  18046. hiddenTextarea.setAttribute("style", `${contextStyle};${HIDDEN_STYLE}`);
  18047. hiddenTextarea.value = targetElement.value || targetElement.placeholder || "";
  18048. let height2 = hiddenTextarea.scrollHeight;
  18049. const result = {};
  18050. if (boxSizing === "border-box") {
  18051. height2 = height2 + borderSize;
  18052. } else if (boxSizing === "content-box") {
  18053. height2 = height2 - paddingSize;
  18054. }
  18055. hiddenTextarea.value = "";
  18056. const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  18057. if (isNumber(minRows)) {
  18058. let minHeight = singleRowHeight * minRows;
  18059. if (boxSizing === "border-box") {
  18060. minHeight = minHeight + paddingSize + borderSize;
  18061. }
  18062. height2 = Math.max(minHeight, height2);
  18063. result.minHeight = `${minHeight}px`;
  18064. }
  18065. if (isNumber(maxRows)) {
  18066. let maxHeight = singleRowHeight * maxRows;
  18067. if (boxSizing === "border-box") {
  18068. maxHeight = maxHeight + paddingSize + borderSize;
  18069. }
  18070. height2 = Math.min(maxHeight, height2);
  18071. }
  18072. result.height = `${height2}px`;
  18073. (_a2 = hiddenTextarea.parentNode) == null ? void 0 : _a2.removeChild(hiddenTextarea);
  18074. hiddenTextarea = void 0;
  18075. return result;
  18076. }
  18077. const inputProps = buildProps({
  18078. id: {
  18079. type: String,
  18080. default: void 0
  18081. },
  18082. size: useSizeProp,
  18083. disabled: Boolean,
  18084. modelValue: {
  18085. type: definePropType([
  18086. String,
  18087. Number,
  18088. Object
  18089. ]),
  18090. default: ""
  18091. },
  18092. type: {
  18093. type: String,
  18094. default: "text"
  18095. },
  18096. resize: {
  18097. type: String,
  18098. values: ["none", "both", "horizontal", "vertical"]
  18099. },
  18100. autosize: {
  18101. type: definePropType([Boolean, Object]),
  18102. default: false
  18103. },
  18104. autocomplete: {
  18105. type: String,
  18106. default: "off"
  18107. },
  18108. formatter: {
  18109. type: Function
  18110. },
  18111. parser: {
  18112. type: Function
  18113. },
  18114. placeholder: {
  18115. type: String
  18116. },
  18117. form: {
  18118. type: String
  18119. },
  18120. readonly: {
  18121. type: Boolean,
  18122. default: false
  18123. },
  18124. clearable: {
  18125. type: Boolean,
  18126. default: false
  18127. },
  18128. showPassword: {
  18129. type: Boolean,
  18130. default: false
  18131. },
  18132. showWordLimit: {
  18133. type: Boolean,
  18134. default: false
  18135. },
  18136. suffixIcon: {
  18137. type: iconPropType
  18138. },
  18139. prefixIcon: {
  18140. type: iconPropType
  18141. },
  18142. containerRole: {
  18143. type: String,
  18144. default: void 0
  18145. },
  18146. label: {
  18147. type: String,
  18148. default: void 0
  18149. },
  18150. tabindex: {
  18151. type: [String, Number],
  18152. default: 0
  18153. },
  18154. validateEvent: {
  18155. type: Boolean,
  18156. default: true
  18157. },
  18158. inputStyle: {
  18159. type: definePropType([Object, Array, String]),
  18160. default: () => mutable({})
  18161. }
  18162. });
  18163. const inputEmits = {
  18164. [UPDATE_MODEL_EVENT]: (value) => isString(value),
  18165. input: (value) => isString(value),
  18166. change: (value) => isString(value),
  18167. focus: (evt) => evt instanceof FocusEvent,
  18168. blur: (evt) => evt instanceof FocusEvent,
  18169. clear: () => true,
  18170. mouseleave: (evt) => evt instanceof MouseEvent,
  18171. mouseenter: (evt) => evt instanceof MouseEvent,
  18172. keydown: (evt) => evt instanceof Event,
  18173. compositionstart: (evt) => evt instanceof CompositionEvent,
  18174. compositionupdate: (evt) => evt instanceof CompositionEvent,
  18175. compositionend: (evt) => evt instanceof CompositionEvent
  18176. };
  18177. const _hoisted_1$g = ["role"];
  18178. const _hoisted_2$a = ["id", "type", "disabled", "formatter", "parser", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form"];
  18179. const _hoisted_3$6 = ["id", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form"];
  18180. const __default__$n = defineComponent({
  18181. name: "ElInput",
  18182. inheritAttrs: false
  18183. });
  18184. const _sfc_main$A = /* @__PURE__ */ defineComponent({
  18185. ...__default__$n,
  18186. props: inputProps,
  18187. emits: inputEmits,
  18188. setup(__props, { expose, emit }) {
  18189. const props = __props;
  18190. const rawAttrs = useAttrs$1();
  18191. const slots = useSlots();
  18192. const containerAttrs = computed$1(() => {
  18193. const comboBoxAttrs = {};
  18194. if (props.containerRole === "combobox") {
  18195. comboBoxAttrs["aria-haspopup"] = rawAttrs["aria-haspopup"];
  18196. comboBoxAttrs["aria-owns"] = rawAttrs["aria-owns"];
  18197. comboBoxAttrs["aria-expanded"] = rawAttrs["aria-expanded"];
  18198. }
  18199. return comboBoxAttrs;
  18200. });
  18201. const containerKls = computed$1(() => [
  18202. props.type === "textarea" ? nsTextarea.b() : nsInput.b(),
  18203. nsInput.m(inputSize.value),
  18204. nsInput.is("disabled", inputDisabled.value),
  18205. nsInput.is("exceed", inputExceed.value),
  18206. {
  18207. [nsInput.b("group")]: slots.prepend || slots.append,
  18208. [nsInput.bm("group", "append")]: slots.append,
  18209. [nsInput.bm("group", "prepend")]: slots.prepend,
  18210. [nsInput.m("prefix")]: slots.prefix || props.prefixIcon,
  18211. [nsInput.m("suffix")]: slots.suffix || props.suffixIcon || props.clearable || props.showPassword,
  18212. [nsInput.bm("suffix", "password-clear")]: showClear.value && showPwdVisible.value
  18213. },
  18214. rawAttrs.class
  18215. ]);
  18216. const wrapperKls = computed$1(() => [
  18217. nsInput.e("wrapper"),
  18218. nsInput.is("focus", focused.value)
  18219. ]);
  18220. const attrs = useAttrs({
  18221. excludeKeys: computed$1(() => {
  18222. return Object.keys(containerAttrs.value);
  18223. })
  18224. });
  18225. const { form, formItem } = useFormItem();
  18226. const { inputId } = useFormItemInputId(props, {
  18227. formItemContext: formItem
  18228. });
  18229. const inputSize = useFormSize();
  18230. const inputDisabled = useFormDisabled();
  18231. const nsInput = useNamespace("input");
  18232. const nsTextarea = useNamespace("textarea");
  18233. const input = shallowRef();
  18234. const textarea = shallowRef();
  18235. const focused = ref(false);
  18236. const hovering = ref(false);
  18237. const isComposing = ref(false);
  18238. const passwordVisible = ref(false);
  18239. const countStyle = ref();
  18240. const textareaCalcStyle = shallowRef(props.inputStyle);
  18241. const _ref = computed$1(() => input.value || textarea.value);
  18242. const needStatusIcon = computed$1(() => {
  18243. var _a2;
  18244. return (_a2 = form == null ? void 0 : form.statusIcon) != null ? _a2 : false;
  18245. });
  18246. const validateState = computed$1(() => (formItem == null ? void 0 : formItem.validateState) || "");
  18247. const validateIcon = computed$1(() => validateState.value && ValidateComponentsMap[validateState.value]);
  18248. const passwordIcon = computed$1(() => passwordVisible.value ? view_default : hide_default);
  18249. const containerStyle = computed$1(() => [
  18250. rawAttrs.style,
  18251. props.inputStyle
  18252. ]);
  18253. const textareaStyle = computed$1(() => [
  18254. props.inputStyle,
  18255. textareaCalcStyle.value,
  18256. { resize: props.resize }
  18257. ]);
  18258. const nativeInputValue = computed$1(() => isNil(props.modelValue) ? "" : String(props.modelValue));
  18259. const showClear = computed$1(() => props.clearable && !inputDisabled.value && !props.readonly && !!nativeInputValue.value && (focused.value || hovering.value));
  18260. const showPwdVisible = computed$1(() => props.showPassword && !inputDisabled.value && !props.readonly && !!nativeInputValue.value && (!!nativeInputValue.value || focused.value));
  18261. const isWordLimitVisible = computed$1(() => props.showWordLimit && !!attrs.value.maxlength && (props.type === "text" || props.type === "textarea") && !inputDisabled.value && !props.readonly && !props.showPassword);
  18262. const textLength = computed$1(() => nativeInputValue.value.length);
  18263. const inputExceed = computed$1(() => !!isWordLimitVisible.value && textLength.value > Number(attrs.value.maxlength));
  18264. const suffixVisible = computed$1(() => !!slots.suffix || !!props.suffixIcon || showClear.value || props.showPassword || isWordLimitVisible.value || !!validateState.value && needStatusIcon.value);
  18265. const [recordCursor, setCursor] = useCursor(input);
  18266. useResizeObserver(textarea, (entries) => {
  18267. onceInitSizeTextarea();
  18268. if (!isWordLimitVisible.value || props.resize !== "both")
  18269. return;
  18270. const entry = entries[0];
  18271. const { width: width2 } = entry.contentRect;
  18272. countStyle.value = {
  18273. right: `calc(100% - ${width2 + 15 + 6}px)`
  18274. };
  18275. });
  18276. const resizeTextarea = () => {
  18277. const { type: type2, autosize } = props;
  18278. if (!isClient || type2 !== "textarea" || !textarea.value)
  18279. return;
  18280. if (autosize) {
  18281. const minRows = isObject$5(autosize) ? autosize.minRows : void 0;
  18282. const maxRows = isObject$5(autosize) ? autosize.maxRows : void 0;
  18283. const textareaStyle2 = calcTextareaHeight(textarea.value, minRows, maxRows);
  18284. textareaCalcStyle.value = {
  18285. overflowY: "hidden",
  18286. ...textareaStyle2
  18287. };
  18288. nextTick(() => {
  18289. textarea.value.offsetHeight;
  18290. textareaCalcStyle.value = textareaStyle2;
  18291. });
  18292. } else {
  18293. textareaCalcStyle.value = {
  18294. minHeight: calcTextareaHeight(textarea.value).minHeight
  18295. };
  18296. }
  18297. };
  18298. const createOnceInitResize = (resizeTextarea2) => {
  18299. let isInit = false;
  18300. return () => {
  18301. var _a2;
  18302. if (isInit || !props.autosize)
  18303. return;
  18304. const isElHidden = ((_a2 = textarea.value) == null ? void 0 : _a2.offsetParent) === null;
  18305. if (!isElHidden) {
  18306. resizeTextarea2();
  18307. isInit = true;
  18308. }
  18309. };
  18310. };
  18311. const onceInitSizeTextarea = createOnceInitResize(resizeTextarea);
  18312. const setNativeInputValue = () => {
  18313. const input2 = _ref.value;
  18314. if (!input2 || input2.value === nativeInputValue.value)
  18315. return;
  18316. input2.value = nativeInputValue.value;
  18317. };
  18318. const handleInput = async (event2) => {
  18319. recordCursor();
  18320. let { value } = event2.target;
  18321. if (props.formatter) {
  18322. value = props.parser ? props.parser(value) : value;
  18323. value = props.formatter(value);
  18324. }
  18325. if (isComposing.value)
  18326. return;
  18327. if (value === nativeInputValue.value) {
  18328. setNativeInputValue();
  18329. return;
  18330. }
  18331. emit(UPDATE_MODEL_EVENT, value);
  18332. emit("input", value);
  18333. await nextTick();
  18334. setNativeInputValue();
  18335. setCursor();
  18336. };
  18337. const handleChange = (event2) => {
  18338. emit("change", event2.target.value);
  18339. };
  18340. const handleCompositionStart = (event2) => {
  18341. emit("compositionstart", event2);
  18342. isComposing.value = true;
  18343. };
  18344. const handleCompositionUpdate = (event2) => {
  18345. var _a2;
  18346. emit("compositionupdate", event2);
  18347. const text = (_a2 = event2.target) == null ? void 0 : _a2.value;
  18348. const lastCharacter = text[text.length - 1] || "";
  18349. isComposing.value = !isKorean(lastCharacter);
  18350. };
  18351. const handleCompositionEnd = (event2) => {
  18352. emit("compositionend", event2);
  18353. if (isComposing.value) {
  18354. isComposing.value = false;
  18355. handleInput(event2);
  18356. }
  18357. };
  18358. const handlePasswordVisible = () => {
  18359. passwordVisible.value = !passwordVisible.value;
  18360. focus();
  18361. };
  18362. const focus = async () => {
  18363. var _a2;
  18364. await nextTick();
  18365. (_a2 = _ref.value) == null ? void 0 : _a2.focus();
  18366. };
  18367. const blur = () => {
  18368. var _a2;
  18369. return (_a2 = _ref.value) == null ? void 0 : _a2.blur();
  18370. };
  18371. const handleFocus = (event2) => {
  18372. focused.value = true;
  18373. emit("focus", event2);
  18374. };
  18375. const handleBlur = (event2) => {
  18376. var _a2;
  18377. focused.value = false;
  18378. emit("blur", event2);
  18379. if (props.validateEvent) {
  18380. (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "blur").catch((err) => debugWarn());
  18381. }
  18382. };
  18383. const handleMouseLeave = (evt) => {
  18384. hovering.value = false;
  18385. emit("mouseleave", evt);
  18386. };
  18387. const handleMouseEnter = (evt) => {
  18388. hovering.value = true;
  18389. emit("mouseenter", evt);
  18390. };
  18391. const handleKeydown = (evt) => {
  18392. emit("keydown", evt);
  18393. };
  18394. const select = () => {
  18395. var _a2;
  18396. (_a2 = _ref.value) == null ? void 0 : _a2.select();
  18397. };
  18398. const clear = () => {
  18399. emit(UPDATE_MODEL_EVENT, "");
  18400. emit("change", "");
  18401. emit("clear");
  18402. emit("input", "");
  18403. };
  18404. watch(() => props.modelValue, () => {
  18405. var _a2;
  18406. nextTick(() => resizeTextarea());
  18407. if (props.validateEvent) {
  18408. (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "change").catch((err) => debugWarn());
  18409. }
  18410. });
  18411. watch(nativeInputValue, () => setNativeInputValue());
  18412. watch(() => props.type, async () => {
  18413. await nextTick();
  18414. setNativeInputValue();
  18415. resizeTextarea();
  18416. });
  18417. onMounted(() => {
  18418. if (!props.formatter && props.parser)
  18419. ;
  18420. setNativeInputValue();
  18421. nextTick(resizeTextarea);
  18422. });
  18423. expose({
  18424. input,
  18425. textarea,
  18426. ref: _ref,
  18427. textareaStyle,
  18428. autosize: toRef(props, "autosize"),
  18429. focus,
  18430. blur,
  18431. select,
  18432. clear,
  18433. resizeTextarea
  18434. });
  18435. return (_ctx, _cache) => {
  18436. return withDirectives((openBlock(), createElementBlock("div", mergeProps(unref(containerAttrs), {
  18437. class: unref(containerKls),
  18438. style: unref(containerStyle),
  18439. role: _ctx.containerRole,
  18440. onMouseenter: handleMouseEnter,
  18441. onMouseleave: handleMouseLeave
  18442. }), [
  18443. createCommentVNode(" input "),
  18444. _ctx.type !== "textarea" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
  18445. createCommentVNode(" prepend slot "),
  18446. _ctx.$slots.prepend ? (openBlock(), createElementBlock("div", {
  18447. key: 0,
  18448. class: normalizeClass(unref(nsInput).be("group", "prepend"))
  18449. }, [
  18450. renderSlot(_ctx.$slots, "prepend")
  18451. ], 2)) : createCommentVNode("v-if", true),
  18452. createElementVNode("div", {
  18453. class: normalizeClass(unref(wrapperKls))
  18454. }, [
  18455. createCommentVNode(" prefix slot "),
  18456. _ctx.$slots.prefix || _ctx.prefixIcon ? (openBlock(), createElementBlock("span", {
  18457. key: 0,
  18458. class: normalizeClass(unref(nsInput).e("prefix"))
  18459. }, [
  18460. createElementVNode("span", {
  18461. class: normalizeClass(unref(nsInput).e("prefix-inner")),
  18462. onClick: focus
  18463. }, [
  18464. renderSlot(_ctx.$slots, "prefix"),
  18465. _ctx.prefixIcon ? (openBlock(), createBlock(unref(ElIcon), {
  18466. key: 0,
  18467. class: normalizeClass(unref(nsInput).e("icon"))
  18468. }, {
  18469. default: withCtx(() => [
  18470. (openBlock(), createBlock(resolveDynamicComponent(_ctx.prefixIcon)))
  18471. ]),
  18472. _: 1
  18473. }, 8, ["class"])) : createCommentVNode("v-if", true)
  18474. ], 2)
  18475. ], 2)) : createCommentVNode("v-if", true),
  18476. createElementVNode("input", mergeProps({
  18477. id: unref(inputId),
  18478. ref_key: "input",
  18479. ref: input,
  18480. class: unref(nsInput).e("inner")
  18481. }, unref(attrs), {
  18482. type: _ctx.showPassword ? passwordVisible.value ? "text" : "password" : _ctx.type,
  18483. disabled: unref(inputDisabled),
  18484. formatter: _ctx.formatter,
  18485. parser: _ctx.parser,
  18486. readonly: _ctx.readonly,
  18487. autocomplete: _ctx.autocomplete,
  18488. tabindex: _ctx.tabindex,
  18489. "aria-label": _ctx.label,
  18490. placeholder: _ctx.placeholder,
  18491. style: _ctx.inputStyle,
  18492. form: props.form,
  18493. onCompositionstart: handleCompositionStart,
  18494. onCompositionupdate: handleCompositionUpdate,
  18495. onCompositionend: handleCompositionEnd,
  18496. onInput: handleInput,
  18497. onFocus: handleFocus,
  18498. onBlur: handleBlur,
  18499. onChange: handleChange,
  18500. onKeydown: handleKeydown
  18501. }), null, 16, _hoisted_2$a),
  18502. createCommentVNode(" suffix slot "),
  18503. unref(suffixVisible) ? (openBlock(), createElementBlock("span", {
  18504. key: 1,
  18505. class: normalizeClass(unref(nsInput).e("suffix"))
  18506. }, [
  18507. createElementVNode("span", {
  18508. class: normalizeClass(unref(nsInput).e("suffix-inner")),
  18509. onClick: focus
  18510. }, [
  18511. !unref(showClear) || !unref(showPwdVisible) || !unref(isWordLimitVisible) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
  18512. renderSlot(_ctx.$slots, "suffix"),
  18513. _ctx.suffixIcon ? (openBlock(), createBlock(unref(ElIcon), {
  18514. key: 0,
  18515. class: normalizeClass(unref(nsInput).e("icon"))
  18516. }, {
  18517. default: withCtx(() => [
  18518. (openBlock(), createBlock(resolveDynamicComponent(_ctx.suffixIcon)))
  18519. ]),
  18520. _: 1
  18521. }, 8, ["class"])) : createCommentVNode("v-if", true)
  18522. ], 64)) : createCommentVNode("v-if", true),
  18523. unref(showClear) ? (openBlock(), createBlock(unref(ElIcon), {
  18524. key: 1,
  18525. class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("clear")]),
  18526. onMousedown: withModifiers(unref(NOOP), ["prevent"]),
  18527. onClick: clear
  18528. }, {
  18529. default: withCtx(() => [
  18530. createVNode(unref(circle_close_default))
  18531. ]),
  18532. _: 1
  18533. }, 8, ["class", "onMousedown"])) : createCommentVNode("v-if", true),
  18534. unref(showPwdVisible) ? (openBlock(), createBlock(unref(ElIcon), {
  18535. key: 2,
  18536. class: normalizeClass([unref(nsInput).e("icon"), unref(nsInput).e("password")]),
  18537. onClick: handlePasswordVisible
  18538. }, {
  18539. default: withCtx(() => [
  18540. (openBlock(), createBlock(resolveDynamicComponent(unref(passwordIcon))))
  18541. ]),
  18542. _: 1
  18543. }, 8, ["class"])) : createCommentVNode("v-if", true),
  18544. unref(isWordLimitVisible) ? (openBlock(), createElementBlock("span", {
  18545. key: 3,
  18546. class: normalizeClass(unref(nsInput).e("count"))
  18547. }, [
  18548. createElementVNode("span", {
  18549. class: normalizeClass(unref(nsInput).e("count-inner"))
  18550. }, toDisplayString(unref(textLength)) + " / " + toDisplayString(unref(attrs).maxlength), 3)
  18551. ], 2)) : createCommentVNode("v-if", true),
  18552. unref(validateState) && unref(validateIcon) && unref(needStatusIcon) ? (openBlock(), createBlock(unref(ElIcon), {
  18553. key: 4,
  18554. class: normalizeClass([
  18555. unref(nsInput).e("icon"),
  18556. unref(nsInput).e("validateIcon"),
  18557. unref(nsInput).is("loading", unref(validateState) === "validating")
  18558. ])
  18559. }, {
  18560. default: withCtx(() => [
  18561. (openBlock(), createBlock(resolveDynamicComponent(unref(validateIcon))))
  18562. ]),
  18563. _: 1
  18564. }, 8, ["class"])) : createCommentVNode("v-if", true)
  18565. ], 2)
  18566. ], 2)) : createCommentVNode("v-if", true)
  18567. ], 2),
  18568. createCommentVNode(" append slot "),
  18569. _ctx.$slots.append ? (openBlock(), createElementBlock("div", {
  18570. key: 1,
  18571. class: normalizeClass(unref(nsInput).be("group", "append"))
  18572. }, [
  18573. renderSlot(_ctx.$slots, "append")
  18574. ], 2)) : createCommentVNode("v-if", true)
  18575. ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
  18576. createCommentVNode(" textarea "),
  18577. createElementVNode("textarea", mergeProps({
  18578. id: unref(inputId),
  18579. ref_key: "textarea",
  18580. ref: textarea,
  18581. class: unref(nsTextarea).e("inner")
  18582. }, unref(attrs), {
  18583. tabindex: _ctx.tabindex,
  18584. disabled: unref(inputDisabled),
  18585. readonly: _ctx.readonly,
  18586. autocomplete: _ctx.autocomplete,
  18587. style: unref(textareaStyle),
  18588. "aria-label": _ctx.label,
  18589. placeholder: _ctx.placeholder,
  18590. form: props.form,
  18591. onCompositionstart: handleCompositionStart,
  18592. onCompositionupdate: handleCompositionUpdate,
  18593. onCompositionend: handleCompositionEnd,
  18594. onInput: handleInput,
  18595. onFocus: handleFocus,
  18596. onBlur: handleBlur,
  18597. onChange: handleChange,
  18598. onKeydown: handleKeydown
  18599. }), null, 16, _hoisted_3$6),
  18600. unref(isWordLimitVisible) ? (openBlock(), createElementBlock("span", {
  18601. key: 0,
  18602. style: normalizeStyle(countStyle.value),
  18603. class: normalizeClass(unref(nsInput).e("count"))
  18604. }, toDisplayString(unref(textLength)) + " / " + toDisplayString(unref(attrs).maxlength), 7)) : createCommentVNode("v-if", true)
  18605. ], 64))
  18606. ], 16, _hoisted_1$g)), [
  18607. [vShow, _ctx.type !== "hidden"]
  18608. ]);
  18609. };
  18610. }
  18611. });
  18612. var Input = /* @__PURE__ */ _export_sfc$1(_sfc_main$A, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/input/src/input.vue"]]);
  18613. const ElInput = withInstall(Input);
  18614. const GAP = 4;
  18615. const BAR_MAP = {
  18616. vertical: {
  18617. offset: "offsetHeight",
  18618. scroll: "scrollTop",
  18619. scrollSize: "scrollHeight",
  18620. size: "height",
  18621. key: "vertical",
  18622. axis: "Y",
  18623. client: "clientY",
  18624. direction: "top"
  18625. },
  18626. horizontal: {
  18627. offset: "offsetWidth",
  18628. scroll: "scrollLeft",
  18629. scrollSize: "scrollWidth",
  18630. size: "width",
  18631. key: "horizontal",
  18632. axis: "X",
  18633. client: "clientX",
  18634. direction: "left"
  18635. }
  18636. };
  18637. const renderThumbStyle = ({
  18638. move,
  18639. size,
  18640. bar
  18641. }) => ({
  18642. [bar.size]: size,
  18643. transform: `translate${bar.axis}(${move}%)`
  18644. });
  18645. const scrollbarContextKey = Symbol("scrollbarContextKey");
  18646. const thumbProps = buildProps({
  18647. vertical: Boolean,
  18648. size: String,
  18649. move: Number,
  18650. ratio: {
  18651. type: Number,
  18652. required: true
  18653. },
  18654. always: Boolean
  18655. });
  18656. const COMPONENT_NAME$4 = "Thumb";
  18657. const _sfc_main$z = /* @__PURE__ */ defineComponent({
  18658. __name: "thumb",
  18659. props: thumbProps,
  18660. setup(__props) {
  18661. const props = __props;
  18662. const scrollbar = inject(scrollbarContextKey);
  18663. const ns = useNamespace("scrollbar");
  18664. if (!scrollbar)
  18665. throwError(COMPONENT_NAME$4, "can not inject scrollbar context");
  18666. const instance = ref();
  18667. const thumb = ref();
  18668. const thumbState = ref({});
  18669. const visible = ref(false);
  18670. let cursorDown = false;
  18671. let cursorLeave = false;
  18672. let originalOnSelectStart = isClient ? document.onselectstart : null;
  18673. const bar = computed$1(() => BAR_MAP[props.vertical ? "vertical" : "horizontal"]);
  18674. const thumbStyle = computed$1(() => renderThumbStyle({
  18675. size: props.size,
  18676. move: props.move,
  18677. bar: bar.value
  18678. }));
  18679. const offsetRatio = computed$1(() => instance.value[bar.value.offset] ** 2 / scrollbar.wrapElement[bar.value.scrollSize] / props.ratio / thumb.value[bar.value.offset]);
  18680. const clickThumbHandler = (e) => {
  18681. var _a2;
  18682. e.stopPropagation();
  18683. if (e.ctrlKey || [1, 2].includes(e.button))
  18684. return;
  18685. (_a2 = window.getSelection()) == null ? void 0 : _a2.removeAllRanges();
  18686. startDrag(e);
  18687. const el = e.currentTarget;
  18688. if (!el)
  18689. return;
  18690. thumbState.value[bar.value.axis] = el[bar.value.offset] - (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction]);
  18691. };
  18692. const clickTrackHandler = (e) => {
  18693. if (!thumb.value || !instance.value || !scrollbar.wrapElement)
  18694. return;
  18695. const offset = Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]);
  18696. const thumbHalf = thumb.value[bar.value.offset] / 2;
  18697. const thumbPositionPercentage = (offset - thumbHalf) * 100 * offsetRatio.value / instance.value[bar.value.offset];
  18698. scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
  18699. };
  18700. const startDrag = (e) => {
  18701. e.stopImmediatePropagation();
  18702. cursorDown = true;
  18703. document.addEventListener("mousemove", mouseMoveDocumentHandler);
  18704. document.addEventListener("mouseup", mouseUpDocumentHandler);
  18705. originalOnSelectStart = document.onselectstart;
  18706. document.onselectstart = () => false;
  18707. };
  18708. const mouseMoveDocumentHandler = (e) => {
  18709. if (!instance.value || !thumb.value)
  18710. return;
  18711. if (cursorDown === false)
  18712. return;
  18713. const prevPage = thumbState.value[bar.value.axis];
  18714. if (!prevPage)
  18715. return;
  18716. const offset = (instance.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1;
  18717. const thumbClickPosition = thumb.value[bar.value.offset] - prevPage;
  18718. const thumbPositionPercentage = (offset - thumbClickPosition) * 100 * offsetRatio.value / instance.value[bar.value.offset];
  18719. scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
  18720. };
  18721. const mouseUpDocumentHandler = () => {
  18722. cursorDown = false;
  18723. thumbState.value[bar.value.axis] = 0;
  18724. document.removeEventListener("mousemove", mouseMoveDocumentHandler);
  18725. document.removeEventListener("mouseup", mouseUpDocumentHandler);
  18726. restoreOnselectstart();
  18727. if (cursorLeave)
  18728. visible.value = false;
  18729. };
  18730. const mouseMoveScrollbarHandler = () => {
  18731. cursorLeave = false;
  18732. visible.value = !!props.size;
  18733. };
  18734. const mouseLeaveScrollbarHandler = () => {
  18735. cursorLeave = true;
  18736. visible.value = cursorDown;
  18737. };
  18738. onBeforeUnmount(() => {
  18739. restoreOnselectstart();
  18740. document.removeEventListener("mouseup", mouseUpDocumentHandler);
  18741. });
  18742. const restoreOnselectstart = () => {
  18743. if (document.onselectstart !== originalOnSelectStart)
  18744. document.onselectstart = originalOnSelectStart;
  18745. };
  18746. useEventListener(toRef(scrollbar, "scrollbarElement"), "mousemove", mouseMoveScrollbarHandler);
  18747. useEventListener(toRef(scrollbar, "scrollbarElement"), "mouseleave", mouseLeaveScrollbarHandler);
  18748. return (_ctx, _cache) => {
  18749. return openBlock(), createBlock(Transition, {
  18750. name: unref(ns).b("fade"),
  18751. persisted: ""
  18752. }, {
  18753. default: withCtx(() => [
  18754. withDirectives(createElementVNode("div", {
  18755. ref_key: "instance",
  18756. ref: instance,
  18757. class: normalizeClass([unref(ns).e("bar"), unref(ns).is(unref(bar).key)]),
  18758. onMousedown: clickTrackHandler
  18759. }, [
  18760. createElementVNode("div", {
  18761. ref_key: "thumb",
  18762. ref: thumb,
  18763. class: normalizeClass(unref(ns).e("thumb")),
  18764. style: normalizeStyle(unref(thumbStyle)),
  18765. onMousedown: clickThumbHandler
  18766. }, null, 38)
  18767. ], 34), [
  18768. [vShow, _ctx.always || visible.value]
  18769. ])
  18770. ]),
  18771. _: 1
  18772. }, 8, ["name"]);
  18773. };
  18774. }
  18775. });
  18776. var Thumb = /* @__PURE__ */ _export_sfc$1(_sfc_main$z, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/thumb.vue"]]);
  18777. const barProps = buildProps({
  18778. always: {
  18779. type: Boolean,
  18780. default: true
  18781. },
  18782. width: String,
  18783. height: String,
  18784. ratioX: {
  18785. type: Number,
  18786. default: 1
  18787. },
  18788. ratioY: {
  18789. type: Number,
  18790. default: 1
  18791. }
  18792. });
  18793. const _sfc_main$y = /* @__PURE__ */ defineComponent({
  18794. __name: "bar",
  18795. props: barProps,
  18796. setup(__props, { expose }) {
  18797. const props = __props;
  18798. const moveX = ref(0);
  18799. const moveY = ref(0);
  18800. const handleScroll = (wrap) => {
  18801. if (wrap) {
  18802. const offsetHeight = wrap.offsetHeight - GAP;
  18803. const offsetWidth = wrap.offsetWidth - GAP;
  18804. moveY.value = wrap.scrollTop * 100 / offsetHeight * props.ratioY;
  18805. moveX.value = wrap.scrollLeft * 100 / offsetWidth * props.ratioX;
  18806. }
  18807. };
  18808. expose({
  18809. handleScroll
  18810. });
  18811. return (_ctx, _cache) => {
  18812. return openBlock(), createElementBlock(Fragment, null, [
  18813. createVNode(Thumb, {
  18814. move: moveX.value,
  18815. ratio: _ctx.ratioX,
  18816. size: _ctx.width,
  18817. always: _ctx.always
  18818. }, null, 8, ["move", "ratio", "size", "always"]),
  18819. createVNode(Thumb, {
  18820. move: moveY.value,
  18821. ratio: _ctx.ratioY,
  18822. size: _ctx.height,
  18823. vertical: "",
  18824. always: _ctx.always
  18825. }, null, 8, ["move", "ratio", "size", "always"])
  18826. ], 64);
  18827. };
  18828. }
  18829. });
  18830. var Bar = /* @__PURE__ */ _export_sfc$1(_sfc_main$y, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/bar.vue"]]);
  18831. const scrollbarProps = buildProps({
  18832. height: {
  18833. type: [String, Number],
  18834. default: ""
  18835. },
  18836. maxHeight: {
  18837. type: [String, Number],
  18838. default: ""
  18839. },
  18840. native: {
  18841. type: Boolean,
  18842. default: false
  18843. },
  18844. wrapStyle: {
  18845. type: definePropType([String, Object, Array]),
  18846. default: ""
  18847. },
  18848. wrapClass: {
  18849. type: [String, Array],
  18850. default: ""
  18851. },
  18852. viewClass: {
  18853. type: [String, Array],
  18854. default: ""
  18855. },
  18856. viewStyle: {
  18857. type: [String, Array, Object],
  18858. default: ""
  18859. },
  18860. noresize: Boolean,
  18861. tag: {
  18862. type: String,
  18863. default: "div"
  18864. },
  18865. always: Boolean,
  18866. minSize: {
  18867. type: Number,
  18868. default: 20
  18869. }
  18870. });
  18871. const scrollbarEmits = {
  18872. scroll: ({
  18873. scrollTop,
  18874. scrollLeft
  18875. }) => [scrollTop, scrollLeft].every(isNumber)
  18876. };
  18877. const COMPONENT_NAME$3 = "ElScrollbar";
  18878. const __default__$m = defineComponent({
  18879. name: COMPONENT_NAME$3
  18880. });
  18881. const _sfc_main$x = /* @__PURE__ */ defineComponent({
  18882. ...__default__$m,
  18883. props: scrollbarProps,
  18884. emits: scrollbarEmits,
  18885. setup(__props, { expose, emit }) {
  18886. const props = __props;
  18887. const ns = useNamespace("scrollbar");
  18888. let stopResizeObserver = void 0;
  18889. let stopResizeListener = void 0;
  18890. const scrollbarRef = ref();
  18891. const wrapRef = ref();
  18892. const resizeRef = ref();
  18893. const sizeWidth = ref("0");
  18894. const sizeHeight = ref("0");
  18895. const barRef = ref();
  18896. const ratioY = ref(1);
  18897. const ratioX = ref(1);
  18898. const style = computed$1(() => {
  18899. const style2 = {};
  18900. if (props.height)
  18901. style2.height = addUnit(props.height);
  18902. if (props.maxHeight)
  18903. style2.maxHeight = addUnit(props.maxHeight);
  18904. return [props.wrapStyle, style2];
  18905. });
  18906. const wrapKls = computed$1(() => {
  18907. return [
  18908. props.wrapClass,
  18909. ns.e("wrap"),
  18910. { [ns.em("wrap", "hidden-default")]: !props.native }
  18911. ];
  18912. });
  18913. const resizeKls = computed$1(() => {
  18914. return [ns.e("view"), props.viewClass];
  18915. });
  18916. const handleScroll = () => {
  18917. var _a2;
  18918. if (wrapRef.value) {
  18919. (_a2 = barRef.value) == null ? void 0 : _a2.handleScroll(wrapRef.value);
  18920. emit("scroll", {
  18921. scrollTop: wrapRef.value.scrollTop,
  18922. scrollLeft: wrapRef.value.scrollLeft
  18923. });
  18924. }
  18925. };
  18926. function scrollTo(arg1, arg2) {
  18927. if (isObject$5(arg1)) {
  18928. wrapRef.value.scrollTo(arg1);
  18929. } else if (isNumber(arg1) && isNumber(arg2)) {
  18930. wrapRef.value.scrollTo(arg1, arg2);
  18931. }
  18932. }
  18933. const setScrollTop = (value) => {
  18934. if (!isNumber(value)) {
  18935. return;
  18936. }
  18937. wrapRef.value.scrollTop = value;
  18938. };
  18939. const setScrollLeft = (value) => {
  18940. if (!isNumber(value)) {
  18941. return;
  18942. }
  18943. wrapRef.value.scrollLeft = value;
  18944. };
  18945. const update = () => {
  18946. if (!wrapRef.value)
  18947. return;
  18948. const offsetHeight = wrapRef.value.offsetHeight - GAP;
  18949. const offsetWidth = wrapRef.value.offsetWidth - GAP;
  18950. const originalHeight = offsetHeight ** 2 / wrapRef.value.scrollHeight;
  18951. const originalWidth = offsetWidth ** 2 / wrapRef.value.scrollWidth;
  18952. const height2 = Math.max(originalHeight, props.minSize);
  18953. const width2 = Math.max(originalWidth, props.minSize);
  18954. ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height2 / (offsetHeight - height2));
  18955. ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width2 / (offsetWidth - width2));
  18956. sizeHeight.value = height2 + GAP < offsetHeight ? `${height2}px` : "";
  18957. sizeWidth.value = width2 + GAP < offsetWidth ? `${width2}px` : "";
  18958. };
  18959. watch(() => props.noresize, (noresize) => {
  18960. if (noresize) {
  18961. stopResizeObserver == null ? void 0 : stopResizeObserver();
  18962. stopResizeListener == null ? void 0 : stopResizeListener();
  18963. } else {
  18964. ({ stop: stopResizeObserver } = useResizeObserver(resizeRef, update));
  18965. stopResizeListener = useEventListener("resize", update);
  18966. }
  18967. }, { immediate: true });
  18968. watch(() => [props.maxHeight, props.height], () => {
  18969. if (!props.native)
  18970. nextTick(() => {
  18971. var _a2;
  18972. update();
  18973. if (wrapRef.value) {
  18974. (_a2 = barRef.value) == null ? void 0 : _a2.handleScroll(wrapRef.value);
  18975. }
  18976. });
  18977. });
  18978. provide(scrollbarContextKey, reactive({
  18979. scrollbarElement: scrollbarRef,
  18980. wrapElement: wrapRef
  18981. }));
  18982. onMounted(() => {
  18983. if (!props.native)
  18984. nextTick(() => {
  18985. update();
  18986. });
  18987. });
  18988. onUpdated(() => update());
  18989. expose({
  18990. wrapRef,
  18991. update,
  18992. scrollTo,
  18993. setScrollTop,
  18994. setScrollLeft,
  18995. handleScroll
  18996. });
  18997. return (_ctx, _cache) => {
  18998. return openBlock(), createElementBlock("div", {
  18999. ref_key: "scrollbarRef",
  19000. ref: scrollbarRef,
  19001. class: normalizeClass(unref(ns).b())
  19002. }, [
  19003. createElementVNode("div", {
  19004. ref_key: "wrapRef",
  19005. ref: wrapRef,
  19006. class: normalizeClass(unref(wrapKls)),
  19007. style: normalizeStyle(unref(style)),
  19008. onScroll: handleScroll
  19009. }, [
  19010. (openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
  19011. ref_key: "resizeRef",
  19012. ref: resizeRef,
  19013. class: normalizeClass(unref(resizeKls)),
  19014. style: normalizeStyle(_ctx.viewStyle)
  19015. }, {
  19016. default: withCtx(() => [
  19017. renderSlot(_ctx.$slots, "default")
  19018. ]),
  19019. _: 3
  19020. }, 8, ["class", "style"]))
  19021. ], 38),
  19022. !_ctx.native ? (openBlock(), createBlock(Bar, {
  19023. key: 0,
  19024. ref_key: "barRef",
  19025. ref: barRef,
  19026. height: sizeHeight.value,
  19027. width: sizeWidth.value,
  19028. always: _ctx.always,
  19029. "ratio-x": ratioX.value,
  19030. "ratio-y": ratioY.value
  19031. }, null, 8, ["height", "width", "always", "ratio-x", "ratio-y"])) : createCommentVNode("v-if", true)
  19032. ], 2);
  19033. };
  19034. }
  19035. });
  19036. var Scrollbar = /* @__PURE__ */ _export_sfc$1(_sfc_main$x, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/scrollbar/src/scrollbar.vue"]]);
  19037. const ElScrollbar = withInstall(Scrollbar);
  19038. const POPPER_INJECTION_KEY = Symbol("popper");
  19039. const POPPER_CONTENT_INJECTION_KEY = Symbol("popperContent");
  19040. const roleTypes = [
  19041. "dialog",
  19042. "grid",
  19043. "group",
  19044. "listbox",
  19045. "menu",
  19046. "navigation",
  19047. "tooltip",
  19048. "tree"
  19049. ];
  19050. const popperProps = buildProps({
  19051. role: {
  19052. type: String,
  19053. values: roleTypes,
  19054. default: "tooltip"
  19055. }
  19056. });
  19057. const __default__$l = defineComponent({
  19058. name: "ElPopper",
  19059. inheritAttrs: false
  19060. });
  19061. const _sfc_main$w = /* @__PURE__ */ defineComponent({
  19062. ...__default__$l,
  19063. props: popperProps,
  19064. setup(__props, { expose }) {
  19065. const props = __props;
  19066. const triggerRef2 = ref();
  19067. const popperInstanceRef = ref();
  19068. const contentRef = ref();
  19069. const referenceRef = ref();
  19070. const role = computed$1(() => props.role);
  19071. const popperProvides = {
  19072. triggerRef: triggerRef2,
  19073. popperInstanceRef,
  19074. contentRef,
  19075. referenceRef,
  19076. role
  19077. };
  19078. expose(popperProvides);
  19079. provide(POPPER_INJECTION_KEY, popperProvides);
  19080. return (_ctx, _cache) => {
  19081. return renderSlot(_ctx.$slots, "default");
  19082. };
  19083. }
  19084. });
  19085. var Popper = /* @__PURE__ */ _export_sfc$1(_sfc_main$w, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/popper/src/popper.vue"]]);
  19086. const popperArrowProps = buildProps({
  19087. arrowOffset: {
  19088. type: Number,
  19089. default: 5
  19090. }
  19091. });
  19092. const __default__$k = defineComponent({
  19093. name: "ElPopperArrow",
  19094. inheritAttrs: false
  19095. });
  19096. const _sfc_main$v = /* @__PURE__ */ defineComponent({
  19097. ...__default__$k,
  19098. props: popperArrowProps,
  19099. setup(__props, { expose }) {
  19100. const props = __props;
  19101. const ns = useNamespace("popper");
  19102. const { arrowOffset, arrowRef, arrowStyle } = inject(POPPER_CONTENT_INJECTION_KEY, void 0);
  19103. watch(() => props.arrowOffset, (val) => {
  19104. arrowOffset.value = val;
  19105. });
  19106. onBeforeUnmount(() => {
  19107. arrowRef.value = void 0;
  19108. });
  19109. expose({
  19110. arrowRef
  19111. });
  19112. return (_ctx, _cache) => {
  19113. return openBlock(), createElementBlock("span", {
  19114. ref_key: "arrowRef",
  19115. ref: arrowRef,
  19116. class: normalizeClass(unref(ns).e("arrow")),
  19117. style: normalizeStyle(unref(arrowStyle)),
  19118. "data-popper-arrow": ""
  19119. }, null, 6);
  19120. };
  19121. }
  19122. });
  19123. var ElPopperArrow = /* @__PURE__ */ _export_sfc$1(_sfc_main$v, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/popper/src/arrow.vue"]]);
  19124. const NAME = "ElOnlyChild";
  19125. const OnlyChild = defineComponent({
  19126. name: NAME,
  19127. setup(_, {
  19128. slots,
  19129. attrs
  19130. }) {
  19131. var _a2;
  19132. const forwardRefInjection = inject(FORWARD_REF_INJECTION_KEY);
  19133. const forwardRefDirective = useForwardRefDirective((_a2 = forwardRefInjection == null ? void 0 : forwardRefInjection.setForwardRef) != null ? _a2 : NOOP);
  19134. return () => {
  19135. var _a22;
  19136. const defaultSlot = (_a22 = slots.default) == null ? void 0 : _a22.call(slots, attrs);
  19137. if (!defaultSlot)
  19138. return null;
  19139. if (defaultSlot.length > 1) {
  19140. return null;
  19141. }
  19142. const firstLegitNode = findFirstLegitChild(defaultSlot);
  19143. if (!firstLegitNode) {
  19144. return null;
  19145. }
  19146. return withDirectives(cloneVNode(firstLegitNode, attrs), [[forwardRefDirective]]);
  19147. };
  19148. }
  19149. });
  19150. function findFirstLegitChild(node) {
  19151. if (!node)
  19152. return null;
  19153. const children = node;
  19154. for (const child of children) {
  19155. if (isObject$5(child)) {
  19156. switch (child.type) {
  19157. case Comment$1:
  19158. continue;
  19159. case Text$1:
  19160. case "svg":
  19161. return wrapTextContent(child);
  19162. case Fragment:
  19163. return findFirstLegitChild(child.children);
  19164. default:
  19165. return child;
  19166. }
  19167. }
  19168. return wrapTextContent(child);
  19169. }
  19170. return null;
  19171. }
  19172. function wrapTextContent(s) {
  19173. const ns = useNamespace("only-child");
  19174. return createVNode("span", {
  19175. "class": ns.e("content")
  19176. }, [s]);
  19177. }
  19178. const popperTriggerProps = buildProps({
  19179. virtualRef: {
  19180. type: definePropType(Object)
  19181. },
  19182. virtualTriggering: Boolean,
  19183. onMouseenter: {
  19184. type: definePropType(Function)
  19185. },
  19186. onMouseleave: {
  19187. type: definePropType(Function)
  19188. },
  19189. onClick: {
  19190. type: definePropType(Function)
  19191. },
  19192. onKeydown: {
  19193. type: definePropType(Function)
  19194. },
  19195. onFocus: {
  19196. type: definePropType(Function)
  19197. },
  19198. onBlur: {
  19199. type: definePropType(Function)
  19200. },
  19201. onContextmenu: {
  19202. type: definePropType(Function)
  19203. },
  19204. id: String,
  19205. open: Boolean
  19206. });
  19207. const __default__$j = defineComponent({
  19208. name: "ElPopperTrigger",
  19209. inheritAttrs: false
  19210. });
  19211. const _sfc_main$u = /* @__PURE__ */ defineComponent({
  19212. ...__default__$j,
  19213. props: popperTriggerProps,
  19214. setup(__props, { expose }) {
  19215. const props = __props;
  19216. const { role, triggerRef: triggerRef2 } = inject(POPPER_INJECTION_KEY, void 0);
  19217. useForwardRef(triggerRef2);
  19218. const ariaControls = computed$1(() => {
  19219. return ariaHaspopup.value ? props.id : void 0;
  19220. });
  19221. const ariaDescribedby = computed$1(() => {
  19222. if (role && role.value === "tooltip") {
  19223. return props.open && props.id ? props.id : void 0;
  19224. }
  19225. return void 0;
  19226. });
  19227. const ariaHaspopup = computed$1(() => {
  19228. if (role && role.value !== "tooltip") {
  19229. return role.value;
  19230. }
  19231. return void 0;
  19232. });
  19233. const ariaExpanded = computed$1(() => {
  19234. return ariaHaspopup.value ? `${props.open}` : void 0;
  19235. });
  19236. let virtualTriggerAriaStopWatch = void 0;
  19237. onMounted(() => {
  19238. watch(() => props.virtualRef, (virtualEl) => {
  19239. if (virtualEl) {
  19240. triggerRef2.value = unrefElement(virtualEl);
  19241. }
  19242. }, {
  19243. immediate: true
  19244. });
  19245. watch(triggerRef2, (el, prevEl) => {
  19246. virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
  19247. virtualTriggerAriaStopWatch = void 0;
  19248. if (isElement(el)) {
  19249. [
  19250. "onMouseenter",
  19251. "onMouseleave",
  19252. "onClick",
  19253. "onKeydown",
  19254. "onFocus",
  19255. "onBlur",
  19256. "onContextmenu"
  19257. ].forEach((eventName) => {
  19258. var _a2;
  19259. const handler = props[eventName];
  19260. if (handler) {
  19261. el.addEventListener(eventName.slice(2).toLowerCase(), handler);
  19262. (_a2 = prevEl == null ? void 0 : prevEl.removeEventListener) == null ? void 0 : _a2.call(prevEl, eventName.slice(2).toLowerCase(), handler);
  19263. }
  19264. });
  19265. virtualTriggerAriaStopWatch = watch([ariaControls, ariaDescribedby, ariaHaspopup, ariaExpanded], (watches) => {
  19266. [
  19267. "aria-controls",
  19268. "aria-describedby",
  19269. "aria-haspopup",
  19270. "aria-expanded"
  19271. ].forEach((key, idx) => {
  19272. isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
  19273. });
  19274. }, { immediate: true });
  19275. }
  19276. if (isElement(prevEl)) {
  19277. [
  19278. "aria-controls",
  19279. "aria-describedby",
  19280. "aria-haspopup",
  19281. "aria-expanded"
  19282. ].forEach((key) => prevEl.removeAttribute(key));
  19283. }
  19284. }, {
  19285. immediate: true
  19286. });
  19287. });
  19288. onBeforeUnmount(() => {
  19289. virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
  19290. virtualTriggerAriaStopWatch = void 0;
  19291. });
  19292. expose({
  19293. triggerRef: triggerRef2
  19294. });
  19295. return (_ctx, _cache) => {
  19296. return !_ctx.virtualTriggering ? (openBlock(), createBlock(unref(OnlyChild), mergeProps({ key: 0 }, _ctx.$attrs, {
  19297. "aria-controls": unref(ariaControls),
  19298. "aria-describedby": unref(ariaDescribedby),
  19299. "aria-expanded": unref(ariaExpanded),
  19300. "aria-haspopup": unref(ariaHaspopup)
  19301. }), {
  19302. default: withCtx(() => [
  19303. renderSlot(_ctx.$slots, "default")
  19304. ]),
  19305. _: 3
  19306. }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])) : createCommentVNode("v-if", true);
  19307. };
  19308. }
  19309. });
  19310. var ElPopperTrigger = /* @__PURE__ */ _export_sfc$1(_sfc_main$u, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/popper/src/trigger.vue"]]);
  19311. const FOCUS_AFTER_TRAPPED = "focus-trap.focus-after-trapped";
  19312. const FOCUS_AFTER_RELEASED = "focus-trap.focus-after-released";
  19313. const FOCUSOUT_PREVENTED = "focus-trap.focusout-prevented";
  19314. const FOCUS_AFTER_TRAPPED_OPTS = {
  19315. cancelable: true,
  19316. bubbles: false
  19317. };
  19318. const FOCUSOUT_PREVENTED_OPTS = {
  19319. cancelable: true,
  19320. bubbles: false
  19321. };
  19322. const ON_TRAP_FOCUS_EVT = "focusAfterTrapped";
  19323. const ON_RELEASE_FOCUS_EVT = "focusAfterReleased";
  19324. const FOCUS_TRAP_INJECTION_KEY = Symbol("elFocusTrap");
  19325. const focusReason = ref();
  19326. const lastUserFocusTimestamp = ref(0);
  19327. const lastAutomatedFocusTimestamp = ref(0);
  19328. let focusReasonUserCount = 0;
  19329. const obtainAllFocusableElements = (element) => {
  19330. const nodes = [];
  19331. const walker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT, {
  19332. acceptNode: (node) => {
  19333. const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
  19334. if (node.disabled || node.hidden || isHiddenInput)
  19335. return NodeFilter.FILTER_SKIP;
  19336. return node.tabIndex >= 0 || node === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
  19337. }
  19338. });
  19339. while (walker.nextNode())
  19340. nodes.push(walker.currentNode);
  19341. return nodes;
  19342. };
  19343. const getVisibleElement = (elements, container) => {
  19344. for (const element of elements) {
  19345. if (!isHidden(element, container))
  19346. return element;
  19347. }
  19348. };
  19349. const isHidden = (element, container) => {
  19350. if (getComputedStyle(element).visibility === "hidden")
  19351. return true;
  19352. while (element) {
  19353. if (container && element === container)
  19354. return false;
  19355. if (getComputedStyle(element).display === "none")
  19356. return true;
  19357. element = element.parentElement;
  19358. }
  19359. return false;
  19360. };
  19361. const getEdges = (container) => {
  19362. const focusable = obtainAllFocusableElements(container);
  19363. const first = getVisibleElement(focusable, container);
  19364. const last = getVisibleElement(focusable.reverse(), container);
  19365. return [first, last];
  19366. };
  19367. const isSelectable = (element) => {
  19368. return element instanceof HTMLInputElement && "select" in element;
  19369. };
  19370. const tryFocus = (element, shouldSelect) => {
  19371. if (element && element.focus) {
  19372. const prevFocusedElement = document.activeElement;
  19373. element.focus({ preventScroll: true });
  19374. lastAutomatedFocusTimestamp.value = window.performance.now();
  19375. if (element !== prevFocusedElement && isSelectable(element) && shouldSelect) {
  19376. element.select();
  19377. }
  19378. }
  19379. };
  19380. function removeFromStack(list, item) {
  19381. const copy2 = [...list];
  19382. const idx = list.indexOf(item);
  19383. if (idx !== -1) {
  19384. copy2.splice(idx, 1);
  19385. }
  19386. return copy2;
  19387. }
  19388. const createFocusableStack = () => {
  19389. let stack = [];
  19390. const push = (layer) => {
  19391. const currentLayer = stack[0];
  19392. if (currentLayer && layer !== currentLayer) {
  19393. currentLayer.pause();
  19394. }
  19395. stack = removeFromStack(stack, layer);
  19396. stack.unshift(layer);
  19397. };
  19398. const remove2 = (layer) => {
  19399. var _a2, _b;
  19400. stack = removeFromStack(stack, layer);
  19401. (_b = (_a2 = stack[0]) == null ? void 0 : _a2.resume) == null ? void 0 : _b.call(_a2);
  19402. };
  19403. return {
  19404. push,
  19405. remove: remove2
  19406. };
  19407. };
  19408. const focusFirstDescendant = (elements, shouldSelect = false) => {
  19409. const prevFocusedElement = document.activeElement;
  19410. for (const element of elements) {
  19411. tryFocus(element, shouldSelect);
  19412. if (document.activeElement !== prevFocusedElement)
  19413. return;
  19414. }
  19415. };
  19416. const focusableStack = createFocusableStack();
  19417. const isFocusCausedByUserEvent = () => {
  19418. return lastUserFocusTimestamp.value > lastAutomatedFocusTimestamp.value;
  19419. };
  19420. const notifyFocusReasonPointer = () => {
  19421. focusReason.value = "pointer";
  19422. lastUserFocusTimestamp.value = window.performance.now();
  19423. };
  19424. const notifyFocusReasonKeydown = () => {
  19425. focusReason.value = "keyboard";
  19426. lastUserFocusTimestamp.value = window.performance.now();
  19427. };
  19428. const useFocusReason = () => {
  19429. onMounted(() => {
  19430. if (focusReasonUserCount === 0) {
  19431. document.addEventListener("mousedown", notifyFocusReasonPointer);
  19432. document.addEventListener("touchstart", notifyFocusReasonPointer);
  19433. document.addEventListener("keydown", notifyFocusReasonKeydown);
  19434. }
  19435. focusReasonUserCount++;
  19436. });
  19437. onBeforeUnmount(() => {
  19438. focusReasonUserCount--;
  19439. if (focusReasonUserCount <= 0) {
  19440. document.removeEventListener("mousedown", notifyFocusReasonPointer);
  19441. document.removeEventListener("touchstart", notifyFocusReasonPointer);
  19442. document.removeEventListener("keydown", notifyFocusReasonKeydown);
  19443. }
  19444. });
  19445. return {
  19446. focusReason,
  19447. lastUserFocusTimestamp,
  19448. lastAutomatedFocusTimestamp
  19449. };
  19450. };
  19451. const createFocusOutPreventedEvent = (detail) => {
  19452. return new CustomEvent(FOCUSOUT_PREVENTED, {
  19453. ...FOCUSOUT_PREVENTED_OPTS,
  19454. detail
  19455. });
  19456. };
  19457. const _sfc_main$t = defineComponent({
  19458. name: "ElFocusTrap",
  19459. inheritAttrs: false,
  19460. props: {
  19461. loop: Boolean,
  19462. trapped: Boolean,
  19463. focusTrapEl: Object,
  19464. focusStartEl: {
  19465. type: [Object, String],
  19466. default: "first"
  19467. }
  19468. },
  19469. emits: [
  19470. ON_TRAP_FOCUS_EVT,
  19471. ON_RELEASE_FOCUS_EVT,
  19472. "focusin",
  19473. "focusout",
  19474. "focusout-prevented",
  19475. "release-requested"
  19476. ],
  19477. setup(props, { emit }) {
  19478. const forwardRef = ref();
  19479. let lastFocusBeforeTrapped;
  19480. let lastFocusAfterTrapped;
  19481. const { focusReason: focusReason2 } = useFocusReason();
  19482. useEscapeKeydown((event2) => {
  19483. if (props.trapped && !focusLayer.paused) {
  19484. emit("release-requested", event2);
  19485. }
  19486. });
  19487. const focusLayer = {
  19488. paused: false,
  19489. pause() {
  19490. this.paused = true;
  19491. },
  19492. resume() {
  19493. this.paused = false;
  19494. }
  19495. };
  19496. const onKeydown = (e) => {
  19497. if (!props.loop && !props.trapped)
  19498. return;
  19499. if (focusLayer.paused)
  19500. return;
  19501. const { key, altKey, ctrlKey, metaKey, currentTarget, shiftKey } = e;
  19502. const { loop } = props;
  19503. const isTabbing = key === EVENT_CODE.tab && !altKey && !ctrlKey && !metaKey;
  19504. const currentFocusingEl = document.activeElement;
  19505. if (isTabbing && currentFocusingEl) {
  19506. const container = currentTarget;
  19507. const [first, last] = getEdges(container);
  19508. const isTabbable = first && last;
  19509. if (!isTabbable) {
  19510. if (currentFocusingEl === container) {
  19511. const focusoutPreventedEvent = createFocusOutPreventedEvent({
  19512. focusReason: focusReason2.value
  19513. });
  19514. emit("focusout-prevented", focusoutPreventedEvent);
  19515. if (!focusoutPreventedEvent.defaultPrevented) {
  19516. e.preventDefault();
  19517. }
  19518. }
  19519. } else {
  19520. if (!shiftKey && currentFocusingEl === last) {
  19521. const focusoutPreventedEvent = createFocusOutPreventedEvent({
  19522. focusReason: focusReason2.value
  19523. });
  19524. emit("focusout-prevented", focusoutPreventedEvent);
  19525. if (!focusoutPreventedEvent.defaultPrevented) {
  19526. e.preventDefault();
  19527. if (loop)
  19528. tryFocus(first, true);
  19529. }
  19530. } else if (shiftKey && [first, container].includes(currentFocusingEl)) {
  19531. const focusoutPreventedEvent = createFocusOutPreventedEvent({
  19532. focusReason: focusReason2.value
  19533. });
  19534. emit("focusout-prevented", focusoutPreventedEvent);
  19535. if (!focusoutPreventedEvent.defaultPrevented) {
  19536. e.preventDefault();
  19537. if (loop)
  19538. tryFocus(last, true);
  19539. }
  19540. }
  19541. }
  19542. }
  19543. };
  19544. provide(FOCUS_TRAP_INJECTION_KEY, {
  19545. focusTrapRef: forwardRef,
  19546. onKeydown
  19547. });
  19548. watch(() => props.focusTrapEl, (focusTrapEl) => {
  19549. if (focusTrapEl) {
  19550. forwardRef.value = focusTrapEl;
  19551. }
  19552. }, { immediate: true });
  19553. watch([forwardRef], ([forwardRef2], [oldForwardRef]) => {
  19554. if (forwardRef2) {
  19555. forwardRef2.addEventListener("keydown", onKeydown);
  19556. forwardRef2.addEventListener("focusin", onFocusIn);
  19557. forwardRef2.addEventListener("focusout", onFocusOut);
  19558. }
  19559. if (oldForwardRef) {
  19560. oldForwardRef.removeEventListener("keydown", onKeydown);
  19561. oldForwardRef.removeEventListener("focusin", onFocusIn);
  19562. oldForwardRef.removeEventListener("focusout", onFocusOut);
  19563. }
  19564. });
  19565. const trapOnFocus = (e) => {
  19566. emit(ON_TRAP_FOCUS_EVT, e);
  19567. };
  19568. const releaseOnFocus = (e) => emit(ON_RELEASE_FOCUS_EVT, e);
  19569. const onFocusIn = (e) => {
  19570. const trapContainer = unref(forwardRef);
  19571. if (!trapContainer)
  19572. return;
  19573. const target = e.target;
  19574. const relatedTarget = e.relatedTarget;
  19575. const isFocusedInTrap = target && trapContainer.contains(target);
  19576. if (!props.trapped) {
  19577. const isPrevFocusedInTrap = relatedTarget && trapContainer.contains(relatedTarget);
  19578. if (!isPrevFocusedInTrap) {
  19579. lastFocusBeforeTrapped = relatedTarget;
  19580. }
  19581. }
  19582. if (isFocusedInTrap)
  19583. emit("focusin", e);
  19584. if (focusLayer.paused)
  19585. return;
  19586. if (props.trapped) {
  19587. if (isFocusedInTrap) {
  19588. lastFocusAfterTrapped = target;
  19589. } else {
  19590. tryFocus(lastFocusAfterTrapped, true);
  19591. }
  19592. }
  19593. };
  19594. const onFocusOut = (e) => {
  19595. const trapContainer = unref(forwardRef);
  19596. if (focusLayer.paused || !trapContainer)
  19597. return;
  19598. if (props.trapped) {
  19599. const relatedTarget = e.relatedTarget;
  19600. if (!isNil(relatedTarget) && !trapContainer.contains(relatedTarget)) {
  19601. setTimeout(() => {
  19602. if (!focusLayer.paused && props.trapped) {
  19603. const focusoutPreventedEvent = createFocusOutPreventedEvent({
  19604. focusReason: focusReason2.value
  19605. });
  19606. emit("focusout-prevented", focusoutPreventedEvent);
  19607. if (!focusoutPreventedEvent.defaultPrevented) {
  19608. tryFocus(lastFocusAfterTrapped, true);
  19609. }
  19610. }
  19611. }, 0);
  19612. }
  19613. } else {
  19614. const target = e.target;
  19615. const isFocusedInTrap = target && trapContainer.contains(target);
  19616. if (!isFocusedInTrap)
  19617. emit("focusout", e);
  19618. }
  19619. };
  19620. async function startTrap() {
  19621. await nextTick();
  19622. const trapContainer = unref(forwardRef);
  19623. if (trapContainer) {
  19624. focusableStack.push(focusLayer);
  19625. const prevFocusedElement = trapContainer.contains(document.activeElement) ? lastFocusBeforeTrapped : document.activeElement;
  19626. lastFocusBeforeTrapped = prevFocusedElement;
  19627. const isPrevFocusContained = trapContainer.contains(prevFocusedElement);
  19628. if (!isPrevFocusContained) {
  19629. const focusEvent = new Event(FOCUS_AFTER_TRAPPED, FOCUS_AFTER_TRAPPED_OPTS);
  19630. trapContainer.addEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
  19631. trapContainer.dispatchEvent(focusEvent);
  19632. if (!focusEvent.defaultPrevented) {
  19633. nextTick(() => {
  19634. let focusStartEl = props.focusStartEl;
  19635. if (!isString(focusStartEl)) {
  19636. tryFocus(focusStartEl);
  19637. if (document.activeElement !== focusStartEl) {
  19638. focusStartEl = "first";
  19639. }
  19640. }
  19641. if (focusStartEl === "first") {
  19642. focusFirstDescendant(obtainAllFocusableElements(trapContainer), true);
  19643. }
  19644. if (document.activeElement === prevFocusedElement || focusStartEl === "container") {
  19645. tryFocus(trapContainer);
  19646. }
  19647. });
  19648. }
  19649. }
  19650. }
  19651. }
  19652. function stopTrap() {
  19653. const trapContainer = unref(forwardRef);
  19654. if (trapContainer) {
  19655. trapContainer.removeEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
  19656. const releasedEvent = new CustomEvent(FOCUS_AFTER_RELEASED, {
  19657. ...FOCUS_AFTER_TRAPPED_OPTS,
  19658. detail: {
  19659. focusReason: focusReason2.value
  19660. }
  19661. });
  19662. trapContainer.addEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus);
  19663. trapContainer.dispatchEvent(releasedEvent);
  19664. if (!releasedEvent.defaultPrevented && (focusReason2.value == "keyboard" || !isFocusCausedByUserEvent() || trapContainer.contains(document.activeElement))) {
  19665. tryFocus(lastFocusBeforeTrapped != null ? lastFocusBeforeTrapped : document.body);
  19666. }
  19667. trapContainer.removeEventListener(FOCUS_AFTER_RELEASED, trapOnFocus);
  19668. focusableStack.remove(focusLayer);
  19669. }
  19670. }
  19671. onMounted(() => {
  19672. if (props.trapped) {
  19673. startTrap();
  19674. }
  19675. watch(() => props.trapped, (trapped) => {
  19676. if (trapped) {
  19677. startTrap();
  19678. } else {
  19679. stopTrap();
  19680. }
  19681. });
  19682. });
  19683. onBeforeUnmount(() => {
  19684. if (props.trapped) {
  19685. stopTrap();
  19686. }
  19687. });
  19688. return {
  19689. onKeydown
  19690. };
  19691. }
  19692. });
  19693. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  19694. return renderSlot(_ctx.$slots, "default", { handleKeydown: _ctx.onKeydown });
  19695. }
  19696. var ElFocusTrap = /* @__PURE__ */ _export_sfc$1(_sfc_main$t, [["render", _sfc_render$7], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/focus-trap/src/focus-trap.vue"]]);
  19697. const POSITIONING_STRATEGIES = ["fixed", "absolute"];
  19698. const popperCoreConfigProps = buildProps({
  19699. boundariesPadding: {
  19700. type: Number,
  19701. default: 0
  19702. },
  19703. fallbackPlacements: {
  19704. type: definePropType(Array),
  19705. default: void 0
  19706. },
  19707. gpuAcceleration: {
  19708. type: Boolean,
  19709. default: true
  19710. },
  19711. offset: {
  19712. type: Number,
  19713. default: 12
  19714. },
  19715. placement: {
  19716. type: String,
  19717. values: Ee,
  19718. default: "bottom"
  19719. },
  19720. popperOptions: {
  19721. type: definePropType(Object),
  19722. default: () => ({})
  19723. },
  19724. strategy: {
  19725. type: String,
  19726. values: POSITIONING_STRATEGIES,
  19727. default: "absolute"
  19728. }
  19729. });
  19730. const popperContentProps = buildProps({
  19731. ...popperCoreConfigProps,
  19732. id: String,
  19733. style: {
  19734. type: definePropType([String, Array, Object])
  19735. },
  19736. className: {
  19737. type: definePropType([String, Array, Object])
  19738. },
  19739. effect: {
  19740. type: String,
  19741. default: "dark"
  19742. },
  19743. visible: Boolean,
  19744. enterable: {
  19745. type: Boolean,
  19746. default: true
  19747. },
  19748. pure: Boolean,
  19749. focusOnShow: {
  19750. type: Boolean,
  19751. default: false
  19752. },
  19753. trapping: {
  19754. type: Boolean,
  19755. default: false
  19756. },
  19757. popperClass: {
  19758. type: definePropType([String, Array, Object])
  19759. },
  19760. popperStyle: {
  19761. type: definePropType([String, Array, Object])
  19762. },
  19763. referenceEl: {
  19764. type: definePropType(Object)
  19765. },
  19766. triggerTargetEl: {
  19767. type: definePropType(Object)
  19768. },
  19769. stopPopperMouseEvent: {
  19770. type: Boolean,
  19771. default: true
  19772. },
  19773. ariaLabel: {
  19774. type: String,
  19775. default: void 0
  19776. },
  19777. virtualTriggering: Boolean,
  19778. zIndex: Number
  19779. });
  19780. const popperContentEmits = {
  19781. mouseenter: (evt) => evt instanceof MouseEvent,
  19782. mouseleave: (evt) => evt instanceof MouseEvent,
  19783. focus: () => true,
  19784. blur: () => true,
  19785. close: () => true
  19786. };
  19787. const buildPopperOptions = (props, modifiers = []) => {
  19788. const { placement, strategy, popperOptions } = props;
  19789. const options2 = {
  19790. placement,
  19791. strategy,
  19792. ...popperOptions,
  19793. modifiers: [...genModifiers(props), ...modifiers]
  19794. };
  19795. deriveExtraModifiers(options2, popperOptions == null ? void 0 : popperOptions.modifiers);
  19796. return options2;
  19797. };
  19798. const unwrapMeasurableEl = ($el) => {
  19799. if (!isClient)
  19800. return;
  19801. return unrefElement($el);
  19802. };
  19803. function genModifiers(options2) {
  19804. const { offset, gpuAcceleration, fallbackPlacements } = options2;
  19805. return [
  19806. {
  19807. name: "offset",
  19808. options: {
  19809. offset: [0, offset != null ? offset : 12]
  19810. }
  19811. },
  19812. {
  19813. name: "preventOverflow",
  19814. options: {
  19815. padding: {
  19816. top: 2,
  19817. bottom: 2,
  19818. left: 5,
  19819. right: 5
  19820. }
  19821. }
  19822. },
  19823. {
  19824. name: "flip",
  19825. options: {
  19826. padding: 5,
  19827. fallbackPlacements
  19828. }
  19829. },
  19830. {
  19831. name: "computeStyles",
  19832. options: {
  19833. gpuAcceleration
  19834. }
  19835. }
  19836. ];
  19837. }
  19838. function deriveExtraModifiers(options2, modifiers) {
  19839. if (modifiers) {
  19840. options2.modifiers = [...options2.modifiers, ...modifiers != null ? modifiers : []];
  19841. }
  19842. }
  19843. const DEFAULT_ARROW_OFFSET = 0;
  19844. const usePopperContent = (props) => {
  19845. const { popperInstanceRef, contentRef, triggerRef: triggerRef2, role } = inject(POPPER_INJECTION_KEY, void 0);
  19846. const arrowRef = ref();
  19847. const arrowOffset = ref();
  19848. const eventListenerModifier = computed$1(() => {
  19849. return {
  19850. name: "eventListeners",
  19851. enabled: !!props.visible
  19852. };
  19853. });
  19854. const arrowModifier = computed$1(() => {
  19855. var _a2;
  19856. const arrowEl = unref(arrowRef);
  19857. const offset = (_a2 = unref(arrowOffset)) != null ? _a2 : DEFAULT_ARROW_OFFSET;
  19858. return {
  19859. name: "arrow",
  19860. enabled: !isUndefined$1(arrowEl),
  19861. options: {
  19862. element: arrowEl,
  19863. padding: offset
  19864. }
  19865. };
  19866. });
  19867. const options2 = computed$1(() => {
  19868. return {
  19869. onFirstUpdate: () => {
  19870. update();
  19871. },
  19872. ...buildPopperOptions(props, [
  19873. unref(arrowModifier),
  19874. unref(eventListenerModifier)
  19875. ])
  19876. };
  19877. });
  19878. const computedReference = computed$1(() => unwrapMeasurableEl(props.referenceEl) || unref(triggerRef2));
  19879. const { attributes, state, styles, update, forceUpdate, instanceRef } = usePopper(computedReference, contentRef, options2);
  19880. watch(instanceRef, (instance) => popperInstanceRef.value = instance);
  19881. onMounted(() => {
  19882. watch(() => {
  19883. var _a2;
  19884. return (_a2 = unref(computedReference)) == null ? void 0 : _a2.getBoundingClientRect();
  19885. }, () => {
  19886. update();
  19887. });
  19888. });
  19889. return {
  19890. attributes,
  19891. arrowRef,
  19892. contentRef,
  19893. instanceRef,
  19894. state,
  19895. styles,
  19896. role,
  19897. forceUpdate,
  19898. update
  19899. };
  19900. };
  19901. const usePopperContentDOM = (props, {
  19902. attributes,
  19903. styles,
  19904. role
  19905. }) => {
  19906. const { nextZIndex } = useZIndex();
  19907. const ns = useNamespace("popper");
  19908. const contentAttrs = computed$1(() => unref(attributes).popper);
  19909. const contentZIndex = ref(props.zIndex || nextZIndex());
  19910. const contentClass = computed$1(() => [
  19911. ns.b(),
  19912. ns.is("pure", props.pure),
  19913. ns.is(props.effect),
  19914. props.popperClass
  19915. ]);
  19916. const contentStyle = computed$1(() => {
  19917. return [
  19918. { zIndex: unref(contentZIndex) },
  19919. props.popperStyle || {},
  19920. unref(styles).popper
  19921. ];
  19922. });
  19923. const ariaModal = computed$1(() => role.value === "dialog" ? "false" : void 0);
  19924. const arrowStyle = computed$1(() => unref(styles).arrow || {});
  19925. const updateZIndex = () => {
  19926. contentZIndex.value = props.zIndex || nextZIndex();
  19927. };
  19928. return {
  19929. ariaModal,
  19930. arrowStyle,
  19931. contentAttrs,
  19932. contentClass,
  19933. contentStyle,
  19934. contentZIndex,
  19935. updateZIndex
  19936. };
  19937. };
  19938. const usePopperContentFocusTrap = (props, emit) => {
  19939. const trapped = ref(false);
  19940. const focusStartRef = ref();
  19941. const onFocusAfterTrapped = () => {
  19942. emit("focus");
  19943. };
  19944. const onFocusAfterReleased = (event2) => {
  19945. var _a2;
  19946. if (((_a2 = event2.detail) == null ? void 0 : _a2.focusReason) !== "pointer") {
  19947. focusStartRef.value = "first";
  19948. emit("blur");
  19949. }
  19950. };
  19951. const onFocusInTrap = (event2) => {
  19952. if (props.visible && !trapped.value) {
  19953. if (event2.target) {
  19954. focusStartRef.value = event2.target;
  19955. }
  19956. trapped.value = true;
  19957. }
  19958. };
  19959. const onFocusoutPrevented = (event2) => {
  19960. if (!props.trapping) {
  19961. if (event2.detail.focusReason === "pointer") {
  19962. event2.preventDefault();
  19963. }
  19964. trapped.value = false;
  19965. }
  19966. };
  19967. const onReleaseRequested = () => {
  19968. trapped.value = false;
  19969. emit("close");
  19970. };
  19971. return {
  19972. focusStartRef,
  19973. trapped,
  19974. onFocusAfterReleased,
  19975. onFocusAfterTrapped,
  19976. onFocusInTrap,
  19977. onFocusoutPrevented,
  19978. onReleaseRequested
  19979. };
  19980. };
  19981. const __default__$i = defineComponent({
  19982. name: "ElPopperContent"
  19983. });
  19984. const _sfc_main$s = /* @__PURE__ */ defineComponent({
  19985. ...__default__$i,
  19986. props: popperContentProps,
  19987. emits: popperContentEmits,
  19988. setup(__props, { expose, emit }) {
  19989. const props = __props;
  19990. const {
  19991. focusStartRef,
  19992. trapped,
  19993. onFocusAfterReleased,
  19994. onFocusAfterTrapped,
  19995. onFocusInTrap,
  19996. onFocusoutPrevented,
  19997. onReleaseRequested
  19998. } = usePopperContentFocusTrap(props, emit);
  19999. const { attributes, arrowRef, contentRef, styles, instanceRef, role, update } = usePopperContent(props);
  20000. const {
  20001. ariaModal,
  20002. arrowStyle,
  20003. contentAttrs,
  20004. contentClass,
  20005. contentStyle,
  20006. updateZIndex
  20007. } = usePopperContentDOM(props, {
  20008. styles,
  20009. attributes,
  20010. role
  20011. });
  20012. const formItemContext = inject(formItemContextKey, void 0);
  20013. const arrowOffset = ref();
  20014. provide(POPPER_CONTENT_INJECTION_KEY, {
  20015. arrowStyle,
  20016. arrowRef,
  20017. arrowOffset
  20018. });
  20019. if (formItemContext && (formItemContext.addInputId || formItemContext.removeInputId)) {
  20020. provide(formItemContextKey, {
  20021. ...formItemContext,
  20022. addInputId: NOOP,
  20023. removeInputId: NOOP
  20024. });
  20025. }
  20026. let triggerTargetAriaStopWatch = void 0;
  20027. const updatePopper = (shouldUpdateZIndex = true) => {
  20028. update();
  20029. shouldUpdateZIndex && updateZIndex();
  20030. };
  20031. const togglePopperAlive = () => {
  20032. updatePopper(false);
  20033. if (props.visible && props.focusOnShow) {
  20034. trapped.value = true;
  20035. } else if (props.visible === false) {
  20036. trapped.value = false;
  20037. }
  20038. };
  20039. onMounted(() => {
  20040. watch(() => props.triggerTargetEl, (triggerTargetEl, prevTriggerTargetEl) => {
  20041. triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
  20042. triggerTargetAriaStopWatch = void 0;
  20043. const el = unref(triggerTargetEl || contentRef.value);
  20044. const prevEl = unref(prevTriggerTargetEl || contentRef.value);
  20045. if (isElement(el)) {
  20046. triggerTargetAriaStopWatch = watch([role, () => props.ariaLabel, ariaModal, () => props.id], (watches) => {
  20047. ["role", "aria-label", "aria-modal", "id"].forEach((key, idx) => {
  20048. isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
  20049. });
  20050. }, { immediate: true });
  20051. }
  20052. if (prevEl !== el && isElement(prevEl)) {
  20053. ["role", "aria-label", "aria-modal", "id"].forEach((key) => {
  20054. prevEl.removeAttribute(key);
  20055. });
  20056. }
  20057. }, { immediate: true });
  20058. watch(() => props.visible, togglePopperAlive, { immediate: true });
  20059. });
  20060. onBeforeUnmount(() => {
  20061. triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
  20062. triggerTargetAriaStopWatch = void 0;
  20063. });
  20064. expose({
  20065. popperContentRef: contentRef,
  20066. popperInstanceRef: instanceRef,
  20067. updatePopper,
  20068. contentStyle
  20069. });
  20070. return (_ctx, _cache) => {
  20071. return openBlock(), createElementBlock("div", mergeProps({
  20072. ref_key: "contentRef",
  20073. ref: contentRef
  20074. }, unref(contentAttrs), {
  20075. style: unref(contentStyle),
  20076. class: unref(contentClass),
  20077. tabindex: "-1",
  20078. onMouseenter: _cache[0] || (_cache[0] = (e) => _ctx.$emit("mouseenter", e)),
  20079. onMouseleave: _cache[1] || (_cache[1] = (e) => _ctx.$emit("mouseleave", e))
  20080. }), [
  20081. createVNode(unref(ElFocusTrap), {
  20082. trapped: unref(trapped),
  20083. "trap-on-focus-in": true,
  20084. "focus-trap-el": unref(contentRef),
  20085. "focus-start-el": unref(focusStartRef),
  20086. onFocusAfterTrapped: unref(onFocusAfterTrapped),
  20087. onFocusAfterReleased: unref(onFocusAfterReleased),
  20088. onFocusin: unref(onFocusInTrap),
  20089. onFocusoutPrevented: unref(onFocusoutPrevented),
  20090. onReleaseRequested: unref(onReleaseRequested)
  20091. }, {
  20092. default: withCtx(() => [
  20093. renderSlot(_ctx.$slots, "default")
  20094. ]),
  20095. _: 3
  20096. }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"])
  20097. ], 16);
  20098. };
  20099. }
  20100. });
  20101. var ElPopperContent = /* @__PURE__ */ _export_sfc$1(_sfc_main$s, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/popper/src/content.vue"]]);
  20102. const ElPopper = withInstall(Popper);
  20103. const TOOLTIP_INJECTION_KEY = Symbol("elTooltip");
  20104. const useTooltipContentProps = buildProps({
  20105. ...useDelayedToggleProps,
  20106. ...popperContentProps,
  20107. appendTo: {
  20108. type: definePropType([String, Object])
  20109. },
  20110. content: {
  20111. type: String,
  20112. default: ""
  20113. },
  20114. rawContent: {
  20115. type: Boolean,
  20116. default: false
  20117. },
  20118. persistent: Boolean,
  20119. ariaLabel: String,
  20120. visible: {
  20121. type: definePropType(Boolean),
  20122. default: null
  20123. },
  20124. transition: String,
  20125. teleported: {
  20126. type: Boolean,
  20127. default: true
  20128. },
  20129. disabled: Boolean
  20130. });
  20131. const useTooltipTriggerProps = buildProps({
  20132. ...popperTriggerProps,
  20133. disabled: Boolean,
  20134. trigger: {
  20135. type: definePropType([String, Array]),
  20136. default: "hover"
  20137. },
  20138. triggerKeys: {
  20139. type: definePropType(Array),
  20140. default: () => [EVENT_CODE.enter, EVENT_CODE.space]
  20141. }
  20142. });
  20143. const {
  20144. useModelToggleProps: useTooltipModelToggleProps,
  20145. useModelToggleEmits: useTooltipModelToggleEmits,
  20146. useModelToggle: useTooltipModelToggle
  20147. } = createModelToggleComposable("visible");
  20148. const useTooltipProps = buildProps({
  20149. ...popperProps,
  20150. ...useTooltipModelToggleProps,
  20151. ...useTooltipContentProps,
  20152. ...useTooltipTriggerProps,
  20153. ...popperArrowProps,
  20154. showArrow: {
  20155. type: Boolean,
  20156. default: true
  20157. }
  20158. });
  20159. const tooltipEmits = [
  20160. ...useTooltipModelToggleEmits,
  20161. "before-show",
  20162. "before-hide",
  20163. "show",
  20164. "hide",
  20165. "open",
  20166. "close"
  20167. ];
  20168. const isTriggerType = (trigger2, type2) => {
  20169. if (isArray$2(trigger2)) {
  20170. return trigger2.includes(type2);
  20171. }
  20172. return trigger2 === type2;
  20173. };
  20174. const whenTrigger = (trigger2, type2, handler) => {
  20175. return (e) => {
  20176. isTriggerType(unref(trigger2), type2) && handler(e);
  20177. };
  20178. };
  20179. const __default__$h = defineComponent({
  20180. name: "ElTooltipTrigger"
  20181. });
  20182. const _sfc_main$r = /* @__PURE__ */ defineComponent({
  20183. ...__default__$h,
  20184. props: useTooltipTriggerProps,
  20185. setup(__props, { expose }) {
  20186. const props = __props;
  20187. const ns = useNamespace("tooltip");
  20188. const { controlled, id, open, onOpen, onClose, onToggle } = inject(TOOLTIP_INJECTION_KEY, void 0);
  20189. const triggerRef2 = ref(null);
  20190. const stopWhenControlledOrDisabled = () => {
  20191. if (unref(controlled) || props.disabled) {
  20192. return true;
  20193. }
  20194. };
  20195. const trigger2 = toRef(props, "trigger");
  20196. const onMouseenter = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "hover", onOpen));
  20197. const onMouseleave = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "hover", onClose));
  20198. const onClick = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "click", (e) => {
  20199. if (e.button === 0) {
  20200. onToggle(e);
  20201. }
  20202. }));
  20203. const onFocus = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "focus", onOpen));
  20204. const onBlur = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "focus", onClose));
  20205. const onContextMenu = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger2, "contextmenu", (e) => {
  20206. e.preventDefault();
  20207. onToggle(e);
  20208. }));
  20209. const onKeydown = composeEventHandlers(stopWhenControlledOrDisabled, (e) => {
  20210. const { code } = e;
  20211. if (props.triggerKeys.includes(code)) {
  20212. e.preventDefault();
  20213. onToggle(e);
  20214. }
  20215. });
  20216. expose({
  20217. triggerRef: triggerRef2
  20218. });
  20219. return (_ctx, _cache) => {
  20220. return openBlock(), createBlock(unref(ElPopperTrigger), {
  20221. id: unref(id),
  20222. "virtual-ref": _ctx.virtualRef,
  20223. open: unref(open),
  20224. "virtual-triggering": _ctx.virtualTriggering,
  20225. class: normalizeClass(unref(ns).e("trigger")),
  20226. onBlur: unref(onBlur),
  20227. onClick: unref(onClick),
  20228. onContextmenu: unref(onContextMenu),
  20229. onFocus: unref(onFocus),
  20230. onMouseenter: unref(onMouseenter),
  20231. onMouseleave: unref(onMouseleave),
  20232. onKeydown: unref(onKeydown)
  20233. }, {
  20234. default: withCtx(() => [
  20235. renderSlot(_ctx.$slots, "default")
  20236. ]),
  20237. _: 3
  20238. }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]);
  20239. };
  20240. }
  20241. });
  20242. var ElTooltipTrigger = /* @__PURE__ */ _export_sfc$1(_sfc_main$r, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/tooltip/src/trigger.vue"]]);
  20243. const __default__$g = defineComponent({
  20244. name: "ElTooltipContent",
  20245. inheritAttrs: false
  20246. });
  20247. const _sfc_main$q = /* @__PURE__ */ defineComponent({
  20248. ...__default__$g,
  20249. props: useTooltipContentProps,
  20250. setup(__props, { expose }) {
  20251. const props = __props;
  20252. const { selector } = usePopperContainerId();
  20253. const ns = useNamespace("tooltip");
  20254. const contentRef = ref(null);
  20255. const destroyed = ref(false);
  20256. const {
  20257. controlled,
  20258. id,
  20259. open,
  20260. trigger: trigger2,
  20261. onClose,
  20262. onOpen,
  20263. onShow,
  20264. onHide,
  20265. onBeforeShow,
  20266. onBeforeHide
  20267. } = inject(TOOLTIP_INJECTION_KEY, void 0);
  20268. const transitionClass = computed$1(() => {
  20269. return props.transition || `${ns.namespace.value}-fade-in-linear`;
  20270. });
  20271. const persistentRef = computed$1(() => {
  20272. return props.persistent;
  20273. });
  20274. onBeforeUnmount(() => {
  20275. destroyed.value = true;
  20276. });
  20277. const shouldRender = computed$1(() => {
  20278. return unref(persistentRef) ? true : unref(open);
  20279. });
  20280. const shouldShow = computed$1(() => {
  20281. return props.disabled ? false : unref(open);
  20282. });
  20283. const appendTo = computed$1(() => {
  20284. return props.appendTo || selector.value;
  20285. });
  20286. const contentStyle = computed$1(() => {
  20287. var _a2;
  20288. return (_a2 = props.style) != null ? _a2 : {};
  20289. });
  20290. const ariaHidden = computed$1(() => !unref(open));
  20291. const onTransitionLeave = () => {
  20292. onHide();
  20293. };
  20294. const stopWhenControlled = () => {
  20295. if (unref(controlled))
  20296. return true;
  20297. };
  20298. const onContentEnter = composeEventHandlers(stopWhenControlled, () => {
  20299. if (props.enterable && unref(trigger2) === "hover") {
  20300. onOpen();
  20301. }
  20302. });
  20303. const onContentLeave = composeEventHandlers(stopWhenControlled, () => {
  20304. if (unref(trigger2) === "hover") {
  20305. onClose();
  20306. }
  20307. });
  20308. const onBeforeEnter = () => {
  20309. var _a2, _b;
  20310. (_b = (_a2 = contentRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  20311. onBeforeShow == null ? void 0 : onBeforeShow();
  20312. };
  20313. const onBeforeLeave = () => {
  20314. onBeforeHide == null ? void 0 : onBeforeHide();
  20315. };
  20316. const onAfterShow = () => {
  20317. onShow();
  20318. stopHandle = onClickOutside(computed$1(() => {
  20319. var _a2;
  20320. return (_a2 = contentRef.value) == null ? void 0 : _a2.popperContentRef;
  20321. }), () => {
  20322. if (unref(controlled))
  20323. return;
  20324. const $trigger = unref(trigger2);
  20325. if ($trigger !== "hover") {
  20326. onClose();
  20327. }
  20328. });
  20329. };
  20330. const onBlur = () => {
  20331. if (!props.virtualTriggering) {
  20332. onClose();
  20333. }
  20334. };
  20335. let stopHandle;
  20336. watch(() => unref(open), (val) => {
  20337. if (!val) {
  20338. stopHandle == null ? void 0 : stopHandle();
  20339. }
  20340. }, {
  20341. flush: "post"
  20342. });
  20343. watch(() => props.content, () => {
  20344. var _a2, _b;
  20345. (_b = (_a2 = contentRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  20346. });
  20347. expose({
  20348. contentRef
  20349. });
  20350. return (_ctx, _cache) => {
  20351. return openBlock(), createBlock(Teleport, {
  20352. disabled: !_ctx.teleported,
  20353. to: unref(appendTo)
  20354. }, [
  20355. createVNode(Transition, {
  20356. name: unref(transitionClass),
  20357. onAfterLeave: onTransitionLeave,
  20358. onBeforeEnter,
  20359. onAfterEnter: onAfterShow,
  20360. onBeforeLeave
  20361. }, {
  20362. default: withCtx(() => [
  20363. unref(shouldRender) ? withDirectives((openBlock(), createBlock(unref(ElPopperContent), mergeProps({
  20364. key: 0,
  20365. id: unref(id),
  20366. ref_key: "contentRef",
  20367. ref: contentRef
  20368. }, _ctx.$attrs, {
  20369. "aria-label": _ctx.ariaLabel,
  20370. "aria-hidden": unref(ariaHidden),
  20371. "boundaries-padding": _ctx.boundariesPadding,
  20372. "fallback-placements": _ctx.fallbackPlacements,
  20373. "gpu-acceleration": _ctx.gpuAcceleration,
  20374. offset: _ctx.offset,
  20375. placement: _ctx.placement,
  20376. "popper-options": _ctx.popperOptions,
  20377. strategy: _ctx.strategy,
  20378. effect: _ctx.effect,
  20379. enterable: _ctx.enterable,
  20380. pure: _ctx.pure,
  20381. "popper-class": _ctx.popperClass,
  20382. "popper-style": [_ctx.popperStyle, unref(contentStyle)],
  20383. "reference-el": _ctx.referenceEl,
  20384. "trigger-target-el": _ctx.triggerTargetEl,
  20385. visible: unref(shouldShow),
  20386. "z-index": _ctx.zIndex,
  20387. onMouseenter: unref(onContentEnter),
  20388. onMouseleave: unref(onContentLeave),
  20389. onBlur,
  20390. onClose: unref(onClose)
  20391. }), {
  20392. default: withCtx(() => [
  20393. !destroyed.value ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true)
  20394. ]),
  20395. _: 3
  20396. }, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [
  20397. [vShow, unref(shouldShow)]
  20398. ]) : createCommentVNode("v-if", true)
  20399. ]),
  20400. _: 3
  20401. }, 8, ["name"])
  20402. ], 8, ["disabled", "to"]);
  20403. };
  20404. }
  20405. });
  20406. var ElTooltipContent = /* @__PURE__ */ _export_sfc$1(_sfc_main$q, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/tooltip/src/content.vue"]]);
  20407. const _hoisted_1$f = ["innerHTML"];
  20408. const _hoisted_2$9 = { key: 1 };
  20409. const __default__$f = defineComponent({
  20410. name: "ElTooltip"
  20411. });
  20412. const _sfc_main$p = /* @__PURE__ */ defineComponent({
  20413. ...__default__$f,
  20414. props: useTooltipProps,
  20415. emits: tooltipEmits,
  20416. setup(__props, { expose, emit }) {
  20417. const props = __props;
  20418. usePopperContainer();
  20419. const id = useId();
  20420. const popperRef = ref();
  20421. const contentRef = ref();
  20422. const updatePopper = () => {
  20423. var _a2;
  20424. const popperComponent = unref(popperRef);
  20425. if (popperComponent) {
  20426. (_a2 = popperComponent.popperInstanceRef) == null ? void 0 : _a2.update();
  20427. }
  20428. };
  20429. const open = ref(false);
  20430. const toggleReason = ref();
  20431. const { show, hide, hasUpdateHandler } = useTooltipModelToggle({
  20432. indicator: open,
  20433. toggleReason
  20434. });
  20435. const { onOpen, onClose } = useDelayedToggle({
  20436. showAfter: toRef(props, "showAfter"),
  20437. hideAfter: toRef(props, "hideAfter"),
  20438. autoClose: toRef(props, "autoClose"),
  20439. open: show,
  20440. close: hide
  20441. });
  20442. const controlled = computed$1(() => isBoolean(props.visible) && !hasUpdateHandler.value);
  20443. provide(TOOLTIP_INJECTION_KEY, {
  20444. controlled,
  20445. id,
  20446. open: readonly(open),
  20447. trigger: toRef(props, "trigger"),
  20448. onOpen: (event2) => {
  20449. onOpen(event2);
  20450. },
  20451. onClose: (event2) => {
  20452. onClose(event2);
  20453. },
  20454. onToggle: (event2) => {
  20455. if (unref(open)) {
  20456. onClose(event2);
  20457. } else {
  20458. onOpen(event2);
  20459. }
  20460. },
  20461. onShow: () => {
  20462. emit("show", toggleReason.value);
  20463. },
  20464. onHide: () => {
  20465. emit("hide", toggleReason.value);
  20466. },
  20467. onBeforeShow: () => {
  20468. emit("before-show", toggleReason.value);
  20469. },
  20470. onBeforeHide: () => {
  20471. emit("before-hide", toggleReason.value);
  20472. },
  20473. updatePopper
  20474. });
  20475. watch(() => props.disabled, (disabled) => {
  20476. if (disabled && open.value) {
  20477. open.value = false;
  20478. }
  20479. });
  20480. const isFocusInsideContent = () => {
  20481. var _a2, _b;
  20482. const popperContent = (_b = (_a2 = contentRef.value) == null ? void 0 : _a2.contentRef) == null ? void 0 : _b.popperContentRef;
  20483. return popperContent && popperContent.contains(document.activeElement);
  20484. };
  20485. onDeactivated(() => open.value && hide());
  20486. expose({
  20487. popperRef,
  20488. contentRef,
  20489. isFocusInsideContent,
  20490. updatePopper,
  20491. onOpen,
  20492. onClose,
  20493. hide
  20494. });
  20495. return (_ctx, _cache) => {
  20496. return openBlock(), createBlock(unref(ElPopper), {
  20497. ref_key: "popperRef",
  20498. ref: popperRef,
  20499. role: _ctx.role
  20500. }, {
  20501. default: withCtx(() => [
  20502. createVNode(ElTooltipTrigger, {
  20503. disabled: _ctx.disabled,
  20504. trigger: _ctx.trigger,
  20505. "trigger-keys": _ctx.triggerKeys,
  20506. "virtual-ref": _ctx.virtualRef,
  20507. "virtual-triggering": _ctx.virtualTriggering
  20508. }, {
  20509. default: withCtx(() => [
  20510. _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true)
  20511. ]),
  20512. _: 3
  20513. }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]),
  20514. createVNode(ElTooltipContent, {
  20515. ref_key: "contentRef",
  20516. ref: contentRef,
  20517. "aria-label": _ctx.ariaLabel,
  20518. "boundaries-padding": _ctx.boundariesPadding,
  20519. content: _ctx.content,
  20520. disabled: _ctx.disabled,
  20521. effect: _ctx.effect,
  20522. enterable: _ctx.enterable,
  20523. "fallback-placements": _ctx.fallbackPlacements,
  20524. "hide-after": _ctx.hideAfter,
  20525. "gpu-acceleration": _ctx.gpuAcceleration,
  20526. offset: _ctx.offset,
  20527. persistent: _ctx.persistent,
  20528. "popper-class": _ctx.popperClass,
  20529. "popper-style": _ctx.popperStyle,
  20530. placement: _ctx.placement,
  20531. "popper-options": _ctx.popperOptions,
  20532. pure: _ctx.pure,
  20533. "raw-content": _ctx.rawContent,
  20534. "reference-el": _ctx.referenceEl,
  20535. "trigger-target-el": _ctx.triggerTargetEl,
  20536. "show-after": _ctx.showAfter,
  20537. strategy: _ctx.strategy,
  20538. teleported: _ctx.teleported,
  20539. transition: _ctx.transition,
  20540. "virtual-triggering": _ctx.virtualTriggering,
  20541. "z-index": _ctx.zIndex,
  20542. "append-to": _ctx.appendTo
  20543. }, {
  20544. default: withCtx(() => [
  20545. renderSlot(_ctx.$slots, "content", {}, () => [
  20546. _ctx.rawContent ? (openBlock(), createElementBlock("span", {
  20547. key: 0,
  20548. innerHTML: _ctx.content
  20549. }, null, 8, _hoisted_1$f)) : (openBlock(), createElementBlock("span", _hoisted_2$9, toDisplayString(_ctx.content), 1))
  20550. ]),
  20551. _ctx.showArrow ? (openBlock(), createBlock(unref(ElPopperArrow), {
  20552. key: 0,
  20553. "arrow-offset": _ctx.arrowOffset
  20554. }, null, 8, ["arrow-offset"])) : createCommentVNode("v-if", true)
  20555. ]),
  20556. _: 3
  20557. }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"])
  20558. ]),
  20559. _: 3
  20560. }, 8, ["role"]);
  20561. };
  20562. }
  20563. });
  20564. var Tooltip = /* @__PURE__ */ _export_sfc$1(_sfc_main$p, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/tooltip/src/tooltip.vue"]]);
  20565. const ElTooltip = withInstall(Tooltip);
  20566. const buttonGroupContextKey = Symbol("buttonGroupContextKey");
  20567. const useButton = (props, emit) => {
  20568. useDeprecated({
  20569. from: "type.text",
  20570. replacement: "link",
  20571. version: "3.0.0",
  20572. scope: "props",
  20573. ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
  20574. }, computed$1(() => props.type === "text"));
  20575. const buttonGroupContext = inject(buttonGroupContextKey, void 0);
  20576. const globalConfig2 = useGlobalConfig("button");
  20577. const { form } = useFormItem();
  20578. const _size = useFormSize(computed$1(() => buttonGroupContext == null ? void 0 : buttonGroupContext.size));
  20579. const _disabled = useFormDisabled();
  20580. const _ref = ref();
  20581. const slots = useSlots();
  20582. const _type = computed$1(() => props.type || (buttonGroupContext == null ? void 0 : buttonGroupContext.type) || "");
  20583. const autoInsertSpace = computed$1(() => {
  20584. var _a2, _b, _c;
  20585. return (_c = (_b = props.autoInsertSpace) != null ? _b : (_a2 = globalConfig2.value) == null ? void 0 : _a2.autoInsertSpace) != null ? _c : false;
  20586. });
  20587. const _props = computed$1(() => {
  20588. if (props.tag === "button") {
  20589. return {
  20590. ariaDisabled: _disabled.value || props.loading,
  20591. disabled: _disabled.value || props.loading,
  20592. autofocus: props.autofocus,
  20593. type: props.nativeType
  20594. };
  20595. }
  20596. return {};
  20597. });
  20598. const shouldAddSpace = computed$1(() => {
  20599. var _a2;
  20600. const defaultSlot = (_a2 = slots.default) == null ? void 0 : _a2.call(slots);
  20601. if (autoInsertSpace.value && (defaultSlot == null ? void 0 : defaultSlot.length) === 1) {
  20602. const slot = defaultSlot[0];
  20603. if ((slot == null ? void 0 : slot.type) === Text$1) {
  20604. const text = slot.children;
  20605. return /^\p{Unified_Ideograph}{2}$/u.test(text.trim());
  20606. }
  20607. }
  20608. return false;
  20609. });
  20610. const handleClick = (evt) => {
  20611. if (props.nativeType === "reset") {
  20612. form == null ? void 0 : form.resetFields();
  20613. }
  20614. emit("click", evt);
  20615. };
  20616. return {
  20617. _disabled,
  20618. _size,
  20619. _type,
  20620. _ref,
  20621. _props,
  20622. shouldAddSpace,
  20623. handleClick
  20624. };
  20625. };
  20626. const buttonTypes = [
  20627. "default",
  20628. "primary",
  20629. "success",
  20630. "warning",
  20631. "info",
  20632. "danger",
  20633. "text",
  20634. ""
  20635. ];
  20636. const buttonNativeTypes = ["button", "submit", "reset"];
  20637. const buttonProps = buildProps({
  20638. size: useSizeProp,
  20639. disabled: Boolean,
  20640. type: {
  20641. type: String,
  20642. values: buttonTypes,
  20643. default: ""
  20644. },
  20645. icon: {
  20646. type: iconPropType
  20647. },
  20648. nativeType: {
  20649. type: String,
  20650. values: buttonNativeTypes,
  20651. default: "button"
  20652. },
  20653. loading: Boolean,
  20654. loadingIcon: {
  20655. type: iconPropType,
  20656. default: () => loading_default
  20657. },
  20658. plain: Boolean,
  20659. text: Boolean,
  20660. link: Boolean,
  20661. bg: Boolean,
  20662. autofocus: Boolean,
  20663. round: Boolean,
  20664. circle: Boolean,
  20665. color: String,
  20666. dark: Boolean,
  20667. autoInsertSpace: {
  20668. type: Boolean,
  20669. default: void 0
  20670. },
  20671. tag: {
  20672. type: definePropType([String, Object]),
  20673. default: "button"
  20674. }
  20675. });
  20676. const buttonEmits = {
  20677. click: (evt) => evt instanceof MouseEvent
  20678. };
  20679. function bound01$1(n, max2) {
  20680. if (isOnePointZero$1(n)) {
  20681. n = "100%";
  20682. }
  20683. var isPercent = isPercentage$1(n);
  20684. n = max2 === 360 ? n : Math.min(max2, Math.max(0, parseFloat(n)));
  20685. if (isPercent) {
  20686. n = parseInt(String(n * max2), 10) / 100;
  20687. }
  20688. if (Math.abs(n - max2) < 1e-6) {
  20689. return 1;
  20690. }
  20691. if (max2 === 360) {
  20692. n = (n < 0 ? n % max2 + max2 : n % max2) / parseFloat(String(max2));
  20693. } else {
  20694. n = n % max2 / parseFloat(String(max2));
  20695. }
  20696. return n;
  20697. }
  20698. function clamp01(val) {
  20699. return Math.min(1, Math.max(0, val));
  20700. }
  20701. function isOnePointZero$1(n) {
  20702. return typeof n === "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1;
  20703. }
  20704. function isPercentage$1(n) {
  20705. return typeof n === "string" && n.indexOf("%") !== -1;
  20706. }
  20707. function boundAlpha(a) {
  20708. a = parseFloat(a);
  20709. if (isNaN(a) || a < 0 || a > 1) {
  20710. a = 1;
  20711. }
  20712. return a;
  20713. }
  20714. function convertToPercentage(n) {
  20715. if (n <= 1) {
  20716. return "".concat(Number(n) * 100, "%");
  20717. }
  20718. return n;
  20719. }
  20720. function pad2(c) {
  20721. return c.length === 1 ? "0" + c : String(c);
  20722. }
  20723. function rgbToRgb(r2, g, b) {
  20724. return {
  20725. r: bound01$1(r2, 255) * 255,
  20726. g: bound01$1(g, 255) * 255,
  20727. b: bound01$1(b, 255) * 255
  20728. };
  20729. }
  20730. function rgbToHsl(r2, g, b) {
  20731. r2 = bound01$1(r2, 255);
  20732. g = bound01$1(g, 255);
  20733. b = bound01$1(b, 255);
  20734. var max2 = Math.max(r2, g, b);
  20735. var min2 = Math.min(r2, g, b);
  20736. var h2 = 0;
  20737. var s = 0;
  20738. var l = (max2 + min2) / 2;
  20739. if (max2 === min2) {
  20740. s = 0;
  20741. h2 = 0;
  20742. } else {
  20743. var d2 = max2 - min2;
  20744. s = l > 0.5 ? d2 / (2 - max2 - min2) : d2 / (max2 + min2);
  20745. switch (max2) {
  20746. case r2:
  20747. h2 = (g - b) / d2 + (g < b ? 6 : 0);
  20748. break;
  20749. case g:
  20750. h2 = (b - r2) / d2 + 2;
  20751. break;
  20752. case b:
  20753. h2 = (r2 - g) / d2 + 4;
  20754. break;
  20755. }
  20756. h2 /= 6;
  20757. }
  20758. return { h: h2, s, l };
  20759. }
  20760. function hue2rgb(p, q2, t2) {
  20761. if (t2 < 0) {
  20762. t2 += 1;
  20763. }
  20764. if (t2 > 1) {
  20765. t2 -= 1;
  20766. }
  20767. if (t2 < 1 / 6) {
  20768. return p + (q2 - p) * (6 * t2);
  20769. }
  20770. if (t2 < 1 / 2) {
  20771. return q2;
  20772. }
  20773. if (t2 < 2 / 3) {
  20774. return p + (q2 - p) * (2 / 3 - t2) * 6;
  20775. }
  20776. return p;
  20777. }
  20778. function hslToRgb(h2, s, l) {
  20779. var r2;
  20780. var g;
  20781. var b;
  20782. h2 = bound01$1(h2, 360);
  20783. s = bound01$1(s, 100);
  20784. l = bound01$1(l, 100);
  20785. if (s === 0) {
  20786. g = l;
  20787. b = l;
  20788. r2 = l;
  20789. } else {
  20790. var q2 = l < 0.5 ? l * (1 + s) : l + s - l * s;
  20791. var p = 2 * l - q2;
  20792. r2 = hue2rgb(p, q2, h2 + 1 / 3);
  20793. g = hue2rgb(p, q2, h2);
  20794. b = hue2rgb(p, q2, h2 - 1 / 3);
  20795. }
  20796. return { r: r2 * 255, g: g * 255, b: b * 255 };
  20797. }
  20798. function rgbToHsv(r2, g, b) {
  20799. r2 = bound01$1(r2, 255);
  20800. g = bound01$1(g, 255);
  20801. b = bound01$1(b, 255);
  20802. var max2 = Math.max(r2, g, b);
  20803. var min2 = Math.min(r2, g, b);
  20804. var h2 = 0;
  20805. var v = max2;
  20806. var d2 = max2 - min2;
  20807. var s = max2 === 0 ? 0 : d2 / max2;
  20808. if (max2 === min2) {
  20809. h2 = 0;
  20810. } else {
  20811. switch (max2) {
  20812. case r2:
  20813. h2 = (g - b) / d2 + (g < b ? 6 : 0);
  20814. break;
  20815. case g:
  20816. h2 = (b - r2) / d2 + 2;
  20817. break;
  20818. case b:
  20819. h2 = (r2 - g) / d2 + 4;
  20820. break;
  20821. }
  20822. h2 /= 6;
  20823. }
  20824. return { h: h2, s, v };
  20825. }
  20826. function hsvToRgb(h2, s, v) {
  20827. h2 = bound01$1(h2, 360) * 6;
  20828. s = bound01$1(s, 100);
  20829. v = bound01$1(v, 100);
  20830. var i2 = Math.floor(h2);
  20831. var f = h2 - i2;
  20832. var p = v * (1 - s);
  20833. var q2 = v * (1 - f * s);
  20834. var t2 = v * (1 - (1 - f) * s);
  20835. var mod = i2 % 6;
  20836. var r2 = [v, q2, p, p, t2, v][mod];
  20837. var g = [t2, v, v, q2, p, p][mod];
  20838. var b = [p, p, t2, v, v, q2][mod];
  20839. return { r: r2 * 255, g: g * 255, b: b * 255 };
  20840. }
  20841. function rgbToHex(r2, g, b, allow3Char) {
  20842. var hex = [
  20843. pad2(Math.round(r2).toString(16)),
  20844. pad2(Math.round(g).toString(16)),
  20845. pad2(Math.round(b).toString(16))
  20846. ];
  20847. if (allow3Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1))) {
  20848. return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
  20849. }
  20850. return hex.join("");
  20851. }
  20852. function rgbaToHex(r2, g, b, a, allow4Char) {
  20853. var hex = [
  20854. pad2(Math.round(r2).toString(16)),
  20855. pad2(Math.round(g).toString(16)),
  20856. pad2(Math.round(b).toString(16)),
  20857. pad2(convertDecimalToHex(a))
  20858. ];
  20859. if (allow4Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1)) && hex[3].startsWith(hex[3].charAt(1))) {
  20860. return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
  20861. }
  20862. return hex.join("");
  20863. }
  20864. function convertDecimalToHex(d2) {
  20865. return Math.round(parseFloat(d2) * 255).toString(16);
  20866. }
  20867. function convertHexToDecimal(h2) {
  20868. return parseIntFromHex(h2) / 255;
  20869. }
  20870. function parseIntFromHex(val) {
  20871. return parseInt(val, 16);
  20872. }
  20873. function numberInputToObject(color2) {
  20874. return {
  20875. r: color2 >> 16,
  20876. g: (color2 & 65280) >> 8,
  20877. b: color2 & 255
  20878. };
  20879. }
  20880. var names = {
  20881. aliceblue: "#f0f8ff",
  20882. antiquewhite: "#faebd7",
  20883. aqua: "#00ffff",
  20884. aquamarine: "#7fffd4",
  20885. azure: "#f0ffff",
  20886. beige: "#f5f5dc",
  20887. bisque: "#ffe4c4",
  20888. black: "#000000",
  20889. blanchedalmond: "#ffebcd",
  20890. blue: "#0000ff",
  20891. blueviolet: "#8a2be2",
  20892. brown: "#a52a2a",
  20893. burlywood: "#deb887",
  20894. cadetblue: "#5f9ea0",
  20895. chartreuse: "#7fff00",
  20896. chocolate: "#d2691e",
  20897. coral: "#ff7f50",
  20898. cornflowerblue: "#6495ed",
  20899. cornsilk: "#fff8dc",
  20900. crimson: "#dc143c",
  20901. cyan: "#00ffff",
  20902. darkblue: "#00008b",
  20903. darkcyan: "#008b8b",
  20904. darkgoldenrod: "#b8860b",
  20905. darkgray: "#a9a9a9",
  20906. darkgreen: "#006400",
  20907. darkgrey: "#a9a9a9",
  20908. darkkhaki: "#bdb76b",
  20909. darkmagenta: "#8b008b",
  20910. darkolivegreen: "#556b2f",
  20911. darkorange: "#ff8c00",
  20912. darkorchid: "#9932cc",
  20913. darkred: "#8b0000",
  20914. darksalmon: "#e9967a",
  20915. darkseagreen: "#8fbc8f",
  20916. darkslateblue: "#483d8b",
  20917. darkslategray: "#2f4f4f",
  20918. darkslategrey: "#2f4f4f",
  20919. darkturquoise: "#00ced1",
  20920. darkviolet: "#9400d3",
  20921. deeppink: "#ff1493",
  20922. deepskyblue: "#00bfff",
  20923. dimgray: "#696969",
  20924. dimgrey: "#696969",
  20925. dodgerblue: "#1e90ff",
  20926. firebrick: "#b22222",
  20927. floralwhite: "#fffaf0",
  20928. forestgreen: "#228b22",
  20929. fuchsia: "#ff00ff",
  20930. gainsboro: "#dcdcdc",
  20931. ghostwhite: "#f8f8ff",
  20932. goldenrod: "#daa520",
  20933. gold: "#ffd700",
  20934. gray: "#808080",
  20935. green: "#008000",
  20936. greenyellow: "#adff2f",
  20937. grey: "#808080",
  20938. honeydew: "#f0fff0",
  20939. hotpink: "#ff69b4",
  20940. indianred: "#cd5c5c",
  20941. indigo: "#4b0082",
  20942. ivory: "#fffff0",
  20943. khaki: "#f0e68c",
  20944. lavenderblush: "#fff0f5",
  20945. lavender: "#e6e6fa",
  20946. lawngreen: "#7cfc00",
  20947. lemonchiffon: "#fffacd",
  20948. lightblue: "#add8e6",
  20949. lightcoral: "#f08080",
  20950. lightcyan: "#e0ffff",
  20951. lightgoldenrodyellow: "#fafad2",
  20952. lightgray: "#d3d3d3",
  20953. lightgreen: "#90ee90",
  20954. lightgrey: "#d3d3d3",
  20955. lightpink: "#ffb6c1",
  20956. lightsalmon: "#ffa07a",
  20957. lightseagreen: "#20b2aa",
  20958. lightskyblue: "#87cefa",
  20959. lightslategray: "#778899",
  20960. lightslategrey: "#778899",
  20961. lightsteelblue: "#b0c4de",
  20962. lightyellow: "#ffffe0",
  20963. lime: "#00ff00",
  20964. limegreen: "#32cd32",
  20965. linen: "#faf0e6",
  20966. magenta: "#ff00ff",
  20967. maroon: "#800000",
  20968. mediumaquamarine: "#66cdaa",
  20969. mediumblue: "#0000cd",
  20970. mediumorchid: "#ba55d3",
  20971. mediumpurple: "#9370db",
  20972. mediumseagreen: "#3cb371",
  20973. mediumslateblue: "#7b68ee",
  20974. mediumspringgreen: "#00fa9a",
  20975. mediumturquoise: "#48d1cc",
  20976. mediumvioletred: "#c71585",
  20977. midnightblue: "#191970",
  20978. mintcream: "#f5fffa",
  20979. mistyrose: "#ffe4e1",
  20980. moccasin: "#ffe4b5",
  20981. navajowhite: "#ffdead",
  20982. navy: "#000080",
  20983. oldlace: "#fdf5e6",
  20984. olive: "#808000",
  20985. olivedrab: "#6b8e23",
  20986. orange: "#ffa500",
  20987. orangered: "#ff4500",
  20988. orchid: "#da70d6",
  20989. palegoldenrod: "#eee8aa",
  20990. palegreen: "#98fb98",
  20991. paleturquoise: "#afeeee",
  20992. palevioletred: "#db7093",
  20993. papayawhip: "#ffefd5",
  20994. peachpuff: "#ffdab9",
  20995. peru: "#cd853f",
  20996. pink: "#ffc0cb",
  20997. plum: "#dda0dd",
  20998. powderblue: "#b0e0e6",
  20999. purple: "#800080",
  21000. rebeccapurple: "#663399",
  21001. red: "#ff0000",
  21002. rosybrown: "#bc8f8f",
  21003. royalblue: "#4169e1",
  21004. saddlebrown: "#8b4513",
  21005. salmon: "#fa8072",
  21006. sandybrown: "#f4a460",
  21007. seagreen: "#2e8b57",
  21008. seashell: "#fff5ee",
  21009. sienna: "#a0522d",
  21010. silver: "#c0c0c0",
  21011. skyblue: "#87ceeb",
  21012. slateblue: "#6a5acd",
  21013. slategray: "#708090",
  21014. slategrey: "#708090",
  21015. snow: "#fffafa",
  21016. springgreen: "#00ff7f",
  21017. steelblue: "#4682b4",
  21018. tan: "#d2b48c",
  21019. teal: "#008080",
  21020. thistle: "#d8bfd8",
  21021. tomato: "#ff6347",
  21022. turquoise: "#40e0d0",
  21023. violet: "#ee82ee",
  21024. wheat: "#f5deb3",
  21025. white: "#ffffff",
  21026. whitesmoke: "#f5f5f5",
  21027. yellow: "#ffff00",
  21028. yellowgreen: "#9acd32"
  21029. };
  21030. function inputToRGB(color2) {
  21031. var rgb = { r: 0, g: 0, b: 0 };
  21032. var a = 1;
  21033. var s = null;
  21034. var v = null;
  21035. var l = null;
  21036. var ok = false;
  21037. var format = false;
  21038. if (typeof color2 === "string") {
  21039. color2 = stringInputToObject(color2);
  21040. }
  21041. if (typeof color2 === "object") {
  21042. if (isValidCSSUnit(color2.r) && isValidCSSUnit(color2.g) && isValidCSSUnit(color2.b)) {
  21043. rgb = rgbToRgb(color2.r, color2.g, color2.b);
  21044. ok = true;
  21045. format = String(color2.r).substr(-1) === "%" ? "prgb" : "rgb";
  21046. } else if (isValidCSSUnit(color2.h) && isValidCSSUnit(color2.s) && isValidCSSUnit(color2.v)) {
  21047. s = convertToPercentage(color2.s);
  21048. v = convertToPercentage(color2.v);
  21049. rgb = hsvToRgb(color2.h, s, v);
  21050. ok = true;
  21051. format = "hsv";
  21052. } else if (isValidCSSUnit(color2.h) && isValidCSSUnit(color2.s) && isValidCSSUnit(color2.l)) {
  21053. s = convertToPercentage(color2.s);
  21054. l = convertToPercentage(color2.l);
  21055. rgb = hslToRgb(color2.h, s, l);
  21056. ok = true;
  21057. format = "hsl";
  21058. }
  21059. if (Object.prototype.hasOwnProperty.call(color2, "a")) {
  21060. a = color2.a;
  21061. }
  21062. }
  21063. a = boundAlpha(a);
  21064. return {
  21065. ok,
  21066. format: color2.format || format,
  21067. r: Math.min(255, Math.max(rgb.r, 0)),
  21068. g: Math.min(255, Math.max(rgb.g, 0)),
  21069. b: Math.min(255, Math.max(rgb.b, 0)),
  21070. a
  21071. };
  21072. }
  21073. var CSS_INTEGER = "[-\\+]?\\d+%?";
  21074. var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
  21075. var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
  21076. var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
  21077. var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
  21078. var matchers = {
  21079. CSS_UNIT: new RegExp(CSS_UNIT),
  21080. rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
  21081. rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
  21082. hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
  21083. hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
  21084. hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
  21085. hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
  21086. hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  21087. hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
  21088. hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  21089. hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
  21090. };
  21091. function stringInputToObject(color2) {
  21092. color2 = color2.trim().toLowerCase();
  21093. if (color2.length === 0) {
  21094. return false;
  21095. }
  21096. var named = false;
  21097. if (names[color2]) {
  21098. color2 = names[color2];
  21099. named = true;
  21100. } else if (color2 === "transparent") {
  21101. return { r: 0, g: 0, b: 0, a: 0, format: "name" };
  21102. }
  21103. var match = matchers.rgb.exec(color2);
  21104. if (match) {
  21105. return { r: match[1], g: match[2], b: match[3] };
  21106. }
  21107. match = matchers.rgba.exec(color2);
  21108. if (match) {
  21109. return { r: match[1], g: match[2], b: match[3], a: match[4] };
  21110. }
  21111. match = matchers.hsl.exec(color2);
  21112. if (match) {
  21113. return { h: match[1], s: match[2], l: match[3] };
  21114. }
  21115. match = matchers.hsla.exec(color2);
  21116. if (match) {
  21117. return { h: match[1], s: match[2], l: match[3], a: match[4] };
  21118. }
  21119. match = matchers.hsv.exec(color2);
  21120. if (match) {
  21121. return { h: match[1], s: match[2], v: match[3] };
  21122. }
  21123. match = matchers.hsva.exec(color2);
  21124. if (match) {
  21125. return { h: match[1], s: match[2], v: match[3], a: match[4] };
  21126. }
  21127. match = matchers.hex8.exec(color2);
  21128. if (match) {
  21129. return {
  21130. r: parseIntFromHex(match[1]),
  21131. g: parseIntFromHex(match[2]),
  21132. b: parseIntFromHex(match[3]),
  21133. a: convertHexToDecimal(match[4]),
  21134. format: named ? "name" : "hex8"
  21135. };
  21136. }
  21137. match = matchers.hex6.exec(color2);
  21138. if (match) {
  21139. return {
  21140. r: parseIntFromHex(match[1]),
  21141. g: parseIntFromHex(match[2]),
  21142. b: parseIntFromHex(match[3]),
  21143. format: named ? "name" : "hex"
  21144. };
  21145. }
  21146. match = matchers.hex4.exec(color2);
  21147. if (match) {
  21148. return {
  21149. r: parseIntFromHex(match[1] + match[1]),
  21150. g: parseIntFromHex(match[2] + match[2]),
  21151. b: parseIntFromHex(match[3] + match[3]),
  21152. a: convertHexToDecimal(match[4] + match[4]),
  21153. format: named ? "name" : "hex8"
  21154. };
  21155. }
  21156. match = matchers.hex3.exec(color2);
  21157. if (match) {
  21158. return {
  21159. r: parseIntFromHex(match[1] + match[1]),
  21160. g: parseIntFromHex(match[2] + match[2]),
  21161. b: parseIntFromHex(match[3] + match[3]),
  21162. format: named ? "name" : "hex"
  21163. };
  21164. }
  21165. return false;
  21166. }
  21167. function isValidCSSUnit(color2) {
  21168. return Boolean(matchers.CSS_UNIT.exec(String(color2)));
  21169. }
  21170. var TinyColor = function() {
  21171. function TinyColor2(color2, opts) {
  21172. if (color2 === void 0) {
  21173. color2 = "";
  21174. }
  21175. if (opts === void 0) {
  21176. opts = {};
  21177. }
  21178. var _a2;
  21179. if (color2 instanceof TinyColor2) {
  21180. return color2;
  21181. }
  21182. if (typeof color2 === "number") {
  21183. color2 = numberInputToObject(color2);
  21184. }
  21185. this.originalInput = color2;
  21186. var rgb = inputToRGB(color2);
  21187. this.originalInput = color2;
  21188. this.r = rgb.r;
  21189. this.g = rgb.g;
  21190. this.b = rgb.b;
  21191. this.a = rgb.a;
  21192. this.roundA = Math.round(100 * this.a) / 100;
  21193. this.format = (_a2 = opts.format) !== null && _a2 !== void 0 ? _a2 : rgb.format;
  21194. this.gradientType = opts.gradientType;
  21195. if (this.r < 1) {
  21196. this.r = Math.round(this.r);
  21197. }
  21198. if (this.g < 1) {
  21199. this.g = Math.round(this.g);
  21200. }
  21201. if (this.b < 1) {
  21202. this.b = Math.round(this.b);
  21203. }
  21204. this.isValid = rgb.ok;
  21205. }
  21206. TinyColor2.prototype.isDark = function() {
  21207. return this.getBrightness() < 128;
  21208. };
  21209. TinyColor2.prototype.isLight = function() {
  21210. return !this.isDark();
  21211. };
  21212. TinyColor2.prototype.getBrightness = function() {
  21213. var rgb = this.toRgb();
  21214. return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3;
  21215. };
  21216. TinyColor2.prototype.getLuminance = function() {
  21217. var rgb = this.toRgb();
  21218. var R2;
  21219. var G2;
  21220. var B2;
  21221. var RsRGB = rgb.r / 255;
  21222. var GsRGB = rgb.g / 255;
  21223. var BsRGB = rgb.b / 255;
  21224. if (RsRGB <= 0.03928) {
  21225. R2 = RsRGB / 12.92;
  21226. } else {
  21227. R2 = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
  21228. }
  21229. if (GsRGB <= 0.03928) {
  21230. G2 = GsRGB / 12.92;
  21231. } else {
  21232. G2 = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
  21233. }
  21234. if (BsRGB <= 0.03928) {
  21235. B2 = BsRGB / 12.92;
  21236. } else {
  21237. B2 = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
  21238. }
  21239. return 0.2126 * R2 + 0.7152 * G2 + 0.0722 * B2;
  21240. };
  21241. TinyColor2.prototype.getAlpha = function() {
  21242. return this.a;
  21243. };
  21244. TinyColor2.prototype.setAlpha = function(alpha) {
  21245. this.a = boundAlpha(alpha);
  21246. this.roundA = Math.round(100 * this.a) / 100;
  21247. return this;
  21248. };
  21249. TinyColor2.prototype.isMonochrome = function() {
  21250. var s = this.toHsl().s;
  21251. return s === 0;
  21252. };
  21253. TinyColor2.prototype.toHsv = function() {
  21254. var hsv = rgbToHsv(this.r, this.g, this.b);
  21255. return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };
  21256. };
  21257. TinyColor2.prototype.toHsvString = function() {
  21258. var hsv = rgbToHsv(this.r, this.g, this.b);
  21259. var h2 = Math.round(hsv.h * 360);
  21260. var s = Math.round(hsv.s * 100);
  21261. var v = Math.round(hsv.v * 100);
  21262. return this.a === 1 ? "hsv(".concat(h2, ", ").concat(s, "%, ").concat(v, "%)") : "hsva(".concat(h2, ", ").concat(s, "%, ").concat(v, "%, ").concat(this.roundA, ")");
  21263. };
  21264. TinyColor2.prototype.toHsl = function() {
  21265. var hsl = rgbToHsl(this.r, this.g, this.b);
  21266. return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };
  21267. };
  21268. TinyColor2.prototype.toHslString = function() {
  21269. var hsl = rgbToHsl(this.r, this.g, this.b);
  21270. var h2 = Math.round(hsl.h * 360);
  21271. var s = Math.round(hsl.s * 100);
  21272. var l = Math.round(hsl.l * 100);
  21273. return this.a === 1 ? "hsl(".concat(h2, ", ").concat(s, "%, ").concat(l, "%)") : "hsla(".concat(h2, ", ").concat(s, "%, ").concat(l, "%, ").concat(this.roundA, ")");
  21274. };
  21275. TinyColor2.prototype.toHex = function(allow3Char) {
  21276. if (allow3Char === void 0) {
  21277. allow3Char = false;
  21278. }
  21279. return rgbToHex(this.r, this.g, this.b, allow3Char);
  21280. };
  21281. TinyColor2.prototype.toHexString = function(allow3Char) {
  21282. if (allow3Char === void 0) {
  21283. allow3Char = false;
  21284. }
  21285. return "#" + this.toHex(allow3Char);
  21286. };
  21287. TinyColor2.prototype.toHex8 = function(allow4Char) {
  21288. if (allow4Char === void 0) {
  21289. allow4Char = false;
  21290. }
  21291. return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);
  21292. };
  21293. TinyColor2.prototype.toHex8String = function(allow4Char) {
  21294. if (allow4Char === void 0) {
  21295. allow4Char = false;
  21296. }
  21297. return "#" + this.toHex8(allow4Char);
  21298. };
  21299. TinyColor2.prototype.toHexShortString = function(allowShortChar) {
  21300. if (allowShortChar === void 0) {
  21301. allowShortChar = false;
  21302. }
  21303. return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
  21304. };
  21305. TinyColor2.prototype.toRgb = function() {
  21306. return {
  21307. r: Math.round(this.r),
  21308. g: Math.round(this.g),
  21309. b: Math.round(this.b),
  21310. a: this.a
  21311. };
  21312. };
  21313. TinyColor2.prototype.toRgbString = function() {
  21314. var r2 = Math.round(this.r);
  21315. var g = Math.round(this.g);
  21316. var b = Math.round(this.b);
  21317. return this.a === 1 ? "rgb(".concat(r2, ", ").concat(g, ", ").concat(b, ")") : "rgba(".concat(r2, ", ").concat(g, ", ").concat(b, ", ").concat(this.roundA, ")");
  21318. };
  21319. TinyColor2.prototype.toPercentageRgb = function() {
  21320. var fmt = function(x) {
  21321. return "".concat(Math.round(bound01$1(x, 255) * 100), "%");
  21322. };
  21323. return {
  21324. r: fmt(this.r),
  21325. g: fmt(this.g),
  21326. b: fmt(this.b),
  21327. a: this.a
  21328. };
  21329. };
  21330. TinyColor2.prototype.toPercentageRgbString = function() {
  21331. var rnd = function(x) {
  21332. return Math.round(bound01$1(x, 255) * 100);
  21333. };
  21334. return this.a === 1 ? "rgb(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%)") : "rgba(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%, ").concat(this.roundA, ")");
  21335. };
  21336. TinyColor2.prototype.toName = function() {
  21337. if (this.a === 0) {
  21338. return "transparent";
  21339. }
  21340. if (this.a < 1) {
  21341. return false;
  21342. }
  21343. var hex = "#" + rgbToHex(this.r, this.g, this.b, false);
  21344. for (var _i = 0, _a2 = Object.entries(names); _i < _a2.length; _i++) {
  21345. var _b = _a2[_i], key = _b[0], value = _b[1];
  21346. if (hex === value) {
  21347. return key;
  21348. }
  21349. }
  21350. return false;
  21351. };
  21352. TinyColor2.prototype.toString = function(format) {
  21353. var formatSet = Boolean(format);
  21354. format = format !== null && format !== void 0 ? format : this.format;
  21355. var formattedString = false;
  21356. var hasAlpha = this.a < 1 && this.a >= 0;
  21357. var needsAlphaFormat = !formatSet && hasAlpha && (format.startsWith("hex") || format === "name");
  21358. if (needsAlphaFormat) {
  21359. if (format === "name" && this.a === 0) {
  21360. return this.toName();
  21361. }
  21362. return this.toRgbString();
  21363. }
  21364. if (format === "rgb") {
  21365. formattedString = this.toRgbString();
  21366. }
  21367. if (format === "prgb") {
  21368. formattedString = this.toPercentageRgbString();
  21369. }
  21370. if (format === "hex" || format === "hex6") {
  21371. formattedString = this.toHexString();
  21372. }
  21373. if (format === "hex3") {
  21374. formattedString = this.toHexString(true);
  21375. }
  21376. if (format === "hex4") {
  21377. formattedString = this.toHex8String(true);
  21378. }
  21379. if (format === "hex8") {
  21380. formattedString = this.toHex8String();
  21381. }
  21382. if (format === "name") {
  21383. formattedString = this.toName();
  21384. }
  21385. if (format === "hsl") {
  21386. formattedString = this.toHslString();
  21387. }
  21388. if (format === "hsv") {
  21389. formattedString = this.toHsvString();
  21390. }
  21391. return formattedString || this.toHexString();
  21392. };
  21393. TinyColor2.prototype.toNumber = function() {
  21394. return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
  21395. };
  21396. TinyColor2.prototype.clone = function() {
  21397. return new TinyColor2(this.toString());
  21398. };
  21399. TinyColor2.prototype.lighten = function(amount) {
  21400. if (amount === void 0) {
  21401. amount = 10;
  21402. }
  21403. var hsl = this.toHsl();
  21404. hsl.l += amount / 100;
  21405. hsl.l = clamp01(hsl.l);
  21406. return new TinyColor2(hsl);
  21407. };
  21408. TinyColor2.prototype.brighten = function(amount) {
  21409. if (amount === void 0) {
  21410. amount = 10;
  21411. }
  21412. var rgb = this.toRgb();
  21413. rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
  21414. rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
  21415. rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
  21416. return new TinyColor2(rgb);
  21417. };
  21418. TinyColor2.prototype.darken = function(amount) {
  21419. if (amount === void 0) {
  21420. amount = 10;
  21421. }
  21422. var hsl = this.toHsl();
  21423. hsl.l -= amount / 100;
  21424. hsl.l = clamp01(hsl.l);
  21425. return new TinyColor2(hsl);
  21426. };
  21427. TinyColor2.prototype.tint = function(amount) {
  21428. if (amount === void 0) {
  21429. amount = 10;
  21430. }
  21431. return this.mix("white", amount);
  21432. };
  21433. TinyColor2.prototype.shade = function(amount) {
  21434. if (amount === void 0) {
  21435. amount = 10;
  21436. }
  21437. return this.mix("black", amount);
  21438. };
  21439. TinyColor2.prototype.desaturate = function(amount) {
  21440. if (amount === void 0) {
  21441. amount = 10;
  21442. }
  21443. var hsl = this.toHsl();
  21444. hsl.s -= amount / 100;
  21445. hsl.s = clamp01(hsl.s);
  21446. return new TinyColor2(hsl);
  21447. };
  21448. TinyColor2.prototype.saturate = function(amount) {
  21449. if (amount === void 0) {
  21450. amount = 10;
  21451. }
  21452. var hsl = this.toHsl();
  21453. hsl.s += amount / 100;
  21454. hsl.s = clamp01(hsl.s);
  21455. return new TinyColor2(hsl);
  21456. };
  21457. TinyColor2.prototype.greyscale = function() {
  21458. return this.desaturate(100);
  21459. };
  21460. TinyColor2.prototype.spin = function(amount) {
  21461. var hsl = this.toHsl();
  21462. var hue = (hsl.h + amount) % 360;
  21463. hsl.h = hue < 0 ? 360 + hue : hue;
  21464. return new TinyColor2(hsl);
  21465. };
  21466. TinyColor2.prototype.mix = function(color2, amount) {
  21467. if (amount === void 0) {
  21468. amount = 50;
  21469. }
  21470. var rgb1 = this.toRgb();
  21471. var rgb2 = new TinyColor2(color2).toRgb();
  21472. var p = amount / 100;
  21473. var rgba = {
  21474. r: (rgb2.r - rgb1.r) * p + rgb1.r,
  21475. g: (rgb2.g - rgb1.g) * p + rgb1.g,
  21476. b: (rgb2.b - rgb1.b) * p + rgb1.b,
  21477. a: (rgb2.a - rgb1.a) * p + rgb1.a
  21478. };
  21479. return new TinyColor2(rgba);
  21480. };
  21481. TinyColor2.prototype.analogous = function(results, slices) {
  21482. if (results === void 0) {
  21483. results = 6;
  21484. }
  21485. if (slices === void 0) {
  21486. slices = 30;
  21487. }
  21488. var hsl = this.toHsl();
  21489. var part = 360 / slices;
  21490. var ret = [this];
  21491. for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results; ) {
  21492. hsl.h = (hsl.h + part) % 360;
  21493. ret.push(new TinyColor2(hsl));
  21494. }
  21495. return ret;
  21496. };
  21497. TinyColor2.prototype.complement = function() {
  21498. var hsl = this.toHsl();
  21499. hsl.h = (hsl.h + 180) % 360;
  21500. return new TinyColor2(hsl);
  21501. };
  21502. TinyColor2.prototype.monochromatic = function(results) {
  21503. if (results === void 0) {
  21504. results = 6;
  21505. }
  21506. var hsv = this.toHsv();
  21507. var h2 = hsv.h;
  21508. var s = hsv.s;
  21509. var v = hsv.v;
  21510. var res = [];
  21511. var modification = 1 / results;
  21512. while (results--) {
  21513. res.push(new TinyColor2({ h: h2, s, v }));
  21514. v = (v + modification) % 1;
  21515. }
  21516. return res;
  21517. };
  21518. TinyColor2.prototype.splitcomplement = function() {
  21519. var hsl = this.toHsl();
  21520. var h2 = hsl.h;
  21521. return [
  21522. this,
  21523. new TinyColor2({ h: (h2 + 72) % 360, s: hsl.s, l: hsl.l }),
  21524. new TinyColor2({ h: (h2 + 216) % 360, s: hsl.s, l: hsl.l })
  21525. ];
  21526. };
  21527. TinyColor2.prototype.onBackground = function(background) {
  21528. var fg = this.toRgb();
  21529. var bg = new TinyColor2(background).toRgb();
  21530. var alpha = fg.a + bg.a * (1 - fg.a);
  21531. return new TinyColor2({
  21532. r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
  21533. g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
  21534. b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
  21535. a: alpha
  21536. });
  21537. };
  21538. TinyColor2.prototype.triad = function() {
  21539. return this.polyad(3);
  21540. };
  21541. TinyColor2.prototype.tetrad = function() {
  21542. return this.polyad(4);
  21543. };
  21544. TinyColor2.prototype.polyad = function(n) {
  21545. var hsl = this.toHsl();
  21546. var h2 = hsl.h;
  21547. var result = [this];
  21548. var increment = 360 / n;
  21549. for (var i2 = 1; i2 < n; i2++) {
  21550. result.push(new TinyColor2({ h: (h2 + i2 * increment) % 360, s: hsl.s, l: hsl.l }));
  21551. }
  21552. return result;
  21553. };
  21554. TinyColor2.prototype.equals = function(color2) {
  21555. return this.toRgbString() === new TinyColor2(color2).toRgbString();
  21556. };
  21557. return TinyColor2;
  21558. }();
  21559. function darken(color2, amount = 20) {
  21560. return color2.mix("#141414", amount).toString();
  21561. }
  21562. function useButtonCustomStyle(props) {
  21563. const _disabled = useFormDisabled();
  21564. const ns = useNamespace("button");
  21565. return computed$1(() => {
  21566. let styles = {};
  21567. const buttonColor = props.color;
  21568. if (buttonColor) {
  21569. const color2 = new TinyColor(buttonColor);
  21570. const activeBgColor = props.dark ? color2.tint(20).toString() : darken(color2, 20);
  21571. if (props.plain) {
  21572. styles = ns.cssVarBlock({
  21573. "bg-color": props.dark ? darken(color2, 90) : color2.tint(90).toString(),
  21574. "text-color": buttonColor,
  21575. "border-color": props.dark ? darken(color2, 50) : color2.tint(50).toString(),
  21576. "hover-text-color": `var(${ns.cssVarName("color-white")})`,
  21577. "hover-bg-color": buttonColor,
  21578. "hover-border-color": buttonColor,
  21579. "active-bg-color": activeBgColor,
  21580. "active-text-color": `var(${ns.cssVarName("color-white")})`,
  21581. "active-border-color": activeBgColor
  21582. });
  21583. if (_disabled.value) {
  21584. styles[ns.cssVarBlockName("disabled-bg-color")] = props.dark ? darken(color2, 90) : color2.tint(90).toString();
  21585. styles[ns.cssVarBlockName("disabled-text-color")] = props.dark ? darken(color2, 50) : color2.tint(50).toString();
  21586. styles[ns.cssVarBlockName("disabled-border-color")] = props.dark ? darken(color2, 80) : color2.tint(80).toString();
  21587. }
  21588. } else {
  21589. const hoverBgColor = props.dark ? darken(color2, 30) : color2.tint(30).toString();
  21590. const textColor = color2.isDark() ? `var(${ns.cssVarName("color-white")})` : `var(${ns.cssVarName("color-black")})`;
  21591. styles = ns.cssVarBlock({
  21592. "bg-color": buttonColor,
  21593. "text-color": textColor,
  21594. "border-color": buttonColor,
  21595. "hover-bg-color": hoverBgColor,
  21596. "hover-text-color": textColor,
  21597. "hover-border-color": hoverBgColor,
  21598. "active-bg-color": activeBgColor,
  21599. "active-border-color": activeBgColor
  21600. });
  21601. if (_disabled.value) {
  21602. const disabledButtonColor = props.dark ? darken(color2, 50) : color2.tint(50).toString();
  21603. styles[ns.cssVarBlockName("disabled-bg-color")] = disabledButtonColor;
  21604. styles[ns.cssVarBlockName("disabled-text-color")] = props.dark ? "rgba(255, 255, 255, 0.5)" : `var(${ns.cssVarName("color-white")})`;
  21605. styles[ns.cssVarBlockName("disabled-border-color")] = disabledButtonColor;
  21606. }
  21607. }
  21608. }
  21609. return styles;
  21610. });
  21611. }
  21612. const __default__$e = defineComponent({
  21613. name: "ElButton"
  21614. });
  21615. const _sfc_main$o = /* @__PURE__ */ defineComponent({
  21616. ...__default__$e,
  21617. props: buttonProps,
  21618. emits: buttonEmits,
  21619. setup(__props, { expose, emit }) {
  21620. const props = __props;
  21621. const buttonStyle = useButtonCustomStyle(props);
  21622. const ns = useNamespace("button");
  21623. const { _ref, _size, _type, _disabled, _props, shouldAddSpace, handleClick } = useButton(props, emit);
  21624. expose({
  21625. ref: _ref,
  21626. size: _size,
  21627. type: _type,
  21628. disabled: _disabled,
  21629. shouldAddSpace
  21630. });
  21631. return (_ctx, _cache) => {
  21632. return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), mergeProps({
  21633. ref_key: "_ref",
  21634. ref: _ref
  21635. }, unref(_props), {
  21636. class: [
  21637. unref(ns).b(),
  21638. unref(ns).m(unref(_type)),
  21639. unref(ns).m(unref(_size)),
  21640. unref(ns).is("disabled", unref(_disabled)),
  21641. unref(ns).is("loading", _ctx.loading),
  21642. unref(ns).is("plain", _ctx.plain),
  21643. unref(ns).is("round", _ctx.round),
  21644. unref(ns).is("circle", _ctx.circle),
  21645. unref(ns).is("text", _ctx.text),
  21646. unref(ns).is("link", _ctx.link),
  21647. unref(ns).is("has-bg", _ctx.bg)
  21648. ],
  21649. style: unref(buttonStyle),
  21650. onClick: unref(handleClick)
  21651. }), {
  21652. default: withCtx(() => [
  21653. _ctx.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
  21654. _ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(ElIcon), {
  21655. key: 1,
  21656. class: normalizeClass(unref(ns).is("loading"))
  21657. }, {
  21658. default: withCtx(() => [
  21659. (openBlock(), createBlock(resolveDynamicComponent(_ctx.loadingIcon)))
  21660. ]),
  21661. _: 1
  21662. }, 8, ["class"]))
  21663. ], 64)) : _ctx.icon || _ctx.$slots.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
  21664. default: withCtx(() => [
  21665. _ctx.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), { key: 0 })) : renderSlot(_ctx.$slots, "icon", { key: 1 })
  21666. ]),
  21667. _: 3
  21668. })) : createCommentVNode("v-if", true),
  21669. _ctx.$slots.default ? (openBlock(), createElementBlock("span", {
  21670. key: 2,
  21671. class: normalizeClass({ [unref(ns).em("text", "expand")]: unref(shouldAddSpace) })
  21672. }, [
  21673. renderSlot(_ctx.$slots, "default")
  21674. ], 2)) : createCommentVNode("v-if", true)
  21675. ]),
  21676. _: 3
  21677. }, 16, ["class", "style", "onClick"]);
  21678. };
  21679. }
  21680. });
  21681. var Button$2 = /* @__PURE__ */ _export_sfc$1(_sfc_main$o, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/button/src/button.vue"]]);
  21682. const buttonGroupProps = {
  21683. size: buttonProps.size,
  21684. type: buttonProps.type
  21685. };
  21686. const __default__$d = defineComponent({
  21687. name: "ElButtonGroup"
  21688. });
  21689. const _sfc_main$n = /* @__PURE__ */ defineComponent({
  21690. ...__default__$d,
  21691. props: buttonGroupProps,
  21692. setup(__props) {
  21693. const props = __props;
  21694. provide(buttonGroupContextKey, reactive({
  21695. size: toRef(props, "size"),
  21696. type: toRef(props, "type")
  21697. }));
  21698. const ns = useNamespace("button");
  21699. return (_ctx, _cache) => {
  21700. return openBlock(), createElementBlock("div", {
  21701. class: normalizeClass(`${unref(ns).b("group")}`)
  21702. }, [
  21703. renderSlot(_ctx.$slots, "default")
  21704. ], 2);
  21705. };
  21706. }
  21707. });
  21708. var ButtonGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$n, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/button/src/button-group.vue"]]);
  21709. const ElButton = withInstall(Button$2, {
  21710. ButtonGroup
  21711. });
  21712. const ElButtonGroup = withNoopInstall(ButtonGroup);
  21713. const nodeList = /* @__PURE__ */ new Map();
  21714. let startClick;
  21715. if (isClient) {
  21716. document.addEventListener("mousedown", (e) => startClick = e);
  21717. document.addEventListener("mouseup", (e) => {
  21718. for (const handlers of nodeList.values()) {
  21719. for (const { documentHandler } of handlers) {
  21720. documentHandler(e, startClick);
  21721. }
  21722. }
  21723. });
  21724. }
  21725. function createDocumentHandler(el, binding) {
  21726. let excludes = [];
  21727. if (Array.isArray(binding.arg)) {
  21728. excludes = binding.arg;
  21729. } else if (isElement(binding.arg)) {
  21730. excludes.push(binding.arg);
  21731. }
  21732. return function(mouseup, mousedown) {
  21733. const popperRef = binding.instance.popperRef;
  21734. const mouseUpTarget = mouseup.target;
  21735. const mouseDownTarget = mousedown == null ? void 0 : mousedown.target;
  21736. const isBound = !binding || !binding.instance;
  21737. const isTargetExists = !mouseUpTarget || !mouseDownTarget;
  21738. const isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
  21739. const isSelf = el === mouseUpTarget;
  21740. const isTargetExcluded = excludes.length && excludes.some((item) => item == null ? void 0 : item.contains(mouseUpTarget)) || excludes.length && excludes.includes(mouseDownTarget);
  21741. const isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
  21742. if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) {
  21743. return;
  21744. }
  21745. binding.value(mouseup, mousedown);
  21746. };
  21747. }
  21748. const ClickOutside = {
  21749. beforeMount(el, binding) {
  21750. if (!nodeList.has(el)) {
  21751. nodeList.set(el, []);
  21752. }
  21753. nodeList.get(el).push({
  21754. documentHandler: createDocumentHandler(el, binding),
  21755. bindingFn: binding.value
  21756. });
  21757. },
  21758. updated(el, binding) {
  21759. if (!nodeList.has(el)) {
  21760. nodeList.set(el, []);
  21761. }
  21762. const handlers = nodeList.get(el);
  21763. const oldHandlerIndex = handlers.findIndex((item) => item.bindingFn === binding.oldValue);
  21764. const newHandler = {
  21765. documentHandler: createDocumentHandler(el, binding),
  21766. bindingFn: binding.value
  21767. };
  21768. if (oldHandlerIndex >= 0) {
  21769. handlers.splice(oldHandlerIndex, 1, newHandler);
  21770. } else {
  21771. handlers.push(newHandler);
  21772. }
  21773. },
  21774. unmounted(el) {
  21775. nodeList.delete(el);
  21776. }
  21777. };
  21778. const REPEAT_INTERVAL = 100;
  21779. const REPEAT_DELAY = 600;
  21780. const vRepeatClick = {
  21781. beforeMount(el, binding) {
  21782. const value = binding.value;
  21783. const { interval = REPEAT_INTERVAL, delay = REPEAT_DELAY } = isFunction$3(value) ? {} : value;
  21784. let intervalId;
  21785. let delayId;
  21786. const handler = () => isFunction$3(value) ? value() : value.handler();
  21787. const clear = () => {
  21788. if (delayId) {
  21789. clearTimeout(delayId);
  21790. delayId = void 0;
  21791. }
  21792. if (intervalId) {
  21793. clearInterval(intervalId);
  21794. intervalId = void 0;
  21795. }
  21796. };
  21797. el.addEventListener("mousedown", (evt) => {
  21798. if (evt.button !== 0)
  21799. return;
  21800. clear();
  21801. handler();
  21802. document.addEventListener("mouseup", () => clear(), {
  21803. once: true
  21804. });
  21805. delayId = setTimeout(() => {
  21806. intervalId = setInterval(() => {
  21807. handler();
  21808. }, interval);
  21809. }, delay);
  21810. });
  21811. }
  21812. };
  21813. const radioPropsBase = buildProps({
  21814. size: useSizeProp,
  21815. disabled: Boolean,
  21816. label: {
  21817. type: [String, Number, Boolean],
  21818. default: ""
  21819. }
  21820. });
  21821. const radioProps = buildProps({
  21822. ...radioPropsBase,
  21823. modelValue: {
  21824. type: [String, Number, Boolean],
  21825. default: ""
  21826. },
  21827. name: {
  21828. type: String,
  21829. default: ""
  21830. },
  21831. border: Boolean
  21832. });
  21833. const radioEmits = {
  21834. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
  21835. [CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val)
  21836. };
  21837. const radioGroupKey = Symbol("radioGroupKey");
  21838. const useRadio = (props, emit) => {
  21839. const radioRef = ref();
  21840. const radioGroup = inject(radioGroupKey, void 0);
  21841. const isGroup = computed$1(() => !!radioGroup);
  21842. const modelValue = computed$1({
  21843. get() {
  21844. return isGroup.value ? radioGroup.modelValue : props.modelValue;
  21845. },
  21846. set(val) {
  21847. if (isGroup.value) {
  21848. radioGroup.changeEvent(val);
  21849. } else {
  21850. emit && emit(UPDATE_MODEL_EVENT, val);
  21851. }
  21852. radioRef.value.checked = props.modelValue === props.label;
  21853. }
  21854. });
  21855. const size = useFormSize(computed$1(() => radioGroup == null ? void 0 : radioGroup.size));
  21856. const disabled = useFormDisabled(computed$1(() => radioGroup == null ? void 0 : radioGroup.disabled));
  21857. const focus = ref(false);
  21858. const tabIndex = computed$1(() => {
  21859. return disabled.value || isGroup.value && modelValue.value !== props.label ? -1 : 0;
  21860. });
  21861. return {
  21862. radioRef,
  21863. isGroup,
  21864. radioGroup,
  21865. focus,
  21866. size,
  21867. disabled,
  21868. tabIndex,
  21869. modelValue
  21870. };
  21871. };
  21872. const _hoisted_1$e = ["value", "name", "disabled"];
  21873. const __default__$c = defineComponent({
  21874. name: "ElRadio"
  21875. });
  21876. const _sfc_main$m = /* @__PURE__ */ defineComponent({
  21877. ...__default__$c,
  21878. props: radioProps,
  21879. emits: radioEmits,
  21880. setup(__props, { emit }) {
  21881. const props = __props;
  21882. const ns = useNamespace("radio");
  21883. const { radioRef, radioGroup, focus, size, disabled, modelValue } = useRadio(props, emit);
  21884. function handleChange() {
  21885. nextTick(() => emit("change", modelValue.value));
  21886. }
  21887. return (_ctx, _cache) => {
  21888. var _a2;
  21889. return openBlock(), createElementBlock("label", {
  21890. class: normalizeClass([
  21891. unref(ns).b(),
  21892. unref(ns).is("disabled", unref(disabled)),
  21893. unref(ns).is("focus", unref(focus)),
  21894. unref(ns).is("bordered", _ctx.border),
  21895. unref(ns).is("checked", unref(modelValue) === _ctx.label),
  21896. unref(ns).m(unref(size))
  21897. ])
  21898. }, [
  21899. createElementVNode("span", {
  21900. class: normalizeClass([
  21901. unref(ns).e("input"),
  21902. unref(ns).is("disabled", unref(disabled)),
  21903. unref(ns).is("checked", unref(modelValue) === _ctx.label)
  21904. ])
  21905. }, [
  21906. withDirectives(createElementVNode("input", {
  21907. ref_key: "radioRef",
  21908. ref: radioRef,
  21909. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
  21910. class: normalizeClass(unref(ns).e("original")),
  21911. value: _ctx.label,
  21912. name: _ctx.name || ((_a2 = unref(radioGroup)) == null ? void 0 : _a2.name),
  21913. disabled: unref(disabled),
  21914. type: "radio",
  21915. onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
  21916. onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
  21917. onChange: handleChange
  21918. }, null, 42, _hoisted_1$e), [
  21919. [vModelRadio, unref(modelValue)]
  21920. ]),
  21921. createElementVNode("span", {
  21922. class: normalizeClass(unref(ns).e("inner"))
  21923. }, null, 2)
  21924. ], 2),
  21925. createElementVNode("span", {
  21926. class: normalizeClass(unref(ns).e("label")),
  21927. onKeydown: _cache[3] || (_cache[3] = withModifiers(() => {
  21928. }, ["stop"]))
  21929. }, [
  21930. renderSlot(_ctx.$slots, "default", {}, () => [
  21931. createTextVNode(toDisplayString(_ctx.label), 1)
  21932. ])
  21933. ], 34)
  21934. ], 2);
  21935. };
  21936. }
  21937. });
  21938. var Radio = /* @__PURE__ */ _export_sfc$1(_sfc_main$m, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/radio/src/radio.vue"]]);
  21939. const radioButtonProps = buildProps({
  21940. ...radioPropsBase,
  21941. name: {
  21942. type: String,
  21943. default: ""
  21944. }
  21945. });
  21946. const _hoisted_1$d = ["value", "name", "disabled"];
  21947. const __default__$b = defineComponent({
  21948. name: "ElRadioButton"
  21949. });
  21950. const _sfc_main$l = /* @__PURE__ */ defineComponent({
  21951. ...__default__$b,
  21952. props: radioButtonProps,
  21953. setup(__props) {
  21954. const props = __props;
  21955. const ns = useNamespace("radio");
  21956. const { radioRef, focus, size, disabled, modelValue, radioGroup } = useRadio(props);
  21957. const activeStyle = computed$1(() => {
  21958. return {
  21959. backgroundColor: (radioGroup == null ? void 0 : radioGroup.fill) || "",
  21960. borderColor: (radioGroup == null ? void 0 : radioGroup.fill) || "",
  21961. boxShadow: (radioGroup == null ? void 0 : radioGroup.fill) ? `-1px 0 0 0 ${radioGroup.fill}` : "",
  21962. color: (radioGroup == null ? void 0 : radioGroup.textColor) || ""
  21963. };
  21964. });
  21965. return (_ctx, _cache) => {
  21966. var _a2;
  21967. return openBlock(), createElementBlock("label", {
  21968. class: normalizeClass([
  21969. unref(ns).b("button"),
  21970. unref(ns).is("active", unref(modelValue) === _ctx.label),
  21971. unref(ns).is("disabled", unref(disabled)),
  21972. unref(ns).is("focus", unref(focus)),
  21973. unref(ns).bm("button", unref(size))
  21974. ])
  21975. }, [
  21976. withDirectives(createElementVNode("input", {
  21977. ref_key: "radioRef",
  21978. ref: radioRef,
  21979. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(modelValue) ? modelValue.value = $event : null),
  21980. class: normalizeClass(unref(ns).be("button", "original-radio")),
  21981. value: _ctx.label,
  21982. type: "radio",
  21983. name: _ctx.name || ((_a2 = unref(radioGroup)) == null ? void 0 : _a2.name),
  21984. disabled: unref(disabled),
  21985. onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
  21986. onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false)
  21987. }, null, 42, _hoisted_1$d), [
  21988. [vModelRadio, unref(modelValue)]
  21989. ]),
  21990. createElementVNode("span", {
  21991. class: normalizeClass(unref(ns).be("button", "inner")),
  21992. style: normalizeStyle(unref(modelValue) === _ctx.label ? unref(activeStyle) : {}),
  21993. onKeydown: _cache[3] || (_cache[3] = withModifiers(() => {
  21994. }, ["stop"]))
  21995. }, [
  21996. renderSlot(_ctx.$slots, "default", {}, () => [
  21997. createTextVNode(toDisplayString(_ctx.label), 1)
  21998. ])
  21999. ], 38)
  22000. ], 2);
  22001. };
  22002. }
  22003. });
  22004. var RadioButton = /* @__PURE__ */ _export_sfc$1(_sfc_main$l, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/radio/src/radio-button.vue"]]);
  22005. const radioGroupProps = buildProps({
  22006. id: {
  22007. type: String,
  22008. default: void 0
  22009. },
  22010. size: useSizeProp,
  22011. disabled: Boolean,
  22012. modelValue: {
  22013. type: [String, Number, Boolean],
  22014. default: ""
  22015. },
  22016. fill: {
  22017. type: String,
  22018. default: ""
  22019. },
  22020. label: {
  22021. type: String,
  22022. default: void 0
  22023. },
  22024. textColor: {
  22025. type: String,
  22026. default: ""
  22027. },
  22028. name: {
  22029. type: String,
  22030. default: void 0
  22031. },
  22032. validateEvent: {
  22033. type: Boolean,
  22034. default: true
  22035. }
  22036. });
  22037. const radioGroupEmits = radioEmits;
  22038. const _hoisted_1$c = ["id", "aria-label", "aria-labelledby"];
  22039. const __default__$a = defineComponent({
  22040. name: "ElRadioGroup"
  22041. });
  22042. const _sfc_main$k = /* @__PURE__ */ defineComponent({
  22043. ...__default__$a,
  22044. props: radioGroupProps,
  22045. emits: radioGroupEmits,
  22046. setup(__props, { emit }) {
  22047. const props = __props;
  22048. const ns = useNamespace("radio");
  22049. const radioId = useId();
  22050. const radioGroupRef = ref();
  22051. const { formItem } = useFormItem();
  22052. const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, {
  22053. formItemContext: formItem
  22054. });
  22055. const changeEvent = (value) => {
  22056. emit(UPDATE_MODEL_EVENT, value);
  22057. nextTick(() => emit("change", value));
  22058. };
  22059. onMounted(() => {
  22060. const radios = radioGroupRef.value.querySelectorAll("[type=radio]");
  22061. const firstLabel = radios[0];
  22062. if (!Array.from(radios).some((radio) => radio.checked) && firstLabel) {
  22063. firstLabel.tabIndex = 0;
  22064. }
  22065. });
  22066. const name = computed$1(() => {
  22067. return props.name || radioId.value;
  22068. });
  22069. provide(radioGroupKey, reactive({
  22070. ...toRefs(props),
  22071. changeEvent,
  22072. name
  22073. }));
  22074. watch(() => props.modelValue, () => {
  22075. if (props.validateEvent) {
  22076. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  22077. }
  22078. });
  22079. return (_ctx, _cache) => {
  22080. return openBlock(), createElementBlock("div", {
  22081. id: unref(groupId),
  22082. ref_key: "radioGroupRef",
  22083. ref: radioGroupRef,
  22084. class: normalizeClass(unref(ns).b("group")),
  22085. role: "radiogroup",
  22086. "aria-label": !unref(isLabeledByFormItem) ? _ctx.label || "radio-group" : void 0,
  22087. "aria-labelledby": unref(isLabeledByFormItem) ? unref(formItem).labelId : void 0
  22088. }, [
  22089. renderSlot(_ctx.$slots, "default")
  22090. ], 10, _hoisted_1$c);
  22091. };
  22092. }
  22093. });
  22094. var RadioGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$k, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/radio/src/radio-group.vue"]]);
  22095. withInstall(Radio, {
  22096. RadioButton,
  22097. RadioGroup
  22098. });
  22099. const ElRadioGroup = withNoopInstall(RadioGroup);
  22100. const ElRadioButton = withNoopInstall(RadioButton);
  22101. const tagProps = buildProps({
  22102. closable: Boolean,
  22103. type: {
  22104. type: String,
  22105. values: ["success", "info", "warning", "danger", ""],
  22106. default: ""
  22107. },
  22108. hit: Boolean,
  22109. disableTransitions: Boolean,
  22110. color: {
  22111. type: String,
  22112. default: ""
  22113. },
  22114. size: {
  22115. type: String,
  22116. values: componentSizes,
  22117. default: ""
  22118. },
  22119. effect: {
  22120. type: String,
  22121. values: ["dark", "light", "plain"],
  22122. default: "light"
  22123. },
  22124. round: Boolean
  22125. });
  22126. const tagEmits = {
  22127. close: (evt) => evt instanceof MouseEvent,
  22128. click: (evt) => evt instanceof MouseEvent
  22129. };
  22130. const __default__$9 = defineComponent({
  22131. name: "ElTag"
  22132. });
  22133. const _sfc_main$j = /* @__PURE__ */ defineComponent({
  22134. ...__default__$9,
  22135. props: tagProps,
  22136. emits: tagEmits,
  22137. setup(__props, { emit }) {
  22138. const props = __props;
  22139. const tagSize = useFormSize();
  22140. const ns = useNamespace("tag");
  22141. const classes = computed$1(() => {
  22142. const { type: type2, hit, effect, closable, round: round2 } = props;
  22143. return [
  22144. ns.b(),
  22145. ns.is("closable", closable),
  22146. ns.m(type2),
  22147. ns.m(tagSize.value),
  22148. ns.m(effect),
  22149. ns.is("hit", hit),
  22150. ns.is("round", round2)
  22151. ];
  22152. });
  22153. const handleClose = (event2) => {
  22154. emit("close", event2);
  22155. };
  22156. const handleClick = (event2) => {
  22157. emit("click", event2);
  22158. };
  22159. return (_ctx, _cache) => {
  22160. return _ctx.disableTransitions ? (openBlock(), createElementBlock("span", {
  22161. key: 0,
  22162. class: normalizeClass(unref(classes)),
  22163. style: normalizeStyle({ backgroundColor: _ctx.color }),
  22164. onClick: handleClick
  22165. }, [
  22166. createElementVNode("span", {
  22167. class: normalizeClass(unref(ns).e("content"))
  22168. }, [
  22169. renderSlot(_ctx.$slots, "default")
  22170. ], 2),
  22171. _ctx.closable ? (openBlock(), createBlock(unref(ElIcon), {
  22172. key: 0,
  22173. class: normalizeClass(unref(ns).e("close")),
  22174. onClick: withModifiers(handleClose, ["stop"])
  22175. }, {
  22176. default: withCtx(() => [
  22177. createVNode(unref(close_default))
  22178. ]),
  22179. _: 1
  22180. }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
  22181. ], 6)) : (openBlock(), createBlock(Transition, {
  22182. key: 1,
  22183. name: `${unref(ns).namespace.value}-zoom-in-center`,
  22184. appear: ""
  22185. }, {
  22186. default: withCtx(() => [
  22187. createElementVNode("span", {
  22188. class: normalizeClass(unref(classes)),
  22189. style: normalizeStyle({ backgroundColor: _ctx.color }),
  22190. onClick: handleClick
  22191. }, [
  22192. createElementVNode("span", {
  22193. class: normalizeClass(unref(ns).e("content"))
  22194. }, [
  22195. renderSlot(_ctx.$slots, "default")
  22196. ], 2),
  22197. _ctx.closable ? (openBlock(), createBlock(unref(ElIcon), {
  22198. key: 0,
  22199. class: normalizeClass(unref(ns).e("close")),
  22200. onClick: withModifiers(handleClose, ["stop"])
  22201. }, {
  22202. default: withCtx(() => [
  22203. createVNode(unref(close_default))
  22204. ]),
  22205. _: 1
  22206. }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
  22207. ], 6)
  22208. ]),
  22209. _: 3
  22210. }, 8, ["name"]));
  22211. };
  22212. }
  22213. });
  22214. var Tag = /* @__PURE__ */ _export_sfc$1(_sfc_main$j, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/tag/src/tag.vue"]]);
  22215. const ElTag = withInstall(Tag);
  22216. const emitChangeFn = (value) => typeof isNumber(value);
  22217. const collapseProps = buildProps({
  22218. accordion: Boolean,
  22219. modelValue: {
  22220. type: definePropType([Array, String, Number]),
  22221. default: () => mutable([])
  22222. }
  22223. });
  22224. const collapseEmits = {
  22225. [UPDATE_MODEL_EVENT]: emitChangeFn,
  22226. [CHANGE_EVENT]: emitChangeFn
  22227. };
  22228. const collapseContextKey = Symbol("collapseContextKey");
  22229. const useCollapse = (props, emit) => {
  22230. const activeNames = ref(castArray(props.modelValue));
  22231. const setActiveNames = (_activeNames) => {
  22232. activeNames.value = _activeNames;
  22233. const value = props.accordion ? activeNames.value[0] : activeNames.value;
  22234. emit(UPDATE_MODEL_EVENT, value);
  22235. emit(CHANGE_EVENT, value);
  22236. };
  22237. const handleItemClick = (name) => {
  22238. if (props.accordion) {
  22239. setActiveNames([activeNames.value[0] === name ? "" : name]);
  22240. } else {
  22241. const _activeNames = [...activeNames.value];
  22242. const index2 = _activeNames.indexOf(name);
  22243. if (index2 > -1) {
  22244. _activeNames.splice(index2, 1);
  22245. } else {
  22246. _activeNames.push(name);
  22247. }
  22248. setActiveNames(_activeNames);
  22249. }
  22250. };
  22251. watch(() => props.modelValue, () => activeNames.value = castArray(props.modelValue), { deep: true });
  22252. provide(collapseContextKey, {
  22253. activeNames,
  22254. handleItemClick
  22255. });
  22256. return {
  22257. activeNames,
  22258. setActiveNames
  22259. };
  22260. };
  22261. const useCollapseDOM = () => {
  22262. const ns = useNamespace("collapse");
  22263. const rootKls = computed$1(() => ns.b());
  22264. return {
  22265. rootKls
  22266. };
  22267. };
  22268. const __default__$8 = defineComponent({
  22269. name: "ElCollapse"
  22270. });
  22271. const _sfc_main$i = /* @__PURE__ */ defineComponent({
  22272. ...__default__$8,
  22273. props: collapseProps,
  22274. emits: collapseEmits,
  22275. setup(__props, { expose, emit }) {
  22276. const props = __props;
  22277. const { activeNames, setActiveNames } = useCollapse(props, emit);
  22278. const { rootKls } = useCollapseDOM();
  22279. expose({
  22280. activeNames,
  22281. setActiveNames
  22282. });
  22283. return (_ctx, _cache) => {
  22284. return openBlock(), createElementBlock("div", {
  22285. class: normalizeClass(unref(rootKls)),
  22286. role: "tablist",
  22287. "aria-multiselectable": "true"
  22288. }, [
  22289. renderSlot(_ctx.$slots, "default")
  22290. ], 2);
  22291. };
  22292. }
  22293. });
  22294. var Collapse = /* @__PURE__ */ _export_sfc$1(_sfc_main$i, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/collapse/src/collapse.vue"]]);
  22295. const __default__$7 = defineComponent({
  22296. name: "ElCollapseTransition"
  22297. });
  22298. const _sfc_main$h = /* @__PURE__ */ defineComponent({
  22299. ...__default__$7,
  22300. setup(__props) {
  22301. const ns = useNamespace("collapse-transition");
  22302. const on3 = {
  22303. beforeEnter(el) {
  22304. if (!el.dataset)
  22305. el.dataset = {};
  22306. el.dataset.oldPaddingTop = el.style.paddingTop;
  22307. el.dataset.oldPaddingBottom = el.style.paddingBottom;
  22308. el.style.maxHeight = 0;
  22309. el.style.paddingTop = 0;
  22310. el.style.paddingBottom = 0;
  22311. },
  22312. enter(el) {
  22313. el.dataset.oldOverflow = el.style.overflow;
  22314. if (el.scrollHeight !== 0) {
  22315. el.style.maxHeight = `${el.scrollHeight}px`;
  22316. el.style.paddingTop = el.dataset.oldPaddingTop;
  22317. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  22318. } else {
  22319. el.style.maxHeight = 0;
  22320. el.style.paddingTop = el.dataset.oldPaddingTop;
  22321. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  22322. }
  22323. el.style.overflow = "hidden";
  22324. },
  22325. afterEnter(el) {
  22326. el.style.maxHeight = "";
  22327. el.style.overflow = el.dataset.oldOverflow;
  22328. },
  22329. beforeLeave(el) {
  22330. if (!el.dataset)
  22331. el.dataset = {};
  22332. el.dataset.oldPaddingTop = el.style.paddingTop;
  22333. el.dataset.oldPaddingBottom = el.style.paddingBottom;
  22334. el.dataset.oldOverflow = el.style.overflow;
  22335. el.style.maxHeight = `${el.scrollHeight}px`;
  22336. el.style.overflow = "hidden";
  22337. },
  22338. leave(el) {
  22339. if (el.scrollHeight !== 0) {
  22340. el.style.maxHeight = 0;
  22341. el.style.paddingTop = 0;
  22342. el.style.paddingBottom = 0;
  22343. }
  22344. },
  22345. afterLeave(el) {
  22346. el.style.maxHeight = "";
  22347. el.style.overflow = el.dataset.oldOverflow;
  22348. el.style.paddingTop = el.dataset.oldPaddingTop;
  22349. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  22350. }
  22351. };
  22352. return (_ctx, _cache) => {
  22353. return openBlock(), createBlock(Transition, mergeProps({
  22354. name: unref(ns).b()
  22355. }, toHandlers(on3)), {
  22356. default: withCtx(() => [
  22357. renderSlot(_ctx.$slots, "default")
  22358. ]),
  22359. _: 3
  22360. }, 16, ["name"]);
  22361. };
  22362. }
  22363. });
  22364. var CollapseTransition = /* @__PURE__ */ _export_sfc$1(_sfc_main$h, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/collapse-transition/src/collapse-transition.vue"]]);
  22365. CollapseTransition.install = (app) => {
  22366. app.component(CollapseTransition.name, CollapseTransition);
  22367. };
  22368. const _CollapseTransition = CollapseTransition;
  22369. const collapseItemProps = buildProps({
  22370. title: {
  22371. type: String,
  22372. default: ""
  22373. },
  22374. name: {
  22375. type: definePropType([String, Number]),
  22376. default: () => generateId()
  22377. },
  22378. disabled: Boolean
  22379. });
  22380. const useCollapseItem = (props) => {
  22381. const collapse = inject(collapseContextKey);
  22382. const focusing = ref(false);
  22383. const isClick = ref(false);
  22384. const id = ref(generateId());
  22385. const isActive = computed$1(() => collapse == null ? void 0 : collapse.activeNames.value.includes(props.name));
  22386. const handleFocus = () => {
  22387. setTimeout(() => {
  22388. if (!isClick.value) {
  22389. focusing.value = true;
  22390. } else {
  22391. isClick.value = false;
  22392. }
  22393. }, 50);
  22394. };
  22395. const handleHeaderClick = () => {
  22396. if (props.disabled)
  22397. return;
  22398. collapse == null ? void 0 : collapse.handleItemClick(props.name);
  22399. focusing.value = false;
  22400. isClick.value = true;
  22401. };
  22402. const handleEnterClick = () => {
  22403. collapse == null ? void 0 : collapse.handleItemClick(props.name);
  22404. };
  22405. return {
  22406. focusing,
  22407. id,
  22408. isActive,
  22409. handleFocus,
  22410. handleHeaderClick,
  22411. handleEnterClick
  22412. };
  22413. };
  22414. const useCollapseItemDOM = (props, { focusing, isActive, id }) => {
  22415. const ns = useNamespace("collapse");
  22416. const rootKls = computed$1(() => [
  22417. ns.b("item"),
  22418. ns.is("active", unref(isActive)),
  22419. ns.is("disabled", props.disabled)
  22420. ]);
  22421. const headKls = computed$1(() => [
  22422. ns.be("item", "header"),
  22423. ns.is("active", unref(isActive)),
  22424. { focusing: unref(focusing) && !props.disabled }
  22425. ]);
  22426. const arrowKls = computed$1(() => [
  22427. ns.be("item", "arrow"),
  22428. ns.is("active", unref(isActive))
  22429. ]);
  22430. const itemWrapperKls = computed$1(() => ns.be("item", "wrap"));
  22431. const itemContentKls = computed$1(() => ns.be("item", "content"));
  22432. const scopedContentId = computed$1(() => ns.b(`content-${unref(id)}`));
  22433. const scopedHeadId = computed$1(() => ns.b(`head-${unref(id)}`));
  22434. return {
  22435. arrowKls,
  22436. headKls,
  22437. rootKls,
  22438. itemWrapperKls,
  22439. itemContentKls,
  22440. scopedContentId,
  22441. scopedHeadId
  22442. };
  22443. };
  22444. const _hoisted_1$b = ["aria-expanded", "aria-controls", "aria-describedby"];
  22445. const _hoisted_2$8 = ["id", "tabindex"];
  22446. const _hoisted_3$5 = ["id", "aria-hidden", "aria-labelledby"];
  22447. const __default__$6 = defineComponent({
  22448. name: "ElCollapseItem"
  22449. });
  22450. const _sfc_main$g = /* @__PURE__ */ defineComponent({
  22451. ...__default__$6,
  22452. props: collapseItemProps,
  22453. setup(__props, { expose }) {
  22454. const props = __props;
  22455. const {
  22456. focusing,
  22457. id,
  22458. isActive,
  22459. handleFocus,
  22460. handleHeaderClick,
  22461. handleEnterClick
  22462. } = useCollapseItem(props);
  22463. const {
  22464. arrowKls,
  22465. headKls,
  22466. rootKls,
  22467. itemWrapperKls,
  22468. itemContentKls,
  22469. scopedContentId,
  22470. scopedHeadId
  22471. } = useCollapseItemDOM(props, { focusing, isActive, id });
  22472. expose({
  22473. isActive
  22474. });
  22475. return (_ctx, _cache) => {
  22476. return openBlock(), createElementBlock("div", {
  22477. class: normalizeClass(unref(rootKls))
  22478. }, [
  22479. createElementVNode("div", {
  22480. role: "tab",
  22481. "aria-expanded": unref(isActive),
  22482. "aria-controls": unref(scopedContentId),
  22483. "aria-describedby": unref(scopedContentId)
  22484. }, [
  22485. createElementVNode("div", {
  22486. id: unref(scopedHeadId),
  22487. class: normalizeClass(unref(headKls)),
  22488. role: "button",
  22489. tabindex: _ctx.disabled ? -1 : 0,
  22490. onClick: _cache[0] || (_cache[0] = (...args) => unref(handleHeaderClick) && unref(handleHeaderClick)(...args)),
  22491. onKeypress: _cache[1] || (_cache[1] = withKeys(withModifiers((...args) => unref(handleEnterClick) && unref(handleEnterClick)(...args), ["stop", "prevent"]), ["space", "enter"])),
  22492. onFocus: _cache[2] || (_cache[2] = (...args) => unref(handleFocus) && unref(handleFocus)(...args)),
  22493. onBlur: _cache[3] || (_cache[3] = ($event) => focusing.value = false)
  22494. }, [
  22495. renderSlot(_ctx.$slots, "title", {}, () => [
  22496. createTextVNode(toDisplayString(_ctx.title), 1)
  22497. ]),
  22498. createVNode(unref(ElIcon), {
  22499. class: normalizeClass(unref(arrowKls))
  22500. }, {
  22501. default: withCtx(() => [
  22502. createVNode(unref(arrow_right_default))
  22503. ]),
  22504. _: 1
  22505. }, 8, ["class"])
  22506. ], 42, _hoisted_2$8)
  22507. ], 8, _hoisted_1$b),
  22508. createVNode(unref(_CollapseTransition), null, {
  22509. default: withCtx(() => [
  22510. withDirectives(createElementVNode("div", {
  22511. id: unref(scopedContentId),
  22512. class: normalizeClass(unref(itemWrapperKls)),
  22513. role: "tabpanel",
  22514. "aria-hidden": !unref(isActive),
  22515. "aria-labelledby": unref(scopedHeadId)
  22516. }, [
  22517. createElementVNode("div", {
  22518. class: normalizeClass(unref(itemContentKls))
  22519. }, [
  22520. renderSlot(_ctx.$slots, "default")
  22521. ], 2)
  22522. ], 10, _hoisted_3$5), [
  22523. [vShow, unref(isActive)]
  22524. ])
  22525. ]),
  22526. _: 3
  22527. })
  22528. ], 2);
  22529. };
  22530. }
  22531. });
  22532. var CollapseItem = /* @__PURE__ */ _export_sfc$1(_sfc_main$g, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/collapse/src/collapse-item.vue"]]);
  22533. const ElCollapse = withInstall(Collapse, {
  22534. CollapseItem
  22535. });
  22536. const ElCollapseItem = withNoopInstall(CollapseItem);
  22537. const alphaSliderProps = buildProps({
  22538. color: {
  22539. type: definePropType(Object),
  22540. required: true
  22541. },
  22542. vertical: {
  22543. type: Boolean,
  22544. default: false
  22545. }
  22546. });
  22547. let isDragging = false;
  22548. function draggable(element, options2) {
  22549. if (!isClient)
  22550. return;
  22551. const moveFn = function(event2) {
  22552. var _a2;
  22553. (_a2 = options2.drag) == null ? void 0 : _a2.call(options2, event2);
  22554. };
  22555. const upFn = function(event2) {
  22556. var _a2;
  22557. document.removeEventListener("mousemove", moveFn);
  22558. document.removeEventListener("mouseup", upFn);
  22559. document.removeEventListener("touchmove", moveFn);
  22560. document.removeEventListener("touchend", upFn);
  22561. document.onselectstart = null;
  22562. document.ondragstart = null;
  22563. isDragging = false;
  22564. (_a2 = options2.end) == null ? void 0 : _a2.call(options2, event2);
  22565. };
  22566. const downFn = function(event2) {
  22567. var _a2;
  22568. if (isDragging)
  22569. return;
  22570. event2.preventDefault();
  22571. document.onselectstart = () => false;
  22572. document.ondragstart = () => false;
  22573. document.addEventListener("mousemove", moveFn);
  22574. document.addEventListener("mouseup", upFn);
  22575. document.addEventListener("touchmove", moveFn);
  22576. document.addEventListener("touchend", upFn);
  22577. isDragging = true;
  22578. (_a2 = options2.start) == null ? void 0 : _a2.call(options2, event2);
  22579. };
  22580. element.addEventListener("mousedown", downFn);
  22581. element.addEventListener("touchstart", downFn);
  22582. }
  22583. const useAlphaSlider = (props) => {
  22584. const instance = getCurrentInstance();
  22585. const thumb = shallowRef();
  22586. const bar = shallowRef();
  22587. function handleClick(event2) {
  22588. const target = event2.target;
  22589. if (target !== thumb.value) {
  22590. handleDrag(event2);
  22591. }
  22592. }
  22593. function handleDrag(event2) {
  22594. if (!bar.value || !thumb.value)
  22595. return;
  22596. const el = instance.vnode.el;
  22597. const rect = el.getBoundingClientRect();
  22598. const { clientX, clientY } = getClientXY(event2);
  22599. if (!props.vertical) {
  22600. let left = clientX - rect.left;
  22601. left = Math.max(thumb.value.offsetWidth / 2, left);
  22602. left = Math.min(left, rect.width - thumb.value.offsetWidth / 2);
  22603. props.color.set("alpha", Math.round((left - thumb.value.offsetWidth / 2) / (rect.width - thumb.value.offsetWidth) * 100));
  22604. } else {
  22605. let top = clientY - rect.top;
  22606. top = Math.max(thumb.value.offsetHeight / 2, top);
  22607. top = Math.min(top, rect.height - thumb.value.offsetHeight / 2);
  22608. props.color.set("alpha", Math.round((top - thumb.value.offsetHeight / 2) / (rect.height - thumb.value.offsetHeight) * 100));
  22609. }
  22610. }
  22611. return {
  22612. thumb,
  22613. bar,
  22614. handleDrag,
  22615. handleClick
  22616. };
  22617. };
  22618. const useAlphaSliderDOM = (props, {
  22619. bar,
  22620. thumb,
  22621. handleDrag
  22622. }) => {
  22623. const instance = getCurrentInstance();
  22624. const ns = useNamespace("color-alpha-slider");
  22625. const thumbLeft = ref(0);
  22626. const thumbTop = ref(0);
  22627. const background = ref();
  22628. function getThumbLeft() {
  22629. if (!thumb.value)
  22630. return 0;
  22631. if (props.vertical)
  22632. return 0;
  22633. const el = instance.vnode.el;
  22634. const alpha = props.color.get("alpha");
  22635. if (!el)
  22636. return 0;
  22637. return Math.round(alpha * (el.offsetWidth - thumb.value.offsetWidth / 2) / 100);
  22638. }
  22639. function getThumbTop() {
  22640. if (!thumb.value)
  22641. return 0;
  22642. const el = instance.vnode.el;
  22643. if (!props.vertical)
  22644. return 0;
  22645. const alpha = props.color.get("alpha");
  22646. if (!el)
  22647. return 0;
  22648. return Math.round(alpha * (el.offsetHeight - thumb.value.offsetHeight / 2) / 100);
  22649. }
  22650. function getBackground() {
  22651. if (props.color && props.color.value) {
  22652. const { r: r2, g, b } = props.color.toRgb();
  22653. return `linear-gradient(to right, rgba(${r2}, ${g}, ${b}, 0) 0%, rgba(${r2}, ${g}, ${b}, 1) 100%)`;
  22654. }
  22655. return "";
  22656. }
  22657. function update() {
  22658. thumbLeft.value = getThumbLeft();
  22659. thumbTop.value = getThumbTop();
  22660. background.value = getBackground();
  22661. }
  22662. onMounted(() => {
  22663. if (!bar.value || !thumb.value)
  22664. return;
  22665. const dragConfig = {
  22666. drag: (event2) => {
  22667. handleDrag(event2);
  22668. },
  22669. end: (event2) => {
  22670. handleDrag(event2);
  22671. }
  22672. };
  22673. draggable(bar.value, dragConfig);
  22674. draggable(thumb.value, dragConfig);
  22675. update();
  22676. });
  22677. watch(() => props.color.get("alpha"), () => update());
  22678. watch(() => props.color.value, () => update());
  22679. const rootKls = computed$1(() => [ns.b(), ns.is("vertical", props.vertical)]);
  22680. const barKls = computed$1(() => ns.e("bar"));
  22681. const thumbKls = computed$1(() => ns.e("thumb"));
  22682. const barStyle = computed$1(() => ({ background: background.value }));
  22683. const thumbStyle = computed$1(() => ({
  22684. left: addUnit(thumbLeft.value),
  22685. top: addUnit(thumbTop.value)
  22686. }));
  22687. return { rootKls, barKls, barStyle, thumbKls, thumbStyle, update };
  22688. };
  22689. const COMPONENT_NAME$2 = "ElColorAlphaSlider";
  22690. const __default__$5 = defineComponent({
  22691. name: COMPONENT_NAME$2
  22692. });
  22693. const _sfc_main$f = /* @__PURE__ */ defineComponent({
  22694. ...__default__$5,
  22695. props: alphaSliderProps,
  22696. setup(__props, { expose }) {
  22697. const props = __props;
  22698. const { bar, thumb, handleDrag, handleClick } = useAlphaSlider(props);
  22699. const { rootKls, barKls, barStyle, thumbKls, thumbStyle, update } = useAlphaSliderDOM(props, {
  22700. bar,
  22701. thumb,
  22702. handleDrag
  22703. });
  22704. expose({
  22705. update,
  22706. bar,
  22707. thumb
  22708. });
  22709. return (_ctx, _cache) => {
  22710. return openBlock(), createElementBlock("div", {
  22711. class: normalizeClass(unref(rootKls))
  22712. }, [
  22713. createElementVNode("div", {
  22714. ref_key: "bar",
  22715. ref: bar,
  22716. class: normalizeClass(unref(barKls)),
  22717. style: normalizeStyle(unref(barStyle)),
  22718. onClick: _cache[0] || (_cache[0] = (...args) => unref(handleClick) && unref(handleClick)(...args))
  22719. }, null, 6),
  22720. createElementVNode("div", {
  22721. ref_key: "thumb",
  22722. ref: thumb,
  22723. class: normalizeClass(unref(thumbKls)),
  22724. style: normalizeStyle(unref(thumbStyle))
  22725. }, null, 6)
  22726. ], 2);
  22727. };
  22728. }
  22729. });
  22730. var AlphaSlider = /* @__PURE__ */ _export_sfc$1(_sfc_main$f, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/components/alpha-slider.vue"]]);
  22731. const _sfc_main$e = defineComponent({
  22732. name: "ElColorHueSlider",
  22733. props: {
  22734. color: {
  22735. type: Object,
  22736. required: true
  22737. },
  22738. vertical: Boolean
  22739. },
  22740. setup(props) {
  22741. const ns = useNamespace("color-hue-slider");
  22742. const instance = getCurrentInstance();
  22743. const thumb = ref();
  22744. const bar = ref();
  22745. const thumbLeft = ref(0);
  22746. const thumbTop = ref(0);
  22747. const hueValue = computed$1(() => {
  22748. return props.color.get("hue");
  22749. });
  22750. watch(() => hueValue.value, () => {
  22751. update();
  22752. });
  22753. function handleClick(event2) {
  22754. const target = event2.target;
  22755. if (target !== thumb.value) {
  22756. handleDrag(event2);
  22757. }
  22758. }
  22759. function handleDrag(event2) {
  22760. if (!bar.value || !thumb.value)
  22761. return;
  22762. const el = instance.vnode.el;
  22763. const rect = el.getBoundingClientRect();
  22764. const { clientX, clientY } = getClientXY(event2);
  22765. let hue;
  22766. if (!props.vertical) {
  22767. let left = clientX - rect.left;
  22768. left = Math.min(left, rect.width - thumb.value.offsetWidth / 2);
  22769. left = Math.max(thumb.value.offsetWidth / 2, left);
  22770. hue = Math.round((left - thumb.value.offsetWidth / 2) / (rect.width - thumb.value.offsetWidth) * 360);
  22771. } else {
  22772. let top = clientY - rect.top;
  22773. top = Math.min(top, rect.height - thumb.value.offsetHeight / 2);
  22774. top = Math.max(thumb.value.offsetHeight / 2, top);
  22775. hue = Math.round((top - thumb.value.offsetHeight / 2) / (rect.height - thumb.value.offsetHeight) * 360);
  22776. }
  22777. props.color.set("hue", hue);
  22778. }
  22779. function getThumbLeft() {
  22780. if (!thumb.value)
  22781. return 0;
  22782. const el = instance.vnode.el;
  22783. if (props.vertical)
  22784. return 0;
  22785. const hue = props.color.get("hue");
  22786. if (!el)
  22787. return 0;
  22788. return Math.round(hue * (el.offsetWidth - thumb.value.offsetWidth / 2) / 360);
  22789. }
  22790. function getThumbTop() {
  22791. if (!thumb.value)
  22792. return 0;
  22793. const el = instance.vnode.el;
  22794. if (!props.vertical)
  22795. return 0;
  22796. const hue = props.color.get("hue");
  22797. if (!el)
  22798. return 0;
  22799. return Math.round(hue * (el.offsetHeight - thumb.value.offsetHeight / 2) / 360);
  22800. }
  22801. function update() {
  22802. thumbLeft.value = getThumbLeft();
  22803. thumbTop.value = getThumbTop();
  22804. }
  22805. onMounted(() => {
  22806. if (!bar.value || !thumb.value)
  22807. return;
  22808. const dragConfig = {
  22809. drag: (event2) => {
  22810. handleDrag(event2);
  22811. },
  22812. end: (event2) => {
  22813. handleDrag(event2);
  22814. }
  22815. };
  22816. draggable(bar.value, dragConfig);
  22817. draggable(thumb.value, dragConfig);
  22818. update();
  22819. });
  22820. return {
  22821. bar,
  22822. thumb,
  22823. thumbLeft,
  22824. thumbTop,
  22825. hueValue,
  22826. handleClick,
  22827. update,
  22828. ns
  22829. };
  22830. }
  22831. });
  22832. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  22833. return openBlock(), createElementBlock("div", {
  22834. class: normalizeClass([_ctx.ns.b(), _ctx.ns.is("vertical", _ctx.vertical)])
  22835. }, [
  22836. createElementVNode("div", {
  22837. ref: "bar",
  22838. class: normalizeClass(_ctx.ns.e("bar")),
  22839. onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
  22840. }, null, 2),
  22841. createElementVNode("div", {
  22842. ref: "thumb",
  22843. class: normalizeClass(_ctx.ns.e("thumb")),
  22844. style: normalizeStyle({
  22845. left: _ctx.thumbLeft + "px",
  22846. top: _ctx.thumbTop + "px"
  22847. })
  22848. }, null, 6)
  22849. ], 2);
  22850. }
  22851. var HueSlider = /* @__PURE__ */ _export_sfc$1(_sfc_main$e, [["render", _sfc_render$6], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/components/hue-slider.vue"]]);
  22852. const colorPickerProps = buildProps({
  22853. modelValue: String,
  22854. id: String,
  22855. showAlpha: Boolean,
  22856. colorFormat: String,
  22857. disabled: Boolean,
  22858. size: useSizeProp,
  22859. popperClass: {
  22860. type: String,
  22861. default: ""
  22862. },
  22863. label: {
  22864. type: String,
  22865. default: void 0
  22866. },
  22867. tabindex: {
  22868. type: [String, Number],
  22869. default: 0
  22870. },
  22871. predefine: {
  22872. type: definePropType(Array)
  22873. },
  22874. validateEvent: {
  22875. type: Boolean,
  22876. default: true
  22877. }
  22878. });
  22879. const colorPickerEmits = {
  22880. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNil(val),
  22881. [CHANGE_EVENT]: (val) => isString(val) || isNil(val),
  22882. activeChange: (val) => isString(val) || isNil(val)
  22883. };
  22884. const colorPickerContextKey = Symbol("colorPickerContextKey");
  22885. const hsv2hsl = function(hue, sat, val) {
  22886. return [
  22887. hue,
  22888. sat * val / ((hue = (2 - sat) * val) < 1 ? hue : 2 - hue) || 0,
  22889. hue / 2
  22890. ];
  22891. };
  22892. const isOnePointZero = function(n) {
  22893. return typeof n === "string" && n.includes(".") && Number.parseFloat(n) === 1;
  22894. };
  22895. const isPercentage = function(n) {
  22896. return typeof n === "string" && n.includes("%");
  22897. };
  22898. const bound01 = function(value, max2) {
  22899. if (isOnePointZero(value))
  22900. value = "100%";
  22901. const processPercent = isPercentage(value);
  22902. value = Math.min(max2, Math.max(0, Number.parseFloat(`${value}`)));
  22903. if (processPercent) {
  22904. value = Number.parseInt(`${value * max2}`, 10) / 100;
  22905. }
  22906. if (Math.abs(value - max2) < 1e-6) {
  22907. return 1;
  22908. }
  22909. return value % max2 / Number.parseFloat(max2);
  22910. };
  22911. const INT_HEX_MAP = {
  22912. 10: "A",
  22913. 11: "B",
  22914. 12: "C",
  22915. 13: "D",
  22916. 14: "E",
  22917. 15: "F"
  22918. };
  22919. const hexOne = (value) => {
  22920. value = Math.min(Math.round(value), 255);
  22921. const high = Math.floor(value / 16);
  22922. const low = value % 16;
  22923. return `${INT_HEX_MAP[high] || high}${INT_HEX_MAP[low] || low}`;
  22924. };
  22925. const toHex = function({ r: r2, g, b }) {
  22926. if (Number.isNaN(+r2) || Number.isNaN(+g) || Number.isNaN(+b))
  22927. return "";
  22928. return `#${hexOne(r2)}${hexOne(g)}${hexOne(b)}`;
  22929. };
  22930. const HEX_INT_MAP = {
  22931. A: 10,
  22932. B: 11,
  22933. C: 12,
  22934. D: 13,
  22935. E: 14,
  22936. F: 15
  22937. };
  22938. const parseHexChannel = function(hex) {
  22939. if (hex.length === 2) {
  22940. return (HEX_INT_MAP[hex[0].toUpperCase()] || +hex[0]) * 16 + (HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1]);
  22941. }
  22942. return HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1];
  22943. };
  22944. const hsl2hsv = function(hue, sat, light) {
  22945. sat = sat / 100;
  22946. light = light / 100;
  22947. let smin = sat;
  22948. const lmin = Math.max(light, 0.01);
  22949. light *= 2;
  22950. sat *= light <= 1 ? light : 2 - light;
  22951. smin *= lmin <= 1 ? lmin : 2 - lmin;
  22952. const v = (light + sat) / 2;
  22953. const sv = light === 0 ? 2 * smin / (lmin + smin) : 2 * sat / (light + sat);
  22954. return {
  22955. h: hue,
  22956. s: sv * 100,
  22957. v: v * 100
  22958. };
  22959. };
  22960. const rgb2hsv = (r2, g, b) => {
  22961. r2 = bound01(r2, 255);
  22962. g = bound01(g, 255);
  22963. b = bound01(b, 255);
  22964. const max2 = Math.max(r2, g, b);
  22965. const min2 = Math.min(r2, g, b);
  22966. let h2;
  22967. const v = max2;
  22968. const d2 = max2 - min2;
  22969. const s = max2 === 0 ? 0 : d2 / max2;
  22970. if (max2 === min2) {
  22971. h2 = 0;
  22972. } else {
  22973. switch (max2) {
  22974. case r2: {
  22975. h2 = (g - b) / d2 + (g < b ? 6 : 0);
  22976. break;
  22977. }
  22978. case g: {
  22979. h2 = (b - r2) / d2 + 2;
  22980. break;
  22981. }
  22982. case b: {
  22983. h2 = (r2 - g) / d2 + 4;
  22984. break;
  22985. }
  22986. }
  22987. h2 /= 6;
  22988. }
  22989. return { h: h2 * 360, s: s * 100, v: v * 100 };
  22990. };
  22991. const hsv2rgb = function(h2, s, v) {
  22992. h2 = bound01(h2, 360) * 6;
  22993. s = bound01(s, 100);
  22994. v = bound01(v, 100);
  22995. const i2 = Math.floor(h2);
  22996. const f = h2 - i2;
  22997. const p = v * (1 - s);
  22998. const q2 = v * (1 - f * s);
  22999. const t2 = v * (1 - (1 - f) * s);
  23000. const mod = i2 % 6;
  23001. const r2 = [v, q2, p, p, t2, v][mod];
  23002. const g = [t2, v, v, q2, p, p][mod];
  23003. const b = [p, p, t2, v, v, q2][mod];
  23004. return {
  23005. r: Math.round(r2 * 255),
  23006. g: Math.round(g * 255),
  23007. b: Math.round(b * 255)
  23008. };
  23009. };
  23010. class Color$1 {
  23011. constructor(options2 = {}) {
  23012. this._hue = 0;
  23013. this._saturation = 100;
  23014. this._value = 100;
  23015. this._alpha = 100;
  23016. this.enableAlpha = false;
  23017. this.format = "hex";
  23018. this.value = "";
  23019. for (const option in options2) {
  23020. if (hasOwn(options2, option)) {
  23021. this[option] = options2[option];
  23022. }
  23023. }
  23024. if (options2.value) {
  23025. this.fromString(options2.value);
  23026. } else {
  23027. this.doOnChange();
  23028. }
  23029. }
  23030. set(prop, value) {
  23031. if (arguments.length === 1 && typeof prop === "object") {
  23032. for (const p in prop) {
  23033. if (hasOwn(prop, p)) {
  23034. this.set(p, prop[p]);
  23035. }
  23036. }
  23037. return;
  23038. }
  23039. this[`_${prop}`] = value;
  23040. this.doOnChange();
  23041. }
  23042. get(prop) {
  23043. if (prop === "alpha") {
  23044. return Math.floor(this[`_${prop}`]);
  23045. }
  23046. return this[`_${prop}`];
  23047. }
  23048. toRgb() {
  23049. return hsv2rgb(this._hue, this._saturation, this._value);
  23050. }
  23051. fromString(value) {
  23052. if (!value) {
  23053. this._hue = 0;
  23054. this._saturation = 100;
  23055. this._value = 100;
  23056. this.doOnChange();
  23057. return;
  23058. }
  23059. const fromHSV = (h2, s, v) => {
  23060. this._hue = Math.max(0, Math.min(360, h2));
  23061. this._saturation = Math.max(0, Math.min(100, s));
  23062. this._value = Math.max(0, Math.min(100, v));
  23063. this.doOnChange();
  23064. };
  23065. if (value.includes("hsl")) {
  23066. const parts = value.replace(/hsla|hsl|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val, index2) => index2 > 2 ? Number.parseFloat(val) : Number.parseInt(val, 10));
  23067. if (parts.length === 4) {
  23068. this._alpha = Number.parseFloat(parts[3]) * 100;
  23069. } else if (parts.length === 3) {
  23070. this._alpha = 100;
  23071. }
  23072. if (parts.length >= 3) {
  23073. const { h: h2, s, v } = hsl2hsv(parts[0], parts[1], parts[2]);
  23074. fromHSV(h2, s, v);
  23075. }
  23076. } else if (value.includes("hsv")) {
  23077. const parts = value.replace(/hsva|hsv|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val, index2) => index2 > 2 ? Number.parseFloat(val) : Number.parseInt(val, 10));
  23078. if (parts.length === 4) {
  23079. this._alpha = Number.parseFloat(parts[3]) * 100;
  23080. } else if (parts.length === 3) {
  23081. this._alpha = 100;
  23082. }
  23083. if (parts.length >= 3) {
  23084. fromHSV(parts[0], parts[1], parts[2]);
  23085. }
  23086. } else if (value.includes("rgb")) {
  23087. const parts = value.replace(/rgba|rgb|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val, index2) => index2 > 2 ? Number.parseFloat(val) : Number.parseInt(val, 10));
  23088. if (parts.length === 4) {
  23089. this._alpha = Number.parseFloat(parts[3]) * 100;
  23090. } else if (parts.length === 3) {
  23091. this._alpha = 100;
  23092. }
  23093. if (parts.length >= 3) {
  23094. const { h: h2, s, v } = rgb2hsv(parts[0], parts[1], parts[2]);
  23095. fromHSV(h2, s, v);
  23096. }
  23097. } else if (value.includes("#")) {
  23098. const hex = value.replace("#", "").trim();
  23099. if (!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(hex))
  23100. return;
  23101. let r2, g, b;
  23102. if (hex.length === 3) {
  23103. r2 = parseHexChannel(hex[0] + hex[0]);
  23104. g = parseHexChannel(hex[1] + hex[1]);
  23105. b = parseHexChannel(hex[2] + hex[2]);
  23106. } else if (hex.length === 6 || hex.length === 8) {
  23107. r2 = parseHexChannel(hex.slice(0, 2));
  23108. g = parseHexChannel(hex.slice(2, 4));
  23109. b = parseHexChannel(hex.slice(4, 6));
  23110. }
  23111. if (hex.length === 8) {
  23112. this._alpha = parseHexChannel(hex.slice(6)) / 255 * 100;
  23113. } else if (hex.length === 3 || hex.length === 6) {
  23114. this._alpha = 100;
  23115. }
  23116. const { h: h2, s, v } = rgb2hsv(r2, g, b);
  23117. fromHSV(h2, s, v);
  23118. }
  23119. }
  23120. compare(color2) {
  23121. return Math.abs(color2._hue - this._hue) < 2 && Math.abs(color2._saturation - this._saturation) < 1 && Math.abs(color2._value - this._value) < 1 && Math.abs(color2._alpha - this._alpha) < 1;
  23122. }
  23123. doOnChange() {
  23124. const { _hue, _saturation, _value, _alpha, format } = this;
  23125. if (this.enableAlpha) {
  23126. switch (format) {
  23127. case "hsl": {
  23128. const hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  23129. this.value = `hsla(${_hue}, ${Math.round(hsl[1] * 100)}%, ${Math.round(hsl[2] * 100)}%, ${this.get("alpha") / 100})`;
  23130. break;
  23131. }
  23132. case "hsv": {
  23133. this.value = `hsva(${_hue}, ${Math.round(_saturation)}%, ${Math.round(_value)}%, ${this.get("alpha") / 100})`;
  23134. break;
  23135. }
  23136. case "hex": {
  23137. this.value = `${toHex(hsv2rgb(_hue, _saturation, _value))}${hexOne(_alpha * 255 / 100)}`;
  23138. break;
  23139. }
  23140. default: {
  23141. const { r: r2, g, b } = hsv2rgb(_hue, _saturation, _value);
  23142. this.value = `rgba(${r2}, ${g}, ${b}, ${this.get("alpha") / 100})`;
  23143. }
  23144. }
  23145. } else {
  23146. switch (format) {
  23147. case "hsl": {
  23148. const hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  23149. this.value = `hsl(${_hue}, ${Math.round(hsl[1] * 100)}%, ${Math.round(hsl[2] * 100)}%)`;
  23150. break;
  23151. }
  23152. case "hsv": {
  23153. this.value = `hsv(${_hue}, ${Math.round(_saturation)}%, ${Math.round(_value)}%)`;
  23154. break;
  23155. }
  23156. case "rgb": {
  23157. const { r: r2, g, b } = hsv2rgb(_hue, _saturation, _value);
  23158. this.value = `rgb(${r2}, ${g}, ${b})`;
  23159. break;
  23160. }
  23161. default: {
  23162. this.value = toHex(hsv2rgb(_hue, _saturation, _value));
  23163. }
  23164. }
  23165. }
  23166. }
  23167. }
  23168. const _sfc_main$d = defineComponent({
  23169. props: {
  23170. colors: {
  23171. type: Array,
  23172. required: true
  23173. },
  23174. color: {
  23175. type: Object,
  23176. required: true
  23177. }
  23178. },
  23179. setup(props) {
  23180. const ns = useNamespace("color-predefine");
  23181. const { currentColor } = inject(colorPickerContextKey);
  23182. const rgbaColors = ref(parseColors(props.colors, props.color));
  23183. watch(() => currentColor.value, (val) => {
  23184. const color2 = new Color$1();
  23185. color2.fromString(val);
  23186. rgbaColors.value.forEach((item) => {
  23187. item.selected = color2.compare(item);
  23188. });
  23189. });
  23190. watchEffect(() => {
  23191. rgbaColors.value = parseColors(props.colors, props.color);
  23192. });
  23193. function handleSelect(index2) {
  23194. props.color.fromString(props.colors[index2]);
  23195. }
  23196. function parseColors(colors, color2) {
  23197. return colors.map((value) => {
  23198. const c = new Color$1();
  23199. c.enableAlpha = true;
  23200. c.format = "rgba";
  23201. c.fromString(value);
  23202. c.selected = c.value === color2.value;
  23203. return c;
  23204. });
  23205. }
  23206. return {
  23207. rgbaColors,
  23208. handleSelect,
  23209. ns
  23210. };
  23211. }
  23212. });
  23213. const _hoisted_1$a = ["onClick"];
  23214. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  23215. return openBlock(), createElementBlock("div", {
  23216. class: normalizeClass(_ctx.ns.b())
  23217. }, [
  23218. createElementVNode("div", {
  23219. class: normalizeClass(_ctx.ns.e("colors"))
  23220. }, [
  23221. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rgbaColors, (item, index2) => {
  23222. return openBlock(), createElementBlock("div", {
  23223. key: _ctx.colors[index2],
  23224. class: normalizeClass([
  23225. _ctx.ns.e("color-selector"),
  23226. _ctx.ns.is("alpha", item._alpha < 100),
  23227. { selected: item.selected }
  23228. ]),
  23229. onClick: ($event) => _ctx.handleSelect(index2)
  23230. }, [
  23231. createElementVNode("div", {
  23232. style: normalizeStyle({ backgroundColor: item.value })
  23233. }, null, 4)
  23234. ], 10, _hoisted_1$a);
  23235. }), 128))
  23236. ], 2)
  23237. ], 2);
  23238. }
  23239. var Predefine = /* @__PURE__ */ _export_sfc$1(_sfc_main$d, [["render", _sfc_render$5], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/components/predefine.vue"]]);
  23240. const _sfc_main$c = defineComponent({
  23241. name: "ElSlPanel",
  23242. props: {
  23243. color: {
  23244. type: Object,
  23245. required: true
  23246. }
  23247. },
  23248. setup(props) {
  23249. const ns = useNamespace("color-svpanel");
  23250. const instance = getCurrentInstance();
  23251. const cursorTop = ref(0);
  23252. const cursorLeft = ref(0);
  23253. const background = ref("hsl(0, 100%, 50%)");
  23254. const colorValue = computed$1(() => {
  23255. const hue = props.color.get("hue");
  23256. const value = props.color.get("value");
  23257. return { hue, value };
  23258. });
  23259. function update() {
  23260. const saturation = props.color.get("saturation");
  23261. const value = props.color.get("value");
  23262. const el = instance.vnode.el;
  23263. const { clientWidth: width2, clientHeight: height2 } = el;
  23264. cursorLeft.value = saturation * width2 / 100;
  23265. cursorTop.value = (100 - value) * height2 / 100;
  23266. background.value = `hsl(${props.color.get("hue")}, 100%, 50%)`;
  23267. }
  23268. function handleDrag(event2) {
  23269. const el = instance.vnode.el;
  23270. const rect = el.getBoundingClientRect();
  23271. const { clientX, clientY } = getClientXY(event2);
  23272. let left = clientX - rect.left;
  23273. let top = clientY - rect.top;
  23274. left = Math.max(0, left);
  23275. left = Math.min(left, rect.width);
  23276. top = Math.max(0, top);
  23277. top = Math.min(top, rect.height);
  23278. cursorLeft.value = left;
  23279. cursorTop.value = top;
  23280. props.color.set({
  23281. saturation: left / rect.width * 100,
  23282. value: 100 - top / rect.height * 100
  23283. });
  23284. }
  23285. watch(() => colorValue.value, () => {
  23286. update();
  23287. });
  23288. onMounted(() => {
  23289. draggable(instance.vnode.el, {
  23290. drag: (event2) => {
  23291. handleDrag(event2);
  23292. },
  23293. end: (event2) => {
  23294. handleDrag(event2);
  23295. }
  23296. });
  23297. update();
  23298. });
  23299. return {
  23300. cursorTop,
  23301. cursorLeft,
  23302. background,
  23303. colorValue,
  23304. handleDrag,
  23305. update,
  23306. ns
  23307. };
  23308. }
  23309. });
  23310. const _hoisted_1$9 = /* @__PURE__ */ createElementVNode("div", null, null, -1);
  23311. const _hoisted_2$7 = [
  23312. _hoisted_1$9
  23313. ];
  23314. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  23315. return openBlock(), createElementBlock("div", {
  23316. class: normalizeClass(_ctx.ns.b()),
  23317. style: normalizeStyle({
  23318. backgroundColor: _ctx.background
  23319. })
  23320. }, [
  23321. createElementVNode("div", {
  23322. class: normalizeClass(_ctx.ns.e("white"))
  23323. }, null, 2),
  23324. createElementVNode("div", {
  23325. class: normalizeClass(_ctx.ns.e("black"))
  23326. }, null, 2),
  23327. createElementVNode("div", {
  23328. class: normalizeClass(_ctx.ns.e("cursor")),
  23329. style: normalizeStyle({
  23330. top: _ctx.cursorTop + "px",
  23331. left: _ctx.cursorLeft + "px"
  23332. })
  23333. }, _hoisted_2$7, 6)
  23334. ], 6);
  23335. }
  23336. var SvPanel = /* @__PURE__ */ _export_sfc$1(_sfc_main$c, [["render", _sfc_render$4], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/components/sv-panel.vue"]]);
  23337. const _hoisted_1$8 = ["id", "aria-label", "aria-labelledby", "aria-description", "tabindex", "onKeydown"];
  23338. const __default__$4 = defineComponent({
  23339. name: "ElColorPicker"
  23340. });
  23341. const _sfc_main$b = /* @__PURE__ */ defineComponent({
  23342. ...__default__$4,
  23343. props: colorPickerProps,
  23344. emits: colorPickerEmits,
  23345. setup(__props, { expose, emit }) {
  23346. const props = __props;
  23347. const { t: t2 } = useLocale();
  23348. const ns = useNamespace("color");
  23349. const { formItem } = useFormItem();
  23350. const colorSize = useFormSize();
  23351. const colorDisabled = useFormDisabled();
  23352. const { inputId: buttonId, isLabeledByFormItem } = useFormItemInputId(props, {
  23353. formItemContext: formItem
  23354. });
  23355. const hue = ref();
  23356. const sv = ref();
  23357. const alpha = ref();
  23358. const popper = ref();
  23359. let shouldActiveChange = true;
  23360. const color2 = reactive(new Color$1({
  23361. enableAlpha: props.showAlpha,
  23362. format: props.colorFormat || "",
  23363. value: props.modelValue
  23364. }));
  23365. const showPicker = ref(false);
  23366. const showPanelColor = ref(false);
  23367. const customInput = ref("");
  23368. const displayedColor = computed$1(() => {
  23369. if (!props.modelValue && !showPanelColor.value) {
  23370. return "transparent";
  23371. }
  23372. return displayedRgb(color2, props.showAlpha);
  23373. });
  23374. const currentColor = computed$1(() => {
  23375. return !props.modelValue && !showPanelColor.value ? "" : color2.value;
  23376. });
  23377. const buttonAriaLabel = computed$1(() => {
  23378. return !isLabeledByFormItem.value ? props.label || t2("el.colorpicker.defaultLabel") : void 0;
  23379. });
  23380. const buttonAriaLabelledby = computed$1(() => {
  23381. return isLabeledByFormItem.value ? formItem == null ? void 0 : formItem.labelId : void 0;
  23382. });
  23383. const btnKls = computed$1(() => {
  23384. return [
  23385. ns.b("picker"),
  23386. ns.is("disabled", colorDisabled.value),
  23387. ns.bm("picker", colorSize.value)
  23388. ];
  23389. });
  23390. function displayedRgb(color22, showAlpha) {
  23391. if (!(color22 instanceof Color$1)) {
  23392. throw new TypeError("color should be instance of _color Class");
  23393. }
  23394. const { r: r2, g, b } = color22.toRgb();
  23395. return showAlpha ? `rgba(${r2}, ${g}, ${b}, ${color22.get("alpha") / 100})` : `rgb(${r2}, ${g}, ${b})`;
  23396. }
  23397. function setShowPicker(value) {
  23398. showPicker.value = value;
  23399. }
  23400. const debounceSetShowPicker = debounce$2(setShowPicker, 100);
  23401. function show() {
  23402. if (colorDisabled.value)
  23403. return;
  23404. setShowPicker(true);
  23405. }
  23406. function hide() {
  23407. debounceSetShowPicker(false);
  23408. resetColor();
  23409. }
  23410. function resetColor() {
  23411. nextTick(() => {
  23412. if (props.modelValue) {
  23413. color2.fromString(props.modelValue);
  23414. } else {
  23415. color2.value = "";
  23416. nextTick(() => {
  23417. showPanelColor.value = false;
  23418. });
  23419. }
  23420. });
  23421. }
  23422. function handleTrigger() {
  23423. if (colorDisabled.value)
  23424. return;
  23425. debounceSetShowPicker(!showPicker.value);
  23426. }
  23427. function handleConfirm() {
  23428. color2.fromString(customInput.value);
  23429. }
  23430. function confirmValue() {
  23431. const value = color2.value;
  23432. emit(UPDATE_MODEL_EVENT, value);
  23433. emit("change", value);
  23434. if (props.validateEvent) {
  23435. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  23436. }
  23437. debounceSetShowPicker(false);
  23438. nextTick(() => {
  23439. const newColor = new Color$1({
  23440. enableAlpha: props.showAlpha,
  23441. format: props.colorFormat || "",
  23442. value: props.modelValue
  23443. });
  23444. if (!color2.compare(newColor)) {
  23445. resetColor();
  23446. }
  23447. });
  23448. }
  23449. function clear() {
  23450. debounceSetShowPicker(false);
  23451. emit(UPDATE_MODEL_EVENT, null);
  23452. emit("change", null);
  23453. if (props.modelValue !== null && props.validateEvent) {
  23454. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  23455. }
  23456. resetColor();
  23457. }
  23458. onMounted(() => {
  23459. if (props.modelValue) {
  23460. customInput.value = currentColor.value;
  23461. }
  23462. });
  23463. watch(() => props.modelValue, (newVal) => {
  23464. if (!newVal) {
  23465. showPanelColor.value = false;
  23466. } else if (newVal && newVal !== color2.value) {
  23467. shouldActiveChange = false;
  23468. color2.fromString(newVal);
  23469. }
  23470. });
  23471. watch(() => currentColor.value, (val) => {
  23472. customInput.value = val;
  23473. shouldActiveChange && emit("activeChange", val);
  23474. shouldActiveChange = true;
  23475. });
  23476. watch(() => color2.value, () => {
  23477. if (!props.modelValue && !showPanelColor.value) {
  23478. showPanelColor.value = true;
  23479. }
  23480. });
  23481. watch(() => showPicker.value, () => {
  23482. nextTick(() => {
  23483. var _a2, _b, _c;
  23484. (_a2 = hue.value) == null ? void 0 : _a2.update();
  23485. (_b = sv.value) == null ? void 0 : _b.update();
  23486. (_c = alpha.value) == null ? void 0 : _c.update();
  23487. });
  23488. });
  23489. provide(colorPickerContextKey, {
  23490. currentColor
  23491. });
  23492. expose({
  23493. color: color2,
  23494. show,
  23495. hide
  23496. });
  23497. return (_ctx, _cache) => {
  23498. return openBlock(), createBlock(unref(ElTooltip), {
  23499. ref_key: "popper",
  23500. ref: popper,
  23501. visible: showPicker.value,
  23502. "show-arrow": false,
  23503. "fallback-placements": ["bottom", "top", "right", "left"],
  23504. offset: 0,
  23505. "gpu-acceleration": false,
  23506. "popper-class": [unref(ns).be("picker", "panel"), unref(ns).b("dropdown"), _ctx.popperClass],
  23507. "stop-popper-mouse-event": false,
  23508. effect: "light",
  23509. trigger: "click",
  23510. transition: `${unref(ns).namespace.value}-zoom-in-top`,
  23511. persistent: ""
  23512. }, {
  23513. content: withCtx(() => [
  23514. withDirectives((openBlock(), createElementBlock("div", null, [
  23515. createElementVNode("div", {
  23516. class: normalizeClass(unref(ns).be("dropdown", "main-wrapper"))
  23517. }, [
  23518. createVNode(HueSlider, {
  23519. ref_key: "hue",
  23520. ref: hue,
  23521. class: "hue-slider",
  23522. color: unref(color2),
  23523. vertical: ""
  23524. }, null, 8, ["color"]),
  23525. createVNode(SvPanel, {
  23526. ref: "svPanel",
  23527. color: unref(color2)
  23528. }, null, 8, ["color"])
  23529. ], 2),
  23530. _ctx.showAlpha ? (openBlock(), createBlock(AlphaSlider, {
  23531. key: 0,
  23532. ref_key: "alpha",
  23533. ref: alpha,
  23534. color: unref(color2)
  23535. }, null, 8, ["color"])) : createCommentVNode("v-if", true),
  23536. _ctx.predefine ? (openBlock(), createBlock(Predefine, {
  23537. key: 1,
  23538. ref: "predefine",
  23539. color: unref(color2),
  23540. colors: _ctx.predefine
  23541. }, null, 8, ["color", "colors"])) : createCommentVNode("v-if", true),
  23542. createElementVNode("div", {
  23543. class: normalizeClass(unref(ns).be("dropdown", "btns"))
  23544. }, [
  23545. createElementVNode("span", {
  23546. class: normalizeClass(unref(ns).be("dropdown", "value"))
  23547. }, [
  23548. createVNode(unref(ElInput), {
  23549. modelValue: customInput.value,
  23550. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => customInput.value = $event),
  23551. "validate-event": false,
  23552. size: "small",
  23553. onKeyup: withKeys(handleConfirm, ["enter"]),
  23554. onBlur: handleConfirm
  23555. }, null, 8, ["modelValue", "onKeyup"])
  23556. ], 2),
  23557. createVNode(unref(ElButton), {
  23558. class: normalizeClass(unref(ns).be("dropdown", "link-btn")),
  23559. text: "",
  23560. size: "small",
  23561. onClick: clear
  23562. }, {
  23563. default: withCtx(() => [
  23564. createTextVNode(toDisplayString(unref(t2)("el.colorpicker.clear")), 1)
  23565. ]),
  23566. _: 1
  23567. }, 8, ["class"]),
  23568. createVNode(unref(ElButton), {
  23569. plain: "",
  23570. size: "small",
  23571. class: normalizeClass(unref(ns).be("dropdown", "btn")),
  23572. onClick: confirmValue
  23573. }, {
  23574. default: withCtx(() => [
  23575. createTextVNode(toDisplayString(unref(t2)("el.colorpicker.confirm")), 1)
  23576. ]),
  23577. _: 1
  23578. }, 8, ["class"])
  23579. ], 2)
  23580. ])), [
  23581. [unref(ClickOutside), hide]
  23582. ])
  23583. ]),
  23584. default: withCtx(() => [
  23585. createElementVNode("div", {
  23586. id: unref(buttonId),
  23587. class: normalizeClass(unref(btnKls)),
  23588. role: "button",
  23589. "aria-label": unref(buttonAriaLabel),
  23590. "aria-labelledby": unref(buttonAriaLabelledby),
  23591. "aria-description": unref(t2)("el.colorpicker.description", { color: _ctx.modelValue || "" }),
  23592. tabindex: _ctx.tabindex,
  23593. onKeydown: withKeys(handleTrigger, ["enter"])
  23594. }, [
  23595. unref(colorDisabled) ? (openBlock(), createElementBlock("div", {
  23596. key: 0,
  23597. class: normalizeClass(unref(ns).be("picker", "mask"))
  23598. }, null, 2)) : createCommentVNode("v-if", true),
  23599. createElementVNode("div", {
  23600. class: normalizeClass(unref(ns).be("picker", "trigger")),
  23601. onClick: handleTrigger
  23602. }, [
  23603. createElementVNode("span", {
  23604. class: normalizeClass([unref(ns).be("picker", "color"), unref(ns).is("alpha", _ctx.showAlpha)])
  23605. }, [
  23606. createElementVNode("span", {
  23607. class: normalizeClass(unref(ns).be("picker", "color-inner")),
  23608. style: normalizeStyle({
  23609. backgroundColor: unref(displayedColor)
  23610. })
  23611. }, [
  23612. withDirectives(createVNode(unref(ElIcon), {
  23613. class: normalizeClass([unref(ns).be("picker", "icon"), unref(ns).is("icon-arrow-down")])
  23614. }, {
  23615. default: withCtx(() => [
  23616. createVNode(unref(arrow_down_default))
  23617. ]),
  23618. _: 1
  23619. }, 8, ["class"]), [
  23620. [vShow, _ctx.modelValue || showPanelColor.value]
  23621. ]),
  23622. !_ctx.modelValue && !showPanelColor.value ? (openBlock(), createBlock(unref(ElIcon), {
  23623. key: 0,
  23624. class: normalizeClass([unref(ns).be("picker", "empty"), unref(ns).is("icon-close")])
  23625. }, {
  23626. default: withCtx(() => [
  23627. createVNode(unref(close_default))
  23628. ]),
  23629. _: 1
  23630. }, 8, ["class"])) : createCommentVNode("v-if", true)
  23631. ], 6)
  23632. ], 2)
  23633. ], 2)
  23634. ], 42, _hoisted_1$8)
  23635. ]),
  23636. _: 1
  23637. }, 8, ["visible", "popper-class", "transition"]);
  23638. };
  23639. }
  23640. });
  23641. var ColorPicker = /* @__PURE__ */ _export_sfc$1(_sfc_main$b, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/color-picker/src/color-picker.vue"]]);
  23642. const ElColorPicker = withInstall(ColorPicker);
  23643. const overlayProps = buildProps({
  23644. mask: {
  23645. type: Boolean,
  23646. default: true
  23647. },
  23648. customMaskEvent: {
  23649. type: Boolean,
  23650. default: false
  23651. },
  23652. overlayClass: {
  23653. type: definePropType([
  23654. String,
  23655. Array,
  23656. Object
  23657. ])
  23658. },
  23659. zIndex: {
  23660. type: definePropType([String, Number])
  23661. }
  23662. });
  23663. const overlayEmits = {
  23664. click: (evt) => evt instanceof MouseEvent
  23665. };
  23666. const BLOCK = "overlay";
  23667. var Overlay = defineComponent({
  23668. name: "ElOverlay",
  23669. props: overlayProps,
  23670. emits: overlayEmits,
  23671. setup(props, { slots, emit }) {
  23672. const ns = useNamespace(BLOCK);
  23673. const onMaskClick = (e) => {
  23674. emit("click", e);
  23675. };
  23676. const { onClick, onMousedown, onMouseup } = useSameTarget(props.customMaskEvent ? void 0 : onMaskClick);
  23677. return () => {
  23678. return props.mask ? createVNode("div", {
  23679. class: [ns.b(), props.overlayClass],
  23680. style: {
  23681. zIndex: props.zIndex
  23682. },
  23683. onClick,
  23684. onMousedown,
  23685. onMouseup
  23686. }, [renderSlot(slots, "default")], PatchFlags.STYLE | PatchFlags.CLASS | PatchFlags.PROPS, ["onClick", "onMouseup", "onMousedown"]) : h("div", {
  23687. class: props.overlayClass,
  23688. style: {
  23689. zIndex: props.zIndex,
  23690. position: "fixed",
  23691. top: "0px",
  23692. right: "0px",
  23693. bottom: "0px",
  23694. left: "0px"
  23695. }
  23696. }, [renderSlot(slots, "default")]);
  23697. };
  23698. }
  23699. });
  23700. const ElOverlay = Overlay;
  23701. const dialogInjectionKey = Symbol("dialogInjectionKey");
  23702. const dialogContentProps = buildProps({
  23703. center: {
  23704. type: Boolean,
  23705. default: false
  23706. },
  23707. alignCenter: {
  23708. type: Boolean,
  23709. default: false
  23710. },
  23711. closeIcon: {
  23712. type: iconPropType
  23713. },
  23714. customClass: {
  23715. type: String,
  23716. default: ""
  23717. },
  23718. draggable: {
  23719. type: Boolean,
  23720. default: false
  23721. },
  23722. fullscreen: {
  23723. type: Boolean,
  23724. default: false
  23725. },
  23726. showClose: {
  23727. type: Boolean,
  23728. default: true
  23729. },
  23730. title: {
  23731. type: String,
  23732. default: ""
  23733. }
  23734. });
  23735. const dialogContentEmits = {
  23736. close: () => true
  23737. };
  23738. const _hoisted_1$7 = ["aria-label"];
  23739. const _hoisted_2$6 = ["id"];
  23740. const __default__$3 = defineComponent({ name: "ElDialogContent" });
  23741. const _sfc_main$a = /* @__PURE__ */ defineComponent({
  23742. ...__default__$3,
  23743. props: dialogContentProps,
  23744. emits: dialogContentEmits,
  23745. setup(__props) {
  23746. const props = __props;
  23747. const { t: t2 } = useLocale();
  23748. const { Close } = CloseComponents;
  23749. const { dialogRef, headerRef, bodyId, ns, style } = inject(dialogInjectionKey);
  23750. const { focusTrapRef } = inject(FOCUS_TRAP_INJECTION_KEY);
  23751. const composedDialogRef = composeRefs(focusTrapRef, dialogRef);
  23752. const draggable2 = computed$1(() => props.draggable);
  23753. useDraggable(dialogRef, headerRef, draggable2);
  23754. return (_ctx, _cache) => {
  23755. return openBlock(), createElementBlock("div", {
  23756. ref: unref(composedDialogRef),
  23757. class: normalizeClass([
  23758. unref(ns).b(),
  23759. unref(ns).is("fullscreen", _ctx.fullscreen),
  23760. unref(ns).is("draggable", unref(draggable2)),
  23761. unref(ns).is("align-center", _ctx.alignCenter),
  23762. { [unref(ns).m("center")]: _ctx.center },
  23763. _ctx.customClass
  23764. ]),
  23765. style: normalizeStyle(unref(style)),
  23766. tabindex: "-1"
  23767. }, [
  23768. createElementVNode("header", {
  23769. ref_key: "headerRef",
  23770. ref: headerRef,
  23771. class: normalizeClass(unref(ns).e("header"))
  23772. }, [
  23773. renderSlot(_ctx.$slots, "header", {}, () => [
  23774. createElementVNode("span", {
  23775. role: "heading",
  23776. class: normalizeClass(unref(ns).e("title"))
  23777. }, toDisplayString(_ctx.title), 3)
  23778. ]),
  23779. _ctx.showClose ? (openBlock(), createElementBlock("button", {
  23780. key: 0,
  23781. "aria-label": unref(t2)("el.dialog.close"),
  23782. class: normalizeClass(unref(ns).e("headerbtn")),
  23783. type: "button",
  23784. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
  23785. }, [
  23786. createVNode(unref(ElIcon), {
  23787. class: normalizeClass(unref(ns).e("close"))
  23788. }, {
  23789. default: withCtx(() => [
  23790. (openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon || unref(Close))))
  23791. ]),
  23792. _: 1
  23793. }, 8, ["class"])
  23794. ], 10, _hoisted_1$7)) : createCommentVNode("v-if", true)
  23795. ], 2),
  23796. createElementVNode("div", {
  23797. id: unref(bodyId),
  23798. class: normalizeClass(unref(ns).e("body"))
  23799. }, [
  23800. renderSlot(_ctx.$slots, "default")
  23801. ], 10, _hoisted_2$6),
  23802. _ctx.$slots.footer ? (openBlock(), createElementBlock("footer", {
  23803. key: 0,
  23804. class: normalizeClass(unref(ns).e("footer"))
  23805. }, [
  23806. renderSlot(_ctx.$slots, "footer")
  23807. ], 2)) : createCommentVNode("v-if", true)
  23808. ], 6);
  23809. };
  23810. }
  23811. });
  23812. var ElDialogContent = /* @__PURE__ */ _export_sfc$1(_sfc_main$a, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog-content.vue"]]);
  23813. const dialogProps = buildProps({
  23814. ...dialogContentProps,
  23815. appendToBody: {
  23816. type: Boolean,
  23817. default: false
  23818. },
  23819. beforeClose: {
  23820. type: definePropType(Function)
  23821. },
  23822. destroyOnClose: {
  23823. type: Boolean,
  23824. default: false
  23825. },
  23826. closeOnClickModal: {
  23827. type: Boolean,
  23828. default: true
  23829. },
  23830. closeOnPressEscape: {
  23831. type: Boolean,
  23832. default: true
  23833. },
  23834. lockScroll: {
  23835. type: Boolean,
  23836. default: true
  23837. },
  23838. modal: {
  23839. type: Boolean,
  23840. default: true
  23841. },
  23842. openDelay: {
  23843. type: Number,
  23844. default: 0
  23845. },
  23846. closeDelay: {
  23847. type: Number,
  23848. default: 0
  23849. },
  23850. top: {
  23851. type: String
  23852. },
  23853. modelValue: {
  23854. type: Boolean,
  23855. default: false
  23856. },
  23857. modalClass: String,
  23858. width: {
  23859. type: [String, Number]
  23860. },
  23861. zIndex: {
  23862. type: Number
  23863. },
  23864. trapFocus: {
  23865. type: Boolean,
  23866. default: false
  23867. }
  23868. });
  23869. const dialogEmits = {
  23870. open: () => true,
  23871. opened: () => true,
  23872. close: () => true,
  23873. closed: () => true,
  23874. [UPDATE_MODEL_EVENT]: (value) => isBoolean(value),
  23875. openAutoFocus: () => true,
  23876. closeAutoFocus: () => true
  23877. };
  23878. const useDialog = (props, targetRef) => {
  23879. const instance = getCurrentInstance();
  23880. const emit = instance.emit;
  23881. const { nextZIndex } = useZIndex();
  23882. let lastPosition = "";
  23883. const titleId = useId();
  23884. const bodyId = useId();
  23885. const visible = ref(false);
  23886. const closed = ref(false);
  23887. const rendered = ref(false);
  23888. const zIndex2 = ref(props.zIndex || nextZIndex());
  23889. let openTimer = void 0;
  23890. let closeTimer = void 0;
  23891. const namespace = useGlobalConfig("namespace", defaultNamespace);
  23892. const style = computed$1(() => {
  23893. const style2 = {};
  23894. const varPrefix = `--${namespace.value}-dialog`;
  23895. if (!props.fullscreen) {
  23896. if (props.top) {
  23897. style2[`${varPrefix}-margin-top`] = props.top;
  23898. }
  23899. if (props.width) {
  23900. style2[`${varPrefix}-width`] = addUnit(props.width);
  23901. }
  23902. }
  23903. return style2;
  23904. });
  23905. const overlayDialogStyle = computed$1(() => {
  23906. if (props.alignCenter) {
  23907. return { display: "flex" };
  23908. }
  23909. return {};
  23910. });
  23911. function afterEnter() {
  23912. emit("opened");
  23913. }
  23914. function afterLeave() {
  23915. emit("closed");
  23916. emit(UPDATE_MODEL_EVENT, false);
  23917. if (props.destroyOnClose) {
  23918. rendered.value = false;
  23919. }
  23920. }
  23921. function beforeLeave() {
  23922. emit("close");
  23923. }
  23924. function open() {
  23925. closeTimer == null ? void 0 : closeTimer();
  23926. openTimer == null ? void 0 : openTimer();
  23927. if (props.openDelay && props.openDelay > 0) {
  23928. ({ stop: openTimer } = useTimeoutFn(() => doOpen(), props.openDelay));
  23929. } else {
  23930. doOpen();
  23931. }
  23932. }
  23933. function close() {
  23934. openTimer == null ? void 0 : openTimer();
  23935. closeTimer == null ? void 0 : closeTimer();
  23936. if (props.closeDelay && props.closeDelay > 0) {
  23937. ({ stop: closeTimer } = useTimeoutFn(() => doClose(), props.closeDelay));
  23938. } else {
  23939. doClose();
  23940. }
  23941. }
  23942. function handleClose() {
  23943. function hide(shouldCancel) {
  23944. if (shouldCancel)
  23945. return;
  23946. closed.value = true;
  23947. visible.value = false;
  23948. }
  23949. if (props.beforeClose) {
  23950. props.beforeClose(hide);
  23951. } else {
  23952. close();
  23953. }
  23954. }
  23955. function onModalClick() {
  23956. if (props.closeOnClickModal) {
  23957. handleClose();
  23958. }
  23959. }
  23960. function doOpen() {
  23961. if (!isClient)
  23962. return;
  23963. visible.value = true;
  23964. }
  23965. function doClose() {
  23966. visible.value = false;
  23967. }
  23968. function onOpenAutoFocus() {
  23969. emit("openAutoFocus");
  23970. }
  23971. function onCloseAutoFocus() {
  23972. emit("closeAutoFocus");
  23973. }
  23974. function onFocusoutPrevented(event2) {
  23975. var _a2;
  23976. if (((_a2 = event2.detail) == null ? void 0 : _a2.focusReason) === "pointer") {
  23977. event2.preventDefault();
  23978. }
  23979. }
  23980. if (props.lockScroll) {
  23981. useLockscreen(visible);
  23982. }
  23983. function onCloseRequested() {
  23984. if (props.closeOnPressEscape) {
  23985. handleClose();
  23986. }
  23987. }
  23988. watch(() => props.modelValue, (val) => {
  23989. if (val) {
  23990. closed.value = false;
  23991. open();
  23992. rendered.value = true;
  23993. zIndex2.value = props.zIndex ? zIndex2.value++ : nextZIndex();
  23994. nextTick(() => {
  23995. emit("open");
  23996. if (targetRef.value) {
  23997. targetRef.value.scrollTop = 0;
  23998. }
  23999. });
  24000. } else {
  24001. if (visible.value) {
  24002. close();
  24003. }
  24004. }
  24005. });
  24006. watch(() => props.fullscreen, (val) => {
  24007. if (!targetRef.value)
  24008. return;
  24009. if (val) {
  24010. lastPosition = targetRef.value.style.transform;
  24011. targetRef.value.style.transform = "";
  24012. } else {
  24013. targetRef.value.style.transform = lastPosition;
  24014. }
  24015. });
  24016. onMounted(() => {
  24017. if (props.modelValue) {
  24018. visible.value = true;
  24019. rendered.value = true;
  24020. open();
  24021. }
  24022. });
  24023. return {
  24024. afterEnter,
  24025. afterLeave,
  24026. beforeLeave,
  24027. handleClose,
  24028. onModalClick,
  24029. close,
  24030. doClose,
  24031. onOpenAutoFocus,
  24032. onCloseAutoFocus,
  24033. onCloseRequested,
  24034. onFocusoutPrevented,
  24035. titleId,
  24036. bodyId,
  24037. closed,
  24038. style,
  24039. overlayDialogStyle,
  24040. rendered,
  24041. visible,
  24042. zIndex: zIndex2
  24043. };
  24044. };
  24045. const _hoisted_1$6 = ["aria-label", "aria-labelledby", "aria-describedby"];
  24046. const __default__$2 = defineComponent({
  24047. name: "ElDialog",
  24048. inheritAttrs: false
  24049. });
  24050. const _sfc_main$9 = /* @__PURE__ */ defineComponent({
  24051. ...__default__$2,
  24052. props: dialogProps,
  24053. emits: dialogEmits,
  24054. setup(__props, { expose }) {
  24055. const props = __props;
  24056. const slots = useSlots();
  24057. useDeprecated({
  24058. scope: "el-dialog",
  24059. from: "the title slot",
  24060. replacement: "the header slot",
  24061. version: "3.0.0",
  24062. ref: "https://element-plus.org/en-US/component/dialog.html#slots"
  24063. }, computed$1(() => !!slots.title));
  24064. useDeprecated({
  24065. scope: "el-dialog",
  24066. from: "custom-class",
  24067. replacement: "class",
  24068. version: "2.3.0",
  24069. ref: "https://element-plus.org/en-US/component/dialog.html#attributes",
  24070. type: "Attribute"
  24071. }, computed$1(() => !!props.customClass));
  24072. const ns = useNamespace("dialog");
  24073. const dialogRef = ref();
  24074. const headerRef = ref();
  24075. const dialogContentRef = ref();
  24076. const {
  24077. visible,
  24078. titleId,
  24079. bodyId,
  24080. style,
  24081. overlayDialogStyle,
  24082. rendered,
  24083. zIndex: zIndex2,
  24084. afterEnter,
  24085. afterLeave,
  24086. beforeLeave,
  24087. handleClose,
  24088. onModalClick,
  24089. onOpenAutoFocus,
  24090. onCloseAutoFocus,
  24091. onCloseRequested,
  24092. onFocusoutPrevented
  24093. } = useDialog(props, dialogRef);
  24094. provide(dialogInjectionKey, {
  24095. dialogRef,
  24096. headerRef,
  24097. bodyId,
  24098. ns,
  24099. rendered,
  24100. style
  24101. });
  24102. const overlayEvent = useSameTarget(onModalClick);
  24103. const draggable2 = computed$1(() => props.draggable && !props.fullscreen);
  24104. expose({
  24105. visible,
  24106. dialogContentRef
  24107. });
  24108. return (_ctx, _cache) => {
  24109. return openBlock(), createBlock(Teleport, {
  24110. to: "body",
  24111. disabled: !_ctx.appendToBody
  24112. }, [
  24113. createVNode(Transition, {
  24114. name: "dialog-fade",
  24115. onAfterEnter: unref(afterEnter),
  24116. onAfterLeave: unref(afterLeave),
  24117. onBeforeLeave: unref(beforeLeave),
  24118. persisted: ""
  24119. }, {
  24120. default: withCtx(() => [
  24121. withDirectives(createVNode(unref(ElOverlay), {
  24122. "custom-mask-event": "",
  24123. mask: _ctx.modal,
  24124. "overlay-class": _ctx.modalClass,
  24125. "z-index": unref(zIndex2)
  24126. }, {
  24127. default: withCtx(() => [
  24128. createElementVNode("div", {
  24129. role: "dialog",
  24130. "aria-modal": "true",
  24131. "aria-label": _ctx.title || void 0,
  24132. "aria-labelledby": !_ctx.title ? unref(titleId) : void 0,
  24133. "aria-describedby": unref(bodyId),
  24134. class: normalizeClass(`${unref(ns).namespace.value}-overlay-dialog`),
  24135. style: normalizeStyle(unref(overlayDialogStyle)),
  24136. onClick: _cache[0] || (_cache[0] = (...args) => unref(overlayEvent).onClick && unref(overlayEvent).onClick(...args)),
  24137. onMousedown: _cache[1] || (_cache[1] = (...args) => unref(overlayEvent).onMousedown && unref(overlayEvent).onMousedown(...args)),
  24138. onMouseup: _cache[2] || (_cache[2] = (...args) => unref(overlayEvent).onMouseup && unref(overlayEvent).onMouseup(...args))
  24139. }, [
  24140. createVNode(unref(ElFocusTrap), {
  24141. loop: "",
  24142. trapped: unref(visible),
  24143. "focus-start-el": "container",
  24144. onFocusAfterTrapped: unref(onOpenAutoFocus),
  24145. onFocusAfterReleased: unref(onCloseAutoFocus),
  24146. onFocusoutPrevented: unref(onFocusoutPrevented),
  24147. onReleaseRequested: unref(onCloseRequested)
  24148. }, {
  24149. default: withCtx(() => [
  24150. unref(rendered) ? (openBlock(), createBlock(ElDialogContent, mergeProps({
  24151. key: 0,
  24152. ref_key: "dialogContentRef",
  24153. ref: dialogContentRef
  24154. }, _ctx.$attrs, {
  24155. "custom-class": _ctx.customClass,
  24156. center: _ctx.center,
  24157. "align-center": _ctx.alignCenter,
  24158. "close-icon": _ctx.closeIcon,
  24159. draggable: unref(draggable2),
  24160. fullscreen: _ctx.fullscreen,
  24161. "show-close": _ctx.showClose,
  24162. title: _ctx.title,
  24163. onClose: unref(handleClose)
  24164. }), createSlots({
  24165. header: withCtx(() => [
  24166. !_ctx.$slots.title ? renderSlot(_ctx.$slots, "header", {
  24167. key: 0,
  24168. close: unref(handleClose),
  24169. titleId: unref(titleId),
  24170. titleClass: unref(ns).e("title")
  24171. }) : renderSlot(_ctx.$slots, "title", { key: 1 })
  24172. ]),
  24173. default: withCtx(() => [
  24174. renderSlot(_ctx.$slots, "default")
  24175. ]),
  24176. _: 2
  24177. }, [
  24178. _ctx.$slots.footer ? {
  24179. name: "footer",
  24180. fn: withCtx(() => [
  24181. renderSlot(_ctx.$slots, "footer")
  24182. ])
  24183. } : void 0
  24184. ]), 1040, ["custom-class", "center", "align-center", "close-icon", "draggable", "fullscreen", "show-close", "title", "onClose"])) : createCommentVNode("v-if", true)
  24185. ]),
  24186. _: 3
  24187. }, 8, ["trapped", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested"])
  24188. ], 46, _hoisted_1$6)
  24189. ]),
  24190. _: 3
  24191. }, 8, ["mask", "overlay-class", "z-index"]), [
  24192. [vShow, unref(visible)]
  24193. ])
  24194. ]),
  24195. _: 3
  24196. }, 8, ["onAfterEnter", "onAfterLeave", "onBeforeLeave"])
  24197. ], 8, ["disabled"]);
  24198. };
  24199. }
  24200. });
  24201. var Dialog = /* @__PURE__ */ _export_sfc$1(_sfc_main$9, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog.vue"]]);
  24202. const ElDialog = withInstall(Dialog);
  24203. const inputNumberProps = buildProps({
  24204. id: {
  24205. type: String,
  24206. default: void 0
  24207. },
  24208. step: {
  24209. type: Number,
  24210. default: 1
  24211. },
  24212. stepStrictly: Boolean,
  24213. max: {
  24214. type: Number,
  24215. default: Number.POSITIVE_INFINITY
  24216. },
  24217. min: {
  24218. type: Number,
  24219. default: Number.NEGATIVE_INFINITY
  24220. },
  24221. modelValue: Number,
  24222. readonly: Boolean,
  24223. disabled: Boolean,
  24224. size: useSizeProp,
  24225. controls: {
  24226. type: Boolean,
  24227. default: true
  24228. },
  24229. controlsPosition: {
  24230. type: String,
  24231. default: "",
  24232. values: ["", "right"]
  24233. },
  24234. valueOnClear: {
  24235. type: [String, Number, null],
  24236. validator: (val) => val === null || isNumber(val) || ["min", "max"].includes(val),
  24237. default: null
  24238. },
  24239. name: String,
  24240. label: String,
  24241. placeholder: String,
  24242. precision: {
  24243. type: Number,
  24244. validator: (val) => val >= 0 && val === Number.parseInt(`${val}`, 10)
  24245. },
  24246. validateEvent: {
  24247. type: Boolean,
  24248. default: true
  24249. }
  24250. });
  24251. const inputNumberEmits = {
  24252. [CHANGE_EVENT]: (cur, prev) => prev !== cur,
  24253. blur: (e) => e instanceof FocusEvent,
  24254. focus: (e) => e instanceof FocusEvent,
  24255. [INPUT_EVENT]: (val) => isNumber(val) || isNil(val),
  24256. [UPDATE_MODEL_EVENT]: (val) => isNumber(val) || isNil(val)
  24257. };
  24258. const _hoisted_1$5 = ["aria-label", "onKeydown"];
  24259. const _hoisted_2$5 = ["aria-label", "onKeydown"];
  24260. const __default__$1 = defineComponent({
  24261. name: "ElInputNumber"
  24262. });
  24263. const _sfc_main$8 = /* @__PURE__ */ defineComponent({
  24264. ...__default__$1,
  24265. props: inputNumberProps,
  24266. emits: inputNumberEmits,
  24267. setup(__props, { expose, emit }) {
  24268. const props = __props;
  24269. const { t: t2 } = useLocale();
  24270. const ns = useNamespace("input-number");
  24271. const input = ref();
  24272. const data = reactive({
  24273. currentValue: props.modelValue,
  24274. userInput: null
  24275. });
  24276. const { formItem } = useFormItem();
  24277. const minDisabled = computed$1(() => isNumber(props.modelValue) && props.modelValue <= props.min);
  24278. const maxDisabled = computed$1(() => isNumber(props.modelValue) && props.modelValue >= props.max);
  24279. const numPrecision = computed$1(() => {
  24280. const stepPrecision = getPrecision(props.step);
  24281. if (!isUndefined(props.precision)) {
  24282. if (stepPrecision > props.precision)
  24283. ;
  24284. return props.precision;
  24285. } else {
  24286. return Math.max(getPrecision(props.modelValue), stepPrecision);
  24287. }
  24288. });
  24289. const controlsAtRight = computed$1(() => {
  24290. return props.controls && props.controlsPosition === "right";
  24291. });
  24292. const inputNumberSize = useFormSize();
  24293. const inputNumberDisabled = useFormDisabled();
  24294. const displayValue = computed$1(() => {
  24295. if (data.userInput !== null) {
  24296. return data.userInput;
  24297. }
  24298. let currentValue = data.currentValue;
  24299. if (isNil(currentValue))
  24300. return "";
  24301. if (isNumber(currentValue)) {
  24302. if (Number.isNaN(currentValue))
  24303. return "";
  24304. if (!isUndefined(props.precision)) {
  24305. currentValue = currentValue.toFixed(props.precision);
  24306. }
  24307. }
  24308. return currentValue;
  24309. });
  24310. const toPrecision = (num, pre) => {
  24311. if (isUndefined(pre))
  24312. pre = numPrecision.value;
  24313. if (pre === 0)
  24314. return Math.round(num);
  24315. let snum = String(num);
  24316. const pointPos = snum.indexOf(".");
  24317. if (pointPos === -1)
  24318. return num;
  24319. const nums = snum.replace(".", "").split("");
  24320. const datum = nums[pointPos + pre];
  24321. if (!datum)
  24322. return num;
  24323. const length = snum.length;
  24324. if (snum.charAt(length - 1) === "5") {
  24325. snum = `${snum.slice(0, Math.max(0, length - 1))}6`;
  24326. }
  24327. return Number.parseFloat(Number(snum).toFixed(pre));
  24328. };
  24329. const getPrecision = (value) => {
  24330. if (isNil(value))
  24331. return 0;
  24332. const valueString = value.toString();
  24333. const dotPosition = valueString.indexOf(".");
  24334. let precision = 0;
  24335. if (dotPosition !== -1) {
  24336. precision = valueString.length - dotPosition - 1;
  24337. }
  24338. return precision;
  24339. };
  24340. const ensurePrecision = (val, coefficient = 1) => {
  24341. if (!isNumber(val))
  24342. return data.currentValue;
  24343. return toPrecision(val + props.step * coefficient);
  24344. };
  24345. const increase = () => {
  24346. if (props.readonly || inputNumberDisabled.value || maxDisabled.value)
  24347. return;
  24348. const value = Number(displayValue.value) || 0;
  24349. const newVal = ensurePrecision(value);
  24350. setCurrentValue(newVal);
  24351. emit(INPUT_EVENT, data.currentValue);
  24352. };
  24353. const decrease = () => {
  24354. if (props.readonly || inputNumberDisabled.value || minDisabled.value)
  24355. return;
  24356. const value = Number(displayValue.value) || 0;
  24357. const newVal = ensurePrecision(value, -1);
  24358. setCurrentValue(newVal);
  24359. emit(INPUT_EVENT, data.currentValue);
  24360. };
  24361. const verifyValue = (value, update) => {
  24362. const { max: max2, min: min2, step, precision, stepStrictly, valueOnClear } = props;
  24363. let newVal = Number(value);
  24364. if (isNil(value) || Number.isNaN(newVal)) {
  24365. return null;
  24366. }
  24367. if (value === "") {
  24368. if (valueOnClear === null) {
  24369. return null;
  24370. }
  24371. newVal = isString(valueOnClear) ? { min: min2, max: max2 }[valueOnClear] : valueOnClear;
  24372. }
  24373. if (stepStrictly) {
  24374. newVal = toPrecision(Math.round(newVal / step) * step, precision);
  24375. }
  24376. if (!isUndefined(precision)) {
  24377. newVal = toPrecision(newVal, precision);
  24378. }
  24379. if (newVal > max2 || newVal < min2) {
  24380. newVal = newVal > max2 ? max2 : min2;
  24381. update && emit(UPDATE_MODEL_EVENT, newVal);
  24382. }
  24383. return newVal;
  24384. };
  24385. const setCurrentValue = (value, emitChange = true) => {
  24386. var _a2;
  24387. const oldVal = data.currentValue;
  24388. const newVal = verifyValue(value);
  24389. if (!emitChange) {
  24390. emit(UPDATE_MODEL_EVENT, newVal);
  24391. return;
  24392. }
  24393. if (oldVal === newVal)
  24394. return;
  24395. data.userInput = null;
  24396. emit(UPDATE_MODEL_EVENT, newVal);
  24397. emit(CHANGE_EVENT, newVal, oldVal);
  24398. if (props.validateEvent) {
  24399. (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "change").catch((err) => debugWarn());
  24400. }
  24401. data.currentValue = newVal;
  24402. };
  24403. const handleInput = (value) => {
  24404. data.userInput = value;
  24405. const newVal = value === "" ? null : Number(value);
  24406. emit(INPUT_EVENT, newVal);
  24407. setCurrentValue(newVal, false);
  24408. };
  24409. const handleInputChange = (value) => {
  24410. const newVal = value !== "" ? Number(value) : "";
  24411. if (isNumber(newVal) && !Number.isNaN(newVal) || value === "") {
  24412. setCurrentValue(newVal);
  24413. }
  24414. data.userInput = null;
  24415. };
  24416. const focus = () => {
  24417. var _a2, _b;
  24418. (_b = (_a2 = input.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b.call(_a2);
  24419. };
  24420. const blur = () => {
  24421. var _a2, _b;
  24422. (_b = (_a2 = input.value) == null ? void 0 : _a2.blur) == null ? void 0 : _b.call(_a2);
  24423. };
  24424. const handleFocus = (event2) => {
  24425. emit("focus", event2);
  24426. };
  24427. const handleBlur = (event2) => {
  24428. var _a2;
  24429. emit("blur", event2);
  24430. if (props.validateEvent) {
  24431. (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "blur").catch((err) => debugWarn());
  24432. }
  24433. };
  24434. watch(() => props.modelValue, (value) => {
  24435. const userInput = verifyValue(data.userInput);
  24436. const newValue = verifyValue(value, true);
  24437. if (!isNumber(userInput) && (!userInput || userInput !== newValue)) {
  24438. data.currentValue = newValue;
  24439. data.userInput = null;
  24440. }
  24441. }, { immediate: true });
  24442. onMounted(() => {
  24443. var _a2;
  24444. const { min: min2, max: max2, modelValue } = props;
  24445. const innerInput = (_a2 = input.value) == null ? void 0 : _a2.input;
  24446. innerInput.setAttribute("role", "spinbutton");
  24447. if (Number.isFinite(max2)) {
  24448. innerInput.setAttribute("aria-valuemax", String(max2));
  24449. } else {
  24450. innerInput.removeAttribute("aria-valuemax");
  24451. }
  24452. if (Number.isFinite(min2)) {
  24453. innerInput.setAttribute("aria-valuemin", String(min2));
  24454. } else {
  24455. innerInput.removeAttribute("aria-valuemin");
  24456. }
  24457. innerInput.setAttribute("aria-valuenow", String(data.currentValue));
  24458. innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value));
  24459. if (!isNumber(modelValue) && modelValue != null) {
  24460. let val = Number(modelValue);
  24461. if (Number.isNaN(val)) {
  24462. val = null;
  24463. }
  24464. emit(UPDATE_MODEL_EVENT, val);
  24465. }
  24466. });
  24467. onUpdated(() => {
  24468. var _a2;
  24469. const innerInput = (_a2 = input.value) == null ? void 0 : _a2.input;
  24470. innerInput == null ? void 0 : innerInput.setAttribute("aria-valuenow", `${data.currentValue}`);
  24471. });
  24472. expose({
  24473. focus,
  24474. blur
  24475. });
  24476. return (_ctx, _cache) => {
  24477. return openBlock(), createElementBlock("div", {
  24478. class: normalizeClass([
  24479. unref(ns).b(),
  24480. unref(ns).m(unref(inputNumberSize)),
  24481. unref(ns).is("disabled", unref(inputNumberDisabled)),
  24482. unref(ns).is("without-controls", !_ctx.controls),
  24483. unref(ns).is("controls-right", unref(controlsAtRight))
  24484. ]),
  24485. onDragstart: _cache[1] || (_cache[1] = withModifiers(() => {
  24486. }, ["prevent"]))
  24487. }, [
  24488. _ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
  24489. key: 0,
  24490. role: "button",
  24491. "aria-label": unref(t2)("el.inputNumber.decrease"),
  24492. class: normalizeClass([unref(ns).e("decrease"), unref(ns).is("disabled", unref(minDisabled))]),
  24493. onKeydown: withKeys(decrease, ["enter"])
  24494. }, [
  24495. createVNode(unref(ElIcon), null, {
  24496. default: withCtx(() => [
  24497. unref(controlsAtRight) ? (openBlock(), createBlock(unref(arrow_down_default), { key: 0 })) : (openBlock(), createBlock(unref(minus_default), { key: 1 }))
  24498. ]),
  24499. _: 1
  24500. })
  24501. ], 42, _hoisted_1$5)), [
  24502. [unref(vRepeatClick), decrease]
  24503. ]) : createCommentVNode("v-if", true),
  24504. _ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
  24505. key: 1,
  24506. role: "button",
  24507. "aria-label": unref(t2)("el.inputNumber.increase"),
  24508. class: normalizeClass([unref(ns).e("increase"), unref(ns).is("disabled", unref(maxDisabled))]),
  24509. onKeydown: withKeys(increase, ["enter"])
  24510. }, [
  24511. createVNode(unref(ElIcon), null, {
  24512. default: withCtx(() => [
  24513. unref(controlsAtRight) ? (openBlock(), createBlock(unref(arrow_up_default), { key: 0 })) : (openBlock(), createBlock(unref(plus_default), { key: 1 }))
  24514. ]),
  24515. _: 1
  24516. })
  24517. ], 42, _hoisted_2$5)), [
  24518. [unref(vRepeatClick), increase]
  24519. ]) : createCommentVNode("v-if", true),
  24520. createVNode(unref(ElInput), {
  24521. id: _ctx.id,
  24522. ref_key: "input",
  24523. ref: input,
  24524. type: "number",
  24525. step: _ctx.step,
  24526. "model-value": unref(displayValue),
  24527. placeholder: _ctx.placeholder,
  24528. readonly: _ctx.readonly,
  24529. disabled: unref(inputNumberDisabled),
  24530. size: unref(inputNumberSize),
  24531. max: _ctx.max,
  24532. min: _ctx.min,
  24533. name: _ctx.name,
  24534. label: _ctx.label,
  24535. "validate-event": false,
  24536. onWheel: _cache[0] || (_cache[0] = withModifiers(() => {
  24537. }, ["prevent"])),
  24538. onKeydown: [
  24539. withKeys(withModifiers(increase, ["prevent"]), ["up"]),
  24540. withKeys(withModifiers(decrease, ["prevent"]), ["down"])
  24541. ],
  24542. onBlur: handleBlur,
  24543. onFocus: handleFocus,
  24544. onInput: handleInput,
  24545. onChange: handleInputChange
  24546. }, null, 8, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "label", "onKeydown"])
  24547. ], 34);
  24548. };
  24549. }
  24550. });
  24551. var InputNumber = /* @__PURE__ */ _export_sfc$1(_sfc_main$8, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/input-number/src/input-number.vue"]]);
  24552. const ElInputNumber = withInstall(InputNumber);
  24553. const selectGroupKey = Symbol("ElSelectGroup");
  24554. const selectKey = Symbol("ElSelect");
  24555. function useOption(props, states) {
  24556. const select = inject(selectKey);
  24557. const selectGroup = inject(selectGroupKey, { disabled: false });
  24558. const isObject3 = computed$1(() => {
  24559. return Object.prototype.toString.call(props.value).toLowerCase() === "[object object]";
  24560. });
  24561. const itemSelected = computed$1(() => {
  24562. if (!select.props.multiple) {
  24563. return isEqual2(props.value, select.props.modelValue);
  24564. } else {
  24565. return contains(select.props.modelValue, props.value);
  24566. }
  24567. });
  24568. const limitReached = computed$1(() => {
  24569. if (select.props.multiple) {
  24570. const modelValue = select.props.modelValue || [];
  24571. return !itemSelected.value && modelValue.length >= select.props.multipleLimit && select.props.multipleLimit > 0;
  24572. } else {
  24573. return false;
  24574. }
  24575. });
  24576. const currentLabel = computed$1(() => {
  24577. return props.label || (isObject3.value ? "" : props.value);
  24578. });
  24579. const currentValue = computed$1(() => {
  24580. return props.value || props.label || "";
  24581. });
  24582. const isDisabled3 = computed$1(() => {
  24583. return props.disabled || states.groupDisabled || limitReached.value;
  24584. });
  24585. const instance = getCurrentInstance();
  24586. const contains = (arr = [], target) => {
  24587. if (!isObject3.value) {
  24588. return arr && arr.includes(target);
  24589. } else {
  24590. const valueKey = select.props.valueKey;
  24591. return arr && arr.some((item) => {
  24592. return toRaw$1(get$2(item, valueKey)) === get$2(target, valueKey);
  24593. });
  24594. }
  24595. };
  24596. const isEqual2 = (a, b) => {
  24597. if (!isObject3.value) {
  24598. return a === b;
  24599. } else {
  24600. const { valueKey } = select.props;
  24601. return get$2(a, valueKey) === get$2(b, valueKey);
  24602. }
  24603. };
  24604. const hoverItem = () => {
  24605. if (!props.disabled && !selectGroup.disabled) {
  24606. select.hoverIndex = select.optionsArray.indexOf(instance.proxy);
  24607. }
  24608. };
  24609. watch(() => currentLabel.value, () => {
  24610. if (!props.created && !select.props.remote)
  24611. select.setSelected();
  24612. });
  24613. watch(() => props.value, (val, oldVal) => {
  24614. const { remote, valueKey } = select.props;
  24615. if (!Object.is(val, oldVal)) {
  24616. select.onOptionDestroy(oldVal, instance.proxy);
  24617. select.onOptionCreate(instance.proxy);
  24618. }
  24619. if (!props.created && !remote) {
  24620. if (valueKey && typeof val === "object" && typeof oldVal === "object" && val[valueKey] === oldVal[valueKey]) {
  24621. return;
  24622. }
  24623. select.setSelected();
  24624. }
  24625. });
  24626. watch(() => selectGroup.disabled, () => {
  24627. states.groupDisabled = selectGroup.disabled;
  24628. }, { immediate: true });
  24629. const { queryChange } = toRaw$1(select);
  24630. watch(queryChange, (changes) => {
  24631. const { query } = unref(changes);
  24632. const regexp = new RegExp(escapeStringRegexp(query), "i");
  24633. states.visible = regexp.test(currentLabel.value) || props.created;
  24634. if (!states.visible) {
  24635. select.filteredOptionsCount--;
  24636. }
  24637. }, { immediate: true });
  24638. return {
  24639. select,
  24640. currentLabel,
  24641. currentValue,
  24642. itemSelected,
  24643. isDisabled: isDisabled3,
  24644. hoverItem
  24645. };
  24646. }
  24647. const _sfc_main$7 = defineComponent({
  24648. name: "ElOption",
  24649. componentName: "ElOption",
  24650. props: {
  24651. value: {
  24652. required: true,
  24653. type: [String, Number, Boolean, Object]
  24654. },
  24655. label: [String, Number],
  24656. created: Boolean,
  24657. disabled: {
  24658. type: Boolean,
  24659. default: false
  24660. }
  24661. },
  24662. setup(props) {
  24663. const ns = useNamespace("select");
  24664. const states = reactive({
  24665. index: -1,
  24666. groupDisabled: false,
  24667. visible: true,
  24668. hitState: false,
  24669. hover: false
  24670. });
  24671. const { currentLabel, itemSelected, isDisabled: isDisabled3, select, hoverItem } = useOption(props, states);
  24672. const { visible, hover } = toRefs(states);
  24673. const vm = getCurrentInstance().proxy;
  24674. select.onOptionCreate(vm);
  24675. onBeforeUnmount(() => {
  24676. const key = vm.value;
  24677. const { selected } = select;
  24678. const selectedOptions = select.props.multiple ? selected : [selected];
  24679. const doesSelected = selectedOptions.some((item) => {
  24680. return item.value === vm.value;
  24681. });
  24682. nextTick(() => {
  24683. if (select.cachedOptions.get(key) === vm && !doesSelected) {
  24684. select.cachedOptions.delete(key);
  24685. }
  24686. });
  24687. select.onOptionDestroy(key, vm);
  24688. });
  24689. function selectOptionClick() {
  24690. if (props.disabled !== true && states.groupDisabled !== true) {
  24691. select.handleOptionSelect(vm, true);
  24692. }
  24693. }
  24694. return {
  24695. ns,
  24696. currentLabel,
  24697. itemSelected,
  24698. isDisabled: isDisabled3,
  24699. select,
  24700. hoverItem,
  24701. visible,
  24702. hover,
  24703. selectOptionClick,
  24704. states
  24705. };
  24706. }
  24707. });
  24708. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  24709. return withDirectives((openBlock(), createElementBlock("li", {
  24710. class: normalizeClass([
  24711. _ctx.ns.be("dropdown", "item"),
  24712. _ctx.ns.is("disabled", _ctx.isDisabled),
  24713. {
  24714. selected: _ctx.itemSelected,
  24715. hover: _ctx.hover
  24716. }
  24717. ]),
  24718. onMouseenter: _cache[0] || (_cache[0] = (...args) => _ctx.hoverItem && _ctx.hoverItem(...args)),
  24719. onClick: _cache[1] || (_cache[1] = withModifiers((...args) => _ctx.selectOptionClick && _ctx.selectOptionClick(...args), ["stop"]))
  24720. }, [
  24721. renderSlot(_ctx.$slots, "default", {}, () => [
  24722. createElementVNode("span", null, toDisplayString(_ctx.currentLabel), 1)
  24723. ])
  24724. ], 34)), [
  24725. [vShow, _ctx.visible]
  24726. ]);
  24727. }
  24728. var Option = /* @__PURE__ */ _export_sfc$1(_sfc_main$7, [["render", _sfc_render$3], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/option.vue"]]);
  24729. const _sfc_main$6 = defineComponent({
  24730. name: "ElSelectDropdown",
  24731. componentName: "ElSelectDropdown",
  24732. setup() {
  24733. const select = inject(selectKey);
  24734. const ns = useNamespace("select");
  24735. const popperClass = computed$1(() => select.props.popperClass);
  24736. const isMultiple = computed$1(() => select.props.multiple);
  24737. const isFitInputWidth = computed$1(() => select.props.fitInputWidth);
  24738. const minWidth = ref("");
  24739. function updateMinWidth() {
  24740. var _a2;
  24741. minWidth.value = `${(_a2 = select.selectWrapper) == null ? void 0 : _a2.offsetWidth}px`;
  24742. }
  24743. onMounted(() => {
  24744. updateMinWidth();
  24745. useResizeObserver(select.selectWrapper, updateMinWidth);
  24746. });
  24747. return {
  24748. ns,
  24749. minWidth,
  24750. popperClass,
  24751. isMultiple,
  24752. isFitInputWidth
  24753. };
  24754. }
  24755. });
  24756. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  24757. return openBlock(), createElementBlock("div", {
  24758. class: normalizeClass([_ctx.ns.b("dropdown"), _ctx.ns.is("multiple", _ctx.isMultiple), _ctx.popperClass]),
  24759. style: normalizeStyle({ [_ctx.isFitInputWidth ? "width" : "minWidth"]: _ctx.minWidth })
  24760. }, [
  24761. renderSlot(_ctx.$slots, "default")
  24762. ], 6);
  24763. }
  24764. var ElSelectMenu = /* @__PURE__ */ _export_sfc$1(_sfc_main$6, [["render", _sfc_render$2], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/select-dropdown.vue"]]);
  24765. function useSelectStates(props) {
  24766. const { t: t2 } = useLocale();
  24767. return reactive({
  24768. options: /* @__PURE__ */ new Map(),
  24769. cachedOptions: /* @__PURE__ */ new Map(),
  24770. createdLabel: null,
  24771. createdSelected: false,
  24772. selected: props.multiple ? [] : {},
  24773. inputLength: 20,
  24774. inputWidth: 0,
  24775. optionsCount: 0,
  24776. filteredOptionsCount: 0,
  24777. visible: false,
  24778. softFocus: false,
  24779. selectedLabel: "",
  24780. hoverIndex: -1,
  24781. query: "",
  24782. previousQuery: null,
  24783. inputHovering: false,
  24784. cachedPlaceHolder: "",
  24785. currentPlaceholder: t2("el.select.placeholder"),
  24786. menuVisibleOnFocus: false,
  24787. isOnComposition: false,
  24788. isSilentBlur: false,
  24789. prefixWidth: 11,
  24790. tagInMultiLine: false,
  24791. mouseEnter: false
  24792. });
  24793. }
  24794. const useSelect = (props, states, ctx) => {
  24795. const { t: t2 } = useLocale();
  24796. const ns = useNamespace("select");
  24797. useDeprecated({
  24798. from: "suffixTransition",
  24799. replacement: "override style scheme",
  24800. version: "2.3.0",
  24801. scope: "props",
  24802. ref: "https://element-plus.org/en-US/component/select.html#select-attributes"
  24803. }, computed$1(() => props.suffixTransition === false));
  24804. const reference = ref(null);
  24805. const input = ref(null);
  24806. const iOSInput = ref(null);
  24807. const tooltipRef = ref(null);
  24808. const tags = ref(null);
  24809. const selectWrapper = ref(null);
  24810. const scrollbar = ref(null);
  24811. const hoverOption = ref(-1);
  24812. const queryChange = shallowRef({ query: "" });
  24813. const groupQueryChange = shallowRef("");
  24814. const optionList = ref([]);
  24815. let originClientHeight = 0;
  24816. const { form, formItem } = useFormItem();
  24817. const readonly2 = computed$1(() => !props.filterable || props.multiple || !states.visible);
  24818. const selectDisabled = computed$1(() => props.disabled || (form == null ? void 0 : form.disabled));
  24819. const showClose = computed$1(() => {
  24820. const hasValue = props.multiple ? Array.isArray(props.modelValue) && props.modelValue.length > 0 : props.modelValue !== void 0 && props.modelValue !== null && props.modelValue !== "";
  24821. const criteria = props.clearable && !selectDisabled.value && states.inputHovering && hasValue;
  24822. return criteria;
  24823. });
  24824. const iconComponent = computed$1(() => props.remote && props.filterable && !props.remoteShowSuffix ? "" : props.suffixIcon);
  24825. const iconReverse = computed$1(() => ns.is("reverse", iconComponent.value && states.visible && props.suffixTransition));
  24826. const debounce$12 = computed$1(() => props.remote ? 300 : 0);
  24827. const emptyText = computed$1(() => {
  24828. if (props.loading) {
  24829. return props.loadingText || t2("el.select.loading");
  24830. } else {
  24831. if (props.remote && states.query === "" && states.options.size === 0)
  24832. return false;
  24833. if (props.filterable && states.query && states.options.size > 0 && states.filteredOptionsCount === 0) {
  24834. return props.noMatchText || t2("el.select.noMatch");
  24835. }
  24836. if (states.options.size === 0) {
  24837. return props.noDataText || t2("el.select.noData");
  24838. }
  24839. }
  24840. return null;
  24841. });
  24842. const optionsArray = computed$1(() => {
  24843. const list = Array.from(states.options.values());
  24844. const newList = [];
  24845. optionList.value.forEach((item) => {
  24846. const index2 = list.findIndex((i2) => i2.currentLabel === item);
  24847. if (index2 > -1) {
  24848. newList.push(list[index2]);
  24849. }
  24850. });
  24851. return newList.length ? newList : list;
  24852. });
  24853. const cachedOptionsArray = computed$1(() => Array.from(states.cachedOptions.values()));
  24854. const showNewOption = computed$1(() => {
  24855. const hasExistingOption = optionsArray.value.filter((option) => {
  24856. return !option.created;
  24857. }).some((option) => {
  24858. return option.currentLabel === states.query;
  24859. });
  24860. return props.filterable && props.allowCreate && states.query !== "" && !hasExistingOption;
  24861. });
  24862. const selectSize = useFormSize();
  24863. const collapseTagSize = computed$1(() => ["small"].includes(selectSize.value) ? "small" : "default");
  24864. const dropMenuVisible = computed$1({
  24865. get() {
  24866. return states.visible && emptyText.value !== false;
  24867. },
  24868. set(val) {
  24869. states.visible = val;
  24870. }
  24871. });
  24872. watch([() => selectDisabled.value, () => selectSize.value, () => form == null ? void 0 : form.size], () => {
  24873. nextTick(() => {
  24874. resetInputHeight();
  24875. });
  24876. });
  24877. watch(() => props.placeholder, (val) => {
  24878. states.cachedPlaceHolder = states.currentPlaceholder = val;
  24879. });
  24880. watch(() => props.modelValue, (val, oldVal) => {
  24881. if (props.multiple) {
  24882. resetInputHeight();
  24883. if (val && val.length > 0 || input.value && states.query !== "") {
  24884. states.currentPlaceholder = "";
  24885. } else {
  24886. states.currentPlaceholder = states.cachedPlaceHolder;
  24887. }
  24888. if (props.filterable && !props.reserveKeyword) {
  24889. states.query = "";
  24890. handleQueryChange(states.query);
  24891. }
  24892. }
  24893. setSelected();
  24894. if (props.filterable && !props.multiple) {
  24895. states.inputLength = 20;
  24896. }
  24897. if (!isEqual(val, oldVal) && props.validateEvent) {
  24898. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  24899. }
  24900. }, {
  24901. flush: "post",
  24902. deep: true
  24903. });
  24904. watch(() => states.visible, (val) => {
  24905. var _a2, _b, _c, _d, _e;
  24906. if (!val) {
  24907. if (props.filterable) {
  24908. if (isFunction$3(props.filterMethod)) {
  24909. props.filterMethod("");
  24910. }
  24911. if (isFunction$3(props.remoteMethod)) {
  24912. props.remoteMethod("");
  24913. }
  24914. }
  24915. input.value && input.value.blur();
  24916. states.query = "";
  24917. states.previousQuery = null;
  24918. states.selectedLabel = "";
  24919. states.inputLength = 20;
  24920. states.menuVisibleOnFocus = false;
  24921. resetHoverIndex();
  24922. nextTick(() => {
  24923. if (input.value && input.value.value === "" && states.selected.length === 0) {
  24924. states.currentPlaceholder = states.cachedPlaceHolder;
  24925. }
  24926. });
  24927. if (!props.multiple) {
  24928. if (states.selected) {
  24929. if (props.filterable && props.allowCreate && states.createdSelected && states.createdLabel) {
  24930. states.selectedLabel = states.createdLabel;
  24931. } else {
  24932. states.selectedLabel = states.selected.currentLabel;
  24933. }
  24934. if (props.filterable)
  24935. states.query = states.selectedLabel;
  24936. }
  24937. if (props.filterable) {
  24938. states.currentPlaceholder = states.cachedPlaceHolder;
  24939. }
  24940. }
  24941. } else {
  24942. (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  24943. if (props.filterable) {
  24944. states.filteredOptionsCount = states.optionsCount;
  24945. states.query = props.remote ? "" : states.selectedLabel;
  24946. (_d = (_c = iOSInput.value) == null ? void 0 : _c.focus) == null ? void 0 : _d.call(_c);
  24947. if (props.multiple) {
  24948. (_e = input.value) == null ? void 0 : _e.focus();
  24949. } else {
  24950. if (states.selectedLabel) {
  24951. states.currentPlaceholder = `${states.selectedLabel}`;
  24952. states.selectedLabel = "";
  24953. }
  24954. }
  24955. handleQueryChange(states.query);
  24956. if (!props.multiple && !props.remote) {
  24957. queryChange.value.query = "";
  24958. triggerRef(queryChange);
  24959. triggerRef(groupQueryChange);
  24960. }
  24961. }
  24962. }
  24963. ctx.emit("visible-change", val);
  24964. });
  24965. watch(() => states.options.entries(), () => {
  24966. var _a2, _b, _c;
  24967. if (!isClient)
  24968. return;
  24969. (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  24970. if (props.multiple) {
  24971. resetInputHeight();
  24972. }
  24973. const inputs = ((_c = selectWrapper.value) == null ? void 0 : _c.querySelectorAll("input")) || [];
  24974. if (!Array.from(inputs).includes(document.activeElement)) {
  24975. setSelected();
  24976. }
  24977. if (props.defaultFirstOption && (props.filterable || props.remote) && states.filteredOptionsCount) {
  24978. checkDefaultFirstOption();
  24979. }
  24980. }, {
  24981. flush: "post"
  24982. });
  24983. watch(() => states.hoverIndex, (val) => {
  24984. if (isNumber(val) && val > -1) {
  24985. hoverOption.value = optionsArray.value[val] || {};
  24986. } else {
  24987. hoverOption.value = {};
  24988. }
  24989. optionsArray.value.forEach((option) => {
  24990. option.hover = hoverOption.value === option;
  24991. });
  24992. });
  24993. const resetInputHeight = () => {
  24994. nextTick(() => {
  24995. var _a2, _b;
  24996. if (!reference.value)
  24997. return;
  24998. const input2 = reference.value.$el.querySelector("input");
  24999. originClientHeight = originClientHeight || (input2.clientHeight > 0 ? input2.clientHeight + 2 : 0);
  25000. const _tags = tags.value;
  25001. const gotSize = getComponentSize(selectSize.value || (form == null ? void 0 : form.size));
  25002. const sizeInMap = selectSize.value || gotSize === originClientHeight || originClientHeight <= 0 ? gotSize : originClientHeight;
  25003. const isElHidden = input2.offsetParent === null;
  25004. !isElHidden && (input2.style.height = `${(states.selected.length === 0 ? sizeInMap : Math.max(_tags ? _tags.clientHeight + (_tags.clientHeight > sizeInMap ? 6 : 0) : 0, sizeInMap)) - 2}px`);
  25005. states.tagInMultiLine = Number.parseFloat(input2.style.height) >= sizeInMap;
  25006. if (states.visible && emptyText.value !== false) {
  25007. (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  25008. }
  25009. });
  25010. };
  25011. const handleQueryChange = async (val) => {
  25012. if (states.previousQuery === val || states.isOnComposition)
  25013. return;
  25014. if (states.previousQuery === null && (isFunction$3(props.filterMethod) || isFunction$3(props.remoteMethod))) {
  25015. states.previousQuery = val;
  25016. return;
  25017. }
  25018. states.previousQuery = val;
  25019. nextTick(() => {
  25020. var _a2, _b;
  25021. if (states.visible)
  25022. (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  25023. });
  25024. states.hoverIndex = -1;
  25025. if (props.multiple && props.filterable) {
  25026. nextTick(() => {
  25027. const length = input.value.value.length * 15 + 20;
  25028. states.inputLength = props.collapseTags ? Math.min(50, length) : length;
  25029. managePlaceholder();
  25030. resetInputHeight();
  25031. });
  25032. }
  25033. if (props.remote && isFunction$3(props.remoteMethod)) {
  25034. states.hoverIndex = -1;
  25035. props.remoteMethod(val);
  25036. } else if (isFunction$3(props.filterMethod)) {
  25037. props.filterMethod(val);
  25038. triggerRef(groupQueryChange);
  25039. } else {
  25040. states.filteredOptionsCount = states.optionsCount;
  25041. queryChange.value.query = val;
  25042. triggerRef(queryChange);
  25043. triggerRef(groupQueryChange);
  25044. }
  25045. if (props.defaultFirstOption && (props.filterable || props.remote) && states.filteredOptionsCount) {
  25046. await nextTick();
  25047. checkDefaultFirstOption();
  25048. }
  25049. };
  25050. const managePlaceholder = () => {
  25051. if (states.currentPlaceholder !== "") {
  25052. states.currentPlaceholder = input.value.value ? "" : states.cachedPlaceHolder;
  25053. }
  25054. };
  25055. const checkDefaultFirstOption = () => {
  25056. const optionsInDropdown = optionsArray.value.filter((n) => n.visible && !n.disabled && !n.states.groupDisabled);
  25057. const userCreatedOption = optionsInDropdown.find((n) => n.created);
  25058. const firstOriginOption = optionsInDropdown[0];
  25059. states.hoverIndex = getValueIndex(optionsArray.value, userCreatedOption || firstOriginOption);
  25060. };
  25061. const setSelected = () => {
  25062. var _a2;
  25063. if (!props.multiple) {
  25064. const option = getOption(props.modelValue);
  25065. if ((_a2 = option.props) == null ? void 0 : _a2.created) {
  25066. states.createdLabel = option.props.value;
  25067. states.createdSelected = true;
  25068. } else {
  25069. states.createdSelected = false;
  25070. }
  25071. states.selectedLabel = option.currentLabel;
  25072. states.selected = option;
  25073. if (props.filterable)
  25074. states.query = states.selectedLabel;
  25075. return;
  25076. } else {
  25077. states.selectedLabel = "";
  25078. }
  25079. const result = [];
  25080. if (Array.isArray(props.modelValue)) {
  25081. props.modelValue.forEach((value) => {
  25082. result.push(getOption(value));
  25083. });
  25084. }
  25085. states.selected = result;
  25086. nextTick(() => {
  25087. resetInputHeight();
  25088. });
  25089. };
  25090. const getOption = (value) => {
  25091. let option;
  25092. const isObjectValue = toRawType(value).toLowerCase() === "object";
  25093. const isNull = toRawType(value).toLowerCase() === "null";
  25094. const isUndefined2 = toRawType(value).toLowerCase() === "undefined";
  25095. for (let i2 = states.cachedOptions.size - 1; i2 >= 0; i2--) {
  25096. const cachedOption = cachedOptionsArray.value[i2];
  25097. const isEqualValue = isObjectValue ? get$2(cachedOption.value, props.valueKey) === get$2(value, props.valueKey) : cachedOption.value === value;
  25098. if (isEqualValue) {
  25099. option = {
  25100. value,
  25101. currentLabel: cachedOption.currentLabel,
  25102. isDisabled: cachedOption.isDisabled
  25103. };
  25104. break;
  25105. }
  25106. }
  25107. if (option)
  25108. return option;
  25109. const label = isObjectValue ? value.label : !isNull && !isUndefined2 ? value : "";
  25110. const newOption = {
  25111. value,
  25112. currentLabel: label
  25113. };
  25114. if (props.multiple) {
  25115. newOption.hitState = false;
  25116. }
  25117. return newOption;
  25118. };
  25119. const resetHoverIndex = () => {
  25120. setTimeout(() => {
  25121. const valueKey = props.valueKey;
  25122. if (!props.multiple) {
  25123. states.hoverIndex = optionsArray.value.findIndex((item) => {
  25124. return getValueKey(item) === getValueKey(states.selected);
  25125. });
  25126. } else {
  25127. if (states.selected.length > 0) {
  25128. states.hoverIndex = Math.min.apply(null, states.selected.map((selected) => {
  25129. return optionsArray.value.findIndex((item) => {
  25130. return get$2(item, valueKey) === get$2(selected, valueKey);
  25131. });
  25132. }));
  25133. } else {
  25134. states.hoverIndex = -1;
  25135. }
  25136. }
  25137. }, 300);
  25138. };
  25139. const handleResize = () => {
  25140. var _a2, _b;
  25141. resetInputWidth();
  25142. (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.updatePopper) == null ? void 0 : _b.call(_a2);
  25143. if (props.multiple)
  25144. resetInputHeight();
  25145. };
  25146. const resetInputWidth = () => {
  25147. var _a2;
  25148. states.inputWidth = (_a2 = reference.value) == null ? void 0 : _a2.$el.offsetWidth;
  25149. };
  25150. const onInputChange = () => {
  25151. if (props.filterable && states.query !== states.selectedLabel) {
  25152. states.query = states.selectedLabel;
  25153. handleQueryChange(states.query);
  25154. }
  25155. };
  25156. const debouncedOnInputChange = debounce$2(() => {
  25157. onInputChange();
  25158. }, debounce$12.value);
  25159. const debouncedQueryChange = debounce$2((e) => {
  25160. handleQueryChange(e.target.value);
  25161. }, debounce$12.value);
  25162. const emitChange = (val) => {
  25163. if (!isEqual(props.modelValue, val)) {
  25164. ctx.emit(CHANGE_EVENT, val);
  25165. }
  25166. };
  25167. const deletePrevTag = (e) => {
  25168. if (e.code === EVENT_CODE.delete)
  25169. return;
  25170. if (e.target.value.length <= 0 && !toggleLastOptionHitState()) {
  25171. const value = props.modelValue.slice();
  25172. value.pop();
  25173. ctx.emit(UPDATE_MODEL_EVENT, value);
  25174. emitChange(value);
  25175. }
  25176. if (e.target.value.length === 1 && props.modelValue.length === 0) {
  25177. states.currentPlaceholder = states.cachedPlaceHolder;
  25178. }
  25179. };
  25180. const deleteTag = (event2, tag) => {
  25181. const index2 = states.selected.indexOf(tag);
  25182. if (index2 > -1 && !selectDisabled.value) {
  25183. const value = props.modelValue.slice();
  25184. value.splice(index2, 1);
  25185. ctx.emit(UPDATE_MODEL_EVENT, value);
  25186. emitChange(value);
  25187. ctx.emit("remove-tag", tag.value);
  25188. }
  25189. event2.stopPropagation();
  25190. };
  25191. const deleteSelected = (event2) => {
  25192. event2.stopPropagation();
  25193. const value = props.multiple ? [] : "";
  25194. if (!isString(value)) {
  25195. for (const item of states.selected) {
  25196. if (item.isDisabled)
  25197. value.push(item.value);
  25198. }
  25199. }
  25200. ctx.emit(UPDATE_MODEL_EVENT, value);
  25201. emitChange(value);
  25202. states.hoverIndex = -1;
  25203. states.visible = false;
  25204. ctx.emit("clear");
  25205. };
  25206. const handleOptionSelect = (option, byClick) => {
  25207. var _a2;
  25208. if (props.multiple) {
  25209. const value = (props.modelValue || []).slice();
  25210. const optionIndex = getValueIndex(value, option.value);
  25211. if (optionIndex > -1) {
  25212. value.splice(optionIndex, 1);
  25213. } else if (props.multipleLimit <= 0 || value.length < props.multipleLimit) {
  25214. value.push(option.value);
  25215. }
  25216. ctx.emit(UPDATE_MODEL_EVENT, value);
  25217. emitChange(value);
  25218. if (option.created) {
  25219. states.query = "";
  25220. handleQueryChange("");
  25221. states.inputLength = 20;
  25222. }
  25223. if (props.filterable)
  25224. (_a2 = input.value) == null ? void 0 : _a2.focus();
  25225. } else {
  25226. ctx.emit(UPDATE_MODEL_EVENT, option.value);
  25227. emitChange(option.value);
  25228. states.visible = false;
  25229. }
  25230. states.isSilentBlur = byClick;
  25231. setSoftFocus();
  25232. if (states.visible)
  25233. return;
  25234. nextTick(() => {
  25235. scrollToOption(option);
  25236. });
  25237. };
  25238. const getValueIndex = (arr = [], value) => {
  25239. if (!isObject$5(value))
  25240. return arr.indexOf(value);
  25241. const valueKey = props.valueKey;
  25242. let index2 = -1;
  25243. arr.some((item, i2) => {
  25244. if (toRaw$1(get$2(item, valueKey)) === get$2(value, valueKey)) {
  25245. index2 = i2;
  25246. return true;
  25247. }
  25248. return false;
  25249. });
  25250. return index2;
  25251. };
  25252. const setSoftFocus = () => {
  25253. states.softFocus = true;
  25254. const _input = input.value || reference.value;
  25255. if (_input) {
  25256. _input == null ? void 0 : _input.focus();
  25257. }
  25258. };
  25259. const scrollToOption = (option) => {
  25260. var _a2, _b, _c, _d, _e;
  25261. const targetOption = Array.isArray(option) ? option[0] : option;
  25262. let target = null;
  25263. if (targetOption == null ? void 0 : targetOption.value) {
  25264. const options2 = optionsArray.value.filter((item) => item.value === targetOption.value);
  25265. if (options2.length > 0) {
  25266. target = options2[0].$el;
  25267. }
  25268. }
  25269. if (tooltipRef.value && target) {
  25270. const menu = (_d = (_c = (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.popperRef) == null ? void 0 : _b.contentRef) == null ? void 0 : _c.querySelector) == null ? void 0 : _d.call(_c, `.${ns.be("dropdown", "wrap")}`);
  25271. if (menu) {
  25272. scrollIntoView(menu, target);
  25273. }
  25274. }
  25275. (_e = scrollbar.value) == null ? void 0 : _e.handleScroll();
  25276. };
  25277. const onOptionCreate = (vm) => {
  25278. states.optionsCount++;
  25279. states.filteredOptionsCount++;
  25280. states.options.set(vm.value, vm);
  25281. states.cachedOptions.set(vm.value, vm);
  25282. };
  25283. const onOptionDestroy = (key, vm) => {
  25284. if (states.options.get(key) === vm) {
  25285. states.optionsCount--;
  25286. states.filteredOptionsCount--;
  25287. states.options.delete(key);
  25288. }
  25289. };
  25290. const resetInputState = (e) => {
  25291. if (e.code !== EVENT_CODE.backspace)
  25292. toggleLastOptionHitState(false);
  25293. states.inputLength = input.value.value.length * 15 + 20;
  25294. resetInputHeight();
  25295. };
  25296. const toggleLastOptionHitState = (hit) => {
  25297. if (!Array.isArray(states.selected))
  25298. return;
  25299. const option = states.selected[states.selected.length - 1];
  25300. if (!option)
  25301. return;
  25302. if (hit === true || hit === false) {
  25303. option.hitState = hit;
  25304. return hit;
  25305. }
  25306. option.hitState = !option.hitState;
  25307. return option.hitState;
  25308. };
  25309. const handleComposition = (event2) => {
  25310. const text = event2.target.value;
  25311. if (event2.type === "compositionend") {
  25312. states.isOnComposition = false;
  25313. nextTick(() => handleQueryChange(text));
  25314. } else {
  25315. const lastCharacter = text[text.length - 1] || "";
  25316. states.isOnComposition = !isKorean(lastCharacter);
  25317. }
  25318. };
  25319. const handleMenuEnter = () => {
  25320. nextTick(() => scrollToOption(states.selected));
  25321. };
  25322. const handleFocus = (event2) => {
  25323. if (!states.softFocus) {
  25324. if (props.automaticDropdown || props.filterable) {
  25325. if (props.filterable && !states.visible) {
  25326. states.menuVisibleOnFocus = true;
  25327. }
  25328. states.visible = true;
  25329. }
  25330. ctx.emit("focus", event2);
  25331. } else {
  25332. states.softFocus = false;
  25333. }
  25334. };
  25335. const blur = () => {
  25336. var _a2, _b, _c;
  25337. states.visible = false;
  25338. (_a2 = reference.value) == null ? void 0 : _a2.blur();
  25339. (_c = (_b = iOSInput.value) == null ? void 0 : _b.blur) == null ? void 0 : _c.call(_b);
  25340. };
  25341. const handleBlur = (event2) => {
  25342. nextTick(() => {
  25343. if (states.isSilentBlur) {
  25344. states.isSilentBlur = false;
  25345. } else {
  25346. ctx.emit("blur", event2);
  25347. }
  25348. });
  25349. states.softFocus = false;
  25350. };
  25351. const handleClearClick = (event2) => {
  25352. deleteSelected(event2);
  25353. };
  25354. const handleClose = () => {
  25355. states.visible = false;
  25356. };
  25357. const handleKeydownEscape = (event2) => {
  25358. if (states.visible) {
  25359. event2.preventDefault();
  25360. event2.stopPropagation();
  25361. states.visible = false;
  25362. }
  25363. };
  25364. const toggleMenu = (e) => {
  25365. var _a2;
  25366. if (e && !states.mouseEnter) {
  25367. return;
  25368. }
  25369. if (!selectDisabled.value) {
  25370. if (states.menuVisibleOnFocus) {
  25371. states.menuVisibleOnFocus = false;
  25372. } else {
  25373. if (!tooltipRef.value || !tooltipRef.value.isFocusInsideContent()) {
  25374. states.visible = !states.visible;
  25375. }
  25376. }
  25377. if (states.visible) {
  25378. (_a2 = input.value || reference.value) == null ? void 0 : _a2.focus();
  25379. }
  25380. }
  25381. };
  25382. const selectOption = () => {
  25383. if (!states.visible) {
  25384. toggleMenu();
  25385. } else {
  25386. if (optionsArray.value[states.hoverIndex]) {
  25387. handleOptionSelect(optionsArray.value[states.hoverIndex], void 0);
  25388. }
  25389. }
  25390. };
  25391. const getValueKey = (item) => {
  25392. return isObject$5(item.value) ? get$2(item.value, props.valueKey) : item.value;
  25393. };
  25394. const optionsAllDisabled = computed$1(() => optionsArray.value.filter((option) => option.visible).every((option) => option.disabled));
  25395. const showTagList = computed$1(() => states.selected.slice(0, props.maxCollapseTags));
  25396. const collapseTagList = computed$1(() => states.selected.slice(props.maxCollapseTags));
  25397. const navigateOptions = (direction) => {
  25398. if (!states.visible) {
  25399. states.visible = true;
  25400. return;
  25401. }
  25402. if (states.options.size === 0 || states.filteredOptionsCount === 0)
  25403. return;
  25404. if (states.isOnComposition)
  25405. return;
  25406. if (!optionsAllDisabled.value) {
  25407. if (direction === "next") {
  25408. states.hoverIndex++;
  25409. if (states.hoverIndex === states.options.size) {
  25410. states.hoverIndex = 0;
  25411. }
  25412. } else if (direction === "prev") {
  25413. states.hoverIndex--;
  25414. if (states.hoverIndex < 0) {
  25415. states.hoverIndex = states.options.size - 1;
  25416. }
  25417. }
  25418. const option = optionsArray.value[states.hoverIndex];
  25419. if (option.disabled === true || option.states.groupDisabled === true || !option.visible) {
  25420. navigateOptions(direction);
  25421. }
  25422. nextTick(() => scrollToOption(hoverOption.value));
  25423. }
  25424. };
  25425. const handleMouseEnter = () => {
  25426. states.mouseEnter = true;
  25427. };
  25428. const handleMouseLeave = () => {
  25429. states.mouseEnter = false;
  25430. };
  25431. return {
  25432. optionList,
  25433. optionsArray,
  25434. selectSize,
  25435. handleResize,
  25436. debouncedOnInputChange,
  25437. debouncedQueryChange,
  25438. deletePrevTag,
  25439. deleteTag,
  25440. deleteSelected,
  25441. handleOptionSelect,
  25442. scrollToOption,
  25443. readonly: readonly2,
  25444. resetInputHeight,
  25445. showClose,
  25446. iconComponent,
  25447. iconReverse,
  25448. showNewOption,
  25449. collapseTagSize,
  25450. setSelected,
  25451. managePlaceholder,
  25452. selectDisabled,
  25453. emptyText,
  25454. toggleLastOptionHitState,
  25455. resetInputState,
  25456. handleComposition,
  25457. onOptionCreate,
  25458. onOptionDestroy,
  25459. handleMenuEnter,
  25460. handleFocus,
  25461. blur,
  25462. handleBlur,
  25463. handleClearClick,
  25464. handleClose,
  25465. handleKeydownEscape,
  25466. toggleMenu,
  25467. selectOption,
  25468. getValueKey,
  25469. navigateOptions,
  25470. dropMenuVisible,
  25471. queryChange,
  25472. groupQueryChange,
  25473. showTagList,
  25474. collapseTagList,
  25475. reference,
  25476. input,
  25477. iOSInput,
  25478. tooltipRef,
  25479. tags,
  25480. selectWrapper,
  25481. scrollbar,
  25482. handleMouseEnter,
  25483. handleMouseLeave
  25484. };
  25485. };
  25486. var ElOptions = defineComponent({
  25487. name: "ElOptions",
  25488. emits: ["update-options"],
  25489. setup(_, { slots, emit }) {
  25490. let cachedOptions = [];
  25491. function isSameOptions(a, b) {
  25492. if (a.length !== b.length)
  25493. return false;
  25494. for (const [index2] of a.entries()) {
  25495. if (a[index2] != b[index2]) {
  25496. return false;
  25497. }
  25498. }
  25499. return true;
  25500. }
  25501. return () => {
  25502. var _a2, _b;
  25503. const children = (_a2 = slots.default) == null ? void 0 : _a2.call(slots);
  25504. const filteredOptions = [];
  25505. function filterOptions(children2) {
  25506. if (!Array.isArray(children2))
  25507. return;
  25508. children2.forEach((item) => {
  25509. var _a22, _b2, _c, _d;
  25510. const name = (_a22 = (item == null ? void 0 : item.type) || {}) == null ? void 0 : _a22.name;
  25511. if (name === "ElOptionGroup") {
  25512. filterOptions(!isString(item.children) && !Array.isArray(item.children) && isFunction$3((_b2 = item.children) == null ? void 0 : _b2.default) ? (_c = item.children) == null ? void 0 : _c.default() : item.children);
  25513. } else if (name === "ElOption") {
  25514. filteredOptions.push((_d = item.props) == null ? void 0 : _d.label);
  25515. } else if (Array.isArray(item.children)) {
  25516. filterOptions(item.children);
  25517. }
  25518. });
  25519. }
  25520. if (children.length) {
  25521. filterOptions((_b = children[0]) == null ? void 0 : _b.children);
  25522. }
  25523. if (!isSameOptions(filteredOptions, cachedOptions)) {
  25524. cachedOptions = filteredOptions;
  25525. emit("update-options", filteredOptions);
  25526. }
  25527. return children;
  25528. };
  25529. }
  25530. });
  25531. const COMPONENT_NAME$1 = "ElSelect";
  25532. const _sfc_main$5 = defineComponent({
  25533. name: COMPONENT_NAME$1,
  25534. componentName: COMPONENT_NAME$1,
  25535. components: {
  25536. ElInput,
  25537. ElSelectMenu,
  25538. ElOption: Option,
  25539. ElOptions,
  25540. ElTag,
  25541. ElScrollbar,
  25542. ElTooltip,
  25543. ElIcon
  25544. },
  25545. directives: { ClickOutside },
  25546. props: {
  25547. name: String,
  25548. id: String,
  25549. modelValue: {
  25550. type: [Array, String, Number, Boolean, Object],
  25551. default: void 0
  25552. },
  25553. autocomplete: {
  25554. type: String,
  25555. default: "off"
  25556. },
  25557. automaticDropdown: Boolean,
  25558. size: {
  25559. type: String,
  25560. validator: isValidComponentSize
  25561. },
  25562. effect: {
  25563. type: String,
  25564. default: "light"
  25565. },
  25566. disabled: Boolean,
  25567. clearable: Boolean,
  25568. filterable: Boolean,
  25569. allowCreate: Boolean,
  25570. loading: Boolean,
  25571. popperClass: {
  25572. type: String,
  25573. default: ""
  25574. },
  25575. popperOptions: {
  25576. type: Object,
  25577. default: () => ({})
  25578. },
  25579. remote: Boolean,
  25580. loadingText: String,
  25581. noMatchText: String,
  25582. noDataText: String,
  25583. remoteMethod: Function,
  25584. filterMethod: Function,
  25585. multiple: Boolean,
  25586. multipleLimit: {
  25587. type: Number,
  25588. default: 0
  25589. },
  25590. placeholder: {
  25591. type: String
  25592. },
  25593. defaultFirstOption: Boolean,
  25594. reserveKeyword: {
  25595. type: Boolean,
  25596. default: true
  25597. },
  25598. valueKey: {
  25599. type: String,
  25600. default: "value"
  25601. },
  25602. collapseTags: Boolean,
  25603. collapseTagsTooltip: {
  25604. type: Boolean,
  25605. default: false
  25606. },
  25607. maxCollapseTags: {
  25608. type: Number,
  25609. default: 1
  25610. },
  25611. teleported: useTooltipContentProps.teleported,
  25612. persistent: {
  25613. type: Boolean,
  25614. default: true
  25615. },
  25616. clearIcon: {
  25617. type: iconPropType,
  25618. default: circle_close_default
  25619. },
  25620. fitInputWidth: {
  25621. type: Boolean,
  25622. default: false
  25623. },
  25624. suffixIcon: {
  25625. type: iconPropType,
  25626. default: arrow_down_default
  25627. },
  25628. tagType: { ...tagProps.type, default: "info" },
  25629. validateEvent: {
  25630. type: Boolean,
  25631. default: true
  25632. },
  25633. remoteShowSuffix: {
  25634. type: Boolean,
  25635. default: false
  25636. },
  25637. suffixTransition: {
  25638. type: Boolean,
  25639. default: true
  25640. },
  25641. placement: {
  25642. type: String,
  25643. values: Ee,
  25644. default: "bottom-start"
  25645. }
  25646. },
  25647. emits: [
  25648. UPDATE_MODEL_EVENT,
  25649. CHANGE_EVENT,
  25650. "remove-tag",
  25651. "clear",
  25652. "visible-change",
  25653. "focus",
  25654. "blur"
  25655. ],
  25656. setup(props, ctx) {
  25657. const nsSelect = useNamespace("select");
  25658. const nsInput = useNamespace("input");
  25659. const { t: t2 } = useLocale();
  25660. const states = useSelectStates(props);
  25661. const {
  25662. optionList,
  25663. optionsArray,
  25664. selectSize,
  25665. readonly: readonly2,
  25666. handleResize,
  25667. collapseTagSize,
  25668. debouncedOnInputChange,
  25669. debouncedQueryChange,
  25670. deletePrevTag,
  25671. deleteTag,
  25672. deleteSelected,
  25673. handleOptionSelect,
  25674. scrollToOption,
  25675. setSelected,
  25676. resetInputHeight,
  25677. managePlaceholder,
  25678. showClose,
  25679. selectDisabled,
  25680. iconComponent,
  25681. iconReverse,
  25682. showNewOption,
  25683. emptyText,
  25684. toggleLastOptionHitState,
  25685. resetInputState,
  25686. handleComposition,
  25687. onOptionCreate,
  25688. onOptionDestroy,
  25689. handleMenuEnter,
  25690. handleFocus,
  25691. blur,
  25692. handleBlur,
  25693. handleClearClick,
  25694. handleClose,
  25695. handleKeydownEscape,
  25696. toggleMenu,
  25697. selectOption,
  25698. getValueKey,
  25699. navigateOptions,
  25700. dropMenuVisible,
  25701. reference,
  25702. input,
  25703. iOSInput,
  25704. tooltipRef,
  25705. tags,
  25706. selectWrapper,
  25707. scrollbar,
  25708. queryChange,
  25709. groupQueryChange,
  25710. handleMouseEnter,
  25711. handleMouseLeave,
  25712. showTagList,
  25713. collapseTagList
  25714. } = useSelect(props, states, ctx);
  25715. const { focus } = useFocus(reference);
  25716. const {
  25717. inputWidth,
  25718. selected,
  25719. inputLength,
  25720. filteredOptionsCount,
  25721. visible,
  25722. softFocus,
  25723. selectedLabel,
  25724. hoverIndex,
  25725. query,
  25726. inputHovering,
  25727. currentPlaceholder,
  25728. menuVisibleOnFocus,
  25729. isOnComposition,
  25730. isSilentBlur,
  25731. options: options2,
  25732. cachedOptions,
  25733. optionsCount,
  25734. prefixWidth,
  25735. tagInMultiLine
  25736. } = toRefs(states);
  25737. const wrapperKls = computed$1(() => {
  25738. const classList = [nsSelect.b()];
  25739. const _selectSize = unref(selectSize);
  25740. if (_selectSize) {
  25741. classList.push(nsSelect.m(_selectSize));
  25742. }
  25743. if (props.disabled) {
  25744. classList.push(nsSelect.m("disabled"));
  25745. }
  25746. return classList;
  25747. });
  25748. const selectTagsStyle = computed$1(() => ({
  25749. maxWidth: `${unref(inputWidth) - 32}px`,
  25750. width: "100%"
  25751. }));
  25752. const tagTextStyle = computed$1(() => {
  25753. const maxWidth = unref(inputWidth) > 123 ? unref(inputWidth) - 123 : unref(inputWidth) - 75;
  25754. return { maxWidth: `${maxWidth}px` };
  25755. });
  25756. provide(selectKey, reactive({
  25757. props,
  25758. options: options2,
  25759. optionsArray,
  25760. cachedOptions,
  25761. optionsCount,
  25762. filteredOptionsCount,
  25763. hoverIndex,
  25764. handleOptionSelect,
  25765. onOptionCreate,
  25766. onOptionDestroy,
  25767. selectWrapper,
  25768. selected,
  25769. setSelected,
  25770. queryChange,
  25771. groupQueryChange
  25772. }));
  25773. onMounted(() => {
  25774. states.cachedPlaceHolder = currentPlaceholder.value = props.placeholder || (() => t2("el.select.placeholder"));
  25775. if (props.multiple && Array.isArray(props.modelValue) && props.modelValue.length > 0) {
  25776. currentPlaceholder.value = "";
  25777. }
  25778. useResizeObserver(selectWrapper, handleResize);
  25779. if (props.remote && props.multiple) {
  25780. resetInputHeight();
  25781. }
  25782. nextTick(() => {
  25783. const refEl = reference.value && reference.value.$el;
  25784. if (!refEl)
  25785. return;
  25786. inputWidth.value = refEl.getBoundingClientRect().width;
  25787. if (ctx.slots.prefix) {
  25788. const prefix = refEl.querySelector(`.${nsInput.e("prefix")}`);
  25789. prefixWidth.value = Math.max(prefix.getBoundingClientRect().width + 5, 30);
  25790. }
  25791. });
  25792. setSelected();
  25793. });
  25794. if (props.multiple && !Array.isArray(props.modelValue)) {
  25795. ctx.emit(UPDATE_MODEL_EVENT, []);
  25796. }
  25797. if (!props.multiple && Array.isArray(props.modelValue)) {
  25798. ctx.emit(UPDATE_MODEL_EVENT, "");
  25799. }
  25800. const popperPaneRef = computed$1(() => {
  25801. var _a2, _b;
  25802. return (_b = (_a2 = tooltipRef.value) == null ? void 0 : _a2.popperRef) == null ? void 0 : _b.contentRef;
  25803. });
  25804. const onOptionsRendered = (v) => {
  25805. optionList.value = v;
  25806. };
  25807. return {
  25808. isIOS,
  25809. onOptionsRendered,
  25810. tagInMultiLine,
  25811. prefixWidth,
  25812. selectSize,
  25813. readonly: readonly2,
  25814. handleResize,
  25815. collapseTagSize,
  25816. debouncedOnInputChange,
  25817. debouncedQueryChange,
  25818. deletePrevTag,
  25819. deleteTag,
  25820. deleteSelected,
  25821. handleOptionSelect,
  25822. scrollToOption,
  25823. inputWidth,
  25824. selected,
  25825. inputLength,
  25826. filteredOptionsCount,
  25827. visible,
  25828. softFocus,
  25829. selectedLabel,
  25830. hoverIndex,
  25831. query,
  25832. inputHovering,
  25833. currentPlaceholder,
  25834. menuVisibleOnFocus,
  25835. isOnComposition,
  25836. isSilentBlur,
  25837. options: options2,
  25838. resetInputHeight,
  25839. managePlaceholder,
  25840. showClose,
  25841. selectDisabled,
  25842. iconComponent,
  25843. iconReverse,
  25844. showNewOption,
  25845. emptyText,
  25846. toggleLastOptionHitState,
  25847. resetInputState,
  25848. handleComposition,
  25849. handleMenuEnter,
  25850. handleFocus,
  25851. blur,
  25852. handleBlur,
  25853. handleClearClick,
  25854. handleClose,
  25855. handleKeydownEscape,
  25856. toggleMenu,
  25857. selectOption,
  25858. getValueKey,
  25859. navigateOptions,
  25860. dropMenuVisible,
  25861. focus,
  25862. reference,
  25863. input,
  25864. iOSInput,
  25865. tooltipRef,
  25866. popperPaneRef,
  25867. tags,
  25868. selectWrapper,
  25869. scrollbar,
  25870. wrapperKls,
  25871. selectTagsStyle,
  25872. nsSelect,
  25873. tagTextStyle,
  25874. handleMouseEnter,
  25875. handleMouseLeave,
  25876. showTagList,
  25877. collapseTagList
  25878. };
  25879. }
  25880. });
  25881. const _hoisted_1$4 = ["disabled", "autocomplete"];
  25882. const _hoisted_2$4 = ["disabled"];
  25883. const _hoisted_3$4 = { style: { "height": "100%", "display": "flex", "justify-content": "center", "align-items": "center" } };
  25884. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  25885. const _component_el_tag = resolveComponent("el-tag");
  25886. const _component_el_tooltip = resolveComponent("el-tooltip");
  25887. const _component_el_icon = resolveComponent("el-icon");
  25888. const _component_el_input = resolveComponent("el-input");
  25889. const _component_el_option = resolveComponent("el-option");
  25890. const _component_el_options = resolveComponent("el-options");
  25891. const _component_el_scrollbar = resolveComponent("el-scrollbar");
  25892. const _component_el_select_menu = resolveComponent("el-select-menu");
  25893. const _directive_click_outside = resolveDirective("click-outside");
  25894. return withDirectives((openBlock(), createElementBlock("div", {
  25895. ref: "selectWrapper",
  25896. class: normalizeClass(_ctx.wrapperKls),
  25897. onMouseenter: _cache[21] || (_cache[21] = (...args) => _ctx.handleMouseEnter && _ctx.handleMouseEnter(...args)),
  25898. onMouseleave: _cache[22] || (_cache[22] = (...args) => _ctx.handleMouseLeave && _ctx.handleMouseLeave(...args)),
  25899. onClick: _cache[23] || (_cache[23] = withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["stop"]))
  25900. }, [
  25901. createVNode(_component_el_tooltip, {
  25902. ref: "tooltipRef",
  25903. visible: _ctx.dropMenuVisible,
  25904. placement: _ctx.placement,
  25905. teleported: _ctx.teleported,
  25906. "popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
  25907. "popper-options": _ctx.popperOptions,
  25908. "fallback-placements": ["bottom-start", "top-start", "right", "left"],
  25909. effect: _ctx.effect,
  25910. pure: "",
  25911. trigger: "click",
  25912. transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
  25913. "stop-popper-mouse-event": false,
  25914. "gpu-acceleration": false,
  25915. persistent: _ctx.persistent,
  25916. onShow: _ctx.handleMenuEnter
  25917. }, {
  25918. default: withCtx(() => [
  25919. createElementVNode("div", {
  25920. class: "select-trigger",
  25921. onMouseenter: _cache[19] || (_cache[19] = ($event) => _ctx.inputHovering = true),
  25922. onMouseleave: _cache[20] || (_cache[20] = ($event) => _ctx.inputHovering = false)
  25923. }, [
  25924. _ctx.multiple ? (openBlock(), createElementBlock("div", {
  25925. key: 0,
  25926. ref: "tags",
  25927. class: normalizeClass([
  25928. _ctx.nsSelect.e("tags"),
  25929. _ctx.nsSelect.is("disabled", _ctx.selectDisabled)
  25930. ]),
  25931. style: normalizeStyle(_ctx.selectTagsStyle)
  25932. }, [
  25933. _ctx.collapseTags && _ctx.selected.length ? (openBlock(), createBlock(Transition, {
  25934. key: 0,
  25935. onAfterLeave: _ctx.resetInputHeight
  25936. }, {
  25937. default: withCtx(() => [
  25938. createElementVNode("span", {
  25939. class: normalizeClass([
  25940. _ctx.nsSelect.b("tags-wrapper"),
  25941. { "has-prefix": _ctx.prefixWidth && _ctx.selected.length }
  25942. ])
  25943. }, [
  25944. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.showTagList, (item) => {
  25945. return openBlock(), createBlock(_component_el_tag, {
  25946. key: _ctx.getValueKey(item),
  25947. closable: !_ctx.selectDisabled && !item.isDisabled,
  25948. size: _ctx.collapseTagSize,
  25949. hit: item.hitState,
  25950. type: _ctx.tagType,
  25951. "disable-transitions": "",
  25952. onClose: ($event) => _ctx.deleteTag($event, item)
  25953. }, {
  25954. default: withCtx(() => [
  25955. createElementVNode("span", {
  25956. class: normalizeClass(_ctx.nsSelect.e("tags-text")),
  25957. style: normalizeStyle(_ctx.tagTextStyle)
  25958. }, toDisplayString(item.currentLabel), 7)
  25959. ]),
  25960. _: 2
  25961. }, 1032, ["closable", "size", "hit", "type", "onClose"]);
  25962. }), 128)),
  25963. _ctx.selected.length > _ctx.maxCollapseTags ? (openBlock(), createBlock(_component_el_tag, {
  25964. key: 0,
  25965. closable: false,
  25966. size: _ctx.collapseTagSize,
  25967. type: _ctx.tagType,
  25968. "disable-transitions": ""
  25969. }, {
  25970. default: withCtx(() => [
  25971. _ctx.collapseTagsTooltip ? (openBlock(), createBlock(_component_el_tooltip, {
  25972. key: 0,
  25973. disabled: _ctx.dropMenuVisible,
  25974. "fallback-placements": ["bottom", "top", "right", "left"],
  25975. effect: _ctx.effect,
  25976. placement: "bottom",
  25977. teleported: _ctx.teleported
  25978. }, {
  25979. default: withCtx(() => [
  25980. createElementVNode("span", {
  25981. class: normalizeClass(_ctx.nsSelect.e("tags-text"))
  25982. }, "+ " + toDisplayString(_ctx.selected.length - _ctx.maxCollapseTags), 3)
  25983. ]),
  25984. content: withCtx(() => [
  25985. createElementVNode("div", {
  25986. class: normalizeClass(_ctx.nsSelect.e("collapse-tags"))
  25987. }, [
  25988. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.collapseTagList, (item) => {
  25989. return openBlock(), createElementBlock("div", {
  25990. key: _ctx.getValueKey(item),
  25991. class: normalizeClass(_ctx.nsSelect.e("collapse-tag"))
  25992. }, [
  25993. createVNode(_component_el_tag, {
  25994. class: "in-tooltip",
  25995. closable: !_ctx.selectDisabled && !item.isDisabled,
  25996. size: _ctx.collapseTagSize,
  25997. hit: item.hitState,
  25998. type: _ctx.tagType,
  25999. "disable-transitions": "",
  26000. style: { margin: "2px" },
  26001. onClose: ($event) => _ctx.deleteTag($event, item)
  26002. }, {
  26003. default: withCtx(() => [
  26004. createElementVNode("span", {
  26005. class: normalizeClass(_ctx.nsSelect.e("tags-text")),
  26006. style: normalizeStyle({
  26007. maxWidth: _ctx.inputWidth - 75 + "px"
  26008. })
  26009. }, toDisplayString(item.currentLabel), 7)
  26010. ]),
  26011. _: 2
  26012. }, 1032, ["closable", "size", "hit", "type", "onClose"])
  26013. ], 2);
  26014. }), 128))
  26015. ], 2)
  26016. ]),
  26017. _: 1
  26018. }, 8, ["disabled", "effect", "teleported"])) : (openBlock(), createElementBlock("span", {
  26019. key: 1,
  26020. class: normalizeClass(_ctx.nsSelect.e("tags-text"))
  26021. }, "+ " + toDisplayString(_ctx.selected.length - _ctx.maxCollapseTags), 3))
  26022. ]),
  26023. _: 1
  26024. }, 8, ["size", "type"])) : createCommentVNode("v-if", true)
  26025. ], 2)
  26026. ]),
  26027. _: 1
  26028. }, 8, ["onAfterLeave"])) : createCommentVNode("v-if", true),
  26029. !_ctx.collapseTags ? (openBlock(), createBlock(Transition, {
  26030. key: 1,
  26031. onAfterLeave: _ctx.resetInputHeight
  26032. }, {
  26033. default: withCtx(() => [
  26034. createElementVNode("span", {
  26035. class: normalizeClass([
  26036. _ctx.nsSelect.b("tags-wrapper"),
  26037. { "has-prefix": _ctx.prefixWidth && _ctx.selected.length }
  26038. ])
  26039. }, [
  26040. (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.selected, (item) => {
  26041. return openBlock(), createBlock(_component_el_tag, {
  26042. key: _ctx.getValueKey(item),
  26043. closable: !_ctx.selectDisabled && !item.isDisabled,
  26044. size: _ctx.collapseTagSize,
  26045. hit: item.hitState,
  26046. type: _ctx.tagType,
  26047. "disable-transitions": "",
  26048. onClose: ($event) => _ctx.deleteTag($event, item)
  26049. }, {
  26050. default: withCtx(() => [
  26051. createElementVNode("span", {
  26052. class: normalizeClass(_ctx.nsSelect.e("tags-text")),
  26053. style: normalizeStyle({ maxWidth: _ctx.inputWidth - 75 + "px" })
  26054. }, toDisplayString(item.currentLabel), 7)
  26055. ]),
  26056. _: 2
  26057. }, 1032, ["closable", "size", "hit", "type", "onClose"]);
  26058. }), 128))
  26059. ], 2)
  26060. ]),
  26061. _: 1
  26062. }, 8, ["onAfterLeave"])) : createCommentVNode("v-if", true),
  26063. _ctx.filterable ? withDirectives((openBlock(), createElementBlock("input", {
  26064. key: 2,
  26065. ref: "input",
  26066. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.query = $event),
  26067. type: "text",
  26068. class: normalizeClass([
  26069. _ctx.nsSelect.e("input"),
  26070. _ctx.nsSelect.is(_ctx.selectSize),
  26071. _ctx.nsSelect.is("disabled", _ctx.selectDisabled)
  26072. ]),
  26073. disabled: _ctx.selectDisabled,
  26074. autocomplete: _ctx.autocomplete,
  26075. style: normalizeStyle({
  26076. marginLeft: _ctx.prefixWidth && !_ctx.selected.length || _ctx.tagInMultiLine ? `${_ctx.prefixWidth}px` : "",
  26077. flexGrow: 1,
  26078. width: `${_ctx.inputLength / (_ctx.inputWidth - 32)}%`,
  26079. maxWidth: `${_ctx.inputWidth - 42}px`
  26080. }),
  26081. onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
  26082. onBlur: _cache[2] || (_cache[2] = (...args) => _ctx.handleBlur && _ctx.handleBlur(...args)),
  26083. onKeyup: _cache[3] || (_cache[3] = (...args) => _ctx.managePlaceholder && _ctx.managePlaceholder(...args)),
  26084. onKeydown: [
  26085. _cache[4] || (_cache[4] = (...args) => _ctx.resetInputState && _ctx.resetInputState(...args)),
  26086. _cache[5] || (_cache[5] = withKeys(withModifiers(($event) => _ctx.navigateOptions("next"), ["prevent"]), ["down"])),
  26087. _cache[6] || (_cache[6] = withKeys(withModifiers(($event) => _ctx.navigateOptions("prev"), ["prevent"]), ["up"])),
  26088. _cache[7] || (_cache[7] = withKeys((...args) => _ctx.handleKeydownEscape && _ctx.handleKeydownEscape(...args), ["esc"])),
  26089. _cache[8] || (_cache[8] = withKeys(withModifiers((...args) => _ctx.selectOption && _ctx.selectOption(...args), ["stop", "prevent"]), ["enter"])),
  26090. _cache[9] || (_cache[9] = withKeys((...args) => _ctx.deletePrevTag && _ctx.deletePrevTag(...args), ["delete"])),
  26091. _cache[10] || (_cache[10] = withKeys(($event) => _ctx.visible = false, ["tab"]))
  26092. ],
  26093. onCompositionstart: _cache[11] || (_cache[11] = (...args) => _ctx.handleComposition && _ctx.handleComposition(...args)),
  26094. onCompositionupdate: _cache[12] || (_cache[12] = (...args) => _ctx.handleComposition && _ctx.handleComposition(...args)),
  26095. onCompositionend: _cache[13] || (_cache[13] = (...args) => _ctx.handleComposition && _ctx.handleComposition(...args)),
  26096. onInput: _cache[14] || (_cache[14] = (...args) => _ctx.debouncedQueryChange && _ctx.debouncedQueryChange(...args))
  26097. }, null, 46, _hoisted_1$4)), [
  26098. [vModelText, _ctx.query]
  26099. ]) : createCommentVNode("v-if", true)
  26100. ], 6)) : createCommentVNode("v-if", true),
  26101. createCommentVNode(" fix: https://github.com/element-plus/element-plus/issues/11415 "),
  26102. _ctx.isIOS && !_ctx.multiple && _ctx.filterable && _ctx.readonly ? (openBlock(), createElementBlock("input", {
  26103. key: 1,
  26104. ref: "iOSInput",
  26105. class: normalizeClass([
  26106. _ctx.nsSelect.e("input"),
  26107. _ctx.nsSelect.is(_ctx.selectSize),
  26108. _ctx.nsSelect.em("input", "iOS")
  26109. ]),
  26110. disabled: _ctx.selectDisabled,
  26111. type: "text"
  26112. }, null, 10, _hoisted_2$4)) : createCommentVNode("v-if", true),
  26113. createVNode(_component_el_input, {
  26114. id: _ctx.id,
  26115. ref: "reference",
  26116. modelValue: _ctx.selectedLabel,
  26117. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => _ctx.selectedLabel = $event),
  26118. type: "text",
  26119. placeholder: typeof _ctx.currentPlaceholder === "function" ? _ctx.currentPlaceholder() : _ctx.currentPlaceholder,
  26120. name: _ctx.name,
  26121. autocomplete: _ctx.autocomplete,
  26122. size: _ctx.selectSize,
  26123. disabled: _ctx.selectDisabled,
  26124. readonly: _ctx.readonly,
  26125. "validate-event": false,
  26126. class: normalizeClass([_ctx.nsSelect.is("focus", _ctx.visible)]),
  26127. tabindex: _ctx.multiple && _ctx.filterable ? -1 : void 0,
  26128. onFocus: _ctx.handleFocus,
  26129. onBlur: _ctx.handleBlur,
  26130. onInput: _ctx.debouncedOnInputChange,
  26131. onPaste: _ctx.debouncedOnInputChange,
  26132. onCompositionstart: _ctx.handleComposition,
  26133. onCompositionupdate: _ctx.handleComposition,
  26134. onCompositionend: _ctx.handleComposition,
  26135. onKeydown: [
  26136. _cache[16] || (_cache[16] = withKeys(withModifiers(($event) => _ctx.navigateOptions("next"), ["stop", "prevent"]), ["down"])),
  26137. _cache[17] || (_cache[17] = withKeys(withModifiers(($event) => _ctx.navigateOptions("prev"), ["stop", "prevent"]), ["up"])),
  26138. withKeys(withModifiers(_ctx.selectOption, ["stop", "prevent"]), ["enter"]),
  26139. withKeys(_ctx.handleKeydownEscape, ["esc"]),
  26140. _cache[18] || (_cache[18] = withKeys(($event) => _ctx.visible = false, ["tab"]))
  26141. ]
  26142. }, createSlots({
  26143. suffix: withCtx(() => [
  26144. _ctx.iconComponent && !_ctx.showClose ? (openBlock(), createBlock(_component_el_icon, {
  26145. key: 0,
  26146. class: normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsSelect.e("icon"), _ctx.iconReverse])
  26147. }, {
  26148. default: withCtx(() => [
  26149. (openBlock(), createBlock(resolveDynamicComponent(_ctx.iconComponent)))
  26150. ]),
  26151. _: 1
  26152. }, 8, ["class"])) : createCommentVNode("v-if", true),
  26153. _ctx.showClose && _ctx.clearIcon ? (openBlock(), createBlock(_component_el_icon, {
  26154. key: 1,
  26155. class: normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsSelect.e("icon")]),
  26156. onClick: _ctx.handleClearClick
  26157. }, {
  26158. default: withCtx(() => [
  26159. (openBlock(), createBlock(resolveDynamicComponent(_ctx.clearIcon)))
  26160. ]),
  26161. _: 1
  26162. }, 8, ["class", "onClick"])) : createCommentVNode("v-if", true)
  26163. ]),
  26164. _: 2
  26165. }, [
  26166. _ctx.$slots.prefix ? {
  26167. name: "prefix",
  26168. fn: withCtx(() => [
  26169. createElementVNode("div", _hoisted_3$4, [
  26170. renderSlot(_ctx.$slots, "prefix")
  26171. ])
  26172. ])
  26173. } : void 0
  26174. ]), 1032, ["id", "modelValue", "placeholder", "name", "autocomplete", "size", "disabled", "readonly", "class", "tabindex", "onFocus", "onBlur", "onInput", "onPaste", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onKeydown"])
  26175. ], 32)
  26176. ]),
  26177. content: withCtx(() => [
  26178. createVNode(_component_el_select_menu, null, {
  26179. default: withCtx(() => [
  26180. withDirectives(createVNode(_component_el_scrollbar, {
  26181. ref: "scrollbar",
  26182. tag: "ul",
  26183. "wrap-class": _ctx.nsSelect.be("dropdown", "wrap"),
  26184. "view-class": _ctx.nsSelect.be("dropdown", "list"),
  26185. class: normalizeClass([
  26186. _ctx.nsSelect.is("empty", !_ctx.allowCreate && Boolean(_ctx.query) && _ctx.filteredOptionsCount === 0)
  26187. ])
  26188. }, {
  26189. default: withCtx(() => [
  26190. _ctx.showNewOption ? (openBlock(), createBlock(_component_el_option, {
  26191. key: 0,
  26192. value: _ctx.query,
  26193. created: true
  26194. }, null, 8, ["value"])) : createCommentVNode("v-if", true),
  26195. createVNode(_component_el_options, { onUpdateOptions: _ctx.onOptionsRendered }, {
  26196. default: withCtx(() => [
  26197. renderSlot(_ctx.$slots, "default")
  26198. ]),
  26199. _: 3
  26200. }, 8, ["onUpdateOptions"])
  26201. ]),
  26202. _: 3
  26203. }, 8, ["wrap-class", "view-class", "class"]), [
  26204. [vShow, _ctx.options.size > 0 && !_ctx.loading]
  26205. ]),
  26206. _ctx.emptyText && (!_ctx.allowCreate || _ctx.loading || _ctx.allowCreate && _ctx.options.size === 0) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
  26207. _ctx.$slots.empty ? renderSlot(_ctx.$slots, "empty", { key: 0 }) : (openBlock(), createElementBlock("p", {
  26208. key: 1,
  26209. class: normalizeClass(_ctx.nsSelect.be("dropdown", "empty"))
  26210. }, toDisplayString(_ctx.emptyText), 3))
  26211. ], 64)) : createCommentVNode("v-if", true)
  26212. ]),
  26213. _: 3
  26214. })
  26215. ]),
  26216. _: 3
  26217. }, 8, ["visible", "placement", "teleported", "popper-class", "popper-options", "effect", "transition", "persistent", "onShow"])
  26218. ], 34)), [
  26219. [_directive_click_outside, _ctx.handleClose, _ctx.popperPaneRef]
  26220. ]);
  26221. }
  26222. var Select = /* @__PURE__ */ _export_sfc$1(_sfc_main$5, [["render", _sfc_render$1], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/select.vue"]]);
  26223. const _sfc_main$4 = defineComponent({
  26224. name: "ElOptionGroup",
  26225. componentName: "ElOptionGroup",
  26226. props: {
  26227. label: String,
  26228. disabled: {
  26229. type: Boolean,
  26230. default: false
  26231. }
  26232. },
  26233. setup(props) {
  26234. const ns = useNamespace("select");
  26235. const visible = ref(true);
  26236. const instance = getCurrentInstance();
  26237. const children = ref([]);
  26238. provide(selectGroupKey, reactive({
  26239. ...toRefs(props)
  26240. }));
  26241. const select = inject(selectKey);
  26242. onMounted(() => {
  26243. children.value = flattedChildren(instance.subTree);
  26244. });
  26245. const flattedChildren = (node) => {
  26246. const children2 = [];
  26247. if (Array.isArray(node.children)) {
  26248. node.children.forEach((child) => {
  26249. var _a2;
  26250. if (child.type && child.type.name === "ElOption" && child.component && child.component.proxy) {
  26251. children2.push(child.component.proxy);
  26252. } else if ((_a2 = child.children) == null ? void 0 : _a2.length) {
  26253. children2.push(...flattedChildren(child));
  26254. }
  26255. });
  26256. }
  26257. return children2;
  26258. };
  26259. const { groupQueryChange } = toRaw$1(select);
  26260. watch(groupQueryChange, () => {
  26261. visible.value = children.value.some((option) => option.visible === true);
  26262. }, { flush: "post" });
  26263. return {
  26264. visible,
  26265. ns
  26266. };
  26267. }
  26268. });
  26269. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  26270. return withDirectives((openBlock(), createElementBlock("ul", {
  26271. class: normalizeClass(_ctx.ns.be("group", "wrap"))
  26272. }, [
  26273. createElementVNode("li", {
  26274. class: normalizeClass(_ctx.ns.be("group", "title"))
  26275. }, toDisplayString(_ctx.label), 3),
  26276. createElementVNode("li", null, [
  26277. createElementVNode("ul", {
  26278. class: normalizeClass(_ctx.ns.b("group"))
  26279. }, [
  26280. renderSlot(_ctx.$slots, "default")
  26281. ], 2)
  26282. ])
  26283. ], 2)), [
  26284. [vShow, _ctx.visible]
  26285. ]);
  26286. }
  26287. var OptionGroup = /* @__PURE__ */ _export_sfc$1(_sfc_main$4, [["render", _sfc_render], ["__file", "/home/runner/work/element-plus/element-plus/packages/components/select/src/option-group.vue"]]);
  26288. const ElSelect = withInstall(Select, {
  26289. Option,
  26290. OptionGroup
  26291. });
  26292. const ElOption = withNoopInstall(Option);
  26293. withNoopInstall(OptionGroup);
  26294. const switchProps = buildProps({
  26295. modelValue: {
  26296. type: [Boolean, String, Number],
  26297. default: false
  26298. },
  26299. value: {
  26300. type: [Boolean, String, Number],
  26301. default: false
  26302. },
  26303. disabled: {
  26304. type: Boolean,
  26305. default: false
  26306. },
  26307. width: {
  26308. type: [String, Number],
  26309. default: ""
  26310. },
  26311. inlinePrompt: {
  26312. type: Boolean,
  26313. default: false
  26314. },
  26315. activeIcon: {
  26316. type: iconPropType
  26317. },
  26318. inactiveIcon: {
  26319. type: iconPropType
  26320. },
  26321. activeText: {
  26322. type: String,
  26323. default: ""
  26324. },
  26325. inactiveText: {
  26326. type: String,
  26327. default: ""
  26328. },
  26329. activeColor: {
  26330. type: String,
  26331. default: ""
  26332. },
  26333. inactiveColor: {
  26334. type: String,
  26335. default: ""
  26336. },
  26337. borderColor: {
  26338. type: String,
  26339. default: ""
  26340. },
  26341. activeValue: {
  26342. type: [Boolean, String, Number],
  26343. default: true
  26344. },
  26345. inactiveValue: {
  26346. type: [Boolean, String, Number],
  26347. default: false
  26348. },
  26349. name: {
  26350. type: String,
  26351. default: ""
  26352. },
  26353. validateEvent: {
  26354. type: Boolean,
  26355. default: true
  26356. },
  26357. id: String,
  26358. loading: {
  26359. type: Boolean,
  26360. default: false
  26361. },
  26362. beforeChange: {
  26363. type: definePropType(Function)
  26364. },
  26365. size: {
  26366. type: String,
  26367. validator: isValidComponentSize
  26368. },
  26369. tabindex: {
  26370. type: [String, Number]
  26371. }
  26372. });
  26373. const switchEmits = {
  26374. [UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
  26375. [CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
  26376. [INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val)
  26377. };
  26378. const _hoisted_1$3 = ["onClick"];
  26379. const _hoisted_2$3 = ["id", "aria-checked", "aria-disabled", "name", "true-value", "false-value", "disabled", "tabindex", "onKeydown"];
  26380. const _hoisted_3$3 = ["aria-hidden"];
  26381. const _hoisted_4$3 = ["aria-hidden"];
  26382. const _hoisted_5$3 = ["aria-hidden"];
  26383. const COMPONENT_NAME = "ElSwitch";
  26384. const __default__ = defineComponent({
  26385. name: COMPONENT_NAME
  26386. });
  26387. const _sfc_main$3 = /* @__PURE__ */ defineComponent({
  26388. ...__default__,
  26389. props: switchProps,
  26390. emits: switchEmits,
  26391. setup(__props, { expose, emit }) {
  26392. const props = __props;
  26393. const vm = getCurrentInstance();
  26394. const { formItem } = useFormItem();
  26395. const switchSize = useFormSize();
  26396. const ns = useNamespace("switch");
  26397. useDeprecated({
  26398. from: '"value"',
  26399. replacement: '"model-value" or "v-model"',
  26400. scope: COMPONENT_NAME,
  26401. version: "2.3.0",
  26402. ref: "https://element-plus.org/en-US/component/switch.html#attributes",
  26403. type: "Attribute"
  26404. }, computed$1(() => {
  26405. var _a2;
  26406. return !!((_a2 = vm.vnode.props) == null ? void 0 : _a2.value);
  26407. }));
  26408. const { inputId } = useFormItemInputId(props, {
  26409. formItemContext: formItem
  26410. });
  26411. const switchDisabled = useFormDisabled(computed$1(() => props.loading));
  26412. const isControlled = ref(props.modelValue !== false);
  26413. const input = ref();
  26414. const core = ref();
  26415. const switchKls = computed$1(() => [
  26416. ns.b(),
  26417. ns.m(switchSize.value),
  26418. ns.is("disabled", switchDisabled.value),
  26419. ns.is("checked", checked.value)
  26420. ]);
  26421. const coreStyle = computed$1(() => ({
  26422. width: addUnit(props.width)
  26423. }));
  26424. watch(() => props.modelValue, () => {
  26425. isControlled.value = true;
  26426. });
  26427. watch(() => props.value, () => {
  26428. isControlled.value = false;
  26429. });
  26430. const actualValue = computed$1(() => {
  26431. return isControlled.value ? props.modelValue : props.value;
  26432. });
  26433. const checked = computed$1(() => actualValue.value === props.activeValue);
  26434. if (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {
  26435. emit(UPDATE_MODEL_EVENT, props.inactiveValue);
  26436. emit(CHANGE_EVENT, props.inactiveValue);
  26437. emit(INPUT_EVENT, props.inactiveValue);
  26438. }
  26439. watch(checked, (val) => {
  26440. var _a2;
  26441. input.value.checked = val;
  26442. if (props.validateEvent) {
  26443. (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "change").catch((err) => debugWarn());
  26444. }
  26445. });
  26446. const handleChange = () => {
  26447. const val = checked.value ? props.inactiveValue : props.activeValue;
  26448. emit(UPDATE_MODEL_EVENT, val);
  26449. emit(CHANGE_EVENT, val);
  26450. emit(INPUT_EVENT, val);
  26451. nextTick(() => {
  26452. input.value.checked = checked.value;
  26453. });
  26454. };
  26455. const switchValue = () => {
  26456. if (switchDisabled.value)
  26457. return;
  26458. const { beforeChange } = props;
  26459. if (!beforeChange) {
  26460. handleChange();
  26461. return;
  26462. }
  26463. const shouldChange = beforeChange();
  26464. const isPromiseOrBool = [
  26465. isPromise$2(shouldChange),
  26466. isBoolean(shouldChange)
  26467. ].includes(true);
  26468. if (!isPromiseOrBool) {
  26469. throwError(COMPONENT_NAME, "beforeChange must return type `Promise<boolean>` or `boolean`");
  26470. }
  26471. if (isPromise$2(shouldChange)) {
  26472. shouldChange.then((result) => {
  26473. if (result) {
  26474. handleChange();
  26475. }
  26476. }).catch((e) => {
  26477. });
  26478. } else if (shouldChange) {
  26479. handleChange();
  26480. }
  26481. };
  26482. const styles = computed$1(() => {
  26483. return ns.cssVarBlock({
  26484. ...props.activeColor ? { "on-color": props.activeColor } : null,
  26485. ...props.inactiveColor ? { "off-color": props.inactiveColor } : null,
  26486. ...props.borderColor ? { "border-color": props.borderColor } : null
  26487. });
  26488. });
  26489. const focus = () => {
  26490. var _a2, _b;
  26491. (_b = (_a2 = input.value) == null ? void 0 : _a2.focus) == null ? void 0 : _b.call(_a2);
  26492. };
  26493. onMounted(() => {
  26494. input.value.checked = checked.value;
  26495. });
  26496. expose({
  26497. focus,
  26498. checked
  26499. });
  26500. return (_ctx, _cache) => {
  26501. return openBlock(), createElementBlock("div", {
  26502. class: normalizeClass(unref(switchKls)),
  26503. style: normalizeStyle(unref(styles)),
  26504. onClick: withModifiers(switchValue, ["prevent"])
  26505. }, [
  26506. createElementVNode("input", {
  26507. id: unref(inputId),
  26508. ref_key: "input",
  26509. ref: input,
  26510. class: normalizeClass(unref(ns).e("input")),
  26511. type: "checkbox",
  26512. role: "switch",
  26513. "aria-checked": unref(checked),
  26514. "aria-disabled": unref(switchDisabled),
  26515. name: _ctx.name,
  26516. "true-value": _ctx.activeValue,
  26517. "false-value": _ctx.inactiveValue,
  26518. disabled: unref(switchDisabled),
  26519. tabindex: _ctx.tabindex,
  26520. onChange: handleChange,
  26521. onKeydown: withKeys(switchValue, ["enter"])
  26522. }, null, 42, _hoisted_2$3),
  26523. !_ctx.inlinePrompt && (_ctx.inactiveIcon || _ctx.inactiveText) ? (openBlock(), createElementBlock("span", {
  26524. key: 0,
  26525. class: normalizeClass([
  26526. unref(ns).e("label"),
  26527. unref(ns).em("label", "left"),
  26528. unref(ns).is("active", !unref(checked))
  26529. ])
  26530. }, [
  26531. _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
  26532. default: withCtx(() => [
  26533. (openBlock(), createBlock(resolveDynamicComponent(_ctx.inactiveIcon)))
  26534. ]),
  26535. _: 1
  26536. })) : createCommentVNode("v-if", true),
  26537. !_ctx.inactiveIcon && _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
  26538. key: 1,
  26539. "aria-hidden": unref(checked)
  26540. }, toDisplayString(_ctx.inactiveText), 9, _hoisted_3$3)) : createCommentVNode("v-if", true)
  26541. ], 2)) : createCommentVNode("v-if", true),
  26542. createElementVNode("span", {
  26543. ref_key: "core",
  26544. ref: core,
  26545. class: normalizeClass(unref(ns).e("core")),
  26546. style: normalizeStyle(unref(coreStyle))
  26547. }, [
  26548. _ctx.inlinePrompt ? (openBlock(), createElementBlock("div", {
  26549. key: 0,
  26550. class: normalizeClass(unref(ns).e("inner"))
  26551. }, [
  26552. _ctx.activeIcon || _ctx.inactiveIcon ? (openBlock(), createBlock(unref(ElIcon), {
  26553. key: 0,
  26554. class: normalizeClass(unref(ns).is("icon"))
  26555. }, {
  26556. default: withCtx(() => [
  26557. (openBlock(), createBlock(resolveDynamicComponent(unref(checked) ? _ctx.activeIcon : _ctx.inactiveIcon)))
  26558. ]),
  26559. _: 1
  26560. }, 8, ["class"])) : _ctx.activeText || _ctx.inactiveText ? (openBlock(), createElementBlock("span", {
  26561. key: 1,
  26562. class: normalizeClass(unref(ns).is("text")),
  26563. "aria-hidden": !unref(checked)
  26564. }, toDisplayString(unref(checked) ? _ctx.activeText : _ctx.inactiveText), 11, _hoisted_4$3)) : createCommentVNode("v-if", true)
  26565. ], 2)) : createCommentVNode("v-if", true),
  26566. createElementVNode("div", {
  26567. class: normalizeClass(unref(ns).e("action"))
  26568. }, [
  26569. _ctx.loading ? (openBlock(), createBlock(unref(ElIcon), {
  26570. key: 0,
  26571. class: normalizeClass(unref(ns).is("loading"))
  26572. }, {
  26573. default: withCtx(() => [
  26574. createVNode(unref(loading_default))
  26575. ]),
  26576. _: 1
  26577. }, 8, ["class"])) : createCommentVNode("v-if", true)
  26578. ], 2)
  26579. ], 6),
  26580. !_ctx.inlinePrompt && (_ctx.activeIcon || _ctx.activeText) ? (openBlock(), createElementBlock("span", {
  26581. key: 1,
  26582. class: normalizeClass([
  26583. unref(ns).e("label"),
  26584. unref(ns).em("label", "right"),
  26585. unref(ns).is("active", unref(checked))
  26586. ])
  26587. }, [
  26588. _ctx.activeIcon ? (openBlock(), createBlock(unref(ElIcon), { key: 0 }, {
  26589. default: withCtx(() => [
  26590. (openBlock(), createBlock(resolveDynamicComponent(_ctx.activeIcon)))
  26591. ]),
  26592. _: 1
  26593. })) : createCommentVNode("v-if", true),
  26594. !_ctx.activeIcon && _ctx.activeText ? (openBlock(), createElementBlock("span", {
  26595. key: 1,
  26596. "aria-hidden": !unref(checked)
  26597. }, toDisplayString(_ctx.activeText), 9, _hoisted_5$3)) : createCommentVNode("v-if", true)
  26598. ], 2)) : createCommentVNode("v-if", true)
  26599. ], 14, _hoisted_1$3);
  26600. };
  26601. }
  26602. });
  26603. var Switch = /* @__PURE__ */ _export_sfc$1(_sfc_main$3, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/switch/src/switch.vue"]]);
  26604. const ElSwitch = withInstall(Switch);
  26605. /*! Element Plus v2.3.4 */
  26606. var zhCn = {
  26607. name: "zh-cn",
  26608. el: {
  26609. colorpicker: {
  26610. confirm: "\u786E\u5B9A",
  26611. clear: "\u6E05\u7A7A"
  26612. },
  26613. datepicker: {
  26614. now: "\u6B64\u523B",
  26615. today: "\u4ECA\u5929",
  26616. cancel: "\u53D6\u6D88",
  26617. clear: "\u6E05\u7A7A",
  26618. confirm: "\u786E\u5B9A",
  26619. selectDate: "\u9009\u62E9\u65E5\u671F",
  26620. selectTime: "\u9009\u62E9\u65F6\u95F4",
  26621. startDate: "\u5F00\u59CB\u65E5\u671F",
  26622. startTime: "\u5F00\u59CB\u65F6\u95F4",
  26623. endDate: "\u7ED3\u675F\u65E5\u671F",
  26624. endTime: "\u7ED3\u675F\u65F6\u95F4",
  26625. prevYear: "\u524D\u4E00\u5E74",
  26626. nextYear: "\u540E\u4E00\u5E74",
  26627. prevMonth: "\u4E0A\u4E2A\u6708",
  26628. nextMonth: "\u4E0B\u4E2A\u6708",
  26629. year: "\u5E74",
  26630. month1: "1 \u6708",
  26631. month2: "2 \u6708",
  26632. month3: "3 \u6708",
  26633. month4: "4 \u6708",
  26634. month5: "5 \u6708",
  26635. month6: "6 \u6708",
  26636. month7: "7 \u6708",
  26637. month8: "8 \u6708",
  26638. month9: "9 \u6708",
  26639. month10: "10 \u6708",
  26640. month11: "11 \u6708",
  26641. month12: "12 \u6708",
  26642. weeks: {
  26643. sun: "\u65E5",
  26644. mon: "\u4E00",
  26645. tue: "\u4E8C",
  26646. wed: "\u4E09",
  26647. thu: "\u56DB",
  26648. fri: "\u4E94",
  26649. sat: "\u516D"
  26650. },
  26651. months: {
  26652. jan: "\u4E00\u6708",
  26653. feb: "\u4E8C\u6708",
  26654. mar: "\u4E09\u6708",
  26655. apr: "\u56DB\u6708",
  26656. may: "\u4E94\u6708",
  26657. jun: "\u516D\u6708",
  26658. jul: "\u4E03\u6708",
  26659. aug: "\u516B\u6708",
  26660. sep: "\u4E5D\u6708",
  26661. oct: "\u5341\u6708",
  26662. nov: "\u5341\u4E00\u6708",
  26663. dec: "\u5341\u4E8C\u6708"
  26664. }
  26665. },
  26666. select: {
  26667. loading: "\u52A0\u8F7D\u4E2D",
  26668. noMatch: "\u65E0\u5339\u914D\u6570\u636E",
  26669. noData: "\u65E0\u6570\u636E",
  26670. placeholder: "\u8BF7\u9009\u62E9"
  26671. },
  26672. cascader: {
  26673. noMatch: "\u65E0\u5339\u914D\u6570\u636E",
  26674. loading: "\u52A0\u8F7D\u4E2D",
  26675. placeholder: "\u8BF7\u9009\u62E9",
  26676. noData: "\u6682\u65E0\u6570\u636E"
  26677. },
  26678. pagination: {
  26679. goto: "\u524D\u5F80",
  26680. pagesize: "\u6761/\u9875",
  26681. total: "\u5171 {total} \u6761",
  26682. pageClassifier: "\u9875",
  26683. page: "\u9875",
  26684. prev: "\u4E0A\u4E00\u9875",
  26685. next: "\u4E0B\u4E00\u9875",
  26686. currentPage: "\u7B2C {pager} \u9875",
  26687. prevPages: "\u5411\u524D {pager} \u9875",
  26688. nextPages: "\u5411\u540E {pager} \u9875",
  26689. deprecationWarning: "\u4F60\u4F7F\u7528\u4E86\u4E00\u4E9B\u5DF2\u88AB\u5E9F\u5F03\u7684\u7528\u6CD5\uFF0C\u8BF7\u53C2\u8003 el-pagination \u7684\u5B98\u65B9\u6587\u6863"
  26690. },
  26691. messagebox: {
  26692. title: "\u63D0\u793A",
  26693. confirm: "\u786E\u5B9A",
  26694. cancel: "\u53D6\u6D88",
  26695. error: "\u8F93\u5165\u7684\u6570\u636E\u4E0D\u5408\u6CD5!"
  26696. },
  26697. upload: {
  26698. deleteTip: "\u6309 delete \u952E\u53EF\u5220\u9664",
  26699. delete: "\u5220\u9664",
  26700. preview: "\u67E5\u770B\u56FE\u7247",
  26701. continue: "\u7EE7\u7EED\u4E0A\u4F20"
  26702. },
  26703. table: {
  26704. emptyText: "\u6682\u65E0\u6570\u636E",
  26705. confirmFilter: "\u7B5B\u9009",
  26706. resetFilter: "\u91CD\u7F6E",
  26707. clearFilter: "\u5168\u90E8",
  26708. sumText: "\u5408\u8BA1"
  26709. },
  26710. tree: {
  26711. emptyText: "\u6682\u65E0\u6570\u636E"
  26712. },
  26713. transfer: {
  26714. noMatch: "\u65E0\u5339\u914D\u6570\u636E",
  26715. noData: "\u65E0\u6570\u636E",
  26716. titles: ["\u5217\u8868 1", "\u5217\u8868 2"],
  26717. filterPlaceholder: "\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",
  26718. noCheckedFormat: "\u5171 {total} \u9879",
  26719. hasCheckedFormat: "\u5DF2\u9009 {checked}/{total} \u9879"
  26720. },
  26721. image: {
  26722. error: "\u52A0\u8F7D\u5931\u8D25"
  26723. },
  26724. pageHeader: {
  26725. title: "\u8FD4\u56DE"
  26726. },
  26727. popconfirm: {
  26728. confirmButtonText: "\u786E\u5B9A",
  26729. cancelButtonText: "\u53D6\u6D88"
  26730. }
  26731. }
  26732. };
  26733. /*! Element Plus v2.3.4 */
  26734. var en = {
  26735. name: "en",
  26736. el: {
  26737. colorpicker: {
  26738. confirm: "OK",
  26739. clear: "Clear",
  26740. defaultLabel: "color picker",
  26741. description: "current color is {color}. press enter to select a new color."
  26742. },
  26743. datepicker: {
  26744. now: "Now",
  26745. today: "Today",
  26746. cancel: "Cancel",
  26747. clear: "Clear",
  26748. confirm: "OK",
  26749. dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
  26750. monthTablePrompt: "Use the arrow keys and enter to select the month",
  26751. yearTablePrompt: "Use the arrow keys and enter to select the year",
  26752. selectedDate: "Selected date",
  26753. selectDate: "Select date",
  26754. selectTime: "Select time",
  26755. startDate: "Start Date",
  26756. startTime: "Start Time",
  26757. endDate: "End Date",
  26758. endTime: "End Time",
  26759. prevYear: "Previous Year",
  26760. nextYear: "Next Year",
  26761. prevMonth: "Previous Month",
  26762. nextMonth: "Next Month",
  26763. year: "",
  26764. month1: "January",
  26765. month2: "February",
  26766. month3: "March",
  26767. month4: "April",
  26768. month5: "May",
  26769. month6: "June",
  26770. month7: "July",
  26771. month8: "August",
  26772. month9: "September",
  26773. month10: "October",
  26774. month11: "November",
  26775. month12: "December",
  26776. week: "week",
  26777. weeks: {
  26778. sun: "Sun",
  26779. mon: "Mon",
  26780. tue: "Tue",
  26781. wed: "Wed",
  26782. thu: "Thu",
  26783. fri: "Fri",
  26784. sat: "Sat"
  26785. },
  26786. weeksFull: {
  26787. sun: "Sunday",
  26788. mon: "Monday",
  26789. tue: "Tuesday",
  26790. wed: "Wednesday",
  26791. thu: "Thursday",
  26792. fri: "Friday",
  26793. sat: "Saturday"
  26794. },
  26795. months: {
  26796. jan: "Jan",
  26797. feb: "Feb",
  26798. mar: "Mar",
  26799. apr: "Apr",
  26800. may: "May",
  26801. jun: "Jun",
  26802. jul: "Jul",
  26803. aug: "Aug",
  26804. sep: "Sep",
  26805. oct: "Oct",
  26806. nov: "Nov",
  26807. dec: "Dec"
  26808. }
  26809. },
  26810. inputNumber: {
  26811. decrease: "decrease number",
  26812. increase: "increase number"
  26813. },
  26814. select: {
  26815. loading: "Loading",
  26816. noMatch: "No matching data",
  26817. noData: "No data",
  26818. placeholder: "Select"
  26819. },
  26820. dropdown: {
  26821. toggleDropdown: "Toggle Dropdown"
  26822. },
  26823. cascader: {
  26824. noMatch: "No matching data",
  26825. loading: "Loading",
  26826. placeholder: "Select",
  26827. noData: "No data"
  26828. },
  26829. pagination: {
  26830. goto: "Go to",
  26831. pagesize: "/page",
  26832. total: "Total {total}",
  26833. pageClassifier: "",
  26834. page: "Page",
  26835. prev: "Go to previous page",
  26836. next: "Go to next page",
  26837. currentPage: "page {pager}",
  26838. prevPages: "Previous {pager} pages",
  26839. nextPages: "Next {pager} pages",
  26840. deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
  26841. },
  26842. dialog: {
  26843. close: "Close this dialog"
  26844. },
  26845. drawer: {
  26846. close: "Close this dialog"
  26847. },
  26848. messagebox: {
  26849. title: "Message",
  26850. confirm: "OK",
  26851. cancel: "Cancel",
  26852. error: "Illegal input",
  26853. close: "Close this dialog"
  26854. },
  26855. upload: {
  26856. deleteTip: "press delete to remove",
  26857. delete: "Delete",
  26858. preview: "Preview",
  26859. continue: "Continue"
  26860. },
  26861. slider: {
  26862. defaultLabel: "slider between {min} and {max}",
  26863. defaultRangeStartLabel: "pick start value",
  26864. defaultRangeEndLabel: "pick end value"
  26865. },
  26866. table: {
  26867. emptyText: "No Data",
  26868. confirmFilter: "Confirm",
  26869. resetFilter: "Reset",
  26870. clearFilter: "All",
  26871. sumText: "Sum"
  26872. },
  26873. tree: {
  26874. emptyText: "No Data"
  26875. },
  26876. transfer: {
  26877. noMatch: "No matching data",
  26878. noData: "No data",
  26879. titles: ["List 1", "List 2"],
  26880. filterPlaceholder: "Enter keyword",
  26881. noCheckedFormat: "{total} items",
  26882. hasCheckedFormat: "{checked}/{total} checked"
  26883. },
  26884. image: {
  26885. error: "FAILED"
  26886. },
  26887. pageHeader: {
  26888. title: "Back"
  26889. },
  26890. popconfirm: {
  26891. confirmButtonText: "Yes",
  26892. cancelButtonText: "No"
  26893. }
  26894. }
  26895. };
  26896. var jquery = { exports: {} };
  26897. /*!
  26898. * jQuery JavaScript Library v3.7.0
  26899. * https://jquery.com/
  26900. *
  26901. * Copyright OpenJS Foundation and other contributors
  26902. * Released under the MIT license
  26903. * https://jquery.org/license
  26904. *
  26905. * Date: 2023-05-11T18:29Z
  26906. */
  26907. (function(module2) {
  26908. (function(global2, factory3) {
  26909. {
  26910. module2.exports = global2.document ? factory3(global2, true) : function(w) {
  26911. if (!w.document) {
  26912. throw new Error("jQuery requires a window with a document");
  26913. }
  26914. return factory3(w);
  26915. };
  26916. }
  26917. })(typeof window !== "undefined" ? window : commonjsGlobal, function(window2, noGlobal) {
  26918. var arr = [];
  26919. var getProto = Object.getPrototypeOf;
  26920. var slice = arr.slice;
  26921. var flat2 = arr.flat ? function(array) {
  26922. return arr.flat.call(array);
  26923. } : function(array) {
  26924. return arr.concat.apply([], array);
  26925. };
  26926. var push = arr.push;
  26927. var indexOf = arr.indexOf;
  26928. var class2type = {};
  26929. var toString2 = class2type.toString;
  26930. var hasOwn2 = class2type.hasOwnProperty;
  26931. var fnToString = hasOwn2.toString;
  26932. var ObjectFunctionString = fnToString.call(Object);
  26933. var support = {};
  26934. var isFunction2 = function isFunction3(obj) {
  26935. return typeof obj === "function" && typeof obj.nodeType !== "number" && typeof obj.item !== "function";
  26936. };
  26937. var isWindow = function isWindow2(obj) {
  26938. return obj != null && obj === obj.window;
  26939. };
  26940. var document2 = window2.document;
  26941. var preservedScriptAttributes = {
  26942. type: true,
  26943. src: true,
  26944. nonce: true,
  26945. noModule: true
  26946. };
  26947. function DOMEval(code, node, doc) {
  26948. doc = doc || document2;
  26949. var i2, val, script = doc.createElement("script");
  26950. script.text = code;
  26951. if (node) {
  26952. for (i2 in preservedScriptAttributes) {
  26953. val = node[i2] || node.getAttribute && node.getAttribute(i2);
  26954. if (val) {
  26955. script.setAttribute(i2, val);
  26956. }
  26957. }
  26958. }
  26959. doc.head.appendChild(script).parentNode.removeChild(script);
  26960. }
  26961. function toType(obj) {
  26962. if (obj == null) {
  26963. return obj + "";
  26964. }
  26965. return typeof obj === "object" || typeof obj === "function" ? class2type[toString2.call(obj)] || "object" : typeof obj;
  26966. }
  26967. var version2 = "3.7.0", rhtmlSuffix = /HTML$/i, jQuery = function(selector, context) {
  26968. return new jQuery.fn.init(selector, context);
  26969. };
  26970. jQuery.fn = jQuery.prototype = {
  26971. jquery: version2,
  26972. constructor: jQuery,
  26973. length: 0,
  26974. toArray: function() {
  26975. return slice.call(this);
  26976. },
  26977. get: function(num) {
  26978. if (num == null) {
  26979. return slice.call(this);
  26980. }
  26981. return num < 0 ? this[num + this.length] : this[num];
  26982. },
  26983. pushStack: function(elems) {
  26984. var ret = jQuery.merge(this.constructor(), elems);
  26985. ret.prevObject = this;
  26986. return ret;
  26987. },
  26988. each: function(callback2) {
  26989. return jQuery.each(this, callback2);
  26990. },
  26991. map: function(callback2) {
  26992. return this.pushStack(jQuery.map(this, function(elem, i2) {
  26993. return callback2.call(elem, i2, elem);
  26994. }));
  26995. },
  26996. slice: function() {
  26997. return this.pushStack(slice.apply(this, arguments));
  26998. },
  26999. first: function() {
  27000. return this.eq(0);
  27001. },
  27002. last: function() {
  27003. return this.eq(-1);
  27004. },
  27005. even: function() {
  27006. return this.pushStack(jQuery.grep(this, function(_elem, i2) {
  27007. return (i2 + 1) % 2;
  27008. }));
  27009. },
  27010. odd: function() {
  27011. return this.pushStack(jQuery.grep(this, function(_elem, i2) {
  27012. return i2 % 2;
  27013. }));
  27014. },
  27015. eq: function(i2) {
  27016. var len = this.length, j = +i2 + (i2 < 0 ? len : 0);
  27017. return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
  27018. },
  27019. end: function() {
  27020. return this.prevObject || this.constructor();
  27021. },
  27022. push,
  27023. sort: arr.sort,
  27024. splice: arr.splice
  27025. };
  27026. jQuery.extend = jQuery.fn.extend = function() {
  27027. var options2, name, src, copy2, copyIsArray, clone, target = arguments[0] || {}, i2 = 1, length = arguments.length, deep = false;
  27028. if (typeof target === "boolean") {
  27029. deep = target;
  27030. target = arguments[i2] || {};
  27031. i2++;
  27032. }
  27033. if (typeof target !== "object" && !isFunction2(target)) {
  27034. target = {};
  27035. }
  27036. if (i2 === length) {
  27037. target = this;
  27038. i2--;
  27039. }
  27040. for (; i2 < length; i2++) {
  27041. if ((options2 = arguments[i2]) != null) {
  27042. for (name in options2) {
  27043. copy2 = options2[name];
  27044. if (name === "__proto__" || target === copy2) {
  27045. continue;
  27046. }
  27047. if (deep && copy2 && (jQuery.isPlainObject(copy2) || (copyIsArray = Array.isArray(copy2)))) {
  27048. src = target[name];
  27049. if (copyIsArray && !Array.isArray(src)) {
  27050. clone = [];
  27051. } else if (!copyIsArray && !jQuery.isPlainObject(src)) {
  27052. clone = {};
  27053. } else {
  27054. clone = src;
  27055. }
  27056. copyIsArray = false;
  27057. target[name] = jQuery.extend(deep, clone, copy2);
  27058. } else if (copy2 !== void 0) {
  27059. target[name] = copy2;
  27060. }
  27061. }
  27062. }
  27063. }
  27064. return target;
  27065. };
  27066. jQuery.extend({
  27067. expando: "jQuery" + (version2 + Math.random()).replace(/\D/g, ""),
  27068. isReady: true,
  27069. error: function(msg) {
  27070. throw new Error(msg);
  27071. },
  27072. noop: function() {
  27073. },
  27074. isPlainObject: function(obj) {
  27075. var proto, Ctor;
  27076. if (!obj || toString2.call(obj) !== "[object Object]") {
  27077. return false;
  27078. }
  27079. proto = getProto(obj);
  27080. if (!proto) {
  27081. return true;
  27082. }
  27083. Ctor = hasOwn2.call(proto, "constructor") && proto.constructor;
  27084. return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString;
  27085. },
  27086. isEmptyObject: function(obj) {
  27087. var name;
  27088. for (name in obj) {
  27089. return false;
  27090. }
  27091. return true;
  27092. },
  27093. globalEval: function(code, options2, doc) {
  27094. DOMEval(code, { nonce: options2 && options2.nonce }, doc);
  27095. },
  27096. each: function(obj, callback2) {
  27097. var length, i2 = 0;
  27098. if (isArrayLike2(obj)) {
  27099. length = obj.length;
  27100. for (; i2 < length; i2++) {
  27101. if (callback2.call(obj[i2], i2, obj[i2]) === false) {
  27102. break;
  27103. }
  27104. }
  27105. } else {
  27106. for (i2 in obj) {
  27107. if (callback2.call(obj[i2], i2, obj[i2]) === false) {
  27108. break;
  27109. }
  27110. }
  27111. }
  27112. return obj;
  27113. },
  27114. text: function(elem) {
  27115. var node, ret = "", i2 = 0, nodeType = elem.nodeType;
  27116. if (!nodeType) {
  27117. while (node = elem[i2++]) {
  27118. ret += jQuery.text(node);
  27119. }
  27120. } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
  27121. return elem.textContent;
  27122. } else if (nodeType === 3 || nodeType === 4) {
  27123. return elem.nodeValue;
  27124. }
  27125. return ret;
  27126. },
  27127. makeArray: function(arr2, results) {
  27128. var ret = results || [];
  27129. if (arr2 != null) {
  27130. if (isArrayLike2(Object(arr2))) {
  27131. jQuery.merge(
  27132. ret,
  27133. typeof arr2 === "string" ? [arr2] : arr2
  27134. );
  27135. } else {
  27136. push.call(ret, arr2);
  27137. }
  27138. }
  27139. return ret;
  27140. },
  27141. inArray: function(elem, arr2, i2) {
  27142. return arr2 == null ? -1 : indexOf.call(arr2, elem, i2);
  27143. },
  27144. isXMLDoc: function(elem) {
  27145. var namespace = elem && elem.namespaceURI, docElem = elem && (elem.ownerDocument || elem).documentElement;
  27146. return !rhtmlSuffix.test(namespace || docElem && docElem.nodeName || "HTML");
  27147. },
  27148. merge: function(first, second) {
  27149. var len = +second.length, j = 0, i2 = first.length;
  27150. for (; j < len; j++) {
  27151. first[i2++] = second[j];
  27152. }
  27153. first.length = i2;
  27154. return first;
  27155. },
  27156. grep: function(elems, callback2, invert) {
  27157. var callbackInverse, matches = [], i2 = 0, length = elems.length, callbackExpect = !invert;
  27158. for (; i2 < length; i2++) {
  27159. callbackInverse = !callback2(elems[i2], i2);
  27160. if (callbackInverse !== callbackExpect) {
  27161. matches.push(elems[i2]);
  27162. }
  27163. }
  27164. return matches;
  27165. },
  27166. map: function(elems, callback2, arg) {
  27167. var length, value, i2 = 0, ret = [];
  27168. if (isArrayLike2(elems)) {
  27169. length = elems.length;
  27170. for (; i2 < length; i2++) {
  27171. value = callback2(elems[i2], i2, arg);
  27172. if (value != null) {
  27173. ret.push(value);
  27174. }
  27175. }
  27176. } else {
  27177. for (i2 in elems) {
  27178. value = callback2(elems[i2], i2, arg);
  27179. if (value != null) {
  27180. ret.push(value);
  27181. }
  27182. }
  27183. }
  27184. return flat2(ret);
  27185. },
  27186. guid: 1,
  27187. support
  27188. });
  27189. if (typeof Symbol === "function") {
  27190. jQuery.fn[Symbol.iterator] = arr[Symbol.iterator];
  27191. }
  27192. jQuery.each(
  27193. "Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),
  27194. function(_i, name) {
  27195. class2type["[object " + name + "]"] = name.toLowerCase();
  27196. }
  27197. );
  27198. function isArrayLike2(obj) {
  27199. var length = !!obj && "length" in obj && obj.length, type2 = toType(obj);
  27200. if (isFunction2(obj) || isWindow(obj)) {
  27201. return false;
  27202. }
  27203. return type2 === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj;
  27204. }
  27205. function nodeName(elem, name) {
  27206. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  27207. }
  27208. var pop = arr.pop;
  27209. var sort = arr.sort;
  27210. var splice2 = arr.splice;
  27211. var whitespace = "[\\x20\\t\\r\\n\\f]";
  27212. var rtrimCSS = new RegExp(
  27213. "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
  27214. "g"
  27215. );
  27216. jQuery.contains = function(a, b) {
  27217. var bup = b && b.parentNode;
  27218. return a === bup || !!(bup && bup.nodeType === 1 && (a.contains ? a.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));
  27219. };
  27220. var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
  27221. function fcssescape(ch, asCodePoint) {
  27222. if (asCodePoint) {
  27223. if (ch === "\0") {
  27224. return "\uFFFD";
  27225. }
  27226. return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " ";
  27227. }
  27228. return "\\" + ch;
  27229. }
  27230. jQuery.escapeSelector = function(sel) {
  27231. return (sel + "").replace(rcssescape, fcssescape);
  27232. };
  27233. var preferredDoc = document2, pushNative = push;
  27234. (function() {
  27235. var i2, Expr, outermostContext, sortInput, hasDuplicate, push2 = pushNative, document3, documentElement2, documentIsHTML, rbuggyQSA, matches, expando = jQuery.expando, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), nonnativeSelectorCache = createCache(), sortOrder = function(a, b) {
  27236. if (a === b) {
  27237. hasDuplicate = true;
  27238. }
  27239. return 0;
  27240. }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + "*([*^$|!~]?=)" + whitespace + `*(?:'((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)"|(` + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + `)(?:\\((('((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|` + attributes + ")*)|.*)\\)|)", rwhitespace = new RegExp(whitespace + "+", "g"), rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), rleadingCombinator = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), rdescend = new RegExp(whitespace + "|>"), rpseudo = new RegExp(pseudos), ridentifier = new RegExp("^" + identifier + "$"), matchExpr = {
  27241. ID: new RegExp("^#(" + identifier + ")"),
  27242. CLASS: new RegExp("^\\.(" + identifier + ")"),
  27243. TAG: new RegExp("^(" + identifier + "|[*])"),
  27244. ATTR: new RegExp("^" + attributes),
  27245. PSEUDO: new RegExp("^" + pseudos),
  27246. CHILD: new RegExp(
  27247. "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)",
  27248. "i"
  27249. ),
  27250. bool: new RegExp("^(?:" + booleans + ")$", "i"),
  27251. needsContext: new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
  27252. }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rquickExpr2 = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, runescape = new RegExp("\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g"), funescape = function(escape2, nonHex) {
  27253. var high = "0x" + escape2.slice(1) - 65536;
  27254. if (nonHex) {
  27255. return nonHex;
  27256. }
  27257. return high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320);
  27258. }, unloadHandler = function() {
  27259. setDocument();
  27260. }, inDisabledFieldset = addCombinator(
  27261. function(elem) {
  27262. return elem.disabled === true && nodeName(elem, "fieldset");
  27263. },
  27264. { dir: "parentNode", next: "legend" }
  27265. );
  27266. function safeActiveElement() {
  27267. try {
  27268. return document3.activeElement;
  27269. } catch (err) {
  27270. }
  27271. }
  27272. try {
  27273. push2.apply(
  27274. arr = slice.call(preferredDoc.childNodes),
  27275. preferredDoc.childNodes
  27276. );
  27277. arr[preferredDoc.childNodes.length].nodeType;
  27278. } catch (e) {
  27279. push2 = {
  27280. apply: function(target, els) {
  27281. pushNative.apply(target, slice.call(els));
  27282. },
  27283. call: function(target) {
  27284. pushNative.apply(target, slice.call(arguments, 1));
  27285. }
  27286. };
  27287. }
  27288. function find2(selector, context, results, seed) {
  27289. var m, i3, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument, nodeType = context ? context.nodeType : 9;
  27290. results = results || [];
  27291. if (typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {
  27292. return results;
  27293. }
  27294. if (!seed) {
  27295. setDocument(context);
  27296. context = context || document3;
  27297. if (documentIsHTML) {
  27298. if (nodeType !== 11 && (match = rquickExpr2.exec(selector))) {
  27299. if (m = match[1]) {
  27300. if (nodeType === 9) {
  27301. if (elem = context.getElementById(m)) {
  27302. if (elem.id === m) {
  27303. push2.call(results, elem);
  27304. return results;
  27305. }
  27306. } else {
  27307. return results;
  27308. }
  27309. } else {
  27310. if (newContext && (elem = newContext.getElementById(m)) && find2.contains(context, elem) && elem.id === m) {
  27311. push2.call(results, elem);
  27312. return results;
  27313. }
  27314. }
  27315. } else if (match[2]) {
  27316. push2.apply(results, context.getElementsByTagName(selector));
  27317. return results;
  27318. } else if ((m = match[3]) && context.getElementsByClassName) {
  27319. push2.apply(results, context.getElementsByClassName(m));
  27320. return results;
  27321. }
  27322. }
  27323. if (!nonnativeSelectorCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
  27324. newSelector = selector;
  27325. newContext = context;
  27326. if (nodeType === 1 && (rdescend.test(selector) || rleadingCombinator.test(selector))) {
  27327. newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
  27328. if (newContext != context || !support.scope) {
  27329. if (nid = context.getAttribute("id")) {
  27330. nid = jQuery.escapeSelector(nid);
  27331. } else {
  27332. context.setAttribute("id", nid = expando);
  27333. }
  27334. }
  27335. groups = tokenize(selector);
  27336. i3 = groups.length;
  27337. while (i3--) {
  27338. groups[i3] = (nid ? "#" + nid : ":scope") + " " + toSelector(groups[i3]);
  27339. }
  27340. newSelector = groups.join(",");
  27341. }
  27342. try {
  27343. push2.apply(
  27344. results,
  27345. newContext.querySelectorAll(newSelector)
  27346. );
  27347. return results;
  27348. } catch (qsaError) {
  27349. nonnativeSelectorCache(selector, true);
  27350. } finally {
  27351. if (nid === expando) {
  27352. context.removeAttribute("id");
  27353. }
  27354. }
  27355. }
  27356. }
  27357. }
  27358. return select(selector.replace(rtrimCSS, "$1"), context, results, seed);
  27359. }
  27360. function createCache() {
  27361. var keys3 = [];
  27362. function cache(key, value) {
  27363. if (keys3.push(key + " ") > Expr.cacheLength) {
  27364. delete cache[keys3.shift()];
  27365. }
  27366. return cache[key + " "] = value;
  27367. }
  27368. return cache;
  27369. }
  27370. function markFunction(fn2) {
  27371. fn2[expando] = true;
  27372. return fn2;
  27373. }
  27374. function assert(fn2) {
  27375. var el = document3.createElement("fieldset");
  27376. try {
  27377. return !!fn2(el);
  27378. } catch (e) {
  27379. return false;
  27380. } finally {
  27381. if (el.parentNode) {
  27382. el.parentNode.removeChild(el);
  27383. }
  27384. el = null;
  27385. }
  27386. }
  27387. function createInputPseudo(type2) {
  27388. return function(elem) {
  27389. return nodeName(elem, "input") && elem.type === type2;
  27390. };
  27391. }
  27392. function createButtonPseudo(type2) {
  27393. return function(elem) {
  27394. return (nodeName(elem, "input") || nodeName(elem, "button")) && elem.type === type2;
  27395. };
  27396. }
  27397. function createDisabledPseudo(disabled) {
  27398. return function(elem) {
  27399. if ("form" in elem) {
  27400. if (elem.parentNode && elem.disabled === false) {
  27401. if ("label" in elem) {
  27402. if ("label" in elem.parentNode) {
  27403. return elem.parentNode.disabled === disabled;
  27404. } else {
  27405. return elem.disabled === disabled;
  27406. }
  27407. }
  27408. return elem.isDisabled === disabled || elem.isDisabled !== !disabled && inDisabledFieldset(elem) === disabled;
  27409. }
  27410. return elem.disabled === disabled;
  27411. } else if ("label" in elem) {
  27412. return elem.disabled === disabled;
  27413. }
  27414. return false;
  27415. };
  27416. }
  27417. function createPositionalPseudo(fn2) {
  27418. return markFunction(function(argument) {
  27419. argument = +argument;
  27420. return markFunction(function(seed, matches2) {
  27421. var j, matchIndexes = fn2([], seed.length, argument), i3 = matchIndexes.length;
  27422. while (i3--) {
  27423. if (seed[j = matchIndexes[i3]]) {
  27424. seed[j] = !(matches2[j] = seed[j]);
  27425. }
  27426. }
  27427. });
  27428. });
  27429. }
  27430. function testContext(context) {
  27431. return context && typeof context.getElementsByTagName !== "undefined" && context;
  27432. }
  27433. function setDocument(node) {
  27434. var subWindow, doc = node ? node.ownerDocument || node : preferredDoc;
  27435. if (doc == document3 || doc.nodeType !== 9 || !doc.documentElement) {
  27436. return document3;
  27437. }
  27438. document3 = doc;
  27439. documentElement2 = document3.documentElement;
  27440. documentIsHTML = !jQuery.isXMLDoc(document3);
  27441. matches = documentElement2.matches || documentElement2.webkitMatchesSelector || documentElement2.msMatchesSelector;
  27442. if (preferredDoc != document3 && (subWindow = document3.defaultView) && subWindow.top !== subWindow) {
  27443. subWindow.addEventListener("unload", unloadHandler);
  27444. }
  27445. support.getById = assert(function(el) {
  27446. documentElement2.appendChild(el).id = jQuery.expando;
  27447. return !document3.getElementsByName || !document3.getElementsByName(jQuery.expando).length;
  27448. });
  27449. support.disconnectedMatch = assert(function(el) {
  27450. return matches.call(el, "*");
  27451. });
  27452. support.scope = assert(function() {
  27453. return document3.querySelectorAll(":scope");
  27454. });
  27455. support.cssHas = assert(function() {
  27456. try {
  27457. document3.querySelector(":has(*,:jqfake)");
  27458. return false;
  27459. } catch (e) {
  27460. return true;
  27461. }
  27462. });
  27463. if (support.getById) {
  27464. Expr.filter.ID = function(id) {
  27465. var attrId = id.replace(runescape, funescape);
  27466. return function(elem) {
  27467. return elem.getAttribute("id") === attrId;
  27468. };
  27469. };
  27470. Expr.find.ID = function(id, context) {
  27471. if (typeof context.getElementById !== "undefined" && documentIsHTML) {
  27472. var elem = context.getElementById(id);
  27473. return elem ? [elem] : [];
  27474. }
  27475. };
  27476. } else {
  27477. Expr.filter.ID = function(id) {
  27478. var attrId = id.replace(runescape, funescape);
  27479. return function(elem) {
  27480. var node2 = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
  27481. return node2 && node2.value === attrId;
  27482. };
  27483. };
  27484. Expr.find.ID = function(id, context) {
  27485. if (typeof context.getElementById !== "undefined" && documentIsHTML) {
  27486. var node2, i3, elems, elem = context.getElementById(id);
  27487. if (elem) {
  27488. node2 = elem.getAttributeNode("id");
  27489. if (node2 && node2.value === id) {
  27490. return [elem];
  27491. }
  27492. elems = context.getElementsByName(id);
  27493. i3 = 0;
  27494. while (elem = elems[i3++]) {
  27495. node2 = elem.getAttributeNode("id");
  27496. if (node2 && node2.value === id) {
  27497. return [elem];
  27498. }
  27499. }
  27500. }
  27501. return [];
  27502. }
  27503. };
  27504. }
  27505. Expr.find.TAG = function(tag, context) {
  27506. if (typeof context.getElementsByTagName !== "undefined") {
  27507. return context.getElementsByTagName(tag);
  27508. } else {
  27509. return context.querySelectorAll(tag);
  27510. }
  27511. };
  27512. Expr.find.CLASS = function(className, context) {
  27513. if (typeof context.getElementsByClassName !== "undefined" && documentIsHTML) {
  27514. return context.getElementsByClassName(className);
  27515. }
  27516. };
  27517. rbuggyQSA = [];
  27518. assert(function(el) {
  27519. var input;
  27520. documentElement2.appendChild(el).innerHTML = "<a id='" + expando + "' href='' disabled='disabled'></a><select id='" + expando + "-\r\\' disabled='disabled'><option selected=''></option></select>";
  27521. if (!el.querySelectorAll("[selected]").length) {
  27522. rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")");
  27523. }
  27524. if (!el.querySelectorAll("[id~=" + expando + "-]").length) {
  27525. rbuggyQSA.push("~=");
  27526. }
  27527. if (!el.querySelectorAll("a#" + expando + "+*").length) {
  27528. rbuggyQSA.push(".#.+[+~]");
  27529. }
  27530. if (!el.querySelectorAll(":checked").length) {
  27531. rbuggyQSA.push(":checked");
  27532. }
  27533. input = document3.createElement("input");
  27534. input.setAttribute("type", "hidden");
  27535. el.appendChild(input).setAttribute("name", "D");
  27536. documentElement2.appendChild(el).disabled = true;
  27537. if (el.querySelectorAll(":disabled").length !== 2) {
  27538. rbuggyQSA.push(":enabled", ":disabled");
  27539. }
  27540. input = document3.createElement("input");
  27541. input.setAttribute("name", "");
  27542. el.appendChild(input);
  27543. if (!el.querySelectorAll("[name='']").length) {
  27544. rbuggyQSA.push("\\[" + whitespace + "*name" + whitespace + "*=" + whitespace + `*(?:''|"")`);
  27545. }
  27546. });
  27547. if (!support.cssHas) {
  27548. rbuggyQSA.push(":has");
  27549. }
  27550. rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
  27551. sortOrder = function(a, b) {
  27552. if (a === b) {
  27553. hasDuplicate = true;
  27554. return 0;
  27555. }
  27556. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  27557. if (compare) {
  27558. return compare;
  27559. }
  27560. compare = (a.ownerDocument || a) == (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1;
  27561. if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) {
  27562. if (a === document3 || a.ownerDocument == preferredDoc && find2.contains(preferredDoc, a)) {
  27563. return -1;
  27564. }
  27565. if (b === document3 || b.ownerDocument == preferredDoc && find2.contains(preferredDoc, b)) {
  27566. return 1;
  27567. }
  27568. return sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0;
  27569. }
  27570. return compare & 4 ? -1 : 1;
  27571. };
  27572. return document3;
  27573. }
  27574. find2.matches = function(expr, elements) {
  27575. return find2(expr, null, null, elements);
  27576. };
  27577. find2.matchesSelector = function(elem, expr) {
  27578. setDocument(elem);
  27579. if (documentIsHTML && !nonnativeSelectorCache[expr + " "] && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
  27580. try {
  27581. var ret = matches.call(elem, expr);
  27582. if (ret || support.disconnectedMatch || elem.document && elem.document.nodeType !== 11) {
  27583. return ret;
  27584. }
  27585. } catch (e) {
  27586. nonnativeSelectorCache(expr, true);
  27587. }
  27588. }
  27589. return find2(expr, document3, null, [elem]).length > 0;
  27590. };
  27591. find2.contains = function(context, elem) {
  27592. if ((context.ownerDocument || context) != document3) {
  27593. setDocument(context);
  27594. }
  27595. return jQuery.contains(context, elem);
  27596. };
  27597. find2.attr = function(elem, name) {
  27598. if ((elem.ownerDocument || elem) != document3) {
  27599. setDocument(elem);
  27600. }
  27601. var fn2 = Expr.attrHandle[name.toLowerCase()], val = fn2 && hasOwn2.call(Expr.attrHandle, name.toLowerCase()) ? fn2(elem, name, !documentIsHTML) : void 0;
  27602. if (val !== void 0) {
  27603. return val;
  27604. }
  27605. return elem.getAttribute(name);
  27606. };
  27607. find2.error = function(msg) {
  27608. throw new Error("Syntax error, unrecognized expression: " + msg);
  27609. };
  27610. jQuery.uniqueSort = function(results) {
  27611. var elem, duplicates = [], j = 0, i3 = 0;
  27612. hasDuplicate = !support.sortStable;
  27613. sortInput = !support.sortStable && slice.call(results, 0);
  27614. sort.call(results, sortOrder);
  27615. if (hasDuplicate) {
  27616. while (elem = results[i3++]) {
  27617. if (elem === results[i3]) {
  27618. j = duplicates.push(i3);
  27619. }
  27620. }
  27621. while (j--) {
  27622. splice2.call(results, duplicates[j], 1);
  27623. }
  27624. }
  27625. sortInput = null;
  27626. return results;
  27627. };
  27628. jQuery.fn.uniqueSort = function() {
  27629. return this.pushStack(jQuery.uniqueSort(slice.apply(this)));
  27630. };
  27631. Expr = jQuery.expr = {
  27632. cacheLength: 50,
  27633. createPseudo: markFunction,
  27634. match: matchExpr,
  27635. attrHandle: {},
  27636. find: {},
  27637. relative: {
  27638. ">": { dir: "parentNode", first: true },
  27639. " ": { dir: "parentNode" },
  27640. "+": { dir: "previousSibling", first: true },
  27641. "~": { dir: "previousSibling" }
  27642. },
  27643. preFilter: {
  27644. ATTR: function(match) {
  27645. match[1] = match[1].replace(runescape, funescape);
  27646. match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape);
  27647. if (match[2] === "~=") {
  27648. match[3] = " " + match[3] + " ";
  27649. }
  27650. return match.slice(0, 4);
  27651. },
  27652. CHILD: function(match) {
  27653. match[1] = match[1].toLowerCase();
  27654. if (match[1].slice(0, 3) === "nth") {
  27655. if (!match[3]) {
  27656. find2.error(match[0]);
  27657. }
  27658. match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
  27659. match[5] = +(match[7] + match[8] || match[3] === "odd");
  27660. } else if (match[3]) {
  27661. find2.error(match[0]);
  27662. }
  27663. return match;
  27664. },
  27665. PSEUDO: function(match) {
  27666. var excess, unquoted = !match[6] && match[2];
  27667. if (matchExpr.CHILD.test(match[0])) {
  27668. return null;
  27669. }
  27670. if (match[3]) {
  27671. match[2] = match[4] || match[5] || "";
  27672. } else if (unquoted && rpseudo.test(unquoted) && (excess = tokenize(unquoted, true)) && (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
  27673. match[0] = match[0].slice(0, excess);
  27674. match[2] = unquoted.slice(0, excess);
  27675. }
  27676. return match.slice(0, 3);
  27677. }
  27678. },
  27679. filter: {
  27680. TAG: function(nodeNameSelector) {
  27681. var expectedNodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
  27682. return nodeNameSelector === "*" ? function() {
  27683. return true;
  27684. } : function(elem) {
  27685. return nodeName(elem, expectedNodeName);
  27686. };
  27687. },
  27688. CLASS: function(className) {
  27689. var pattern = classCache[className + " "];
  27690. return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function(elem) {
  27691. return pattern.test(
  27692. typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || ""
  27693. );
  27694. });
  27695. },
  27696. ATTR: function(name, operator, check) {
  27697. return function(elem) {
  27698. var result = find2.attr(elem, name);
  27699. if (result == null) {
  27700. return operator === "!=";
  27701. }
  27702. if (!operator) {
  27703. return true;
  27704. }
  27705. result += "";
  27706. if (operator === "=") {
  27707. return result === check;
  27708. }
  27709. if (operator === "!=") {
  27710. return result !== check;
  27711. }
  27712. if (operator === "^=") {
  27713. return check && result.indexOf(check) === 0;
  27714. }
  27715. if (operator === "*=") {
  27716. return check && result.indexOf(check) > -1;
  27717. }
  27718. if (operator === "$=") {
  27719. return check && result.slice(-check.length) === check;
  27720. }
  27721. if (operator === "~=") {
  27722. return (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1;
  27723. }
  27724. if (operator === "|=") {
  27725. return result === check || result.slice(0, check.length + 1) === check + "-";
  27726. }
  27727. return false;
  27728. };
  27729. },
  27730. CHILD: function(type2, what, _argument, first, last) {
  27731. var simple = type2.slice(0, 3) !== "nth", forward = type2.slice(-4) !== "last", ofType = what === "of-type";
  27732. return first === 1 && last === 0 ? function(elem) {
  27733. return !!elem.parentNode;
  27734. } : function(elem, _context, xml) {
  27735. var cache, outerCache, node, nodeIndex, start2, dir2 = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false;
  27736. if (parent) {
  27737. if (simple) {
  27738. while (dir2) {
  27739. node = elem;
  27740. while (node = node[dir2]) {
  27741. if (ofType ? nodeName(node, name) : node.nodeType === 1) {
  27742. return false;
  27743. }
  27744. }
  27745. start2 = dir2 = type2 === "only" && !start2 && "nextSibling";
  27746. }
  27747. return true;
  27748. }
  27749. start2 = [forward ? parent.firstChild : parent.lastChild];
  27750. if (forward && useCache) {
  27751. outerCache = parent[expando] || (parent[expando] = {});
  27752. cache = outerCache[type2] || [];
  27753. nodeIndex = cache[0] === dirruns && cache[1];
  27754. diff = nodeIndex && cache[2];
  27755. node = nodeIndex && parent.childNodes[nodeIndex];
  27756. while (node = ++nodeIndex && node && node[dir2] || (diff = nodeIndex = 0) || start2.pop()) {
  27757. if (node.nodeType === 1 && ++diff && node === elem) {
  27758. outerCache[type2] = [dirruns, nodeIndex, diff];
  27759. break;
  27760. }
  27761. }
  27762. } else {
  27763. if (useCache) {
  27764. outerCache = elem[expando] || (elem[expando] = {});
  27765. cache = outerCache[type2] || [];
  27766. nodeIndex = cache[0] === dirruns && cache[1];
  27767. diff = nodeIndex;
  27768. }
  27769. if (diff === false) {
  27770. while (node = ++nodeIndex && node && node[dir2] || (diff = nodeIndex = 0) || start2.pop()) {
  27771. if ((ofType ? nodeName(node, name) : node.nodeType === 1) && ++diff) {
  27772. if (useCache) {
  27773. outerCache = node[expando] || (node[expando] = {});
  27774. outerCache[type2] = [dirruns, diff];
  27775. }
  27776. if (node === elem) {
  27777. break;
  27778. }
  27779. }
  27780. }
  27781. }
  27782. }
  27783. diff -= last;
  27784. return diff === first || diff % first === 0 && diff / first >= 0;
  27785. }
  27786. };
  27787. },
  27788. PSEUDO: function(pseudo, argument) {
  27789. var args, fn2 = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || find2.error("unsupported pseudo: " + pseudo);
  27790. if (fn2[expando]) {
  27791. return fn2(argument);
  27792. }
  27793. if (fn2.length > 1) {
  27794. args = [pseudo, pseudo, "", argument];
  27795. return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(seed, matches2) {
  27796. var idx, matched = fn2(seed, argument), i3 = matched.length;
  27797. while (i3--) {
  27798. idx = indexOf.call(seed, matched[i3]);
  27799. seed[idx] = !(matches2[idx] = matched[i3]);
  27800. }
  27801. }) : function(elem) {
  27802. return fn2(elem, 0, args);
  27803. };
  27804. }
  27805. return fn2;
  27806. }
  27807. },
  27808. pseudos: {
  27809. not: markFunction(function(selector) {
  27810. var input = [], results = [], matcher = compile(selector.replace(rtrimCSS, "$1"));
  27811. return matcher[expando] ? markFunction(function(seed, matches2, _context, xml) {
  27812. var elem, unmatched = matcher(seed, null, xml, []), i3 = seed.length;
  27813. while (i3--) {
  27814. if (elem = unmatched[i3]) {
  27815. seed[i3] = !(matches2[i3] = elem);
  27816. }
  27817. }
  27818. }) : function(elem, _context, xml) {
  27819. input[0] = elem;
  27820. matcher(input, null, xml, results);
  27821. input[0] = null;
  27822. return !results.pop();
  27823. };
  27824. }),
  27825. has: markFunction(function(selector) {
  27826. return function(elem) {
  27827. return find2(selector, elem).length > 0;
  27828. };
  27829. }),
  27830. contains: markFunction(function(text) {
  27831. text = text.replace(runescape, funescape);
  27832. return function(elem) {
  27833. return (elem.textContent || jQuery.text(elem)).indexOf(text) > -1;
  27834. };
  27835. }),
  27836. lang: markFunction(function(lang) {
  27837. if (!ridentifier.test(lang || "")) {
  27838. find2.error("unsupported lang: " + lang);
  27839. }
  27840. lang = lang.replace(runescape, funescape).toLowerCase();
  27841. return function(elem) {
  27842. var elemLang;
  27843. do {
  27844. if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) {
  27845. elemLang = elemLang.toLowerCase();
  27846. return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
  27847. }
  27848. } while ((elem = elem.parentNode) && elem.nodeType === 1);
  27849. return false;
  27850. };
  27851. }),
  27852. target: function(elem) {
  27853. var hash = window2.location && window2.location.hash;
  27854. return hash && hash.slice(1) === elem.id;
  27855. },
  27856. root: function(elem) {
  27857. return elem === documentElement2;
  27858. },
  27859. focus: function(elem) {
  27860. return elem === safeActiveElement() && document3.hasFocus() && !!(elem.type || elem.href || ~elem.tabIndex);
  27861. },
  27862. enabled: createDisabledPseudo(false),
  27863. disabled: createDisabledPseudo(true),
  27864. checked: function(elem) {
  27865. return nodeName(elem, "input") && !!elem.checked || nodeName(elem, "option") && !!elem.selected;
  27866. },
  27867. selected: function(elem) {
  27868. if (elem.parentNode) {
  27869. elem.parentNode.selectedIndex;
  27870. }
  27871. return elem.selected === true;
  27872. },
  27873. empty: function(elem) {
  27874. for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
  27875. if (elem.nodeType < 6) {
  27876. return false;
  27877. }
  27878. }
  27879. return true;
  27880. },
  27881. parent: function(elem) {
  27882. return !Expr.pseudos.empty(elem);
  27883. },
  27884. header: function(elem) {
  27885. return rheader.test(elem.nodeName);
  27886. },
  27887. input: function(elem) {
  27888. return rinputs.test(elem.nodeName);
  27889. },
  27890. button: function(elem) {
  27891. return nodeName(elem, "input") && elem.type === "button" || nodeName(elem, "button");
  27892. },
  27893. text: function(elem) {
  27894. var attr;
  27895. return nodeName(elem, "input") && elem.type === "text" && ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text");
  27896. },
  27897. first: createPositionalPseudo(function() {
  27898. return [0];
  27899. }),
  27900. last: createPositionalPseudo(function(_matchIndexes, length) {
  27901. return [length - 1];
  27902. }),
  27903. eq: createPositionalPseudo(function(_matchIndexes, length, argument) {
  27904. return [argument < 0 ? argument + length : argument];
  27905. }),
  27906. even: createPositionalPseudo(function(matchIndexes, length) {
  27907. var i3 = 0;
  27908. for (; i3 < length; i3 += 2) {
  27909. matchIndexes.push(i3);
  27910. }
  27911. return matchIndexes;
  27912. }),
  27913. odd: createPositionalPseudo(function(matchIndexes, length) {
  27914. var i3 = 1;
  27915. for (; i3 < length; i3 += 2) {
  27916. matchIndexes.push(i3);
  27917. }
  27918. return matchIndexes;
  27919. }),
  27920. lt: createPositionalPseudo(function(matchIndexes, length, argument) {
  27921. var i3;
  27922. if (argument < 0) {
  27923. i3 = argument + length;
  27924. } else if (argument > length) {
  27925. i3 = length;
  27926. } else {
  27927. i3 = argument;
  27928. }
  27929. for (; --i3 >= 0; ) {
  27930. matchIndexes.push(i3);
  27931. }
  27932. return matchIndexes;
  27933. }),
  27934. gt: createPositionalPseudo(function(matchIndexes, length, argument) {
  27935. var i3 = argument < 0 ? argument + length : argument;
  27936. for (; ++i3 < length; ) {
  27937. matchIndexes.push(i3);
  27938. }
  27939. return matchIndexes;
  27940. })
  27941. }
  27942. };
  27943. Expr.pseudos.nth = Expr.pseudos.eq;
  27944. for (i2 in { radio: true, checkbox: true, file: true, password: true, image: true }) {
  27945. Expr.pseudos[i2] = createInputPseudo(i2);
  27946. }
  27947. for (i2 in { submit: true, reset: true }) {
  27948. Expr.pseudos[i2] = createButtonPseudo(i2);
  27949. }
  27950. function setFilters() {
  27951. }
  27952. setFilters.prototype = Expr.filters = Expr.pseudos;
  27953. Expr.setFilters = new setFilters();
  27954. function tokenize(selector, parseOnly) {
  27955. var matched, match, tokens, type2, soFar, groups, preFilters, cached = tokenCache[selector + " "];
  27956. if (cached) {
  27957. return parseOnly ? 0 : cached.slice(0);
  27958. }
  27959. soFar = selector;
  27960. groups = [];
  27961. preFilters = Expr.preFilter;
  27962. while (soFar) {
  27963. if (!matched || (match = rcomma.exec(soFar))) {
  27964. if (match) {
  27965. soFar = soFar.slice(match[0].length) || soFar;
  27966. }
  27967. groups.push(tokens = []);
  27968. }
  27969. matched = false;
  27970. if (match = rleadingCombinator.exec(soFar)) {
  27971. matched = match.shift();
  27972. tokens.push({
  27973. value: matched,
  27974. type: match[0].replace(rtrimCSS, " ")
  27975. });
  27976. soFar = soFar.slice(matched.length);
  27977. }
  27978. for (type2 in Expr.filter) {
  27979. if ((match = matchExpr[type2].exec(soFar)) && (!preFilters[type2] || (match = preFilters[type2](match)))) {
  27980. matched = match.shift();
  27981. tokens.push({
  27982. value: matched,
  27983. type: type2,
  27984. matches: match
  27985. });
  27986. soFar = soFar.slice(matched.length);
  27987. }
  27988. }
  27989. if (!matched) {
  27990. break;
  27991. }
  27992. }
  27993. if (parseOnly) {
  27994. return soFar.length;
  27995. }
  27996. return soFar ? find2.error(selector) : tokenCache(selector, groups).slice(0);
  27997. }
  27998. function toSelector(tokens) {
  27999. var i3 = 0, len = tokens.length, selector = "";
  28000. for (; i3 < len; i3++) {
  28001. selector += tokens[i3].value;
  28002. }
  28003. return selector;
  28004. }
  28005. function addCombinator(matcher, combinator, base2) {
  28006. var dir2 = combinator.dir, skip = combinator.next, key = skip || dir2, checkNonElements = base2 && key === "parentNode", doneName = done++;
  28007. return combinator.first ? function(elem, context, xml) {
  28008. while (elem = elem[dir2]) {
  28009. if (elem.nodeType === 1 || checkNonElements) {
  28010. return matcher(elem, context, xml);
  28011. }
  28012. }
  28013. return false;
  28014. } : function(elem, context, xml) {
  28015. var oldCache, outerCache, newCache = [dirruns, doneName];
  28016. if (xml) {
  28017. while (elem = elem[dir2]) {
  28018. if (elem.nodeType === 1 || checkNonElements) {
  28019. if (matcher(elem, context, xml)) {
  28020. return true;
  28021. }
  28022. }
  28023. }
  28024. } else {
  28025. while (elem = elem[dir2]) {
  28026. if (elem.nodeType === 1 || checkNonElements) {
  28027. outerCache = elem[expando] || (elem[expando] = {});
  28028. if (skip && nodeName(elem, skip)) {
  28029. elem = elem[dir2] || elem;
  28030. } else if ((oldCache = outerCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) {
  28031. return newCache[2] = oldCache[2];
  28032. } else {
  28033. outerCache[key] = newCache;
  28034. if (newCache[2] = matcher(elem, context, xml)) {
  28035. return true;
  28036. }
  28037. }
  28038. }
  28039. }
  28040. }
  28041. return false;
  28042. };
  28043. }
  28044. function elementMatcher(matchers2) {
  28045. return matchers2.length > 1 ? function(elem, context, xml) {
  28046. var i3 = matchers2.length;
  28047. while (i3--) {
  28048. if (!matchers2[i3](elem, context, xml)) {
  28049. return false;
  28050. }
  28051. }
  28052. return true;
  28053. } : matchers2[0];
  28054. }
  28055. function multipleContexts(selector, contexts, results) {
  28056. var i3 = 0, len = contexts.length;
  28057. for (; i3 < len; i3++) {
  28058. find2(selector, contexts[i3], results);
  28059. }
  28060. return results;
  28061. }
  28062. function condense(unmatched, map, filter, context, xml) {
  28063. var elem, newUnmatched = [], i3 = 0, len = unmatched.length, mapped = map != null;
  28064. for (; i3 < len; i3++) {
  28065. if (elem = unmatched[i3]) {
  28066. if (!filter || filter(elem, context, xml)) {
  28067. newUnmatched.push(elem);
  28068. if (mapped) {
  28069. map.push(i3);
  28070. }
  28071. }
  28072. }
  28073. }
  28074. return newUnmatched;
  28075. }
  28076. function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
  28077. if (postFilter && !postFilter[expando]) {
  28078. postFilter = setMatcher(postFilter);
  28079. }
  28080. if (postFinder && !postFinder[expando]) {
  28081. postFinder = setMatcher(postFinder, postSelector);
  28082. }
  28083. return markFunction(function(seed, results, context, xml) {
  28084. var temp, i3, elem, matcherOut, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(
  28085. selector || "*",
  28086. context.nodeType ? [context] : context,
  28087. []
  28088. ), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems;
  28089. if (matcher) {
  28090. matcherOut = postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results;
  28091. matcher(matcherIn, matcherOut, context, xml);
  28092. } else {
  28093. matcherOut = matcherIn;
  28094. }
  28095. if (postFilter) {
  28096. temp = condense(matcherOut, postMap);
  28097. postFilter(temp, [], context, xml);
  28098. i3 = temp.length;
  28099. while (i3--) {
  28100. if (elem = temp[i3]) {
  28101. matcherOut[postMap[i3]] = !(matcherIn[postMap[i3]] = elem);
  28102. }
  28103. }
  28104. }
  28105. if (seed) {
  28106. if (postFinder || preFilter) {
  28107. if (postFinder) {
  28108. temp = [];
  28109. i3 = matcherOut.length;
  28110. while (i3--) {
  28111. if (elem = matcherOut[i3]) {
  28112. temp.push(matcherIn[i3] = elem);
  28113. }
  28114. }
  28115. postFinder(null, matcherOut = [], temp, xml);
  28116. }
  28117. i3 = matcherOut.length;
  28118. while (i3--) {
  28119. if ((elem = matcherOut[i3]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i3]) > -1) {
  28120. seed[temp] = !(results[temp] = elem);
  28121. }
  28122. }
  28123. }
  28124. } else {
  28125. matcherOut = condense(
  28126. matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut
  28127. );
  28128. if (postFinder) {
  28129. postFinder(null, results, matcherOut, xml);
  28130. } else {
  28131. push2.apply(results, matcherOut);
  28132. }
  28133. }
  28134. });
  28135. }
  28136. function matcherFromTokens(tokens) {
  28137. var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[" "], i3 = leadingRelative ? 1 : 0, matchContext = addCombinator(function(elem) {
  28138. return elem === checkContext;
  28139. }, implicitRelative, true), matchAnyContext = addCombinator(function(elem) {
  28140. return indexOf.call(checkContext, elem) > -1;
  28141. }, implicitRelative, true), matchers2 = [function(elem, context, xml) {
  28142. var ret = !leadingRelative && (xml || context != outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));
  28143. checkContext = null;
  28144. return ret;
  28145. }];
  28146. for (; i3 < len; i3++) {
  28147. if (matcher = Expr.relative[tokens[i3].type]) {
  28148. matchers2 = [addCombinator(elementMatcher(matchers2), matcher)];
  28149. } else {
  28150. matcher = Expr.filter[tokens[i3].type].apply(null, tokens[i3].matches);
  28151. if (matcher[expando]) {
  28152. j = ++i3;
  28153. for (; j < len; j++) {
  28154. if (Expr.relative[tokens[j].type]) {
  28155. break;
  28156. }
  28157. }
  28158. return setMatcher(
  28159. i3 > 1 && elementMatcher(matchers2),
  28160. i3 > 1 && toSelector(
  28161. tokens.slice(0, i3 - 1).concat({ value: tokens[i3 - 2].type === " " ? "*" : "" })
  28162. ).replace(rtrimCSS, "$1"),
  28163. matcher,
  28164. i3 < j && matcherFromTokens(tokens.slice(i3, j)),
  28165. j < len && matcherFromTokens(tokens = tokens.slice(j)),
  28166. j < len && toSelector(tokens)
  28167. );
  28168. }
  28169. matchers2.push(matcher);
  28170. }
  28171. }
  28172. return elementMatcher(matchers2);
  28173. }
  28174. function matcherFromGroupMatchers(elementMatchers, setMatchers) {
  28175. var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function(seed, context, xml, results, outermost) {
  28176. var elem, j, matcher, matchedCount = 0, i3 = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && Expr.find.TAG("*", outermost), dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1, len = elems.length;
  28177. if (outermost) {
  28178. outermostContext = context == document3 || context || outermost;
  28179. }
  28180. for (; i3 !== len && (elem = elems[i3]) != null; i3++) {
  28181. if (byElement && elem) {
  28182. j = 0;
  28183. if (!context && elem.ownerDocument != document3) {
  28184. setDocument(elem);
  28185. xml = !documentIsHTML;
  28186. }
  28187. while (matcher = elementMatchers[j++]) {
  28188. if (matcher(elem, context || document3, xml)) {
  28189. push2.call(results, elem);
  28190. break;
  28191. }
  28192. }
  28193. if (outermost) {
  28194. dirruns = dirrunsUnique;
  28195. }
  28196. }
  28197. if (bySet) {
  28198. if (elem = !matcher && elem) {
  28199. matchedCount--;
  28200. }
  28201. if (seed) {
  28202. unmatched.push(elem);
  28203. }
  28204. }
  28205. }
  28206. matchedCount += i3;
  28207. if (bySet && i3 !== matchedCount) {
  28208. j = 0;
  28209. while (matcher = setMatchers[j++]) {
  28210. matcher(unmatched, setMatched, context, xml);
  28211. }
  28212. if (seed) {
  28213. if (matchedCount > 0) {
  28214. while (i3--) {
  28215. if (!(unmatched[i3] || setMatched[i3])) {
  28216. setMatched[i3] = pop.call(results);
  28217. }
  28218. }
  28219. }
  28220. setMatched = condense(setMatched);
  28221. }
  28222. push2.apply(results, setMatched);
  28223. if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
  28224. jQuery.uniqueSort(results);
  28225. }
  28226. }
  28227. if (outermost) {
  28228. dirruns = dirrunsUnique;
  28229. outermostContext = contextBackup;
  28230. }
  28231. return unmatched;
  28232. };
  28233. return bySet ? markFunction(superMatcher) : superMatcher;
  28234. }
  28235. function compile(selector, match) {
  28236. var i3, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + " "];
  28237. if (!cached) {
  28238. if (!match) {
  28239. match = tokenize(selector);
  28240. }
  28241. i3 = match.length;
  28242. while (i3--) {
  28243. cached = matcherFromTokens(match[i3]);
  28244. if (cached[expando]) {
  28245. setMatchers.push(cached);
  28246. } else {
  28247. elementMatchers.push(cached);
  28248. }
  28249. }
  28250. cached = compilerCache(
  28251. selector,
  28252. matcherFromGroupMatchers(elementMatchers, setMatchers)
  28253. );
  28254. cached.selector = selector;
  28255. }
  28256. return cached;
  28257. }
  28258. function select(selector, context, results, seed) {
  28259. var i3, tokens, token, type2, find3, compiled = typeof selector === "function" && selector, match = !seed && tokenize(selector = compiled.selector || selector);
  28260. results = results || [];
  28261. if (match.length === 1) {
  28262. tokens = match[0] = match[0].slice(0);
  28263. if (tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {
  28264. context = (Expr.find.ID(
  28265. token.matches[0].replace(runescape, funescape),
  28266. context
  28267. ) || [])[0];
  28268. if (!context) {
  28269. return results;
  28270. } else if (compiled) {
  28271. context = context.parentNode;
  28272. }
  28273. selector = selector.slice(tokens.shift().value.length);
  28274. }
  28275. i3 = matchExpr.needsContext.test(selector) ? 0 : tokens.length;
  28276. while (i3--) {
  28277. token = tokens[i3];
  28278. if (Expr.relative[type2 = token.type]) {
  28279. break;
  28280. }
  28281. if (find3 = Expr.find[type2]) {
  28282. if (seed = find3(
  28283. token.matches[0].replace(runescape, funescape),
  28284. rsibling.test(tokens[0].type) && testContext(context.parentNode) || context
  28285. )) {
  28286. tokens.splice(i3, 1);
  28287. selector = seed.length && toSelector(tokens);
  28288. if (!selector) {
  28289. push2.apply(results, seed);
  28290. return results;
  28291. }
  28292. break;
  28293. }
  28294. }
  28295. }
  28296. }
  28297. (compiled || compile(selector, match))(
  28298. seed,
  28299. context,
  28300. !documentIsHTML,
  28301. results,
  28302. !context || rsibling.test(selector) && testContext(context.parentNode) || context
  28303. );
  28304. return results;
  28305. }
  28306. support.sortStable = expando.split("").sort(sortOrder).join("") === expando;
  28307. setDocument();
  28308. support.sortDetached = assert(function(el) {
  28309. return el.compareDocumentPosition(document3.createElement("fieldset")) & 1;
  28310. });
  28311. jQuery.find = find2;
  28312. jQuery.expr[":"] = jQuery.expr.pseudos;
  28313. jQuery.unique = jQuery.uniqueSort;
  28314. find2.compile = compile;
  28315. find2.select = select;
  28316. find2.setDocument = setDocument;
  28317. find2.escape = jQuery.escapeSelector;
  28318. find2.getText = jQuery.text;
  28319. find2.isXML = jQuery.isXMLDoc;
  28320. find2.selectors = jQuery.expr;
  28321. find2.support = jQuery.support;
  28322. find2.uniqueSort = jQuery.uniqueSort;
  28323. })();
  28324. var dir = function(elem, dir2, until) {
  28325. var matched = [], truncate = until !== void 0;
  28326. while ((elem = elem[dir2]) && elem.nodeType !== 9) {
  28327. if (elem.nodeType === 1) {
  28328. if (truncate && jQuery(elem).is(until)) {
  28329. break;
  28330. }
  28331. matched.push(elem);
  28332. }
  28333. }
  28334. return matched;
  28335. };
  28336. var siblings = function(n, elem) {
  28337. var matched = [];
  28338. for (; n; n = n.nextSibling) {
  28339. if (n.nodeType === 1 && n !== elem) {
  28340. matched.push(n);
  28341. }
  28342. }
  28343. return matched;
  28344. };
  28345. var rneedsContext = jQuery.expr.match.needsContext;
  28346. var rsingleTag = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;
  28347. function winnow(elements, qualifier, not) {
  28348. if (isFunction2(qualifier)) {
  28349. return jQuery.grep(elements, function(elem, i2) {
  28350. return !!qualifier.call(elem, i2, elem) !== not;
  28351. });
  28352. }
  28353. if (qualifier.nodeType) {
  28354. return jQuery.grep(elements, function(elem) {
  28355. return elem === qualifier !== not;
  28356. });
  28357. }
  28358. if (typeof qualifier !== "string") {
  28359. return jQuery.grep(elements, function(elem) {
  28360. return indexOf.call(qualifier, elem) > -1 !== not;
  28361. });
  28362. }
  28363. return jQuery.filter(qualifier, elements, not);
  28364. }
  28365. jQuery.filter = function(expr, elems, not) {
  28366. var elem = elems[0];
  28367. if (not) {
  28368. expr = ":not(" + expr + ")";
  28369. }
  28370. if (elems.length === 1 && elem.nodeType === 1) {
  28371. return jQuery.find.matchesSelector(elem, expr) ? [elem] : [];
  28372. }
  28373. return jQuery.find.matches(expr, jQuery.grep(elems, function(elem2) {
  28374. return elem2.nodeType === 1;
  28375. }));
  28376. };
  28377. jQuery.fn.extend({
  28378. find: function(selector) {
  28379. var i2, ret, len = this.length, self2 = this;
  28380. if (typeof selector !== "string") {
  28381. return this.pushStack(jQuery(selector).filter(function() {
  28382. for (i2 = 0; i2 < len; i2++) {
  28383. if (jQuery.contains(self2[i2], this)) {
  28384. return true;
  28385. }
  28386. }
  28387. }));
  28388. }
  28389. ret = this.pushStack([]);
  28390. for (i2 = 0; i2 < len; i2++) {
  28391. jQuery.find(selector, self2[i2], ret);
  28392. }
  28393. return len > 1 ? jQuery.uniqueSort(ret) : ret;
  28394. },
  28395. filter: function(selector) {
  28396. return this.pushStack(winnow(this, selector || [], false));
  28397. },
  28398. not: function(selector) {
  28399. return this.pushStack(winnow(this, selector || [], true));
  28400. },
  28401. is: function(selector) {
  28402. return !!winnow(
  28403. this,
  28404. typeof selector === "string" && rneedsContext.test(selector) ? jQuery(selector) : selector || [],
  28405. false
  28406. ).length;
  28407. }
  28408. });
  28409. var rootjQuery, rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, init = jQuery.fn.init = function(selector, context, root2) {
  28410. var match, elem;
  28411. if (!selector) {
  28412. return this;
  28413. }
  28414. root2 = root2 || rootjQuery;
  28415. if (typeof selector === "string") {
  28416. if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) {
  28417. match = [null, selector, null];
  28418. } else {
  28419. match = rquickExpr.exec(selector);
  28420. }
  28421. if (match && (match[1] || !context)) {
  28422. if (match[1]) {
  28423. context = context instanceof jQuery ? context[0] : context;
  28424. jQuery.merge(this, jQuery.parseHTML(
  28425. match[1],
  28426. context && context.nodeType ? context.ownerDocument || context : document2,
  28427. true
  28428. ));
  28429. if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
  28430. for (match in context) {
  28431. if (isFunction2(this[match])) {
  28432. this[match](context[match]);
  28433. } else {
  28434. this.attr(match, context[match]);
  28435. }
  28436. }
  28437. }
  28438. return this;
  28439. } else {
  28440. elem = document2.getElementById(match[2]);
  28441. if (elem) {
  28442. this[0] = elem;
  28443. this.length = 1;
  28444. }
  28445. return this;
  28446. }
  28447. } else if (!context || context.jquery) {
  28448. return (context || root2).find(selector);
  28449. } else {
  28450. return this.constructor(context).find(selector);
  28451. }
  28452. } else if (selector.nodeType) {
  28453. this[0] = selector;
  28454. this.length = 1;
  28455. return this;
  28456. } else if (isFunction2(selector)) {
  28457. return root2.ready !== void 0 ? root2.ready(selector) : selector(jQuery);
  28458. }
  28459. return jQuery.makeArray(selector, this);
  28460. };
  28461. init.prototype = jQuery.fn;
  28462. rootjQuery = jQuery(document2);
  28463. var rparentsprev = /^(?:parents|prev(?:Until|All))/, guaranteedUnique = {
  28464. children: true,
  28465. contents: true,
  28466. next: true,
  28467. prev: true
  28468. };
  28469. jQuery.fn.extend({
  28470. has: function(target) {
  28471. var targets = jQuery(target, this), l = targets.length;
  28472. return this.filter(function() {
  28473. var i2 = 0;
  28474. for (; i2 < l; i2++) {
  28475. if (jQuery.contains(this, targets[i2])) {
  28476. return true;
  28477. }
  28478. }
  28479. });
  28480. },
  28481. closest: function(selectors, context) {
  28482. var cur, i2 = 0, l = this.length, matched = [], targets = typeof selectors !== "string" && jQuery(selectors);
  28483. if (!rneedsContext.test(selectors)) {
  28484. for (; i2 < l; i2++) {
  28485. for (cur = this[i2]; cur && cur !== context; cur = cur.parentNode) {
  28486. if (cur.nodeType < 11 && (targets ? targets.index(cur) > -1 : cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors))) {
  28487. matched.push(cur);
  28488. break;
  28489. }
  28490. }
  28491. }
  28492. }
  28493. return this.pushStack(matched.length > 1 ? jQuery.uniqueSort(matched) : matched);
  28494. },
  28495. index: function(elem) {
  28496. if (!elem) {
  28497. return this[0] && this[0].parentNode ? this.first().prevAll().length : -1;
  28498. }
  28499. if (typeof elem === "string") {
  28500. return indexOf.call(jQuery(elem), this[0]);
  28501. }
  28502. return indexOf.call(
  28503. this,
  28504. elem.jquery ? elem[0] : elem
  28505. );
  28506. },
  28507. add: function(selector, context) {
  28508. return this.pushStack(
  28509. jQuery.uniqueSort(
  28510. jQuery.merge(this.get(), jQuery(selector, context))
  28511. )
  28512. );
  28513. },
  28514. addBack: function(selector) {
  28515. return this.add(
  28516. selector == null ? this.prevObject : this.prevObject.filter(selector)
  28517. );
  28518. }
  28519. });
  28520. function sibling(cur, dir2) {
  28521. while ((cur = cur[dir2]) && cur.nodeType !== 1) {
  28522. }
  28523. return cur;
  28524. }
  28525. jQuery.each({
  28526. parent: function(elem) {
  28527. var parent = elem.parentNode;
  28528. return parent && parent.nodeType !== 11 ? parent : null;
  28529. },
  28530. parents: function(elem) {
  28531. return dir(elem, "parentNode");
  28532. },
  28533. parentsUntil: function(elem, _i, until) {
  28534. return dir(elem, "parentNode", until);
  28535. },
  28536. next: function(elem) {
  28537. return sibling(elem, "nextSibling");
  28538. },
  28539. prev: function(elem) {
  28540. return sibling(elem, "previousSibling");
  28541. },
  28542. nextAll: function(elem) {
  28543. return dir(elem, "nextSibling");
  28544. },
  28545. prevAll: function(elem) {
  28546. return dir(elem, "previousSibling");
  28547. },
  28548. nextUntil: function(elem, _i, until) {
  28549. return dir(elem, "nextSibling", until);
  28550. },
  28551. prevUntil: function(elem, _i, until) {
  28552. return dir(elem, "previousSibling", until);
  28553. },
  28554. siblings: function(elem) {
  28555. return siblings((elem.parentNode || {}).firstChild, elem);
  28556. },
  28557. children: function(elem) {
  28558. return siblings(elem.firstChild);
  28559. },
  28560. contents: function(elem) {
  28561. if (elem.contentDocument != null && getProto(elem.contentDocument)) {
  28562. return elem.contentDocument;
  28563. }
  28564. if (nodeName(elem, "template")) {
  28565. elem = elem.content || elem;
  28566. }
  28567. return jQuery.merge([], elem.childNodes);
  28568. }
  28569. }, function(name, fn2) {
  28570. jQuery.fn[name] = function(until, selector) {
  28571. var matched = jQuery.map(this, fn2, until);
  28572. if (name.slice(-5) !== "Until") {
  28573. selector = until;
  28574. }
  28575. if (selector && typeof selector === "string") {
  28576. matched = jQuery.filter(selector, matched);
  28577. }
  28578. if (this.length > 1) {
  28579. if (!guaranteedUnique[name]) {
  28580. jQuery.uniqueSort(matched);
  28581. }
  28582. if (rparentsprev.test(name)) {
  28583. matched.reverse();
  28584. }
  28585. }
  28586. return this.pushStack(matched);
  28587. };
  28588. });
  28589. var rnothtmlwhite = /[^\x20\t\r\n\f]+/g;
  28590. function createOptions(options2) {
  28591. var object = {};
  28592. jQuery.each(options2.match(rnothtmlwhite) || [], function(_, flag) {
  28593. object[flag] = true;
  28594. });
  28595. return object;
  28596. }
  28597. jQuery.Callbacks = function(options2) {
  28598. options2 = typeof options2 === "string" ? createOptions(options2) : jQuery.extend({}, options2);
  28599. var firing, memory, fired, locked, list = [], queue = [], firingIndex = -1, fire = function() {
  28600. locked = locked || options2.once;
  28601. fired = firing = true;
  28602. for (; queue.length; firingIndex = -1) {
  28603. memory = queue.shift();
  28604. while (++firingIndex < list.length) {
  28605. if (list[firingIndex].apply(memory[0], memory[1]) === false && options2.stopOnFalse) {
  28606. firingIndex = list.length;
  28607. memory = false;
  28608. }
  28609. }
  28610. }
  28611. if (!options2.memory) {
  28612. memory = false;
  28613. }
  28614. firing = false;
  28615. if (locked) {
  28616. if (memory) {
  28617. list = [];
  28618. } else {
  28619. list = "";
  28620. }
  28621. }
  28622. }, self2 = {
  28623. add: function() {
  28624. if (list) {
  28625. if (memory && !firing) {
  28626. firingIndex = list.length - 1;
  28627. queue.push(memory);
  28628. }
  28629. (function add(args) {
  28630. jQuery.each(args, function(_, arg) {
  28631. if (isFunction2(arg)) {
  28632. if (!options2.unique || !self2.has(arg)) {
  28633. list.push(arg);
  28634. }
  28635. } else if (arg && arg.length && toType(arg) !== "string") {
  28636. add(arg);
  28637. }
  28638. });
  28639. })(arguments);
  28640. if (memory && !firing) {
  28641. fire();
  28642. }
  28643. }
  28644. return this;
  28645. },
  28646. remove: function() {
  28647. jQuery.each(arguments, function(_, arg) {
  28648. var index2;
  28649. while ((index2 = jQuery.inArray(arg, list, index2)) > -1) {
  28650. list.splice(index2, 1);
  28651. if (index2 <= firingIndex) {
  28652. firingIndex--;
  28653. }
  28654. }
  28655. });
  28656. return this;
  28657. },
  28658. has: function(fn2) {
  28659. return fn2 ? jQuery.inArray(fn2, list) > -1 : list.length > 0;
  28660. },
  28661. empty: function() {
  28662. if (list) {
  28663. list = [];
  28664. }
  28665. return this;
  28666. },
  28667. disable: function() {
  28668. locked = queue = [];
  28669. list = memory = "";
  28670. return this;
  28671. },
  28672. disabled: function() {
  28673. return !list;
  28674. },
  28675. lock: function() {
  28676. locked = queue = [];
  28677. if (!memory && !firing) {
  28678. list = memory = "";
  28679. }
  28680. return this;
  28681. },
  28682. locked: function() {
  28683. return !!locked;
  28684. },
  28685. fireWith: function(context, args) {
  28686. if (!locked) {
  28687. args = args || [];
  28688. args = [context, args.slice ? args.slice() : args];
  28689. queue.push(args);
  28690. if (!firing) {
  28691. fire();
  28692. }
  28693. }
  28694. return this;
  28695. },
  28696. fire: function() {
  28697. self2.fireWith(this, arguments);
  28698. return this;
  28699. },
  28700. fired: function() {
  28701. return !!fired;
  28702. }
  28703. };
  28704. return self2;
  28705. };
  28706. function Identity(v) {
  28707. return v;
  28708. }
  28709. function Thrower(ex) {
  28710. throw ex;
  28711. }
  28712. function adoptValue(value, resolve2, reject2, noValue) {
  28713. var method;
  28714. try {
  28715. if (value && isFunction2(method = value.promise)) {
  28716. method.call(value).done(resolve2).fail(reject2);
  28717. } else if (value && isFunction2(method = value.then)) {
  28718. method.call(value, resolve2, reject2);
  28719. } else {
  28720. resolve2.apply(void 0, [value].slice(noValue));
  28721. }
  28722. } catch (value2) {
  28723. reject2.apply(void 0, [value2]);
  28724. }
  28725. }
  28726. jQuery.extend({
  28727. Deferred: function(func) {
  28728. var tuples = [
  28729. [
  28730. "notify",
  28731. "progress",
  28732. jQuery.Callbacks("memory"),
  28733. jQuery.Callbacks("memory"),
  28734. 2
  28735. ],
  28736. [
  28737. "resolve",
  28738. "done",
  28739. jQuery.Callbacks("once memory"),
  28740. jQuery.Callbacks("once memory"),
  28741. 0,
  28742. "resolved"
  28743. ],
  28744. [
  28745. "reject",
  28746. "fail",
  28747. jQuery.Callbacks("once memory"),
  28748. jQuery.Callbacks("once memory"),
  28749. 1,
  28750. "rejected"
  28751. ]
  28752. ], state = "pending", promise = {
  28753. state: function() {
  28754. return state;
  28755. },
  28756. always: function() {
  28757. deferred.done(arguments).fail(arguments);
  28758. return this;
  28759. },
  28760. "catch": function(fn2) {
  28761. return promise.then(null, fn2);
  28762. },
  28763. pipe: function() {
  28764. var fns = arguments;
  28765. return jQuery.Deferred(function(newDefer) {
  28766. jQuery.each(tuples, function(_i, tuple2) {
  28767. var fn2 = isFunction2(fns[tuple2[4]]) && fns[tuple2[4]];
  28768. deferred[tuple2[1]](function() {
  28769. var returned = fn2 && fn2.apply(this, arguments);
  28770. if (returned && isFunction2(returned.promise)) {
  28771. returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);
  28772. } else {
  28773. newDefer[tuple2[0] + "With"](
  28774. this,
  28775. fn2 ? [returned] : arguments
  28776. );
  28777. }
  28778. });
  28779. });
  28780. fns = null;
  28781. }).promise();
  28782. },
  28783. then: function(onFulfilled, onRejected, onProgress) {
  28784. var maxDepth = 0;
  28785. function resolve2(depth, deferred2, handler, special) {
  28786. return function() {
  28787. var that = this, args = arguments, mightThrow = function() {
  28788. var returned, then;
  28789. if (depth < maxDepth) {
  28790. return;
  28791. }
  28792. returned = handler.apply(that, args);
  28793. if (returned === deferred2.promise()) {
  28794. throw new TypeError("Thenable self-resolution");
  28795. }
  28796. then = returned && (typeof returned === "object" || typeof returned === "function") && returned.then;
  28797. if (isFunction2(then)) {
  28798. if (special) {
  28799. then.call(
  28800. returned,
  28801. resolve2(maxDepth, deferred2, Identity, special),
  28802. resolve2(maxDepth, deferred2, Thrower, special)
  28803. );
  28804. } else {
  28805. maxDepth++;
  28806. then.call(
  28807. returned,
  28808. resolve2(maxDepth, deferred2, Identity, special),
  28809. resolve2(maxDepth, deferred2, Thrower, special),
  28810. resolve2(
  28811. maxDepth,
  28812. deferred2,
  28813. Identity,
  28814. deferred2.notifyWith
  28815. )
  28816. );
  28817. }
  28818. } else {
  28819. if (handler !== Identity) {
  28820. that = void 0;
  28821. args = [returned];
  28822. }
  28823. (special || deferred2.resolveWith)(that, args);
  28824. }
  28825. }, process2 = special ? mightThrow : function() {
  28826. try {
  28827. mightThrow();
  28828. } catch (e) {
  28829. if (jQuery.Deferred.exceptionHook) {
  28830. jQuery.Deferred.exceptionHook(
  28831. e,
  28832. process2.error
  28833. );
  28834. }
  28835. if (depth + 1 >= maxDepth) {
  28836. if (handler !== Thrower) {
  28837. that = void 0;
  28838. args = [e];
  28839. }
  28840. deferred2.rejectWith(that, args);
  28841. }
  28842. }
  28843. };
  28844. if (depth) {
  28845. process2();
  28846. } else {
  28847. if (jQuery.Deferred.getErrorHook) {
  28848. process2.error = jQuery.Deferred.getErrorHook();
  28849. } else if (jQuery.Deferred.getStackHook) {
  28850. process2.error = jQuery.Deferred.getStackHook();
  28851. }
  28852. window2.setTimeout(process2);
  28853. }
  28854. };
  28855. }
  28856. return jQuery.Deferred(function(newDefer) {
  28857. tuples[0][3].add(
  28858. resolve2(
  28859. 0,
  28860. newDefer,
  28861. isFunction2(onProgress) ? onProgress : Identity,
  28862. newDefer.notifyWith
  28863. )
  28864. );
  28865. tuples[1][3].add(
  28866. resolve2(
  28867. 0,
  28868. newDefer,
  28869. isFunction2(onFulfilled) ? onFulfilled : Identity
  28870. )
  28871. );
  28872. tuples[2][3].add(
  28873. resolve2(
  28874. 0,
  28875. newDefer,
  28876. isFunction2(onRejected) ? onRejected : Thrower
  28877. )
  28878. );
  28879. }).promise();
  28880. },
  28881. promise: function(obj) {
  28882. return obj != null ? jQuery.extend(obj, promise) : promise;
  28883. }
  28884. }, deferred = {};
  28885. jQuery.each(tuples, function(i2, tuple2) {
  28886. var list = tuple2[2], stateString = tuple2[5];
  28887. promise[tuple2[1]] = list.add;
  28888. if (stateString) {
  28889. list.add(
  28890. function() {
  28891. state = stateString;
  28892. },
  28893. tuples[3 - i2][2].disable,
  28894. tuples[3 - i2][3].disable,
  28895. tuples[0][2].lock,
  28896. tuples[0][3].lock
  28897. );
  28898. }
  28899. list.add(tuple2[3].fire);
  28900. deferred[tuple2[0]] = function() {
  28901. deferred[tuple2[0] + "With"](this === deferred ? void 0 : this, arguments);
  28902. return this;
  28903. };
  28904. deferred[tuple2[0] + "With"] = list.fireWith;
  28905. });
  28906. promise.promise(deferred);
  28907. if (func) {
  28908. func.call(deferred, deferred);
  28909. }
  28910. return deferred;
  28911. },
  28912. when: function(singleValue) {
  28913. var remaining = arguments.length, i2 = remaining, resolveContexts = Array(i2), resolveValues = slice.call(arguments), primary = jQuery.Deferred(), updateFunc = function(i3) {
  28914. return function(value) {
  28915. resolveContexts[i3] = this;
  28916. resolveValues[i3] = arguments.length > 1 ? slice.call(arguments) : value;
  28917. if (!--remaining) {
  28918. primary.resolveWith(resolveContexts, resolveValues);
  28919. }
  28920. };
  28921. };
  28922. if (remaining <= 1) {
  28923. adoptValue(
  28924. singleValue,
  28925. primary.done(updateFunc(i2)).resolve,
  28926. primary.reject,
  28927. !remaining
  28928. );
  28929. if (primary.state() === "pending" || isFunction2(resolveValues[i2] && resolveValues[i2].then)) {
  28930. return primary.then();
  28931. }
  28932. }
  28933. while (i2--) {
  28934. adoptValue(resolveValues[i2], updateFunc(i2), primary.reject);
  28935. }
  28936. return primary.promise();
  28937. }
  28938. });
  28939. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  28940. jQuery.Deferred.exceptionHook = function(error, asyncError) {
  28941. if (window2.console && window2.console.warn && error && rerrorNames.test(error.name)) {
  28942. window2.console.warn(
  28943. "jQuery.Deferred exception: " + error.message,
  28944. error.stack,
  28945. asyncError
  28946. );
  28947. }
  28948. };
  28949. jQuery.readyException = function(error) {
  28950. window2.setTimeout(function() {
  28951. throw error;
  28952. });
  28953. };
  28954. var readyList = jQuery.Deferred();
  28955. jQuery.fn.ready = function(fn2) {
  28956. readyList.then(fn2).catch(function(error) {
  28957. jQuery.readyException(error);
  28958. });
  28959. return this;
  28960. };
  28961. jQuery.extend({
  28962. isReady: false,
  28963. readyWait: 1,
  28964. ready: function(wait) {
  28965. if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
  28966. return;
  28967. }
  28968. jQuery.isReady = true;
  28969. if (wait !== true && --jQuery.readyWait > 0) {
  28970. return;
  28971. }
  28972. readyList.resolveWith(document2, [jQuery]);
  28973. }
  28974. });
  28975. jQuery.ready.then = readyList.then;
  28976. function completed() {
  28977. document2.removeEventListener("DOMContentLoaded", completed);
  28978. window2.removeEventListener("load", completed);
  28979. jQuery.ready();
  28980. }
  28981. if (document2.readyState === "complete" || document2.readyState !== "loading" && !document2.documentElement.doScroll) {
  28982. window2.setTimeout(jQuery.ready);
  28983. } else {
  28984. document2.addEventListener("DOMContentLoaded", completed);
  28985. window2.addEventListener("load", completed);
  28986. }
  28987. var access = function(elems, fn2, key, value, chainable, emptyGet, raw) {
  28988. var i2 = 0, len = elems.length, bulk = key == null;
  28989. if (toType(key) === "object") {
  28990. chainable = true;
  28991. for (i2 in key) {
  28992. access(elems, fn2, i2, key[i2], true, emptyGet, raw);
  28993. }
  28994. } else if (value !== void 0) {
  28995. chainable = true;
  28996. if (!isFunction2(value)) {
  28997. raw = true;
  28998. }
  28999. if (bulk) {
  29000. if (raw) {
  29001. fn2.call(elems, value);
  29002. fn2 = null;
  29003. } else {
  29004. bulk = fn2;
  29005. fn2 = function(elem, _key, value2) {
  29006. return bulk.call(jQuery(elem), value2);
  29007. };
  29008. }
  29009. }
  29010. if (fn2) {
  29011. for (; i2 < len; i2++) {
  29012. fn2(
  29013. elems[i2],
  29014. key,
  29015. raw ? value : value.call(elems[i2], i2, fn2(elems[i2], key))
  29016. );
  29017. }
  29018. }
  29019. }
  29020. if (chainable) {
  29021. return elems;
  29022. }
  29023. if (bulk) {
  29024. return fn2.call(elems);
  29025. }
  29026. return len ? fn2(elems[0], key) : emptyGet;
  29027. };
  29028. var rmsPrefix = /^-ms-/, rdashAlpha = /-([a-z])/g;
  29029. function fcamelCase(_all, letter) {
  29030. return letter.toUpperCase();
  29031. }
  29032. function camelCase3(string) {
  29033. return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
  29034. }
  29035. var acceptData = function(owner) {
  29036. return owner.nodeType === 1 || owner.nodeType === 9 || !+owner.nodeType;
  29037. };
  29038. function Data() {
  29039. this.expando = jQuery.expando + Data.uid++;
  29040. }
  29041. Data.uid = 1;
  29042. Data.prototype = {
  29043. cache: function(owner) {
  29044. var value = owner[this.expando];
  29045. if (!value) {
  29046. value = {};
  29047. if (acceptData(owner)) {
  29048. if (owner.nodeType) {
  29049. owner[this.expando] = value;
  29050. } else {
  29051. Object.defineProperty(owner, this.expando, {
  29052. value,
  29053. configurable: true
  29054. });
  29055. }
  29056. }
  29057. }
  29058. return value;
  29059. },
  29060. set: function(owner, data, value) {
  29061. var prop, cache = this.cache(owner);
  29062. if (typeof data === "string") {
  29063. cache[camelCase3(data)] = value;
  29064. } else {
  29065. for (prop in data) {
  29066. cache[camelCase3(prop)] = data[prop];
  29067. }
  29068. }
  29069. return cache;
  29070. },
  29071. get: function(owner, key) {
  29072. return key === void 0 ? this.cache(owner) : owner[this.expando] && owner[this.expando][camelCase3(key)];
  29073. },
  29074. access: function(owner, key, value) {
  29075. if (key === void 0 || key && typeof key === "string" && value === void 0) {
  29076. return this.get(owner, key);
  29077. }
  29078. this.set(owner, key, value);
  29079. return value !== void 0 ? value : key;
  29080. },
  29081. remove: function(owner, key) {
  29082. var i2, cache = owner[this.expando];
  29083. if (cache === void 0) {
  29084. return;
  29085. }
  29086. if (key !== void 0) {
  29087. if (Array.isArray(key)) {
  29088. key = key.map(camelCase3);
  29089. } else {
  29090. key = camelCase3(key);
  29091. key = key in cache ? [key] : key.match(rnothtmlwhite) || [];
  29092. }
  29093. i2 = key.length;
  29094. while (i2--) {
  29095. delete cache[key[i2]];
  29096. }
  29097. }
  29098. if (key === void 0 || jQuery.isEmptyObject(cache)) {
  29099. if (owner.nodeType) {
  29100. owner[this.expando] = void 0;
  29101. } else {
  29102. delete owner[this.expando];
  29103. }
  29104. }
  29105. },
  29106. hasData: function(owner) {
  29107. var cache = owner[this.expando];
  29108. return cache !== void 0 && !jQuery.isEmptyObject(cache);
  29109. }
  29110. };
  29111. var dataPriv = new Data();
  29112. var dataUser = new Data();
  29113. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /[A-Z]/g;
  29114. function getData(data) {
  29115. if (data === "true") {
  29116. return true;
  29117. }
  29118. if (data === "false") {
  29119. return false;
  29120. }
  29121. if (data === "null") {
  29122. return null;
  29123. }
  29124. if (data === +data + "") {
  29125. return +data;
  29126. }
  29127. if (rbrace.test(data)) {
  29128. return JSON.parse(data);
  29129. }
  29130. return data;
  29131. }
  29132. function dataAttr(elem, key, data) {
  29133. var name;
  29134. if (data === void 0 && elem.nodeType === 1) {
  29135. name = "data-" + key.replace(rmultiDash, "-$&").toLowerCase();
  29136. data = elem.getAttribute(name);
  29137. if (typeof data === "string") {
  29138. try {
  29139. data = getData(data);
  29140. } catch (e) {
  29141. }
  29142. dataUser.set(elem, key, data);
  29143. } else {
  29144. data = void 0;
  29145. }
  29146. }
  29147. return data;
  29148. }
  29149. jQuery.extend({
  29150. hasData: function(elem) {
  29151. return dataUser.hasData(elem) || dataPriv.hasData(elem);
  29152. },
  29153. data: function(elem, name, data) {
  29154. return dataUser.access(elem, name, data);
  29155. },
  29156. removeData: function(elem, name) {
  29157. dataUser.remove(elem, name);
  29158. },
  29159. _data: function(elem, name, data) {
  29160. return dataPriv.access(elem, name, data);
  29161. },
  29162. _removeData: function(elem, name) {
  29163. dataPriv.remove(elem, name);
  29164. }
  29165. });
  29166. jQuery.fn.extend({
  29167. data: function(key, value) {
  29168. var i2, name, data, elem = this[0], attrs = elem && elem.attributes;
  29169. if (key === void 0) {
  29170. if (this.length) {
  29171. data = dataUser.get(elem);
  29172. if (elem.nodeType === 1 && !dataPriv.get(elem, "hasDataAttrs")) {
  29173. i2 = attrs.length;
  29174. while (i2--) {
  29175. if (attrs[i2]) {
  29176. name = attrs[i2].name;
  29177. if (name.indexOf("data-") === 0) {
  29178. name = camelCase3(name.slice(5));
  29179. dataAttr(elem, name, data[name]);
  29180. }
  29181. }
  29182. }
  29183. dataPriv.set(elem, "hasDataAttrs", true);
  29184. }
  29185. }
  29186. return data;
  29187. }
  29188. if (typeof key === "object") {
  29189. return this.each(function() {
  29190. dataUser.set(this, key);
  29191. });
  29192. }
  29193. return access(this, function(value2) {
  29194. var data2;
  29195. if (elem && value2 === void 0) {
  29196. data2 = dataUser.get(elem, key);
  29197. if (data2 !== void 0) {
  29198. return data2;
  29199. }
  29200. data2 = dataAttr(elem, key);
  29201. if (data2 !== void 0) {
  29202. return data2;
  29203. }
  29204. return;
  29205. }
  29206. this.each(function() {
  29207. dataUser.set(this, key, value2);
  29208. });
  29209. }, null, value, arguments.length > 1, null, true);
  29210. },
  29211. removeData: function(key) {
  29212. return this.each(function() {
  29213. dataUser.remove(this, key);
  29214. });
  29215. }
  29216. });
  29217. jQuery.extend({
  29218. queue: function(elem, type2, data) {
  29219. var queue;
  29220. if (elem) {
  29221. type2 = (type2 || "fx") + "queue";
  29222. queue = dataPriv.get(elem, type2);
  29223. if (data) {
  29224. if (!queue || Array.isArray(data)) {
  29225. queue = dataPriv.access(elem, type2, jQuery.makeArray(data));
  29226. } else {
  29227. queue.push(data);
  29228. }
  29229. }
  29230. return queue || [];
  29231. }
  29232. },
  29233. dequeue: function(elem, type2) {
  29234. type2 = type2 || "fx";
  29235. var queue = jQuery.queue(elem, type2), startLength = queue.length, fn2 = queue.shift(), hooks3 = jQuery._queueHooks(elem, type2), next = function() {
  29236. jQuery.dequeue(elem, type2);
  29237. };
  29238. if (fn2 === "inprogress") {
  29239. fn2 = queue.shift();
  29240. startLength--;
  29241. }
  29242. if (fn2) {
  29243. if (type2 === "fx") {
  29244. queue.unshift("inprogress");
  29245. }
  29246. delete hooks3.stop;
  29247. fn2.call(elem, next, hooks3);
  29248. }
  29249. if (!startLength && hooks3) {
  29250. hooks3.empty.fire();
  29251. }
  29252. },
  29253. _queueHooks: function(elem, type2) {
  29254. var key = type2 + "queueHooks";
  29255. return dataPriv.get(elem, key) || dataPriv.access(elem, key, {
  29256. empty: jQuery.Callbacks("once memory").add(function() {
  29257. dataPriv.remove(elem, [type2 + "queue", key]);
  29258. })
  29259. });
  29260. }
  29261. });
  29262. jQuery.fn.extend({
  29263. queue: function(type2, data) {
  29264. var setter = 2;
  29265. if (typeof type2 !== "string") {
  29266. data = type2;
  29267. type2 = "fx";
  29268. setter--;
  29269. }
  29270. if (arguments.length < setter) {
  29271. return jQuery.queue(this[0], type2);
  29272. }
  29273. return data === void 0 ? this : this.each(function() {
  29274. var queue = jQuery.queue(this, type2, data);
  29275. jQuery._queueHooks(this, type2);
  29276. if (type2 === "fx" && queue[0] !== "inprogress") {
  29277. jQuery.dequeue(this, type2);
  29278. }
  29279. });
  29280. },
  29281. dequeue: function(type2) {
  29282. return this.each(function() {
  29283. jQuery.dequeue(this, type2);
  29284. });
  29285. },
  29286. clearQueue: function(type2) {
  29287. return this.queue(type2 || "fx", []);
  29288. },
  29289. promise: function(type2, obj) {
  29290. var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i2 = this.length, resolve2 = function() {
  29291. if (!--count) {
  29292. defer.resolveWith(elements, [elements]);
  29293. }
  29294. };
  29295. if (typeof type2 !== "string") {
  29296. obj = type2;
  29297. type2 = void 0;
  29298. }
  29299. type2 = type2 || "fx";
  29300. while (i2--) {
  29301. tmp = dataPriv.get(elements[i2], type2 + "queueHooks");
  29302. if (tmp && tmp.empty) {
  29303. count++;
  29304. tmp.empty.add(resolve2);
  29305. }
  29306. }
  29307. resolve2();
  29308. return defer.promise(obj);
  29309. }
  29310. });
  29311. var pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;
  29312. var rcssNum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i");
  29313. var cssExpand = ["Top", "Right", "Bottom", "Left"];
  29314. var documentElement = document2.documentElement;
  29315. var isAttached = function(elem) {
  29316. return jQuery.contains(elem.ownerDocument, elem);
  29317. }, composed = { composed: true };
  29318. if (documentElement.getRootNode) {
  29319. isAttached = function(elem) {
  29320. return jQuery.contains(elem.ownerDocument, elem) || elem.getRootNode(composed) === elem.ownerDocument;
  29321. };
  29322. }
  29323. var isHiddenWithinTree = function(elem, el) {
  29324. elem = el || elem;
  29325. return elem.style.display === "none" || elem.style.display === "" && isAttached(elem) && jQuery.css(elem, "display") === "none";
  29326. };
  29327. function adjustCSS(elem, prop, valueParts, tween) {
  29328. var adjusted, scale, maxIterations = 20, currentValue = tween ? function() {
  29329. return tween.cur();
  29330. } : function() {
  29331. return jQuery.css(elem, prop, "");
  29332. }, initial = currentValue(), unit = valueParts && valueParts[3] || (jQuery.cssNumber[prop] ? "" : "px"), initialInUnit = elem.nodeType && (jQuery.cssNumber[prop] || unit !== "px" && +initial) && rcssNum.exec(jQuery.css(elem, prop));
  29333. if (initialInUnit && initialInUnit[3] !== unit) {
  29334. initial = initial / 2;
  29335. unit = unit || initialInUnit[3];
  29336. initialInUnit = +initial || 1;
  29337. while (maxIterations--) {
  29338. jQuery.style(elem, prop, initialInUnit + unit);
  29339. if ((1 - scale) * (1 - (scale = currentValue() / initial || 0.5)) <= 0) {
  29340. maxIterations = 0;
  29341. }
  29342. initialInUnit = initialInUnit / scale;
  29343. }
  29344. initialInUnit = initialInUnit * 2;
  29345. jQuery.style(elem, prop, initialInUnit + unit);
  29346. valueParts = valueParts || [];
  29347. }
  29348. if (valueParts) {
  29349. initialInUnit = +initialInUnit || +initial || 0;
  29350. adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2];
  29351. if (tween) {
  29352. tween.unit = unit;
  29353. tween.start = initialInUnit;
  29354. tween.end = adjusted;
  29355. }
  29356. }
  29357. return adjusted;
  29358. }
  29359. var defaultDisplayMap = {};
  29360. function getDefaultDisplay(elem) {
  29361. var temp, doc = elem.ownerDocument, nodeName2 = elem.nodeName, display = defaultDisplayMap[nodeName2];
  29362. if (display) {
  29363. return display;
  29364. }
  29365. temp = doc.body.appendChild(doc.createElement(nodeName2));
  29366. display = jQuery.css(temp, "display");
  29367. temp.parentNode.removeChild(temp);
  29368. if (display === "none") {
  29369. display = "block";
  29370. }
  29371. defaultDisplayMap[nodeName2] = display;
  29372. return display;
  29373. }
  29374. function showHide(elements, show) {
  29375. var display, elem, values3 = [], index2 = 0, length = elements.length;
  29376. for (; index2 < length; index2++) {
  29377. elem = elements[index2];
  29378. if (!elem.style) {
  29379. continue;
  29380. }
  29381. display = elem.style.display;
  29382. if (show) {
  29383. if (display === "none") {
  29384. values3[index2] = dataPriv.get(elem, "display") || null;
  29385. if (!values3[index2]) {
  29386. elem.style.display = "";
  29387. }
  29388. }
  29389. if (elem.style.display === "" && isHiddenWithinTree(elem)) {
  29390. values3[index2] = getDefaultDisplay(elem);
  29391. }
  29392. } else {
  29393. if (display !== "none") {
  29394. values3[index2] = "none";
  29395. dataPriv.set(elem, "display", display);
  29396. }
  29397. }
  29398. }
  29399. for (index2 = 0; index2 < length; index2++) {
  29400. if (values3[index2] != null) {
  29401. elements[index2].style.display = values3[index2];
  29402. }
  29403. }
  29404. return elements;
  29405. }
  29406. jQuery.fn.extend({
  29407. show: function() {
  29408. return showHide(this, true);
  29409. },
  29410. hide: function() {
  29411. return showHide(this);
  29412. },
  29413. toggle: function(state) {
  29414. if (typeof state === "boolean") {
  29415. return state ? this.show() : this.hide();
  29416. }
  29417. return this.each(function() {
  29418. if (isHiddenWithinTree(this)) {
  29419. jQuery(this).show();
  29420. } else {
  29421. jQuery(this).hide();
  29422. }
  29423. });
  29424. }
  29425. });
  29426. var rcheckableType = /^(?:checkbox|radio)$/i;
  29427. var rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i;
  29428. var rscriptType = /^$|^module$|\/(?:java|ecma)script/i;
  29429. (function() {
  29430. var fragment = document2.createDocumentFragment(), div = fragment.appendChild(document2.createElement("div")), input = document2.createElement("input");
  29431. input.setAttribute("type", "radio");
  29432. input.setAttribute("checked", "checked");
  29433. input.setAttribute("name", "t");
  29434. div.appendChild(input);
  29435. support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;
  29436. div.innerHTML = "<textarea>x</textarea>";
  29437. support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;
  29438. div.innerHTML = "<option></option>";
  29439. support.option = !!div.lastChild;
  29440. })();
  29441. var wrapMap = {
  29442. thead: [1, "<table>", "</table>"],
  29443. col: [2, "<table><colgroup>", "</colgroup></table>"],
  29444. tr: [2, "<table><tbody>", "</tbody></table>"],
  29445. td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
  29446. _default: [0, "", ""]
  29447. };
  29448. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  29449. wrapMap.th = wrapMap.td;
  29450. if (!support.option) {
  29451. wrapMap.optgroup = wrapMap.option = [1, "<select multiple='multiple'>", "</select>"];
  29452. }
  29453. function getAll(context, tag) {
  29454. var ret;
  29455. if (typeof context.getElementsByTagName !== "undefined") {
  29456. ret = context.getElementsByTagName(tag || "*");
  29457. } else if (typeof context.querySelectorAll !== "undefined") {
  29458. ret = context.querySelectorAll(tag || "*");
  29459. } else {
  29460. ret = [];
  29461. }
  29462. if (tag === void 0 || tag && nodeName(context, tag)) {
  29463. return jQuery.merge([context], ret);
  29464. }
  29465. return ret;
  29466. }
  29467. function setGlobalEval(elems, refElements) {
  29468. var i2 = 0, l = elems.length;
  29469. for (; i2 < l; i2++) {
  29470. dataPriv.set(
  29471. elems[i2],
  29472. "globalEval",
  29473. !refElements || dataPriv.get(refElements[i2], "globalEval")
  29474. );
  29475. }
  29476. }
  29477. var rhtml = /<|&#?\w+;/;
  29478. function buildFragment(elems, context, scripts, selection, ignored) {
  29479. var elem, tmp, tag, wrap, attached, j, fragment = context.createDocumentFragment(), nodes = [], i2 = 0, l = elems.length;
  29480. for (; i2 < l; i2++) {
  29481. elem = elems[i2];
  29482. if (elem || elem === 0) {
  29483. if (toType(elem) === "object") {
  29484. jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
  29485. } else if (!rhtml.test(elem)) {
  29486. nodes.push(context.createTextNode(elem));
  29487. } else {
  29488. tmp = tmp || fragment.appendChild(context.createElement("div"));
  29489. tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
  29490. wrap = wrapMap[tag] || wrapMap._default;
  29491. tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2];
  29492. j = wrap[0];
  29493. while (j--) {
  29494. tmp = tmp.lastChild;
  29495. }
  29496. jQuery.merge(nodes, tmp.childNodes);
  29497. tmp = fragment.firstChild;
  29498. tmp.textContent = "";
  29499. }
  29500. }
  29501. }
  29502. fragment.textContent = "";
  29503. i2 = 0;
  29504. while (elem = nodes[i2++]) {
  29505. if (selection && jQuery.inArray(elem, selection) > -1) {
  29506. if (ignored) {
  29507. ignored.push(elem);
  29508. }
  29509. continue;
  29510. }
  29511. attached = isAttached(elem);
  29512. tmp = getAll(fragment.appendChild(elem), "script");
  29513. if (attached) {
  29514. setGlobalEval(tmp);
  29515. }
  29516. if (scripts) {
  29517. j = 0;
  29518. while (elem = tmp[j++]) {
  29519. if (rscriptType.test(elem.type || "")) {
  29520. scripts.push(elem);
  29521. }
  29522. }
  29523. }
  29524. }
  29525. return fragment;
  29526. }
  29527. var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  29528. function returnTrue() {
  29529. return true;
  29530. }
  29531. function returnFalse() {
  29532. return false;
  29533. }
  29534. function on3(elem, types, selector, data, fn2, one3) {
  29535. var origFn, type2;
  29536. if (typeof types === "object") {
  29537. if (typeof selector !== "string") {
  29538. data = data || selector;
  29539. selector = void 0;
  29540. }
  29541. for (type2 in types) {
  29542. on3(elem, type2, selector, data, types[type2], one3);
  29543. }
  29544. return elem;
  29545. }
  29546. if (data == null && fn2 == null) {
  29547. fn2 = selector;
  29548. data = selector = void 0;
  29549. } else if (fn2 == null) {
  29550. if (typeof selector === "string") {
  29551. fn2 = data;
  29552. data = void 0;
  29553. } else {
  29554. fn2 = data;
  29555. data = selector;
  29556. selector = void 0;
  29557. }
  29558. }
  29559. if (fn2 === false) {
  29560. fn2 = returnFalse;
  29561. } else if (!fn2) {
  29562. return elem;
  29563. }
  29564. if (one3 === 1) {
  29565. origFn = fn2;
  29566. fn2 = function(event2) {
  29567. jQuery().off(event2);
  29568. return origFn.apply(this, arguments);
  29569. };
  29570. fn2.guid = origFn.guid || (origFn.guid = jQuery.guid++);
  29571. }
  29572. return elem.each(function() {
  29573. jQuery.event.add(this, types, fn2, data, selector);
  29574. });
  29575. }
  29576. jQuery.event = {
  29577. global: {},
  29578. add: function(elem, types, handler, data, selector) {
  29579. var handleObjIn, eventHandle, tmp, events, t2, handleObj, special, handlers, type2, namespaces, origType, elemData = dataPriv.get(elem);
  29580. if (!acceptData(elem)) {
  29581. return;
  29582. }
  29583. if (handler.handler) {
  29584. handleObjIn = handler;
  29585. handler = handleObjIn.handler;
  29586. selector = handleObjIn.selector;
  29587. }
  29588. if (selector) {
  29589. jQuery.find.matchesSelector(documentElement, selector);
  29590. }
  29591. if (!handler.guid) {
  29592. handler.guid = jQuery.guid++;
  29593. }
  29594. if (!(events = elemData.events)) {
  29595. events = elemData.events = /* @__PURE__ */ Object.create(null);
  29596. }
  29597. if (!(eventHandle = elemData.handle)) {
  29598. eventHandle = elemData.handle = function(e) {
  29599. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : void 0;
  29600. };
  29601. }
  29602. types = (types || "").match(rnothtmlwhite) || [""];
  29603. t2 = types.length;
  29604. while (t2--) {
  29605. tmp = rtypenamespace.exec(types[t2]) || [];
  29606. type2 = origType = tmp[1];
  29607. namespaces = (tmp[2] || "").split(".").sort();
  29608. if (!type2) {
  29609. continue;
  29610. }
  29611. special = jQuery.event.special[type2] || {};
  29612. type2 = (selector ? special.delegateType : special.bindType) || type2;
  29613. special = jQuery.event.special[type2] || {};
  29614. handleObj = jQuery.extend({
  29615. type: type2,
  29616. origType,
  29617. data,
  29618. handler,
  29619. guid: handler.guid,
  29620. selector,
  29621. needsContext: selector && jQuery.expr.match.needsContext.test(selector),
  29622. namespace: namespaces.join(".")
  29623. }, handleObjIn);
  29624. if (!(handlers = events[type2])) {
  29625. handlers = events[type2] = [];
  29626. handlers.delegateCount = 0;
  29627. if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
  29628. if (elem.addEventListener) {
  29629. elem.addEventListener(type2, eventHandle);
  29630. }
  29631. }
  29632. }
  29633. if (special.add) {
  29634. special.add.call(elem, handleObj);
  29635. if (!handleObj.handler.guid) {
  29636. handleObj.handler.guid = handler.guid;
  29637. }
  29638. }
  29639. if (selector) {
  29640. handlers.splice(handlers.delegateCount++, 0, handleObj);
  29641. } else {
  29642. handlers.push(handleObj);
  29643. }
  29644. jQuery.event.global[type2] = true;
  29645. }
  29646. },
  29647. remove: function(elem, types, handler, selector, mappedTypes) {
  29648. var j, origCount, tmp, events, t2, handleObj, special, handlers, type2, namespaces, origType, elemData = dataPriv.hasData(elem) && dataPriv.get(elem);
  29649. if (!elemData || !(events = elemData.events)) {
  29650. return;
  29651. }
  29652. types = (types || "").match(rnothtmlwhite) || [""];
  29653. t2 = types.length;
  29654. while (t2--) {
  29655. tmp = rtypenamespace.exec(types[t2]) || [];
  29656. type2 = origType = tmp[1];
  29657. namespaces = (tmp[2] || "").split(".").sort();
  29658. if (!type2) {
  29659. for (type2 in events) {
  29660. jQuery.event.remove(elem, type2 + types[t2], handler, selector, true);
  29661. }
  29662. continue;
  29663. }
  29664. special = jQuery.event.special[type2] || {};
  29665. type2 = (selector ? special.delegateType : special.bindType) || type2;
  29666. handlers = events[type2] || [];
  29667. tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
  29668. origCount = j = handlers.length;
  29669. while (j--) {
  29670. handleObj = handlers[j];
  29671. if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) {
  29672. handlers.splice(j, 1);
  29673. if (handleObj.selector) {
  29674. handlers.delegateCount--;
  29675. }
  29676. if (special.remove) {
  29677. special.remove.call(elem, handleObj);
  29678. }
  29679. }
  29680. }
  29681. if (origCount && !handlers.length) {
  29682. if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {
  29683. jQuery.removeEvent(elem, type2, elemData.handle);
  29684. }
  29685. delete events[type2];
  29686. }
  29687. }
  29688. if (jQuery.isEmptyObject(events)) {
  29689. dataPriv.remove(elem, "handle events");
  29690. }
  29691. },
  29692. dispatch: function(nativeEvent) {
  29693. var i2, j, ret, matched, handleObj, handlerQueue, args = new Array(arguments.length), event2 = jQuery.event.fix(nativeEvent), handlers = (dataPriv.get(this, "events") || /* @__PURE__ */ Object.create(null))[event2.type] || [], special = jQuery.event.special[event2.type] || {};
  29694. args[0] = event2;
  29695. for (i2 = 1; i2 < arguments.length; i2++) {
  29696. args[i2] = arguments[i2];
  29697. }
  29698. event2.delegateTarget = this;
  29699. if (special.preDispatch && special.preDispatch.call(this, event2) === false) {
  29700. return;
  29701. }
  29702. handlerQueue = jQuery.event.handlers.call(this, event2, handlers);
  29703. i2 = 0;
  29704. while ((matched = handlerQueue[i2++]) && !event2.isPropagationStopped()) {
  29705. event2.currentTarget = matched.elem;
  29706. j = 0;
  29707. while ((handleObj = matched.handlers[j++]) && !event2.isImmediatePropagationStopped()) {
  29708. if (!event2.rnamespace || handleObj.namespace === false || event2.rnamespace.test(handleObj.namespace)) {
  29709. event2.handleObj = handleObj;
  29710. event2.data = handleObj.data;
  29711. ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args);
  29712. if (ret !== void 0) {
  29713. if ((event2.result = ret) === false) {
  29714. event2.preventDefault();
  29715. event2.stopPropagation();
  29716. }
  29717. }
  29718. }
  29719. }
  29720. }
  29721. if (special.postDispatch) {
  29722. special.postDispatch.call(this, event2);
  29723. }
  29724. return event2.result;
  29725. },
  29726. handlers: function(event2, handlers) {
  29727. var i2, handleObj, sel, matchedHandlers, matchedSelectors, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event2.target;
  29728. if (delegateCount && cur.nodeType && !(event2.type === "click" && event2.button >= 1)) {
  29729. for (; cur !== this; cur = cur.parentNode || this) {
  29730. if (cur.nodeType === 1 && !(event2.type === "click" && cur.disabled === true)) {
  29731. matchedHandlers = [];
  29732. matchedSelectors = {};
  29733. for (i2 = 0; i2 < delegateCount; i2++) {
  29734. handleObj = handlers[i2];
  29735. sel = handleObj.selector + " ";
  29736. if (matchedSelectors[sel] === void 0) {
  29737. matchedSelectors[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) > -1 : jQuery.find(sel, this, null, [cur]).length;
  29738. }
  29739. if (matchedSelectors[sel]) {
  29740. matchedHandlers.push(handleObj);
  29741. }
  29742. }
  29743. if (matchedHandlers.length) {
  29744. handlerQueue.push({ elem: cur, handlers: matchedHandlers });
  29745. }
  29746. }
  29747. }
  29748. }
  29749. cur = this;
  29750. if (delegateCount < handlers.length) {
  29751. handlerQueue.push({ elem: cur, handlers: handlers.slice(delegateCount) });
  29752. }
  29753. return handlerQueue;
  29754. },
  29755. addProp: function(name, hook3) {
  29756. Object.defineProperty(jQuery.Event.prototype, name, {
  29757. enumerable: true,
  29758. configurable: true,
  29759. get: isFunction2(hook3) ? function() {
  29760. if (this.originalEvent) {
  29761. return hook3(this.originalEvent);
  29762. }
  29763. } : function() {
  29764. if (this.originalEvent) {
  29765. return this.originalEvent[name];
  29766. }
  29767. },
  29768. set: function(value) {
  29769. Object.defineProperty(this, name, {
  29770. enumerable: true,
  29771. configurable: true,
  29772. writable: true,
  29773. value
  29774. });
  29775. }
  29776. });
  29777. },
  29778. fix: function(originalEvent) {
  29779. return originalEvent[jQuery.expando] ? originalEvent : new jQuery.Event(originalEvent);
  29780. },
  29781. special: {
  29782. load: {
  29783. noBubble: true
  29784. },
  29785. click: {
  29786. setup: function(data) {
  29787. var el = this || data;
  29788. if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) {
  29789. leverageNative(el, "click", true);
  29790. }
  29791. return false;
  29792. },
  29793. trigger: function(data) {
  29794. var el = this || data;
  29795. if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) {
  29796. leverageNative(el, "click");
  29797. }
  29798. return true;
  29799. },
  29800. _default: function(event2) {
  29801. var target = event2.target;
  29802. return rcheckableType.test(target.type) && target.click && nodeName(target, "input") && dataPriv.get(target, "click") || nodeName(target, "a");
  29803. }
  29804. },
  29805. beforeunload: {
  29806. postDispatch: function(event2) {
  29807. if (event2.result !== void 0 && event2.originalEvent) {
  29808. event2.originalEvent.returnValue = event2.result;
  29809. }
  29810. }
  29811. }
  29812. }
  29813. };
  29814. function leverageNative(el, type2, isSetup) {
  29815. if (!isSetup) {
  29816. if (dataPriv.get(el, type2) === void 0) {
  29817. jQuery.event.add(el, type2, returnTrue);
  29818. }
  29819. return;
  29820. }
  29821. dataPriv.set(el, type2, false);
  29822. jQuery.event.add(el, type2, {
  29823. namespace: false,
  29824. handler: function(event2) {
  29825. var result, saved = dataPriv.get(this, type2);
  29826. if (event2.isTrigger & 1 && this[type2]) {
  29827. if (!saved) {
  29828. saved = slice.call(arguments);
  29829. dataPriv.set(this, type2, saved);
  29830. this[type2]();
  29831. result = dataPriv.get(this, type2);
  29832. dataPriv.set(this, type2, false);
  29833. if (saved !== result) {
  29834. event2.stopImmediatePropagation();
  29835. event2.preventDefault();
  29836. return result;
  29837. }
  29838. } else if ((jQuery.event.special[type2] || {}).delegateType) {
  29839. event2.stopPropagation();
  29840. }
  29841. } else if (saved) {
  29842. dataPriv.set(this, type2, jQuery.event.trigger(
  29843. saved[0],
  29844. saved.slice(1),
  29845. this
  29846. ));
  29847. event2.stopPropagation();
  29848. event2.isImmediatePropagationStopped = returnTrue;
  29849. }
  29850. }
  29851. });
  29852. }
  29853. jQuery.removeEvent = function(elem, type2, handle) {
  29854. if (elem.removeEventListener) {
  29855. elem.removeEventListener(type2, handle);
  29856. }
  29857. };
  29858. jQuery.Event = function(src, props) {
  29859. if (!(this instanceof jQuery.Event)) {
  29860. return new jQuery.Event(src, props);
  29861. }
  29862. if (src && src.type) {
  29863. this.originalEvent = src;
  29864. this.type = src.type;
  29865. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === void 0 && src.returnValue === false ? returnTrue : returnFalse;
  29866. this.target = src.target && src.target.nodeType === 3 ? src.target.parentNode : src.target;
  29867. this.currentTarget = src.currentTarget;
  29868. this.relatedTarget = src.relatedTarget;
  29869. } else {
  29870. this.type = src;
  29871. }
  29872. if (props) {
  29873. jQuery.extend(this, props);
  29874. }
  29875. this.timeStamp = src && src.timeStamp || Date.now();
  29876. this[jQuery.expando] = true;
  29877. };
  29878. jQuery.Event.prototype = {
  29879. constructor: jQuery.Event,
  29880. isDefaultPrevented: returnFalse,
  29881. isPropagationStopped: returnFalse,
  29882. isImmediatePropagationStopped: returnFalse,
  29883. isSimulated: false,
  29884. preventDefault: function() {
  29885. var e = this.originalEvent;
  29886. this.isDefaultPrevented = returnTrue;
  29887. if (e && !this.isSimulated) {
  29888. e.preventDefault();
  29889. }
  29890. },
  29891. stopPropagation: function() {
  29892. var e = this.originalEvent;
  29893. this.isPropagationStopped = returnTrue;
  29894. if (e && !this.isSimulated) {
  29895. e.stopPropagation();
  29896. }
  29897. },
  29898. stopImmediatePropagation: function() {
  29899. var e = this.originalEvent;
  29900. this.isImmediatePropagationStopped = returnTrue;
  29901. if (e && !this.isSimulated) {
  29902. e.stopImmediatePropagation();
  29903. }
  29904. this.stopPropagation();
  29905. }
  29906. };
  29907. jQuery.each({
  29908. altKey: true,
  29909. bubbles: true,
  29910. cancelable: true,
  29911. changedTouches: true,
  29912. ctrlKey: true,
  29913. detail: true,
  29914. eventPhase: true,
  29915. metaKey: true,
  29916. pageX: true,
  29917. pageY: true,
  29918. shiftKey: true,
  29919. view: true,
  29920. "char": true,
  29921. code: true,
  29922. charCode: true,
  29923. key: true,
  29924. keyCode: true,
  29925. button: true,
  29926. buttons: true,
  29927. clientX: true,
  29928. clientY: true,
  29929. offsetX: true,
  29930. offsetY: true,
  29931. pointerId: true,
  29932. pointerType: true,
  29933. screenX: true,
  29934. screenY: true,
  29935. targetTouches: true,
  29936. toElement: true,
  29937. touches: true,
  29938. which: true
  29939. }, jQuery.event.addProp);
  29940. jQuery.each({ focus: "focusin", blur: "focusout" }, function(type2, delegateType) {
  29941. function focusMappedHandler(nativeEvent) {
  29942. if (document2.documentMode) {
  29943. var handle = dataPriv.get(this, "handle"), event2 = jQuery.event.fix(nativeEvent);
  29944. event2.type = nativeEvent.type === "focusin" ? "focus" : "blur";
  29945. event2.isSimulated = true;
  29946. handle(nativeEvent);
  29947. if (event2.target === event2.currentTarget) {
  29948. handle(event2);
  29949. }
  29950. } else {
  29951. jQuery.event.simulate(
  29952. delegateType,
  29953. nativeEvent.target,
  29954. jQuery.event.fix(nativeEvent)
  29955. );
  29956. }
  29957. }
  29958. jQuery.event.special[type2] = {
  29959. setup: function() {
  29960. var attaches;
  29961. leverageNative(this, type2, true);
  29962. if (document2.documentMode) {
  29963. attaches = dataPriv.get(this, delegateType);
  29964. if (!attaches) {
  29965. this.addEventListener(delegateType, focusMappedHandler);
  29966. }
  29967. dataPriv.set(this, delegateType, (attaches || 0) + 1);
  29968. } else {
  29969. return false;
  29970. }
  29971. },
  29972. trigger: function() {
  29973. leverageNative(this, type2);
  29974. return true;
  29975. },
  29976. teardown: function() {
  29977. var attaches;
  29978. if (document2.documentMode) {
  29979. attaches = dataPriv.get(this, delegateType) - 1;
  29980. if (!attaches) {
  29981. this.removeEventListener(delegateType, focusMappedHandler);
  29982. dataPriv.remove(this, delegateType);
  29983. } else {
  29984. dataPriv.set(this, delegateType, attaches);
  29985. }
  29986. } else {
  29987. return false;
  29988. }
  29989. },
  29990. _default: function(event2) {
  29991. return dataPriv.get(event2.target, type2);
  29992. },
  29993. delegateType
  29994. };
  29995. jQuery.event.special[delegateType] = {
  29996. setup: function() {
  29997. var doc = this.ownerDocument || this.document || this, dataHolder = document2.documentMode ? this : doc, attaches = dataPriv.get(dataHolder, delegateType);
  29998. if (!attaches) {
  29999. if (document2.documentMode) {
  30000. this.addEventListener(delegateType, focusMappedHandler);
  30001. } else {
  30002. doc.addEventListener(type2, focusMappedHandler, true);
  30003. }
  30004. }
  30005. dataPriv.set(dataHolder, delegateType, (attaches || 0) + 1);
  30006. },
  30007. teardown: function() {
  30008. var doc = this.ownerDocument || this.document || this, dataHolder = document2.documentMode ? this : doc, attaches = dataPriv.get(dataHolder, delegateType) - 1;
  30009. if (!attaches) {
  30010. if (document2.documentMode) {
  30011. this.removeEventListener(delegateType, focusMappedHandler);
  30012. } else {
  30013. doc.removeEventListener(type2, focusMappedHandler, true);
  30014. }
  30015. dataPriv.remove(dataHolder, delegateType);
  30016. } else {
  30017. dataPriv.set(dataHolder, delegateType, attaches);
  30018. }
  30019. }
  30020. };
  30021. });
  30022. jQuery.each({
  30023. mouseenter: "mouseover",
  30024. mouseleave: "mouseout",
  30025. pointerenter: "pointerover",
  30026. pointerleave: "pointerout"
  30027. }, function(orig, fix) {
  30028. jQuery.event.special[orig] = {
  30029. delegateType: fix,
  30030. bindType: fix,
  30031. handle: function(event2) {
  30032. var ret, target = this, related = event2.relatedTarget, handleObj = event2.handleObj;
  30033. if (!related || related !== target && !jQuery.contains(target, related)) {
  30034. event2.type = handleObj.origType;
  30035. ret = handleObj.handler.apply(this, arguments);
  30036. event2.type = fix;
  30037. }
  30038. return ret;
  30039. }
  30040. };
  30041. });
  30042. jQuery.fn.extend({
  30043. on: function(types, selector, data, fn2) {
  30044. return on3(this, types, selector, data, fn2);
  30045. },
  30046. one: function(types, selector, data, fn2) {
  30047. return on3(this, types, selector, data, fn2, 1);
  30048. },
  30049. off: function(types, selector, fn2) {
  30050. var handleObj, type2;
  30051. if (types && types.preventDefault && types.handleObj) {
  30052. handleObj = types.handleObj;
  30053. jQuery(types.delegateTarget).off(
  30054. handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
  30055. handleObj.selector,
  30056. handleObj.handler
  30057. );
  30058. return this;
  30059. }
  30060. if (typeof types === "object") {
  30061. for (type2 in types) {
  30062. this.off(type2, selector, types[type2]);
  30063. }
  30064. return this;
  30065. }
  30066. if (selector === false || typeof selector === "function") {
  30067. fn2 = selector;
  30068. selector = void 0;
  30069. }
  30070. if (fn2 === false) {
  30071. fn2 = returnFalse;
  30072. }
  30073. return this.each(function() {
  30074. jQuery.event.remove(this, types, fn2, selector);
  30075. });
  30076. }
  30077. });
  30078. var rnoInnerhtml = /<script|<style|<link/i, rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
  30079. function manipulationTarget(elem, content) {
  30080. if (nodeName(elem, "table") && nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr")) {
  30081. return jQuery(elem).children("tbody")[0] || elem;
  30082. }
  30083. return elem;
  30084. }
  30085. function disableScript(elem) {
  30086. elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
  30087. return elem;
  30088. }
  30089. function restoreScript(elem) {
  30090. if ((elem.type || "").slice(0, 5) === "true/") {
  30091. elem.type = elem.type.slice(5);
  30092. } else {
  30093. elem.removeAttribute("type");
  30094. }
  30095. return elem;
  30096. }
  30097. function cloneCopyEvent(src, dest) {
  30098. var i2, l, type2, pdataOld, udataOld, udataCur, events;
  30099. if (dest.nodeType !== 1) {
  30100. return;
  30101. }
  30102. if (dataPriv.hasData(src)) {
  30103. pdataOld = dataPriv.get(src);
  30104. events = pdataOld.events;
  30105. if (events) {
  30106. dataPriv.remove(dest, "handle events");
  30107. for (type2 in events) {
  30108. for (i2 = 0, l = events[type2].length; i2 < l; i2++) {
  30109. jQuery.event.add(dest, type2, events[type2][i2]);
  30110. }
  30111. }
  30112. }
  30113. }
  30114. if (dataUser.hasData(src)) {
  30115. udataOld = dataUser.access(src);
  30116. udataCur = jQuery.extend({}, udataOld);
  30117. dataUser.set(dest, udataCur);
  30118. }
  30119. }
  30120. function fixInput(src, dest) {
  30121. var nodeName2 = dest.nodeName.toLowerCase();
  30122. if (nodeName2 === "input" && rcheckableType.test(src.type)) {
  30123. dest.checked = src.checked;
  30124. } else if (nodeName2 === "input" || nodeName2 === "textarea") {
  30125. dest.defaultValue = src.defaultValue;
  30126. }
  30127. }
  30128. function domManip(collection, args, callback2, ignored) {
  30129. args = flat2(args);
  30130. var fragment, first, scripts, hasScripts, node, doc, i2 = 0, l = collection.length, iNoClone = l - 1, value = args[0], valueIsFunction = isFunction2(value);
  30131. if (valueIsFunction || l > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value)) {
  30132. return collection.each(function(index2) {
  30133. var self2 = collection.eq(index2);
  30134. if (valueIsFunction) {
  30135. args[0] = value.call(this, index2, self2.html());
  30136. }
  30137. domManip(self2, args, callback2, ignored);
  30138. });
  30139. }
  30140. if (l) {
  30141. fragment = buildFragment(args, collection[0].ownerDocument, false, collection, ignored);
  30142. first = fragment.firstChild;
  30143. if (fragment.childNodes.length === 1) {
  30144. fragment = first;
  30145. }
  30146. if (first || ignored) {
  30147. scripts = jQuery.map(getAll(fragment, "script"), disableScript);
  30148. hasScripts = scripts.length;
  30149. for (; i2 < l; i2++) {
  30150. node = fragment;
  30151. if (i2 !== iNoClone) {
  30152. node = jQuery.clone(node, true, true);
  30153. if (hasScripts) {
  30154. jQuery.merge(scripts, getAll(node, "script"));
  30155. }
  30156. }
  30157. callback2.call(collection[i2], node, i2);
  30158. }
  30159. if (hasScripts) {
  30160. doc = scripts[scripts.length - 1].ownerDocument;
  30161. jQuery.map(scripts, restoreScript);
  30162. for (i2 = 0; i2 < hasScripts; i2++) {
  30163. node = scripts[i2];
  30164. if (rscriptType.test(node.type || "") && !dataPriv.access(node, "globalEval") && jQuery.contains(doc, node)) {
  30165. if (node.src && (node.type || "").toLowerCase() !== "module") {
  30166. if (jQuery._evalUrl && !node.noModule) {
  30167. jQuery._evalUrl(node.src, {
  30168. nonce: node.nonce || node.getAttribute("nonce")
  30169. }, doc);
  30170. }
  30171. } else {
  30172. DOMEval(node.textContent.replace(rcleanScript, ""), node, doc);
  30173. }
  30174. }
  30175. }
  30176. }
  30177. }
  30178. }
  30179. return collection;
  30180. }
  30181. function remove2(elem, selector, keepData) {
  30182. var node, nodes = selector ? jQuery.filter(selector, elem) : elem, i2 = 0;
  30183. for (; (node = nodes[i2]) != null; i2++) {
  30184. if (!keepData && node.nodeType === 1) {
  30185. jQuery.cleanData(getAll(node));
  30186. }
  30187. if (node.parentNode) {
  30188. if (keepData && isAttached(node)) {
  30189. setGlobalEval(getAll(node, "script"));
  30190. }
  30191. node.parentNode.removeChild(node);
  30192. }
  30193. }
  30194. return elem;
  30195. }
  30196. jQuery.extend({
  30197. htmlPrefilter: function(html) {
  30198. return html;
  30199. },
  30200. clone: function(elem, dataAndEvents, deepDataAndEvents) {
  30201. var i2, l, srcElements, destElements, clone = elem.cloneNode(true), inPage = isAttached(elem);
  30202. if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) {
  30203. destElements = getAll(clone);
  30204. srcElements = getAll(elem);
  30205. for (i2 = 0, l = srcElements.length; i2 < l; i2++) {
  30206. fixInput(srcElements[i2], destElements[i2]);
  30207. }
  30208. }
  30209. if (dataAndEvents) {
  30210. if (deepDataAndEvents) {
  30211. srcElements = srcElements || getAll(elem);
  30212. destElements = destElements || getAll(clone);
  30213. for (i2 = 0, l = srcElements.length; i2 < l; i2++) {
  30214. cloneCopyEvent(srcElements[i2], destElements[i2]);
  30215. }
  30216. } else {
  30217. cloneCopyEvent(elem, clone);
  30218. }
  30219. }
  30220. destElements = getAll(clone, "script");
  30221. if (destElements.length > 0) {
  30222. setGlobalEval(destElements, !inPage && getAll(elem, "script"));
  30223. }
  30224. return clone;
  30225. },
  30226. cleanData: function(elems) {
  30227. var data, elem, type2, special = jQuery.event.special, i2 = 0;
  30228. for (; (elem = elems[i2]) !== void 0; i2++) {
  30229. if (acceptData(elem)) {
  30230. if (data = elem[dataPriv.expando]) {
  30231. if (data.events) {
  30232. for (type2 in data.events) {
  30233. if (special[type2]) {
  30234. jQuery.event.remove(elem, type2);
  30235. } else {
  30236. jQuery.removeEvent(elem, type2, data.handle);
  30237. }
  30238. }
  30239. }
  30240. elem[dataPriv.expando] = void 0;
  30241. }
  30242. if (elem[dataUser.expando]) {
  30243. elem[dataUser.expando] = void 0;
  30244. }
  30245. }
  30246. }
  30247. }
  30248. });
  30249. jQuery.fn.extend({
  30250. detach: function(selector) {
  30251. return remove2(this, selector, true);
  30252. },
  30253. remove: function(selector) {
  30254. return remove2(this, selector);
  30255. },
  30256. text: function(value) {
  30257. return access(this, function(value2) {
  30258. return value2 === void 0 ? jQuery.text(this) : this.empty().each(function() {
  30259. if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
  30260. this.textContent = value2;
  30261. }
  30262. });
  30263. }, null, value, arguments.length);
  30264. },
  30265. append: function() {
  30266. return domManip(this, arguments, function(elem) {
  30267. if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
  30268. var target = manipulationTarget(this, elem);
  30269. target.appendChild(elem);
  30270. }
  30271. });
  30272. },
  30273. prepend: function() {
  30274. return domManip(this, arguments, function(elem) {
  30275. if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
  30276. var target = manipulationTarget(this, elem);
  30277. target.insertBefore(elem, target.firstChild);
  30278. }
  30279. });
  30280. },
  30281. before: function() {
  30282. return domManip(this, arguments, function(elem) {
  30283. if (this.parentNode) {
  30284. this.parentNode.insertBefore(elem, this);
  30285. }
  30286. });
  30287. },
  30288. after: function() {
  30289. return domManip(this, arguments, function(elem) {
  30290. if (this.parentNode) {
  30291. this.parentNode.insertBefore(elem, this.nextSibling);
  30292. }
  30293. });
  30294. },
  30295. empty: function() {
  30296. var elem, i2 = 0;
  30297. for (; (elem = this[i2]) != null; i2++) {
  30298. if (elem.nodeType === 1) {
  30299. jQuery.cleanData(getAll(elem, false));
  30300. elem.textContent = "";
  30301. }
  30302. }
  30303. return this;
  30304. },
  30305. clone: function(dataAndEvents, deepDataAndEvents) {
  30306. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  30307. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  30308. return this.map(function() {
  30309. return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
  30310. });
  30311. },
  30312. html: function(value) {
  30313. return access(this, function(value2) {
  30314. var elem = this[0] || {}, i2 = 0, l = this.length;
  30315. if (value2 === void 0 && elem.nodeType === 1) {
  30316. return elem.innerHTML;
  30317. }
  30318. if (typeof value2 === "string" && !rnoInnerhtml.test(value2) && !wrapMap[(rtagName.exec(value2) || ["", ""])[1].toLowerCase()]) {
  30319. value2 = jQuery.htmlPrefilter(value2);
  30320. try {
  30321. for (; i2 < l; i2++) {
  30322. elem = this[i2] || {};
  30323. if (elem.nodeType === 1) {
  30324. jQuery.cleanData(getAll(elem, false));
  30325. elem.innerHTML = value2;
  30326. }
  30327. }
  30328. elem = 0;
  30329. } catch (e) {
  30330. }
  30331. }
  30332. if (elem) {
  30333. this.empty().append(value2);
  30334. }
  30335. }, null, value, arguments.length);
  30336. },
  30337. replaceWith: function() {
  30338. var ignored = [];
  30339. return domManip(this, arguments, function(elem) {
  30340. var parent = this.parentNode;
  30341. if (jQuery.inArray(this, ignored) < 0) {
  30342. jQuery.cleanData(getAll(this));
  30343. if (parent) {
  30344. parent.replaceChild(elem, this);
  30345. }
  30346. }
  30347. }, ignored);
  30348. }
  30349. });
  30350. jQuery.each({
  30351. appendTo: "append",
  30352. prependTo: "prepend",
  30353. insertBefore: "before",
  30354. insertAfter: "after",
  30355. replaceAll: "replaceWith"
  30356. }, function(name, original) {
  30357. jQuery.fn[name] = function(selector) {
  30358. var elems, ret = [], insert = jQuery(selector), last = insert.length - 1, i2 = 0;
  30359. for (; i2 <= last; i2++) {
  30360. elems = i2 === last ? this : this.clone(true);
  30361. jQuery(insert[i2])[original](elems);
  30362. push.apply(ret, elems.get());
  30363. }
  30364. return this.pushStack(ret);
  30365. };
  30366. });
  30367. var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i");
  30368. var rcustomProp = /^--/;
  30369. var getStyles = function(elem) {
  30370. var view = elem.ownerDocument.defaultView;
  30371. if (!view || !view.opener) {
  30372. view = window2;
  30373. }
  30374. return view.getComputedStyle(elem);
  30375. };
  30376. var swap = function(elem, options2, callback2) {
  30377. var ret, name, old = {};
  30378. for (name in options2) {
  30379. old[name] = elem.style[name];
  30380. elem.style[name] = options2[name];
  30381. }
  30382. ret = callback2.call(elem);
  30383. for (name in options2) {
  30384. elem.style[name] = old[name];
  30385. }
  30386. return ret;
  30387. };
  30388. var rboxStyle = new RegExp(cssExpand.join("|"), "i");
  30389. (function() {
  30390. function computeStyleTests() {
  30391. if (!div) {
  30392. return;
  30393. }
  30394. container.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0";
  30395. div.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%";
  30396. documentElement.appendChild(container).appendChild(div);
  30397. var divStyle = window2.getComputedStyle(div);
  30398. pixelPositionVal = divStyle.top !== "1%";
  30399. reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12;
  30400. div.style.right = "60%";
  30401. pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36;
  30402. boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36;
  30403. div.style.position = "absolute";
  30404. scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12;
  30405. documentElement.removeChild(container);
  30406. div = null;
  30407. }
  30408. function roundPixelMeasures(measure) {
  30409. return Math.round(parseFloat(measure));
  30410. }
  30411. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, reliableTrDimensionsVal, reliableMarginLeftVal, container = document2.createElement("div"), div = document2.createElement("div");
  30412. if (!div.style) {
  30413. return;
  30414. }
  30415. div.style.backgroundClip = "content-box";
  30416. div.cloneNode(true).style.backgroundClip = "";
  30417. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  30418. jQuery.extend(support, {
  30419. boxSizingReliable: function() {
  30420. computeStyleTests();
  30421. return boxSizingReliableVal;
  30422. },
  30423. pixelBoxStyles: function() {
  30424. computeStyleTests();
  30425. return pixelBoxStylesVal;
  30426. },
  30427. pixelPosition: function() {
  30428. computeStyleTests();
  30429. return pixelPositionVal;
  30430. },
  30431. reliableMarginLeft: function() {
  30432. computeStyleTests();
  30433. return reliableMarginLeftVal;
  30434. },
  30435. scrollboxSize: function() {
  30436. computeStyleTests();
  30437. return scrollboxSizeVal;
  30438. },
  30439. reliableTrDimensions: function() {
  30440. var table, tr, trChild, trStyle;
  30441. if (reliableTrDimensionsVal == null) {
  30442. table = document2.createElement("table");
  30443. tr = document2.createElement("tr");
  30444. trChild = document2.createElement("div");
  30445. table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
  30446. tr.style.cssText = "border:1px solid";
  30447. tr.style.height = "1px";
  30448. trChild.style.height = "9px";
  30449. trChild.style.display = "block";
  30450. documentElement.appendChild(table).appendChild(tr).appendChild(trChild);
  30451. trStyle = window2.getComputedStyle(tr);
  30452. reliableTrDimensionsVal = parseInt(trStyle.height, 10) + parseInt(trStyle.borderTopWidth, 10) + parseInt(trStyle.borderBottomWidth, 10) === tr.offsetHeight;
  30453. documentElement.removeChild(table);
  30454. }
  30455. return reliableTrDimensionsVal;
  30456. }
  30457. });
  30458. })();
  30459. function curCSS(elem, name, computed2) {
  30460. var width2, minWidth, maxWidth, ret, isCustomProp = rcustomProp.test(name), style = elem.style;
  30461. computed2 = computed2 || getStyles(elem);
  30462. if (computed2) {
  30463. ret = computed2.getPropertyValue(name) || computed2[name];
  30464. if (isCustomProp && ret) {
  30465. ret = ret.replace(rtrimCSS, "$1") || void 0;
  30466. }
  30467. if (ret === "" && !isAttached(elem)) {
  30468. ret = jQuery.style(elem, name);
  30469. }
  30470. if (!support.pixelBoxStyles() && rnumnonpx.test(ret) && rboxStyle.test(name)) {
  30471. width2 = style.width;
  30472. minWidth = style.minWidth;
  30473. maxWidth = style.maxWidth;
  30474. style.minWidth = style.maxWidth = style.width = ret;
  30475. ret = computed2.width;
  30476. style.width = width2;
  30477. style.minWidth = minWidth;
  30478. style.maxWidth = maxWidth;
  30479. }
  30480. }
  30481. return ret !== void 0 ? ret + "" : ret;
  30482. }
  30483. function addGetHookIf(conditionFn, hookFn) {
  30484. return {
  30485. get: function() {
  30486. if (conditionFn()) {
  30487. delete this.get;
  30488. return;
  30489. }
  30490. return (this.get = hookFn).apply(this, arguments);
  30491. }
  30492. };
  30493. }
  30494. var cssPrefixes = ["Webkit", "Moz", "ms"], emptyStyle = document2.createElement("div").style, vendorProps = {};
  30495. function vendorPropName(name) {
  30496. var capName = name[0].toUpperCase() + name.slice(1), i2 = cssPrefixes.length;
  30497. while (i2--) {
  30498. name = cssPrefixes[i2] + capName;
  30499. if (name in emptyStyle) {
  30500. return name;
  30501. }
  30502. }
  30503. }
  30504. function finalPropName(name) {
  30505. var final = jQuery.cssProps[name] || vendorProps[name];
  30506. if (final) {
  30507. return final;
  30508. }
  30509. if (name in emptyStyle) {
  30510. return name;
  30511. }
  30512. return vendorProps[name] = vendorPropName(name) || name;
  30513. }
  30514. var rdisplayswap = /^(none|table(?!-c[ea]).+)/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = {
  30515. letterSpacing: "0",
  30516. fontWeight: "400"
  30517. };
  30518. function setPositiveNumber(_elem, value, subtract) {
  30519. var matches = rcssNum.exec(value);
  30520. return matches ? Math.max(0, matches[2] - (subtract || 0)) + (matches[3] || "px") : value;
  30521. }
  30522. function boxModelAdjustment(elem, dimension, box, isBorderBox, styles, computedVal) {
  30523. var i2 = dimension === "width" ? 1 : 0, extra = 0, delta = 0, marginDelta = 0;
  30524. if (box === (isBorderBox ? "border" : "content")) {
  30525. return 0;
  30526. }
  30527. for (; i2 < 4; i2 += 2) {
  30528. if (box === "margin") {
  30529. marginDelta += jQuery.css(elem, box + cssExpand[i2], true, styles);
  30530. }
  30531. if (!isBorderBox) {
  30532. delta += jQuery.css(elem, "padding" + cssExpand[i2], true, styles);
  30533. if (box !== "padding") {
  30534. delta += jQuery.css(elem, "border" + cssExpand[i2] + "Width", true, styles);
  30535. } else {
  30536. extra += jQuery.css(elem, "border" + cssExpand[i2] + "Width", true, styles);
  30537. }
  30538. } else {
  30539. if (box === "content") {
  30540. delta -= jQuery.css(elem, "padding" + cssExpand[i2], true, styles);
  30541. }
  30542. if (box !== "margin") {
  30543. delta -= jQuery.css(elem, "border" + cssExpand[i2] + "Width", true, styles);
  30544. }
  30545. }
  30546. }
  30547. if (!isBorderBox && computedVal >= 0) {
  30548. delta += Math.max(0, Math.ceil(
  30549. elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - computedVal - delta - extra - 0.5
  30550. )) || 0;
  30551. }
  30552. return delta + marginDelta;
  30553. }
  30554. function getWidthOrHeight(elem, dimension, extra) {
  30555. var styles = getStyles(elem), boxSizingNeeded = !support.boxSizingReliable() || extra, isBorderBox = boxSizingNeeded && jQuery.css(elem, "boxSizing", false, styles) === "border-box", valueIsBorderBox = isBorderBox, val = curCSS(elem, dimension, styles), offsetProp = "offset" + dimension[0].toUpperCase() + dimension.slice(1);
  30556. if (rnumnonpx.test(val)) {
  30557. if (!extra) {
  30558. return val;
  30559. }
  30560. val = "auto";
  30561. }
  30562. if ((!support.boxSizingReliable() && isBorderBox || !support.reliableTrDimensions() && nodeName(elem, "tr") || val === "auto" || !parseFloat(val) && jQuery.css(elem, "display", false, styles) === "inline") && elem.getClientRects().length) {
  30563. isBorderBox = jQuery.css(elem, "boxSizing", false, styles) === "border-box";
  30564. valueIsBorderBox = offsetProp in elem;
  30565. if (valueIsBorderBox) {
  30566. val = elem[offsetProp];
  30567. }
  30568. }
  30569. val = parseFloat(val) || 0;
  30570. return val + boxModelAdjustment(
  30571. elem,
  30572. dimension,
  30573. extra || (isBorderBox ? "border" : "content"),
  30574. valueIsBorderBox,
  30575. styles,
  30576. val
  30577. ) + "px";
  30578. }
  30579. jQuery.extend({
  30580. cssHooks: {
  30581. opacity: {
  30582. get: function(elem, computed2) {
  30583. if (computed2) {
  30584. var ret = curCSS(elem, "opacity");
  30585. return ret === "" ? "1" : ret;
  30586. }
  30587. }
  30588. }
  30589. },
  30590. cssNumber: {
  30591. animationIterationCount: true,
  30592. aspectRatio: true,
  30593. borderImageSlice: true,
  30594. columnCount: true,
  30595. flexGrow: true,
  30596. flexShrink: true,
  30597. fontWeight: true,
  30598. gridArea: true,
  30599. gridColumn: true,
  30600. gridColumnEnd: true,
  30601. gridColumnStart: true,
  30602. gridRow: true,
  30603. gridRowEnd: true,
  30604. gridRowStart: true,
  30605. lineHeight: true,
  30606. opacity: true,
  30607. order: true,
  30608. orphans: true,
  30609. scale: true,
  30610. widows: true,
  30611. zIndex: true,
  30612. zoom: true,
  30613. fillOpacity: true,
  30614. floodOpacity: true,
  30615. stopOpacity: true,
  30616. strokeMiterlimit: true,
  30617. strokeOpacity: true
  30618. },
  30619. cssProps: {},
  30620. style: function(elem, name, value, extra) {
  30621. if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
  30622. return;
  30623. }
  30624. var ret, type2, hooks3, origName = camelCase3(name), isCustomProp = rcustomProp.test(name), style = elem.style;
  30625. if (!isCustomProp) {
  30626. name = finalPropName(origName);
  30627. }
  30628. hooks3 = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
  30629. if (value !== void 0) {
  30630. type2 = typeof value;
  30631. if (type2 === "string" && (ret = rcssNum.exec(value)) && ret[1]) {
  30632. value = adjustCSS(elem, name, ret);
  30633. type2 = "number";
  30634. }
  30635. if (value == null || value !== value) {
  30636. return;
  30637. }
  30638. if (type2 === "number" && !isCustomProp) {
  30639. value += ret && ret[3] || (jQuery.cssNumber[origName] ? "" : "px");
  30640. }
  30641. if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
  30642. style[name] = "inherit";
  30643. }
  30644. if (!hooks3 || !("set" in hooks3) || (value = hooks3.set(elem, value, extra)) !== void 0) {
  30645. if (isCustomProp) {
  30646. style.setProperty(name, value);
  30647. } else {
  30648. style[name] = value;
  30649. }
  30650. }
  30651. } else {
  30652. if (hooks3 && "get" in hooks3 && (ret = hooks3.get(elem, false, extra)) !== void 0) {
  30653. return ret;
  30654. }
  30655. return style[name];
  30656. }
  30657. },
  30658. css: function(elem, name, extra, styles) {
  30659. var val, num, hooks3, origName = camelCase3(name), isCustomProp = rcustomProp.test(name);
  30660. if (!isCustomProp) {
  30661. name = finalPropName(origName);
  30662. }
  30663. hooks3 = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
  30664. if (hooks3 && "get" in hooks3) {
  30665. val = hooks3.get(elem, true, extra);
  30666. }
  30667. if (val === void 0) {
  30668. val = curCSS(elem, name, styles);
  30669. }
  30670. if (val === "normal" && name in cssNormalTransform) {
  30671. val = cssNormalTransform[name];
  30672. }
  30673. if (extra === "" || extra) {
  30674. num = parseFloat(val);
  30675. return extra === true || isFinite(num) ? num || 0 : val;
  30676. }
  30677. return val;
  30678. }
  30679. });
  30680. jQuery.each(["height", "width"], function(_i, dimension) {
  30681. jQuery.cssHooks[dimension] = {
  30682. get: function(elem, computed2, extra) {
  30683. if (computed2) {
  30684. return rdisplayswap.test(jQuery.css(elem, "display")) && (!elem.getClientRects().length || !elem.getBoundingClientRect().width) ? swap(elem, cssShow, function() {
  30685. return getWidthOrHeight(elem, dimension, extra);
  30686. }) : getWidthOrHeight(elem, dimension, extra);
  30687. }
  30688. },
  30689. set: function(elem, value, extra) {
  30690. var matches, styles = getStyles(elem), scrollboxSizeBuggy = !support.scrollboxSize() && styles.position === "absolute", boxSizingNeeded = scrollboxSizeBuggy || extra, isBorderBox = boxSizingNeeded && jQuery.css(elem, "boxSizing", false, styles) === "border-box", subtract = extra ? boxModelAdjustment(
  30691. elem,
  30692. dimension,
  30693. extra,
  30694. isBorderBox,
  30695. styles
  30696. ) : 0;
  30697. if (isBorderBox && scrollboxSizeBuggy) {
  30698. subtract -= Math.ceil(
  30699. elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - parseFloat(styles[dimension]) - boxModelAdjustment(elem, dimension, "border", false, styles) - 0.5
  30700. );
  30701. }
  30702. if (subtract && (matches = rcssNum.exec(value)) && (matches[3] || "px") !== "px") {
  30703. elem.style[dimension] = value;
  30704. value = jQuery.css(elem, dimension);
  30705. }
  30706. return setPositiveNumber(elem, value, subtract);
  30707. }
  30708. };
  30709. });
  30710. jQuery.cssHooks.marginLeft = addGetHookIf(
  30711. support.reliableMarginLeft,
  30712. function(elem, computed2) {
  30713. if (computed2) {
  30714. return (parseFloat(curCSS(elem, "marginLeft")) || elem.getBoundingClientRect().left - swap(elem, { marginLeft: 0 }, function() {
  30715. return elem.getBoundingClientRect().left;
  30716. })) + "px";
  30717. }
  30718. }
  30719. );
  30720. jQuery.each({
  30721. margin: "",
  30722. padding: "",
  30723. border: "Width"
  30724. }, function(prefix, suffix) {
  30725. jQuery.cssHooks[prefix + suffix] = {
  30726. expand: function(value) {
  30727. var i2 = 0, expanded = {}, parts = typeof value === "string" ? value.split(" ") : [value];
  30728. for (; i2 < 4; i2++) {
  30729. expanded[prefix + cssExpand[i2] + suffix] = parts[i2] || parts[i2 - 2] || parts[0];
  30730. }
  30731. return expanded;
  30732. }
  30733. };
  30734. if (prefix !== "margin") {
  30735. jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
  30736. }
  30737. });
  30738. jQuery.fn.extend({
  30739. css: function(name, value) {
  30740. return access(this, function(elem, name2, value2) {
  30741. var styles, len, map = {}, i2 = 0;
  30742. if (Array.isArray(name2)) {
  30743. styles = getStyles(elem);
  30744. len = name2.length;
  30745. for (; i2 < len; i2++) {
  30746. map[name2[i2]] = jQuery.css(elem, name2[i2], false, styles);
  30747. }
  30748. return map;
  30749. }
  30750. return value2 !== void 0 ? jQuery.style(elem, name2, value2) : jQuery.css(elem, name2);
  30751. }, name, value, arguments.length > 1);
  30752. }
  30753. });
  30754. function Tween(elem, options2, prop, end, easing) {
  30755. return new Tween.prototype.init(elem, options2, prop, end, easing);
  30756. }
  30757. jQuery.Tween = Tween;
  30758. Tween.prototype = {
  30759. constructor: Tween,
  30760. init: function(elem, options2, prop, end, easing, unit) {
  30761. this.elem = elem;
  30762. this.prop = prop;
  30763. this.easing = easing || jQuery.easing._default;
  30764. this.options = options2;
  30765. this.start = this.now = this.cur();
  30766. this.end = end;
  30767. this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
  30768. },
  30769. cur: function() {
  30770. var hooks3 = Tween.propHooks[this.prop];
  30771. return hooks3 && hooks3.get ? hooks3.get(this) : Tween.propHooks._default.get(this);
  30772. },
  30773. run: function(percent) {
  30774. var eased, hooks3 = Tween.propHooks[this.prop];
  30775. if (this.options.duration) {
  30776. this.pos = eased = jQuery.easing[this.easing](
  30777. percent,
  30778. this.options.duration * percent,
  30779. 0,
  30780. 1,
  30781. this.options.duration
  30782. );
  30783. } else {
  30784. this.pos = eased = percent;
  30785. }
  30786. this.now = (this.end - this.start) * eased + this.start;
  30787. if (this.options.step) {
  30788. this.options.step.call(this.elem, this.now, this);
  30789. }
  30790. if (hooks3 && hooks3.set) {
  30791. hooks3.set(this);
  30792. } else {
  30793. Tween.propHooks._default.set(this);
  30794. }
  30795. return this;
  30796. }
  30797. };
  30798. Tween.prototype.init.prototype = Tween.prototype;
  30799. Tween.propHooks = {
  30800. _default: {
  30801. get: function(tween) {
  30802. var result;
  30803. if (tween.elem.nodeType !== 1 || tween.elem[tween.prop] != null && tween.elem.style[tween.prop] == null) {
  30804. return tween.elem[tween.prop];
  30805. }
  30806. result = jQuery.css(tween.elem, tween.prop, "");
  30807. return !result || result === "auto" ? 0 : result;
  30808. },
  30809. set: function(tween) {
  30810. if (jQuery.fx.step[tween.prop]) {
  30811. jQuery.fx.step[tween.prop](tween);
  30812. } else if (tween.elem.nodeType === 1 && (jQuery.cssHooks[tween.prop] || tween.elem.style[finalPropName(tween.prop)] != null)) {
  30813. jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
  30814. } else {
  30815. tween.elem[tween.prop] = tween.now;
  30816. }
  30817. }
  30818. }
  30819. };
  30820. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  30821. set: function(tween) {
  30822. if (tween.elem.nodeType && tween.elem.parentNode) {
  30823. tween.elem[tween.prop] = tween.now;
  30824. }
  30825. }
  30826. };
  30827. jQuery.easing = {
  30828. linear: function(p) {
  30829. return p;
  30830. },
  30831. swing: function(p) {
  30832. return 0.5 - Math.cos(p * Math.PI) / 2;
  30833. },
  30834. _default: "swing"
  30835. };
  30836. jQuery.fx = Tween.prototype.init;
  30837. jQuery.fx.step = {};
  30838. var fxNow, inProgress, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/;
  30839. function schedule() {
  30840. if (inProgress) {
  30841. if (document2.hidden === false && window2.requestAnimationFrame) {
  30842. window2.requestAnimationFrame(schedule);
  30843. } else {
  30844. window2.setTimeout(schedule, jQuery.fx.interval);
  30845. }
  30846. jQuery.fx.tick();
  30847. }
  30848. }
  30849. function createFxNow() {
  30850. window2.setTimeout(function() {
  30851. fxNow = void 0;
  30852. });
  30853. return fxNow = Date.now();
  30854. }
  30855. function genFx(type2, includeWidth) {
  30856. var which, i2 = 0, attrs = { height: type2 };
  30857. includeWidth = includeWidth ? 1 : 0;
  30858. for (; i2 < 4; i2 += 2 - includeWidth) {
  30859. which = cssExpand[i2];
  30860. attrs["margin" + which] = attrs["padding" + which] = type2;
  30861. }
  30862. if (includeWidth) {
  30863. attrs.opacity = attrs.width = type2;
  30864. }
  30865. return attrs;
  30866. }
  30867. function createTween(value, prop, animation) {
  30868. var tween, collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners["*"]), index2 = 0, length = collection.length;
  30869. for (; index2 < length; index2++) {
  30870. if (tween = collection[index2].call(animation, prop, value)) {
  30871. return tween;
  30872. }
  30873. }
  30874. }
  30875. function defaultPrefilter(elem, props, opts) {
  30876. var prop, value, toggle, hooks3, oldfire, propTween, restoreDisplay, display, isBox = "width" in props || "height" in props, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHiddenWithinTree(elem), dataShow = dataPriv.get(elem, "fxshow");
  30877. if (!opts.queue) {
  30878. hooks3 = jQuery._queueHooks(elem, "fx");
  30879. if (hooks3.unqueued == null) {
  30880. hooks3.unqueued = 0;
  30881. oldfire = hooks3.empty.fire;
  30882. hooks3.empty.fire = function() {
  30883. if (!hooks3.unqueued) {
  30884. oldfire();
  30885. }
  30886. };
  30887. }
  30888. hooks3.unqueued++;
  30889. anim.always(function() {
  30890. anim.always(function() {
  30891. hooks3.unqueued--;
  30892. if (!jQuery.queue(elem, "fx").length) {
  30893. hooks3.empty.fire();
  30894. }
  30895. });
  30896. });
  30897. }
  30898. for (prop in props) {
  30899. value = props[prop];
  30900. if (rfxtypes.test(value)) {
  30901. delete props[prop];
  30902. toggle = toggle || value === "toggle";
  30903. if (value === (hidden ? "hide" : "show")) {
  30904. if (value === "show" && dataShow && dataShow[prop] !== void 0) {
  30905. hidden = true;
  30906. } else {
  30907. continue;
  30908. }
  30909. }
  30910. orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
  30911. }
  30912. }
  30913. propTween = !jQuery.isEmptyObject(props);
  30914. if (!propTween && jQuery.isEmptyObject(orig)) {
  30915. return;
  30916. }
  30917. if (isBox && elem.nodeType === 1) {
  30918. opts.overflow = [style.overflow, style.overflowX, style.overflowY];
  30919. restoreDisplay = dataShow && dataShow.display;
  30920. if (restoreDisplay == null) {
  30921. restoreDisplay = dataPriv.get(elem, "display");
  30922. }
  30923. display = jQuery.css(elem, "display");
  30924. if (display === "none") {
  30925. if (restoreDisplay) {
  30926. display = restoreDisplay;
  30927. } else {
  30928. showHide([elem], true);
  30929. restoreDisplay = elem.style.display || restoreDisplay;
  30930. display = jQuery.css(elem, "display");
  30931. showHide([elem]);
  30932. }
  30933. }
  30934. if (display === "inline" || display === "inline-block" && restoreDisplay != null) {
  30935. if (jQuery.css(elem, "float") === "none") {
  30936. if (!propTween) {
  30937. anim.done(function() {
  30938. style.display = restoreDisplay;
  30939. });
  30940. if (restoreDisplay == null) {
  30941. display = style.display;
  30942. restoreDisplay = display === "none" ? "" : display;
  30943. }
  30944. }
  30945. style.display = "inline-block";
  30946. }
  30947. }
  30948. }
  30949. if (opts.overflow) {
  30950. style.overflow = "hidden";
  30951. anim.always(function() {
  30952. style.overflow = opts.overflow[0];
  30953. style.overflowX = opts.overflow[1];
  30954. style.overflowY = opts.overflow[2];
  30955. });
  30956. }
  30957. propTween = false;
  30958. for (prop in orig) {
  30959. if (!propTween) {
  30960. if (dataShow) {
  30961. if ("hidden" in dataShow) {
  30962. hidden = dataShow.hidden;
  30963. }
  30964. } else {
  30965. dataShow = dataPriv.access(elem, "fxshow", { display: restoreDisplay });
  30966. }
  30967. if (toggle) {
  30968. dataShow.hidden = !hidden;
  30969. }
  30970. if (hidden) {
  30971. showHide([elem], true);
  30972. }
  30973. anim.done(function() {
  30974. if (!hidden) {
  30975. showHide([elem]);
  30976. }
  30977. dataPriv.remove(elem, "fxshow");
  30978. for (prop in orig) {
  30979. jQuery.style(elem, prop, orig[prop]);
  30980. }
  30981. });
  30982. }
  30983. propTween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
  30984. if (!(prop in dataShow)) {
  30985. dataShow[prop] = propTween.start;
  30986. if (hidden) {
  30987. propTween.end = propTween.start;
  30988. propTween.start = 0;
  30989. }
  30990. }
  30991. }
  30992. }
  30993. function propFilter(props, specialEasing) {
  30994. var index2, name, easing, value, hooks3;
  30995. for (index2 in props) {
  30996. name = camelCase3(index2);
  30997. easing = specialEasing[name];
  30998. value = props[index2];
  30999. if (Array.isArray(value)) {
  31000. easing = value[1];
  31001. value = props[index2] = value[0];
  31002. }
  31003. if (index2 !== name) {
  31004. props[name] = value;
  31005. delete props[index2];
  31006. }
  31007. hooks3 = jQuery.cssHooks[name];
  31008. if (hooks3 && "expand" in hooks3) {
  31009. value = hooks3.expand(value);
  31010. delete props[name];
  31011. for (index2 in value) {
  31012. if (!(index2 in props)) {
  31013. props[index2] = value[index2];
  31014. specialEasing[index2] = easing;
  31015. }
  31016. }
  31017. } else {
  31018. specialEasing[name] = easing;
  31019. }
  31020. }
  31021. }
  31022. function Animation(elem, properties, options2) {
  31023. var result, stopped, index2 = 0, length = Animation.prefilters.length, deferred = jQuery.Deferred().always(function() {
  31024. delete tick.elem;
  31025. }), tick = function() {
  31026. if (stopped) {
  31027. return false;
  31028. }
  31029. var currentTime = fxNow || createFxNow(), remaining = Math.max(0, animation.startTime + animation.duration - currentTime), temp = remaining / animation.duration || 0, percent = 1 - temp, index3 = 0, length2 = animation.tweens.length;
  31030. for (; index3 < length2; index3++) {
  31031. animation.tweens[index3].run(percent);
  31032. }
  31033. deferred.notifyWith(elem, [animation, percent, remaining]);
  31034. if (percent < 1 && length2) {
  31035. return remaining;
  31036. }
  31037. if (!length2) {
  31038. deferred.notifyWith(elem, [animation, 1, 0]);
  31039. }
  31040. deferred.resolveWith(elem, [animation]);
  31041. return false;
  31042. }, animation = deferred.promise({
  31043. elem,
  31044. props: jQuery.extend({}, properties),
  31045. opts: jQuery.extend(true, {
  31046. specialEasing: {},
  31047. easing: jQuery.easing._default
  31048. }, options2),
  31049. originalProperties: properties,
  31050. originalOptions: options2,
  31051. startTime: fxNow || createFxNow(),
  31052. duration: options2.duration,
  31053. tweens: [],
  31054. createTween: function(prop, end) {
  31055. var tween = jQuery.Tween(
  31056. elem,
  31057. animation.opts,
  31058. prop,
  31059. end,
  31060. animation.opts.specialEasing[prop] || animation.opts.easing
  31061. );
  31062. animation.tweens.push(tween);
  31063. return tween;
  31064. },
  31065. stop: function(gotoEnd) {
  31066. var index3 = 0, length2 = gotoEnd ? animation.tweens.length : 0;
  31067. if (stopped) {
  31068. return this;
  31069. }
  31070. stopped = true;
  31071. for (; index3 < length2; index3++) {
  31072. animation.tweens[index3].run(1);
  31073. }
  31074. if (gotoEnd) {
  31075. deferred.notifyWith(elem, [animation, 1, 0]);
  31076. deferred.resolveWith(elem, [animation, gotoEnd]);
  31077. } else {
  31078. deferred.rejectWith(elem, [animation, gotoEnd]);
  31079. }
  31080. return this;
  31081. }
  31082. }), props = animation.props;
  31083. propFilter(props, animation.opts.specialEasing);
  31084. for (; index2 < length; index2++) {
  31085. result = Animation.prefilters[index2].call(animation, elem, props, animation.opts);
  31086. if (result) {
  31087. if (isFunction2(result.stop)) {
  31088. jQuery._queueHooks(animation.elem, animation.opts.queue).stop = result.stop.bind(result);
  31089. }
  31090. return result;
  31091. }
  31092. }
  31093. jQuery.map(props, createTween, animation);
  31094. if (isFunction2(animation.opts.start)) {
  31095. animation.opts.start.call(elem, animation);
  31096. }
  31097. animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);
  31098. jQuery.fx.timer(
  31099. jQuery.extend(tick, {
  31100. elem,
  31101. anim: animation,
  31102. queue: animation.opts.queue
  31103. })
  31104. );
  31105. return animation;
  31106. }
  31107. jQuery.Animation = jQuery.extend(Animation, {
  31108. tweeners: {
  31109. "*": [function(prop, value) {
  31110. var tween = this.createTween(prop, value);
  31111. adjustCSS(tween.elem, prop, rcssNum.exec(value), tween);
  31112. return tween;
  31113. }]
  31114. },
  31115. tweener: function(props, callback2) {
  31116. if (isFunction2(props)) {
  31117. callback2 = props;
  31118. props = ["*"];
  31119. } else {
  31120. props = props.match(rnothtmlwhite);
  31121. }
  31122. var prop, index2 = 0, length = props.length;
  31123. for (; index2 < length; index2++) {
  31124. prop = props[index2];
  31125. Animation.tweeners[prop] = Animation.tweeners[prop] || [];
  31126. Animation.tweeners[prop].unshift(callback2);
  31127. }
  31128. },
  31129. prefilters: [defaultPrefilter],
  31130. prefilter: function(callback2, prepend) {
  31131. if (prepend) {
  31132. Animation.prefilters.unshift(callback2);
  31133. } else {
  31134. Animation.prefilters.push(callback2);
  31135. }
  31136. }
  31137. });
  31138. jQuery.speed = function(speed, easing, fn2) {
  31139. var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
  31140. complete: fn2 || !fn2 && easing || isFunction2(speed) && speed,
  31141. duration: speed,
  31142. easing: fn2 && easing || easing && !isFunction2(easing) && easing
  31143. };
  31144. if (jQuery.fx.off) {
  31145. opt.duration = 0;
  31146. } else {
  31147. if (typeof opt.duration !== "number") {
  31148. if (opt.duration in jQuery.fx.speeds) {
  31149. opt.duration = jQuery.fx.speeds[opt.duration];
  31150. } else {
  31151. opt.duration = jQuery.fx.speeds._default;
  31152. }
  31153. }
  31154. }
  31155. if (opt.queue == null || opt.queue === true) {
  31156. opt.queue = "fx";
  31157. }
  31158. opt.old = opt.complete;
  31159. opt.complete = function() {
  31160. if (isFunction2(opt.old)) {
  31161. opt.old.call(this);
  31162. }
  31163. if (opt.queue) {
  31164. jQuery.dequeue(this, opt.queue);
  31165. }
  31166. };
  31167. return opt;
  31168. };
  31169. jQuery.fn.extend({
  31170. fadeTo: function(speed, to, easing, callback2) {
  31171. return this.filter(isHiddenWithinTree).css("opacity", 0).show().end().animate({ opacity: to }, speed, easing, callback2);
  31172. },
  31173. animate: function(prop, speed, easing, callback2) {
  31174. var empty = jQuery.isEmptyObject(prop), optall = jQuery.speed(speed, easing, callback2), doAnimation = function() {
  31175. var anim = Animation(this, jQuery.extend({}, prop), optall);
  31176. if (empty || dataPriv.get(this, "finish")) {
  31177. anim.stop(true);
  31178. }
  31179. };
  31180. doAnimation.finish = doAnimation;
  31181. return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation);
  31182. },
  31183. stop: function(type2, clearQueue, gotoEnd) {
  31184. var stopQueue = function(hooks3) {
  31185. var stop = hooks3.stop;
  31186. delete hooks3.stop;
  31187. stop(gotoEnd);
  31188. };
  31189. if (typeof type2 !== "string") {
  31190. gotoEnd = clearQueue;
  31191. clearQueue = type2;
  31192. type2 = void 0;
  31193. }
  31194. if (clearQueue) {
  31195. this.queue(type2 || "fx", []);
  31196. }
  31197. return this.each(function() {
  31198. var dequeue3 = true, index2 = type2 != null && type2 + "queueHooks", timers = jQuery.timers, data = dataPriv.get(this);
  31199. if (index2) {
  31200. if (data[index2] && data[index2].stop) {
  31201. stopQueue(data[index2]);
  31202. }
  31203. } else {
  31204. for (index2 in data) {
  31205. if (data[index2] && data[index2].stop && rrun.test(index2)) {
  31206. stopQueue(data[index2]);
  31207. }
  31208. }
  31209. }
  31210. for (index2 = timers.length; index2--; ) {
  31211. if (timers[index2].elem === this && (type2 == null || timers[index2].queue === type2)) {
  31212. timers[index2].anim.stop(gotoEnd);
  31213. dequeue3 = false;
  31214. timers.splice(index2, 1);
  31215. }
  31216. }
  31217. if (dequeue3 || !gotoEnd) {
  31218. jQuery.dequeue(this, type2);
  31219. }
  31220. });
  31221. },
  31222. finish: function(type2) {
  31223. if (type2 !== false) {
  31224. type2 = type2 || "fx";
  31225. }
  31226. return this.each(function() {
  31227. var index2, data = dataPriv.get(this), queue = data[type2 + "queue"], hooks3 = data[type2 + "queueHooks"], timers = jQuery.timers, length = queue ? queue.length : 0;
  31228. data.finish = true;
  31229. jQuery.queue(this, type2, []);
  31230. if (hooks3 && hooks3.stop) {
  31231. hooks3.stop.call(this, true);
  31232. }
  31233. for (index2 = timers.length; index2--; ) {
  31234. if (timers[index2].elem === this && timers[index2].queue === type2) {
  31235. timers[index2].anim.stop(true);
  31236. timers.splice(index2, 1);
  31237. }
  31238. }
  31239. for (index2 = 0; index2 < length; index2++) {
  31240. if (queue[index2] && queue[index2].finish) {
  31241. queue[index2].finish.call(this);
  31242. }
  31243. }
  31244. delete data.finish;
  31245. });
  31246. }
  31247. });
  31248. jQuery.each(["toggle", "show", "hide"], function(_i, name) {
  31249. var cssFn = jQuery.fn[name];
  31250. jQuery.fn[name] = function(speed, easing, callback2) {
  31251. return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback2);
  31252. };
  31253. });
  31254. jQuery.each({
  31255. slideDown: genFx("show"),
  31256. slideUp: genFx("hide"),
  31257. slideToggle: genFx("toggle"),
  31258. fadeIn: { opacity: "show" },
  31259. fadeOut: { opacity: "hide" },
  31260. fadeToggle: { opacity: "toggle" }
  31261. }, function(name, props) {
  31262. jQuery.fn[name] = function(speed, easing, callback2) {
  31263. return this.animate(props, speed, easing, callback2);
  31264. };
  31265. });
  31266. jQuery.timers = [];
  31267. jQuery.fx.tick = function() {
  31268. var timer, i2 = 0, timers = jQuery.timers;
  31269. fxNow = Date.now();
  31270. for (; i2 < timers.length; i2++) {
  31271. timer = timers[i2];
  31272. if (!timer() && timers[i2] === timer) {
  31273. timers.splice(i2--, 1);
  31274. }
  31275. }
  31276. if (!timers.length) {
  31277. jQuery.fx.stop();
  31278. }
  31279. fxNow = void 0;
  31280. };
  31281. jQuery.fx.timer = function(timer) {
  31282. jQuery.timers.push(timer);
  31283. jQuery.fx.start();
  31284. };
  31285. jQuery.fx.interval = 13;
  31286. jQuery.fx.start = function() {
  31287. if (inProgress) {
  31288. return;
  31289. }
  31290. inProgress = true;
  31291. schedule();
  31292. };
  31293. jQuery.fx.stop = function() {
  31294. inProgress = null;
  31295. };
  31296. jQuery.fx.speeds = {
  31297. slow: 600,
  31298. fast: 200,
  31299. _default: 400
  31300. };
  31301. jQuery.fn.delay = function(time, type2) {
  31302. time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
  31303. type2 = type2 || "fx";
  31304. return this.queue(type2, function(next, hooks3) {
  31305. var timeout = window2.setTimeout(next, time);
  31306. hooks3.stop = function() {
  31307. window2.clearTimeout(timeout);
  31308. };
  31309. });
  31310. };
  31311. (function() {
  31312. var input = document2.createElement("input"), select = document2.createElement("select"), opt = select.appendChild(document2.createElement("option"));
  31313. input.type = "checkbox";
  31314. support.checkOn = input.value !== "";
  31315. support.optSelected = opt.selected;
  31316. input = document2.createElement("input");
  31317. input.value = "t";
  31318. input.type = "radio";
  31319. support.radioValue = input.value === "t";
  31320. })();
  31321. var boolHook, attrHandle = jQuery.expr.attrHandle;
  31322. jQuery.fn.extend({
  31323. attr: function(name, value) {
  31324. return access(this, jQuery.attr, name, value, arguments.length > 1);
  31325. },
  31326. removeAttr: function(name) {
  31327. return this.each(function() {
  31328. jQuery.removeAttr(this, name);
  31329. });
  31330. }
  31331. });
  31332. jQuery.extend({
  31333. attr: function(elem, name, value) {
  31334. var ret, hooks3, nType = elem.nodeType;
  31335. if (nType === 3 || nType === 8 || nType === 2) {
  31336. return;
  31337. }
  31338. if (typeof elem.getAttribute === "undefined") {
  31339. return jQuery.prop(elem, name, value);
  31340. }
  31341. if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
  31342. hooks3 = jQuery.attrHooks[name.toLowerCase()] || (jQuery.expr.match.bool.test(name) ? boolHook : void 0);
  31343. }
  31344. if (value !== void 0) {
  31345. if (value === null) {
  31346. jQuery.removeAttr(elem, name);
  31347. return;
  31348. }
  31349. if (hooks3 && "set" in hooks3 && (ret = hooks3.set(elem, value, name)) !== void 0) {
  31350. return ret;
  31351. }
  31352. elem.setAttribute(name, value + "");
  31353. return value;
  31354. }
  31355. if (hooks3 && "get" in hooks3 && (ret = hooks3.get(elem, name)) !== null) {
  31356. return ret;
  31357. }
  31358. ret = jQuery.find.attr(elem, name);
  31359. return ret == null ? void 0 : ret;
  31360. },
  31361. attrHooks: {
  31362. type: {
  31363. set: function(elem, value) {
  31364. if (!support.radioValue && value === "radio" && nodeName(elem, "input")) {
  31365. var val = elem.value;
  31366. elem.setAttribute("type", value);
  31367. if (val) {
  31368. elem.value = val;
  31369. }
  31370. return value;
  31371. }
  31372. }
  31373. }
  31374. },
  31375. removeAttr: function(elem, value) {
  31376. var name, i2 = 0, attrNames = value && value.match(rnothtmlwhite);
  31377. if (attrNames && elem.nodeType === 1) {
  31378. while (name = attrNames[i2++]) {
  31379. elem.removeAttribute(name);
  31380. }
  31381. }
  31382. }
  31383. });
  31384. boolHook = {
  31385. set: function(elem, value, name) {
  31386. if (value === false) {
  31387. jQuery.removeAttr(elem, name);
  31388. } else {
  31389. elem.setAttribute(name, name);
  31390. }
  31391. return name;
  31392. }
  31393. };
  31394. jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(_i, name) {
  31395. var getter = attrHandle[name] || jQuery.find.attr;
  31396. attrHandle[name] = function(elem, name2, isXML) {
  31397. var ret, handle, lowercaseName = name2.toLowerCase();
  31398. if (!isXML) {
  31399. handle = attrHandle[lowercaseName];
  31400. attrHandle[lowercaseName] = ret;
  31401. ret = getter(elem, name2, isXML) != null ? lowercaseName : null;
  31402. attrHandle[lowercaseName] = handle;
  31403. }
  31404. return ret;
  31405. };
  31406. });
  31407. var rfocusable = /^(?:input|select|textarea|button)$/i, rclickable = /^(?:a|area)$/i;
  31408. jQuery.fn.extend({
  31409. prop: function(name, value) {
  31410. return access(this, jQuery.prop, name, value, arguments.length > 1);
  31411. },
  31412. removeProp: function(name) {
  31413. return this.each(function() {
  31414. delete this[jQuery.propFix[name] || name];
  31415. });
  31416. }
  31417. });
  31418. jQuery.extend({
  31419. prop: function(elem, name, value) {
  31420. var ret, hooks3, nType = elem.nodeType;
  31421. if (nType === 3 || nType === 8 || nType === 2) {
  31422. return;
  31423. }
  31424. if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
  31425. name = jQuery.propFix[name] || name;
  31426. hooks3 = jQuery.propHooks[name];
  31427. }
  31428. if (value !== void 0) {
  31429. if (hooks3 && "set" in hooks3 && (ret = hooks3.set(elem, value, name)) !== void 0) {
  31430. return ret;
  31431. }
  31432. return elem[name] = value;
  31433. }
  31434. if (hooks3 && "get" in hooks3 && (ret = hooks3.get(elem, name)) !== null) {
  31435. return ret;
  31436. }
  31437. return elem[name];
  31438. },
  31439. propHooks: {
  31440. tabIndex: {
  31441. get: function(elem) {
  31442. var tabindex = jQuery.find.attr(elem, "tabindex");
  31443. if (tabindex) {
  31444. return parseInt(tabindex, 10);
  31445. }
  31446. if (rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href) {
  31447. return 0;
  31448. }
  31449. return -1;
  31450. }
  31451. }
  31452. },
  31453. propFix: {
  31454. "for": "htmlFor",
  31455. "class": "className"
  31456. }
  31457. });
  31458. if (!support.optSelected) {
  31459. jQuery.propHooks.selected = {
  31460. get: function(elem) {
  31461. var parent = elem.parentNode;
  31462. if (parent && parent.parentNode) {
  31463. parent.parentNode.selectedIndex;
  31464. }
  31465. return null;
  31466. },
  31467. set: function(elem) {
  31468. var parent = elem.parentNode;
  31469. if (parent) {
  31470. parent.selectedIndex;
  31471. if (parent.parentNode) {
  31472. parent.parentNode.selectedIndex;
  31473. }
  31474. }
  31475. }
  31476. };
  31477. }
  31478. jQuery.each([
  31479. "tabIndex",
  31480. "readOnly",
  31481. "maxLength",
  31482. "cellSpacing",
  31483. "cellPadding",
  31484. "rowSpan",
  31485. "colSpan",
  31486. "useMap",
  31487. "frameBorder",
  31488. "contentEditable"
  31489. ], function() {
  31490. jQuery.propFix[this.toLowerCase()] = this;
  31491. });
  31492. function stripAndCollapse(value) {
  31493. var tokens = value.match(rnothtmlwhite) || [];
  31494. return tokens.join(" ");
  31495. }
  31496. function getClass2(elem) {
  31497. return elem.getAttribute && elem.getAttribute("class") || "";
  31498. }
  31499. function classesToArray(value) {
  31500. if (Array.isArray(value)) {
  31501. return value;
  31502. }
  31503. if (typeof value === "string") {
  31504. return value.match(rnothtmlwhite) || [];
  31505. }
  31506. return [];
  31507. }
  31508. jQuery.fn.extend({
  31509. addClass: function(value) {
  31510. var classNames, cur, curValue, className, i2, finalValue;
  31511. if (isFunction2(value)) {
  31512. return this.each(function(j) {
  31513. jQuery(this).addClass(value.call(this, j, getClass2(this)));
  31514. });
  31515. }
  31516. classNames = classesToArray(value);
  31517. if (classNames.length) {
  31518. return this.each(function() {
  31519. curValue = getClass2(this);
  31520. cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
  31521. if (cur) {
  31522. for (i2 = 0; i2 < classNames.length; i2++) {
  31523. className = classNames[i2];
  31524. if (cur.indexOf(" " + className + " ") < 0) {
  31525. cur += className + " ";
  31526. }
  31527. }
  31528. finalValue = stripAndCollapse(cur);
  31529. if (curValue !== finalValue) {
  31530. this.setAttribute("class", finalValue);
  31531. }
  31532. }
  31533. });
  31534. }
  31535. return this;
  31536. },
  31537. removeClass: function(value) {
  31538. var classNames, cur, curValue, className, i2, finalValue;
  31539. if (isFunction2(value)) {
  31540. return this.each(function(j) {
  31541. jQuery(this).removeClass(value.call(this, j, getClass2(this)));
  31542. });
  31543. }
  31544. if (!arguments.length) {
  31545. return this.attr("class", "");
  31546. }
  31547. classNames = classesToArray(value);
  31548. if (classNames.length) {
  31549. return this.each(function() {
  31550. curValue = getClass2(this);
  31551. cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
  31552. if (cur) {
  31553. for (i2 = 0; i2 < classNames.length; i2++) {
  31554. className = classNames[i2];
  31555. while (cur.indexOf(" " + className + " ") > -1) {
  31556. cur = cur.replace(" " + className + " ", " ");
  31557. }
  31558. }
  31559. finalValue = stripAndCollapse(cur);
  31560. if (curValue !== finalValue) {
  31561. this.setAttribute("class", finalValue);
  31562. }
  31563. }
  31564. });
  31565. }
  31566. return this;
  31567. },
  31568. toggleClass: function(value, stateVal) {
  31569. var classNames, className, i2, self2, type2 = typeof value, isValidValue = type2 === "string" || Array.isArray(value);
  31570. if (isFunction2(value)) {
  31571. return this.each(function(i3) {
  31572. jQuery(this).toggleClass(
  31573. value.call(this, i3, getClass2(this), stateVal),
  31574. stateVal
  31575. );
  31576. });
  31577. }
  31578. if (typeof stateVal === "boolean" && isValidValue) {
  31579. return stateVal ? this.addClass(value) : this.removeClass(value);
  31580. }
  31581. classNames = classesToArray(value);
  31582. return this.each(function() {
  31583. if (isValidValue) {
  31584. self2 = jQuery(this);
  31585. for (i2 = 0; i2 < classNames.length; i2++) {
  31586. className = classNames[i2];
  31587. if (self2.hasClass(className)) {
  31588. self2.removeClass(className);
  31589. } else {
  31590. self2.addClass(className);
  31591. }
  31592. }
  31593. } else if (value === void 0 || type2 === "boolean") {
  31594. className = getClass2(this);
  31595. if (className) {
  31596. dataPriv.set(this, "__className__", className);
  31597. }
  31598. if (this.setAttribute) {
  31599. this.setAttribute(
  31600. "class",
  31601. className || value === false ? "" : dataPriv.get(this, "__className__") || ""
  31602. );
  31603. }
  31604. }
  31605. });
  31606. },
  31607. hasClass: function(selector) {
  31608. var className, elem, i2 = 0;
  31609. className = " " + selector + " ";
  31610. while (elem = this[i2++]) {
  31611. if (elem.nodeType === 1 && (" " + stripAndCollapse(getClass2(elem)) + " ").indexOf(className) > -1) {
  31612. return true;
  31613. }
  31614. }
  31615. return false;
  31616. }
  31617. });
  31618. var rreturn = /\r/g;
  31619. jQuery.fn.extend({
  31620. val: function(value) {
  31621. var hooks3, ret, valueIsFunction, elem = this[0];
  31622. if (!arguments.length) {
  31623. if (elem) {
  31624. hooks3 = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
  31625. if (hooks3 && "get" in hooks3 && (ret = hooks3.get(elem, "value")) !== void 0) {
  31626. return ret;
  31627. }
  31628. ret = elem.value;
  31629. if (typeof ret === "string") {
  31630. return ret.replace(rreturn, "");
  31631. }
  31632. return ret == null ? "" : ret;
  31633. }
  31634. return;
  31635. }
  31636. valueIsFunction = isFunction2(value);
  31637. return this.each(function(i2) {
  31638. var val;
  31639. if (this.nodeType !== 1) {
  31640. return;
  31641. }
  31642. if (valueIsFunction) {
  31643. val = value.call(this, i2, jQuery(this).val());
  31644. } else {
  31645. val = value;
  31646. }
  31647. if (val == null) {
  31648. val = "";
  31649. } else if (typeof val === "number") {
  31650. val += "";
  31651. } else if (Array.isArray(val)) {
  31652. val = jQuery.map(val, function(value2) {
  31653. return value2 == null ? "" : value2 + "";
  31654. });
  31655. }
  31656. hooks3 = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
  31657. if (!hooks3 || !("set" in hooks3) || hooks3.set(this, val, "value") === void 0) {
  31658. this.value = val;
  31659. }
  31660. });
  31661. }
  31662. });
  31663. jQuery.extend({
  31664. valHooks: {
  31665. option: {
  31666. get: function(elem) {
  31667. var val = jQuery.find.attr(elem, "value");
  31668. return val != null ? val : stripAndCollapse(jQuery.text(elem));
  31669. }
  31670. },
  31671. select: {
  31672. get: function(elem) {
  31673. var value, option, i2, options2 = elem.options, index2 = elem.selectedIndex, one3 = elem.type === "select-one", values3 = one3 ? null : [], max2 = one3 ? index2 + 1 : options2.length;
  31674. if (index2 < 0) {
  31675. i2 = max2;
  31676. } else {
  31677. i2 = one3 ? index2 : 0;
  31678. }
  31679. for (; i2 < max2; i2++) {
  31680. option = options2[i2];
  31681. if ((option.selected || i2 === index2) && !option.disabled && (!option.parentNode.disabled || !nodeName(option.parentNode, "optgroup"))) {
  31682. value = jQuery(option).val();
  31683. if (one3) {
  31684. return value;
  31685. }
  31686. values3.push(value);
  31687. }
  31688. }
  31689. return values3;
  31690. },
  31691. set: function(elem, value) {
  31692. var optionSet, option, options2 = elem.options, values3 = jQuery.makeArray(value), i2 = options2.length;
  31693. while (i2--) {
  31694. option = options2[i2];
  31695. if (option.selected = jQuery.inArray(jQuery.valHooks.option.get(option), values3) > -1) {
  31696. optionSet = true;
  31697. }
  31698. }
  31699. if (!optionSet) {
  31700. elem.selectedIndex = -1;
  31701. }
  31702. return values3;
  31703. }
  31704. }
  31705. }
  31706. });
  31707. jQuery.each(["radio", "checkbox"], function() {
  31708. jQuery.valHooks[this] = {
  31709. set: function(elem, value) {
  31710. if (Array.isArray(value)) {
  31711. return elem.checked = jQuery.inArray(jQuery(elem).val(), value) > -1;
  31712. }
  31713. }
  31714. };
  31715. if (!support.checkOn) {
  31716. jQuery.valHooks[this].get = function(elem) {
  31717. return elem.getAttribute("value") === null ? "on" : elem.value;
  31718. };
  31719. }
  31720. });
  31721. var location = window2.location;
  31722. var nonce = { guid: Date.now() };
  31723. var rquery = /\?/;
  31724. jQuery.parseXML = function(data) {
  31725. var xml, parserErrorElem;
  31726. if (!data || typeof data !== "string") {
  31727. return null;
  31728. }
  31729. try {
  31730. xml = new window2.DOMParser().parseFromString(data, "text/xml");
  31731. } catch (e) {
  31732. }
  31733. parserErrorElem = xml && xml.getElementsByTagName("parsererror")[0];
  31734. if (!xml || parserErrorElem) {
  31735. jQuery.error("Invalid XML: " + (parserErrorElem ? jQuery.map(parserErrorElem.childNodes, function(el) {
  31736. return el.textContent;
  31737. }).join("\n") : data));
  31738. }
  31739. return xml;
  31740. };
  31741. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, stopPropagationCallback = function(e) {
  31742. e.stopPropagation();
  31743. };
  31744. jQuery.extend(jQuery.event, {
  31745. trigger: function(event2, data, elem, onlyHandlers) {
  31746. var i2, cur, tmp, bubbleType, ontype, handle, special, lastElement, eventPath = [elem || document2], type2 = hasOwn2.call(event2, "type") ? event2.type : event2, namespaces = hasOwn2.call(event2, "namespace") ? event2.namespace.split(".") : [];
  31747. cur = lastElement = tmp = elem = elem || document2;
  31748. if (elem.nodeType === 3 || elem.nodeType === 8) {
  31749. return;
  31750. }
  31751. if (rfocusMorph.test(type2 + jQuery.event.triggered)) {
  31752. return;
  31753. }
  31754. if (type2.indexOf(".") > -1) {
  31755. namespaces = type2.split(".");
  31756. type2 = namespaces.shift();
  31757. namespaces.sort();
  31758. }
  31759. ontype = type2.indexOf(":") < 0 && "on" + type2;
  31760. event2 = event2[jQuery.expando] ? event2 : new jQuery.Event(type2, typeof event2 === "object" && event2);
  31761. event2.isTrigger = onlyHandlers ? 2 : 3;
  31762. event2.namespace = namespaces.join(".");
  31763. event2.rnamespace = event2.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
  31764. event2.result = void 0;
  31765. if (!event2.target) {
  31766. event2.target = elem;
  31767. }
  31768. data = data == null ? [event2] : jQuery.makeArray(data, [event2]);
  31769. special = jQuery.event.special[type2] || {};
  31770. if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {
  31771. return;
  31772. }
  31773. if (!onlyHandlers && !special.noBubble && !isWindow(elem)) {
  31774. bubbleType = special.delegateType || type2;
  31775. if (!rfocusMorph.test(bubbleType + type2)) {
  31776. cur = cur.parentNode;
  31777. }
  31778. for (; cur; cur = cur.parentNode) {
  31779. eventPath.push(cur);
  31780. tmp = cur;
  31781. }
  31782. if (tmp === (elem.ownerDocument || document2)) {
  31783. eventPath.push(tmp.defaultView || tmp.parentWindow || window2);
  31784. }
  31785. }
  31786. i2 = 0;
  31787. while ((cur = eventPath[i2++]) && !event2.isPropagationStopped()) {
  31788. lastElement = cur;
  31789. event2.type = i2 > 1 ? bubbleType : special.bindType || type2;
  31790. handle = (dataPriv.get(cur, "events") || /* @__PURE__ */ Object.create(null))[event2.type] && dataPriv.get(cur, "handle");
  31791. if (handle) {
  31792. handle.apply(cur, data);
  31793. }
  31794. handle = ontype && cur[ontype];
  31795. if (handle && handle.apply && acceptData(cur)) {
  31796. event2.result = handle.apply(cur, data);
  31797. if (event2.result === false) {
  31798. event2.preventDefault();
  31799. }
  31800. }
  31801. }
  31802. event2.type = type2;
  31803. if (!onlyHandlers && !event2.isDefaultPrevented()) {
  31804. if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && acceptData(elem)) {
  31805. if (ontype && isFunction2(elem[type2]) && !isWindow(elem)) {
  31806. tmp = elem[ontype];
  31807. if (tmp) {
  31808. elem[ontype] = null;
  31809. }
  31810. jQuery.event.triggered = type2;
  31811. if (event2.isPropagationStopped()) {
  31812. lastElement.addEventListener(type2, stopPropagationCallback);
  31813. }
  31814. elem[type2]();
  31815. if (event2.isPropagationStopped()) {
  31816. lastElement.removeEventListener(type2, stopPropagationCallback);
  31817. }
  31818. jQuery.event.triggered = void 0;
  31819. if (tmp) {
  31820. elem[ontype] = tmp;
  31821. }
  31822. }
  31823. }
  31824. }
  31825. return event2.result;
  31826. },
  31827. simulate: function(type2, elem, event2) {
  31828. var e = jQuery.extend(
  31829. new jQuery.Event(),
  31830. event2,
  31831. {
  31832. type: type2,
  31833. isSimulated: true
  31834. }
  31835. );
  31836. jQuery.event.trigger(e, null, elem);
  31837. }
  31838. });
  31839. jQuery.fn.extend({
  31840. trigger: function(type2, data) {
  31841. return this.each(function() {
  31842. jQuery.event.trigger(type2, data, this);
  31843. });
  31844. },
  31845. triggerHandler: function(type2, data) {
  31846. var elem = this[0];
  31847. if (elem) {
  31848. return jQuery.event.trigger(type2, data, elem, true);
  31849. }
  31850. }
  31851. });
  31852. var rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i;
  31853. function buildParams(prefix, obj, traditional, add) {
  31854. var name;
  31855. if (Array.isArray(obj)) {
  31856. jQuery.each(obj, function(i2, v) {
  31857. if (traditional || rbracket.test(prefix)) {
  31858. add(prefix, v);
  31859. } else {
  31860. buildParams(
  31861. prefix + "[" + (typeof v === "object" && v != null ? i2 : "") + "]",
  31862. v,
  31863. traditional,
  31864. add
  31865. );
  31866. }
  31867. });
  31868. } else if (!traditional && toType(obj) === "object") {
  31869. for (name in obj) {
  31870. buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
  31871. }
  31872. } else {
  31873. add(prefix, obj);
  31874. }
  31875. }
  31876. jQuery.param = function(a, traditional) {
  31877. var prefix, s = [], add = function(key, valueOrFunction) {
  31878. var value = isFunction2(valueOrFunction) ? valueOrFunction() : valueOrFunction;
  31879. s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value == null ? "" : value);
  31880. };
  31881. if (a == null) {
  31882. return "";
  31883. }
  31884. if (Array.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) {
  31885. jQuery.each(a, function() {
  31886. add(this.name, this.value);
  31887. });
  31888. } else {
  31889. for (prefix in a) {
  31890. buildParams(prefix, a[prefix], traditional, add);
  31891. }
  31892. }
  31893. return s.join("&");
  31894. };
  31895. jQuery.fn.extend({
  31896. serialize: function() {
  31897. return jQuery.param(this.serializeArray());
  31898. },
  31899. serializeArray: function() {
  31900. return this.map(function() {
  31901. var elements = jQuery.prop(this, "elements");
  31902. return elements ? jQuery.makeArray(elements) : this;
  31903. }).filter(function() {
  31904. var type2 = this.type;
  31905. return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type2) && (this.checked || !rcheckableType.test(type2));
  31906. }).map(function(_i, elem) {
  31907. var val = jQuery(this).val();
  31908. if (val == null) {
  31909. return null;
  31910. }
  31911. if (Array.isArray(val)) {
  31912. return jQuery.map(val, function(val2) {
  31913. return { name: elem.name, value: val2.replace(rCRLF, "\r\n") };
  31914. });
  31915. }
  31916. return { name: elem.name, value: val.replace(rCRLF, "\r\n") };
  31917. }).get();
  31918. }
  31919. });
  31920. var r20 = /%20/g, rhash = /#.*$/, rantiCache = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, prefilters = {}, transports = {}, allTypes = "*/".concat("*"), originAnchor = document2.createElement("a");
  31921. originAnchor.href = location.href;
  31922. function addToPrefiltersOrTransports(structure) {
  31923. return function(dataTypeExpression, func) {
  31924. if (typeof dataTypeExpression !== "string") {
  31925. func = dataTypeExpression;
  31926. dataTypeExpression = "*";
  31927. }
  31928. var dataType, i2 = 0, dataTypes = dataTypeExpression.toLowerCase().match(rnothtmlwhite) || [];
  31929. if (isFunction2(func)) {
  31930. while (dataType = dataTypes[i2++]) {
  31931. if (dataType[0] === "+") {
  31932. dataType = dataType.slice(1) || "*";
  31933. (structure[dataType] = structure[dataType] || []).unshift(func);
  31934. } else {
  31935. (structure[dataType] = structure[dataType] || []).push(func);
  31936. }
  31937. }
  31938. }
  31939. };
  31940. }
  31941. function inspectPrefiltersOrTransports(structure, options2, originalOptions, jqXHR) {
  31942. var inspected = {}, seekingTransport = structure === transports;
  31943. function inspect(dataType) {
  31944. var selected;
  31945. inspected[dataType] = true;
  31946. jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) {
  31947. var dataTypeOrTransport = prefilterOrFactory(options2, originalOptions, jqXHR);
  31948. if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) {
  31949. options2.dataTypes.unshift(dataTypeOrTransport);
  31950. inspect(dataTypeOrTransport);
  31951. return false;
  31952. } else if (seekingTransport) {
  31953. return !(selected = dataTypeOrTransport);
  31954. }
  31955. });
  31956. return selected;
  31957. }
  31958. return inspect(options2.dataTypes[0]) || !inspected["*"] && inspect("*");
  31959. }
  31960. function ajaxExtend(target, src) {
  31961. var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {};
  31962. for (key in src) {
  31963. if (src[key] !== void 0) {
  31964. (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];
  31965. }
  31966. }
  31967. if (deep) {
  31968. jQuery.extend(true, target, deep);
  31969. }
  31970. return target;
  31971. }
  31972. function ajaxHandleResponses(s, jqXHR, responses) {
  31973. var ct2, type2, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes;
  31974. while (dataTypes[0] === "*") {
  31975. dataTypes.shift();
  31976. if (ct2 === void 0) {
  31977. ct2 = s.mimeType || jqXHR.getResponseHeader("Content-Type");
  31978. }
  31979. }
  31980. if (ct2) {
  31981. for (type2 in contents) {
  31982. if (contents[type2] && contents[type2].test(ct2)) {
  31983. dataTypes.unshift(type2);
  31984. break;
  31985. }
  31986. }
  31987. }
  31988. if (dataTypes[0] in responses) {
  31989. finalDataType = dataTypes[0];
  31990. } else {
  31991. for (type2 in responses) {
  31992. if (!dataTypes[0] || s.converters[type2 + " " + dataTypes[0]]) {
  31993. finalDataType = type2;
  31994. break;
  31995. }
  31996. if (!firstDataType) {
  31997. firstDataType = type2;
  31998. }
  31999. }
  32000. finalDataType = finalDataType || firstDataType;
  32001. }
  32002. if (finalDataType) {
  32003. if (finalDataType !== dataTypes[0]) {
  32004. dataTypes.unshift(finalDataType);
  32005. }
  32006. return responses[finalDataType];
  32007. }
  32008. }
  32009. function ajaxConvert(s, response, jqXHR, isSuccess) {
  32010. var conv2, current, conv, tmp, prev, converters = {}, dataTypes = s.dataTypes.slice();
  32011. if (dataTypes[1]) {
  32012. for (conv in s.converters) {
  32013. converters[conv.toLowerCase()] = s.converters[conv];
  32014. }
  32015. }
  32016. current = dataTypes.shift();
  32017. while (current) {
  32018. if (s.responseFields[current]) {
  32019. jqXHR[s.responseFields[current]] = response;
  32020. }
  32021. if (!prev && isSuccess && s.dataFilter) {
  32022. response = s.dataFilter(response, s.dataType);
  32023. }
  32024. prev = current;
  32025. current = dataTypes.shift();
  32026. if (current) {
  32027. if (current === "*") {
  32028. current = prev;
  32029. } else if (prev !== "*" && prev !== current) {
  32030. conv = converters[prev + " " + current] || converters["* " + current];
  32031. if (!conv) {
  32032. for (conv2 in converters) {
  32033. tmp = conv2.split(" ");
  32034. if (tmp[1] === current) {
  32035. conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]];
  32036. if (conv) {
  32037. if (conv === true) {
  32038. conv = converters[conv2];
  32039. } else if (converters[conv2] !== true) {
  32040. current = tmp[0];
  32041. dataTypes.unshift(tmp[1]);
  32042. }
  32043. break;
  32044. }
  32045. }
  32046. }
  32047. }
  32048. if (conv !== true) {
  32049. if (conv && s.throws) {
  32050. response = conv(response);
  32051. } else {
  32052. try {
  32053. response = conv(response);
  32054. } catch (e) {
  32055. return {
  32056. state: "parsererror",
  32057. error: conv ? e : "No conversion from " + prev + " to " + current
  32058. };
  32059. }
  32060. }
  32061. }
  32062. }
  32063. }
  32064. }
  32065. return { state: "success", data: response };
  32066. }
  32067. jQuery.extend({
  32068. active: 0,
  32069. lastModified: {},
  32070. etag: {},
  32071. ajaxSettings: {
  32072. url: location.href,
  32073. type: "GET",
  32074. isLocal: rlocalProtocol.test(location.protocol),
  32075. global: true,
  32076. processData: true,
  32077. async: true,
  32078. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  32079. accepts: {
  32080. "*": allTypes,
  32081. text: "text/plain",
  32082. html: "text/html",
  32083. xml: "application/xml, text/xml",
  32084. json: "application/json, text/javascript"
  32085. },
  32086. contents: {
  32087. xml: /\bxml\b/,
  32088. html: /\bhtml/,
  32089. json: /\bjson\b/
  32090. },
  32091. responseFields: {
  32092. xml: "responseXML",
  32093. text: "responseText",
  32094. json: "responseJSON"
  32095. },
  32096. converters: {
  32097. "* text": String,
  32098. "text html": true,
  32099. "text json": JSON.parse,
  32100. "text xml": jQuery.parseXML
  32101. },
  32102. flatOptions: {
  32103. url: true,
  32104. context: true
  32105. }
  32106. },
  32107. ajaxSetup: function(target, settings) {
  32108. return settings ? ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) : ajaxExtend(jQuery.ajaxSettings, target);
  32109. },
  32110. ajaxPrefilter: addToPrefiltersOrTransports(prefilters),
  32111. ajaxTransport: addToPrefiltersOrTransports(transports),
  32112. ajax: function(url, options2) {
  32113. if (typeof url === "object") {
  32114. options2 = url;
  32115. url = void 0;
  32116. }
  32117. options2 = options2 || {};
  32118. var transport, cacheURL, responseHeadersString, responseHeaders, timeoutTimer, urlAnchor, completed2, fireGlobals, i2, uncached, s = jQuery.ajaxSetup({}, options2), callbackContext = s.context || s, globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event, deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), statusCode = s.statusCode || {}, requestHeaders = {}, requestHeadersNames = {}, strAbort = "canceled", jqXHR = {
  32119. readyState: 0,
  32120. getResponseHeader: function(key) {
  32121. var match;
  32122. if (completed2) {
  32123. if (!responseHeaders) {
  32124. responseHeaders = {};
  32125. while (match = rheaders.exec(responseHeadersString)) {
  32126. responseHeaders[match[1].toLowerCase() + " "] = (responseHeaders[match[1].toLowerCase() + " "] || []).concat(match[2]);
  32127. }
  32128. }
  32129. match = responseHeaders[key.toLowerCase() + " "];
  32130. }
  32131. return match == null ? null : match.join(", ");
  32132. },
  32133. getAllResponseHeaders: function() {
  32134. return completed2 ? responseHeadersString : null;
  32135. },
  32136. setRequestHeader: function(name, value) {
  32137. if (completed2 == null) {
  32138. name = requestHeadersNames[name.toLowerCase()] = requestHeadersNames[name.toLowerCase()] || name;
  32139. requestHeaders[name] = value;
  32140. }
  32141. return this;
  32142. },
  32143. overrideMimeType: function(type2) {
  32144. if (completed2 == null) {
  32145. s.mimeType = type2;
  32146. }
  32147. return this;
  32148. },
  32149. statusCode: function(map) {
  32150. var code;
  32151. if (map) {
  32152. if (completed2) {
  32153. jqXHR.always(map[jqXHR.status]);
  32154. } else {
  32155. for (code in map) {
  32156. statusCode[code] = [statusCode[code], map[code]];
  32157. }
  32158. }
  32159. }
  32160. return this;
  32161. },
  32162. abort: function(statusText) {
  32163. var finalText = statusText || strAbort;
  32164. if (transport) {
  32165. transport.abort(finalText);
  32166. }
  32167. done(0, finalText);
  32168. return this;
  32169. }
  32170. };
  32171. deferred.promise(jqXHR);
  32172. s.url = ((url || s.url || location.href) + "").replace(rprotocol, location.protocol + "//");
  32173. s.type = options2.method || options2.type || s.method || s.type;
  32174. s.dataTypes = (s.dataType || "*").toLowerCase().match(rnothtmlwhite) || [""];
  32175. if (s.crossDomain == null) {
  32176. urlAnchor = document2.createElement("a");
  32177. try {
  32178. urlAnchor.href = s.url;
  32179. urlAnchor.href = urlAnchor.href;
  32180. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host;
  32181. } catch (e) {
  32182. s.crossDomain = true;
  32183. }
  32184. }
  32185. if (s.data && s.processData && typeof s.data !== "string") {
  32186. s.data = jQuery.param(s.data, s.traditional);
  32187. }
  32188. inspectPrefiltersOrTransports(prefilters, s, options2, jqXHR);
  32189. if (completed2) {
  32190. return jqXHR;
  32191. }
  32192. fireGlobals = jQuery.event && s.global;
  32193. if (fireGlobals && jQuery.active++ === 0) {
  32194. jQuery.event.trigger("ajaxStart");
  32195. }
  32196. s.type = s.type.toUpperCase();
  32197. s.hasContent = !rnoContent.test(s.type);
  32198. cacheURL = s.url.replace(rhash, "");
  32199. if (!s.hasContent) {
  32200. uncached = s.url.slice(cacheURL.length);
  32201. if (s.data && (s.processData || typeof s.data === "string")) {
  32202. cacheURL += (rquery.test(cacheURL) ? "&" : "?") + s.data;
  32203. delete s.data;
  32204. }
  32205. if (s.cache === false) {
  32206. cacheURL = cacheURL.replace(rantiCache, "$1");
  32207. uncached = (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce.guid++ + uncached;
  32208. }
  32209. s.url = cacheURL + uncached;
  32210. } else if (s.data && s.processData && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0) {
  32211. s.data = s.data.replace(r20, "+");
  32212. }
  32213. if (s.ifModified) {
  32214. if (jQuery.lastModified[cacheURL]) {
  32215. jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
  32216. }
  32217. if (jQuery.etag[cacheURL]) {
  32218. jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
  32219. }
  32220. }
  32221. if (s.data && s.hasContent && s.contentType !== false || options2.contentType) {
  32222. jqXHR.setRequestHeader("Content-Type", s.contentType);
  32223. }
  32224. jqXHR.setRequestHeader(
  32225. "Accept",
  32226. s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") : s.accepts["*"]
  32227. );
  32228. for (i2 in s.headers) {
  32229. jqXHR.setRequestHeader(i2, s.headers[i2]);
  32230. }
  32231. if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || completed2)) {
  32232. return jqXHR.abort();
  32233. }
  32234. strAbort = "abort";
  32235. completeDeferred.add(s.complete);
  32236. jqXHR.done(s.success);
  32237. jqXHR.fail(s.error);
  32238. transport = inspectPrefiltersOrTransports(transports, s, options2, jqXHR);
  32239. if (!transport) {
  32240. done(-1, "No Transport");
  32241. } else {
  32242. jqXHR.readyState = 1;
  32243. if (fireGlobals) {
  32244. globalEventContext.trigger("ajaxSend", [jqXHR, s]);
  32245. }
  32246. if (completed2) {
  32247. return jqXHR;
  32248. }
  32249. if (s.async && s.timeout > 0) {
  32250. timeoutTimer = window2.setTimeout(function() {
  32251. jqXHR.abort("timeout");
  32252. }, s.timeout);
  32253. }
  32254. try {
  32255. completed2 = false;
  32256. transport.send(requestHeaders, done);
  32257. } catch (e) {
  32258. if (completed2) {
  32259. throw e;
  32260. }
  32261. done(-1, e);
  32262. }
  32263. }
  32264. function done(status, nativeStatusText, responses, headers) {
  32265. var isSuccess, success, error, response, modified, statusText = nativeStatusText;
  32266. if (completed2) {
  32267. return;
  32268. }
  32269. completed2 = true;
  32270. if (timeoutTimer) {
  32271. window2.clearTimeout(timeoutTimer);
  32272. }
  32273. transport = void 0;
  32274. responseHeadersString = headers || "";
  32275. jqXHR.readyState = status > 0 ? 4 : 0;
  32276. isSuccess = status >= 200 && status < 300 || status === 304;
  32277. if (responses) {
  32278. response = ajaxHandleResponses(s, jqXHR, responses);
  32279. }
  32280. if (!isSuccess && jQuery.inArray("script", s.dataTypes) > -1 && jQuery.inArray("json", s.dataTypes) < 0) {
  32281. s.converters["text script"] = function() {
  32282. };
  32283. }
  32284. response = ajaxConvert(s, response, jqXHR, isSuccess);
  32285. if (isSuccess) {
  32286. if (s.ifModified) {
  32287. modified = jqXHR.getResponseHeader("Last-Modified");
  32288. if (modified) {
  32289. jQuery.lastModified[cacheURL] = modified;
  32290. }
  32291. modified = jqXHR.getResponseHeader("etag");
  32292. if (modified) {
  32293. jQuery.etag[cacheURL] = modified;
  32294. }
  32295. }
  32296. if (status === 204 || s.type === "HEAD") {
  32297. statusText = "nocontent";
  32298. } else if (status === 304) {
  32299. statusText = "notmodified";
  32300. } else {
  32301. statusText = response.state;
  32302. success = response.data;
  32303. error = response.error;
  32304. isSuccess = !error;
  32305. }
  32306. } else {
  32307. error = statusText;
  32308. if (status || !statusText) {
  32309. statusText = "error";
  32310. if (status < 0) {
  32311. status = 0;
  32312. }
  32313. }
  32314. }
  32315. jqXHR.status = status;
  32316. jqXHR.statusText = (nativeStatusText || statusText) + "";
  32317. if (isSuccess) {
  32318. deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);
  32319. } else {
  32320. deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);
  32321. }
  32322. jqXHR.statusCode(statusCode);
  32323. statusCode = void 0;
  32324. if (fireGlobals) {
  32325. globalEventContext.trigger(
  32326. isSuccess ? "ajaxSuccess" : "ajaxError",
  32327. [jqXHR, s, isSuccess ? success : error]
  32328. );
  32329. }
  32330. completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
  32331. if (fireGlobals) {
  32332. globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
  32333. if (!--jQuery.active) {
  32334. jQuery.event.trigger("ajaxStop");
  32335. }
  32336. }
  32337. }
  32338. return jqXHR;
  32339. },
  32340. getJSON: function(url, data, callback2) {
  32341. return jQuery.get(url, data, callback2, "json");
  32342. },
  32343. getScript: function(url, callback2) {
  32344. return jQuery.get(url, void 0, callback2, "script");
  32345. }
  32346. });
  32347. jQuery.each(["get", "post"], function(_i, method) {
  32348. jQuery[method] = function(url, data, callback2, type2) {
  32349. if (isFunction2(data)) {
  32350. type2 = type2 || callback2;
  32351. callback2 = data;
  32352. data = void 0;
  32353. }
  32354. return jQuery.ajax(jQuery.extend({
  32355. url,
  32356. type: method,
  32357. dataType: type2,
  32358. data,
  32359. success: callback2
  32360. }, jQuery.isPlainObject(url) && url));
  32361. };
  32362. });
  32363. jQuery.ajaxPrefilter(function(s) {
  32364. var i2;
  32365. for (i2 in s.headers) {
  32366. if (i2.toLowerCase() === "content-type") {
  32367. s.contentType = s.headers[i2] || "";
  32368. }
  32369. }
  32370. });
  32371. jQuery._evalUrl = function(url, options2, doc) {
  32372. return jQuery.ajax({
  32373. url,
  32374. type: "GET",
  32375. dataType: "script",
  32376. cache: true,
  32377. async: false,
  32378. global: false,
  32379. converters: {
  32380. "text script": function() {
  32381. }
  32382. },
  32383. dataFilter: function(response) {
  32384. jQuery.globalEval(response, options2, doc);
  32385. }
  32386. });
  32387. };
  32388. jQuery.fn.extend({
  32389. wrapAll: function(html) {
  32390. var wrap;
  32391. if (this[0]) {
  32392. if (isFunction2(html)) {
  32393. html = html.call(this[0]);
  32394. }
  32395. wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
  32396. if (this[0].parentNode) {
  32397. wrap.insertBefore(this[0]);
  32398. }
  32399. wrap.map(function() {
  32400. var elem = this;
  32401. while (elem.firstElementChild) {
  32402. elem = elem.firstElementChild;
  32403. }
  32404. return elem;
  32405. }).append(this);
  32406. }
  32407. return this;
  32408. },
  32409. wrapInner: function(html) {
  32410. if (isFunction2(html)) {
  32411. return this.each(function(i2) {
  32412. jQuery(this).wrapInner(html.call(this, i2));
  32413. });
  32414. }
  32415. return this.each(function() {
  32416. var self2 = jQuery(this), contents = self2.contents();
  32417. if (contents.length) {
  32418. contents.wrapAll(html);
  32419. } else {
  32420. self2.append(html);
  32421. }
  32422. });
  32423. },
  32424. wrap: function(html) {
  32425. var htmlIsFunction = isFunction2(html);
  32426. return this.each(function(i2) {
  32427. jQuery(this).wrapAll(htmlIsFunction ? html.call(this, i2) : html);
  32428. });
  32429. },
  32430. unwrap: function(selector) {
  32431. this.parent(selector).not("body").each(function() {
  32432. jQuery(this).replaceWith(this.childNodes);
  32433. });
  32434. return this;
  32435. }
  32436. });
  32437. jQuery.expr.pseudos.hidden = function(elem) {
  32438. return !jQuery.expr.pseudos.visible(elem);
  32439. };
  32440. jQuery.expr.pseudos.visible = function(elem) {
  32441. return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
  32442. };
  32443. jQuery.ajaxSettings.xhr = function() {
  32444. try {
  32445. return new window2.XMLHttpRequest();
  32446. } catch (e) {
  32447. }
  32448. };
  32449. var xhrSuccessStatus = {
  32450. 0: 200,
  32451. 1223: 204
  32452. }, xhrSupported = jQuery.ajaxSettings.xhr();
  32453. support.cors = !!xhrSupported && "withCredentials" in xhrSupported;
  32454. support.ajax = xhrSupported = !!xhrSupported;
  32455. jQuery.ajaxTransport(function(options2) {
  32456. var callback2, errorCallback;
  32457. if (support.cors || xhrSupported && !options2.crossDomain) {
  32458. return {
  32459. send: function(headers, complete) {
  32460. var i2, xhr = options2.xhr();
  32461. xhr.open(
  32462. options2.type,
  32463. options2.url,
  32464. options2.async,
  32465. options2.username,
  32466. options2.password
  32467. );
  32468. if (options2.xhrFields) {
  32469. for (i2 in options2.xhrFields) {
  32470. xhr[i2] = options2.xhrFields[i2];
  32471. }
  32472. }
  32473. if (options2.mimeType && xhr.overrideMimeType) {
  32474. xhr.overrideMimeType(options2.mimeType);
  32475. }
  32476. if (!options2.crossDomain && !headers["X-Requested-With"]) {
  32477. headers["X-Requested-With"] = "XMLHttpRequest";
  32478. }
  32479. for (i2 in headers) {
  32480. xhr.setRequestHeader(i2, headers[i2]);
  32481. }
  32482. callback2 = function(type2) {
  32483. return function() {
  32484. if (callback2) {
  32485. callback2 = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.ontimeout = xhr.onreadystatechange = null;
  32486. if (type2 === "abort") {
  32487. xhr.abort();
  32488. } else if (type2 === "error") {
  32489. if (typeof xhr.status !== "number") {
  32490. complete(0, "error");
  32491. } else {
  32492. complete(
  32493. xhr.status,
  32494. xhr.statusText
  32495. );
  32496. }
  32497. } else {
  32498. complete(
  32499. xhrSuccessStatus[xhr.status] || xhr.status,
  32500. xhr.statusText,
  32501. (xhr.responseType || "text") !== "text" || typeof xhr.responseText !== "string" ? { binary: xhr.response } : { text: xhr.responseText },
  32502. xhr.getAllResponseHeaders()
  32503. );
  32504. }
  32505. }
  32506. };
  32507. };
  32508. xhr.onload = callback2();
  32509. errorCallback = xhr.onerror = xhr.ontimeout = callback2("error");
  32510. if (xhr.onabort !== void 0) {
  32511. xhr.onabort = errorCallback;
  32512. } else {
  32513. xhr.onreadystatechange = function() {
  32514. if (xhr.readyState === 4) {
  32515. window2.setTimeout(function() {
  32516. if (callback2) {
  32517. errorCallback();
  32518. }
  32519. });
  32520. }
  32521. };
  32522. }
  32523. callback2 = callback2("abort");
  32524. try {
  32525. xhr.send(options2.hasContent && options2.data || null);
  32526. } catch (e) {
  32527. if (callback2) {
  32528. throw e;
  32529. }
  32530. }
  32531. },
  32532. abort: function() {
  32533. if (callback2) {
  32534. callback2();
  32535. }
  32536. }
  32537. };
  32538. }
  32539. });
  32540. jQuery.ajaxPrefilter(function(s) {
  32541. if (s.crossDomain) {
  32542. s.contents.script = false;
  32543. }
  32544. });
  32545. jQuery.ajaxSetup({
  32546. accepts: {
  32547. script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  32548. },
  32549. contents: {
  32550. script: /\b(?:java|ecma)script\b/
  32551. },
  32552. converters: {
  32553. "text script": function(text) {
  32554. jQuery.globalEval(text);
  32555. return text;
  32556. }
  32557. }
  32558. });
  32559. jQuery.ajaxPrefilter("script", function(s) {
  32560. if (s.cache === void 0) {
  32561. s.cache = false;
  32562. }
  32563. if (s.crossDomain) {
  32564. s.type = "GET";
  32565. }
  32566. });
  32567. jQuery.ajaxTransport("script", function(s) {
  32568. if (s.crossDomain || s.scriptAttrs) {
  32569. var script, callback2;
  32570. return {
  32571. send: function(_, complete) {
  32572. script = jQuery("<script>").attr(s.scriptAttrs || {}).prop({ charset: s.scriptCharset, src: s.url }).on("load error", callback2 = function(evt) {
  32573. script.remove();
  32574. callback2 = null;
  32575. if (evt) {
  32576. complete(evt.type === "error" ? 404 : 200, evt.type);
  32577. }
  32578. });
  32579. document2.head.appendChild(script[0]);
  32580. },
  32581. abort: function() {
  32582. if (callback2) {
  32583. callback2();
  32584. }
  32585. }
  32586. };
  32587. }
  32588. });
  32589. var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/;
  32590. jQuery.ajaxSetup({
  32591. jsonp: "callback",
  32592. jsonpCallback: function() {
  32593. var callback2 = oldCallbacks.pop() || jQuery.expando + "_" + nonce.guid++;
  32594. this[callback2] = true;
  32595. return callback2;
  32596. }
  32597. });
  32598. jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) {
  32599. var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ? "url" : typeof s.data === "string" && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0 && rjsonp.test(s.data) && "data");
  32600. if (jsonProp || s.dataTypes[0] === "jsonp") {
  32601. callbackName = s.jsonpCallback = isFunction2(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback;
  32602. if (jsonProp) {
  32603. s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName);
  32604. } else if (s.jsonp !== false) {
  32605. s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName;
  32606. }
  32607. s.converters["script json"] = function() {
  32608. if (!responseContainer) {
  32609. jQuery.error(callbackName + " was not called");
  32610. }
  32611. return responseContainer[0];
  32612. };
  32613. s.dataTypes[0] = "json";
  32614. overwritten = window2[callbackName];
  32615. window2[callbackName] = function() {
  32616. responseContainer = arguments;
  32617. };
  32618. jqXHR.always(function() {
  32619. if (overwritten === void 0) {
  32620. jQuery(window2).removeProp(callbackName);
  32621. } else {
  32622. window2[callbackName] = overwritten;
  32623. }
  32624. if (s[callbackName]) {
  32625. s.jsonpCallback = originalSettings.jsonpCallback;
  32626. oldCallbacks.push(callbackName);
  32627. }
  32628. if (responseContainer && isFunction2(overwritten)) {
  32629. overwritten(responseContainer[0]);
  32630. }
  32631. responseContainer = overwritten = void 0;
  32632. });
  32633. return "script";
  32634. }
  32635. });
  32636. support.createHTMLDocument = function() {
  32637. var body = document2.implementation.createHTMLDocument("").body;
  32638. body.innerHTML = "<form></form><form></form>";
  32639. return body.childNodes.length === 2;
  32640. }();
  32641. jQuery.parseHTML = function(data, context, keepScripts) {
  32642. if (typeof data !== "string") {
  32643. return [];
  32644. }
  32645. if (typeof context === "boolean") {
  32646. keepScripts = context;
  32647. context = false;
  32648. }
  32649. var base2, parsed, scripts;
  32650. if (!context) {
  32651. if (support.createHTMLDocument) {
  32652. context = document2.implementation.createHTMLDocument("");
  32653. base2 = context.createElement("base");
  32654. base2.href = document2.location.href;
  32655. context.head.appendChild(base2);
  32656. } else {
  32657. context = document2;
  32658. }
  32659. }
  32660. parsed = rsingleTag.exec(data);
  32661. scripts = !keepScripts && [];
  32662. if (parsed) {
  32663. return [context.createElement(parsed[1])];
  32664. }
  32665. parsed = buildFragment([data], context, scripts);
  32666. if (scripts && scripts.length) {
  32667. jQuery(scripts).remove();
  32668. }
  32669. return jQuery.merge([], parsed.childNodes);
  32670. };
  32671. jQuery.fn.load = function(url, params, callback2) {
  32672. var selector, type2, response, self2 = this, off2 = url.indexOf(" ");
  32673. if (off2 > -1) {
  32674. selector = stripAndCollapse(url.slice(off2));
  32675. url = url.slice(0, off2);
  32676. }
  32677. if (isFunction2(params)) {
  32678. callback2 = params;
  32679. params = void 0;
  32680. } else if (params && typeof params === "object") {
  32681. type2 = "POST";
  32682. }
  32683. if (self2.length > 0) {
  32684. jQuery.ajax({
  32685. url,
  32686. type: type2 || "GET",
  32687. dataType: "html",
  32688. data: params
  32689. }).done(function(responseText) {
  32690. response = arguments;
  32691. self2.html(selector ? jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) : responseText);
  32692. }).always(callback2 && function(jqXHR, status) {
  32693. self2.each(function() {
  32694. callback2.apply(this, response || [jqXHR.responseText, status, jqXHR]);
  32695. });
  32696. });
  32697. }
  32698. return this;
  32699. };
  32700. jQuery.expr.pseudos.animated = function(elem) {
  32701. return jQuery.grep(jQuery.timers, function(fn2) {
  32702. return elem === fn2.elem;
  32703. }).length;
  32704. };
  32705. jQuery.offset = {
  32706. setOffset: function(elem, options2, i2) {
  32707. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position2 = jQuery.css(elem, "position"), curElem = jQuery(elem), props = {};
  32708. if (position2 === "static") {
  32709. elem.style.position = "relative";
  32710. }
  32711. curOffset = curElem.offset();
  32712. curCSSTop = jQuery.css(elem, "top");
  32713. curCSSLeft = jQuery.css(elem, "left");
  32714. calculatePosition = (position2 === "absolute" || position2 === "fixed") && (curCSSTop + curCSSLeft).indexOf("auto") > -1;
  32715. if (calculatePosition) {
  32716. curPosition = curElem.position();
  32717. curTop = curPosition.top;
  32718. curLeft = curPosition.left;
  32719. } else {
  32720. curTop = parseFloat(curCSSTop) || 0;
  32721. curLeft = parseFloat(curCSSLeft) || 0;
  32722. }
  32723. if (isFunction2(options2)) {
  32724. options2 = options2.call(elem, i2, jQuery.extend({}, curOffset));
  32725. }
  32726. if (options2.top != null) {
  32727. props.top = options2.top - curOffset.top + curTop;
  32728. }
  32729. if (options2.left != null) {
  32730. props.left = options2.left - curOffset.left + curLeft;
  32731. }
  32732. if ("using" in options2) {
  32733. options2.using.call(elem, props);
  32734. } else {
  32735. curElem.css(props);
  32736. }
  32737. }
  32738. };
  32739. jQuery.fn.extend({
  32740. offset: function(options2) {
  32741. if (arguments.length) {
  32742. return options2 === void 0 ? this : this.each(function(i2) {
  32743. jQuery.offset.setOffset(this, options2, i2);
  32744. });
  32745. }
  32746. var rect, win2, elem = this[0];
  32747. if (!elem) {
  32748. return;
  32749. }
  32750. if (!elem.getClientRects().length) {
  32751. return { top: 0, left: 0 };
  32752. }
  32753. rect = elem.getBoundingClientRect();
  32754. win2 = elem.ownerDocument.defaultView;
  32755. return {
  32756. top: rect.top + win2.pageYOffset,
  32757. left: rect.left + win2.pageXOffset
  32758. };
  32759. },
  32760. position: function() {
  32761. if (!this[0]) {
  32762. return;
  32763. }
  32764. var offsetParent, offset, doc, elem = this[0], parentOffset = { top: 0, left: 0 };
  32765. if (jQuery.css(elem, "position") === "fixed") {
  32766. offset = elem.getBoundingClientRect();
  32767. } else {
  32768. offset = this.offset();
  32769. doc = elem.ownerDocument;
  32770. offsetParent = elem.offsetParent || doc.documentElement;
  32771. while (offsetParent && (offsetParent === doc.body || offsetParent === doc.documentElement) && jQuery.css(offsetParent, "position") === "static") {
  32772. offsetParent = offsetParent.parentNode;
  32773. }
  32774. if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
  32775. parentOffset = jQuery(offsetParent).offset();
  32776. parentOffset.top += jQuery.css(offsetParent, "borderTopWidth", true);
  32777. parentOffset.left += jQuery.css(offsetParent, "borderLeftWidth", true);
  32778. }
  32779. }
  32780. return {
  32781. top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
  32782. left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
  32783. };
  32784. },
  32785. offsetParent: function() {
  32786. return this.map(function() {
  32787. var offsetParent = this.offsetParent;
  32788. while (offsetParent && jQuery.css(offsetParent, "position") === "static") {
  32789. offsetParent = offsetParent.offsetParent;
  32790. }
  32791. return offsetParent || documentElement;
  32792. });
  32793. }
  32794. });
  32795. jQuery.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(method, prop) {
  32796. var top = "pageYOffset" === prop;
  32797. jQuery.fn[method] = function(val) {
  32798. return access(this, function(elem, method2, val2) {
  32799. var win2;
  32800. if (isWindow(elem)) {
  32801. win2 = elem;
  32802. } else if (elem.nodeType === 9) {
  32803. win2 = elem.defaultView;
  32804. }
  32805. if (val2 === void 0) {
  32806. return win2 ? win2[prop] : elem[method2];
  32807. }
  32808. if (win2) {
  32809. win2.scrollTo(
  32810. !top ? val2 : win2.pageXOffset,
  32811. top ? val2 : win2.pageYOffset
  32812. );
  32813. } else {
  32814. elem[method2] = val2;
  32815. }
  32816. }, method, val, arguments.length);
  32817. };
  32818. });
  32819. jQuery.each(["top", "left"], function(_i, prop) {
  32820. jQuery.cssHooks[prop] = addGetHookIf(
  32821. support.pixelPosition,
  32822. function(elem, computed2) {
  32823. if (computed2) {
  32824. computed2 = curCSS(elem, prop);
  32825. return rnumnonpx.test(computed2) ? jQuery(elem).position()[prop] + "px" : computed2;
  32826. }
  32827. }
  32828. );
  32829. });
  32830. jQuery.each({ Height: "height", Width: "width" }, function(name, type2) {
  32831. jQuery.each({
  32832. padding: "inner" + name,
  32833. content: type2,
  32834. "": "outer" + name
  32835. }, function(defaultExtra, funcName) {
  32836. jQuery.fn[funcName] = function(margin, value) {
  32837. var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"), extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
  32838. return access(this, function(elem, type3, value2) {
  32839. var doc;
  32840. if (isWindow(elem)) {
  32841. return funcName.indexOf("outer") === 0 ? elem["inner" + name] : elem.document.documentElement["client" + name];
  32842. }
  32843. if (elem.nodeType === 9) {
  32844. doc = elem.documentElement;
  32845. return Math.max(
  32846. elem.body["scroll" + name],
  32847. doc["scroll" + name],
  32848. elem.body["offset" + name],
  32849. doc["offset" + name],
  32850. doc["client" + name]
  32851. );
  32852. }
  32853. return value2 === void 0 ? jQuery.css(elem, type3, extra) : jQuery.style(elem, type3, value2, extra);
  32854. }, type2, chainable ? margin : void 0, chainable);
  32855. };
  32856. });
  32857. });
  32858. jQuery.each([
  32859. "ajaxStart",
  32860. "ajaxStop",
  32861. "ajaxComplete",
  32862. "ajaxError",
  32863. "ajaxSuccess",
  32864. "ajaxSend"
  32865. ], function(_i, type2) {
  32866. jQuery.fn[type2] = function(fn2) {
  32867. return this.on(type2, fn2);
  32868. };
  32869. });
  32870. jQuery.fn.extend({
  32871. bind: function(types, data, fn2) {
  32872. return this.on(types, null, data, fn2);
  32873. },
  32874. unbind: function(types, fn2) {
  32875. return this.off(types, null, fn2);
  32876. },
  32877. delegate: function(selector, types, data, fn2) {
  32878. return this.on(types, selector, data, fn2);
  32879. },
  32880. undelegate: function(selector, types, fn2) {
  32881. return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn2);
  32882. },
  32883. hover: function(fnOver, fnOut) {
  32884. return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
  32885. }
  32886. });
  32887. jQuery.each(
  32888. "blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),
  32889. function(_i, name) {
  32890. jQuery.fn[name] = function(data, fn2) {
  32891. return arguments.length > 0 ? this.on(name, null, data, fn2) : this.trigger(name);
  32892. };
  32893. }
  32894. );
  32895. var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
  32896. jQuery.proxy = function(fn2, context) {
  32897. var tmp, args, proxy;
  32898. if (typeof context === "string") {
  32899. tmp = fn2[context];
  32900. context = fn2;
  32901. fn2 = tmp;
  32902. }
  32903. if (!isFunction2(fn2)) {
  32904. return void 0;
  32905. }
  32906. args = slice.call(arguments, 2);
  32907. proxy = function() {
  32908. return fn2.apply(context || this, args.concat(slice.call(arguments)));
  32909. };
  32910. proxy.guid = fn2.guid = fn2.guid || jQuery.guid++;
  32911. return proxy;
  32912. };
  32913. jQuery.holdReady = function(hold) {
  32914. if (hold) {
  32915. jQuery.readyWait++;
  32916. } else {
  32917. jQuery.ready(true);
  32918. }
  32919. };
  32920. jQuery.isArray = Array.isArray;
  32921. jQuery.parseJSON = JSON.parse;
  32922. jQuery.nodeName = nodeName;
  32923. jQuery.isFunction = isFunction2;
  32924. jQuery.isWindow = isWindow;
  32925. jQuery.camelCase = camelCase3;
  32926. jQuery.type = toType;
  32927. jQuery.now = Date.now;
  32928. jQuery.isNumeric = function(obj) {
  32929. var type2 = jQuery.type(obj);
  32930. return (type2 === "number" || type2 === "string") && !isNaN(obj - parseFloat(obj));
  32931. };
  32932. jQuery.trim = function(text) {
  32933. return text == null ? "" : (text + "").replace(rtrim, "$1");
  32934. };
  32935. var _jQuery = window2.jQuery, _$ = window2.$;
  32936. jQuery.noConflict = function(deep) {
  32937. if (window2.$ === jQuery) {
  32938. window2.$ = _$;
  32939. }
  32940. if (deep && window2.jQuery === jQuery) {
  32941. window2.jQuery = _jQuery;
  32942. }
  32943. return jQuery;
  32944. };
  32945. if (typeof noGlobal === "undefined") {
  32946. window2.jQuery = window2.$ = jQuery;
  32947. }
  32948. return jQuery;
  32949. });
  32950. })(jquery);
  32951. var _style_0$2 = `@charset "UTF-8";:root{--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary-rgb:64,158,255;--el-color-success-rgb:103,194,58;--el-color-warning-rgb:230,162,60;--el-color-danger-rgb:245,108,108;--el-color-error-rgb:245,108,108;--el-color-info-rgb:144,147,153;--el-font-size-extra-large:20px;--el-font-size-large:18px;--el-font-size-medium:16px;--el-font-size-base:14px;--el-font-size-small:13px;--el-font-size-extra-small:12px;--el-font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","\\5fae\\8f6f\\96c5\\9ed1",Arial,sans-serif;--el-font-weight-primary:500;--el-font-line-height-primary:24px;--el-index-normal:1;--el-index-top:1000;--el-index-popper:2000;--el-border-radius-base:4px;--el-border-radius-small:2px;--el-border-radius-round:20px;--el-border-radius-circle:100%;--el-transition-duration:.3s;--el-transition-duration-fast:.2s;--el-transition-function-ease-in-out-bezier:cubic-bezier(.645, .045, .355, 1);--el-transition-function-fast-bezier:cubic-bezier(.23, 1, .32, 1);--el-transition-all:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);--el-transition-fade:opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-md-fade:transform var(--el-transition-duration) var(--el-transition-function-fast-bezier),opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-fade-linear:opacity var(--el-transition-duration-fast) linear;--el-transition-border:border-color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-box-shadow:box-shadow var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-color:color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-component-size-large:40px;--el-component-size:32px;--el-component-size-small:24px}:root{color-scheme:light;--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary:#409eff;--el-color-primary-light-3:#79bbff;--el-color-primary-light-5:#a0cfff;--el-color-primary-light-7:#c6e2ff;--el-color-primary-light-8:#d9ecff;--el-color-primary-light-9:#ecf5ff;--el-color-primary-dark-2:#337ecc;--el-color-success:#67c23a;--el-color-success-light-3:#95d475;--el-color-success-light-5:#b3e19d;--el-color-success-light-7:#d1edc4;--el-color-success-light-8:#e1f3d8;--el-color-success-light-9:#f0f9eb;--el-color-success-dark-2:#529b2e;--el-color-warning:#e6a23c;--el-color-warning-light-3:#eebe77;--el-color-warning-light-5:#f3d19e;--el-color-warning-light-7:#f8e3c5;--el-color-warning-light-8:#faecd8;--el-color-warning-light-9:#fdf6ec;--el-color-warning-dark-2:#b88230;--el-color-danger:#f56c6c;--el-color-danger-light-3:#f89898;--el-color-danger-light-5:#fab6b6;--el-color-danger-light-7:#fcd3d3;--el-color-danger-light-8:#fde2e2;--el-color-danger-light-9:#fef0f0;--el-color-danger-dark-2:#c45656;--el-color-error:#f56c6c;--el-color-error-light-3:#f89898;--el-color-error-light-5:#fab6b6;--el-color-error-light-7:#fcd3d3;--el-color-error-light-8:#fde2e2;--el-color-error-light-9:#fef0f0;--el-color-error-dark-2:#c45656;--el-color-info:#909399;--el-color-info-light-3:#b1b3b8;--el-color-info-light-5:#c8c9cc;--el-color-info-light-7:#dedfe0;--el-color-info-light-8:#e9e9eb;--el-color-info-light-9:#f4f4f5;--el-color-info-dark-2:#73767a;--el-bg-color:#ffffff;--el-bg-color-page:#f2f3f5;--el-bg-color-overlay:#ffffff;--el-text-color-primary:#303133;--el-text-color-regular:#606266;--el-text-color-secondary:#909399;--el-text-color-placeholder:#a8abb2;--el-text-color-disabled:#c0c4cc;--el-border-color:#dcdfe6;--el-border-color-light:#e4e7ed;--el-border-color-lighter:#ebeef5;--el-border-color-extra-light:#f2f6fc;--el-border-color-dark:#d4d7de;--el-border-color-darker:#cdd0d6;--el-fill-color:#f0f2f5;--el-fill-color-light:#f5f7fa;--el-fill-color-lighter:#fafafa;--el-fill-color-extra-light:#fafcff;--el-fill-color-dark:#ebedf0;--el-fill-color-darker:#e6e8eb;--el-fill-color-blank:#ffffff;--el-box-shadow:0px 12px 32px 4px rgba(0, 0, 0, .04),0px 8px 20px rgba(0, 0, 0, .08);--el-box-shadow-light:0px 0px 12px rgba(0, 0, 0, .12);--el-box-shadow-lighter:0px 0px 6px rgba(0, 0, 0, .12);--el-box-shadow-dark:0px 16px 48px 16px rgba(0, 0, 0, .08),0px 12px 32px rgba(0, 0, 0, .12),0px 8px 16px -8px rgba(0, 0, 0, .16);--el-disabled-bg-color:var(--el-fill-color-light);--el-disabled-text-color:var(--el-text-color-placeholder);--el-disabled-border-color:var(--el-border-color-light);--el-overlay-color:rgba(0, 0, 0, .8);--el-overlay-color-light:rgba(0, 0, 0, .7);--el-overlay-color-lighter:rgba(0, 0, 0, .5);--el-mask-color:rgba(255, 255, 255, .9);--el-mask-color-extra-light:rgba(255, 255, 255, .3);--el-border-width:1px;--el-border-style:solid;--el-border-color-hover:var(--el-text-color-disabled);--el-border:var(--el-border-width) var(--el-border-style) var(--el-border-color);--el-svg-monochrome-grey:var(--el-border-color)}.fade-in-linear-enter-active,.fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.fade-in-linear-enter-from,.fade-in-linear-leave-to{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.el-fade-in-linear-enter-from,.el-fade-in-linear-leave-to{opacity:0}.el-fade-in-enter-active,.el-fade-in-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-fade-in-enter-from,.el-fade-in-leave-active{opacity:0}.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter-from,.el-zoom-in-center-leave-active{opacity:0;transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center top}.el-zoom-in-top-enter-active[data-popper-placement^=top],.el-zoom-in-top-leave-active[data-popper-placement^=top]{transform-origin:center bottom}.el-zoom-in-top-enter-from,.el-zoom-in-top-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center bottom}.el-zoom-in-bottom-enter-from,.el-zoom-in-bottom-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;transform:scale(1);transition:var(--el-transition-md-fade);transform-origin:top left}.el-zoom-in-left-enter-from,.el-zoom-in-left-leave-active{opacity:0;transform:scale(.45)}.collapse-transition{transition:var(--el-transition-duration) height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.el-collapse-transition-enter-active,.el-collapse-transition-leave-active{transition:var(--el-transition-duration) max-height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.horizontal-collapse-transition{transition:var(--el-transition-duration) width ease-in-out,var(--el-transition-duration) padding-left ease-in-out,var(--el-transition-duration) padding-right ease-in-out}.el-list-enter-active,.el-list-leave-active{transition:all 1s}.el-list-enter-from,.el-list-leave-to{opacity:0;transform:translateY(-30px)}.el-list-leave-active{position:absolute!important}.el-opacity-transition{transition:opacity var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.el-icon{--color:inherit;height:1em;width:1em;line-height:1em;display:inline-flex;justify-content:center;align-items:center;position:relative;fill:currentColor;color:var(--color);font-size:inherit}.el-icon.is-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon svg{height:1em;width:1em}.el-affix--fixed{position:fixed}.el-alert{--el-alert-padding:8px 16px;--el-alert-border-radius-base:var(--el-border-radius-base);--el-alert-title-font-size:13px;--el-alert-description-font-size:12px;--el-alert-close-font-size:12px;--el-alert-close-customed-font-size:13px;--el-alert-icon-size:16px;--el-alert-icon-large-size:28px;width:100%;padding:var(--el-alert-padding);margin:0;box-sizing:border-box;border-radius:var(--el-alert-border-radius-base);position:relative;background-color:var(--el-color-white);overflow:hidden;opacity:1;display:flex;align-items:center;transition:opacity var(--el-transition-duration-fast)}.el-alert.is-light .el-alert__close-btn{color:var(--el-text-color-placeholder)}.el-alert.is-dark .el-alert__close-btn,.el-alert.is-dark .el-alert__description{color:var(--el-color-white)}.el-alert.is-center{justify-content:center}.el-alert--success{--el-alert-bg-color:var(--el-color-success-light-9)}.el-alert--success.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-success)}.el-alert--success.is-light .el-alert__description{color:var(--el-color-success)}.el-alert--success.is-dark{background-color:var(--el-color-success);color:var(--el-color-white)}.el-alert--info{--el-alert-bg-color:var(--el-color-info-light-9)}.el-alert--info.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-info)}.el-alert--info.is-light .el-alert__description{color:var(--el-color-info)}.el-alert--info.is-dark{background-color:var(--el-color-info);color:var(--el-color-white)}.el-alert--warning{--el-alert-bg-color:var(--el-color-warning-light-9)}.el-alert--warning.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-warning)}.el-alert--warning.is-light .el-alert__description{color:var(--el-color-warning)}.el-alert--warning.is-dark{background-color:var(--el-color-warning);color:var(--el-color-white)}.el-alert--error{--el-alert-bg-color:var(--el-color-error-light-9)}.el-alert--error.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-error)}.el-alert--error.is-light .el-alert__description{color:var(--el-color-error)}.el-alert--error.is-dark{background-color:var(--el-color-error);color:var(--el-color-white)}.el-alert__content{display:table-cell;padding:0 8px}.el-alert .el-alert__icon{font-size:var(--el-alert-icon-size);width:var(--el-alert-icon-size)}.el-alert .el-alert__icon.is-big{font-size:var(--el-alert-icon-large-size);width:var(--el-alert-icon-large-size)}.el-alert__title{font-size:var(--el-alert-title-font-size);line-height:18px;vertical-align:text-top}.el-alert__title.is-bold{font-weight:700}.el-alert .el-alert__description{font-size:var(--el-alert-description-font-size);margin:5px 0 0}.el-alert .el-alert__close-btn{font-size:var(--el-alert-close-font-size);opacity:1;position:absolute;top:12px;right:15px;cursor:pointer}.el-alert .el-alert__close-btn.is-customed{font-style:normal;font-size:var(--el-alert-close-customed-font-size);top:9px}.el-alert-fade-enter-from,.el-alert-fade-leave-active{opacity:0}.el-aside{overflow:auto;box-sizing:border-box;flex-shrink:0;width:var(--el-aside-width,300px)}.el-autocomplete{position:relative;display:inline-block}.el-autocomplete__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-autocomplete__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-autocomplete__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-autocomplete-suggestion{border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-autocomplete-suggestion__wrap{max-height:280px;padding:10px 0;box-sizing:border-box}.el-autocomplete-suggestion__list{margin:0;padding:0}.el-autocomplete-suggestion li{padding:0 20px;margin:0;line-height:34px;cursor:pointer;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);list-style:none;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-autocomplete-suggestion li:hover,.el-autocomplete-suggestion li.highlighted{background-color:var(--el-fill-color-light)}.el-autocomplete-suggestion li.divider{margin-top:6px;border-top:1px solid var(--el-color-black)}.el-autocomplete-suggestion li.divider:last-child{margin-bottom:-6px}.el-autocomplete-suggestion.is-loading li{text-align:center;height:100px;line-height:100px;font-size:20px;color:var(--el-text-color-secondary)}.el-autocomplete-suggestion.is-loading li:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-autocomplete-suggestion.is-loading li:hover{background-color:var(--el-bg-color-overlay)}.el-autocomplete-suggestion.is-loading .el-icon-loading{vertical-align:middle}.el-avatar{--el-avatar-text-color:var(--el-color-white);--el-avatar-bg-color:var(--el-text-color-disabled);--el-avatar-text-size:14px;--el-avatar-icon-size:18px;--el-avatar-border-radius:var(--el-border-radius-base);--el-avatar-size-large:56px;--el-avatar-size-small:24px;--el-avatar-size:40px;display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;text-align:center;overflow:hidden;color:var(--el-avatar-text-color);background:var(--el-avatar-bg-color);width:var(--el-avatar-size);height:var(--el-avatar-size);font-size:var(--el-avatar-text-size)}.el-avatar>img{display:block;height:100%}.el-avatar--circle{border-radius:50%}.el-avatar--square{border-radius:var(--el-avatar-border-radius)}.el-avatar--icon{font-size:var(--el-avatar-icon-size)}.el-avatar--small{--el-avatar-size:24px}.el-avatar--large{--el-avatar-size:56px}.el-backtop{--el-backtop-bg-color:var(--el-bg-color-overlay);--el-backtop-text-color:var(--el-color-primary);--el-backtop-hover-bg-color:var(--el-border-color-extra-light);position:fixed;background-color:var(--el-backtop-bg-color);width:40px;height:40px;border-radius:50%;color:var(--el-backtop-text-color);display:flex;align-items:center;justify-content:center;font-size:20px;box-shadow:var(--el-box-shadow-lighter);cursor:pointer;z-index:5}.el-backtop:hover{background-color:var(--el-backtop-hover-bg-color)}.el-backtop__icon{font-size:20px}.el-badge{--el-badge-bg-color:var(--el-color-danger);--el-badge-radius:10px;--el-badge-font-size:12px;--el-badge-padding:6px;--el-badge-size:18px;position:relative;vertical-align:middle;display:inline-block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.el-badge__content{background-color:var(--el-badge-bg-color);border-radius:var(--el-badge-radius);color:var(--el-color-white);display:inline-flex;justify-content:center;align-items:center;font-size:var(--el-badge-font-size);height:var(--el-badge-size);padding:0 var(--el-badge-padding);white-space:nowrap;border:1px solid var(--el-bg-color)}.el-badge__content.is-fixed{position:absolute;top:0;right:calc(1px + var(--el-badge-size)/ 2);transform:translateY(-50%) translate(100%);z-index:var(--el-index-normal)}.el-badge__content.is-fixed.is-dot{right:5px}.el-badge__content.is-dot{height:8px;width:8px;padding:0;right:0;border-radius:50%}.el-badge__content--primary{background-color:var(--el-color-primary)}.el-badge__content--success{background-color:var(--el-color-success)}.el-badge__content--warning{background-color:var(--el-color-warning)}.el-badge__content--info{background-color:var(--el-color-info)}.el-badge__content--danger{background-color:var(--el-color-danger)}.el-breadcrumb{font-size:14px;line-height:1}.el-breadcrumb:after,.el-breadcrumb:before{display:table;content:""}.el-breadcrumb:after{clear:both}.el-breadcrumb__separator{margin:0 9px;font-weight:700;color:var(--el-text-color-placeholder)}.el-breadcrumb__separator.el-icon{margin:0 6px;font-weight:400}.el-breadcrumb__separator.el-icon svg{vertical-align:middle}.el-breadcrumb__item{float:left;display:inline-flex;align-items:center}.el-breadcrumb__inner{color:var(--el-text-color-regular)}.el-breadcrumb__inner a,.el-breadcrumb__inner.is-link{font-weight:700;text-decoration:none;transition:var(--el-transition-color);color:var(--el-text-color-primary)}.el-breadcrumb__inner a:hover,.el-breadcrumb__inner.is-link:hover{color:var(--el-color-primary);cursor:pointer}.el-breadcrumb__item:last-child .el-breadcrumb__inner,.el-breadcrumb__item:last-child .el-breadcrumb__inner a,.el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover,.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover{font-weight:400;color:var(--el-text-color-regular);cursor:text}.el-breadcrumb__item:last-child .el-breadcrumb__separator{display:none}.el-button-group{display:inline-block;vertical-align:middle}.el-button-group:after,.el-button-group:before{display:table;content:""}.el-button-group:after{clear:both}.el-button-group>.el-button{float:left;position:relative}.el-button-group>.el-button+.el-button{margin-left:0}.el-button-group>.el-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.el-button-group>.el-button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.el-button-group>.el-button:first-child:last-child{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base)}.el-button-group>.el-button:first-child:last-child.is-round{border-radius:var(--el-border-radius-round)}.el-button-group>.el-button:first-child:last-child.is-circle{border-radius:50%}.el-button-group>.el-button:not(:first-child):not(:last-child){border-radius:0}.el-button-group>.el-button:not(:last-child){margin-right:-1px}.el-button-group>.el-button:active,.el-button-group>.el-button:focus,.el-button-group>.el-button:hover{z-index:1}.el-button-group>.el-button.is-active{z-index:1}.el-button-group>.el-dropdown>.el-button{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button{--el-button-font-weight:var(--el-font-weight-primary);--el-button-border-color:var(--el-border-color);--el-button-bg-color:var(--el-fill-color-blank);--el-button-text-color:var(--el-text-color-regular);--el-button-disabled-text-color:var(--el-disabled-text-color);--el-button-disabled-bg-color:var(--el-fill-color-blank);--el-button-disabled-border-color:var(--el-border-color-light);--el-button-divide-border-color:rgba(255, 255, 255, .5);--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-color-primary-light-9);--el-button-hover-border-color:var(--el-color-primary-light-7);--el-button-active-text-color:var(--el-button-hover-text-color);--el-button-active-border-color:var(--el-color-primary);--el-button-active-bg-color:var(--el-button-hover-bg-color);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-hover-link-text-color:var(--el-color-info);--el-button-active-color:var(--el-text-color-primary)}.el-button{display:inline-flex;justify-content:center;align-items:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;color:var(--el-button-text-color);text-align:center;box-sizing:border-box;outline:0;transition:.1s;font-weight:var(--el-button-font-weight);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-appearance:none;background-color:var(--el-button-bg-color);border:var(--el-border);border-color:var(--el-button-border-color);padding:8px 15px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button:focus,.el-button:hover{color:var(--el-button-hover-text-color);border-color:var(--el-button-hover-border-color);background-color:var(--el-button-hover-bg-color);outline:0}.el-button:active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button:focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button>span{display:inline-flex;align-items:center}.el-button+.el-button{margin-left:12px}.el-button.is-round{padding:8px 15px}.el-button::-moz-focus-inner{border:0}.el-button [class*=el-icon]+span{margin-left:6px}.el-button [class*=el-icon] svg{vertical-align:bottom}.el-button.is-plain{--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-fill-color-blank);--el-button-hover-border-color:var(--el-color-primary)}.el-button.is-active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button.is-disabled,.el-button.is-disabled:focus,.el-button.is-disabled:hover{color:var(--el-button-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color);border-color:var(--el-button-disabled-border-color)}.el-button.is-loading{position:relative;pointer-events:none}.el-button.is-loading:before{z-index:1;pointer-events:none;content:"";position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:inherit;background-color:var(--el-mask-color-extra-light)}.el-button.is-round{border-radius:var(--el-border-radius-round)}.el-button.is-circle{border-radius:50%;padding:8px}.el-button.is-text{color:var(--el-button-text-color);border:0 solid transparent;background-color:transparent}.el-button.is-text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important}.el-button.is-text:not(.is-disabled):focus,.el-button.is-text:not(.is-disabled):hover{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled):focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button.is-text:not(.is-disabled):active{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled).is-has-bg:focus,.el-button.is-text:not(.is-disabled).is-has-bg:hover{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg:active{background-color:var(--el-fill-color-dark)}.el-button__text--expand{letter-spacing:.3em;margin-right:-.3em}.el-button.is-link{border-color:transparent;color:var(--el-button-text-color);background:0 0;padding:2px;height:auto}.el-button.is-link:focus,.el-button.is-link:hover{color:var(--el-button-hover-link-text-color)}.el-button.is-link.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button.is-link:not(.is-disabled):focus,.el-button.is-link:not(.is-disabled):hover{border-color:transparent;background-color:transparent}.el-button.is-link:not(.is-disabled):active{color:var(--el-button-active-color);border-color:transparent;background-color:transparent}.el-button--text{border-color:transparent;background:0 0;color:var(--el-color-primary);padding-left:0;padding-right:0}.el-button--text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button--text:not(.is-disabled):focus,.el-button--text:not(.is-disabled):hover{color:var(--el-color-primary-light-3);border-color:transparent;background-color:transparent}.el-button--text:not(.is-disabled):active{color:var(--el-color-primary-dark-2);border-color:transparent;background-color:transparent}.el-button__link--expand{letter-spacing:.3em;margin-right:-.3em}.el-button--primary{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-primary);--el-button-border-color:var(--el-color-primary);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-active-color:var(--el-color-primary-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-primary-light-5);--el-button-hover-bg-color:var(--el-color-primary-light-3);--el-button-hover-border-color:var(--el-color-primary-light-3);--el-button-active-bg-color:var(--el-color-primary-dark-2);--el-button-active-border-color:var(--el-color-primary-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-primary-light-5);--el-button-disabled-border-color:var(--el-color-primary-light-5)}.el-button--primary.is-link,.el-button--primary.is-plain,.el-button--primary.is-text{--el-button-text-color:var(--el-color-primary);--el-button-bg-color:var(--el-color-primary-light-9);--el-button-border-color:var(--el-color-primary-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-primary);--el-button-hover-border-color:var(--el-color-primary);--el-button-active-text-color:var(--el-color-white)}.el-button--primary.is-link.is-disabled,.el-button--primary.is-link.is-disabled:active,.el-button--primary.is-link.is-disabled:focus,.el-button--primary.is-link.is-disabled:hover,.el-button--primary.is-plain.is-disabled,.el-button--primary.is-plain.is-disabled:active,.el-button--primary.is-plain.is-disabled:focus,.el-button--primary.is-plain.is-disabled:hover,.el-button--primary.is-text.is-disabled,.el-button--primary.is-text.is-disabled:active,.el-button--primary.is-text.is-disabled:focus,.el-button--primary.is-text.is-disabled:hover{color:var(--el-color-primary-light-5);background-color:var(--el-color-primary-light-9);border-color:var(--el-color-primary-light-8)}.el-button--success{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-success);--el-button-border-color:var(--el-color-success);--el-button-outline-color:var(--el-color-success-light-5);--el-button-active-color:var(--el-color-success-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-success-light-5);--el-button-hover-bg-color:var(--el-color-success-light-3);--el-button-hover-border-color:var(--el-color-success-light-3);--el-button-active-bg-color:var(--el-color-success-dark-2);--el-button-active-border-color:var(--el-color-success-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-success-light-5);--el-button-disabled-border-color:var(--el-color-success-light-5)}.el-button--success.is-link,.el-button--success.is-plain,.el-button--success.is-text{--el-button-text-color:var(--el-color-success);--el-button-bg-color:var(--el-color-success-light-9);--el-button-border-color:var(--el-color-success-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-success);--el-button-hover-border-color:var(--el-color-success);--el-button-active-text-color:var(--el-color-white)}.el-button--success.is-link.is-disabled,.el-button--success.is-link.is-disabled:active,.el-button--success.is-link.is-disabled:focus,.el-button--success.is-link.is-disabled:hover,.el-button--success.is-plain.is-disabled,.el-button--success.is-plain.is-disabled:active,.el-button--success.is-plain.is-disabled:focus,.el-button--success.is-plain.is-disabled:hover,.el-button--success.is-text.is-disabled,.el-button--success.is-text.is-disabled:active,.el-button--success.is-text.is-disabled:focus,.el-button--success.is-text.is-disabled:hover{color:var(--el-color-success-light-5);background-color:var(--el-color-success-light-9);border-color:var(--el-color-success-light-8)}.el-button--warning{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-warning);--el-button-border-color:var(--el-color-warning);--el-button-outline-color:var(--el-color-warning-light-5);--el-button-active-color:var(--el-color-warning-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-warning-light-5);--el-button-hover-bg-color:var(--el-color-warning-light-3);--el-button-hover-border-color:var(--el-color-warning-light-3);--el-button-active-bg-color:var(--el-color-warning-dark-2);--el-button-active-border-color:var(--el-color-warning-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-warning-light-5);--el-button-disabled-border-color:var(--el-color-warning-light-5)}.el-button--warning.is-link,.el-button--warning.is-plain,.el-button--warning.is-text{--el-button-text-color:var(--el-color-warning);--el-button-bg-color:var(--el-color-warning-light-9);--el-button-border-color:var(--el-color-warning-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-warning);--el-button-hover-border-color:var(--el-color-warning);--el-button-active-text-color:var(--el-color-white)}.el-button--warning.is-link.is-disabled,.el-button--warning.is-link.is-disabled:active,.el-button--warning.is-link.is-disabled:focus,.el-button--warning.is-link.is-disabled:hover,.el-button--warning.is-plain.is-disabled,.el-button--warning.is-plain.is-disabled:active,.el-button--warning.is-plain.is-disabled:focus,.el-button--warning.is-plain.is-disabled:hover,.el-button--warning.is-text.is-disabled,.el-button--warning.is-text.is-disabled:active,.el-button--warning.is-text.is-disabled:focus,.el-button--warning.is-text.is-disabled:hover{color:var(--el-color-warning-light-5);background-color:var(--el-color-warning-light-9);border-color:var(--el-color-warning-light-8)}.el-button--danger{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-danger);--el-button-border-color:var(--el-color-danger);--el-button-outline-color:var(--el-color-danger-light-5);--el-button-active-color:var(--el-color-danger-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-danger-light-5);--el-button-hover-bg-color:var(--el-color-danger-light-3);--el-button-hover-border-color:var(--el-color-danger-light-3);--el-button-active-bg-color:var(--el-color-danger-dark-2);--el-button-active-border-color:var(--el-color-danger-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-danger-light-5);--el-button-disabled-border-color:var(--el-color-danger-light-5)}.el-button--danger.is-link,.el-button--danger.is-plain,.el-button--danger.is-text{--el-button-text-color:var(--el-color-danger);--el-button-bg-color:var(--el-color-danger-light-9);--el-button-border-color:var(--el-color-danger-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-danger);--el-button-hover-border-color:var(--el-color-danger);--el-button-active-text-color:var(--el-color-white)}.el-button--danger.is-link.is-disabled,.el-button--danger.is-link.is-disabled:active,.el-button--danger.is-link.is-disabled:focus,.el-button--danger.is-link.is-disabled:hover,.el-button--danger.is-plain.is-disabled,.el-button--danger.is-plain.is-disabled:active,.el-button--danger.is-plain.is-disabled:focus,.el-button--danger.is-plain.is-disabled:hover,.el-button--danger.is-text.is-disabled,.el-button--danger.is-text.is-disabled:active,.el-button--danger.is-text.is-disabled:focus,.el-button--danger.is-text.is-disabled:hover{color:var(--el-color-danger-light-5);background-color:var(--el-color-danger-light-9);border-color:var(--el-color-danger-light-8)}.el-button--info{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-info);--el-button-border-color:var(--el-color-info);--el-button-outline-color:var(--el-color-info-light-5);--el-button-active-color:var(--el-color-info-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-info-light-5);--el-button-hover-bg-color:var(--el-color-info-light-3);--el-button-hover-border-color:var(--el-color-info-light-3);--el-button-active-bg-color:var(--el-color-info-dark-2);--el-button-active-border-color:var(--el-color-info-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-info-light-5);--el-button-disabled-border-color:var(--el-color-info-light-5)}.el-button--info.is-link,.el-button--info.is-plain,.el-button--info.is-text{--el-button-text-color:var(--el-color-info);--el-button-bg-color:var(--el-color-info-light-9);--el-button-border-color:var(--el-color-info-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-info);--el-button-hover-border-color:var(--el-color-info);--el-button-active-text-color:var(--el-color-white)}.el-button--info.is-link.is-disabled,.el-button--info.is-link.is-disabled:active,.el-button--info.is-link.is-disabled:focus,.el-button--info.is-link.is-disabled:hover,.el-button--info.is-plain.is-disabled,.el-button--info.is-plain.is-disabled:active,.el-button--info.is-plain.is-disabled:focus,.el-button--info.is-plain.is-disabled:hover,.el-button--info.is-text.is-disabled,.el-button--info.is-text.is-disabled:active,.el-button--info.is-text.is-disabled:focus,.el-button--info.is-text.is-disabled:hover{color:var(--el-color-info-light-5);background-color:var(--el-color-info-light-9);border-color:var(--el-color-info-light-8)}.el-button--large{--el-button-size:40px;height:var(--el-button-size);padding:12px 19px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button--large [class*=el-icon]+span{margin-left:8px}.el-button--large.is-round{padding:12px 19px}.el-button--large.is-circle{width:var(--el-button-size);padding:12px}.el-button--small{--el-button-size:24px;height:var(--el-button-size);padding:5px 11px;font-size:12px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-button--small [class*=el-icon]+span{margin-left:4px}.el-button--small.is-round{padding:5px 11px}.el-button--small.is-circle{width:var(--el-button-size);padding:5px}.el-calendar{--el-calendar-border:var(--el-table-border, 1px solid var(--el-border-color-lighter));--el-calendar-header-border-bottom:var(--el-calendar-border);--el-calendar-selected-bg-color:var(--el-color-primary-light-9);--el-calendar-cell-width:85px;background-color:var(--el-fill-color-blank)}.el-calendar__header{display:flex;justify-content:space-between;padding:12px 20px;border-bottom:var(--el-calendar-header-border-bottom)}.el-calendar__title{color:var(--el-text-color);align-self:center}.el-calendar__body{padding:12px 20px 35px}.el-calendar-table{table-layout:fixed;width:100%}.el-calendar-table thead th{padding:12px 0;color:var(--el-text-color-regular);font-weight:400}.el-calendar-table:not(.is-range) td.next,.el-calendar-table:not(.is-range) td.prev{color:var(--el-text-color-placeholder)}.el-calendar-table td{border-bottom:var(--el-calendar-border);border-right:var(--el-calendar-border);vertical-align:top;transition:background-color var(--el-transition-duration-fast) ease}.el-calendar-table td.is-selected{background-color:var(--el-calendar-selected-bg-color)}.el-calendar-table td.is-today{color:var(--el-color-primary)}.el-calendar-table tr:first-child td{border-top:var(--el-calendar-border)}.el-calendar-table tr td:first-child{border-left:var(--el-calendar-border)}.el-calendar-table tr.el-calendar-table__row--hide-border td{border-top:none}.el-calendar-table .el-calendar-day{box-sizing:border-box;padding:8px;height:var(--el-calendar-cell-width)}.el-calendar-table .el-calendar-day:hover{cursor:pointer;background-color:var(--el-calendar-selected-bg-color)}.el-card{--el-card-border-color:var(--el-border-color-light);--el-card-border-radius:4px;--el-card-padding:20px;--el-card-bg-color:var(--el-fill-color-blank)}.el-card{border-radius:var(--el-card-border-radius);border:1px solid var(--el-card-border-color);background-color:var(--el-card-bg-color);overflow:hidden;color:var(--el-text-color-primary);transition:var(--el-transition-duration)}.el-card.is-always-shadow{box-shadow:var(--el-box-shadow-light)}.el-card.is-hover-shadow:focus,.el-card.is-hover-shadow:hover{box-shadow:var(--el-box-shadow-light)}.el-card__header{padding:calc(var(--el-card-padding) - 2px) var(--el-card-padding);border-bottom:1px solid var(--el-card-border-color);box-sizing:border-box}.el-card__body{padding:var(--el-card-padding)}.el-carousel__item{position:absolute;top:0;left:0;width:100%;height:100%;display:inline-block;overflow:hidden;z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-active{z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-animating{transition:transform .4s ease-in-out}.el-carousel__item--card{width:50%;transition:transform .4s ease-in-out}.el-carousel__item--card.is-in-stage{cursor:pointer;z-index:var(--el-index-normal)}.el-carousel__item--card.is-in-stage.is-hover .el-carousel__mask,.el-carousel__item--card.is-in-stage:hover .el-carousel__mask{opacity:.12}.el-carousel__item--card.is-active{z-index:calc(var(--el-index-normal) + 1)}.el-carousel__mask{position:absolute;width:100%;height:100%;top:0;left:0;background-color:var(--el-color-white);opacity:.24;transition:var(--el-transition-duration-fast)}.el-carousel{--el-carousel-arrow-font-size:12px;--el-carousel-arrow-size:36px;--el-carousel-arrow-background:rgba(31, 45, 61, .11);--el-carousel-arrow-hover-background:rgba(31, 45, 61, .23);--el-carousel-indicator-width:30px;--el-carousel-indicator-height:2px;--el-carousel-indicator-padding-horizontal:4px;--el-carousel-indicator-padding-vertical:12px;--el-carousel-indicator-out-color:var(--el-border-color-hover);position:relative}.el-carousel--horizontal{overflow-x:hidden}.el-carousel--vertical{overflow-y:hidden}.el-carousel__container{position:relative;height:300px}.el-carousel__arrow{border:none;outline:0;padding:0;margin:0;height:var(--el-carousel-arrow-size);width:var(--el-carousel-arrow-size);cursor:pointer;transition:var(--el-transition-duration);border-radius:50%;background-color:var(--el-carousel-arrow-background);color:#fff;position:absolute;top:50%;z-index:10;transform:translateY(-50%);text-align:center;font-size:var(--el-carousel-arrow-font-size);display:inline-flex;justify-content:center;align-items:center}.el-carousel__arrow--left{left:16px}.el-carousel__arrow--right{right:16px}.el-carousel__arrow:hover{background-color:var(--el-carousel-arrow-hover-background)}.el-carousel__arrow i{cursor:pointer}.el-carousel__indicators{position:absolute;list-style:none;margin:0;padding:0;z-index:calc(var(--el-index-normal) + 1)}.el-carousel__indicators--horizontal{bottom:0;left:50%;transform:translate(-50%)}.el-carousel__indicators--vertical{right:0;top:50%;transform:translateY(-50%)}.el-carousel__indicators--outside{bottom:calc(var(--el-carousel-indicator-height) + var(--el-carousel-indicator-padding-vertical) * 2);text-align:center;position:static;transform:none}.el-carousel__indicators--outside .el-carousel__indicator:hover button{opacity:.64}.el-carousel__indicators--outside button{background-color:var(--el-carousel-indicator-out-color);opacity:.24}.el-carousel__indicators--labels{left:0;right:0;transform:none;text-align:center}.el-carousel__indicators--labels .el-carousel__button{height:auto;width:auto;padding:2px 18px;font-size:12px;color:#000}.el-carousel__indicators--labels .el-carousel__indicator{padding:6px 4px}.el-carousel__indicator{background-color:transparent;cursor:pointer}.el-carousel__indicator:hover button{opacity:.72}.el-carousel__indicator--horizontal{display:inline-block;padding:var(--el-carousel-indicator-padding-vertical) var(--el-carousel-indicator-padding-horizontal)}.el-carousel__indicator--vertical{padding:var(--el-carousel-indicator-padding-horizontal) var(--el-carousel-indicator-padding-vertical)}.el-carousel__indicator--vertical .el-carousel__button{width:var(--el-carousel-indicator-height);height:calc(var(--el-carousel-indicator-width)/ 2)}.el-carousel__indicator.is-active button{opacity:1}.el-carousel__button{display:block;opacity:.48;width:var(--el-carousel-indicator-width);height:var(--el-carousel-indicator-height);background-color:#fff;border:none;outline:0;padding:0;margin:0;cursor:pointer;transition:var(--el-transition-duration)}.carousel-arrow-left-enter-from,.carousel-arrow-left-leave-active{transform:translateY(-50%) translate(-10px);opacity:0}.carousel-arrow-right-enter-from,.carousel-arrow-right-leave-active{transform:translateY(-50%) translate(10px);opacity:0}.el-cascader-panel{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader-panel{display:flex;border-radius:var(--el-cascader-menu-radius);font-size:var(--el-cascader-menu-font-size)}.el-cascader-panel.is-bordered{border:var(--el-cascader-menu-border);border-radius:var(--el-cascader-menu-radius)}.el-cascader-menu{min-width:180px;box-sizing:border-box;color:var(--el-cascader-menu-text-color);border-right:var(--el-cascader-menu-border)}.el-cascader-menu:last-child{border-right:none}.el-cascader-menu:last-child .el-cascader-node{padding-right:20px}.el-cascader-menu__wrap.el-scrollbar__wrap{height:204px}.el-cascader-menu__list{position:relative;min-height:100%;margin:0;padding:6px 0;list-style:none;box-sizing:border-box}.el-cascader-menu__hover-zone{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.el-cascader-menu__empty-text{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;color:var(--el-cascader-color-empty)}.el-cascader-menu__empty-text .is-loading{margin-right:2px}.el-cascader-node{position:relative;display:flex;align-items:center;padding:0 30px 0 20px;height:34px;line-height:34px;outline:0}.el-cascader-node.is-selectable.in-active-path{color:var(--el-cascader-menu-text-color)}.el-cascader-node.in-active-path,.el-cascader-node.is-active,.el-cascader-node.is-selectable.in-checked-path{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader-node:not(.is-disabled){cursor:pointer}.el-cascader-node:not(.is-disabled):focus,.el-cascader-node:not(.is-disabled):hover{background:var(--el-cascader-node-background-hover)}.el-cascader-node.is-disabled{color:var(--el-cascader-node-color-disabled);cursor:not-allowed}.el-cascader-node__prefix{position:absolute;left:10px}.el-cascader-node__postfix{position:absolute;right:10px}.el-cascader-node__label{flex:1;text-align:left;padding:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-cascader-node>.el-checkbox{margin-right:0}.el-cascader-node>.el-radio{margin-right:0}.el-cascader-node>.el-radio .el-radio__label{padding-left:0}.el-cascader{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color);display:inline-block;vertical-align:middle;position:relative;font-size:var(--el-font-size-base);line-height:32px;outline:0}.el-cascader:not(.is-disabled):hover .el-input__wrapper{cursor:pointer;box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-cascader .el-input{display:flex;cursor:pointer}.el-cascader .el-input .el-input__inner{text-overflow:ellipsis;cursor:pointer}.el-cascader .el-input .el-input__suffix-inner .el-icon{height:calc(100% - 2px)}.el-cascader .el-input .el-input__suffix-inner .el-icon svg{vertical-align:middle}.el-cascader .el-input .icon-arrow-down{transition:transform var(--el-transition-duration);font-size:14px}.el-cascader .el-input .icon-arrow-down.is-reverse{transform:rotate(180deg)}.el-cascader .el-input .icon-circle-close:hover{color:var(--el-input-clear-hover-color,var(--el-text-color-secondary))}.el-cascader .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-cascader--large{font-size:14px;line-height:40px}.el-cascader--small{font-size:12px;line-height:24px}.el-cascader.is-disabled .el-cascader__label{z-index:calc(var(--el-index-normal) + 1);color:var(--el-disabled-text-color)}.el-cascader__dropdown{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader__dropdown{font-size:var(--el-cascader-menu-font-size);border-radius:var(--el-cascader-menu-radius)}.el-cascader__dropdown.el-popper{background:var(--el-cascader-menu-fill);border:var(--el-cascader-menu-border);box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__dropdown.el-popper .el-popper__arrow:before{border:var(--el-cascader-menu-border)}.el-cascader__dropdown.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-cascader__dropdown.el-popper{box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__tags{position:absolute;left:0;right:30px;top:50%;transform:translateY(-50%);display:flex;flex-wrap:wrap;line-height:normal;text-align:left;box-sizing:border-box}.el-cascader__tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-cascader-tag-background)}.el-cascader__tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__collapse-tags{white-space:normal;z-index:var(--el-index-normal)}.el-cascader__collapse-tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-fill-color)}.el-cascader__collapse-tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__collapse-tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__collapse-tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__suggestion-panel{border-radius:var(--el-cascader-menu-radius)}.el-cascader__suggestion-list{max-height:204px;margin:0;padding:6px 0;font-size:var(--el-font-size-base);color:var(--el-cascader-menu-text-color);text-align:center}.el-cascader__suggestion-item{display:flex;justify-content:space-between;align-items:center;height:34px;padding:0 15px;text-align:left;outline:0;cursor:pointer}.el-cascader__suggestion-item:focus,.el-cascader__suggestion-item:hover{background:var(--el-cascader-node-background-hover)}.el-cascader__suggestion-item.is-checked{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader__suggestion-item>span{margin-right:10px}.el-cascader__empty-text{margin:10px 0;color:var(--el-cascader-color-empty)}.el-cascader__search-input{flex:1;height:24px;min-width:60px;margin:2px 0 2px 11px;padding:0;color:var(--el-cascader-menu-text-color);border:none;outline:0;box-sizing:border-box;background:0 0}.el-cascader__search-input::-moz-placeholder{color:transparent}.el-cascader__search-input:-ms-input-placeholder{color:transparent}.el-cascader__search-input::placeholder{color:transparent}.el-check-tag{background-color:var(--el-color-info-light-9);border-radius:var(--el-border-radius-base);color:var(--el-color-info);cursor:pointer;display:inline-block;font-size:var(--el-font-size-base);line-height:var(--el-font-size-base);padding:7px 15px;transition:var(--el-transition-all);font-weight:700}.el-check-tag:hover{background-color:var(--el-color-info-light-7)}.el-check-tag.is-checked{background-color:var(--el-color-primary-light-8);color:var(--el-color-primary)}.el-check-tag.is-checked:hover{background-color:var(--el-color-primary-light-7)}.el-checkbox-button{--el-checkbox-button-checked-bg-color:var(--el-color-primary);--el-checkbox-button-checked-text-color:var(--el-color-white);--el-checkbox-button-checked-border-color:var(--el-color-primary)}.el-checkbox-button{position:relative;display:inline-block}.el-checkbox-button__inner{display:inline-block;line-height:1;font-weight:var(--el-checkbox-font-weight);white-space:nowrap;vertical-align:middle;cursor:pointer;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button__inner.is-round{padding:8px 15px}.el-checkbox-button__inner:hover{color:var(--el-color-primary)}.el-checkbox-button__inner [class*=el-icon-]{line-height:.9}.el-checkbox-button__inner [class*=el-icon-]+span{margin-left:5px}.el-checkbox-button__original{opacity:0;outline:0;position:absolute;margin:0;z-index:-1}.el-checkbox-button.is-checked .el-checkbox-button__inner{color:var(--el-checkbox-button-checked-text-color);background-color:var(--el-checkbox-button-checked-bg-color);border-color:var(--el-checkbox-button-checked-border-color);box-shadow:-1px 0 0 0 var(--el-color-primary-light-7)}.el-checkbox-button.is-checked:first-child .el-checkbox-button__inner{border-left-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button.is-disabled .el-checkbox-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-checkbox-button.is-disabled:first-child .el-checkbox-button__inner{border-left-color:var(--el-button-disabled-border-color,var(--el-border-color-light))}.el-checkbox-button:first-child .el-checkbox-button__inner{border-left:var(--el-border);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base);box-shadow:none!important}.el-checkbox-button.is-focus .el-checkbox-button__inner{border-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button:last-child .el-checkbox-button__inner{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base)}.el-checkbox-button--large .el-checkbox-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button--large .el-checkbox-button__inner.is-round{padding:12px 19px}.el-checkbox-button--small .el-checkbox-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-checkbox-button--small .el-checkbox-button__inner.is-round{padding:5px 11px}.el-checkbox-group{font-size:0;line-height:0}.el-checkbox{--el-checkbox-font-size:14px;--el-checkbox-font-weight:var(--el-font-weight-primary);--el-checkbox-text-color:var(--el-text-color-regular);--el-checkbox-input-height:14px;--el-checkbox-input-width:14px;--el-checkbox-border-radius:var(--el-border-radius-small);--el-checkbox-bg-color:var(--el-fill-color-blank);--el-checkbox-input-border:var(--el-border);--el-checkbox-disabled-border-color:var(--el-border-color);--el-checkbox-disabled-input-fill:var(--el-fill-color-light);--el-checkbox-disabled-icon-color:var(--el-text-color-placeholder);--el-checkbox-disabled-checked-input-fill:var(--el-border-color-extra-light);--el-checkbox-disabled-checked-input-border-color:var(--el-border-color);--el-checkbox-disabled-checked-icon-color:var(--el-text-color-placeholder);--el-checkbox-checked-text-color:var(--el-color-primary);--el-checkbox-checked-input-border-color:var(--el-color-primary);--el-checkbox-checked-bg-color:var(--el-color-primary);--el-checkbox-checked-icon-color:var(--el-color-white);--el-checkbox-input-border-color-hover:var(--el-color-primary)}.el-checkbox{color:var(--el-checkbox-text-color);font-weight:var(--el-checkbox-font-weight);font-size:var(--el-font-size-base);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:30px;height:32px}.el-checkbox.is-disabled{cursor:not-allowed}.el-checkbox.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-checkbox.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-checkbox.is-bordered.is-disabled{border-color:var(--el-border-color-lighter)}.el-checkbox.is-bordered.el-checkbox--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__label{font-size:var(--el-font-size-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__inner{height:14px;width:14px}.el-checkbox.is-bordered.el-checkbox--small{padding:0 11px 0 7px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner:after{height:6px;width:2px}.el-checkbox input:focus-visible+.el-checkbox__inner{outline:2px solid var(--el-checkbox-input-border-color-hover);outline-offset:1px;border-radius:var(--el-checkbox-border-radius)}.el-checkbox__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative}.el-checkbox__input.is-disabled .el-checkbox__inner{background-color:var(--el-checkbox-disabled-input-fill);border-color:var(--el-checkbox-disabled-border-color);cursor:not-allowed}.el-checkbox__input.is-disabled .el-checkbox__inner:after{cursor:not-allowed;border-color:var(--el-checkbox-disabled-icon-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner:after{border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner:before{background-color:var(--el-checkbox-disabled-checked-icon-color);border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled+span.el-checkbox__label{color:var(--el-disabled-text-color);cursor:not-allowed}.el-checkbox__input.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-checked .el-checkbox__inner:after{transform:rotate(45deg) scaleY(1)}.el-checkbox__input.is-checked+.el-checkbox__label{color:var(--el-checkbox-checked-text-color)}.el-checkbox__input.is-focus:not(.is-checked) .el-checkbox__original:not(:focus-visible){border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__input.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-indeterminate .el-checkbox__inner:before{content:"";position:absolute;display:block;background-color:var(--el-checkbox-checked-icon-color);height:2px;transform:scale(.5);left:0;right:0;top:5px}.el-checkbox__input.is-indeterminate .el-checkbox__inner:after{display:none}.el-checkbox__inner{display:inline-block;position:relative;border:var(--el-checkbox-input-border);border-radius:var(--el-checkbox-border-radius);box-sizing:border-box;width:var(--el-checkbox-input-width);height:var(--el-checkbox-input-height);background-color:var(--el-checkbox-bg-color);z-index:var(--el-index-normal);transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46),outline .25s cubic-bezier(.71,-.46,.29,1.46)}.el-checkbox__inner:hover{border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__inner:after{box-sizing:content-box;content:"";border:1px solid var(--el-checkbox-checked-icon-color);border-left:0;border-top:0;height:7px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:3px;transition:transform .15s ease-in 50ms;transform-origin:center}.el-checkbox__original{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.el-checkbox__label{display:inline-block;padding-left:8px;line-height:1;font-size:var(--el-checkbox-font-size)}.el-checkbox.el-checkbox--large{height:40px}.el-checkbox.el-checkbox--large .el-checkbox__label{font-size:14px}.el-checkbox.el-checkbox--large .el-checkbox__inner{width:14px;height:14px}.el-checkbox.el-checkbox--small{height:24px}.el-checkbox.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.el-checkbox--small .el-checkbox__inner{width:12px;height:12px}.el-checkbox.el-checkbox--small .el-checkbox__input.is-indeterminate .el-checkbox__inner:before{top:4px}.el-checkbox.el-checkbox--small .el-checkbox__inner:after{width:2px;height:6px}.el-checkbox:last-of-type{margin-right:0}[class*=el-col-]{box-sizing:border-box}[class*=el-col-].is-guttered{display:block;min-height:1px}.el-col-0,.el-col-0.is-guttered{display:none}.el-col-0{max-width:0%;flex:0 0 0%}.el-col-offset-0{margin-left:0}.el-col-pull-0{position:relative;right:0}.el-col-push-0{position:relative;left:0}.el-col-1{max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-offset-1{margin-left:4.1666666667%}.el-col-pull-1{position:relative;right:4.1666666667%}.el-col-push-1{position:relative;left:4.1666666667%}.el-col-2{max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-offset-2{margin-left:8.3333333333%}.el-col-pull-2{position:relative;right:8.3333333333%}.el-col-push-2{position:relative;left:8.3333333333%}.el-col-3{max-width:12.5%;flex:0 0 12.5%}.el-col-offset-3{margin-left:12.5%}.el-col-pull-3{position:relative;right:12.5%}.el-col-push-3{position:relative;left:12.5%}.el-col-4{max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-offset-4{margin-left:16.6666666667%}.el-col-pull-4{position:relative;right:16.6666666667%}.el-col-push-4{position:relative;left:16.6666666667%}.el-col-5{max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-offset-5{margin-left:20.8333333333%}.el-col-pull-5{position:relative;right:20.8333333333%}.el-col-push-5{position:relative;left:20.8333333333%}.el-col-6{max-width:25%;flex:0 0 25%}.el-col-offset-6{margin-left:25%}.el-col-pull-6{position:relative;right:25%}.el-col-push-6{position:relative;left:25%}.el-col-7{max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-offset-7{margin-left:29.1666666667%}.el-col-pull-7{position:relative;right:29.1666666667%}.el-col-push-7{position:relative;left:29.1666666667%}.el-col-8{max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-offset-8{margin-left:33.3333333333%}.el-col-pull-8{position:relative;right:33.3333333333%}.el-col-push-8{position:relative;left:33.3333333333%}.el-col-9{max-width:37.5%;flex:0 0 37.5%}.el-col-offset-9{margin-left:37.5%}.el-col-pull-9{position:relative;right:37.5%}.el-col-push-9{position:relative;left:37.5%}.el-col-10{max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-offset-10{margin-left:41.6666666667%}.el-col-pull-10{position:relative;right:41.6666666667%}.el-col-push-10{position:relative;left:41.6666666667%}.el-col-11{max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-offset-11{margin-left:45.8333333333%}.el-col-pull-11{position:relative;right:45.8333333333%}.el-col-push-11{position:relative;left:45.8333333333%}.el-col-12{max-width:50%;flex:0 0 50%}.el-col-offset-12{margin-left:50%}.el-col-pull-12{position:relative;right:50%}.el-col-push-12{position:relative;left:50%}.el-col-13{max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-offset-13{margin-left:54.1666666667%}.el-col-pull-13{position:relative;right:54.1666666667%}.el-col-push-13{position:relative;left:54.1666666667%}.el-col-14{max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-offset-14{margin-left:58.3333333333%}.el-col-pull-14{position:relative;right:58.3333333333%}.el-col-push-14{position:relative;left:58.3333333333%}.el-col-15{max-width:62.5%;flex:0 0 62.5%}.el-col-offset-15{margin-left:62.5%}.el-col-pull-15{position:relative;right:62.5%}.el-col-push-15{position:relative;left:62.5%}.el-col-16{max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-offset-16{margin-left:66.6666666667%}.el-col-pull-16{position:relative;right:66.6666666667%}.el-col-push-16{position:relative;left:66.6666666667%}.el-col-17{max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-offset-17{margin-left:70.8333333333%}.el-col-pull-17{position:relative;right:70.8333333333%}.el-col-push-17{position:relative;left:70.8333333333%}.el-col-18{max-width:75%;flex:0 0 75%}.el-col-offset-18{margin-left:75%}.el-col-pull-18{position:relative;right:75%}.el-col-push-18{position:relative;left:75%}.el-col-19{max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-offset-19{margin-left:79.1666666667%}.el-col-pull-19{position:relative;right:79.1666666667%}.el-col-push-19{position:relative;left:79.1666666667%}.el-col-20{max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-offset-20{margin-left:83.3333333333%}.el-col-pull-20{position:relative;right:83.3333333333%}.el-col-push-20{position:relative;left:83.3333333333%}.el-col-21{max-width:87.5%;flex:0 0 87.5%}.el-col-offset-21{margin-left:87.5%}.el-col-pull-21{position:relative;right:87.5%}.el-col-push-21{position:relative;left:87.5%}.el-col-22{max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-offset-22{margin-left:91.6666666667%}.el-col-pull-22{position:relative;right:91.6666666667%}.el-col-push-22{position:relative;left:91.6666666667%}.el-col-23{max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-offset-23{margin-left:95.8333333333%}.el-col-pull-23{position:relative;right:95.8333333333%}.el-col-push-23{position:relative;left:95.8333333333%}.el-col-24{max-width:100%;flex:0 0 100%}.el-col-offset-24{margin-left:100%}.el-col-pull-24{position:relative;right:100%}.el-col-push-24{position:relative;left:100%}@media only screen and (max-width:768px){.el-col-xs-0,.el-col-xs-0.is-guttered{display:none}.el-col-xs-0{max-width:0%;flex:0 0 0%}.el-col-xs-offset-0{margin-left:0}.el-col-xs-pull-0{position:relative;right:0}.el-col-xs-push-0{position:relative;left:0}.el-col-xs-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xs-offset-1{margin-left:4.1666666667%}.el-col-xs-pull-1{position:relative;right:4.1666666667%}.el-col-xs-push-1{position:relative;left:4.1666666667%}.el-col-xs-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xs-offset-2{margin-left:8.3333333333%}.el-col-xs-pull-2{position:relative;right:8.3333333333%}.el-col-xs-push-2{position:relative;left:8.3333333333%}.el-col-xs-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xs-offset-3{margin-left:12.5%}.el-col-xs-pull-3{position:relative;right:12.5%}.el-col-xs-push-3{position:relative;left:12.5%}.el-col-xs-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xs-offset-4{margin-left:16.6666666667%}.el-col-xs-pull-4{position:relative;right:16.6666666667%}.el-col-xs-push-4{position:relative;left:16.6666666667%}.el-col-xs-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xs-offset-5{margin-left:20.8333333333%}.el-col-xs-pull-5{position:relative;right:20.8333333333%}.el-col-xs-push-5{position:relative;left:20.8333333333%}.el-col-xs-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xs-offset-6{margin-left:25%}.el-col-xs-pull-6{position:relative;right:25%}.el-col-xs-push-6{position:relative;left:25%}.el-col-xs-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xs-offset-7{margin-left:29.1666666667%}.el-col-xs-pull-7{position:relative;right:29.1666666667%}.el-col-xs-push-7{position:relative;left:29.1666666667%}.el-col-xs-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xs-offset-8{margin-left:33.3333333333%}.el-col-xs-pull-8{position:relative;right:33.3333333333%}.el-col-xs-push-8{position:relative;left:33.3333333333%}.el-col-xs-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xs-offset-9{margin-left:37.5%}.el-col-xs-pull-9{position:relative;right:37.5%}.el-col-xs-push-9{position:relative;left:37.5%}.el-col-xs-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xs-offset-10{margin-left:41.6666666667%}.el-col-xs-pull-10{position:relative;right:41.6666666667%}.el-col-xs-push-10{position:relative;left:41.6666666667%}.el-col-xs-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xs-offset-11{margin-left:45.8333333333%}.el-col-xs-pull-11{position:relative;right:45.8333333333%}.el-col-xs-push-11{position:relative;left:45.8333333333%}.el-col-xs-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xs-offset-12{margin-left:50%}.el-col-xs-pull-12{position:relative;right:50%}.el-col-xs-push-12{position:relative;left:50%}.el-col-xs-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xs-offset-13{margin-left:54.1666666667%}.el-col-xs-pull-13{position:relative;right:54.1666666667%}.el-col-xs-push-13{position:relative;left:54.1666666667%}.el-col-xs-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xs-offset-14{margin-left:58.3333333333%}.el-col-xs-pull-14{position:relative;right:58.3333333333%}.el-col-xs-push-14{position:relative;left:58.3333333333%}.el-col-xs-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xs-offset-15{margin-left:62.5%}.el-col-xs-pull-15{position:relative;right:62.5%}.el-col-xs-push-15{position:relative;left:62.5%}.el-col-xs-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xs-offset-16{margin-left:66.6666666667%}.el-col-xs-pull-16{position:relative;right:66.6666666667%}.el-col-xs-push-16{position:relative;left:66.6666666667%}.el-col-xs-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xs-offset-17{margin-left:70.8333333333%}.el-col-xs-pull-17{position:relative;right:70.8333333333%}.el-col-xs-push-17{position:relative;left:70.8333333333%}.el-col-xs-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xs-offset-18{margin-left:75%}.el-col-xs-pull-18{position:relative;right:75%}.el-col-xs-push-18{position:relative;left:75%}.el-col-xs-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xs-offset-19{margin-left:79.1666666667%}.el-col-xs-pull-19{position:relative;right:79.1666666667%}.el-col-xs-push-19{position:relative;left:79.1666666667%}.el-col-xs-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xs-offset-20{margin-left:83.3333333333%}.el-col-xs-pull-20{position:relative;right:83.3333333333%}.el-col-xs-push-20{position:relative;left:83.3333333333%}.el-col-xs-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xs-offset-21{margin-left:87.5%}.el-col-xs-pull-21{position:relative;right:87.5%}.el-col-xs-push-21{position:relative;left:87.5%}.el-col-xs-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xs-offset-22{margin-left:91.6666666667%}.el-col-xs-pull-22{position:relative;right:91.6666666667%}.el-col-xs-push-22{position:relative;left:91.6666666667%}.el-col-xs-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xs-offset-23{margin-left:95.8333333333%}.el-col-xs-pull-23{position:relative;right:95.8333333333%}.el-col-xs-push-23{position:relative;left:95.8333333333%}.el-col-xs-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xs-offset-24{margin-left:100%}.el-col-xs-pull-24{position:relative;right:100%}.el-col-xs-push-24{position:relative;left:100%}}@media only screen and (min-width:768px){.el-col-sm-0,.el-col-sm-0.is-guttered{display:none}.el-col-sm-0{max-width:0%;flex:0 0 0%}.el-col-sm-offset-0{margin-left:0}.el-col-sm-pull-0{position:relative;right:0}.el-col-sm-push-0{position:relative;left:0}.el-col-sm-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-sm-offset-1{margin-left:4.1666666667%}.el-col-sm-pull-1{position:relative;right:4.1666666667%}.el-col-sm-push-1{position:relative;left:4.1666666667%}.el-col-sm-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-sm-offset-2{margin-left:8.3333333333%}.el-col-sm-pull-2{position:relative;right:8.3333333333%}.el-col-sm-push-2{position:relative;left:8.3333333333%}.el-col-sm-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-sm-offset-3{margin-left:12.5%}.el-col-sm-pull-3{position:relative;right:12.5%}.el-col-sm-push-3{position:relative;left:12.5%}.el-col-sm-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-sm-offset-4{margin-left:16.6666666667%}.el-col-sm-pull-4{position:relative;right:16.6666666667%}.el-col-sm-push-4{position:relative;left:16.6666666667%}.el-col-sm-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-sm-offset-5{margin-left:20.8333333333%}.el-col-sm-pull-5{position:relative;right:20.8333333333%}.el-col-sm-push-5{position:relative;left:20.8333333333%}.el-col-sm-6{display:block;max-width:25%;flex:0 0 25%}.el-col-sm-offset-6{margin-left:25%}.el-col-sm-pull-6{position:relative;right:25%}.el-col-sm-push-6{position:relative;left:25%}.el-col-sm-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-sm-offset-7{margin-left:29.1666666667%}.el-col-sm-pull-7{position:relative;right:29.1666666667%}.el-col-sm-push-7{position:relative;left:29.1666666667%}.el-col-sm-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-sm-offset-8{margin-left:33.3333333333%}.el-col-sm-pull-8{position:relative;right:33.3333333333%}.el-col-sm-push-8{position:relative;left:33.3333333333%}.el-col-sm-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-sm-offset-9{margin-left:37.5%}.el-col-sm-pull-9{position:relative;right:37.5%}.el-col-sm-push-9{position:relative;left:37.5%}.el-col-sm-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-sm-offset-10{margin-left:41.6666666667%}.el-col-sm-pull-10{position:relative;right:41.6666666667%}.el-col-sm-push-10{position:relative;left:41.6666666667%}.el-col-sm-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-sm-offset-11{margin-left:45.8333333333%}.el-col-sm-pull-11{position:relative;right:45.8333333333%}.el-col-sm-push-11{position:relative;left:45.8333333333%}.el-col-sm-12{display:block;max-width:50%;flex:0 0 50%}.el-col-sm-offset-12{margin-left:50%}.el-col-sm-pull-12{position:relative;right:50%}.el-col-sm-push-12{position:relative;left:50%}.el-col-sm-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-sm-offset-13{margin-left:54.1666666667%}.el-col-sm-pull-13{position:relative;right:54.1666666667%}.el-col-sm-push-13{position:relative;left:54.1666666667%}.el-col-sm-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-sm-offset-14{margin-left:58.3333333333%}.el-col-sm-pull-14{position:relative;right:58.3333333333%}.el-col-sm-push-14{position:relative;left:58.3333333333%}.el-col-sm-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-sm-offset-15{margin-left:62.5%}.el-col-sm-pull-15{position:relative;right:62.5%}.el-col-sm-push-15{position:relative;left:62.5%}.el-col-sm-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-sm-offset-16{margin-left:66.6666666667%}.el-col-sm-pull-16{position:relative;right:66.6666666667%}.el-col-sm-push-16{position:relative;left:66.6666666667%}.el-col-sm-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-sm-offset-17{margin-left:70.8333333333%}.el-col-sm-pull-17{position:relative;right:70.8333333333%}.el-col-sm-push-17{position:relative;left:70.8333333333%}.el-col-sm-18{display:block;max-width:75%;flex:0 0 75%}.el-col-sm-offset-18{margin-left:75%}.el-col-sm-pull-18{position:relative;right:75%}.el-col-sm-push-18{position:relative;left:75%}.el-col-sm-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-sm-offset-19{margin-left:79.1666666667%}.el-col-sm-pull-19{position:relative;right:79.1666666667%}.el-col-sm-push-19{position:relative;left:79.1666666667%}.el-col-sm-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-sm-offset-20{margin-left:83.3333333333%}.el-col-sm-pull-20{position:relative;right:83.3333333333%}.el-col-sm-push-20{position:relative;left:83.3333333333%}.el-col-sm-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-sm-offset-21{margin-left:87.5%}.el-col-sm-pull-21{position:relative;right:87.5%}.el-col-sm-push-21{position:relative;left:87.5%}.el-col-sm-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-sm-offset-22{margin-left:91.6666666667%}.el-col-sm-pull-22{position:relative;right:91.6666666667%}.el-col-sm-push-22{position:relative;left:91.6666666667%}.el-col-sm-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-sm-offset-23{margin-left:95.8333333333%}.el-col-sm-pull-23{position:relative;right:95.8333333333%}.el-col-sm-push-23{position:relative;left:95.8333333333%}.el-col-sm-24{display:block;max-width:100%;flex:0 0 100%}.el-col-sm-offset-24{margin-left:100%}.el-col-sm-pull-24{position:relative;right:100%}.el-col-sm-push-24{position:relative;left:100%}}@media only screen and (min-width:992px){.el-col-md-0,.el-col-md-0.is-guttered{display:none}.el-col-md-0{max-width:0%;flex:0 0 0%}.el-col-md-offset-0{margin-left:0}.el-col-md-pull-0{position:relative;right:0}.el-col-md-push-0{position:relative;left:0}.el-col-md-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-md-offset-1{margin-left:4.1666666667%}.el-col-md-pull-1{position:relative;right:4.1666666667%}.el-col-md-push-1{position:relative;left:4.1666666667%}.el-col-md-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-md-offset-2{margin-left:8.3333333333%}.el-col-md-pull-2{position:relative;right:8.3333333333%}.el-col-md-push-2{position:relative;left:8.3333333333%}.el-col-md-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-md-offset-3{margin-left:12.5%}.el-col-md-pull-3{position:relative;right:12.5%}.el-col-md-push-3{position:relative;left:12.5%}.el-col-md-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-md-offset-4{margin-left:16.6666666667%}.el-col-md-pull-4{position:relative;right:16.6666666667%}.el-col-md-push-4{position:relative;left:16.6666666667%}.el-col-md-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-md-offset-5{margin-left:20.8333333333%}.el-col-md-pull-5{position:relative;right:20.8333333333%}.el-col-md-push-5{position:relative;left:20.8333333333%}.el-col-md-6{display:block;max-width:25%;flex:0 0 25%}.el-col-md-offset-6{margin-left:25%}.el-col-md-pull-6{position:relative;right:25%}.el-col-md-push-6{position:relative;left:25%}.el-col-md-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-md-offset-7{margin-left:29.1666666667%}.el-col-md-pull-7{position:relative;right:29.1666666667%}.el-col-md-push-7{position:relative;left:29.1666666667%}.el-col-md-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-md-offset-8{margin-left:33.3333333333%}.el-col-md-pull-8{position:relative;right:33.3333333333%}.el-col-md-push-8{position:relative;left:33.3333333333%}.el-col-md-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-md-offset-9{margin-left:37.5%}.el-col-md-pull-9{position:relative;right:37.5%}.el-col-md-push-9{position:relative;left:37.5%}.el-col-md-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-md-offset-10{margin-left:41.6666666667%}.el-col-md-pull-10{position:relative;right:41.6666666667%}.el-col-md-push-10{position:relative;left:41.6666666667%}.el-col-md-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-md-offset-11{margin-left:45.8333333333%}.el-col-md-pull-11{position:relative;right:45.8333333333%}.el-col-md-push-11{position:relative;left:45.8333333333%}.el-col-md-12{display:block;max-width:50%;flex:0 0 50%}.el-col-md-offset-12{margin-left:50%}.el-col-md-pull-12{position:relative;right:50%}.el-col-md-push-12{position:relative;left:50%}.el-col-md-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-md-offset-13{margin-left:54.1666666667%}.el-col-md-pull-13{position:relative;right:54.1666666667%}.el-col-md-push-13{position:relative;left:54.1666666667%}.el-col-md-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-md-offset-14{margin-left:58.3333333333%}.el-col-md-pull-14{position:relative;right:58.3333333333%}.el-col-md-push-14{position:relative;left:58.3333333333%}.el-col-md-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-md-offset-15{margin-left:62.5%}.el-col-md-pull-15{position:relative;right:62.5%}.el-col-md-push-15{position:relative;left:62.5%}.el-col-md-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-md-offset-16{margin-left:66.6666666667%}.el-col-md-pull-16{position:relative;right:66.6666666667%}.el-col-md-push-16{position:relative;left:66.6666666667%}.el-col-md-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-md-offset-17{margin-left:70.8333333333%}.el-col-md-pull-17{position:relative;right:70.8333333333%}.el-col-md-push-17{position:relative;left:70.8333333333%}.el-col-md-18{display:block;max-width:75%;flex:0 0 75%}.el-col-md-offset-18{margin-left:75%}.el-col-md-pull-18{position:relative;right:75%}.el-col-md-push-18{position:relative;left:75%}.el-col-md-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-md-offset-19{margin-left:79.1666666667%}.el-col-md-pull-19{position:relative;right:79.1666666667%}.el-col-md-push-19{position:relative;left:79.1666666667%}.el-col-md-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-md-offset-20{margin-left:83.3333333333%}.el-col-md-pull-20{position:relative;right:83.3333333333%}.el-col-md-push-20{position:relative;left:83.3333333333%}.el-col-md-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-md-offset-21{margin-left:87.5%}.el-col-md-pull-21{position:relative;right:87.5%}.el-col-md-push-21{position:relative;left:87.5%}.el-col-md-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-md-offset-22{margin-left:91.6666666667%}.el-col-md-pull-22{position:relative;right:91.6666666667%}.el-col-md-push-22{position:relative;left:91.6666666667%}.el-col-md-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-md-offset-23{margin-left:95.8333333333%}.el-col-md-pull-23{position:relative;right:95.8333333333%}.el-col-md-push-23{position:relative;left:95.8333333333%}.el-col-md-24{display:block;max-width:100%;flex:0 0 100%}.el-col-md-offset-24{margin-left:100%}.el-col-md-pull-24{position:relative;right:100%}.el-col-md-push-24{position:relative;left:100%}}@media only screen and (min-width:1200px){.el-col-lg-0,.el-col-lg-0.is-guttered{display:none}.el-col-lg-0{max-width:0%;flex:0 0 0%}.el-col-lg-offset-0{margin-left:0}.el-col-lg-pull-0{position:relative;right:0}.el-col-lg-push-0{position:relative;left:0}.el-col-lg-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-lg-offset-1{margin-left:4.1666666667%}.el-col-lg-pull-1{position:relative;right:4.1666666667%}.el-col-lg-push-1{position:relative;left:4.1666666667%}.el-col-lg-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-lg-offset-2{margin-left:8.3333333333%}.el-col-lg-pull-2{position:relative;right:8.3333333333%}.el-col-lg-push-2{position:relative;left:8.3333333333%}.el-col-lg-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-lg-offset-3{margin-left:12.5%}.el-col-lg-pull-3{position:relative;right:12.5%}.el-col-lg-push-3{position:relative;left:12.5%}.el-col-lg-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-lg-offset-4{margin-left:16.6666666667%}.el-col-lg-pull-4{position:relative;right:16.6666666667%}.el-col-lg-push-4{position:relative;left:16.6666666667%}.el-col-lg-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-lg-offset-5{margin-left:20.8333333333%}.el-col-lg-pull-5{position:relative;right:20.8333333333%}.el-col-lg-push-5{position:relative;left:20.8333333333%}.el-col-lg-6{display:block;max-width:25%;flex:0 0 25%}.el-col-lg-offset-6{margin-left:25%}.el-col-lg-pull-6{position:relative;right:25%}.el-col-lg-push-6{position:relative;left:25%}.el-col-lg-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-lg-offset-7{margin-left:29.1666666667%}.el-col-lg-pull-7{position:relative;right:29.1666666667%}.el-col-lg-push-7{position:relative;left:29.1666666667%}.el-col-lg-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-lg-offset-8{margin-left:33.3333333333%}.el-col-lg-pull-8{position:relative;right:33.3333333333%}.el-col-lg-push-8{position:relative;left:33.3333333333%}.el-col-lg-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-lg-offset-9{margin-left:37.5%}.el-col-lg-pull-9{position:relative;right:37.5%}.el-col-lg-push-9{position:relative;left:37.5%}.el-col-lg-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-lg-offset-10{margin-left:41.6666666667%}.el-col-lg-pull-10{position:relative;right:41.6666666667%}.el-col-lg-push-10{position:relative;left:41.6666666667%}.el-col-lg-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-lg-offset-11{margin-left:45.8333333333%}.el-col-lg-pull-11{position:relative;right:45.8333333333%}.el-col-lg-push-11{position:relative;left:45.8333333333%}.el-col-lg-12{display:block;max-width:50%;flex:0 0 50%}.el-col-lg-offset-12{margin-left:50%}.el-col-lg-pull-12{position:relative;right:50%}.el-col-lg-push-12{position:relative;left:50%}.el-col-lg-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-lg-offset-13{margin-left:54.1666666667%}.el-col-lg-pull-13{position:relative;right:54.1666666667%}.el-col-lg-push-13{position:relative;left:54.1666666667%}.el-col-lg-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-lg-offset-14{margin-left:58.3333333333%}.el-col-lg-pull-14{position:relative;right:58.3333333333%}.el-col-lg-push-14{position:relative;left:58.3333333333%}.el-col-lg-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-lg-offset-15{margin-left:62.5%}.el-col-lg-pull-15{position:relative;right:62.5%}.el-col-lg-push-15{position:relative;left:62.5%}.el-col-lg-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-lg-offset-16{margin-left:66.6666666667%}.el-col-lg-pull-16{position:relative;right:66.6666666667%}.el-col-lg-push-16{position:relative;left:66.6666666667%}.el-col-lg-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-lg-offset-17{margin-left:70.8333333333%}.el-col-lg-pull-17{position:relative;right:70.8333333333%}.el-col-lg-push-17{position:relative;left:70.8333333333%}.el-col-lg-18{display:block;max-width:75%;flex:0 0 75%}.el-col-lg-offset-18{margin-left:75%}.el-col-lg-pull-18{position:relative;right:75%}.el-col-lg-push-18{position:relative;left:75%}.el-col-lg-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-lg-offset-19{margin-left:79.1666666667%}.el-col-lg-pull-19{position:relative;right:79.1666666667%}.el-col-lg-push-19{position:relative;left:79.1666666667%}.el-col-lg-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-lg-offset-20{margin-left:83.3333333333%}.el-col-lg-pull-20{position:relative;right:83.3333333333%}.el-col-lg-push-20{position:relative;left:83.3333333333%}.el-col-lg-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-lg-offset-21{margin-left:87.5%}.el-col-lg-pull-21{position:relative;right:87.5%}.el-col-lg-push-21{position:relative;left:87.5%}.el-col-lg-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-lg-offset-22{margin-left:91.6666666667%}.el-col-lg-pull-22{position:relative;right:91.6666666667%}.el-col-lg-push-22{position:relative;left:91.6666666667%}.el-col-lg-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-lg-offset-23{margin-left:95.8333333333%}.el-col-lg-pull-23{position:relative;right:95.8333333333%}.el-col-lg-push-23{position:relative;left:95.8333333333%}.el-col-lg-24{display:block;max-width:100%;flex:0 0 100%}.el-col-lg-offset-24{margin-left:100%}.el-col-lg-pull-24{position:relative;right:100%}.el-col-lg-push-24{position:relative;left:100%}}@media only screen and (min-width:1920px){.el-col-xl-0,.el-col-xl-0.is-guttered{display:none}.el-col-xl-0{max-width:0%;flex:0 0 0%}.el-col-xl-offset-0{margin-left:0}.el-col-xl-pull-0{position:relative;right:0}.el-col-xl-push-0{position:relative;left:0}.el-col-xl-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xl-offset-1{margin-left:4.1666666667%}.el-col-xl-pull-1{position:relative;right:4.1666666667%}.el-col-xl-push-1{position:relative;left:4.1666666667%}.el-col-xl-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xl-offset-2{margin-left:8.3333333333%}.el-col-xl-pull-2{position:relative;right:8.3333333333%}.el-col-xl-push-2{position:relative;left:8.3333333333%}.el-col-xl-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xl-offset-3{margin-left:12.5%}.el-col-xl-pull-3{position:relative;right:12.5%}.el-col-xl-push-3{position:relative;left:12.5%}.el-col-xl-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xl-offset-4{margin-left:16.6666666667%}.el-col-xl-pull-4{position:relative;right:16.6666666667%}.el-col-xl-push-4{position:relative;left:16.6666666667%}.el-col-xl-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xl-offset-5{margin-left:20.8333333333%}.el-col-xl-pull-5{position:relative;right:20.8333333333%}.el-col-xl-push-5{position:relative;left:20.8333333333%}.el-col-xl-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xl-offset-6{margin-left:25%}.el-col-xl-pull-6{position:relative;right:25%}.el-col-xl-push-6{position:relative;left:25%}.el-col-xl-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xl-offset-7{margin-left:29.1666666667%}.el-col-xl-pull-7{position:relative;right:29.1666666667%}.el-col-xl-push-7{position:relative;left:29.1666666667%}.el-col-xl-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xl-offset-8{margin-left:33.3333333333%}.el-col-xl-pull-8{position:relative;right:33.3333333333%}.el-col-xl-push-8{position:relative;left:33.3333333333%}.el-col-xl-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xl-offset-9{margin-left:37.5%}.el-col-xl-pull-9{position:relative;right:37.5%}.el-col-xl-push-9{position:relative;left:37.5%}.el-col-xl-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xl-offset-10{margin-left:41.6666666667%}.el-col-xl-pull-10{position:relative;right:41.6666666667%}.el-col-xl-push-10{position:relative;left:41.6666666667%}.el-col-xl-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xl-offset-11{margin-left:45.8333333333%}.el-col-xl-pull-11{position:relative;right:45.8333333333%}.el-col-xl-push-11{position:relative;left:45.8333333333%}.el-col-xl-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xl-offset-12{margin-left:50%}.el-col-xl-pull-12{position:relative;right:50%}.el-col-xl-push-12{position:relative;left:50%}.el-col-xl-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xl-offset-13{margin-left:54.1666666667%}.el-col-xl-pull-13{position:relative;right:54.1666666667%}.el-col-xl-push-13{position:relative;left:54.1666666667%}.el-col-xl-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xl-offset-14{margin-left:58.3333333333%}.el-col-xl-pull-14{position:relative;right:58.3333333333%}.el-col-xl-push-14{position:relative;left:58.3333333333%}.el-col-xl-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xl-offset-15{margin-left:62.5%}.el-col-xl-pull-15{position:relative;right:62.5%}.el-col-xl-push-15{position:relative;left:62.5%}.el-col-xl-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xl-offset-16{margin-left:66.6666666667%}.el-col-xl-pull-16{position:relative;right:66.6666666667%}.el-col-xl-push-16{position:relative;left:66.6666666667%}.el-col-xl-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xl-offset-17{margin-left:70.8333333333%}.el-col-xl-pull-17{position:relative;right:70.8333333333%}.el-col-xl-push-17{position:relative;left:70.8333333333%}.el-col-xl-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xl-offset-18{margin-left:75%}.el-col-xl-pull-18{position:relative;right:75%}.el-col-xl-push-18{position:relative;left:75%}.el-col-xl-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xl-offset-19{margin-left:79.1666666667%}.el-col-xl-pull-19{position:relative;right:79.1666666667%}.el-col-xl-push-19{position:relative;left:79.1666666667%}.el-col-xl-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xl-offset-20{margin-left:83.3333333333%}.el-col-xl-pull-20{position:relative;right:83.3333333333%}.el-col-xl-push-20{position:relative;left:83.3333333333%}.el-col-xl-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xl-offset-21{margin-left:87.5%}.el-col-xl-pull-21{position:relative;right:87.5%}.el-col-xl-push-21{position:relative;left:87.5%}.el-col-xl-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xl-offset-22{margin-left:91.6666666667%}.el-col-xl-pull-22{position:relative;right:91.6666666667%}.el-col-xl-push-22{position:relative;left:91.6666666667%}.el-col-xl-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xl-offset-23{margin-left:95.8333333333%}.el-col-xl-pull-23{position:relative;right:95.8333333333%}.el-col-xl-push-23{position:relative;left:95.8333333333%}.el-col-xl-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xl-offset-24{margin-left:100%}.el-col-xl-pull-24{position:relative;right:100%}.el-col-xl-push-24{position:relative;left:100%}}.el-collapse{--el-collapse-border-color:var(--el-border-color-lighter);--el-collapse-header-height:48px;--el-collapse-header-bg-color:var(--el-fill-color-blank);--el-collapse-header-text-color:var(--el-text-color-primary);--el-collapse-header-font-size:13px;--el-collapse-content-bg-color:var(--el-fill-color-blank);--el-collapse-content-font-size:13px;--el-collapse-content-text-color:var(--el-text-color-primary);border-top:1px solid var(--el-collapse-border-color);border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item.is-disabled .el-collapse-item__header{color:var(--el-text-color-disabled);cursor:not-allowed}.el-collapse-item__header{display:flex;align-items:center;height:var(--el-collapse-header-height);line-height:var(--el-collapse-header-height);background-color:var(--el-collapse-header-bg-color);color:var(--el-collapse-header-text-color);cursor:pointer;border-bottom:1px solid var(--el-collapse-border-color);font-size:var(--el-collapse-header-font-size);font-weight:500;transition:border-bottom-color var(--el-transition-duration);outline:0}.el-collapse-item__arrow{margin:0 8px 0 auto;transition:transform var(--el-transition-duration);font-weight:300}.el-collapse-item__arrow.is-active{transform:rotate(90deg)}.el-collapse-item__header.focusing:focus:not(:hover){color:var(--el-color-primary)}.el-collapse-item__header.is-active{border-bottom-color:transparent}.el-collapse-item__wrap{will-change:height;background-color:var(--el-collapse-content-bg-color);overflow:hidden;box-sizing:border-box;border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item__content{padding-bottom:25px;font-size:var(--el-collapse-content-font-size);color:var(--el-collapse-content-text-color);line-height:1.7692307692}.el-collapse-item:last-child{margin-bottom:-1px}.el-color-predefine{display:flex;font-size:12px;margin-top:8px;width:280px}.el-color-predefine__colors{display:flex;flex:1;flex-wrap:wrap}.el-color-predefine__color-selector{margin:0 0 8px 8px;width:20px;height:20px;border-radius:4px;cursor:pointer}.el-color-predefine__color-selector:nth-child(10n+1){margin-left:0}.el-color-predefine__color-selector.selected{box-shadow:0 0 3px 2px var(--el-color-primary)}.el-color-predefine__color-selector>div{display:flex;height:100%;border-radius:3px}.el-color-predefine__color-selector.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-hue-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-color:red;padding:0 2px;float:right}.el-color-hue-slider__bar{position:relative;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);height:100%}.el-color-hue-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-hue-slider.is-vertical{width:12px;height:180px;padding:2px 0}.el-color-hue-slider.is-vertical .el-color-hue-slider__bar{background:linear-gradient(to bottom,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}.el-color-hue-slider.is-vertical .el-color-hue-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-svpanel{position:relative;width:280px;height:180px}.el-color-svpanel__black,.el-color-svpanel__white{position:absolute;top:0;left:0;right:0;bottom:0}.el-color-svpanel__white{background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.el-color-svpanel__black{background:linear-gradient(to top,#000,rgba(0,0,0,0))}.el-color-svpanel__cursor{position:absolute}.el-color-svpanel__cursor>div{cursor:head;width:4px;height:4px;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px #0000004d,0 0 1px 2px #0006;border-radius:50%;transform:translate(-2px,-2px)}.el-color-alpha-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-alpha-slider__bar{position:relative;background:linear-gradient(to right,rgba(255,255,255,0) 0,var(--el-bg-color) 100%);height:100%}.el-color-alpha-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-alpha-slider.is-vertical{width:20px;height:180px}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__bar{background:linear-gradient(to bottom,rgba(255,255,255,0) 0,#fff 100%)}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-dropdown{width:300px}.el-color-dropdown__main-wrapper{margin-bottom:6px}.el-color-dropdown__main-wrapper:after{content:"";display:table;clear:both}.el-color-dropdown__btns{margin-top:12px;text-align:right}.el-color-dropdown__value{float:left;line-height:26px;font-size:12px;color:#000;width:160px}.el-color-picker{display:inline-block;position:relative;line-height:normal;outline:0}.el-color-picker:hover:not(.is-disabled) .el-color-picker__trigger{border:1px solid var(--el-border-color-hover)}.el-color-picker:focus-visible:not(.is-disabled) .el-color-picker__trigger{outline:2px solid var(--el-color-primary);outline-offset:1px}.el-color-picker.is-disabled .el-color-picker__trigger{cursor:not-allowed}.el-color-picker--large{height:40px}.el-color-picker--large .el-color-picker__trigger{height:40px;width:40px}.el-color-picker--large .el-color-picker__mask{height:38px;width:38px}.el-color-picker--small{height:24px}.el-color-picker--small .el-color-picker__trigger{height:24px;width:24px}.el-color-picker--small .el-color-picker__mask{height:22px;width:22px}.el-color-picker--small .el-color-picker__empty,.el-color-picker--small .el-color-picker__icon{transform:scale(.8)}.el-color-picker__mask{height:30px;width:30px;border-radius:4px;position:absolute;top:1px;left:1px;z-index:1;cursor:not-allowed;background-color:#ffffffb3}.el-color-picker__trigger{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;height:32px;width:32px;padding:4px;border:1px solid var(--el-border-color);border-radius:4px;font-size:0;position:relative;cursor:pointer}.el-color-picker__color{position:relative;display:block;box-sizing:border-box;border:1px solid var(--el-text-color-secondary);border-radius:var(--el-border-radius-small);width:100%;height:100%;text-align:center}.el-color-picker__color.is-alpha{background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-picker__color-inner{display:inline-flex;justify-content:center;align-items:center;width:100%;height:100%}.el-color-picker .el-color-picker__empty{font-size:12px;color:var(--el-text-color-secondary)}.el-color-picker .el-color-picker__icon{display:inline-flex;justify-content:center;align-items:center;color:#fff;font-size:12px}.el-color-picker__panel{position:absolute;z-index:10;padding:6px;box-sizing:content-box;background-color:#fff;border-radius:var(--el-border-radius-base);box-shadow:var(--el-box-shadow-light)}.el-color-picker__panel.el-popper{border:1px solid var(--el-border-color-lighter)}.el-color-picker,.el-color-picker__panel{--el-color-picker-alpha-bg-a:#ccc;--el-color-picker-alpha-bg-b:transparent}.dark .el-color-picker,.dark .el-color-picker__panel{--el-color-picker-alpha-bg-a:#333333}.el-container{display:flex;flex-direction:row;flex:1;flex-basis:auto;box-sizing:border-box;min-width:0}.el-container.is-vertical{flex-direction:column}.el-date-table{font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-date-table.is-week-mode .el-date-table__row:hover .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table.is-week-mode .el-date-table__row:hover td.available:hover{color:var(--el-datepicker-text-color)}.el-date-table.is-week-mode .el-date-table__row:hover td:first-child .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table.is-week-mode .el-date-table__row:hover td:last-child .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table.is-week-mode .el-date-table__row.current .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td{width:32px;height:30px;padding:4px 0;box-sizing:border-box;text-align:center;cursor:pointer;position:relative}.el-date-table td .el-date-table-cell{height:30px;padding:3px 0;box-sizing:border-box}.el-date-table td .el-date-table-cell .el-date-table-cell__text{width:24px;height:24px;display:block;margin:0 auto;line-height:24px;position:absolute;left:50%;transform:translate(-50%);border-radius:50%}.el-date-table td.next-month,.el-date-table td.prev-month{color:var(--el-datepicker-off-text-color)}.el-date-table td.today{position:relative}.el-date-table td.today .el-date-table-cell__text{color:var(--el-color-primary);font-weight:700}.el-date-table td.today.end-date .el-date-table-cell__text,.el-date-table td.today.start-date .el-date-table-cell__text{color:#fff}.el-date-table td.available:hover{color:var(--el-datepicker-hover-text-color)}.el-date-table td.in-range .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td.in-range .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.current:not(.disabled) .el-date-table-cell__text{color:#fff;background-color:var(--el-datepicker-active-color)}.el-date-table td.current:not(.disabled):focus-visible .el-date-table-cell__text{outline:2px solid var(--el-datepicker-active-color);outline-offset:1px}.el-date-table td.end-date .el-date-table-cell,.el-date-table td.start-date .el-date-table-cell{color:#fff}.el-date-table td.end-date .el-date-table-cell__text,.el-date-table td.start-date .el-date-table-cell__text{background-color:var(--el-datepicker-active-color)}.el-date-table td.start-date .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table td.end-date .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table td.disabled .el-date-table-cell{background-color:var(--el-fill-color-light);opacity:1;cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-date-table td.selected .el-date-table-cell{margin-left:5px;margin-right:5px;background-color:var(--el-datepicker-inrange-bg-color);border-radius:15px}.el-date-table td.selected .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.selected .el-date-table-cell__text{background-color:var(--el-datepicker-active-color);color:#fff;border-radius:15px}.el-date-table td.week{font-size:80%;color:var(--el-datepicker-header-text-color)}.el-date-table td:focus{outline:0}.el-date-table th{padding:5px;color:var(--el-datepicker-header-text-color);font-weight:400;border-bottom:solid 1px var(--el-border-color-lighter)}.el-month-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-month-table td{text-align:center;padding:8px 0;cursor:pointer}.el-month-table td div{height:48px;padding:6px 0;box-sizing:border-box}.el-month-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-month-table td.today.end-date .cell,.el-month-table td.today.start-date .cell{color:#fff}.el-month-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-month-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-month-table td .cell{width:60px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);margin:0 auto;border-radius:18px}.el-month-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-month-table td.in-range div{background-color:var(--el-datepicker-inrange-bg-color)}.el-month-table td.in-range div:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-month-table td.end-date div,.el-month-table td.start-date div{color:#fff}.el-month-table td.end-date .cell,.el-month-table td.start-date .cell{color:#fff;background-color:var(--el-datepicker-active-color)}.el-month-table td.start-date div{border-top-left-radius:24px;border-bottom-left-radius:24px}.el-month-table td.end-date div{border-top-right-radius:24px;border-bottom-right-radius:24px}.el-month-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-month-table td:focus-visible{outline:0}.el-month-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-year-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-year-table .el-icon{color:var(--el-datepicker-icon-color)}.el-year-table td{text-align:center;padding:20px 3px;cursor:pointer}.el-year-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-year-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-year-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-year-table td .cell{width:48px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);border-radius:18px;margin:0 auto}.el-year-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-year-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-year-table td:focus-visible{outline:0}.el-year-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-time-spinner.has-seconds .el-time-spinner__wrapper{width:33.3%}.el-time-spinner__wrapper{max-height:192px;overflow:auto;display:inline-block;width:50%;vertical-align:top;position:relative}.el-time-spinner__wrapper.el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default){padding-bottom:15px}.el-time-spinner__wrapper.is-arrow{box-sizing:border-box;text-align:center;overflow:hidden}.el-time-spinner__wrapper.is-arrow .el-time-spinner__list{transform:translateY(-32px)}.el-time-spinner__wrapper.is-arrow .el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:default}.el-time-spinner__arrow{font-size:12px;color:var(--el-text-color-secondary);position:absolute;left:0;width:100%;z-index:var(--el-index-normal);text-align:center;height:30px;line-height:30px;cursor:pointer}.el-time-spinner__arrow:hover{color:var(--el-color-primary)}.el-time-spinner__arrow.arrow-up{top:10px}.el-time-spinner__arrow.arrow-down{bottom:10px}.el-time-spinner__input.el-input{width:70%}.el-time-spinner__input.el-input .el-input__inner{padding:0;text-align:center}.el-time-spinner__list{padding:0;margin:0;list-style:none;text-align:center}.el-time-spinner__list:after,.el-time-spinner__list:before{content:"";display:block;width:100%;height:80px}.el-time-spinner__item{height:32px;line-height:32px;font-size:12px;color:var(--el-text-color-regular)}.el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:pointer}.el-time-spinner__item.is-active:not(.is-disabled){color:var(--el-text-color-primary);font-weight:700}.el-time-spinner__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-picker__popper{--el-datepicker-border-color:var(--el-disabled-border-color)}.el-picker__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-datepicker-border-color);box-shadow:var(--el-box-shadow-light)}.el-picker__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-datepicker-border-color)}.el-picker__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-date-editor{--el-date-editor-width:220px;--el-date-editor-monthrange-width:300px;--el-date-editor-daterange-width:350px;--el-date-editor-datetimerange-width:400px;--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary);position:relative;display:inline-block;text-align:left}.el-date-editor.el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-date-editor.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-date-editor.el-input,.el-date-editor.el-input__wrapper{width:var(--el-date-editor-width);height:var(--el-input-height,var(--el-component-size))}.el-date-editor--monthrange{--el-date-editor-width:var(--el-date-editor-monthrange-width)}.el-date-editor--daterange,.el-date-editor--timerange{--el-date-editor-width:var(--el-date-editor-daterange-width)}.el-date-editor--datetimerange{--el-date-editor-width:var(--el-date-editor-datetimerange-width)}.el-date-editor--dates .el-input__wrapper{text-overflow:ellipsis;white-space:nowrap}.el-date-editor .close-icon,.el-date-editor .clear-icon{cursor:pointer}.el-date-editor .clear-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__icon{height:inherit;font-size:14px;color:var(--el-text-color-placeholder);float:left}.el-date-editor .el-range__icon svg{vertical-align:middle}.el-date-editor .el-range-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;outline:0;display:inline-block;height:30px;line-height:30px;margin:0;padding:0;width:39%;text-align:center;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);background-color:transparent}.el-date-editor .el-range-input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input::placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-separator{flex:1;display:inline-flex;justify-content:center;align-items:center;height:100%;padding:0 5px;margin:0;font-size:14px;word-break:keep-all;color:var(--el-text-color-primary)}.el-date-editor .el-range__close-icon{font-size:14px;color:var(--el-text-color-placeholder);height:inherit;width:unset;cursor:pointer}.el-date-editor .el-range__close-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__close-icon svg{vertical-align:middle}.el-date-editor .el-range__close-icon--hidden{opacity:0;visibility:hidden}.el-range-editor.el-input__wrapper{display:inline-flex;align-items:center;padding:0 10px}.el-range-editor.is-active,.el-range-editor.is-active:hover{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-range-editor--large{line-height:var(--el-component-size-large)}.el-range-editor--large.el-input__wrapper{height:var(--el-component-size-large)}.el-range-editor--large .el-range-separator{line-height:40px;font-size:14px}.el-range-editor--large .el-range-input{height:38px;line-height:38px;font-size:14px}.el-range-editor--small{line-height:var(--el-component-size-small)}.el-range-editor--small.el-input__wrapper{height:var(--el-component-size-small)}.el-range-editor--small .el-range-separator{line-height:24px;font-size:12px}.el-range-editor--small .el-range-input{height:22px;line-height:22px;font-size:12px}.el-range-editor.is-disabled{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled:focus,.el-range-editor.is-disabled:hover{border-color:var(--el-disabled-border-color)}.el-range-editor.is-disabled input{background-color:var(--el-disabled-bg-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input::placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled .el-range-separator{color:var(--el-disabled-text-color)}.el-picker-panel{color:var(--el-text-color-regular);background:var(--el-bg-color-overlay);border-radius:var(--el-border-radius-base);line-height:30px}.el-picker-panel .el-time-panel{margin:5px 0;border:solid 1px var(--el-datepicker-border-color);background-color:var(--el-bg-color-overlay);box-shadow:var(--el-box-shadow-light)}.el-picker-panel__body-wrapper:after,.el-picker-panel__body:after{content:"";display:table;clear:both}.el-picker-panel__content{position:relative;margin:15px}.el-picker-panel__footer{border-top:1px solid var(--el-datepicker-inner-border-color);padding:4px 12px;text-align:right;background-color:var(--el-bg-color-overlay);position:relative;font-size:0}.el-picker-panel__shortcut{display:block;width:100%;border:0;background-color:transparent;line-height:28px;font-size:14px;color:var(--el-datepicker-text-color);padding-left:12px;text-align:left;outline:0;cursor:pointer}.el-picker-panel__shortcut:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__shortcut.active{background-color:#e6f1fe;color:var(--el-datepicker-active-color)}.el-picker-panel__btn{border:1px solid var(--el-fill-color-darker);color:var(--el-text-color-primary);line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:0;font-size:12px}.el-picker-panel__btn[disabled]{color:var(--el-text-color-disabled);cursor:not-allowed}.el-picker-panel__icon-btn{font-size:12px;color:var(--el-datepicker-icon-color);border:0;background:0 0;cursor:pointer;outline:0;margin-top:8px}.el-picker-panel__icon-btn:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn:focus-visible{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn.is-disabled{color:var(--el-text-color-disabled)}.el-picker-panel__icon-btn.is-disabled:hover{cursor:not-allowed}.el-picker-panel__icon-btn .el-icon{cursor:pointer;font-size:inherit}.el-picker-panel__link-btn{vertical-align:middle}.el-picker-panel [slot=sidebar],.el-picker-panel__sidebar{position:absolute;top:0;bottom:0;width:110px;border-right:1px solid var(--el-datepicker-inner-border-color);box-sizing:border-box;padding-top:6px;background-color:var(--el-bg-color-overlay);overflow:auto}.el-picker-panel [slot=sidebar]+.el-picker-panel__body,.el-picker-panel__sidebar+.el-picker-panel__body{margin-left:110px}.el-date-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-picker{width:322px}.el-date-picker.has-sidebar.has-time{width:434px}.el-date-picker.has-sidebar{width:438px}.el-date-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-picker .el-picker-panel__content{width:292px}.el-date-picker table{table-layout:fixed;width:100%}.el-date-picker__editor-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-picker__header{margin:12px;text-align:center}.el-date-picker__header--bordered{margin-bottom:0;padding-bottom:12px;border-bottom:solid 1px var(--el-border-color-lighter)}.el-date-picker__header--bordered+.el-picker-panel__content{margin-top:0}.el-date-picker__header-label{font-size:16px;font-weight:500;padding:0 5px;line-height:22px;text-align:center;cursor:pointer;color:var(--el-text-color-regular)}.el-date-picker__header-label:hover{color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label:focus-visible{outline:0;color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label.active{color:var(--el-datepicker-active-color)}.el-date-picker__prev-btn{float:left}.el-date-picker__next-btn{float:right}.el-date-picker__time-wrap{padding:10px;text-align:center}.el-date-picker__time-label{float:left;cursor:pointer;line-height:30px;margin-left:10px}.el-date-picker .el-time-panel{position:absolute}.el-date-range-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-range-picker{width:646px}.el-date-range-picker.has-sidebar{width:756px}.el-date-range-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-range-picker table{table-layout:fixed;width:100%}.el-date-range-picker .el-picker-panel__body{min-width:513px}.el-date-range-picker .el-picker-panel__content{margin:0}.el-date-range-picker__header{position:relative;text-align:center;height:28px}.el-date-range-picker__header [class*=arrow-left]{float:left}.el-date-range-picker__header [class*=arrow-right]{float:right}.el-date-range-picker__header div{font-size:16px;font-weight:500;margin-right:50px}.el-date-range-picker__content{float:left;width:50%;box-sizing:border-box;margin:0;padding:16px}.el-date-range-picker__content.is-left{border-right:1px solid var(--el-datepicker-inner-border-color)}.el-date-range-picker__content .el-date-range-picker__header div{margin-left:50px;margin-right:50px}.el-date-range-picker__editors-wrap{box-sizing:border-box;display:table-cell}.el-date-range-picker__editors-wrap.is-right{text-align:right}.el-date-range-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-range-picker__time-header>.el-icon-arrow-right{font-size:20px;vertical-align:middle;display:table-cell;color:var(--el-datepicker-icon-color)}.el-date-range-picker__time-picker-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-range-picker__time-picker-wrap .el-picker-panel{position:absolute;top:13px;right:0;z-index:1;background:#fff}.el-date-range-picker__time-picker-wrap .el-time-panel{position:absolute}.el-time-range-picker{width:354px;overflow:visible}.el-time-range-picker__content{position:relative;text-align:center;padding:10px;z-index:1}.el-time-range-picker__cell{box-sizing:border-box;margin:0;padding:4px 7px 7px;width:50%;display:inline-block}.el-time-range-picker__header{margin-bottom:5px;text-align:center;font-size:14px}.el-time-range-picker__body{border-radius:2px;border:1px solid var(--el-datepicker-border-color)}.el-time-panel{border-radius:2px;position:relative;width:180px;left:0;z-index:var(--el-index-top);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:content-box}.el-time-panel__content{font-size:0;position:relative;overflow:hidden}.el-time-panel__content:after,.el-time-panel__content:before{content:"";top:50%;position:absolute;margin-top:-16px;height:32px;z-index:-1;left:0;right:0;box-sizing:border-box;padding-top:6px;text-align:left}.el-time-panel__content:after{left:50%;margin-left:12%;margin-right:12%}.el-time-panel__content:before{padding-left:50%;margin-right:12%;margin-left:12%;border-top:1px solid var(--el-border-color-light);border-bottom:1px solid var(--el-border-color-light)}.el-time-panel__content.has-seconds:after{left:66.6666666667%}.el-time-panel__content.has-seconds:before{padding-left:33.3333333333%}.el-time-panel__footer{border-top:1px solid var(--el-timepicker-inner-border-color,var(--el-border-color-light));padding:4px;height:36px;line-height:25px;text-align:right;box-sizing:border-box}.el-time-panel__btn{border:none;line-height:28px;padding:0 5px;margin:0 5px;cursor:pointer;background-color:transparent;outline:0;font-size:12px;color:var(--el-text-color-primary)}.el-time-panel__btn.confirm{font-weight:800;color:var(--el-timepicker-active-color,var(--el-color-primary))}.el-descriptions{--el-descriptions-table-border:1px solid var(--el-border-color-lighter);--el-descriptions-item-bordered-label-background:var(--el-fill-color-light);box-sizing:border-box;font-size:var(--el-font-size-base);color:var(--el-text-color-primary)}.el-descriptions__header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.el-descriptions__title{color:var(--el-text-color-primary);font-size:16px;font-weight:700}.el-descriptions__body{background-color:var(--el-fill-color-blank)}.el-descriptions__body .el-descriptions__table{border-collapse:collapse;width:100%}.el-descriptions__body .el-descriptions__table .el-descriptions__cell{box-sizing:border-box;text-align:left;font-weight:400;line-height:23px;font-size:14px}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-left{text-align:left}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-center{text-align:center}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-right{text-align:right}.el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{border:var(--el-descriptions-table-border);padding:8px 11px}.el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:12px}.el-descriptions--large{font-size:14px}.el-descriptions--large .el-descriptions__header{margin-bottom:20px}.el-descriptions--large .el-descriptions__header .el-descriptions__title{font-size:16px}.el-descriptions--large .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:14px}.el-descriptions--large .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:12px 15px}.el-descriptions--large .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:16px}.el-descriptions--small{font-size:12px}.el-descriptions--small .el-descriptions__header{margin-bottom:12px}.el-descriptions--small .el-descriptions__header .el-descriptions__title{font-size:14px}.el-descriptions--small .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:12px}.el-descriptions--small .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:4px 7px}.el-descriptions--small .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:8px}.el-descriptions__label.el-descriptions__cell.is-bordered-label{font-weight:700;color:var(--el-text-color-regular);background:var(--el-descriptions-item-bordered-label-background)}.el-descriptions__label:not(.is-bordered-label){color:var(--el-text-color-primary);margin-right:16px}.el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:6px}.el-descriptions__content.el-descriptions__cell.is-bordered-content{color:var(--el-text-color-primary)}.el-descriptions__content:not(.is-bordered-label){color:var(--el-text-color-regular)}.el-descriptions--large .el-descriptions__label:not(.is-bordered-label){margin-right:16px}.el-descriptions--large .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:8px}.el-descriptions--small .el-descriptions__label:not(.is-bordered-label){margin-right:12px}.el-descriptions--small .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:4px}:root{--el-popup-modal-bg-color:var(--el-color-black);--el-popup-modal-opacity:.5}.v-modal-enter{-webkit-animation:v-modal-in var(--el-transition-duration-fast) ease;animation:v-modal-in var(--el-transition-duration-fast) ease}.v-modal-leave{-webkit-animation:v-modal-out var(--el-transition-duration-fast) ease forwards;animation:v-modal-out var(--el-transition-duration-fast) ease forwards}@-webkit-keyframes v-modal-in{0%{opacity:0}}@keyframes v-modal-in{0%{opacity:0}}@-webkit-keyframes v-modal-out{to{opacity:0}}@keyframes v-modal-out{to{opacity:0}}.v-modal{position:fixed;left:0;top:0;width:100%;height:100%;opacity:var(--el-popup-modal-opacity);background:var(--el-popup-modal-bg-color)}.el-popup-parent--hidden{overflow:hidden}.el-dialog{--el-dialog-width:50%;--el-dialog-margin-top:15vh;--el-dialog-bg-color:var(--el-bg-color);--el-dialog-box-shadow:var(--el-box-shadow);--el-dialog-title-font-size:var(--el-font-size-large);--el-dialog-content-font-size:14px;--el-dialog-font-line-height:var(--el-font-line-height-primary);--el-dialog-padding-primary:20px;--el-dialog-border-radius:var(--el-border-radius-small);position:relative;margin:var(--el-dialog-margin-top,15vh) auto 50px;background:var(--el-dialog-bg-color);border-radius:var(--el-dialog-border-radius);box-shadow:var(--el-dialog-box-shadow);box-sizing:border-box;width:var(--el-dialog-width,50%)}.el-dialog:focus{outline:0!important}.el-dialog.is-align-center{margin:auto}.el-dialog.is-fullscreen{--el-dialog-width:100%;--el-dialog-margin-top:0;margin-bottom:0;height:100%;overflow:auto}.el-dialog__wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;margin:0}.el-dialog.is-draggable .el-dialog__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-dialog__header{padding:var(--el-dialog-padding-primary);padding-bottom:10px;margin-right:16px}.el-dialog__headerbtn{position:absolute;top:6px;right:0;padding:0;width:54px;height:54px;background:0 0;border:none;outline:0;cursor:pointer;font-size:var(--el-message-close-size,16px)}.el-dialog__headerbtn .el-dialog__close{color:var(--el-color-info);font-size:inherit}.el-dialog__headerbtn:focus .el-dialog__close,.el-dialog__headerbtn:hover .el-dialog__close{color:var(--el-color-primary)}.el-dialog__title{line-height:var(--el-dialog-font-line-height);font-size:var(--el-dialog-title-font-size);color:var(--el-text-color-primary)}.el-dialog__body{padding:calc(var(--el-dialog-padding-primary) + 10px) var(--el-dialog-padding-primary);color:var(--el-text-color-regular);font-size:var(--el-dialog-content-font-size)}.el-dialog__footer{padding:var(--el-dialog-padding-primary);padding-top:10px;text-align:right;box-sizing:border-box}.el-dialog--center{text-align:center}.el-dialog--center .el-dialog__body{text-align:initial;padding:25px calc(var(--el-dialog-padding-primary) + 5px) 30px}.el-dialog--center .el-dialog__footer{text-align:inherit}.el-overlay-dialog{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto}.dialog-fade-enter-active{-webkit-animation:modal-fade-in var(--el-transition-duration);animation:modal-fade-in var(--el-transition-duration)}.dialog-fade-enter-active .el-overlay-dialog{-webkit-animation:dialog-fade-in var(--el-transition-duration);animation:dialog-fade-in var(--el-transition-duration)}.dialog-fade-leave-active{-webkit-animation:modal-fade-out var(--el-transition-duration);animation:modal-fade-out var(--el-transition-duration)}.dialog-fade-leave-active .el-overlay-dialog{-webkit-animation:dialog-fade-out var(--el-transition-duration);animation:dialog-fade-out var(--el-transition-duration)}@-webkit-keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@-webkit-keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@-webkit-keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}@keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}.el-divider{position:relative}.el-divider--horizontal{display:block;height:1px;width:100%;margin:24px 0;border-top:1px var(--el-border-color) var(--el-border-style)}.el-divider--vertical{display:inline-block;width:1px;height:1em;margin:0 8px;vertical-align:middle;position:relative;border-left:1px var(--el-border-color) var(--el-border-style)}.el-divider__text{position:absolute;background-color:var(--el-bg-color);padding:0 20px;font-weight:500;color:var(--el-text-color-primary);font-size:14px}.el-divider__text.is-left{left:20px;transform:translateY(-50%)}.el-divider__text.is-center{left:50%;transform:translate(-50%) translateY(-50%)}.el-divider__text.is-right{right:20px;transform:translateY(-50%)}.el-drawer{--el-drawer-bg-color:var(--el-dialog-bg-color, var(--el-bg-color));--el-drawer-padding-primary:var(--el-dialog-padding-primary, 20px)}.el-drawer{position:absolute;box-sizing:border-box;background-color:var(--el-drawer-bg-color);display:flex;flex-direction:column;box-shadow:var(--el-box-shadow-dark);overflow:hidden;transition:all var(--el-transition-duration)}.el-drawer .rtl,.el-drawer .ltr,.el-drawer .ttb,.el-drawer .btt{transform:translate(0)}.el-drawer__sr-focus:focus{outline:0!important}.el-drawer__header{align-items:center;color:#72767b;display:flex;margin-bottom:32px;padding:var(--el-drawer-padding-primary);padding-bottom:0}.el-drawer__header>:first-child{flex:1}.el-drawer__title{margin:0;flex:1;line-height:inherit;font-size:1rem}.el-drawer__footer{padding:var(--el-drawer-padding-primary);padding-top:10px;text-align:right}.el-drawer__close-btn{display:inline-flex;border:none;cursor:pointer;font-size:var(--el-font-size-extra-large);color:inherit;background-color:transparent;outline:0}.el-drawer__close-btn:focus i,.el-drawer__close-btn:hover i{color:var(--el-color-primary)}.el-drawer__body{flex:1;padding:var(--el-drawer-padding-primary);overflow:auto}.el-drawer__body>*{box-sizing:border-box}.el-drawer.ltr,.el-drawer.rtl{height:100%;top:0;bottom:0}.el-drawer.btt,.el-drawer.ttb{width:100%;left:0;right:0}.el-drawer.ltr{left:0}.el-drawer.rtl{right:0}.el-drawer.ttb{top:0}.el-drawer.btt{bottom:0}.el-drawer-fade-enter-active,.el-drawer-fade-leave-active{transition:all var(--el-transition-duration)}.el-drawer-fade-enter-active,.el-drawer-fade-enter-from,.el-drawer-fade-enter-to,.el-drawer-fade-leave-active,.el-drawer-fade-leave-from,.el-drawer-fade-leave-to{overflow:hidden!important}.el-drawer-fade-enter-from,.el-drawer-fade-leave-to{opacity:0}.el-drawer-fade-enter-to,.el-drawer-fade-leave-from{opacity:1}.el-drawer-fade-enter-from .rtl,.el-drawer-fade-leave-to .rtl{transform:translate(100%)}.el-drawer-fade-enter-from .ltr,.el-drawer-fade-leave-to .ltr{transform:translate(-100%)}.el-drawer-fade-enter-from .ttb,.el-drawer-fade-leave-to .ttb{transform:translateY(-100%)}.el-drawer-fade-enter-from .btt,.el-drawer-fade-leave-to .btt{transform:translateY(100%)}.el-dropdown{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10;display:inline-flex;position:relative;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);line-height:1;vertical-align:top}.el-dropdown.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-dropdown__popper{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10}.el-dropdown__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-dropdown-menu-box-shadow)}.el-dropdown__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-dropdown__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-dropdown__popper .el-dropdown-menu{border:none}.el-dropdown__popper .el-dropdown__popper-selfdefine{outline:0}.el-dropdown__popper .el-scrollbar__bar{z-index:calc(var(--el-dropdown-menu-index) + 1)}.el-dropdown__popper .el-dropdown__list{list-style:none;padding:0;margin:0;box-sizing:border-box}.el-dropdown .el-dropdown__caret-button{padding-left:0;padding-right:0;display:inline-flex;justify-content:center;align-items:center;width:32px;border-left:none}.el-dropdown .el-dropdown__caret-button>span{display:inline-flex}.el-dropdown .el-dropdown__caret-button:before{content:"";position:absolute;display:block;width:1px;top:-1px;bottom:-1px;left:0;background:var(--el-overlay-color-lighter)}.el-dropdown .el-dropdown__caret-button.el-button:before{background:var(--el-border-color);opacity:.5}.el-dropdown .el-dropdown__caret-button .el-dropdown__icon{font-size:inherit;padding-left:0}.el-dropdown .el-dropdown-selfdefine{outline:0}.el-dropdown--large .el-dropdown__caret-button{width:40px}.el-dropdown--small .el-dropdown__caret-button{width:24px}.el-dropdown-menu{position:relative;top:0;left:0;z-index:var(--el-dropdown-menu-index);padding:5px 0;margin:0;background-color:var(--el-bg-color-overlay);border:none;border-radius:var(--el-border-radius-base);box-shadow:none;list-style:none}.el-dropdown-menu__item{display:flex;align-items:center;white-space:nowrap;list-style:none;line-height:22px;padding:5px 16px;margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);cursor:pointer;outline:0}.el-dropdown-menu__item:not(.is-disabled):focus{background-color:var(--el-dropdown-menuItem-hover-fill);color:var(--el-dropdown-menuItem-hover-color)}.el-dropdown-menu__item i{margin-right:5px}.el-dropdown-menu__item--divided{margin:6px 0;border-top:1px solid var(--el-border-color-lighter)}.el-dropdown-menu__item.is-disabled{cursor:not-allowed;color:var(--el-text-color-disabled)}.el-dropdown-menu--large{padding:7px 0}.el-dropdown-menu--large .el-dropdown-menu__item{padding:7px 20px;line-height:22px;font-size:14px}.el-dropdown-menu--large .el-dropdown-menu__item--divided{margin:8px 0}.el-dropdown-menu--small{padding:3px 0}.el-dropdown-menu--small .el-dropdown-menu__item{padding:2px 12px;line-height:20px;font-size:12px}.el-dropdown-menu--small .el-dropdown-menu__item--divided{margin:4px 0}.el-empty{--el-empty-padding:40px 0;--el-empty-image-width:160px;--el-empty-description-margin-top:20px;--el-empty-bottom-margin-top:20px;--el-empty-fill-color-0:var(--el-color-white);--el-empty-fill-color-1:#fcfcfd;--el-empty-fill-color-2:#f8f9fb;--el-empty-fill-color-3:#f7f8fc;--el-empty-fill-color-4:#eeeff3;--el-empty-fill-color-5:#edeef2;--el-empty-fill-color-6:#e9ebef;--el-empty-fill-color-7:#e5e7e9;--el-empty-fill-color-8:#e0e3e9;--el-empty-fill-color-9:#d5d7de;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-empty-padding)}.el-empty__image{width:var(--el-empty-image-width)}.el-empty__image img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;height:100%;vertical-align:top;-o-object-fit:contain;object-fit:contain}.el-empty__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:100%;height:100%;vertical-align:top}.el-empty__description{margin-top:var(--el-empty-description-margin-top)}.el-empty__description p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-secondary)}.el-empty__bottom{margin-top:var(--el-empty-bottom-margin-top)}.el-footer{--el-footer-padding:0 20px;--el-footer-height:60px;padding:var(--el-footer-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-footer-height)}.el-form{--el-form-label-font-size:var(--el-font-size-base)}.el-form--label-left .el-form-item__label{justify-content:flex-start}.el-form--label-top .el-form-item{display:block}.el-form--label-top .el-form-item .el-form-item__label{display:block;height:auto;text-align:left;margin-bottom:8px;line-height:22px}.el-form--inline .el-form-item{display:inline-flex;vertical-align:middle;margin-right:32px}.el-form--inline.el-form--label-top{display:flex;flex-wrap:wrap}.el-form--inline.el-form--label-top .el-form-item{display:block}.el-form--large.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:12px;line-height:22px}.el-form--default.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:8px;line-height:22px}.el-form--small.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:4px;line-height:20px}.el-form-item{display:flex;--font-size:14px;margin-bottom:18px}.el-form-item .el-form-item{margin-bottom:0}.el-form-item .el-input__validateIcon{display:none}.el-form-item--large{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:22px}.el-form-item--large .el-form-item__label{height:40px;line-height:40px}.el-form-item--large .el-form-item__content{line-height:40px}.el-form-item--large .el-form-item__error{padding-top:4px}.el-form-item--default{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--default .el-form-item__label{height:32px;line-height:32px}.el-form-item--default .el-form-item__content{line-height:32px}.el-form-item--default .el-form-item__error{padding-top:2px}.el-form-item--small{--font-size:12px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--small .el-form-item__label{height:24px;line-height:24px}.el-form-item--small .el-form-item__content{line-height:24px}.el-form-item--small .el-form-item__error{padding-top:2px}.el-form-item__label-wrap{display:flex}.el-form-item__label{display:inline-flex;justify-content:flex-end;align-items:flex-start;flex:0 0 auto;font-size:var(--el-form-label-font-size);color:var(--el-text-color-regular);height:32px;line-height:32px;padding:0 12px 0 0;box-sizing:border-box}.el-form-item__content{display:flex;flex-wrap:wrap;align-items:center;flex:1;line-height:32px;position:relative;font-size:var(--font-size);min-width:0}.el-form-item__content .el-input-group{vertical-align:top}.el-form-item__error{color:var(--el-color-danger);font-size:12px;line-height:1;padding-top:2px;position:absolute;top:100%;left:0}.el-form-item__error--inline{position:relative;top:auto;left:auto;display:inline-block;margin-left:10px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label-wrap>.el-form-item__label:before,.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label:before{content:"*";color:var(--el-color-danger);margin-right:4px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label-wrap>.el-form-item__label:after,.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label:after{content:"*";color:var(--el-color-danger);margin-left:4px}.el-form-item.is-error .el-select-v2__wrapper,.el-form-item.is-error .el-select-v2__wrapper:focus,.el-form-item.is-error .el-textarea__inner,.el-form-item.is-error .el-textarea__inner:focus{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input-group__append .el-input__wrapper,.el-form-item.is-error .el-input-group__prepend .el-input__wrapper{box-shadow:0 0 0 1px transparent inset}.el-form-item.is-error .el-input__validateIcon{color:var(--el-color-danger)}.el-form-item--feedback .el-input__validateIcon{display:inline-flex}.el-header{--el-header-padding:0 20px;--el-header-height:60px;padding:var(--el-header-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-header-height)}.el-image-viewer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.el-image-viewer__btn{position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;border-radius:50%;opacity:.8;cursor:pointer;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__btn .el-icon{font-size:inherit;cursor:pointer}.el-image-viewer__close{top:40px;right:40px;width:40px;height:40px;font-size:40px}.el-image-viewer__canvas{position:static;width:100%;height:100%;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__actions{left:50%;bottom:30px;transform:translate(-50%);width:282px;height:44px;padding:0 23px;background-color:var(--el-text-color-regular);border-color:#fff;border-radius:22px}.el-image-viewer__actions__inner{width:100%;height:100%;text-align:justify;cursor:default;font-size:23px;color:#fff;display:flex;align-items:center;justify-content:space-around}.el-image-viewer__prev{top:50%;transform:translateY(-50%);left:40px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__next{top:50%;transform:translateY(-50%);right:40px;text-indent:2px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__close{width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__mask{position:absolute;width:100%;height:100%;top:0;left:0;opacity:.5;background:#000}.viewer-fade-enter-active{-webkit-animation:viewer-fade-in var(--el-transition-duration);animation:viewer-fade-in var(--el-transition-duration)}.viewer-fade-leave-active{-webkit-animation:viewer-fade-out var(--el-transition-duration);animation:viewer-fade-out var(--el-transition-duration)}@-webkit-keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-image__error,.el-image__inner,.el-image__placeholder,.el-image__wrapper{width:100%;height:100%}.el-image{position:relative;display:inline-block;overflow:hidden}.el-image__inner{vertical-align:top;opacity:1}.el-image__inner.is-loading{opacity:0}.el-image__wrapper{position:absolute;top:0;left:0}.el-image__placeholder{background:var(--el-fill-color-light)}.el-image__error{display:flex;justify-content:center;align-items:center;font-size:14px;background:var(--el-fill-color-light);color:var(--el-text-color-placeholder);vertical-align:middle}.el-image__preview{cursor:pointer}.el-input-number{position:relative;display:inline-flex;width:150px;line-height:30px}.el-input-number .el-input__wrapper{padding-left:42px;padding-right:42px}.el-input-number .el-input__inner{-webkit-appearance:none;-moz-appearance:textfield;text-align:center;line-height:1}.el-input-number .el-input__inner::-webkit-inner-spin-button,.el-input-number .el-input__inner::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.el-input-number__decrease,.el-input-number__increase{display:flex;justify-content:center;align-items:center;height:auto;position:absolute;z-index:1;top:1px;bottom:1px;width:32px;background:var(--el-fill-color-light);color:var(--el-text-color-regular);cursor:pointer;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-input-number__decrease:hover,.el-input-number__increase:hover{color:var(--el-color-primary)}.el-input-number__decrease:hover~.el-input:not(.is-disabled) .el-input_wrapper,.el-input-number__increase:hover~.el-input:not(.is-disabled) .el-input_wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-input-number__decrease.is-disabled,.el-input-number__increase.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-input-number__increase{right:1px;border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0;border-left:var(--el-border)}.el-input-number__decrease{left:1px;border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);border-right:var(--el-border)}.el-input-number.is-disabled .el-input-number__decrease,.el-input-number.is-disabled .el-input-number__increase{border-color:var(--el-disabled-border-color);color:var(--el-disabled-border-color)}.el-input-number.is-disabled .el-input-number__decrease:hover,.el-input-number.is-disabled .el-input-number__increase:hover{color:var(--el-disabled-border-color);cursor:not-allowed}.el-input-number--large{width:180px;line-height:38px}.el-input-number--large .el-input-number__decrease,.el-input-number--large .el-input-number__increase{width:40px;font-size:14px}.el-input-number--large .el-input__wrapper{padding-left:47px;padding-right:47px}.el-input-number--small{width:120px;line-height:22px}.el-input-number--small .el-input-number__decrease,.el-input-number--small .el-input-number__increase{width:24px;font-size:12px}.el-input-number--small .el-input__wrapper{padding-left:31px;padding-right:31px}.el-input-number--small .el-input-number__decrease [class*=el-icon],.el-input-number--small .el-input-number__increase [class*=el-icon]{transform:scale(.9)}.el-input-number.is-without-controls .el-input__wrapper{padding-left:15px;padding-right:15px}.el-input-number.is-controls-right .el-input__wrapper{padding-left:15px;padding-right:42px}.el-input-number.is-controls-right .el-input-number__decrease,.el-input-number.is-controls-right .el-input-number__increase{--el-input-number-controls-height:15px;height:var(--el-input-number-controls-height);line-height:var(--el-input-number-controls-height)}.el-input-number.is-controls-right .el-input-number__decrease [class*=el-icon],.el-input-number.is-controls-right .el-input-number__increase [class*=el-icon]{transform:scale(.8)}.el-input-number.is-controls-right .el-input-number__increase{bottom:auto;left:auto;border-radius:0 var(--el-border-radius-base) 0 0;border-bottom:var(--el-border)}.el-input-number.is-controls-right .el-input-number__decrease{right:1px;top:auto;left:auto;border-right:none;border-left:var(--el-border);border-radius:0 0 var(--el-border-radius-base) 0}.el-input-number.is-controls-right[class*=large] [class*=decrease],.el-input-number.is-controls-right[class*=large] [class*=increase]{--el-input-number-controls-height:19px}.el-input-number.is-controls-right[class*=small] [class*=decrease],.el-input-number.is-controls-right[class*=small] [class*=increase]{--el-input-number-controls-height:11px}.el-textarea{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-textarea{position:relative;display:inline-block;width:100%;vertical-align:bottom;font-size:var(--el-font-size-base)}.el-textarea__inner{position:relative;display:block;resize:vertical;padding:5px 11px;line-height:1.5;box-sizing:border-box;width:100%;font-size:inherit;font-family:inherit;color:var(--el-input-text-color,var(--el-text-color-regular));background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;-webkit-appearance:none;box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);border:none}.el-textarea__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-textarea__inner:focus{outline:0;box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-textarea .el-input__count{color:var(--el-color-info);background:var(--el-fill-color-blank);position:absolute;font-size:12px;line-height:14px;bottom:5px;right:10px}.el-textarea.is-disabled .el-textarea__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-textarea.is-disabled .el-textarea__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner::placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-exceed .el-textarea__inner{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-textarea.is-exceed .el-input__count{color:var(--el-color-danger)}.el-input{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-input{--el-input-height:var(--el-component-size);position:relative;font-size:var(--el-font-size-base);display:inline-flex;width:100%;line-height:var(--el-input-height);box-sizing:border-box;vertical-align:middle}.el-input::-webkit-scrollbar{z-index:11;width:6px}.el-input::-webkit-scrollbar:horizontal{height:6px}.el-input::-webkit-scrollbar-thumb{border-radius:5px;width:6px;background:var(--el-text-color-disabled)}.el-input::-webkit-scrollbar-corner{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track-piece{background:var(--el-fill-color-blank);width:6px}.el-input .el-input__clear,.el-input .el-input__password{color:var(--el-input-icon-color);font-size:14px;cursor:pointer}.el-input .el-input__clear:hover,.el-input .el-input__password:hover{color:var(--el-input-clear-hover-color)}.el-input .el-input__count{height:100%;display:inline-flex;align-items:center;color:var(--el-color-info);font-size:12px}.el-input .el-input__count .el-input__count-inner{background:var(--el-fill-color-blank);line-height:initial;display:inline-block;padding-left:8px}.el-input__wrapper{display:inline-flex;flex-grow:1;align-items:center;justify-content:center;padding:1px 11px;background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);transform:translateZ(0);box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 32px) - 2px);width:100%;flex-grow:1;-webkit-appearance:none;color:var(--el-input-text-color,var(--el-text-color-regular));font-size:inherit;height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);padding:0;outline:0;border:none;background:0 0;box-sizing:border-box}.el-input__inner:focus{outline:0}.el-input__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner[type=password]::-ms-reveal{display:none}.el-input__prefix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__prefix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__prefix-inner>:last-child{margin-right:8px}.el-input__prefix-inner>:first-child,.el-input__prefix-inner>:first-child.el-input__icon{margin-left:0}.el-input__suffix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__suffix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__suffix-inner>:first-child{margin-left:8px}.el-input .el-input__icon{height:inherit;line-height:inherit;display:flex;justify-content:center;align-items:center;transition:all var(--el-transition-duration);margin-left:8px}.el-input__validateIcon{pointer-events:none}.el-input.is-active .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-color,) inset}.el-input.is-disabled{cursor:not-allowed}.el-input.is-disabled .el-input__wrapper{background-color:var(--el-disabled-bg-color);box-shadow:0 0 0 1px var(--el-disabled-border-color) inset}.el-input.is-disabled .el-input__inner{color:var(--el-disabled-text-color);-webkit-text-fill-color:var(--el-disabled-text-color);cursor:not-allowed}.el-input.is-disabled .el-input__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner::placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__icon{cursor:not-allowed}.el-input.is-exceed .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-input.is-exceed .el-input__suffix .el-input__count{color:var(--el-color-danger)}.el-input--large{--el-input-height:var(--el-component-size-large);font-size:14px}.el-input--large .el-input__wrapper{padding:1px 15px}.el-input--large .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 40px) - 2px)}.el-input--small{--el-input-height:var(--el-component-size-small);font-size:12px}.el-input--small .el-input__wrapper{padding:1px 7px}.el-input--small .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 24px) - 2px)}.el-input-group{display:inline-flex;width:100%;align-items:stretch}.el-input-group__append,.el-input-group__prepend{background-color:var(--el-fill-color-light);color:var(--el-color-info);position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:100%;border-radius:var(--el-input-border-radius);padding:0 20px;white-space:nowrap}.el-input-group__append:focus,.el-input-group__prepend:focus{outline:0}.el-input-group__append .el-button,.el-input-group__append .el-select,.el-input-group__prepend .el-button,.el-input-group__prepend .el-select{display:inline-block;margin:0 -20px}.el-input-group__append button.el-button,.el-input-group__append button.el-button:hover,.el-input-group__append div.el-select .el-input__wrapper,.el-input-group__append div.el-select:hover .el-input__wrapper,.el-input-group__prepend button.el-button,.el-input-group__prepend button.el-button:hover,.el-input-group__prepend div.el-select .el-input__wrapper,.el-input-group__prepend div.el-select:hover .el-input__wrapper{border-color:transparent;background-color:transparent;color:inherit}.el-input-group__append .el-button,.el-input-group__append .el-input,.el-input-group__prepend .el-button,.el-input-group__prepend .el-input{font-size:inherit}.el-input-group__prepend{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group__append{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--prepend>.el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper{box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important;z-index:2}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper:focus{outline:0;z-index:2;box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__wrapper{z-index:1;box-shadow:1px 0 0 0 var(--el-input-hover-border-color) inset,1px 0 0 0 var(--el-input-hover-border-color),0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-input-group--append>.el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__wrapper{z-index:2;box-shadow:-1px 0 0 0 var(--el-input-focus-border-color),-1px 0 0 0 var(--el-input-focus-border-color) inset,0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__wrapper{z-index:1;box-shadow:-1px 0 0 0 var(--el-input-hover-border-color),-1px 0 0 0 var(--el-input-hover-border-color) inset,0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-link{--el-link-font-size:var(--el-font-size-base);--el-link-font-weight:var(--el-font-weight-primary);--el-link-text-color:var(--el-text-color-regular);--el-link-hover-text-color:var(--el-color-primary);--el-link-disabled-text-color:var(--el-text-color-placeholder)}.el-link{display:inline-flex;flex-direction:row;align-items:center;justify-content:center;vertical-align:middle;position:relative;text-decoration:none;outline:0;cursor:pointer;padding:0;font-size:var(--el-link-font-size);font-weight:var(--el-link-font-weight);color:var(--el-link-text-color)}.el-link:hover{color:var(--el-link-hover-text-color)}.el-link.is-underline:hover:after{content:"";position:absolute;left:0;right:0;height:0;bottom:0;border-bottom:1px solid var(--el-link-hover-text-color)}.el-link.is-disabled{color:var(--el-link-disabled-text-color);cursor:not-allowed}.el-link [class*=el-icon-]+span{margin-left:5px}.el-link.el-link--default:after{border-color:var(--el-link-hover-text-color)}.el-link__inner{display:inline-flex;justify-content:center;align-items:center}.el-link.el-link--primary{--el-link-text-color:var(--el-color-primary);--el-link-hover-text-color:var(--el-color-primary-light-3);--el-link-disabled-text-color:var(--el-color-primary-light-5)}.el-link.el-link--primary:after{border-color:var(--el-link-text-color)}.el-link.el-link--primary.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--success{--el-link-text-color:var(--el-color-success);--el-link-hover-text-color:var(--el-color-success-light-3);--el-link-disabled-text-color:var(--el-color-success-light-5)}.el-link.el-link--success:after{border-color:var(--el-link-text-color)}.el-link.el-link--success.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning{--el-link-text-color:var(--el-color-warning);--el-link-hover-text-color:var(--el-color-warning-light-3);--el-link-disabled-text-color:var(--el-color-warning-light-5)}.el-link.el-link--warning:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger{--el-link-text-color:var(--el-color-danger);--el-link-hover-text-color:var(--el-color-danger-light-3);--el-link-disabled-text-color:var(--el-color-danger-light-5)}.el-link.el-link--danger:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--error{--el-link-text-color:var(--el-color-error);--el-link-hover-text-color:var(--el-color-error-light-3);--el-link-disabled-text-color:var(--el-color-error-light-5)}.el-link.el-link--error:after{border-color:var(--el-link-text-color)}.el-link.el-link--error.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--info{--el-link-text-color:var(--el-color-info);--el-link-hover-text-color:var(--el-color-info-light-3);--el-link-disabled-text-color:var(--el-color-info-light-5)}.el-link.el-link--info:after{border-color:var(--el-link-text-color)}.el-link.el-link--info.is-underline:hover:after{border-color:var(--el-link-text-color)}:root{--el-loading-spinner-size:42px;--el-loading-fullscreen-spinner-size:50px}.el-loading-parent--relative{position:relative!important}.el-loading-parent--hidden{overflow:hidden!important}.el-loading-mask{position:absolute;z-index:2000;background-color:var(--el-mask-color);margin:0;top:0;right:0;bottom:0;left:0;transition:opacity var(--el-transition-duration)}.el-loading-mask.is-fullscreen{position:fixed}.el-loading-mask.is-fullscreen .el-loading-spinner{margin-top:calc((0px - var(--el-loading-fullscreen-spinner-size))/ 2)}.el-loading-mask.is-fullscreen .el-loading-spinner .circular{height:var(--el-loading-fullscreen-spinner-size);width:var(--el-loading-fullscreen-spinner-size)}.el-loading-spinner{top:50%;margin-top:calc((0px - var(--el-loading-spinner-size))/ 2);width:100%;text-align:center;position:absolute}.el-loading-spinner .el-loading-text{color:var(--el-color-primary);margin:3px 0;font-size:14px}.el-loading-spinner .circular{display:inline;height:var(--el-loading-spinner-size);width:var(--el-loading-spinner-size);-webkit-animation:loading-rotate 2s linear infinite;animation:loading-rotate 2s linear infinite}.el-loading-spinner .path{-webkit-animation:loading-dash 1.5s ease-in-out infinite;animation:loading-dash 1.5s ease-in-out infinite;stroke-dasharray:90,150;stroke-dashoffset:0;stroke-width:2;stroke:var(--el-color-primary);stroke-linecap:round}.el-loading-spinner i{color:var(--el-color-primary)}.el-loading-fade-enter-from,.el-loading-fade-leave-to{opacity:0}@-webkit-keyframes loading-rotate{to{transform:rotate(360deg)}}@keyframes loading-rotate{to{transform:rotate(360deg)}}@-webkit-keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}.el-main{--el-main-padding:20px;display:block;flex:1;flex-basis:auto;overflow:auto;box-sizing:border-box;padding:var(--el-main-padding)}:root{--el-menu-active-color:var(--el-color-primary);--el-menu-text-color:var(--el-text-color-primary);--el-menu-hover-text-color:var(--el-color-primary);--el-menu-bg-color:var(--el-fill-color-blank);--el-menu-hover-bg-color:var(--el-color-primary-light-9);--el-menu-item-height:56px;--el-menu-sub-item-height:calc(var(--el-menu-item-height) - 6px);--el-menu-horizontal-sub-item-height:36px;--el-menu-item-font-size:var(--el-font-size-base);--el-menu-item-hover-fill:var(--el-color-primary-light-9);--el-menu-border-color:var(--el-border-color);--el-menu-base-level-padding:20px;--el-menu-level-padding:20px;--el-menu-icon-width:24px}.el-menu{border-right:solid 1px var(--el-menu-border-color);list-style:none;position:relative;margin:0;padding-left:0;background-color:var(--el-menu-bg-color);box-sizing:border-box}.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item-group__title,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-sub-menu__title{white-space:nowrap;padding-left:calc(var(--el-menu-base-level-padding) + var(--el-menu-level) * var(--el-menu-level-padding))}.el-menu--horizontal{display:flex;flex-wrap:nowrap;border-bottom:solid 1px var(--el-menu-border-color);border-right:none}.el-menu--horizontal>.el-menu-item{display:inline-flex;justify-content:center;align-items:center;height:100%;margin:0;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-menu-item a,.el-menu--horizontal>.el-menu-item a:hover{color:inherit}.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover{background-color:#fff}.el-menu--horizontal>.el-sub-menu:focus,.el-menu--horizontal>.el-sub-menu:hover{outline:0}.el-menu--horizontal>.el-sub-menu:hover .el-sub-menu__title{color:var(--el-menu-hover-text-color)}.el-menu--horizontal>.el-sub-menu.is-active .el-sub-menu__title{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title{height:100%;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title:hover{background-color:var(--el-bg-color-overlay)}.el-menu--horizontal .el-menu .el-menu-item,.el-menu--horizontal .el-menu .el-sub-menu__title{background-color:var(--el-menu-bg-color);display:flex;align-items:center;height:var(--el-menu-horizontal-sub-item-height);line-height:var(--el-menu-horizontal-sub-item-height);padding:0 10px;color:var(--el-menu-text-color)}.el-menu--horizontal .el-menu .el-sub-menu__title{padding-right:40px}.el-menu--horizontal .el-menu .el-menu-item.is-active,.el-menu--horizontal .el-menu .el-sub-menu.is-active>.el-sub-menu__title{color:var(--el-menu-active-color)}.el-menu--horizontal .el-menu-item:not(.is-disabled):focus,.el-menu--horizontal .el-menu-item:not(.is-disabled):hover{outline:0;color:var(--el-menu-hover-text-color);background-color:var(--el-menu-hover-bg-color)}.el-menu--horizontal>.el-menu-item.is-active{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)!important}.el-menu--collapse{width:calc(var(--el-menu-icon-width) + var(--el-menu-base-level-padding) * 2)}.el-menu--collapse>.el-menu-item [class^=el-icon],.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title [class^=el-icon],.el-menu--collapse>.el-sub-menu>.el-sub-menu__title [class^=el-icon]{margin:0;vertical-align:middle;width:var(--el-menu-icon-width);text-align:center}.el-menu--collapse>.el-menu-item .el-sub-menu__icon-arrow,.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow{display:none}.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title>span,.el-menu--collapse>.el-menu-item>span,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title>span{height:0;width:0;overflow:hidden;visibility:hidden;display:inline-block}.el-menu--collapse>.el-menu-item.is-active i{color:inherit}.el-menu--collapse .el-menu .el-sub-menu{min-width:200px}.el-menu--popup{z-index:100;min-width:200px;border:none;padding:5px 0;border-radius:var(--el-border-radius-small);box-shadow:var(--el-box-shadow-light)}.el-menu .el-icon{flex-shrink:0}.el-menu-item{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap}.el-menu-item *{vertical-align:bottom}.el-menu-item i{color:inherit}.el-menu-item:focus,.el-menu-item:hover{outline:0}.el-menu-item:hover{background-color:var(--el-menu-hover-bg-color)}.el-menu-item.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-menu-item [class^=el-icon]{margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px;vertical-align:middle}.el-menu-item.is-active{color:var(--el-menu-active-color)}.el-menu-item.is-active i{color:inherit}.el-menu-item .el-menu-tooltip__trigger{position:absolute;left:0;top:0;height:100%;width:100%;display:inline-flex;align-items:center;box-sizing:border-box;padding:0 var(--el-menu-base-level-padding)}.el-sub-menu{list-style:none;margin:0;padding-left:0}.el-sub-menu__title{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap;padding-right:calc(var(--el-menu-base-level-padding) + var(--el-menu-icon-width))}.el-sub-menu__title *{vertical-align:bottom}.el-sub-menu__title i{color:inherit}.el-sub-menu__title:focus,.el-sub-menu__title:hover{outline:0}.el-sub-menu__title.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu__title:hover{background-color:var(--el-menu-hover-bg-color)}.el-sub-menu .el-menu{border:none}.el-sub-menu .el-menu-item{height:var(--el-menu-sub-item-height);line-height:var(--el-menu-sub-item-height)}.el-sub-menu__hide-arrow .el-sub-menu__icon-arrow{display:none!important}.el-sub-menu.is-active .el-sub-menu__title{border-bottom-color:var(--el-menu-active-color)}.el-sub-menu.is-disabled .el-menu-item,.el-sub-menu.is-disabled .el-sub-menu__title{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu .el-icon{vertical-align:middle;margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px}.el-sub-menu .el-icon.el-sub-menu__icon-more{margin-right:0!important}.el-sub-menu .el-sub-menu__icon-arrow{position:absolute;top:50%;right:var(--el-menu-base-level-padding);margin-top:-6px;transition:transform var(--el-transition-duration);font-size:12px;margin-right:0;width:inherit}.el-menu-item-group>ul{padding:0}.el-menu-item-group__title{padding:7px 0 7px var(--el-menu-base-level-padding);line-height:normal;font-size:12px;color:var(--el-text-color-secondary)}.horizontal-collapse-transition .el-sub-menu__title .el-sub-menu__icon-arrow{transition:var(--el-transition-duration-fast);opacity:0}.el-message-box{--el-messagebox-title-color:var(--el-text-color-primary);--el-messagebox-width:420px;--el-messagebox-border-radius:4px;--el-messagebox-font-size:var(--el-font-size-large);--el-messagebox-content-font-size:var(--el-font-size-base);--el-messagebox-content-color:var(--el-text-color-regular);--el-messagebox-error-font-size:12px;--el-messagebox-padding-primary:15px}.el-message-box{display:inline-block;max-width:var(--el-messagebox-width);width:100%;padding-bottom:10px;vertical-align:middle;background-color:var(--el-bg-color);border-radius:var(--el-messagebox-border-radius);border:1px solid var(--el-border-color-lighter);font-size:var(--el-messagebox-font-size);box-shadow:var(--el-box-shadow-light);text-align:left;overflow:hidden;-webkit-backface-visibility:hidden;backface-visibility:hidden;box-sizing:border-box}.el-message-box:focus{outline:0!important}.el-overlay.is-message-box .el-overlay-message-box{text-align:center;position:fixed;top:0;right:0;bottom:0;left:0;padding:16px;overflow:auto}.el-overlay.is-message-box .el-overlay-message-box:after{content:"";display:inline-block;height:100%;width:0;vertical-align:middle}.el-message-box.is-draggable .el-message-box__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-message-box__header{position:relative;padding:var(--el-messagebox-padding-primary);padding-bottom:10px}.el-message-box__title{padding-left:0;margin-bottom:0;font-size:var(--el-messagebox-font-size);line-height:1;color:var(--el-messagebox-title-color)}.el-message-box__headerbtn{position:absolute;top:var(--el-messagebox-padding-primary);right:var(--el-messagebox-padding-primary);padding:0;border:none;outline:0;background:0 0;font-size:var(--el-message-close-size,16px);cursor:pointer}.el-message-box__headerbtn .el-message-box__close{color:var(--el-color-info);font-size:inherit}.el-message-box__headerbtn:focus .el-message-box__close,.el-message-box__headerbtn:hover .el-message-box__close{color:var(--el-color-primary)}.el-message-box__content{padding:10px var(--el-messagebox-padding-primary);color:var(--el-messagebox-content-color);font-size:var(--el-messagebox-content-font-size)}.el-message-box__container{position:relative}.el-message-box__input{padding-top:15px}.el-message-box__input div.invalid>input{border-color:var(--el-color-error)}.el-message-box__input div.invalid>input:focus{border-color:var(--el-color-error)}.el-message-box__status{position:absolute;top:50%;transform:translateY(-50%);font-size:24px!important}.el-message-box__status:before{padding-left:1px}.el-message-box__status.el-icon{position:absolute}.el-message-box__status+.el-message-box__message{padding-left:36px;padding-right:12px;word-break:break-word}.el-message-box__status.el-message-box-icon--success{--el-messagebox-color:var(--el-color-success);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--info{--el-messagebox-color:var(--el-color-info);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--warning{--el-messagebox-color:var(--el-color-warning);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--error{--el-messagebox-color:var(--el-color-error);color:var(--el-messagebox-color)}.el-message-box__message{margin:0}.el-message-box__message p{margin:0;line-height:24px}.el-message-box__errormsg{color:var(--el-color-error);font-size:var(--el-messagebox-error-font-size);min-height:18px;margin-top:2px}.el-message-box__btns{padding:5px 15px 0;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center}.el-message-box__btns button:nth-child(2){margin-left:10px}.el-message-box__btns-reverse{flex-direction:row-reverse}.el-message-box--center .el-message-box__title{position:relative;display:flex;align-items:center;justify-content:center}.el-message-box--center .el-message-box__status{position:relative;top:auto;padding-right:5px;text-align:center;transform:translateY(-1px)}.el-message-box--center .el-message-box__message{margin-left:0}.el-message-box--center .el-message-box__btns{justify-content:center}.el-message-box--center .el-message-box__content{padding-left:calc(var(--el-messagebox-padding-primary) + 12px);padding-right:calc(var(--el-messagebox-padding-primary) + 12px);text-align:center}.fade-in-linear-enter-active .el-overlay-message-box{-webkit-animation:msgbox-fade-in var(--el-transition-duration);animation:msgbox-fade-in var(--el-transition-duration)}.fade-in-linear-leave-active .el-overlay-message-box{animation:msgbox-fade-in var(--el-transition-duration) reverse}@-webkit-keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-message{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-border-color-lighter);--el-message-padding:15px 19px;--el-message-close-size:16px;--el-message-close-icon-color:var(--el-text-color-placeholder);--el-message-close-hover-color:var(--el-text-color-secondary)}.el-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;max-width:calc(100% - 32px);box-sizing:border-box;border-radius:var(--el-border-radius-base);border-width:var(--el-border-width);border-style:var(--el-border-style);border-color:var(--el-message-border-color);position:fixed;left:50%;top:20px;transform:translate(-50%);background-color:var(--el-message-bg-color);transition:opacity var(--el-transition-duration),transform .4s,top .4s;padding:var(--el-message-padding);display:flex;align-items:center}.el-message.is-center{justify-content:center}.el-message.is-closable .el-message__content{padding-right:31px}.el-message p{margin:0}.el-message--success{--el-message-bg-color:var(--el-color-success-light-9);--el-message-border-color:var(--el-color-success-light-8);--el-message-text-color:var(--el-color-success)}.el-message--success .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--success{color:var(--el-message-text-color)}.el-message--info{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-color-info-light-8);--el-message-text-color:var(--el-color-info)}.el-message--info .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--info{color:var(--el-message-text-color)}.el-message--warning{--el-message-bg-color:var(--el-color-warning-light-9);--el-message-border-color:var(--el-color-warning-light-8);--el-message-text-color:var(--el-color-warning)}.el-message--warning .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--warning{color:var(--el-message-text-color)}.el-message--error{--el-message-bg-color:var(--el-color-error-light-9);--el-message-border-color:var(--el-color-error-light-8);--el-message-text-color:var(--el-color-error)}.el-message--error .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--error{color:var(--el-message-text-color)}.el-message__icon{margin-right:10px}.el-message .el-message__badge{position:absolute;top:-8px;right:-8px}.el-message__content{padding:0;font-size:14px;line-height:1}.el-message__content:focus{outline-width:0}.el-message .el-message__closeBtn{position:absolute;top:50%;right:19px;transform:translateY(-50%);cursor:pointer;color:var(--el-message-close-icon-color);font-size:var(--el-message-close-size)}.el-message .el-message__closeBtn:focus{outline-width:0}.el-message .el-message__closeBtn:hover{color:var(--el-message-close-hover-color)}.el-message-fade-enter-from,.el-message-fade-leave-to{opacity:0;transform:translate(-50%,-100%)}.el-notification{--el-notification-width:330px;--el-notification-padding:14px 26px 14px 13px;--el-notification-radius:8px;--el-notification-shadow:var(--el-box-shadow-light);--el-notification-border-color:var(--el-border-color-lighter);--el-notification-icon-size:24px;--el-notification-close-font-size:var(--el-message-close-size, 16px);--el-notification-group-margin-left:13px;--el-notification-group-margin-right:8px;--el-notification-content-font-size:var(--el-font-size-base);--el-notification-content-color:var(--el-text-color-regular);--el-notification-title-font-size:16px;--el-notification-title-color:var(--el-text-color-primary);--el-notification-close-color:var(--el-text-color-secondary);--el-notification-close-hover-color:var(--el-text-color-regular)}.el-notification{display:flex;width:var(--el-notification-width);padding:var(--el-notification-padding);border-radius:var(--el-notification-radius);box-sizing:border-box;border:1px solid var(--el-notification-border-color);position:fixed;background-color:var(--el-bg-color-overlay);box-shadow:var(--el-notification-shadow);transition:opacity var(--el-transition-duration),transform var(--el-transition-duration),left var(--el-transition-duration),right var(--el-transition-duration),top .4s,bottom var(--el-transition-duration);overflow-wrap:anywhere;overflow:hidden;z-index:9999}.el-notification.right{right:16px}.el-notification.left{left:16px}.el-notification__group{margin-left:var(--el-notification-group-margin-left);margin-right:var(--el-notification-group-margin-right)}.el-notification__title{font-weight:700;font-size:var(--el-notification-title-font-size);line-height:var(--el-notification-icon-size);color:var(--el-notification-title-color);margin:0}.el-notification__content{font-size:var(--el-notification-content-font-size);line-height:24px;margin:6px 0 0;color:var(--el-notification-content-color);text-align:justify}.el-notification__content p{margin:0}.el-notification .el-notification__icon{height:var(--el-notification-icon-size);width:var(--el-notification-icon-size);font-size:var(--el-notification-icon-size)}.el-notification .el-notification__closeBtn{position:absolute;top:18px;right:15px;cursor:pointer;color:var(--el-notification-close-color);font-size:var(--el-notification-close-font-size)}.el-notification .el-notification__closeBtn:hover{color:var(--el-notification-close-hover-color)}.el-notification .el-notification--success{--el-notification-icon-color:var(--el-color-success);color:var(--el-notification-icon-color)}.el-notification .el-notification--info{--el-notification-icon-color:var(--el-color-info);color:var(--el-notification-icon-color)}.el-notification .el-notification--warning{--el-notification-icon-color:var(--el-color-warning);color:var(--el-notification-icon-color)}.el-notification .el-notification--error{--el-notification-icon-color:var(--el-color-error);color:var(--el-notification-icon-color)}.el-notification-fade-enter-from.right{right:0;transform:translate(100%)}.el-notification-fade-enter-from.left{left:0;transform:translate(-100%)}.el-notification-fade-leave-to{opacity:0}.el-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;height:100%;background-color:var(--el-overlay-color-lighter);overflow:auto}.el-overlay .el-overlay-root{height:0}.el-page-header.is-contentful .el-page-header__main{border-top:1px solid var(--el-border-color-light);margin-top:16px}.el-page-header__header{display:flex;align-items:center;justify-content:space-between;line-height:24px}.el-page-header__left{display:flex;align-items:center;margin-right:40px;position:relative}.el-page-header__back{display:flex;align-items:center;cursor:pointer}.el-page-header__left .el-divider--vertical{margin:0 16px}.el-page-header__icon{font-size:16px;margin-right:10px;display:flex;align-items:center}.el-page-header__icon .el-icon{font-size:inherit}.el-page-header__title{font-size:14px;font-weight:500}.el-page-header__content{font-size:18px;color:var(--el-text-color-primary)}.el-page-header__breadcrumb{margin-bottom:16px}.el-pagination{--el-pagination-font-size:14px;--el-pagination-bg-color:var(--el-fill-color-blank);--el-pagination-text-color:var(--el-text-color-primary);--el-pagination-border-radius:2px;--el-pagination-button-color:var(--el-text-color-primary);--el-pagination-button-width:32px;--el-pagination-button-height:32px;--el-pagination-button-disabled-color:var(--el-text-color-placeholder);--el-pagination-button-disabled-bg-color:var(--el-fill-color-blank);--el-pagination-button-bg-color:var(--el-fill-color);--el-pagination-hover-color:var(--el-color-primary);--el-pagination-font-size-small:12px;--el-pagination-button-width-small:24px;--el-pagination-button-height-small:24px;--el-pagination-item-gap:16px;white-space:nowrap;color:var(--el-pagination-text-color);font-size:var(--el-pagination-font-size);font-weight:400;display:flex;align-items:center}.el-pagination .el-input__inner{text-align:center;-moz-appearance:textfield}.el-pagination .el-select .el-input{width:128px}.el-pagination button{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pagination button *{pointer-events:none}.el-pagination button:focus{outline:0}.el-pagination button:hover{color:var(--el-pagination-hover-color)}.el-pagination button.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pagination button.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pagination button.is-disabled,.el-pagination button:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pagination button:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-pagination .btn-next .el-icon,.el-pagination .btn-prev .el-icon{display:block;font-size:12px;font-weight:700;width:inherit}.el-pagination>.is-first{margin-left:0!important}.el-pagination>.is-last{margin-right:0!important}.el-pagination .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination__sizes,.el-pagination__total{margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__total[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__jump{display:flex;align-items:center;margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__jump[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__goto{margin-right:8px}.el-pagination__editor{text-align:center;box-sizing:border-box}.el-pagination__editor.el-input{width:56px}.el-pagination__editor .el-input__inner::-webkit-inner-spin-button,.el-pagination__editor .el-input__inner::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.el-pagination__classifier{margin-left:8px}.el-pagination__rightwrapper{flex:1;display:flex;align-items:center;justify-content:flex-end}.el-pagination.is-background .btn-next,.el-pagination.is-background .btn-prev,.el-pagination.is-background .el-pager li{margin:0 4px;background-color:var(--el-pagination-button-bg-color)}.el-pagination.is-background .btn-next.is-active,.el-pagination.is-background .btn-prev.is-active,.el-pagination.is-background .el-pager li.is-active{background-color:var(--el-color-primary);color:var(--el-color-white)}.el-pagination.is-background .btn-next.is-disabled,.el-pagination.is-background .btn-next:disabled,.el-pagination.is-background .btn-prev.is-disabled,.el-pagination.is-background .btn-prev:disabled,.el-pagination.is-background .el-pager li.is-disabled,.el-pagination.is-background .el-pager li:disabled{color:var(--el-text-color-placeholder);background-color:var(--el-disabled-bg-color)}.el-pagination.is-background .btn-next.is-disabled.is-active,.el-pagination.is-background .btn-next:disabled.is-active,.el-pagination.is-background .btn-prev.is-disabled.is-active,.el-pagination.is-background .btn-prev:disabled.is-active,.el-pagination.is-background .el-pager li.is-disabled.is-active,.el-pagination.is-background .el-pager li:disabled.is-active{color:var(--el-text-color-secondary);background-color:var(--el-fill-color-dark)}.el-pagination.is-background .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination--small .btn-next,.el-pagination--small .btn-prev,.el-pagination--small .el-pager li{height:var(--el-pagination-button-height-small);line-height:var(--el-pagination-button-height-small);font-size:var(--el-pagination-font-size-small);min-width:var(--el-pagination-button-width-small)}.el-pagination--small button,.el-pagination--small span:not([class*=suffix]){font-size:var(--el-pagination-font-size-small)}.el-pagination--small .el-select .el-input{width:100px}.el-pager{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;font-size:0;padding:0;margin:0;display:flex;align-items:center}.el-pager li{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pager li *{pointer-events:none}.el-pager li:focus{outline:0}.el-pager li:hover{color:var(--el-pagination-hover-color)}.el-pager li.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pager li.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pager li.is-disabled,.el-pager li:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pager li:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-popconfirm__main{display:flex;align-items:center}.el-popconfirm__icon{margin-right:5px}.el-popconfirm__action{text-align:right;margin-top:8px}.el-popover{--el-popover-bg-color:var(--el-bg-color-overlay);--el-popover-font-size:var(--el-font-size-base);--el-popover-border-color:var(--el-border-color-lighter);--el-popover-padding:12px;--el-popover-padding-large:18px 20px;--el-popover-title-font-size:16px;--el-popover-title-text-color:var(--el-text-color-primary);--el-popover-border-radius:4px}.el-popover.el-popper{background:var(--el-popover-bg-color);min-width:150px;border-radius:var(--el-popover-border-radius);border:1px solid var(--el-popover-border-color);padding:var(--el-popover-padding);z-index:var(--el-index-popper);color:var(--el-text-color-regular);line-height:1.4;text-align:justify;font-size:var(--el-popover-font-size);box-shadow:var(--el-box-shadow-light);word-break:break-all;box-sizing:border-box}.el-popover.el-popper--plain{padding:var(--el-popover-padding-large)}.el-popover__title{color:var(--el-popover-title-text-color);font-size:var(--el-popover-title-font-size);line-height:1;margin-bottom:12px}.el-popover__reference:focus:hover,.el-popover__reference:focus:not(.focusing){outline-width:0}.el-popover.el-popper.is-dark{--el-popover-bg-color:var(--el-text-color-primary);--el-popover-border-color:var(--el-text-color-primary);--el-popover-title-text-color:var(--el-bg-color);color:var(--el-bg-color)}.el-popover.el-popper:focus,.el-popover.el-popper:focus:active{outline-width:0}.el-progress{position:relative;line-height:1;display:flex;align-items:center}.el-progress__text{font-size:14px;color:var(--el-text-color-regular);margin-left:5px;min-width:50px;line-height:1}.el-progress__text i{vertical-align:middle;display:block}.el-progress--circle,.el-progress--dashboard{display:inline-block}.el-progress--circle .el-progress__text,.el-progress--dashboard .el-progress__text{position:absolute;top:50%;left:0;width:100%;text-align:center;margin:0;transform:translateY(-50%)}.el-progress--circle .el-progress__text i,.el-progress--dashboard .el-progress__text i{vertical-align:middle;display:inline-block}.el-progress--without-text .el-progress__text{display:none}.el-progress--without-text .el-progress-bar{padding-right:0;margin-right:0;display:block}.el-progress--text-inside .el-progress-bar{padding-right:0;margin-right:0}.el-progress.is-success .el-progress-bar__inner{background-color:var(--el-color-success)}.el-progress.is-success .el-progress__text{color:var(--el-color-success)}.el-progress.is-warning .el-progress-bar__inner{background-color:var(--el-color-warning)}.el-progress.is-warning .el-progress__text{color:var(--el-color-warning)}.el-progress.is-exception .el-progress-bar__inner{background-color:var(--el-color-danger)}.el-progress.is-exception .el-progress__text{color:var(--el-color-danger)}.el-progress-bar{flex-grow:1;box-sizing:border-box}.el-progress-bar__outer{height:6px;border-radius:100px;background-color:var(--el-border-color-lighter);overflow:hidden;position:relative;vertical-align:middle}.el-progress-bar__inner{position:absolute;left:0;top:0;height:100%;background-color:var(--el-color-primary);text-align:right;border-radius:100px;line-height:1;white-space:nowrap;transition:width .6s ease}.el-progress-bar__inner:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-progress-bar__inner--indeterminate{transform:translateZ(0);-webkit-animation:indeterminate 3s infinite;animation:indeterminate 3s infinite}.el-progress-bar__inner--striped{background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.1) 50%,rgba(0,0,0,.1) 75%,transparent 75%,transparent);background-size:1.25em 1.25em}.el-progress-bar__inner--striped.el-progress-bar__inner--striped-flow{-webkit-animation:striped-flow 3s linear infinite;animation:striped-flow 3s linear infinite}.el-progress-bar__innerText{display:inline-block;vertical-align:middle;color:#fff;font-size:12px;margin:0 5px}@-webkit-keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@-webkit-keyframes indeterminate{0%{left:-100%}to{left:100%}}@keyframes indeterminate{0%{left:-100%}to{left:100%}}@-webkit-keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}@keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}.el-radio-button{--el-radio-button-checked-bg-color:var(--el-color-primary);--el-radio-button-checked-text-color:var(--el-color-white);--el-radio-button-checked-border-color:var(--el-color-primary);--el-radio-button-disabled-checked-fill:var(--el-border-color-extra-light)}.el-radio-button{position:relative;display:inline-block;outline:0}.el-radio-button__inner{display:inline-block;line-height:1;white-space:nowrap;vertical-align:middle;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);font-weight:var(--el-button-font-weight,var(--el-font-weight-primary));border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;cursor:pointer;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button__inner.is-round{padding:8px 15px}.el-radio-button__inner:hover{color:var(--el-color-primary)}.el-radio-button__inner [class*=el-icon-]{line-height:.9}.el-radio-button__inner [class*=el-icon-]+span{margin-left:5px}.el-radio-button:first-child .el-radio-button__inner{border-left:var(--el-border);border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);box-shadow:none!important}.el-radio-button__original-radio{opacity:0;outline:0;position:absolute;z-index:-1}.el-radio-button__original-radio:checked+.el-radio-button__inner{color:var(--el-radio-button-checked-text-color,var(--el-color-white));background-color:var(--el-radio-button-checked-bg-color,var(--el-color-primary));border-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));box-shadow:-1px 0 0 0 var(--el-radio-button-checked-border-color,var(--el-color-primary))}.el-radio-button__original-radio:focus-visible+.el-radio-button__inner{border-left:var(--el-border);border-left-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));outline:2px solid var(--el-radio-button-checked-border-color);outline-offset:1px;z-index:2;border-radius:var(--el-border-radius-base);box-shadow:none}.el-radio-button__original-radio:disabled+.el-radio-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-radio-button__original-radio:disabled:checked+.el-radio-button__inner{background-color:var(--el-radio-button-disabled-checked-fill)}.el-radio-button:last-child .el-radio-button__inner{border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0}.el-radio-button:first-child:last-child .el-radio-button__inner{border-radius:var(--el-border-radius-base)}.el-radio-button--large .el-radio-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button--large .el-radio-button__inner.is-round{padding:12px 19px}.el-radio-button--small .el-radio-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-radio-button--small .el-radio-button__inner.is-round{padding:5px 11px}.el-radio-group{display:inline-flex;align-items:center;flex-wrap:wrap;font-size:0}.el-radio{--el-radio-font-size:var(--el-font-size-base);--el-radio-text-color:var(--el-text-color-regular);--el-radio-font-weight:var(--el-font-weight-primary);--el-radio-input-height:14px;--el-radio-input-width:14px;--el-radio-input-border-radius:var(--el-border-radius-circle);--el-radio-input-bg-color:var(--el-fill-color-blank);--el-radio-input-border:var(--el-border);--el-radio-input-border-color:var(--el-border-color);--el-radio-input-border-color-hover:var(--el-color-primary)}.el-radio{color:var(--el-radio-text-color);font-weight:var(--el-radio-font-weight);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;outline:0;font-size:var(--el-font-size-base);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:32px;height:32px}.el-radio.el-radio--large{height:40px}.el-radio.el-radio--small{height:24px}.el-radio.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-radio.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-radio.is-bordered.is-disabled{cursor:not-allowed;border-color:var(--el-border-color-lighter)}.el-radio.is-bordered.el-radio--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--large .el-radio__label{font-size:var(--el-font-size-base)}.el-radio.is-bordered.el-radio--large .el-radio__inner{height:14px;width:14px}.el-radio.is-bordered.el-radio--small{padding:0 11px 0 7px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--small .el-radio__label{font-size:12px}.el-radio.is-bordered.el-radio--small .el-radio__inner{height:12px;width:12px}.el-radio:last-child{margin-right:0}.el-radio__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative;vertical-align:middle}.el-radio__input.is-disabled .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);cursor:not-allowed}.el-radio__input.is-disabled .el-radio__inner:after{cursor:not-allowed;background-color:var(--el-disabled-bg-color)}.el-radio__input.is-disabled .el-radio__inner+.el-radio__label{cursor:not-allowed}.el-radio__input.is-disabled.is-checked .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color)}.el-radio__input.is-disabled.is-checked .el-radio__inner:after{background-color:var(--el-text-color-placeholder)}.el-radio__input.is-disabled+span.el-radio__label{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-radio__input.is-checked .el-radio__inner{border-color:var(--el-color-primary);background:var(--el-color-primary)}.el-radio__input.is-checked .el-radio__inner:after{transform:translate(-50%,-50%) scale(1)}.el-radio__input.is-checked+.el-radio__label{color:var(--el-color-primary)}.el-radio__input.is-focus .el-radio__inner{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner{border:var(--el-radio-input-border);border-radius:var(--el-radio-input-border-radius);width:var(--el-radio-input-width);height:var(--el-radio-input-height);background-color:var(--el-radio-input-bg-color);position:relative;cursor:pointer;display:inline-block;box-sizing:border-box}.el-radio__inner:hover{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner:after{width:4px;height:4px;border-radius:var(--el-radio-input-border-radius);background-color:var(--el-color-white);content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(0);transition:transform .15s ease-in}.el-radio__original{opacity:0;outline:0;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.el-radio__original:focus-visible+.el-radio__inner{outline:2px solid var(--el-radio-input-border-color-hover);outline-offset:1px;border-radius:var(--el-radio-input-border-radius)}.el-radio:focus:not(:focus-visible):not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner{box-shadow:0 0 2px 2px var(--el-radio-input-border-color-hover)}.el-radio__label{font-size:var(--el-radio-font-size);padding-left:8px}.el-radio.el-radio--large .el-radio__label{font-size:14px}.el-radio.el-radio--large .el-radio__inner{width:14px;height:14px}.el-radio.el-radio--small .el-radio__label{font-size:12px}.el-radio.el-radio--small .el-radio__inner{width:12px;height:12px}.el-rate{--el-rate-height:20px;--el-rate-font-size:var(--el-font-size-base);--el-rate-icon-size:18px;--el-rate-icon-margin:6px;--el-rate-void-color:var(--el-border-color-darker);--el-rate-fill-color:#f7ba2a;--el-rate-disabled-void-color:var(--el-fill-color);--el-rate-text-color:var(--el-text-color-primary)}.el-rate{display:inline-flex;align-items:center;height:32px}.el-rate:active,.el-rate:focus{outline:0}.el-rate__item{cursor:pointer;display:inline-block;position:relative;font-size:0;vertical-align:middle;color:var(--el-rate-void-color);line-height:normal}.el-rate .el-rate__icon{position:relative;display:inline-block;font-size:var(--el-rate-icon-size);margin-right:var(--el-rate-icon-margin);transition:var(--el-transition-duration)}.el-rate .el-rate__icon.hover{transform:scale(1.15)}.el-rate .el-rate__icon .path2{position:absolute;left:0;top:0}.el-rate .el-rate__icon.is-active{color:var(--el-rate-fill-color)}.el-rate__decimal{position:absolute;top:0;left:0;display:inline-block;overflow:hidden;color:var(--el-rate-fill-color)}.el-rate__text{font-size:var(--el-rate-font-size);vertical-align:middle;color:var(--el-rate-text-color)}.el-rate--large{height:40px}.el-rate--small{height:24px}.el-rate--small .el-rate__icon{font-size:14px}.el-rate.is-disabled .el-rate__item{cursor:auto;color:var(--el-rate-disabled-void-color)}.el-result{--el-result-padding:40px 30px;--el-result-icon-font-size:64px;--el-result-title-font-size:20px;--el-result-title-margin-top:20px;--el-result-subtitle-margin-top:10px;--el-result-extra-margin-top:30px}.el-result{display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-result-padding)}.el-result__icon svg{width:var(--el-result-icon-font-size);height:var(--el-result-icon-font-size)}.el-result__title{margin-top:var(--el-result-title-margin-top)}.el-result__title p{margin:0;font-size:var(--el-result-title-font-size);color:var(--el-text-color-primary);line-height:1.3}.el-result__subtitle{margin-top:var(--el-result-subtitle-margin-top)}.el-result__subtitle p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);line-height:1.3}.el-result__extra{margin-top:var(--el-result-extra-margin-top)}.el-result .icon-primary{--el-result-color:var(--el-color-primary);color:var(--el-result-color)}.el-result .icon-success{--el-result-color:var(--el-color-success);color:var(--el-result-color)}.el-result .icon-warning{--el-result-color:var(--el-color-warning);color:var(--el-result-color)}.el-result .icon-danger{--el-result-color:var(--el-color-danger);color:var(--el-result-color)}.el-result .icon-error{--el-result-color:var(--el-color-error);color:var(--el-result-color)}.el-result .icon-info{--el-result-color:var(--el-color-info);color:var(--el-result-color)}.el-row{display:flex;flex-wrap:wrap;position:relative;box-sizing:border-box}.el-row.is-justify-center{justify-content:center}.el-row.is-justify-end{justify-content:flex-end}.el-row.is-justify-space-between{justify-content:space-between}.el-row.is-justify-space-around{justify-content:space-around}.el-row.is-justify-space-evenly{justify-content:space-evenly}.el-row.is-align-middle{align-items:center}.el-row.is-align-bottom{align-items:flex-end}.el-scrollbar{--el-scrollbar-opacity:.3;--el-scrollbar-bg-color:var(--el-text-color-secondary);--el-scrollbar-hover-opacity:.5;--el-scrollbar-hover-bg-color:var(--el-text-color-secondary)}.el-scrollbar{overflow:hidden;position:relative;height:100%}.el-scrollbar__wrap{overflow:auto;height:100%}.el-scrollbar__wrap--hidden-default{scrollbar-width:none}.el-scrollbar__wrap--hidden-default::-webkit-scrollbar{display:none}.el-scrollbar__thumb{position:relative;display:block;width:0;height:0;cursor:pointer;border-radius:inherit;background-color:var(--el-scrollbar-bg-color,var(--el-text-color-secondary));transition:var(--el-transition-duration) background-color;opacity:var(--el-scrollbar-opacity,.3)}.el-scrollbar__thumb:hover{background-color:var(--el-scrollbar-hover-bg-color,var(--el-text-color-secondary));opacity:var(--el-scrollbar-hover-opacity,.5)}.el-scrollbar__bar{position:absolute;right:2px;bottom:2px;z-index:1;border-radius:4px}.el-scrollbar__bar.is-vertical{width:6px;top:2px}.el-scrollbar__bar.is-vertical>div{width:100%}.el-scrollbar__bar.is-horizontal{height:6px;left:2px}.el-scrollbar__bar.is-horizontal>div{height:100%}.el-scrollbar-fade-enter-active{transition:opacity .34s ease-out}.el-scrollbar-fade-leave-active{transition:opacity .12s ease-out}.el-scrollbar-fade-enter-from,.el-scrollbar-fade-leave-active{opacity:0}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled{color:var(--el-text-color-disabled)}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown__option-item:hover:not(.hover){background-color:transparent}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-disabled.is-selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;margin:6px 0!important;padding:0!important;box-sizing:border-box}.el-select-dropdown__option-item{font-size:var(--el-select-font-size);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__option-item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__option-item.is-disabled:hover{background-color:var(--el-bg-color)}.el-select-dropdown__option-item.is-selected{background-color:var(--el-fill-color-light);font-weight:700}.el-select-dropdown__option-item.is-selected:not(.is-multiple){color:var(--el-color-primary)}.el-select-dropdown__option-item.hover{background-color:var(--el-fill-color-light)!important}.el-select-dropdown__option-item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon{position:absolute;right:20px;top:0;height:inherit;font-size:12px}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon svg{height:inherit;vertical-align:middle}.el-select-group{margin:0;padding:0}.el-select-group__wrap{position:relative;list-style:none;margin:0;padding:0}.el-select-group__wrap:not(:last-of-type){padding-bottom:24px}.el-select-group__wrap:not(:last-of-type):after{content:"";position:absolute;display:block;left:20px;right:20px;bottom:12px;height:1px;background:var(--el-border-color-light)}.el-select-group__split-dash{position:absolute;left:20px;right:20px;height:1px;background:var(--el-border-color-light)}.el-select-group__title{padding-left:20px;font-size:12px;color:var(--el-color-info);line-height:30px}.el-select-group .el-select-dropdown__item{padding-left:20px}.el-select-v2{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select-v2{display:inline-block;position:relative;vertical-align:middle;font-size:14px}.el-select-v2__wrapper{display:flex;align-items:center;flex-wrap:wrap;position:relative;box-sizing:border-box;cursor:pointer;padding:1px 30px 1px 0;border:1px solid var(--el-border-color);border-radius:var(--el-border-radius-base);background-color:var(--el-fill-color-blank);transition:var(--el-transition-duration)}.el-select-v2__wrapper:hover{border-color:var(--el-text-color-placeholder)}.el-select-v2__wrapper.is-filterable{cursor:text}.el-select-v2__wrapper.is-focused{border-color:var(--el-color-primary)}.el-select-v2__wrapper.is-hovering:not(.is-focused){border-color:var(--el-border-color-hover)}.el-select-v2__wrapper.is-disabled{cursor:not-allowed;background-color:var(--el-fill-color-light);color:var(--el-text-color-placeholder);border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled:hover{border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled.is-focus{border-color:var(--el-input-focus-border-color)}.el-select-v2__wrapper.is-disabled .is-transparent{opacity:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-select-v2__wrapper.is-disabled .el-select-v2__caret,.el-select-v2__wrapper.is-disabled .el-select-v2__combobox-input{cursor:not-allowed}.el-select-v2__wrapper .el-select-v2__input-wrapper{box-sizing:border-box;position:relative;-webkit-margin-start:12px;margin-inline-start:12px;max-width:100%;overflow:hidden}.el-select-v2__wrapper,.el-select-v2__wrapper .el-select-v2__input-wrapper{line-height:32px}.el-select-v2__wrapper .el-select-v2__input-wrapper input{--el-input-inner-height:calc(var(--el-component-size, 32px) - 8px);height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);min-width:4px;width:100%;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:0 0;border:none;margin:2px 0;outline:0;padding:0}.el-select-v2 .el-select-v2__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select-v2__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:14px}.el-select-v2__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select-v2__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select-v2__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select-v2--large .el-select-v2__wrapper .el-select-v2__combobox-input{height:32px}.el-select-v2--large .el-select-v2__caret,.el-select-v2--large .el-select-v2__suffix{height:40px}.el-select-v2--large .el-select-v2__placeholder{font-size:14px;line-height:40px}.el-select-v2--small .el-select-v2__wrapper .el-select-v2__combobox-input{height:16px}.el-select-v2--small .el-select-v2__caret,.el-select-v2--small .el-select-v2__suffix{height:24px}.el-select-v2--small .el-select-v2__placeholder{font-size:12px;line-height:24px}.el-select-v2 .el-select-v2__selection>span{display:inline-block}.el-select-v2:hover .el-select-v2__combobox-input{border-color:var(--el-select-border-color-hover)}.el-select-v2 .el-select__selection-text{text-overflow:ellipsis;display:inline-block;overflow-x:hidden;vertical-align:bottom}.el-select-v2 .el-select-v2__combobox-input{padding-right:35px;display:block;color:var(--el-text-color-regular)}.el-select-v2 .el-select-v2__combobox-input:focus{border-color:var(--el-select-input-focus-border-color)}.el-select-v2__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px}.el-select-v2__input.is-small{height:14px}.el-select-v2__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select-v2__close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__suffix{display:inline-flex;position:absolute;right:12px;height:32px;top:50%;transform:translateY(-50%);color:var(--el-input-icon-color,var(--el-text-color-placeholder))}.el-select-v2__suffix .el-input__icon{height:inherit}.el-select-v2__suffix .el-input__icon:not(:first-child){margin-left:8px}.el-select-v2__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:var(--el-transition-duration);transform:rotate(180deg);cursor:pointer}.el-select-v2__caret.is-reverse{transform:rotate(0)}.el-select-v2__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(180deg);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select-v2__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__caret.el-icon{height:inherit}.el-select-v2__caret.el-icon svg{vertical-align:middle}.el-select-v2__selection{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;width:100%}.el-select-v2__input-calculator{left:0;position:absolute;top:0;visibility:hidden;white-space:pre;z-index:999}.el-select-v2__selected-item{line-height:inherit;height:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-wrap:wrap}.el-select-v2__placeholder{position:absolute;top:50%;transform:translateY(-50%);-webkit-margin-start:12px;margin-inline-start:12px;width:calc(100% - 52px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--el-input-text-color,var(--el-text-color-regular))}.el-select-v2__placeholder.is-transparent{color:var(--el-text-color-placeholder)}.el-select-v2 .el-select-v2__selection .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 0 2px 6px;background-color:var(--el-fill-color)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;color:var(--el-color-white)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select-v2.el-select-v2--small .el-select-v2__selection .el-tag{margin:1px 0 1px 6px;height:18px}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown .el-select-dropdown__option-item.is-selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown .el-select-dropdown__item.is-disabled:hover{background-color:unset}.el-select-dropdown .el-select-dropdown__item.is-disabled.selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;padding:6px 0;margin:0;box-sizing:border-box}.el-select{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select{display:inline-block;position:relative;vertical-align:middle;line-height:32px}.el-select__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select .el-select-tags-wrapper.has-prefix{margin-left:6px}.el-select--large{line-height:40px}.el-select--large .el-select-tags-wrapper.has-prefix{margin-left:8px}.el-select--small{line-height:24px}.el-select--small .el-select-tags-wrapper.has-prefix{margin-left:4px}.el-select .el-select__tags>span{display:inline-block}.el-select:hover:not(.el-select--disabled) .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-border-color-hover) inset}.el-select .el-select__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select .el-input__wrapper{cursor:pointer}.el-select .el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select .el-input__inner{cursor:pointer}.el-select .el-input{display:flex}.el-select .el-input .el-select__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:transform var(--el-transition-duration);transform:rotate(0);cursor:pointer}.el-select .el-input .el-select__caret.is-reverse{transform:rotate(-180deg)}.el-select .el-input .el-select__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(0);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select .el-input .el-select__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select .el-input .el-select__caret.el-icon{position:relative;height:inherit;z-index:2}.el-select .el-input.is-disabled .el-input__wrapper{cursor:not-allowed}.el-select .el-input.is-disabled .el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-select-disabled-border) inset}.el-select .el-input.is-disabled .el-input__inner,.el-select .el-input.is-disabled .el-select__caret{cursor:not-allowed}.el-select .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px;background-color:transparent}.el-select__input.is-disabled{cursor:not-allowed}.el-select__input--iOS{position:absolute;left:0;top:0;z-index:6}.el-select__input.is-small{height:14px}.el-select__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select__close:hover{color:var(--el-select-close-hover-color)}.el-select__tags{position:absolute;line-height:normal;top:50%;transform:translateY(-50%);white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__tags .el-tag:last-child{margin-right:0}.el-select__tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__tags.is-disabled{cursor:not-allowed}.el-select__collapse-tags{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__collapse-tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__collapse-tags .el-tag:last-child{margin-right:0}.el-select__collapse-tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__collapse-tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__collapse-tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__collapse-tag{line-height:inherit;height:inherit;display:flex}.el-skeleton{--el-skeleton-circle-size:var(--el-avatar-size)}.el-skeleton__item{background:var(--el-skeleton-color);display:inline-block;height:16px;border-radius:var(--el-border-radius-base);width:100%}.el-skeleton__circle{border-radius:50%;width:var(--el-skeleton-circle-size);height:var(--el-skeleton-circle-size);line-height:var(--el-skeleton-circle-size)}.el-skeleton__button{height:40px;width:64px;border-radius:4px}.el-skeleton__p{width:100%}.el-skeleton__p.is-last{width:61%}.el-skeleton__p.is-first{width:33%}.el-skeleton__text{width:100%;height:var(--el-font-size-small)}.el-skeleton__caption{height:var(--el-font-size-extra-small)}.el-skeleton__h1{height:var(--el-font-size-extra-large)}.el-skeleton__h3{height:var(--el-font-size-large)}.el-skeleton__h5{height:var(--el-font-size-medium)}.el-skeleton__image{width:unset;display:flex;align-items:center;justify-content:center;border-radius:0}.el-skeleton__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:22%;height:22%}.el-skeleton{--el-skeleton-color:var(--el-fill-color);--el-skeleton-to-color:var(--el-fill-color-darker)}@-webkit-keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}@keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.el-skeleton{width:100%}.el-skeleton__first-line,.el-skeleton__paragraph{height:16px;margin-top:16px;background:var(--el-skeleton-color)}.el-skeleton.is-animated .el-skeleton__item{background:linear-gradient(90deg,var(--el-skeleton-color) 25%,var(--el-skeleton-to-color) 37%,var(--el-skeleton-color) 63%);background-size:400% 100%;-webkit-animation:el-skeleton-loading 1.4s ease infinite;animation:el-skeleton-loading 1.4s ease infinite}.el-slider{--el-slider-main-bg-color:var(--el-color-primary);--el-slider-runway-bg-color:var(--el-border-color-light);--el-slider-stop-bg-color:var(--el-color-white);--el-slider-disabled-color:var(--el-text-color-placeholder);--el-slider-border-radius:3px;--el-slider-height:6px;--el-slider-button-size:20px;--el-slider-button-wrapper-size:36px;--el-slider-button-wrapper-offset:-15px}.el-slider{width:100%;height:32px;display:flex;align-items:center}.el-slider__runway{flex:1;height:var(--el-slider-height);background-color:var(--el-slider-runway-bg-color);border-radius:var(--el-slider-border-radius);position:relative;cursor:pointer}.el-slider__runway.show-input{margin-right:30px;width:auto}.el-slider__runway.is-disabled{cursor:default}.el-slider__runway.is-disabled .el-slider__bar{background-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button{border-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button-wrapper.hover,.el-slider__runway.is-disabled .el-slider__button-wrapper:hover,.el-slider__runway.is-disabled .el-slider__button-wrapper.dragging{cursor:not-allowed}.el-slider__runway.is-disabled .el-slider__button.dragging,.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover{transform:scale(1)}.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover,.el-slider__runway.is-disabled .el-slider__button.dragging{cursor:not-allowed}.el-slider__input{flex-shrink:0;width:130px}.el-slider__bar{height:var(--el-slider-height);background-color:var(--el-slider-main-bg-color);border-top-left-radius:var(--el-slider-border-radius);border-bottom-left-radius:var(--el-slider-border-radius);position:absolute}.el-slider__button-wrapper{height:var(--el-slider-button-wrapper-size);width:var(--el-slider-button-wrapper-size);position:absolute;z-index:1;top:var(--el-slider-button-wrapper-offset);transform:translate(-50%);background-color:transparent;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:normal;outline:0}.el-slider__button-wrapper:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-slider__button-wrapper.hover,.el-slider__button-wrapper:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button-wrapper.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__button{display:inline-block;width:var(--el-slider-button-size);height:var(--el-slider-button-size);vertical-align:middle;border:solid 2px var(--el-slider-main-bg-color);background-color:var(--el-color-white);border-radius:50%;box-sizing:border-box;transition:var(--el-transition-duration-fast);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-slider__button.dragging,.el-slider__button.hover,.el-slider__button:hover{transform:scale(1.2)}.el-slider__button.hover,.el-slider__button:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__stop{position:absolute;height:var(--el-slider-height);width:var(--el-slider-height);border-radius:var(--el-border-radius-circle);background-color:var(--el-slider-stop-bg-color);transform:translate(-50%)}.el-slider__marks{top:0;left:12px;width:18px;height:100%}.el-slider__marks-text{position:absolute;transform:translate(-50%);font-size:14px;color:var(--el-color-info);margin-top:15px;white-space:pre}.el-slider.is-vertical{position:relative;display:inline-flex;width:auto;height:100%;flex:0}.el-slider.is-vertical .el-slider__runway{width:var(--el-slider-height);height:100%;margin:0 16px}.el-slider.is-vertical .el-slider__bar{width:var(--el-slider-height);height:auto;border-radius:0 0 3px 3px}.el-slider.is-vertical .el-slider__button-wrapper{top:auto;left:var(--el-slider-button-wrapper-offset);transform:translateY(50%)}.el-slider.is-vertical .el-slider__stop{transform:translateY(50%)}.el-slider.is-vertical .el-slider__marks-text{margin-top:0;left:15px;transform:translateY(50%)}.el-slider--large{height:40px}.el-slider--small{height:24px}.el-space{display:inline-flex;vertical-align:top}.el-space__item{display:flex;flex-wrap:wrap}.el-space__item>*{flex:1}.el-space--vertical{flex-direction:column}.el-time-spinner{width:100%;white-space:nowrap}.el-spinner{display:inline-block;vertical-align:middle}.el-spinner-inner{-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite;width:50px;height:50px}.el-spinner-inner .path{stroke:var(--el-border-color-lighter);stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}@-webkit-keyframes rotate{to{transform:rotate(360deg)}}@keyframes rotate{to{transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}.el-step{position:relative;flex-shrink:1}.el-step:last-of-type .el-step__line{display:none}.el-step:last-of-type.is-flex{flex-basis:auto!important;flex-shrink:0;flex-grow:0}.el-step:last-of-type .el-step__description,.el-step:last-of-type .el-step__main{padding-right:0}.el-step__head{position:relative;width:100%}.el-step__head.is-process{color:var(--el-text-color-primary);border-color:var(--el-text-color-primary)}.el-step__head.is-wait{color:var(--el-text-color-placeholder);border-color:var(--el-text-color-placeholder)}.el-step__head.is-success{color:var(--el-color-success);border-color:var(--el-color-success)}.el-step__head.is-error{color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-step__head.is-finish{color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-step__icon{position:relative;z-index:1;display:inline-flex;justify-content:center;align-items:center;width:24px;height:24px;font-size:14px;box-sizing:border-box;background:var(--el-bg-color);transition:.15s ease-out}.el-step__icon.is-text{border-radius:50%;border:2px solid;border-color:inherit}.el-step__icon.is-icon{width:40px}.el-step__icon-inner{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;font-weight:700;line-height:1;color:inherit}.el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:25px;font-weight:400}.el-step__icon-inner.is-status{transform:translateY(1px)}.el-step__line{position:absolute;border-color:inherit;background-color:var(--el-text-color-placeholder)}.el-step__line-inner{display:block;border-width:1px;border-style:solid;border-color:inherit;transition:.15s ease-out;box-sizing:border-box;width:0;height:0}.el-step__main{white-space:normal;text-align:left}.el-step__title{font-size:16px;line-height:38px}.el-step__title.is-process{font-weight:700;color:var(--el-text-color-primary)}.el-step__title.is-wait{color:var(--el-text-color-placeholder)}.el-step__title.is-success{color:var(--el-color-success)}.el-step__title.is-error{color:var(--el-color-danger)}.el-step__title.is-finish{color:var(--el-color-primary)}.el-step__description{padding-right:10%;margin-top:-5px;font-size:12px;line-height:20px;font-weight:400}.el-step__description.is-process{color:var(--el-text-color-primary)}.el-step__description.is-wait{color:var(--el-text-color-placeholder)}.el-step__description.is-success{color:var(--el-color-success)}.el-step__description.is-error{color:var(--el-color-danger)}.el-step__description.is-finish{color:var(--el-color-primary)}.el-step.is-horizontal{display:inline-block}.el-step.is-horizontal .el-step__line{height:2px;top:11px;left:0;right:0}.el-step.is-vertical{display:flex}.el-step.is-vertical .el-step__head{flex-grow:0;width:24px}.el-step.is-vertical .el-step__main{padding-left:10px;flex-grow:1}.el-step.is-vertical .el-step__title{line-height:24px;padding-bottom:8px}.el-step.is-vertical .el-step__line{width:2px;top:0;bottom:0;left:11px}.el-step.is-vertical .el-step__icon.is-icon{width:24px}.el-step.is-center .el-step__head,.el-step.is-center .el-step__main{text-align:center}.el-step.is-center .el-step__description{padding-left:20%;padding-right:20%}.el-step.is-center .el-step__line{left:50%;right:-50%}.el-step.is-simple{display:flex;align-items:center}.el-step.is-simple .el-step__head{width:auto;font-size:0;padding-right:10px}.el-step.is-simple .el-step__icon{background:0 0;width:16px;height:16px;font-size:12px}.el-step.is-simple .el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:18px}.el-step.is-simple .el-step__icon-inner.is-status{transform:scale(.8) translateY(1px)}.el-step.is-simple .el-step__main{position:relative;display:flex;align-items:stretch;flex-grow:1}.el-step.is-simple .el-step__title{font-size:16px;line-height:20px}.el-step.is-simple:not(:last-of-type) .el-step__title{max-width:50%;word-break:break-all}.el-step.is-simple .el-step__arrow{flex-grow:1;display:flex;align-items:center;justify-content:center}.el-step.is-simple .el-step__arrow:after,.el-step.is-simple .el-step__arrow:before{content:"";display:inline-block;position:absolute;height:15px;width:1px;background:var(--el-text-color-placeholder)}.el-step.is-simple .el-step__arrow:before{transform:rotate(-45deg) translateY(-4px);transform-origin:0 0}.el-step.is-simple .el-step__arrow:after{transform:rotate(45deg) translateY(4px);transform-origin:100% 100%}.el-step.is-simple:last-of-type .el-step__arrow{display:none}.el-steps{display:flex}.el-steps--simple{padding:13px 8%;border-radius:4px;background:var(--el-fill-color-light)}.el-steps--horizontal{white-space:nowrap}.el-steps--vertical{height:100%;flex-flow:column}.el-switch{--el-switch-on-color:var(--el-color-primary);--el-switch-off-color:var(--el-border-color)}.el-switch{display:inline-flex;align-items:center;position:relative;font-size:14px;line-height:20px;height:32px;vertical-align:middle}.el-switch.is-disabled .el-switch__core,.el-switch.is-disabled .el-switch__label{cursor:not-allowed}.el-switch__label{transition:var(--el-transition-duration-fast);height:20px;display:inline-block;font-size:14px;font-weight:500;cursor:pointer;vertical-align:middle;color:var(--el-text-color-primary)}.el-switch__label.is-active{color:var(--el-color-primary)}.el-switch__label--left{margin-right:10px}.el-switch__label--right{margin-left:10px}.el-switch__label *{line-height:1;font-size:14px;display:inline-block}.el-switch__label .el-icon{height:inherit}.el-switch__label .el-icon svg{vertical-align:middle}.el-switch__input{position:absolute;width:0;height:0;opacity:0;margin:0}.el-switch__input:focus-visible~.el-switch__core{outline:2px solid var(--el-switch-on-color);outline-offset:1px}.el-switch__core{display:inline-flex;position:relative;align-items:center;min-width:40px;height:20px;border:1px solid var(--el-switch-border-color,var(--el-switch-off-color));outline:0;border-radius:10px;box-sizing:border-box;background:var(--el-switch-off-color);cursor:pointer;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration)}.el-switch__core .el-switch__inner{width:100%;transition:all var(--el-transition-duration);height:16px;display:flex;justify-content:center;align-items:center;overflow:hidden;padding:0 4px 0 18px}.el-switch__core .el-switch__inner .is-icon,.el-switch__core .el-switch__inner .is-text{font-size:12px;color:var(--el-color-white);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-switch__core .el-switch__action{position:absolute;left:1px;border-radius:var(--el-border-radius-circle);transition:all var(--el-transition-duration);width:16px;height:16px;background-color:var(--el-color-white);display:flex;justify-content:center;align-items:center;color:var(--el-switch-off-color)}.el-switch.is-checked .el-switch__core{border-color:var(--el-switch-border-color,var(--el-switch-on-color));background-color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__action{left:calc(100% - 17px);color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__inner{padding:0 18px 0 4px}.el-switch.is-disabled{opacity:.6}.el-switch--wide .el-switch__label.el-switch__label--left span{left:10px}.el-switch--wide .el-switch__label.el-switch__label--right span{right:10px}.el-switch .label-fade-enter-from,.el-switch .label-fade-leave-active{opacity:0}.el-switch--large{font-size:14px;line-height:24px;height:40px}.el-switch--large .el-switch__label{height:24px;font-size:14px}.el-switch--large .el-switch__label *{font-size:14px}.el-switch--large .el-switch__core{min-width:50px;height:24px;border-radius:12px}.el-switch--large .el-switch__core .el-switch__inner{height:20px;padding:0 6px 0 22px}.el-switch--large .el-switch__core .el-switch__action{width:20px;height:20px}.el-switch--large.is-checked .el-switch__core .el-switch__action{left:calc(100% - 21px)}.el-switch--large.is-checked .el-switch__core .el-switch__inner{padding:0 22px 0 6px}.el-switch--small{font-size:12px;line-height:16px;height:24px}.el-switch--small .el-switch__label{height:16px;font-size:12px}.el-switch--small .el-switch__label *{font-size:12px}.el-switch--small .el-switch__core{min-width:30px;height:16px;border-radius:8px}.el-switch--small .el-switch__core .el-switch__inner{height:12px;padding:0 2px 0 14px}.el-switch--small .el-switch__core .el-switch__action{width:12px;height:12px}.el-switch--small.is-checked .el-switch__core .el-switch__action{left:calc(100% - 13px)}.el-switch--small.is-checked .el-switch__core .el-switch__inner{padding:0 14px 0 2px}.el-table-column--selection .cell{padding-left:14px;padding-right:14px}.el-table-filter{border:solid 1px var(--el-border-color-lighter);border-radius:2px;background-color:#fff;box-shadow:var(--el-box-shadow-light);box-sizing:border-box}.el-table-filter__list{padding:5px 0;margin:0;list-style:none;min-width:100px}.el-table-filter__list-item{line-height:36px;padding:0 10px;cursor:pointer;font-size:var(--el-font-size-base)}.el-table-filter__list-item:hover{background-color:var(--el-color-primary-light-9);color:var(--el-color-primary)}.el-table-filter__list-item.is-active{background-color:var(--el-color-primary);color:#fff}.el-table-filter__content{min-width:100px}.el-table-filter__bottom{border-top:1px solid var(--el-border-color-lighter);padding:8px}.el-table-filter__bottom button{background:0 0;border:none;color:var(--el-text-color-regular);cursor:pointer;font-size:var(--el-font-size-small);padding:0 3px}.el-table-filter__bottom button:hover{color:var(--el-color-primary)}.el-table-filter__bottom button:focus{outline:0}.el-table-filter__bottom button.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-table-filter__wrap{max-height:280px}.el-table-filter__checkbox-group{padding:10px}.el-table-filter__checkbox-group label.el-checkbox{display:flex;align-items:center;margin-right:5px;margin-bottom:12px;margin-left:5px;height:unset}.el-table-filter__checkbox-group .el-checkbox:last-child{margin-bottom:0}.el-table{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table{position:relative;overflow:hidden;box-sizing:border-box;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:100%;max-width:100%;background-color:var(--el-table-bg-color);font-size:14px;color:var(--el-table-text-color)}.el-table__inner-wrapper{position:relative;display:flex;flex-direction:column;height:100%}.el-table__inner-wrapper:before{left:0;bottom:0;width:100%;height:1px}.el-table.has-footer.el-table--fluid-height tr:last-child td.el-table__cell,.el-table.has-footer.el-table--scrollable-y tr:last-child td.el-table__cell{border-bottom-color:transparent}.el-table__empty-block{position:-webkit-sticky;position:sticky;left:0;min-height:60px;text-align:center;width:100%;display:flex;justify-content:center;align-items:center}.el-table__empty-text{line-height:60px;width:50%;color:var(--el-text-color-secondary)}.el-table__expand-column .cell{padding:0;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table__expand-icon{position:relative;cursor:pointer;color:var(--el-text-color-regular);font-size:12px;transition:transform var(--el-transition-duration-fast) ease-in-out;height:20px}.el-table__expand-icon--expanded{transform:rotate(90deg)}.el-table__expand-icon>.el-icon{font-size:12px}.el-table__expanded-cell{background-color:var(--el-table-expanded-cell-bg-color)}.el-table__expanded-cell[class*=cell]{padding:20px 50px}.el-table__expanded-cell:hover{background-color:transparent!important}.el-table__placeholder{display:inline-block;width:20px}.el-table__append-wrapper{overflow:hidden}.el-table--fit{border-right:0;border-bottom:0}.el-table--fit .el-table__cell.gutter{border-right-width:1px}.el-table thead{color:var(--el-table-header-text-color);font-weight:500}.el-table thead.is-group th.el-table__cell{background:var(--el-fill-color-light)}.el-table .el-table__cell{padding:8px 0;min-width:0;box-sizing:border-box;text-overflow:ellipsis;vertical-align:middle;position:relative;text-align:left;z-index:1}.el-table .el-table__cell.is-center{text-align:center}.el-table .el-table__cell.is-right{text-align:right}.el-table .el-table__cell.gutter{width:15px;border-right-width:0;border-bottom-width:0;padding:0}.el-table .el-table__cell.is-hidden>*{visibility:hidden}.el-table .cell{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;line-height:23px;padding:0 12px}.el-table .cell.el-tooltip{white-space:nowrap;min-width:50px}.el-table--large{font-size:var(--el-font-size-base)}.el-table--large .el-table__cell{padding:12px 0}.el-table--large .cell{padding:0 16px}.el-table--default{font-size:14px}.el-table--default .el-table__cell{padding:8px 0}.el-table--default .cell{padding:0 12px}.el-table--small{font-size:12px}.el-table--small .el-table__cell{padding:4px 0}.el-table--small .cell{padding:0 8px}.el-table tr{background-color:var(--el-table-tr-bg-color)}.el-table tr input[type=checkbox]{margin:0}.el-table td.el-table__cell,.el-table th.el-table__cell.is-leaf{border-bottom:var(--el-table-border)}.el-table th.el-table__cell.is-sortable{cursor:pointer}.el-table th.el-table__cell{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--el-table-header-bg-color)}.el-table th.el-table__cell>.cell.highlight{color:var(--el-color-primary)}.el-table th.el-table__cell.required>div:before{display:inline-block;content:"";width:8px;height:8px;border-radius:50%;background:#ff4d51;margin-right:5px;vertical-align:middle}.el-table td.el-table__cell div{box-sizing:border-box}.el-table td.el-table__cell.gutter{width:0}.el-table__footer-wrapper{border-top:var(--el-table-border)}.el-table--border .el-table__inner-wrapper:after,.el-table--border:after,.el-table--border:before,.el-table__inner-wrapper:before{content:"";position:absolute;background-color:var(--el-table-border-color);z-index:3}.el-table--border .el-table__inner-wrapper:after{left:0;top:0;width:100%;height:1px}.el-table--border:before{top:-1px;left:0;width:1px;height:100%}.el-table--border:after{top:-1px;right:0;width:1px;height:100%}.el-table--border .el-table__inner-wrapper{border-right:none;border-bottom:none}.el-table--border .el-table__footer-wrapper{position:relative;flex-shrink:0}.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table--border th.el-table__cell.gutter:last-of-type{border-bottom:var(--el-table-border);border-bottom-width:1px}.el-table--border th.el-table__cell{border-bottom:var(--el-table-border)}.el-table--hidden{visibility:hidden}.el-table__body-wrapper,.el-table__footer-wrapper,.el-table__header-wrapper{width:100%}.el-table__body-wrapper tr td.el-table-fixed-column--left,.el-table__body-wrapper tr td.el-table-fixed-column--right,.el-table__body-wrapper tr th.el-table-fixed-column--left,.el-table__body-wrapper tr th.el-table-fixed-column--right,.el-table__footer-wrapper tr td.el-table-fixed-column--left,.el-table__footer-wrapper tr td.el-table-fixed-column--right,.el-table__footer-wrapper tr th.el-table-fixed-column--left,.el-table__footer-wrapper tr th.el-table-fixed-column--right,.el-table__header-wrapper tr td.el-table-fixed-column--left,.el-table__header-wrapper tr td.el-table-fixed-column--right,.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:var(--el-bg-color)}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{content:"";position:absolute;top:0;width:10px;bottom:-1px;overflow-x:hidden;overflow-y:hidden;box-shadow:none;touch-action:none;pointer-events:none}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before{left:-10px}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{right:-10px;box-shadow:none}.el-table__body-wrapper tr td.el-table__fixed-right-patch,.el-table__body-wrapper tr th.el-table__fixed-right-patch,.el-table__footer-wrapper tr td.el-table__fixed-right-patch,.el-table__footer-wrapper tr th.el-table__fixed-right-patch,.el-table__header-wrapper tr td.el-table__fixed-right-patch,.el-table__header-wrapper tr th.el-table__fixed-right-patch{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:#fff;right:0}.el-table__header-wrapper{flex-shrink:0}.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body,.el-table__footer,.el-table__header{table-layout:fixed;border-collapse:separate}.el-table__footer-wrapper,.el-table__header-wrapper{overflow:hidden}.el-table__footer-wrapper tbody td.el-table__cell,.el-table__header-wrapper tbody td.el-table__cell{background-color:var(--el-table-row-hover-bg-color);color:var(--el-table-text-color)}.el-table__body-wrapper .el-table-column--selection>.cell,.el-table__header-wrapper .el-table-column--selection>.cell{display:inline-flex;align-items:center;height:23px}.el-table__body-wrapper .el-table-column--selection .el-checkbox,.el-table__header-wrapper .el-table-column--selection .el-checkbox{height:unset}.el-table.is-scrolling-left .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-left.el-table--border .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:var(--el-table-border)}.el-table.is-scrolling-left th.el-table-fixed-column--left{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-right th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-middle .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-none .el-table-fixed-column--left.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--left.is-last-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-last-column:before{box-shadow:none}.el-table.is-scrolling-none th.el-table-fixed-column--left,.el-table.is-scrolling-none th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body-wrapper{overflow:hidden;position:relative;flex:1}.el-table__body-wrapper .el-scrollbar__bar{z-index:2}.el-table .caret-wrapper{display:inline-flex;flex-direction:column;align-items:center;height:14px;width:24px;vertical-align:middle;cursor:pointer;overflow:initial;position:relative}.el-table .sort-caret{width:0;height:0;border:solid 5px transparent;position:absolute;left:7px}.el-table .sort-caret.ascending{border-bottom-color:var(--el-text-color-placeholder);top:-5px}.el-table .sort-caret.descending{border-top-color:var(--el-text-color-placeholder);bottom:-3px}.el-table .ascending .sort-caret.ascending{border-bottom-color:var(--el-color-primary)}.el-table .descending .sort-caret.descending{border-top-color:var(--el-color-primary)}.el-table .hidden-columns{visibility:hidden;position:absolute;z-index:-1}.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell{background:var(--el-fill-color-lighter)}.el-table--striped .el-table__body tr.el-table__row--striped.current-row td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__body tr.hover-row.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped>td.el-table__cell,.el-table__body tr.hover-row>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table__body tr.current-row>td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__column-resize-proxy{position:absolute;left:200px;top:0;bottom:0;width:0;border-left:var(--el-table-border);z-index:10}.el-table__column-filter-trigger{display:inline-block;cursor:pointer}.el-table__column-filter-trigger i{color:var(--el-color-info);font-size:14px;vertical-align:middle}.el-table__border-left-patch{top:0;left:0;width:1px;height:100%;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-bottom-patch{left:0;height:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-right-patch{top:0;height:100%;width:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table--enable-row-transition .el-table__body td.el-table__cell{transition:background-color .25s ease}.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table [class*=el-table__row--level] .el-table__expand-icon{display:inline-block;width:12px;line-height:12px;height:12px;text-align:center;margin-right:8px}.el-table .el-table.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table:not(.el-table--border) .el-table__cell{border-right:none}.el-table:not(.el-table--border)>.el-table__inner-wrapper:after{content:none}.el-table-v2{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table-v2{font-size:14px}.el-table-v2 *{box-sizing:border-box}.el-table-v2__root{position:relative}.el-table-v2__root:hover .el-table-v2__main .el-virtual-scrollbar{opacity:1}.el-table-v2__main{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0}.el-table-v2__main .el-vl__horizontal,.el-table-v2__main .el-vl__vertical{z-index:2}.el-table-v2__left{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0;box-shadow:2px 0 4px #0000000f}.el-table-v2__left .el-virtual-scrollbar{opacity:0}.el-table-v2__left .el-vl__horizontal,.el-table-v2__left .el-vl__vertical{z-index:-1}.el-table-v2__right{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);right:0;box-shadow:-2px 0 4px #0000000f}.el-table-v2__right .el-virtual-scrollbar{opacity:0}.el-table-v2__right .el-vl__horizontal,.el-table-v2__right .el-vl__vertical{z-index:-1}.el-table-v2__header-row,.el-table-v2__row{-webkit-padding-end:var(--el-table-scrollbar-size);padding-inline-end:var(--el-table-scrollbar-size)}.el-table-v2__header-wrapper{overflow:hidden}.el-table-v2__header{position:relative;overflow:hidden}.el-table-v2__footer{position:absolute;left:0;right:0;bottom:0;overflow:hidden}.el-table-v2__empty{position:absolute;left:0}.el-table-v2__overlay{position:absolute;left:0;right:0;top:0;bottom:0;z-index:9999}.el-table-v2__header-row{display:flex;border-bottom:var(--el-table-border)}.el-table-v2__header-cell{display:flex;align-items:center;padding:0 8px;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;background-color:var(--el-table-header-bg-color);color:var(--el-table-header-text-color);font-weight:700}.el-table-v2__header-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__header-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__header-cell.is-sortable{cursor:pointer}.el-table-v2__header-cell:hover .el-icon{display:block}.el-table-v2__sort-icon{transition:opacity,display var(--el-transition-duration);opacity:.6;display:none}.el-table-v2__sort-icon.is-sorting{display:block;opacity:1}.el-table-v2__row{border-bottom:var(--el-table-border);display:flex;align-items:center;transition:background-color var(--el-transition-duration)}.el-table-v2__row.is-hovered,.el-table-v2__row:hover{background-color:var(--el-table-row-hover-bg-color)}.el-table-v2__row-cell{height:100%;overflow:hidden;display:flex;align-items:center;padding:0 8px}.el-table-v2__row-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__row-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__expand-icon{margin:0 4px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table-v2__expand-icon svg{transition:transform var(--el-transition-duration)}.el-table-v2__expand-icon.is-expanded svg{transform:rotate(90deg)}.el-table-v2:not(.is-dynamic) .el-table-v2__cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-table-v2.is-dynamic .el-table-v2__row{overflow:hidden;align-items:stretch}.el-table-v2.is-dynamic .el-table-v2__row .el-table-v2__row-cell{word-break:break-all}.el-tabs{--el-tabs-header-height:40px}.el-tabs__header{padding:0;position:relative;margin:0 0 15px}.el-tabs__active-bar{position:absolute;bottom:0;left:0;height:2px;background-color:var(--el-color-primary);z-index:1;transition:width var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),transform var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);list-style:none}.el-tabs__new-tab{display:flex;align-items:center;justify-content:center;float:right;border:1px solid var(--el-border-color);height:20px;width:20px;line-height:20px;margin:10px 0 10px 10px;border-radius:3px;text-align:center;font-size:12px;color:var(--el-text-color-primary);cursor:pointer;transition:all .15s}.el-tabs__new-tab .is-icon-plus{height:inherit;width:inherit;transform:scale(.8)}.el-tabs__new-tab .is-icon-plus svg{vertical-align:middle}.el-tabs__new-tab:hover{color:var(--el-color-primary)}.el-tabs__nav-wrap{overflow:hidden;margin-bottom:-1px;position:relative}.el-tabs__nav-wrap:after{content:"";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:var(--el-border-color-light);z-index:var(--el-index-normal)}.el-tabs__nav-wrap.is-scrollable{padding:0 20px;box-sizing:border-box}.el-tabs__nav-scroll{overflow:hidden}.el-tabs__nav-next,.el-tabs__nav-prev{position:absolute;cursor:pointer;line-height:44px;font-size:12px;color:var(--el-text-color-secondary);width:20px;text-align:center}.el-tabs__nav-next{right:0}.el-tabs__nav-prev{left:0}.el-tabs__nav{display:flex;white-space:nowrap;position:relative;transition:transform var(--el-transition-duration);float:left;z-index:calc(var(--el-index-normal) + 1)}.el-tabs__nav.is-stretch{min-width:100%;display:flex}.el-tabs__nav.is-stretch>*{flex:1;text-align:center}.el-tabs__item{padding:0 20px;height:var(--el-tabs-header-height);box-sizing:border-box;display:flex;align-items:center;justify-content:center;list-style:none;font-size:var(--el-font-size-base);font-weight:500;color:var(--el-text-color-primary);position:relative}.el-tabs__item:focus,.el-tabs__item:focus:active{outline:0}.el-tabs__item:focus-visible{box-shadow:0 0 2px 2px var(--el-color-primary) inset;border-radius:3px}.el-tabs__item .is-icon-close{border-radius:50%;text-align:center;transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);margin-left:5px}.el-tabs__item .is-icon-close:before{transform:scale(.9);display:inline-block}.el-tabs__item .is-icon-close:hover{background-color:var(--el-text-color-placeholder);color:#fff}.el-tabs__item.is-active{color:var(--el-color-primary)}.el-tabs__item:hover{color:var(--el-color-primary);cursor:pointer}.el-tabs__item.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-tabs__content{overflow:hidden;position:relative}.el-tabs--card>.el-tabs__header{border-bottom:1px solid var(--el-border-color-light);height:var(--el-tabs-header-height)}.el-tabs--card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--card>.el-tabs__header .el-tabs__nav{border:1px solid var(--el-border-color-light);border-bottom:none;border-radius:4px 4px 0 0;box-sizing:border-box}.el-tabs--card>.el-tabs__header .el-tabs__active-bar{display:none}.el-tabs--card>.el-tabs__header .el-tabs__item .is-icon-close{position:relative;font-size:12px;width:0;height:14px;overflow:hidden;right:-2px;transform-origin:100% 50%}.el-tabs--card>.el-tabs__header .el-tabs__item{border-bottom:1px solid transparent;border-left:1px solid var(--el-border-color-light);transition:color var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),padding var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier)}.el-tabs--card>.el-tabs__header .el-tabs__item:first-child{border-left:none}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover{padding-left:13px;padding-right:13px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover .is-icon-close{width:14px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active{border-bottom-color:var(--el-bg-color)}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable{padding-left:20px;padding-right:20px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable .is-icon-close{width:14px}.el-tabs--border-card{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color)}.el-tabs--border-card>.el-tabs__content{padding:15px}.el-tabs--border-card>.el-tabs__header{background-color:var(--el-fill-color-light);border-bottom:1px solid var(--el-border-color-light);margin:0}.el-tabs--border-card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--border-card>.el-tabs__header .el-tabs__item{transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);border:1px solid transparent;margin-top:-1px;color:var(--el-text-color-secondary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:first-child{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item+.el-tabs__item{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay);border-right-color:var(--el-border-color);border-left-color:var(--el-border-color)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover{color:var(--el-color-primary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-disabled{color:var(--el-disabled-text-color)}.el-tabs--border-card>.el-tabs__header .is-scrollable .el-tabs__item:first-child{margin-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),.el-tabs--top .el-tabs__item.is-top:nth-child(2){padding-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:last-child,.el-tabs--bottom .el-tabs__item.is-top:last-child,.el-tabs--top .el-tabs__item.is-bottom:last-child,.el-tabs--top .el-tabs__item.is-top:last-child{padding-right:0}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2){padding-left:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover{padding-left:13px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child{padding-right:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover{padding-right:13px}.el-tabs--bottom .el-tabs__header.is-bottom{margin-bottom:0;margin-top:10px}.el-tabs--bottom.el-tabs--border-card .el-tabs__header.is-bottom{border-bottom:0;border-top:1px solid var(--el-border-color)}.el-tabs--bottom.el-tabs--border-card .el-tabs__nav-wrap.is-bottom{margin-top:-1px;margin-bottom:0}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom:not(.is-active){border:1px solid transparent}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom{margin:0 -1px -1px}.el-tabs--left,.el-tabs--right{overflow:hidden}.el-tabs--left .el-tabs__header.is-left,.el-tabs--left .el-tabs__header.is-right,.el-tabs--left .el-tabs__nav-scroll,.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__header.is-left,.el-tabs--right .el-tabs__header.is-right,.el-tabs--right .el-tabs__nav-scroll,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{height:100%}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__active-bar.is-right,.el-tabs--right .el-tabs__active-bar.is-left,.el-tabs--right .el-tabs__active-bar.is-right{top:0;bottom:auto;width:2px;height:auto}.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{margin-bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{height:30px;line-height:30px;width:100%;text-align:center;cursor:pointer}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i{transform:rotate(90deg)}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{left:auto;top:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next{right:auto;bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--left .el-tabs__nav-wrap.is-right.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-right.is-scrollable{padding:30px 0}.el-tabs--left .el-tabs__nav-wrap.is-left:after,.el-tabs--left .el-tabs__nav-wrap.is-right:after,.el-tabs--right .el-tabs__nav-wrap.is-left:after,.el-tabs--right .el-tabs__nav-wrap.is-right:after{height:100%;width:2px;bottom:auto;top:0}.el-tabs--left .el-tabs__nav.is-left,.el-tabs--left .el-tabs__nav.is-right,.el-tabs--right .el-tabs__nav.is-left,.el-tabs--right .el-tabs__nav.is-right{flex-direction:column}.el-tabs--left .el-tabs__item.is-left,.el-tabs--right .el-tabs__item.is-left{justify-content:flex-end}.el-tabs--left .el-tabs__item.is-right,.el-tabs--right .el-tabs__item.is-right{justify-content:flex-start}.el-tabs--left .el-tabs__header.is-left{float:left;margin-bottom:0;margin-right:10px}.el-tabs--left .el-tabs__nav-wrap.is-left{margin-right:-1px}.el-tabs--left .el-tabs__nav-wrap.is-left:after{left:auto;right:0}.el-tabs--left .el-tabs__active-bar.is-left{right:0;left:auto}.el-tabs--left .el-tabs__item.is-left{text-align:right}.el-tabs--left.el-tabs--card .el-tabs__active-bar.is-left{display:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left{border-left:none;border-right:1px solid var(--el-border-color-light);border-bottom:none;border-top:1px solid var(--el-border-color-light);text-align:left}.el-tabs--left.el-tabs--card .el-tabs__item.is-left:first-child{border-right:1px solid var(--el-border-color-light);border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active{border:1px solid var(--el-border-color-light);border-right-color:#fff;border-left:none;border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:first-child{border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:last-child{border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__nav{border-radius:4px 0 0 4px;border-bottom:1px solid var(--el-border-color-light);border-right:none}.el-tabs--left.el-tabs--card .el-tabs__new-tab{float:none}.el-tabs--left.el-tabs--border-card .el-tabs__header.is-left{border-right:1px solid var(--el-border-color)}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left{border:1px solid transparent;margin:-1px 0 -1px -1px}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.el-tabs--right .el-tabs__header.is-right{float:right;margin-bottom:0;margin-left:10px}.el-tabs--right .el-tabs__nav-wrap.is-right{margin-left:-1px}.el-tabs--right .el-tabs__nav-wrap.is-right:after{left:0;right:auto}.el-tabs--right .el-tabs__active-bar.is-right{left:0}.el-tabs--right.el-tabs--card .el-tabs__active-bar.is-right{display:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right{border-bottom:none;border-top:1px solid var(--el-border-color-light)}.el-tabs--right.el-tabs--card .el-tabs__item.is-right:first-child{border-left:1px solid var(--el-border-color-light);border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active{border:1px solid var(--el-border-color-light);border-left-color:#fff;border-right:none;border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:first-child{border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:last-child{border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__nav{border-radius:0 4px 4px 0;border-bottom:1px solid var(--el-border-color-light);border-left:none}.el-tabs--right.el-tabs--border-card .el-tabs__header.is-right{border-left:1px solid var(--el-border-color)}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right{border:1px solid transparent;margin:-1px -1px -1px 0}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.slideInLeft-transition,.slideInRight-transition{display:inline-block}.slideInRight-enter{-webkit-animation:slideInRight-enter var(--el-transition-duration);animation:slideInRight-enter var(--el-transition-duration)}.slideInRight-leave{position:absolute;left:0;right:0;-webkit-animation:slideInRight-leave var(--el-transition-duration);animation:slideInRight-leave var(--el-transition-duration)}.slideInLeft-enter{-webkit-animation:slideInLeft-enter var(--el-transition-duration);animation:slideInLeft-enter var(--el-transition-duration)}.slideInLeft-leave{position:absolute;left:0;right:0;-webkit-animation:slideInLeft-leave var(--el-transition-duration);animation:slideInLeft-leave var(--el-transition-duration)}@-webkit-keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@-webkit-keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}@keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}.el-tag{--el-tag-font-size:12px;--el-tag-border-radius:4px;--el-tag-border-radius-rounded:9999px}.el-tag{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary);--el-tag-text-color:var(--el-color-primary);background-color:var(--el-tag-bg-color);border-color:var(--el-tag-border-color);color:var(--el-tag-text-color);display:inline-flex;justify-content:center;align-items:center;height:24px;padding:0 9px;font-size:var(--el-tag-font-size);line-height:1;border-width:1px;border-style:solid;border-radius:var(--el-tag-border-radius);box-sizing:border-box;white-space:nowrap;--el-icon-size:14px}.el-tag.el-tag--primary{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-bg-color:var(--el-color-success-light-9);--el-tag-border-color:var(--el-color-success-light-8);--el-tag-hover-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-bg-color:var(--el-color-warning-light-9);--el-tag-border-color:var(--el-color-warning-light-8);--el-tag-hover-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-bg-color:var(--el-color-danger-light-9);--el-tag-border-color:var(--el-color-danger-light-8);--el-tag-hover-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-bg-color:var(--el-color-error-light-9);--el-tag-border-color:var(--el-color-error-light-8);--el-tag-hover-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-bg-color:var(--el-color-info-light-9);--el-tag-border-color:var(--el-color-info-light-8);--el-tag-hover-color:var(--el-color-info)}.el-tag.el-tag--primary{--el-tag-text-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-text-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-text-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-text-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-text-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-text-color:var(--el-color-info)}.el-tag.is-hit{border-color:var(--el-color-primary)}.el-tag.is-round{border-radius:var(--el-tag-border-radius-rounded)}.el-tag .el-tag__close{color:var(--el-tag-text-color)}.el-tag .el-tag__close:hover{color:var(--el-color-white);background-color:var(--el-tag-hover-color)}.el-tag .el-icon{border-radius:50%;cursor:pointer;font-size:calc(var(--el-icon-size) - 2px);height:var(--el-icon-size);width:var(--el-icon-size)}.el-tag .el-tag__close{margin-left:6px}.el-tag--dark{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3);--el-tag-text-color:var(--el-color-white)}.el-tag--dark.el-tag--primary{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3)}.el-tag--dark.el-tag--success{--el-tag-bg-color:var(--el-color-success);--el-tag-border-color:var(--el-color-success);--el-tag-hover-color:var(--el-color-success-light-3)}.el-tag--dark.el-tag--warning{--el-tag-bg-color:var(--el-color-warning);--el-tag-border-color:var(--el-color-warning);--el-tag-hover-color:var(--el-color-warning-light-3)}.el-tag--dark.el-tag--danger{--el-tag-bg-color:var(--el-color-danger);--el-tag-border-color:var(--el-color-danger);--el-tag-hover-color:var(--el-color-danger-light-3)}.el-tag--dark.el-tag--error{--el-tag-bg-color:var(--el-color-error);--el-tag-border-color:var(--el-color-error);--el-tag-hover-color:var(--el-color-error-light-3)}.el-tag--dark.el-tag--info{--el-tag-bg-color:var(--el-color-info);--el-tag-border-color:var(--el-color-info);--el-tag-hover-color:var(--el-color-info-light-3)}.el-tag--dark.el-tag--primary,.el-tag--dark.el-tag--success,.el-tag--dark.el-tag--warning,.el-tag--dark.el-tag--danger,.el-tag--dark.el-tag--error,.el-tag--dark.el-tag--info{--el-tag-text-color:var(--el-color-white)}.el-tag--plain{--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary);--el-tag-bg-color:var(--el-fill-color-blank)}.el-tag--plain.el-tag--primary{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary)}.el-tag--plain.el-tag--success{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-success-light-5);--el-tag-hover-color:var(--el-color-success)}.el-tag--plain.el-tag--warning{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-warning-light-5);--el-tag-hover-color:var(--el-color-warning)}.el-tag--plain.el-tag--danger{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-danger-light-5);--el-tag-hover-color:var(--el-color-danger)}.el-tag--plain.el-tag--error{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-error-light-5);--el-tag-hover-color:var(--el-color-error)}.el-tag--plain.el-tag--info{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-info-light-5);--el-tag-hover-color:var(--el-color-info)}.el-tag.is-closable{padding-right:5px}.el-tag--large{padding:0 11px;height:32px;--el-icon-size:16px}.el-tag--large .el-tag__close{margin-left:8px}.el-tag--large.is-closable{padding-right:7px}.el-tag--small{padding:0 7px;height:20px;--el-icon-size:12px}.el-tag--small .el-tag__close{margin-left:4px}.el-tag--small.is-closable{padding-right:3px}.el-tag--small .el-icon-close{transform:scale(.8)}.el-tag.el-tag--primary.is-hit{border-color:var(--el-color-primary)}.el-tag.el-tag--success.is-hit{border-color:var(--el-color-success)}.el-tag.el-tag--warning.is-hit{border-color:var(--el-color-warning)}.el-tag.el-tag--danger.is-hit{border-color:var(--el-color-danger)}.el-tag.el-tag--error.is-hit{border-color:var(--el-color-error)}.el-tag.el-tag--info.is-hit{border-color:var(--el-color-info)}.el-text{--el-text-font-size:var(--el-font-size-base);--el-text-color:var(--el-text-color-regular)}.el-text{align-self:center;margin:0;padding:0;font-size:var(--el-text-font-size);color:var(--el-text-color);word-break:break-all}.el-text.is-truncated{display:inline-block;max-width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.el-text--large{--el-text-font-size:var(--el-font-size-medium)}.el-text--default{--el-text-font-size:var(--el-font-size-base)}.el-text--small{--el-text-font-size:var(--el-font-size-extra-small)}.el-text.el-text--primary{--el-text-color:var(--el-color-primary)}.el-text.el-text--success{--el-text-color:var(--el-color-success)}.el-text.el-text--warning{--el-text-color:var(--el-color-warning)}.el-text.el-text--danger{--el-text-color:var(--el-color-danger)}.el-text.el-text--error{--el-text-color:var(--el-color-error)}.el-text.el-text--info{--el-text-color:var(--el-color-info)}.el-text>.el-icon{vertical-align:-2px}.time-select{margin:5px 0;min-width:0}.time-select .el-picker-panel__content{max-height:200px;margin:0}.time-select-item{padding:8px 10px;font-size:14px;line-height:20px}.time-select-item.disabled{color:var(--el-datepicker-border-color);cursor:not-allowed}.time-select-item:hover{background-color:var(--el-fill-color-light);font-weight:700;cursor:pointer}.time-select .time-select-item.selected:not(.disabled){color:var(--el-color-primary);font-weight:700}.el-timeline-item{position:relative;padding-bottom:20px}.el-timeline-item__wrapper{position:relative;padding-left:28px;top:-3px}.el-timeline-item__tail{position:absolute;left:4px;height:100%;border-left:2px solid var(--el-timeline-node-color)}.el-timeline-item .el-timeline-item__icon{color:var(--el-color-white);font-size:var(--el-font-size-small)}.el-timeline-item__node{position:absolute;background-color:var(--el-timeline-node-color);border-color:var(--el-timeline-node-color);border-radius:50%;box-sizing:border-box;display:flex;justify-content:center;align-items:center}.el-timeline-item__node--normal{left:-1px;width:var(--el-timeline-node-size-normal);height:var(--el-timeline-node-size-normal)}.el-timeline-item__node--large{left:-2px;width:var(--el-timeline-node-size-large);height:var(--el-timeline-node-size-large)}.el-timeline-item__node.is-hollow{background:var(--el-color-white);border-style:solid;border-width:2px}.el-timeline-item__node--primary{background-color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-timeline-item__node--success{background-color:var(--el-color-success);border-color:var(--el-color-success)}.el-timeline-item__node--warning{background-color:var(--el-color-warning);border-color:var(--el-color-warning)}.el-timeline-item__node--danger{background-color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-timeline-item__node--info{background-color:var(--el-color-info);border-color:var(--el-color-info)}.el-timeline-item__dot{position:absolute;display:flex;justify-content:center;align-items:center}.el-timeline-item__content{color:var(--el-text-color-primary)}.el-timeline-item__timestamp{color:var(--el-text-color-secondary);line-height:1;font-size:var(--el-font-size-small)}.el-timeline-item__timestamp.is-top{margin-bottom:8px;padding-top:4px}.el-timeline-item__timestamp.is-bottom{margin-top:8px}.el-timeline{--el-timeline-node-size-normal:12px;--el-timeline-node-size-large:14px;--el-timeline-node-color:var(--el-border-color-light)}.el-timeline{margin:0;font-size:var(--el-font-size-base);list-style:none}.el-timeline .el-timeline-item:last-child .el-timeline-item__tail{display:none}.el-timeline .el-timeline-item__center{display:flex;align-items:center}.el-timeline .el-timeline-item__center .el-timeline-item__wrapper{width:100%}.el-timeline .el-timeline-item__center .el-timeline-item__tail{top:0}.el-timeline .el-timeline-item__center:first-child .el-timeline-item__tail{height:calc(50% + 10px);top:calc(50% - 10px)}.el-timeline .el-timeline-item__center:last-child .el-timeline-item__tail{display:block;height:calc(50% - 10px)}.el-tooltip-v2__content{--el-tooltip-v2-padding:5px 10px;--el-tooltip-v2-border-radius:4px;--el-tooltip-v2-border-color:var(--el-border-color);border-radius:var(--el-tooltip-v2-border-radius);color:var(--el-color-black);background-color:var(--el-color-white);padding:var(--el-tooltip-v2-padding);border:1px solid var(--el-border-color)}.el-tooltip-v2__arrow{position:absolute;color:var(--el-color-white);width:var(--el-tooltip-v2-arrow-width);height:var(--el-tooltip-v2-arrow-height);pointer-events:none;left:var(--el-tooltip-v2-arrow-x);top:var(--el-tooltip-v2-arrow-y)}.el-tooltip-v2__arrow:before{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__arrow:after{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow{bottom:0}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:before{border-top-color:var(--el-color-white);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:after{border-top-color:var(--el-border-color);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:100%;z-index:-1}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow{top:0}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:before{border-bottom-color:var(--el-color-white);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:after{border-bottom-color:var(--el-border-color);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:100%;z-index:-1}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow{right:0}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:before{border-left-color:var(--el-color-white);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:after{border-left-color:var(--el-border-color);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:100%;z-index:-1}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow{left:0}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:before{border-right-color:var(--el-color-white);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:after{border-right-color:var(--el-border-color);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:100%;z-index:-1}.el-tooltip-v2__content.is-dark{--el-tooltip-v2-border-color:transparent;background-color:var(--el-color-black);color:var(--el-color-white);border-color:transparent}.el-tooltip-v2__content.is-dark .el-tooltip-v2__arrow{background-color:var(--el-color-black);border-color:transparent}.el-transfer{--el-transfer-border-color:var(--el-border-color-lighter);--el-transfer-border-radius:var(--el-border-radius-base);--el-transfer-panel-width:200px;--el-transfer-panel-header-height:40px;--el-transfer-panel-header-bg-color:var(--el-fill-color-light);--el-transfer-panel-footer-height:40px;--el-transfer-panel-body-height:278px;--el-transfer-item-height:30px;--el-transfer-filter-height:32px}.el-transfer{font-size:var(--el-font-size-base)}.el-transfer__buttons{display:inline-block;vertical-align:middle;padding:0 30px}.el-transfer__button{vertical-align:top}.el-transfer__button:nth-child(2){margin:0 0 0 10px}.el-transfer__button i,.el-transfer__button span{font-size:14px}.el-transfer__button .el-icon+span{margin-left:0}.el-transfer-panel{overflow:hidden;background:var(--el-bg-color-overlay);display:inline-block;text-align:left;vertical-align:middle;width:var(--el-transfer-panel-width);max-height:100%;box-sizing:border-box;position:relative}.el-transfer-panel__body{height:var(--el-transfer-panel-body-height);border-left:1px solid var(--el-transfer-border-color);border-right:1px solid var(--el-transfer-border-color);border-bottom:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius);overflow:hidden}.el-transfer-panel__body.is-with-footer{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.el-transfer-panel__list{margin:0;padding:6px 0;list-style:none;height:var(--el-transfer-panel-body-height);overflow:auto;box-sizing:border-box}.el-transfer-panel__list.is-filterable{height:calc(100% - var(--el-transfer-filter-height) - 30px);padding-top:0}.el-transfer-panel__item{height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding-left:15px;display:block!important}.el-transfer-panel__item+.el-transfer-panel__item{margin-left:0}.el-transfer-panel__item.el-checkbox{color:var(--el-text-color-regular)}.el-transfer-panel__item:hover{color:var(--el-color-primary)}.el-transfer-panel__item.el-checkbox .el-checkbox__label{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;box-sizing:border-box;padding-left:22px;line-height:var(--el-transfer-item-height)}.el-transfer-panel__item .el-checkbox__input{position:absolute;top:8px}.el-transfer-panel__filter{text-align:center;padding:15px;box-sizing:border-box}.el-transfer-panel__filter .el-input__inner{height:var(--el-transfer-filter-height);width:100%;font-size:12px;display:inline-block;box-sizing:border-box;border-radius:calc(var(--el-transfer-filter-height)/ 2)}.el-transfer-panel__filter .el-icon-circle-close{cursor:pointer}.el-transfer-panel .el-transfer-panel__header{display:flex;align-items:center;height:var(--el-transfer-panel-header-height);background:var(--el-transfer-panel-header-bg-color);margin:0;padding-left:15px;border:1px solid var(--el-transfer-border-color);border-top-left-radius:var(--el-transfer-border-radius);border-top-right-radius:var(--el-transfer-border-radius);box-sizing:border-box;color:var(--el-color-black)}.el-transfer-panel .el-transfer-panel__header .el-checkbox{position:relative;display:flex;width:100%;align-items:center}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label{font-size:16px;color:var(--el-text-color-primary);font-weight:400}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label span{position:absolute;right:15px;top:50%;transform:translate3d(0,-50%,0);color:var(--el-text-color-secondary);font-size:12px;font-weight:400}.el-transfer-panel .el-transfer-panel__footer{height:var(--el-transfer-panel-footer-height);background:var(--el-bg-color-overlay);margin:0;padding:0;border:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius)}.el-transfer-panel .el-transfer-panel__footer:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-transfer-panel .el-transfer-panel__footer .el-checkbox{padding-left:20px;color:var(--el-text-color-regular)}.el-transfer-panel .el-transfer-panel__empty{margin:0;height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding:6px 15px 0;color:var(--el-text-color-secondary);text-align:center}.el-transfer-panel .el-checkbox__label{padding-left:8px}.el-transfer-panel .el-checkbox__inner{height:14px;width:14px;border-radius:3px}.el-transfer-panel .el-checkbox__inner:after{height:6px;width:3px;left:4px}.el-tree{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree{position:relative;cursor:default;background:var(--el-fill-color-blank);color:var(--el-tree-text-color);font-size:var(--el-font-size-base)}.el-tree__empty-block{position:relative;min-height:60px;text-align:center;width:100%;height:100%}.el-tree__empty-text{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:var(--el-text-color-secondary);font-size:var(--el-font-size-base)}.el-tree__drop-indicator{position:absolute;left:0;right:0;height:1px;background-color:var(--el-color-primary)}.el-tree-node{white-space:nowrap;outline:0}.el-tree-node:focus>.el-tree-node__content{background-color:var(--el-tree-node-hover-bg-color)}.el-tree-node.is-drop-inner>.el-tree-node__content .el-tree-node__label{background-color:var(--el-color-primary);color:#fff}.el-tree-node__content{display:flex;align-items:center;height:26px;cursor:pointer}.el-tree-node__content>.el-tree-node__expand-icon{padding:6px;box-sizing:content-box}.el-tree-node__content>label.el-checkbox{margin-right:8px}.el-tree-node__content:hover{background-color:var(--el-tree-node-hover-bg-color)}.el-tree.is-dragging .el-tree-node__content{cursor:move}.el-tree.is-dragging .el-tree-node__content *{pointer-events:none}.el-tree.is-dragging.is-drop-not-allow .el-tree-node__content{cursor:not-allowed}.el-tree-node__expand-icon{cursor:pointer;color:var(--el-tree-expand-icon-color);font-size:12px;transform:rotate(0);transition:transform var(--el-transition-duration) ease-in-out}.el-tree-node__expand-icon.expanded{transform:rotate(90deg)}.el-tree-node__expand-icon.is-leaf{color:transparent;cursor:default}.el-tree-node__expand-icon.is-hidden{visibility:hidden}.el-tree-node__loading-icon{margin-right:8px;font-size:var(--el-font-size-base);color:var(--el-tree-expand-icon-color)}.el-tree-node>.el-tree-node__children{overflow:hidden;background-color:transparent}.el-tree-node.is-expanded>.el-tree-node__children{display:block}.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:var(--el-color-primary-light-9)}.el-tree-select{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree-select__popper .el-tree-node__expand-icon{margin-left:8px}.el-tree-select__popper .el-tree-node.is-checked>.el-tree-node__content .el-select-dropdown__item.selected:after{content:none}.el-tree-select__popper .el-select-dropdown__item{flex:1;background:0 0!important;padding-left:0;height:20px;line-height:20px}.el-upload{--el-upload-dragger-padding-horizontal:40px;--el-upload-dragger-padding-vertical:10px}.el-upload{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;outline:0}.el-upload__input{display:none}.el-upload__tip{font-size:12px;color:var(--el-text-color-regular);margin-top:7px}.el-upload iframe{position:absolute;z-index:-1;top:0;left:0;opacity:0}.el-upload--picture-card{--el-upload-picture-card-size:148px;background-color:var(--el-fill-color-lighter);border:1px dashed var(--el-border-color-darker);border-radius:6px;box-sizing:border-box;width:var(--el-upload-picture-card-size);height:var(--el-upload-picture-card-size);cursor:pointer;vertical-align:top;display:inline-flex;justify-content:center;align-items:center}.el-upload--picture-card i{font-size:28px;color:var(--el-text-color-secondary)}.el-upload--picture-card:hover{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload.is-drag{display:block}.el-upload:focus{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload:focus .el-upload-dragger{border-color:var(--el-color-primary)}.el-upload-dragger{padding:var(--el-upload-dragger-padding-horizontal) var(--el-upload-dragger-padding-vertical);background-color:var(--el-fill-color-blank);border:1px dashed var(--el-border-color);border-radius:6px;box-sizing:border-box;text-align:center;cursor:pointer;position:relative;overflow:hidden}.el-upload-dragger .el-icon--upload{font-size:67px;color:var(--el-text-color-placeholder);margin-bottom:16px;line-height:50px}.el-upload-dragger+.el-upload__tip{text-align:center}.el-upload-dragger~.el-upload__files{border-top:var(--el-border);margin-top:7px;padding-top:5px}.el-upload-dragger .el-upload__text{color:var(--el-text-color-regular);font-size:14px;text-align:center}.el-upload-dragger .el-upload__text em{color:var(--el-color-primary);font-style:normal}.el-upload-dragger:hover{border-color:var(--el-color-primary)}.el-upload-dragger.is-dragover{padding:calc(var(--el-upload-dragger-padding-horizontal) - 1px) calc(var(--el-upload-dragger-padding-vertical) - 1px);background-color:var(--el-color-primary-light-9);border:2px dashed var(--el-color-primary)}.el-upload-list{margin:10px 0 0;padding:0;list-style:none;position:relative}.el-upload-list__item{transition:all .5s cubic-bezier(.55,0,.1,1);font-size:14px;color:var(--el-text-color-regular);margin-bottom:5px;position:relative;box-sizing:border-box;border-radius:4px;width:100%}.el-upload-list__item .el-progress{position:absolute;top:20px;width:100%}.el-upload-list__item .el-progress__text{position:absolute;right:0;top:-13px}.el-upload-list__item .el-progress-bar{margin-right:0;padding-right:0}.el-upload-list__item .el-icon--upload-success{color:var(--el-color-success)}.el-upload-list__item .el-icon--close{display:none;position:absolute;right:5px;top:50%;cursor:pointer;opacity:.75;color:var(--el-text-color-regular);transition:opacity var(--el-transition-duration);transform:translateY(-50%)}.el-upload-list__item .el-icon--close:hover{opacity:1;color:var(--el-color-primary)}.el-upload-list__item .el-icon--close-tip{display:none;position:absolute;top:1px;right:5px;font-size:12px;cursor:pointer;opacity:1;color:var(--el-color-primary);font-style:normal}.el-upload-list__item:hover{background-color:var(--el-fill-color-light)}.el-upload-list__item:hover .el-icon--close{display:inline-flex}.el-upload-list__item:hover .el-progress__text{display:none}.el-upload-list__item .el-upload-list__item-info{display:inline-flex;justify-content:center;flex-direction:column;width:calc(100% - 30px);margin-left:4px}.el-upload-list__item.is-success .el-upload-list__item-status-label{display:inline-flex}.el-upload-list__item.is-success .el-upload-list__item-name:focus,.el-upload-list__item.is-success .el-upload-list__item-name:hover{color:var(--el-color-primary);cursor:pointer}.el-upload-list__item.is-success:focus:not(:hover) .el-icon--close-tip{display:inline-block}.el-upload-list__item.is-success:active,.el-upload-list__item.is-success:not(.focusing):focus{outline-width:0}.el-upload-list__item.is-success:active .el-icon--close-tip,.el-upload-list__item.is-success:not(.focusing):focus .el-icon--close-tip{display:none}.el-upload-list__item.is-success:focus .el-upload-list__item-status-label,.el-upload-list__item.is-success:hover .el-upload-list__item-status-label{display:none;opacity:0}.el-upload-list__item-name{color:var(--el-text-color-regular);display:inline-flex;text-align:center;align-items:center;padding:0 4px;transition:color var(--el-transition-duration);font-size:var(--el-font-size-base)}.el-upload-list__item-name .el-icon{margin-right:6px;color:var(--el-text-color-secondary)}.el-upload-list__item-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-upload-list__item-status-label{position:absolute;right:5px;top:0;line-height:inherit;display:none;height:100%;justify-content:center;align-items:center;transition:opacity var(--el-transition-duration)}.el-upload-list__item-delete{position:absolute;right:10px;top:0;font-size:12px;color:var(--el-text-color-regular);display:none}.el-upload-list__item-delete:hover{color:var(--el-color-primary)}.el-upload-list--picture-card{--el-upload-list-picture-card-size:148px;display:inline-flex;flex-wrap:wrap;margin:0}.el-upload-list--picture-card .el-upload-list__item{overflow:hidden;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;width:var(--el-upload-list-picture-card-size);height:var(--el-upload-list-picture-card-size);margin:0 8px 8px 0;padding:0;display:inline-flex}.el-upload-list--picture-card .el-upload-list__item .el-icon--check,.el-upload-list--picture-card .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture-card .el-upload-list__item .el-icon--close{display:none}.el-upload-list--picture-card .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:block}.el-upload-list--picture-card .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture-card .el-upload-list__item .el-upload-list__item-name{display:none}.el-upload-list--picture-card .el-upload-list__item-thumbnail{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.el-upload-list--picture-card .el-upload-list__item-status-label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture-card .el-upload-list__item-status-label i{font-size:12px;margin-top:11px;transform:rotate(-45deg)}.el-upload-list--picture-card .el-upload-list__item-actions{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;display:inline-flex;justify-content:center;align-items:center;color:#fff;opacity:0;font-size:20px;background-color:var(--el-overlay-color-lighter);transition:opacity var(--el-transition-duration)}.el-upload-list--picture-card .el-upload-list__item-actions span{display:none;cursor:pointer}.el-upload-list--picture-card .el-upload-list__item-actions span+span{margin-left:1rem}.el-upload-list--picture-card .el-upload-list__item-actions .el-upload-list__item-delete{position:static;font-size:inherit;color:inherit}.el-upload-list--picture-card .el-upload-list__item-actions:hover{opacity:1}.el-upload-list--picture-card .el-upload-list__item-actions:hover span{display:inline-flex}.el-upload-list--picture-card .el-progress{top:50%;left:50%;transform:translate(-50%,-50%);bottom:auto;width:126px}.el-upload-list--picture-card .el-progress .el-progress__text{top:50%}.el-upload-list--picture .el-upload-list__item{overflow:hidden;z-index:0;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;margin-top:10px;padding:10px;display:flex;align-items:center}.el-upload-list--picture .el-upload-list__item .el-icon--check,.el-upload-list--picture .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:inline-flex}.el-upload-list--picture .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name i{display:none}.el-upload-list--picture .el-upload-list__item .el-icon--close{top:5px;transform:translateY(0)}.el-upload-list--picture .el-upload-list__item-thumbnail{display:inline-flex;justify-content:center;align-items:center;width:70px;height:70px;-o-object-fit:contain;object-fit:contain;position:relative;z-index:1;background-color:var(--el-color-white)}.el-upload-list--picture .el-upload-list__item-status-label{position:absolute;right:-17px;top:-7px;width:46px;height:26px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture .el-upload-list__item-status-label i{font-size:12px;margin-top:12px;transform:rotate(-45deg)}.el-upload-list--picture .el-progress{position:relative;top:-7px}.el-upload-cover{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;z-index:10;cursor:default}.el-upload-cover:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-upload-cover img{display:block;width:100%;height:100%}.el-upload-cover__label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-cover__label i{font-size:12px;margin-top:11px;transform:rotate(-45deg);color:#fff}.el-upload-cover__progress{display:inline-block;vertical-align:middle;position:static;width:243px}.el-upload-cover__progress+.el-upload__inner{opacity:0}.el-upload-cover__content{position:absolute;top:0;left:0;width:100%;height:100%}.el-upload-cover__interact{position:absolute;bottom:0;left:0;width:100%;height:100%;background-color:var(--el-overlay-color-light);text-align:center}.el-upload-cover__interact .btn{display:inline-block;color:#fff;font-size:14px;cursor:pointer;vertical-align:middle;transition:var(--el-transition-md-fade);margin-top:60px}.el-upload-cover__interact .btn i{margin-top:0}.el-upload-cover__interact .btn span{opacity:0;transition:opacity .15s linear}.el-upload-cover__interact .btn:not(:first-child){margin-left:35px}.el-upload-cover__interact .btn:hover{transform:translateY(-13px)}.el-upload-cover__interact .btn:hover span{opacity:1}.el-upload-cover__interact .btn i{color:#fff;display:block;font-size:24px;line-height:inherit;margin:0 auto 5px}.el-upload-cover__title{position:absolute;bottom:0;left:0;background-color:#fff;height:36px;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400;text-align:left;padding:0 10px;margin:0;line-height:36px;font-size:14px;color:var(--el-text-color-primary)}.el-upload-cover+.el-upload__inner{opacity:0;position:relative;z-index:1}.el-vl__wrapper{position:relative}.el-vl__wrapper:hover .el-virtual-scrollbar,.el-vl__wrapper.always-on .el-virtual-scrollbar{opacity:1}.el-vl__window{scrollbar-width:none}.el-vl__window::-webkit-scrollbar{display:none}.el-virtual-scrollbar{opacity:0;transition:opacity .34s ease-out}.el-virtual-scrollbar.always-on{opacity:1}.el-vg__wrapper{position:relative}.el-popper{--el-popper-border-radius:var(--el-popover-border-radius, 4px)}.el-popper{position:absolute;border-radius:var(--el-popper-border-radius);padding:5px 11px;z-index:2000;font-size:12px;line-height:20px;min-width:10px;word-wrap:break-word;visibility:visible}.el-popper.is-dark{color:var(--el-bg-color);background:var(--el-text-color-primary);border:1px solid var(--el-text-color-primary)}.el-popper.is-dark .el-popper__arrow:before{border:1px solid var(--el-text-color-primary);background:var(--el-text-color-primary);right:0}.el-popper.is-light{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light)}.el-popper.is-light .el-popper__arrow:before{border:1px solid var(--el-border-color-light);background:var(--el-bg-color-overlay);right:0}.el-popper.is-pure{padding:0}.el-popper__arrow{position:absolute;width:10px;height:10px;z-index:-1}.el-popper__arrow:before{position:absolute;width:10px;height:10px;z-index:-1;content:" ";transform:rotate(45deg);background:var(--el-text-color-primary);box-sizing:border-box}.el-popper[data-popper-placement^=top]>.el-popper__arrow{bottom:-5px}.el-popper[data-popper-placement^=top]>.el-popper__arrow:before{border-bottom-right-radius:2px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow{top:-5px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow:before{border-top-left-radius:2px}.el-popper[data-popper-placement^=left]>.el-popper__arrow{right:-5px}.el-popper[data-popper-placement^=left]>.el-popper__arrow:before{border-top-right-radius:2px}.el-popper[data-popper-placement^=right]>.el-popper__arrow{left:-5px}.el-popper[data-popper-placement^=right]>.el-popper__arrow:before{border-bottom-left-radius:2px}.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent!important;border-left-color:transparent!important}.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent!important;border-right-color:transparent!important}.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent!important;border-bottom-color:transparent!important}.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent!important;border-top-color:transparent!important}.el-select-dropdown__item{font-size:var(--el-font-size-base);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__item.hover,.el-select-dropdown__item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown__item.selected{color:var(--el-color-primary);font-weight:700}.el-statistic{--el-statistic-title-font-weight:400;--el-statistic-title-font-size:var(--el-font-size-extra-small);--el-statistic-title-color:var(--el-text-color-regular);--el-statistic-content-font-weight:400;--el-statistic-content-font-size:var(--el-font-size-extra-large);--el-statistic-content-color:var(--el-text-color-primary)}.el-statistic__head{font-weight:var(--el-statistic-title-font-weight);font-size:var(--el-statistic-title-font-size);color:var(--el-statistic-title-color);line-height:20px;margin-bottom:4px}.el-statistic__content{font-weight:var(--el-statistic-content-font-weight);font-size:var(--el-statistic-content-font-size);color:var(--el-statistic-content-color)}.el-statistic__value{display:inline-block}.el-statistic__prefix{margin-right:4px;display:inline-block}.el-statistic__suffix{margin-left:4px;display:inline-block}.el-button{height:32rem!important;padding:8rem 15rem!important;font-size:14rem!important}.el-input__wrapper{padding:1rem 11rem!important}.el-input{height:32rem!important;font-size:14rem!important}.jt-wall-row .col-left{font-size:14rem!important}.el-color-picker__trigger{height:32rem!important;padding:4rem!important}.el-radio-button__inner{padding:8rem 15rem!important;font-size:14rem}.el-textarea__inner{padding:5rem 11rem!important;font-size:14rem}.el-input__inner{height:32rem!important;font-size:14rem!important}.jt-wall-row{display:flex;flex-direction:row;height:40rem;align-items:center}.jt-wall-row .col-left{display:flex;align-items:center;justify-content:right;width:60rem;font-family:Alimama_ShuHeiTi_Bold;font-weight:700;margin-right:8rem}.jt-wall-row .col-main{flex:1;display:flex;flex-direction:row}.jt-wall-row .col-main .el-input--suffix{background-color:#fff0}.jt-wall-row .col-main .el-input--suffix *{background-color:#fff0;color:#fff}.jt-wall-row .col-main .el-input-number__decrease,.jt-wall-row .col-main .el-input-number__increase{background-color:#3489ff;color:#fff}.jt-wall-dialog{pointer-events:none}.jt-wall-dialog .el-dialog{pointer-events:auto;position:absolute!important;background:rgba(5,45,155,.7);min-width:280rem;overflow:hidden;margin-top:0rem}.jt-wall-dialog .el-dialog .el-dialog__header{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyCAIAAAD9fhrKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo4NTc1YTY2Yi1hY2U5LTUyNDctODM5MS01MGJjMjM4MDkxMDkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDY4MTUxMzk2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDY4MTUxMzg2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YjZlNTUzODYtMzRjZC02NDQyLWI4OTktODY4YTdiYTNkMzgyIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjg1NzVhNjZiLWFjZTktNTI0Ny04MzkxLTUwYmMyMzgwOTEwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Po+VQtwAACdUSURBVHja7H1bluM4kiUMfEjuHpFZtY4+/TGLmQ3MmTMbnf1MdUX6QyIJ2MAAAjC8+JB7ZHZXh7LKQ6IoECSBy2sXFwb4/X/+X2FfEqDv5dh35mXeC+k2CzD/+XfxL72BeVbv04KI7uP6ByD7pZTy6ToMnUTwv3f7rgWG/cNXrhz7AcVtUfOiwP/kOg6mLGRVoq1JUewjsAoLWJQ2RdlTg7CD+y+eJW3MziVU1dfK/wV2LIhXJpQJ/nQhOUFWWxDJRYjnwnfItkB2Z8w/yC7sr9fnXpj8Y/9d27hw/2D4zm/0/4V92EcRtq+bMP9J+AX98UdadxN8oy/D/tXdBeWAvsBQM7/FvwklxzemJ0xyfrflu6JG1T+Hc1mrhKEA/wfTQ9BfAD119x9Ca2R1ZjuEqwdq/Kb7C9vO3oQzZJ9AKdAzqDuoGVC5r3r3j8Gp62XoJaT9g3WBDK3crwwIdfB+mxUmyJP0HXNGAj/uM1zNQWTs8MChMOvJEQYMuDxdepBAQGM7810t2MHIioItnEqwbOx66GBadMSXHHQiCgBHFmDV8h+rJcQPEUaLk+WIFi5YDnyQXPoUs0R+oyTfEWvdkKFaskPYju0t1RLCDrxM/luoHejIm+0qbZ9g6+P2/snOBWDRQVPAggLOgMEBFRh7PoY+DPaJvUIYIvjeb3eG9b39tH6zFoL0Q9eHzVt6A1qOKMdYE7cD+lsBDCtdya7B2QINBEj1YZqMxSAwIKL7J3DVdI0WHbWgY4HdyIp2Z7d+lvreTa+hfHep/M/ZhZS9Gr7pbthqXsmtsdXpepS9MHXTi5xf5XIzX3XXf/tfBkmer2MHkPKdGr0SOckyXGzoO60IYIGBUcEdYFZKSuikFMBLT7pxQprYwXrifAZwtfto3pi9bVEcXVKSVcKtPYT5lSnMlOAaQMKKUobEv2UXF9a7kx4vbkRWnGsxAKxnAIRnrPAtg9FFYM8l93Pg/YA9A31zZCeJfOOBv3znykOv2KG6W/YVpu+xtlHUjlvWXGzu3Dqd6rflx/ZRkH+0vEFofssYCXAbtSNB7O6gxylGfNhRGFFJOdT6jbbFR4jEcHa4EqKrlkOsD2LKs2J9AlGKdVtucv4I9TdQpftrrH88BUSO3QVHI7RaboRWiJW7zy+zoW/jd4Ie0b472y+Q2F+AwHXuXv79f39/GiHr3pCgXQpSxaMeYOx7cxYGBHIKkHIKQhxJ6MOimxQI25jVdWBCy0Up941DSE4JAfKQtUURDcqawrT21YUUnVHkUVoJfByheE0DCGLysIiwkiEX6zwZctkHb3JHofU0ivee7aJx/QoxOTT6b2OVMCmE/0RU0SctOfsqnOz6rS9KszI5Umh2dJHWNjsFXSsw+7nIcCEtKuys2VfILxcWwIf8TdGrI3wxQpQHU/zi5JEjD8HWclhMxX4ecMHgi4ZesOgyBGsZWokCrWD5kPM9otXwbOLK9OphesYiOWvWFA3qddNbivHFc81iq7r8ZrrvJ2Jz/zjuRqnuvQm46rtmsFO0Yaql4w7U4fH5YuJD+JiWsB3Dj9HRYdp0J81LGE7nySMmPZfxflbAemw6wGW42RLMj+bZHEtcL1145NmiPEMWGKmNAwOMkYchZyaenRYiWmgpLx0xcGfXrjwXdMw5xSG/3ZJ/5LKXa0D++I4+R9gKVwwtuVrpNzj6HS7syt/Fuj+E5ghJAAblHeFxG2rhzyWNfgRrZ2HPNDDCVjQm2P4ltPk9kZUfRRmssXRMgzGIhftL7zdCpBuClYxYi02LC7KWwK+JSH4Yj5tEhZiyjLwfBaiq4lSKGonKgzUBK5xdQr5C9wfT/5HCfx5vJhcRkQtYKVrN77BMnjtJPT5pGHK4LCCKHSBidDe/rzQt2S+7CEINL4bBsX7XiNURcTdot5/18NIPXVfiFK8GNB/tGZYhiWBSvt/n8gnN7+9kEccCJSSH4Ai4fsG+stU3BzDI+OEPMS/K7GXgz0foAf6wgVkiYIkJMk2F7/NimBayADDClrZIJDCHLUQBGTdCcKAsPXcKWqODsqABuJPFJApGpx+sskHE20jmINK6KFuAbxvgmR2cCoTE3le5KAoeODNymG7ZKP/IcbdjNrEZTmzVfzMaySEojcE3QeokTnEoYVCFCSxGAT4e3uCU7i/oxMokDCzQKq8MFeTRyv1OquEZoU/pURFgisp1oFhnfiWaxgYCkkEGH8SZMJDi1kBadlvEEcol+x6q4tQ2TwMGw8ClHzF2snu6vN0nFx4mwOUAyILQNNPY4tN1WKUeKDAr/Cj/Cg3QPBnMmhxm4bKoD1PUSML8SmcCZmCmC+dUCwizumlWobYFbEWUs3o8psoXijTeElqsCBeCVE+4wFcEIQsVg9IZNC3hyZhgI7AY1LUVv9KWFJhM/SZioY23iHN1O6bsJGd2lS1VZra/AzY0/HatTsQXG6Vl75MOhoySNjhIHlCzvq6xxMEmVCXH4sSms9wKMmLFeA0bHMxEK9Nl5jehZrEerTM8BUHmaIU5WvHzCvWW06u0NC2pJSZohXJQw3eUXfOZggX1wYMwhn1xU2EfqjZfHYhv1/F9MhGbZjw9xIkrAM0GJG6zoUs5ZhUHRR+PhWCKMGscDDlaNPUUgzcf9+V6IUVLJFSLUSp+ahC3m/9f+v6+UHDoQ9EYCAewWu81rILXyrY4cYMkdHfEyjNNYONMPOLDVd3L1MqVeWGmSqVgiyJ1j2AYptSYtACA2Haz94jN1gOprhSLFbEThhIAErkEIO7TIkOhwPA3+6EQ9cNhUUnEdAvW+0A4SnYdmCiZGhdwHfZCkTMpjlDZD9t8KtlFp+4ATNSuyJjcc1T2KC/rOGQmtIs04uc7uC+0MtxK6GVFFei14VY0QFiEfZipdpiVCajl/RXU1Azi7DaS2HoCRNzlVOmFzTt949XvwlMlKqzoWYnqZIDjZRxvcrkZJiWYkuUwa90NDUi836fn67h2X4dZWHKi+JMANJIMWf1tMphlbj4obTFr7GjokGNSEo95LMIUtgAvfTct2haFERQgYAF6FuMxCDzaoR+rDvQOfIQc+6Af0XaCFPjWYDvV+pEPVmCizfvxv3DqfqgA07sb9sRjARdgfVS/UoLHR31svBBwn/aHa8WPlf8Q07rh1pM6KZBHytXSMB1cx1z+YnQoFYOygQjMhB6RGaZ4ed6jkIRgmuNUihYrWg0erdoxYM7+AlotFAnqZQUxOej+2QNfDa0QK5aOiFZ/gKVp6eGTM9Xjt5UJihpdrYfsFbjKHxWHAAtqStYeyUKv0Zj+dB36DoCcpVHAQd+DV2xaFnz7mEyIZ5AmpeWV2DCQHS8rCcOzDGaZkI7uDmEW6Vl2FBIjI8mU+IxFetgiRZ94n2LUA1Cu5peAm8IjUgA17nnx7qqIXLGXeG0fU9sHYm5eozMNJg9kmldiOsn516qC4TGjS/JgwEQWxYY0iqWqDbVYK2tnpddKJPeCl4O1nbG0TImKmSyOdWJxUuXZ8aFMVp9Ej6/7G3MWUIv4ivFELH7H+UsyIBf0b3qZzt8NmPC1TaiKLlZBZkuDVqjWAcFuxP4pRSseyWJlWNAfjmxQ0ysQTcvFdX6t1OW3fMyxQZ8OhO/YstLtM6xtLEuCAshgEkcDWXbo0KBJMnDDBHIb0M3Xceh7mQwacg0+CEAx1lsDNYN1Xn2nb2/3ZRz70WEWRHaUR4jZaVgY6SU5/KdZRRjSvDH7wUR/wyCQJe/bWI9WQ66oka8RIUMAiD67YDFksV6ira3UD6E+BhLHBDBvIomCE4Ij1vigaFbY3hh/y0+zRLBsH5Ect8nUjo0MZKcTY3NMj4gN8QsTXplrzFgPUhKvQC42p0JVWVobpxjbWiFNWrOVzmkIYhEAZo4EZw1dPhC1R6sLmv8hVAc9c90qPTUTA8r5DbQSVZP/GjF1epXYGSVtaZen4WsHsA4oVbgl0kc6Zv8MUkrrRZiUghSzwqGUJiv8FXuac4NxxKuCWVl4aPe72LlE93mxCIP3aca+uww976xHYMsAUkeeMhMeLkyLYtw1nUyUMAQdmVGIFpPBO0g4R2YchsTXtQ5HYsmngY0JZJxLeDK4WiYgC+fdxvVvwTggMW/7UNmF6aLYjuxYfh+Moj/E5p55rzBy8Ky1MLkwfw85ugh+UrGqaRzBL0V5IhBHNzBUOF6ZFmxhJU5JFHRRM3ChyKV0kUlOLFa0rZogBvpV6joCVWzqDCw3WO4GrcRqtnrScvScvDaMkGIU307AZ2mawIo1awW6/qJ6O+aYjH4WV6+lTNQC9w0w6wvqdHjcBWqerHwECq0MDzS9ZobJYgp3ZoEnSuZBcrPB42iBJlItZM5xfmUhkhZYA7r+Ns3OFzUtNPPIY9YGbHE6sApMvZ1UeafpRrhq2SH049okePiARMLw4lIAL2+CwGAYxSihQxwKTQbbgJ011EZTEmoAcVQxzo7wY4eiFo1gHtIhYh7YAVblTxRYcehAnYwgYJPwM+kzfx/tEsmbvLbpr4oZfuifDeysoer+wvwnDfE3g5u8f2Y6OvPclsyljPKCkkWRoOhyt0DFXZXSGdcXlg+DVqFwsi/IIYw9J7/dGBB0bUfdOppvqEVuTGWiVfesB6ptKwKsq1e1GL3p0jrAsKLWzW9wLmPhASeE35nG9WiqItzmmd/LBLNMQDfRCRPQ+EaZ+rASfYYNLNJbwiwraaEdXnHOCRNpMmBKzYIJT0oIlzWoyvuiHacOdxWCuB4mzMTJW4nOFWLGCF7pYBRzKXD+hWGnAsICPEM6oue9W7w34THCvTHf5SxZx5PbDz5Rsb3bkXrioYd2qz6lnbIYjShoVKmgi9b0acyIp30nSbSGrjL8V8BNIue75mDYkJoCoBDxkSNW5nLvo5UkT/yHcEpO6hwL2K/6b6K/rA6JClDhgYaHVVfABnj1BzlU3XNQkqzcDRBVGYrdCFTgY55pvJYZHSJh0po8oQ5ooPSOlkJLgAp6axDxeumtFZ5uyETWCXwaRyjHgJyzPM4ByglXJ+DSy7stAeIMU4xhIvg5oOEmQp6IghEBhBBCCREjx/wWOgTiJ4pMiq8RaEgTNZz1JW37m6pTnOEMhMGmEWx746PGmkdk2WzAZ2e0HUuUryBUVfAqQS3wF9nbSLDjc4MqlIr7DxjsyOkN1OIIEUppw7Qh82okgSd/yKVfyflNqpufv5Wq7KsPVSJNZh7Z3Kl8TAL3BpMfe/WfuvEbnsAc19ZJ3yOZ4ccPa9bkGBSAyZIjUtBX/3qCSpXRw2yH3lK526Jc+cus3jWNQoJzfmKpH6/IVRAuh1n95CxagkndGI0O6wgiJBHOqnuDV6OK0EzkdlAGupzeBh7lpHRZPLggxqxRAn+AFlV9KgcF8W0sOGhiP96yP9no8djVEJsUoKQPmDHcAqRSllZKQuQ5IPtCJ1JOk5ujcs+XC9A0KU1q9o/VTnWJqFSyqhaxstbQN7ncc6s741ZU1eEbTWbG2nAg7t2kDXp1GrCSYReoh4TbjyYW9jByxNUW4kHP43BfFhqP416H4KhEpOk7Gp+crbROtZpsy7C4a9/d7Pij2dcAzjtSUVIyACiTiTCsCFFXZxX9SSwmvgRgNIrxRwZegXn5CxbAy2teXCjn/IsBNwsMRRxQDUOWaazPGJmom+MqTKe1s6i5FHaHXDAxdjSfZAefbdtjO9sqRHV/qPgudmgjxqmKUNGxMm6CdUcRZrQMc5BiGKENBHQOrbASVWFuSk06vFYWrRYvufc2Euwy2wH3WGEWikZzAxVl0UpkM28i3HVXbcvPoRMrcWc9Kj/+9Dnnwzry5IQ2Zomq+LXyF8KUwZAheZ/mKOMB8PDQORWeiJJBMhWw9D2kwz8UgUthMOtu0MoG4d450TtbaUKpMoWLcS53LHPwsTO332b+g6hkIRTBMpefgcdqq8GCtTsoc/ghcNMApn6FypjgCvIC6mmudjnLKennBCU5ecQjT1k8+ZOW4HWcNmI+Oo9lbFUFstT/WTHxYq4cYTcSt0KZKWIlXytN8zZRFFlDPfe5rBK4LghdVgBmDIuK6pwEJnJraMA7pMnMV+2n9TTQCnG/gT3Ok0+EhFsToUVNzCoHiZidU4LBLJK0bjQrMEkesMIWwEqOKAuqDIbPQoxnT1X2OLVW+O4+WS+ozWxDVvih7zvws5UxyWNTm0kQQjea9oNioudYbpVKfVJ8XF9wR3Uy5TKQMiZrMU9DRClg4335nYYGSgFUmkU546r8Nkxtyaa5ZGUC7Nz96v6t7aIyKbV+lPIn6cDpVgnVw7X2wdzqpetDXylyYdkVOWyl7CiOsl3IyM5mHdVxKnMMrKN4s1wMWik/zc9wn6sFvtKBgQW3S6bjmKI6MlstCUtMJHZJLvZ+jLkLt9Fq+/nBc5N8FrCwkavveGBYbC80+FWutvP4ZCfHt/uEGvPgyB5LUeIr7CqD+QXbKgY3zR+DiQagboasadPs1IfWhmcNfZdoWJlchKkRwu9mqJ6JESfL+9bWHow/btoKBPk+72+BOsYLBd51EHP9CZ6lETMuloBYDIErwyDVprDdPrI5vVgkOWq9P/IIPVjO9semovRogYjtjRW2VSFVWCN+WAwL5mN03BNwNWhFG3RuW03izAwf3SieJoeUWHO6CdU/CWlzOeRDmY0AUGS2We2Cyhx2HHEzR7v8roNoVUrseKxl7KpX+ABgcR4koFQNEsxqznfnuVFCT8x+yNKzZVZk5hd9smb5vDLMLs/dAbnt3v4ldjarkAQFsOEVcbmrWrTL/mS0ye7vk4rPniwNRGqPggihMXrlwI18HDAHKEhd2lAMswtRptvHhgiFNcnpSBIF3EztUOYthk0hbEM/2tCnWukcoK277Ra7e5VEKyVKYbMSMQNaBZ5SM0FoDXp4sjmOM3cw1jTskrqhz4bqDi0RHPepCVVZYIiVM6P8CuPzmuU9y7EVjG8t/MdCad/RCo6hFZ4OCc8PIO8NG5eYdZvUnXIuhPAoWpjJDHXpx76LFwViGJVJrPlIov/e8CE7P9qlVKYg0TCudlDJ8CZNehXwC8Is1liLkGwP02uHmIOsiIlmipCk9HGJIidpYV/AChAkOUiTjIgs711mCYN0lLNIQ1oLlwW3rSTWxNp2URwUoTEqB7VsL1D0lXTkBCE95W37FbsgmOUmbJAsgaK0QebyFFZOByu2hyhKlOGeaKf6ZMRHw4D9C9lEcTE8S06vujcIOKSzeEoZqyqHU0NE+YSDpDmD2WIZ1K5VN/3Q3RNl46tEvXhC2dyXT/FhDasJPznuiE2exakWwywT6H3cab5OktvXN8K+k7Q6Tj4jmvdkyJNGBsnMZz2YFj3Ns7K4YOK5y2BFdxS5vsZM862Hc8gX6JKUQvZcTrCWJXthaQCAz5CJxApZsIciW0YIc7isdKZKVFjLebCT/a6aL6GWGXd3GgXUdJzyPWw0zloNoWa5Fzmgi329t9WxzgUplVwCmOdbqIANf5Dod+gvdtLMBkhhbXzAcy8YoAfKdaUXsUw03a9/CtOPMZsSVD/v5DsNF4NZ3fSHsGJWUn2tpDIHUoRZ0InD8nqJ4J/0pRxjWHjU0d4IHDDDLEN8XJaFJE+m7+WDW8JnYzA7S7fHx/j80/U2zwawHFEywHexqSO22l8ZWjKVyZRzV2omHwYKkSZ9BagkFUe+gg3E7HcpdeISdAWReQIErmQlEnLE3Gya3iMv/MS3x/cR5+1U+BPK3H7I46Z81p6+k/OxQujxd3ghkVsqaxaVB0Eqe2Bo0RHPwndKqqdMgW+yWwwVQoBK1dpQxeynvRq/Ww/qvWCUKOcPA4uqt8FsKwzcGhHG/cv+IGDt+WgSHf3Qz6O6ZEiKiQSVc/1DYByr/D0OPVkZoKmF1YplUAVonjS3ZVkIXOzSXkN3GX1i1Wpa8SQzShYJWkVT4X1Wi8s8k156nhVUlOv1IE+7VxqF0gm5KVEFwGRr1jSgblKqDMtycnTKCYXHrOdiM4dnS9jaaGDbrvcjVqwjRxENh1ruvMIkC01xZXErCMIKVPGWa5q+fpdEW+J0nJyLYK3HJ8I5YRaSt/2D0vVpO25oMCtbpWYTp/hhNPQ4fpMTgLpVfrvcpV7IimXqvE2jTyVmOOxceSQkPB0bhmtheMq83OcF+SoyEH95HbqrAxcshr22YCsSk2XBm4nc1LryoCnQzabO5ihB3gqbwa8piuA1DCqloniZHymP5yCBLpHYqlBUkoqKQn7HjTpCNjdxe07fWSfU2TmJu213e4mn4673I/U5mPm9PtbHODSyYBObqCU2+EbT1uCm/N0Is9zKXfVflzJ/VhqgzczXLR/W9X4HpZUT9RvCXAlVKcBKZTBr7uJiq5we6MWEjdrAljkEdIemamJtXtmW2vDJkPAx3T0Fl0Vpw1MmZ78sVFiyTQ09raZTldghs97Uqzk5CV+vdIfQqu8SjZytiZPKQ9kzdd3bxICGrPFlXIJ7NZtIA4xUlY2YLQ+RZrKCjWud5bfL3sY1Lb4+KPr1arCPkvI0o5qG36IeFS0zmIDOhFrdRbQTrOLm0hhIijjYbDAa1NQh6U0GB7cEsupEGj+mQY55w9+Wd9TlUdFimbKu92FniAPxAUf7YwyrETqJzdiwHCo2UKJMGOgn5XGvlX3XSfl06Ya+q1A2n4evrulCSMsviLstyolWPZBoZTX7QqHHVB1PleCgYZmazospcEGsqeDFslIY85pm05DrRIyFnGno1zDBQf4M2EjP8cCz5fO9G35m+X8BWNXPBkUtrKqB3J7PO0cKraV+050yoda6jncp7Vdni7LPWl7FADC909ChWqR+FR3BFgpZ54QNW1l4q4dn4hKL85TmR5XLjXyS4zMdt41Wpy82PgBYZ6bLb9vfHZTcbLKXPGSyb/uOsmX1UlbCTN4OIGUUTJNSdIh5nZloE4f6RMkF2c2MEal2HhoIha6TmgMZLBJyYmEyh4L05USswqegGjnklzcTs1p3B44/sHiEA5sL11eZelWmqu5/ZK345orxj76gfeiNyYQHw0aWB34/LK3pXFk3jhEomKck6HehFeUyZpLWIe+431XDKAbZza+gZ1vgm9XI7OzCwzjFi9X9BcDZHWZRRA9mY3f/Q/SuzrIJzQcHOg60gv44MLW+qpMsu4lWxpkWytvX8JTaAUGPVjG/diW3ZKbVBPVn1vo+LbNPwWxiwKdxoOmH22pXJtUzVFpIYrcqmEi9YZgDZco+sSRighsgdtOmQyaOQ1yTFFpaSQZtojqvqJiXgmxjdVXBZHSKz9sJBB8gtka2Q2Uwvz2T50S2qnLWULtwTGtbXTMxmdBbu0QHKMF2KpVKYFjrnLEeIafVTSpF4Vg3tPVEbFaHWkuvhu9SvIKdxgzzh8EsNbxg1MiwyYGwgriUV/7yrfNDh8U56lXS6l+i0i+OORjw6ODgkZDwXARQMqN50WsamYokj26yyxNN0gOBVb26mNaTA6JBFn2b5yBaDUP/vGr2KAAqFxfaiqmFuHnSVgXLGBmnL1AfWhJ1CzqKRk2iEgk5LysXXqjhWnEfYGM2S2aPxWxNp222EYxumoVFNYnmgUlBTQ5X3DinJCazTnGr8Gq1N/bE0hNbUiRo3sdC1cYd6G3zOJrZp/6gUIskLWhL+yV8+V1BquGbFNKuz2xiECdpvawZrNp8qv7coL49WLuDlMtH9daa7WCo3PBijWAHiBUbADuFWUcWoajj04aehda78GHgJNONg2nIoNXQPV+GZtNOO3nJuQykGGL1MS1hcayL9UM0L3uJGmn9tc3DdbNJnKHiVQ2F5E0tXdXmKJAxRoQbD+forirjTcECT8RzefV2Ap9jfOin6UWHdI1Thi98qFolHOoDkCRaeYLZt43RRr4GDS2r1S+pAlU3SDTwizALSYanoUOhlFR/iOHJurTkgcGFgsFBZzCLlkxf3vMUo+tk7KnTCw7fRHfRZXh4JBh8XMP6xEtR1lCS2JM6MBphut86ILg1fQxbQGPAS9tI826Xt6GpmTZpHy2fkyQ2SDt5uawmbx2UnXmenQoGdcjn+dmrpyYKrYy5w6pcCXfVQww+1a2ui4fUzUPyT4KPWJH095+HrX2SpSK+6JWtT5EVDnztyXz1sc9VBvER2N0FiLRYks8NBHQ81MJ2eZVy7EKE0i57o0mUn96sDP9sC9yoRusj0JLOVOA7CFXjerq7/9DDM5Dj4euxZQ+wiuG8xrfxtVjX0ryoFiOTkhZtNvRquxwhapqXAxdafpXSgLrfdlIaptb3sBHrVfwB7GLPBH8+dG3oDlUU8ws0ayhWOcuJD1ak5nwAYaOVAx7puzvi44EYP1mlAo49Dzf2Sd2bmKX4hXOaQ6N1NNa/SD+2ltIol7eoD0VUq3cojT3iQcirajqmdvNdmqZpuJKVtHD7oVWNU8nZAHJ6FZp6JSzW9jW+RNvXSdg1oSUtezC/0lhkRfgSNkWXUiNTzeoaIB5F+UcZViM29AIQpa8yYaBuNva+k08XP0Nwo6OCaA032MWi55CfyBT4fLVzbtLHbHuIh0MYwYC13S+6EbXBtk4BqbyYS0pBs2jEKNC8SblJO2eLmyu+PUZfHo65Ho7IPj8N6EvqeTz7YO74PXB8bPbJ0k5fy6jlJS39TxPf6f4iBGzDU7XZazni+BuN9Nn8fLTU4E0Jg1mmQISj15P7J8iaL+X0B+i53oDVvbstNoXWRZTDcY+ilXl1f/8f/+fQo7uJJS60x2kitEJs7mxw6sUm/dwOglrfart41/stHsKU9Xwdu2q0DBUqlNeZbPcktCFurrN4dBvDISzoVmNqFWD726zc/6KWpn/JF+7lLMd16cA85MS2nrWj5KAd8gM78bg+utLy2fuZ0pI4GhkdLM8y4aG6U5sysSHA+cCWfPVCjiZidQXW+og5xI26nuxESFL6uQcPoDobZ1biN7cManQtFVWg8bu+f74OsL1OQftbskcEp5WdczN23ZMpsFS7anythHMT0X9MNDs616NKqo9Qj4ZbQNZSlPJhr4biDq1blYW3B7D+1+vLEOpAXFwfIdWPcMSGhEQ5ZPSC/bOQ/S5C1YLNTo2/CfFKsw4tdJKkZYf2cr3piOuV3O4dXn43PIsvWpH92ESOAhfdf3My3Ofly/7Q5awjEdgw0MRok9bYCusMulyG7skPCDYDt3ZU6MJA5Z1WNk9p/3Tpd5577eeGKertvkTRih0RK1DUQKeaAoV7UAK7T+m6hgWNFAK/wOunw9ODPOtIqZtTqutaLrm0KNQK8hCeOwtSzUnSIncCtX/rVl/U5TdaE0wcwqm0E0h1+V3AD1OOKNF5lbToEHr8rkiGg58PWO1TuM+LgZKNLiMNWo1+hmBDmm3mXLZ/5sVFmhgKvI6DHRDc66hY84zbRXTephmx6kwvbnViJoQWfxQbcJaVcyYchlN949c8wv9UyIbtBz9ugtg2sKGVtG7/VG15aLcyZHcgBeqN1qAn3jH3t3+o4beiQDzYuAxxQ+i6+U20GKVe5O0fOH5HK379fMAqerehVB/TdPcpXCrhonMbXNIBwRZXrSEXUk6r5WOKgNjR+mDjMMidltFAAeu0IutWGcU14WKbaycCaGvZLAH7I0rH0O0Xk/oLkQmOjR5ud/At/wmeePCg6u7/BPWih+fcVAWHRjN090wJv0k1t92B7Aj/Afgtc2kdfwiauJLmBJsCUbVmi6+G+PEFoXv4Qds/cO9MMPV2CzFarmqtKUMNuDiJ/fgQNUMujWiIVZgeKOyA4MuVkqrvx0Glux1dgtPZ5oqAY0/JDZ0bjksHtWRKsF3j3Zw+p3EL/nT+Be2nAB77yfbHLyz50PXBnbykR4ZNTtPhHdGAco3ioofvO/2/UQwlDrx0BviEXjkBTK/QKcwA5ThmUYYs2U0/nN2hqunZZX4mikDlg+HhOcBy67+/TxPiltA1kNvAgstDUsuiVHRa2V/0fWfQSsIBbKrdYFLBDMLyyR01negw48cDJwJnpIttgBON9RK+WpT5E4Kl40s6f2YtQnGyKPyiM8SvukxHi5LLfVWgilTLW304TAQ1+HT5m7z/sHYHl4Dhw3Audflet1Dt1Ra7UV3/1q0FNhq4XvqPf5hDGDb3AGYdsDUEBEVhSArFaLglKhta9e3pIuWBqtQggjSmSN/sgODQPz8NUC5ceuxKzrZAvfEQ3C0Pzj8K4Iv3+/X6VxK4HgG4RgMGJIOCgRo7DAe7vy3GwIHyMZh/9ZIUCJ1N8ACn6k9eDvJPXIJ/onWSZKqgSSrDqc51wtagNL7ZjFZ5XdOEwmPfv1yHo1ZlzMWg+7x8cBUf8DoOmWZfzrHYuMW3UOCGnWo/1sDTcIYPNesvgK9treVsOAQNEotbttctblhmkoF2lpvqQbEotrry9cEz/dLkNp9nsrsOr/p2bSM7ZdNXPZDREdZJgiG/KGlk/yHwe1lgC6dSEHRDh3/YqddNKmoN8bMaf09yPHw+JAwkBbGd2Mx2WwMuT2N/JlqL+66L6Ni5x2FlwKeLHRA8pnyVtz5RwfCEHHTunuNJV+fGI+ULYjc8GZKd9ZufNdTjsXL2AkKopk/HM+e1a4v8OZHzTxjhrfq27OQb63h4SIFyQ4edKcRXuLOSfCwQT/Q+KnAFwbfqLBGPlHN/+39qLAYoHwYscwjDULKZzOVOkiT2YV1DsFlSs0KLxne7LkVS4MXEgg+OgCbzDc83lyPmg0+kJv6ijgH/ncLJv9C0keXi+vk1x0eLIlOVVqcVqKD59M800nf/4ewOlgRZSWv8LSvwoP/TgmDfTT/EhoHWDVDqFzV+O4JZWxqWpjAwGaqrXyYJ3wy56rozcU3cycSZbx+TinmjaT7zt6dLZRJPK85IX4YPvt5mrfVfoBnBA/X9RB8+wjAOrb/0ic6En/7JLh3ELzovPEDpML28eIC2HrsAcNa39VgDjApU/0AtDb5gdwE1gYeYtUDZafkIcbMFDrBMsIn1JjaUlJdiFJsuLVrStQVY86JfOetpMbSuDS4HOqjhbm+3iZ/KYDX7TsJDV4eSZL3f5p+COn8F0ok9XefX68+hd3AcVfBPq1TzK5rEBwI3nOXtBTpJNe+vJJmjih1ruQk3G/GBChr07A0IzrA5UcmAEc2XlP0G1DZF948pEb9bL0OrXi4jwIFLCnWN6e5EK7/rZbBTDh+6gYaivVNSK/VpFMIvw5gvPSb+Jf3i1+vPu9rngHEn7pleBU2I+W3XWV7JvQNyuf7eTa8kw4e4Z/pheJAev+8UiHWepa5/l5OdwbNNoG7/EON3sqG2GFK5JI9hKNOidq8IgctlAHjksUPB5n3KNKansb9eBmhGyFsAobNBzPI3B1dmgD+hDVeHun69/lWZGZ4Zf8RzrW+zYC9p/a7lA1owOFGJZi/HAp1L63e3pMU5LyBITVOvIUmyXFWpbNYaC7WVAcr/L8AA+dSd3OMf2BsAAAAASUVORK5CYII=) no-repeat;background-size:100%;margin-right:0rem;padding:6rem;text-align:center}.jt-wall-dialog .el-dialog .el-dialog__headerbtn{height:34rem}.jt-wall-dialog .el-dialog .el-dialog__body{padding:10rem;color:#fff}.jt-wall-dialog .el-dialog .el-color-picker__trigger{width:120rem}.jt-wall-dialog .el-dialog .el-body-foot{position:absolute;bottom:8rem;right:8rem;width:calc(100% - 16rem)}.jt-wall-dialog .el-dialog .el-body-foot .el-button-group{display:flex}.jt-wall-dialog .el-dialog .el-body-foot .el-button-group .el-button{border:solid 0rem rgb(255,0,0);flex:1}
  32952. `;
  32953. var _export_sfc = (sfc, props) => {
  32954. const target = sfc.__vccOpts || sfc;
  32955. for (const [key, val] of props) {
  32956. target[key] = val;
  32957. }
  32958. return target;
  32959. };
  32960. const _hoisted_1$2 = { class: "jt-wall-dialog" };
  32961. const _hoisted_2$2 = {
  32962. slot: "title",
  32963. class: "header-title"
  32964. };
  32965. const _hoisted_3$2 = { style: { "line-height": "24rem", "font-size": "16rem", "color": "#fff", "font-family": "'Alimama_ShuHeiTi_Bold'" } };
  32966. const _hoisted_4$2 = { class: "odin-dialog__content" };
  32967. const _hoisted_5$2 = { class: "jt-wall-row" };
  32968. const _hoisted_6$2 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u9AD8\u5EA6", -1);
  32969. const _hoisted_7$2 = { class: "col-main" };
  32970. const _hoisted_8$2 = { class: "jt-wall-row" };
  32971. const _hoisted_9$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u5F2F\u66F2\u5EA6", -1);
  32972. const _hoisted_10$1 = { class: "col-main" };
  32973. const _hoisted_11$1 = { class: "jt-wall-row" };
  32974. const _hoisted_12$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u7EBF\u5BBD", -1);
  32975. const _hoisted_13$1 = { class: "col-main" };
  32976. const _hoisted_14$1 = { class: "jt-wall-row" };
  32977. const _hoisted_15$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u53D1\u5149\u5F3A\u5EA6", -1);
  32978. const _hoisted_16$1 = { class: "col-main" };
  32979. const _hoisted_17$1 = { class: "jt-wall-row" };
  32980. const _hoisted_18$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u989C\u8272", -1);
  32981. const _hoisted_19$1 = { class: "col-main" };
  32982. const _hoisted_20$1 = { class: "jt-wall-row" };
  32983. const _hoisted_21$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6D41\u52A8\u65B9\u5411", -1);
  32984. const _hoisted_22$1 = { class: "col-main" };
  32985. const _hoisted_23$1 = { class: "jt-wall-row" };
  32986. const _hoisted_24$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6D41\u52A8\u987A\u5E8F", -1);
  32987. const _hoisted_25$1 = { class: "col-main" };
  32988. const _hoisted_26$1 = { class: "jt-wall-row" };
  32989. const _hoisted_27$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6D41\u52A8\u65F6\u95F4", -1);
  32990. const _hoisted_28$1 = { class: "col-main" };
  32991. const _hoisted_29$1 = { class: "col-main" };
  32992. const _hoisted_30$1 = { class: "jt-wall-row" };
  32993. const _hoisted_31$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u91CD\u590D\u6570\u91CF", -1);
  32994. const _hoisted_32$1 = { class: "col-main" };
  32995. const _hoisted_33$1 = {
  32996. class: "jt-wall-row",
  32997. style: { "height": "60rem" }
  32998. };
  32999. const _hoisted_34$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6587\u5B57\u5185\u5BB9", -1);
  33000. const _hoisted_35$1 = { class: "col-main" };
  33001. const _hoisted_36$1 = { class: "jt-wall-row" };
  33002. const _hoisted_37$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u63CF\u8FB9\u5BBD\u5EA6", -1);
  33003. const _hoisted_38$1 = { class: "col-main" };
  33004. const _hoisted_39$1 = { class: "jt-wall-row" };
  33005. const _hoisted_40$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u63CF\u8FB9\u989C\u8272", -1);
  33006. const _hoisted_41$1 = { class: "col-main" };
  33007. const _hoisted_42$1 = {
  33008. class: "jt-wall-row",
  33009. style: { "height": "100rem" }
  33010. };
  33011. const _hoisted_43$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u89C6\u9891\u5730\u5740", -1);
  33012. const _hoisted_44$1 = { class: "col-main" };
  33013. const _hoisted_45$1 = { class: "jt-wall-row" };
  33014. const _hoisted_46$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "X\u8F74\u5E73\u79FB", -1);
  33015. const _hoisted_47$1 = { class: "col-main" };
  33016. const _hoisted_48$1 = { class: "jt-wall-row" };
  33017. const _hoisted_49$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "Y\u8F74\u5E73\u79FB", -1);
  33018. const _hoisted_50$1 = { class: "col-main" };
  33019. const _hoisted_51$1 = { class: "jt-wall-row" };
  33020. const _hoisted_52$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "Z\u8F74\u5E73\u79FB", -1);
  33021. const _hoisted_53$1 = { class: "col-main" };
  33022. const _hoisted_54$1 = { class: "el-body-foot" };
  33023. const _sfc_main$2 = {
  33024. __name: "CrEditProperty.ce",
  33025. props: {
  33026. params: {
  33027. id: {
  33028. type: String,
  33029. default: () => void 0
  33030. },
  33031. height: {
  33032. type: Number,
  33033. default: () => 13
  33034. },
  33035. bottomHeight: {
  33036. type: Number,
  33037. default: () => 0
  33038. },
  33039. color: {
  33040. type: String,
  33041. default: () => "255,255,0,0.9"
  33042. },
  33043. direction: {
  33044. type: String,
  33045. default: () => "horizontal"
  33046. },
  33047. order: {
  33048. type: String,
  33049. default: () => "+"
  33050. },
  33051. count: {
  33052. type: Number,
  33053. default: () => 2
  33054. },
  33055. text: {
  33056. type: String,
  33057. default: () => ""
  33058. },
  33059. lineWidth: {
  33060. type: Number,
  33061. default: () => 2
  33062. },
  33063. glowPower: {
  33064. type: Number,
  33065. default: () => 0.25
  33066. },
  33067. outlineWidth: {
  33068. type: Number,
  33069. default: () => 0
  33070. },
  33071. outlineColor: {
  33072. type: String,
  33073. default: () => "255,255,0,0.9"
  33074. },
  33075. speed: {
  33076. type: Number,
  33077. default: () => 1.5
  33078. },
  33079. videoUrl: {
  33080. type: String,
  33081. default: () => ""
  33082. },
  33083. arcHeight: {
  33084. type: Number,
  33085. default: () => 1e3
  33086. },
  33087. axisX: {
  33088. type: Number,
  33089. default: () => 0
  33090. },
  33091. axisY: {
  33092. type: Number,
  33093. default: () => 0
  33094. },
  33095. axisZ: {
  33096. type: Number,
  33097. default: () => 0
  33098. }
  33099. },
  33100. showDialog: {
  33101. type: Boolean,
  33102. default: () => false
  33103. }
  33104. },
  33105. emits: ["submit", "update:showDialog", "update:params", "remove"],
  33106. setup(__props, { expose: __expose, emit }) {
  33107. const props = __props;
  33108. const language = ref("zh-cn");
  33109. const locale = computed$1(() => language.value === "zh-cn" ? zhCn : en);
  33110. const {
  33111. proxy
  33112. } = getCurrentInstance();
  33113. const predefineColors = ref([
  33114. "#ff4500",
  33115. "#ff8c00",
  33116. "#ffd700",
  33117. "#90ee90",
  33118. "#00ced1",
  33119. "#1e90ff",
  33120. "#c71585",
  33121. "rgba(255, 69, 0, 0.68)",
  33122. "rgb(255, 120, 0)",
  33123. "hsv(51, 100, 98)",
  33124. "hsva(120, 40, 94, 0.5)",
  33125. "hsl(181, 100%, 37%)",
  33126. "hsla(209, 100%, 56%, 0.73)",
  33127. "#c7158577"
  33128. ]);
  33129. const isShowColor = ref(false);
  33130. const isShowText = ref(false);
  33131. const isShowHeight = ref(false);
  33132. const isShowDirection = ref(false);
  33133. const isShowOrder = ref(false);
  33134. const isShowCount = ref(false);
  33135. ref(false);
  33136. const isShowLineWidth = ref(false);
  33137. const isShowGlowpower = ref(false);
  33138. const isShowOutlineWidth = ref(false);
  33139. const isShowOutlineColor = ref(false);
  33140. const isShowSpeed = ref(false);
  33141. const isShowVideoUrl = ref(false);
  33142. const isShowArcHeight = ref(false);
  33143. const isShowAxis = ref(false);
  33144. const color2 = ref(props.params.color);
  33145. const title = ref("\u5C5E\u6027\u7F16\u8F91");
  33146. const dialogVisible = ref(props.showDialog);
  33147. const directions = reactive([{
  33148. key: "\u5DE6\u53F3",
  33149. value: "horizontal"
  33150. }, {
  33151. key: "\u4E0A\u4E0B",
  33152. value: "vertical"
  33153. }]);
  33154. const orders = reactive([]);
  33155. const radioDirection = ref("");
  33156. const radioOrder = ref("");
  33157. const wallHeight = ref(0);
  33158. const yCount = ref(0);
  33159. const txtContent = ref("");
  33160. const lineWidth = ref(0);
  33161. const glowPower = ref(0.25);
  33162. const outlineWidth = ref(0);
  33163. const outlineColor = ref(props.params.outlineColor);
  33164. const speed = ref(1.5);
  33165. const txtVideoUrl = ref("");
  33166. const arcHeight = ref(1e3);
  33167. const axisX = ref(0);
  33168. const axisY = ref(0);
  33169. const axisZ = ref(0);
  33170. updateParams(props.params);
  33171. function updateParams(params) {
  33172. proxy._params = params;
  33173. _setShowControls(false);
  33174. if (params.id === DrawTools.DrawType.TextWall) {
  33175. title.value = "\u5E7F\u544A\u724C\u7F16\u8F91";
  33176. isShowColor.value = true;
  33177. isShowText.value = true;
  33178. isShowHeight.value = true;
  33179. } else if (params.id === DrawTools.DrawType.DynamicWall) {
  33180. title.value = "\u52A8\u6001\u56F4\u680F\u7F16\u8F91";
  33181. isShowColor.value = true;
  33182. isShowDirection.value = true;
  33183. isShowOrder.value = true;
  33184. isShowCount.value = true;
  33185. isShowHeight.value = true;
  33186. isShowSpeed.value = true;
  33187. } else if (params.id === DrawTools.DrawType.NormalWall) {
  33188. title.value = "\u666E\u901A\u56F4\u680F\u7F16\u8F91";
  33189. isShowColor.value = true;
  33190. isShowHeight.value = true;
  33191. } else if (params.id === DrawTools.DrawType.Circle) {
  33192. title.value = "\u8D34\u5730\u5706\u7F16\u8F91";
  33193. isShowColor.value = true;
  33194. isShowOutlineColor.value = true;
  33195. isShowOutlineWidth.value = true;
  33196. } else if (params.id === DrawTools.DrawType.DynamicCircle) {
  33197. title.value = "\u6269\u6563\u5706\u7F16\u8F91";
  33198. isShowColor.value = true;
  33199. isShowCount.value = true;
  33200. isShowSpeed.value = true;
  33201. } else if (params.id === DrawTools.DrawType.House) {
  33202. title.value = "\u623F\u5C4B\u7F16\u8F91";
  33203. isShowColor.value = true;
  33204. isShowHeight.value = true;
  33205. } else if (params.id === DrawTools.DrawType.VideoWall) {
  33206. title.value = "\u89C6\u9891\u5899\u7F16\u8F91";
  33207. isShowHeight.value = true;
  33208. isShowVideoUrl.value = true;
  33209. isShowAxis.value = true;
  33210. } else if (params.id === DrawTools.DrawType.Polyline) {
  33211. title.value = "\u8D34\u5730\u7EBF\u7F16\u8F91";
  33212. isShowColor.value = true;
  33213. isShowLineWidth.value = true;
  33214. } else if (params.id === DrawTools.DrawType.ArrowPolyline) {
  33215. title.value = "\u7BAD\u5934\u7EBF\u7F16\u8F91";
  33216. isShowColor.value = true;
  33217. isShowLineWidth.value = true;
  33218. } else if (params.id === DrawTools.DrawType.DynamicPolyline) {
  33219. title.value = "\u52A8\u6001\u7EBF\u7F16\u8F91";
  33220. isShowColor.value = true;
  33221. isShowOrder.value = true;
  33222. isShowCount.value = true;
  33223. isShowLineWidth.value = true;
  33224. isShowSpeed.value = true;
  33225. } else if (params.id === DrawTools.DrawType.GrowPolyline) {
  33226. title.value = "\u53D1\u5149\u7EBF\u7F16\u8F91";
  33227. isShowColor.value = true;
  33228. isShowLineWidth.value = true;
  33229. isShowGlowpower.value = true;
  33230. } else if (params.id === DrawTools.DrawType.OutlinePolyline) {
  33231. title.value = "\u63CF\u8FB9\u7EBF\u7F16\u8F91";
  33232. isShowColor.value = true;
  33233. isShowLineWidth.value = true;
  33234. isShowOutlineColor.value = true;
  33235. isShowOutlineWidth.value = true;
  33236. } else if (params.id === DrawTools.DrawType.Polygon) {
  33237. title.value = "\u8D34\u5730\u9762\u7F16\u8F91";
  33238. isShowColor.value = true;
  33239. isShowOutlineColor.value = true;
  33240. isShowOutlineWidth.value = true;
  33241. } else if (params.id === DrawTools.DrawType.Rectangle) {
  33242. title.value = "\u77E9\u5F62\u7F16\u8F91";
  33243. isShowColor.value = true;
  33244. isShowOutlineColor.value = true;
  33245. isShowOutlineWidth.value = true;
  33246. } else if (params.id === DrawTools.DrawType.SpatialLine) {
  33247. title.value = "\u7A7A\u95F4\u7EBF\u7F16\u8F91";
  33248. isShowColor.value = true;
  33249. isShowLineWidth.value = true;
  33250. } else if (params.id === DrawTools.DrawType.OdLine) {
  33251. title.value = "OD\u7EBF\u7F16\u8F91";
  33252. isShowSpeed.value = true;
  33253. isShowColor.value = true;
  33254. isShowLineWidth.value = true;
  33255. isShowOrder.value = true;
  33256. isShowArcHeight.value = true;
  33257. } else {
  33258. _setShowControls(false);
  33259. }
  33260. color2.value = params.color;
  33261. if (params.direction === "horizontal") {
  33262. radioDirection.value = directions[0].key;
  33263. Object.assign(orders, [{
  33264. key: "\u81EA\u5DE6\u81F3\u53F3",
  33265. value: "-"
  33266. }, {
  33267. key: "\u81EA\u53F3\u81F3\u5DE6",
  33268. value: "+"
  33269. }]);
  33270. if (params.order === "-") {
  33271. radioOrder.value = orders[0].key;
  33272. } else {
  33273. radioOrder.value = orders[1].key;
  33274. }
  33275. } else {
  33276. radioDirection.value = directions[1].key;
  33277. Object.assign(orders, [{
  33278. key: "\u81EA\u4E0A\u81F3\u4E0B",
  33279. value: "+"
  33280. }, {
  33281. key: "\u81EA\u4E0B\u81F3\u4E0A",
  33282. value: "-"
  33283. }]);
  33284. if (params.order === "+") {
  33285. radioOrder.value = orders[0].key;
  33286. } else {
  33287. radioOrder.value = orders[1].key;
  33288. }
  33289. }
  33290. if (params.id === DrawTools.DrawType.OdLine) {
  33291. Object.assign(orders, [{
  33292. key: "\u6C47\u805A",
  33293. value: "+"
  33294. }, {
  33295. key: "\u6269\u6563",
  33296. value: "-"
  33297. }]);
  33298. if (params.order === "+") {
  33299. radioOrder.value = orders[0].key;
  33300. } else {
  33301. radioOrder.value = orders[1].key;
  33302. }
  33303. }
  33304. wallHeight.value = parseFloat(params.height).toFixed(2);
  33305. yCount.value = params.count;
  33306. txtContent.value = params.text;
  33307. lineWidth.value = params.lineWidth;
  33308. glowPower.value = params.power;
  33309. outlineColor.value = params.outlineColor;
  33310. outlineWidth.value = params.outlineWidth;
  33311. speed.value = (parseFloat(params.duration) / 1e3).toFixed(2);
  33312. txtVideoUrl.value = params.videoUrl;
  33313. arcHeight.value = params.odlineHeight;
  33314. axisX.value = params.axisX;
  33315. axisY.value = params.axisY;
  33316. axisZ.value = params.axisZ;
  33317. }
  33318. function _setShowControls(isShow) {
  33319. isShowColor.value = isShow;
  33320. isShowText.value = isShow;
  33321. isShowDirection.value = isShow;
  33322. isShowOrder.value = isShow;
  33323. isShowCount.value = isShow;
  33324. isShowHeight.value = isShow;
  33325. isShowLineWidth.value = isShow;
  33326. isShowGlowpower.value = isShow;
  33327. isShowOutlineColor.value = isShow;
  33328. isShowOutlineWidth.value = isShow;
  33329. isShowSpeed.value = isShow;
  33330. isShowVideoUrl.value = isShow;
  33331. isShowArcHeight.value = isShow;
  33332. isShowAxis.value = isShow;
  33333. }
  33334. __expose({});
  33335. function submit() {
  33336. let outParam = proxy._params;
  33337. outParam.height = wallHeight.value;
  33338. outParam.color = color2.value;
  33339. outParam.direction = directions.filter((item) => {
  33340. return item.key === radioDirection.value;
  33341. })[0].value;
  33342. outParam.order = orders.filter((item) => {
  33343. return item.key === radioOrder.value;
  33344. })[0].value;
  33345. outParam.count = yCount.value;
  33346. outParam.text = txtContent.value;
  33347. outParam.lineWidth = lineWidth.value;
  33348. outParam.power = glowPower.value;
  33349. outParam.outlineColor = outlineColor.value;
  33350. outParam.outlineWidth = outlineWidth.value;
  33351. outParam.duration = speed.value * 1e3;
  33352. outParam.videoUrl = txtVideoUrl.value;
  33353. outParam.odlineHeight = arcHeight.value;
  33354. outParam.bottomHeight = props.params.bottomHeight;
  33355. outParam.axisX = axisX.value;
  33356. outParam.axisY = axisY.value;
  33357. outParam.axisZ = axisZ.value;
  33358. emit("submit", outParam);
  33359. axisX.value = axisY.value = axisZ.value = 0;
  33360. }
  33361. function close() {
  33362. dialogVisible.value = false;
  33363. }
  33364. function remove2() {
  33365. emit("remove", {});
  33366. dialogVisible.value = false;
  33367. }
  33368. function directionChange(e) {
  33369. if (e.target.value === directions[0].key) {
  33370. Object.assign(orders, [{
  33371. key: "\u81EA\u5DE6\u81F3\u53F3",
  33372. value: "-"
  33373. }, {
  33374. key: "\u81EA\u53F3\u81F3\u5DE6",
  33375. value: "+"
  33376. }]);
  33377. radioOrder.value = orders[0].key;
  33378. } else if (e.target.value === directions[1].key) {
  33379. Object.assign(orders, [{
  33380. key: "\u81EA\u4E0A\u81F3\u4E0B",
  33381. value: "-"
  33382. }, {
  33383. key: "\u81EA\u4E0B\u81F3\u4E0A",
  33384. value: "+"
  33385. }]);
  33386. radioOrder.value = orders[0].key;
  33387. }
  33388. }
  33389. function closeDialog() {
  33390. emit("update:showDialog", false);
  33391. }
  33392. function openDialog() {
  33393. updateParams(props.params);
  33394. }
  33395. return (_ctx, _cache) => {
  33396. return openBlock(), createElementBlock("div", _hoisted_1$2, [
  33397. createVNode(unref(ElDialog), {
  33398. modal: false,
  33399. "destroy-on-close": false,
  33400. modelValue: dialogVisible.value,
  33401. "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => dialogVisible.value = $event),
  33402. title: title.value,
  33403. style: normalizeStyle({ left: "10rem", background: "rgb(0 44 126 / 68%)", height: "calc(100% - 175rem)", width: "180rem", top: "125rem" }),
  33404. onClose: closeDialog,
  33405. onOpen: openDialog,
  33406. "show-close": false
  33407. }, {
  33408. header: withCtx(() => [
  33409. createElementVNode("div", _hoisted_2$2, [
  33410. createElementVNode("span", _hoisted_3$2, toDisplayString(title.value), 1)
  33411. ])
  33412. ]),
  33413. default: withCtx(() => [
  33414. createElementVNode("div", _hoisted_4$2, [
  33415. withDirectives(createElementVNode("div", _hoisted_5$2, [
  33416. _hoisted_6$2,
  33417. createElementVNode("div", _hoisted_7$2, [
  33418. createVNode(unref(ElInput), {
  33419. modelValue: wallHeight.value,
  33420. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => wallHeight.value = $event),
  33421. placeholder: "\u8F93\u5165\u9AD8\u5EA6\u503C",
  33422. clearable: ""
  33423. }, null, 8, ["modelValue"])
  33424. ])
  33425. ], 512), [
  33426. [vShow, isShowHeight.value]
  33427. ]),
  33428. withDirectives(createElementVNode("div", _hoisted_8$2, [
  33429. _hoisted_9$1,
  33430. createElementVNode("div", _hoisted_10$1, [
  33431. createVNode(unref(ElInput), {
  33432. modelValue: arcHeight.value,
  33433. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => arcHeight.value = $event),
  33434. placeholder: "\u8F93\u5165\u5F2F\u66F2\u5EA60\uFF5E9000",
  33435. clearable: ""
  33436. }, null, 8, ["modelValue"])
  33437. ])
  33438. ], 512), [
  33439. [vShow, isShowArcHeight.value]
  33440. ]),
  33441. withDirectives(createElementVNode("div", _hoisted_11$1, [
  33442. _hoisted_12$1,
  33443. createElementVNode("div", _hoisted_13$1, [
  33444. createVNode(unref(ElInput), {
  33445. modelValue: lineWidth.value,
  33446. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => lineWidth.value = $event),
  33447. placeholder: "\u8F93\u5165\u5BBD\u5EA6\u503C",
  33448. clearable: ""
  33449. }, null, 8, ["modelValue"])
  33450. ])
  33451. ], 512), [
  33452. [vShow, isShowLineWidth.value]
  33453. ]),
  33454. withDirectives(createElementVNode("div", _hoisted_14$1, [
  33455. _hoisted_15$1,
  33456. createElementVNode("div", _hoisted_16$1, [
  33457. createVNode(unref(ElInput), {
  33458. modelValue: glowPower.value,
  33459. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => glowPower.value = $event),
  33460. placeholder: "\u8F93\u5165\u53D1\u5149\u5F3A\u5EA60\uFF5E1",
  33461. clearable: ""
  33462. }, null, 8, ["modelValue"])
  33463. ])
  33464. ], 512), [
  33465. [vShow, isShowGlowpower.value]
  33466. ]),
  33467. withDirectives(createElementVNode("div", _hoisted_17$1, [
  33468. _hoisted_18$1,
  33469. createElementVNode("div", _hoisted_19$1, [
  33470. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  33471. default: withCtx(() => [
  33472. createVNode(unref(ElColorPicker), {
  33473. modelValue: color2.value,
  33474. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => color2.value = $event),
  33475. "show-alpha": "",
  33476. predefine: predefineColors.value,
  33477. label: "12"
  33478. }, null, 8, ["modelValue", "predefine"])
  33479. ]),
  33480. _: 1
  33481. }, 8, ["locale"])
  33482. ])
  33483. ], 512), [
  33484. [vShow, isShowColor.value]
  33485. ]),
  33486. withDirectives(createElementVNode("div", _hoisted_20$1, [
  33487. _hoisted_21$1,
  33488. createElementVNode("div", _hoisted_22$1, [
  33489. createVNode(unref(ElRadioGroup), {
  33490. modelValue: radioDirection.value,
  33491. "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => radioDirection.value = $event)
  33492. }, {
  33493. default: withCtx(() => [
  33494. (openBlock(true), createElementBlock(Fragment, null, renderList(directions, (item, index2) => {
  33495. return openBlock(), createBlock(unref(ElRadioButton), {
  33496. label: item.key,
  33497. modelValue: item.value,
  33498. "onUpdate:modelValue": ($event) => item.value = $event,
  33499. onChange: directionChange
  33500. }, null, 8, ["label", "modelValue", "onUpdate:modelValue"]);
  33501. }), 256))
  33502. ]),
  33503. _: 1
  33504. }, 8, ["modelValue"])
  33505. ])
  33506. ], 512), [
  33507. [vShow, isShowDirection.value]
  33508. ]),
  33509. withDirectives(createElementVNode("div", _hoisted_23$1, [
  33510. _hoisted_24$1,
  33511. createElementVNode("div", _hoisted_25$1, [
  33512. createVNode(unref(ElRadioGroup), {
  33513. modelValue: radioOrder.value,
  33514. "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => radioOrder.value = $event)
  33515. }, {
  33516. default: withCtx(() => [
  33517. (openBlock(true), createElementBlock(Fragment, null, renderList(orders, (item, index2) => {
  33518. return openBlock(), createBlock(unref(ElRadioButton), {
  33519. label: item.key,
  33520. modelValue: item.value,
  33521. "onUpdate:modelValue": ($event) => item.value = $event
  33522. }, null, 8, ["label", "modelValue", "onUpdate:modelValue"]);
  33523. }), 256))
  33524. ]),
  33525. _: 1
  33526. }, 8, ["modelValue"])
  33527. ])
  33528. ], 512), [
  33529. [vShow, isShowOrder.value]
  33530. ]),
  33531. withDirectives(createElementVNode("div", _hoisted_26$1, [
  33532. _hoisted_27$1,
  33533. createElementVNode("div", _hoisted_28$1, [
  33534. createElementVNode("div", _hoisted_29$1, [
  33535. createVNode(unref(ElInput), {
  33536. modelValue: speed.value,
  33537. "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => speed.value = $event),
  33538. placeholder: "\u8F93\u5165\u6D41\u52A8\u65F6\u95F40\uFF5E10",
  33539. clearable: ""
  33540. }, null, 8, ["modelValue"])
  33541. ])
  33542. ])
  33543. ], 512), [
  33544. [vShow, isShowSpeed.value]
  33545. ]),
  33546. withDirectives(createElementVNode("div", _hoisted_30$1, [
  33547. _hoisted_31$1,
  33548. createElementVNode("div", _hoisted_32$1, [
  33549. createVNode(unref(ElInput), {
  33550. modelValue: yCount.value,
  33551. "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => yCount.value = $event),
  33552. placeholder: "\u8F93\u51651\uFF5E100",
  33553. clearable: ""
  33554. }, null, 8, ["modelValue"])
  33555. ])
  33556. ], 512), [
  33557. [vShow, isShowCount.value]
  33558. ]),
  33559. withDirectives(createElementVNode("div", _hoisted_33$1, [
  33560. _hoisted_34$1,
  33561. createElementVNode("div", _hoisted_35$1, [
  33562. createVNode(unref(ElInput), {
  33563. modelValue: txtContent.value,
  33564. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => txtContent.value = $event),
  33565. placeholder: "\u8F93\u5165\u663E\u793A\u7684\u6587\u5B57\u5185\u5BB9",
  33566. clearable: "",
  33567. type: "textarea",
  33568. rows: 2
  33569. }, null, 8, ["modelValue"])
  33570. ])
  33571. ], 512), [
  33572. [vShow, isShowText.value]
  33573. ]),
  33574. withDirectives(createElementVNode("div", _hoisted_36$1, [
  33575. _hoisted_37$1,
  33576. createElementVNode("div", _hoisted_38$1, [
  33577. createVNode(unref(ElInput), {
  33578. modelValue: outlineWidth.value,
  33579. "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => outlineWidth.value = $event),
  33580. placeholder: "\u8F93\u5165\u5BBD\u5EA6\u503C",
  33581. clearable: ""
  33582. }, null, 8, ["modelValue"])
  33583. ])
  33584. ], 512), [
  33585. [vShow, isShowOutlineWidth.value]
  33586. ]),
  33587. withDirectives(createElementVNode("div", _hoisted_39$1, [
  33588. _hoisted_40$1,
  33589. createElementVNode("div", _hoisted_41$1, [
  33590. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  33591. default: withCtx(() => [
  33592. createVNode(unref(ElColorPicker), {
  33593. modelValue: outlineColor.value,
  33594. "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => outlineColor.value = $event),
  33595. "show-alpha": "",
  33596. predefine: predefineColors.value,
  33597. label: "12"
  33598. }, null, 8, ["modelValue", "predefine"])
  33599. ]),
  33600. _: 1
  33601. }, 8, ["locale"])
  33602. ])
  33603. ], 512), [
  33604. [vShow, isShowOutlineColor.value]
  33605. ]),
  33606. withDirectives(createElementVNode("div", _hoisted_42$1, [
  33607. _hoisted_43$1,
  33608. createElementVNode("div", _hoisted_44$1, [
  33609. createVNode(unref(ElInput), {
  33610. modelValue: txtVideoUrl.value,
  33611. "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => txtVideoUrl.value = $event),
  33612. placeholder: "\u8F93\u5165\u64AD\u653E\u89C6\u9891\u7684\u5730\u5740",
  33613. clearable: "",
  33614. type: "textarea",
  33615. rows: 4
  33616. }, null, 8, ["modelValue"])
  33617. ])
  33618. ], 512), [
  33619. [vShow, isShowVideoUrl.value]
  33620. ]),
  33621. withDirectives(createElementVNode("div", _hoisted_45$1, [
  33622. _hoisted_46$1,
  33623. createElementVNode("div", _hoisted_47$1, [
  33624. createVNode(unref(ElInputNumber), {
  33625. modelValue: axisX.value,
  33626. "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => axisX.value = $event),
  33627. precision: 2,
  33628. step: 0.1,
  33629. max: 10
  33630. }, null, 8, ["modelValue"])
  33631. ])
  33632. ], 512), [
  33633. [vShow, isShowAxis.value]
  33634. ]),
  33635. withDirectives(createElementVNode("div", _hoisted_48$1, [
  33636. _hoisted_49$1,
  33637. createElementVNode("div", _hoisted_50$1, [
  33638. createVNode(unref(ElInputNumber), {
  33639. modelValue: axisY.value,
  33640. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => axisY.value = $event),
  33641. precision: 2,
  33642. step: 0.1,
  33643. max: 10
  33644. }, null, 8, ["modelValue"])
  33645. ])
  33646. ], 512), [
  33647. [vShow, isShowAxis.value]
  33648. ]),
  33649. withDirectives(createElementVNode("div", _hoisted_51$1, [
  33650. _hoisted_52$1,
  33651. createElementVNode("div", _hoisted_53$1, [
  33652. createVNode(unref(ElInputNumber), {
  33653. modelValue: axisZ.value,
  33654. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => axisZ.value = $event),
  33655. precision: 2,
  33656. step: 0.1,
  33657. max: 10
  33658. }, null, 8, ["modelValue"])
  33659. ])
  33660. ], 512), [
  33661. [vShow, isShowAxis.value]
  33662. ]),
  33663. createElementVNode("div", _hoisted_54$1, [
  33664. createVNode(unref(ElButtonGroup), null, {
  33665. default: withCtx(() => [
  33666. createVNode(unref(ElButton), {
  33667. type: "primary",
  33668. icon: unref(edit_default),
  33669. onClick: _cache[16] || (_cache[16] = ($event) => submit())
  33670. }, {
  33671. default: withCtx(() => [
  33672. createTextVNode("\u4FEE\u6539")
  33673. ]),
  33674. _: 1
  33675. }, 8, ["icon"]),
  33676. createVNode(unref(ElButton), {
  33677. type: "primary",
  33678. style: { "background-color": "rgb(222, 146, 47)" },
  33679. icon: unref(delete_default),
  33680. onClick: _cache[17] || (_cache[17] = ($event) => remove2())
  33681. }, {
  33682. default: withCtx(() => [
  33683. createTextVNode("\u5220\u9664")
  33684. ]),
  33685. _: 1
  33686. }, 8, ["icon"]),
  33687. createVNode(unref(ElButton), {
  33688. type: "primary",
  33689. style: { "background-color": "rgb(126, 128, 135)" },
  33690. icon: unref(close_default),
  33691. onClick: _cache[18] || (_cache[18] = ($event) => close())
  33692. }, {
  33693. default: withCtx(() => [
  33694. createTextVNode("\u5173\u95ED")
  33695. ]),
  33696. _: 1
  33697. }, 8, ["icon"])
  33698. ]),
  33699. _: 1
  33700. })
  33701. ])
  33702. ])
  33703. ]),
  33704. _: 1
  33705. }, 8, ["modelValue", "title", "style"])
  33706. ]);
  33707. };
  33708. }
  33709. };
  33710. var DialogEditProperty$2 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["styles", [_style_0$2]]]);
  33711. Array.prototype.last = function() {
  33712. if (this === void 0 || this.length === void 0 || this.length === 0)
  33713. return void 0;
  33714. return this[this.length - 1];
  33715. };
  33716. Array.prototype.first = function() {
  33717. if (this === void 0 || this.length === void 0 || this.length === 0)
  33718. return void 0;
  33719. return this[0];
  33720. };
  33721. Cesium.Entity.prototype.setEditType = function(options2) {
  33722. this._editType = options2;
  33723. };
  33724. Cesium.Entity.prototype.getEditType = function() {
  33725. return this._editType;
  33726. };
  33727. Cesium.Entity.prototype.setEntityType = function(entityType) {
  33728. this._entityType = entityType;
  33729. };
  33730. Cesium.Entity.prototype.getEntityType = function(entityType) {
  33731. return this._entityType;
  33732. };
  33733. Cesium.Entity.prototype.setIsEdit = function(isEdit) {
  33734. this._isEdit = isEdit;
  33735. };
  33736. Cesium.Entity.prototype.getIsEdit = function() {
  33737. return this._isEdit;
  33738. };
  33739. Cesium.Entity.prototype.setParams = function(params) {
  33740. this._params = params;
  33741. };
  33742. Cesium.Entity.prototype.getParams = function() {
  33743. return this._params;
  33744. };
  33745. Cesium.Entity.prototype.bindEntity = function(entity) {
  33746. this._bindEntity = entity;
  33747. };
  33748. Cesium.Entity.prototype.getBindEntity = function() {
  33749. return this._bindEntity;
  33750. };
  33751. class DrawTools {
  33752. constructor(viewer2, options2) {
  33753. this._viewer = viewer2;
  33754. this._init(options2);
  33755. }
  33756. static initEditPropertyParams() {
  33757. return {
  33758. id: void 0,
  33759. height: 20,
  33760. bottomHeight: 0,
  33761. color: "rgba(0,255,0,0.75)",
  33762. direction: "horizontal",
  33763. order: "-",
  33764. count: 2,
  33765. text: "",
  33766. lineWidth: 0,
  33767. power: 0.25,
  33768. outlineWidth: 0,
  33769. outlineColor: "rgba(255,255,255,1)",
  33770. videoUrl: "",
  33771. duration: 1500,
  33772. odlineHeight: 1e3,
  33773. odlineCount: 50,
  33774. axisX: 0,
  33775. axisY: 0,
  33776. axisZ: 0
  33777. };
  33778. }
  33779. _init(options2) {
  33780. this._viewer.scene.globe.depthTestAgainstTerrain = true;
  33781. this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  33782. this._sketchEntityName = this._guid();
  33783. let dataSource = new Cesium.CustomDataSource(this._sketchEntityName);
  33784. this._viewer.dataSources.add(dataSource);
  33785. this._entities = dataSource.entities;
  33786. this._pointEntitys = [];
  33787. this._sketchPointImage = void 0;
  33788. this._iconNormal = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcEAYAAAAinQPXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAASAAAAEgARslrPgAAB2FJREFUWMO9mHtQlNcZxn/nW65GxHtEqTEajUxVoLYRSIyipHG4qG0lajtxVIRFubgqXuOI28ZE7FAvCLKLSNKxg/FSIzdvqNE62kaRitqpYMxovBGigo4I4n6nfwjsCrsLrtjnn53vnPe87/Oc9/2+854VdBhCd6ZP6dMHlAXO/lOngrzMLz/8EEQ0ASNGANNY2aOHxYIdfHr3LuBCwPnzQIKcf/AgiJ8pQV99BfmvR4+orHxZVsLxpZFT0qd07gyP7zqrej3IInF47lwQkTLV3d1xv3KXWPT4MYhLzMzIgHpn10+Sk+Gw74w+jx79HwSGnzUYhg4FED4FBcBq/jtokOOC2oSb0FZUgHpKVoeHQ9GtGM/y8lcgMLxf5juDBwNDlOWnTgGvUdWz5wsQ7c179fUWzz9y0tX1BdZPILeqCpTtil9QEOT9c876K1faWqS07XeMzJFuboCXkpaX1w5hqxl14QJIKYRWCzLV5OXtDQXbon3c3c2/TeMoYvncucAgPrl40Y7fA0zv1QtMydKwb58FL7toRwbDYo3/0utB3OD8qlX2hIkLqalwO0b9+fLlUHJOG9vQ0P4EjfyFIdPZGfqsURampIBIlxsWLLBtL/NltF4PhUIrVq92QGDIeEOmpye4pYju164Bq6n29LTiopy8tDTIL48pSExsDq/Oj9is/eAD4CRbli1DMEFUBAYCewnUaJD8jr2lpQjpJ7M2bBBi0+L47Tt2mP2G5xhNaWnAHrLj461tKF1rasA0rW5b//6w/0rigQcPWhrZKVFXP8TkybaFyb3kXbkCbiO6fpyU1Dwq58vNG3U6BJvEiYMHEcwQW8aNA3pT7O4OaPmTiwuCnlwcNQrEDRGYmytloilj5vr1Zv+mNXVhSUnmOFYEVnt6gtM9t+8mTbKlwo5AoWdySIjteWUcIwwG2LX7o6lPnkiZULTlj/7+wEThm5oKbCBeCOANUisqkNRxLCEBSSzrYmOB3jw6c8Yi3kL5K51OyvkZGXUTJz7LSH09CIPwMBpt85CHhMf48Q4IJFPofHzsbMAAJfjIEQtXC9TZWi0wkEuKAmjEyspKpNN2pyVBQULZaIjbvXmzUDb6xF0zGJCqv+no6NGAK5fLyiz8JssVcXEWgQLUsZZxWmGbrLTN057Agfh7eNiefhpRb7h922LgOzFp2DDzxnJXrsvLE0rqOW3sTz+12h4lLfRZhuQybuXmWmQkgPzhwy0o1jlV37ljh+e3/L1LF0cEXqX04UPb0075rlovLwtBHuqZ5845T5Z37UqbEAPkzOfsUvlHXZ35saFnQ4++fe04eIfftv64tEfgdvkXeweprFIvBQaaebJH+f3x4xbPvsRPnixlQlHGtDFjWq2Wuqj0yz4+QKk4FxNjMVXD2998Y0FRKEsCAuzwzBKv2eZpR6DspxQcPWpnvrNYoNNBZOTOnRoN0ilJMzYjA3ibsKoqoIxezs6gLJbpxcVSTbyePurwYSkT76VPKSgAWQslJcAmenTrBszgP7W1wBlRmZICY2SydHIC8ZCvdTo7Ak+ri44dcySDNDTs2mVufluhThoGD4bHp6or4uOb3zWJnoqwMGAVLnfuACHscHJCiFRmhISA0BMcFob52PDC/8EDkLfkR5GRQmycN8/t8mXw8O73WVwctnvdJ3SqrQXNSJeY3bttaWhHJxMxzDh97VqQAwheutR2IC6pm/z8oOBm7LcVFVJNKNo0oUsXhBKmGR0VBfI0vkFBINzExxoNEKP+ePYsktefFmVnC2Vjvm5SZSVEpGUNefNNUH8ti8rKQCziaOfOVuL2563PP4eCjJhxK1a8hMCJJ7NTPDxAXWIaefEi0J2r/ftbMfyryDhxAkZ2u1EaHAx6oReq2rb/JiTLZKkoUHLf2//YMWCGnPf++1YM7zHw+nVQ1mlKhg2DvPeiltr+GLaj2W524Kd6zZ4NhGOQ0ophI6GSkr4Gq61VGyjx7vdZQoIdYY1xVZ06RKttS1gTHLkPLjVmGo3AJZToaCsGjSWrPFBKfH3bvta0uyR3ySlGIxS4a7trte1l244MtoRpT93XSUk0l0oruFDbqROYUtQ9X3xhLr2WaBpX4+WnOTl2hHkw9eZN0Li5dLP6Dehogc1dexslK/7MynffhbNDvZXnWq9GNJWyiKC69TlphvobtWbOHNgnZonq6hdl+xL/yTQhbKUxeOtWEP9melSUFYMWJSv/IAtNprZLUu4Rf9u6FQpdo49bfRXaBQcy2BL1p+XURYtAZrLwhx+sGDSWrDpc3ZeVBbJMPt22zY6wRj/1oep08zXMUXRABpsQFmqcHhICYiLlhw4BBWiFA/5FOXmhoc8u0Pv3vyyrDshgEwqLYnKLi4FO5OfkvPh66UdudnZHCXsFAptQ96XMW7jQTsm2xAF23roFlD6NXLy4o9m8AoHFR7SxNTWgjGOsVovtxqBxXAzEbc4cKCycN+/+/Y7n88oRvjarcNYsCDtprP/+ewjvZ1xz9SpERBp3zpz5qqP/D5zQE33tptaiAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTA0LTA5VDE2OjQyOjI5KzA4OjAwjRBbGwAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wNC0wOVQxNjo0MjoyOSswODowMPxN46cAAABKdEVYdHN2ZzpiYXNlLXVyaQBmaWxlOi8vL2hvbWUvYWRtaW4vaWNvbi1mb250L3RtcC9pY29uXzJhcHo1b3VpcnV4L2Rpbmd3ZWkuc3ZncY9vkgAAAABJRU5ErkJggg==";
  33789. this._iconBlue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MkEyMUE1MDg3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MkEyMUE1MDc3NTAyMTFFREI0RUY4MjBCRjRGRDc0QUIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv/grmkAAAhxSURBVHjazFoLUFVFGN49597LBdFUEpEQI0IpyxIfqU1ZkY/pNZg1RZlWY2lW4yMncxq18oHZ0+lhOaWZUo0zPjIr8W1NiubI+AxBIkRQQsQE7us8tv3P7qGL7gXOPRdzZ3bmcnf3+7/v/Lv/+f/lYkIIMpur2yBktQVO5yM7LRybIvsOFKFGCeHyQz/dFO2Ousflcg6UJSlVlqVEjHEMjNMH5tE0vVLT9ZJAQNnn9fm3d+9z3xEYioR9bNcjW9Z8Gtv35l7PUAFjnU5HLytrFUU9TgV9XXD4+PJhoyfV2/GIFO4TGD8my1lVuGXSHYNuPdyhfbv5VkVAgzWwFjAACzAvp0fwoV++uz6lxzXLolzOW1AEmz+gHCwtq3i2z52Pn2jtlgvXI1LpgQ0jeqYm74y0CGiACdjUxkir3KxMlsoKNj6WmNAlV5Kk9qiNGmBTG6vAlhV+rd1aUuGeNSNSeiSuolGo2X1cdDogbThQ79h21CMfP6NKtR4dw/edYiTSK8GhZ/aO0R7KiFV7dnPpzeFQXkppWeWY9MGj8+ifektbqzVC8KbVH6UNHdJvOw2nHUIB7vrDI89df861p0SRsUSjuiSzB4qxyYzx0TVEdBUNTnVqs7I6B4beEKOFwqThuu7X/IJ7hj/yYlGoM9NqIakpSVH7t67c3C4muq8IyKcQ9EpuddSK3xqcSHJR7g7WsSkCm8+YiSEgRuU9gMbd3k5578kufrcTC8U0eLwF/e99anhJ6Sm/HSHSid/Xv5CclJAjAjlXr+GHP6x07z9JZCSDCBfzBJapBomJabJfdKqFCiGa4RkQgrQA6p+MtbVTEn2dY2XhUz956szM6wdkLRFtsVZFrReeeaRTQte46aIxT4DgrA9ABJKRw42QTLsjimqATgUZwpxNO/0OGz3KmMvWuBFgABZgimwBB+ASbtSSp0zIHutyOuNEg9NW/e06UE49YRBi5LFB2NxaMoQg5iGJfza+Y+MwlwlmogALMIXpD+UAXIBTOEKi4rt0zg51sFft8TjN7YQbnzrbVpeeD8Q+w3fYFCQba9ha5kHABGyRTcrlCeBkVQjO/Wxeb3rA00WDb62rcbHzAARML0hBAloK+lyQ4TEHx2B4BragUS69vl06/6aLnk6LQuQ+vdMyRQMHT/ql/D9VGfEQi00PGFDYwqsP8/AsMQyJbTvABhuiFb3TU+8Otb1CCXFd1SF2gGhg/f56Bw4+B9iCJ0J5Bv93fgAbbIimd7yq/UDgZklITLQ7RTSwp9grs7MgBYXYMEQ0OTtBWBR7d5FX+NQ5J0tCHG63K0GYglSpkrklGkXY1GGKMbdo8d+qkBfn5LB0RpwOeDlc2mo9NNYHbyOMIuCRptvNsCGqXxgnS2dEoslhxMrgSDXOSbL0HlFVzSv6vlMMJigorWGpnJ2ymzRdTrENGxY4NSeE+PwBYQ3ds6tDN1IewvvFRMLQwTBMPB2lxTuEaTvnRKwI0S/U1ZeLBganRWtGwteYAOoR8EgQFsUe3DNamNpzTroVIWp1TW2xaCCrf6xKzDScaP89SRKGGBLkCSMjVo1aZRS1IZrOOalWhCgHjxTvEw3ckhylD7rOobF6ghZJphhk1TO80DK8Yab1KgJssCHMKhgnxYqQQM7i5bv9AaVONDh7VFzAqCWMekLhRZIFzzQWWLzIMjAY3qwsii2+YakDTsDNkkdoRVZbXHLyN9EglKdjh8QoUBSBcaIDEYU91cbtRi7yUFCF2OgBha9lBRZg3nWjuPQFLsDJqkfAtfWfr1jzDSHiR/zuk/GBjO5YQyqtQDU/5WYKCjo/Oicd/JmPw1xYA2sBA7AAM8RFBAEuwMnqYTei3Q95vx47U1VzTJj3uDBZNzXRl9EdUTE+SshnECJcFPOWwraNxj0GYo3OyLM1PgQYgAWYIlvAAbgAp3AKK6XyTPXZ56bOm0f3p/BFFEdr7LwZSd5xQ9wKUukUo/u4h8SdecCHzPmwdtOMJF9ciHodbE+cvmA+cAm1rVoSAsD1m3fmH127cfvSUJOiXRh98nS8/8dpXb0DknWNKB5qzsOIKlwYdIULpWMwB+ZunNrVC2tDeQIa2P552+4jfFsROxd0sbRfm5/31dyMPumZLQWkwsqA9EOTCzqCzdTGvKB7MCNWTU9s/oIOWsHh41tvGz5uNv34Fxdi64IOvNaxQ/t2aXvzVixKTUnqezkSRBqhCm4bMW7GhboGuJw7H+qQW7nEBoALFPCvOx8cP+toYUl+W4v4o6h0L9iiNkvBdnNXplYvsSEtOFddc75owLCxc6jLd7aVCMDulzlmDtgCm6FSEju38RAxztJUumTkoy+9faqyqjDSIgDzgezJi6gN+P9Is1HKjpBGz9T+U1cy+ulXZ9XU/lMRKRGABZjUEyeseCJcIY1i6BY4NmHagjlen/+CXREUow6wADMcEeEKQTxxq96wadfvCz9cvpBuBSVcEbCWYuQAFmCGSgrbSojx0qW9KmfxV5u/zP1+MTEqI6vlCNFhLWAAFsdEl1sIvIAgdTn98muL1mzZtXe1VYCtv+xbDWsBg2OR/0OIKaaB9ooHsqcsoXt8h4Uwu+P+xyfD/zwqOIatHw7YFQJvVthSUICVDxs9Kae0rOJwS2vKyk8fgbmwhq/V7fKwLYSLgWLoPLz9s59//c3mwjKMPTZ+5hswl6ceWiQ4REQIF2OE5QOHCo9NfCVndoPHW3vxHPgOxmAOzOVr0BUlhIuB0Hn2+5937p/77hcLgsMyfF7wwbKFMAZz+Fx0RQoJDsvvL8ndYYZlM8y+8/HKbXbDbKgW8ftd+qQJLQcglFZCaE3qFn81wogEh1mYE/F74bb64RnFAm/DDwy6mPdrkJLzKGfLpsj+vwIMACSZzfDJFmOPAAAAAElFTkSuQmCC";
  33790. this._iconGreen = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MjI1NDIwOUU3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MjI1NDIwOUQ3NTAyMTFFRDk0MTJGQzhGMTFCQkREODIiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgEE4igAAAgKSURBVHjazFoJbFRVFP3L/OlMoQXKImAFm0JbFtFKShEQI6UsggmkGKghIKTIIgZUohIDKEuLaFTQiIKyKKghqSyyF0pZbcHQsJVpoRkKbYFAW+iU2f78/313+qY+hvc78+dPkZfcMJ377rn3/Pve/fe9gVUUhfENY5eBjNbhvlnI6Bmh+KT5NzBhGigg9sb5vX3NpohhRqMwgOe4eJ7nurIsGwl69MDskiRXS7Jc7naLpx1OV/4z/V67CKpw+Gf1ZiQv9/vWyc8lTkMEpgiCIVGLrSh6ShGhX4ovlG5Mz5jToCcjXKhPIGvyOOG2JW/OywNfuBAd1WqFVhIwwAZsAQOwAPNxZoQ9f+yPHnHdn94QYRSeZ8I4XG7xnLWianq/oZOuBrvkQs0IZz27a2RCfLeCcJOAAZiAjXyM0hqblslcRfHuiV07d9zKcVwU00IDsJGPLeBLS3zBLi3O8nfuyLjuXbegKtTsOrY4Ldz22u2GPFue4bL7MlfrqWXh+xhDjNLL2EtOj0r3jI8Z70kyJcnN4aC4RGtF9eSklzIOoD/lQEsrGCLs/m3f9nxlUP98VE6j1QDz6/P5xZWLI06KJ3lGwIWdB2tfZEgkJB4oVwwzWBgsLY1d6hoWPUxSw0Tl2na8sHjYiAnvlKntmaD3SHxcrDG1f9/1aiScspOZYZ1hGm4dHnmSRyRglk+i/ITQwVywAVvAoA3kMyolufc6iEHv0uKuntkxu1ts5xyacY2nhh1TNsZcpBTxjBl2K4AQ2eD8MiITWXFDmULiYJhUNlXak7DH0d7QnvrUr1feWtgjZdxa2hILKiOzp01o1/mp9gtoOrtsZ0eXjjYXMYhEa/RFKyxmLCaCmBF/NhF633xkCxiABZg0XxADxBJq1eLnz8ycYhSE9jTl3Iq5EWeYM/wjwUPQvj1CEwHP8SMFWIBJbX9QDBALzrNmIhGdOsZkqm3sTfWbhKbgTcSSMhBLiiYcMc9I2CMswARsmk8Uy5s4r5qIsFt/WN6nVaQ5iaZcVLkoQjEpjbD++4IM+hFUQniCDMYBTMCm+USxJP6+bkVfFWRVIny/Pj3TaIpiezF3SjzFN619AaNwRLABSwzhnSOWGxLABh80sz5J8a+qLS81IsY20a1TaIrc2lzhoX3A+2Ui6FcxkRn+4f3j9UEZbdtEDcCUgycSaTbF0RQnGk7wTY79S2xIbSvGIDCPNxynPnUckyYiBpPJ2JmmKBVLuSYCXIA9EWxWWAIPYZeJZdS4cEwGTXtEMBhMNEWthHonVieB5gix2Aft/NIYk6Y9wqHmMGzH4HANHBOn6T3i8UgO2vcxfIzibTdI0Tv88Lw+NMTUHBHF6XJTz9CJQqLs7ZdkLHoIkbbyf71YgpBAbdtxTIoWInK9reEGTTGk9RCpqfGTCDJ6skE2kxL2QRk4JlkLEc+dmrorNEVGTIbo7VxFgowUQlYU4oxCnFMAe0LMBJFmgmPyaCEinrt45TRNkRyZLA8SBkleMj5CMvGclCBJMIQdJgAC2OCDZoZjErUQcees3njK5RZtNOWy2GUu1sk2nidcOAiPX2aUAHvC/1yCBDDh1Khyw2KDmLBF8Bkpt1bWXSm/fpKmhOPp9OjpIhyKGCcWHxkPpQj4b2oPQcJnj7AAMy06jbo/IBaISWtGwF3Dj5tzf1PIIyQx1nRf40phUiTmQWMQTaTI/ePx2wPEPvAF7xWEAViAqXIRoUAsEJPWze6tdn8dOF5y63ZNCbXv4SKVvYl7HSkKItPQGMwjpFx+4he8V5AtYAAWYNJ8QQwQC0bQfLASq2/duTvjveXL0fqkvog6GDooR3sdtWdFZomsjW18Xj5SdhXBwYOADdgW9CpwAJbK3nDMWpC9AmJRW1aBiABww8GCwkt/7s5fpzbJzJmZ9XHrnYfiDtkHSgMlph59CSXC9y8phA7m5sXl2cFWLRMwwPe+w6cuYvqKngs6uFp4tvDApmUv9ktKC1RZSxwl3I66HYaD9QcNFtHC+RpAaDuShCR5RPQIz7h24zy9zb3lQFjFF0oPpY6Yuhh9vIaJ6Lqgg6y1jY5q1bPowOZV8XGxyY+jQUQVqjh15NSP6m0P4HLuntom13KJDQD1CPDa0NezFl2ylBe2NInLZdYi8IV8WvGCDJi9YC+JoXDW3qm5V5aSPmUJSnlBS5EA7P5pk5eAL/Cp1pLouY2HinEXtdLlo96Y+3ll9W1LuEkA5tjMeauQD/h9pNkqpYdIU2bq7tvKM976cFFN3f2qcJEALMBEmbiqJROhEmkig5ZAycz3s5c4nK56vSQQhg2wADMUEqESYXCTcWfX/qNnVn6zcSVaCmKoJMAWYeQAFmCqNYUtRYTBTcftnNWbDv68dedqVMZlrQBgA7aAAVgYk3ncRBTcNd189+NVuXlHi7ZpBTh07PQ2sAUMjKX8H0R8ZKB7qhqbOX8tWuNHNJTZI2MmzYPfPKowhq5rDL1E4M0q4w7qRnrGnBxrRdWFQDYVN25ehLlgg21lvXHoJoLJwInjHrz9M9/+5LPmyjLoJmYt/BTm4tZDCkcMYSGCyXjL8tnzlpJZH+QsfmB31PnPge9AB3NgLrZhnigimAyUzrs79xX8s+zLn7LJsgyfs7/esBJ0MAfPZZ5IImRZ/mrt1iO+suwrs1989+thvWVWbYT9fhc9aQUdB6CUVkNpje3SqQPDMgpZZmFO2O+FW+o/niEsyDb8qt7Rd78GLTmucrp80vz/K8AAYAEv1AHM/GwAAAAASUVORK5CYII=";
  33791. this._iconViolet = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNjZmZDYyMy02NmE4LWYzNDUtODc4MC00YmMwY2IzZWM4OTMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzFDREU3Mjk3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzFDREU3Mjg3NTAyMTFFREE4MThDODBGNzMxNDBCQzEiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OWFmM2ZiODktNzQ4OS1kMDRkLTkyNzUtZDM5MWNhYzYwMGE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjM2NmZkNjIzLTY2YTgtZjM0NS04NzgwLTRiYzBjYjNlYzg5MyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Ppb+WxIAAAhcSURBVHjazFoLcFTVGb6vvdnNY0lEEJOIxhCSKTEFKSC1osIgjqIyA62mZfAxWJU+tC3TVh2lHSGhtNOKOqK0ii+0QwcfFB+IAsKIITpJhUBDHhMiSSBCTMgm2d377PnungubnXOT3L0b6rlzmM2e83/n+87/n/+ecxbeNE3OLvLFV3Fui3KiivNSkhmTNb7EpagQQvzxg++VBvxpc2XZN1MUhEJRFHJ5nk9HO5mwAV03OnTDaFYUtTocie66pOymOjSlYnzeq0d2bn02c9oVxXcTAct8PqnYja2qakeJoFdqDx3dNH/xij4vHhGSnYHlSxf5Out3rrjmqqmHglkZa9yKQIENbIEBLGCeT4/wB/f+c1LBpXkvpsm+73IpLFFF/bKltf2esjl3NI005JL1iNBSs23B5MKJe1ItAgWYwCZj3OiWm5vOQmvt9ttzJ4zbLAhCFjdKBdhkjNcwlht+Iw0tof6zrQsKLs19jWShIeM40hASure3S727O0WloV/QehTeSo/ZsilPzjCC11+k5yzM0/yTs4yhcAgvtaW1Y2nJ7MU7yJ/GcKE1EiH8B1ueLrr2+9N3kXQadAIM7f1abK84LEcOnBFFXuREMpk8TyrHx4jhMQ1OJ5x0U+f8s8boeY9MUbLmjNedMEm6Du2rqp17w5KfNTitmRGvkcKCfHnW9NK/O4kwIjp37JdfpDUv+jSgVw+IASHAofpRef/gSttQ0Rc2sAUGq5Axs2ZM+85GcPAaWkLT528/MDF/QiXLWPtG4Rt/tM+v1vSLMi9zPl4iniCVeASeEPjB82QQj8Az8IjOaZxqapxiKpzvygy9aMs1EekCmTnrX7WdfHjSjEUbWCE2Io88cPeSnAkXjV3J9ERY5xuX7PNrNQOin0/j0kiVUQUI8llVSnjs79FHpjawBQawgMkaCxzAJdmsJT50X/ky2ecby5yllTWy+p9+MY2PkYonb60RUuER1udBoixBMgcsYDK3P4QDuIBTMkLSxo+7oNxpYfe80eaLhZPMSSSkUAU8vPWvFVr2QrdimD7xfWw7nzUZMgdMYLPGJFx+DE5uhfCbn1s9JSM9UMJqbF9TJ5O5tNZEooh48o4Lk66fwWJIJZjAZtkQLsVvbFxTapm7ECKWTSmax2oYONgjRKp7RSluYbsRwRITS9cxQcDGGCybKSWF1zuFl5MQeUwwcwaroXtbmyTRWLdFkJekKxGDwo3nz4nB+iEVY7D6Z4/JmgluroSkB/wFrIa+z7rE2DyeWwfJiEhcO2fXD3n69p9mzjrl5EqI5PfLE5hv0qZ+gach4TacRhJmwFaaB5i8KCfJ1RrxSZKfuW3oUflE8l49kvg3xmCeX2KcXK0RMut8yo7BqSqUk+DqPaJpepjpqmyfaSbs30wPx24WFsZww2koIWYkqjDP0PKkDAO7WOuheyevBRgGxQS2XJjO3LZTTqYbIUZvqO84qyFz9lidyohtzenjRYT92LiZsy9kbocpJ8ONEO1UV3cjqyHn1nxNw+6V1tgsJicmdkaJCbDxgJ1zW77G6k85aW6EqF/WNVYzc3lZtuGfGdQ1sgXHVtwW4zbM4sPJ3tYDE9gYg2VDOaluhCiV6zftjypqiNWY92iponKKdZ7QaHUjJl6EbQ8sYOY+Uqo43LCEwAncXHmkuaWtu7H5q09ZjTieZv/kEhWHIpXURDHx6ydxLcT3OSdCsQ5YwAxeyz76ggs4ufUIXNv3/MtbXzfjj5BxZeK6aYpvaoYetUhECRnVqhoNNyvkTIP5WbNOh7H+sAUGsIDpcBFhggs4uV3sVrb79459R052dh1hGgZEs+hfP4hIU9P1iEUmapFSDGWQqPjnLHlDoQKiHGyBASxgssYCB3ABp2QOVmrHyVOn7/3V6tUkPpkvImlsmln83nXh4NJcNWKGuYgRIxcTpcQIx1fynd2OvrCBbfG710WA5bA2wvevrFgDLk5hNZwQAPd9uKfq8Jvbd210BPCL3GVPfS9a+PbVYWF6QA8bEBSrYYgzI1a1Ptvfk4q+l791dRi2Tp5Awdjvf7y/joaV6eWCLpPUy6p2vPTElWUl84bLSOH6XqHn3Xapd9fXotLUJ+jdmrUBFHMkU56UaQTnkkRxc54WKAkaw2HVHjr60awb7nycfDxGhXi6oIPXsoNZGUUHdry8rrAgf9r52CCSDFU7a8Gdv+sN9eNyrsdpkbu5xAZALwE8NueW5Y8drm+uGm0R/21oOYCxyJgtGHuoK1O3l9jYFnxzqqunYcb8ZauIy/eMlghgT5+3dBXGwphOWxIvt/HIGKfJVrr5xh/+/E9tHZ31qRYBzIXlD64jY+D3kSGzlBchZz3TfSbUvPiu3z7W1X2mPVUigAVM4okmN55IVshZMSQEjtz364pV4Ui016sIghECFjCTEZGsEI5u3E5t++CTz9c+uWktCQU1WRGwJRiVwAKm06ZwtIRYL11SOyvXv/ThC5vfWW/iaOf2PEJsYAsMYFFM7nwLwQsIW5cTv/j9uq07PzmwxS3AR3urt8AWGBTL/H8IscX04zp4YflDG0iM73aRZnfffMeD+M2jnWJ4Ovx7FYI3K0IKB7Dj8xevqGxpbT80nE3r8RN16Asbamt45eFZCBWDw1AP3v7lP330j0OlZbTdvvzhP6Av3XroqeCQEiFUjJWWaw7WH7n/N5WP9w+EuxP74Du0oQ/6UhvuWyWEikHqPP3O+3u+eOIv/6iIT8v4XPG3F9eiDX1oX+5bKSQ+Lf91w+bddlq20+yfn3n1Y69p1qmk/H6XzLRJjgNIpR1IrfkXj7+Q4zkzPs2iT8rvhUfrP54RLHgbv82Ps+/XsCWnWc7TmKzx/yfAAHo1CtU9myPWAAAAAElFTkSuQmCC";
  33792. this._image_arrow_forward = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4FpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDplMWFmZGVkNi00MTJhLTc5NDAtYjQxMC04NDExNjRiMzQ0ODciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QTA3MThEMzhCMjc3MTFFRDg1ODdDNkY4OTc4ODRCRjUiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QTA3MThEMzdCMjc3MTFFRDg1ODdDNkY4OTc4ODRCRjUiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIxLjAgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YjI3YWU1YjEtZmRkMy0wOTQyLWIyMzUtMDFkYWY3YTJlNGUyIiBzdFJlZjpkb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6YWUwMWJjYWItYzAxZS04YTQyLTg4MjAtNDU1NmY4NDVmMjBiIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+BD9OfQAAEDhJREFUeNrsXT3PJEcRrho2QQ5IkAj4HfwJEhLInUHAjwBBgEACCRC2gAA5MEiQ2QRYpCQgPiJbsiAxyMYGm+O48927u+8WPd6Zd3t7u6qe6lnfe3tvt9Sa3Zmej+6uruep6i9+9NxzTPvAh4MQHf+Z09RCfsPRzUXInyOVa9b/Hnq4zMBdmnv9dhnp7enpDKtToJf9f04/5OZajQiwQhK4UmWskAUtTa3avSAV8aj9Ro7a7/JcDz34UtkVba/fp1JGLrCSpQvmx0EASnAfwZ8V650rgMugdAkA7lIhGGSQkMP1wxs1oqJds64jxIZOyg8jGTmZ2BXXdzfXOf2WozRykub4XAeWbiktK+deR5299G9+mhXgd1N8McU3z+wBqFrqNTLAQE0xYNE7ROKkS0J/n5hppJJXAQgBBT0SrBCH4yNP0K6TjsP3SfUZHlGxiA9ViEeNXOyyNLsszXVxXxmv1fTyDECL2Yazi7dJduRp1Vs9dJdQJ11nCF9K8ZMpfj/FN5pr9XQMgGptt1jPFEhvWd9FGp59Qdo9Gvk4h5XvfbsFvEPQMxF5JgeOZf0OgW8ZjPKI3jd/wzD9Lo+7gohcT+e3Bbko4674v90fOUXZHf7TLnvWdddwPfTQw4WEzaS7fp3ij1N8bYkHQLPec+bHDdZwrsxF8SZoYC8KYFDWETRUniv1fJieCDGAq/Z8bSwDWgZEtW4X37MiFSCV4LElTwwSQ494kXOfFP8/UXipNDLjkZ35sRGylBMXOX4X5zK4qxCOmVhsMwKSx43yf5OlXxf3dnLSQw89lPj9hRQ/m+KnU3w1xfvn8gBQ0JpHLFvb2q/34deUvxjWvgb0kT58Bq1hxPL13uNZ6QP4Tu97Ix4C6x2IFwUpj4hXQ3sH8u3oteg57TuQMkO+r/Xbau/PycmmIBzr7Pfj7Pp87Sr7vT785hRlk5GcHp5U6N74HvbtMJeI91J8IcWXU/xbCwGwQNvrG/cG7KGg7H2DRwyQ5wwKkUCfMVTyFiEELfdEAMRIV+06iRIA9PuRb1wK4lGiYZWRlq7iAQgTiyUEhQnv8tHS1fI9BGXMqmO0fq137DJisi7i1URO5uPj6fx4/DD7X6Zbd3LSwzNOAErMemkiAn8pSELIA+BZqwIAjzc1EL0HJSje/S1WeASQlzwXsbARr8K5PQHnsuqXehdQS/j0+n5Cq/atshBQ0XuigGqBfQuZGgJ5o4bvjJIjPkvdtsssSmZr77iavB8jyXiUkY2RiDyczj3Kfj+Yrn2YpZt/bzuO9XAmD0DeJfnHFL+T4m8mOTQJwED1PnAEqJda8BqAc+B7UOtaAGBBr0UHEUa+tQZcVlcABZWkl1YMMEIsYdS6jIAc6vmIgLTlGVpq0aNl3jImoREMmQ3vD0pUEALHhpyg+YwAey6XA0AgozNpWtoQ0v6HkD6IEc9tRkRmYvIgi/ez3/em4/+m45x2Qz1cEgEoceftFH9G+wGCf496AFr6/C0vAmLdKySDWZkGyNQ+6wAhHC0uejLARah9vECrm5waFFNUCVmgN5yWdwiIxsNQ1H/Uy+DlCx1vQADI1cBwiTKPkpHl3RKH6amtXo0ocYl6LILyeCNvVt2j71hC9lrG1ESeHSH2pOjWCBmJfFftnGTk5P5ERMb43+n/Byn+OzuXX3t89NS7OR5iA3jRxy6w36b4rRR/F+0CiPb7e258aQTw0gL20nrjDWrPo4pbGPVG5B4UT1miwNkKuMh5VPFFXP8RBbhUqbVaXUxtHpOlsw9axwNoRCPaBeC882ZciEcKqLCyW8BwaCgvVBZQr1K0Tmr1ER0/YbzrCITR5wr5U4qXkoaIt7Ce7uDFXGrkRL22BHo1kfdcTWTkPym+P5GSf9F+0N3b0//3p3MfTKTmNgkAVbDr9RS/meIvLAJgWebeNaL4QMCWlflQdhmZmRBhsS1MN2qha982NL4zYBFADXQIlsUSwGtR/i19wxGS0gpemLV5rDSHj58AwIAZ6FY5IhUWEQ6AOXM2HRm15j2PD/KcqCejdTYJUVvXFS98XlQnDQFdvAToOfunLYaG4gY34gWqbxEvMOopR7zn6AJ2+e/Re/K9FH+S4ju1ymwJEVIghjVuFYoEGpL1DXkQsFKIsLUKECdUba47WnZWHpD8ksMQvWfXGGb5OgG+Q1tVMvqM8t7IEtNI2VvpxCkvtEyl+l3ilgEiP1q55jIoC/NuvFfYaMMElE9lczGxvo0b86DVpSzQhWiQxvtr+kiMMhanDUXzKISvr4J4bP16FHd/FqTurXYrICC31BNSJ2zIXjkxXoB2VMvPp1L8Woo/TfFzHgEQowAFLMDagjxcqUA/87oClYAyJ6XhREBTAvfVCIYYjVCAckbA2RJycQSFi5+sAEe+uI6leFhRHlEm3KJEBbB4tPITkOwyqFS1bjJk4SdEYUfkWQy5jACCR0CI6otfeRa/V67aQl8CKO4WHdEOnAzLbfRJUskvA+DikVEEsDQ9jui0aSqySbzYAVAkPy1BFmALGwZOxEjQu4TFXKRNHHzLr30+xV+m+HyKn5m7AKIsDun3j/7mhvdaFSCAuxeZdsgN744+h2l5l4D3HM2diPZpou9t7Y/kQF644T1L3LWeaxidf3/OkfBaHpeU//H3H/f9L51aiHxvax211Dc6Y6Hl2+y9Pc4jk0u6ABHdQKAcU7DMiOJufG09EwGIJOKab+2eRvR+BNPQay33l+U1jm14ZWkXAOLGRdiWtyMgwlS5YG7sMGEBLUfEOkI2B0LvQayUSFeC57KNHKPWYst+EFFvTov3hSqeDW/cS83iQrtmOOB2RNtRixsQUSaHe8VU9uLLJyPtwHPtCpDO86awo7ti9ciwXrQs9mjdWN8kDe2vxTpmMD/syLJXl863SkQfH+sutrzbWXcmm1vXe5a2AN5YT68zWJ4Casmq7AyKwvAEp6XwLUUgZG+ZS6DLiEFBR9YxkEAjkqAyQIkJohxa6oYbFZKnTCOKBumSEPCd7NSfp+ijOz8iZRx1US6RM1baBBmuTISIWG3QyydX+u2lkq3IeB5PFoXaBluhXT45MYoYRXWChZPEsq2KAcLR8Q61vAoom7WxJZ7coWSnTCaAnvHSlLMSiu/NBpmKWocCkOzIFveahR4h2/Z7T+9+K8WvpPjVAQQhcVwe3qA6MQqOlYxG9xhA+8JrDVEChYsCnShPbLHUCWDT5DRmURpqpIxR0EStXAZkDQEetHykoazF8FIJQESQvFnAICH5wrInAcvcIgZWPpV3iNUGI4NzEY+HOHUaLVNkDECE7EmQwJfGS8Qjxwu/2+prZooPxEXD9GzxNiQD88za96K6PGIMoeO4JNjOI56c8v5x98Av0n6RoH8OhkUsgRcgzDHafyFKYxEQQKKj7cXJjwDP1nY95IyNSYBsRZUyWgcRa9ADfw4KJUK20MGlrcCOKuiagovOICDCBxp6HiiEVHBxyfPIWXKlDTBjhda2TBVm0DPIwLdansAzWKGmvLIB7l6/bMSrihJDDsihAM9EZrGgso2Ut+ZdEDBfClEQRM8tGVQYGQ+HzqjgRlnIwzgN8Ospfjk94g/zyVWgceQL5HhuIc2NoW1L28JbvalsnmJh0l3hVtcCG+RkVoaSuQnRDYc0j4onIBJQdJGpY0T1LYUHUJFGWLrnoq2VkCdDkcWrPBlG9r4gh0wPhocGXWZbew7apiJWk9Zm60RFTCJXey4B8sYV/dNKvgT0aFkyUNMBg6NbvHyDg7g+uh1tUyh5x9pbnawg7QuRI03movPoa3p7AGW4xQMTbVe2YViXj3yRoX9Mv9+lvQv/JcczldfFGyl+g24WAsoaa8NCQHkYCJ8T2rKgD9JAoqsORhd0QI6WVUPA957jHZHvtlcRq2+gg74/siOdZQW2bK1L1L4KHJKvc64EiD4HSVdZclm9Z2iUjSUb6Gh7EZTph2A5WGVTy0skr6i8DwvaSPS7tbIWalvds2X5cDrjEWmnSBu2cGm+Pu6P8HCyhMcV+8b9DsbV/O5NwPredP4eHZYgHuMVPZ1hA+CjuxTwymHiOaCK40KuMZjWUbkUuP9wD9+42D2LGbGgIiPRxWGibFg5FqNGLHbPJW+5n+vCI6bl6b2fHE8KSo4igxSt+cMSlLn8dq4UBiKTkXn4iOcqQqzF8Rp49eYt2d3igSNjvQjNChycNJ6F7xGhljU8kFlTeTqtrMXw9NW8C0L24EV2dAgH2i5ax1s63unwwQSu8wZDI9iOGwyNS+jOa/3fn9KO6caNinbUw5JgyRa0GdDKAARRFLG2+AYFG5jnMkVchcfXxHTdiuOytZSOVejS2IC8iszeXe0HMdxtVeCKEiPNnUkG2A+Om8xTWFYdDUG3YsTNq8iJIKSPi+pBVy9ESKEF2uKAH5tk2RfHSBtBlVWETFl6wUuHki7U4CjbFgfbCmLZbiaLbd5mON9e+PEEpjPQPiyAd073cEq7DpssPVxyyLs7RlL1pxS/TcB2wKvTB90IuFQ8AB7bVBqrKnFRDwHaFy4KMEWtaALf4ylZbzlhtr0BQgB4ZdfFy5vQMitVUymn9+XDH22PAkoKo91U1iJRnifCA2zLY6Kl1/oovXtbPQ6R+pSK/LSQWlEs5+hAPQHPkWKhXk3AupkAcjMB5Ayy60lBbjLwvJqANU/3+ADOcvnQ2cH/GQF9zrFhrtWXU/xRin/+SK4dsrc6VSriWRfIspGFkpOWxoxaz4hLNToTAPVgsML+I6QGAT0UCCygtFb+I8dNGtnKWahcubo+gLSlqwWx6C2wQWUw6i2QLFfeltgEeFUsMuN1B1nuZ3Y8CdaztxmYXhf/1wXYrqfj1RTXWZp1FrcTuG6n2EMPlxuerGeFC8NwHMPwQoo/T/GvKNlbATwRcYtrykb7BGQhHgZca0SxEdh4FR6P5EcsO9QyQ6bRRTd6sfpErbXfkVH/5RKcrVaZZ1Eu8UoI4BmxtoC2ABdfXEYgi3j+v52AdDfF6+zcNvu9no4zuO4ygN1mxxyQt0XsNl8Pt45Yd8Emv6Xw+xR/mOKrtB9nAYeVAVxWP3wNlL3FIKzlZJGFJFpdksgKS6cgJJDF71mRiNehVYxQELY2S4m4l6XY4tUjIMrzquMTKOAN0DbSmcFUClC9zq7PabbF9esCgL1z+bN66OFCgb2D/4WHUQe9Qvstfl9recAKAMxaPz7iXkUGEVrWaHS0bmR+prezUmSN+cg3Bqxtt3VHRjWj3QRz2BWWKhXgqh132f/r7Pz14Zzk13fF9fIZPfTQwwWZoj08sfAO7Vf1+0GKr7dywJUBTBGhQheI8abLnQJsm5cq0reqLUHsjWL33scFoFrLD9eWRC1jDYRr50T5Lx1Ye+hWcA/PRpWdo34vWkZ+leKLKb65hAPm2wHrGxacTnPSRq7nA5G8qTBWvzS6ap4G4LVZCzXQ9YBYA2frd1dcXXH1cJfq86z134Wpy9uTCyvAYt4Vq8LlVm0NdLm4tmSnPLp7rUG6BF9avqTX0Z1ugnLOcu51dOdE9xbz9n8BBgASWdK5g1XGVgAAAABJRU5ErkJggg==";
  33793. this._image_arrow_reverse = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA4FpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDplMWFmZGVkNi00MTJhLTc5NDAtYjQxMC04NDExNjRiMzQ0ODciIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QThBQTYyN0ZCMjc2MTFFREIzM0E4RjQ4Q0YwQTgyMzgiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QThBQTYyN0VCMjc2MTFFREIzM0E4RjQ4Q0YwQTgyMzgiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIxLjAgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YmIzYjdkNGEtYmQwYi04YjRjLTkwNmQtMTRhMTNkNjEwZWUxIiBzdFJlZjpkb2N1bWVudElEPSJhZG9iZTpkb2NpZDpwaG90b3Nob3A6YWUwMWJjYWItYzAxZS04YTQyLTg4MjAtNDU1NmY4NDVmMjBiIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+EmbDrAAAEJdJREFUeNrsXTuPJEkRjujpmdnd2b1bYFkEAhwkpMPi7eCiQ+LuPAyEEMLhcQiQDgmEARL8AhxMDHxsHH4C+Hg4CAMDIYGziBMVZO1k7WRnZ0R8kdWz2zObKeVUVU898hEZX0RkZCQ/ubigkQ6UOGUZzfDc2mq096CRkUa6WRSNXEvjf61R4Y0Q2b1n5/anJ9vRJwdMchM51gsqsxzJOwaQHvF4Gl03UpjSuQJTNs6RY+vcAmiPgqU4SuN3Nu6pn6/vpaYAcXlX+it7zx5CAPh4yt9N+UdD5B9cdqRb2MVDEx+C2lXaFEC65M3e9WVdNo17qLimxrtQUK4BT4JAK8a79Puu+sh6PzsAbfU4eh83hIGWYLBb6upZXjkF8FrKP0z5zZQ/Mkbw4CQjje6/vroYFbs9dS4B86Q4X643jazdvylAe6OA9qYBrhYQWsCn3cPF+T7YcjpK6LseaCP3i6JRTwYga4KGouk/rTZaXsti4Akr1rUYAsMqC8DrKX875TdoTCUMrX6k0f3XXhc5VJ25ANNtAZ7pnNO5nFxd00mRN9X1SQW62+Ld1ADpqXGsAXJJUwDAIs+Vx6mhNUqwHaegOLqvqcrevPYUpBJ26iBgucT4vdayq3ex5J+l+qwlmrID/K2yMnC/oNaDHuB+JWv8P0j5s4PbjjTSSApz2xYgelacn+bz0+Ke1vW2AOJtA4ALcN1hwNLQ6ATTKoUqAPKeE0c71jRNUTRvD6AsIBADyFogwQ6AIMcIeCMAHRUErHl0ZF4dMa9b78/lFDa+L2A7tMo9BWik+p1dISQqAHws5a+l/HbKj4eqOZJLiiNdZ1q01gSccpZB9jQfl/Pz4nzJdwqwPasA+bQCWc3Ui4IeApbe8572Kw3iYwWgxKFWSwuManHeNy2Q9kaTOPXSwKp3zrlHSy4BDNXMyzZloF0toYDJd7SjgBZOQLvYNKKXuvWtloCItkfp9Ke2FyoAzEzhkxn4vzHY/kgm+d4+kD3LoHleHJff7uXjct26r8wL0G46gbNxnyAg7Wlz0wG0Me0+uQYq85hbbQHwTKceOEgQoJl057AImGvz59c0Ck2nC0SAsSwEqHUj8i2tv7W+pUa7liA7AZYAcjR9XdgRWKjQ2pEBywI8jhABYPYS/FLKP075M44JY6SRetK2ANN71fn9lO9mOrxbnN8rQDb9xudZCz4HwJQCGiqBYCrgdy0mEQE5URibKMylBSyTo915jDwyt6oxPA9E2Dm3NH1vbpsbWqsoJdO0X68fUS3dA3A22l2CVgkPG7yyS/D9njCDrGsXh75QS4vnG4GAMgP9x+AYQdf0E/AeBvjIznOeADB79s+Oft9M+UMdHT/S8aTTDKYX+fggHx/m45xfKc7vF0C7AO8W1IpQMEU0UNDbWFBty5ofZEcLbmkOEziAGRw/GuAJyCQQTcn5bcd7mQDNFxG2LOBH6hRhlhJoBwZaCtWEkekGASwmaN9pQoUlVEVAlp1xbD13ZfrfXzqHCCkofSA0JqBAbbUTg2MgMi4twQ39dlRw2HmvJQB8IeWfpvzFbLrs/eDtTfstcSeD6KsZWJfjo5TfW/3vYb5eQJZBCdUC0QjoSsXsraU7iObqMVbLgckzBzL5c55rrFKKRsZSRc5q1S3yXTkotelOQ+1nd9mxYVYUAjTuKIhbtIy8R8hehsVAm7cAaAKEC+kQxObb5nnY1vun9ruejUV07hrR/D0rQ49AgDgPlrCPll8DYDZ4j7XKAPX94ICiwri1gEuLCgMKR6v9vPpq/JaBMqvLAL+a8s9S/gQ4yJ5nupfB9P0pvy+D62ydeJx/e5R/f0++75zwtaM1o2ETbMVkEhbD84A+Im55modjOhNES/YGbO2tKo4Jc6qKxEGQtPquZWZEwFP7DOpVjWjZiBNaRNjSn69DgTRLxajzXI+w52nvHASwCMP3hCgUzHumLsrHUS18GYvsCBwC1Kc13iyTeY8JGp3TZ0f7RpwNifS1+Uy+74qQ7ZDI4Phkh883VkMIO+2D8lbNzB9RLqBVAB9M+Vspv5M1VW9wlum/hikqEDzBNO2g0Zs8k6VHpIjJkU2T3GVwCwl0kucbiswptjRAD+gQT1tkTi0aSMQyM0faHPm/xTBaXstEWJANhUaYC00OnSJwono1wVoTgBbx1KFfeV6WvCXgSxnyBZ33D5k0wXFCDlj0Wm487dYTJGVlu7ToF5nKWcrlOechJmzptE5EV2VooI2sXkBC8EZB1uOHETrRcDTSvlDfbIobPpfyb1L+RQP8EQmbi4GOgDgDxBQdgKz8xgEtEjGbeYO3Bf51Ga0wl8g1NcxKPVYai2ARKZgp7nTEnQyWgMFFjgk5aiJG+1EarxFQqyWDuS2XDJgwo3WghoUPmS+NMJ3yK0hYVqTNidYt2+qxOiCgzEFabwFb4B1sjePI8jEkLgEFtU82ymLRT9STXYzvInSEWi0JrCOTv6lP6/9s/I7wn640CwAfoEsnv9+l/GWDcLgxANsgJeoAYqBCHlPmQOcQ2V6n67UaHUQ5rmWwxVSteSNR+icCusi8Uk0L3txcb3v2vMVjwuibGHiHN6fp0UOLltmhFXTuMsI4OWhdQTScqGc7U3tumcE+ZpApinOftWGMHEB4RcBdwH7hhgVNW+/P1WcZsKwi1lOvLSLToBauRPi8p2R69BzhERq2eMKkF6CICfOVQKze7vTYPAXw65Tfot3lU0joQURjRADdezcDDeqBmOVUQgEmaAxIKGh5xCQbCVrSIkZ0Hr/H1N6zjCliSmv5Dfd6BaPmNc9aIAB9IVpMj8ORpqWX72yvv991/EOdsBzggaaU0PlyRNhsTeG0fD0kQGMe86SOtkKdYxFTsxfAhwxeUT0jmrVhopiDncVDJgfEEQ98hD45MA4j1iKEJ3GwnZhiFu+eUMzRlU4743ijAjmHGbllykL2OY7Ov4hjFSijL3HDbCaN+6yYz86cjiASoyWtevPh7GikvWDsCXYMCB8eYUfNaXGLDYcFUwaB2tJavb6MrNRQ+pq9cWNZ47gYyWJoVwyMcwnQDKJ9e2M/2o8REyriF4Bqodw5rjxLROT91jr2iBPyGq2bO9ug12rHYHsglhxv/r4WNiOR+lBlM7qK6CCr8WYB4Pt0uZ3vX5VPiaOdR5mSx4QY+C4FTFaL41EmKGkxZi6eZpBIjHsYnXdETVTWGlUBGYeA7ewJdhpYiwGMKHMXh2Fb1Magqdeia89EyyvGAzkCawn2rQ1FPCuX1p6IjwfiVc+geRUBlOhe6lHHKhS4PcHQmvZA55kRS5KAdEPgN3sEbu5oYw7wMwRoI4AYoTNkejDCs9Glx0jYbERpphV9Q4Y18akA8PeUf5vyV1L+fdCc6g02r2GQzpdOoo9oLHkAMKrlki3YCFP/sknUAUnzqxCKaWQ9dZaGaYw7Bi3qfISWmzrrboVaFZB+UdrUYi5QNYXEwPcsCxCqOTtty7SiXwQU9BgoKwFWNE1joyAv8KyOEdrzIvihfg89q18iIG3F/kAdC6NtXf+3Z4kbO/2AWJwlKGBxsI3Z4N1k8AWP/jkwnpt9WqwC4D+lP99J+Zcp/6tz0HNAo7I0CnYkr54EgJNQh8VC03Yjkd/QAYoyBwGYlQDaMjqtENW+BGCAVuAMDkjGa6wvVjkQJzVP0udA/3PFJhFth4GyOhqHRIUGDmpgFKBDxFqmMdm1MUw4MB5RK0uUR1lttMZ7noFzRINHhfT2+8TkC9b6fYuvWb4XkdUJiACH+JoxyGu8PlizVPYqAMuTi4vWA3MgoJ+n/Brhc/PzJkEfpctVBXMgng/TbrAezUENia2Nrmm1rAiexcGKaDWB1gkw+p4Zcx2dR7aes9YDR8oIhOBtlWMnAlb0vRIc2JOjya/dKAfdHwAtU3RLWWQnPuQ7E+mOc2v2MfA2FbKesTZu6WnDKA1QR9u3/78b9yM6hhDa4JXtb9WLKBbILDoevMBqGt+eqvb16hUJXYzu54A4hbYDFTG1lr4SyN/ZqKMn6HjOnc+e0QSAOWmhgDUgPaXjTPPqhiX07qN8nCMEPs7CycN8fj//PsdAmBtl22j4ySESCRDPmqiBIBBDAk6UGZECKMh3J5DxXBfgaO0+AXWlFQBtlbnRLyyN8Mw9ghRaV689NQbrtT3ar2u2G+4V6iJClSeY9AgPER4xrR67+2DUQxu9gsEa3nXIb3jPeXTChCsmPd9DlF5PQQ1ZoywBYE7aZkCtRjlWAeAmpHkq5m4WPuZQx6/Q1V4Bc0jjB1koWTbueTUfyx3ztp2DskeIiOxJ4DFNlPFqjHBS7mNQi0QZOVK3ifRoglMH+EXLI53PdAoqXaArnXWK0BGy10VUWOwBME+Dj7RppEyI0HAIUEXvYcAipT1v3cNgOTxAR33S6o2NohFue3zfPMFhTXRD8QQAoqvtgH+S8qczWLXW4w4B4CYnbEZp2fN+2Zr3ohJEyusH+d5y+9672SJzVtBLr3m2cT+XexusmWpAtaFDaX+HAnOj3Grb9AJO77bHqNXALs+VyV0UZh6d9ukRsiLadKStvBgHiBUCsXagZW7RjyO47O0oGVEsKDBOkSkGMqyXUYuBrHjWExYQS4J3D0esErYAcFXNmVl/KuXvpfz13Rc96+izgaIjHYkoc14IK4vQcScLIeeFEHOaj2fVfaf5+jTn+fcTAACmgCaGaINTh7a1dj6/R+CJmOFbYBed70fKjW4vjQJ1r6WmVzDy/AqY4r4RnjUHEWx6rIsR4Eetikhdestujd2Ipr5ipdveTqSIMKAFAFpWue1t/rY1WenVre+m/MeU/5nyX1J+my7nzctNT45JUx3p5U0zdfwn538fcTm3Od/Jx7Min1fn51kQOauEkvJ6m4WU5fqEsI1GagZiMTJrsySieIRNVsBMX3XiO4N5dSGD4Vtm1hoUDrFHuxG+N31H1LKx044tM7AV26DeLY8I22iHwTbUVn71cPneXQx7o1MeIupodBe/cmfISIRFZzO7/YiQyBRAneZ56TfpMoDQ5+n4nQBHGhLVSP3Esa1yKXBsi/NFQNlUQshZPm4LIWU5bnI+KSwsh7Z4oJaNXl8DxMrQ40/Qqbk/G88Rh75JAcs1/kOW1SKqjaNWgbaVYFdoZMId+CZHiNDKiewsiTqMW/2NRBM0HQR7BIAlvU6XWwe/VWgeIw1BYaSRnncqhYg6b8HfNvn3WiA5qYQVLs4twIwuRaWAw2IEFFF/AUR4QQQfpKxr6oPWAxEeiGK+A9Hl6hG/AFEsBl55kT1fVGFhu4L3/yHlv6X8j5TfGDzotqcB/iMdbZpyfvfIJehNJUhUVhDhQgAp/8/Fb5uGMKIdl+9agYO0zZusQa9NOSCmew8gUY3Dm9rQmJi2MRFS7poZRsvYalukHtrUhXL+9NSaynmWMAFAr+KfU/5Vyk9ebs028I6hSA/rx0gvqwT9v5yPndg3tB9JcqNcbxrP1cJHKyqlFvu+tRcDExZ2WByQZ2Ng90Q7RdgGg2AeES5qfw2kqM33rZkCGDx1pBfX6dFXDXobpDTSbeo0K6S2F2obDb/bCv+NOBIigYy8CLgtE34dO4FVwWd/Q/Wmc+j2hdGCDFp/OZWgAzWqDHp7qYlXXvaBeBPrJYd+mdyQjrJ+4+DzJfBPDYKo91Uw9wz5vwADAFVdqz1vyN8hAAAAAElFTkSuQmCC";
  33794. this._image_h_l_r = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAABIklEQVR4nO3WbQuCMBiG0dn//80tiAp6WT4zi+A+54vTTdMKuZZ20Y/H2/is9/r+aFxdNz5/qa7t1/Gr+dlj79ZX5mrnvz93p+3T9zKznbnnynW/OPfwnLXP/v2xqXvolXv8dH7Ld7Vhvs+cf/2v/d/vd3dfq8/0zbm1a1d/18L2o3fIzHbtnVi51p5zK8f6q3Xj8cza8XjrusH+oQEAcQQAAAQSAAAQSAAAQCABAACBBAAABBIAABBIAABAIAEAAIEEAAAEEgAAEEgAAEAgAQAAgQQAAAQSAAAQSAAAQCABAACBBAAABBIAABBIAABAIAEAAIEEAAAEEgAAEEgAAEAgAQAAgQQAAAQSAAAQSAAAQCABAACBBAAABBIAAJCmtXYCutDwWwUr9cEAAAAASUVORK5CYII=";
  33795. this._image_h_r_l = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAAAAXNSR0IArs4c6QAAAFBlWElmTU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQAAAABAAAAJgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACAKADAAQAAAABAAAAIAAAAACVLBWUAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgoZXuEHAAAC90lEQVR4Ae3WzVbbMBAG0PzBgcOa93/M7nCj2F8zUUILdDmXjWTNSLauBMz+19vbstvvl139+c5zza39sd7hUNe99mveZ/3dbs3/LF7W3j/IXbZ5hzI/Yzf7TXxux/fPY3n+W+wrOfP3Zs5P26wXk22d/bzenJf8jNf82h/73XLOh7KeS51b++fEw/R8uQfzetvzsubmbtyuPXLmteo6W/9Qv2lZ7te4fde6l6xT52Ysbf22jK3t+o7j8frdt/H1HTWe96RdY+v8OnfrX84u45kznrPm6Cde2/THnPRrW/vjK+e8OT6e61j6OZcaH/ZbfDvXy+/Qsc5Jv55TxtKOWNY/t39+bx/NSV6dk3VGrM4Zu/2fsbFW/Ou69RvGO2rOFlvq2Pwdc2w8Z/0tdpqeL/HTab0/iaWd1xt5iaWd587PyXt6evyOOT939LP8jCcv66d9fn78nsSH2cvLv3OS//p6mzvmJza3Izb+D64/ae/zR/zR3IyN+MfH/fz39+tY9j9yv9//6pw57+45/xvOfzv9ECBAgAABAt0EFADdTtx+CRAgQIDAWUAB4BoQIECAAIGGAgqAhoduywQIECBAQAHgDhAgQIAAgYYCCoCGh27LBAgQIEBAAeAOECBAgACBhgIKgIaHbssECBAgQEAB4A4QIECAAIGGAgqAhoduywQIECBAQAHgDhAgQIAAgYYCCoCGh27LBAgQIEBAAeAOECBAgACBhgIKgIaHbssECBAgQEAB4A4QIECAAIGGAgqAhoduywQIECBAQAHgDhAgQIAAgYYCCoCGh27LBAgQIEBAAeAOECBAgACBhgIKgIaHbssECBAgQEAB4A4QIECAAIGGAgqAhoduywQIECBAQAHgDhAgQIAAgYYCCoCGh27LBAgQIEBAAeAOECBAgACBhgIKgIaHbssECBAgQEAB4A4QIECAAIGGAgqAhoduywQIECBAQAHgDhAgQIAAgYYCCoCGh27LBAgQIEBAAeAOECBAgACBhgK/AX08dE/3SOoSAAAAAElFTkSuQmCC";
  33796. this._image_v_b_t = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAADcklEQVR4nO3di27bMAyFYdpWLuv2/o+aJfFFgxOp5VjKdjDM6rD/A4KkbZyhwIBzTMluE/s+CAAA+J/EIH1/SL9ws/KLR/5rAADwZb2S4zHIMBzVN9YOzh8QN74XAAD8HTmLt2Z3Ns3PId7vR/MB9oPihtcAAGBfOq9Lr3WOR/0Icrt5BaAxb14rAwAA4OsUAC/HPxWAk4i0hSmAF/iT8zMAALCvnNXtQiHwwn/O8WkuAGdTALy1hFhoEQAAoA5ver+W4aoAXK8UAAAA/j1/UgDGED8mAHYZQB/ofYBQAgAAqMIL/qXN/L+F/6MAyPX6TUS6lQLgPYQCAABAFaUCsJbjY3oMQS4XXQDaFwoAywAAANRRCv6lApDP/odHAYi3Wy4A3YYCMFEAAACozgv9tUn+qApAnycA4cUCMFEAAACoxgv+LQVgSI8Q5OdPWwDawoE2/CcKAAAAVZTC3zuRn5wC0M0F4LuIHJx9AHb3/2TCnwIAAEAdugC0zmtRWW4LwP0xAYjPCcAhTQHswZ9uHOAUAQAAsC971t8WLunXBeD97H9+X14COBT2Adj1flsCKAAAAOzPC35vGcBb/291ATguFIBS8FMAAACoo1QASpP8993/7wUgLQGcUgEICxMAHfojVwIAAFCNLQDdCwUgPDcBXi5vqQAcCgUgOsFv9wIAAID9NE74ezf1swXgnt7X6CWAo7oh0FIBGLkSAACAqvJGPxv+paX8UW8AnH+Q7wR4NhsBvQIwqgnASAEAAKAaO/7fUgB6lfEx3wnwbDYCLhWAkQIAAEBVXgHwbuufc3xQ9/xJBeB6PacCcFooAF74jxQAAACqWAp/fVdfXQD6lO+PE/ggH0sA+koAUQdKOpACAADA1/BKARC1AbDNpSDE5wQgXwrYpQKwNgEYKQAAAFRTKgD27/roCYC+1f84TwDOZg9AMAfa9f+BCQAAAFW16iqAYJ717YBzjg9qiX96/jng2+2Uzv6PqgSUJgCDKQHcDRAAgP3Zs/9gvvY2Abb6ioC5AOTgP5vw17p0QKueKQAAANThFYCgzvytLn2dpwHHEO/3tfCX9P2ggr8zlwICAIB9NGb8vxT8OsePefw/XxIYpO9/mJ3/S/LGgqDW/ikAAADsp9kQ+J45v9/S9+NcALaGv5X/4W77IQAAoLI3EWl/AQ/TsX9wLtbWAAAAAElFTkSuQmCC";
  33797. this._image_v_t_b = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAAgCAYAAABkS8DlAAAAAXNSR0IArs4c6QAAAFBlWElmTU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQAAAABAAAAJgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACAKADAAQAAAABAAAAIAAAAACVLBWUAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNi4wLjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgoZXuEHAAAHhUlEQVR4Ae2d2W7bSBREucmy7IcA+f+fnAePtXCZqr68IhVLSGLATIA5DbS72QspHT9U9UbV79++vVdV9axIgAAEIAABCEDgf0Kgq3a7f/RdR8WXT37nSf0yfvIWdIMABCAAAQhA4DcJNHP7+jf7uXlvA/CmTHb2TEDe0A3uhRT7XpWOg+JU1bXLCRCAAAQgAAEIbEFgmqzXjq1iN+d/ruF13dfT9NbVT08XdXI8zZ33StMQKHsN94R/UMNBFZ5BIEAAAhCAAAQgsBEB6W8j/U0T4MF4GgGnj3TcA/ej4rmr9vuzM4rpHpQteXfOG1j8ffOMvSos/CWqHAMgCAQIQAACEIDAVgRW4m8TYB1uNRs/VtNkA5AmYK3jFv+zCs7qe+6m/f6ki92qsW+SZsAdLf6OLrcBKNP+Kuj1oEEPyjpVESAAAQhAAAIQ2IhALR1uZsH3TH4n0W4lymkAbAys4w7W8F5t+6muPeg/dbUMgAp25SYh9BZ5G4BavUpH3cwd0wBY9Ici/mEI7DZcR4AABCAAAQhAYCsCtWX6ugfAot9rTO5ZgDQAax33YN0GwPrtJf9j18gAyA3kVEGO5m0AHIoB0J8QeU8thOjnUoDTNAduT4AABCAAAQhAYAsC0xQzADHi92g/xD+WAH7UcQ3xp75qGpuAMADT4XDUbsBaJqCeR/Ke4i8zAEqLAVCaIn9rAGIJYJTjcDkBAhCAAAQgAIGNCEi2lxmAZSkgR/85sE8d9wA/l/FPujh6E+BRmUYi3tSNNhTaIaQBsLtw8BG/2FhwHfmrj5cCxkblaoQBKKD4AwEIQAACENiIQAzcGwlwGf3rsq3GMZcAYv1/reOzAZB+n1UpA/Dy4uMAthFW+0E32in94BzUwSI/qFNJnVcc53KXESAAAQhAAAIQ2I6A5Lpq9MfRum0zUGYAXKZr1zs6eMe+Ndyn+C7KH7v6+fmoYo3xPZxvBqVlF6HLZAuio+rKDIA6W/B1A5//TyOgonJKoDyBPxCAAAQgAAEIbELAS/eN9NknAWppeCsNb10m+S5lNzpuDdfSvTS8HP/vqsPhXY2t4EXY9ZG9/u8phFqL+8UA6E7aJFDW+Yvou63arDcA2gQQIAABCEAAAhDYjoA12iP9YgK0lu+0GIC57J6O9xLsi3T/1E0vL+8e/auxR/flHKHyZQlAdy4GQOWut+hnXIu/y1xPgAAEIAABCEBgOwIxUz9q/C7h1+g+zEBcF3NwR8fLuwDU/tQ1h8O/cgLe0NdrE6BfCNQpbwdxuwRg8W+8vHA1Abn730cEMQDb/cN5EgQgAAEIQCAJlNG/hD7Ef53e03Gf3ov3BehVwN4DMIu6VDxmAGQAtALgtYUyAyCnYIVPob8xAaWvTwkQIAABCEAAAhDYmkARfonwYgBm4S+m4KOOFwMgXb/EEsA4xuheGwD1yTtVWNFjA4G/ii9jlL+IfxwLtPCPpd7tCBCAAAQgAAEIbEkgtNrr/2kCmqaUze/3uQ7kVT/qmKB13C8EunRtnAKwiNsVxAZAO4b5BldxTwOwFv6cFfD7AwgQgAAEIAABCGxLYPSreDRgT81OI+BZfEeHmBGYZvH3gN96X2YAvAegV7uz0usJAFXaTSwhDYDTtQmIlwdhABZS5CAAAQhAAALbELDIW/Rz4G5DkGYgDcDySXIGwL8H0PsYoN8DMEjXPfUf7wBwp3AVS7dZ6DWlEHsBMg1DgAFYSJGDAAQgAAEIbEMgRvf5PoCSSsLzdEDMAOQnkY5PsQQwGwAdA5TY+6d9y+hfSh5vAfzROcQMwDL693WO/qMuH0EKAQhAAAIQgMAWBNZi77xmA8rav4/x39PxeKePlwCGbtrtjmqT7//3C4CaMvq/19GC7zP/FnwMwBb/Wp4BAQhAAAIQeEzAWu3oWfvMW/zzet0zdPu6DNB1r69HqX+e/S9vANQ97joH9Q3hb9vFBPjmLidAAAIQgAAEILAtAeu1Q+r2oDf1W8QVStn601jEFTR7P1bDMJQfA+r860F++Y83DrhT39feFbju17mTQ9ct4p9lma47kIcABCAAAQhA4GsJpFan4M8a7ofe1XFruPcBKHZV256qp6dWbiDE352fnrQb8NYAlG9goc/oAud9MwIEIAABCEAAAn+GgAbt19H+rOG+9sa+m5D67bRtZQBeX09l5H+5LAbAN/hVA+A9AQQIQAACEIAABP4MgU4H+FKzU7/zev2J1gZAmwE7jfaP89T/YgC8gcAhb+BOS4h8HCWo1H9dt7QiBwEIQAACEIDA1xM4n0OzvYwfYVnC/6jjMZO/28kANM1ZsdZvAoSDyMaR5k2iQ36NtSFY57OeFAIQgAAEIACBbQgcDqnVy8DdT36k4/NMQFd9/352s+rt7Z4BWD78Wugf5ZfW5CAAAQhAAAIQ2IJADtz9rEd516V2Xw3A6WQDUFX7fU4d3N6gVN75M9/g5mF3mlEEAQhAAAIQgMAXErAeW/jX4v/ocWkCVK/f+Z2ena7arvOr4muWNf8rCjIQgAAEIACBv47AL+m4TwlcFH/W+K/7dnwgCEAAAhCAAAQ+T+A/hVJn6rP9qnIAAAAASUVORK5CYII=";
  33798. this._sketchTempPoints = [];
  33799. this._sketchPoints = [];
  33800. this._sketchOutputPoints = [];
  33801. this._sketchWallHeights = [];
  33802. this._drawEntity = void 0;
  33803. this._lineLabel = void 0;
  33804. this._polygonLabel = void 0;
  33805. if (options2 && options2.isDrawPoint)
  33806. this._isDrawPoint = options2.isDrawPoint;
  33807. else
  33808. this._isDrawPoint = false;
  33809. if (options2 && options2.isRetainDrawPoint)
  33810. this._isRetainDrawPoint = options2.isRetainDrawPoint;
  33811. else
  33812. this._isRetainDrawPoint = false;
  33813. this._param = {
  33814. lineWidth: 3,
  33815. lineColor: "rgba(0,255,0,0.75)",
  33816. outlineWidth: 2,
  33817. outlineColor: "rgba(255,255,255,1)",
  33818. polygonColor: "rgba(0,255,0,0.5)",
  33819. wallHeight: 30,
  33820. power: 0.25,
  33821. odlineHeight: 1e3,
  33822. odlineCount: 50,
  33823. text: "\u91D1\u7530\u4EA7\u4E1A\u96C6\u56E2",
  33824. duration: 1500,
  33825. count: 1,
  33826. direction_h: "horizontal",
  33827. direction_v: "vertical",
  33828. order_add: "+",
  33829. order_minus: "-",
  33830. houseColor: "rgba(0,255,0,0.95)"
  33831. };
  33832. if (options2 && options2.iconType) {
  33833. switch (options2.iconType) {
  33834. case DrawTools.IconType.Normal:
  33835. this._sketchPointImage = this._iconNormal;
  33836. break;
  33837. case DrawTools.IconType.Blue:
  33838. this._sketchPointImage = this._iconBlue;
  33839. break;
  33840. case DrawTools.IconType.Green:
  33841. this._sketchPointImage = this._iconGreen;
  33842. break;
  33843. case DrawTools.IconType.Violet:
  33844. this._sketchPointImage = this._iconViolet;
  33845. break;
  33846. default:
  33847. this._sketchPointImage = this._iconNormal;
  33848. break;
  33849. }
  33850. } else {
  33851. this._sketchPointImage = this._iconNormal;
  33852. }
  33853. this._canvasWidth = this._viewer.scene.canvas.width;
  33854. this._canvasHeight = this._viewer.scene.canvas.height;
  33855. if (this._isRuntimeApp()) {
  33856. this._viewer._cesiumWidget._supportsImageRenderingPixelated = Cesium.FeatureDetection.supportsImageRenderingPixelated();
  33857. this._viewer._cesiumWidget._forceResize = true;
  33858. if (Cesium.FeatureDetection.supportsImageRenderingPixelated()) {
  33859. this._viewer.resolutionScale = 2.6;
  33860. }
  33861. }
  33862. }
  33863. _arcToDegree(arc) {
  33864. return arc / Math.PI * 180;
  33865. }
  33866. _toColor(red, green, blue, alpha) {
  33867. let normalColor = new Cesium.Color(0, 0, 0, 1);
  33868. if (typeof red != "number")
  33869. return normalColor;
  33870. if (typeof green != "number")
  33871. return normalColor;
  33872. if (typeof blue != "number")
  33873. return normalColor;
  33874. if (typeof alpha != "number")
  33875. return normalColor;
  33876. if (red < 0 || red > 255 || green < 0 || green > 255 || blue < 0 || blue > 255 || alpha < 0 || alpha > 1)
  33877. return normalColor;
  33878. return new Cesium.Color(red / 255, green / 255, blue / 255, alpha);
  33879. }
  33880. _toColorFromArray(array) {
  33881. if (!array || array.length === void 0 || array.length === 0)
  33882. return new Cesium.Color(255 / 255, 255 / 255, 255 / 255, 1);
  33883. let r2 = 255, g = 255, b = 255, a = 1;
  33884. if (array.length === 1) {
  33885. r2 = parseInt(array[0]);
  33886. } else if (array.length === 2) {
  33887. r2 = parseInt(array[0]);
  33888. g = parseInt(array[1]);
  33889. } else if (array.length === 3) {
  33890. r2 = parseInt(array[0]);
  33891. g = parseInt(array[1]);
  33892. b = parseInt(array[2]);
  33893. } else if (array.length >= 4) {
  33894. r2 = parseInt(array[0]);
  33895. g = parseInt(array[1]);
  33896. b = parseInt(array[2]);
  33897. a = parseFloat(array[3]);
  33898. }
  33899. return new Cesium.Color(r2 / 255, g / 255, b / 255, a);
  33900. }
  33901. _updateScene() {
  33902. this._viewer.scene.requestRender();
  33903. }
  33904. _getScreenClickPosition(screenPosition) {
  33905. let resCartesian = void 0;
  33906. let ray = this._viewer.scene.camera.getPickRay(screenPosition);
  33907. let position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  33908. Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  33909. if (Cesium.defined(position2)) {
  33910. resCartesian = {
  33911. x: position2.x,
  33912. y: position2.y,
  33913. z: position2.z
  33914. };
  33915. }
  33916. return resCartesian;
  33917. }
  33918. _getScreenClickPositionAndHeight(screenPoint) {
  33919. var lng = void 0, lat = void 0, height2 = void 0;
  33920. var ray = this._viewer.scene.camera.getPickRay(screenPoint);
  33921. var position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  33922. var cartographic = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  33923. cartographic = Cesium.Cartographic.fromCartesian(position2);
  33924. var feature2 = this._viewer.scene.pick(screenPoint);
  33925. if (feature2 === void 0 && Cesium.defined(cartographic)) {
  33926. lng = this._arcToDegree(cartographic.longitude);
  33927. lat = this._arcToDegree(cartographic.latitude);
  33928. height2 = cartographic.height;
  33929. } else {
  33930. var cartesian = this._viewer.scene.pickPosition(screenPoint);
  33931. if (Cesium.defined(cartesian)) {
  33932. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  33933. if (Cesium.defined(cartographic)) {
  33934. lng = this._arcToDegree(cartographic.longitude);
  33935. lat = this._arcToDegree(cartographic.latitude);
  33936. height2 = cartographic.height;
  33937. }
  33938. }
  33939. }
  33940. return {
  33941. lng,
  33942. lat,
  33943. height: height2
  33944. };
  33945. }
  33946. _transfromFromScreenPoint(screenPosition) {
  33947. let location = this._getScreenClickPositionAndHeight(screenPosition);
  33948. if (location.lng != void 0) {
  33949. var cartesian = Cesium.Cartesian3.fromDegrees(location.lng, location.lat, location.height);
  33950. return {
  33951. gLocation: location,
  33952. sLocation: cartesian
  33953. };
  33954. } else {
  33955. return {
  33956. gLocation: void 0,
  33957. sLocation: void 0
  33958. };
  33959. }
  33960. }
  33961. _removeEntityByName(entityName) {
  33962. var entities2 = this._entities;
  33963. if (!entities2 || !entities2.values)
  33964. return;
  33965. var delEntitys = [];
  33966. for (var i2 = 0; i2 < entities2.values.length; i2++) {
  33967. if (entities2.values[i2].name == entityName) {
  33968. delEntitys.push(entities2.values[i2]);
  33969. }
  33970. }
  33971. for (var i2 = 0; i2 < delEntitys.length; i2++) {
  33972. entities2.remove(delEntitys[i2]);
  33973. }
  33974. this._updateScene();
  33975. }
  33976. _removeEntityByObject(objEntity) {
  33977. if (!Cesium.defined(objEntity))
  33978. return;
  33979. this._entities.remove(objEntity);
  33980. }
  33981. _createPoint(coord, label) {
  33982. let _self = this;
  33983. let entity = new Cesium.Entity({
  33984. name: _self._sketchEntityName + "_Point",
  33985. position: coord,
  33986. billboard: {
  33987. image: _self._sketchPointImage,
  33988. horizontalOrigin: Cesium.HorizontalOrigin.center,
  33989. verticalOrigin: Cesium.VerticalOrigin.bottom,
  33990. scale: 0.5,
  33991. pixelOffset: new Cesium.Cartesian2(0, -11),
  33992. disableDepthTestDistance: Number.POSITIVE_INFINITY
  33993. }
  33994. });
  33995. if (label) {
  33996. entity.label = {
  33997. text: label,
  33998. font: "12px sans-serif",
  33999. fillColor: this._toColor(255, 255, 255, 1),
  34000. outlineColor: this._toColor(0, 154, 94, 1),
  34001. style: Cesium.LabelStyle.FILL_AND_OUTLINE,
  34002. outlineWidth: 1,
  34003. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  34004. pixelOffset: new Cesium.Cartesian2(0, -28),
  34005. showBackground: true,
  34006. backgroundColor: this._toColor(0, 0, 0, 0.6),
  34007. disableDepthTestDistance: Number.POSITIVE_INFINITY
  34008. };
  34009. }
  34010. this._entities.add(entity);
  34011. this._pointEntitys.push(entity);
  34012. this._updateScene();
  34013. }
  34014. _removePointEntitys() {
  34015. this._removeEntityByName(this._sketchEntityName + "_Point");
  34016. this._pointEntitys = [];
  34017. }
  34018. _callUpdaeEllipseCenterPosition() {
  34019. let _self = this;
  34020. return function() {
  34021. let point1cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[0]);
  34022. let point2cartographic = Cesium.Cartographic.fromCartesian(_self._sketchTempPoints[1]);
  34023. _self._sketchEllipseCenterPosition = Cesium.Cartesian3.fromDegrees(
  34024. Cesium.Math.toDegrees(
  34025. point1cartographic.longitude
  34026. ),
  34027. Cesium.Math.toDegrees(point1cartographic.latitude),
  34028. point2cartographic.height
  34029. );
  34030. return _self._sketchEllipseCenterPosition;
  34031. };
  34032. }
  34033. _callUpdateEllipseMinorAxis(positions) {
  34034. let _self = this;
  34035. return function() {
  34036. if (positions === void 0 || positions.length === void 0 || positions.length < 2) {
  34037. _self._sketchEllipseRadius = 0;
  34038. } else {
  34039. _self._sketchEllipseRadius = _self._calculateEllipseMinorAxis(positions[0], positions[1]);
  34040. if (_self._sketchEllipseRadius <= 0)
  34041. _self._sketchEllipseRadius = 1;
  34042. }
  34043. return _self._sketchEllipseRadius;
  34044. };
  34045. }
  34046. _calculateEllipseMinorAxis(position1, position2) {
  34047. let point1cartographic = Cesium.Cartographic.fromCartesian(position1);
  34048. let point2cartographic = Cesium.Cartographic.fromCartesian(position2);
  34049. let geodesic = new Cesium.EllipsoidGeodesic();
  34050. geodesic.setEndPoints(point1cartographic, point2cartographic);
  34051. return geodesic.surfaceDistance;
  34052. }
  34053. _calculateEllipseOutlineCoordinate(position1, position2) {
  34054. let positionCenter = position1;
  34055. let positionRotate = position2;
  34056. let ellipseOutlineCoordinates = [];
  34057. for (let angle = 5; angle < 360; ) {
  34058. let newPosition = this._rotatedPointByAngle(positionRotate, positionCenter, angle);
  34059. ellipseOutlineCoordinates.push(newPosition);
  34060. angle = angle + 5;
  34061. }
  34062. ellipseOutlineCoordinates.push(ellipseOutlineCoordinates[0]);
  34063. return ellipseOutlineCoordinates;
  34064. }
  34065. _callEllipseOutlineCoordinate(positions) {
  34066. let _self = this;
  34067. return function() {
  34068. _self._ellipseOutlineCoordinates = _self._calculateEllipseOutlineCoordinate(positions[0], positions[1]);
  34069. return _self._ellipseOutlineCoordinates;
  34070. };
  34071. }
  34072. _rotatedPointByAngle(position_A, position_B, angle) {
  34073. var localToWorld_Matrix = Cesium.Transforms.eastNorthUpToFixedFrame(position_B);
  34074. var worldToLocal_Matrix = Cesium.Matrix4.inverse(localToWorld_Matrix, new Cesium.Matrix4());
  34075. Cesium.Matrix4.multiplyByPoint(worldToLocal_Matrix, position_B, new Cesium.Cartesian3());
  34076. var localPosition_A = Cesium.Matrix4.multiplyByPoint(worldToLocal_Matrix, position_A, new Cesium.Cartesian3());
  34077. var new_x = localPosition_A.x * Math.cos(Cesium.Math.toRadians(angle)) + localPosition_A.y * Math.sin(Cesium.Math.toRadians(angle));
  34078. var new_y = localPosition_A.y * Math.cos(Cesium.Math.toRadians(angle)) - localPosition_A.x * Math.sin(Cesium.Math.toRadians(angle));
  34079. var new_z = localPosition_A.z;
  34080. return Cesium.Matrix4.multiplyByPoint(
  34081. localToWorld_Matrix,
  34082. new Cesium.Cartesian3(new_x, new_y, new_z),
  34083. new Cesium.Cartesian3()
  34084. );
  34085. }
  34086. _callUpdateRectangleCoordinates(positions) {
  34087. let _self = this;
  34088. return function() {
  34089. let g0 = Cesium.Ellipsoid.WGS84.cartesianToCartographic(positions[0]);
  34090. let g1 = Cesium.Ellipsoid.WGS84.cartesianToCartographic(positions[1]);
  34091. let lng0 = Cesium.Math.toDegrees(g0.longitude);
  34092. let lat0 = Cesium.Math.toDegrees(g0.latitude);
  34093. let lng1 = Cesium.Math.toDegrees(g1.longitude);
  34094. let lat1 = Cesium.Math.toDegrees(g1.latitude);
  34095. _self._rectangleCoordinates = [0, 0, 1, 1];
  34096. if (lng0 < lng1) {
  34097. _self._rectangleCoordinates[0] = lng0;
  34098. _self._rectangleCoordinates[2] = lng1;
  34099. } else {
  34100. _self._rectangleCoordinates[0] = lng1;
  34101. _self._rectangleCoordinates[2] = lng0;
  34102. }
  34103. if (lat0 < lat1) {
  34104. _self._rectangleCoordinates[1] = lat0;
  34105. _self._rectangleCoordinates[3] = lat1;
  34106. } else {
  34107. _self._rectangleCoordinates[1] = lat1;
  34108. _self._rectangleCoordinates[3] = lat0;
  34109. }
  34110. let rectangle = Cesium.Rectangle.fromDegrees(
  34111. _self._rectangleCoordinates[0],
  34112. _self._rectangleCoordinates[1],
  34113. _self._rectangleCoordinates[2],
  34114. _self._rectangleCoordinates[3]
  34115. );
  34116. let res = _self._calculateRectangleOutlineCoordinates(rectangle);
  34117. _self._rectangleOutlineCoordinates = res.cPoints;
  34118. _self._sketchOutputPoints = res.gPoints;
  34119. return rectangle;
  34120. };
  34121. }
  34122. _calculateRectangleOutlineCoordinates(rectangle) {
  34123. let south_east = Cesium.Rectangle.southeast(rectangle);
  34124. let se2 = Cesium.Cartographic.toCartesian(south_east);
  34125. let south_west = Cesium.Rectangle.southwest(rectangle);
  34126. let sw = Cesium.Cartographic.toCartesian(south_west);
  34127. let north_east = Cesium.Rectangle.northeast(rectangle);
  34128. let ne2 = Cesium.Cartographic.toCartesian(north_east);
  34129. let north_west = Cesium.Rectangle.northwest(rectangle);
  34130. let nw = Cesium.Cartographic.toCartesian(north_west);
  34131. let gPoints = [];
  34132. gPoints.push({
  34133. lng: Cesium.Math.toDegrees(south_west.longitude),
  34134. lat: Cesium.Math.toDegrees(south_west.latitude),
  34135. height: south_west.height
  34136. });
  34137. gPoints.push({
  34138. lng: Cesium.Math.toDegrees(south_east.longitude),
  34139. lat: Cesium.Math.toDegrees(south_east.latitude),
  34140. height: south_east.height
  34141. });
  34142. gPoints.push({
  34143. lng: Cesium.Math.toDegrees(north_east.longitude),
  34144. lat: Cesium.Math.toDegrees(north_east.latitude),
  34145. height: north_east.height
  34146. });
  34147. gPoints.push({
  34148. lng: Cesium.Math.toDegrees(north_west.longitude),
  34149. lat: Cesium.Math.toDegrees(north_west.latitude),
  34150. height: north_west.height
  34151. });
  34152. gPoints.push({
  34153. lng: Cesium.Math.toDegrees(south_west.longitude),
  34154. lat: Cesium.Math.toDegrees(south_west.latitude),
  34155. height: south_west.height
  34156. });
  34157. return {
  34158. cPoints: [sw, se2, ne2, nw, sw],
  34159. gPoints
  34160. };
  34161. }
  34162. _callUpdateRectangleOutlineCoordinates() {
  34163. let _self = this;
  34164. return function() {
  34165. return _self._rectangleOutlineCoordinates;
  34166. };
  34167. }
  34168. _materialTextImageProperty(options2) {
  34169. this._canvasId = "canvasJt";
  34170. let canvasObj = document.getElementById(this._canvasId);
  34171. if (canvasObj != null) {
  34172. document.body.removeChild(canvasObj);
  34173. }
  34174. canvasObj = document.createElement("canvas");
  34175. canvasObj.id = this._canvasId;
  34176. canvasObj.setAttribute("width", "1024px");
  34177. canvasObj.setAttribute("height", "256px");
  34178. document.body.appendChild(canvasObj);
  34179. let context = canvasObj.getContext("2d");
  34180. context.fillStyle = options2.color === void 0 ? "rgba(255,0,0,1)" : options2.color;
  34181. context.font = "bold 240px \u5FAE\u8F6F\u96C5\u9ED1";
  34182. context.textAlign = "left";
  34183. context.textBaseline = "bottom";
  34184. context.fillText(options2.text, 12, 250, 1e3);
  34185. let textMaterial = new Cesium.ImageMaterialProperty({
  34186. image: canvasObj,
  34187. transparent: true
  34188. });
  34189. textMaterial._param = {
  34190. color: context.fillStyle,
  34191. text: options2.text
  34192. };
  34193. return textMaterial;
  34194. }
  34195. _materialColorProperty(options2) {
  34196. let mColor = "rgba(0,255,0,1)";
  34197. if (options2 !== void 0 && options2.color !== void 0)
  34198. mColor = options2.color;
  34199. let colorMaterial = new Cesium.ColorMaterialProperty(Cesium.Color.fromCssColorString(mColor));
  34200. colorMaterial._param = {
  34201. color: mColor
  34202. };
  34203. return colorMaterial;
  34204. }
  34205. _materialPolylineArrowProperty(options2) {
  34206. let mColor = "rgba(0,255,0,1)";
  34207. if (options2 !== void 0 && options2.color !== void 0)
  34208. mColor = options2.color;
  34209. let colorMaterial = new Cesium.PolylineArrowMaterialProperty(Cesium.Color.fromCssColorString(mColor));
  34210. colorMaterial._param = {
  34211. color: mColor
  34212. };
  34213. return colorMaterial;
  34214. }
  34215. _materialPolylineGlowProperty(options2) {
  34216. let mColor = "rgba(0,255,0,1)";
  34217. if (options2 !== void 0 && options2.color !== void 0)
  34218. mColor = options2.color;
  34219. let power = 0.25;
  34220. if (options2 !== void 0 && options2.power !== void 0 && typeof options2.power === "number")
  34221. power = options2.power;
  34222. let colorMaterial = new Cesium.PolylineGlowMaterialProperty({
  34223. color: Cesium.Color.fromCssColorString(mColor),
  34224. glowPower: power
  34225. });
  34226. colorMaterial._param = {
  34227. color: mColor,
  34228. power
  34229. };
  34230. return colorMaterial;
  34231. }
  34232. _materialPolylineOutlineProperty(options2) {
  34233. let mColor = "rgba(0,255,0,1)";
  34234. let outlineColor = "rgba(255,255,255,1.0)";
  34235. let outlineWidth = 1.2;
  34236. if (options2 !== void 0 && options2.color !== void 0)
  34237. mColor = options2.color;
  34238. if (options2 !== void 0 && options2.outlineColor !== void 0)
  34239. outlineColor = options2.outlineColor;
  34240. if (options2 !== void 0 && options2.outlineWidth !== void 0 && typeof options2.outlineWidth === "number")
  34241. outlineWidth = options2.outlineWidth;
  34242. let colorMaterial = new Cesium.PolylineOutlineMaterialProperty({
  34243. color: Cesium.Color.fromCssColorString(mColor),
  34244. outlineColor: Cesium.Color.fromCssColorString(outlineColor),
  34245. outlineWidth
  34246. });
  34247. colorMaterial._param = {
  34248. color: mColor,
  34249. outlineColor,
  34250. outlineWidth
  34251. };
  34252. return colorMaterial;
  34253. }
  34254. _clear(isAll) {
  34255. if (isAll != void 0 && isAll === true) {
  34256. this._removeEntityByName(this._sketchEntityName);
  34257. this._removePointEntitys();
  34258. }
  34259. this._sketchTempPoints = [];
  34260. this._sketchPoints = [];
  34261. this._sketchOutputPoints = [];
  34262. this._sketchWallHeights = [];
  34263. this._drawEntity = void 0;
  34264. this._removeOperationDom();
  34265. this._tooltipRemove();
  34266. if (this._drawEventHandler !== null && this._drawEventHandler !== void 0 && this._drawEventHandler.isDestroyed() === false) {
  34267. this._clearEvent(this._drawEventHandler);
  34268. }
  34269. }
  34270. }
  34271. Object.assign(DrawTools.prototype, {
  34272. setLabel: function(options2) {
  34273. if (!options2) {
  34274. options2 = {
  34275. lineLabel: void 0,
  34276. polygonLabel: void 0
  34277. };
  34278. }
  34279. if (options2.lineLabel)
  34280. this._lineLabel = options2.lineLabel;
  34281. if (options2.polygonLabel)
  34282. this._lineLabel = options2.polygonLabel;
  34283. }
  34284. });
  34285. Object.assign(DrawTools.prototype, {
  34286. _registerLeftClickEvent: function(handler, callChange) {
  34287. let _self = this;
  34288. if (!handler)
  34289. return;
  34290. handler.setInputAction(function(event2) {
  34291. _self._lock = true;
  34292. clearTimeout(_self._timer);
  34293. _self._timer = setTimeout(function() {
  34294. if (callChange)
  34295. callChange(event2);
  34296. _self._lock = false;
  34297. }, 200);
  34298. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  34299. },
  34300. _registerLeftDoubleClickEvent: function(handler, callChange) {
  34301. let _self = this;
  34302. if (!handler)
  34303. return;
  34304. handler.setInputAction(function(event2) {
  34305. clearTimeout(_self._timer);
  34306. _self._lock = false;
  34307. if (callChange)
  34308. callChange(event2);
  34309. }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  34310. },
  34311. _registerMouseMoveEvent: function(handler, callChange) {
  34312. let _self = this;
  34313. if (!handler)
  34314. return;
  34315. handler.setInputAction(function(event2) {
  34316. if (_self._lock === void 0 || _self._lock === false) {
  34317. if (callChange)
  34318. callChange(event2);
  34319. }
  34320. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  34321. },
  34322. _registerRightClickEvent: function(handler, callChange) {
  34323. if (!handler)
  34324. return;
  34325. handler.setInputAction(function(event2) {
  34326. if (callChange)
  34327. callChange(event2);
  34328. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  34329. },
  34330. _registerLeftDownEvent: function(handler, callChange) {
  34331. if (!handler)
  34332. return;
  34333. handler.setInputAction(function(event2) {
  34334. if (callChange)
  34335. callChange(event2);
  34336. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  34337. },
  34338. _registerLeftUpEvent: function(handler, callChange) {
  34339. if (!handler)
  34340. return;
  34341. handler.setInputAction(function(event2) {
  34342. if (callChange)
  34343. callChange(event2);
  34344. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  34345. },
  34346. _clearEvent: function(handler) {
  34347. this._endTooltip();
  34348. this._removeOperationDom();
  34349. if (!handler)
  34350. return;
  34351. handler.destroy();
  34352. handler = null;
  34353. }
  34354. });
  34355. Object.assign(DrawTools.prototype, {
  34356. _createPolyline: function(polylineType) {
  34357. let _self = this;
  34358. let entityParam = DrawTools.initEditPropertyParams();
  34359. let polylineWidth = _self._param.lineWidth;
  34360. let polylineMaterial = this._materialColorProperty({
  34361. color: _self._param.lineColor
  34362. });
  34363. entityParam.id = DrawTools.DrawType.Polyline;
  34364. if (polylineType !== void 0 && polylineType === DrawTools.PolylineType.ArrowsPolyline) {
  34365. polylineMaterial = this._materialPolylineArrowProperty({
  34366. color: _self._param.lineColor
  34367. });
  34368. polylineWidth = _self._param.lineWidth * 3;
  34369. entityParam.color = _self._param.lineColor;
  34370. entityParam.id = DrawTools.DrawType.ArrowPolyline;
  34371. } else if (polylineType !== void 0 && polylineType === DrawTools.PolylineType.GrowPolyline) {
  34372. polylineMaterial = this._materialPolylineGlowProperty({
  34373. color: _self._param.lineColor,
  34374. power: _self._param.power
  34375. });
  34376. polylineWidth = _self._param.lineWidth * 3;
  34377. entityParam.color = _self._param.lineColor;
  34378. entityParam.power = _self._param.power;
  34379. entityParam.id = DrawTools.DrawType.GrowPolyline;
  34380. } else if (polylineType !== void 0 && polylineType === DrawTools.PolylineType.OutlinePolyline) {
  34381. polylineMaterial = this._materialPolylineOutlineProperty({
  34382. color: _self._param.lineColor,
  34383. outlineColor: _self._param.outlineColor,
  34384. outlineWidth: _self._param.outlineWidth
  34385. });
  34386. polylineWidth = _self._param.lineWidth * 2;
  34387. entityParam.color = _self._param.lineColor;
  34388. entityParam.outlineColor = _self._param.outlineColor;
  34389. entityParam.outlineWidth = _self._param.outlineWidth;
  34390. entityParam.id = DrawTools.DrawType.OutlinePolyline;
  34391. } else if (polylineType !== void 0 && polylineType === DrawTools.PolylineType.DynamicPolyline) {
  34392. polylineMaterial = new WallMaterialProperty({
  34393. viewer: _self._viewer,
  34394. trailImage: _self._image_h_l_r,
  34395. duration: _self._param.duration,
  34396. color: Cesium.Color.fromCssColorString(_self._param.lineColor),
  34397. param: {
  34398. direction: _self._param.direction_h,
  34399. count: _self._param.count,
  34400. order: _self._param.order_minus
  34401. }
  34402. });
  34403. polylineWidth = _self._param.lineWidth;
  34404. entityParam.color = _self._param.lineColor;
  34405. entityParam.duration = _self._param.duration;
  34406. entityParam.direction = _self._param.direction_h;
  34407. entityParam.count = _self._param.count;
  34408. entityParam.order = _self._param.order_minus;
  34409. entityParam.id = DrawTools.DrawType.DynamicPolyline;
  34410. }
  34411. entityParam.lineWidth = polylineWidth;
  34412. let entityPolyline = new Cesium.Entity({
  34413. name: _self._sketchEntityName,
  34414. polyline: {
  34415. show: true,
  34416. positions: new Cesium.CallbackProperty(function() {
  34417. return _self._sketchTempPoints;
  34418. }, false),
  34419. material: polylineMaterial,
  34420. width: polylineWidth,
  34421. clampToGround: true
  34422. }
  34423. });
  34424. this._drawEntity = this._entities.add(entityPolyline);
  34425. this._drawEntity.setParams(entityParam);
  34426. },
  34427. _updatePolyline: function(isEdit) {
  34428. this._drawEntity.polyline.positions = this._sketchPoints;
  34429. this._drawEntity.setEntityType(DrawTools.DrawType.Polyline);
  34430. if (isEdit != void 0 && isEdit === true) {
  34431. this._removePointEntitys();
  34432. this._setEntityIsEdit(this._drawEntity);
  34433. }
  34434. },
  34435. _createSpatialPolyline: function() {
  34436. let _self = this;
  34437. let entityParam = DrawTools.initEditPropertyParams();
  34438. let lineMaterial = this._materialColorProperty({
  34439. color: _self._param.lineColor
  34440. });
  34441. entityParam.id = DrawTools.DrawType.SpatialLine;
  34442. entityParam.color = _self._param.lineColor;
  34443. entityParam.lineWidth = _self._param.lineWidth;
  34444. let entity = new Cesium.Entity({
  34445. name: _self._sketchEntityName,
  34446. polyline: {
  34447. show: true,
  34448. positions: new Cesium.CallbackProperty(function() {
  34449. return _self._sketchTempPoints;
  34450. }, false),
  34451. material: lineMaterial,
  34452. width: _self._param.lineWidth,
  34453. clampToGround: false
  34454. }
  34455. });
  34456. this._drawEntity = this._entities.add(entity);
  34457. this._drawEntity.setParams(entityParam);
  34458. },
  34459. _updateSpatialPolyline: function(isEdit) {
  34460. this._drawEntity.polyline.positions = this._sketchPoints;
  34461. this._drawEntity.setEntityType(DrawTools.DrawType.SpatialLine);
  34462. if (isEdit != void 0 && isEdit === true) {
  34463. this._removePointEntitys();
  34464. this._setEntityIsEdit(this._drawEntity);
  34465. }
  34466. },
  34467. _createPolygon: function(polygonType) {
  34468. let _self = this;
  34469. let entityParam = DrawTools.initEditPropertyParams();
  34470. let polygonMaterial = this._materialColorProperty({
  34471. color: _self._param.polygonColor
  34472. });
  34473. let lineMaterial = this._materialColorProperty({
  34474. color: _self._param.outlineColor
  34475. });
  34476. let entityPolygon = new Cesium.Entity({
  34477. name: _self._sketchEntityName,
  34478. polygon: {
  34479. show: true,
  34480. hierarchy: new Cesium.CallbackProperty(function() {
  34481. return {
  34482. positions: _self._sketchTempPoints
  34483. };
  34484. }, false),
  34485. material: polygonMaterial,
  34486. classificationType: Cesium.ClassificationType.BOTH
  34487. },
  34488. polyline: {
  34489. show: true,
  34490. positions: new Cesium.CallbackProperty(function() {
  34491. return _self._sketchTempPoints;
  34492. }, false),
  34493. material: lineMaterial,
  34494. width: _self._param.outlineWidth,
  34495. clampToGround: true
  34496. }
  34497. });
  34498. entityParam.color = _self._param.polygonColor;
  34499. entityParam.outlineColor = _self._param.outlineColor;
  34500. entityParam.outlineWidth = _self._param.outlineWidth;
  34501. this._drawEntity = this._entities.add(entityPolygon);
  34502. if (polygonType !== void 0 && polygonType === DrawTools.PolygonType.NormalPolygon) {
  34503. this._drawEntity.setEntityType(DrawTools.DrawType.Polygon);
  34504. entityParam.id = DrawTools.DrawType.Polygon;
  34505. } else if (polygonType !== void 0 && polygonType === DrawTools.PolygonType.HousePolygon) {
  34506. this._drawEntity.setEntityType(DrawTools.DrawType.House);
  34507. entityParam.id = DrawTools.DrawType.House;
  34508. }
  34509. this._drawEntity.setParams(entityParam);
  34510. },
  34511. _updatePolygon: function(isEdit) {
  34512. let _self = this;
  34513. let houseMaterial = this._materialColorProperty({
  34514. color: _self._param.houseColor
  34515. });
  34516. let entityType = this._drawEntity.getEntityType();
  34517. if (entityType === DrawTools.DrawType.Polygon) {
  34518. this._drawEntity.polygon.hierarchy = {
  34519. positions: _self._sketchPoints
  34520. };
  34521. this._drawEntity.polyline.positions = this._sketchPoints;
  34522. } else if (entityType === DrawTools.DrawType.House) {
  34523. let entityParam = this._drawEntity.getParams();
  34524. this._removeEntityByObject(this._drawEntity);
  34525. let height2 = parseFloat(this._sketchOutputPoints[0].height);
  34526. let houseHeight = height2 + parseInt(_self._param.wallHeight);
  34527. let houseEntity = new Cesium.Entity({
  34528. name: _self._sketchEntityName,
  34529. polygon: {
  34530. show: true,
  34531. hierarchy: {
  34532. positions: _self._sketchPoints
  34533. },
  34534. extrudedHeight: houseHeight,
  34535. material: houseMaterial
  34536. }
  34537. });
  34538. this._drawEntity = this._entities.add(houseEntity);
  34539. this._drawEntity.setEntityType(entityType);
  34540. entityParam.height = _self._param.wallHeight;
  34541. entityParam.bottomHeight = height2;
  34542. entityParam.color = _self._param.houseColor;
  34543. this._drawEntity.setParams(entityParam);
  34544. }
  34545. if (isEdit != void 0 && isEdit === true) {
  34546. this._removePointEntitys();
  34547. this._setEntityIsEdit(this._drawEntity);
  34548. }
  34549. },
  34550. _createRectangle: function() {
  34551. let _self = this;
  34552. let entityParam = DrawTools.initEditPropertyParams();
  34553. let rectMaterial = this._materialColorProperty({
  34554. color: _self._param.polygonColor
  34555. });
  34556. let lineMaterial = this._materialColorProperty({
  34557. color: _self._param.outlineColor
  34558. });
  34559. let entityRectangle = new Cesium.Entity({
  34560. name: _self._sketchEntityName,
  34561. polyline: {
  34562. show: true,
  34563. positions: new Cesium.CallbackProperty(
  34564. _self._callUpdateRectangleOutlineCoordinates(),
  34565. false
  34566. ),
  34567. material: lineMaterial,
  34568. width: _self._param.outlineWidth,
  34569. clampToGround: true
  34570. },
  34571. rectangle: {
  34572. show: true,
  34573. coordinates: new Cesium.CallbackProperty(
  34574. _self._callUpdateRectangleCoordinates(
  34575. _self._sketchTempPoints
  34576. ),
  34577. false
  34578. ),
  34579. material: rectMaterial,
  34580. classificationType: Cesium.ClassificationType.BOTH
  34581. }
  34582. });
  34583. entityParam.id = DrawTools.DrawType.Rectangle;
  34584. entityParam.color = _self._param.polygonColor;
  34585. entityParam.outlineColor = _self._param.outlineColor;
  34586. entityParam.outlineWidth = _self._param.outlineWidth;
  34587. this._drawEntity = this._entities.add(entityRectangle);
  34588. this._drawEntity.setParams(entityParam);
  34589. },
  34590. _updateRectangle(isEdit) {
  34591. this._drawEntity.polyline.positions = this._rectangleOutlineCoordinates;
  34592. let coordinates = this._rectangleCoordinates;
  34593. this._drawEntity.rectangle.coordinates = Cesium.Rectangle.fromDegrees(coordinates[0], coordinates[1], coordinates[2], coordinates[3]);
  34594. this._drawEntity.setEntityType(DrawTools.DrawType.Rectangle);
  34595. if (isEdit != void 0 && isEdit === true) {
  34596. this._setEntityIsEdit(this._drawEntity);
  34597. }
  34598. },
  34599. _createCircle: function(centerPosition, circleType) {
  34600. let _self = this;
  34601. let entityParam = DrawTools.initEditPropertyParams();
  34602. let circleMaterial = this._materialColorProperty({
  34603. color: _self._param.polygonColor
  34604. });
  34605. let lineMaterial = this._materialColorProperty({
  34606. color: _self._param.outlineColor
  34607. });
  34608. if (circleType != void 0 && circleType === DrawTools.CircleType.DynamicCircle) {
  34609. circleMaterial = new CircleMaterialProperty({
  34610. viewer: _self._viewer,
  34611. duration: _self._param.duration,
  34612. color: Cesium.Color.fromCssColorString(_self._param.polygonColor),
  34613. count: _self._param.count
  34614. });
  34615. }
  34616. this._sketchEllipseCenterPosition = centerPosition.clone();
  34617. let entityCircle = new Cesium.Entity({
  34618. name: _self._sketchEntityName,
  34619. position: centerPosition,
  34620. ellipse: {
  34621. show: true,
  34622. semiMinorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(
  34623. _self._sketchTempPoints
  34624. ), false),
  34625. semiMajorAxis: new Cesium.CallbackProperty(_self._callUpdateEllipseMinorAxis(
  34626. _self._sketchTempPoints
  34627. ), false),
  34628. material: circleMaterial,
  34629. classificationType: Cesium.ClassificationType.BOTH
  34630. }
  34631. });
  34632. if (circleType === void 0 || circleType === DrawTools.CircleType.ColorCircle) {
  34633. entityCircle.polyline = {
  34634. show: true,
  34635. positions: new Cesium.CallbackProperty(_self._callEllipseOutlineCoordinate(
  34636. _self._sketchTempPoints
  34637. ), false),
  34638. material: lineMaterial,
  34639. width: _self._param.outlineWidth,
  34640. clampToGround: true
  34641. };
  34642. }
  34643. this._drawEntity = this._entities.add(entityCircle);
  34644. if (circleType === void 0 || circleType === DrawTools.CircleType.ColorCircle) {
  34645. this._drawEntity.setEntityType(DrawTools.DrawType.Circle);
  34646. entityParam.id = DrawTools.DrawType.Circle;
  34647. entityParam.color = _self._param.polygonColor;
  34648. entityParam.outlineColor = _self._param.outlineColor;
  34649. entityParam.outlineWidth = _self._param.outlineWidth;
  34650. } else if (circleType != void 0 && circleType === DrawTools.CircleType.DynamicCircle) {
  34651. this._drawEntity.setEntityType(DrawTools.DrawType.DynamicCircle);
  34652. entityParam.id = DrawTools.DrawType.DynamicCircle;
  34653. entityParam.color = _self._param.polygonColor;
  34654. entityParam.duration = _self._param.duration;
  34655. entityParam.count = _self._param.count;
  34656. }
  34657. this._drawEntity.setParams(entityParam);
  34658. },
  34659. _updateCircle(isEdit) {
  34660. this._drawEntity.position = this._sketchEllipseCenterPosition;
  34661. let center2 = this._sketchTempPoints.first();
  34662. let outpoint = this._sketchTempPoints.last();
  34663. this._ellipseOutlineCoordinates = this._calculateEllipseOutlineCoordinate(center2, outpoint);
  34664. this._sketchEllipseRadius = this._calculateEllipseMinorAxis(center2, outpoint);
  34665. if (this._drawEntity.polyline != void 0) {
  34666. this._drawEntity.polyline.positions = this._ellipseOutlineCoordinates;
  34667. }
  34668. this._drawEntity.ellipse.semiMajorAxis = this._sketchEllipseRadius;
  34669. this._drawEntity.ellipse.semiMinorAxis = this._sketchEllipseRadius;
  34670. if (isEdit != void 0 && isEdit === true) {
  34671. this._setEntityIsEdit(this._drawEntity);
  34672. }
  34673. },
  34674. _createWall: function(wallType) {
  34675. let _self = this;
  34676. let entityParam = DrawTools.initEditPropertyParams();
  34677. let wallMaterial = this._materialColorProperty({
  34678. color: _self._param.polygonColor
  34679. });
  34680. entityParam.color = _self._param.polygonColor;
  34681. if (wallType !== void 0 && wallType === DrawTools.WallType.TextWall) {
  34682. wallMaterial = this._materialTextImageProperty({
  34683. color: _self._param.polygonColor,
  34684. text: _self._param.text
  34685. });
  34686. entityParam.text = _self._param.text;
  34687. entityParam.color = _self._param.polygonColor;
  34688. } else if (wallType !== void 0 && wallType === DrawTools.WallType.DynamicWall) {
  34689. wallMaterial = new WallMaterialProperty({
  34690. viewer: _self._viewer,
  34691. trailImage: _self._image_v_t_b,
  34692. duration: _self._param.duration,
  34693. color: Cesium.Color.fromCssColorString(_self._param.polygonColor),
  34694. param: {
  34695. count: _self._param.count,
  34696. direction: _self._param.direction_v,
  34697. order: _self._param.order_minus
  34698. }
  34699. });
  34700. entityParam.color = _self._param.polygonColor;
  34701. entityParam.duration = _self._param.duration;
  34702. entityParam.direction = _self._param.direction_v;
  34703. entityParam.count = _self._param.count;
  34704. entityParam.order = _self._param.order_minus;
  34705. }
  34706. let normalWall = new Cesium.Entity({
  34707. name: _self._sketchEntityName,
  34708. wall: {
  34709. show: true,
  34710. positions: new Cesium.CallbackProperty(function() {
  34711. return _self._sketchTempPoints;
  34712. }, false),
  34713. minimumHeights: new Cesium.CallbackProperty(function() {
  34714. return _self._sketchWallHeights;
  34715. }, false),
  34716. maximumHeights: new Cesium.CallbackProperty(function() {
  34717. _self._sketchWallMaxHeights = [];
  34718. for (let i2 = 0; i2 < _self._sketchWallHeights.length; i2++) {
  34719. _self._sketchWallMaxHeights.push(_self._sketchWallHeights[i2] + _self._param.wallHeight);
  34720. }
  34721. return _self._sketchWallMaxHeights;
  34722. }, false),
  34723. material: wallMaterial
  34724. }
  34725. });
  34726. this._drawEntity = this._entities.add(normalWall);
  34727. entityParam.height = this._param.wallHeight;
  34728. if (wallType === void 0 || wallType === DrawTools.WallType.ColorWall) {
  34729. this._drawEntity.setEntityType(DrawTools.DrawType.NormalWall);
  34730. entityParam.id = DrawTools.DrawType.NormalWall;
  34731. } else if (wallType !== void 0 && wallType === DrawTools.WallType.DynamicWall) {
  34732. this._drawEntity.setEntityType(DrawTools.DrawType.DynamicWall);
  34733. entityParam.id = DrawTools.DrawType.DynamicWall;
  34734. } else if (wallType !== void 0 && wallType === DrawTools.WallType.TextWall) {
  34735. this._drawEntity.setEntityType(DrawTools.DrawType.TextWall);
  34736. entityParam.id = DrawTools.DrawType.TextWall;
  34737. }
  34738. this._drawEntity.setParams(entityParam);
  34739. },
  34740. _updateWall: function(isEdit) {
  34741. let hLength = this._sketchWallHeights.length;
  34742. let mhLength = this._sketchWallMaxHeights.length;
  34743. let pLength = this._sketchPoints.length;
  34744. if (hLength === mhLength && hLength - pLength === 1) {
  34745. this._sketchWallHeights.pop();
  34746. this._sketchWallMaxHeights.pop();
  34747. this._drawEntity.wall.positions = this._sketchPoints;
  34748. this._drawEntity.wall.minimumHeights = this._sketchWallHeights;
  34749. this._drawEntity.wall.maximumHeights = this._sketchWallMaxHeights;
  34750. if (isEdit != void 0 && isEdit === true) {
  34751. this._removePointEntitys();
  34752. this._setEntityIsEdit(this._drawEntity);
  34753. }
  34754. } else {
  34755. this._console(hLength, mhLength, pLength);
  34756. }
  34757. },
  34758. _createVideoWall: function() {
  34759. let _self = this;
  34760. let entityWall = new Cesium.Entity({
  34761. name: _self._sketchEntityName,
  34762. position: _self._sketchOutputPoints[0],
  34763. wall: {
  34764. show: true,
  34765. positions: new Cesium.CallbackProperty(function() {
  34766. let pt0 = _self._sketchOutputPoints[0];
  34767. let pt1 = _self._sketchOutputPoints[1];
  34768. _self._wallPositions = [];
  34769. _self._wallPositions.push(Cesium.Cartesian3.fromDegrees(
  34770. pt0.lng,
  34771. pt0.lat,
  34772. pt0.height
  34773. ));
  34774. _self._wallPositions.push(Cesium.Cartesian3.fromDegrees(
  34775. pt1.lng,
  34776. pt1.lat,
  34777. pt0.height
  34778. ));
  34779. return _self._wallPositions;
  34780. }, false),
  34781. maximumHeights: new Cesium.CallbackProperty(function() {
  34782. _self._sketchWallHeights = [];
  34783. let pt2 = _self._sketchOutputPoints[0];
  34784. _self._sketchWallHeights.push(pt2.height);
  34785. _self._sketchWallHeights.push(pt2.height);
  34786. return _self._sketchWallHeights;
  34787. }, false),
  34788. minimumHeights: new Cesium.CallbackProperty(function() {
  34789. _self._sketchWallMaxHeights = [];
  34790. let pt2 = _self._sketchOutputPoints[1];
  34791. _self._sketchWallMaxHeights.push(pt2.height);
  34792. _self._sketchWallMaxHeights.push(pt2.height);
  34793. return _self._sketchWallMaxHeights;
  34794. }, false),
  34795. material: Cesium.Color.fromCssColorString(_self._param.polygonColor),
  34796. outline: true,
  34797. outlineColor: Cesium.Color.fromCssColorString(_self._param.outlineColor),
  34798. outlineWidth: _self._param.outlineWidth
  34799. }
  34800. });
  34801. _self._drawEntity = _self._entities.add(entityWall);
  34802. },
  34803. _updateVideoWall: function(isEdit) {
  34804. let entityParam = DrawTools.initEditPropertyParams();
  34805. entityParam.id = DrawTools.DrawType.VideoWall;
  34806. let videoElement = document.getElementById("wallVideo");
  34807. if (videoElement !== null) {
  34808. document.body.removeChild(videoElement);
  34809. }
  34810. videoElement = document.createElement("video");
  34811. videoElement.id = "wallVideo";
  34812. videoElement.setAttribute("crossorigin", "anonymous");
  34813. videoElement.setAttribute("width", "1024px");
  34814. videoElement.setAttribute("height", "256px");
  34815. videoElement.setAttribute("controls", "controls");
  34816. videoElement.setAttribute(
  34817. "src",
  34818. "https://lf3-cdn-tos.bytescm.com/obj/eden-cn/lmeh7pfuho/campus/campus_intro_20200522.mp4"
  34819. );
  34820. videoElement.setAttribute("loop", "loop");
  34821. videoElement.play();
  34822. document.body.appendChild(videoElement);
  34823. this._drawEntity.wall.positions = this._wallPositions;
  34824. this._drawEntity.wall.minimumHeights = this._sketchWallHeights;
  34825. this._drawEntity.wall.maximumHeights = this._sketchWallMaxHeights;
  34826. entityParam.height = this._sketchWallMaxHeights[0] - this._sketchWallHeights[0];
  34827. this._drawEntity.wall.material = videoElement;
  34828. this._removePointEntitys();
  34829. this._drawEntity.setEntityType(DrawTools.DrawType.VideoWall);
  34830. entityParam.videoUrl = "https://lf3-cdn-tos.bytescm.com/obj/eden-cn/lmeh7pfuho/campus/campus_intro_20200522.mp4";
  34831. entityParam.id = DrawTools.DrawType.VideoWall;
  34832. this._drawEntity.setParams(entityParam);
  34833. if (isEdit != void 0 && isEdit === true) {
  34834. this._setEntityIsEdit(this._drawEntity);
  34835. }
  34836. },
  34837. _calculateOdlinePositios: function(strPoint, endPoint, height2, count) {
  34838. let pt1 = this._cartesian3ToGeo(strPoint);
  34839. let pt2 = this._cartesian3ToGeo(endPoint);
  34840. var h2 = height2 && height2 < 1e3 ? height2 : 1e3;
  34841. var L = Math.abs(pt1.longitude - pt2.longitude) > Math.abs(pt1.latitude - pt2.latitude) ? Math.abs(pt1.longitude - pt2.longitude) : Math.abs(pt1.latitude - pt2.latitude);
  34842. var num = count && count > 50 ? count : 50;
  34843. var result = [];
  34844. var tempResult = [];
  34845. var dlt = L / num;
  34846. var addHeight = pt1.height > pt2.height ? pt1.height : pt2.height;
  34847. var maxHeight = addHeight + h2;
  34848. var minHeight1 = pt1.height;
  34849. var minHeight2 = pt2.height;
  34850. if (Math.abs(pt1.longitude - pt2.longitude) > Math.abs(pt1.latitude - pt2.latitude)) {
  34851. var delLat = (pt2.latitude - pt1.latitude) / num;
  34852. if (pt1.longitude - pt2.longitude > 0) {
  34853. dlt = -dlt;
  34854. }
  34855. for (var i2 = 1; i2 < num; i2++) {
  34856. var tempH = h2 - Math.pow(-0.5 * L + Math.abs(dlt) * i2, 2) * 4 * h2 / Math.pow(L, 2);
  34857. var lon = pt1.longitude + dlt * i2;
  34858. var lat = pt1.latitude + delLat * i2;
  34859. var alt = void 0;
  34860. if (Math.abs(dlt) * i2 == 0.5 * L) {
  34861. alt = maxHeight;
  34862. } else if (Math.abs(dlt) * i2 < 0.5 * L) {
  34863. alt = (maxHeight - minHeight1) / h2 * tempH + minHeight1;
  34864. } else {
  34865. alt = (maxHeight - minHeight2) / h2 * tempH + minHeight2;
  34866. }
  34867. tempResult.push([lon, lat, alt]);
  34868. }
  34869. } else {
  34870. var delLon = (pt2.longitude - pt1.longitude) / num;
  34871. if (pt1.latitude - pt2.latitude > 0) {
  34872. dlt = -dlt;
  34873. }
  34874. for (var i2 = 1; i2 < num; i2++) {
  34875. var tempH = h2 - Math.pow(-0.5 * L + Math.abs(dlt) * i2, 2) * 4 * h2 / Math.pow(L, 2);
  34876. var lon = pt1.longitude + delLon * i2;
  34877. var lat = pt1.latitude + dlt * i2;
  34878. var alt = void 0;
  34879. if (Math.abs(dlt) * i2 == 0.5 * L) {
  34880. alt = maxHeight;
  34881. } else if (Math.abs(dlt) * i2 < 0.5 * L) {
  34882. alt = (maxHeight - minHeight1) / h2 * tempH + minHeight1;
  34883. } else {
  34884. alt = (maxHeight - minHeight2) / h2 * tempH + minHeight2;
  34885. }
  34886. tempResult.push([lon, lat, alt]);
  34887. }
  34888. }
  34889. result.push([pt1.longitude, pt1.latitude, pt1.height]);
  34890. for (var i2 = 0; i2 < tempResult.length; i2++) {
  34891. result.push(tempResult[i2]);
  34892. }
  34893. result.push([pt2.longitude, pt2.latitude, pt2.height]);
  34894. let results = [];
  34895. for (let i3 = 0; i3 < result.length; i3++) {
  34896. results.push(Cesium.Cartesian3.fromDegrees(result[i3][0], result[i3][1], result[i3][2]));
  34897. }
  34898. return results;
  34899. },
  34900. _createOdline: function(isFirst) {
  34901. let _self = this;
  34902. if (isFirst !== void 0 && isFirst === true) {
  34903. let fatherEntity = new Cesium.Entity({
  34904. name: this._sketchEntityName
  34905. });
  34906. this._odlineFatherEntity = this._entities.add(fatherEntity);
  34907. let entityParam = DrawTools.initEditPropertyParams();
  34908. entityParam.id = DrawTools.DrawType.OdLine;
  34909. entityParam.color = _self._param.polygonColor;
  34910. entityParam.duration = _self._param.duration;
  34911. entityParam.direction = _self._param.direction_h;
  34912. entityParam.count = _self._param.count;
  34913. entityParam.order = _self._param.order_add;
  34914. entityParam.odlineHeight = _self._param.odlineHeight;
  34915. entityParam.odlineCount = _self._param.odlineCount;
  34916. entityParam.lineWidth = _self._param.lineWidth * 3;
  34917. this._odlineFatherEntity.setParams(entityParam);
  34918. this._odlineEntitys = [];
  34919. }
  34920. let faterParam = this._odlineFatherEntity.getParams();
  34921. let odLineMaterial = new WallMaterialProperty({
  34922. viewer: _self._viewer,
  34923. trailImage: _self._image_arrow_reverse,
  34924. duration: faterParam.duration,
  34925. color: Cesium.Color.fromCssColorString(faterParam.color),
  34926. param: {
  34927. direction: faterParam.direction,
  34928. count: faterParam.count,
  34929. order: faterParam.order
  34930. }
  34931. });
  34932. let entity = new Cesium.Entity({
  34933. name: _self._sketchEntityName,
  34934. parent: this._odlineFatherEntity,
  34935. polyline: {
  34936. show: true,
  34937. positions: new Cesium.CallbackProperty(function() {
  34938. let center2 = _self._sketchTempPoints[0];
  34939. let endPoint = _self._sketchTempPoints[_self._sketchTempPoints.length - 1];
  34940. let results = _self._calculateOdlinePositios(
  34941. center2,
  34942. endPoint,
  34943. parseInt(
  34944. faterParam.odlineHeight
  34945. ),
  34946. parseInt(faterParam.odlineCount)
  34947. );
  34948. return results;
  34949. }, false),
  34950. material: odLineMaterial,
  34951. width: faterParam.lineWidth,
  34952. clampToGround: false
  34953. }
  34954. });
  34955. this._drawEntity = this._entities.add(entity);
  34956. },
  34957. _updateOdline: function(isLast, isEdit) {
  34958. if (isLast !== void 0 && isLast === true) {
  34959. if (isEdit !== void 0 && isEdit === true) {
  34960. this._drawEntity.setEntityType(DrawTools.DrawType.OdLine);
  34961. this._setEntityIsEdit(this._drawEntity);
  34962. this._drawEntity.parent.setIsEdit(true);
  34963. }
  34964. } else {
  34965. let params = this._drawEntity.parent.getParams();
  34966. let center2 = this._sketchTempPoints[0];
  34967. let endPoint = this._sketchTempPoints[this._sketchTempPoints.length - 1];
  34968. let results = this._calculateOdlinePositios(
  34969. center2,
  34970. endPoint,
  34971. parseInt(params.odlineHeight),
  34972. parseInt(params.odlineCount)
  34973. );
  34974. this._drawEntity.polyline.positions = results;
  34975. this._drawEntity.setEntityType(DrawTools.DrawType.OdLine);
  34976. this._odlineEntitys.push(this._drawEntity);
  34977. if (isEdit !== void 0 && isEdit === true) {
  34978. this._drawEntity.setIsEdit(true);
  34979. }
  34980. }
  34981. },
  34982. _guid() {
  34983. function S4() {
  34984. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  34985. }
  34986. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  34987. },
  34988. _console(...rest) {
  34989. console.log("===>>>", rest);
  34990. }
  34991. });
  34992. Object.assign(DrawTools.prototype, {
  34993. _drawMovingDoubleTooltip(position2) {
  34994. this._updateTooltip("\u5DE6\u952E\u5355\u51FB\u7ED8\u5236,\u53F3\u952E\u5355\u51FB\u64A4\u9500<br>\u5DE6\u952E\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236", position2);
  34995. },
  34996. _drawMovingSimpleTooltip(position2) {
  34997. this._updateTooltip("\u5DE6\u952E\u5355\u51FB\u7ED3\u675F\u7ED8\u5236", position2);
  34998. },
  34999. _removeLastDrawPointEntity() {
  35000. let lastPointEntity = this._pointEntitys.last();
  35001. if (lastPointEntity !== void 0) {
  35002. this._removeEntityByObject(lastPointEntity);
  35003. this._pointEntitys.pop();
  35004. }
  35005. },
  35006. _sketchDrawPoint(handler, options2) {
  35007. let _self = this;
  35008. this._registerLeftClickEvent(handler, function(event2) {
  35009. let scene = _self._viewer.scene;
  35010. if (scene.mode !== Cesium.SceneMode.MORPHING) {
  35011. var pickedObject = scene.pick(event2.position);
  35012. if (scene.pickPositionSupported && Cesium.defined(pickedObject)) {
  35013. var cartesian = scene.pickPosition(event2.position);
  35014. if (Cesium.defined(cartesian)) {
  35015. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  35016. var lng = Cesium.Math.toDegrees(cartographic.longitude);
  35017. var lat = Cesium.Math.toDegrees(cartographic.latitude);
  35018. var height2 = cartographic.height;
  35019. _self._sketchOutputPoints.push({
  35020. lng,
  35021. lat,
  35022. height: height2
  35023. });
  35024. }
  35025. _self._createPoint(cartesian, "\u70B9");
  35026. _self._sketchPoints.push(cartesian.clone());
  35027. if (_self._sketchPoints.length >= 2) {
  35028. _self._createVideoWall();
  35029. _self._clearEvent(handler);
  35030. }
  35031. }
  35032. }
  35033. if (options2.onComplete)
  35034. options2.onComplete(loc.sLocation, loc.gLocation);
  35035. });
  35036. },
  35037. _sketchDrawMultiplePoint(handler, options2) {
  35038. let _self = this;
  35039. this._registerLeftClickEvent(handler, function(event2) {
  35040. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35041. if (!Cesium.defined(loc2.sLocation))
  35042. return;
  35043. if (_self._isDrawPoint) {
  35044. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35045. }
  35046. _self._sketchPoints.push(loc2.sLocation);
  35047. _self._sketchOutputPoints.push(loc2.gLocation);
  35048. if (options2.onAdded)
  35049. options2.onAdded(loc2.sLocation, loc2.gLocation);
  35050. });
  35051. this._registerRightClickEvent(handler, function(event2) {
  35052. if (_self._sketchPoints.length > 0) {
  35053. _self._sketchPoints.pop();
  35054. _self._sketchOutputPoints.pop();
  35055. if (options2.onUndo)
  35056. options2.onUndo();
  35057. }
  35058. });
  35059. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35060. _self._clearEvent(handler);
  35061. if (options2.onComplete)
  35062. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  35063. });
  35064. },
  35065. _sketchDrawPolyline(handler, options2) {
  35066. let _self = this;
  35067. this._registerLeftClickEvent(handler, function(event2) {
  35068. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35069. if (!Cesium.defined(loc2.sLocation))
  35070. return;
  35071. if (_self._isDrawPoint) {
  35072. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35073. }
  35074. if (_self._sketchTempPoints.length === 0) {
  35075. _self._createPolyline(options2.polylineType);
  35076. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35077. }
  35078. _self._sketchTempPoints.push(loc2.sLocation);
  35079. _self._sketchPoints.push(loc2.sLocation.clone());
  35080. _self._sketchOutputPoints.push(loc2.gLocation);
  35081. if (options2.onAdded)
  35082. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  35083. _self._createOperationDom();
  35084. });
  35085. this._registerMouseMoveEvent(handler, function(event2) {
  35086. if (_self._isRuntimeApp())
  35087. return;
  35088. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35089. if (!Cesium.defined(loc2.sLocation))
  35090. return;
  35091. if (_self._sketchTempPoints.length > 1) {
  35092. _self._drawMovingDoubleTooltip(event2.endPosition);
  35093. _self._sketchTempPoints.pop();
  35094. _self._sketchTempPoints.push(loc2.sLocation);
  35095. if (options2.onMoving)
  35096. options2.onMoving(loc2.sLocation);
  35097. }
  35098. });
  35099. this._registerRightClickEvent(handler, function(event2) {
  35100. if (_self._sketchTempPoints.length > 2) {
  35101. _self._drawByUndo();
  35102. if (options2.onUndo)
  35103. options2.onUndo();
  35104. }
  35105. });
  35106. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35107. if (_self._sketchPoints.length < 2) {
  35108. if (options2.onError)
  35109. options2.onError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  35110. return;
  35111. }
  35112. _self._updatePolyline(options2.isEdit);
  35113. if (!_self._isRetainDrawPoint)
  35114. _self._removePointEntitys();
  35115. _self._clearEvent(handler);
  35116. if (options2.onComplete)
  35117. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  35118. });
  35119. },
  35120. _sketchDrawSpatialPolyline(handler, options2) {
  35121. let _self = this;
  35122. this._registerLeftClickEvent(handler, function(event2) {
  35123. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35124. if (!Cesium.defined(loc2.sLocation))
  35125. return;
  35126. if (_self._isDrawPoint) {
  35127. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35128. }
  35129. if (_self._sketchTempPoints.length === 0) {
  35130. _self._createSpatialPolyline();
  35131. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35132. }
  35133. _self._sketchTempPoints.push(loc2.sLocation);
  35134. _self._sketchPoints.push(loc2.sLocation.clone());
  35135. _self._sketchOutputPoints.push(loc2.gLocation);
  35136. if (options2.onAdded)
  35137. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  35138. _self._createOperationDom();
  35139. });
  35140. this._registerMouseMoveEvent(handler, function(event2) {
  35141. if (_self._isRuntimeApp())
  35142. return;
  35143. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35144. if (!Cesium.defined(loc2.sLocation))
  35145. return;
  35146. if (_self._sketchTempPoints.length > 1) {
  35147. _self._drawMovingDoubleTooltip(event2.endPosition);
  35148. _self._sketchTempPoints.pop();
  35149. _self._sketchTempPoints.push(loc2.sLocation);
  35150. if (options2.onMoving)
  35151. options2.onMoving(loc2.sLocation);
  35152. }
  35153. });
  35154. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35155. if (_self._sketchPoints.length < 2) {
  35156. if (options2.onError)
  35157. options2.onError("\u7ED8\u5236\u70B9\u5C11\u4E8E2\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  35158. return;
  35159. }
  35160. _self._updateSpatialPolyline(options2.isEdit);
  35161. _self._removePointEntitys();
  35162. _self._clearEvent(handler);
  35163. if (options2.onComplete)
  35164. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  35165. });
  35166. this._registerRightClickEvent(handler, function(event2) {
  35167. if (_self._sketchTempPoints.length > 2) {
  35168. _self._drawByUndo();
  35169. if (options2.onUndo)
  35170. options2.onUndo();
  35171. }
  35172. });
  35173. },
  35174. _sketchDrawOdline(handler, options2) {
  35175. let _self = this;
  35176. this._registerLeftClickEvent(handler, function(event2) {
  35177. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35178. if (!Cesium.defined(loc2.sLocation))
  35179. return;
  35180. if (_self._isDrawPoint) {
  35181. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35182. }
  35183. if (_self._isRuntimeApp()) {
  35184. _self._showTooltipMessage("\u518D\u6B21\u5355\u51FB\u7ED8\u5236\u4E00\u6761OD\u7EBF\uFF01");
  35185. }
  35186. if (_self._sketchTempPoints.length === 0) {
  35187. _self._createOdline(true);
  35188. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35189. } else {
  35190. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35191. _self._updateOdline(false, options2.isEdit);
  35192. _self._createOdline();
  35193. }
  35194. _self._sketchTempPoints.push(loc2.sLocation);
  35195. _self._sketchPoints.push(loc2.sLocation.clone());
  35196. _self._sketchOutputPoints.push(loc2.gLocation);
  35197. if (options2.onAdded)
  35198. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  35199. _self._createOperationDom();
  35200. });
  35201. this._registerMouseMoveEvent(handler, function(event2) {
  35202. if (_self._isRuntimeApp())
  35203. return;
  35204. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35205. if (!Cesium.defined(loc2.sLocation))
  35206. return;
  35207. if (_self._sketchTempPoints.length > 1) {
  35208. _self._drawMovingDoubleTooltip(event2.endPosition);
  35209. _self._sketchTempPoints.pop();
  35210. _self._sketchTempPoints.push(loc2.sLocation);
  35211. if (options2.onMoving)
  35212. options2.onMoving(loc2.sLocation);
  35213. }
  35214. });
  35215. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35216. _self._removeEntityByObject(_self._drawEntity);
  35217. _self._updateOdline(true, options2.isEdit);
  35218. _self._removePointEntitys();
  35219. _self._clearEvent(handler);
  35220. if (options2.onComplete)
  35221. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  35222. });
  35223. this._registerRightClickEvent(handler, function(event2) {
  35224. if (_self._odlineEntitys.length > 0) {
  35225. if (_self._isDrawPoint) {
  35226. _self._removeLastDrawPointEntity();
  35227. }
  35228. _self._removeEntityByObject(_self._odlineEntitys.last());
  35229. _self._odlineEntitys.pop();
  35230. if (options2.onUndo)
  35231. options2.onUndo();
  35232. }
  35233. });
  35234. },
  35235. _sketchDrawPolygon(handler, options2) {
  35236. let _self = this;
  35237. this._registerLeftClickEvent(handler, function(event2) {
  35238. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35239. if (!Cesium.defined(loc2.sLocation))
  35240. return;
  35241. if (_self._isDrawPoint) {
  35242. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35243. }
  35244. if (_self._sketchTempPoints.length === 0) {
  35245. _self._createPolygon(options2.polygonType);
  35246. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35247. }
  35248. _self._sketchTempPoints.push(loc2.sLocation);
  35249. _self._sketchPoints.push(loc2.sLocation.clone());
  35250. _self._sketchOutputPoints.push(loc2.gLocation);
  35251. if (options2.onAdded)
  35252. options2.onAdded(_self._sketchPoints, _self._sketchOutputPoints);
  35253. _self._createOperationDom();
  35254. });
  35255. this._registerMouseMoveEvent(handler, function(event2) {
  35256. if (_self._isRuntimeApp())
  35257. return;
  35258. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35259. if (!Cesium.defined(loc2.sLocation))
  35260. return;
  35261. if (_self._sketchTempPoints.length > 1) {
  35262. _self._drawMovingDoubleTooltip(event2.endPosition);
  35263. _self._sketchTempPoints.pop();
  35264. _self._sketchTempPoints.push(loc2.sLocation);
  35265. if (options2.onMoving)
  35266. options2.onMoving(loc2.sLocation);
  35267. }
  35268. });
  35269. this._registerRightClickEvent(handler, function(event2) {
  35270. if (_self._sketchTempPoints.length > 2) {
  35271. _self._drawByUndo();
  35272. if (options2.onUndo)
  35273. options2.onUndo();
  35274. }
  35275. });
  35276. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35277. if (_self._sketchPoints.length < 3) {
  35278. if (options2.onError)
  35279. options2.onError("\u70B9\u6570\u5C11\u4E8E3\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  35280. return;
  35281. }
  35282. _self._updatePolygon(options2.isEdit);
  35283. if (!_self._isRetainDrawPoint)
  35284. _self._removePointEntitys();
  35285. _self._clearEvent(handler);
  35286. if (options2.onComplete)
  35287. options2.onComplete(_self._sketchPoints, _self._sketchOutputPoints);
  35288. });
  35289. },
  35290. _sketchDrawCircle: function(handler, options2) {
  35291. let _self = this;
  35292. this._registerLeftClickEvent(handler, function(event2) {
  35293. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35294. if (!Cesium.defined(loc2.sLocation))
  35295. return;
  35296. if (_self._sketchTempPoints.length === 0) {
  35297. if (_self._isDrawPoint) {
  35298. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  35299. }
  35300. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35301. _self._sketchTempPoints.push(loc2.sLocation);
  35302. _self._sketchPoints.push(loc2.sLocation.clone());
  35303. _self._sketchOutputPoints.push(loc2.gLocation);
  35304. _self._createCircle(loc2.sLocation, options2.circleType);
  35305. if (_self._isRuntimeApp()) {
  35306. _self._showTooltipMessage("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u7ED8\u5236\uFF01");
  35307. }
  35308. if (options2.onAdded)
  35309. options2.onAdded(loc2.sLocation);
  35310. } else {
  35311. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35312. _self._removePointEntitys();
  35313. _self._updateCircle(options2.isEdit);
  35314. _self._clearEvent(handler);
  35315. if (options2.onComplete)
  35316. options2.onComplete(_self._sketchOutputPoints[0], _self._sketchEllipseRadius);
  35317. }
  35318. });
  35319. this._registerMouseMoveEvent(handler, function(event2) {
  35320. if (_self._isRuntimeApp()) {
  35321. return;
  35322. }
  35323. if (_self._sketchTempPoints.length <= 0)
  35324. return;
  35325. _self._drawMovingSimpleTooltip(event2.endPosition);
  35326. var cartesian = _self._viewer.scene.pickPosition(event2.endPosition);
  35327. if (cartesian == void 0)
  35328. return;
  35329. _self._sketchTempPoints.pop();
  35330. _self._sketchTempPoints.push(cartesian);
  35331. });
  35332. },
  35333. _sketchDrawRectangle: function(handler, options2) {
  35334. let _self = this;
  35335. this._registerLeftClickEvent(handler, function(event2) {
  35336. if (_self._sketchTempPoints.length === 0) {
  35337. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35338. if (!Cesium.defined(loc2.sLocation))
  35339. return;
  35340. if (_self._isDrawPoint) {
  35341. _self._createPoint(loc2.sLocation, "\u8D77\u70B9");
  35342. }
  35343. _self._sketchTempPoints.push(loc2.sLocation);
  35344. _self._sketchTempPoints.push(loc2.sLocation);
  35345. _self._sketchPoints.push(loc2.gLocation);
  35346. _self._createRectangle();
  35347. if (options2.onAdded)
  35348. options2.onAdded(loc2.sLocation);
  35349. if (_self._isRuntimeApp()) {
  35350. _self._showTooltipMessage("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u7ED8\u5236\uFF01");
  35351. }
  35352. } else {
  35353. _self._removePointEntitys();
  35354. _self._removeEntityByObject(_self._sketchTempRectangle);
  35355. _self._updateRectangle(options2.isEdit);
  35356. _self._clearEvent(handler);
  35357. if (options2.onComplete)
  35358. options2.onComplete(_self._sketchOutputPoints);
  35359. }
  35360. });
  35361. this._registerMouseMoveEvent(handler, function(event2) {
  35362. if (_self._sketchTempPoints.length < 1)
  35363. return;
  35364. _self._drawMovingSimpleTooltip(event2.endPosition);
  35365. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35366. if (!Cesium.defined(loc2.sLocation))
  35367. return;
  35368. _self._sketchTempPoints.pop();
  35369. _self._sketchTempPoints.push(loc2.sLocation);
  35370. });
  35371. },
  35372. _sketchDrawWall: function(handler, options2) {
  35373. let _self = this;
  35374. this._registerLeftClickEvent(handler, function(event2) {
  35375. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35376. if (!Cesium.defined(loc2.sLocation))
  35377. return;
  35378. if (_self._isDrawPoint) {
  35379. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35380. }
  35381. if (_self._sketchTempPoints.length === 0) {
  35382. _self._createWall(options2.wallType);
  35383. _self._sketchTempPoints.push(loc2.sLocation.clone());
  35384. _self._sketchWallHeights.push(loc2.gLocation.height);
  35385. }
  35386. _self._sketchTempPoints.push(loc2.sLocation);
  35387. _self._sketchWallHeights.push(loc2.gLocation.height);
  35388. _self._sketchPoints.push(loc2.sLocation.clone());
  35389. _self._createOperationDom();
  35390. });
  35391. this._registerMouseMoveEvent(handler, function(event2) {
  35392. if (_self._isRuntimeApp()) {
  35393. return;
  35394. }
  35395. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35396. if (!Cesium.defined(loc2.sLocation))
  35397. return;
  35398. if (_self._sketchTempPoints.length > 1) {
  35399. _self._drawMovingDoubleTooltip(event2.endPosition);
  35400. _self._sketchTempPoints.pop();
  35401. _self._sketchTempPoints.push(loc2.sLocation);
  35402. _self._sketchWallHeights.pop();
  35403. _self._sketchWallHeights.push(loc2.gLocation.height);
  35404. }
  35405. });
  35406. this._registerRightClickEvent(handler, function(event2) {
  35407. if (_self._sketchTempPoints.length > 2) {
  35408. _self._sketchPoints.pop();
  35409. if (_self._isRuntimeApp()) {
  35410. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 1, 1);
  35411. _self._sketchWallHeights.splice(_self._sketchWallHeights.length - 1, 1);
  35412. } else {
  35413. _self._sketchTempPoints.splice(_self._sketchTempPoints.length - 2, 1);
  35414. _self._sketchWallHeights.splice(_self._sketchWallHeights.length - 2, 1);
  35415. }
  35416. if (_self._isDrawPoint) {
  35417. _self._removeLastDrawPointEntity();
  35418. }
  35419. }
  35420. });
  35421. this._registerLeftDoubleClickEvent(handler, function(event2) {
  35422. if (_self._sketchPoints.length < 2) {
  35423. if (options2.onError)
  35424. options2.onError("\u70B9\u6570\u5C11\u4E8E\u4E24\u4E2A\uFF0C\u7981\u6B62\u7ED3\u675F\u7ED8\u5236\uFF01");
  35425. return;
  35426. }
  35427. _self._updateWall(options2.isEdit);
  35428. if (!_self._isRetainDrawPoint)
  35429. _self._removePointEntitys();
  35430. _self._clearEvent(handler);
  35431. });
  35432. },
  35433. _sketchDrawVideoWall: function(handler, options2) {
  35434. let _self = this;
  35435. this._registerLeftClickEvent(handler, function(event2) {
  35436. let loc2 = _self._transfromFromScreenPoint(event2.position);
  35437. if (!Cesium.defined(loc2.sLocation))
  35438. return;
  35439. if (_self._isDrawPoint) {
  35440. _self._createPoint(loc2.sLocation, _self._lineLabel);
  35441. }
  35442. if (_self._sketchOutputPoints.length === 0) {
  35443. _self._sketchOutputPoints.push(loc2.gLocation);
  35444. _self._sketchOutputPoints.push(loc2.gLocation);
  35445. _self._createVideoWall();
  35446. if (_self._isRuntimeApp()) {
  35447. _self._showTooltipMessage("\u518D\u6B21\u5355\u51FB\u7ED3\u675F\u7ED8\u5236");
  35448. }
  35449. } else {
  35450. _self._updateVideoWall(options2.isEdit);
  35451. _self._clearEvent(handler);
  35452. }
  35453. });
  35454. this._registerMouseMoveEvent(handler, function(event2) {
  35455. if (_self._isRuntimeApp())
  35456. return;
  35457. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  35458. if (!Cesium.defined(loc2.sLocation))
  35459. return;
  35460. if (_self._sketchOutputPoints.length > 1) {
  35461. _self._drawMovingSimpleTooltip(event2.endPosition);
  35462. _self._sketchOutputPoints.pop();
  35463. _self._sketchOutputPoints.push(loc2.gLocation);
  35464. }
  35465. });
  35466. },
  35467. _drawByUndo: function() {
  35468. this._sketchPoints.pop();
  35469. if (this._isRuntimeApp()) {
  35470. this._sketchTempPoints.splice(this._sketchTempPoints.length - 1, 1);
  35471. } else {
  35472. this._sketchTempPoints.splice(this._sketchTempPoints.length - 2, 1);
  35473. }
  35474. if (this._isDrawPoint) {
  35475. this._removeLastDrawPointEntity();
  35476. }
  35477. },
  35478. draw: function(type2, options2) {
  35479. let _self = this;
  35480. this._clear();
  35481. this._drawEventHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  35482. if (this._isRuntimeApp()) {
  35483. this._showTooltipMessage("\u5355\u51FB\u7ED8\u5236");
  35484. } else {
  35485. this._beginTooltip("\u5DE6\u952E\u5355\u51FB\u7ED8\u5236", void 0);
  35486. }
  35487. this._drawType = type2;
  35488. switch (type2) {
  35489. case DrawTools.DrawType.Point:
  35490. _self._sketchDrawPoint(_self._drawEventHandler, options2);
  35491. break;
  35492. case DrawTools.DrawType.Polyline:
  35493. options2.polylineType = DrawTools.PolylineType.NormalPolyline;
  35494. _self._sketchDrawPolyline(_self._drawEventHandler, options2);
  35495. break;
  35496. case DrawTools.DrawType.ArrowPolyline:
  35497. options2.polylineType = DrawTools.PolylineType.ArrowsPolyline;
  35498. _self._sketchDrawPolyline(_self._drawEventHandler, options2);
  35499. break;
  35500. case DrawTools.DrawType.DynamicPolyline:
  35501. options2.polylineType = DrawTools.PolylineType.DynamicPolyline;
  35502. _self._sketchDrawPolyline(_self._drawEventHandler, options2);
  35503. break;
  35504. case DrawTools.DrawType.GrowPolyline:
  35505. options2.polylineType = DrawTools.PolylineType.GrowPolyline;
  35506. _self._sketchDrawPolyline(_self._drawEventHandler, options2);
  35507. break;
  35508. case DrawTools.DrawType.OutlinePolyline:
  35509. options2.polylineType = DrawTools.PolylineType.OutlinePolyline;
  35510. _self._sketchDrawPolyline(_self._drawEventHandler, options2);
  35511. break;
  35512. case DrawTools.DrawType.Polygon:
  35513. options2.polygonType = DrawTools.PolygonType.NormalPolygon;
  35514. _self._sketchDrawPolygon(_self._drawEventHandler, options2);
  35515. break;
  35516. case DrawTools.DrawType.SpatialLine:
  35517. _self._sketchDrawSpatialPolyline(_self._drawEventHandler, options2);
  35518. break;
  35519. case DrawTools.DrawType.Circle:
  35520. options2.circleType = DrawTools.CircleType.ColorCircle;
  35521. _self._sketchDrawCircle(_self._drawEventHandler, options2);
  35522. break;
  35523. case DrawTools.DrawType.Rectangle:
  35524. _self._sketchDrawRectangle(_self._drawEventHandler, options2);
  35525. break;
  35526. case DrawTools.DrawType.NormalWall:
  35527. options2.wallType = DrawTools.WallType.ColorWall;
  35528. _self._sketchDrawWall(_self._drawEventHandler, options2);
  35529. break;
  35530. case DrawTools.DrawType.DynamicWall:
  35531. options2.wallType = DrawTools.WallType.DynamicWall;
  35532. _self._sketchDrawWall(_self._drawEventHandler, options2);
  35533. break;
  35534. case DrawTools.DrawType.TextWall:
  35535. options2.wallType = DrawTools.WallType.TextWall;
  35536. _self._sketchDrawWall(_self._drawEventHandler, options2);
  35537. break;
  35538. case DrawTools.DrawType.DynamicCircle:
  35539. options2.circleType = DrawTools.CircleType.DynamicCircle;
  35540. _self._sketchDrawCircle(_self._drawEventHandler, options2);
  35541. break;
  35542. case DrawTools.DrawType.House:
  35543. options2.polygonType = DrawTools.PolygonType.HousePolygon;
  35544. _self._sketchDrawPolygon(_self._drawEventHandler, options2);
  35545. break;
  35546. case DrawTools.DrawType.VideoWall:
  35547. _self._sketchDrawVideoWall(_self._drawEventHandler, options2);
  35548. break;
  35549. case DrawTools.DrawType.OdLine:
  35550. _self._sketchDrawOdline(_self._drawEventHandler, options2);
  35551. break;
  35552. }
  35553. },
  35554. Clear: function() {
  35555. this._clear(true);
  35556. this._unActivateEdit();
  35557. this._closePropertyEditDialog();
  35558. this._removeOperationDom();
  35559. },
  35560. sketchInit: function() {
  35561. this._clear(false);
  35562. },
  35563. _checkAppOrWeb() {
  35564. if (window.navigator.userAgent.match(
  35565. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  35566. )) {
  35567. return DrawTools.RuntimeEnvironment.App;
  35568. } else {
  35569. return DrawTools.RuntimeEnvironment.Web;
  35570. }
  35571. },
  35572. _isRuntimeApp() {
  35573. if (this._checkAppOrWeb() === DrawTools.RuntimeEnvironment.App) {
  35574. return true;
  35575. }
  35576. return false;
  35577. }
  35578. });
  35579. Object.assign(DrawTools.prototype, {
  35580. _tooltipInit: function(text, mousePosition) {
  35581. let _self = this;
  35582. this._tooltipId = "tooltipSketchmodel";
  35583. let tooltipObj = document.getElementById(this._tooltipId);
  35584. if (tooltipObj === null) {
  35585. tooltipObj = document.createElement("div");
  35586. tooltipObj.id = this._tooltipId;
  35587. document.body.appendChild(tooltipObj);
  35588. let divStyle = "";
  35589. divStyle += "top: 30px;";
  35590. divStyle += "left: 30px;";
  35591. divStyle += "position: absolute;";
  35592. divStyle += "display: flex;";
  35593. divStyle += "align-items: center;";
  35594. divStyle += "width: 12x0px;";
  35595. divStyle += "height: auto;";
  35596. divStyle += "background-color: rgba(0, 0, 0, 0.65);";
  35597. divStyle += "border-radius: 5px;";
  35598. divStyle += "color: rgb(255, 255, 255);";
  35599. divStyle += "font-size: 12px;";
  35600. divStyle += "font-family: 'Alimama_ShuHeiTi_Bold';";
  35601. divStyle += "padding: 8px;";
  35602. divStyle += "border:solid 1px rgb(255,0,0);";
  35603. tooltipObj.setAttribute("style", divStyle);
  35604. }
  35605. if (text != void 0)
  35606. tooltipObj.innerHTML = text;
  35607. if (mousePosition === void 0) {
  35608. document.onmousemove = function(event2) {
  35609. if (event2.clientX < 100 || event2.clientX > _self._canvasWidth - 100 || event2.clientY < 100 || event2.clientY > _self._canvasHeight - 100) {
  35610. tooltipObj.style.display = "none";
  35611. } else {
  35612. tooltipObj.style.display = "flex";
  35613. tooltipObj.style.left = event2.clientX + 10 + "px";
  35614. tooltipObj.style.top = event2.clientY - tooltipObj.offsetHeight / 2 + "px";
  35615. }
  35616. };
  35617. } else {
  35618. if (mousePosition.x < 100 || mousePosition.x > _self._canvasWidth - 100 || mousePosition.y < 100 || mousePosition.y > _self._canvasHeight - 100) {
  35619. tooltipObj.style.display = "none";
  35620. } else {
  35621. tooltipObj.style.display = "flex";
  35622. tooltipObj.style.left = mousePosition.x + 10 + "px";
  35623. tooltipObj.style.top = mousePosition.y - tooltipObj.offsetHeight / 2 + "px";
  35624. }
  35625. }
  35626. },
  35627. _tooltipRemove: function() {
  35628. let tooltipObj = document.getElementById(this._tooltipId);
  35629. if (tooltipObj != null) {
  35630. document.body.removeChild(tooltipObj);
  35631. }
  35632. },
  35633. _tooltipSetText: function(text, mousePosition) {
  35634. let tooltipObj = document.getElementById(this._tooltipId);
  35635. if (tooltipObj != null) {
  35636. if (text != void 0)
  35637. tooltipObj.innerHTML = text;
  35638. if (mousePosition != void 0) {
  35639. if (mousePosition.x < 100 || mousePosition.x > this._canvasWidth - 100 || mousePosition.y < 100 || mousePosition.y > this._canvasHeight - 100) {
  35640. tooltipObj.style.display = "none";
  35641. } else {
  35642. tooltipObj.style.display = "flex";
  35643. tooltipObj.style.left = mousePosition.x + 10 + "px";
  35644. tooltipObj.style.top = mousePosition.y - tooltipObj.offsetHeight / 2 + "px";
  35645. }
  35646. }
  35647. }
  35648. },
  35649. _setMousePointerStyle: function() {
  35650. document.querySelector("body").style.cursor = "crosshair";
  35651. },
  35652. _setMouseDefaultStyle: function() {
  35653. document.querySelector("body").style.cursor = "default";
  35654. },
  35655. _beginTooltip(text, position2) {
  35656. this._tooltipInit(text, position2);
  35657. this._setMousePointerStyle();
  35658. },
  35659. _updateTooltip(text, position2) {
  35660. this._tooltipSetText(text, position2);
  35661. },
  35662. _endTooltip() {
  35663. this._tooltipRemove();
  35664. this._setMouseDefaultStyle();
  35665. },
  35666. _showTooltipMessage: function(message) {
  35667. let msgMainDom = document.getElementById("messageMainDom");
  35668. if (msgMainDom !== null && msgMainDom !== void 0) {
  35669. document.body.removeChild(msgMainDom);
  35670. }
  35671. msgMainDom = document.createElement("div");
  35672. msgMainDom.style.width = "30%";
  35673. msgMainDom.style.backgroundColor = "rgba(237, 248, 230, 1.0)";
  35674. msgMainDom.style.height = "45px";
  35675. msgMainDom.style.border = "solid 2px rgb(219, 241, 208)";
  35676. msgMainDom.style.borderRadius = "8px";
  35677. msgMainDom.style.display = "flex";
  35678. msgMainDom.style.alignItems = "center";
  35679. msgMainDom.style.paddingLeft = "10px";
  35680. msgMainDom.style.color = "rgb(91, 188, 48)";
  35681. msgMainDom.style.fontSize = "14px";
  35682. msgMainDom.style.fontWeight = "600";
  35683. msgMainDom.style.position = "absolute";
  35684. msgMainDom.style.left = "35%";
  35685. msgMainDom.style.transition = "transform 1s";
  35686. msgMainDom.style.transform = "translateY(-90px)";
  35687. msgMainDom.style.top = "0px";
  35688. msgMainDom.style.zIndex = 1e3;
  35689. document.body.appendChild(msgMainDom);
  35690. let strHtml = "";
  35691. strHtml += "<div style='";
  35692. strHtml += "background-color: rgb(88, 185, 45);";
  35693. strHtml += "color: rgb(255, 255, 255);";
  35694. strHtml += "height: 24px;";
  35695. strHtml += "width: 24px;";
  35696. strHtml += "border-radius: 20px;";
  35697. strHtml += "display: flex;";
  35698. strHtml += "justify-content: center;";
  35699. strHtml += "align-items: center;";
  35700. strHtml += "font-size: 14px;";
  35701. strHtml += "margin-right: 18px;";
  35702. strHtml += "'>&#10003</div>";
  35703. strHtml += "<div>" + message + "</div>";
  35704. msgMainDom.innerHTML = strHtml;
  35705. msgMainDom.addEventListener("transitionend", function() {
  35706. setTimeout(function() {
  35707. document.body.removeChild(msgMainDom);
  35708. }, 1e3);
  35709. }, false);
  35710. setTimeout(function() {
  35711. msgMainDom.style.transform = "translateY(50px)";
  35712. }, 100);
  35713. }
  35714. });
  35715. Object.assign(DrawTools.prototype, {
  35716. _createSingleCoordinateAxisArrow(positions, color2, axisEntityId) {
  35717. let _self = this;
  35718. let coordinateAxisEntity = new Cesium.Entity({
  35719. id: axisEntityId,
  35720. name: _self._coordinateAxisEntityName,
  35721. position: positions[0],
  35722. polyline: {
  35723. positions,
  35724. width: 10,
  35725. material: _self._materialPolylineArrowProperty({
  35726. color: color2
  35727. })
  35728. }
  35729. });
  35730. coordinateAxisEntity.setEditType({
  35731. type: DrawTools.EditPointType.CoordinateAxis
  35732. });
  35733. return this._entities.add(coordinateAxisEntity);
  35734. },
  35735. _getTranslatePostion: function(originPosition, translateCartesian) {
  35736. let transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(originPosition);
  35737. let m = new Cesium.Matrix4();
  35738. Cesium.Matrix4.setTranslation(
  35739. Cesium.Matrix4.IDENTITY,
  35740. translateCartesian,
  35741. m
  35742. );
  35743. let modelMatrix = Cesium.Matrix4.multiply(transform3, m, transform3);
  35744. let outPosition = new Cesium.Cartesian3(0, 0, 0);
  35745. Cesium.Matrix4.getTranslation(modelMatrix, outPosition);
  35746. return outPosition;
  35747. },
  35748. _createCoordinateAxis: function(position2) {
  35749. this._showTooltipMessage("\u5355\u51FB\u53F3\u952E\u79FB\u9664\u8C03\u6574\u8F74\u7EBF\uFF01");
  35750. this._removeCoorinateAxis();
  35751. let _self = this;
  35752. let cameraRight = this._viewer.scene.camera.rightWC;
  35753. this._tx = cameraRight.x > 0 ? 150 : -150;
  35754. this._ty = cameraRight.y > 0 ? 150 : -150;
  35755. this._tz = 150;
  35756. this._coordinateAxisEntityId_x = "coordinateAxisId_x";
  35757. this._coordinateAxisEntityId_y = "coordinateAxisId_y";
  35758. this._coordinateAxisEntityId_z = "coordinateAxisId_z";
  35759. this._coordinateAxisEntityName = "coordinateAxisEntity";
  35760. let translateCartesian = new Cesium.Cartesian3(this._tx, 0, 0);
  35761. let endPosition = this._getTranslatePostion(position2, translateCartesian);
  35762. const xPos = [position2, endPosition];
  35763. this._coordinateEntity_x = this._createSingleCoordinateAxisArrow(xPos, "rgba(0,255,0,1.0)", this._coordinateAxisEntityId_x);
  35764. this._coordinateAxisBindEntity(this._coordinateEntity_x);
  35765. translateCartesian = new Cesium.Cartesian3(0, this._ty, 0);
  35766. endPosition = this._getTranslatePostion(position2, translateCartesian);
  35767. const yPos = [position2, endPosition];
  35768. this._coordinateEntity_y = this._createSingleCoordinateAxisArrow(yPos, "rgba(0,0,255,1.0)", this._coordinateAxisEntityId_y);
  35769. this._coordinateAxisBindEntity(this._coordinateEntity_y);
  35770. translateCartesian = new Cesium.Cartesian3(0, 0, this._tz);
  35771. endPosition = this._getTranslatePostion(position2, translateCartesian);
  35772. const zPos = [position2, endPosition];
  35773. this._coordinateEntity_z = this._createSingleCoordinateAxisArrow(zPos, "rgba(255,0,0,1.0)", this._coordinateAxisEntityId_z);
  35774. this._coordinateAxisBindEntity(this._coordinateEntity_z);
  35775. this._eventCoorinateAxis = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  35776. this._registerLeftDownEvent(this._eventCoorinateAxis, function(event2) {
  35777. _self._coorinateAxisMouseDown(event2);
  35778. });
  35779. this._registerMouseMoveEvent(this._eventCoorinateAxis, function(event2) {
  35780. _self._coorinateAxisMouseMove(event2);
  35781. });
  35782. this._registerLeftUpEvent(this._eventCoorinateAxis, function(event2) {
  35783. _self._coorinateAxisMouseUp(event2);
  35784. });
  35785. this._registerRightClickEvent(this._eventCoorinateAxis, function(event2) {
  35786. _self._removeCoorinateAxis();
  35787. });
  35788. },
  35789. _coordinateAxisBindEntity: function(axisEntity) {
  35790. if (this._editEntity === void 0)
  35791. return;
  35792. let editEntityType = this._editEntity.getEntityType();
  35793. if (editEntityType === void 0)
  35794. return;
  35795. if (editEntityType === DrawTools.DrawType.VideoWall) {
  35796. axisEntity.bindEntity(this._editEntity);
  35797. }
  35798. },
  35799. _coorinateAxisMouseDown: function(event2) {
  35800. let _self = this;
  35801. let feature2 = this._viewer.scene.pick(event2.position);
  35802. if (feature2 === void 0)
  35803. return;
  35804. if (feature2.id != void 0 && feature2.id instanceof Cesium.Entity) {
  35805. this._viewer.scene.screenSpaceCameraController.enableRotate = false;
  35806. if (feature2.id.getEditType() === void 0)
  35807. return;
  35808. let entityType = feature2.id.getEditType().type;
  35809. if (entityType !== DrawTools.EditPointType.CoordinateAxis)
  35810. return;
  35811. this._editCoorinateAxis = feature2.id;
  35812. this._editCoorinateAxis.polyline.width = 15;
  35813. this._coordinateAxisMoveStartPosition = this._viewer.scene.camera.pickEllipsoid(
  35814. event2.position,
  35815. this._viewer.scene.globe.ellipsoid
  35816. );
  35817. this._coordinateAxisMoveStartScreen = event2.position;
  35818. this._coorinateAxisPosition = this._editCoorinateAxis.position._value;
  35819. this._coordinateEntity_x.polyline.positions = new Cesium.CallbackProperty(function() {
  35820. let translateCartesian = new Cesium.Cartesian3(_self._tx, 0, 0);
  35821. let endPosition = _self._getTranslatePostion(
  35822. _self._coorinateAxisPosition,
  35823. translateCartesian
  35824. );
  35825. return [_self._coorinateAxisPosition, endPosition];
  35826. }, false);
  35827. this._coordinateEntity_y.polyline.positions = new Cesium.CallbackProperty(function() {
  35828. let translateCartesian = new Cesium.Cartesian3(0, _self._ty, 0);
  35829. let endPosition = _self._getTranslatePostion(
  35830. _self._coorinateAxisPosition,
  35831. translateCartesian
  35832. );
  35833. return [_self._coorinateAxisPosition, endPosition];
  35834. }, false);
  35835. this._coordinateEntity_z.polyline.positions = new Cesium.CallbackProperty(function() {
  35836. let translateCartesian = new Cesium.Cartesian3(0, 0, _self._tz);
  35837. let endPosition = _self._getTranslatePostion(
  35838. _self._coorinateAxisPosition,
  35839. translateCartesian
  35840. );
  35841. return [_self._coorinateAxisPosition, endPosition];
  35842. }, false);
  35843. this._coordinateAxisActivateEditEntity(this._editCoorinateAxis);
  35844. }
  35845. },
  35846. _coorinateAxisMouseMove: function(event2) {
  35847. if (!Cesium.defined(this._editCoorinateAxis))
  35848. return;
  35849. let position2 = this._viewer.scene.camera.pickEllipsoid(
  35850. event2.endPosition,
  35851. this._viewer.scene.globe.ellipsoid
  35852. );
  35853. if (!position2)
  35854. return;
  35855. let strGeo = this._cartesian3ToGeo(this._coordinateAxisMoveStartPosition);
  35856. let endGeo = this._cartesian3ToGeo(position2);
  35857. let entityId = this._editCoorinateAxis.id;
  35858. let entityPosition = this._editCoorinateAxis.position._value;
  35859. let entityGeo = this._cartesian3ToGeo(entityPosition);
  35860. let heightDifference = 0;
  35861. if (entityId === this._coordinateAxisEntityId_x) {
  35862. let difference = strGeo.longitude - endGeo.longitude;
  35863. entityGeo.longitude = entityGeo.longitude - difference;
  35864. } else if (entityId === this._coordinateAxisEntityId_y) {
  35865. let difference = strGeo.latitude - endGeo.latitude;
  35866. entityGeo.latitude = entityGeo.latitude - difference;
  35867. } else if (entityId === this._coordinateAxisEntityId_z) {
  35868. heightDifference = event2.endPosition.y - this._coordinateAxisMoveStartScreen.y;
  35869. heightDifference = heightDifference * 0.5;
  35870. entityGeo.height = entityGeo.height - heightDifference;
  35871. }
  35872. this._coorinateAxisPosition = Cesium.Cartesian3.fromDegrees(entityGeo.longitude, entityGeo.latitude, entityGeo.height);
  35873. this._moveEditEntityByCoordinateAxis(entityPosition, this._coorinateAxisPosition, heightDifference);
  35874. },
  35875. _coorinateAxisMouseUp: function(event2) {
  35876. this._viewer.scene.screenSpaceCameraController.enableRotate = true;
  35877. if (this._editCoorinateAxis !== void 0) {
  35878. this._editCoorinateAxis.polyline.width = 10;
  35879. let translateCartesian = new Cesium.Cartesian3(this._tx, 0, 0);
  35880. let endPosition = this._getTranslatePostion(this._coorinateAxisPosition, translateCartesian);
  35881. this._coordinateEntity_x.polyline.positions = [this._coorinateAxisPosition, endPosition];
  35882. translateCartesian = new Cesium.Cartesian3(0, this._ty, 0);
  35883. endPosition = this._getTranslatePostion(this._coorinateAxisPosition, translateCartesian);
  35884. this._coordinateEntity_y.polyline.positions = [this._coorinateAxisPosition, endPosition];
  35885. translateCartesian = new Cesium.Cartesian3(0, 0, this._tz);
  35886. endPosition = this._getTranslatePostion(this._coorinateAxisPosition, translateCartesian);
  35887. this._coordinateEntity_z.polyline.positions = [this._coorinateAxisPosition, endPosition];
  35888. this._coordinateEntity_x.position = this._coorinateAxisPosition;
  35889. this._coordinateEntity_y.position = this._coorinateAxisPosition;
  35890. this._coordinateEntity_z.position = this._coorinateAxisPosition;
  35891. this._coordinateAxisUpdateEditEntity(this._editCoorinateAxis);
  35892. this._editCoorinateAxis = void 0;
  35893. }
  35894. },
  35895. _moveEditEntityByCoordinateAxis: function(strPosition, endPosition, heightDifference) {
  35896. let movePosition = Cesium.Cartesian3.subtract(endPosition, strPosition, new Cesium.Cartesian3());
  35897. for (let i2 = 0; i2 < this._moveInitPositions.length; i2++) {
  35898. let moveResult = Cesium.Cartesian3.add(this._moveInitPositions[i2], movePosition, new Cesium.Cartesian3());
  35899. this._moveUpdatePositions[i2] = moveResult.clone();
  35900. }
  35901. for (let i2 = 0; i2 < this._moveInitHeights.length; i2++) {
  35902. this._moveUpdateHeights[i2] = parseFloat(this._moveInitHeights[i2]) + heightDifference * -1;
  35903. }
  35904. },
  35905. _coordinateAxisActivateEditEntity: function(moveAxisEntity) {
  35906. let _self = this;
  35907. let bindEntity = moveAxisEntity.getBindEntity();
  35908. if (bindEntity === void 0)
  35909. return;
  35910. let bindEntityType = bindEntity.getEntityType();
  35911. if (bindEntityType === DrawTools.DrawType.VideoWall) {
  35912. let wall = bindEntity.wall;
  35913. this._moveInitPositions = wall.positions._value;
  35914. this._moveInitHeights = wall.minimumHeights._value;
  35915. this._moveInitHeight = wall.maximumHeights._value[0] - wall.minimumHeights._value[0];
  35916. this._moveUpdatePositions = [];
  35917. for (let i2 = 0; i2 < this._moveInitPositions.length; i2++) {
  35918. this._moveUpdatePositions.push(this._moveInitPositions[i2].clone());
  35919. }
  35920. wall.positions = new Cesium.CallbackProperty(function() {
  35921. return _self._moveUpdatePositions;
  35922. }, false);
  35923. this._moveUpdateHeights = [];
  35924. for (let i2 = 0; i2 < this._moveInitHeights.length; i2++) {
  35925. this._moveUpdateHeights.push(this._moveInitHeights[i2]);
  35926. }
  35927. wall.minimumHeights = new Cesium.CallbackProperty(function() {
  35928. return _self._moveUpdateHeights;
  35929. }, false);
  35930. wall.maximumHeights = new Cesium.CallbackProperty(function() {
  35931. let maxHeights = [];
  35932. for (let i2 = 0; i2 < _self._moveUpdateHeights.length; i2++) {
  35933. maxHeights.push(parseFloat(_self._moveUpdateHeights[i2]) + _self._moveInitHeight);
  35934. }
  35935. return maxHeights;
  35936. }, false);
  35937. }
  35938. },
  35939. _coordinateAxisUpdateEditEntity: function(moveAxisEntity) {
  35940. let bindEntity = moveAxisEntity.getBindEntity();
  35941. if (bindEntity === void 0)
  35942. return;
  35943. let bindEntityType = bindEntity.getEntityType();
  35944. if (bindEntityType === DrawTools.DrawType.VideoWall) {
  35945. let wall = bindEntity.wall;
  35946. wall.positions = this._moveUpdatePositions;
  35947. wall.minimumHeights = this._moveUpdateHeights;
  35948. let maxHeights = [];
  35949. for (let i2 = 0; i2 < this._moveUpdateHeights.length; i2++) {
  35950. maxHeights.push(parseFloat(this._moveUpdateHeights[i2]) + this._moveInitHeight);
  35951. }
  35952. wall.maximumHeights = maxHeights;
  35953. }
  35954. },
  35955. _coordinateCalculateEntityOrientation: function(entity, options2) {
  35956. let position2 = entity.position._value;
  35957. let orientation = entity.orientation === void 0 ? new Cesium.Cartesian3(0, 0, 0) : entity.orientation._value;
  35958. let transform3 = Cesium.Matrix4.fromTranslationQuaternionRotationScale(
  35959. position2,
  35960. orientation,
  35961. new Cesium.Cartesian3(1, 1, 1),
  35962. new Cesium.Matrix4()
  35963. );
  35964. let _rotateX = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(options2.x));
  35965. let _rotateY = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(options2.y));
  35966. let _rotateZ = Cesium.Matrix3.fromRotationX(Cesium.Math.toRadians(options2.z));
  35967. transform3 = Cesium.Matrix4.multiplyByMatrix3(transform3, _rotateX, transform3);
  35968. transform3 = Cesium.Matrix4.multiplyByMatrix3(transform3, _rotateY, transform3);
  35969. transform3 = Cesium.Matrix4.multiplyByMatrix3(transform3, _rotateZ, transform3);
  35970. let m3 = Cesium.Matrix4.getRotation(transform3, new Cesium.Matrix3());
  35971. let resOrientation = new Cesium.Quaternion();
  35972. Cesium.Quaternion.fromRotationMatrix(m3, resOrientation);
  35973. return resOrientation;
  35974. },
  35975. _removeCoorinateAxis: function() {
  35976. if (this._coordinateAxisEntityName !== void 0) {
  35977. this._removeEntityByName(this._coordinateAxisEntityName);
  35978. }
  35979. if (this._eventCoorinateAxis !== void 0) {
  35980. this._clearEvent(this._eventCoorinateAxis);
  35981. this._eventCoorinateAxis = void 0;
  35982. }
  35983. }
  35984. });
  35985. Object.assign(DrawTools.prototype, {
  35986. _setEntityIsEdit(entity) {
  35987. let _self = this;
  35988. entity.setIsEdit(true);
  35989. this._unActivateEdit();
  35990. this._sendShowPropertyDialog(entity);
  35991. let handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  35992. this._registerLeftClickEvent(handler, function(event2) {
  35993. _self._unActivateEdit();
  35994. let feature2 = _self._viewer.scene.pick(event2.position);
  35995. if (feature2 !== void 0 && feature2.id instanceof Cesium.Entity) {
  35996. let featureType = feature2.id.getEditType();
  35997. let entityType = feature2.id.getEntityType();
  35998. if (featureType === DrawTools.EditPointType.Node || featureType === DrawTools.EditPointType.Middle || featureType === DrawTools.EditPointType.Center || featureType === DrawTools.EditPointType.CoordinateAxis || featureType === DrawTools.EditPointType.OdlineStrartNode || featureType === DrawTools.EditPointType.OdlineEndNode || entityType === DrawTools.DrawType.Polyline || entityType === DrawTools.DrawType.ArrowPolyline || entityType === DrawTools.DrawType.DynamicPolyline || entityType === DrawTools.DrawType.GrowPolyline || entityType === DrawTools.DrawType.OutlinePolyline || entityType === DrawTools.DrawType.OdLine || entityType === DrawTools.DrawType.Polygon || entityType === DrawTools.DrawType.SpatialLine || entityType === DrawTools.DrawType.Circle || entityType === DrawTools.DrawType.DynamicCircle || entityType === DrawTools.DrawType.Rectangle || entityType === DrawTools.DrawType.NormalWall || entityType === DrawTools.DrawType.DynamicWall || entityType === DrawTools.DrawType.House || entityType === DrawTools.DrawType.TextWall || entityType === DrawTools.DrawType.VideoWall) {
  35999. _self._sendShowPropertyDialog(feature2.id);
  36000. }
  36001. }
  36002. });
  36003. },
  36004. _sendShowPropertyDialog(entity) {
  36005. let _self = this;
  36006. let editEntityType = entity.getEntityType();
  36007. if (entity.getIsEdit() === void 0 || entity.getIsEdit() === false || editEntityType === void 0) {
  36008. this._unActivateEdit();
  36009. return;
  36010. }
  36011. let editProperty = entity.getParams();
  36012. if (editEntityType === DrawTools.DrawType.OdLine) {
  36013. editProperty = entity.parent.getParams();
  36014. }
  36015. this._console("\u9009\u62E9\u5B9E\u4F53\u7684\u5C5E\u6027", editProperty);
  36016. if (editProperty !== void 0 && this.onEditProperty !== void 0) {
  36017. this._openPropertyEditDialog(editProperty, function(params) {
  36018. _self.updateEditEntityProperty(params);
  36019. }, function() {
  36020. _self._removeEditEntity();
  36021. });
  36022. }
  36023. this._activateEdit(entity);
  36024. },
  36025. _removeEditEntity() {
  36026. if (this._editEntity !== void 0) {
  36027. this._console("\u79FB\u9664\u5B9E\u4F53", this._editEntity);
  36028. let entityType = this._editEntity.getEntityType();
  36029. if (entityType === DrawTools.DrawType.OdLine) {
  36030. let fatherEntityId = this._editEntity.parent.id;
  36031. let removeEntitys = [];
  36032. for (let entity of this._entities.values) {
  36033. if (entity.parent !== void 0 && entity.parent.id === fatherEntityId) {
  36034. removeEntitys.push(entity);
  36035. }
  36036. }
  36037. for (let removeEntity of removeEntitys) {
  36038. this._removeEntityByObject(removeEntity);
  36039. }
  36040. } else {
  36041. this._removeEntityByObject(this._editEntity);
  36042. }
  36043. this._unActivateEdit();
  36044. this._editEntity = void 0;
  36045. }
  36046. },
  36047. updateEditEntityProperty: function(params) {
  36048. if (this._editEntity === void 0)
  36049. return;
  36050. if (this._editEntity.getIsEdit() === void 0 || this._editEntity.getIsEdit() === false)
  36051. return;
  36052. let editEntityType = this._editEntity.getEntityType();
  36053. if (editEntityType === void 0)
  36054. return;
  36055. if (editEntityType === DrawTools.DrawType.NormalWall || editEntityType === DrawTools.DrawType.DynamicWall || editEntityType === DrawTools.DrawType.TextWall) {
  36056. this._updateWallProperty(params);
  36057. } else if (editEntityType === DrawTools.DrawType.Circle || editEntityType === DrawTools.DrawType.DynamicCircle) {
  36058. this._updateCircleProperty(params);
  36059. } else if (editEntityType === DrawTools.DrawType.House) {
  36060. this._updateHouseProperty(params);
  36061. } else if (editEntityType === DrawTools.DrawType.VideoWall) {
  36062. this._updateVideoWallProperty(params);
  36063. } else if (editEntityType === DrawTools.DrawType.Polyline) {
  36064. this._updatePolylineProperty(params);
  36065. } else if (editEntityType === DrawTools.DrawType.Polygon) {
  36066. this._updatePolygonProperty(params);
  36067. } else if (editEntityType === DrawTools.DrawType.Rectangle) {
  36068. this._updateRectangleProperty(params);
  36069. } else if (editEntityType === DrawTools.DrawType.SpatialLine) {
  36070. this._updateSpatialPolylineProperty(params);
  36071. } else if (editEntityType === DrawTools.DrawType.OdLine) {
  36072. this._updateOdlineProperty(params);
  36073. }
  36074. },
  36075. _updateOdlineProperty(params) {
  36076. let _self = this;
  36077. let fatherEntity = this._editEntity.parent;
  36078. this._editOdlineEntities = [];
  36079. for (let entity of this._entities.values) {
  36080. if (entity.parent !== void 0 && entity.parent.id === fatherEntity.id) {
  36081. this._editOdlineEntities.push(entity);
  36082. }
  36083. }
  36084. let meterialImage = this._image_arrow_reverse;
  36085. if (params.order === this._param.order_add) {
  36086. meterialImage = this._image_arrow_reverse;
  36087. } else if (params.order === this._param.order_minus) {
  36088. meterialImage = this._image_arrow_forward;
  36089. }
  36090. let odLineMaterial = new WallMaterialProperty({
  36091. viewer: _self._viewer,
  36092. trailImage: meterialImage,
  36093. duration: params.duration,
  36094. color: Cesium.Color.fromCssColorString(params.color),
  36095. param: {
  36096. direction: params.direction,
  36097. count: params.count,
  36098. order: params.order
  36099. }
  36100. });
  36101. for (let entity of this._editOdlineEntities) {
  36102. entity.polyline.material = odLineMaterial;
  36103. let positions = entity.polyline.positions._value;
  36104. let strPoint = positions.first();
  36105. let endPoint = positions.last();
  36106. let newPositios = this._calculateOdlinePositios(
  36107. strPoint,
  36108. endPoint,
  36109. parseInt(params.odlineHeight),
  36110. parseInt(params.odlineCount)
  36111. );
  36112. entity.polyline.positions = newPositios;
  36113. entity.polyline.width = parseInt(params.lineWidth);
  36114. }
  36115. fatherEntity.setParams(params);
  36116. },
  36117. _updateSpatialPolylineProperty(params) {
  36118. let material = this._editEntity.polyline.material;
  36119. let newMaterial = void 0;
  36120. if (material instanceof Cesium.ColorMaterialProperty) {
  36121. newMaterial = this._materialColorProperty({
  36122. color: params.color
  36123. });
  36124. }
  36125. if (newMaterial !== void 0)
  36126. this._editEntity.polyline.material = newMaterial;
  36127. this._editEntity.polyline.width = parseFloat(params.lineWidth);
  36128. this._editEntity.setParams(params);
  36129. },
  36130. _updateRectangleProperty(params) {
  36131. let material = this._editEntity.rectangle.material;
  36132. if (material instanceof Cesium.ColorMaterialProperty) {
  36133. let newMaterial = this._materialColorProperty({
  36134. color: params.color
  36135. });
  36136. this._editEntity.rectangle.material = newMaterial;
  36137. }
  36138. if (this._editEntity.polyline !== void 0) {
  36139. let newMaterial = this._materialColorProperty({
  36140. color: params.outlineColor
  36141. });
  36142. this._editEntity.polyline.material = newMaterial;
  36143. this._editEntity.polyline.width = parseFloat(params.outlineWidth);
  36144. }
  36145. this._editEntity.setParams(params);
  36146. },
  36147. _updatePolygonProperty(params) {
  36148. let material = this._editEntity.polygon.material;
  36149. if (material instanceof Cesium.ColorMaterialProperty) {
  36150. let newMaterial = this._materialColorProperty({
  36151. color: params.color
  36152. });
  36153. this._editEntity.polygon.material = newMaterial;
  36154. }
  36155. if (this._editEntity.polyline !== void 0) {
  36156. let newMaterial = this._materialColorProperty({
  36157. color: params.outlineColor
  36158. });
  36159. this._editEntity.polyline.material = newMaterial;
  36160. this._editEntity.polyline.width = parseFloat(params.outlineWidth);
  36161. }
  36162. this._editEntity.setParams(params);
  36163. },
  36164. _updatePolylineProperty(params) {
  36165. let material = this._editEntity.polyline.material;
  36166. let newMaterial = void 0;
  36167. if (material instanceof Cesium.ColorMaterialProperty) {
  36168. newMaterial = this._materialColorProperty({
  36169. color: params.color
  36170. });
  36171. } else if (material instanceof Cesium.PolylineArrowMaterialProperty) {
  36172. newMaterial = this._materialPolylineArrowProperty({
  36173. color: params.color
  36174. });
  36175. } else if (material instanceof WallMaterialProperty) {
  36176. let materialImage = this._image_h_l_r;
  36177. if (params.order === this._param.order_minus) {
  36178. materialImage = this._image_h_r_l;
  36179. } else if (params.order === this._param.order_add) {
  36180. materialImage = this._image_h_l_r;
  36181. }
  36182. newMaterial = new WallMaterialProperty({
  36183. viewer: this._viewer,
  36184. trailImage: materialImage,
  36185. duration: params.duration,
  36186. color: Cesium.Color.fromCssColorString(params.color),
  36187. param: {
  36188. count: parseInt(params.count),
  36189. direction: params.direction,
  36190. order: params.order
  36191. }
  36192. });
  36193. } else if (material instanceof Cesium.PolylineGlowMaterialProperty) {
  36194. newMaterial = this._materialPolylineGlowProperty({
  36195. color: params.color,
  36196. power: parseFloat(params.power)
  36197. });
  36198. } else if (material instanceof Cesium.PolylineOutlineMaterialProperty) {
  36199. newMaterial = this._materialPolylineOutlineProperty({
  36200. color: params.color,
  36201. outlineWidth: parseFloat(params.outlineWidth),
  36202. outlineColor: params.outlineColor
  36203. });
  36204. }
  36205. if (newMaterial !== void 0)
  36206. this._editEntity.polyline.material = newMaterial;
  36207. this._editEntity.polyline.width = params.lineWidth;
  36208. this._editEntity.setParams(params);
  36209. },
  36210. _updateHouseProperty(params) {
  36211. let entityParams = this._editEntity.getParams();
  36212. let polygonMaterial = this._editEntity.polygon.material;
  36213. if (polygonMaterial instanceof Cesium.ColorMaterialProperty) {
  36214. let material = this._materialColorProperty({
  36215. color: params.color
  36216. });
  36217. this._editEntity.polygon.material = material;
  36218. this._editEntity.polygon.extrudedHeight = parseFloat(params.height) + parseFloat(
  36219. entityParams.bottomHeight
  36220. );
  36221. this._editEntity.setParams(params);
  36222. }
  36223. },
  36224. _updateCircleProperty(params) {
  36225. let circleMaterial = this._editEntity.ellipse.material;
  36226. if (circleMaterial instanceof CircleMaterialProperty) {
  36227. let material = new CircleMaterialProperty({
  36228. viewer: this._viewer,
  36229. duration: params.duration,
  36230. color: Cesium.Color.fromCssColorString(params.color),
  36231. count: parseFloat(params.count)
  36232. });
  36233. this._editEntity.ellipse.material = material;
  36234. } else if (circleMaterial instanceof Cesium.ColorMaterialProperty) {
  36235. let material = this._materialColorProperty({
  36236. color: params.color
  36237. });
  36238. this._editEntity.ellipse.material = material;
  36239. if (this._editEntity.polyline !== void 0) {
  36240. let newMaterial = this._materialColorProperty({
  36241. color: params.outlineColor
  36242. });
  36243. this._editEntity.polyline.material = newMaterial;
  36244. this._editEntity.polyline.width = parseFloat(params.outlineWidth);
  36245. }
  36246. }
  36247. this._editEntity.setParams(params);
  36248. },
  36249. _updateVideoWallProperty(params) {
  36250. let videoElement = document.getElementById("wallVideo");
  36251. if (videoElement !== null) {
  36252. document.body.removeChild(videoElement);
  36253. }
  36254. videoElement = document.createElement("video");
  36255. videoElement.id = "wallVideo";
  36256. videoElement.setAttribute("crossorigin", "anonymous");
  36257. videoElement.setAttribute("width", "1024px");
  36258. videoElement.setAttribute("height", "256px");
  36259. videoElement.setAttribute("controls", "controls");
  36260. videoElement.setAttribute("src", params.videoUrl);
  36261. videoElement.setAttribute("loop", "loop");
  36262. videoElement.play();
  36263. document.body.appendChild(videoElement);
  36264. let minimumHeights = this._editEntity.wall.minimumHeights._value;
  36265. let maximumHeights = [];
  36266. for (let i2 = 0; i2 < minimumHeights.length; i2++) {
  36267. maximumHeights.push(minimumHeights[i2] + parseFloat(params.height));
  36268. }
  36269. this._editEntity.wall.maximumHeights = maximumHeights;
  36270. this._editEntity.wall.material = videoElement;
  36271. let wallPositions = this._editEntity.wall.positions._value;
  36272. let newPositions = [];
  36273. for (let wallPosition of wallPositions) {
  36274. let transform3 = Cesium.Transforms.eastNorthUpToFixedFrame(wallPosition);
  36275. let m = new Cesium.Matrix4();
  36276. Cesium.Matrix4.setTranslation(Cesium.Matrix4.IDENTITY, new Cesium.Cartesian3(
  36277. parseFloat(params.axisX),
  36278. parseFloat(params.axisY),
  36279. parseFloat(params.axisZ)
  36280. ), m);
  36281. let moveMatrix = Cesium.Matrix4.multiply(transform3, m, transform3);
  36282. let newPosition = new Cesium.Cartesian3();
  36283. Cesium.Matrix4.getTranslation(moveMatrix, newPosition);
  36284. newPositions.push(newPosition);
  36285. }
  36286. this._editEntity.wall.positions = newPositions;
  36287. params.axisX = params.axisY = params.axisZ = 0;
  36288. this._editEntity.setParams(params);
  36289. this._activateEdit(this._editEntity);
  36290. },
  36291. _updateWallProperty(params) {
  36292. let minHeights = this._editEntity.wall.minimumHeights._value;
  36293. let maxHeights = [];
  36294. for (let i2 = 0; i2 < minHeights.length; i2++) {
  36295. maxHeights.push(minHeights[i2] + parseFloat(params.height));
  36296. }
  36297. this._editEntity.wall.maximumHeights = maxHeights;
  36298. this._sketchWallMaxHeights = maxHeights;
  36299. let wallMaterial = this._editEntity.wall.material;
  36300. if (wallMaterial instanceof Cesium.ImageMaterialProperty) {
  36301. let material = this._materialTextImageProperty({
  36302. color: params.color,
  36303. text: params.text
  36304. });
  36305. this._editEntity.wall.material = material;
  36306. } else if (wallMaterial instanceof WallMaterialProperty) {
  36307. let materialImage = this._image_h_l_r;
  36308. if (params.direction === this._param.direction_h && params.order === this._param.order_add) {
  36309. materialImage = this._image_h_l_r;
  36310. } else if (params.direction === this._param.direction_h && params.order === this._param.order_add) {
  36311. materialImage = this._image_h_r_l;
  36312. } else if (params.direction === this._param.direction_v && params.order === this._param.order_minus) {
  36313. materialImage = this._image_v_t_b;
  36314. } else if (params.direction === this._param.direction_v && params.order === this._param.order_add) {
  36315. materialImage = this._image_v_b_t;
  36316. }
  36317. let material = new WallMaterialProperty({
  36318. viewer: this._viewer,
  36319. trailImage: materialImage,
  36320. duration: params.duration,
  36321. color: Cesium.Color.fromCssColorString(params.color),
  36322. param: {
  36323. count: parseFloat(params.count),
  36324. direction: params.direction,
  36325. order: params.order
  36326. }
  36327. });
  36328. this._editEntity.wall.material = material;
  36329. } else if (wallMaterial instanceof Cesium.ColorMaterialProperty) {
  36330. let material = this._materialColorProperty({
  36331. color: params.color
  36332. });
  36333. this._editEntity.wall.material = material;
  36334. }
  36335. this._editEntity.setParams(params);
  36336. },
  36337. rotationEntity(options2) {
  36338. if (this._editEntity === void 0)
  36339. return;
  36340. this._coordinateCalculateEntityOrientation(this._editEntity, options2);
  36341. },
  36342. _getEntityEditData: function(entity) {
  36343. if (entity instanceof Cesium.Entity) {
  36344. let editEntityType = entity.getEntityType();
  36345. if (editEntityType === DrawTools.DrawType.Polyline || editEntityType === DrawTools.DrawType.SpatialLine) {
  36346. return entity.polyline.positions._value;
  36347. } else if (editEntityType === DrawTools.DrawType.Polygon || editEntityType === DrawTools.DrawType.House) {
  36348. let positions = entity.polygon.hierarchy._value.positions;
  36349. if (positions[0].x !== positions[positions.length - 1].x) {
  36350. positions.push(positions[0].clone());
  36351. }
  36352. return positions;
  36353. } else if (editEntityType === DrawTools.DrawType.Rectangle) {
  36354. let rect = entity.rectangle.coordinates._value;
  36355. let gNw = Cesium.Rectangle.northwest(rect);
  36356. if (gNw.height <= 0) {
  36357. let height2 = this._queryHeightFromGeo(Cesium.Math.toDegrees(gNw.longitude), Cesium.Math.toDegrees(gNw.latitude));
  36358. gNw.height = height2;
  36359. }
  36360. let cNw = Cesium.Cartesian3.fromRadians(gNw.longitude, gNw.latitude, gNw.height);
  36361. let gSe = Cesium.Rectangle.southeast(rect);
  36362. if (gSe.height <= 0) {
  36363. let height2 = this._queryHeightFromGeo(Cesium.Math.toDegrees(gSe.longitude), Cesium.Math.toDegrees(gSe.latitude));
  36364. gSe.height = height2;
  36365. }
  36366. let cSe = Cesium.Cartesian3.fromRadians(gSe.longitude, gSe.latitude, gSe.height);
  36367. return [cNw, cSe];
  36368. } else if (editEntityType === DrawTools.DrawType.Circle || editEntityType === DrawTools.DrawType.DynamicCircle) {
  36369. let centerPosition = entity.position._value;
  36370. let radius = entity.ellipse.semiMajorAxis._value;
  36371. let cbPoint = this._calculateCircleBoundaryPoint(centerPosition, radius);
  36372. return [centerPosition, cbPoint];
  36373. } else if (editEntityType === DrawTools.DrawType.NormalWall || editEntityType === DrawTools.DrawType.DynamicWall || editEntityType === DrawTools.DrawType.TextWall) {
  36374. this._sketchWallHeights = [];
  36375. this._sketchWallMaxHeights = [];
  36376. let minHeights = entity.wall.minimumHeights._value;
  36377. let maxHeights = entity.wall.maximumHeights._value;
  36378. for (let i2 = 0; i2 < minHeights.length; i2++) {
  36379. this._sketchWallHeights.push(minHeights[i2]);
  36380. this._sketchWallMaxHeights.push(maxHeights[i2]);
  36381. }
  36382. return entity.wall.positions._value;
  36383. } else if (editEntityType === DrawTools.DrawType.VideoWall) {
  36384. let positions = entity.wall.positions._value;
  36385. return [positions[0].clone()];
  36386. } else {
  36387. return [];
  36388. }
  36389. } else {
  36390. return [];
  36391. }
  36392. },
  36393. _calculateCircleBoundaryPoint: function(centerPosition, radius) {
  36394. let gCenter = Cesium.Ellipsoid.WGS84.cartesianToCartographic(centerPosition);
  36395. let cPoint = point([Cesium.Math.toDegrees(gCenter.longitude), Cesium.Math.toDegrees(
  36396. gCenter.latitude
  36397. )]);
  36398. let boundaryPoint = destination(cPoint, radius / 1e3, 90, {
  36399. units: "kilometers"
  36400. }).geometry.coordinates;
  36401. let height2 = this._queryHeightFromGeo(boundaryPoint[0], boundaryPoint[1]);
  36402. let cbPoint = Cesium.Cartesian3.fromDegrees(boundaryPoint[0], boundaryPoint[1], height2);
  36403. return cbPoint;
  36404. },
  36405. _calculateCenterPosition: function(positions) {
  36406. if (positions === void 0 || positions.length === 0)
  36407. return void 0;
  36408. else if (positions.length === 1) {
  36409. return positions[0];
  36410. } else if (positions.length === 2) {
  36411. let pt0 = this._cartesian3ToGeo(positions[0]);
  36412. let pt1 = this._cartesian3ToGeo(positions[1]);
  36413. let point0 = point([pt0.longitude, pt0.latitude]);
  36414. let point1 = point([pt1.longitude, pt1.latitude]);
  36415. let center2 = midpoint(point0, point1).geometry.coordinates;
  36416. let height2 = this._queryHeightFromGeo(center2[0], center2[1]);
  36417. return Cesium.Cartesian3.fromDegrees(center2[0], center2[1], height2);
  36418. } else {
  36419. let geoPoints = [
  36420. []
  36421. ];
  36422. for (let i2 = 0; i2 < positions.length; i2++) {
  36423. let geoPoint = this._cartesian3ToGeo(positions[i2]);
  36424. geoPoints[0].push([geoPoint.longitude, geoPoint.latitude]);
  36425. }
  36426. geoPoints[0].push(geoPoints[0][0]);
  36427. let polygon$1 = polygon(geoPoints);
  36428. let center2 = centerOfMass(polygon$1).geometry.coordinates;
  36429. let height2 = this._queryHeightFromGeo(center2[0], center2[1]);
  36430. return Cesium.Cartesian3.fromDegrees(center2[0], center2[1], height2);
  36431. }
  36432. },
  36433. _calculateTransformPosition: function(position2, distance2, bearing2, options2) {
  36434. let geoPoint = this._cartesian3ToGeo(position2);
  36435. let point$1 = point([geoPoint.longitude, geoPoint.latitude]);
  36436. let resPoint = destination(point$1, distance2, bearing2, options2).geometry.coordinates;
  36437. let height2 = geoPoint.height;
  36438. if (options2 !== void 0 && options2.calculateHeight !== void 0 && options2.calculateHeight === true) {
  36439. height2 = this._queryHeightFromGeo(resPoint[0], resPoint[1]);
  36440. }
  36441. let cPosition = Cesium.Cartesian3.fromDegrees(
  36442. resPoint[0],
  36443. resPoint[1],
  36444. height2
  36445. );
  36446. return cPosition;
  36447. },
  36448. _unActivateEdit: function() {
  36449. this._clearEditPoint();
  36450. this._removeCoorinateAxis();
  36451. this._closePropertyEditDialog();
  36452. },
  36453. _activateEdit: function(editEntity) {
  36454. let entityType = editEntity.getEntityType();
  36455. let entityIsEdit = editEntity.getIsEdit();
  36456. if (entityIsEdit === void 0 || entityType === void 0 || entityIsEdit === false) {
  36457. this._console("\u8BE5\u5B9E\u4F53\u4E0D\u53EF\u7F16\u8F91");
  36458. return;
  36459. }
  36460. if (entityType === DrawTools.DrawType.OdLine) {
  36461. this._activeteOdlineEdit(editEntity);
  36462. } else {
  36463. this._activeteNormalEdit(editEntity);
  36464. }
  36465. },
  36466. _activeteOdlineEdit: function(editEntity) {
  36467. let _self = this;
  36468. let entityType = editEntity.getEntityType();
  36469. if (entityType === void 0 || entityType !== DrawTools.DrawType.OdLine) {
  36470. this._console("\u8BE5\u5B9E\u4F53\u4E0D\u53EF\u7F16\u8F91\u6216\u8BE5\u5B9E\u4F53\u4E0D\u662FOD\u7EBF\u7C7B\u578B");
  36471. return;
  36472. }
  36473. let faterEntityId = editEntity.parent.id;
  36474. this._editOdlineEntities = [];
  36475. for (let entity of this._entities.values) {
  36476. if (entity.parent !== void 0 && entity.parent.id === faterEntityId) {
  36477. this._editOdlineEntities.push(entity);
  36478. }
  36479. }
  36480. if (this._editOdlineEntities.length === 0)
  36481. return;
  36482. this._editEntity = this._editOdlineEntities[0];
  36483. for (let i2 = 0; i2 < this._editOdlineEntities.length; i2++) {
  36484. let entity = this._editOdlineEntities[i2];
  36485. let positions = entity.polyline.positions._value;
  36486. if (i2 === 0) {
  36487. this._createEditOdlineStartPoint(positions.first(), entity);
  36488. this._createEditOdlineEndPoint(positions.last(), entity);
  36489. } else {
  36490. this._createEditOdlineEndPoint(positions.last(), entity);
  36491. }
  36492. }
  36493. if (this._sketchEditHandler === void 0) {
  36494. this._sketchEditHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  36495. }
  36496. this._registerLeftDownEvent(this._sketchEditHandler, function(event2) {
  36497. _self._eventEditMouseDown(event2);
  36498. });
  36499. this._registerMouseMoveEvent(this._sketchEditHandler, function(event2) {
  36500. _self._eventEditMouseMove(event2);
  36501. });
  36502. this._registerLeftUpEvent(this._sketchEditHandler, function(event2) {
  36503. _self._eventEditMouseUp(event2);
  36504. });
  36505. },
  36506. _activeteNormalEdit: function(editEntity) {
  36507. let _self = this;
  36508. let positions = this._getEntityEditData(editEntity);
  36509. this._removePointEntitys();
  36510. let entityType = editEntity.getEntityType();
  36511. this._editEntity = editEntity;
  36512. if (entityType === DrawTools.DrawType.Circle || entityType === DrawTools.DrawType.DynamicCircle) {
  36513. this._createEditCenterPoint(positions[0]);
  36514. this._createEditNodePoint(positions, 1);
  36515. } else if (entityType === DrawTools.DrawType.VideoWall) {
  36516. if (!this._isRuntimeApp()) {
  36517. let position2 = positions[0];
  36518. this._removeCoorinateAxis();
  36519. this._createCoordinateAxis(position2);
  36520. }
  36521. } else {
  36522. this._createEditNodePoint(positions);
  36523. let centerPosition = this._calculateCenterPosition(positions);
  36524. if (centerPosition !== void 0) {
  36525. this._createEditCenterPoint(centerPosition);
  36526. }
  36527. }
  36528. if (entityType !== DrawTools.DrawType.Rectangle && entityType !== DrawTools.DrawType.Circle && entityType !== DrawTools.DrawType.DynamicCircle && entityType !== DrawTools.DrawType.VideoWall) {
  36529. if (entityType === DrawTools.DrawType.SpatialLine) {
  36530. this._createEditMiddlePoint(positions, true);
  36531. } else {
  36532. this._createEditMiddlePoint(positions);
  36533. }
  36534. }
  36535. if (this._sketchEditHandler === void 0) {
  36536. this._sketchEditHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  36537. }
  36538. this._registerLeftDownEvent(this._sketchEditHandler, function(event2) {
  36539. _self._eventEditMouseDown(event2);
  36540. });
  36541. this._registerMouseMoveEvent(this._sketchEditHandler, function(event2) {
  36542. _self._eventEditMouseMove(event2);
  36543. });
  36544. this._registerLeftUpEvent(this._sketchEditHandler, function(event2) {
  36545. _self._eventEditMouseUp(event2);
  36546. });
  36547. },
  36548. _eventEditMouseDown: function(event2) {
  36549. let _self = this;
  36550. let feature2 = _self._viewer.scene.pick(event2.position);
  36551. if (feature2 != void 0 && feature2.id instanceof Cesium.Entity) {
  36552. let featureType = feature2.id.getEditType();
  36553. if (featureType === void 0)
  36554. return;
  36555. _self._viewer.scene.screenSpaceCameraController.enableRotate = false;
  36556. let entityPosition = feature2.id.position._value;
  36557. _self._editPointEntity = feature2.id;
  36558. _self._setMousePointerStyle();
  36559. if (featureType.type === DrawTools.EditPointType.Node || featureType.type === DrawTools.EditPointType.Middle) {
  36560. _self._entityCallbackPropertyByMouseDown();
  36561. _self._removeEntityByObject(_self._editPointEntity);
  36562. if (_self._sketchEditEntitySpatialName != void 0) {
  36563. _self._removeEntityByName(_self._sketchEditEntitySpatialName);
  36564. }
  36565. } else if (featureType.type === DrawTools.EditPointType.Center) {
  36566. _self._entityCenterMouseDownEvent();
  36567. } else if (featureType.type === DrawTools.EditPointType.OdlineEndNode) {
  36568. _self._removeEntityByObject(_self._editPointEntity);
  36569. _self._editEntity = featureType.joinEntity;
  36570. let params = _self._editEntity.parent.getParams();
  36571. _self._sketchEditPoints = [];
  36572. let joinEntityPositions = _self._editEntity.polyline.positions._value;
  36573. _self._sketchEditPoints.push(joinEntityPositions.first());
  36574. _self._sketchEditPoints.push(joinEntityPositions.last());
  36575. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(function() {
  36576. let positions = _self._calculateOdlinePositios(_self._sketchEditPoints[0], _self._sketchEditPoints[1], parseInt(params.odlineHeight), parseInt(params.odlineCount));
  36577. return positions;
  36578. }, false);
  36579. } else if (featureType.type === DrawTools.EditPointType.OdlineStrartNode) {
  36580. _self._removeEntityByObject(_self._editPointEntity);
  36581. _self._editEntity = featureType.joinEntity;
  36582. let params = _self._editEntity.parent.getParams();
  36583. _self._sketchEditPoints = [];
  36584. let joinEntityPositions = _self._editEntity.polyline.positions._value;
  36585. _self._sketchEditPoints.push(joinEntityPositions.first());
  36586. for (let odEntity of _self._editOdlineEntities) {
  36587. let odEntityPositions = odEntity.polyline.positions._value;
  36588. let lastPosition = odEntityPositions.last();
  36589. _self._sketchEditPoints.push(lastPosition.clone());
  36590. odEntity.polyline.positions = new Cesium.CallbackProperty(function() {
  36591. let positions = _self._calculateOdlinePositios(
  36592. _self._sketchEditPoints[0],
  36593. lastPosition,
  36594. parseInt(params.odlineHeight),
  36595. parseInt(params.odlineCount)
  36596. );
  36597. return positions;
  36598. }, false);
  36599. }
  36600. }
  36601. if (featureType.type === DrawTools.EditPointType.Middle) {
  36602. let index2 = featureType.index;
  36603. _self._sketchEditPoints.splice(index2, 0, entityPosition);
  36604. _self._sketchEditIndex = index2;
  36605. if (_self._sketchWallHeights != void 0 && _self._sketchWallHeights.length > 0) {
  36606. let geoPoint = _self._cartesian3ToGeo(entityPosition);
  36607. let height2 = _self._queryHeightFromGeo(geoPoint.longitude, geoPoint.latitude);
  36608. _self._sketchWallHeights.splice(index2, 0, height2);
  36609. let heightDifference = _self._sketchWallMaxHeights[0] - _self._sketchWallHeights[0];
  36610. _self._sketchWallMaxHeights.splice(index2, 0, height2 + heightDifference);
  36611. }
  36612. _self._tooltipInit("\u62D6\u52A8\u4E2D\u70B9\uFF0C\u6539\u53D8\u5F62\u72B6", event2.position);
  36613. } else if (featureType.type === DrawTools.EditPointType.Node) {
  36614. _self._sketchEditIndex = featureType.index;
  36615. _self._tooltipInit("\u62D6\u52A8\u8282\u70B9\uFF0C\u6539\u53D8\u5F62\u72B6", event2.position);
  36616. } else if (featureType.type === DrawTools.EditPointType.Spatial) {
  36617. _self._sketchEditIndex = featureType.index;
  36618. _self._tooltipInit("\u62D6\u52A8\u8282\u70B9\uFF0C\u6539\u53D8\u9AD8\u5EA6", event2.position);
  36619. } else if (featureType.type === DrawTools.EditPointType.CoordinateAxis) {
  36620. _self._tooltipInit("\u62D6\u52A8\u5750\u6807\u8F74\uFF0C\u6539\u53D8\u4F4D\u7F6E", event2.position);
  36621. } else if (featureType.type === DrawTools.EditPointType.OdlineEndNode || featureType.type === DrawTools.EditPointType.OdlineStrartNode) {
  36622. _self._tooltipInit("\u62D6\u52A8\u8282\u70B9\uFF0C\u6539\u53D8OD\u7EBF\u4F4D\u7F6E", event2.position);
  36623. }
  36624. }
  36625. },
  36626. _eventEditMouseMove: function(event2) {
  36627. let _self = this;
  36628. if (_self._editPointEntity != void 0) {
  36629. let loc2 = _self._transfromFromScreenPoint(event2.endPosition);
  36630. if (!Cesium.defined(loc2.sLocation))
  36631. return;
  36632. _self._editPosition = loc2.sLocation;
  36633. let editEntityType = _self._editPointEntity.getEditType();
  36634. if (editEntityType.type === DrawTools.EditPointType.Node) {
  36635. _self._sketchEditPoints[_self._sketchEditIndex] = loc2.sLocation;
  36636. let editEntityType2 = _self._editEntity.getEntityType();
  36637. if (editEntityType2 != DrawTools.DrawType.Rectangle && editEntityType2 != DrawTools.DrawType.Circle && editEntityType2 != DrawTools.DrawType.DynamicCircle) {
  36638. if ((editEntityType2 === DrawTools.DrawType.Polygon || editEntityType2 === DrawTools.DrawType.House) && _self._sketchEditIndex === 0) {
  36639. _self._sketchEditPoints[_self._sketchEditPoints.length - 1] = loc2.sLocation;
  36640. } else if (editEntityType2 === DrawTools.DrawType.NormalWall || editEntityType2 === DrawTools.DrawType.DynamicWall || editEntityType2 === DrawTools.DrawType.TextWall) {
  36641. _self._sketchWallHeights[_self._sketchEditIndex] = loc2.gLocation.height;
  36642. }
  36643. _self._removeEntityByName(_self._sketchEditEntityMiddleName);
  36644. if (editEntityType2 === DrawTools.DrawType.SpatialLine) {
  36645. _self._createEditMiddlePoint(_self._sketchEditPoints, true);
  36646. } else {
  36647. _self._createEditMiddlePoint(_self._sketchEditPoints);
  36648. }
  36649. }
  36650. } else if (editEntityType.type === DrawTools.EditPointType.Middle) {
  36651. _self._sketchEditPoints[_self._sketchEditIndex] = loc2.sLocation;
  36652. } else if (editEntityType.type === DrawTools.EditPointType.Center) {
  36653. _self._entityCenterMouseMoveEvent(event2);
  36654. } else if (editEntityType.type === DrawTools.EditPointType.Spatial) {
  36655. let ellipsoid = _self._viewer.scene.globe.ellipsoid;
  36656. let cartesian = _self._viewer.camera.pickEllipsoid(
  36657. event2.endPosition,
  36658. ellipsoid
  36659. );
  36660. let bottomPoint = _self._sketchEditPoints[_self._sketchEditIndex];
  36661. let heightDifference = cartesian.z - bottomPoint.z;
  36662. if (heightDifference > 0 && heightDifference < 500) {
  36663. for (let i2 = 0; i2 < _self._sketchWallHeights.length; i2++) {
  36664. _self._sketchWallMaxHeights[i2] = _self._sketchWallHeights[i2] + heightDifference;
  36665. }
  36666. }
  36667. } else if (editEntityType.type === DrawTools.EditPointType.OdlineEndNode) {
  36668. _self._sketchEditPoints[_self._sketchEditPoints.length - 1] = loc2.sLocation;
  36669. } else if (editEntityType.type === DrawTools.EditPointType.OdlineStrartNode) {
  36670. _self._sketchEditPoints[0] = loc2.sLocation;
  36671. }
  36672. _self._tooltipInit("\u62AC\u8D77\u9F20\u6807\uFF0C\u5B8C\u6210\u66F4\u6539", event2.endPosition);
  36673. }
  36674. },
  36675. _eventEditMouseUp: function(event2) {
  36676. let _self = this;
  36677. if (_self._editPointEntity != void 0) {
  36678. _self._viewer.scene.screenSpaceCameraController.enableRotate = true;
  36679. _self._tooltipRemove();
  36680. _self._setMouseDefaultStyle();
  36681. let editEntityPointType = _self._editPointEntity.getEditType().type;
  36682. let entityType = _self._editEntity.getEntityType();
  36683. if (editEntityPointType === DrawTools.EditPointType.CoordinateAxis)
  36684. ;
  36685. else if (editEntityPointType === DrawTools.EditPointType.OdlineEndNode) {
  36686. let params = _self._editEntity.parent.getParams();
  36687. let positions = _self._calculateOdlinePositios(_self._sketchEditPoints[0], _self._sketchEditPoints[1], parseInt(params.odlineHeight), parseInt(params.odlineCount));
  36688. _self._editEntity.polyline.positions = positions;
  36689. _self._createEditOdlineEndPoint(_self._sketchEditPoints[1], _self._editEntity);
  36690. } else if (editEntityPointType === DrawTools.EditPointType.OdlineStrartNode) {
  36691. let params = _self._editEntity.parent.getParams();
  36692. let index2 = 1;
  36693. for (let odEntity of _self._editOdlineEntities) {
  36694. let lastPosition = _self._sketchEditPoints[index2++];
  36695. let positions = _self._calculateOdlinePositios(
  36696. _self._sketchEditPoints[0],
  36697. lastPosition,
  36698. parseInt(params.odlineHeight),
  36699. parseInt(params.odlineCount)
  36700. );
  36701. odEntity.polyline.positions = positions;
  36702. }
  36703. _self._createEditOdlineStartPoint(_self._sketchEditPoints[0], _self._editOdlineEntities[0]);
  36704. } else {
  36705. if (editEntityPointType === DrawTools.EditPointType.Node || editEntityPointType === DrawTools.EditPointType.Middle) {
  36706. _self._entityCallbackPropertyByMouseUp();
  36707. } else if (editEntityPointType === DrawTools.EditPointType.Center) {
  36708. _self._entityCenterMouseUpEvent(event2);
  36709. }
  36710. _self._removeEntityByName(_self._sketchEditEntityNodeName);
  36711. _self._removeEntityByName(_self._sketchEditEntityMiddleName);
  36712. _self._removeEntityByName(_self._sketchEditEntityCenterName);
  36713. if (entityType === DrawTools.DrawType.Circle || entityType === DrawTools.DrawType.DynamicCircle) {
  36714. let centerPosition = _self._editEntity.position._value;
  36715. let boundaryPosition = _self._calculateCircleBoundaryPoint(
  36716. centerPosition,
  36717. _self._sketchEllipseRadius
  36718. );
  36719. _self._sketchEditPoints[0] = centerPosition;
  36720. _self._sketchEditPoints[1] = boundaryPosition;
  36721. _self._createEditNodePoint(_self._sketchEditPoints, 1);
  36722. _self._createEditCenterPoint(centerPosition);
  36723. } else {
  36724. _self._createEditNodePoint(_self._sketchEditPoints);
  36725. let centerPosition = _self._calculateCenterPosition(_self._sketchEditPoints);
  36726. _self._createEditCenterPoint(centerPosition);
  36727. }
  36728. if (entityType != DrawTools.DrawType.Rectangle && entityType != DrawTools.DrawType.Circle && entityType != DrawTools.DrawType.DynamicCircle) {
  36729. if (entityType === DrawTools.DrawType.SpatialLine) {
  36730. _self._createEditMiddlePoint(_self._sketchEditPoints, true);
  36731. } else {
  36732. _self._createEditMiddlePoint(_self._sketchEditPoints);
  36733. }
  36734. }
  36735. }
  36736. _self._editPointEntity = void 0;
  36737. }
  36738. },
  36739. _entityCenterMouseDownEvent: function() {
  36740. let _self = this;
  36741. let entityPosition = this._editEntity.position._value;
  36742. this._removeEntityByName(this._sketchEditEntityNodeName);
  36743. this._removeEntityByName(this._sketchEditEntityMiddleName);
  36744. this._removeEntityByName(this._sketchEditEntityCenterName);
  36745. this._startPoint = entityPosition;
  36746. this._startMovePoints = [];
  36747. this._movePoint = entityPosition;
  36748. let editEntityType = this._editEntity.getEntityType();
  36749. if (editEntityType === DrawTools.DrawType.Circle || editEntityType === DrawTools.DrawType.DynamicCircle) {
  36750. if (this._editEntity.polyline !== void 0) {
  36751. for (let i2 = 0; i2 < this._ellipseOutlineCoordinates.length; i2++) {
  36752. this._startMovePoints.push(this._ellipseOutlineCoordinates[i2]);
  36753. }
  36754. this._editEntity.polyline.positions = new Cesium.CallbackProperty(
  36755. function() {
  36756. return _self._ellipseOutlineCoordinates;
  36757. },
  36758. false
  36759. );
  36760. }
  36761. this._editEntity.position = new Cesium.CallbackProperty(function() {
  36762. return _self._movePoint;
  36763. }, false);
  36764. } else if (editEntityType === DrawTools.DrawType.Polygon || editEntityType === DrawTools.DrawType.House) {
  36765. for (let i2 = 0; i2 < this._sketchEditPoints.length; i2++) {
  36766. this._startMovePoints.push(this._sketchEditPoints[i2]);
  36767. }
  36768. _self._editEntity.polygon.hierarchy = new Cesium.CallbackProperty(function() {
  36769. return {
  36770. positions: _self._sketchEditPoints
  36771. };
  36772. }, false);
  36773. if (_self._editEntity.polyline != void 0) {
  36774. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(function() {
  36775. return _self._sketchEditPoints;
  36776. }, false);
  36777. }
  36778. } else if (editEntityType === DrawTools.DrawType.Polyline || editEntityType === DrawTools.DrawType.SpatialLine) {
  36779. for (let i2 = 0; i2 < this._sketchEditPoints.length; i2++) {
  36780. this._startMovePoints.push(this._sketchEditPoints[i2]);
  36781. }
  36782. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(function() {
  36783. return _self._sketchEditPoints;
  36784. }, false);
  36785. } else if (editEntityType === DrawTools.DrawType.Rectangle) {
  36786. for (let i2 = 0; i2 < this._sketchEditPoints.length; i2++) {
  36787. this._startMovePoints.push(this._sketchEditPoints[i2]);
  36788. }
  36789. _self._editEntity.rectangle.coordinates = new Cesium.CallbackProperty(_self._callUpdateRectangleCoordinates(_self._sketchEditPoints), false);
  36790. if (_self._editEntity.polyline != void 0) {
  36791. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(
  36792. _self._callUpdateRectangleOutlineCoordinates(),
  36793. false
  36794. );
  36795. }
  36796. }
  36797. },
  36798. _entityCenterMouseMoveEvent: function(event2) {
  36799. this._calculatePositionsByCenter(event2.endPosition, false);
  36800. },
  36801. _calculatePositionsByCenter: function(screenPosition, calculateHeight) {
  36802. let strLoc = this._cartesian3ToGeo(this._startPoint);
  36803. let endLoc = this._transfromFromScreenPoint(screenPosition);
  36804. var point1 = point([strLoc.longitude, strLoc.latitude]);
  36805. var point2 = point([endLoc.gLocation.lng, endLoc.gLocation.lat]);
  36806. var bearing$1 = bearing(point1, point2);
  36807. var options2 = {
  36808. units: "kilometers",
  36809. calculateHeight
  36810. };
  36811. var distance$1 = distance(point1, point2, options2);
  36812. let editEntityType = this._editEntity.getEntityType();
  36813. if (editEntityType === DrawTools.DrawType.Circle || editEntityType === DrawTools.DrawType.DynamicCircle) {
  36814. for (let i2 = 0; i2 < this._startMovePoints.length; i2++) {
  36815. let position2 = this._calculateTransformPosition(
  36816. this._startMovePoints[i2],
  36817. distance$1,
  36818. bearing$1,
  36819. options2
  36820. );
  36821. this._ellipseOutlineCoordinates[i2] = position2.clone();
  36822. }
  36823. this._movePoint = endLoc.sLocation;
  36824. } else {
  36825. for (let i2 = 0; i2 < this._startMovePoints.length; i2++) {
  36826. let position2 = this._calculateTransformPosition(
  36827. this._startMovePoints[i2],
  36828. distance$1,
  36829. bearing$1,
  36830. options2
  36831. );
  36832. this._sketchEditPoints[i2] = position2.clone();
  36833. }
  36834. }
  36835. },
  36836. _entityCenterMouseUpEvent: function(event2) {
  36837. this._calculatePositionsByCenter(event2.position, true);
  36838. let _self = this;
  36839. let editEntityType = this._editEntity.getEntityType();
  36840. if (editEntityType === DrawTools.DrawType.Circle || editEntityType === DrawTools.DrawType.DynamicCircle) {
  36841. this._editEntity.position = this._movePoint;
  36842. if (this._editEntity.polyline !== void 0) {
  36843. this._editEntity.polyline.positions = this._ellipseOutlineCoordinates;
  36844. }
  36845. } else if (editEntityType === DrawTools.DrawType.Polyline || editEntityType === DrawTools.DrawType.SpatialLine) {
  36846. this._editEntity.polyline.positions = this._sketchEditPoints;
  36847. } else if (editEntityType === DrawTools.DrawType.Polygon || editEntityType === DrawTools.DrawType.House) {
  36848. this._editEntity.polygon.hierarchy = {
  36849. positions: _self._sketchEditPoints
  36850. };
  36851. if (this._editEntity.polyline != void 0) {
  36852. this._editEntity.polyline.positions = this._sketchEditPoints;
  36853. }
  36854. } else if (editEntityType === DrawTools.DrawType.Rectangle) {
  36855. this._editEntity.rectangle.coordinates = Cesium.Rectangle.fromDegrees(_self._rectangleCoordinates[0], _self._rectangleCoordinates[1], _self._rectangleCoordinates[2], _self._rectangleCoordinates[3]);
  36856. if (this._editEntity.polyline != void 0) {
  36857. this._editEntity.polyline.positions = _self._rectangleOutlineCoordinates;
  36858. }
  36859. }
  36860. },
  36861. _entityCallbackPropertyByMouseUp: function() {
  36862. let _self = this;
  36863. let entityType = _self._editEntity.getEntityType();
  36864. if (entityType === DrawTools.DrawType.Polyline) {
  36865. _self._editEntity.polyline.positions = _self._sketchEditPoints;
  36866. } else if (entityType === DrawTools.DrawType.Polygon || entityType === DrawTools.DrawType.House) {
  36867. _self._editEntity.polygon.hierarchy = {
  36868. positions: _self._sketchEditPoints
  36869. };
  36870. if (_self._editEntity.polyline != void 0) {
  36871. let polygonPositions = _self._editEntity.polygon.hierarchy._value.positions;
  36872. let linePositions = [];
  36873. for (let i2 = 0; i2 < polygonPositions.length; i2++) {
  36874. linePositions.push(polygonPositions[i2].clone());
  36875. }
  36876. if (linePositions[0].x !== linePositions[linePositions.length - 1].x) {
  36877. linePositions.push(linePositions[0].clone());
  36878. }
  36879. _self._editEntity.polyline.positions = linePositions;
  36880. }
  36881. } else if (entityType === DrawTools.DrawType.Rectangle) {
  36882. _self._editEntity.rectangle.coordinates = Cesium.Rectangle.fromDegrees(_self._rectangleCoordinates[0], _self._rectangleCoordinates[1], _self._rectangleCoordinates[2], _self._rectangleCoordinates[3]);
  36883. if (_self._editEntity.polyline != void 0) {
  36884. _self._editEntity.polyline.positions = _self._rectangleOutlineCoordinates;
  36885. }
  36886. } else if (entityType === DrawTools.DrawType.Circle || entityType === DrawTools.DrawType.DynamicCircle) {
  36887. _self._editEntity.ellipse.semiMajorAxis = _self._sketchEllipseRadius;
  36888. _self._editEntity.ellipse.semiMinorAxis = _self._sketchEllipseRadius;
  36889. if (_self._editEntity.polyline != void 0) {
  36890. _self._editEntity.polyline.positions = _self._ellipseOutlineCoordinates;
  36891. }
  36892. } else if (entityType === DrawTools.DrawType.NormalWall || entityType === DrawTools.DrawType.DynamicWall || entityType === DrawTools.DrawType.TextWall) {
  36893. _self._editEntity.wall.positions = _self._sketchEditPoints;
  36894. _self._editEntity.wall.minimumHeights = _self._sketchWallHeights;
  36895. _self._editEntity.wall.maximumHeights = _self._sketchWallMaxHeights;
  36896. }
  36897. },
  36898. _entityCallbackPropertyByMouseDown: function() {
  36899. let _self = this;
  36900. let entityType = _self._editEntity.getEntityType();
  36901. if (entityType === DrawTools.DrawType.Polyline || entityType === DrawTools.DrawType.SpatialLine) {
  36902. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(
  36903. function() {
  36904. return _self._sketchEditPoints;
  36905. },
  36906. false
  36907. );
  36908. } else if (entityType === DrawTools.DrawType.Polygon || entityType === DrawTools.DrawType.House) {
  36909. _self._editEntity.polygon.hierarchy = new Cesium.CallbackProperty(
  36910. function() {
  36911. return {
  36912. positions: _self._sketchEditPoints
  36913. };
  36914. },
  36915. false
  36916. );
  36917. if (_self._editEntity.polyline != void 0) {
  36918. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(
  36919. function() {
  36920. let polygonPositions = _self._sketchEditPoints;
  36921. let linePositions = [];
  36922. for (let i2 = 0; i2 < polygonPositions.length; i2++) {
  36923. linePositions.push(polygonPositions[i2].clone());
  36924. }
  36925. if (linePositions[0].x !== linePositions[linePositions.length - 1].x) {
  36926. linePositions.push(linePositions[0].clone());
  36927. }
  36928. return linePositions;
  36929. },
  36930. false
  36931. );
  36932. }
  36933. } else if (entityType === DrawTools.DrawType.Rectangle) {
  36934. _self._editEntity.rectangle.coordinates = new Cesium.CallbackProperty(
  36935. _self._callUpdateRectangleCoordinates(_self._sketchEditPoints),
  36936. false
  36937. );
  36938. if (_self._editEntity.polyline != void 0) {
  36939. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(
  36940. _self._callUpdateRectangleOutlineCoordinates(),
  36941. false
  36942. );
  36943. }
  36944. } else if (entityType === DrawTools.DrawType.Circle || entityType === DrawTools.DrawType.DynamicCircle) {
  36945. if (_self._editPointEntity.getEditType().index === 1) {
  36946. _self._editEntity.ellipse.semiMajorAxis = new Cesium.CallbackProperty(
  36947. _self._callUpdateEllipseMinorAxis(_self._sketchEditPoints),
  36948. false
  36949. );
  36950. _self._editEntity.ellipse.semiMinorAxis = new Cesium.CallbackProperty(
  36951. _self._callUpdateEllipseMinorAxis(_self._sketchEditPoints),
  36952. false
  36953. );
  36954. }
  36955. if (_self._editEntity.polyline != void 0) {
  36956. _self._editEntity.polyline.positions = new Cesium.CallbackProperty(
  36957. _self._callEllipseOutlineCoordinate(_self._sketchEditPoints),
  36958. false
  36959. );
  36960. }
  36961. } else if (entityType === DrawTools.DrawType.NormalWall || entityType === DrawTools.DrawType.DynamicWall || entityType === DrawTools.DrawType.TextWall) {
  36962. _self._editEntity.wall.positions = new Cesium.CallbackProperty(function() {
  36963. return _self._sketchEditPoints;
  36964. }, false);
  36965. _self._editEntity.wall.minimumHeights = new Cesium.CallbackProperty(function() {
  36966. return _self._sketchWallHeights;
  36967. }, false);
  36968. _self._editEntity.wall.maximumHeights = new Cesium.CallbackProperty(function() {
  36969. return _self._sketchWallMaxHeights;
  36970. }, false);
  36971. }
  36972. },
  36973. _createEditPointEntity(options2) {
  36974. let _self = this;
  36975. if (options2 === void 0 || options2.position === void 0)
  36976. return;
  36977. if (options2 === void 0 || options2.editType === void 0)
  36978. return;
  36979. let color2 = options2.color != void 0 ? options2.color : [255, 0, 0, 1];
  36980. let size = options2.size != void 0 && typeof options2.size === "number" ? options2.size : 9;
  36981. let outlineWidth = options2.outlineWidth != void 0 && typeof options2.outlineWidth === "number" ? options2.outlineWidth : 1;
  36982. let outlineColor = options2.outlineColor != void 0 ? options2.outlineColor : [255, 255, 255, 1];
  36983. let pointEntity = new Cesium.Entity({
  36984. name: options2.name != void 0 ? options2.name : _self._sketchEntityName,
  36985. position: options2.position,
  36986. point: {
  36987. show: true,
  36988. pixelSize: size,
  36989. heightReference: Cesium.HeightReference.NONE,
  36990. color: _self._toColorFromArray(color2),
  36991. outlineWidth,
  36992. outlineColor: _self._toColorFromArray(outlineColor),
  36993. disableDepthTestDistance: 15e11
  36994. }
  36995. });
  36996. pointEntity.setEditType(options2.editType);
  36997. _self._entities.add(pointEntity);
  36998. },
  36999. _createEditNodePoint(positions, startIndex) {
  37000. this._sketchEditEntityNodeName = "SketchEditEntityNode";
  37001. let _self = this;
  37002. this._sketchEditPoints = [];
  37003. let strIndex = startIndex === void 0 ? 0 : startIndex;
  37004. for (let i2 = 0; i2 < positions.length; i2++) {
  37005. let position2 = positions[i2];
  37006. this._sketchEditPoints.push(position2.clone());
  37007. if (i2 < strIndex)
  37008. continue;
  37009. if (i2 !== 0 && position2.x === positions[0].x && position2.y === positions[0].y && position2.z === positions[0].z) {
  37010. continue;
  37011. }
  37012. let geoPoint = this._cartesian3ToGeo(position2);
  37013. let height2 = this._queryHeightFromGeo(geoPoint.longitude, geoPoint.latitude);
  37014. let newPosition = Cesium.Cartesian3.fromDegrees(geoPoint.longitude, geoPoint.latitude, height2);
  37015. _self._createEditPointEntity({
  37016. name: _self._sketchEditEntityNodeName,
  37017. position: newPosition,
  37018. size: 12,
  37019. color: [0, 0, 255, 1],
  37020. editType: {
  37021. type: DrawTools.EditPointType.Node,
  37022. index: i2
  37023. }
  37024. });
  37025. }
  37026. },
  37027. _createEditSpatialPoint(positions, heights, startIndex) {
  37028. return;
  37029. },
  37030. _createEditMiddlePoint(positions, isSpatial = false) {
  37031. this._sketchEditEntityMiddleName = "SketchEditEntityMiddle";
  37032. let _self = this;
  37033. if (!isSpatial) {
  37034. for (let i2 = 1; i2 < positions.length; i2++) {
  37035. let p1 = positions[i2 - 1];
  37036. let p2 = positions[i2];
  37037. let pCenter = this._calculateMiddlePoint(p1, p2);
  37038. this._createEditPointEntity({
  37039. name: _self._sketchEditEntityMiddleName,
  37040. position: pCenter,
  37041. size: 9,
  37042. color: [255, 255, 0, 1],
  37043. editType: {
  37044. type: DrawTools.EditPointType.Middle,
  37045. index: i2
  37046. }
  37047. });
  37048. }
  37049. } else {
  37050. for (let i2 = 1; i2 < positions.length; i2++) {
  37051. let p1 = positions[i2 - 1];
  37052. let p2 = positions[i2];
  37053. let pCenter = {
  37054. x: (p1.x + p2.x) / 2,
  37055. y: (p1.y + p2.y) / 2,
  37056. z: (p1.z + p2.z) / 2
  37057. };
  37058. this._createEditPointEntity({
  37059. name: _self._sketchEditEntityMiddleName,
  37060. position: pCenter,
  37061. size: 9,
  37062. color: [255, 255, 0, 1],
  37063. editType: {
  37064. type: DrawTools.EditPointType.Middle,
  37065. index: i2
  37066. }
  37067. });
  37068. }
  37069. }
  37070. },
  37071. _createEditCenterPoint(position2) {
  37072. let _self = this;
  37073. this._sketchEditEntityCenterName = "SketchEditEntityCenter";
  37074. this._createEditPointEntity({
  37075. name: _self._sketchEditEntityCenterName,
  37076. position: position2,
  37077. size: 12,
  37078. color: [0, 255, 0, 0.1],
  37079. outlineWidth: 2,
  37080. outlineColor: [255, 255, 255, 1],
  37081. editType: {
  37082. type: DrawTools.EditPointType.Center
  37083. }
  37084. });
  37085. if (this._editEntity != void 0) {
  37086. this._editEntity.position = position2.clone();
  37087. }
  37088. },
  37089. _createEditOdlineEndPoint(position2, joinEntity) {
  37090. this._sketchEditEntityNodeName = "SketchEditEntityNode";
  37091. let _self = this;
  37092. let geoPoint = this._cartesian3ToGeo(position2);
  37093. let height2 = this._queryHeightFromGeo(geoPoint.longitude, geoPoint.latitude);
  37094. Cesium.Cartesian3.fromDegrees(geoPoint.longitude, geoPoint.latitude, height2);
  37095. _self._createEditPointEntity({
  37096. name: _self._sketchEditEntityNodeName,
  37097. position: position2,
  37098. size: 12,
  37099. color: [0, 0, 255, 1],
  37100. editType: {
  37101. type: DrawTools.EditPointType.OdlineEndNode,
  37102. joinEntity
  37103. }
  37104. });
  37105. },
  37106. _createEditOdlineStartPoint(position2, joinEntity) {
  37107. this._sketchEditEntityNodeName = "SketchEditEntityNode";
  37108. let _self = this;
  37109. let geoPoint = this._cartesian3ToGeo(position2);
  37110. let height2 = this._queryHeightFromGeo(geoPoint.longitude, geoPoint.latitude);
  37111. Cesium.Cartesian3.fromDegrees(geoPoint.longitude, geoPoint.latitude, height2);
  37112. _self._createEditPointEntity({
  37113. name: _self._sketchEditEntityNodeName,
  37114. position: position2,
  37115. size: 12,
  37116. color: [0, 255, 0, 0.6],
  37117. editType: {
  37118. type: DrawTools.EditPointType.OdlineStrartNode,
  37119. joinEntity
  37120. }
  37121. });
  37122. },
  37123. _calculateMiddlePoint(position1, position2) {
  37124. let g1 = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position1);
  37125. let g2 = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  37126. let pt1 = [Cesium.Math.toDegrees(g1.longitude), Cesium.Math.toDegrees(g1.latitude)];
  37127. let pt2 = [Cesium.Math.toDegrees(g2.longitude), Cesium.Math.toDegrees(g2.latitude)];
  37128. let tpt1 = point(pt1);
  37129. let tpt2 = point(pt2);
  37130. let midpoint$1 = midpoint(tpt1, tpt2).geometry.coordinates;
  37131. let height2 = this._queryHeightFromGeo(midpoint$1[0], midpoint$1[1]);
  37132. let result = Cesium.Cartesian3.fromDegrees(midpoint$1[0], midpoint$1[1], height2);
  37133. return result;
  37134. },
  37135. _cartesian3ToGeo: function(position2) {
  37136. let g = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  37137. return {
  37138. longitude: Cesium.Math.toDegrees(g.longitude),
  37139. latitude: Cesium.Math.toDegrees(g.latitude),
  37140. height: g.height
  37141. };
  37142. },
  37143. _queryHeightFromGeo: function(longitude, latitude) {
  37144. if (longitude === void 0 || latitude === void 0 || typeof longitude != "number" || typeof latitude != "number")
  37145. return 0;
  37146. let rLng = Cesium.Math.toRadians(longitude);
  37147. let rLat = Cesium.Math.toRadians(latitude);
  37148. let cartographic = new Cesium.Cartographic(rLng, rLat);
  37149. let noQueryEntities = [];
  37150. for (let i2 = 0; i2 < this._entities.values.length; i2++) {
  37151. if (this._entities.values[i2].name === this._sketchEntityName) {
  37152. noQueryEntities.push(this._entities.values[i2]);
  37153. }
  37154. }
  37155. let height2 = this._viewer.scene.sampleHeight(cartographic, noQueryEntities);
  37156. if (height2 === void 0)
  37157. return 0;
  37158. else
  37159. return height2;
  37160. },
  37161. _queryHeightFromGeoAsync: function(longitude, latitude, callComplete) {
  37162. if (longitude === void 0 || latitude === void 0 || typeof longitude != "number" || typeof latitude != "number")
  37163. return 0;
  37164. let rLng = Cesium.Math.toRadians(longitude);
  37165. let rLat = Cesium.Math.toRadians(latitude);
  37166. let cartographic = new Cesium.Cartographic(rLng, rLat);
  37167. let promise = this._viewer.scene.sampleHeightMostDetailed([cartographic]);
  37168. promise.then(function(updatedPositions) {
  37169. if (callComplete)
  37170. callComplete(updatedPositions[0].height);
  37171. });
  37172. },
  37173. _clearEditPoint: function() {
  37174. if (this._sketchEditHandler != void 0) {
  37175. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN);
  37176. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP);
  37177. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  37178. }
  37179. this._sketchEditPoints = [];
  37180. this._sketchEditIndex = void 0;
  37181. this._editEntity = void 0;
  37182. this._removeEntityByName(this._sketchEditEntityNodeName);
  37183. this._removeEntityByName(this._sketchEditEntityMiddleName);
  37184. this._removeEntityByName(this._sketchEditEntityCenterName);
  37185. this._removeEntityByName(this._sketchEditEntitySpatialName);
  37186. }
  37187. });
  37188. Object.assign(DrawTools.prototype, {
  37189. _checkColor: function(color2) {
  37190. if (color2 === void 0 || color2 === null)
  37191. return false;
  37192. if (typeof color2 != "number")
  37193. return false;
  37194. let intColor = parseInt(color2);
  37195. if (intColor < 0 || intColor > 255)
  37196. return false;
  37197. return true;
  37198. },
  37199. _checkAlpha: function(alpha) {
  37200. if (alpha === void 0 || alpha === null)
  37201. return false;
  37202. if (typeof alpha != "number")
  37203. return false;
  37204. let floatAlpha = parseFloat(alpha);
  37205. if (floatAlpha < 0 || floatAlpha > 1)
  37206. return false;
  37207. return true;
  37208. },
  37209. _checkColorAndAlpha: function(colorAndAlpah) {
  37210. let setColor = void 0;
  37211. if (!colorAndAlpah || colorAndAlpah.length === void 0 || colorAndAlpah.length === 0)
  37212. return void 0;
  37213. if (colorAndAlpah.length === 1 && this._checkColor(colorAndAlpah[0])) {
  37214. setColor = [colorAndAlpah[0], 0, 0, 1];
  37215. } else if (colorAndAlpah.length === 2 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  37216. colorAndAlpah[1]
  37217. )) {
  37218. setColor = [colorAndAlpah[0], colorAndAlpah[1], 0, 1];
  37219. } else if (colorAndAlpah.length === 3 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  37220. colorAndAlpah[1]
  37221. ) && this._checkColor(colorAndAlpah[2])) {
  37222. setColor = [colorAndAlpah[0], colorAndAlpah[1], colorAndAlpah[2], 1];
  37223. } else if (colorAndAlpah.length === 4 && this._checkColor(colorAndAlpah[0]) && this._checkColor(
  37224. colorAndAlpah[1]
  37225. ) && this._checkColor(colorAndAlpah[2]) && this._checkAlpha(
  37226. colorAndAlpah[3]
  37227. )) {
  37228. setColor = [colorAndAlpah[0], colorAndAlpah[1], colorAndAlpah[2], colorAndAlpah[3]];
  37229. }
  37230. return setColor;
  37231. }
  37232. });
  37233. Object.assign(DrawTools.prototype, {
  37234. _initOperationDom: function() {
  37235. let _self = this;
  37236. this._operationDomId = "drawButtonDiv";
  37237. this._operationDom = document.getElementById(this._operationDomId);
  37238. this._removeOperationDom();
  37239. this._createOperationMainDom();
  37240. if ([
  37241. DrawTools.DrawType.Rectangle,
  37242. DrawTools.DrawType.Circle,
  37243. DrawTools.DrawType.DynamicCircle,
  37244. DrawTools.DrawType.VideoWall
  37245. ].indexOf(this._drawType) === -1) {
  37246. let btnUndo = this._createOperationUndoButtonDom();
  37247. btnUndo.onclick = function() {
  37248. _self._operationExecuteEvent(Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  37249. };
  37250. }
  37251. if ([
  37252. DrawTools.DrawType.Rectangle,
  37253. DrawTools.DrawType.Circle,
  37254. DrawTools.DrawType.DynamicCircle,
  37255. DrawTools.DrawType.VideoWall
  37256. ] === -1) {
  37257. let btnCompletion = this._crateOperationCompletionButtonDom();
  37258. btnCompletion.onclick = function() {
  37259. _self._operationExecuteEvent(Cesium.ScreenSpaceEventType.LEFT_CLICK);
  37260. };
  37261. } else {
  37262. let btnCompletion = this._crateOperationCompletionButtonDom();
  37263. btnCompletion.onclick = function() {
  37264. _self._operationExecuteEvent(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  37265. };
  37266. }
  37267. },
  37268. _operationExecuteEvent(eventType) {
  37269. if (this._drawEventHandler !== void 0 && this._drawEventHandler.isDestroyed() === false) {
  37270. let event2 = {
  37271. position: new Cesium.Cartesian2(300, 300)
  37272. };
  37273. let action = this._drawEventHandler.getInputAction(eventType);
  37274. action(event2);
  37275. }
  37276. },
  37277. _createOperationMainDom: function() {
  37278. this._operationDom = document.createElement("div");
  37279. this._operationDom.id = this._operationDomId;
  37280. this._operationDom.style.width = "80px";
  37281. this._operationDom.style.backgroundColor = "rgba(5, 45, 155, 0.7)";
  37282. this._operationDom.style.borderRadius = "5px";
  37283. this._operationDom.style.display = "flex";
  37284. this._operationDom.style.flexDirection = "column";
  37285. this._operationDom.style.padding = "8px";
  37286. this._operationDom.style.justifyContent = "center";
  37287. this._operationDom.style.position = "absolute";
  37288. this._operationDom.style.bottom = "150px";
  37289. this._operationDom.style.right = "10px";
  37290. document.body.appendChild(this._operationDom);
  37291. },
  37292. _createOperationUndoButtonDom: function() {
  37293. let btnUndo = document.createElement("button");
  37294. btnUndo.id = "btnDrawBackout";
  37295. btnUndo.style.height = "30px";
  37296. btnUndo.style.marginBottom = "8px";
  37297. btnUndo.style.backgroundColor = "rgba(52, 137, 255, 1.0)";
  37298. btnUndo.style.color = "rgb(255, 255, 255)";
  37299. btnUndo.style.border = "0px solid red";
  37300. btnUndo.style.borderRadius = "5px";
  37301. btnUndo.innerHTML = "\u56DE\u9000";
  37302. btnUndo.style.fontSize = "13px";
  37303. btnUndo.style.cursor = "pointer";
  37304. this._operationDom.appendChild(btnUndo);
  37305. return btnUndo;
  37306. },
  37307. _crateOperationCompletionButtonDom: function() {
  37308. let btnCompletion = document.createElement("button");
  37309. btnCompletion.id = "btnDrawComplete";
  37310. btnCompletion.style.height = "30px";
  37311. btnCompletion.style.backgroundColor = "rgba(88, 185, 45, 1.0)";
  37312. btnCompletion.style.color = "rgb(255, 255, 255)";
  37313. btnCompletion.style.border = "0px solid red";
  37314. btnCompletion.style.borderRadius = "5px";
  37315. btnCompletion.innerHTML = "\u5B8C\u6210";
  37316. btnCompletion.style.fontSize = "13px";
  37317. btnCompletion.style.cursor = "pointer";
  37318. this._operationDom.appendChild(btnCompletion);
  37319. return btnCompletion;
  37320. },
  37321. _removeOperationDom: function() {
  37322. if (this._operationDom !== null && this._operationDom !== void 0) {
  37323. document.body.removeChild(this._operationDom);
  37324. this._operationDom = void 0;
  37325. }
  37326. },
  37327. _createOperationDom: function() {
  37328. if (this._isRuntimeApp()) {
  37329. this._initOperationDom();
  37330. }
  37331. }
  37332. });
  37333. Object.assign(DrawTools.prototype, {
  37334. _openPropertyEditDialog: function(params, callEdit, callRemove) {
  37335. this._editPropertyDialogDomId = "dialog-property-dom";
  37336. this._registerDOMPropertyEdit = "dialog-edit-property";
  37337. let PropertyEditComponent = customElements.get(this._registerDOMPropertyEdit);
  37338. if (PropertyEditComponent === void 0) {
  37339. PropertyEditComponent = defineCustomElement(DialogEditProperty$2);
  37340. customElements.define(this._registerDOMPropertyEdit, PropertyEditComponent);
  37341. }
  37342. this._closePropertyEditDialog();
  37343. let dialogPropertyElement = new PropertyEditComponent({
  37344. params
  37345. });
  37346. dialogPropertyElement.id = this._editPropertyDialogDomId;
  37347. dialogPropertyElement.showDialog = true;
  37348. document.body.appendChild(dialogPropertyElement);
  37349. dialogPropertyElement.addEventListener(
  37350. "submit",
  37351. (e) => {
  37352. if (callEdit)
  37353. callEdit(e.detail[0]);
  37354. },
  37355. false
  37356. );
  37357. dialogPropertyElement.addEventListener(
  37358. "remove",
  37359. (e) => {
  37360. if (callRemove)
  37361. callRemove();
  37362. },
  37363. false
  37364. );
  37365. },
  37366. _closePropertyEditDialog() {
  37367. let dom2 = document.getElementById(this._editPropertyDialogDomId);
  37368. if (dom2 !== null && dom2 !== void 0) {
  37369. document.body.removeChild(dom2);
  37370. }
  37371. }
  37372. });
  37373. DrawTools.DrawType = Object.freeze({
  37374. Point: "point",
  37375. Polyline: "polyline",
  37376. ArrowPolyline: "arrowPolyline",
  37377. DynamicPolyline: "dynamicPolyline",
  37378. GrowPolyline: "\u53D1\u5149\u7EBF",
  37379. OutlinePolyline: "outlinePolyline",
  37380. OdLine: "odLine",
  37381. Polygon: "polygon",
  37382. SpatialLine: "spatialLine",
  37383. Circle: "circle",
  37384. DynamicCircle: "dynamicCircle",
  37385. Rectangle: "rectangle",
  37386. NormalWall: "normalWall",
  37387. DynamicWall: "dynamicWall",
  37388. House: "house",
  37389. TextWall: "text",
  37390. VideoWall: "videoWall"
  37391. });
  37392. DrawTools.IconType = Object.freeze({
  37393. Normal: "normal",
  37394. Blue: "blue",
  37395. Green: "green",
  37396. Violet: "violter"
  37397. });
  37398. DrawTools.EditPointType = Object.freeze({
  37399. Node: "node",
  37400. Middle: "middle",
  37401. Center: "center",
  37402. CoordinateAxis: "coordinateAxis",
  37403. OdlineStrartNode: "odlineStartNode",
  37404. OdlineEndNode: "odlineEndNode"
  37405. });
  37406. DrawTools.WallType = Object.freeze({
  37407. ColorWall: "colorWall",
  37408. DynamicWall: "dynamicWall",
  37409. TextWall: "textWall"
  37410. });
  37411. DrawTools.CircleType = Object.freeze({
  37412. ColorCircle: "colorCircle",
  37413. DynamicCircle: "dynamicCircle"
  37414. });
  37415. DrawTools.PolylineType = Object.freeze({
  37416. NormalPolyline: "normalPolyline",
  37417. ArrowsPolyline: "arrowsPolyline",
  37418. DynamicPolyline: "dynamicPolyline",
  37419. DottedPolyline: "dottedPolyline",
  37420. GrowPolyline: "growPolyline",
  37421. OutlinePolyline: "outlinePolyline"
  37422. });
  37423. DrawTools.PolygonType = Object.freeze({
  37424. NormalPolygon: "normalPolygon",
  37425. HousePolygon: "housePolygon"
  37426. });
  37427. DrawTools.RuntimeEnvironment = Object.freeze({
  37428. App: "app",
  37429. Web: "web"
  37430. });
  37431. class WallMaterialProperty {
  37432. constructor(options2) {
  37433. this._viewer = options2.viewer;
  37434. this._definitionChanged = new Cesium.Event();
  37435. this._color = void 0;
  37436. this.color = options2.color || Cesium.Color.BLUE;
  37437. this.duration = options2.duration || 1e3;
  37438. this.trailImage = options2.trailImage;
  37439. this._time = new Date().getTime();
  37440. this._materialTypeName = "WallMaterial" + this._guid();
  37441. this._param = {
  37442. color: this.color._value.toCssColorString(),
  37443. image: this.trailImage,
  37444. duration: this.duration,
  37445. count: 0,
  37446. direction: "",
  37447. order: ""
  37448. };
  37449. Cesium.Material._materialCache.addMaterial(this._materialTypeName, {
  37450. fabric: {
  37451. type: this._materialTypeName,
  37452. uniforms: {
  37453. time: -20,
  37454. color: new Cesium.Color(1, 0, 0, 0.5),
  37455. image: options2.trailImage
  37456. },
  37457. source: this._getDirectionWallShader(options2.param)
  37458. },
  37459. translucent: function(material) {
  37460. return true;
  37461. }
  37462. });
  37463. }
  37464. _guid() {
  37465. function S4() {
  37466. return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
  37467. }
  37468. return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
  37469. }
  37470. getType(time) {
  37471. return this._materialTypeName;
  37472. }
  37473. getValue(time, result) {
  37474. if (!Cesium.defined(result)) {
  37475. result = {};
  37476. }
  37477. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.BLUE, result.color);
  37478. result.image = this.trailImage;
  37479. if (this.duration) {
  37480. result.time = (new Date().getTime() - this._time) % this.duration / this.duration;
  37481. }
  37482. this._viewer.scene.requestRender();
  37483. return result;
  37484. }
  37485. equals(other) {
  37486. return this === other || other instanceof WallMaterialProperty && Cesium.Property.equals(this._color, other._color) && other._param.order === this._param.order && other._param.count === this._param.count && other._param.direction === this._param.direction && other.duration === this.duration;
  37487. }
  37488. _getDirectionWallShader(options2) {
  37489. let op = Cesium.defaultValue(options2, {});
  37490. let count = op.count !== void 0 && typeof op.count === "number" && op.count > 0 ? op.count : 1;
  37491. let direction = op.direction === "horizontal" ? "horizontal" : "vertical";
  37492. let order = op.order === "+" ? "+" : "-";
  37493. this._param.count = count;
  37494. this._param.direction = direction;
  37495. this._param.order = order;
  37496. let materail = "";
  37497. materail += "czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n";
  37498. if (direction === "vertical") {
  37499. materail += " vec4 colorImage = texture2D(image,vec2(st.s,fract(float(" + count + ")*st.t " + order + " time)));\n";
  37500. } else if (direction === "horizontal") {
  37501. materail += " vec4 colorImage = texture2D(image, vec2(fract(float(" + count + ")*st.s " + order + " time), st.t));\n";
  37502. }
  37503. materail += " vec4 fragColor;\n fragColor.rgb = color.rgb / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.alpha = colorImage.a * color.a;\n material.diffuse = color.rgb;\n material.emission = fragColor.rgb;\n return material;\n}";
  37504. return materail;
  37505. }
  37506. }
  37507. Object.defineProperties(WallMaterialProperty.prototype, {
  37508. isConstant: {
  37509. get: function() {
  37510. return false;
  37511. }
  37512. },
  37513. definitionChanged: {
  37514. get: function() {
  37515. return this._definitionChanged;
  37516. }
  37517. },
  37518. color: Cesium.createPropertyDescriptor("color")
  37519. });
  37520. class CircleMaterialProperty {
  37521. constructor(options2) {
  37522. this._viewer = options2.viewer;
  37523. this._definitionChanged = new Cesium.Event();
  37524. this._color = void 0;
  37525. this.color = options2.color || Cesium.Color.BLUE;
  37526. this.count = options2.count || 1;
  37527. this.duration = options2.duration || 1e3;
  37528. this._time = new Date().getTime();
  37529. this._materialTypeName = "jtCircleMaterial";
  37530. this._param = {
  37531. color: this.color._value.toCssColorString(),
  37532. duration: this.duration,
  37533. count: this.count
  37534. };
  37535. Cesium.Material._materialCache.addMaterial(this._materialTypeName, {
  37536. fabric: {
  37537. type: this._materialTypeName,
  37538. uniforms: {
  37539. time: 0,
  37540. color: new Cesium.Color(1, 0, 0, 0.5),
  37541. count: 1
  37542. },
  37543. source: this._getCircleMaterial()
  37544. },
  37545. translucent: function(material) {
  37546. return true;
  37547. }
  37548. });
  37549. }
  37550. _getCircleMaterial() {
  37551. let circleMaterial = "czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n vec3 str = materialInput.str;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(time);\n if (abs(str.z) > 0.001)\n {\n //\u7740\u8272\u5668\u6E32\u67D3\u505C\u6B62\uFF0C\u4E0D\u5728\u7ED8\u5236\u5185\u5BB9 \n discard;\n }\n if (dis > 0.5)\n {\n //\u8D85\u51FA\u534A\u5F84\u8303\u56F4\u65F6\uFF0C\u7740\u8272\u5668\u6E32\u67D3\u505C\u6B62 \n discard;\n } else {\n //\u628A\u534A\u5F84\u5206\u6210count\u4EFD\uFF0C\u6BCF\u4E24\u4EFD\u4E4B\u95F4\u7684\u95F4\u9694\u8DDD\u79BB \n float perDis = 0.5 / count;\n float disNum;\n float bl = 0.0;\n //\u5FAA\u73AF\uFF0C\u6700\u591A999\u4E2A\u73AF \n for (int i = 0; i <= 999; i++)\n {\n //\u5224\u65AD\u662F\u5426\u5C5E\u4E8E\u6570\u91CF\u5185\u7684\u73AF \n if (float(i) <= count)\n {\n disNum = perDis * float(i) - dis + per / count;\n if (disNum > 0.0)\n {\n if (disNum < perDis)\n {\n bl = 1.0 - disNum / perDis;\n } else if (disNum - perDis < perDis) {\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = color.a * pow(bl, 3.0);\n }\n }\n }\n }\n return material;\n}\n";
  37552. return circleMaterial;
  37553. }
  37554. }
  37555. Object.assign(CircleMaterialProperty.prototype, {
  37556. getType: function(time) {
  37557. return this._materialTypeName;
  37558. },
  37559. getValue: function(time, result) {
  37560. if (!Cesium.defined(result)) {
  37561. result = {};
  37562. }
  37563. result.color = Cesium.Property.getValueOrClonedDefault(this._color, time, Cesium.Color.BLUE, result.color);
  37564. result.count = this.count;
  37565. if (this.duration) {
  37566. result.time = (new Date().getTime() - this._time) % this.duration / this.duration;
  37567. }
  37568. this._viewer.scene.requestRender();
  37569. return result;
  37570. },
  37571. equals: function(other) {
  37572. return this === other || other instanceof CircleMaterialProperty && Cesium.Property.equals(this._color, other._color);
  37573. }
  37574. });
  37575. Object.defineProperties(CircleMaterialProperty.prototype, {
  37576. isConstant: {
  37577. get: function() {
  37578. return false;
  37579. }
  37580. },
  37581. definitionChanged: {
  37582. get: function() {
  37583. return this._definitionChanged;
  37584. }
  37585. },
  37586. color: Cesium.createPropertyDescriptor("color")
  37587. });
  37588. const _checkAppOrWeb = function() {
  37589. if (window.navigator.userAgent.match(
  37590. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  37591. )) {
  37592. return "App";
  37593. } else {
  37594. return "Web";
  37595. }
  37596. };
  37597. const isRuntimeApp = function() {
  37598. if (_checkAppOrWeb() === "App") {
  37599. return true;
  37600. }
  37601. return false;
  37602. };
  37603. const isRuntimeWeb = function() {
  37604. if (_checkAppOrWeb() === "Web") {
  37605. return true;
  37606. }
  37607. return false;
  37608. };
  37609. function createOperationMainDom() {
  37610. let buttonDiv = document.createElement("div");
  37611. buttonDiv.id = "drawButtonDiv";
  37612. buttonDiv.style.width = "80px";
  37613. buttonDiv.style.backgroundColor = "rgba(5, 45, 155, 0.7)";
  37614. buttonDiv.style.borderRadius = "5px";
  37615. buttonDiv.style.display = "flex";
  37616. buttonDiv.style.flexDirection = "column";
  37617. buttonDiv.style.padding = "8px";
  37618. buttonDiv.style.justifyContent = "center";
  37619. buttonDiv.style.position = "absolute";
  37620. buttonDiv.style.bottom = "150px";
  37621. buttonDiv.style.right = "10px";
  37622. let btnUndo = document.createElement("button");
  37623. btnUndo.id = "btnDrawBackout";
  37624. btnUndo.style.height = "30px";
  37625. btnUndo.style.marginBottom = "8px";
  37626. btnUndo.style.backgroundColor = "rgba(52, 137, 255, 1.0)";
  37627. btnUndo.style.color = "rgb(255, 255, 255)";
  37628. btnUndo.style.border = "0px solid red";
  37629. btnUndo.style.borderRadius = "5px";
  37630. btnUndo.innerHTML = "\u56DE\u9000";
  37631. btnUndo.style.fontSize = "13px";
  37632. btnUndo.style.cursor = "pointer";
  37633. buttonDiv.appendChild(btnUndo);
  37634. let btnCompletion = document.createElement("button");
  37635. btnCompletion.id = "btnDrawComplete";
  37636. btnCompletion.style.height = "30px";
  37637. btnCompletion.style.backgroundColor = "rgba(88, 185, 45, 1.0)";
  37638. btnCompletion.style.color = "rgb(255, 255, 255)";
  37639. btnCompletion.style.border = "0px solid red";
  37640. btnCompletion.style.borderRadius = "5px";
  37641. btnCompletion.innerHTML = "\u5B8C\u6210";
  37642. btnCompletion.style.fontSize = "13px";
  37643. btnCompletion.style.cursor = "pointer";
  37644. buttonDiv.appendChild(btnCompletion);
  37645. document.body.appendChild(buttonDiv);
  37646. }
  37647. function showTooltipMessage(message) {
  37648. let msgMainDom = document.getElementById("messageMainDom");
  37649. if (msgMainDom !== null && msgMainDom !== void 0) {
  37650. document.body.removeChild(msgMainDom);
  37651. }
  37652. msgMainDom = document.createElement("div");
  37653. msgMainDom.style.width = "30%";
  37654. msgMainDom.style.backgroundColor = "rgba(237, 248, 230, 1.0)";
  37655. msgMainDom.style.height = "45px";
  37656. msgMainDom.style.border = "solid 2px rgb(219, 241, 208)";
  37657. msgMainDom.style.borderRadius = "8px";
  37658. msgMainDom.style.display = "flex";
  37659. msgMainDom.style.alignItems = "center";
  37660. msgMainDom.style.paddingLeft = "10px";
  37661. msgMainDom.style.color = "rgb(91, 188, 48)";
  37662. msgMainDom.style.fontSize = "14px";
  37663. msgMainDom.style.fontWeight = "600";
  37664. msgMainDom.style.position = "absolute";
  37665. msgMainDom.style.left = "35%";
  37666. msgMainDom.style.transition = "transform 1s";
  37667. msgMainDom.style.transform = "translateY(-90px)";
  37668. msgMainDom.style.top = "0px";
  37669. msgMainDom.style.zIndex = 1e3;
  37670. document.body.appendChild(msgMainDom);
  37671. let strHtml = "";
  37672. strHtml += "<div style='";
  37673. strHtml += "background-color: rgb(88, 185, 45);";
  37674. strHtml += "color: rgb(255, 255, 255);";
  37675. strHtml += "height: 24px;";
  37676. strHtml += "width: 24px;";
  37677. strHtml += "border-radius: 20px;";
  37678. strHtml += "display: flex;";
  37679. strHtml += "justify-content: center;";
  37680. strHtml += "align-items: center;";
  37681. strHtml += "font-size: 14px;";
  37682. strHtml += "margin-right: 18px;";
  37683. strHtml += "'>&#10003</div>";
  37684. strHtml += "<div>" + message + "</div>";
  37685. msgMainDom.innerHTML = strHtml;
  37686. msgMainDom.addEventListener("transitionend", function() {
  37687. setTimeout(function() {
  37688. document.body.removeChild(msgMainDom);
  37689. }, 1e3);
  37690. }, false);
  37691. setTimeout(function() {
  37692. msgMainDom.style.transform = "translateY(50px)";
  37693. }, 100);
  37694. }
  37695. var RuntimeEnvironment = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  37696. __proto__: null,
  37697. isRuntimeApp,
  37698. isRuntimeWeb,
  37699. createOperationMainDom,
  37700. showTooltipMessage
  37701. }, Symbol.toStringTag, { value: "Module" }));
  37702. class DrawStraightArrow {
  37703. constructor(arg) {
  37704. this.viewer = arg.viewer;
  37705. this.Cesium = arg.Cesium;
  37706. this.floatingPoint = null;
  37707. this._straightArrow = null;
  37708. this._straightArrowLast = null;
  37709. this._positions = [];
  37710. this._entities_point = [];
  37711. this._entities_straightArrow = [];
  37712. this._straightArrowData = null;
  37713. this.DrawStartEvent = new Cesium.Event();
  37714. this.DrawEndEvent = new Cesium.Event();
  37715. this._tooltip = createTooltip(this.viewer.container);
  37716. this._param = {
  37717. id: "DrawStraightArrow",
  37718. polygonColor: "rgba(0,255,0,0.5)",
  37719. outlineColor: "rgba(255, 255, 255, 1)",
  37720. outlineWidth: 1
  37721. };
  37722. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  37723. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  37724. }
  37725. get straightArrow() {
  37726. return this._straightArrowLast;
  37727. }
  37728. getData() {
  37729. return this._straightArrowData;
  37730. }
  37731. computePosition(data) {
  37732. var $this = this;
  37733. var length = data.length;
  37734. var p1 = data[0];
  37735. var p2 = data[length - 1];
  37736. var firstPoint = $this.cartesianToLatlng(p1);
  37737. var endPoints = $this.cartesianToLatlng(p2);
  37738. var arrow = [];
  37739. var res = $this.fineArrow([firstPoint[0], firstPoint[1]], [endPoints[0], endPoints[1]]);
  37740. for (var i2 = 0; i2 < res.length; i2++) {
  37741. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  37742. arrow.push(cart3);
  37743. }
  37744. $this._straightArrowData = [firstPoint, endPoints];
  37745. return new $this.Cesium.PolygonHierarchy(arrow);
  37746. }
  37747. addload(data) {
  37748. var $this = this;
  37749. if (data.length < 2) {
  37750. return null;
  37751. }
  37752. var length = data.length;
  37753. var p1 = data[0];
  37754. var p2 = data[length - 1];
  37755. var arrow = [];
  37756. var res = $this.fineArrow([p1[0], p1[1]], [p2[0], p2[1]]);
  37757. for (var i2 = 0; i2 < res.length; i2++) {
  37758. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  37759. arrow.push(cart3);
  37760. }
  37761. var arrowEntity = $this.viewer.entities.add({
  37762. Type: "DrawStraightArrow",
  37763. Position: data,
  37764. id: data.id || $this.objId,
  37765. polygon: {
  37766. hierarchy: new $this.Cesium.PolygonHierarchy(arrow),
  37767. show: true,
  37768. fill: true,
  37769. clampToGround: true,
  37770. material: $this.polygonMaterial
  37771. }
  37772. });
  37773. return arrowEntity;
  37774. }
  37775. startCreate(drawType) {
  37776. if (isRuntimeApp()) {
  37777. showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  37778. }
  37779. var $this = this;
  37780. this.drawType = drawType;
  37781. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  37782. this.handler.setInputAction(function(evt) {
  37783. if (isRuntimeApp()) {
  37784. var cartesian = $this.getCatesian3FromPX(evt.position);
  37785. if (!cartesian) {
  37786. return;
  37787. }
  37788. $this.createPoint(cartesian);
  37789. $this._positions.push(cartesian);
  37790. if ($this._positions.length === 2) {
  37791. showTooltipMessage("\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  37792. $this.destroy();
  37793. if (!$this.Cesium.defined($this._straightArrow)) {
  37794. $this._straightArrow = $this.createStraightArrow();
  37795. createOperationMainDom();
  37796. document.getElementById("btnDrawBackout").style.display = "none";
  37797. document.getElementById("btnDrawComplete").onclick = () => {
  37798. $this._straightArrowData = $this._positions.concat();
  37799. $this.viewer.entities.remove($this._straightArrow);
  37800. $this._straightArrow = null;
  37801. $this._positions = [];
  37802. var lnglatArr = [];
  37803. for (var i2 = 0; i2 < $this._straightArrowData.length; i2++) {
  37804. var lnglat = $this.cartesianToLatlng($this._straightArrowData[i2]);
  37805. lnglatArr.push(lnglat);
  37806. }
  37807. $this._straightArrowData = lnglatArr;
  37808. var straightArrow = $this.addload($this._straightArrowData);
  37809. $this._entities_straightArrow.push(straightArrow);
  37810. $this._straightArrowLast = straightArrow;
  37811. $this.clearPoint();
  37812. $this.destroy();
  37813. let buttonDiv = document.getElementById("drawButtonDiv");
  37814. if (buttonDiv) {
  37815. document.body.removeChild(buttonDiv);
  37816. }
  37817. };
  37818. }
  37819. }
  37820. } else {
  37821. clearTimeout($this._timer);
  37822. $this._timer = setTimeout(function() {
  37823. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u5355\u51FB");
  37824. var cartesian2 = $this.getCatesian3FromPX(evt.position);
  37825. if ($this._positions.length == 0) {
  37826. $this._positions.push(cartesian2.clone());
  37827. $this.floatingPoint = $this.createPoint(cartesian2);
  37828. $this._positions.push(cartesian2);
  37829. }
  37830. if (!$this._straightArrow) {
  37831. $this.createPoint(cartesian2);
  37832. } else {
  37833. $this._straightArrowData = $this._positions.concat();
  37834. $this.viewer.entities.remove($this._straightArrow);
  37835. $this._straightArrow = null;
  37836. $this._positions = [];
  37837. $this.floatingPoint.position.setValue(cartesian2);
  37838. var lnglatArr = [];
  37839. for (var i2 = 0; i2 < $this._straightArrowData.length; i2++) {
  37840. var lnglat = $this.cartesianToLatlng($this._straightArrowData[i2]);
  37841. lnglatArr.push(lnglat);
  37842. }
  37843. $this._straightArrowData = lnglatArr;
  37844. var straightArrow = $this.addload($this._straightArrowData);
  37845. $this._entities_straightArrow.push(straightArrow);
  37846. $this._straightArrowLast = straightArrow;
  37847. $this.clearPoint();
  37848. $this.destroy();
  37849. $this._tooltip.setVisible(false);
  37850. }
  37851. }, 200);
  37852. }
  37853. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  37854. this.handler.setInputAction(function(evt) {
  37855. if (isRuntimeApp())
  37856. return;
  37857. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  37858. if ($this._positions.length < 2)
  37859. return;
  37860. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236");
  37861. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  37862. if (!$this.Cesium.defined($this._straightArrow)) {
  37863. $this._straightArrow = $this.createStraightArrow();
  37864. }
  37865. $this.floatingPoint.position.setValue(cartesian);
  37866. if ($this._straightArrow) {
  37867. $this._positions.pop();
  37868. $this._positions.push(cartesian);
  37869. }
  37870. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  37871. }
  37872. createStraightArrow() {
  37873. var $this = this;
  37874. var arrowEntity = $this.viewer.entities.add({
  37875. polygon: {
  37876. hierarchy: new $this.Cesium.CallbackProperty(
  37877. function() {
  37878. var length = $this._positions.length;
  37879. var p1 = $this._positions[0];
  37880. var p2 = $this._positions[length - 1];
  37881. var firstPoint = $this.cartesianToLatlng(p1);
  37882. var endPoints = $this.cartesianToLatlng(p2);
  37883. var arrow = [];
  37884. var res = $this.fineArrow([firstPoint[0], firstPoint[1]], [endPoints[0], endPoints[1]]);
  37885. for (var i2 = 0; i2 < res.length; i2++) {
  37886. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  37887. arrow.push(cart3);
  37888. }
  37889. return new $this.Cesium.PolygonHierarchy(arrow);
  37890. },
  37891. false
  37892. ),
  37893. show: true,
  37894. fill: true,
  37895. clampToGround: true,
  37896. material: $this.polygonMaterial
  37897. }
  37898. });
  37899. $this._entities_straightArrow.push(arrowEntity);
  37900. return arrowEntity;
  37901. }
  37902. createPoint(cartesian) {
  37903. var $this = this;
  37904. var point2 = this.viewer.entities.add({
  37905. position: cartesian,
  37906. point: {
  37907. pixelSize: 10,
  37908. color: $this.Cesium.Color.RED,
  37909. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  37910. }
  37911. });
  37912. $this._entities_point.push(point2);
  37913. return point2;
  37914. }
  37915. cartesianToLatlng(cartesian) {
  37916. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  37917. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  37918. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  37919. return [lng, lat];
  37920. }
  37921. destroy() {
  37922. if (this.handler) {
  37923. this.handler.destroy();
  37924. this.handler = null;
  37925. }
  37926. }
  37927. clearPoint() {
  37928. this.DrawEndEvent.raiseEvent(this._straightArrowLast, this._straightArrowData, this.drawType);
  37929. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  37930. this.viewer.entities.remove(this._entities_point[i2]);
  37931. }
  37932. this._entities_point = [];
  37933. }
  37934. clear() {
  37935. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  37936. this.viewer.entities.remove(this._entities_point[i2]);
  37937. }
  37938. for (var i2 = 0; i2 < this._entities_straightArrow.length; i2++) {
  37939. this.viewer.entities.remove(this._entities_straightArrow[i2]);
  37940. }
  37941. this.floatingPoint = null;
  37942. this._straightArrow = null;
  37943. this._straightArrowLast = null;
  37944. this._positions = [];
  37945. this._entities_point = [];
  37946. this._entities_straightArrow = [];
  37947. this._straightArrowData = null;
  37948. }
  37949. getCatesian3FromPX(px) {
  37950. var cartesian;
  37951. var ray = this.viewer.camera.getPickRay(px);
  37952. if (!ray)
  37953. return null;
  37954. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  37955. return cartesian;
  37956. }
  37957. fineArrowDefualParam() {
  37958. return {
  37959. tailWidthFactor: 0.15,
  37960. neckWidthFactor: 0.2,
  37961. headWidthFactor: 0.25,
  37962. headAngle: Math.PI / 8.5,
  37963. neckAngle: Math.PI / 13
  37964. };
  37965. }
  37966. fineArrow(tailPoint, headerPoint) {
  37967. var $this = this;
  37968. if (tailPoint.length < 2 || headerPoint.length < 2)
  37969. return;
  37970. let tailWidthFactor = $this.fineArrowDefualParam().tailWidthFactor;
  37971. let neckWidthFactor = $this.fineArrowDefualParam().neckWidthFactor;
  37972. let headWidthFactor = $this.fineArrowDefualParam().headWidthFactor;
  37973. let headAngle = $this.fineArrowDefualParam().headAngle;
  37974. let neckAngle = $this.fineArrowDefualParam().neckAngle;
  37975. var o = [];
  37976. o[0] = tailPoint;
  37977. o[1] = headerPoint;
  37978. var e = o[0], r2 = o[1], n = $this.getBaseLength(o), g = n * tailWidthFactor, i2 = n * neckWidthFactor, s = n * headWidthFactor, a = $this.getThirdPoint(r2, e, Math.PI / 2, g, true), l = $this.getThirdPoint(r2, e, Math.PI / 2, g, false), u = $this.getThirdPoint(e, r2, headAngle, s, false), c = $this.getThirdPoint(e, r2, headAngle, s, true), p = $this.getThirdPoint(e, r2, neckAngle, i2, false), h2 = $this.getThirdPoint(e, r2, neckAngle, i2, true), d2 = [];
  37979. d2.push(a[0], a[1], p[0], p[1], u[0], u[1], r2[0], r2[1], c[0], c[1], h2[0], h2[1], l[0], l[1], e[0], e[1]);
  37980. return $this.Cesium.Cartesian3.fromDegreesArray(d2);
  37981. }
  37982. getBaseLength(t2) {
  37983. return Math.pow(this.wholeDistance(t2), 0.99);
  37984. }
  37985. wholeDistance(t2) {
  37986. for (var o = 0, e = 0; e < t2.length - 1; e++)
  37987. o += this.distance(t2[e], t2[e + 1]);
  37988. return o;
  37989. }
  37990. distance(t2, o) {
  37991. return Math.sqrt(Math.pow(t2[0] - o[0], 2) + Math.pow(t2[1] - o[1], 2));
  37992. }
  37993. getThirdPoint(t2, o, e, r2, n) {
  37994. var g = this.getAzimuth(t2, o), i2 = n ? g + e : g - e, s = r2 * Math.cos(i2), a = r2 * Math.sin(i2);
  37995. return [o[0] + s, o[1] + a];
  37996. }
  37997. getAzimuth(t2, o) {
  37998. var e, r2 = Math.asin(Math.abs(o[1] - t2[1]) / this.distance(t2, o));
  37999. return o[1] >= t2[1] && o[0] >= t2[0] ? e = r2 + Math.PI : o[1] >= t2[1] && o[0] < t2[0] ? e = 2 * Math.PI - r2 : o[1] < t2[1] && o[0] < t2[0] ? e = r2 : o[1] < t2[1] && o[0] >= t2[0] && (e = Math.PI - r2), e;
  38000. }
  38001. }
  38002. class DrawAttackArrow {
  38003. constructor(arg) {
  38004. __publicField(this, "getAttackArrowBodyPoints", function(t2, o, e, r2) {
  38005. var $this = this;
  38006. for (var n = $this.wholeDistance(t2), g = $this.getBaseLength(t2), i2 = g * r2, s = $this.distance(o, e), a = (i2 - s) / 2, l = 0, u = [], c = [], p = 1; p < t2.length - 1; p++) {
  38007. var h2 = $this.getAngleOfThreePoints(t2[p - 1], t2[p], t2[p + 1]) / 2;
  38008. l += $this.distance(t2[p - 1], t2[p]);
  38009. var d2 = (i2 / 2 - l / n * a) / Math.sin(h2), f = $this.getThirdPoint(t2[p - 1], t2[p], Math.PI - h2, d2, true), E2 = $this.getThirdPoint(t2[p - 1], t2[p], h2, d2, false);
  38010. u.push(f), c.push(E2);
  38011. }
  38012. return u.concat(c);
  38013. });
  38014. __publicField(this, "getQBSplinePoints", function(t2) {
  38015. if (t2.length <= 2)
  38016. return t2;
  38017. var o = 2, e = [], r2 = t2.length - o - 1, y = 0;
  38018. e.push(t2[0]);
  38019. for (var n = 0; r2 >= n; n++)
  38020. for (var g = 0; 1 >= g; g += 0.05) {
  38021. for (var i2 = y = 0, s = 0; o >= s; s++) {
  38022. var a = this.getQuadricBSplineFactor(s, g);
  38023. i2 += a * t2[n + s][0], y += a * t2[n + s][1];
  38024. }
  38025. e.push([i2, y]);
  38026. }
  38027. return e.push(t2[t2.length - 1]), e;
  38028. });
  38029. __publicField(this, "getQuadricBSplineFactor", function(t2, o) {
  38030. return 0 == t2 ? Math.pow(o - 1, 2) / 2 : 1 == t2 ? (-2 * Math.pow(o, 2) + 2 * o + 1) / 2 : 2 == t2 ? Math.pow(o, 2) / 2 : 0;
  38031. });
  38032. __publicField(this, "array2Dto1D", function(array) {
  38033. var newArray = [];
  38034. array.forEach(function(elt) {
  38035. newArray.push(elt[0]);
  38036. newArray.push(elt[1]);
  38037. });
  38038. return newArray;
  38039. });
  38040. this.objId = Number(new Date().getTime() + "" + Number(Math.random() * 1e3).toFixed(0));
  38041. this.viewer = arg.viewer;
  38042. this.Cesium = arg.Cesium;
  38043. this.floatingPoint = null;
  38044. this._AttackArrow = null;
  38045. this._AttackArrowLast = null;
  38046. this._positions = [];
  38047. this._entities_point = [];
  38048. this._entities_AttackArrow = [];
  38049. this._AttackArrowData = null;
  38050. this.DrawStartEvent = new Cesium.Event();
  38051. this.DrawEndEvent = new Cesium.Event();
  38052. this._tooltip = createTooltip(this.viewer.container);
  38053. this._param = {
  38054. id: "DrawStraightArrow",
  38055. polygonColor: "rgba(0,255,0,0.5)",
  38056. outlineColor: "rgba(255, 255, 255, 1)",
  38057. outlineWidth: 1
  38058. };
  38059. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  38060. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  38061. }
  38062. get AttackArrow() {
  38063. return this._AttackArrowLast;
  38064. }
  38065. getData() {
  38066. return this._AttackArrowData;
  38067. }
  38068. addload(data) {
  38069. var $this = this;
  38070. if (data.length < 3) {
  38071. return null;
  38072. }
  38073. var res = $this.fineArrow(data);
  38074. var returnData = res.polygonalPoint;
  38075. var arrowEntity = $this.viewer.entities.add({
  38076. Type: "DrawAttackArrow",
  38077. Position: data,
  38078. id: data.id || $this.objId,
  38079. polygon: {
  38080. hierarchy: new $this.Cesium.PolygonHierarchy(returnData),
  38081. show: true,
  38082. fill: true,
  38083. clampToGround: true,
  38084. material: $this.polygonMaterial
  38085. }
  38086. });
  38087. return arrowEntity;
  38088. }
  38089. computePosition(data) {
  38090. let $this = this;
  38091. var lnglatArr = [];
  38092. for (var i2 = 0; i2 < data.length; i2++) {
  38093. var lnglat = $this.cartesianToLatlng(data[i2]);
  38094. lnglatArr.push(lnglat);
  38095. }
  38096. $this._AttackArrowData = lnglatArr;
  38097. var res = $this.fineArrow(lnglatArr);
  38098. var returnData = res.polygonalPoint;
  38099. return new $this.Cesium.PolygonHierarchy(returnData);
  38100. }
  38101. startCreate(drawType) {
  38102. if (isRuntimeApp()) {
  38103. showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  38104. }
  38105. var $this = this;
  38106. this.drawType = drawType;
  38107. this.handler = new $this.Cesium.ScreenSpaceEventHandler($this.viewer.scene.canvas);
  38108. this.handler.setInputAction(function(evt) {
  38109. if (isRuntimeApp()) {
  38110. var cartesian = $this.getCatesian3FromPX(evt.position);
  38111. if (!cartesian) {
  38112. return;
  38113. }
  38114. $this.createPoint(cartesian);
  38115. $this._positions.push(cartesian);
  38116. if ($this._positions.length <= 2) {
  38117. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38118. } else {
  38119. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  38120. if ($this._positions.length === 3) {
  38121. if (!$this.Cesium.defined($this._AttackArrow)) {
  38122. $this._AttackArrow = $this.createAttackArrow();
  38123. createOperationMainDom();
  38124. document.getElementById("btnDrawBackout").style.display = "none";
  38125. document.getElementById("btnDrawComplete").onclick = () => {
  38126. $this._AttackArrowData = $this._positions.concat();
  38127. $this.viewer.entities.remove($this._AttackArrow);
  38128. $this._AttackArrow = null;
  38129. $this._positions = [];
  38130. let lnglatArr = [];
  38131. for (var i2 = 0; i2 < $this._AttackArrowData.length; i2++) {
  38132. var lnglat = $this.cartesianToLatlng($this._AttackArrowData[i2]);
  38133. lnglatArr.push(lnglat);
  38134. }
  38135. $this._AttackArrowData = lnglatArr;
  38136. var straightArrow = $this.addload(lnglatArr);
  38137. $this._entities_AttackArrow.push(straightArrow);
  38138. $this._AttackArrowLast = straightArrow;
  38139. $this.clearPoint();
  38140. $this.destroy();
  38141. let buttonDiv = document.getElementById("drawButtonDiv");
  38142. if (buttonDiv) {
  38143. document.body.removeChild(buttonDiv);
  38144. }
  38145. };
  38146. }
  38147. }
  38148. }
  38149. } else {
  38150. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u5355\u51FB");
  38151. clearTimeout($this._timer);
  38152. $this._timer = setTimeout(function() {
  38153. var cartesian2 = $this.getCatesian3FromPX(evt.position);
  38154. if (!cartesian2) {
  38155. return;
  38156. }
  38157. if ($this._positions.length == 0) {
  38158. $this.floatingPoint = $this.createPoint(cartesian2);
  38159. $this.createPoint(cartesian2);
  38160. }
  38161. if ($this._positions.length == 1) {
  38162. $this._positions.push(cartesian2.clone());
  38163. $this.createPoint(cartesian2);
  38164. }
  38165. $this._positions.push(cartesian2);
  38166. }, 200);
  38167. }
  38168. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  38169. this.handler.setInputAction(function(evt) {
  38170. if (isRuntimeApp())
  38171. return;
  38172. if ($this._positions.length == 0) {
  38173. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  38174. } else {
  38175. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38176. }
  38177. if ($this._positions.length < 3)
  38178. return;
  38179. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  38180. if (!$this.Cesium.defined($this._AttackArrow)) {
  38181. $this._AttackArrow = $this.createAttackArrow();
  38182. }
  38183. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  38184. if (!cartesian) {
  38185. return;
  38186. }
  38187. $this.floatingPoint.position.setValue(cartesian);
  38188. if ($this._AttackArrow) {
  38189. $this._positions.pop();
  38190. $this._positions.push(cartesian);
  38191. }
  38192. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  38193. this.handler.setInputAction(function(evt) {
  38194. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  38195. this.handler.setInputAction(function(evt) {
  38196. if (isRuntimeApp())
  38197. return;
  38198. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u53CC\u51FB");
  38199. clearTimeout($this._timer);
  38200. var cartesian = $this.getCatesian3FromPX(evt.position);
  38201. $this._positions.pop();
  38202. $this._positions.push(cartesian);
  38203. $this._AttackArrowData = $this._positions.concat();
  38204. $this.viewer.entities.remove($this._AttackArrow);
  38205. $this._AttackArrow = null;
  38206. $this._positions = [];
  38207. $this.floatingPoint.position.setValue(cartesian);
  38208. let lnglatArr = [];
  38209. for (var i2 = 0; i2 < $this._AttackArrowData.length; i2++) {
  38210. var lnglat = $this.cartesianToLatlng($this._AttackArrowData[i2]);
  38211. lnglatArr.push(lnglat);
  38212. }
  38213. $this._AttackArrowData = lnglatArr;
  38214. var straightArrow = $this.addload(lnglatArr);
  38215. $this._entities_AttackArrow.push(straightArrow);
  38216. $this._AttackArrowLast = straightArrow;
  38217. $this.clearPoint();
  38218. $this.destroy();
  38219. $this._tooltip.setVisible(false);
  38220. }, $this.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  38221. }
  38222. createAttackArrow() {
  38223. var $this = this;
  38224. var arrowEntity = $this.viewer.entities.add({
  38225. polygon: {
  38226. hierarchy: new $this.Cesium.CallbackProperty(
  38227. function() {
  38228. var lnglatArr = [];
  38229. for (var i2 = 0; i2 < $this._positions.length; i2++) {
  38230. var lnglat = $this.cartesianToLatlng($this._positions[i2]);
  38231. lnglatArr.push(lnglat);
  38232. }
  38233. var res = $this.fineArrow(lnglatArr);
  38234. var returnData = res.polygonalPoint;
  38235. return new $this.Cesium.PolygonHierarchy(returnData);
  38236. },
  38237. false
  38238. ),
  38239. show: true,
  38240. fill: true,
  38241. clampToGround: true,
  38242. material: $this.polygonMaterial
  38243. }
  38244. });
  38245. $this._entities_AttackArrow.push(arrowEntity);
  38246. return arrowEntity;
  38247. }
  38248. createPoint(cartesian) {
  38249. var $this = this;
  38250. var point2 = this.viewer.entities.add({
  38251. position: cartesian,
  38252. point: {
  38253. pixelSize: 10,
  38254. color: $this.Cesium.Color.RED,
  38255. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  38256. }
  38257. });
  38258. point2.objId = this.objId;
  38259. $this._entities_point.push(point2);
  38260. return point2;
  38261. }
  38262. cartesianToLatlng(cartesian) {
  38263. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  38264. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  38265. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  38266. let alt = cartographic.height;
  38267. return [lng, lat, alt];
  38268. }
  38269. destroy() {
  38270. if (this.handler) {
  38271. this.handler.destroy();
  38272. this.handler = null;
  38273. }
  38274. }
  38275. clearPoint() {
  38276. this.DrawEndEvent.raiseEvent(this._AttackArrowLast, this._AttackArrowData, this.drawType);
  38277. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  38278. this.viewer.entities.remove(this._entities_point[i2]);
  38279. }
  38280. this._entities_point = [];
  38281. }
  38282. clear() {
  38283. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  38284. this.viewer.entities.remove(this._entities_point[i2]);
  38285. }
  38286. for (var i2 = 0; i2 < this._entities_AttackArrow.length; i2++) {
  38287. this.viewer.entities.remove(this._entities_AttackArrow[i2]);
  38288. }
  38289. this.floatingPoint = null;
  38290. this._AttackArrow = null;
  38291. this._AttackArrowLast = null;
  38292. this._positions = [];
  38293. this._entities_point = [];
  38294. this._entities_AttackArrow = [];
  38295. this._AttackArrowData = null;
  38296. }
  38297. getCatesian3FromPX(px) {
  38298. var cartesian;
  38299. var ray = this.viewer.camera.getPickRay(px);
  38300. if (!ray)
  38301. return null;
  38302. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  38303. return cartesian;
  38304. }
  38305. fineArrowDefualParam() {
  38306. return {
  38307. headHeightFactor: 0.18,
  38308. headWidthFactor: 0.3,
  38309. neckHeightFactor: 0.85,
  38310. neckWidthFactor: 0.15,
  38311. tailWidthFactor: 0.1,
  38312. headTailFactor: 0.8,
  38313. swallowTailFactor: 1
  38314. };
  38315. }
  38316. fineArrow(inputPoint) {
  38317. var $this = this;
  38318. inputPoint = $this.dereplication(inputPoint);
  38319. let tailWidthFactor = $this.fineArrowDefualParam().tailWidthFactor;
  38320. let swallowTailFactor = $this.fineArrowDefualParam().swallowTailFactor;
  38321. let swallowTailPnt = $this.fineArrowDefualParam().swallowTailPnt;
  38322. var result = {
  38323. controlPoint: null,
  38324. polygonalPoint: null
  38325. };
  38326. result.controlPoint = inputPoint;
  38327. var t2 = inputPoint.length;
  38328. if (!(2 > t2)) {
  38329. if (2 == inputPoint.length) {
  38330. result.polygonalPoint = inputPoint;
  38331. return result;
  38332. }
  38333. var o = inputPoint, e = o[0], r2 = o[1];
  38334. $this.isClockWise(o[0], o[1], o[2]) && (e = o[1], r2 = o[0]);
  38335. var n = $this.mid(e, r2), g = [n].concat(o.slice(2)), i2 = $this.getAttackArrowHeadPoints(g, e, r2, $this.fineArrowDefualParam()), s = i2[0], a = i2[4], l = $this.distance(e, r2), u = $this.getBaseLength(g), c = u * tailWidthFactor * swallowTailFactor;
  38336. swallowTailPnt = $this.getThirdPoint(g[1], g[0], 0, c, true);
  38337. var p = l / u, h2 = $this.getAttackArrowBodyPoints(g, s, a, p), t2 = h2.length, d2 = [e].concat(h2.slice(0, t2 / 2));
  38338. d2.push(s);
  38339. var f = [r2].concat(h2.slice(t2 / 2, t2));
  38340. var newArray = [];
  38341. f.push(a), d2 = $this.getQBSplinePoints(d2), f = $this.getQBSplinePoints(f), newArray = $this.array2Dto1D(d2.concat(i2, f.reverse(), [swallowTailPnt, d2[0]]));
  38342. result.polygonalPoint = $this.Cesium.Cartesian3.fromDegreesArray(newArray);
  38343. }
  38344. return result;
  38345. }
  38346. getArrowBodyPoints(t2, o, e, r2) {
  38347. var $this = this;
  38348. for (var n = $this.wholeDistance(t2), g = $this.getBaseLength(t2), i2 = g * r2, s = $this.distance(o, e), a = (i2 - s) / 2, l = 0, u = [], c = [], p = 1; p < t2.length - 1; p++) {
  38349. var h2 = $this.getAngleOfThreePoints(t2[p - 1], t2[p], t2[p + 1]) / 2;
  38350. l += $this.distance(t2[p - 1], t2[p]);
  38351. var d2 = (i2 / 2 - l / n * a) / Math.sin(h2), f = $this.getThirdPoint(t2[p - 1], t2[p], Math.PI - h2, d2, true), E2 = $this.getThirdPoint(t2[p - 1], t2[p], h2, d2, false);
  38352. u.push(f), c.push(E2);
  38353. }
  38354. return u.concat(c);
  38355. }
  38356. getAttackArrowHeadPoints(t2, o, e, defaultParam) {
  38357. var $this = this;
  38358. let headHeightFactor = defaultParam.headHeightFactor;
  38359. let headTailFactor = defaultParam.headTailFactor;
  38360. let headWidthFactor = defaultParam.headWidthFactor;
  38361. let neckWidthFactor = defaultParam.neckWidthFactor;
  38362. let neckHeightFactor = defaultParam.neckHeightFactor;
  38363. var r2 = $this.getBaseLength(t2), n = r2 * headHeightFactor, g = t2[t2.length - 1];
  38364. r2 = $this.distance(g, t2[t2.length - 2]);
  38365. var i2 = $this.distance(o, e);
  38366. n > i2 * headTailFactor && (n = i2 * headTailFactor);
  38367. var s = n * headWidthFactor, a = n * neckWidthFactor;
  38368. n = n > r2 ? r2 : n;
  38369. var l = n * neckHeightFactor, u = $this.getThirdPoint(t2[t2.length - 2], g, 0, n, true), c = $this.getThirdPoint(t2[t2.length - 2], g, 0, l, true), p = $this.getThirdPoint(g, u, Math.PI / 2, s, false), h2 = $this.getThirdPoint(g, u, Math.PI / 2, s, true), d2 = $this.getThirdPoint(g, c, Math.PI / 2, a, false), f = $this.getThirdPoint(g, c, Math.PI / 2, a, true);
  38370. return [d2, p, g, h2, f];
  38371. }
  38372. getAngleOfThreePoints(t2, o, e) {
  38373. var r2 = this.getAzimuth(o, t2) - this.getAzimuth(o, e);
  38374. return 0 > r2 ? r2 + Math.PI * 2 : r2;
  38375. }
  38376. dereplication(array) {
  38377. var last = array[array.length - 1];
  38378. var change = false;
  38379. var newArray = [];
  38380. newArray = array.filter(function(i2) {
  38381. if (i2[0] != last[0] && i2[1] != last[1]) {
  38382. return i2;
  38383. }
  38384. change = true;
  38385. });
  38386. if (change)
  38387. newArray.push(last);
  38388. return newArray;
  38389. }
  38390. getBaseLength(t2) {
  38391. return Math.pow(this.wholeDistance(t2), 0.99);
  38392. }
  38393. wholeDistance(t2) {
  38394. for (var o = 0, e = 0; e < t2.length - 1; e++)
  38395. o += this.distance(t2[e], t2[e + 1]);
  38396. return o;
  38397. }
  38398. distance(t2, o) {
  38399. return Math.sqrt(Math.pow(t2[0] - o[0], 2) + Math.pow(t2[1] - o[1], 2));
  38400. }
  38401. getThirdPoint(t2, o, e, r2, n) {
  38402. var g = this.getAzimuth(t2, o), i2 = n ? g + e : g - e, s = r2 * Math.cos(i2), a = r2 * Math.sin(i2);
  38403. return [o[0] + s, o[1] + a];
  38404. }
  38405. getAzimuth(t2, o) {
  38406. var e, r2 = Math.asin(Math.abs(o[1] - t2[1]) / this.distance(t2, o));
  38407. return o[1] >= t2[1] && o[0] >= t2[0] ? e = r2 + Math.PI : o[1] >= t2[1] && o[0] < t2[0] ? e = 2 * Math.PI - r2 : o[1] < t2[1] && o[0] < t2[0] ? e = r2 : o[1] < t2[1] && o[0] >= t2[0] && (e = Math.PI - r2), e;
  38408. }
  38409. isClockWise(t2, o, e) {
  38410. return (e[1] - t2[1]) * (o[0] - t2[0]) > (o[1] - t2[1]) * (e[0] - t2[0]);
  38411. }
  38412. mid(t2, o) {
  38413. return [(t2[0] + o[0]) / 2, (t2[1] + o[1]) / 2];
  38414. }
  38415. }
  38416. class DrawPincerArrow {
  38417. constructor(arg) {
  38418. this.viewer = arg.viewer;
  38419. this.Cesium = arg.Cesium;
  38420. this.floatingPoint = null;
  38421. this._PincerArrow = null;
  38422. this._PincerArrowLast = null;
  38423. this._positions = [];
  38424. this._entities_point = [];
  38425. this._entities_PincerArrow = [];
  38426. this._PincerArrowData = null;
  38427. this.DrawStartEvent = new Cesium.Event();
  38428. this.DrawEndEvent = new Cesium.Event();
  38429. this._tooltip = createTooltip(this.viewer.container);
  38430. this._param = {
  38431. id: "DrawStraightArrow",
  38432. polygonColor: "rgba(0,255,0,0.5)",
  38433. outlineColor: "rgba(255, 255, 255, 1)",
  38434. outlineWidth: 1
  38435. };
  38436. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  38437. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  38438. }
  38439. get PincerArrow() {
  38440. return this._PincerArrowLast;
  38441. }
  38442. getData() {
  38443. return this._PincerArrowData;
  38444. }
  38445. addload(data) {
  38446. var $this = this;
  38447. if (data.length < 3) {
  38448. return;
  38449. }
  38450. var res = $this.doubleArrow(data);
  38451. var returnData = res.polygonalPoint;
  38452. var arrowEntity = $this.viewer.entities.add({
  38453. Type: "DrawPincerArrow",
  38454. Position: data,
  38455. id: data.id || $this.objId,
  38456. polygon: {
  38457. hierarchy: new $this.Cesium.PolygonHierarchy(returnData),
  38458. show: true,
  38459. fill: true,
  38460. clampToGround: true,
  38461. material: $this.polygonMaterial
  38462. }
  38463. });
  38464. return arrowEntity;
  38465. }
  38466. computePosition(data) {
  38467. let $this = this;
  38468. var lnglatArr = [];
  38469. for (var i2 = 0; i2 < data.length; i2++) {
  38470. var lnglat = $this.cartesianToLatlng(data[i2]);
  38471. lnglatArr.push(lnglat);
  38472. }
  38473. $this._PincerArrowData = lnglatArr;
  38474. var res = $this.doubleArrow(lnglatArr);
  38475. var returnData = res.polygonalPoint;
  38476. return new $this.Cesium.PolygonHierarchy(returnData);
  38477. }
  38478. startCreate(drawType) {
  38479. if (isRuntimeApp()) {
  38480. showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  38481. }
  38482. var $this = this;
  38483. this.drawType = drawType;
  38484. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  38485. this.handler.setInputAction(function(evt) {
  38486. if (isRuntimeApp()) {
  38487. var cartesian = $this.getCatesian3FromPX(evt.position);
  38488. if (!cartesian) {
  38489. return;
  38490. }
  38491. $this.createPoint(cartesian);
  38492. $this._positions.push(cartesian);
  38493. if ($this._positions.length < 3 || $this._positions.length === 4) {
  38494. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38495. }
  38496. if ($this._positions.length === 2) {
  38497. if (!$this.Cesium.defined($this._PincerArrow)) {
  38498. $this._PincerArrow = $this.createPincerArrow();
  38499. }
  38500. }
  38501. if ($this._positions.length === 3) {
  38502. $this._positions.pop();
  38503. $this._positions.push(cartesian);
  38504. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  38505. createOperationMainDom();
  38506. document.getElementById("btnDrawBackout").style.display = "none";
  38507. document.getElementById("btnDrawComplete").onclick = () => {
  38508. $this._PincerArrowData = $this._positions.concat();
  38509. $this.viewer.entities.remove($this._PincerArrow);
  38510. $this._PincerArrow = null;
  38511. $this._positions = [];
  38512. var lnglatArr = [];
  38513. for (var i2 = 0; i2 < $this._PincerArrowData.length; i2++) {
  38514. var lnglat = $this.cartesianToLatlng($this._PincerArrowData[i2]);
  38515. lnglatArr.push(lnglat);
  38516. }
  38517. $this._PincerArrowData = lnglatArr;
  38518. var pincerArrow = $this.addload(lnglatArr);
  38519. $this._entities_PincerArrow.push(pincerArrow);
  38520. $this._PincerArrowLast = pincerArrow;
  38521. $this.clearPoint();
  38522. $this.destroy();
  38523. let buttonDiv = document.getElementById("drawButtonDiv");
  38524. if (buttonDiv) {
  38525. document.body.removeChild(buttonDiv);
  38526. }
  38527. };
  38528. }
  38529. if ($this._positions.length === 5) {
  38530. showTooltipMessage("\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  38531. $this.destroy();
  38532. }
  38533. } else {
  38534. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u5355\u51FB");
  38535. clearTimeout($this._timer);
  38536. $this._timer = setTimeout(function() {
  38537. var cartesian2 = $this.getCatesian3FromPX(evt.position);
  38538. if (!cartesian2) {
  38539. return;
  38540. }
  38541. if ($this._positions.length == 0) {
  38542. $this.floatingPoint = $this.createPoint(cartesian2);
  38543. }
  38544. if ($this._positions.length < 5) {
  38545. $this._positions.push(cartesian2);
  38546. $this.createPoint(cartesian2);
  38547. }
  38548. if ($this._positions.length == 5) {
  38549. $this._positions[4] = cartesian2;
  38550. $this.floatingPoint.position.setValue(cartesian2);
  38551. }
  38552. }, 200);
  38553. }
  38554. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  38555. this.handler.setInputAction(function(evt) {
  38556. if (isRuntimeApp())
  38557. return;
  38558. if ($this._positions.length == 0) {
  38559. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  38560. } else {
  38561. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38562. }
  38563. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  38564. if (!cartesian)
  38565. return;
  38566. if ($this._positions.length < 2)
  38567. return;
  38568. if (!$this.Cesium.defined($this._PincerArrow)) {
  38569. if ($this._positions.length == 2) {
  38570. $this._positions.push(cartesian);
  38571. }
  38572. $this._PincerArrow = $this.createPincerArrow();
  38573. }
  38574. $this.floatingPoint.position.setValue(cartesian);
  38575. if ($this._positions.length == 3) {
  38576. $this._positions[2] = cartesian;
  38577. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  38578. }
  38579. if ($this._positions.length > 3) {
  38580. $this._positions.pop();
  38581. $this._positions.push(cartesian);
  38582. if ($this._positions === 4) {
  38583. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38584. }
  38585. if ($this._positions.length == 5) {
  38586. $this._tooltip.showAt(evt.endPosition, "\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  38587. }
  38588. }
  38589. console.log($this._positions.length);
  38590. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  38591. this.handler.setInputAction(function(evt) {
  38592. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  38593. this.handler.setInputAction(function(evt) {
  38594. if (isRuntimeApp())
  38595. return;
  38596. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u53CC\u51FB");
  38597. clearTimeout($this._timer);
  38598. if (!$this._PincerArrow) {
  38599. return;
  38600. }
  38601. var cartesian = $this.getCatesian3FromPX(evt.position);
  38602. if (!cartesian)
  38603. return;
  38604. $this._positions.pop();
  38605. $this._PincerArrowData = $this._positions.concat();
  38606. $this.viewer.entities.remove($this._PincerArrow);
  38607. $this._PincerArrow = null;
  38608. $this._positions = [];
  38609. $this.floatingPoint.position.setValue(cartesian);
  38610. var lnglatArr = [];
  38611. for (var i2 = 0; i2 < $this._PincerArrowData.length; i2++) {
  38612. var lnglat = $this.cartesianToLatlng($this._PincerArrowData[i2]);
  38613. lnglatArr.push(lnglat);
  38614. }
  38615. $this._PincerArrowData = lnglatArr;
  38616. var pincerArrow = $this.addload(lnglatArr);
  38617. $this._entities_PincerArrow.push(pincerArrow);
  38618. $this._PincerArrowLast = pincerArrow;
  38619. $this.clearPoint();
  38620. $this.destroy();
  38621. $this._tooltip.setVisible(false);
  38622. }, $this.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  38623. }
  38624. createPincerArrow() {
  38625. var $this = this;
  38626. $this._computeTempPositions();
  38627. var arrowEntity = $this.viewer.entities.add({
  38628. polygon: {
  38629. hierarchy: new $this.Cesium.CallbackProperty(
  38630. function() {
  38631. var lnglatArr = [];
  38632. for (var i2 = 0; i2 < $this._positions.length; i2++) {
  38633. var lnglat = $this.cartesianToLatlng($this._positions[i2]);
  38634. lnglatArr.push(lnglat);
  38635. }
  38636. var res = $this.doubleArrow(lnglatArr);
  38637. var returnData = res.polygonalPoint;
  38638. return new $this.Cesium.PolygonHierarchy(returnData);
  38639. },
  38640. false
  38641. ),
  38642. show: true,
  38643. fill: true,
  38644. clampToGround: true,
  38645. material: $this.polygonMaterial
  38646. }
  38647. });
  38648. $this._entities_PincerArrow.push(arrowEntity);
  38649. return arrowEntity;
  38650. }
  38651. createPoint(cartesian) {
  38652. var $this = this;
  38653. var point2 = this.viewer.entities.add({
  38654. position: cartesian,
  38655. point: {
  38656. pixelSize: 10,
  38657. color: $this.Cesium.Color.RED,
  38658. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  38659. }
  38660. });
  38661. $this._entities_point.push(point2);
  38662. return point2;
  38663. }
  38664. cartesianToLatlng(cartesian) {
  38665. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  38666. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  38667. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  38668. let alt = cartographic.height;
  38669. return [lng, lat, alt];
  38670. }
  38671. destroy() {
  38672. if (this.handler) {
  38673. this.handler.destroy();
  38674. this.handler = null;
  38675. }
  38676. }
  38677. clearPoint() {
  38678. this.DrawEndEvent.raiseEvent(this._PincerArrowLast, this._PincerArrowData, this.drawType);
  38679. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  38680. this.viewer.entities.remove(this._entities_point[i2]);
  38681. }
  38682. this._entities_point = [];
  38683. }
  38684. clear() {
  38685. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  38686. this.viewer.entities.remove(this._entities_point[i2]);
  38687. }
  38688. for (var i2 = 0; i2 < this._entities_PincerArrow.length; i2++) {
  38689. this.viewer.entities.remove(this._entities_PincerArrow[i2]);
  38690. }
  38691. this.floatingPoint = null;
  38692. this._PincerArrow = null;
  38693. this._PincerArrowLast = null;
  38694. this._positions = [];
  38695. this._entities_point = [];
  38696. this._entities_PincerArrow = [];
  38697. this._PincerArrowData = null;
  38698. }
  38699. getCatesian3FromPX(px) {
  38700. var cartesian;
  38701. var ray = this.viewer.camera.getPickRay(px);
  38702. if (!ray)
  38703. return null;
  38704. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  38705. return cartesian;
  38706. }
  38707. _computeTempPositions() {
  38708. var _this = this;
  38709. var pnts = [].concat(_this._positions);
  38710. var num = pnts.length;
  38711. var first = pnts[0];
  38712. var last = pnts[num - 1];
  38713. if (_this._isSimpleXYZ(first, last) == false) {
  38714. pnts.push(first);
  38715. num += 1;
  38716. }
  38717. _this.tempPositions = [];
  38718. for (var i2 = 1; i2 < num; i2++) {
  38719. var p1 = pnts[i2 - 1];
  38720. var p2 = pnts[i2];
  38721. var cp = _this._computeCenterPotition(p1, p2);
  38722. _this.tempPositions.push(p1);
  38723. _this.tempPositions.push(cp);
  38724. }
  38725. }
  38726. _isSimpleXYZ(p1, p2) {
  38727. if (p1.x == p2.x && p1.y == p2.y && p1.z == p2.z) {
  38728. return true;
  38729. }
  38730. return false;
  38731. }
  38732. _computeCenterPotition(p1, p2) {
  38733. var _this = this;
  38734. var c1 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p1);
  38735. var c2 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p2);
  38736. var cm = new _this.Cesium.EllipsoidGeodesic(c1, c2).interpolateUsingFraction(0.5);
  38737. var cp = _this.viewer.scene.globe.ellipsoid.cartographicToCartesian(cm);
  38738. return cp;
  38739. }
  38740. doubleArrow(inputPoint) {
  38741. var $this = this;
  38742. this.connPoint = null;
  38743. this.tempPoint4 = null;
  38744. this.points = inputPoint;
  38745. var result = {
  38746. controlPoint: null,
  38747. polygonalPoint: null
  38748. };
  38749. var t2 = inputPoint.length;
  38750. if (!(2 > t2)) {
  38751. if (2 == t2)
  38752. return inputPoint;
  38753. var o = this.points[0], e = this.points[1], r2 = this.points[2], t2 = inputPoint.length;
  38754. 3 == t2 ? this.tempPoint4 = $this.getTempPoint4(o, e, r2) : this.tempPoint4 = this.points[3], 3 == t2 || 4 == t2 ? this.connPoint = $this.mid(o, e) : this.connPoint = this.points[4];
  38755. var n, g;
  38756. $this.isClockWise(o, e, r2) ? (n = $this.getArrowPoints(o, this.connPoint, this.tempPoint4, false), g = $this.getArrowPoints(this.connPoint, e, r2, true)) : (n = $this.getArrowPoints(e, this.connPoint, r2, false), g = $this.getArrowPoints(this.connPoint, o, this.tempPoint4, true));
  38757. var i2 = n.length, s = (i2 - 5) / 2, a = n.slice(0, s), l = n.slice(s, s + 5), u = n.slice(s + 5, i2), c = g.slice(0, s), p = g.slice(s, s + 5), h2 = g.slice(s + 5, i2);
  38758. c = $this.getBezierPoints(c);
  38759. var d2 = $this.getBezierPoints(h2.concat(a.slice(1)));
  38760. u = $this.getBezierPoints(u);
  38761. var f = c.concat(p, d2, l, u);
  38762. var newArray = $this.array2Dto1D(f);
  38763. result.controlPoint = [o, e, r2, this.tempPoint4, this.connPoint];
  38764. result.polygonalPoint = $this.Cesium.Cartesian3.fromDegreesArray(newArray);
  38765. }
  38766. return result;
  38767. }
  38768. getTempPoint4(t2, o, e) {
  38769. var $this = this;
  38770. var r2, n, g, i2, s = $this.mid(t2, o), a = $this.distance(s, e), l = $this.getAngleOfThreePoints(t2, s, e);
  38771. return l < Math.PI / 2 ? (n = a * Math.sin(l), g = a * Math.cos(l), i2 = $this.getThirdPoint(t2, s, Math.PI / 2, n, false), r2 = $this.getThirdPoint(s, i2, Math.PI / 2, g, true)) : l >= Math.PI / 2 && l < Math.PI ? (n = a * Math.sin(Math.PI - l), g = a * Math.cos(Math.PI - l), i2 = $this.getThirdPoint(t2, s, Math.PI / 2, n, false), r2 = $this.getThirdPoint(s, i2, Math.PI / 2, g, false)) : l >= Math.PI && l < 1.5 * Math.PI ? (n = a * Math.sin(l - Math.PI), g = a * Math.cos(l - Math.PI), i2 = $this.getThirdPoint(t2, s, Math.PI / 2, n, true), r2 = $this.getThirdPoint(s, i2, Math.PI / 2, g, true)) : (n = a * Math.sin(2 * Math.PI - l), g = a * Math.cos(2 * Math.PI - l), i2 = $this.getThirdPoint(t2, s, Math.PI / 2, n, true), r2 = $this.getThirdPoint(s, i2, Math.PI / 2, g, false)), r2;
  38772. }
  38773. mid(t2, o) {
  38774. return [(t2[0] + o[0]) / 2, (t2[1] + o[1]) / 2];
  38775. }
  38776. isClockWise(t2, o, e) {
  38777. return (e[1] - t2[1]) * (o[0] - t2[0]) > (o[1] - t2[1]) * (e[0] - t2[0]);
  38778. }
  38779. getArrowPoints(t2, o, e, r2) {
  38780. var $this = this;
  38781. var doubleArrowDefualParam = {
  38782. type: "doublearrow",
  38783. headHeightFactor: 0.25,
  38784. headWidthFactor: 0.3,
  38785. neckHeightFactor: 0.85,
  38786. fixPointCount: 4,
  38787. neckWidthFactor: 0.15
  38788. };
  38789. this.type = doubleArrowDefualParam.type, this.headHeightFactor = doubleArrowDefualParam.headHeightFactor, this.headWidthFactor = doubleArrowDefualParam.headWidthFactor, this.neckHeightFactor = doubleArrowDefualParam.neckHeightFactor, this.neckWidthFactor = doubleArrowDefualParam.neckWidthFactor;
  38790. var n = $this.mid(t2, o), g = $this.distance(n, e), i2 = $this.getThirdPoint(e, n, 0, 0.3 * g, true), s = $this.getThirdPoint(e, n, 0, 0.5 * g, true);
  38791. i2 = $this.getThirdPoint(n, i2, Math.PI / 2, g / 5, r2), s = $this.getThirdPoint(n, s, Math.PI / 2, g / 4, r2);
  38792. var a = [n, i2, s, e], l = $this.getArrowHeadPoints(a, this.headHeightFactor, this.headWidthFactor, this.neckHeightFactor, this.neckWidthFactor), u = l[0], c = l[4], p = $this.distance(t2, o) / $this.getBaseLength(a) / 2, h2 = $this.getArrowBodyPoints(a, u, c, p), d2 = h2.length, f = h2.slice(0, d2 / 2), E2 = h2.slice(d2 / 2, d2);
  38793. return f.push(u), E2.push(c), f = f.reverse(), f.push(o), E2 = E2.reverse(), E2.push(t2), f.reverse().concat(l, E2);
  38794. }
  38795. getArrowHeadPoints(t2, o, e) {
  38796. var $this = this;
  38797. var doubleArrowDefualParam = {
  38798. type: "doublearrow",
  38799. headHeightFactor: 0.25,
  38800. headWidthFactor: 0.3,
  38801. neckHeightFactor: 0.85,
  38802. fixPointCount: 4,
  38803. neckWidthFactor: 0.15
  38804. };
  38805. this.type = doubleArrowDefualParam.type, this.headHeightFactor = doubleArrowDefualParam.headHeightFactor, this.headWidthFactor = doubleArrowDefualParam.headWidthFactor, this.neckHeightFactor = doubleArrowDefualParam.neckHeightFactor, this.neckWidthFactor = doubleArrowDefualParam.neckWidthFactor;
  38806. var r2 = $this.getBaseLength(t2), n = r2 * this.headHeightFactor, g = t2[t2.length - 1], i2 = ($this.distance(o, e), n * this.headWidthFactor), s = n * this.neckWidthFactor, a = n * this.neckHeightFactor, l = $this.getThirdPoint(t2[t2.length - 2], g, 0, n, true), u = $this.getThirdPoint(t2[t2.length - 2], g, 0, a, true), c = $this.getThirdPoint(g, l, Math.PI / 2, i2, false), p = $this.getThirdPoint(g, l, Math.PI / 2, i2, true), h2 = $this.getThirdPoint(g, u, Math.PI / 2, s, false), d2 = $this.getThirdPoint(g, u, Math.PI / 2, s, true);
  38807. return [h2, c, g, p, d2];
  38808. }
  38809. getArrowBodyPoints(t2, o, e, r2) {
  38810. var $this = this;
  38811. for (var n = $this.wholeDistance(t2), g = $this.getBaseLength(t2), i2 = g * r2, s = $this.distance(o, e), a = (i2 - s) / 2, l = 0, u = [], c = [], p = 1; p < t2.length - 1; p++) {
  38812. var h2 = $this.getAngleOfThreePoints(t2[p - 1], t2[p], t2[p + 1]) / 2;
  38813. l += $this.distance(t2[p - 1], t2[p]);
  38814. var d2 = (i2 / 2 - l / n * a) / Math.sin(h2), f = $this.getThirdPoint(t2[p - 1], t2[p], Math.PI - h2, d2, true), E2 = $this.getThirdPoint(t2[p - 1], t2[p], h2, d2, false);
  38815. u.push(f), c.push(E2);
  38816. }
  38817. return u.concat(c);
  38818. }
  38819. getBezierPoints(t2) {
  38820. if (t2.length <= 2)
  38821. return t2;
  38822. for (var o = [], e = t2.length - 1, r2 = 0; 1 >= r2; r2 += 0.01) {
  38823. for (var n = 0, y = 0, g = 0; e >= g; g++) {
  38824. var i2 = this.getBinomialFactor(e, g), s = Math.pow(r2, g), a = Math.pow(1 - r2, e - g);
  38825. n += i2 * s * a * t2[g][0], y += i2 * s * a * t2[g][1];
  38826. }
  38827. o.push([n, y]);
  38828. }
  38829. return o.push(t2[e]), o;
  38830. }
  38831. getBaseLength(t2) {
  38832. return Math.pow(this.wholeDistance(t2), 0.99);
  38833. }
  38834. wholeDistance(t2) {
  38835. for (var o = 0, e = 0; e < t2.length - 1; e++)
  38836. o += this.distance(t2[e], t2[e + 1]);
  38837. return o;
  38838. }
  38839. getBinomialFactor(t2, o) {
  38840. return this.getFactorial(t2) / (this.getFactorial(o) * this.getFactorial(t2 - o));
  38841. }
  38842. getFactorial(t2) {
  38843. if (1 >= t2)
  38844. return 1;
  38845. if (2 == t2)
  38846. return 2;
  38847. if (3 == t2)
  38848. return 6;
  38849. if (4 == t2)
  38850. return 24;
  38851. if (5 == t2)
  38852. return 120;
  38853. for (var o = 1, e = 1; t2 >= e; e++)
  38854. o *= e;
  38855. return o;
  38856. }
  38857. array2Dto1D(array) {
  38858. var newArray = [];
  38859. array.forEach(function(elt) {
  38860. newArray.push(elt[0]);
  38861. newArray.push(elt[1]);
  38862. });
  38863. return newArray;
  38864. }
  38865. distance(t2, o) {
  38866. return Math.sqrt(Math.pow(t2[0] - o[0], 2) + Math.pow(t2[1] - o[1], 2));
  38867. }
  38868. getAngleOfThreePoints(t2, o, e) {
  38869. var r2 = this.getAzimuth(o, t2) - this.getAzimuth(o, e);
  38870. return 0 > r2 ? r2 + 2 * Math.PI : r2;
  38871. }
  38872. getAzimuth(t2, o) {
  38873. var e, r2 = Math.asin(Math.abs(o[1] - t2[1]) / this.distance(t2, o));
  38874. return o[1] >= t2[1] && o[0] >= t2[0] ? e = r2 + Math.PI : o[1] >= t2[1] && o[0] < t2[0] ? e = 2 * Math.PI - r2 : o[1] < t2[1] && o[0] < t2[0] ? e = r2 : o[1] < t2[1] && o[0] >= t2[0] && (e = Math.PI - r2), e;
  38875. }
  38876. getThirdPoint(t2, o, e, r2, n) {
  38877. var g = this.getAzimuth(t2, o), i2 = n ? g + e : g - e, s = r2 * Math.cos(i2), a = r2 * Math.sin(i2);
  38878. return [o[0] + s, o[1] + a];
  38879. }
  38880. }
  38881. class DrawGatheringPlace {
  38882. constructor(arg) {
  38883. this.viewer = arg.viewer;
  38884. this.Cesium = arg.Cesium;
  38885. this.tt = 0.4;
  38886. this.floatingPoint = null;
  38887. this.drawHandler = null;
  38888. this.gatheringPlace = null;
  38889. this._gatheringPlaceLast = null;
  38890. this._positions = [];
  38891. this._entities_point = [];
  38892. this._entities_PincerArrow = [];
  38893. this._gatheringPlaceData = null;
  38894. this.DrawStartEvent = new Cesium.Event();
  38895. this.DrawEndEvent = new Cesium.Event();
  38896. this._tooltip = createTooltip(this.viewer.container);
  38897. this._param = {
  38898. id: "DrawStraightArrow",
  38899. polygonColor: "rgba(0,255,0,0.5)",
  38900. outlineColor: "rgba(255, 255, 255, 1)",
  38901. outlineWidth: 1
  38902. };
  38903. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  38904. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  38905. }
  38906. get PincerArrow() {
  38907. return this._gatheringPlaceLast;
  38908. }
  38909. getData() {
  38910. return this._gatheringPlaceData;
  38911. }
  38912. computePosition(data) {
  38913. var $this = this;
  38914. if (data.length < 3) {
  38915. return;
  38916. }
  38917. var gatheringPlace = [];
  38918. var lonLats = [];
  38919. var res = $this.fineGatheringPlace(data);
  38920. for (var i2 = 0; i2 < res.length; i2++) {
  38921. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  38922. gatheringPlace.push(cart3);
  38923. }
  38924. for (let q2 = 0; q2 < data.length; q2++) {
  38925. lonLats.push($this.cartesianToLatlng(data[q2]));
  38926. }
  38927. this._gatheringPlaceData = lonLats;
  38928. return new $this.Cesium.PolygonHierarchy(gatheringPlace);
  38929. }
  38930. addload(data) {
  38931. var $this = this;
  38932. if (data.length < 3) {
  38933. return;
  38934. }
  38935. var gatheringPlace = [];
  38936. var lnglatArr = [];
  38937. for (var i2 = 0; i2 < data.length; i2++) {
  38938. var lnglat = $this.LatlngTocartesian(data[i2]);
  38939. lnglatArr.push(lnglat);
  38940. }
  38941. var res = $this.fineGatheringPlace(lnglatArr);
  38942. for (var i2 = 0; i2 < res.length; i2++) {
  38943. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  38944. gatheringPlace.push(cart3);
  38945. }
  38946. var pHierarchy = new $this.Cesium.PolygonHierarchy(gatheringPlace);
  38947. var arrowEntity = $this.viewer.entities.add({
  38948. Type: "DrawGatheringPlace",
  38949. Position: data,
  38950. id: data.id || $this.objId,
  38951. polygon: {
  38952. hierarchy: pHierarchy,
  38953. show: true,
  38954. fill: true,
  38955. clampToGround: true,
  38956. material: $this.polygonMaterial
  38957. }
  38958. });
  38959. return arrowEntity;
  38960. }
  38961. startCreate(drawType) {
  38962. if (isRuntimeApp()) {
  38963. showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  38964. }
  38965. var $this = this;
  38966. this.drawType = drawType;
  38967. this.handler = new $this.Cesium.ScreenSpaceEventHandler($this.viewer.scene.canvas);
  38968. this.handler.setInputAction(function(event2) {
  38969. if (isRuntimeApp()) {
  38970. var cartesian = $this.getCatesian3FromPX(event2.position);
  38971. if (!cartesian) {
  38972. return;
  38973. }
  38974. $this.createPoint(cartesian);
  38975. $this._positions.push(cartesian);
  38976. if ($this._positions.length < 3) {
  38977. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9");
  38978. }
  38979. if ($this._positions.length === 3) {
  38980. showTooltipMessage("\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  38981. $this.destroy();
  38982. if (!$this.Cesium.defined($this.gatheringPlace)) {
  38983. $this.gatheringPlace = $this.createGatheringPlace();
  38984. createOperationMainDom();
  38985. document.getElementById("btnDrawBackout").style.display = "none";
  38986. document.getElementById("btnDrawComplete").onclick = () => {
  38987. $this._gatheringPlaceData = $this._positions.concat();
  38988. $this.viewer.entities.remove($this.gatheringPlace);
  38989. $this.gatheringPlace = null;
  38990. var lnglatArr = [];
  38991. for (var i2 = 0; i2 < $this._gatheringPlaceData.length; i2++) {
  38992. var lnglat = $this.cartesianToLatlng($this._gatheringPlaceData[i2]);
  38993. lnglatArr.push(lnglat);
  38994. }
  38995. $this._gatheringPlaceData = lnglatArr;
  38996. var pincerArrow = $this.addload(lnglatArr);
  38997. $this._entities_PincerArrow.push(pincerArrow);
  38998. $this._gatheringPlaceLast = pincerArrow;
  38999. $this.viewer.entities.remove($this.floatingPoint);
  39000. $this.floatingPoint = null;
  39001. $this.clearPoint();
  39002. $this.destroy();
  39003. let buttonDiv = document.getElementById("drawButtonDiv");
  39004. if (buttonDiv) {
  39005. document.body.removeChild(buttonDiv);
  39006. }
  39007. };
  39008. }
  39009. }
  39010. } else {
  39011. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u5355\u51FB");
  39012. clearTimeout($this._timer);
  39013. $this._timer = setTimeout(function() {
  39014. var position2 = event2.position;
  39015. if (!$this.Cesium.defined(position2)) {
  39016. return;
  39017. }
  39018. var ray = $this.viewer.camera.getPickRay(position2);
  39019. if (!$this.Cesium.defined(ray)) {
  39020. return;
  39021. }
  39022. var cartesian2 = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  39023. if (!$this.Cesium.defined(cartesian2)) {
  39024. return;
  39025. }
  39026. if ($this._positions.length == 0) {
  39027. $this._positions.push(cartesian2.clone());
  39028. $this.floatingPoint = $this.createPoint(cartesian2);
  39029. }
  39030. if ($this._positions.length <= 2) {
  39031. $this.createPoint(cartesian2);
  39032. $this._positions.push(cartesian2);
  39033. }
  39034. }, 200);
  39035. }
  39036. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  39037. this.handler.setInputAction(function(event2) {
  39038. if (isRuntimeApp())
  39039. return;
  39040. if ($this._positions.length == 0) {
  39041. $this._tooltip.showAt(event2.endPosition, "\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  39042. } else {
  39043. $this._tooltip.showAt(event2.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9");
  39044. }
  39045. if ($this._positions.length < 2) {
  39046. return;
  39047. }
  39048. if ($this._positions.length == 3) {
  39049. $this._tooltip.showAt(event2.endPosition, "\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  39050. }
  39051. var position2 = event2.endPosition;
  39052. if (!$this.Cesium.defined(position2)) {
  39053. return;
  39054. }
  39055. var ray = $this.viewer.camera.getPickRay(position2);
  39056. if (!$this.Cesium.defined(ray)) {
  39057. return;
  39058. }
  39059. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  39060. if (!$this.Cesium.defined(cartesian)) {
  39061. return;
  39062. }
  39063. if (!$this.Cesium.defined($this.gatheringPlace)) {
  39064. $this.gatheringPlace = $this.createGatheringPlace();
  39065. }
  39066. $this.floatingPoint.position.setValue(cartesian);
  39067. if ($this.gatheringPlace) {
  39068. if ($this._positions.length == 3) {
  39069. $this._positions[1] = cartesian;
  39070. } else {
  39071. $this._positions.pop();
  39072. $this._positions.push(cartesian);
  39073. }
  39074. }
  39075. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  39076. this.handler.setInputAction(function(movement) {
  39077. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  39078. this.handler.setInputAction(function(movement) {
  39079. if (isRuntimeApp())
  39080. return;
  39081. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u53CC\u51FB");
  39082. clearTimeout($this._timer);
  39083. if ($this._positions.length >= 3) {
  39084. $this._gatheringPlaceData = $this._positions.concat();
  39085. $this.viewer.entities.remove($this.gatheringPlace);
  39086. $this.gatheringPlace = null;
  39087. var lnglatArr = [];
  39088. for (var i2 = 0; i2 < $this._gatheringPlaceData.length; i2++) {
  39089. var lnglat = $this.cartesianToLatlng($this._gatheringPlaceData[i2]);
  39090. lnglatArr.push(lnglat);
  39091. }
  39092. $this._gatheringPlaceData = lnglatArr;
  39093. var pincerArrow = $this.addload(lnglatArr);
  39094. $this._entities_PincerArrow.push(pincerArrow);
  39095. $this._gatheringPlaceLast = pincerArrow;
  39096. $this.viewer.entities.remove($this.floatingPoint);
  39097. $this.floatingPoint = null;
  39098. $this.clearPoint();
  39099. $this.destroy();
  39100. $this._tooltip.setVisible(false);
  39101. }
  39102. }, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  39103. }
  39104. createGatheringPlace() {
  39105. let $this = this;
  39106. var gatheringPlaceEntity = $this.viewer.entities.add({
  39107. polygon: {
  39108. hierarchy: new $this.Cesium.CallbackProperty(function() {
  39109. if ($this._positions.length < 3) {
  39110. return;
  39111. }
  39112. var gatheringPlace = [];
  39113. var res = $this.fineGatheringPlace($this._positions);
  39114. for (var i2 = 0; i2 < res.length; i2++) {
  39115. var cart3 = new $this.Cesium.Cartesian3(res[i2].x, res[i2].y, res[i2].z);
  39116. gatheringPlace.push(cart3);
  39117. }
  39118. var pHierarchy = new $this.Cesium.PolygonHierarchy(gatheringPlace);
  39119. var lonLats = $this.cartesianToLatlng($this._positions);
  39120. pHierarchy.keyPoints = lonLats;
  39121. return pHierarchy;
  39122. }, false),
  39123. show: true,
  39124. fill: true,
  39125. clampToGround: true,
  39126. material: $this.polygonMaterial
  39127. }
  39128. });
  39129. $this._entities_PincerArrow.push(gatheringPlaceEntity);
  39130. return gatheringPlaceEntity;
  39131. }
  39132. createPoint(cartesian) {
  39133. var $this = this;
  39134. var point2 = this.viewer.entities.add({
  39135. position: cartesian,
  39136. point: {
  39137. pixelSize: 10,
  39138. color: $this.Cesium.Color.RED,
  39139. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  39140. }
  39141. });
  39142. $this._entities_point.push(point2);
  39143. return point2;
  39144. }
  39145. cartesianToLatlng(cartesian) {
  39146. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  39147. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  39148. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  39149. let alt = cartographic.height;
  39150. return [lng, lat, alt];
  39151. }
  39152. destroy() {
  39153. if (this.handler) {
  39154. this.handler.destroy();
  39155. this.handler = null;
  39156. }
  39157. }
  39158. clearPoint() {
  39159. this.DrawEndEvent.raiseEvent(this._gatheringPlaceLast, this._gatheringPlaceData, this.drawType);
  39160. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  39161. this.viewer.entities.remove(this._entities_point[i2]);
  39162. }
  39163. this._entities_point = [];
  39164. }
  39165. clear() {
  39166. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  39167. this.viewer.entities.remove(this._entities_point[i2]);
  39168. }
  39169. for (var i2 = 0; i2 < this._entities_PincerArrow.length; i2++) {
  39170. this.viewer.entities.remove(this._entities_PincerArrow[i2]);
  39171. }
  39172. this.floatingPoint = null;
  39173. this._PincerArrow = null;
  39174. this._PincerArrowLast = null;
  39175. this._positions = [];
  39176. this._entities_point = [];
  39177. this._entities_PincerArrow = [];
  39178. this._PincerArrowData = null;
  39179. }
  39180. getCatesian3FromPX(px) {
  39181. var cartesian;
  39182. var ray = this.viewer.camera.getPickRay(px);
  39183. if (!ray)
  39184. return null;
  39185. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  39186. return cartesian;
  39187. }
  39188. _computeTempPositions() {
  39189. var _this = this;
  39190. var pnts = [].concat(_this._positions);
  39191. var num = pnts.length;
  39192. var first = pnts[0];
  39193. var last = pnts[num - 1];
  39194. if (_this._isSimpleXYZ(first, last) == false) {
  39195. pnts.push(first);
  39196. num += 1;
  39197. }
  39198. _this.tempPositions = [];
  39199. for (var i2 = 1; i2 < num; i2++) {
  39200. var p1 = pnts[i2 - 1];
  39201. var p2 = pnts[i2];
  39202. var cp = _this._computeCenterPotition(p1, p2);
  39203. _this.tempPositions.push(p1);
  39204. _this.tempPositions.push(cp);
  39205. }
  39206. }
  39207. _isSimpleXYZ(p1, p2) {
  39208. if (p1.x == p2.x && p1.y == p2.y && p1.z == p2.z) {
  39209. return true;
  39210. }
  39211. return false;
  39212. }
  39213. _computeCenterPotition(p1, p2) {
  39214. var _this = this;
  39215. var c1 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p1);
  39216. var c2 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p2);
  39217. var cm = new _this.Cesium.EllipsoidGeodesic(c1, c2).interpolateUsingFraction(0.5);
  39218. var cp = _this.viewer.scene.globe.ellipsoid.cartographicToCartesian(cm);
  39219. return cp;
  39220. }
  39221. getLonLat(cartesian) {
  39222. var cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  39223. cartographic.height = this.viewer.scene.globe.getHeight(cartographic);
  39224. var pos = {
  39225. lon: cartographic.longitude,
  39226. lat: cartographic.latitude,
  39227. alt: cartographic.height
  39228. };
  39229. pos.lon = this.Cesium.Math.toDegrees(pos.lon);
  39230. pos.lat = this.Cesium.Math.toDegrees(pos.lat);
  39231. return pos;
  39232. }
  39233. LatlngTocartesian(latlng) {
  39234. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  39235. return cartesian3;
  39236. }
  39237. fineGatheringPlace(gatherPosition) {
  39238. let $this = this;
  39239. let points2 = gatherPosition.length;
  39240. if (points2 < 2) {
  39241. return false;
  39242. } else {
  39243. let pnts = new Array();
  39244. gatherPosition.forEach(function(item) {
  39245. var posLonLat = $this.getLonLat(item);
  39246. pnts.push([posLonLat.lon, posLonLat.lat]);
  39247. });
  39248. if (pnts.length === 2) {
  39249. let mid2 = $this.mid(pnts[0], pnts[1]);
  39250. let d2 = $this.distance(pnts[0], mid2) / 0.9;
  39251. let pnt = $this.getThirdPoint(pnts[0], mid2, Math.PI / 2, d2, true);
  39252. pnts = [pnts[0], pnt, pnts[1]];
  39253. }
  39254. let mid = $this.mid(pnts[0], pnts[2]);
  39255. pnts.push(mid, pnts[0], pnts[1]);
  39256. let [normals, pnt1, pnt2, pnt3, pList] = [
  39257. [],
  39258. void 0,
  39259. void 0,
  39260. void 0,
  39261. []
  39262. ];
  39263. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39264. pnt1 = pnts[i2];
  39265. pnt2 = pnts[i2 + 1];
  39266. pnt3 = pnts[i2 + 2];
  39267. let normalPoints = $this.getBisectorNormals($this.tt, pnt1, pnt2, pnt3);
  39268. normals = normals.concat(normalPoints);
  39269. }
  39270. let count = normals.length;
  39271. normals = [normals[count - 1]].concat(normals.slice(0, count - 1));
  39272. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39273. pnt1 = pnts[i2];
  39274. pnt2 = pnts[i2 + 1];
  39275. pList = pList.concat(pnt1);
  39276. for (let t2 = 0; t2 <= 100; t2++) {
  39277. let pnt = $this.getCubicValue(t2 / 100, pnt1, normals[i2 * 2], normals[i2 * 2 + 1], pnt2);
  39278. pList = pList.concat(pnt);
  39279. }
  39280. pList = pList.concat(pnt2);
  39281. }
  39282. return Cesium.Cartesian3.fromDegreesArray(pList);
  39283. }
  39284. }
  39285. mid(t2, o) {
  39286. return [(t2[0] + o[0]) / 2, (t2[1] + o[1]) / 2];
  39287. }
  39288. distance(t2, o) {
  39289. return Math.sqrt(Math.pow(t2[0] - o[0], 2) + Math.pow(t2[1] - o[1], 2));
  39290. }
  39291. getThirdPoint(t2, o, e, r2, n) {
  39292. var g = this.getAzimuth(t2, o), i2 = n ? g + e : g - e, s = r2 * Math.cos(i2), a = r2 * Math.sin(i2);
  39293. return [o[0] + s, o[1] + a];
  39294. }
  39295. getAzimuth(t2, o) {
  39296. var e, r2 = Math.asin(Math.abs(o[1] - t2[1]) / this.distance(t2, o));
  39297. return o[1] >= t2[1] && o[0] >= t2[0] ? e = r2 + Math.PI : o[1] >= t2[1] && o[0] < t2[0] ? e = 2 * Math.PI - r2 : o[1] < t2[1] && o[0] < t2[0] ? e = r2 : o[1] < t2[1] && o[0] >= t2[0] && (e = Math.PI - r2), e;
  39298. }
  39299. getBisectorNormals(t2, o, e, r2) {
  39300. var n = this.getNormal(o, e, r2), g = Math.sqrt(n[0] * n[0] + n[1] * n[1]), i2 = n[0] / g, s = n[1] / g, a = this.distance(o, e), l = this.distance(e, r2);
  39301. if (g > 1e-4)
  39302. if (this.isClockWise(o, e, r2)) {
  39303. var u = t2 * a, c = e[0] - u * s, p = e[1] + u * i2, h2 = [c, p];
  39304. u = t2 * l, c = e[0] + u * s, p = e[1] - u * i2;
  39305. var d2 = [c, p];
  39306. } else
  39307. u = t2 * a, c = e[0] + u * s, p = e[1] - u * i2, h2 = [c, p], u = t2 * l, c = e[0] - u * s, p = e[1] + u * i2, d2 = [c, p];
  39308. else
  39309. c = e[0] + t2 * (o[0] - e[0]), p = e[1] + t2 * (o[1] - e[1]), h2 = [c, p], c = e[0] + t2 * (r2[0] - e[0]), p = e[1] + t2 * (r2[1] - e[1]), d2 = [c, p];
  39310. return [h2, d2];
  39311. }
  39312. getNormal(t2, o, e) {
  39313. var r2 = t2[0] - o[0], n = t2[1] - o[1], g = Math.sqrt(r2 * r2 + n * n);
  39314. r2 /= g, n /= g;
  39315. var i2 = e[0] - o[0], s = e[1] - o[1], a = Math.sqrt(i2 * i2 + s * s);
  39316. i2 /= a, s /= a;
  39317. var l = r2 + i2, u = n + s;
  39318. return [l, u];
  39319. }
  39320. isClockWise(t2, o, e) {
  39321. return (e[1] - t2[1]) * (o[0] - t2[0]) > (o[1] - t2[1]) * (e[0] - t2[0]);
  39322. }
  39323. getCubicValue(t2, o, e, r2, n) {
  39324. t2 = Math.max(Math.min(t2, 1), 0);
  39325. var g = 1 - t2, i2 = t2 * t2, s = i2 * t2, a = g * g, l = a * g, u = l * o[0] + 3 * a * t2 * e[0] + 3 * g * i2 * r2[0] + s * n[0], c = l * o[1] + 3 * a * t2 * e[1] + 3 * g * i2 * r2[1] + s * n[1];
  39326. return [u, c];
  39327. }
  39328. }
  39329. class DrawClosedCurve {
  39330. constructor(arg) {
  39331. this.viewer = arg.viewer;
  39332. this.Cesium = arg.Cesium;
  39333. this.floatingPoint = null;
  39334. this._ClosedCurve = null;
  39335. this._ClosedCurveLast = null;
  39336. this._positions = [];
  39337. this._entities_point = [];
  39338. this._entities_ClosedCurve = [];
  39339. this._ClosedCurveData = null;
  39340. this.ZERO_TOLERANCE = 1e-4;
  39341. this.FITTING_COUNT = 100;
  39342. this.t = 0.3;
  39343. this.objId = Number(new Date().getTime() + "" + Number(Math.random() * 1e3).toFixed(0));
  39344. this.DrawStartEvent = new Cesium.Event();
  39345. this.DrawEndEvent = new Cesium.Event();
  39346. this._tooltip = createTooltip(this.viewer.container);
  39347. this._param = {
  39348. id: "DrawStraightArrow",
  39349. polygonColor: "rgba(0,255,0,0.5)",
  39350. outlineColor: "rgba(255, 255, 255, 1)",
  39351. outlineWidth: 1
  39352. };
  39353. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  39354. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  39355. }
  39356. get ClosedCurve() {
  39357. return this._ClosedCurveLast;
  39358. }
  39359. getData() {
  39360. return this._ClosedCurveData;
  39361. }
  39362. computePosition(data) {
  39363. let $this = this;
  39364. if (data.length < 2)
  39365. return;
  39366. let pnts = [];
  39367. for (let p = 0; p < data.length; p++) {
  39368. pnts.push($this.cartesianToLatlng(data[p]));
  39369. }
  39370. this._ClosedCurveData = Array.from(pnts);
  39371. pnts.push(pnts[0], pnts[1]);
  39372. let [normals, pList] = [
  39373. [],
  39374. []
  39375. ];
  39376. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39377. let normalPoints = $this.getBisectorNormals($this.t, pnts[i2], pnts[i2 + 1], pnts[i2 + 2]);
  39378. normals = normals.concat(normalPoints);
  39379. }
  39380. let count = normals.length;
  39381. normals = [normals[count - 1]].concat(normals.slice(0, count - 1));
  39382. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39383. let pnt1 = pnts[i2];
  39384. let pnt2 = pnts[i2 + 1];
  39385. pList.push($this.LatlngTocartesian(pnt1));
  39386. for (let t2 = 0; t2 <= $this.FITTING_COUNT; t2++) {
  39387. let pnt = $this.getCubicValue(t2 / $this.FITTING_COUNT, pnt1, normals[i2 * 2], normals[i2 * 2 + 1], pnt2);
  39388. pList.push($this.LatlngTocartesian(pnt));
  39389. }
  39390. pList.push($this.LatlngTocartesian(pnt2));
  39391. }
  39392. let PolygonHierarchy = new $this.Cesium.PolygonHierarchy(pList);
  39393. return {
  39394. PolygonHierarchy,
  39395. pList
  39396. };
  39397. }
  39398. addload(data) {
  39399. let $this = this;
  39400. if (data.length < 2)
  39401. return;
  39402. let pnts = Array.from(data);
  39403. pnts.push(pnts[0], pnts[1]);
  39404. let [normals, pList] = [
  39405. [],
  39406. []
  39407. ];
  39408. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39409. let normalPoints = $this.getBisectorNormals($this.t, pnts[i2], pnts[i2 + 1], pnts[i2 + 2]);
  39410. normals = normals.concat(normalPoints);
  39411. }
  39412. let count = normals.length;
  39413. normals = [normals[count - 1]].concat(normals.slice(0, count - 1));
  39414. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39415. let pnt1 = pnts[i2];
  39416. let pnt2 = pnts[i2 + 1];
  39417. pList.push($this.LatlngTocartesian(pnt1));
  39418. for (let t2 = 0; t2 <= $this.FITTING_COUNT; t2++) {
  39419. let pnt = $this.getCubicValue(t2 / $this.FITTING_COUNT, pnt1, normals[i2 * 2], normals[i2 * 2 + 1], pnt2);
  39420. pList.push($this.LatlngTocartesian(pnt));
  39421. }
  39422. pList.push($this.LatlngTocartesian(pnt2));
  39423. }
  39424. console.log(data, pnts);
  39425. var arrowEntity = $this.viewer.entities.add({
  39426. Type: "DrawClosedCurve",
  39427. Position: data,
  39428. id: data.id || $this.objId,
  39429. polygon: {
  39430. hierarchy: new $this.Cesium.PolygonHierarchy(pList),
  39431. show: true,
  39432. fill: true,
  39433. clampToGround: true,
  39434. material: $this.polygonMaterial
  39435. },
  39436. polyline: {
  39437. positions: pList,
  39438. show: true,
  39439. material: new Cesium.PolylineDashMaterialProperty({
  39440. color: Cesium.Color.YELLOW
  39441. }),
  39442. width: 3,
  39443. clampToGround: true
  39444. }
  39445. });
  39446. return arrowEntity;
  39447. }
  39448. startCreate(drawType) {
  39449. if (isRuntimeApp()) {
  39450. showTooltipMessage("\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  39451. }
  39452. var $this = this;
  39453. this.drawType = drawType;
  39454. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  39455. this.handler.setInputAction(function(evt) {
  39456. if (isRuntimeApp()) {
  39457. var cartesian = $this.getCatesian3FromPX(evt.position);
  39458. if (!cartesian) {
  39459. return;
  39460. }
  39461. $this.createPoint(cartesian);
  39462. $this._positions.push(cartesian);
  39463. if ($this._positions.length > 2) {
  39464. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u70B9\u51FB\u5B8C\u6210\u6309\u94AE\uFF0C\u7ED3\u675F\u7ED8\u5236");
  39465. if ($this._positions.length === 3) {
  39466. if (!$this.Cesium.defined($this._ClosedCurve)) {
  39467. $this._ClosedCurve = $this.createClosedCurve();
  39468. createOperationMainDom();
  39469. document.getElementById("btnDrawBackout").style.display = "none";
  39470. document.getElementById("btnDrawComplete").onclick = () => {
  39471. $this._ClosedCurveData = $this._positions.concat();
  39472. $this.viewer.entities.remove($this._ClosedCurve);
  39473. $this._ClosedCurve = null;
  39474. $this._positions = [];
  39475. var lnglatArr = [];
  39476. for (var i2 = 0; i2 < $this._ClosedCurveData.length; i2++) {
  39477. var lnglat = $this.cartesianToLatlng($this._ClosedCurveData[i2]);
  39478. lnglatArr.push(lnglat);
  39479. }
  39480. $this._ClosedCurveData = lnglatArr;
  39481. var ClosedCurve = $this.addload(lnglatArr);
  39482. $this._entities_ClosedCurve.push(ClosedCurve);
  39483. $this._ClosedCurveLast = ClosedCurve;
  39484. $this.clearPoint();
  39485. $this.destroy();
  39486. let buttonDiv = document.getElementById("drawButtonDiv");
  39487. if (buttonDiv) {
  39488. document.body.removeChild(buttonDiv);
  39489. }
  39490. };
  39491. }
  39492. }
  39493. } else {
  39494. showTooltipMessage("\u70B9\u51FB\u6DFB\u52A0\u70B9");
  39495. }
  39496. } else {
  39497. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u5355\u51FB");
  39498. clearTimeout($this._timer);
  39499. $this._timer = setTimeout(function() {
  39500. var cartesian2 = $this.getCatesian3FromPX(evt.position);
  39501. if ($this._positions.length == 0) {
  39502. $this.floatingPoint = $this.createPoint(cartesian2);
  39503. }
  39504. $this._positions.push(cartesian2);
  39505. $this.createPoint(cartesian2);
  39506. }, 200);
  39507. }
  39508. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  39509. this.handler.setInputAction(function(evt) {
  39510. if (isRuntimeApp())
  39511. return;
  39512. if ($this._positions.length == 0) {
  39513. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");
  39514. } else {
  39515. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9");
  39516. }
  39517. if ($this._positions.length < 2)
  39518. return;
  39519. $this._tooltip.showAt(evt.endPosition, "\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236");
  39520. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  39521. if ($this._positions.length == 2) {
  39522. $this._positions.push(cartesian);
  39523. }
  39524. $this._positions.pop();
  39525. $this._positions.push(cartesian);
  39526. if (!$this.Cesium.defined($this._ClosedCurve)) {
  39527. $this._ClosedCurve = $this.createClosedCurve();
  39528. }
  39529. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  39530. this.handler.setInputAction(function(evt) {
  39531. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  39532. this.handler.setInputAction(function(evt) {
  39533. if (isRuntimeApp())
  39534. return;
  39535. console.log("\u76D1\u542C\u9F20\u6807\u4E8B\u4EF6", "\u53CC\u51FB");
  39536. clearTimeout($this._timer);
  39537. if (!$this._ClosedCurve)
  39538. return;
  39539. var cartesian = $this.getCatesian3FromPX(evt.position);
  39540. $this._positions.pop();
  39541. $this._positions.push(cartesian);
  39542. $this._ClosedCurveData = $this._positions.concat();
  39543. $this.viewer.entities.remove($this._ClosedCurve);
  39544. $this._ClosedCurve = null;
  39545. $this._positions = [];
  39546. $this.floatingPoint.position.setValue(cartesian);
  39547. var lnglatArr = [];
  39548. for (var i2 = 0; i2 < $this._ClosedCurveData.length; i2++) {
  39549. var lnglat = $this.cartesianToLatlng($this._ClosedCurveData[i2]);
  39550. lnglatArr.push(lnglat);
  39551. }
  39552. $this._ClosedCurveData = lnglatArr;
  39553. var ClosedCurve = $this.addload(lnglatArr);
  39554. $this._entities_ClosedCurve.push(ClosedCurve);
  39555. $this._ClosedCurveLast = ClosedCurve;
  39556. $this.clearPoint();
  39557. $this.destroy();
  39558. $this._tooltip.setVisible(false);
  39559. }, $this.Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  39560. }
  39561. createClosedCurve() {
  39562. var $this = this;
  39563. $this.pLists = "";
  39564. var arrowEntity = $this.viewer.entities.add({
  39565. polygon: {
  39566. hierarchy: new $this.Cesium.CallbackProperty(
  39567. function() {
  39568. if ($this._positions.length < 2)
  39569. return;
  39570. let pnts = [];
  39571. for (let p = 0; p < $this._positions.length; p++) {
  39572. pnts.push($this.cartesianToLatlng($this._positions[p]));
  39573. }
  39574. pnts.push(pnts[0], pnts[1]);
  39575. let [normals, pList] = [
  39576. [],
  39577. []
  39578. ];
  39579. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39580. let normalPoints = $this.getBisectorNormals($this.t, pnts[i2], pnts[i2 + 1], pnts[i2 + 2]);
  39581. normals = normals.concat(normalPoints);
  39582. }
  39583. let count = normals.length;
  39584. normals = [normals[count - 1]].concat(normals.slice(0, count - 1));
  39585. for (let i2 = 0; i2 < pnts.length - 2; i2++) {
  39586. let pnt1 = pnts[i2];
  39587. let pnt2 = pnts[i2 + 1];
  39588. pList.push($this.LatlngTocartesian(pnt1));
  39589. for (let t2 = 0; t2 <= $this.FITTING_COUNT; t2++) {
  39590. let pnt = $this.getCubicValue(t2 / $this.FITTING_COUNT, pnt1, normals[i2 * 2], normals[i2 * 2 + 1], pnt2);
  39591. pList.push($this.LatlngTocartesian(pnt));
  39592. }
  39593. pList.push($this.LatlngTocartesian(pnt2));
  39594. }
  39595. $this.pLists = pList;
  39596. return new $this.Cesium.PolygonHierarchy(pList);
  39597. },
  39598. false
  39599. ),
  39600. show: true,
  39601. fill: true,
  39602. clampToGround: true,
  39603. material: $this.polygonMaterial
  39604. },
  39605. polyline: {
  39606. positions: new $this.Cesium.CallbackProperty(
  39607. function() {
  39608. return $this.pLists;
  39609. },
  39610. false
  39611. ),
  39612. show: true,
  39613. material: new Cesium.PolylineDashMaterialProperty({
  39614. color: Cesium.Color.YELLOW
  39615. }),
  39616. width: 3,
  39617. clampToGround: true
  39618. }
  39619. });
  39620. $this._entities_ClosedCurve.push(arrowEntity);
  39621. return arrowEntity;
  39622. }
  39623. createPoint(cartesian) {
  39624. var $this = this;
  39625. var point2 = this.viewer.entities.add({
  39626. position: cartesian,
  39627. point: {
  39628. pixelSize: 10,
  39629. color: $this.Cesium.Color.RED,
  39630. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  39631. }
  39632. });
  39633. $this._entities_point.push(point2);
  39634. return point2;
  39635. }
  39636. cartesianToLatlng(cartesian) {
  39637. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  39638. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  39639. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  39640. return [lng, lat];
  39641. }
  39642. LatlngTocartesian(latlng) {
  39643. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  39644. return cartesian3;
  39645. }
  39646. lonLatToMercator(Latlng) {
  39647. var E2 = Latlng[0];
  39648. var N2 = Latlng[1];
  39649. var x = E2 * 2003750834e-2 / 180;
  39650. var y = Math.log(Math.tan((90 + N2) * Math.PI / 360)) / (Math.PI / 180);
  39651. y = y * 2003750834e-2 / 180;
  39652. return [x, y];
  39653. }
  39654. WebMercator2lonLat(mercator) {
  39655. let x = mercator[0] / 2003750834e-2 * 180;
  39656. let ly = mercator[1] / 2003750834e-2 * 180;
  39657. let y = 180 / Math.PI * (2 * Math.atan(Math.exp(ly * Math.PI / 180)) - Math.PI / 2);
  39658. return [x, y];
  39659. }
  39660. destroy() {
  39661. if (this.handler) {
  39662. this.handler.destroy();
  39663. this.handler = null;
  39664. }
  39665. }
  39666. clearPoint() {
  39667. this.DrawEndEvent.raiseEvent(this._ClosedCurveLast, this._ClosedCurveData);
  39668. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  39669. this.viewer.entities.remove(this._entities_point[i2]);
  39670. }
  39671. this._entities_point = [];
  39672. }
  39673. clear() {
  39674. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  39675. this.viewer.entities.remove(this._entities_point[i2]);
  39676. }
  39677. for (var i2 = 0; i2 < this._entities_ClosedCurve.length; i2++) {
  39678. this.viewer.entities.remove(this._entities_ClosedCurve[i2]);
  39679. }
  39680. this.floatingPoint = null;
  39681. this._ClosedCurve = null;
  39682. this._ClosedCurveLast = null;
  39683. this._positions = [];
  39684. this._entities_point = [];
  39685. this._entities_ClosedCurve = [];
  39686. this._ClosedCurveData = null;
  39687. }
  39688. getCatesian3FromPX(px) {
  39689. var cartesian;
  39690. var ray = this.viewer.camera.getPickRay(px);
  39691. if (!ray)
  39692. return null;
  39693. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  39694. return cartesian;
  39695. }
  39696. getBisectorNormals(t2, pnt1, pnt2, pnt3) {
  39697. let $this = this;
  39698. let normal = $this.getNormal(pnt1, pnt2, pnt3);
  39699. let [bisectorNormalRight, bisectorNormalLeft, dt2, x, y] = [null, null, null, null, null];
  39700. let dist = Math.sqrt(normal[0] * normal[0] + normal[1] * normal[1]);
  39701. let uX = normal[0] / dist;
  39702. let uY = normal[1] / dist;
  39703. let d1 = $this.MathDistance(pnt1, pnt2);
  39704. let d2 = $this.MathDistance(pnt2, pnt3);
  39705. if (dist > $this.ZERO_TOLERANCE) {
  39706. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  39707. dt2 = t2 * d1;
  39708. x = pnt2[0] - dt2 * uY;
  39709. y = pnt2[1] + dt2 * uX;
  39710. bisectorNormalRight = [x, y];
  39711. dt2 = t2 * d2;
  39712. x = pnt2[0] + dt2 * uY;
  39713. y = pnt2[1] - dt2 * uX;
  39714. bisectorNormalLeft = [x, y];
  39715. } else {
  39716. dt2 = t2 * d1;
  39717. x = pnt2[0] + dt2 * uY;
  39718. y = pnt2[1] - dt2 * uX;
  39719. bisectorNormalRight = [x, y];
  39720. dt2 = t2 * d2;
  39721. x = pnt2[0] - dt2 * uY;
  39722. y = pnt2[1] + dt2 * uX;
  39723. bisectorNormalLeft = [x, y];
  39724. }
  39725. } else {
  39726. x = pnt2[0] + t2 * (pnt1[0] - pnt2[0]);
  39727. y = pnt2[1] + t2 * (pnt1[1] - pnt2[1]);
  39728. bisectorNormalRight = [x, y];
  39729. x = pnt2[0] + t2 * (pnt3[0] - pnt2[0]);
  39730. y = pnt2[1] + t2 * (pnt3[1] - pnt2[1]);
  39731. bisectorNormalLeft = [x, y];
  39732. }
  39733. return [bisectorNormalRight, bisectorNormalLeft];
  39734. }
  39735. getNormal(pnt1, pnt2, pnt3) {
  39736. let dX1 = pnt1[0] - pnt2[0];
  39737. let dY1 = pnt1[1] - pnt2[1];
  39738. let d1 = Math.sqrt(dX1 * dX1 + dY1 * dY1);
  39739. dX1 /= d1;
  39740. dY1 /= d1;
  39741. let dX2 = pnt3[0] - pnt2[0];
  39742. let dY2 = pnt3[1] - pnt2[1];
  39743. let d2 = Math.sqrt(dX2 * dX2 + dY2 * dY2);
  39744. dX2 /= d2;
  39745. dY2 /= d2;
  39746. let uX = dX1 + dX2;
  39747. let uY = dY1 + dY2;
  39748. return [uX, uY];
  39749. }
  39750. MathDistance(pnt1, pnt2) {
  39751. return Math.sqrt(Math.pow(pnt1[0] - pnt2[0], 2) + Math.pow(pnt1[1] - pnt2[1], 2));
  39752. }
  39753. isClockWise(pnt1, pnt2, pnt3) {
  39754. return (pnt3[1] - pnt1[1]) * (pnt2[0] - pnt1[0]) > (pnt2[1] - pnt1[1]) * (pnt3[0] - pnt1[0]);
  39755. }
  39756. getCubicValue(t2, startPnt, cPnt1, cPnt2, endPnt) {
  39757. t2 = Math.max(Math.min(t2, 1), 0);
  39758. let [tp, t22] = [1 - t2, t2 * t2];
  39759. let t3 = t22 * t2;
  39760. let tp2 = tp * tp;
  39761. let tp3 = tp2 * tp;
  39762. let x = tp3 * startPnt[0] + 3 * tp2 * t2 * cPnt1[0] + 3 * tp * t22 * cPnt2[0] + t3 * endPnt[0];
  39763. let y = tp3 * startPnt[1] + 3 * tp2 * t2 * cPnt1[1] + 3 * tp * t22 * cPnt2[1] + t3 * endPnt[1];
  39764. return [x, y];
  39765. }
  39766. }
  39767. class DrawSector {
  39768. constructor(arg) {
  39769. this.viewer = arg.viewer;
  39770. this.Cesium = arg.Cesium;
  39771. this.floatingPoint = null;
  39772. this._sector = null;
  39773. this._sectorLast = null;
  39774. this._positions = [];
  39775. this._entities_point = [];
  39776. this._entities_sector = [];
  39777. this._sectorData = null;
  39778. this.DrawStartEvent = new Cesium.Event();
  39779. this.DrawEndEvent = new Cesium.Event();
  39780. this._param = {
  39781. id: "DrawStraightArrow",
  39782. polygonColor: "rgba(0,255,0,0.5)",
  39783. outlineColor: "rgba(255, 255, 255, 1)",
  39784. outlineWidth: 1
  39785. };
  39786. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  39787. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  39788. }
  39789. get sector() {
  39790. return this._sectorLast;
  39791. }
  39792. getData() {
  39793. return this._sectorData;
  39794. }
  39795. computePosition(data) {
  39796. let $this = this;
  39797. let pnts = data;
  39798. let center2 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[0]));
  39799. let pnt2 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[1]));
  39800. let pnt3 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[2]));
  39801. var radius = $this.MathDistance(pnt2, center2);
  39802. var startAngle = $this.getAzimuth(pnt2, center2);
  39803. var endAngle = $this.getAzimuth(pnt3, center2);
  39804. var pList = $this.getArcPoints(center2, radius, startAngle, endAngle);
  39805. pList.push(pnts[0], pList[0]);
  39806. let arrow = [];
  39807. for (var i2 = 0; i2 < pList.length; i2++) {
  39808. var cart3 = new $this.Cesium.Cartesian3(pList[i2].x, pList[i2].y, pList[i2].z);
  39809. arrow.push(cart3);
  39810. }
  39811. var lnglatArr = [];
  39812. for (var d2 = 0; d2 < data.length; d2++) {
  39813. lnglatArr.push($this.cartesianToLatlng(data[d2]));
  39814. }
  39815. $this._sectorData = lnglatArr;
  39816. return new $this.Cesium.PolygonHierarchy(arrow);
  39817. }
  39818. addload(data) {
  39819. var $this = this;
  39820. let pnts = data;
  39821. let center2 = $this.lonLatToMercator(pnts[0]);
  39822. let pnt2 = $this.lonLatToMercator(pnts[1]);
  39823. let pnt3 = $this.lonLatToMercator(pnts[2]);
  39824. var radius = $this.MathDistance(pnt2, center2);
  39825. var startAngle = $this.getAzimuth(pnt2, center2);
  39826. var endAngle = $this.getAzimuth(pnt3, center2);
  39827. var pList = $this.getArcPoints(center2, radius, startAngle, endAngle);
  39828. let pntsc = $this.Cesium.Cartesian3.fromDegrees(pnts[0][0], pnts[0][1]);
  39829. pList.push(pntsc, pList[0]);
  39830. let arrow = [];
  39831. for (var i2 = 0; i2 < pList.length; i2++) {
  39832. var cart3 = new $this.Cesium.Cartesian3(pList[i2].x, pList[i2].y, pList[i2].z);
  39833. arrow.push(cart3);
  39834. }
  39835. var arrowEntity = $this.viewer.entities.add({
  39836. Type: "DrawSector",
  39837. Position: data,
  39838. id: data.id || $this.objId,
  39839. polygon: {
  39840. hierarchy: new $this.Cesium.PolygonHierarchy(arrow),
  39841. show: true,
  39842. fill: true,
  39843. clampToGround: true,
  39844. material: $this.Cesium.Color.AQUA.withAlpha(0.9)
  39845. }
  39846. });
  39847. return arrowEntity;
  39848. }
  39849. startCreate() {
  39850. var $this = this;
  39851. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  39852. this.handler.setInputAction(function(evt) {
  39853. var cartesian = $this.getCatesian3FromPX(evt.position);
  39854. if ($this._positions.length < 3) {
  39855. $this.floatingPoint = $this.createPoint(cartesian);
  39856. $this._positions.push(cartesian);
  39857. }
  39858. if (!$this._sector)
  39859. ;
  39860. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  39861. this.handler.setInputAction(function(evt) {
  39862. if ($this._positions.length < 2)
  39863. return;
  39864. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  39865. if ($this._positions.length == 2) {
  39866. $this._positions.push(cartesian);
  39867. }
  39868. if ($this._positions.length == 3) {
  39869. $this._positions.pop();
  39870. $this._positions.push(cartesian);
  39871. if (!$this.Cesium.defined($this._sector)) {
  39872. $this._sector = $this.createsector();
  39873. }
  39874. }
  39875. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  39876. this.handler.setInputAction(function(evt) {
  39877. if (!$this._sector)
  39878. return;
  39879. var cartesian = $this.getCatesian3FromPX(evt.position);
  39880. $this._positions.pop();
  39881. $this._positions.push(cartesian);
  39882. $this._sectorData = $this._positions.concat();
  39883. $this.viewer.entities.remove($this._sector);
  39884. $this._sector = null;
  39885. $this._positions = [];
  39886. $this.floatingPoint.position.setValue(cartesian);
  39887. var lnglatArr = [];
  39888. for (var i2 = 0; i2 < $this._sectorData.length; i2++) {
  39889. var lnglat = $this.cartesianToLatlng($this._sectorData[i2]);
  39890. lnglatArr.push(lnglat);
  39891. }
  39892. $this._sectorData = lnglatArr;
  39893. var sector = $this.addload(lnglatArr);
  39894. $this._entities_sector.push(sector);
  39895. $this._sectorLast = sector;
  39896. $this.clearPoint();
  39897. $this.destroy();
  39898. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  39899. }
  39900. createsector() {
  39901. var $this = this;
  39902. var arrowEntity = $this.viewer.entities.add(
  39903. {
  39904. polygon: {
  39905. hierarchy: new $this.Cesium.CallbackProperty(
  39906. function() {
  39907. let pnts = $this._positions;
  39908. let center2 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[0]));
  39909. let pnt2 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[1]));
  39910. let pnt3 = $this.lonLatToMercator($this.cartesianToLatlng(pnts[2]));
  39911. var radius = $this.MathDistance(pnt2, center2);
  39912. var startAngle = $this.getAzimuth(pnt2, center2);
  39913. var endAngle = $this.getAzimuth(pnt3, center2);
  39914. var pList = $this.getArcPoints(center2, radius, startAngle, endAngle);
  39915. pList.push(pnts[0], pList[0]);
  39916. for (var i2 = 0; i2 < pList.length; i2++) {
  39917. new $this.Cesium.Cartesian3(pList[i2].x, pList[i2].y, pList[i2].z);
  39918. }
  39919. return new $this.Cesium.PolygonHierarchy(pList);
  39920. },
  39921. false
  39922. ),
  39923. show: true,
  39924. fill: true,
  39925. clampToGround: true,
  39926. material: $this.Cesium.Color.AQUA.withAlpha(0.5)
  39927. }
  39928. }
  39929. );
  39930. $this._entities_sector.push(arrowEntity);
  39931. return arrowEntity;
  39932. }
  39933. createPoint(cartesian) {
  39934. var $this = this;
  39935. var point2 = this.viewer.entities.add({
  39936. position: cartesian,
  39937. point: {
  39938. pixelSize: 10,
  39939. color: $this.Cesium.Color.RED,
  39940. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  39941. }
  39942. });
  39943. $this._entities_point.push(point2);
  39944. return point2;
  39945. }
  39946. cartesianToLatlng(cartesian) {
  39947. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  39948. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  39949. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  39950. return [lng, lat];
  39951. }
  39952. lonLatToMercator(Latlng) {
  39953. var E2 = Latlng[0];
  39954. var N2 = Latlng[1];
  39955. var x = E2 * 2003750834e-2 / 180;
  39956. var y = Math.log(Math.tan((90 + N2) * Math.PI / 360)) / (Math.PI / 180);
  39957. y = y * 2003750834e-2 / 180;
  39958. return [x, y];
  39959. }
  39960. WebMercator2lonLat(mercator) {
  39961. let x = mercator[0] / 2003750834e-2 * 180;
  39962. let ly = mercator[1] / 2003750834e-2 * 180;
  39963. let y = 180 / Math.PI * (2 * Math.atan(Math.exp(ly * Math.PI / 180)) - Math.PI / 2);
  39964. return [x, y];
  39965. }
  39966. destroy() {
  39967. if (this.handler) {
  39968. this.handler.destroy();
  39969. this.handler = null;
  39970. }
  39971. }
  39972. clearPoint() {
  39973. this.DrawEndEvent.raiseEvent(this._sectorLast, this._sectorData);
  39974. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  39975. this.viewer.entities.remove(this._entities_point[i2]);
  39976. }
  39977. this._entities_point = [];
  39978. }
  39979. clear() {
  39980. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  39981. this.viewer.entities.remove(this._entities_point[i2]);
  39982. }
  39983. for (var i2 = 0; i2 < this._entities_sector.length; i2++) {
  39984. this.viewer.entities.remove(this._entities_sector[i2]);
  39985. }
  39986. this.floatingPoint = null;
  39987. this._sector = null;
  39988. this._sectorLast = null;
  39989. this._positions = [];
  39990. this._entities_point = [];
  39991. this._entities_sector = [];
  39992. this._sectorData = null;
  39993. }
  39994. getCatesian3FromPX(px) {
  39995. var cartesian;
  39996. var ray = this.viewer.camera.getPickRay(px);
  39997. if (!ray)
  39998. return null;
  39999. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  40000. return cartesian;
  40001. }
  40002. MathDistance(pnt1, pnt2) {
  40003. return Math.sqrt(Math.pow(pnt1[0] - pnt2[0], 2) + Math.pow(pnt1[1] - pnt2[1], 2));
  40004. }
  40005. getAzimuth(startPoint, endPoint) {
  40006. var azimuth;
  40007. var angle = Math.asin(Math.abs(endPoint[1] - startPoint[1]) / this.MathDistance(startPoint, endPoint));
  40008. if (endPoint[1] >= startPoint[1] && endPoint[0] >= startPoint[0]) {
  40009. azimuth = angle + Math.PI;
  40010. } else if (endPoint[1] >= startPoint[1] && endPoint[0] < startPoint[0]) {
  40011. azimuth = Math.PI * 2 - angle;
  40012. } else if (endPoint[1] < startPoint[1] && endPoint[0] < startPoint[0]) {
  40013. azimuth = angle;
  40014. } else if (endPoint[1] < startPoint[1] && endPoint[0] >= startPoint[0]) {
  40015. azimuth = Math.PI - angle;
  40016. }
  40017. return azimuth;
  40018. }
  40019. getArcPoints(center2, radius, startAngle, endAngle) {
  40020. var x = null, y = null, pnts = [], angleDiff = endAngle - startAngle;
  40021. angleDiff = angleDiff < 0 ? angleDiff + Math.PI * 2 : angleDiff;
  40022. for (var i2 = 0; i2 <= 100; i2++) {
  40023. var angle = startAngle + angleDiff * i2 / 100;
  40024. x = center2[0] + radius * Math.cos(angle);
  40025. y = center2[1] + radius * Math.sin(angle);
  40026. let latlon = this.WebMercator2lonLat([x, y]);
  40027. pnts.push(this.Cesium.Cartesian3.fromDegrees(latlon[0], latlon[1]));
  40028. }
  40029. return pnts;
  40030. }
  40031. }
  40032. class DrawBowLine {
  40033. constructor(arg) {
  40034. this.viewer = arg.viewer;
  40035. this.Cesium = arg.Cesium;
  40036. this.tt = 0.4;
  40037. this.floatingPoint = null;
  40038. this.drawHandler = null;
  40039. this.DrawBowLine = null;
  40040. this._DrawBowLineLast = null;
  40041. this._positions = [];
  40042. this._entities_point = [];
  40043. this._entities_PincerArrow = [];
  40044. this._DrawBowLineData = null;
  40045. this.DrawStartEvent = new Cesium.Event();
  40046. this.DrawEndEvent = new Cesium.Event();
  40047. this._param = {
  40048. id: "DrawStraightArrow",
  40049. polygonColor: "rgba(0,255,0,0.5)",
  40050. outlineColor: "rgba(255, 255, 255, 1)",
  40051. outlineWidth: 1
  40052. };
  40053. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  40054. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  40055. }
  40056. get PincerArrow() {
  40057. return this._DrawBowLineLast;
  40058. }
  40059. getData() {
  40060. return this._DrawBowLineData;
  40061. }
  40062. computePosition(data) {
  40063. var $this = this;
  40064. if (data.length < 3) {
  40065. return;
  40066. }
  40067. var DrawBowLine2 = [];
  40068. let positions = [];
  40069. for (var i2 = 0; i2 < data.length; i2++) {
  40070. positions.push($this.cartesianToLatlng(data[i2]));
  40071. var cart3 = $this.lonLatToMercator($this.cartesianToLatlng(data[i2]));
  40072. DrawBowLine2.push(cart3);
  40073. }
  40074. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowLine2[0], DrawBowLine2[2], DrawBowLine2[1], null, null];
  40075. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40076. let radius = $this.MathDistance(pnt1, center2);
  40077. let angle1 = $this.getAzimuth(pnt1, center2);
  40078. let angle2 = $this.getAzimuth(pnt2, center2);
  40079. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40080. startAngle = angle2;
  40081. endAngle = angle1;
  40082. } else {
  40083. startAngle = angle1;
  40084. endAngle = angle2;
  40085. }
  40086. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40087. let pHierarchy = [];
  40088. for (var l = 0; l < getArcPoint.length; l++) {
  40089. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40090. pHierarchy.push(cart3);
  40091. }
  40092. $this._DrawBowLineData = positions;
  40093. return pHierarchy;
  40094. }
  40095. addload(data) {
  40096. var $this = this;
  40097. if (data.length < 3) {
  40098. return;
  40099. }
  40100. var DrawBowLine2 = [];
  40101. for (var i2 = 0; i2 < data.length; i2++) {
  40102. var cart3 = $this.lonLatToMercator(data[i2]);
  40103. DrawBowLine2.push(cart3);
  40104. }
  40105. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowLine2[0], DrawBowLine2[2], DrawBowLine2[1], null, null];
  40106. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40107. let radius = $this.MathDistance(pnt1, center2);
  40108. let angle1 = $this.getAzimuth(pnt1, center2);
  40109. let angle2 = $this.getAzimuth(pnt2, center2);
  40110. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40111. startAngle = angle2;
  40112. endAngle = angle1;
  40113. } else {
  40114. startAngle = angle1;
  40115. endAngle = angle2;
  40116. }
  40117. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40118. let pHierarchy = [];
  40119. for (var l = 0; l < getArcPoint.length; l++) {
  40120. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40121. pHierarchy.push(cart3);
  40122. }
  40123. var arrowEntity = $this.viewer.entities.add({
  40124. Type: "DrawBowLine",
  40125. Position: data,
  40126. id: data.id || $this.objId,
  40127. polyline: {
  40128. positions: pHierarchy,
  40129. show: true,
  40130. material: $this.Cesium.Color.YELLOW,
  40131. width: 3,
  40132. clampToGround: true
  40133. }
  40134. });
  40135. return arrowEntity;
  40136. }
  40137. startCreate(drawType) {
  40138. this.drawType = drawType;
  40139. var $this = this;
  40140. this.handler = new $this.Cesium.ScreenSpaceEventHandler($this.viewer.scene.canvas);
  40141. this.handler.setInputAction(function(event2) {
  40142. var position2 = event2.position;
  40143. if (!$this.Cesium.defined(position2)) {
  40144. return;
  40145. }
  40146. var ray = $this.viewer.camera.getPickRay(position2);
  40147. if (!$this.Cesium.defined(ray)) {
  40148. return;
  40149. }
  40150. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  40151. if (!$this.Cesium.defined(cartesian)) {
  40152. return;
  40153. }
  40154. if ($this._positions.length == 0) {
  40155. $this._positions.push(cartesian.clone());
  40156. $this.floatingPoint = $this.createPoint(cartesian);
  40157. }
  40158. if ($this._positions.length <= 2) {
  40159. $this.createPoint(cartesian);
  40160. $this._positions.push(cartesian);
  40161. }
  40162. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  40163. this.handler.setInputAction(function(event2) {
  40164. if ($this._positions.length < 2) {
  40165. return;
  40166. }
  40167. var position2 = event2.endPosition;
  40168. if (!$this.Cesium.defined(position2)) {
  40169. return;
  40170. }
  40171. var ray = $this.viewer.camera.getPickRay(position2);
  40172. if (!$this.Cesium.defined(ray)) {
  40173. return;
  40174. }
  40175. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  40176. if (!$this.Cesium.defined(cartesian)) {
  40177. return;
  40178. }
  40179. if (!$this.Cesium.defined($this.DrawBowLine)) {
  40180. $this.DrawBowLine = $this.createDrawBowLine();
  40181. }
  40182. $this.floatingPoint.position.setValue(cartesian);
  40183. if ($this.DrawBowLine) {
  40184. if ($this._positions.length == 3) {
  40185. $this._positions[1] = cartesian;
  40186. } else {
  40187. $this._positions.pop();
  40188. $this._positions.push(cartesian);
  40189. }
  40190. }
  40191. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  40192. this.handler.setInputAction(function(movement) {
  40193. if ($this._positions.length >= 3) {
  40194. $this._DrawBowLineData = $this._positions.concat();
  40195. $this.viewer.entities.remove($this.DrawBowLine);
  40196. $this.DrawBowLine = null;
  40197. var lnglatArr = [];
  40198. for (var i2 = 0; i2 < $this._DrawBowLineData.length; i2++) {
  40199. var lnglat = $this.cartesianToLatlng($this._DrawBowLineData[i2]);
  40200. lnglatArr.push(lnglat);
  40201. }
  40202. $this._DrawBowLineData = lnglatArr;
  40203. var pincerArrow = $this.addload(lnglatArr);
  40204. $this._entities_PincerArrow.push(pincerArrow);
  40205. $this._DrawBowLineLast = pincerArrow;
  40206. $this.viewer.entities.remove($this.floatingPoint);
  40207. $this.floatingPoint = null;
  40208. $this.clearPoint();
  40209. $this.destroy();
  40210. }
  40211. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  40212. }
  40213. createDrawBowLine() {
  40214. let $this = this;
  40215. var DrawBowLineEntity = $this.viewer.entities.add({
  40216. polyline: {
  40217. positions: new $this.Cesium.CallbackProperty(function() {
  40218. if ($this._positions.length < 3) {
  40219. return;
  40220. }
  40221. var DrawBowLine2 = [];
  40222. for (var i2 = 0; i2 < $this._positions.length; i2++) {
  40223. var cart3 = $this.lonLatToMercator($this.cartesianToLatlng($this._positions[i2]));
  40224. DrawBowLine2.push(cart3);
  40225. }
  40226. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowLine2[0], DrawBowLine2[2], DrawBowLine2[1], null, null];
  40227. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40228. let radius = $this.MathDistance(pnt1, center2);
  40229. let angle1 = $this.getAzimuth(pnt1, center2);
  40230. let angle2 = $this.getAzimuth(pnt2, center2);
  40231. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40232. startAngle = angle2;
  40233. endAngle = angle1;
  40234. } else {
  40235. startAngle = angle1;
  40236. endAngle = angle2;
  40237. }
  40238. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40239. let pHierarchy = [];
  40240. for (var l = 0; l < getArcPoint.length; l++) {
  40241. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40242. pHierarchy.push(cart3);
  40243. }
  40244. return pHierarchy;
  40245. }, false),
  40246. show: true,
  40247. material: $this.Cesium.Color.YELLOW,
  40248. width: 3,
  40249. clampToGround: true
  40250. }
  40251. });
  40252. $this._entities_PincerArrow.push(DrawBowLineEntity);
  40253. return DrawBowLineEntity;
  40254. }
  40255. createPoint(cartesian) {
  40256. var $this = this;
  40257. var point2 = this.viewer.entities.add({
  40258. position: cartesian,
  40259. point: {
  40260. pixelSize: 10,
  40261. color: $this.Cesium.Color.RED,
  40262. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  40263. }
  40264. });
  40265. $this._entities_point.push(point2);
  40266. return point2;
  40267. }
  40268. cartesianToLatlng(cartesian) {
  40269. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  40270. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  40271. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  40272. cartographic.height;
  40273. return [lng, lat];
  40274. }
  40275. destroy() {
  40276. if (this.handler) {
  40277. this.handler.destroy();
  40278. this.handler = null;
  40279. }
  40280. }
  40281. clearPoint() {
  40282. this.DrawEndEvent.raiseEvent(this._DrawBowLineLast, this._DrawBowLineData, this.drawType);
  40283. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  40284. this.viewer.entities.remove(this._entities_point[i2]);
  40285. }
  40286. this._entities_point = [];
  40287. }
  40288. clear() {
  40289. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  40290. this.viewer.entities.remove(this._entities_point[i2]);
  40291. }
  40292. for (var i2 = 0; i2 < this._entities_PincerArrow.length; i2++) {
  40293. this.viewer.entities.remove(this._entities_PincerArrow[i2]);
  40294. }
  40295. this.floatingPoint = null;
  40296. this._PincerArrow = null;
  40297. this._PincerArrowLast = null;
  40298. this._positions = [];
  40299. this._entities_point = [];
  40300. this._entities_PincerArrow = [];
  40301. this._PincerArrowData = null;
  40302. }
  40303. getCatesian3FromPX(px) {
  40304. var cartesian;
  40305. var ray = this.viewer.camera.getPickRay(px);
  40306. if (!ray)
  40307. return null;
  40308. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  40309. return cartesian;
  40310. }
  40311. _computeTempPositions() {
  40312. var _this = this;
  40313. var pnts = [].concat(_this._positions);
  40314. var num = pnts.length;
  40315. var first = pnts[0];
  40316. var last = pnts[num - 1];
  40317. if (_this._isSimpleXYZ(first, last) == false) {
  40318. pnts.push(first);
  40319. num += 1;
  40320. }
  40321. _this.tempPositions = [];
  40322. for (var i2 = 1; i2 < num; i2++) {
  40323. var p1 = pnts[i2 - 1];
  40324. var p2 = pnts[i2];
  40325. var cp = _this._computeCenterPotition(p1, p2);
  40326. _this.tempPositions.push(p1);
  40327. _this.tempPositions.push(cp);
  40328. }
  40329. }
  40330. _isSimpleXYZ(p1, p2) {
  40331. if (p1.x == p2.x && p1.y == p2.y && p1.z == p2.z) {
  40332. return true;
  40333. }
  40334. return false;
  40335. }
  40336. _computeCenterPotition(p1, p2) {
  40337. var _this = this;
  40338. var c1 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p1);
  40339. var c2 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p2);
  40340. var cm = new _this.Cesium.EllipsoidGeodesic(c1, c2).interpolateUsingFraction(0.5);
  40341. var cp = _this.viewer.scene.globe.ellipsoid.cartographicToCartesian(cm);
  40342. return cp;
  40343. }
  40344. getLonLat(cartesian) {
  40345. var cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  40346. cartographic.height = this.viewer.scene.globe.getHeight(cartographic);
  40347. var pos = {
  40348. lon: cartographic.longitude,
  40349. lat: cartographic.latitude,
  40350. alt: cartographic.height
  40351. };
  40352. pos.lon = this.Cesium.Math.toDegrees(pos.lon);
  40353. pos.lat = this.Cesium.Math.toDegrees(pos.lat);
  40354. return pos;
  40355. }
  40356. LatlngTocartesian(latlng) {
  40357. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  40358. return cartesian3;
  40359. }
  40360. lonLatToMercator(Latlng) {
  40361. var E2 = Latlng[0];
  40362. var N2 = Latlng[1];
  40363. var x = E2 * 2003750834e-2 / 180;
  40364. var y = Math.log(Math.tan((90 + N2) * Math.PI / 360)) / (Math.PI / 180);
  40365. y = y * 2003750834e-2 / 180;
  40366. return [x, y];
  40367. }
  40368. WebMercator2lonLat(mercator) {
  40369. let x = mercator[0] / 2003750834e-2 * 180;
  40370. let ly = mercator[1] / 2003750834e-2 * 180;
  40371. let y = 180 / Math.PI * (2 * Math.atan(Math.exp(ly * Math.PI / 180)) - Math.PI / 2);
  40372. return [x, y];
  40373. }
  40374. getCircleCenterOfThreePoints(point1, point2, point3) {
  40375. let pntA = [(point1[0] + point2[0]) / 2, (point1[1] + point2[1]) / 2];
  40376. let pntB = [pntA[0] - point1[1] + point2[1], pntA[1] + point1[0] - point2[0]];
  40377. let pntC = [(point1[0] + point3[0]) / 2, (point1[1] + point3[1]) / 2];
  40378. let pntD = [pntC[0] - point1[1] + point3[1], pntC[1] + point1[0] - point3[0]];
  40379. return this.getIntersectPoint(pntA, pntB, pntC, pntD);
  40380. }
  40381. getIntersectPoint(pntA, pntB, pntC, pntD) {
  40382. if (pntA[1] === pntB[1]) {
  40383. let f2 = (pntD[0] - pntC[0]) / (pntD[1] - pntC[1]);
  40384. let x2 = f2 * (pntA[1] - pntC[1]) + pntC[0];
  40385. let y2 = pntA[1];
  40386. return [x2, y2];
  40387. }
  40388. if (pntC[1] === pntD[1]) {
  40389. let e2 = (pntB[0] - pntA[0]) / (pntB[1] - pntA[1]);
  40390. let x2 = e2 * (pntC[1] - pntA[1]) + pntA[0];
  40391. let y2 = pntC[1];
  40392. return [x2, y2];
  40393. }
  40394. let e = (pntB[0] - pntA[0]) / (pntB[1] - pntA[1]);
  40395. let f = (pntD[0] - pntC[0]) / (pntD[1] - pntC[1]);
  40396. let y = (e * pntA[1] - pntA[0] - f * pntC[1] + pntC[0]) / (e - f);
  40397. let x = e * y - e * pntA[1] + pntA[0];
  40398. return [x, y];
  40399. }
  40400. MathDistance(pnt1, pnt2) {
  40401. return Math.sqrt(Math.pow(pnt1[0] - pnt2[0], 2) + Math.pow(pnt1[1] - pnt2[1], 2));
  40402. }
  40403. getAzimuth(startPoint, endPoint) {
  40404. let azimuth;
  40405. let angle = Math.asin(Math.abs(endPoint[1] - startPoint[1]) / this.MathDistance(startPoint, endPoint));
  40406. if (endPoint[1] >= startPoint[1] && endPoint[0] >= startPoint[0]) {
  40407. azimuth = angle + Math.PI;
  40408. } else if (endPoint[1] >= startPoint[1] && endPoint[0] < startPoint[0]) {
  40409. azimuth = Math.PI * 2 - angle;
  40410. } else if (endPoint[1] < startPoint[1] && endPoint[0] < startPoint[0]) {
  40411. azimuth = angle;
  40412. } else if (endPoint[1] < startPoint[1] && endPoint[0] >= startPoint[0]) {
  40413. azimuth = Math.PI - angle;
  40414. }
  40415. return azimuth;
  40416. }
  40417. isClockWise(pnt1, pnt2, pnt3) {
  40418. return (pnt3[1] - pnt1[1]) * (pnt2[0] - pnt1[0]) > (pnt2[1] - pnt1[1]) * (pnt3[0] - pnt1[0]);
  40419. }
  40420. getArcPoints(center2, radius, startAngle, endAngle) {
  40421. let [x, y, pnts, angleDiff] = [null, null, [], endAngle - startAngle];
  40422. angleDiff = angleDiff < 0 ? angleDiff + Math.PI * 2 : angleDiff;
  40423. for (let i2 = 0; i2 <= 100; i2++) {
  40424. let angle = startAngle + angleDiff * i2 / 100;
  40425. x = center2[0] + radius * Math.cos(angle);
  40426. y = center2[1] + radius * Math.sin(angle);
  40427. pnts.push([x, y]);
  40428. }
  40429. return pnts;
  40430. }
  40431. }
  40432. class DrawBowPlane {
  40433. constructor(arg) {
  40434. this.viewer = arg.viewer;
  40435. this.Cesium = arg.Cesium;
  40436. this.tt = 0.4;
  40437. this.floatingPoint = null;
  40438. this.drawHandler = null;
  40439. this.DrawBowPlane = null;
  40440. this._DrawBowPlaneLast = null;
  40441. this._positions = [];
  40442. this._entities_point = [];
  40443. this._entities_PincerArrow = [];
  40444. this._DrawBowPlaneData = null;
  40445. this.DrawStartEvent = new Cesium.Event();
  40446. this.DrawEndEvent = new Cesium.Event();
  40447. this._param = {
  40448. id: "DrawStraightArrow",
  40449. polygonColor: "rgba(0,255,0,0.5)",
  40450. outlineColor: "rgba(255, 255, 255, 1)",
  40451. outlineWidth: 1
  40452. };
  40453. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  40454. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  40455. }
  40456. get PincerArrow() {
  40457. return this._DrawBowPlaneLast;
  40458. }
  40459. getData() {
  40460. return this._DrawBowPlaneData;
  40461. }
  40462. computePosition(data) {
  40463. var $this = this;
  40464. if (data.length < 3) {
  40465. return;
  40466. }
  40467. var DrawBowPlane2 = [];
  40468. let positions = [];
  40469. for (var i2 = 0; i2 < data.length; i2++) {
  40470. positions.push($this.cartesianToLatlng(data[i2]));
  40471. var cart3 = $this.lonLatToMercator($this.cartesianToLatlng(data[i2]));
  40472. DrawBowPlane2.push(cart3);
  40473. }
  40474. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowPlane2[0], DrawBowPlane2[2], DrawBowPlane2[1], null, null];
  40475. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40476. let radius = $this.MathDistance(pnt1, center2);
  40477. let angle1 = $this.getAzimuth(pnt1, center2);
  40478. let angle2 = $this.getAzimuth(pnt2, center2);
  40479. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40480. startAngle = angle2;
  40481. endAngle = angle1;
  40482. } else {
  40483. startAngle = angle1;
  40484. endAngle = angle2;
  40485. }
  40486. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40487. let pHierarchy = [];
  40488. for (var l = 0; l < getArcPoint.length; l++) {
  40489. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40490. pHierarchy.push(cart3);
  40491. }
  40492. pHierarchy.push(pHierarchy[0]);
  40493. $this._DrawBowPlaneData = positions;
  40494. return new $this.Cesium.PolygonHierarchy(pHierarchy);
  40495. }
  40496. addload(data) {
  40497. var $this = this;
  40498. if (data.length < 3) {
  40499. return;
  40500. }
  40501. var DrawBowPlane2 = [];
  40502. for (var i2 = 0; i2 < data.length; i2++) {
  40503. var cart3 = $this.lonLatToMercator(data[i2]);
  40504. DrawBowPlane2.push(cart3);
  40505. }
  40506. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowPlane2[0], DrawBowPlane2[2], DrawBowPlane2[1], null, null];
  40507. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40508. let radius = $this.MathDistance(pnt1, center2);
  40509. let angle1 = $this.getAzimuth(pnt1, center2);
  40510. let angle2 = $this.getAzimuth(pnt2, center2);
  40511. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40512. startAngle = angle2;
  40513. endAngle = angle1;
  40514. } else {
  40515. startAngle = angle1;
  40516. endAngle = angle2;
  40517. }
  40518. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40519. let pHierarchy = [];
  40520. for (var l = 0; l < getArcPoint.length; l++) {
  40521. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40522. pHierarchy.push(cart3);
  40523. }
  40524. pHierarchy.push(pHierarchy[0]);
  40525. var arrowEntity = $this.viewer.entities.add(
  40526. {
  40527. Type: "DrawBowPlane",
  40528. Position: data,
  40529. id: data.id || $this.objId,
  40530. polygon: {
  40531. hierarchy: new $this.Cesium.PolygonHierarchy(pHierarchy),
  40532. show: true,
  40533. material: $this.Cesium.Color.YELLOW,
  40534. width: 3,
  40535. clampToGround: true,
  40536. outlineWidth: 3,
  40537. outline: true,
  40538. outlineColor: Cesium.Color.MAGENTA
  40539. }
  40540. }
  40541. );
  40542. return arrowEntity;
  40543. }
  40544. startCreate(drawType) {
  40545. this.drawType = drawType;
  40546. var $this = this;
  40547. this.handler = new $this.Cesium.ScreenSpaceEventHandler($this.viewer.scene.canvas);
  40548. this.handler.setInputAction(function(event2) {
  40549. var position2 = event2.position;
  40550. if (!$this.Cesium.defined(position2)) {
  40551. return;
  40552. }
  40553. var ray = $this.viewer.camera.getPickRay(position2);
  40554. if (!$this.Cesium.defined(ray)) {
  40555. return;
  40556. }
  40557. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  40558. if (!$this.Cesium.defined(cartesian)) {
  40559. return;
  40560. }
  40561. if ($this._positions.length == 0) {
  40562. $this._positions.push(cartesian.clone());
  40563. $this.floatingPoint = $this.createPoint(cartesian);
  40564. }
  40565. if ($this._positions.length <= 2) {
  40566. $this.createPoint(cartesian);
  40567. $this._positions.push(cartesian);
  40568. }
  40569. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  40570. this.handler.setInputAction(function(event2) {
  40571. if ($this._positions.length < 2) {
  40572. return;
  40573. }
  40574. var position2 = event2.endPosition;
  40575. if (!$this.Cesium.defined(position2)) {
  40576. return;
  40577. }
  40578. var ray = $this.viewer.camera.getPickRay(position2);
  40579. if (!$this.Cesium.defined(ray)) {
  40580. return;
  40581. }
  40582. var cartesian = $this.viewer.scene.globe.pick(ray, $this.viewer.scene);
  40583. if (!$this.Cesium.defined(cartesian)) {
  40584. return;
  40585. }
  40586. if (!$this.Cesium.defined($this.DrawBowPlane)) {
  40587. $this.DrawBowPlane = $this.createDrawBowPlane();
  40588. }
  40589. $this.floatingPoint.position.setValue(cartesian);
  40590. if ($this.DrawBowPlane) {
  40591. if ($this._positions.length == 3) {
  40592. $this._positions[1] = cartesian;
  40593. } else {
  40594. $this._positions.pop();
  40595. $this._positions.push(cartesian);
  40596. }
  40597. }
  40598. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  40599. this.handler.setInputAction(function(movement) {
  40600. if ($this._positions.length >= 3) {
  40601. $this._DrawBowPlaneData = $this._positions.concat();
  40602. $this.viewer.entities.remove($this.DrawBowPlane);
  40603. $this.DrawBowPlane = null;
  40604. var lnglatArr = [];
  40605. for (var i2 = 0; i2 < $this._DrawBowPlaneData.length; i2++) {
  40606. var lnglat = $this.cartesianToLatlng($this._DrawBowPlaneData[i2]);
  40607. lnglatArr.push(lnglat);
  40608. }
  40609. $this._DrawBowPlaneData = lnglatArr;
  40610. var pincerArrow = $this.addload(lnglatArr);
  40611. $this._entities_PincerArrow.push(pincerArrow);
  40612. $this._DrawBowPlaneLast = pincerArrow;
  40613. $this.viewer.entities.remove($this.floatingPoint);
  40614. $this.floatingPoint = null;
  40615. $this.clearPoint();
  40616. $this.destroy();
  40617. }
  40618. }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  40619. }
  40620. createDrawBowPlane() {
  40621. let $this = this;
  40622. var DrawBowPlaneEntity = $this.viewer.entities.add(
  40623. {
  40624. polygon: {
  40625. hierarchy: new $this.Cesium.CallbackProperty(function() {
  40626. if ($this._positions.length < 3) {
  40627. return;
  40628. }
  40629. var DrawBowPlane2 = [];
  40630. for (var i2 = 0; i2 < $this._positions.length; i2++) {
  40631. var cart3 = $this.lonLatToMercator($this.cartesianToLatlng($this._positions[i2]));
  40632. DrawBowPlane2.push(cart3);
  40633. }
  40634. let [pnt1, pnt2, pnt3, startAngle, endAngle] = [DrawBowPlane2[0], DrawBowPlane2[2], DrawBowPlane2[1], null, null];
  40635. let center2 = $this.getCircleCenterOfThreePoints(pnt1, pnt2, pnt3);
  40636. let radius = $this.MathDistance(pnt1, center2);
  40637. let angle1 = $this.getAzimuth(pnt1, center2);
  40638. let angle2 = $this.getAzimuth(pnt2, center2);
  40639. if ($this.isClockWise(pnt1, pnt2, pnt3)) {
  40640. startAngle = angle2;
  40641. endAngle = angle1;
  40642. } else {
  40643. startAngle = angle1;
  40644. endAngle = angle2;
  40645. }
  40646. let getArcPoint = $this.getArcPoints(center2, radius, startAngle, endAngle);
  40647. let pHierarchy = [];
  40648. for (var l = 0; l < getArcPoint.length; l++) {
  40649. var cart3 = $this.LatlngTocartesian($this.WebMercator2lonLat(getArcPoint[l]));
  40650. pHierarchy.push(cart3);
  40651. }
  40652. pHierarchy.push(pHierarchy[0]);
  40653. return new $this.Cesium.PolygonHierarchy(pHierarchy);
  40654. }, false),
  40655. show: true,
  40656. material: $this.Cesium.Color.YELLOW,
  40657. clampToGround: true
  40658. }
  40659. }
  40660. );
  40661. $this._entities_PincerArrow.push(DrawBowPlaneEntity);
  40662. return DrawBowPlaneEntity;
  40663. }
  40664. createPoint(cartesian) {
  40665. var $this = this;
  40666. var point2 = this.viewer.entities.add({
  40667. position: cartesian,
  40668. point: {
  40669. pixelSize: 10,
  40670. color: $this.Cesium.Color.RED,
  40671. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  40672. }
  40673. });
  40674. $this._entities_point.push(point2);
  40675. return point2;
  40676. }
  40677. cartesianToLatlng(cartesian) {
  40678. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  40679. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  40680. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  40681. cartographic.height;
  40682. return [lng, lat];
  40683. }
  40684. destroy() {
  40685. if (this.handler) {
  40686. this.handler.destroy();
  40687. this.handler = null;
  40688. }
  40689. }
  40690. clearPoint() {
  40691. this.DrawEndEvent.raiseEvent(this._DrawBowPlaneLast, this._DrawBowPlaneData, this.drawType);
  40692. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  40693. this.viewer.entities.remove(this._entities_point[i2]);
  40694. }
  40695. this._entities_point = [];
  40696. }
  40697. clear() {
  40698. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  40699. this.viewer.entities.remove(this._entities_point[i2]);
  40700. }
  40701. for (var i2 = 0; i2 < this._entities_PincerArrow.length; i2++) {
  40702. this.viewer.entities.remove(this._entities_PincerArrow[i2]);
  40703. }
  40704. this.floatingPoint = null;
  40705. this._PincerArrow = null;
  40706. this._PincerArrowLast = null;
  40707. this._positions = [];
  40708. this._entities_point = [];
  40709. this._entities_PincerArrow = [];
  40710. this._PincerArrowData = null;
  40711. }
  40712. getCatesian3FromPX(px) {
  40713. var cartesian;
  40714. var ray = this.viewer.camera.getPickRay(px);
  40715. if (!ray)
  40716. return null;
  40717. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  40718. return cartesian;
  40719. }
  40720. _computeTempPositions() {
  40721. var _this = this;
  40722. var pnts = [].concat(_this._positions);
  40723. var num = pnts.length;
  40724. var first = pnts[0];
  40725. var last = pnts[num - 1];
  40726. if (_this._isSimpleXYZ(first, last) == false) {
  40727. pnts.push(first);
  40728. num += 1;
  40729. }
  40730. _this.tempPositions = [];
  40731. for (var i2 = 1; i2 < num; i2++) {
  40732. var p1 = pnts[i2 - 1];
  40733. var p2 = pnts[i2];
  40734. var cp = _this._computeCenterPotition(p1, p2);
  40735. _this.tempPositions.push(p1);
  40736. _this.tempPositions.push(cp);
  40737. }
  40738. }
  40739. _isSimpleXYZ(p1, p2) {
  40740. if (p1.x == p2.x && p1.y == p2.y && p1.z == p2.z) {
  40741. return true;
  40742. }
  40743. return false;
  40744. }
  40745. _computeCenterPotition(p1, p2) {
  40746. var _this = this;
  40747. var c1 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p1);
  40748. var c2 = _this.viewer.scene.globe.ellipsoid.cartesianToCartographic(p2);
  40749. var cm = new _this.Cesium.EllipsoidGeodesic(c1, c2).interpolateUsingFraction(0.5);
  40750. var cp = _this.viewer.scene.globe.ellipsoid.cartographicToCartesian(cm);
  40751. return cp;
  40752. }
  40753. getLonLat(cartesian) {
  40754. var cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  40755. cartographic.height = this.viewer.scene.globe.getHeight(cartographic);
  40756. var pos = {
  40757. lon: cartographic.longitude,
  40758. lat: cartographic.latitude,
  40759. alt: cartographic.height
  40760. };
  40761. pos.lon = this.Cesium.Math.toDegrees(pos.lon);
  40762. pos.lat = this.Cesium.Math.toDegrees(pos.lat);
  40763. return pos;
  40764. }
  40765. LatlngTocartesian(latlng) {
  40766. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  40767. return cartesian3;
  40768. }
  40769. lonLatToMercator(Latlng) {
  40770. var E2 = Latlng[0];
  40771. var N2 = Latlng[1];
  40772. var x = E2 * 2003750834e-2 / 180;
  40773. var y = Math.log(Math.tan((90 + N2) * Math.PI / 360)) / (Math.PI / 180);
  40774. y = y * 2003750834e-2 / 180;
  40775. return [x, y];
  40776. }
  40777. WebMercator2lonLat(mercator) {
  40778. let x = mercator[0] / 2003750834e-2 * 180;
  40779. let ly = mercator[1] / 2003750834e-2 * 180;
  40780. let y = 180 / Math.PI * (2 * Math.atan(Math.exp(ly * Math.PI / 180)) - Math.PI / 2);
  40781. return [x, y];
  40782. }
  40783. getCircleCenterOfThreePoints(point1, point2, point3) {
  40784. let pntA = [(point1[0] + point2[0]) / 2, (point1[1] + point2[1]) / 2];
  40785. let pntB = [pntA[0] - point1[1] + point2[1], pntA[1] + point1[0] - point2[0]];
  40786. let pntC = [(point1[0] + point3[0]) / 2, (point1[1] + point3[1]) / 2];
  40787. let pntD = [pntC[0] - point1[1] + point3[1], pntC[1] + point1[0] - point3[0]];
  40788. return this.getIntersectPoint(pntA, pntB, pntC, pntD);
  40789. }
  40790. getIntersectPoint(pntA, pntB, pntC, pntD) {
  40791. if (pntA[1] === pntB[1]) {
  40792. let f2 = (pntD[0] - pntC[0]) / (pntD[1] - pntC[1]);
  40793. let x2 = f2 * (pntA[1] - pntC[1]) + pntC[0];
  40794. let y2 = pntA[1];
  40795. return [x2, y2];
  40796. }
  40797. if (pntC[1] === pntD[1]) {
  40798. let e2 = (pntB[0] - pntA[0]) / (pntB[1] - pntA[1]);
  40799. let x2 = e2 * (pntC[1] - pntA[1]) + pntA[0];
  40800. let y2 = pntC[1];
  40801. return [x2, y2];
  40802. }
  40803. let e = (pntB[0] - pntA[0]) / (pntB[1] - pntA[1]);
  40804. let f = (pntD[0] - pntC[0]) / (pntD[1] - pntC[1]);
  40805. let y = (e * pntA[1] - pntA[0] - f * pntC[1] + pntC[0]) / (e - f);
  40806. let x = e * y - e * pntA[1] + pntA[0];
  40807. return [x, y];
  40808. }
  40809. MathDistance(pnt1, pnt2) {
  40810. return Math.sqrt(Math.pow(pnt1[0] - pnt2[0], 2) + Math.pow(pnt1[1] - pnt2[1], 2));
  40811. }
  40812. getAzimuth(startPoint, endPoint) {
  40813. let azimuth;
  40814. let angle = Math.asin(Math.abs(endPoint[1] - startPoint[1]) / this.MathDistance(startPoint, endPoint));
  40815. if (endPoint[1] >= startPoint[1] && endPoint[0] >= startPoint[0]) {
  40816. azimuth = angle + Math.PI;
  40817. } else if (endPoint[1] >= startPoint[1] && endPoint[0] < startPoint[0]) {
  40818. azimuth = Math.PI * 2 - angle;
  40819. } else if (endPoint[1] < startPoint[1] && endPoint[0] < startPoint[0]) {
  40820. azimuth = angle;
  40821. } else if (endPoint[1] < startPoint[1] && endPoint[0] >= startPoint[0]) {
  40822. azimuth = Math.PI - angle;
  40823. }
  40824. return azimuth;
  40825. }
  40826. isClockWise(pnt1, pnt2, pnt3) {
  40827. return (pnt3[1] - pnt1[1]) * (pnt2[0] - pnt1[0]) > (pnt2[1] - pnt1[1]) * (pnt3[0] - pnt1[0]);
  40828. }
  40829. getArcPoints(center2, radius, startAngle, endAngle) {
  40830. let [x, y, pnts, angleDiff] = [null, null, [], endAngle - startAngle];
  40831. angleDiff = angleDiff < 0 ? angleDiff + Math.PI * 2 : angleDiff;
  40832. for (let i2 = 0; i2 <= 100; i2++) {
  40833. let angle = startAngle + angleDiff * i2 / 100;
  40834. x = center2[0] + radius * Math.cos(angle);
  40835. y = center2[1] + radius * Math.sin(angle);
  40836. pnts.push([x, y]);
  40837. }
  40838. return pnts;
  40839. }
  40840. }
  40841. class DrawCurve {
  40842. constructor(arg) {
  40843. this.viewer = arg.viewer;
  40844. this.Cesium = arg.Cesium;
  40845. this.floatingPoint = null;
  40846. this._curveline = null;
  40847. this._curvelineLast = null;
  40848. this._positions = [];
  40849. this._entities_point = [];
  40850. this._entities_line = [];
  40851. this._curvelineData = null;
  40852. this.DrawStartEvent = new Cesium.Event();
  40853. this.DrawEndEvent = new Cesium.Event();
  40854. this.ZERO_TOLERANCE = 1e-4;
  40855. this.FITTING_COUNT = 100;
  40856. this.t = 0.3;
  40857. this._param = {
  40858. id: "DrawStraightArrow",
  40859. polygonColor: "rgba(0,255,0,0.5)",
  40860. outlineColor: "rgba(255, 255, 255, 1)",
  40861. outlineWidth: 1
  40862. };
  40863. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  40864. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  40865. }
  40866. get curveline() {
  40867. return this._curvelineLast;
  40868. }
  40869. getData() {
  40870. return this._curvelineData;
  40871. }
  40872. addload(data) {
  40873. var $this = this;
  40874. let pnts = [];
  40875. for (let p = 0; p < data.length; p++) {
  40876. pnts.push($this.lonLatToMercator(data[p]));
  40877. }
  40878. let CurvePoints = $this.getCurvePoints(pnts);
  40879. let point2 = [];
  40880. for (let i2 = 0; i2 < CurvePoints.length; i2++) {
  40881. point2.push($this.LatlngTocartesian($this.WebMercator2lonLat(CurvePoints[i2])));
  40882. }
  40883. var polyline = this.viewer.entities.add({
  40884. Type: "DrawCurve",
  40885. Position: data,
  40886. id: data.id || $this.objId,
  40887. polyline: {
  40888. positions: point2,
  40889. show: true,
  40890. material: $this.Cesium.Color.YELLOW,
  40891. width: 3,
  40892. clampToGround: true
  40893. }
  40894. });
  40895. return polyline;
  40896. }
  40897. computePosition(data) {
  40898. let pnts = [];
  40899. let position2 = [];
  40900. for (let p = 0; p < data.length; p++) {
  40901. position2.push(this.cartesianToLatlng(data[p]));
  40902. pnts.push(this.lonLatToMercator(this.cartesianToLatlng(data[p])));
  40903. }
  40904. this._curvelineData = position2;
  40905. let CurvePoints = this.getCurvePoints(pnts);
  40906. let point2 = [];
  40907. for (let i2 = 0; i2 < CurvePoints.length; i2++) {
  40908. point2.push(this.LatlngTocartesian(this.WebMercator2lonLat(CurvePoints[i2])));
  40909. }
  40910. return point2;
  40911. }
  40912. startCreate(drawType) {
  40913. this.drawType = drawType;
  40914. var $this = this;
  40915. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  40916. this.handler.setInputAction(function(evt) {
  40917. var cartesian = $this.getCatesian3FromPX(evt.position);
  40918. if ($this._positions.length == 0) {
  40919. $this._positions.push(cartesian.clone());
  40920. $this.floatingPoint = $this.createPoint(cartesian);
  40921. $this.createPoint(cartesian);
  40922. }
  40923. $this._positions.push(cartesian);
  40924. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  40925. this.handler.setInputAction(function(evt) {
  40926. if ($this._positions.length < 3)
  40927. return;
  40928. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  40929. if (!$this.Cesium.defined($this._curveline)) {
  40930. $this._curveline = $this.createCurveline();
  40931. }
  40932. $this.floatingPoint.position.setValue(cartesian);
  40933. if ($this._curveline) {
  40934. $this._positions.pop();
  40935. $this._positions.push(cartesian);
  40936. }
  40937. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  40938. this.handler.setInputAction(function(evt) {
  40939. if (!$this._curveline)
  40940. return;
  40941. var cartesian = $this.getCatesian3FromPX(evt.position);
  40942. $this._positions.pop();
  40943. $this._positions.push(cartesian);
  40944. $this.createPoint(cartesian);
  40945. $this._curvelineData = $this._positions.concat();
  40946. $this.viewer.entities.remove($this._curveline);
  40947. $this._curveline = null;
  40948. $this._positions = [];
  40949. $this.floatingPoint.position.setValue(cartesian);
  40950. let lnglatArr = [];
  40951. for (var i2 = 0; i2 < $this._curvelineData.length; i2++) {
  40952. var lnglat = $this.cartesianToLatlng($this._curvelineData[i2]);
  40953. lnglatArr.push(lnglat);
  40954. }
  40955. $this._curvelineData = lnglatArr;
  40956. var line = $this.addload($this._curvelineData);
  40957. $this._entities_line.push(line);
  40958. $this._curvelineLast = line;
  40959. $this.clearPoint();
  40960. $this.destroy();
  40961. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  40962. }
  40963. createPoint(cartesian) {
  40964. var $this = this;
  40965. var point2 = this.viewer.entities.add({
  40966. position: cartesian,
  40967. point: {
  40968. pixelSize: 10,
  40969. color: $this.Cesium.Color.RED,
  40970. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  40971. }
  40972. });
  40973. $this._entities_point.push(point2);
  40974. return point2;
  40975. }
  40976. createCurveline() {
  40977. var $this = this;
  40978. var polyline = this.viewer.entities.add({
  40979. polyline: {
  40980. positions: new $this.Cesium.CallbackProperty(function() {
  40981. let pnts = [];
  40982. for (let p = 0; p < $this._positions.length; p++) {
  40983. pnts.push($this.lonLatToMercator($this.cartesianToLatlng($this._positions[p])));
  40984. }
  40985. let CurvePoints = $this.getCurvePoints(pnts);
  40986. let point2 = [];
  40987. for (let i2 = 0; i2 < CurvePoints.length; i2++) {
  40988. point2.push($this.LatlngTocartesian($this.WebMercator2lonLat(CurvePoints[i2])));
  40989. }
  40990. return point2;
  40991. }, false),
  40992. show: true,
  40993. material: $this.Cesium.Color.YELLOW,
  40994. width: 3,
  40995. clampToGround: true
  40996. }
  40997. });
  40998. $this._entities_line.push(polyline);
  40999. return polyline;
  41000. }
  41001. clearPoint() {
  41002. this.DrawEndEvent.raiseEvent(this._curvelineLast, this._curvelineData, this.drawType);
  41003. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  41004. this.viewer.entities.remove(this._entities_point[i2]);
  41005. }
  41006. this._entities_point = [];
  41007. }
  41008. destroy() {
  41009. if (this.handler) {
  41010. this.handler.destroy();
  41011. this.handler = null;
  41012. }
  41013. }
  41014. clear() {
  41015. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  41016. this.viewer.entities.remove(this._entities_point[i2]);
  41017. }
  41018. for (var i2 = 0; i2 < this._entities_line.length; i2++) {
  41019. this.viewer.entities.remove(this._entities_line[i2]);
  41020. }
  41021. this.floatingPoint = null;
  41022. this._curveline = null;
  41023. this._curvelineLast = null;
  41024. this._positions = [];
  41025. this._entities_point = [];
  41026. this._entities_line = [];
  41027. this._curvelineData = null;
  41028. }
  41029. getCatesian3FromPX(px) {
  41030. var cartesian;
  41031. var ray = this.viewer.camera.getPickRay(px);
  41032. if (!ray)
  41033. return null;
  41034. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  41035. return cartesian;
  41036. }
  41037. cartesianToLatlng(cartesian) {
  41038. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  41039. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  41040. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  41041. return [lng, lat];
  41042. }
  41043. LatlngTocartesian(latlng) {
  41044. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  41045. return cartesian3;
  41046. }
  41047. lonLatToMercator(Latlng) {
  41048. var E2 = Latlng[0];
  41049. var N2 = Latlng[1];
  41050. var x = E2 * 2003750834e-2 / 180;
  41051. var y = Math.log(Math.tan((90 + N2) * Math.PI / 360)) / (Math.PI / 180);
  41052. y = y * 2003750834e-2 / 180;
  41053. return [x, y];
  41054. }
  41055. WebMercator2lonLat(mercator) {
  41056. let x = mercator[0] / 2003750834e-2 * 180;
  41057. let ly = mercator[1] / 2003750834e-2 * 180;
  41058. let y = 180 / Math.PI * (2 * Math.atan(Math.exp(ly * Math.PI / 180)) - Math.PI / 2);
  41059. return [x, y];
  41060. }
  41061. getCurvePoints(controlPoints) {
  41062. let leftControl = this.getLeftMostControlPoint(controlPoints, this.t);
  41063. let [pnt1, pnt2, pnt3, normals, points2] = [null, null, null, [leftControl], []];
  41064. for (let i2 = 0; i2 < controlPoints.length - 2; i2++) {
  41065. [pnt1, pnt2, pnt3] = [controlPoints[i2], controlPoints[i2 + 1], controlPoints[i2 + 2]];
  41066. let normalPoints = this.getBisectorNormals(this.t, pnt1, pnt2, pnt3);
  41067. normals = normals.concat(normalPoints);
  41068. }
  41069. let rightControl = this.getRightMostControlPoint(controlPoints, this.t);
  41070. if (rightControl) {
  41071. normals.push(rightControl);
  41072. }
  41073. for (let i2 = 0; i2 < controlPoints.length - 1; i2++) {
  41074. pnt1 = controlPoints[i2];
  41075. pnt2 = controlPoints[i2 + 1];
  41076. points2.push(pnt1);
  41077. for (let t2 = 0; t2 < this.FITTING_COUNT; t2++) {
  41078. let pnt = this.getCubicValue(t2 / this.FITTING_COUNT, pnt1, normals[i2 * 2], normals[i2 * 2 + 1], pnt2);
  41079. points2.push(pnt);
  41080. }
  41081. points2.push(pnt2);
  41082. }
  41083. return points2;
  41084. }
  41085. getLeftMostControlPoint(controlPoints, t2) {
  41086. let [pnt1, pnt2, pnt3, controlX, controlY] = [controlPoints[0], controlPoints[1], controlPoints[2], null, null];
  41087. let pnts = this.getBisectorNormals(0, pnt1, pnt2, pnt3);
  41088. let normalRight = pnts[0];
  41089. let normal = this.getNormal(pnt1, pnt2, pnt3);
  41090. let dist = Math.sqrt(normal[0] * normal[0] + normal[1] * normal[1]);
  41091. if (dist > this.ZERO_TOLERANCE) {
  41092. let mid = this.Mid(pnt1, pnt2);
  41093. let pX = pnt1[0] - mid[0];
  41094. let pY = pnt1[1] - mid[1];
  41095. let d1 = this.MathDistance(pnt1, pnt2);
  41096. let n = 2 / d1;
  41097. let nX = -n * pY;
  41098. let nY = n * pX;
  41099. let a11 = nX * nX - nY * nY;
  41100. let a12 = 2 * nX * nY;
  41101. let a22 = nY * nY - nX * nX;
  41102. let dX = normalRight[0] - mid[0];
  41103. let dY = normalRight[1] - mid[1];
  41104. controlX = mid[0] + a11 * dX + a12 * dY;
  41105. controlY = mid[1] + a12 * dX + a22 * dY;
  41106. } else {
  41107. controlX = pnt1[0] + t2 * (pnt2[0] - pnt1[0]);
  41108. controlY = pnt1[1] + t2 * (pnt2[1] - pnt1[1]);
  41109. }
  41110. return [controlX, controlY];
  41111. }
  41112. getBisectorNormals(t2, pnt1, pnt2, pnt3) {
  41113. let normal = this.getNormal(pnt1, pnt2, pnt3);
  41114. let [bisectorNormalRight, bisectorNormalLeft, dt2, x, y] = [null, null, null, null, null];
  41115. let dist = Math.sqrt(normal[0] * normal[0] + normal[1] * normal[1]);
  41116. let uX = normal[0] / dist;
  41117. let uY = normal[1] / dist;
  41118. let d1 = this.MathDistance(pnt1, pnt2);
  41119. let d2 = this.MathDistance(pnt2, pnt3);
  41120. if (dist > this.ZERO_TOLERANCE) {
  41121. if (this.isClockWise(pnt1, pnt2, pnt3)) {
  41122. dt2 = t2 * d1;
  41123. x = pnt2[0] - dt2 * uY;
  41124. y = pnt2[1] + dt2 * uX;
  41125. bisectorNormalRight = [x, y];
  41126. dt2 = t2 * d2;
  41127. x = pnt2[0] + dt2 * uY;
  41128. y = pnt2[1] - dt2 * uX;
  41129. bisectorNormalLeft = [x, y];
  41130. } else {
  41131. dt2 = t2 * d1;
  41132. x = pnt2[0] + dt2 * uY;
  41133. y = pnt2[1] - dt2 * uX;
  41134. bisectorNormalRight = [x, y];
  41135. dt2 = t2 * d2;
  41136. x = pnt2[0] - dt2 * uY;
  41137. y = pnt2[1] + dt2 * uX;
  41138. bisectorNormalLeft = [x, y];
  41139. }
  41140. } else {
  41141. x = pnt2[0] + t2 * (pnt1[0] - pnt2[0]);
  41142. y = pnt2[1] + t2 * (pnt1[1] - pnt2[1]);
  41143. bisectorNormalRight = [x, y];
  41144. x = pnt2[0] + t2 * (pnt3[0] - pnt2[0]);
  41145. y = pnt2[1] + t2 * (pnt3[1] - pnt2[1]);
  41146. bisectorNormalLeft = [x, y];
  41147. }
  41148. return [bisectorNormalRight, bisectorNormalLeft];
  41149. }
  41150. getNormal(pnt1, pnt2, pnt3) {
  41151. let dX1 = pnt1[0] - pnt2[0];
  41152. let dY1 = pnt1[1] - pnt2[1];
  41153. let d1 = Math.sqrt(dX1 * dX1 + dY1 * dY1);
  41154. dX1 /= d1;
  41155. dY1 /= d1;
  41156. let dX2 = pnt3[0] - pnt2[0];
  41157. let dY2 = pnt3[1] - pnt2[1];
  41158. let d2 = Math.sqrt(dX2 * dX2 + dY2 * dY2);
  41159. dX2 /= d2;
  41160. dY2 /= d2;
  41161. let uX = dX1 + dX2;
  41162. let uY = dY1 + dY2;
  41163. return [uX, uY];
  41164. }
  41165. isClockWise(pnt1, pnt2, pnt3) {
  41166. return (pnt3[1] - pnt1[1]) * (pnt2[0] - pnt1[0]) > (pnt2[1] - pnt1[1]) * (pnt3[0] - pnt1[0]);
  41167. }
  41168. Mid(point1, point2) {
  41169. return [(point1[0] + point2[0]) / 2, (point1[1] + point2[1]) / 2];
  41170. }
  41171. MathDistance(pnt1, pnt2) {
  41172. return Math.sqrt(Math.pow(pnt1[0] - pnt2[0], 2) + Math.pow(pnt1[1] - pnt2[1], 2));
  41173. }
  41174. getRightMostControlPoint(controlPoints, t2) {
  41175. let count = controlPoints.length;
  41176. let pnt1 = controlPoints[count - 3];
  41177. let pnt2 = controlPoints[count - 2];
  41178. let pnt3 = controlPoints[count - 1];
  41179. let pnts = this.getBisectorNormals(0, pnt1, pnt2, pnt3);
  41180. let normalLeft = pnts[1];
  41181. let normal = this.getNormal(pnt1, pnt2, pnt3);
  41182. let dist = Math.sqrt(normal[0] * normal[0] + normal[1] * normal[1]);
  41183. let [controlX, controlY] = [null, null];
  41184. if (dist > this.ZERO_TOLERANCE) {
  41185. let mid = this.Mid(pnt2, pnt3);
  41186. let pX = pnt3[0] - mid[0];
  41187. let pY = pnt3[1] - mid[1];
  41188. let d1 = this.MathDistance(pnt2, pnt3);
  41189. let n = 2 / d1;
  41190. let nX = -n * pY;
  41191. let nY = n * pX;
  41192. let a11 = nX * nX - nY * nY;
  41193. let a12 = 2 * nX * nY;
  41194. let a22 = nY * nY - nX * nX;
  41195. let dX = normalLeft[0] - mid[0];
  41196. let dY = normalLeft[1] - mid[1];
  41197. controlX = mid[0] + a11 * dX + a12 * dY;
  41198. controlY = mid[1] + a12 * dX + a22 * dY;
  41199. } else {
  41200. controlX = pnt3[0] + t2 * (pnt2[0] - pnt3[0]);
  41201. controlY = pnt3[1] + t2 * (pnt2[1] - pnt3[1]);
  41202. }
  41203. return [controlX, controlY];
  41204. }
  41205. getCubicValue(t2, startPnt, cPnt1, cPnt2, endPnt) {
  41206. t2 = Math.max(Math.min(t2, 1), 0);
  41207. let [tp, t22] = [1 - t2, t2 * t2];
  41208. let t3 = t22 * t2;
  41209. let tp2 = tp * tp;
  41210. let tp3 = tp2 * tp;
  41211. let x = tp3 * startPnt[0] + 3 * tp2 * t2 * cPnt1[0] + 3 * tp * t22 * cPnt2[0] + t3 * endPnt[0];
  41212. let y = tp3 * startPnt[1] + 3 * tp2 * t2 * cPnt1[1] + 3 * tp * t22 * cPnt2[1] + t3 * endPnt[1];
  41213. return [x, y];
  41214. }
  41215. }
  41216. class DrawCurveFlag {
  41217. constructor(arg) {
  41218. this.viewer = arg.viewer;
  41219. this.Cesium = arg.Cesium;
  41220. this.identificationPoint = null;
  41221. this.CurveFlag = null;
  41222. this.CurveFlagLast = null;
  41223. this.positions = [];
  41224. this.entitiesPoint = [];
  41225. this.entitiesCurveFlag = [];
  41226. this.CurveFlagData = null;
  41227. this.DrawStartEvent = new Cesium.Event();
  41228. this.DrawEndEvent = new Cesium.Event();
  41229. this._param = {
  41230. id: "DrawStraightArrow",
  41231. polygonColor: "rgba(0,255,0,0.5)",
  41232. outlineColor: "rgba(255, 255, 255, 1)",
  41233. outlineWidth: 1
  41234. };
  41235. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  41236. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  41237. }
  41238. getData() {
  41239. return this.CurveFlagData;
  41240. }
  41241. computePosition(data) {
  41242. let $this = this;
  41243. var lnglatArr = [];
  41244. for (var i2 = 0; i2 < data.length; i2++) {
  41245. var lnglat = $this.cartesianToLatlng(data[i2]);
  41246. lnglatArr.push(lnglat);
  41247. }
  41248. let startPoint = lnglatArr[0];
  41249. let endPoint = lnglatArr[lnglatArr.length - 1];
  41250. let point1 = startPoint;
  41251. let point2 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41252. let point3 = [(startPoint[0] + endPoint[0]) / 2, startPoint[1]];
  41253. let point4 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], -(endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41254. let point5 = [endPoint[0], startPoint[1]];
  41255. let point6 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41256. let point7 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 3 / 8 + startPoint[1]];
  41257. let point8 = [(startPoint[0] + endPoint[0]) / 2, (startPoint[1] + endPoint[1]) / 2];
  41258. let point9 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 5 / 8 + startPoint[1]];
  41259. let point10 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41260. let point11 = [startPoint[0], endPoint[1]];
  41261. let curve1 = $this.getBezierPoints([point1, point2, point3, point4, point5]);
  41262. let curve2 = $this.getBezierPoints([point6, point7, point8, point9, point10]);
  41263. let componentspolygon = [];
  41264. componentspolygon = curve1.concat(curve2);
  41265. let PolygonHierarchy = new $this.Cesium.PolygonHierarchy(componentspolygon);
  41266. let componentspolyline = [];
  41267. componentspolyline = curve1.concat(curve2);
  41268. componentspolyline.push($this.LatlngTocartesian(point1));
  41269. componentspolyline.push($this.LatlngTocartesian(point11));
  41270. $this.CurveFlagData = lnglatArr;
  41271. return [PolygonHierarchy, componentspolyline];
  41272. }
  41273. addload(data) {
  41274. var $this = this;
  41275. if (data.length < 2)
  41276. return;
  41277. let startPoint = data[0];
  41278. let endPoint = data[data.length - 1];
  41279. let point1 = startPoint;
  41280. let point2 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41281. let point3 = [(startPoint[0] + endPoint[0]) / 2, startPoint[1]];
  41282. let point4 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], -(endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41283. let point5 = [endPoint[0], startPoint[1]];
  41284. let point6 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41285. let point7 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 3 / 8 + startPoint[1]];
  41286. let point8 = [(startPoint[0] + endPoint[0]) / 2, (startPoint[1] + endPoint[1]) / 2];
  41287. let point9 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 5 / 8 + startPoint[1]];
  41288. let point10 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41289. let point11 = [startPoint[0], endPoint[1]];
  41290. let curve1 = $this.getBezierPoints([point1, point2, point3, point4, point5]);
  41291. let curve2 = $this.getBezierPoints([point6, point7, point8, point9, point10]);
  41292. let componentspolygon = [];
  41293. componentspolygon = curve1.concat(curve2);
  41294. let componentspolyline = [];
  41295. componentspolyline = curve1.concat(curve2);
  41296. componentspolyline.push($this.LatlngTocartesian(point1));
  41297. componentspolyline.push($this.LatlngTocartesian(point11));
  41298. var shape = this.viewer.entities.add({
  41299. Type: "DrawCurveFlag",
  41300. Position: data,
  41301. id: data.id || $this.objId,
  41302. polygon: {
  41303. hierarchy: new $this.Cesium.PolygonHierarchy(componentspolygon),
  41304. extrudedHeight: 1,
  41305. material: $this.Cesium.Color.RED
  41306. },
  41307. polyline: {
  41308. positions: componentspolyline,
  41309. show: true,
  41310. material: $this.Cesium.Color.YELLOW,
  41311. width: 5,
  41312. clampToGround: true
  41313. }
  41314. });
  41315. $this.entitiesCurveFlag.push(shape);
  41316. return shape;
  41317. }
  41318. startCreate(drawType) {
  41319. this.drawType = drawType;
  41320. var $this = this;
  41321. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  41322. this.handler.setInputAction(function(evt) {
  41323. var cartesian = $this.getCatesian3FromPX(evt.position);
  41324. if ($this.positions.length == 0) {
  41325. $this.positions.push(cartesian.clone());
  41326. $this.identificationPoint = $this.createPoint(cartesian);
  41327. $this.createPoint(cartesian);
  41328. $this.positions.push(cartesian);
  41329. }
  41330. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  41331. this.handler.setInputAction(function(evt) {
  41332. if ($this.positions.length < 2)
  41333. return;
  41334. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  41335. if (!$this.Cesium.defined($this.CurveFlag)) {
  41336. $this.CurveFlag = $this.createCurveFlag();
  41337. }
  41338. $this.identificationPoint.position.setValue(cartesian);
  41339. if ($this.CurveFlag) {
  41340. $this.positions.pop();
  41341. $this.positions.push(cartesian);
  41342. }
  41343. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  41344. this.handler.setInputAction(function(evt) {
  41345. if (!$this.CurveFlag)
  41346. return;
  41347. var cartesian = $this.getCatesian3FromPX(evt.position);
  41348. $this.positions.pop();
  41349. $this.positions.push(cartesian);
  41350. $this.createPoint(cartesian);
  41351. $this.CurveFlagData = $this.positions.concat();
  41352. $this.viewer.entities.remove($this.CurveFlag);
  41353. $this.CurveFlag = null;
  41354. $this.positions = [];
  41355. $this.identificationPoint.position.setValue(cartesian);
  41356. var lnglatArr = [];
  41357. for (var i2 = 0; i2 < $this.CurveFlagData.length; i2++) {
  41358. var lnglat = $this.cartesianToLatlng($this.CurveFlagData[i2]);
  41359. lnglatArr.push(lnglat);
  41360. }
  41361. $this.CurveFlagData = lnglatArr;
  41362. var CurveFlag = $this.addload([$this.CurveFlagData[0], $this.CurveFlagData[$this.CurveFlagData.length - 1]]);
  41363. $this.entitiesCurveFlag.push(CurveFlag);
  41364. $this.CurveFlagLast = CurveFlag;
  41365. $this.clearPoint();
  41366. $this.destroy();
  41367. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  41368. }
  41369. createPoint(cartesian) {
  41370. var $this = this;
  41371. var point2 = this.viewer.entities.add({
  41372. position: cartesian,
  41373. point: {
  41374. pixelSize: 10,
  41375. color: $this.Cesium.Color.RED,
  41376. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  41377. }
  41378. });
  41379. $this.entitiesPoint.push(point2);
  41380. return point2;
  41381. }
  41382. createCurveFlag() {
  41383. var $this = this;
  41384. var polygon2 = this.viewer.entities.add({
  41385. polygon: {
  41386. hierarchy: new $this.Cesium.CallbackProperty(function() {
  41387. if ($this.positions.length < 2)
  41388. return;
  41389. let lonlat = [];
  41390. let components = [];
  41391. let length = $this.positions.length;
  41392. for (let i2 = 0; i2 < length; i2++) {
  41393. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  41394. }
  41395. let startPoint = lonlat[0];
  41396. let endPoint = lonlat[lonlat.length - 1];
  41397. let point1 = startPoint;
  41398. let point2 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41399. let point3 = [(startPoint[0] + endPoint[0]) / 2, startPoint[1]];
  41400. let point4 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], -(endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41401. let point5 = [endPoint[0], startPoint[1]];
  41402. let point6 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41403. let point7 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 3 / 8 + startPoint[1]];
  41404. let point8 = [(startPoint[0] + endPoint[0]) / 2, (startPoint[1] + endPoint[1]) / 2];
  41405. let point9 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 5 / 8 + startPoint[1]];
  41406. let point10 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41407. [startPoint[0], endPoint[1]];
  41408. let curve1 = $this.getBezierPoints([point1, point2, point3, point4, point5]);
  41409. let curve2 = $this.getBezierPoints([point6, point7, point8, point9, point10]);
  41410. components = curve1.concat(curve2);
  41411. return new $this.Cesium.PolygonHierarchy(components);
  41412. }, false),
  41413. extrudedHeight: 1,
  41414. material: $this.Cesium.Color.RED
  41415. },
  41416. polyline: {
  41417. positions: new $this.Cesium.CallbackProperty(function() {
  41418. if ($this.positions.length < 2)
  41419. return;
  41420. let lonlat = [];
  41421. let components = [];
  41422. let length = $this.positions.length;
  41423. for (let i2 = 0; i2 < length; i2++) {
  41424. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  41425. }
  41426. let startPoint = lonlat[0];
  41427. let endPoint = lonlat[lonlat.length - 1];
  41428. let point1 = startPoint;
  41429. let point2 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41430. let point3 = [(startPoint[0] + endPoint[0]) / 2, startPoint[1]];
  41431. let point4 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], -(endPoint[1] - startPoint[1]) / 8 + startPoint[1]];
  41432. let point5 = [endPoint[0], startPoint[1]];
  41433. let point6 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41434. let point7 = [(endPoint[0] - startPoint[0]) * 3 / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 3 / 8 + startPoint[1]];
  41435. let point8 = [(startPoint[0] + endPoint[0]) / 2, (startPoint[1] + endPoint[1]) / 2];
  41436. let point9 = [(endPoint[0] - startPoint[0]) / 4 + startPoint[0], (endPoint[1] - startPoint[1]) * 5 / 8 + startPoint[1]];
  41437. let point10 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41438. let point11 = [startPoint[0], endPoint[1]];
  41439. let curve1 = $this.getBezierPoints([point1, point2, point3, point4, point5]);
  41440. let curve2 = $this.getBezierPoints([point6, point7, point8, point9, point10]);
  41441. components = curve1.concat(curve2);
  41442. components.push($this.LatlngTocartesian(point1));
  41443. components.push($this.LatlngTocartesian(point11));
  41444. return components;
  41445. }, false),
  41446. show: true,
  41447. material: $this.Cesium.Color.YELLOW,
  41448. width: 5,
  41449. clampToGround: true
  41450. }
  41451. });
  41452. $this.entitiesCurveFlag.push(polygon2);
  41453. return polygon2;
  41454. }
  41455. cartesianToLatlng(cartesian) {
  41456. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  41457. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  41458. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  41459. return [lng, lat];
  41460. }
  41461. LatlngTocartesian(latlng) {
  41462. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  41463. return cartesian3;
  41464. }
  41465. clearPoint() {
  41466. this.DrawEndEvent.raiseEvent(this.CurveFlagLast, [this.CurveFlagData[0], this.CurveFlagData[this.CurveFlagData.length - 1]], this.drawType);
  41467. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  41468. this.viewer.entities.remove(this.entitiesPoint[i2]);
  41469. }
  41470. this.entitiesPoint = [];
  41471. }
  41472. destroy() {
  41473. if (this.handler) {
  41474. this.handler.destroy();
  41475. this.handler = null;
  41476. }
  41477. }
  41478. clear() {
  41479. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  41480. this.viewer.entities.remove(this.entitiesPoint[i2]);
  41481. }
  41482. for (var i2 = 0; i2 < this.entitiesCurveFlag.length; i2++) {
  41483. this.viewer.entities.remove(this.entitiesCurveFlag[i2]);
  41484. }
  41485. this.identificationPoint = null;
  41486. this.CurveFlag = null;
  41487. this.CurveFlagLast = null;
  41488. this.positions = [];
  41489. this.entitiesPoint = [];
  41490. this.entitiesCurveFlag = [];
  41491. this.CurveFlagData = null;
  41492. }
  41493. getCatesian3FromPX(px) {
  41494. var cartesian;
  41495. var ray = this.viewer.camera.getPickRay(px);
  41496. if (!ray)
  41497. return null;
  41498. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  41499. return cartesian;
  41500. }
  41501. getBezierPoints(points2) {
  41502. let $this = this;
  41503. if (points2.length <= 2) {
  41504. return points2;
  41505. } else {
  41506. let bezierPoints = [];
  41507. let n = points2.length - 1;
  41508. for (let t2 = 0; t2 <= 1; t2 += 0.01) {
  41509. let [x, y] = [0, 0];
  41510. for (let index2 = 0; index2 <= n; index2++) {
  41511. let factor = $this.getBinomialFactor(n, index2);
  41512. let a = Math.pow(t2, index2);
  41513. let b = Math.pow(1 - t2, n - index2);
  41514. x += factor * a * b * points2[index2][0];
  41515. y += factor * a * b * points2[index2][1];
  41516. }
  41517. bezierPoints.push($this.LatlngTocartesian([x, y]));
  41518. }
  41519. bezierPoints.push($this.LatlngTocartesian(points2[n]));
  41520. return bezierPoints;
  41521. }
  41522. }
  41523. getBinomialFactor(n, index2) {
  41524. return this.getFactorial(n) / (this.getFactorial(index2) * this.getFactorial(n - index2));
  41525. }
  41526. getFactorial(n) {
  41527. let result = 1;
  41528. switch (n) {
  41529. case n <= 1:
  41530. result = 1;
  41531. break;
  41532. case n === 2:
  41533. result = 2;
  41534. break;
  41535. case n === 3:
  41536. result = 6;
  41537. break;
  41538. case n === 24:
  41539. result = 24;
  41540. break;
  41541. case n === 5:
  41542. result = 120;
  41543. break;
  41544. default:
  41545. for (let i2 = 1; i2 <= n; i2++) {
  41546. result *= i2;
  41547. }
  41548. break;
  41549. }
  41550. return result;
  41551. }
  41552. }
  41553. class DrawRectFlag {
  41554. constructor(arg) {
  41555. this.viewer = arg.viewer;
  41556. this.Cesium = arg.Cesium;
  41557. this.identificationPoint = null;
  41558. this.RectFlag = null;
  41559. this.RectFlagLast = null;
  41560. this.positions = [];
  41561. this.entitiesPoint = [];
  41562. this.entitiesRectFlag = [];
  41563. this.RectFlagData = null;
  41564. this.DrawStartEvent = new Cesium.Event();
  41565. this.DrawEndEvent = new Cesium.Event();
  41566. this._param = {
  41567. id: "DrawStraightArrow",
  41568. polygonColor: "rgba(0,255,0,0.5)",
  41569. outlineColor: "rgba(255, 255, 255, 1)",
  41570. outlineWidth: 1
  41571. };
  41572. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  41573. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  41574. }
  41575. getData() {
  41576. return this.RectFlagData;
  41577. }
  41578. computePosition(data) {
  41579. let $this = this;
  41580. var lnglatArr = [];
  41581. for (var i2 = 0; i2 < data.length; i2++) {
  41582. var lnglat = $this.cartesianToLatlng(data[i2]);
  41583. lnglatArr.push(lnglat);
  41584. }
  41585. let startPoint = lnglatArr[0];
  41586. let endPoint = lnglatArr[lnglatArr.length - 1];
  41587. let point0 = lnglatArr[0];
  41588. var point1 = [endPoint[0], startPoint[1]];
  41589. var point2 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41590. var point3 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41591. var point4 = [startPoint[0], endPoint[1]];
  41592. let componentspolygon = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0]);
  41593. let componentspolyline = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0, ...point4]);
  41594. let PolygonHierarchy = new $this.Cesium.PolygonHierarchy(componentspolygon);
  41595. $this.RectFlagData = lnglatArr;
  41596. console.log([PolygonHierarchy, componentspolyline]);
  41597. return [PolygonHierarchy, componentspolyline];
  41598. }
  41599. addload(data) {
  41600. var $this = this;
  41601. if (data.length < 2)
  41602. return;
  41603. let startPoint = data[0];
  41604. let endPoint = data[data.length - 1];
  41605. let point0 = data[0];
  41606. var point1 = [endPoint[0], startPoint[1]];
  41607. var point2 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41608. var point3 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41609. var point4 = [startPoint[0], endPoint[1]];
  41610. let componentspolygon = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0]);
  41611. let componentspolyline = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0, ...point4]);
  41612. var shape = this.viewer.entities.add({
  41613. Type: "DrawRectFlag",
  41614. Position: data,
  41615. id: data.id || $this.objId,
  41616. polygon: {
  41617. hierarchy: new $this.Cesium.PolygonHierarchy(componentspolygon),
  41618. extrudedHeight: 1,
  41619. material: $this.Cesium.Color.RED
  41620. },
  41621. polyline: {
  41622. positions: componentspolyline,
  41623. show: true,
  41624. material: $this.Cesium.Color.YELLOW,
  41625. width: 5,
  41626. clampToGround: true
  41627. }
  41628. });
  41629. $this.entitiesRectFlag.push(shape);
  41630. return shape;
  41631. }
  41632. startCreate(drawType) {
  41633. this.drawType = drawType;
  41634. var $this = this;
  41635. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  41636. this.handler.setInputAction(function(evt) {
  41637. var cartesian = $this.getCatesian3FromPX(evt.position);
  41638. if ($this.positions.length == 0) {
  41639. $this.positions.push(cartesian.clone());
  41640. $this.identificationPoint = $this.createPoint(cartesian);
  41641. $this.createPoint(cartesian);
  41642. $this.positions.push(cartesian);
  41643. }
  41644. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  41645. this.handler.setInputAction(function(evt) {
  41646. if ($this.positions.length < 2)
  41647. return;
  41648. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  41649. if (!$this.Cesium.defined($this.RectFlag)) {
  41650. $this.RectFlag = $this.createRectFlag();
  41651. }
  41652. $this.identificationPoint.position.setValue(cartesian);
  41653. if ($this.RectFlag) {
  41654. $this.positions.pop();
  41655. $this.positions.push(cartesian);
  41656. }
  41657. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  41658. this.handler.setInputAction(function(evt) {
  41659. if (!$this.RectFlag)
  41660. return;
  41661. var cartesian = $this.getCatesian3FromPX(evt.position);
  41662. $this.positions.pop();
  41663. $this.positions.push(cartesian);
  41664. $this.createPoint(cartesian);
  41665. $this.RectFlagData = $this.positions.concat();
  41666. $this.viewer.entities.remove($this.RectFlag);
  41667. $this.RectFlag = null;
  41668. $this.positions = [];
  41669. $this.identificationPoint.position.setValue(cartesian);
  41670. var lnglatArr = [];
  41671. for (var i2 = 0; i2 < $this.RectFlagData.length; i2++) {
  41672. var lnglat = $this.cartesianToLatlng($this.RectFlagData[i2]);
  41673. lnglatArr.push(lnglat);
  41674. }
  41675. $this.RectFlagData = lnglatArr;
  41676. var RectFlag = $this.addload([$this.RectFlagData[0], $this.RectFlagData[$this.RectFlagData.length - 1]]);
  41677. $this.entitiesRectFlag.push(RectFlag);
  41678. $this.RectFlagLast = RectFlag;
  41679. $this.clearPoint();
  41680. $this.destroy();
  41681. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  41682. }
  41683. createPoint(cartesian) {
  41684. var $this = this;
  41685. var point2 = this.viewer.entities.add({
  41686. position: cartesian,
  41687. point: {
  41688. pixelSize: 10,
  41689. color: $this.Cesium.Color.RED,
  41690. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  41691. }
  41692. });
  41693. $this.entitiesPoint.push(point2);
  41694. return point2;
  41695. }
  41696. createRectFlag() {
  41697. console.log("232323");
  41698. var $this = this;
  41699. var polygon2 = this.viewer.entities.add({
  41700. polygon: {
  41701. hierarchy: new $this.Cesium.CallbackProperty(function() {
  41702. if ($this.positions.length < 2)
  41703. return;
  41704. let lonlat = [];
  41705. let length = $this.positions.length;
  41706. for (let i2 = 0; i2 < length; i2++) {
  41707. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  41708. }
  41709. let startPoint = lonlat[0];
  41710. let endPoint = lonlat[lonlat.length - 1];
  41711. let point0 = lonlat[0];
  41712. var point1 = [endPoint[0], startPoint[1]];
  41713. var point2 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41714. var point3 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41715. [startPoint[0], endPoint[1]];
  41716. let components = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0]);
  41717. return new $this.Cesium.PolygonHierarchy(components);
  41718. }, false),
  41719. extrudedHeight: 1,
  41720. material: $this.Cesium.Color.RED
  41721. },
  41722. polyline: {
  41723. positions: new $this.Cesium.CallbackProperty(function() {
  41724. if ($this.positions.length < 2)
  41725. return;
  41726. let lonlat = [];
  41727. let length = $this.positions.length;
  41728. for (let i2 = 0; i2 < length; i2++) {
  41729. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  41730. }
  41731. let startPoint = lonlat[0];
  41732. let endPoint = lonlat[lonlat.length - 1];
  41733. let point0 = lonlat[0];
  41734. var point1 = [endPoint[0], startPoint[1]];
  41735. var point2 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41736. var point3 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41737. var point4 = [startPoint[0], endPoint[1]];
  41738. let components = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point3, ...point0, ...point4]);
  41739. return components;
  41740. }, false),
  41741. show: true,
  41742. material: $this.Cesium.Color.YELLOW,
  41743. width: 5,
  41744. clampToGround: true
  41745. }
  41746. });
  41747. $this.entitiesRectFlag.push(polygon2);
  41748. return polygon2;
  41749. }
  41750. cartesianToLatlng(cartesian) {
  41751. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  41752. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  41753. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  41754. return [lng, lat];
  41755. }
  41756. LatlngTocartesian(latlng) {
  41757. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  41758. return cartesian3;
  41759. }
  41760. clearPoint() {
  41761. this.DrawEndEvent.raiseEvent(this.RectFlagLast, [this.RectFlagData[0], this.RectFlagData[this.RectFlagData.length - 1]], this.drawType);
  41762. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  41763. this.viewer.entities.remove(this.entitiesPoint[i2]);
  41764. }
  41765. this.entitiesPoint = [];
  41766. }
  41767. destroy() {
  41768. if (this.handler) {
  41769. this.handler.destroy();
  41770. this.handler = null;
  41771. }
  41772. }
  41773. clear() {
  41774. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  41775. this.viewer.entities.remove(this.entitiesPoint[i2]);
  41776. }
  41777. for (var i2 = 0; i2 < this.entitiesRectFlag.length; i2++) {
  41778. this.viewer.entities.remove(this.entitiesRectFlag[i2]);
  41779. }
  41780. this.identificationPoint = null;
  41781. this.RectFlag = null;
  41782. this.RectFlagLast = null;
  41783. this.positions = [];
  41784. this.entitiesPoint = [];
  41785. this.entitiesRectFlag = [];
  41786. this.RectFlagData = null;
  41787. }
  41788. getCatesian3FromPX(px) {
  41789. var cartesian;
  41790. var ray = this.viewer.camera.getPickRay(px);
  41791. if (!ray)
  41792. return null;
  41793. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  41794. return cartesian;
  41795. }
  41796. }
  41797. class DrawTriangleFlag {
  41798. constructor(arg) {
  41799. this.viewer = arg.viewer;
  41800. this.Cesium = arg.Cesium;
  41801. this.identificationPoint = null;
  41802. this.TriangleFlag = null;
  41803. this.TriangleFlagLast = null;
  41804. this.positions = [];
  41805. this.entitiesPoint = [];
  41806. this.entitiesTriangleFlag = [];
  41807. this.TriangleFlagData = null;
  41808. this.DrawStartEvent = new Cesium.Event();
  41809. this.DrawEndEvent = new Cesium.Event();
  41810. this._param = {
  41811. id: "DrawStraightArrow",
  41812. polygonColor: "rgba(0,255,0,0.5)",
  41813. outlineColor: "rgba(255, 255, 255, 1)",
  41814. outlineWidth: 1
  41815. };
  41816. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  41817. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  41818. }
  41819. getData() {
  41820. return this.TriangleFlagData;
  41821. }
  41822. computePosition(data) {
  41823. let $this = this;
  41824. var lnglatArr = [];
  41825. for (var i2 = 0; i2 < data.length; i2++) {
  41826. var lnglat = $this.cartesianToLatlng(data[i2]);
  41827. lnglatArr.push(lnglat);
  41828. }
  41829. let startPoint = lnglatArr[0];
  41830. let endPoint = lnglatArr[lnglatArr.length - 1];
  41831. let point0 = lnglatArr[0];
  41832. var point1 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41833. var point2 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41834. var point3 = [startPoint[0], endPoint[1]];
  41835. let componentspolygon = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0]);
  41836. let componentspolyline = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0, ...point3]);
  41837. let PolygonHierarchy = new $this.Cesium.PolygonHierarchy(componentspolygon);
  41838. $this.TriangleFlagData = lnglatArr;
  41839. console.log([PolygonHierarchy, componentspolyline]);
  41840. return [PolygonHierarchy, componentspolyline];
  41841. }
  41842. addload(data) {
  41843. var $this = this;
  41844. if (data.length < 2)
  41845. return;
  41846. let startPoint = data[0];
  41847. let endPoint = data[data.length - 1];
  41848. let point0 = data[0];
  41849. var point1 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41850. var point2 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41851. var point3 = [startPoint[0], endPoint[1]];
  41852. let componentspolygon = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0]);
  41853. let componentspolyline = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0, ...point3]);
  41854. var shape = this.viewer.entities.add({
  41855. Type: "DrawTriangleFlag",
  41856. Position: data,
  41857. id: data.id || $this.objId,
  41858. polygon: {
  41859. hierarchy: new $this.Cesium.PolygonHierarchy(componentspolygon),
  41860. extrudedHeight: 1,
  41861. material: $this.Cesium.Color.RED
  41862. },
  41863. polyline: {
  41864. positions: componentspolyline,
  41865. show: true,
  41866. material: $this.Cesium.Color.YELLOW,
  41867. width: 5,
  41868. clampToGround: true
  41869. }
  41870. });
  41871. $this.entitiesTriangleFlag.push(shape);
  41872. return shape;
  41873. }
  41874. startCreate(drawType) {
  41875. this.drawType = drawType;
  41876. var $this = this;
  41877. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  41878. this.handler.setInputAction(function(evt) {
  41879. var cartesian = $this.getCatesian3FromPX(evt.position);
  41880. if ($this.positions.length == 0) {
  41881. $this.positions.push(cartesian.clone());
  41882. $this.identificationPoint = $this.createPoint(cartesian);
  41883. $this.createPoint(cartesian);
  41884. $this.positions.push(cartesian);
  41885. }
  41886. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  41887. this.handler.setInputAction(function(evt) {
  41888. if ($this.positions.length < 2)
  41889. return;
  41890. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  41891. if (!$this.Cesium.defined($this.TriangleFlag)) {
  41892. $this.TriangleFlag = $this.createTriangleFlag();
  41893. }
  41894. $this.identificationPoint.position.setValue(cartesian);
  41895. if ($this.TriangleFlag) {
  41896. $this.positions.pop();
  41897. $this.positions.push(cartesian);
  41898. }
  41899. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  41900. this.handler.setInputAction(function(evt) {
  41901. if (!$this.TriangleFlag)
  41902. return;
  41903. var cartesian = $this.getCatesian3FromPX(evt.position);
  41904. $this.positions.pop();
  41905. $this.positions.push(cartesian);
  41906. $this.createPoint(cartesian);
  41907. $this.TriangleFlagData = $this.positions.concat();
  41908. $this.viewer.entities.remove($this.TriangleFlag);
  41909. $this.TriangleFlag = null;
  41910. $this.positions = [];
  41911. $this.identificationPoint.position.setValue(cartesian);
  41912. var lnglatArr = [];
  41913. for (var i2 = 0; i2 < $this.TriangleFlagData.length; i2++) {
  41914. var lnglat = $this.cartesianToLatlng($this.TriangleFlagData[i2]);
  41915. lnglatArr.push(lnglat);
  41916. }
  41917. $this.TriangleFlagData = lnglatArr;
  41918. var TriangleFlag = $this.addload([$this.TriangleFlagData[0], $this.TriangleFlagData[$this.TriangleFlagData.length - 1]]);
  41919. $this.entitiesTriangleFlag.push(TriangleFlag);
  41920. $this.TriangleFlagLast = TriangleFlag;
  41921. $this.clearPoint();
  41922. $this.destroy();
  41923. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  41924. }
  41925. createPoint(cartesian) {
  41926. var $this = this;
  41927. var point2 = this.viewer.entities.add({
  41928. position: cartesian,
  41929. point: {
  41930. pixelSize: 10,
  41931. color: $this.Cesium.Color.RED,
  41932. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  41933. }
  41934. });
  41935. $this.entitiesPoint.push(point2);
  41936. return point2;
  41937. }
  41938. createTriangleFlag() {
  41939. console.log("232323");
  41940. var $this = this;
  41941. var polygon2 = this.viewer.entities.add({
  41942. polygon: {
  41943. hierarchy: new $this.Cesium.CallbackProperty(function() {
  41944. if ($this.positions.length < 2)
  41945. return;
  41946. let lonlat = [];
  41947. let length = $this.positions.length;
  41948. for (let i2 = 0; i2 < length; i2++) {
  41949. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  41950. }
  41951. let startPoint = lonlat[0];
  41952. let endPoint = lonlat[lonlat.length - 1];
  41953. let point0 = lonlat[0];
  41954. var point1 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41955. var point2 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41956. [startPoint[0], endPoint[1]];
  41957. let components = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0]);
  41958. return new $this.Cesium.PolygonHierarchy(components);
  41959. }, false),
  41960. extrudedHeight: 1,
  41961. material: $this.Cesium.Color.RED
  41962. },
  41963. polyline: {
  41964. positions: new $this.Cesium.CallbackProperty(function() {
  41965. if ($this.positions.length < 2)
  41966. return;
  41967. let lonlat = [];
  41968. let length = $this.positions.length;
  41969. for (let i2 = 0; i2 < length; i2++) {
  41970. lonlat.push($this.cartesianToLatlng($this.positions[i2]));
  41971. }
  41972. let startPoint = lonlat[0];
  41973. let endPoint = lonlat[lonlat.length - 1];
  41974. let point0 = lonlat[0];
  41975. var point1 = [endPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41976. var point2 = [startPoint[0], (startPoint[1] + endPoint[1]) / 2];
  41977. var point3 = [startPoint[0], endPoint[1]];
  41978. let components = $this.Cesium.Cartesian3.fromDegreesArray([...point0, ...point1, ...point2, ...point0, ...point3]);
  41979. return components;
  41980. }, false),
  41981. show: true,
  41982. material: $this.Cesium.Color.YELLOW,
  41983. width: 5,
  41984. clampToGround: true
  41985. }
  41986. });
  41987. $this.entitiesTriangleFlag.push(polygon2);
  41988. return polygon2;
  41989. }
  41990. cartesianToLatlng(cartesian) {
  41991. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  41992. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  41993. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  41994. return [lng, lat];
  41995. }
  41996. LatlngTocartesian(latlng) {
  41997. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  41998. return cartesian3;
  41999. }
  42000. clearPoint() {
  42001. this.DrawEndEvent.raiseEvent(this.TriangleFlagLast, [this.TriangleFlagData[0], this.TriangleFlagData[this.TriangleFlagData.length - 1]], this.drawType);
  42002. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  42003. this.viewer.entities.remove(this.entitiesPoint[i2]);
  42004. }
  42005. this.entitiesPoint = [];
  42006. }
  42007. destroy() {
  42008. if (this.handler) {
  42009. this.handler.destroy();
  42010. this.handler = null;
  42011. }
  42012. }
  42013. clear() {
  42014. for (var i2 = 0; i2 < this.entitiesPoint.length; i2++) {
  42015. this.viewer.entities.remove(this.entitiesPoint[i2]);
  42016. }
  42017. for (var i2 = 0; i2 < this.entitiesTriangleFlag.length; i2++) {
  42018. this.viewer.entities.remove(this.entitiesTriangleFlag[i2]);
  42019. }
  42020. this.identificationPoint = null;
  42021. this.TriangleFlag = null;
  42022. this.TriangleFlagLast = null;
  42023. this.positions = [];
  42024. this.entitiesPoint = [];
  42025. this.entitiesTriangleFlag = [];
  42026. this.TriangleFlagData = null;
  42027. }
  42028. getCatesian3FromPX(px) {
  42029. var cartesian;
  42030. var ray = this.viewer.camera.getPickRay(px);
  42031. if (!ray)
  42032. return null;
  42033. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42034. return cartesian;
  42035. }
  42036. }
  42037. class DrawPoint$1 {
  42038. constructor(arg) {
  42039. this.viewer = arg.viewer;
  42040. this.Cesium = arg.Cesium;
  42041. this._point = null;
  42042. this._pointData = null;
  42043. this._entities = [];
  42044. this.DrawStartEvent = new Cesium.Event();
  42045. this.DrawEndEvent = new Cesium.Event();
  42046. this._param = {
  42047. id: "DrawStraightArrow",
  42048. polygonColor: "rgba(0,255,0,0.5)",
  42049. outlineColor: "rgba(255, 255, 255, 1)",
  42050. outlineWidth: 1
  42051. };
  42052. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  42053. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  42054. }
  42055. get point() {
  42056. return this._point;
  42057. }
  42058. addload(data) {
  42059. return this.createPoint(data);
  42060. }
  42061. getData() {
  42062. return this._pointData;
  42063. }
  42064. computePosition(data) {
  42065. let $this = this;
  42066. var lnglatArr = [];
  42067. for (var i2 = 0; i2 < data.length; i2++) {
  42068. var lnglat = $this.cartesianToLatlng(data[i2]);
  42069. lnglatArr.push(lnglat);
  42070. }
  42071. $this._pointData = lnglatArr;
  42072. let point2 = lnglatArr[0];
  42073. return $this.Cesium.Cartesian3.fromDegrees(point2[0], point2[1]);
  42074. }
  42075. startCreate(drawType) {
  42076. this.drawType = drawType;
  42077. var $this = this;
  42078. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42079. this.handler.setInputAction(function(evt) {
  42080. var cartesian = $this.getCatesian3FromPX(evt.position);
  42081. if (!cartesian)
  42082. return;
  42083. let latlon = $this.cartesianToLatlng(cartesian);
  42084. var point2 = $this.createPoint(latlon);
  42085. $this._pointData = cartesian;
  42086. $this._point = point2;
  42087. $this.DrawEndEvent.raiseEvent($this._point, latlon, $this.drawType);
  42088. $this.destroy();
  42089. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42090. }
  42091. createPoint(cartesian) {
  42092. var $this = this;
  42093. var point2 = this.viewer.entities.add({
  42094. Type: "DrawPoint",
  42095. Position: [cartesian],
  42096. position: $this.Cesium.Cartesian3.fromDegrees(cartesian[0], cartesian[1]),
  42097. id: cartesian.id || $this.objId,
  42098. billboard: {
  42099. image: "./static/poi2.png",
  42100. verticalOrigin: Cesium.VerticalOrigin.BOTTOM
  42101. }
  42102. });
  42103. $this._entities.push(point2);
  42104. return point2;
  42105. }
  42106. cartesianToLatlng(cartesian) {
  42107. let ellipsoid = this.viewer.scene.globe.ellipsoid;
  42108. let cartographic = ellipsoid.cartesianToCartographic(cartesian);
  42109. let lat = Cesium.Math.toDegrees(cartographic.latitude);
  42110. let lng = Cesium.Math.toDegrees(cartographic.longitude);
  42111. return [lng, lat];
  42112. }
  42113. destroy() {
  42114. if (this.handler) {
  42115. this.handler.destroy();
  42116. this.handler = null;
  42117. }
  42118. }
  42119. clear() {
  42120. for (var i2 = 0; i2 < this._entities.length; i2++) {
  42121. this.viewer.entities.remove(this._entities[i2]);
  42122. }
  42123. this._entities = [];
  42124. this._point = null;
  42125. }
  42126. getCatesian3FromPX(px) {
  42127. var cartesian;
  42128. var ray = this.viewer.camera.getPickRay(px);
  42129. if (!ray)
  42130. return null;
  42131. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42132. return cartesian;
  42133. }
  42134. }
  42135. class DrawPolyline {
  42136. constructor(arg) {
  42137. this.viewer = arg.viewer;
  42138. this.Cesium = arg.Cesium;
  42139. this._polyline = null;
  42140. this._polylineLast = null;
  42141. this._positions = [];
  42142. this._entities_point = [];
  42143. this._entities_line = [];
  42144. this._polylineData = null;
  42145. this.DrawStartEvent = new Cesium.Event();
  42146. this.DrawEndEvent = new Cesium.Event();
  42147. this._param = {
  42148. id: "DrawStraightArrow",
  42149. polygonColor: "rgba(0,255,0,0.5)",
  42150. outlineColor: "rgba(255, 255, 255, 1)",
  42151. outlineWidth: 1
  42152. };
  42153. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  42154. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  42155. }
  42156. get line() {
  42157. return this._polylineLast;
  42158. }
  42159. getData() {
  42160. return this._polylineData;
  42161. }
  42162. computePosition(data) {
  42163. let $this = this;
  42164. var lnglatArr = [];
  42165. for (var i2 = 0; i2 < data.length; i2++) {
  42166. var lnglat = $this.cartesianToLatlng(data[i2]);
  42167. lnglatArr.push(lnglat);
  42168. }
  42169. $this._polylineData = lnglatArr;
  42170. return data;
  42171. }
  42172. addload(data) {
  42173. var $this = this;
  42174. var lnglatArr = [];
  42175. for (var i2 = 0; i2 < data.length; i2++) {
  42176. var lnglat = $this.LatlngTocartesian(data[i2]);
  42177. lnglatArr.push(lnglat);
  42178. }
  42179. var polyline = this.viewer.entities.add({
  42180. Type: "DrawPolyline",
  42181. Position: data,
  42182. id: data.id || $this.objId,
  42183. polyline: {
  42184. positions: lnglatArr,
  42185. show: true,
  42186. material: $this.Cesium.Color.RED,
  42187. width: 3,
  42188. clampToGround: true
  42189. }
  42190. });
  42191. return polyline;
  42192. }
  42193. startCreate(drawType) {
  42194. this.drawType = drawType;
  42195. var $this = this;
  42196. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42197. this.handler.setInputAction(function(evt) {
  42198. var cartesian = $this.getCatesian3FromPX(evt.position);
  42199. if ($this._positions.length == 0) {
  42200. $this._positions.push(cartesian.clone());
  42201. }
  42202. $this._positions.push(cartesian);
  42203. $this.createPoint(cartesian);
  42204. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42205. this.handler.setInputAction(function(evt) {
  42206. if ($this._positions.length < 1)
  42207. return;
  42208. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  42209. if (!$this.Cesium.defined($this._polyline)) {
  42210. $this._polyline = $this.createPolyline();
  42211. }
  42212. if ($this._polyline) {
  42213. $this._positions.pop();
  42214. $this._positions.push(cartesian);
  42215. }
  42216. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  42217. this.handler.setInputAction(function(evt) {
  42218. if (!$this._polyline)
  42219. return;
  42220. var cartesian = $this.getCatesian3FromPX(evt.position);
  42221. $this._positions.pop();
  42222. $this.createPoint(cartesian);
  42223. $this._polylineData = $this._positions.concat();
  42224. $this.viewer.entities.remove($this._polyline);
  42225. $this._polyline = null;
  42226. $this._positions = [];
  42227. var lnglatArr = [];
  42228. for (var i2 = 0; i2 < $this._polylineData.length; i2++) {
  42229. var lnglat = $this.cartesianToLatlng($this._polylineData[i2]);
  42230. lnglatArr.push(lnglat);
  42231. }
  42232. $this._polylineData = lnglatArr;
  42233. var line = $this.addload($this._polylineData);
  42234. $this._entities_line.push(line);
  42235. $this._polylineLast = line;
  42236. $this.clearPoint();
  42237. $this.destroy();
  42238. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  42239. }
  42240. createPoint(cartesian) {
  42241. var $this = this;
  42242. var point2 = this.viewer.entities.add({
  42243. position: cartesian,
  42244. point: {
  42245. pixelSize: 10,
  42246. color: $this.Cesium.Color.RED,
  42247. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  42248. }
  42249. });
  42250. $this._entities_point.push(point2);
  42251. return point2;
  42252. }
  42253. createPolyline() {
  42254. var $this = this;
  42255. var polyline = this.viewer.entities.add({
  42256. polyline: {
  42257. positions: new $this.Cesium.CallbackProperty(function() {
  42258. return $this._positions;
  42259. }, false),
  42260. show: true,
  42261. material: $this.Cesium.Color.RED,
  42262. width: 3,
  42263. clampToGround: true
  42264. }
  42265. });
  42266. $this._entities_line.push(polyline);
  42267. return polyline;
  42268. }
  42269. cartesianToLatlng(cartesian) {
  42270. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  42271. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  42272. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  42273. return [lng, lat];
  42274. }
  42275. LatlngTocartesian(latlng) {
  42276. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  42277. return cartesian3;
  42278. }
  42279. clearPoint() {
  42280. this.DrawEndEvent.raiseEvent(this._polylineLast, this._polylineData, this.drawType);
  42281. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42282. this.viewer.entities.remove(this._entities_point[i2]);
  42283. }
  42284. this._entities_point = [];
  42285. }
  42286. destroy() {
  42287. if (this.handler) {
  42288. this.handler.destroy();
  42289. this.handler = null;
  42290. }
  42291. }
  42292. clear() {
  42293. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42294. this.viewer.entities.remove(this._entities_point[i2]);
  42295. }
  42296. for (var i2 = 0; i2 < this._entities_line.length; i2++) {
  42297. this.viewer.entities.remove(this._entities_line[i2]);
  42298. }
  42299. this._polyline = null;
  42300. this._positions = [];
  42301. this._entities_point = [];
  42302. this._entities_line = [];
  42303. this._polylineData = null;
  42304. this._polylineLast = null;
  42305. }
  42306. getCatesian3FromPX(px) {
  42307. var cartesian;
  42308. var ray = this.viewer.camera.getPickRay(px);
  42309. if (!ray)
  42310. return null;
  42311. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42312. return cartesian;
  42313. }
  42314. }
  42315. class DrawPolygon {
  42316. constructor(arg) {
  42317. this.viewer = arg.viewer;
  42318. this.Cesium = arg.Cesium;
  42319. this._polygon = null;
  42320. this._polygonLast = null;
  42321. this._positions = [];
  42322. this._entities_point = [];
  42323. this._entities_polygon = [];
  42324. this._polygonData = null;
  42325. this.DrawStartEvent = new Cesium.Event();
  42326. this.DrawEndEvent = new Cesium.Event();
  42327. this._param = {
  42328. id: "DrawStraightArrow",
  42329. polygonColor: "rgba(0,255,0,0.5)",
  42330. outlineColor: "rgba(255, 255, 255, 1)",
  42331. outlineWidth: 1
  42332. };
  42333. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  42334. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  42335. }
  42336. get polygon() {
  42337. return this._polygonLast;
  42338. }
  42339. getData() {
  42340. return this._polygonData;
  42341. }
  42342. computePosition(data) {
  42343. let $this = this;
  42344. var lnglatArr = [];
  42345. for (var i2 = 0; i2 < data.length; i2++) {
  42346. var lnglat = $this.cartesianToLatlng(data[i2]);
  42347. lnglatArr.push(lnglat);
  42348. }
  42349. $this._polygonData = lnglatArr;
  42350. return new $this.Cesium.PolygonHierarchy(data);
  42351. }
  42352. addload(data) {
  42353. var $this = this;
  42354. var lnglatArr = [];
  42355. for (var i2 = 0; i2 < data.length; i2++) {
  42356. var lnglat = $this.LatlngTocartesian(data[i2]);
  42357. lnglatArr.push(lnglat);
  42358. }
  42359. return this.viewer.entities.add({
  42360. Type: "DrawPolygon",
  42361. Position: data,
  42362. id: data.id || $this.objId,
  42363. polygon: {
  42364. hierarchy: new $this.Cesium.PolygonHierarchy(lnglatArr),
  42365. clampToGround: true,
  42366. show: true,
  42367. fill: true,
  42368. material: $this.Cesium.Color.RED.withAlpha(0.9),
  42369. width: 3,
  42370. outlineColor: $this.Cesium.Color.BLACK,
  42371. outlineWidth: 1,
  42372. outline: false
  42373. }
  42374. });
  42375. }
  42376. startCreate(drawType) {
  42377. this.drawType = drawType;
  42378. var $this = this;
  42379. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42380. this.handler.setInputAction(function(evt) {
  42381. var cartesian = $this.getCatesian3FromPX(evt.position);
  42382. if ($this._positions.length == 0) {
  42383. $this._positions.push(cartesian.clone());
  42384. }
  42385. $this.createPoint(cartesian);
  42386. $this._positions.push(cartesian);
  42387. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42388. this.handler.setInputAction(function(evt) {
  42389. if ($this._positions.length < 1)
  42390. return;
  42391. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  42392. if ($this._positions.length == 3) {
  42393. if (!$this.Cesium.defined($this._polygon)) {
  42394. $this._polygon = $this.createPolygon();
  42395. }
  42396. }
  42397. $this._positions.pop();
  42398. $this._positions.push(cartesian);
  42399. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  42400. this.handler.setInputAction(function(evt) {
  42401. if (!$this._polygon)
  42402. return;
  42403. var cartesian = $this.getCatesian3FromPX(evt.position);
  42404. $this._positions.pop();
  42405. $this.createPoint(cartesian);
  42406. $this._polygonData = $this._positions.concat();
  42407. $this.viewer.entities.remove($this._positions);
  42408. $this._positions = null;
  42409. $this._positions = [];
  42410. var lnglatArr = [];
  42411. for (var i2 = 0; i2 < $this._polygonData.length; i2++) {
  42412. var lnglat = $this.cartesianToLatlng($this._polygonData[i2]);
  42413. lnglatArr.push(lnglat);
  42414. }
  42415. $this._polygonData = lnglatArr;
  42416. var Polygon = $this.addload($this._polygonData);
  42417. $this._entities_polygon.push(Polygon);
  42418. $this._polygonLast = Polygon;
  42419. $this.clearPoint();
  42420. $this.destroy();
  42421. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  42422. }
  42423. createPolygon() {
  42424. var $this = this;
  42425. var polygon2 = this.viewer.entities.add({
  42426. polygon: {
  42427. hierarchy: new $this.Cesium.CallbackProperty(function() {
  42428. return new $this.Cesium.PolygonHierarchy($this._positions);
  42429. }, false),
  42430. clampToGround: true,
  42431. show: true,
  42432. fill: true,
  42433. material: $this.Cesium.Color.RED.withAlpha(0.5),
  42434. width: 3,
  42435. outlineColor: $this.Cesium.Color.BLACK,
  42436. outlineWidth: 1,
  42437. outline: false
  42438. }
  42439. });
  42440. $this._entities_polygon.push(polygon2);
  42441. return polygon2;
  42442. }
  42443. cartesianToLatlng(cartesian) {
  42444. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  42445. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  42446. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  42447. return [lng, lat];
  42448. }
  42449. LatlngTocartesian(latlng) {
  42450. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  42451. return cartesian3;
  42452. }
  42453. clearPoint() {
  42454. this.DrawEndEvent.raiseEvent(this._polygonLast, this._polygonData, this.drawType);
  42455. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42456. this.viewer.entities.remove(this._entities_point[i2]);
  42457. }
  42458. this._entities_point = [];
  42459. }
  42460. createPoint(cartesian) {
  42461. var $this = this;
  42462. var point2 = this.viewer.entities.add({
  42463. position: cartesian,
  42464. point: {
  42465. pixelSize: 10,
  42466. color: $this.Cesium.Color.RED,
  42467. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  42468. }
  42469. });
  42470. $this._entities_point.push(point2);
  42471. return point2;
  42472. }
  42473. destroy() {
  42474. if (this.handler) {
  42475. this.handler.destroy();
  42476. this.handler = null;
  42477. }
  42478. }
  42479. clear() {
  42480. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42481. this.viewer.entities.remove(this._entities_point[i2]);
  42482. }
  42483. for (var i2 = 0; i2 < this._entities_polygon.length; i2++) {
  42484. this.viewer.entities.remove(this._entities_polygon[i2]);
  42485. }
  42486. this._polygon = null;
  42487. this._polygonLast = null;
  42488. this._positions = [];
  42489. this._entities_point = [];
  42490. this._entities_polygon = [];
  42491. this._polygonData = null;
  42492. }
  42493. getCatesian3FromPX(px) {
  42494. var cartesian;
  42495. var ray = this.viewer.camera.getPickRay(px);
  42496. if (!ray)
  42497. return null;
  42498. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42499. return cartesian;
  42500. }
  42501. }
  42502. class DrawRectangle {
  42503. constructor(arg) {
  42504. this.viewer = arg.viewer;
  42505. this.Cesium = arg.Cesium;
  42506. this.floatingPoint = null;
  42507. this._rectangle = null;
  42508. this._rectangleLast = null;
  42509. this._positions = [];
  42510. this._entities_point = [];
  42511. this._entities_rectangle = [];
  42512. this._rectangleData = null;
  42513. this.DrawStartEvent = new Cesium.Event();
  42514. this.DrawEndEvent = new Cesium.Event();
  42515. this._param = {
  42516. id: "DrawStraightArrow",
  42517. polygonColor: "rgba(0,255,0,0.5)",
  42518. outlineColor: "rgba(255, 255, 255, 1)",
  42519. outlineWidth: 1
  42520. };
  42521. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  42522. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  42523. }
  42524. get line() {
  42525. return this._rectangleLast;
  42526. }
  42527. getData() {
  42528. return this._rectangleData;
  42529. }
  42530. computePosition(data) {
  42531. let $this = this;
  42532. var lnglatArr = [];
  42533. for (var i2 = 0; i2 < data.length; i2++) {
  42534. var lnglat = $this.cartesianToLatlng(data[i2]);
  42535. lnglatArr.push(lnglat);
  42536. }
  42537. $this._rectangleData = lnglatArr;
  42538. return new $this.Cesium.Rectangle.fromCartesianArray(data);
  42539. }
  42540. addload(data) {
  42541. var $this = this;
  42542. var lnglatArr = [];
  42543. for (var i2 = 0; i2 < data.length; i2++) {
  42544. var lnglat = $this.LatlngTocartesian(data[i2]);
  42545. lnglatArr.push(lnglat);
  42546. }
  42547. var shape = this.viewer.entities.add({
  42548. Type: "DrawRectangle",
  42549. Position: data,
  42550. id: data.id || $this.objId,
  42551. rectangle: {
  42552. coordinates: $this.Cesium.Rectangle.fromCartesianArray(lnglatArr),
  42553. material: $this.Cesium.Color.RED.withAlpha(0.9)
  42554. }
  42555. });
  42556. $this._entities_rectangle.push(shape);
  42557. return shape;
  42558. }
  42559. startCreate(drawType) {
  42560. this.drawType = drawType;
  42561. var $this = this;
  42562. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42563. this.handler.setInputAction(function(evt) {
  42564. var cartesian = $this.getCatesian3FromPX(evt.position);
  42565. if ($this._positions.length == 0) {
  42566. $this._positions.push(cartesian.clone());
  42567. $this.floatingPoint = $this.createPoint(cartesian);
  42568. $this.createPoint(cartesian);
  42569. $this._positions.push(cartesian);
  42570. }
  42571. if ($this._positions.length == 2) {
  42572. $this._positions.push(cartesian);
  42573. }
  42574. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42575. this.handler.setInputAction(function(evt) {
  42576. if ($this._positions.length < 3)
  42577. return;
  42578. var cartesian = $this.getCatesian3FromPX(evt.endPosition);
  42579. if (!$this.Cesium.defined($this._rectangle)) {
  42580. $this._rectangle = $this.createRectangle();
  42581. }
  42582. $this.floatingPoint.position.setValue(cartesian);
  42583. if ($this._rectangle) {
  42584. $this._positions.pop();
  42585. $this._positions.push(cartesian);
  42586. }
  42587. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  42588. this.handler.setInputAction(function(evt) {
  42589. if (!$this._rectangle)
  42590. return;
  42591. var cartesian = $this.getCatesian3FromPX(evt.position);
  42592. $this._positions.pop();
  42593. $this._positions.push(cartesian);
  42594. $this.createPoint(cartesian);
  42595. $this._rectangleData = $this._positions.concat();
  42596. $this.viewer.entities.remove($this._rectangle);
  42597. $this._rectangle = null;
  42598. $this._positions = [];
  42599. $this.floatingPoint.position.setValue(cartesian);
  42600. var lnglatArr = [];
  42601. for (var i2 = 0; i2 < $this._rectangleData.length; i2++) {
  42602. var lnglat = $this.cartesianToLatlng($this._rectangleData[i2]);
  42603. lnglatArr.push(lnglat);
  42604. }
  42605. $this._rectangleData = lnglatArr;
  42606. var rectangle = $this.addload([$this._rectangleData[0], $this._rectangleData[$this._rectangleData.length - 1]]);
  42607. $this._entities_rectangle.push(rectangle);
  42608. $this._rectangleLast = rectangle;
  42609. $this.clearPoint();
  42610. $this.destroy();
  42611. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  42612. }
  42613. createPoint(cartesian) {
  42614. var $this = this;
  42615. var point2 = this.viewer.entities.add({
  42616. position: cartesian,
  42617. point: {
  42618. pixelSize: 10,
  42619. color: $this.Cesium.Color.RED,
  42620. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  42621. }
  42622. });
  42623. $this._entities_point.push(point2);
  42624. return point2;
  42625. }
  42626. createRectangle() {
  42627. var $this = this;
  42628. var shape = this.viewer.entities.add({
  42629. name: "rectangle",
  42630. rectangle: {
  42631. coordinates: new $this.Cesium.CallbackProperty(function() {
  42632. var obj = $this.Cesium.Rectangle.fromCartesianArray($this._positions);
  42633. return obj;
  42634. }, false),
  42635. material: $this.Cesium.Color.RED.withAlpha(0.5)
  42636. }
  42637. });
  42638. $this._entities_rectangle.push(shape);
  42639. return shape;
  42640. }
  42641. cartesianToLatlng(cartesian) {
  42642. var latlng = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  42643. var lat = this.Cesium.Math.toDegrees(latlng.latitude);
  42644. var lng = this.Cesium.Math.toDegrees(latlng.longitude);
  42645. return [lng, lat];
  42646. }
  42647. LatlngTocartesian(latlng) {
  42648. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  42649. return cartesian3;
  42650. }
  42651. clearPoint() {
  42652. this.DrawEndEvent.raiseEvent(this._rectangleLast, [this._rectangleData[0], this._rectangleData[this._rectangleData.length - 1]], this.drawType);
  42653. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42654. this.viewer.entities.remove(this._entities_point[i2]);
  42655. }
  42656. this._entities_point = [];
  42657. }
  42658. destroy() {
  42659. if (this.handler) {
  42660. this.handler.destroy();
  42661. this.handler = null;
  42662. }
  42663. }
  42664. clear() {
  42665. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42666. this.viewer.entities.remove(this._entities_point[i2]);
  42667. }
  42668. for (var i2 = 0; i2 < this._entities_rectangle.length; i2++) {
  42669. this.viewer.entities.remove(this._entities_rectangle[i2]);
  42670. }
  42671. this.floatingPoint = null;
  42672. this._rectangle = null;
  42673. this._rectangleLast = null;
  42674. this._positions = [];
  42675. this._entities_point = [];
  42676. this._entities_rectangle = [];
  42677. this._rectangleData = null;
  42678. }
  42679. getCatesian3FromPX(px) {
  42680. var cartesian;
  42681. var ray = this.viewer.camera.getPickRay(px);
  42682. if (!ray)
  42683. return null;
  42684. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42685. return cartesian;
  42686. }
  42687. }
  42688. class DrawCircle {
  42689. constructor(arg) {
  42690. this.viewer = arg.viewer;
  42691. this.Cesium = arg.Cesium;
  42692. this._cicle = null;
  42693. this.floatingPoint = null;
  42694. this._cicleLast = null;
  42695. this._positions = [];
  42696. this._entities_point = [];
  42697. this._entities_cicle = [];
  42698. this._cicleData = null;
  42699. this.DrawStartEvent = new Cesium.Event();
  42700. this.DrawEndEvent = new Cesium.Event();
  42701. this._param = {
  42702. id: "DrawStraightArrow",
  42703. polygonColor: "rgba(0,255,0,0.5)",
  42704. outlineColor: "rgba(255, 255, 255, 1)",
  42705. outlineWidth: 1
  42706. };
  42707. this.polygonMaterial = Cesium.Color.fromCssColorString(this._param.polygonColor);
  42708. this.outlineMaterial = Cesium.Color.fromCssColorString(this._param.outlineColor);
  42709. }
  42710. get cicle() {
  42711. return this._cicleLast;
  42712. }
  42713. addload(data) {
  42714. var that = this;
  42715. let lnglatArr = [];
  42716. for (var i2 = 0; i2 < data.length; i2++) {
  42717. var lnglat = that.LatlngTocartesian(data[i2]);
  42718. lnglatArr.push(lnglat);
  42719. }
  42720. var value = lnglatArr;
  42721. var r2 = Math.sqrt(
  42722. Math.pow(value[0].x - value[value.length - 1].x, 2) + Math.pow(value[0].y - value[value.length - 1].y, 2)
  42723. );
  42724. var position2 = value[0];
  42725. var shape = that.viewer.entities.add({
  42726. Type: "DrawCircle",
  42727. Position: [data[0], data[data.length - 1]],
  42728. position: position2,
  42729. id: data.id || that.objId,
  42730. ellipse: {
  42731. semiMinorAxis: r2,
  42732. semiMajorAxis: r2,
  42733. material: that.Cesium.Color.RED.withAlpha(0.9),
  42734. show: true,
  42735. clampToGround: true
  42736. }
  42737. });
  42738. return shape;
  42739. }
  42740. getData() {
  42741. return this._cicleData;
  42742. }
  42743. computePosition(data) {
  42744. var that = this;
  42745. let lnglatArr = [];
  42746. for (var i2 = 0; i2 < data.length; i2++) {
  42747. var lnglat = that.cartesianToLatlng(data[i2]);
  42748. lnglatArr.push(lnglat);
  42749. }
  42750. that._cicleData = lnglatArr;
  42751. var value = data;
  42752. var r2 = Math.sqrt(
  42753. Math.pow(value[0].x - value[value.length - 1].x, 2) + Math.pow(value[0].y - value[value.length - 1].y, 2)
  42754. );
  42755. var position2 = value[0];
  42756. return { position: position2, r: r2 };
  42757. }
  42758. startCreate(drawType) {
  42759. this.drawType = drawType;
  42760. this.handler = new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42761. this.viewer.scene.globe.depthTestAgainstTerrain = true;
  42762. var $this = this;
  42763. this.handler.setInputAction(function(evt) {
  42764. $this.viewer.scene.globe.depthTestAgainstTerrain = true;
  42765. var cartesian = $this.getCatesian3FromPX(evt.position);
  42766. if ($this._positions.length == 0) {
  42767. $this._positions.push(cartesian.clone());
  42768. $this.floatingPoint = $this.createPoint(cartesian);
  42769. $this._positions.push(cartesian);
  42770. }
  42771. if (!$this._cicle) {
  42772. $this.createPoint(cartesian);
  42773. }
  42774. }, $this.Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42775. this.handler.setInputAction(function(evt) {
  42776. if ($this._positions.length < 1)
  42777. return;
  42778. var cartesian = $this.viewer.scene.pickPosition(evt.endPosition);
  42779. if (!$this.Cesium.defined($this._cicle)) {
  42780. $this._cicle = $this.createCicle();
  42781. }
  42782. $this.floatingPoint.position.setValue(cartesian);
  42783. if ($this._cicle) {
  42784. $this._positions.pop();
  42785. $this._positions.push(cartesian);
  42786. }
  42787. }, $this.Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  42788. this.handler.setInputAction(function(evt) {
  42789. if (!$this._cicle)
  42790. return;
  42791. $this.viewer.scene.globe.depthTestAgainstTerrain = false;
  42792. var cartesian = $this.viewer.scene.pickPosition(evt.position);
  42793. $this._positions.pop();
  42794. $this._positions.push(cartesian);
  42795. $this._cicleData = $this._positions.concat();
  42796. $this.viewer.entities.remove($this._cicle);
  42797. $this._cicle = null;
  42798. $this._positions = [];
  42799. $this.floatingPoint.position.setValue(cartesian);
  42800. let lnglatArr = [];
  42801. for (var i2 = 0; i2 < $this._cicleData.length; i2++) {
  42802. var lnglat = $this.cartesianToLatlng($this._cicleData[i2]);
  42803. lnglatArr.push(lnglat);
  42804. }
  42805. $this._cicleData = lnglatArr;
  42806. var cicle = $this.addload($this._cicleData);
  42807. $this._entities_cicle.push(cicle);
  42808. $this._cicleLast = cicle;
  42809. $this.clearPoint();
  42810. $this.destroy();
  42811. }, $this.Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  42812. }
  42813. createCicle() {
  42814. var that = this;
  42815. var shape = this.viewer.entities.add({
  42816. position: that._positions[0],
  42817. ellipse: {
  42818. semiMinorAxis: new that.Cesium.CallbackProperty(function() {
  42819. var r2 = Math.sqrt(
  42820. Math.pow(that._positions[0].x - that._positions[that._positions.length - 1].x, 2) + Math.pow(that._positions[0].y - that._positions[that._positions.length - 1].y, 2)
  42821. );
  42822. return r2 ? r2 : r2 + 1;
  42823. }, false),
  42824. semiMajorAxis: new that.Cesium.CallbackProperty(function() {
  42825. var r2 = Math.sqrt(
  42826. Math.pow(that._positions[0].x - that._positions[that._positions.length - 1].x, 2) + Math.pow(that._positions[0].y - that._positions[that._positions.length - 1].y, 2)
  42827. );
  42828. return r2 ? r2 : r2 + 1;
  42829. }, false),
  42830. material: that.Cesium.Color.RED.withAlpha(0.5),
  42831. outline: true
  42832. }
  42833. });
  42834. that._entities_cicle.push(shape);
  42835. return shape;
  42836. }
  42837. createPoint(cartesian) {
  42838. var $this = this;
  42839. var point2 = this.viewer.entities.add({
  42840. position: cartesian,
  42841. point: {
  42842. pixelSize: 10,
  42843. color: $this.Cesium.Color.RED,
  42844. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  42845. }
  42846. });
  42847. $this._entities_point.push(point2);
  42848. return point2;
  42849. }
  42850. getCatesian3FromPX(px) {
  42851. var cartesian;
  42852. var ray = this.viewer.camera.getPickRay(px);
  42853. if (!ray)
  42854. return null;
  42855. cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  42856. return cartesian;
  42857. }
  42858. cartesianToLatlng(cartesian) {
  42859. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  42860. let lat = this.Cesium.Math.toDegrees(cartographic.latitude);
  42861. let lng = this.Cesium.Math.toDegrees(cartographic.longitude);
  42862. cartographic.height;
  42863. return [lng, lat];
  42864. }
  42865. LatlngTocartesian(latlng) {
  42866. let cartesian3 = this.Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1], 0);
  42867. return cartesian3;
  42868. }
  42869. destroy() {
  42870. if (this.handler) {
  42871. this.handler.destroy();
  42872. this.handler = null;
  42873. }
  42874. }
  42875. clearPoint() {
  42876. this.DrawEndEvent.raiseEvent(this._cicleLast, this._cicleData, this.drawType);
  42877. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42878. this.viewer.entities.remove(this._entities_point[i2]);
  42879. }
  42880. this._entities_point = [];
  42881. }
  42882. clear() {
  42883. for (var i2 = 0; i2 < this._entities_point.length; i2++) {
  42884. this.viewer.entities.remove(this._entities_point[i2]);
  42885. }
  42886. for (var i2 = 0; i2 < this._entities_cicle.length; i2++) {
  42887. this.viewer.entities.remove(this._entities_cicle[i2]);
  42888. }
  42889. this._cicle = null;
  42890. this.floatingPoint = null;
  42891. this._cicleLast = null;
  42892. this._positions = [];
  42893. this._entities_point = [];
  42894. this._entities_cicle = [];
  42895. this._cicleData = null;
  42896. }
  42897. }
  42898. let MilitaryPlot = {
  42899. DrawStraightArrow,
  42900. DrawAttackArrow,
  42901. DrawPincerArrow,
  42902. DrawGatheringPlace,
  42903. DrawClosedCurve,
  42904. DrawSector,
  42905. DrawBowLine,
  42906. DrawBowPlane,
  42907. DrawCurve,
  42908. DrawCurveFlag,
  42909. DrawRectFlag,
  42910. DrawTriangleFlag,
  42911. DrawPoint: DrawPoint$1,
  42912. DrawPolyline,
  42913. DrawPolygon,
  42914. DrawRectangle,
  42915. DrawCircle
  42916. };
  42917. class EntityEdit {
  42918. constructor(viewer2) {
  42919. this.viewer = viewer2;
  42920. this.DrawExample = "";
  42921. this.midVertexEntities = [];
  42922. this.initEventHandler();
  42923. }
  42924. initEventHandler() {
  42925. this.eventHandler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  42926. this.EditEndEvent = new Cesium.Event();
  42927. this.EditEndEntity = new Cesium.Event();
  42928. }
  42929. activate() {
  42930. this.deactivate();
  42931. this.initLeftClickEventHandler();
  42932. }
  42933. deactivate() {
  42934. this.DrawExample = "";
  42935. this.eventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42936. this.unRegisterEvents();
  42937. this.clearAllEditVertex();
  42938. }
  42939. clearAllEditVertex() {
  42940. this.clearEditVertex();
  42941. this.clearMidVertex();
  42942. }
  42943. initLeftClickEventHandler() {
  42944. this.eventHandler.setInputAction((e) => {
  42945. let id = this.viewer.scene.pick(e.position);
  42946. if (!id || !id.id) {
  42947. this.handleEditEntity();
  42948. return;
  42949. }
  42950. if (!id.id || !id.id.Type)
  42951. return;
  42952. if (this.editEntity && this.editEntity.id == id.id.id)
  42953. return;
  42954. this.handleEditEntity();
  42955. this.handlePickEditEntity(id.id);
  42956. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  42957. }
  42958. handleEditEntity() {
  42959. this.unRegisterEvents();
  42960. this.clearAllEditVertex();
  42961. let editEntity = this.editEntity;
  42962. if (!editEntity)
  42963. return;
  42964. this.closeEntityEditMode();
  42965. this.editEntity = void 0;
  42966. if (!this.isEdited)
  42967. return;
  42968. this.EditEndEvent.raiseEvent(editEntity);
  42969. this.isEdited = false;
  42970. this.isEditing = false;
  42971. }
  42972. handlePickEditEntity(pickId) {
  42973. const EditableTypes = ["DrawAttackArrow", "DrawCircle", "DrawCurve", "DrawPincerArrow", "DrawPoint", "DrawPolygon", "DrawPolyline", "DrawRectangle", "DrawStraightArrow", "DrawGatheringPlace", "DrawSector", "DrawClosedCurve", "DrawBowLine", "DrawBowPlane", "DrawRectFlag", "DrawTriangleFlag", "DrawCurveFlag"];
  42974. if (EditableTypes.indexOf(pickId.Type) == -1)
  42975. return;
  42976. this.editEntity = pickId;
  42977. this.EditEndEntity.raiseEvent(this.editEntity);
  42978. this.isEditing = false;
  42979. this.isEdited = false;
  42980. this.editPositions = this.getEditEntityPositions();
  42981. this.EditMoveCenterPositoin = this.getCenterPosition();
  42982. this.openEntityEditModel();
  42983. this.clearAllEditVertex();
  42984. this.unRegisterEvents();
  42985. this.createEditVertex();
  42986. this.createMidVertex();
  42987. this.registerEvents();
  42988. }
  42989. openEntityEditModel() {
  42990. if (this.DrawExample == "")
  42991. return;
  42992. switch (this.editEntity.Type) {
  42993. case "DrawStraightArrow":
  42994. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  42995. return this.DrawExample.computePosition(this.editPositions);
  42996. }, false);
  42997. break;
  42998. case "DrawAttackArrow":
  42999. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43000. return this.DrawExample.computePosition(this.editPositions);
  43001. }, false);
  43002. break;
  43003. case "DrawPincerArrow":
  43004. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43005. return this.DrawExample.computePosition(this.editPositions);
  43006. }, false);
  43007. break;
  43008. case "DrawGatheringPlace":
  43009. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43010. return this.DrawExample.computePosition(this.editPositions);
  43011. }, false);
  43012. break;
  43013. case "DrawClosedCurve":
  43014. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43015. return this.DrawExample.computePosition(this.editPositions).PolygonHierarchy;
  43016. }, false);
  43017. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43018. return this.DrawExample.computePosition(this.editPositions).pList;
  43019. }, false);
  43020. break;
  43021. case "DrawCircle":
  43022. this.editEntity.position = new Cesium.CallbackProperty((e) => {
  43023. return this.DrawExample.computePosition(this.editPositions).position;
  43024. }, false);
  43025. this.editEntity.ellipse.semiMinorAxis = new Cesium.CallbackProperty((e) => {
  43026. return this.DrawExample.computePosition(this.editPositions).r;
  43027. }, false);
  43028. this.editEntity.ellipse.semiMajorAxis = new Cesium.CallbackProperty((e) => {
  43029. return this.DrawExample.computePosition(this.editPositions).r;
  43030. }, false);
  43031. break;
  43032. case "DrawCurve":
  43033. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43034. return this.DrawExample.computePosition(this.editPositions);
  43035. }, false);
  43036. break;
  43037. case "DrawPoint":
  43038. this.editEntity.position = new Cesium.CallbackProperty((e) => {
  43039. return this.editPositions[0];
  43040. }, false);
  43041. break;
  43042. case "DrawPolygon":
  43043. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43044. return this.DrawExample.computePosition(this.editPositions);
  43045. }, false);
  43046. break;
  43047. case "DrawPolyline":
  43048. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43049. return this.DrawExample.computePosition(this.editPositions);
  43050. }, false);
  43051. break;
  43052. case "DrawRectangle":
  43053. this.editEntity.rectangle.coordinates = new Cesium.CallbackProperty((e) => {
  43054. return this.DrawExample.computePosition(this.editPositions);
  43055. }, false);
  43056. break;
  43057. case "DrawSector":
  43058. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43059. return this.DrawExample.computePosition(this.editPositions);
  43060. }, false);
  43061. break;
  43062. case "DrawBowLine":
  43063. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43064. return this.DrawExample.computePosition(this.editPositions);
  43065. }, false);
  43066. break;
  43067. case "DrawBowPlane":
  43068. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43069. return this.DrawExample.computePosition(this.editPositions);
  43070. }, false);
  43071. break;
  43072. case "DrawRectFlag":
  43073. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43074. return this.DrawExample.computePosition(this.editPositions)[0];
  43075. }, false);
  43076. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43077. return this.DrawExample.computePosition(this.editPositions)[1];
  43078. }, false);
  43079. break;
  43080. case "DrawTriangleFlag":
  43081. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43082. return this.DrawExample.computePosition(this.editPositions)[0];
  43083. }, false);
  43084. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43085. return this.DrawExample.computePosition(this.editPositions)[1];
  43086. }, false);
  43087. break;
  43088. case "DrawCurveFlag":
  43089. this.editEntity.polygon.hierarchy = new Cesium.CallbackProperty((e) => {
  43090. return this.DrawExample.computePosition(this.editPositions)[0];
  43091. }, false);
  43092. this.editEntity.polyline.positions = new Cesium.CallbackProperty((e) => {
  43093. return this.DrawExample.computePosition(this.editPositions)[1];
  43094. }, false);
  43095. break;
  43096. }
  43097. }
  43098. closeEntityEditMode() {
  43099. if (this.DrawExample == "")
  43100. return;
  43101. let position2 = "";
  43102. switch (this.editEntity.Type) {
  43103. case "DrawStraightArrow":
  43104. position2 = this.DrawExample.computePosition(this.editPositions);
  43105. this.editEntity.polygon.hierarchy = position2;
  43106. this.editEntity.Position = this.DrawExample.getData();
  43107. break;
  43108. case "DrawAttackArrow":
  43109. position2 = this.DrawExample.computePosition(this.editPositions);
  43110. this.editEntity.polygon.hierarchy = position2;
  43111. this.editEntity.Position = this.DrawExample.getData();
  43112. break;
  43113. case "DrawPincerArrow":
  43114. position2 = this.DrawExample.computePosition(this.editPositions);
  43115. this.editEntity.polygon.hierarchy = position2;
  43116. this.editEntity.Position = this.DrawExample.getData();
  43117. break;
  43118. case "DrawGatheringPlace":
  43119. position2 = this.DrawExample.computePosition(this.editPositions);
  43120. this.editEntity.polygon.hierarchy = position2;
  43121. this.editEntity.Position = this.DrawExample.getData();
  43122. break;
  43123. case "DrawClosedCurve":
  43124. position2 = this.DrawExample.computePosition(this.editPositions);
  43125. this.editEntity.polygon.hierarchy = position2.PolygonHierarchy;
  43126. this.editEntity.polyline.positions = position2.pList;
  43127. this.editEntity.Position = this.DrawExample.getData();
  43128. break;
  43129. case "DrawCircle":
  43130. position2 = this.DrawExample.computePosition(this.editPositions);
  43131. this.editEntity.position = position2.position;
  43132. this.editEntity.ellipse.semiMinorAxis = position2.r;
  43133. this.editEntity.ellipse.semiMajorAxis = position2.r;
  43134. this.editEntity.Position = this.DrawExample.getData();
  43135. break;
  43136. case "DrawCurve":
  43137. position2 = this.DrawExample.computePosition(this.editPositions);
  43138. this.editEntity.polyline.positions = position2;
  43139. this.editEntity.Position = this.DrawExample.getData();
  43140. break;
  43141. case "DrawPoint":
  43142. position2 = this.DrawExample.computePosition(this.editPositions);
  43143. this.editEntity.position = position2;
  43144. this.editEntity.Position = this.DrawExample.getData();
  43145. break;
  43146. case "DrawPolygon":
  43147. position2 = this.DrawExample.computePosition(this.editPositions);
  43148. this.editEntity.polygon.hierarchy = position2;
  43149. this.editEntity.Position = this.DrawExample.getData();
  43150. break;
  43151. case "DrawPolyline":
  43152. position2 = this.DrawExample.computePosition(this.editPositions);
  43153. this.editEntity.polyline.positions = position2;
  43154. this.editEntity.Position = this.DrawExample.getData();
  43155. break;
  43156. case "DrawRectangle":
  43157. position2 = this.DrawExample.computePosition(this.editPositions);
  43158. this.editEntity.rectangle.coordinates = position2;
  43159. this.editEntity.Position = this.DrawExample.getData();
  43160. break;
  43161. case "DrawSector":
  43162. position2 = this.DrawExample.computePosition(this.editPositions);
  43163. this.editEntity.polygon.hierarchy = position2;
  43164. this.editEntity.Position = this.DrawExample.getData();
  43165. break;
  43166. case "DrawBowLine":
  43167. position2 = this.DrawExample.computePosition(this.editPositions);
  43168. this.editEntity.polyline.positions = position2;
  43169. this.editEntity.Position = this.DrawExample.getData();
  43170. break;
  43171. case "DrawBowPlane":
  43172. position2 = this.DrawExample.computePosition(this.editPositions);
  43173. this.editEntity.polygon.hierarchy = position2;
  43174. this.editEntity.Position = this.DrawExample.getData();
  43175. break;
  43176. case "DrawRectFlag":
  43177. position2 = this.DrawExample.computePosition(this.editPositions);
  43178. this.editEntity.polygon.hierarchy = position2[0];
  43179. this.editEntity.polyline.positions = position2[1];
  43180. this.editEntity.Position = this.DrawExample.getData();
  43181. break;
  43182. case "DrawTriangleFlag":
  43183. position2 = this.DrawExample.computePosition(this.editPositions);
  43184. this.editEntity.polygon.hierarchy = position2[0];
  43185. this.editEntity.polyline.positions = position2[1];
  43186. this.editEntity.Position = this.DrawExample.getData();
  43187. break;
  43188. case "DrawCurveFlag":
  43189. position2 = this.DrawExample.computePosition(this.editPositions);
  43190. this.editEntity.polygon.hierarchy = position2[0];
  43191. this.editEntity.polyline.positions = position2[1];
  43192. this.editEntity.Position = this.DrawExample.getData();
  43193. break;
  43194. }
  43195. }
  43196. getEditEntityPositions() {
  43197. let position2 = this.editEntity.Position;
  43198. let positionArr = [];
  43199. switch (this.editEntity.Type) {
  43200. case "DrawAttackArrow":
  43201. for (let i2 = 0; i2 < position2.length; i2++) {
  43202. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43203. }
  43204. return positionArr;
  43205. case "DrawCircle":
  43206. for (let i2 = 0; i2 < position2.length; i2++) {
  43207. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43208. }
  43209. return positionArr;
  43210. case "DrawCurve":
  43211. for (let i2 = 0; i2 < position2.length; i2++) {
  43212. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43213. }
  43214. return positionArr;
  43215. case "DrawPincerArrow":
  43216. for (let i2 = 0; i2 < position2.length; i2++) {
  43217. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43218. }
  43219. return positionArr;
  43220. case "DrawPoint":
  43221. for (let i2 = 0; i2 < position2.length; i2++) {
  43222. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43223. }
  43224. return positionArr;
  43225. case "DrawPolygon":
  43226. for (let i2 = 0; i2 < position2.length; i2++) {
  43227. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43228. }
  43229. return positionArr;
  43230. case "DrawPolyline":
  43231. for (let i2 = 0; i2 < position2.length; i2++) {
  43232. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43233. }
  43234. return positionArr;
  43235. case "DrawRectangle":
  43236. for (let i2 = 0; i2 < position2.length; i2++) {
  43237. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43238. }
  43239. return positionArr;
  43240. case "DrawStraightArrow":
  43241. for (let i2 = 0; i2 < position2.length; i2++) {
  43242. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43243. }
  43244. return positionArr;
  43245. case "DrawGatheringPlace":
  43246. for (let i2 = 0; i2 < position2.length; i2++) {
  43247. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43248. }
  43249. return positionArr;
  43250. case "DrawSector":
  43251. for (let i2 = 0; i2 < position2.length; i2++) {
  43252. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43253. }
  43254. return positionArr;
  43255. case "DrawClosedCurve":
  43256. for (let i2 = 0; i2 < position2.length; i2++) {
  43257. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43258. }
  43259. return positionArr;
  43260. case "DrawBowLine":
  43261. for (let i2 = 0; i2 < position2.length; i2++) {
  43262. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43263. }
  43264. return positionArr;
  43265. case "DrawBowPlane":
  43266. for (let i2 = 0; i2 < position2.length; i2++) {
  43267. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43268. }
  43269. return positionArr;
  43270. case "DrawRectFlag":
  43271. for (let i2 = 0; i2 < position2.length; i2++) {
  43272. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43273. }
  43274. return positionArr;
  43275. case "DrawTriangleFlag":
  43276. for (let i2 = 0; i2 < position2.length; i2++) {
  43277. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43278. }
  43279. return positionArr;
  43280. case "DrawCurveFlag":
  43281. for (let i2 = 0; i2 < position2.length; i2++) {
  43282. positionArr.push(this.LatlngTocartesian(position2[i2]));
  43283. }
  43284. return positionArr;
  43285. }
  43286. }
  43287. registerEvents() {
  43288. this.initLeftDownEventHandler();
  43289. this.initMouseMoveEventHandler();
  43290. this.initLeftUpEventHandler();
  43291. }
  43292. unRegisterEvents() {
  43293. this.eventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN);
  43294. this.eventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP);
  43295. this.eventHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  43296. }
  43297. initLeftDownEventHandler() {
  43298. this.eventHandler.setInputAction((e) => {
  43299. let id = this.viewer.scene.pick(e.position);
  43300. if (!id || !id.id || !id.id.type)
  43301. return;
  43302. if (id.id.type == "EditVertex" || id.id.type == "EditMove") {
  43303. this.isEditing = true;
  43304. this.viewer.scene.screenSpaceCameraController.enableRotate = false;
  43305. this.viewer.enableCursorStyle = false;
  43306. this.viewer._element.style.cursor = "";
  43307. document.body.style.cursor = "move";
  43308. this.editVertext = id.id;
  43309. this.editVertext.show = false;
  43310. this.clearMidVertex();
  43311. } else if (id.id.type == "EditMidVertex") {
  43312. this.editPositions.splice(id.id.vertexIndex, 0, id.id.position._value);
  43313. this.clearAllEditVertex();
  43314. this.createEditVertex();
  43315. this.createMidVertex();
  43316. this.isEdited = true;
  43317. } else {
  43318. return;
  43319. }
  43320. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  43321. }
  43322. initLeftUpEventHandler() {
  43323. this.eventHandler.setInputAction((e) => {
  43324. if (!this.isEditing)
  43325. return;
  43326. this.viewer.enableCursorStyle = true;
  43327. document.body.style.cursor = "default";
  43328. this.viewer.scene.screenSpaceCameraController.enableRotate = true;
  43329. this.editVertext.show = true;
  43330. this.isEditing = false;
  43331. this.clearMidVertex();
  43332. this.createMidVertex();
  43333. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  43334. }
  43335. initMouseMoveEventHandler() {
  43336. this.eventHandler.setInputAction((e) => {
  43337. var position2 = e.endPosition;
  43338. var ray = this.viewer.scene.camera.getPickRay(position2);
  43339. var cartesian = this.viewer.scene.globe.pick(ray, this.viewer.scene);
  43340. if (!cartesian)
  43341. return;
  43342. if (!this.isEditing)
  43343. return;
  43344. if (this.editVertext.type == "EditMove") {
  43345. let startPosition = this.EditMoveCenterPositoin;
  43346. if (!startPosition)
  43347. return;
  43348. this.moveEntityByOffset(startPosition, cartesian);
  43349. } else if (this.editVertext.type == "EditVertex" || this.editVertext.type == "EditMidVertex") {
  43350. this.editPositions[this.editVertext.vertexIndex] = cartesian;
  43351. }
  43352. this.isEdited = true;
  43353. this.EditMoveCenterPositoin = this.getCenterPosition();
  43354. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  43355. }
  43356. getCenterPosition() {
  43357. let points2 = [];
  43358. let maxHeight = 0;
  43359. if (this.editEntity.Type == "DrawCircle" || this.editEntity.Type == "DrawPoint" || this.editEntity.Type == "DrawSector") {
  43360. return this.editPositions[0];
  43361. }
  43362. this.editPositions.forEach((position2) => {
  43363. const point3d = this.cartesian3ToPoint3D(position2);
  43364. points2.push([point3d.x, point3d.y]);
  43365. if (maxHeight < point3d.z)
  43366. maxHeight = point3d.z;
  43367. });
  43368. let geo = lineString(points2);
  43369. let bbox2 = bbox$1(geo);
  43370. let bboxPolygon$1 = bboxPolygon(bbox2);
  43371. let pointOnFeature = center(bboxPolygon$1);
  43372. let lonLat = pointOnFeature.geometry.coordinates;
  43373. return Cesium.Cartesian3.fromDegrees(lonLat[0], lonLat[1], maxHeight);
  43374. }
  43375. moveEntityByOffset(startPosition, endPosition) {
  43376. let startPoint3d = this.cartesian3ToPoint3D(startPosition);
  43377. let endPoint3d = this.cartesian3ToPoint3D(endPosition);
  43378. let offsetX = endPoint3d.x - startPoint3d.x;
  43379. let offsetY = endPoint3d.y - startPoint3d.y;
  43380. let element;
  43381. for (let i2 = 0; i2 < this.editPositions.length; i2++) {
  43382. element = this.cartesian3ToPoint3D(this.editPositions[i2]);
  43383. element.x += offsetX;
  43384. element.y += offsetY;
  43385. this.editPositions[i2] = Cesium.Cartesian3.fromDegrees(element.x, element.y, element.z);
  43386. }
  43387. }
  43388. createEditVertex() {
  43389. this.vertexEntities = [];
  43390. this.editPositions.forEach((p, index2) => {
  43391. const entity = this.viewer.entities.add({
  43392. position: new Cesium.CallbackProperty((e) => {
  43393. return this.editPositions[index2];
  43394. }, false),
  43395. type: "EditVertex",
  43396. vertexIndex: index2,
  43397. point: {
  43398. show: true,
  43399. pixelSize: 10,
  43400. color: new Cesium.Color(0, 0, 1, 1),
  43401. outlineWidth: 1,
  43402. outlineColor: new Cesium.Color(1, 1, 1, 1),
  43403. disableDepthTestDistance: 15e11,
  43404. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  43405. }
  43406. });
  43407. this.vertexEntities.push(entity);
  43408. });
  43409. if (this.editEntity.Type == "DrawCircle") {
  43410. this.vertexEntities[0].show = false;
  43411. }
  43412. if (this.editPositions.length == 1) {
  43413. return;
  43414. }
  43415. this.createEditMoveCenterEntity();
  43416. }
  43417. createEditMoveCenterEntity() {
  43418. this.EditMoveCenterEntity = this.viewer.entities.add({
  43419. position: new Cesium.CallbackProperty((e) => {
  43420. return this.EditMoveCenterPositoin;
  43421. }, false),
  43422. type: "EditMove",
  43423. point: {
  43424. show: true,
  43425. pixelSize: 12,
  43426. color: new Cesium.Color(0, 1, 0, 0.1),
  43427. outlineWidth: 2,
  43428. outlineColor: new Cesium.Color(1, 1, 1, 1),
  43429. disableDepthTestDistance: 15e11,
  43430. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  43431. }
  43432. });
  43433. }
  43434. clearEditVertex() {
  43435. if (this.vertexEntities) {
  43436. this.vertexEntities.forEach((item) => {
  43437. this.viewer.entities.remove(item);
  43438. });
  43439. }
  43440. this.vertexEntities = [];
  43441. this.viewer.entities.remove(this.EditMoveCenterEntity);
  43442. }
  43443. createMidVertex() {
  43444. if (this.editEntity.Type == "DrawCircle" || this.editEntity.Type == "DrawPincerArrow" || this.editEntity.Type == "DrawRectangle" || this.editEntity.Type == "DrawStraightArrow" || this.editEntity.Type == "DrawGatheringPlace" || this.editEntity.Type == "DrawSector" || this.editEntity.Type == "DrawBowLine" || this.editEntity.Type == "DrawBowPlane" || this.editEntity.Type == "DrawRectFlag" || this.editEntity.Type == "DrawTriangleFlag" || this.editEntity.Type == "DrawCurveFlag") {
  43445. return;
  43446. }
  43447. this.midVertexEntities = [];
  43448. for (let i2 = 0; i2 < this.editPositions.length; i2++) {
  43449. const p1 = this.editPositions[i2];
  43450. const p2 = this.editPositions[i2 + 1];
  43451. let mideP = this.midPosition(p1, p2);
  43452. const entity = this.viewer.entities.add({
  43453. position: mideP,
  43454. type: "EditMidVertex",
  43455. vertexIndex: i2 + 1,
  43456. point: {
  43457. show: true,
  43458. pixelSize: 10,
  43459. color: new Cesium.Color(0, 1, 0, 1),
  43460. outlineWidth: 1,
  43461. outlineColor: new Cesium.Color(1, 1, 1, 1),
  43462. disableDepthTestDistance: 15e11,
  43463. heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
  43464. }
  43465. });
  43466. this.midVertexEntities.push(entity);
  43467. }
  43468. }
  43469. clearMidVertex() {
  43470. if (this.midVertexEntities) {
  43471. this.midVertexEntities.forEach((item) => {
  43472. this.viewer.entities.remove(item);
  43473. });
  43474. }
  43475. this.midVertexEntities = [];
  43476. }
  43477. cartesian3ToPoint3D(position2) {
  43478. const cartographic = Cesium.Cartographic.fromCartesian(position2);
  43479. const lon = Cesium.Math.toDegrees(cartographic.longitude);
  43480. const lat = Cesium.Math.toDegrees(cartographic.latitude);
  43481. return {
  43482. x: lon,
  43483. y: lat,
  43484. z: cartographic.height
  43485. };
  43486. }
  43487. midPosition(first, second) {
  43488. if (!first || !second)
  43489. return null;
  43490. let point3d1 = this.cartesian3ToPoint3D(first);
  43491. let point3d2 = this.cartesian3ToPoint3D(second);
  43492. let midLonLat = {
  43493. x: (point3d1.x + point3d2.x) / 2,
  43494. y: (point3d1.y + point3d2.y) / 2,
  43495. z: (point3d1.z + point3d2.z) / 2
  43496. };
  43497. return Cesium.Cartesian3.fromDegrees(midLonLat.x, midLonLat.y, midLonLat.z);
  43498. }
  43499. cartesianToLatlng(cartesian) {
  43500. let cartographic = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(cartesian);
  43501. let lat = new Cesium.Math.toDegrees(cartographic.latitude);
  43502. let lng = new Cesium.Math.toDegrees(cartographic.longitude);
  43503. cartographic.height;
  43504. return [lng, lat];
  43505. }
  43506. LatlngTocartesian(latlng) {
  43507. let cartesian3 = new Cesium.Cartesian3.fromDegrees(latlng[0], latlng[1]);
  43508. return cartesian3;
  43509. }
  43510. }
  43511. var _style_0$1 = `@charset "UTF-8";:root{--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary-rgb:64,158,255;--el-color-success-rgb:103,194,58;--el-color-warning-rgb:230,162,60;--el-color-danger-rgb:245,108,108;--el-color-error-rgb:245,108,108;--el-color-info-rgb:144,147,153;--el-font-size-extra-large:20px;--el-font-size-large:18px;--el-font-size-medium:16px;--el-font-size-base:14px;--el-font-size-small:13px;--el-font-size-extra-small:12px;--el-font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","\\5fae\\8f6f\\96c5\\9ed1",Arial,sans-serif;--el-font-weight-primary:500;--el-font-line-height-primary:24px;--el-index-normal:1;--el-index-top:1000;--el-index-popper:2000;--el-border-radius-base:4px;--el-border-radius-small:2px;--el-border-radius-round:20px;--el-border-radius-circle:100%;--el-transition-duration:.3s;--el-transition-duration-fast:.2s;--el-transition-function-ease-in-out-bezier:cubic-bezier(.645, .045, .355, 1);--el-transition-function-fast-bezier:cubic-bezier(.23, 1, .32, 1);--el-transition-all:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);--el-transition-fade:opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-md-fade:transform var(--el-transition-duration) var(--el-transition-function-fast-bezier),opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-fade-linear:opacity var(--el-transition-duration-fast) linear;--el-transition-border:border-color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-box-shadow:box-shadow var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-color:color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-component-size-large:40px;--el-component-size:32px;--el-component-size-small:24px}:root{color-scheme:light;--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary:#409eff;--el-color-primary-light-3:#79bbff;--el-color-primary-light-5:#a0cfff;--el-color-primary-light-7:#c6e2ff;--el-color-primary-light-8:#d9ecff;--el-color-primary-light-9:#ecf5ff;--el-color-primary-dark-2:#337ecc;--el-color-success:#67c23a;--el-color-success-light-3:#95d475;--el-color-success-light-5:#b3e19d;--el-color-success-light-7:#d1edc4;--el-color-success-light-8:#e1f3d8;--el-color-success-light-9:#f0f9eb;--el-color-success-dark-2:#529b2e;--el-color-warning:#e6a23c;--el-color-warning-light-3:#eebe77;--el-color-warning-light-5:#f3d19e;--el-color-warning-light-7:#f8e3c5;--el-color-warning-light-8:#faecd8;--el-color-warning-light-9:#fdf6ec;--el-color-warning-dark-2:#b88230;--el-color-danger:#f56c6c;--el-color-danger-light-3:#f89898;--el-color-danger-light-5:#fab6b6;--el-color-danger-light-7:#fcd3d3;--el-color-danger-light-8:#fde2e2;--el-color-danger-light-9:#fef0f0;--el-color-danger-dark-2:#c45656;--el-color-error:#f56c6c;--el-color-error-light-3:#f89898;--el-color-error-light-5:#fab6b6;--el-color-error-light-7:#fcd3d3;--el-color-error-light-8:#fde2e2;--el-color-error-light-9:#fef0f0;--el-color-error-dark-2:#c45656;--el-color-info:#909399;--el-color-info-light-3:#b1b3b8;--el-color-info-light-5:#c8c9cc;--el-color-info-light-7:#dedfe0;--el-color-info-light-8:#e9e9eb;--el-color-info-light-9:#f4f4f5;--el-color-info-dark-2:#73767a;--el-bg-color:#ffffff;--el-bg-color-page:#f2f3f5;--el-bg-color-overlay:#ffffff;--el-text-color-primary:#303133;--el-text-color-regular:#606266;--el-text-color-secondary:#909399;--el-text-color-placeholder:#a8abb2;--el-text-color-disabled:#c0c4cc;--el-border-color:#dcdfe6;--el-border-color-light:#e4e7ed;--el-border-color-lighter:#ebeef5;--el-border-color-extra-light:#f2f6fc;--el-border-color-dark:#d4d7de;--el-border-color-darker:#cdd0d6;--el-fill-color:#f0f2f5;--el-fill-color-light:#f5f7fa;--el-fill-color-lighter:#fafafa;--el-fill-color-extra-light:#fafcff;--el-fill-color-dark:#ebedf0;--el-fill-color-darker:#e6e8eb;--el-fill-color-blank:#ffffff;--el-box-shadow:0px 12px 32px 4px rgba(0, 0, 0, .04),0px 8px 20px rgba(0, 0, 0, .08);--el-box-shadow-light:0px 0px 12px rgba(0, 0, 0, .12);--el-box-shadow-lighter:0px 0px 6px rgba(0, 0, 0, .12);--el-box-shadow-dark:0px 16px 48px 16px rgba(0, 0, 0, .08),0px 12px 32px rgba(0, 0, 0, .12),0px 8px 16px -8px rgba(0, 0, 0, .16);--el-disabled-bg-color:var(--el-fill-color-light);--el-disabled-text-color:var(--el-text-color-placeholder);--el-disabled-border-color:var(--el-border-color-light);--el-overlay-color:rgba(0, 0, 0, .8);--el-overlay-color-light:rgba(0, 0, 0, .7);--el-overlay-color-lighter:rgba(0, 0, 0, .5);--el-mask-color:rgba(255, 255, 255, .9);--el-mask-color-extra-light:rgba(255, 255, 255, .3);--el-border-width:1px;--el-border-style:solid;--el-border-color-hover:var(--el-text-color-disabled);--el-border:var(--el-border-width) var(--el-border-style) var(--el-border-color);--el-svg-monochrome-grey:var(--el-border-color)}.fade-in-linear-enter-active,.fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.fade-in-linear-enter-from,.fade-in-linear-leave-to{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.el-fade-in-linear-enter-from,.el-fade-in-linear-leave-to{opacity:0}.el-fade-in-enter-active,.el-fade-in-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-fade-in-enter-from,.el-fade-in-leave-active{opacity:0}.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter-from,.el-zoom-in-center-leave-active{opacity:0;transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center top}.el-zoom-in-top-enter-active[data-popper-placement^=top],.el-zoom-in-top-leave-active[data-popper-placement^=top]{transform-origin:center bottom}.el-zoom-in-top-enter-from,.el-zoom-in-top-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center bottom}.el-zoom-in-bottom-enter-from,.el-zoom-in-bottom-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;transform:scale(1);transition:var(--el-transition-md-fade);transform-origin:top left}.el-zoom-in-left-enter-from,.el-zoom-in-left-leave-active{opacity:0;transform:scale(.45)}.collapse-transition{transition:var(--el-transition-duration) height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.el-collapse-transition-enter-active,.el-collapse-transition-leave-active{transition:var(--el-transition-duration) max-height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.horizontal-collapse-transition{transition:var(--el-transition-duration) width ease-in-out,var(--el-transition-duration) padding-left ease-in-out,var(--el-transition-duration) padding-right ease-in-out}.el-list-enter-active,.el-list-leave-active{transition:all 1s}.el-list-enter-from,.el-list-leave-to{opacity:0;transform:translateY(-30px)}.el-list-leave-active{position:absolute!important}.el-opacity-transition{transition:opacity var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.el-icon{--color:inherit;height:1em;width:1em;line-height:1em;display:inline-flex;justify-content:center;align-items:center;position:relative;fill:currentColor;color:var(--color);font-size:inherit}.el-icon.is-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon svg{height:1em;width:1em}.el-affix--fixed{position:fixed}.el-alert{--el-alert-padding:8px 16px;--el-alert-border-radius-base:var(--el-border-radius-base);--el-alert-title-font-size:13px;--el-alert-description-font-size:12px;--el-alert-close-font-size:12px;--el-alert-close-customed-font-size:13px;--el-alert-icon-size:16px;--el-alert-icon-large-size:28px;width:100%;padding:var(--el-alert-padding);margin:0;box-sizing:border-box;border-radius:var(--el-alert-border-radius-base);position:relative;background-color:var(--el-color-white);overflow:hidden;opacity:1;display:flex;align-items:center;transition:opacity var(--el-transition-duration-fast)}.el-alert.is-light .el-alert__close-btn{color:var(--el-text-color-placeholder)}.el-alert.is-dark .el-alert__close-btn,.el-alert.is-dark .el-alert__description{color:var(--el-color-white)}.el-alert.is-center{justify-content:center}.el-alert--success{--el-alert-bg-color:var(--el-color-success-light-9)}.el-alert--success.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-success)}.el-alert--success.is-light .el-alert__description{color:var(--el-color-success)}.el-alert--success.is-dark{background-color:var(--el-color-success);color:var(--el-color-white)}.el-alert--info{--el-alert-bg-color:var(--el-color-info-light-9)}.el-alert--info.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-info)}.el-alert--info.is-light .el-alert__description{color:var(--el-color-info)}.el-alert--info.is-dark{background-color:var(--el-color-info);color:var(--el-color-white)}.el-alert--warning{--el-alert-bg-color:var(--el-color-warning-light-9)}.el-alert--warning.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-warning)}.el-alert--warning.is-light .el-alert__description{color:var(--el-color-warning)}.el-alert--warning.is-dark{background-color:var(--el-color-warning);color:var(--el-color-white)}.el-alert--error{--el-alert-bg-color:var(--el-color-error-light-9)}.el-alert--error.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-error)}.el-alert--error.is-light .el-alert__description{color:var(--el-color-error)}.el-alert--error.is-dark{background-color:var(--el-color-error);color:var(--el-color-white)}.el-alert__content{display:table-cell;padding:0 8px}.el-alert .el-alert__icon{font-size:var(--el-alert-icon-size);width:var(--el-alert-icon-size)}.el-alert .el-alert__icon.is-big{font-size:var(--el-alert-icon-large-size);width:var(--el-alert-icon-large-size)}.el-alert__title{font-size:var(--el-alert-title-font-size);line-height:18px;vertical-align:text-top}.el-alert__title.is-bold{font-weight:700}.el-alert .el-alert__description{font-size:var(--el-alert-description-font-size);margin:5px 0 0}.el-alert .el-alert__close-btn{font-size:var(--el-alert-close-font-size);opacity:1;position:absolute;top:12px;right:15px;cursor:pointer}.el-alert .el-alert__close-btn.is-customed{font-style:normal;font-size:var(--el-alert-close-customed-font-size);top:9px}.el-alert-fade-enter-from,.el-alert-fade-leave-active{opacity:0}.el-aside{overflow:auto;box-sizing:border-box;flex-shrink:0;width:var(--el-aside-width,300px)}.el-autocomplete{position:relative;display:inline-block}.el-autocomplete__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-autocomplete__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-autocomplete__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-autocomplete-suggestion{border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-autocomplete-suggestion__wrap{max-height:280px;padding:10px 0;box-sizing:border-box}.el-autocomplete-suggestion__list{margin:0;padding:0}.el-autocomplete-suggestion li{padding:0 20px;margin:0;line-height:34px;cursor:pointer;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);list-style:none;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-autocomplete-suggestion li:hover,.el-autocomplete-suggestion li.highlighted{background-color:var(--el-fill-color-light)}.el-autocomplete-suggestion li.divider{margin-top:6px;border-top:1px solid var(--el-color-black)}.el-autocomplete-suggestion li.divider:last-child{margin-bottom:-6px}.el-autocomplete-suggestion.is-loading li{text-align:center;height:100px;line-height:100px;font-size:20px;color:var(--el-text-color-secondary)}.el-autocomplete-suggestion.is-loading li:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-autocomplete-suggestion.is-loading li:hover{background-color:var(--el-bg-color-overlay)}.el-autocomplete-suggestion.is-loading .el-icon-loading{vertical-align:middle}.el-avatar{--el-avatar-text-color:var(--el-color-white);--el-avatar-bg-color:var(--el-text-color-disabled);--el-avatar-text-size:14px;--el-avatar-icon-size:18px;--el-avatar-border-radius:var(--el-border-radius-base);--el-avatar-size-large:56px;--el-avatar-size-small:24px;--el-avatar-size:40px;display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;text-align:center;overflow:hidden;color:var(--el-avatar-text-color);background:var(--el-avatar-bg-color);width:var(--el-avatar-size);height:var(--el-avatar-size);font-size:var(--el-avatar-text-size)}.el-avatar>img{display:block;height:100%}.el-avatar--circle{border-radius:50%}.el-avatar--square{border-radius:var(--el-avatar-border-radius)}.el-avatar--icon{font-size:var(--el-avatar-icon-size)}.el-avatar--small{--el-avatar-size:24px}.el-avatar--large{--el-avatar-size:56px}.el-backtop{--el-backtop-bg-color:var(--el-bg-color-overlay);--el-backtop-text-color:var(--el-color-primary);--el-backtop-hover-bg-color:var(--el-border-color-extra-light);position:fixed;background-color:var(--el-backtop-bg-color);width:40px;height:40px;border-radius:50%;color:var(--el-backtop-text-color);display:flex;align-items:center;justify-content:center;font-size:20px;box-shadow:var(--el-box-shadow-lighter);cursor:pointer;z-index:5}.el-backtop:hover{background-color:var(--el-backtop-hover-bg-color)}.el-backtop__icon{font-size:20px}.el-badge{--el-badge-bg-color:var(--el-color-danger);--el-badge-radius:10px;--el-badge-font-size:12px;--el-badge-padding:6px;--el-badge-size:18px;position:relative;vertical-align:middle;display:inline-block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.el-badge__content{background-color:var(--el-badge-bg-color);border-radius:var(--el-badge-radius);color:var(--el-color-white);display:inline-flex;justify-content:center;align-items:center;font-size:var(--el-badge-font-size);height:var(--el-badge-size);padding:0 var(--el-badge-padding);white-space:nowrap;border:1px solid var(--el-bg-color)}.el-badge__content.is-fixed{position:absolute;top:0;right:calc(1px + var(--el-badge-size)/ 2);transform:translateY(-50%) translate(100%);z-index:var(--el-index-normal)}.el-badge__content.is-fixed.is-dot{right:5px}.el-badge__content.is-dot{height:8px;width:8px;padding:0;right:0;border-radius:50%}.el-badge__content--primary{background-color:var(--el-color-primary)}.el-badge__content--success{background-color:var(--el-color-success)}.el-badge__content--warning{background-color:var(--el-color-warning)}.el-badge__content--info{background-color:var(--el-color-info)}.el-badge__content--danger{background-color:var(--el-color-danger)}.el-breadcrumb{font-size:14px;line-height:1}.el-breadcrumb:after,.el-breadcrumb:before{display:table;content:""}.el-breadcrumb:after{clear:both}.el-breadcrumb__separator{margin:0 9px;font-weight:700;color:var(--el-text-color-placeholder)}.el-breadcrumb__separator.el-icon{margin:0 6px;font-weight:400}.el-breadcrumb__separator.el-icon svg{vertical-align:middle}.el-breadcrumb__item{float:left;display:inline-flex;align-items:center}.el-breadcrumb__inner{color:var(--el-text-color-regular)}.el-breadcrumb__inner a,.el-breadcrumb__inner.is-link{font-weight:700;text-decoration:none;transition:var(--el-transition-color);color:var(--el-text-color-primary)}.el-breadcrumb__inner a:hover,.el-breadcrumb__inner.is-link:hover{color:var(--el-color-primary);cursor:pointer}.el-breadcrumb__item:last-child .el-breadcrumb__inner,.el-breadcrumb__item:last-child .el-breadcrumb__inner a,.el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover,.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover{font-weight:400;color:var(--el-text-color-regular);cursor:text}.el-breadcrumb__item:last-child .el-breadcrumb__separator{display:none}.el-button-group{display:inline-block;vertical-align:middle}.el-button-group:after,.el-button-group:before{display:table;content:""}.el-button-group:after{clear:both}.el-button-group>.el-button{float:left;position:relative}.el-button-group>.el-button+.el-button{margin-left:0}.el-button-group>.el-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.el-button-group>.el-button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.el-button-group>.el-button:first-child:last-child{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base)}.el-button-group>.el-button:first-child:last-child.is-round{border-radius:var(--el-border-radius-round)}.el-button-group>.el-button:first-child:last-child.is-circle{border-radius:50%}.el-button-group>.el-button:not(:first-child):not(:last-child){border-radius:0}.el-button-group>.el-button:not(:last-child){margin-right:-1px}.el-button-group>.el-button:active,.el-button-group>.el-button:focus,.el-button-group>.el-button:hover{z-index:1}.el-button-group>.el-button.is-active{z-index:1}.el-button-group>.el-dropdown>.el-button{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button{--el-button-font-weight:var(--el-font-weight-primary);--el-button-border-color:var(--el-border-color);--el-button-bg-color:var(--el-fill-color-blank);--el-button-text-color:var(--el-text-color-regular);--el-button-disabled-text-color:var(--el-disabled-text-color);--el-button-disabled-bg-color:var(--el-fill-color-blank);--el-button-disabled-border-color:var(--el-border-color-light);--el-button-divide-border-color:rgba(255, 255, 255, .5);--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-color-primary-light-9);--el-button-hover-border-color:var(--el-color-primary-light-7);--el-button-active-text-color:var(--el-button-hover-text-color);--el-button-active-border-color:var(--el-color-primary);--el-button-active-bg-color:var(--el-button-hover-bg-color);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-hover-link-text-color:var(--el-color-info);--el-button-active-color:var(--el-text-color-primary)}.el-button{display:inline-flex;justify-content:center;align-items:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;color:var(--el-button-text-color);text-align:center;box-sizing:border-box;outline:0;transition:.1s;font-weight:var(--el-button-font-weight);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-appearance:none;background-color:var(--el-button-bg-color);border:var(--el-border);border-color:var(--el-button-border-color);padding:8px 15px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button:focus,.el-button:hover{color:var(--el-button-hover-text-color);border-color:var(--el-button-hover-border-color);background-color:var(--el-button-hover-bg-color);outline:0}.el-button:active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button:focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button>span{display:inline-flex;align-items:center}.el-button+.el-button{margin-left:12px}.el-button.is-round{padding:8px 15px}.el-button::-moz-focus-inner{border:0}.el-button [class*=el-icon]+span{margin-left:6px}.el-button [class*=el-icon] svg{vertical-align:bottom}.el-button.is-plain{--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-fill-color-blank);--el-button-hover-border-color:var(--el-color-primary)}.el-button.is-active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button.is-disabled,.el-button.is-disabled:focus,.el-button.is-disabled:hover{color:var(--el-button-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color);border-color:var(--el-button-disabled-border-color)}.el-button.is-loading{position:relative;pointer-events:none}.el-button.is-loading:before{z-index:1;pointer-events:none;content:"";position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:inherit;background-color:var(--el-mask-color-extra-light)}.el-button.is-round{border-radius:var(--el-border-radius-round)}.el-button.is-circle{border-radius:50%;padding:8px}.el-button.is-text{color:var(--el-button-text-color);border:0 solid transparent;background-color:transparent}.el-button.is-text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important}.el-button.is-text:not(.is-disabled):focus,.el-button.is-text:not(.is-disabled):hover{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled):focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button.is-text:not(.is-disabled):active{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled).is-has-bg:focus,.el-button.is-text:not(.is-disabled).is-has-bg:hover{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg:active{background-color:var(--el-fill-color-dark)}.el-button__text--expand{letter-spacing:.3em;margin-right:-.3em}.el-button.is-link{border-color:transparent;color:var(--el-button-text-color);background:0 0;padding:2px;height:auto}.el-button.is-link:focus,.el-button.is-link:hover{color:var(--el-button-hover-link-text-color)}.el-button.is-link.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button.is-link:not(.is-disabled):focus,.el-button.is-link:not(.is-disabled):hover{border-color:transparent;background-color:transparent}.el-button.is-link:not(.is-disabled):active{color:var(--el-button-active-color);border-color:transparent;background-color:transparent}.el-button--text{border-color:transparent;background:0 0;color:var(--el-color-primary);padding-left:0;padding-right:0}.el-button--text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button--text:not(.is-disabled):focus,.el-button--text:not(.is-disabled):hover{color:var(--el-color-primary-light-3);border-color:transparent;background-color:transparent}.el-button--text:not(.is-disabled):active{color:var(--el-color-primary-dark-2);border-color:transparent;background-color:transparent}.el-button__link--expand{letter-spacing:.3em;margin-right:-.3em}.el-button--primary{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-primary);--el-button-border-color:var(--el-color-primary);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-active-color:var(--el-color-primary-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-primary-light-5);--el-button-hover-bg-color:var(--el-color-primary-light-3);--el-button-hover-border-color:var(--el-color-primary-light-3);--el-button-active-bg-color:var(--el-color-primary-dark-2);--el-button-active-border-color:var(--el-color-primary-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-primary-light-5);--el-button-disabled-border-color:var(--el-color-primary-light-5)}.el-button--primary.is-link,.el-button--primary.is-plain,.el-button--primary.is-text{--el-button-text-color:var(--el-color-primary);--el-button-bg-color:var(--el-color-primary-light-9);--el-button-border-color:var(--el-color-primary-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-primary);--el-button-hover-border-color:var(--el-color-primary);--el-button-active-text-color:var(--el-color-white)}.el-button--primary.is-link.is-disabled,.el-button--primary.is-link.is-disabled:active,.el-button--primary.is-link.is-disabled:focus,.el-button--primary.is-link.is-disabled:hover,.el-button--primary.is-plain.is-disabled,.el-button--primary.is-plain.is-disabled:active,.el-button--primary.is-plain.is-disabled:focus,.el-button--primary.is-plain.is-disabled:hover,.el-button--primary.is-text.is-disabled,.el-button--primary.is-text.is-disabled:active,.el-button--primary.is-text.is-disabled:focus,.el-button--primary.is-text.is-disabled:hover{color:var(--el-color-primary-light-5);background-color:var(--el-color-primary-light-9);border-color:var(--el-color-primary-light-8)}.el-button--success{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-success);--el-button-border-color:var(--el-color-success);--el-button-outline-color:var(--el-color-success-light-5);--el-button-active-color:var(--el-color-success-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-success-light-5);--el-button-hover-bg-color:var(--el-color-success-light-3);--el-button-hover-border-color:var(--el-color-success-light-3);--el-button-active-bg-color:var(--el-color-success-dark-2);--el-button-active-border-color:var(--el-color-success-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-success-light-5);--el-button-disabled-border-color:var(--el-color-success-light-5)}.el-button--success.is-link,.el-button--success.is-plain,.el-button--success.is-text{--el-button-text-color:var(--el-color-success);--el-button-bg-color:var(--el-color-success-light-9);--el-button-border-color:var(--el-color-success-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-success);--el-button-hover-border-color:var(--el-color-success);--el-button-active-text-color:var(--el-color-white)}.el-button--success.is-link.is-disabled,.el-button--success.is-link.is-disabled:active,.el-button--success.is-link.is-disabled:focus,.el-button--success.is-link.is-disabled:hover,.el-button--success.is-plain.is-disabled,.el-button--success.is-plain.is-disabled:active,.el-button--success.is-plain.is-disabled:focus,.el-button--success.is-plain.is-disabled:hover,.el-button--success.is-text.is-disabled,.el-button--success.is-text.is-disabled:active,.el-button--success.is-text.is-disabled:focus,.el-button--success.is-text.is-disabled:hover{color:var(--el-color-success-light-5);background-color:var(--el-color-success-light-9);border-color:var(--el-color-success-light-8)}.el-button--warning{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-warning);--el-button-border-color:var(--el-color-warning);--el-button-outline-color:var(--el-color-warning-light-5);--el-button-active-color:var(--el-color-warning-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-warning-light-5);--el-button-hover-bg-color:var(--el-color-warning-light-3);--el-button-hover-border-color:var(--el-color-warning-light-3);--el-button-active-bg-color:var(--el-color-warning-dark-2);--el-button-active-border-color:var(--el-color-warning-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-warning-light-5);--el-button-disabled-border-color:var(--el-color-warning-light-5)}.el-button--warning.is-link,.el-button--warning.is-plain,.el-button--warning.is-text{--el-button-text-color:var(--el-color-warning);--el-button-bg-color:var(--el-color-warning-light-9);--el-button-border-color:var(--el-color-warning-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-warning);--el-button-hover-border-color:var(--el-color-warning);--el-button-active-text-color:var(--el-color-white)}.el-button--warning.is-link.is-disabled,.el-button--warning.is-link.is-disabled:active,.el-button--warning.is-link.is-disabled:focus,.el-button--warning.is-link.is-disabled:hover,.el-button--warning.is-plain.is-disabled,.el-button--warning.is-plain.is-disabled:active,.el-button--warning.is-plain.is-disabled:focus,.el-button--warning.is-plain.is-disabled:hover,.el-button--warning.is-text.is-disabled,.el-button--warning.is-text.is-disabled:active,.el-button--warning.is-text.is-disabled:focus,.el-button--warning.is-text.is-disabled:hover{color:var(--el-color-warning-light-5);background-color:var(--el-color-warning-light-9);border-color:var(--el-color-warning-light-8)}.el-button--danger{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-danger);--el-button-border-color:var(--el-color-danger);--el-button-outline-color:var(--el-color-danger-light-5);--el-button-active-color:var(--el-color-danger-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-danger-light-5);--el-button-hover-bg-color:var(--el-color-danger-light-3);--el-button-hover-border-color:var(--el-color-danger-light-3);--el-button-active-bg-color:var(--el-color-danger-dark-2);--el-button-active-border-color:var(--el-color-danger-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-danger-light-5);--el-button-disabled-border-color:var(--el-color-danger-light-5)}.el-button--danger.is-link,.el-button--danger.is-plain,.el-button--danger.is-text{--el-button-text-color:var(--el-color-danger);--el-button-bg-color:var(--el-color-danger-light-9);--el-button-border-color:var(--el-color-danger-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-danger);--el-button-hover-border-color:var(--el-color-danger);--el-button-active-text-color:var(--el-color-white)}.el-button--danger.is-link.is-disabled,.el-button--danger.is-link.is-disabled:active,.el-button--danger.is-link.is-disabled:focus,.el-button--danger.is-link.is-disabled:hover,.el-button--danger.is-plain.is-disabled,.el-button--danger.is-plain.is-disabled:active,.el-button--danger.is-plain.is-disabled:focus,.el-button--danger.is-plain.is-disabled:hover,.el-button--danger.is-text.is-disabled,.el-button--danger.is-text.is-disabled:active,.el-button--danger.is-text.is-disabled:focus,.el-button--danger.is-text.is-disabled:hover{color:var(--el-color-danger-light-5);background-color:var(--el-color-danger-light-9);border-color:var(--el-color-danger-light-8)}.el-button--info{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-info);--el-button-border-color:var(--el-color-info);--el-button-outline-color:var(--el-color-info-light-5);--el-button-active-color:var(--el-color-info-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-info-light-5);--el-button-hover-bg-color:var(--el-color-info-light-3);--el-button-hover-border-color:var(--el-color-info-light-3);--el-button-active-bg-color:var(--el-color-info-dark-2);--el-button-active-border-color:var(--el-color-info-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-info-light-5);--el-button-disabled-border-color:var(--el-color-info-light-5)}.el-button--info.is-link,.el-button--info.is-plain,.el-button--info.is-text{--el-button-text-color:var(--el-color-info);--el-button-bg-color:var(--el-color-info-light-9);--el-button-border-color:var(--el-color-info-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-info);--el-button-hover-border-color:var(--el-color-info);--el-button-active-text-color:var(--el-color-white)}.el-button--info.is-link.is-disabled,.el-button--info.is-link.is-disabled:active,.el-button--info.is-link.is-disabled:focus,.el-button--info.is-link.is-disabled:hover,.el-button--info.is-plain.is-disabled,.el-button--info.is-plain.is-disabled:active,.el-button--info.is-plain.is-disabled:focus,.el-button--info.is-plain.is-disabled:hover,.el-button--info.is-text.is-disabled,.el-button--info.is-text.is-disabled:active,.el-button--info.is-text.is-disabled:focus,.el-button--info.is-text.is-disabled:hover{color:var(--el-color-info-light-5);background-color:var(--el-color-info-light-9);border-color:var(--el-color-info-light-8)}.el-button--large{--el-button-size:40px;height:var(--el-button-size);padding:12px 19px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button--large [class*=el-icon]+span{margin-left:8px}.el-button--large.is-round{padding:12px 19px}.el-button--large.is-circle{width:var(--el-button-size);padding:12px}.el-button--small{--el-button-size:24px;height:var(--el-button-size);padding:5px 11px;font-size:12px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-button--small [class*=el-icon]+span{margin-left:4px}.el-button--small.is-round{padding:5px 11px}.el-button--small.is-circle{width:var(--el-button-size);padding:5px}.el-calendar{--el-calendar-border:var(--el-table-border, 1px solid var(--el-border-color-lighter));--el-calendar-header-border-bottom:var(--el-calendar-border);--el-calendar-selected-bg-color:var(--el-color-primary-light-9);--el-calendar-cell-width:85px;background-color:var(--el-fill-color-blank)}.el-calendar__header{display:flex;justify-content:space-between;padding:12px 20px;border-bottom:var(--el-calendar-header-border-bottom)}.el-calendar__title{color:var(--el-text-color);align-self:center}.el-calendar__body{padding:12px 20px 35px}.el-calendar-table{table-layout:fixed;width:100%}.el-calendar-table thead th{padding:12px 0;color:var(--el-text-color-regular);font-weight:400}.el-calendar-table:not(.is-range) td.next,.el-calendar-table:not(.is-range) td.prev{color:var(--el-text-color-placeholder)}.el-calendar-table td{border-bottom:var(--el-calendar-border);border-right:var(--el-calendar-border);vertical-align:top;transition:background-color var(--el-transition-duration-fast) ease}.el-calendar-table td.is-selected{background-color:var(--el-calendar-selected-bg-color)}.el-calendar-table td.is-today{color:var(--el-color-primary)}.el-calendar-table tr:first-child td{border-top:var(--el-calendar-border)}.el-calendar-table tr td:first-child{border-left:var(--el-calendar-border)}.el-calendar-table tr.el-calendar-table__row--hide-border td{border-top:none}.el-calendar-table .el-calendar-day{box-sizing:border-box;padding:8px;height:var(--el-calendar-cell-width)}.el-calendar-table .el-calendar-day:hover{cursor:pointer;background-color:var(--el-calendar-selected-bg-color)}.el-card{--el-card-border-color:var(--el-border-color-light);--el-card-border-radius:4px;--el-card-padding:20px;--el-card-bg-color:var(--el-fill-color-blank)}.el-card{border-radius:var(--el-card-border-radius);border:1px solid var(--el-card-border-color);background-color:var(--el-card-bg-color);overflow:hidden;color:var(--el-text-color-primary);transition:var(--el-transition-duration)}.el-card.is-always-shadow{box-shadow:var(--el-box-shadow-light)}.el-card.is-hover-shadow:focus,.el-card.is-hover-shadow:hover{box-shadow:var(--el-box-shadow-light)}.el-card__header{padding:calc(var(--el-card-padding) - 2px) var(--el-card-padding);border-bottom:1px solid var(--el-card-border-color);box-sizing:border-box}.el-card__body{padding:var(--el-card-padding)}.el-carousel__item{position:absolute;top:0;left:0;width:100%;height:100%;display:inline-block;overflow:hidden;z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-active{z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-animating{transition:transform .4s ease-in-out}.el-carousel__item--card{width:50%;transition:transform .4s ease-in-out}.el-carousel__item--card.is-in-stage{cursor:pointer;z-index:var(--el-index-normal)}.el-carousel__item--card.is-in-stage.is-hover .el-carousel__mask,.el-carousel__item--card.is-in-stage:hover .el-carousel__mask{opacity:.12}.el-carousel__item--card.is-active{z-index:calc(var(--el-index-normal) + 1)}.el-carousel__mask{position:absolute;width:100%;height:100%;top:0;left:0;background-color:var(--el-color-white);opacity:.24;transition:var(--el-transition-duration-fast)}.el-carousel{--el-carousel-arrow-font-size:12px;--el-carousel-arrow-size:36px;--el-carousel-arrow-background:rgba(31, 45, 61, .11);--el-carousel-arrow-hover-background:rgba(31, 45, 61, .23);--el-carousel-indicator-width:30px;--el-carousel-indicator-height:2px;--el-carousel-indicator-padding-horizontal:4px;--el-carousel-indicator-padding-vertical:12px;--el-carousel-indicator-out-color:var(--el-border-color-hover);position:relative}.el-carousel--horizontal{overflow-x:hidden}.el-carousel--vertical{overflow-y:hidden}.el-carousel__container{position:relative;height:300px}.el-carousel__arrow{border:none;outline:0;padding:0;margin:0;height:var(--el-carousel-arrow-size);width:var(--el-carousel-arrow-size);cursor:pointer;transition:var(--el-transition-duration);border-radius:50%;background-color:var(--el-carousel-arrow-background);color:#fff;position:absolute;top:50%;z-index:10;transform:translateY(-50%);text-align:center;font-size:var(--el-carousel-arrow-font-size);display:inline-flex;justify-content:center;align-items:center}.el-carousel__arrow--left{left:16px}.el-carousel__arrow--right{right:16px}.el-carousel__arrow:hover{background-color:var(--el-carousel-arrow-hover-background)}.el-carousel__arrow i{cursor:pointer}.el-carousel__indicators{position:absolute;list-style:none;margin:0;padding:0;z-index:calc(var(--el-index-normal) + 1)}.el-carousel__indicators--horizontal{bottom:0;left:50%;transform:translate(-50%)}.el-carousel__indicators--vertical{right:0;top:50%;transform:translateY(-50%)}.el-carousel__indicators--outside{bottom:calc(var(--el-carousel-indicator-height) + var(--el-carousel-indicator-padding-vertical) * 2);text-align:center;position:static;transform:none}.el-carousel__indicators--outside .el-carousel__indicator:hover button{opacity:.64}.el-carousel__indicators--outside button{background-color:var(--el-carousel-indicator-out-color);opacity:.24}.el-carousel__indicators--labels{left:0;right:0;transform:none;text-align:center}.el-carousel__indicators--labels .el-carousel__button{height:auto;width:auto;padding:2px 18px;font-size:12px;color:#000}.el-carousel__indicators--labels .el-carousel__indicator{padding:6px 4px}.el-carousel__indicator{background-color:transparent;cursor:pointer}.el-carousel__indicator:hover button{opacity:.72}.el-carousel__indicator--horizontal{display:inline-block;padding:var(--el-carousel-indicator-padding-vertical) var(--el-carousel-indicator-padding-horizontal)}.el-carousel__indicator--vertical{padding:var(--el-carousel-indicator-padding-horizontal) var(--el-carousel-indicator-padding-vertical)}.el-carousel__indicator--vertical .el-carousel__button{width:var(--el-carousel-indicator-height);height:calc(var(--el-carousel-indicator-width)/ 2)}.el-carousel__indicator.is-active button{opacity:1}.el-carousel__button{display:block;opacity:.48;width:var(--el-carousel-indicator-width);height:var(--el-carousel-indicator-height);background-color:#fff;border:none;outline:0;padding:0;margin:0;cursor:pointer;transition:var(--el-transition-duration)}.carousel-arrow-left-enter-from,.carousel-arrow-left-leave-active{transform:translateY(-50%) translate(-10px);opacity:0}.carousel-arrow-right-enter-from,.carousel-arrow-right-leave-active{transform:translateY(-50%) translate(10px);opacity:0}.el-cascader-panel{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader-panel{display:flex;border-radius:var(--el-cascader-menu-radius);font-size:var(--el-cascader-menu-font-size)}.el-cascader-panel.is-bordered{border:var(--el-cascader-menu-border);border-radius:var(--el-cascader-menu-radius)}.el-cascader-menu{min-width:180px;box-sizing:border-box;color:var(--el-cascader-menu-text-color);border-right:var(--el-cascader-menu-border)}.el-cascader-menu:last-child{border-right:none}.el-cascader-menu:last-child .el-cascader-node{padding-right:20px}.el-cascader-menu__wrap.el-scrollbar__wrap{height:204px}.el-cascader-menu__list{position:relative;min-height:100%;margin:0;padding:6px 0;list-style:none;box-sizing:border-box}.el-cascader-menu__hover-zone{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.el-cascader-menu__empty-text{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;color:var(--el-cascader-color-empty)}.el-cascader-menu__empty-text .is-loading{margin-right:2px}.el-cascader-node{position:relative;display:flex;align-items:center;padding:0 30px 0 20px;height:34px;line-height:34px;outline:0}.el-cascader-node.is-selectable.in-active-path{color:var(--el-cascader-menu-text-color)}.el-cascader-node.in-active-path,.el-cascader-node.is-active,.el-cascader-node.is-selectable.in-checked-path{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader-node:not(.is-disabled){cursor:pointer}.el-cascader-node:not(.is-disabled):focus,.el-cascader-node:not(.is-disabled):hover{background:var(--el-cascader-node-background-hover)}.el-cascader-node.is-disabled{color:var(--el-cascader-node-color-disabled);cursor:not-allowed}.el-cascader-node__prefix{position:absolute;left:10px}.el-cascader-node__postfix{position:absolute;right:10px}.el-cascader-node__label{flex:1;text-align:left;padding:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-cascader-node>.el-checkbox{margin-right:0}.el-cascader-node>.el-radio{margin-right:0}.el-cascader-node>.el-radio .el-radio__label{padding-left:0}.el-cascader{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color);display:inline-block;vertical-align:middle;position:relative;font-size:var(--el-font-size-base);line-height:32px;outline:0}.el-cascader:not(.is-disabled):hover .el-input__wrapper{cursor:pointer;box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-cascader .el-input{display:flex;cursor:pointer}.el-cascader .el-input .el-input__inner{text-overflow:ellipsis;cursor:pointer}.el-cascader .el-input .el-input__suffix-inner .el-icon{height:calc(100% - 2px)}.el-cascader .el-input .el-input__suffix-inner .el-icon svg{vertical-align:middle}.el-cascader .el-input .icon-arrow-down{transition:transform var(--el-transition-duration);font-size:14px}.el-cascader .el-input .icon-arrow-down.is-reverse{transform:rotate(180deg)}.el-cascader .el-input .icon-circle-close:hover{color:var(--el-input-clear-hover-color,var(--el-text-color-secondary))}.el-cascader .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-cascader--large{font-size:14px;line-height:40px}.el-cascader--small{font-size:12px;line-height:24px}.el-cascader.is-disabled .el-cascader__label{z-index:calc(var(--el-index-normal) + 1);color:var(--el-disabled-text-color)}.el-cascader__dropdown{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader__dropdown{font-size:var(--el-cascader-menu-font-size);border-radius:var(--el-cascader-menu-radius)}.el-cascader__dropdown.el-popper{background:var(--el-cascader-menu-fill);border:var(--el-cascader-menu-border);box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__dropdown.el-popper .el-popper__arrow:before{border:var(--el-cascader-menu-border)}.el-cascader__dropdown.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-cascader__dropdown.el-popper{box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__tags{position:absolute;left:0;right:30px;top:50%;transform:translateY(-50%);display:flex;flex-wrap:wrap;line-height:normal;text-align:left;box-sizing:border-box}.el-cascader__tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-cascader-tag-background)}.el-cascader__tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__collapse-tags{white-space:normal;z-index:var(--el-index-normal)}.el-cascader__collapse-tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-fill-color)}.el-cascader__collapse-tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__collapse-tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__collapse-tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__suggestion-panel{border-radius:var(--el-cascader-menu-radius)}.el-cascader__suggestion-list{max-height:204px;margin:0;padding:6px 0;font-size:var(--el-font-size-base);color:var(--el-cascader-menu-text-color);text-align:center}.el-cascader__suggestion-item{display:flex;justify-content:space-between;align-items:center;height:34px;padding:0 15px;text-align:left;outline:0;cursor:pointer}.el-cascader__suggestion-item:focus,.el-cascader__suggestion-item:hover{background:var(--el-cascader-node-background-hover)}.el-cascader__suggestion-item.is-checked{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader__suggestion-item>span{margin-right:10px}.el-cascader__empty-text{margin:10px 0;color:var(--el-cascader-color-empty)}.el-cascader__search-input{flex:1;height:24px;min-width:60px;margin:2px 0 2px 11px;padding:0;color:var(--el-cascader-menu-text-color);border:none;outline:0;box-sizing:border-box;background:0 0}.el-cascader__search-input::-moz-placeholder{color:transparent}.el-cascader__search-input:-ms-input-placeholder{color:transparent}.el-cascader__search-input::placeholder{color:transparent}.el-check-tag{background-color:var(--el-color-info-light-9);border-radius:var(--el-border-radius-base);color:var(--el-color-info);cursor:pointer;display:inline-block;font-size:var(--el-font-size-base);line-height:var(--el-font-size-base);padding:7px 15px;transition:var(--el-transition-all);font-weight:700}.el-check-tag:hover{background-color:var(--el-color-info-light-7)}.el-check-tag.is-checked{background-color:var(--el-color-primary-light-8);color:var(--el-color-primary)}.el-check-tag.is-checked:hover{background-color:var(--el-color-primary-light-7)}.el-checkbox-button{--el-checkbox-button-checked-bg-color:var(--el-color-primary);--el-checkbox-button-checked-text-color:var(--el-color-white);--el-checkbox-button-checked-border-color:var(--el-color-primary)}.el-checkbox-button{position:relative;display:inline-block}.el-checkbox-button__inner{display:inline-block;line-height:1;font-weight:var(--el-checkbox-font-weight);white-space:nowrap;vertical-align:middle;cursor:pointer;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button__inner.is-round{padding:8px 15px}.el-checkbox-button__inner:hover{color:var(--el-color-primary)}.el-checkbox-button__inner [class*=el-icon-]{line-height:.9}.el-checkbox-button__inner [class*=el-icon-]+span{margin-left:5px}.el-checkbox-button__original{opacity:0;outline:0;position:absolute;margin:0;z-index:-1}.el-checkbox-button.is-checked .el-checkbox-button__inner{color:var(--el-checkbox-button-checked-text-color);background-color:var(--el-checkbox-button-checked-bg-color);border-color:var(--el-checkbox-button-checked-border-color);box-shadow:-1px 0 0 0 var(--el-color-primary-light-7)}.el-checkbox-button.is-checked:first-child .el-checkbox-button__inner{border-left-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button.is-disabled .el-checkbox-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-checkbox-button.is-disabled:first-child .el-checkbox-button__inner{border-left-color:var(--el-button-disabled-border-color,var(--el-border-color-light))}.el-checkbox-button:first-child .el-checkbox-button__inner{border-left:var(--el-border);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base);box-shadow:none!important}.el-checkbox-button.is-focus .el-checkbox-button__inner{border-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button:last-child .el-checkbox-button__inner{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base)}.el-checkbox-button--large .el-checkbox-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button--large .el-checkbox-button__inner.is-round{padding:12px 19px}.el-checkbox-button--small .el-checkbox-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-checkbox-button--small .el-checkbox-button__inner.is-round{padding:5px 11px}.el-checkbox-group{font-size:0;line-height:0}.el-checkbox{--el-checkbox-font-size:14px;--el-checkbox-font-weight:var(--el-font-weight-primary);--el-checkbox-text-color:var(--el-text-color-regular);--el-checkbox-input-height:14px;--el-checkbox-input-width:14px;--el-checkbox-border-radius:var(--el-border-radius-small);--el-checkbox-bg-color:var(--el-fill-color-blank);--el-checkbox-input-border:var(--el-border);--el-checkbox-disabled-border-color:var(--el-border-color);--el-checkbox-disabled-input-fill:var(--el-fill-color-light);--el-checkbox-disabled-icon-color:var(--el-text-color-placeholder);--el-checkbox-disabled-checked-input-fill:var(--el-border-color-extra-light);--el-checkbox-disabled-checked-input-border-color:var(--el-border-color);--el-checkbox-disabled-checked-icon-color:var(--el-text-color-placeholder);--el-checkbox-checked-text-color:var(--el-color-primary);--el-checkbox-checked-input-border-color:var(--el-color-primary);--el-checkbox-checked-bg-color:var(--el-color-primary);--el-checkbox-checked-icon-color:var(--el-color-white);--el-checkbox-input-border-color-hover:var(--el-color-primary)}.el-checkbox{color:var(--el-checkbox-text-color);font-weight:var(--el-checkbox-font-weight);font-size:var(--el-font-size-base);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:30px;height:32px}.el-checkbox.is-disabled{cursor:not-allowed}.el-checkbox.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-checkbox.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-checkbox.is-bordered.is-disabled{border-color:var(--el-border-color-lighter)}.el-checkbox.is-bordered.el-checkbox--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__label{font-size:var(--el-font-size-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__inner{height:14px;width:14px}.el-checkbox.is-bordered.el-checkbox--small{padding:0 11px 0 7px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner:after{height:6px;width:2px}.el-checkbox input:focus-visible+.el-checkbox__inner{outline:2px solid var(--el-checkbox-input-border-color-hover);outline-offset:1px;border-radius:var(--el-checkbox-border-radius)}.el-checkbox__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative}.el-checkbox__input.is-disabled .el-checkbox__inner{background-color:var(--el-checkbox-disabled-input-fill);border-color:var(--el-checkbox-disabled-border-color);cursor:not-allowed}.el-checkbox__input.is-disabled .el-checkbox__inner:after{cursor:not-allowed;border-color:var(--el-checkbox-disabled-icon-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner:after{border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner:before{background-color:var(--el-checkbox-disabled-checked-icon-color);border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled+span.el-checkbox__label{color:var(--el-disabled-text-color);cursor:not-allowed}.el-checkbox__input.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-checked .el-checkbox__inner:after{transform:rotate(45deg) scaleY(1)}.el-checkbox__input.is-checked+.el-checkbox__label{color:var(--el-checkbox-checked-text-color)}.el-checkbox__input.is-focus:not(.is-checked) .el-checkbox__original:not(:focus-visible){border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__input.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-indeterminate .el-checkbox__inner:before{content:"";position:absolute;display:block;background-color:var(--el-checkbox-checked-icon-color);height:2px;transform:scale(.5);left:0;right:0;top:5px}.el-checkbox__input.is-indeterminate .el-checkbox__inner:after{display:none}.el-checkbox__inner{display:inline-block;position:relative;border:var(--el-checkbox-input-border);border-radius:var(--el-checkbox-border-radius);box-sizing:border-box;width:var(--el-checkbox-input-width);height:var(--el-checkbox-input-height);background-color:var(--el-checkbox-bg-color);z-index:var(--el-index-normal);transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46),outline .25s cubic-bezier(.71,-.46,.29,1.46)}.el-checkbox__inner:hover{border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__inner:after{box-sizing:content-box;content:"";border:1px solid var(--el-checkbox-checked-icon-color);border-left:0;border-top:0;height:7px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:3px;transition:transform .15s ease-in 50ms;transform-origin:center}.el-checkbox__original{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.el-checkbox__label{display:inline-block;padding-left:8px;line-height:1;font-size:var(--el-checkbox-font-size)}.el-checkbox.el-checkbox--large{height:40px}.el-checkbox.el-checkbox--large .el-checkbox__label{font-size:14px}.el-checkbox.el-checkbox--large .el-checkbox__inner{width:14px;height:14px}.el-checkbox.el-checkbox--small{height:24px}.el-checkbox.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.el-checkbox--small .el-checkbox__inner{width:12px;height:12px}.el-checkbox.el-checkbox--small .el-checkbox__input.is-indeterminate .el-checkbox__inner:before{top:4px}.el-checkbox.el-checkbox--small .el-checkbox__inner:after{width:2px;height:6px}.el-checkbox:last-of-type{margin-right:0}[class*=el-col-]{box-sizing:border-box}[class*=el-col-].is-guttered{display:block;min-height:1px}.el-col-0,.el-col-0.is-guttered{display:none}.el-col-0{max-width:0%;flex:0 0 0%}.el-col-offset-0{margin-left:0}.el-col-pull-0{position:relative;right:0}.el-col-push-0{position:relative;left:0}.el-col-1{max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-offset-1{margin-left:4.1666666667%}.el-col-pull-1{position:relative;right:4.1666666667%}.el-col-push-1{position:relative;left:4.1666666667%}.el-col-2{max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-offset-2{margin-left:8.3333333333%}.el-col-pull-2{position:relative;right:8.3333333333%}.el-col-push-2{position:relative;left:8.3333333333%}.el-col-3{max-width:12.5%;flex:0 0 12.5%}.el-col-offset-3{margin-left:12.5%}.el-col-pull-3{position:relative;right:12.5%}.el-col-push-3{position:relative;left:12.5%}.el-col-4{max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-offset-4{margin-left:16.6666666667%}.el-col-pull-4{position:relative;right:16.6666666667%}.el-col-push-4{position:relative;left:16.6666666667%}.el-col-5{max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-offset-5{margin-left:20.8333333333%}.el-col-pull-5{position:relative;right:20.8333333333%}.el-col-push-5{position:relative;left:20.8333333333%}.el-col-6{max-width:25%;flex:0 0 25%}.el-col-offset-6{margin-left:25%}.el-col-pull-6{position:relative;right:25%}.el-col-push-6{position:relative;left:25%}.el-col-7{max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-offset-7{margin-left:29.1666666667%}.el-col-pull-7{position:relative;right:29.1666666667%}.el-col-push-7{position:relative;left:29.1666666667%}.el-col-8{max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-offset-8{margin-left:33.3333333333%}.el-col-pull-8{position:relative;right:33.3333333333%}.el-col-push-8{position:relative;left:33.3333333333%}.el-col-9{max-width:37.5%;flex:0 0 37.5%}.el-col-offset-9{margin-left:37.5%}.el-col-pull-9{position:relative;right:37.5%}.el-col-push-9{position:relative;left:37.5%}.el-col-10{max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-offset-10{margin-left:41.6666666667%}.el-col-pull-10{position:relative;right:41.6666666667%}.el-col-push-10{position:relative;left:41.6666666667%}.el-col-11{max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-offset-11{margin-left:45.8333333333%}.el-col-pull-11{position:relative;right:45.8333333333%}.el-col-push-11{position:relative;left:45.8333333333%}.el-col-12{max-width:50%;flex:0 0 50%}.el-col-offset-12{margin-left:50%}.el-col-pull-12{position:relative;right:50%}.el-col-push-12{position:relative;left:50%}.el-col-13{max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-offset-13{margin-left:54.1666666667%}.el-col-pull-13{position:relative;right:54.1666666667%}.el-col-push-13{position:relative;left:54.1666666667%}.el-col-14{max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-offset-14{margin-left:58.3333333333%}.el-col-pull-14{position:relative;right:58.3333333333%}.el-col-push-14{position:relative;left:58.3333333333%}.el-col-15{max-width:62.5%;flex:0 0 62.5%}.el-col-offset-15{margin-left:62.5%}.el-col-pull-15{position:relative;right:62.5%}.el-col-push-15{position:relative;left:62.5%}.el-col-16{max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-offset-16{margin-left:66.6666666667%}.el-col-pull-16{position:relative;right:66.6666666667%}.el-col-push-16{position:relative;left:66.6666666667%}.el-col-17{max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-offset-17{margin-left:70.8333333333%}.el-col-pull-17{position:relative;right:70.8333333333%}.el-col-push-17{position:relative;left:70.8333333333%}.el-col-18{max-width:75%;flex:0 0 75%}.el-col-offset-18{margin-left:75%}.el-col-pull-18{position:relative;right:75%}.el-col-push-18{position:relative;left:75%}.el-col-19{max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-offset-19{margin-left:79.1666666667%}.el-col-pull-19{position:relative;right:79.1666666667%}.el-col-push-19{position:relative;left:79.1666666667%}.el-col-20{max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-offset-20{margin-left:83.3333333333%}.el-col-pull-20{position:relative;right:83.3333333333%}.el-col-push-20{position:relative;left:83.3333333333%}.el-col-21{max-width:87.5%;flex:0 0 87.5%}.el-col-offset-21{margin-left:87.5%}.el-col-pull-21{position:relative;right:87.5%}.el-col-push-21{position:relative;left:87.5%}.el-col-22{max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-offset-22{margin-left:91.6666666667%}.el-col-pull-22{position:relative;right:91.6666666667%}.el-col-push-22{position:relative;left:91.6666666667%}.el-col-23{max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-offset-23{margin-left:95.8333333333%}.el-col-pull-23{position:relative;right:95.8333333333%}.el-col-push-23{position:relative;left:95.8333333333%}.el-col-24{max-width:100%;flex:0 0 100%}.el-col-offset-24{margin-left:100%}.el-col-pull-24{position:relative;right:100%}.el-col-push-24{position:relative;left:100%}@media only screen and (max-width:768px){.el-col-xs-0,.el-col-xs-0.is-guttered{display:none}.el-col-xs-0{max-width:0%;flex:0 0 0%}.el-col-xs-offset-0{margin-left:0}.el-col-xs-pull-0{position:relative;right:0}.el-col-xs-push-0{position:relative;left:0}.el-col-xs-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xs-offset-1{margin-left:4.1666666667%}.el-col-xs-pull-1{position:relative;right:4.1666666667%}.el-col-xs-push-1{position:relative;left:4.1666666667%}.el-col-xs-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xs-offset-2{margin-left:8.3333333333%}.el-col-xs-pull-2{position:relative;right:8.3333333333%}.el-col-xs-push-2{position:relative;left:8.3333333333%}.el-col-xs-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xs-offset-3{margin-left:12.5%}.el-col-xs-pull-3{position:relative;right:12.5%}.el-col-xs-push-3{position:relative;left:12.5%}.el-col-xs-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xs-offset-4{margin-left:16.6666666667%}.el-col-xs-pull-4{position:relative;right:16.6666666667%}.el-col-xs-push-4{position:relative;left:16.6666666667%}.el-col-xs-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xs-offset-5{margin-left:20.8333333333%}.el-col-xs-pull-5{position:relative;right:20.8333333333%}.el-col-xs-push-5{position:relative;left:20.8333333333%}.el-col-xs-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xs-offset-6{margin-left:25%}.el-col-xs-pull-6{position:relative;right:25%}.el-col-xs-push-6{position:relative;left:25%}.el-col-xs-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xs-offset-7{margin-left:29.1666666667%}.el-col-xs-pull-7{position:relative;right:29.1666666667%}.el-col-xs-push-7{position:relative;left:29.1666666667%}.el-col-xs-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xs-offset-8{margin-left:33.3333333333%}.el-col-xs-pull-8{position:relative;right:33.3333333333%}.el-col-xs-push-8{position:relative;left:33.3333333333%}.el-col-xs-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xs-offset-9{margin-left:37.5%}.el-col-xs-pull-9{position:relative;right:37.5%}.el-col-xs-push-9{position:relative;left:37.5%}.el-col-xs-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xs-offset-10{margin-left:41.6666666667%}.el-col-xs-pull-10{position:relative;right:41.6666666667%}.el-col-xs-push-10{position:relative;left:41.6666666667%}.el-col-xs-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xs-offset-11{margin-left:45.8333333333%}.el-col-xs-pull-11{position:relative;right:45.8333333333%}.el-col-xs-push-11{position:relative;left:45.8333333333%}.el-col-xs-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xs-offset-12{margin-left:50%}.el-col-xs-pull-12{position:relative;right:50%}.el-col-xs-push-12{position:relative;left:50%}.el-col-xs-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xs-offset-13{margin-left:54.1666666667%}.el-col-xs-pull-13{position:relative;right:54.1666666667%}.el-col-xs-push-13{position:relative;left:54.1666666667%}.el-col-xs-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xs-offset-14{margin-left:58.3333333333%}.el-col-xs-pull-14{position:relative;right:58.3333333333%}.el-col-xs-push-14{position:relative;left:58.3333333333%}.el-col-xs-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xs-offset-15{margin-left:62.5%}.el-col-xs-pull-15{position:relative;right:62.5%}.el-col-xs-push-15{position:relative;left:62.5%}.el-col-xs-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xs-offset-16{margin-left:66.6666666667%}.el-col-xs-pull-16{position:relative;right:66.6666666667%}.el-col-xs-push-16{position:relative;left:66.6666666667%}.el-col-xs-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xs-offset-17{margin-left:70.8333333333%}.el-col-xs-pull-17{position:relative;right:70.8333333333%}.el-col-xs-push-17{position:relative;left:70.8333333333%}.el-col-xs-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xs-offset-18{margin-left:75%}.el-col-xs-pull-18{position:relative;right:75%}.el-col-xs-push-18{position:relative;left:75%}.el-col-xs-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xs-offset-19{margin-left:79.1666666667%}.el-col-xs-pull-19{position:relative;right:79.1666666667%}.el-col-xs-push-19{position:relative;left:79.1666666667%}.el-col-xs-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xs-offset-20{margin-left:83.3333333333%}.el-col-xs-pull-20{position:relative;right:83.3333333333%}.el-col-xs-push-20{position:relative;left:83.3333333333%}.el-col-xs-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xs-offset-21{margin-left:87.5%}.el-col-xs-pull-21{position:relative;right:87.5%}.el-col-xs-push-21{position:relative;left:87.5%}.el-col-xs-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xs-offset-22{margin-left:91.6666666667%}.el-col-xs-pull-22{position:relative;right:91.6666666667%}.el-col-xs-push-22{position:relative;left:91.6666666667%}.el-col-xs-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xs-offset-23{margin-left:95.8333333333%}.el-col-xs-pull-23{position:relative;right:95.8333333333%}.el-col-xs-push-23{position:relative;left:95.8333333333%}.el-col-xs-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xs-offset-24{margin-left:100%}.el-col-xs-pull-24{position:relative;right:100%}.el-col-xs-push-24{position:relative;left:100%}}@media only screen and (min-width:768px){.el-col-sm-0,.el-col-sm-0.is-guttered{display:none}.el-col-sm-0{max-width:0%;flex:0 0 0%}.el-col-sm-offset-0{margin-left:0}.el-col-sm-pull-0{position:relative;right:0}.el-col-sm-push-0{position:relative;left:0}.el-col-sm-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-sm-offset-1{margin-left:4.1666666667%}.el-col-sm-pull-1{position:relative;right:4.1666666667%}.el-col-sm-push-1{position:relative;left:4.1666666667%}.el-col-sm-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-sm-offset-2{margin-left:8.3333333333%}.el-col-sm-pull-2{position:relative;right:8.3333333333%}.el-col-sm-push-2{position:relative;left:8.3333333333%}.el-col-sm-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-sm-offset-3{margin-left:12.5%}.el-col-sm-pull-3{position:relative;right:12.5%}.el-col-sm-push-3{position:relative;left:12.5%}.el-col-sm-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-sm-offset-4{margin-left:16.6666666667%}.el-col-sm-pull-4{position:relative;right:16.6666666667%}.el-col-sm-push-4{position:relative;left:16.6666666667%}.el-col-sm-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-sm-offset-5{margin-left:20.8333333333%}.el-col-sm-pull-5{position:relative;right:20.8333333333%}.el-col-sm-push-5{position:relative;left:20.8333333333%}.el-col-sm-6{display:block;max-width:25%;flex:0 0 25%}.el-col-sm-offset-6{margin-left:25%}.el-col-sm-pull-6{position:relative;right:25%}.el-col-sm-push-6{position:relative;left:25%}.el-col-sm-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-sm-offset-7{margin-left:29.1666666667%}.el-col-sm-pull-7{position:relative;right:29.1666666667%}.el-col-sm-push-7{position:relative;left:29.1666666667%}.el-col-sm-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-sm-offset-8{margin-left:33.3333333333%}.el-col-sm-pull-8{position:relative;right:33.3333333333%}.el-col-sm-push-8{position:relative;left:33.3333333333%}.el-col-sm-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-sm-offset-9{margin-left:37.5%}.el-col-sm-pull-9{position:relative;right:37.5%}.el-col-sm-push-9{position:relative;left:37.5%}.el-col-sm-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-sm-offset-10{margin-left:41.6666666667%}.el-col-sm-pull-10{position:relative;right:41.6666666667%}.el-col-sm-push-10{position:relative;left:41.6666666667%}.el-col-sm-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-sm-offset-11{margin-left:45.8333333333%}.el-col-sm-pull-11{position:relative;right:45.8333333333%}.el-col-sm-push-11{position:relative;left:45.8333333333%}.el-col-sm-12{display:block;max-width:50%;flex:0 0 50%}.el-col-sm-offset-12{margin-left:50%}.el-col-sm-pull-12{position:relative;right:50%}.el-col-sm-push-12{position:relative;left:50%}.el-col-sm-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-sm-offset-13{margin-left:54.1666666667%}.el-col-sm-pull-13{position:relative;right:54.1666666667%}.el-col-sm-push-13{position:relative;left:54.1666666667%}.el-col-sm-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-sm-offset-14{margin-left:58.3333333333%}.el-col-sm-pull-14{position:relative;right:58.3333333333%}.el-col-sm-push-14{position:relative;left:58.3333333333%}.el-col-sm-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-sm-offset-15{margin-left:62.5%}.el-col-sm-pull-15{position:relative;right:62.5%}.el-col-sm-push-15{position:relative;left:62.5%}.el-col-sm-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-sm-offset-16{margin-left:66.6666666667%}.el-col-sm-pull-16{position:relative;right:66.6666666667%}.el-col-sm-push-16{position:relative;left:66.6666666667%}.el-col-sm-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-sm-offset-17{margin-left:70.8333333333%}.el-col-sm-pull-17{position:relative;right:70.8333333333%}.el-col-sm-push-17{position:relative;left:70.8333333333%}.el-col-sm-18{display:block;max-width:75%;flex:0 0 75%}.el-col-sm-offset-18{margin-left:75%}.el-col-sm-pull-18{position:relative;right:75%}.el-col-sm-push-18{position:relative;left:75%}.el-col-sm-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-sm-offset-19{margin-left:79.1666666667%}.el-col-sm-pull-19{position:relative;right:79.1666666667%}.el-col-sm-push-19{position:relative;left:79.1666666667%}.el-col-sm-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-sm-offset-20{margin-left:83.3333333333%}.el-col-sm-pull-20{position:relative;right:83.3333333333%}.el-col-sm-push-20{position:relative;left:83.3333333333%}.el-col-sm-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-sm-offset-21{margin-left:87.5%}.el-col-sm-pull-21{position:relative;right:87.5%}.el-col-sm-push-21{position:relative;left:87.5%}.el-col-sm-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-sm-offset-22{margin-left:91.6666666667%}.el-col-sm-pull-22{position:relative;right:91.6666666667%}.el-col-sm-push-22{position:relative;left:91.6666666667%}.el-col-sm-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-sm-offset-23{margin-left:95.8333333333%}.el-col-sm-pull-23{position:relative;right:95.8333333333%}.el-col-sm-push-23{position:relative;left:95.8333333333%}.el-col-sm-24{display:block;max-width:100%;flex:0 0 100%}.el-col-sm-offset-24{margin-left:100%}.el-col-sm-pull-24{position:relative;right:100%}.el-col-sm-push-24{position:relative;left:100%}}@media only screen and (min-width:992px){.el-col-md-0,.el-col-md-0.is-guttered{display:none}.el-col-md-0{max-width:0%;flex:0 0 0%}.el-col-md-offset-0{margin-left:0}.el-col-md-pull-0{position:relative;right:0}.el-col-md-push-0{position:relative;left:0}.el-col-md-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-md-offset-1{margin-left:4.1666666667%}.el-col-md-pull-1{position:relative;right:4.1666666667%}.el-col-md-push-1{position:relative;left:4.1666666667%}.el-col-md-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-md-offset-2{margin-left:8.3333333333%}.el-col-md-pull-2{position:relative;right:8.3333333333%}.el-col-md-push-2{position:relative;left:8.3333333333%}.el-col-md-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-md-offset-3{margin-left:12.5%}.el-col-md-pull-3{position:relative;right:12.5%}.el-col-md-push-3{position:relative;left:12.5%}.el-col-md-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-md-offset-4{margin-left:16.6666666667%}.el-col-md-pull-4{position:relative;right:16.6666666667%}.el-col-md-push-4{position:relative;left:16.6666666667%}.el-col-md-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-md-offset-5{margin-left:20.8333333333%}.el-col-md-pull-5{position:relative;right:20.8333333333%}.el-col-md-push-5{position:relative;left:20.8333333333%}.el-col-md-6{display:block;max-width:25%;flex:0 0 25%}.el-col-md-offset-6{margin-left:25%}.el-col-md-pull-6{position:relative;right:25%}.el-col-md-push-6{position:relative;left:25%}.el-col-md-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-md-offset-7{margin-left:29.1666666667%}.el-col-md-pull-7{position:relative;right:29.1666666667%}.el-col-md-push-7{position:relative;left:29.1666666667%}.el-col-md-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-md-offset-8{margin-left:33.3333333333%}.el-col-md-pull-8{position:relative;right:33.3333333333%}.el-col-md-push-8{position:relative;left:33.3333333333%}.el-col-md-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-md-offset-9{margin-left:37.5%}.el-col-md-pull-9{position:relative;right:37.5%}.el-col-md-push-9{position:relative;left:37.5%}.el-col-md-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-md-offset-10{margin-left:41.6666666667%}.el-col-md-pull-10{position:relative;right:41.6666666667%}.el-col-md-push-10{position:relative;left:41.6666666667%}.el-col-md-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-md-offset-11{margin-left:45.8333333333%}.el-col-md-pull-11{position:relative;right:45.8333333333%}.el-col-md-push-11{position:relative;left:45.8333333333%}.el-col-md-12{display:block;max-width:50%;flex:0 0 50%}.el-col-md-offset-12{margin-left:50%}.el-col-md-pull-12{position:relative;right:50%}.el-col-md-push-12{position:relative;left:50%}.el-col-md-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-md-offset-13{margin-left:54.1666666667%}.el-col-md-pull-13{position:relative;right:54.1666666667%}.el-col-md-push-13{position:relative;left:54.1666666667%}.el-col-md-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-md-offset-14{margin-left:58.3333333333%}.el-col-md-pull-14{position:relative;right:58.3333333333%}.el-col-md-push-14{position:relative;left:58.3333333333%}.el-col-md-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-md-offset-15{margin-left:62.5%}.el-col-md-pull-15{position:relative;right:62.5%}.el-col-md-push-15{position:relative;left:62.5%}.el-col-md-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-md-offset-16{margin-left:66.6666666667%}.el-col-md-pull-16{position:relative;right:66.6666666667%}.el-col-md-push-16{position:relative;left:66.6666666667%}.el-col-md-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-md-offset-17{margin-left:70.8333333333%}.el-col-md-pull-17{position:relative;right:70.8333333333%}.el-col-md-push-17{position:relative;left:70.8333333333%}.el-col-md-18{display:block;max-width:75%;flex:0 0 75%}.el-col-md-offset-18{margin-left:75%}.el-col-md-pull-18{position:relative;right:75%}.el-col-md-push-18{position:relative;left:75%}.el-col-md-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-md-offset-19{margin-left:79.1666666667%}.el-col-md-pull-19{position:relative;right:79.1666666667%}.el-col-md-push-19{position:relative;left:79.1666666667%}.el-col-md-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-md-offset-20{margin-left:83.3333333333%}.el-col-md-pull-20{position:relative;right:83.3333333333%}.el-col-md-push-20{position:relative;left:83.3333333333%}.el-col-md-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-md-offset-21{margin-left:87.5%}.el-col-md-pull-21{position:relative;right:87.5%}.el-col-md-push-21{position:relative;left:87.5%}.el-col-md-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-md-offset-22{margin-left:91.6666666667%}.el-col-md-pull-22{position:relative;right:91.6666666667%}.el-col-md-push-22{position:relative;left:91.6666666667%}.el-col-md-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-md-offset-23{margin-left:95.8333333333%}.el-col-md-pull-23{position:relative;right:95.8333333333%}.el-col-md-push-23{position:relative;left:95.8333333333%}.el-col-md-24{display:block;max-width:100%;flex:0 0 100%}.el-col-md-offset-24{margin-left:100%}.el-col-md-pull-24{position:relative;right:100%}.el-col-md-push-24{position:relative;left:100%}}@media only screen and (min-width:1200px){.el-col-lg-0,.el-col-lg-0.is-guttered{display:none}.el-col-lg-0{max-width:0%;flex:0 0 0%}.el-col-lg-offset-0{margin-left:0}.el-col-lg-pull-0{position:relative;right:0}.el-col-lg-push-0{position:relative;left:0}.el-col-lg-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-lg-offset-1{margin-left:4.1666666667%}.el-col-lg-pull-1{position:relative;right:4.1666666667%}.el-col-lg-push-1{position:relative;left:4.1666666667%}.el-col-lg-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-lg-offset-2{margin-left:8.3333333333%}.el-col-lg-pull-2{position:relative;right:8.3333333333%}.el-col-lg-push-2{position:relative;left:8.3333333333%}.el-col-lg-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-lg-offset-3{margin-left:12.5%}.el-col-lg-pull-3{position:relative;right:12.5%}.el-col-lg-push-3{position:relative;left:12.5%}.el-col-lg-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-lg-offset-4{margin-left:16.6666666667%}.el-col-lg-pull-4{position:relative;right:16.6666666667%}.el-col-lg-push-4{position:relative;left:16.6666666667%}.el-col-lg-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-lg-offset-5{margin-left:20.8333333333%}.el-col-lg-pull-5{position:relative;right:20.8333333333%}.el-col-lg-push-5{position:relative;left:20.8333333333%}.el-col-lg-6{display:block;max-width:25%;flex:0 0 25%}.el-col-lg-offset-6{margin-left:25%}.el-col-lg-pull-6{position:relative;right:25%}.el-col-lg-push-6{position:relative;left:25%}.el-col-lg-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-lg-offset-7{margin-left:29.1666666667%}.el-col-lg-pull-7{position:relative;right:29.1666666667%}.el-col-lg-push-7{position:relative;left:29.1666666667%}.el-col-lg-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-lg-offset-8{margin-left:33.3333333333%}.el-col-lg-pull-8{position:relative;right:33.3333333333%}.el-col-lg-push-8{position:relative;left:33.3333333333%}.el-col-lg-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-lg-offset-9{margin-left:37.5%}.el-col-lg-pull-9{position:relative;right:37.5%}.el-col-lg-push-9{position:relative;left:37.5%}.el-col-lg-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-lg-offset-10{margin-left:41.6666666667%}.el-col-lg-pull-10{position:relative;right:41.6666666667%}.el-col-lg-push-10{position:relative;left:41.6666666667%}.el-col-lg-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-lg-offset-11{margin-left:45.8333333333%}.el-col-lg-pull-11{position:relative;right:45.8333333333%}.el-col-lg-push-11{position:relative;left:45.8333333333%}.el-col-lg-12{display:block;max-width:50%;flex:0 0 50%}.el-col-lg-offset-12{margin-left:50%}.el-col-lg-pull-12{position:relative;right:50%}.el-col-lg-push-12{position:relative;left:50%}.el-col-lg-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-lg-offset-13{margin-left:54.1666666667%}.el-col-lg-pull-13{position:relative;right:54.1666666667%}.el-col-lg-push-13{position:relative;left:54.1666666667%}.el-col-lg-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-lg-offset-14{margin-left:58.3333333333%}.el-col-lg-pull-14{position:relative;right:58.3333333333%}.el-col-lg-push-14{position:relative;left:58.3333333333%}.el-col-lg-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-lg-offset-15{margin-left:62.5%}.el-col-lg-pull-15{position:relative;right:62.5%}.el-col-lg-push-15{position:relative;left:62.5%}.el-col-lg-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-lg-offset-16{margin-left:66.6666666667%}.el-col-lg-pull-16{position:relative;right:66.6666666667%}.el-col-lg-push-16{position:relative;left:66.6666666667%}.el-col-lg-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-lg-offset-17{margin-left:70.8333333333%}.el-col-lg-pull-17{position:relative;right:70.8333333333%}.el-col-lg-push-17{position:relative;left:70.8333333333%}.el-col-lg-18{display:block;max-width:75%;flex:0 0 75%}.el-col-lg-offset-18{margin-left:75%}.el-col-lg-pull-18{position:relative;right:75%}.el-col-lg-push-18{position:relative;left:75%}.el-col-lg-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-lg-offset-19{margin-left:79.1666666667%}.el-col-lg-pull-19{position:relative;right:79.1666666667%}.el-col-lg-push-19{position:relative;left:79.1666666667%}.el-col-lg-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-lg-offset-20{margin-left:83.3333333333%}.el-col-lg-pull-20{position:relative;right:83.3333333333%}.el-col-lg-push-20{position:relative;left:83.3333333333%}.el-col-lg-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-lg-offset-21{margin-left:87.5%}.el-col-lg-pull-21{position:relative;right:87.5%}.el-col-lg-push-21{position:relative;left:87.5%}.el-col-lg-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-lg-offset-22{margin-left:91.6666666667%}.el-col-lg-pull-22{position:relative;right:91.6666666667%}.el-col-lg-push-22{position:relative;left:91.6666666667%}.el-col-lg-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-lg-offset-23{margin-left:95.8333333333%}.el-col-lg-pull-23{position:relative;right:95.8333333333%}.el-col-lg-push-23{position:relative;left:95.8333333333%}.el-col-lg-24{display:block;max-width:100%;flex:0 0 100%}.el-col-lg-offset-24{margin-left:100%}.el-col-lg-pull-24{position:relative;right:100%}.el-col-lg-push-24{position:relative;left:100%}}@media only screen and (min-width:1920px){.el-col-xl-0,.el-col-xl-0.is-guttered{display:none}.el-col-xl-0{max-width:0%;flex:0 0 0%}.el-col-xl-offset-0{margin-left:0}.el-col-xl-pull-0{position:relative;right:0}.el-col-xl-push-0{position:relative;left:0}.el-col-xl-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xl-offset-1{margin-left:4.1666666667%}.el-col-xl-pull-1{position:relative;right:4.1666666667%}.el-col-xl-push-1{position:relative;left:4.1666666667%}.el-col-xl-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xl-offset-2{margin-left:8.3333333333%}.el-col-xl-pull-2{position:relative;right:8.3333333333%}.el-col-xl-push-2{position:relative;left:8.3333333333%}.el-col-xl-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xl-offset-3{margin-left:12.5%}.el-col-xl-pull-3{position:relative;right:12.5%}.el-col-xl-push-3{position:relative;left:12.5%}.el-col-xl-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xl-offset-4{margin-left:16.6666666667%}.el-col-xl-pull-4{position:relative;right:16.6666666667%}.el-col-xl-push-4{position:relative;left:16.6666666667%}.el-col-xl-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xl-offset-5{margin-left:20.8333333333%}.el-col-xl-pull-5{position:relative;right:20.8333333333%}.el-col-xl-push-5{position:relative;left:20.8333333333%}.el-col-xl-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xl-offset-6{margin-left:25%}.el-col-xl-pull-6{position:relative;right:25%}.el-col-xl-push-6{position:relative;left:25%}.el-col-xl-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xl-offset-7{margin-left:29.1666666667%}.el-col-xl-pull-7{position:relative;right:29.1666666667%}.el-col-xl-push-7{position:relative;left:29.1666666667%}.el-col-xl-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xl-offset-8{margin-left:33.3333333333%}.el-col-xl-pull-8{position:relative;right:33.3333333333%}.el-col-xl-push-8{position:relative;left:33.3333333333%}.el-col-xl-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xl-offset-9{margin-left:37.5%}.el-col-xl-pull-9{position:relative;right:37.5%}.el-col-xl-push-9{position:relative;left:37.5%}.el-col-xl-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xl-offset-10{margin-left:41.6666666667%}.el-col-xl-pull-10{position:relative;right:41.6666666667%}.el-col-xl-push-10{position:relative;left:41.6666666667%}.el-col-xl-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xl-offset-11{margin-left:45.8333333333%}.el-col-xl-pull-11{position:relative;right:45.8333333333%}.el-col-xl-push-11{position:relative;left:45.8333333333%}.el-col-xl-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xl-offset-12{margin-left:50%}.el-col-xl-pull-12{position:relative;right:50%}.el-col-xl-push-12{position:relative;left:50%}.el-col-xl-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xl-offset-13{margin-left:54.1666666667%}.el-col-xl-pull-13{position:relative;right:54.1666666667%}.el-col-xl-push-13{position:relative;left:54.1666666667%}.el-col-xl-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xl-offset-14{margin-left:58.3333333333%}.el-col-xl-pull-14{position:relative;right:58.3333333333%}.el-col-xl-push-14{position:relative;left:58.3333333333%}.el-col-xl-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xl-offset-15{margin-left:62.5%}.el-col-xl-pull-15{position:relative;right:62.5%}.el-col-xl-push-15{position:relative;left:62.5%}.el-col-xl-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xl-offset-16{margin-left:66.6666666667%}.el-col-xl-pull-16{position:relative;right:66.6666666667%}.el-col-xl-push-16{position:relative;left:66.6666666667%}.el-col-xl-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xl-offset-17{margin-left:70.8333333333%}.el-col-xl-pull-17{position:relative;right:70.8333333333%}.el-col-xl-push-17{position:relative;left:70.8333333333%}.el-col-xl-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xl-offset-18{margin-left:75%}.el-col-xl-pull-18{position:relative;right:75%}.el-col-xl-push-18{position:relative;left:75%}.el-col-xl-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xl-offset-19{margin-left:79.1666666667%}.el-col-xl-pull-19{position:relative;right:79.1666666667%}.el-col-xl-push-19{position:relative;left:79.1666666667%}.el-col-xl-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xl-offset-20{margin-left:83.3333333333%}.el-col-xl-pull-20{position:relative;right:83.3333333333%}.el-col-xl-push-20{position:relative;left:83.3333333333%}.el-col-xl-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xl-offset-21{margin-left:87.5%}.el-col-xl-pull-21{position:relative;right:87.5%}.el-col-xl-push-21{position:relative;left:87.5%}.el-col-xl-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xl-offset-22{margin-left:91.6666666667%}.el-col-xl-pull-22{position:relative;right:91.6666666667%}.el-col-xl-push-22{position:relative;left:91.6666666667%}.el-col-xl-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xl-offset-23{margin-left:95.8333333333%}.el-col-xl-pull-23{position:relative;right:95.8333333333%}.el-col-xl-push-23{position:relative;left:95.8333333333%}.el-col-xl-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xl-offset-24{margin-left:100%}.el-col-xl-pull-24{position:relative;right:100%}.el-col-xl-push-24{position:relative;left:100%}}.el-collapse{--el-collapse-border-color:var(--el-border-color-lighter);--el-collapse-header-height:48px;--el-collapse-header-bg-color:var(--el-fill-color-blank);--el-collapse-header-text-color:var(--el-text-color-primary);--el-collapse-header-font-size:13px;--el-collapse-content-bg-color:var(--el-fill-color-blank);--el-collapse-content-font-size:13px;--el-collapse-content-text-color:var(--el-text-color-primary);border-top:1px solid var(--el-collapse-border-color);border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item.is-disabled .el-collapse-item__header{color:var(--el-text-color-disabled);cursor:not-allowed}.el-collapse-item__header{display:flex;align-items:center;height:var(--el-collapse-header-height);line-height:var(--el-collapse-header-height);background-color:var(--el-collapse-header-bg-color);color:var(--el-collapse-header-text-color);cursor:pointer;border-bottom:1px solid var(--el-collapse-border-color);font-size:var(--el-collapse-header-font-size);font-weight:500;transition:border-bottom-color var(--el-transition-duration);outline:0}.el-collapse-item__arrow{margin:0 8px 0 auto;transition:transform var(--el-transition-duration);font-weight:300}.el-collapse-item__arrow.is-active{transform:rotate(90deg)}.el-collapse-item__header.focusing:focus:not(:hover){color:var(--el-color-primary)}.el-collapse-item__header.is-active{border-bottom-color:transparent}.el-collapse-item__wrap{will-change:height;background-color:var(--el-collapse-content-bg-color);overflow:hidden;box-sizing:border-box;border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item__content{padding-bottom:25px;font-size:var(--el-collapse-content-font-size);color:var(--el-collapse-content-text-color);line-height:1.7692307692}.el-collapse-item:last-child{margin-bottom:-1px}.el-color-predefine{display:flex;font-size:12px;margin-top:8px;width:280px}.el-color-predefine__colors{display:flex;flex:1;flex-wrap:wrap}.el-color-predefine__color-selector{margin:0 0 8px 8px;width:20px;height:20px;border-radius:4px;cursor:pointer}.el-color-predefine__color-selector:nth-child(10n+1){margin-left:0}.el-color-predefine__color-selector.selected{box-shadow:0 0 3px 2px var(--el-color-primary)}.el-color-predefine__color-selector>div{display:flex;height:100%;border-radius:3px}.el-color-predefine__color-selector.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-hue-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-color:red;padding:0 2px;float:right}.el-color-hue-slider__bar{position:relative;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);height:100%}.el-color-hue-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-hue-slider.is-vertical{width:12px;height:180px;padding:2px 0}.el-color-hue-slider.is-vertical .el-color-hue-slider__bar{background:linear-gradient(to bottom,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}.el-color-hue-slider.is-vertical .el-color-hue-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-svpanel{position:relative;width:280px;height:180px}.el-color-svpanel__black,.el-color-svpanel__white{position:absolute;top:0;left:0;right:0;bottom:0}.el-color-svpanel__white{background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.el-color-svpanel__black{background:linear-gradient(to top,#000,rgba(0,0,0,0))}.el-color-svpanel__cursor{position:absolute}.el-color-svpanel__cursor>div{cursor:head;width:4px;height:4px;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px #0000004d,0 0 1px 2px #0006;border-radius:50%;transform:translate(-2px,-2px)}.el-color-alpha-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-alpha-slider__bar{position:relative;background:linear-gradient(to right,rgba(255,255,255,0) 0,var(--el-bg-color) 100%);height:100%}.el-color-alpha-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-alpha-slider.is-vertical{width:20px;height:180px}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__bar{background:linear-gradient(to bottom,rgba(255,255,255,0) 0,#fff 100%)}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-dropdown{width:300px}.el-color-dropdown__main-wrapper{margin-bottom:6px}.el-color-dropdown__main-wrapper:after{content:"";display:table;clear:both}.el-color-dropdown__btns{margin-top:12px;text-align:right}.el-color-dropdown__value{float:left;line-height:26px;font-size:12px;color:#000;width:160px}.el-color-picker{display:inline-block;position:relative;line-height:normal;outline:0}.el-color-picker:hover:not(.is-disabled) .el-color-picker__trigger{border:1px solid var(--el-border-color-hover)}.el-color-picker:focus-visible:not(.is-disabled) .el-color-picker__trigger{outline:2px solid var(--el-color-primary);outline-offset:1px}.el-color-picker.is-disabled .el-color-picker__trigger{cursor:not-allowed}.el-color-picker--large{height:40px}.el-color-picker--large .el-color-picker__trigger{height:40px;width:40px}.el-color-picker--large .el-color-picker__mask{height:38px;width:38px}.el-color-picker--small{height:24px}.el-color-picker--small .el-color-picker__trigger{height:24px;width:24px}.el-color-picker--small .el-color-picker__mask{height:22px;width:22px}.el-color-picker--small .el-color-picker__empty,.el-color-picker--small .el-color-picker__icon{transform:scale(.8)}.el-color-picker__mask{height:30px;width:30px;border-radius:4px;position:absolute;top:1px;left:1px;z-index:1;cursor:not-allowed;background-color:#ffffffb3}.el-color-picker__trigger{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;height:32px;width:32px;padding:4px;border:1px solid var(--el-border-color);border-radius:4px;font-size:0;position:relative;cursor:pointer}.el-color-picker__color{position:relative;display:block;box-sizing:border-box;border:1px solid var(--el-text-color-secondary);border-radius:var(--el-border-radius-small);width:100%;height:100%;text-align:center}.el-color-picker__color.is-alpha{background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-picker__color-inner{display:inline-flex;justify-content:center;align-items:center;width:100%;height:100%}.el-color-picker .el-color-picker__empty{font-size:12px;color:var(--el-text-color-secondary)}.el-color-picker .el-color-picker__icon{display:inline-flex;justify-content:center;align-items:center;color:#fff;font-size:12px}.el-color-picker__panel{position:absolute;z-index:10;padding:6px;box-sizing:content-box;background-color:#fff;border-radius:var(--el-border-radius-base);box-shadow:var(--el-box-shadow-light)}.el-color-picker__panel.el-popper{border:1px solid var(--el-border-color-lighter)}.el-color-picker,.el-color-picker__panel{--el-color-picker-alpha-bg-a:#ccc;--el-color-picker-alpha-bg-b:transparent}.dark .el-color-picker,.dark .el-color-picker__panel{--el-color-picker-alpha-bg-a:#333333}.el-container{display:flex;flex-direction:row;flex:1;flex-basis:auto;box-sizing:border-box;min-width:0}.el-container.is-vertical{flex-direction:column}.el-date-table{font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-date-table.is-week-mode .el-date-table__row:hover .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table.is-week-mode .el-date-table__row:hover td.available:hover{color:var(--el-datepicker-text-color)}.el-date-table.is-week-mode .el-date-table__row:hover td:first-child .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table.is-week-mode .el-date-table__row:hover td:last-child .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table.is-week-mode .el-date-table__row.current .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td{width:32px;height:30px;padding:4px 0;box-sizing:border-box;text-align:center;cursor:pointer;position:relative}.el-date-table td .el-date-table-cell{height:30px;padding:3px 0;box-sizing:border-box}.el-date-table td .el-date-table-cell .el-date-table-cell__text{width:24px;height:24px;display:block;margin:0 auto;line-height:24px;position:absolute;left:50%;transform:translate(-50%);border-radius:50%}.el-date-table td.next-month,.el-date-table td.prev-month{color:var(--el-datepicker-off-text-color)}.el-date-table td.today{position:relative}.el-date-table td.today .el-date-table-cell__text{color:var(--el-color-primary);font-weight:700}.el-date-table td.today.end-date .el-date-table-cell__text,.el-date-table td.today.start-date .el-date-table-cell__text{color:#fff}.el-date-table td.available:hover{color:var(--el-datepicker-hover-text-color)}.el-date-table td.in-range .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td.in-range .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.current:not(.disabled) .el-date-table-cell__text{color:#fff;background-color:var(--el-datepicker-active-color)}.el-date-table td.current:not(.disabled):focus-visible .el-date-table-cell__text{outline:2px solid var(--el-datepicker-active-color);outline-offset:1px}.el-date-table td.end-date .el-date-table-cell,.el-date-table td.start-date .el-date-table-cell{color:#fff}.el-date-table td.end-date .el-date-table-cell__text,.el-date-table td.start-date .el-date-table-cell__text{background-color:var(--el-datepicker-active-color)}.el-date-table td.start-date .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table td.end-date .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table td.disabled .el-date-table-cell{background-color:var(--el-fill-color-light);opacity:1;cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-date-table td.selected .el-date-table-cell{margin-left:5px;margin-right:5px;background-color:var(--el-datepicker-inrange-bg-color);border-radius:15px}.el-date-table td.selected .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.selected .el-date-table-cell__text{background-color:var(--el-datepicker-active-color);color:#fff;border-radius:15px}.el-date-table td.week{font-size:80%;color:var(--el-datepicker-header-text-color)}.el-date-table td:focus{outline:0}.el-date-table th{padding:5px;color:var(--el-datepicker-header-text-color);font-weight:400;border-bottom:solid 1px var(--el-border-color-lighter)}.el-month-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-month-table td{text-align:center;padding:8px 0;cursor:pointer}.el-month-table td div{height:48px;padding:6px 0;box-sizing:border-box}.el-month-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-month-table td.today.end-date .cell,.el-month-table td.today.start-date .cell{color:#fff}.el-month-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-month-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-month-table td .cell{width:60px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);margin:0 auto;border-radius:18px}.el-month-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-month-table td.in-range div{background-color:var(--el-datepicker-inrange-bg-color)}.el-month-table td.in-range div:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-month-table td.end-date div,.el-month-table td.start-date div{color:#fff}.el-month-table td.end-date .cell,.el-month-table td.start-date .cell{color:#fff;background-color:var(--el-datepicker-active-color)}.el-month-table td.start-date div{border-top-left-radius:24px;border-bottom-left-radius:24px}.el-month-table td.end-date div{border-top-right-radius:24px;border-bottom-right-radius:24px}.el-month-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-month-table td:focus-visible{outline:0}.el-month-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-year-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-year-table .el-icon{color:var(--el-datepicker-icon-color)}.el-year-table td{text-align:center;padding:20px 3px;cursor:pointer}.el-year-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-year-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-year-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-year-table td .cell{width:48px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);border-radius:18px;margin:0 auto}.el-year-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-year-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-year-table td:focus-visible{outline:0}.el-year-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-time-spinner.has-seconds .el-time-spinner__wrapper{width:33.3%}.el-time-spinner__wrapper{max-height:192px;overflow:auto;display:inline-block;width:50%;vertical-align:top;position:relative}.el-time-spinner__wrapper.el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default){padding-bottom:15px}.el-time-spinner__wrapper.is-arrow{box-sizing:border-box;text-align:center;overflow:hidden}.el-time-spinner__wrapper.is-arrow .el-time-spinner__list{transform:translateY(-32px)}.el-time-spinner__wrapper.is-arrow .el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:default}.el-time-spinner__arrow{font-size:12px;color:var(--el-text-color-secondary);position:absolute;left:0;width:100%;z-index:var(--el-index-normal);text-align:center;height:30px;line-height:30px;cursor:pointer}.el-time-spinner__arrow:hover{color:var(--el-color-primary)}.el-time-spinner__arrow.arrow-up{top:10px}.el-time-spinner__arrow.arrow-down{bottom:10px}.el-time-spinner__input.el-input{width:70%}.el-time-spinner__input.el-input .el-input__inner{padding:0;text-align:center}.el-time-spinner__list{padding:0;margin:0;list-style:none;text-align:center}.el-time-spinner__list:after,.el-time-spinner__list:before{content:"";display:block;width:100%;height:80px}.el-time-spinner__item{height:32px;line-height:32px;font-size:12px;color:var(--el-text-color-regular)}.el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:pointer}.el-time-spinner__item.is-active:not(.is-disabled){color:var(--el-text-color-primary);font-weight:700}.el-time-spinner__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-picker__popper{--el-datepicker-border-color:var(--el-disabled-border-color)}.el-picker__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-datepicker-border-color);box-shadow:var(--el-box-shadow-light)}.el-picker__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-datepicker-border-color)}.el-picker__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-date-editor{--el-date-editor-width:220px;--el-date-editor-monthrange-width:300px;--el-date-editor-daterange-width:350px;--el-date-editor-datetimerange-width:400px;--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary);position:relative;display:inline-block;text-align:left}.el-date-editor.el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-date-editor.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-date-editor.el-input,.el-date-editor.el-input__wrapper{width:var(--el-date-editor-width);height:var(--el-input-height,var(--el-component-size))}.el-date-editor--monthrange{--el-date-editor-width:var(--el-date-editor-monthrange-width)}.el-date-editor--daterange,.el-date-editor--timerange{--el-date-editor-width:var(--el-date-editor-daterange-width)}.el-date-editor--datetimerange{--el-date-editor-width:var(--el-date-editor-datetimerange-width)}.el-date-editor--dates .el-input__wrapper{text-overflow:ellipsis;white-space:nowrap}.el-date-editor .close-icon,.el-date-editor .clear-icon{cursor:pointer}.el-date-editor .clear-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__icon{height:inherit;font-size:14px;color:var(--el-text-color-placeholder);float:left}.el-date-editor .el-range__icon svg{vertical-align:middle}.el-date-editor .el-range-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;outline:0;display:inline-block;height:30px;line-height:30px;margin:0;padding:0;width:39%;text-align:center;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);background-color:transparent}.el-date-editor .el-range-input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input::placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-separator{flex:1;display:inline-flex;justify-content:center;align-items:center;height:100%;padding:0 5px;margin:0;font-size:14px;word-break:keep-all;color:var(--el-text-color-primary)}.el-date-editor .el-range__close-icon{font-size:14px;color:var(--el-text-color-placeholder);height:inherit;width:unset;cursor:pointer}.el-date-editor .el-range__close-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__close-icon svg{vertical-align:middle}.el-date-editor .el-range__close-icon--hidden{opacity:0;visibility:hidden}.el-range-editor.el-input__wrapper{display:inline-flex;align-items:center;padding:0 10px}.el-range-editor.is-active,.el-range-editor.is-active:hover{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-range-editor--large{line-height:var(--el-component-size-large)}.el-range-editor--large.el-input__wrapper{height:var(--el-component-size-large)}.el-range-editor--large .el-range-separator{line-height:40px;font-size:14px}.el-range-editor--large .el-range-input{height:38px;line-height:38px;font-size:14px}.el-range-editor--small{line-height:var(--el-component-size-small)}.el-range-editor--small.el-input__wrapper{height:var(--el-component-size-small)}.el-range-editor--small .el-range-separator{line-height:24px;font-size:12px}.el-range-editor--small .el-range-input{height:22px;line-height:22px;font-size:12px}.el-range-editor.is-disabled{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled:focus,.el-range-editor.is-disabled:hover{border-color:var(--el-disabled-border-color)}.el-range-editor.is-disabled input{background-color:var(--el-disabled-bg-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input::placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled .el-range-separator{color:var(--el-disabled-text-color)}.el-picker-panel{color:var(--el-text-color-regular);background:var(--el-bg-color-overlay);border-radius:var(--el-border-radius-base);line-height:30px}.el-picker-panel .el-time-panel{margin:5px 0;border:solid 1px var(--el-datepicker-border-color);background-color:var(--el-bg-color-overlay);box-shadow:var(--el-box-shadow-light)}.el-picker-panel__body-wrapper:after,.el-picker-panel__body:after{content:"";display:table;clear:both}.el-picker-panel__content{position:relative;margin:15px}.el-picker-panel__footer{border-top:1px solid var(--el-datepicker-inner-border-color);padding:4px 12px;text-align:right;background-color:var(--el-bg-color-overlay);position:relative;font-size:0}.el-picker-panel__shortcut{display:block;width:100%;border:0;background-color:transparent;line-height:28px;font-size:14px;color:var(--el-datepicker-text-color);padding-left:12px;text-align:left;outline:0;cursor:pointer}.el-picker-panel__shortcut:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__shortcut.active{background-color:#e6f1fe;color:var(--el-datepicker-active-color)}.el-picker-panel__btn{border:1px solid var(--el-fill-color-darker);color:var(--el-text-color-primary);line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:0;font-size:12px}.el-picker-panel__btn[disabled]{color:var(--el-text-color-disabled);cursor:not-allowed}.el-picker-panel__icon-btn{font-size:12px;color:var(--el-datepicker-icon-color);border:0;background:0 0;cursor:pointer;outline:0;margin-top:8px}.el-picker-panel__icon-btn:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn:focus-visible{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn.is-disabled{color:var(--el-text-color-disabled)}.el-picker-panel__icon-btn.is-disabled:hover{cursor:not-allowed}.el-picker-panel__icon-btn .el-icon{cursor:pointer;font-size:inherit}.el-picker-panel__link-btn{vertical-align:middle}.el-picker-panel [slot=sidebar],.el-picker-panel__sidebar{position:absolute;top:0;bottom:0;width:110px;border-right:1px solid var(--el-datepicker-inner-border-color);box-sizing:border-box;padding-top:6px;background-color:var(--el-bg-color-overlay);overflow:auto}.el-picker-panel [slot=sidebar]+.el-picker-panel__body,.el-picker-panel__sidebar+.el-picker-panel__body{margin-left:110px}.el-date-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-picker{width:322px}.el-date-picker.has-sidebar.has-time{width:434px}.el-date-picker.has-sidebar{width:438px}.el-date-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-picker .el-picker-panel__content{width:292px}.el-date-picker table{table-layout:fixed;width:100%}.el-date-picker__editor-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-picker__header{margin:12px;text-align:center}.el-date-picker__header--bordered{margin-bottom:0;padding-bottom:12px;border-bottom:solid 1px var(--el-border-color-lighter)}.el-date-picker__header--bordered+.el-picker-panel__content{margin-top:0}.el-date-picker__header-label{font-size:16px;font-weight:500;padding:0 5px;line-height:22px;text-align:center;cursor:pointer;color:var(--el-text-color-regular)}.el-date-picker__header-label:hover{color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label:focus-visible{outline:0;color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label.active{color:var(--el-datepicker-active-color)}.el-date-picker__prev-btn{float:left}.el-date-picker__next-btn{float:right}.el-date-picker__time-wrap{padding:10px;text-align:center}.el-date-picker__time-label{float:left;cursor:pointer;line-height:30px;margin-left:10px}.el-date-picker .el-time-panel{position:absolute}.el-date-range-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-range-picker{width:646px}.el-date-range-picker.has-sidebar{width:756px}.el-date-range-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-range-picker table{table-layout:fixed;width:100%}.el-date-range-picker .el-picker-panel__body{min-width:513px}.el-date-range-picker .el-picker-panel__content{margin:0}.el-date-range-picker__header{position:relative;text-align:center;height:28px}.el-date-range-picker__header [class*=arrow-left]{float:left}.el-date-range-picker__header [class*=arrow-right]{float:right}.el-date-range-picker__header div{font-size:16px;font-weight:500;margin-right:50px}.el-date-range-picker__content{float:left;width:50%;box-sizing:border-box;margin:0;padding:16px}.el-date-range-picker__content.is-left{border-right:1px solid var(--el-datepicker-inner-border-color)}.el-date-range-picker__content .el-date-range-picker__header div{margin-left:50px;margin-right:50px}.el-date-range-picker__editors-wrap{box-sizing:border-box;display:table-cell}.el-date-range-picker__editors-wrap.is-right{text-align:right}.el-date-range-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-range-picker__time-header>.el-icon-arrow-right{font-size:20px;vertical-align:middle;display:table-cell;color:var(--el-datepicker-icon-color)}.el-date-range-picker__time-picker-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-range-picker__time-picker-wrap .el-picker-panel{position:absolute;top:13px;right:0;z-index:1;background:#fff}.el-date-range-picker__time-picker-wrap .el-time-panel{position:absolute}.el-time-range-picker{width:354px;overflow:visible}.el-time-range-picker__content{position:relative;text-align:center;padding:10px;z-index:1}.el-time-range-picker__cell{box-sizing:border-box;margin:0;padding:4px 7px 7px;width:50%;display:inline-block}.el-time-range-picker__header{margin-bottom:5px;text-align:center;font-size:14px}.el-time-range-picker__body{border-radius:2px;border:1px solid var(--el-datepicker-border-color)}.el-time-panel{border-radius:2px;position:relative;width:180px;left:0;z-index:var(--el-index-top);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:content-box}.el-time-panel__content{font-size:0;position:relative;overflow:hidden}.el-time-panel__content:after,.el-time-panel__content:before{content:"";top:50%;position:absolute;margin-top:-16px;height:32px;z-index:-1;left:0;right:0;box-sizing:border-box;padding-top:6px;text-align:left}.el-time-panel__content:after{left:50%;margin-left:12%;margin-right:12%}.el-time-panel__content:before{padding-left:50%;margin-right:12%;margin-left:12%;border-top:1px solid var(--el-border-color-light);border-bottom:1px solid var(--el-border-color-light)}.el-time-panel__content.has-seconds:after{left:66.6666666667%}.el-time-panel__content.has-seconds:before{padding-left:33.3333333333%}.el-time-panel__footer{border-top:1px solid var(--el-timepicker-inner-border-color,var(--el-border-color-light));padding:4px;height:36px;line-height:25px;text-align:right;box-sizing:border-box}.el-time-panel__btn{border:none;line-height:28px;padding:0 5px;margin:0 5px;cursor:pointer;background-color:transparent;outline:0;font-size:12px;color:var(--el-text-color-primary)}.el-time-panel__btn.confirm{font-weight:800;color:var(--el-timepicker-active-color,var(--el-color-primary))}.el-descriptions{--el-descriptions-table-border:1px solid var(--el-border-color-lighter);--el-descriptions-item-bordered-label-background:var(--el-fill-color-light);box-sizing:border-box;font-size:var(--el-font-size-base);color:var(--el-text-color-primary)}.el-descriptions__header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.el-descriptions__title{color:var(--el-text-color-primary);font-size:16px;font-weight:700}.el-descriptions__body{background-color:var(--el-fill-color-blank)}.el-descriptions__body .el-descriptions__table{border-collapse:collapse;width:100%}.el-descriptions__body .el-descriptions__table .el-descriptions__cell{box-sizing:border-box;text-align:left;font-weight:400;line-height:23px;font-size:14px}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-left{text-align:left}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-center{text-align:center}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-right{text-align:right}.el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{border:var(--el-descriptions-table-border);padding:8px 11px}.el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:12px}.el-descriptions--large{font-size:14px}.el-descriptions--large .el-descriptions__header{margin-bottom:20px}.el-descriptions--large .el-descriptions__header .el-descriptions__title{font-size:16px}.el-descriptions--large .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:14px}.el-descriptions--large .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:12px 15px}.el-descriptions--large .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:16px}.el-descriptions--small{font-size:12px}.el-descriptions--small .el-descriptions__header{margin-bottom:12px}.el-descriptions--small .el-descriptions__header .el-descriptions__title{font-size:14px}.el-descriptions--small .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:12px}.el-descriptions--small .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:4px 7px}.el-descriptions--small .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:8px}.el-descriptions__label.el-descriptions__cell.is-bordered-label{font-weight:700;color:var(--el-text-color-regular);background:var(--el-descriptions-item-bordered-label-background)}.el-descriptions__label:not(.is-bordered-label){color:var(--el-text-color-primary);margin-right:16px}.el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:6px}.el-descriptions__content.el-descriptions__cell.is-bordered-content{color:var(--el-text-color-primary)}.el-descriptions__content:not(.is-bordered-label){color:var(--el-text-color-regular)}.el-descriptions--large .el-descriptions__label:not(.is-bordered-label){margin-right:16px}.el-descriptions--large .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:8px}.el-descriptions--small .el-descriptions__label:not(.is-bordered-label){margin-right:12px}.el-descriptions--small .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:4px}:root{--el-popup-modal-bg-color:var(--el-color-black);--el-popup-modal-opacity:.5}.v-modal-enter{-webkit-animation:v-modal-in var(--el-transition-duration-fast) ease;animation:v-modal-in var(--el-transition-duration-fast) ease}.v-modal-leave{-webkit-animation:v-modal-out var(--el-transition-duration-fast) ease forwards;animation:v-modal-out var(--el-transition-duration-fast) ease forwards}@-webkit-keyframes v-modal-in{0%{opacity:0}}@keyframes v-modal-in{0%{opacity:0}}@-webkit-keyframes v-modal-out{to{opacity:0}}@keyframes v-modal-out{to{opacity:0}}.v-modal{position:fixed;left:0;top:0;width:100%;height:100%;opacity:var(--el-popup-modal-opacity);background:var(--el-popup-modal-bg-color)}.el-popup-parent--hidden{overflow:hidden}.el-dialog{--el-dialog-width:50%;--el-dialog-margin-top:15vh;--el-dialog-bg-color:var(--el-bg-color);--el-dialog-box-shadow:var(--el-box-shadow);--el-dialog-title-font-size:var(--el-font-size-large);--el-dialog-content-font-size:14px;--el-dialog-font-line-height:var(--el-font-line-height-primary);--el-dialog-padding-primary:20px;--el-dialog-border-radius:var(--el-border-radius-small);position:relative;margin:var(--el-dialog-margin-top,15vh) auto 50px;background:var(--el-dialog-bg-color);border-radius:var(--el-dialog-border-radius);box-shadow:var(--el-dialog-box-shadow);box-sizing:border-box;width:var(--el-dialog-width,50%)}.el-dialog:focus{outline:0!important}.el-dialog.is-align-center{margin:auto}.el-dialog.is-fullscreen{--el-dialog-width:100%;--el-dialog-margin-top:0;margin-bottom:0;height:100%;overflow:auto}.el-dialog__wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;margin:0}.el-dialog.is-draggable .el-dialog__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-dialog__header{padding:var(--el-dialog-padding-primary);padding-bottom:10px;margin-right:16px}.el-dialog__headerbtn{position:absolute;top:6px;right:0;padding:0;width:54px;height:54px;background:0 0;border:none;outline:0;cursor:pointer;font-size:var(--el-message-close-size,16px)}.el-dialog__headerbtn .el-dialog__close{color:var(--el-color-info);font-size:inherit}.el-dialog__headerbtn:focus .el-dialog__close,.el-dialog__headerbtn:hover .el-dialog__close{color:var(--el-color-primary)}.el-dialog__title{line-height:var(--el-dialog-font-line-height);font-size:var(--el-dialog-title-font-size);color:var(--el-text-color-primary)}.el-dialog__body{padding:calc(var(--el-dialog-padding-primary) + 10px) var(--el-dialog-padding-primary);color:var(--el-text-color-regular);font-size:var(--el-dialog-content-font-size)}.el-dialog__footer{padding:var(--el-dialog-padding-primary);padding-top:10px;text-align:right;box-sizing:border-box}.el-dialog--center{text-align:center}.el-dialog--center .el-dialog__body{text-align:initial;padding:25px calc(var(--el-dialog-padding-primary) + 5px) 30px}.el-dialog--center .el-dialog__footer{text-align:inherit}.el-overlay-dialog{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto}.dialog-fade-enter-active{-webkit-animation:modal-fade-in var(--el-transition-duration);animation:modal-fade-in var(--el-transition-duration)}.dialog-fade-enter-active .el-overlay-dialog{-webkit-animation:dialog-fade-in var(--el-transition-duration);animation:dialog-fade-in var(--el-transition-duration)}.dialog-fade-leave-active{-webkit-animation:modal-fade-out var(--el-transition-duration);animation:modal-fade-out var(--el-transition-duration)}.dialog-fade-leave-active .el-overlay-dialog{-webkit-animation:dialog-fade-out var(--el-transition-duration);animation:dialog-fade-out var(--el-transition-duration)}@-webkit-keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@-webkit-keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@-webkit-keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}@keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}.el-divider{position:relative}.el-divider--horizontal{display:block;height:1px;width:100%;margin:24px 0;border-top:1px var(--el-border-color) var(--el-border-style)}.el-divider--vertical{display:inline-block;width:1px;height:1em;margin:0 8px;vertical-align:middle;position:relative;border-left:1px var(--el-border-color) var(--el-border-style)}.el-divider__text{position:absolute;background-color:var(--el-bg-color);padding:0 20px;font-weight:500;color:var(--el-text-color-primary);font-size:14px}.el-divider__text.is-left{left:20px;transform:translateY(-50%)}.el-divider__text.is-center{left:50%;transform:translate(-50%) translateY(-50%)}.el-divider__text.is-right{right:20px;transform:translateY(-50%)}.el-drawer{--el-drawer-bg-color:var(--el-dialog-bg-color, var(--el-bg-color));--el-drawer-padding-primary:var(--el-dialog-padding-primary, 20px)}.el-drawer{position:absolute;box-sizing:border-box;background-color:var(--el-drawer-bg-color);display:flex;flex-direction:column;box-shadow:var(--el-box-shadow-dark);overflow:hidden;transition:all var(--el-transition-duration)}.el-drawer .rtl,.el-drawer .ltr,.el-drawer .ttb,.el-drawer .btt{transform:translate(0)}.el-drawer__sr-focus:focus{outline:0!important}.el-drawer__header{align-items:center;color:#72767b;display:flex;margin-bottom:32px;padding:var(--el-drawer-padding-primary);padding-bottom:0}.el-drawer__header>:first-child{flex:1}.el-drawer__title{margin:0;flex:1;line-height:inherit;font-size:1rem}.el-drawer__footer{padding:var(--el-drawer-padding-primary);padding-top:10px;text-align:right}.el-drawer__close-btn{display:inline-flex;border:none;cursor:pointer;font-size:var(--el-font-size-extra-large);color:inherit;background-color:transparent;outline:0}.el-drawer__close-btn:focus i,.el-drawer__close-btn:hover i{color:var(--el-color-primary)}.el-drawer__body{flex:1;padding:var(--el-drawer-padding-primary);overflow:auto}.el-drawer__body>*{box-sizing:border-box}.el-drawer.ltr,.el-drawer.rtl{height:100%;top:0;bottom:0}.el-drawer.btt,.el-drawer.ttb{width:100%;left:0;right:0}.el-drawer.ltr{left:0}.el-drawer.rtl{right:0}.el-drawer.ttb{top:0}.el-drawer.btt{bottom:0}.el-drawer-fade-enter-active,.el-drawer-fade-leave-active{transition:all var(--el-transition-duration)}.el-drawer-fade-enter-active,.el-drawer-fade-enter-from,.el-drawer-fade-enter-to,.el-drawer-fade-leave-active,.el-drawer-fade-leave-from,.el-drawer-fade-leave-to{overflow:hidden!important}.el-drawer-fade-enter-from,.el-drawer-fade-leave-to{opacity:0}.el-drawer-fade-enter-to,.el-drawer-fade-leave-from{opacity:1}.el-drawer-fade-enter-from .rtl,.el-drawer-fade-leave-to .rtl{transform:translate(100%)}.el-drawer-fade-enter-from .ltr,.el-drawer-fade-leave-to .ltr{transform:translate(-100%)}.el-drawer-fade-enter-from .ttb,.el-drawer-fade-leave-to .ttb{transform:translateY(-100%)}.el-drawer-fade-enter-from .btt,.el-drawer-fade-leave-to .btt{transform:translateY(100%)}.el-dropdown{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10;display:inline-flex;position:relative;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);line-height:1;vertical-align:top}.el-dropdown.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-dropdown__popper{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10}.el-dropdown__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-dropdown-menu-box-shadow)}.el-dropdown__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-dropdown__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-dropdown__popper .el-dropdown-menu{border:none}.el-dropdown__popper .el-dropdown__popper-selfdefine{outline:0}.el-dropdown__popper .el-scrollbar__bar{z-index:calc(var(--el-dropdown-menu-index) + 1)}.el-dropdown__popper .el-dropdown__list{list-style:none;padding:0;margin:0;box-sizing:border-box}.el-dropdown .el-dropdown__caret-button{padding-left:0;padding-right:0;display:inline-flex;justify-content:center;align-items:center;width:32px;border-left:none}.el-dropdown .el-dropdown__caret-button>span{display:inline-flex}.el-dropdown .el-dropdown__caret-button:before{content:"";position:absolute;display:block;width:1px;top:-1px;bottom:-1px;left:0;background:var(--el-overlay-color-lighter)}.el-dropdown .el-dropdown__caret-button.el-button:before{background:var(--el-border-color);opacity:.5}.el-dropdown .el-dropdown__caret-button .el-dropdown__icon{font-size:inherit;padding-left:0}.el-dropdown .el-dropdown-selfdefine{outline:0}.el-dropdown--large .el-dropdown__caret-button{width:40px}.el-dropdown--small .el-dropdown__caret-button{width:24px}.el-dropdown-menu{position:relative;top:0;left:0;z-index:var(--el-dropdown-menu-index);padding:5px 0;margin:0;background-color:var(--el-bg-color-overlay);border:none;border-radius:var(--el-border-radius-base);box-shadow:none;list-style:none}.el-dropdown-menu__item{display:flex;align-items:center;white-space:nowrap;list-style:none;line-height:22px;padding:5px 16px;margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);cursor:pointer;outline:0}.el-dropdown-menu__item:not(.is-disabled):focus{background-color:var(--el-dropdown-menuItem-hover-fill);color:var(--el-dropdown-menuItem-hover-color)}.el-dropdown-menu__item i{margin-right:5px}.el-dropdown-menu__item--divided{margin:6px 0;border-top:1px solid var(--el-border-color-lighter)}.el-dropdown-menu__item.is-disabled{cursor:not-allowed;color:var(--el-text-color-disabled)}.el-dropdown-menu--large{padding:7px 0}.el-dropdown-menu--large .el-dropdown-menu__item{padding:7px 20px;line-height:22px;font-size:14px}.el-dropdown-menu--large .el-dropdown-menu__item--divided{margin:8px 0}.el-dropdown-menu--small{padding:3px 0}.el-dropdown-menu--small .el-dropdown-menu__item{padding:2px 12px;line-height:20px;font-size:12px}.el-dropdown-menu--small .el-dropdown-menu__item--divided{margin:4px 0}.el-empty{--el-empty-padding:40px 0;--el-empty-image-width:160px;--el-empty-description-margin-top:20px;--el-empty-bottom-margin-top:20px;--el-empty-fill-color-0:var(--el-color-white);--el-empty-fill-color-1:#fcfcfd;--el-empty-fill-color-2:#f8f9fb;--el-empty-fill-color-3:#f7f8fc;--el-empty-fill-color-4:#eeeff3;--el-empty-fill-color-5:#edeef2;--el-empty-fill-color-6:#e9ebef;--el-empty-fill-color-7:#e5e7e9;--el-empty-fill-color-8:#e0e3e9;--el-empty-fill-color-9:#d5d7de;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-empty-padding)}.el-empty__image{width:var(--el-empty-image-width)}.el-empty__image img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;height:100%;vertical-align:top;-o-object-fit:contain;object-fit:contain}.el-empty__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:100%;height:100%;vertical-align:top}.el-empty__description{margin-top:var(--el-empty-description-margin-top)}.el-empty__description p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-secondary)}.el-empty__bottom{margin-top:var(--el-empty-bottom-margin-top)}.el-footer{--el-footer-padding:0 20px;--el-footer-height:60px;padding:var(--el-footer-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-footer-height)}.el-form{--el-form-label-font-size:var(--el-font-size-base)}.el-form--label-left .el-form-item__label{justify-content:flex-start}.el-form--label-top .el-form-item{display:block}.el-form--label-top .el-form-item .el-form-item__label{display:block;height:auto;text-align:left;margin-bottom:8px;line-height:22px}.el-form--inline .el-form-item{display:inline-flex;vertical-align:middle;margin-right:32px}.el-form--inline.el-form--label-top{display:flex;flex-wrap:wrap}.el-form--inline.el-form--label-top .el-form-item{display:block}.el-form--large.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:12px;line-height:22px}.el-form--default.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:8px;line-height:22px}.el-form--small.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:4px;line-height:20px}.el-form-item{display:flex;--font-size:14px;margin-bottom:18px}.el-form-item .el-form-item{margin-bottom:0}.el-form-item .el-input__validateIcon{display:none}.el-form-item--large{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:22px}.el-form-item--large .el-form-item__label{height:40px;line-height:40px}.el-form-item--large .el-form-item__content{line-height:40px}.el-form-item--large .el-form-item__error{padding-top:4px}.el-form-item--default{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--default .el-form-item__label{height:32px;line-height:32px}.el-form-item--default .el-form-item__content{line-height:32px}.el-form-item--default .el-form-item__error{padding-top:2px}.el-form-item--small{--font-size:12px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--small .el-form-item__label{height:24px;line-height:24px}.el-form-item--small .el-form-item__content{line-height:24px}.el-form-item--small .el-form-item__error{padding-top:2px}.el-form-item__label-wrap{display:flex}.el-form-item__label{display:inline-flex;justify-content:flex-end;align-items:flex-start;flex:0 0 auto;font-size:var(--el-form-label-font-size);color:var(--el-text-color-regular);height:32px;line-height:32px;padding:0 12px 0 0;box-sizing:border-box}.el-form-item__content{display:flex;flex-wrap:wrap;align-items:center;flex:1;line-height:32px;position:relative;font-size:var(--font-size);min-width:0}.el-form-item__content .el-input-group{vertical-align:top}.el-form-item__error{color:var(--el-color-danger);font-size:12px;line-height:1;padding-top:2px;position:absolute;top:100%;left:0}.el-form-item__error--inline{position:relative;top:auto;left:auto;display:inline-block;margin-left:10px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label-wrap>.el-form-item__label:before,.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label:before{content:"*";color:var(--el-color-danger);margin-right:4px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label-wrap>.el-form-item__label:after,.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label:after{content:"*";color:var(--el-color-danger);margin-left:4px}.el-form-item.is-error .el-select-v2__wrapper,.el-form-item.is-error .el-select-v2__wrapper:focus,.el-form-item.is-error .el-textarea__inner,.el-form-item.is-error .el-textarea__inner:focus{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input-group__append .el-input__wrapper,.el-form-item.is-error .el-input-group__prepend .el-input__wrapper{box-shadow:0 0 0 1px transparent inset}.el-form-item.is-error .el-input__validateIcon{color:var(--el-color-danger)}.el-form-item--feedback .el-input__validateIcon{display:inline-flex}.el-header{--el-header-padding:0 20px;--el-header-height:60px;padding:var(--el-header-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-header-height)}.el-image-viewer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.el-image-viewer__btn{position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;border-radius:50%;opacity:.8;cursor:pointer;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__btn .el-icon{font-size:inherit;cursor:pointer}.el-image-viewer__close{top:40px;right:40px;width:40px;height:40px;font-size:40px}.el-image-viewer__canvas{position:static;width:100%;height:100%;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__actions{left:50%;bottom:30px;transform:translate(-50%);width:282px;height:44px;padding:0 23px;background-color:var(--el-text-color-regular);border-color:#fff;border-radius:22px}.el-image-viewer__actions__inner{width:100%;height:100%;text-align:justify;cursor:default;font-size:23px;color:#fff;display:flex;align-items:center;justify-content:space-around}.el-image-viewer__prev{top:50%;transform:translateY(-50%);left:40px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__next{top:50%;transform:translateY(-50%);right:40px;text-indent:2px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__close{width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__mask{position:absolute;width:100%;height:100%;top:0;left:0;opacity:.5;background:#000}.viewer-fade-enter-active{-webkit-animation:viewer-fade-in var(--el-transition-duration);animation:viewer-fade-in var(--el-transition-duration)}.viewer-fade-leave-active{-webkit-animation:viewer-fade-out var(--el-transition-duration);animation:viewer-fade-out var(--el-transition-duration)}@-webkit-keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-image__error,.el-image__inner,.el-image__placeholder,.el-image__wrapper{width:100%;height:100%}.el-image{position:relative;display:inline-block;overflow:hidden}.el-image__inner{vertical-align:top;opacity:1}.el-image__inner.is-loading{opacity:0}.el-image__wrapper{position:absolute;top:0;left:0}.el-image__placeholder{background:var(--el-fill-color-light)}.el-image__error{display:flex;justify-content:center;align-items:center;font-size:14px;background:var(--el-fill-color-light);color:var(--el-text-color-placeholder);vertical-align:middle}.el-image__preview{cursor:pointer}.el-input-number{position:relative;display:inline-flex;width:150px;line-height:30px}.el-input-number .el-input__wrapper{padding-left:42px;padding-right:42px}.el-input-number .el-input__inner{-webkit-appearance:none;-moz-appearance:textfield;text-align:center;line-height:1}.el-input-number .el-input__inner::-webkit-inner-spin-button,.el-input-number .el-input__inner::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.el-input-number__decrease,.el-input-number__increase{display:flex;justify-content:center;align-items:center;height:auto;position:absolute;z-index:1;top:1px;bottom:1px;width:32px;background:var(--el-fill-color-light);color:var(--el-text-color-regular);cursor:pointer;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-input-number__decrease:hover,.el-input-number__increase:hover{color:var(--el-color-primary)}.el-input-number__decrease:hover~.el-input:not(.is-disabled) .el-input_wrapper,.el-input-number__increase:hover~.el-input:not(.is-disabled) .el-input_wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-input-number__decrease.is-disabled,.el-input-number__increase.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-input-number__increase{right:1px;border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0;border-left:var(--el-border)}.el-input-number__decrease{left:1px;border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);border-right:var(--el-border)}.el-input-number.is-disabled .el-input-number__decrease,.el-input-number.is-disabled .el-input-number__increase{border-color:var(--el-disabled-border-color);color:var(--el-disabled-border-color)}.el-input-number.is-disabled .el-input-number__decrease:hover,.el-input-number.is-disabled .el-input-number__increase:hover{color:var(--el-disabled-border-color);cursor:not-allowed}.el-input-number--large{width:180px;line-height:38px}.el-input-number--large .el-input-number__decrease,.el-input-number--large .el-input-number__increase{width:40px;font-size:14px}.el-input-number--large .el-input__wrapper{padding-left:47px;padding-right:47px}.el-input-number--small{width:120px;line-height:22px}.el-input-number--small .el-input-number__decrease,.el-input-number--small .el-input-number__increase{width:24px;font-size:12px}.el-input-number--small .el-input__wrapper{padding-left:31px;padding-right:31px}.el-input-number--small .el-input-number__decrease [class*=el-icon],.el-input-number--small .el-input-number__increase [class*=el-icon]{transform:scale(.9)}.el-input-number.is-without-controls .el-input__wrapper{padding-left:15px;padding-right:15px}.el-input-number.is-controls-right .el-input__wrapper{padding-left:15px;padding-right:42px}.el-input-number.is-controls-right .el-input-number__decrease,.el-input-number.is-controls-right .el-input-number__increase{--el-input-number-controls-height:15px;height:var(--el-input-number-controls-height);line-height:var(--el-input-number-controls-height)}.el-input-number.is-controls-right .el-input-number__decrease [class*=el-icon],.el-input-number.is-controls-right .el-input-number__increase [class*=el-icon]{transform:scale(.8)}.el-input-number.is-controls-right .el-input-number__increase{bottom:auto;left:auto;border-radius:0 var(--el-border-radius-base) 0 0;border-bottom:var(--el-border)}.el-input-number.is-controls-right .el-input-number__decrease{right:1px;top:auto;left:auto;border-right:none;border-left:var(--el-border);border-radius:0 0 var(--el-border-radius-base) 0}.el-input-number.is-controls-right[class*=large] [class*=decrease],.el-input-number.is-controls-right[class*=large] [class*=increase]{--el-input-number-controls-height:19px}.el-input-number.is-controls-right[class*=small] [class*=decrease],.el-input-number.is-controls-right[class*=small] [class*=increase]{--el-input-number-controls-height:11px}.el-textarea{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-textarea{position:relative;display:inline-block;width:100%;vertical-align:bottom;font-size:var(--el-font-size-base)}.el-textarea__inner{position:relative;display:block;resize:vertical;padding:5px 11px;line-height:1.5;box-sizing:border-box;width:100%;font-size:inherit;font-family:inherit;color:var(--el-input-text-color,var(--el-text-color-regular));background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;-webkit-appearance:none;box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);border:none}.el-textarea__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-textarea__inner:focus{outline:0;box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-textarea .el-input__count{color:var(--el-color-info);background:var(--el-fill-color-blank);position:absolute;font-size:12px;line-height:14px;bottom:5px;right:10px}.el-textarea.is-disabled .el-textarea__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-textarea.is-disabled .el-textarea__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner::placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-exceed .el-textarea__inner{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-textarea.is-exceed .el-input__count{color:var(--el-color-danger)}.el-input{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-input{--el-input-height:var(--el-component-size);position:relative;font-size:var(--el-font-size-base);display:inline-flex;width:100%;line-height:var(--el-input-height);box-sizing:border-box;vertical-align:middle}.el-input::-webkit-scrollbar{z-index:11;width:6px}.el-input::-webkit-scrollbar:horizontal{height:6px}.el-input::-webkit-scrollbar-thumb{border-radius:5px;width:6px;background:var(--el-text-color-disabled)}.el-input::-webkit-scrollbar-corner{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track-piece{background:var(--el-fill-color-blank);width:6px}.el-input .el-input__clear,.el-input .el-input__password{color:var(--el-input-icon-color);font-size:14px;cursor:pointer}.el-input .el-input__clear:hover,.el-input .el-input__password:hover{color:var(--el-input-clear-hover-color)}.el-input .el-input__count{height:100%;display:inline-flex;align-items:center;color:var(--el-color-info);font-size:12px}.el-input .el-input__count .el-input__count-inner{background:var(--el-fill-color-blank);line-height:initial;display:inline-block;padding-left:8px}.el-input__wrapper{display:inline-flex;flex-grow:1;align-items:center;justify-content:center;padding:1px 11px;background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);transform:translateZ(0);box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 32px) - 2px);width:100%;flex-grow:1;-webkit-appearance:none;color:var(--el-input-text-color,var(--el-text-color-regular));font-size:inherit;height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);padding:0;outline:0;border:none;background:0 0;box-sizing:border-box}.el-input__inner:focus{outline:0}.el-input__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner[type=password]::-ms-reveal{display:none}.el-input__prefix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__prefix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__prefix-inner>:last-child{margin-right:8px}.el-input__prefix-inner>:first-child,.el-input__prefix-inner>:first-child.el-input__icon{margin-left:0}.el-input__suffix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__suffix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__suffix-inner>:first-child{margin-left:8px}.el-input .el-input__icon{height:inherit;line-height:inherit;display:flex;justify-content:center;align-items:center;transition:all var(--el-transition-duration);margin-left:8px}.el-input__validateIcon{pointer-events:none}.el-input.is-active .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-color,) inset}.el-input.is-disabled{cursor:not-allowed}.el-input.is-disabled .el-input__wrapper{background-color:var(--el-disabled-bg-color);box-shadow:0 0 0 1px var(--el-disabled-border-color) inset}.el-input.is-disabled .el-input__inner{color:var(--el-disabled-text-color);-webkit-text-fill-color:var(--el-disabled-text-color);cursor:not-allowed}.el-input.is-disabled .el-input__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner::placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__icon{cursor:not-allowed}.el-input.is-exceed .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-input.is-exceed .el-input__suffix .el-input__count{color:var(--el-color-danger)}.el-input--large{--el-input-height:var(--el-component-size-large);font-size:14px}.el-input--large .el-input__wrapper{padding:1px 15px}.el-input--large .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 40px) - 2px)}.el-input--small{--el-input-height:var(--el-component-size-small);font-size:12px}.el-input--small .el-input__wrapper{padding:1px 7px}.el-input--small .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 24px) - 2px)}.el-input-group{display:inline-flex;width:100%;align-items:stretch}.el-input-group__append,.el-input-group__prepend{background-color:var(--el-fill-color-light);color:var(--el-color-info);position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:100%;border-radius:var(--el-input-border-radius);padding:0 20px;white-space:nowrap}.el-input-group__append:focus,.el-input-group__prepend:focus{outline:0}.el-input-group__append .el-button,.el-input-group__append .el-select,.el-input-group__prepend .el-button,.el-input-group__prepend .el-select{display:inline-block;margin:0 -20px}.el-input-group__append button.el-button,.el-input-group__append button.el-button:hover,.el-input-group__append div.el-select .el-input__wrapper,.el-input-group__append div.el-select:hover .el-input__wrapper,.el-input-group__prepend button.el-button,.el-input-group__prepend button.el-button:hover,.el-input-group__prepend div.el-select .el-input__wrapper,.el-input-group__prepend div.el-select:hover .el-input__wrapper{border-color:transparent;background-color:transparent;color:inherit}.el-input-group__append .el-button,.el-input-group__append .el-input,.el-input-group__prepend .el-button,.el-input-group__prepend .el-input{font-size:inherit}.el-input-group__prepend{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group__append{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--prepend>.el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper{box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important;z-index:2}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper:focus{outline:0;z-index:2;box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__wrapper{z-index:1;box-shadow:1px 0 0 0 var(--el-input-hover-border-color) inset,1px 0 0 0 var(--el-input-hover-border-color),0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-input-group--append>.el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__wrapper{z-index:2;box-shadow:-1px 0 0 0 var(--el-input-focus-border-color),-1px 0 0 0 var(--el-input-focus-border-color) inset,0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__wrapper{z-index:1;box-shadow:-1px 0 0 0 var(--el-input-hover-border-color),-1px 0 0 0 var(--el-input-hover-border-color) inset,0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-link{--el-link-font-size:var(--el-font-size-base);--el-link-font-weight:var(--el-font-weight-primary);--el-link-text-color:var(--el-text-color-regular);--el-link-hover-text-color:var(--el-color-primary);--el-link-disabled-text-color:var(--el-text-color-placeholder)}.el-link{display:inline-flex;flex-direction:row;align-items:center;justify-content:center;vertical-align:middle;position:relative;text-decoration:none;outline:0;cursor:pointer;padding:0;font-size:var(--el-link-font-size);font-weight:var(--el-link-font-weight);color:var(--el-link-text-color)}.el-link:hover{color:var(--el-link-hover-text-color)}.el-link.is-underline:hover:after{content:"";position:absolute;left:0;right:0;height:0;bottom:0;border-bottom:1px solid var(--el-link-hover-text-color)}.el-link.is-disabled{color:var(--el-link-disabled-text-color);cursor:not-allowed}.el-link [class*=el-icon-]+span{margin-left:5px}.el-link.el-link--default:after{border-color:var(--el-link-hover-text-color)}.el-link__inner{display:inline-flex;justify-content:center;align-items:center}.el-link.el-link--primary{--el-link-text-color:var(--el-color-primary);--el-link-hover-text-color:var(--el-color-primary-light-3);--el-link-disabled-text-color:var(--el-color-primary-light-5)}.el-link.el-link--primary:after{border-color:var(--el-link-text-color)}.el-link.el-link--primary.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--success{--el-link-text-color:var(--el-color-success);--el-link-hover-text-color:var(--el-color-success-light-3);--el-link-disabled-text-color:var(--el-color-success-light-5)}.el-link.el-link--success:after{border-color:var(--el-link-text-color)}.el-link.el-link--success.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning{--el-link-text-color:var(--el-color-warning);--el-link-hover-text-color:var(--el-color-warning-light-3);--el-link-disabled-text-color:var(--el-color-warning-light-5)}.el-link.el-link--warning:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger{--el-link-text-color:var(--el-color-danger);--el-link-hover-text-color:var(--el-color-danger-light-3);--el-link-disabled-text-color:var(--el-color-danger-light-5)}.el-link.el-link--danger:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--error{--el-link-text-color:var(--el-color-error);--el-link-hover-text-color:var(--el-color-error-light-3);--el-link-disabled-text-color:var(--el-color-error-light-5)}.el-link.el-link--error:after{border-color:var(--el-link-text-color)}.el-link.el-link--error.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--info{--el-link-text-color:var(--el-color-info);--el-link-hover-text-color:var(--el-color-info-light-3);--el-link-disabled-text-color:var(--el-color-info-light-5)}.el-link.el-link--info:after{border-color:var(--el-link-text-color)}.el-link.el-link--info.is-underline:hover:after{border-color:var(--el-link-text-color)}:root{--el-loading-spinner-size:42px;--el-loading-fullscreen-spinner-size:50px}.el-loading-parent--relative{position:relative!important}.el-loading-parent--hidden{overflow:hidden!important}.el-loading-mask{position:absolute;z-index:2000;background-color:var(--el-mask-color);margin:0;top:0;right:0;bottom:0;left:0;transition:opacity var(--el-transition-duration)}.el-loading-mask.is-fullscreen{position:fixed}.el-loading-mask.is-fullscreen .el-loading-spinner{margin-top:calc((0px - var(--el-loading-fullscreen-spinner-size))/ 2)}.el-loading-mask.is-fullscreen .el-loading-spinner .circular{height:var(--el-loading-fullscreen-spinner-size);width:var(--el-loading-fullscreen-spinner-size)}.el-loading-spinner{top:50%;margin-top:calc((0px - var(--el-loading-spinner-size))/ 2);width:100%;text-align:center;position:absolute}.el-loading-spinner .el-loading-text{color:var(--el-color-primary);margin:3px 0;font-size:14px}.el-loading-spinner .circular{display:inline;height:var(--el-loading-spinner-size);width:var(--el-loading-spinner-size);-webkit-animation:loading-rotate 2s linear infinite;animation:loading-rotate 2s linear infinite}.el-loading-spinner .path{-webkit-animation:loading-dash 1.5s ease-in-out infinite;animation:loading-dash 1.5s ease-in-out infinite;stroke-dasharray:90,150;stroke-dashoffset:0;stroke-width:2;stroke:var(--el-color-primary);stroke-linecap:round}.el-loading-spinner i{color:var(--el-color-primary)}.el-loading-fade-enter-from,.el-loading-fade-leave-to{opacity:0}@-webkit-keyframes loading-rotate{to{transform:rotate(360deg)}}@keyframes loading-rotate{to{transform:rotate(360deg)}}@-webkit-keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}.el-main{--el-main-padding:20px;display:block;flex:1;flex-basis:auto;overflow:auto;box-sizing:border-box;padding:var(--el-main-padding)}:root{--el-menu-active-color:var(--el-color-primary);--el-menu-text-color:var(--el-text-color-primary);--el-menu-hover-text-color:var(--el-color-primary);--el-menu-bg-color:var(--el-fill-color-blank);--el-menu-hover-bg-color:var(--el-color-primary-light-9);--el-menu-item-height:56px;--el-menu-sub-item-height:calc(var(--el-menu-item-height) - 6px);--el-menu-horizontal-sub-item-height:36px;--el-menu-item-font-size:var(--el-font-size-base);--el-menu-item-hover-fill:var(--el-color-primary-light-9);--el-menu-border-color:var(--el-border-color);--el-menu-base-level-padding:20px;--el-menu-level-padding:20px;--el-menu-icon-width:24px}.el-menu{border-right:solid 1px var(--el-menu-border-color);list-style:none;position:relative;margin:0;padding-left:0;background-color:var(--el-menu-bg-color);box-sizing:border-box}.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item-group__title,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-sub-menu__title{white-space:nowrap;padding-left:calc(var(--el-menu-base-level-padding) + var(--el-menu-level) * var(--el-menu-level-padding))}.el-menu--horizontal{display:flex;flex-wrap:nowrap;border-bottom:solid 1px var(--el-menu-border-color);border-right:none}.el-menu--horizontal>.el-menu-item{display:inline-flex;justify-content:center;align-items:center;height:100%;margin:0;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-menu-item a,.el-menu--horizontal>.el-menu-item a:hover{color:inherit}.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover{background-color:#fff}.el-menu--horizontal>.el-sub-menu:focus,.el-menu--horizontal>.el-sub-menu:hover{outline:0}.el-menu--horizontal>.el-sub-menu:hover .el-sub-menu__title{color:var(--el-menu-hover-text-color)}.el-menu--horizontal>.el-sub-menu.is-active .el-sub-menu__title{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title{height:100%;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title:hover{background-color:var(--el-bg-color-overlay)}.el-menu--horizontal .el-menu .el-menu-item,.el-menu--horizontal .el-menu .el-sub-menu__title{background-color:var(--el-menu-bg-color);display:flex;align-items:center;height:var(--el-menu-horizontal-sub-item-height);line-height:var(--el-menu-horizontal-sub-item-height);padding:0 10px;color:var(--el-menu-text-color)}.el-menu--horizontal .el-menu .el-sub-menu__title{padding-right:40px}.el-menu--horizontal .el-menu .el-menu-item.is-active,.el-menu--horizontal .el-menu .el-sub-menu.is-active>.el-sub-menu__title{color:var(--el-menu-active-color)}.el-menu--horizontal .el-menu-item:not(.is-disabled):focus,.el-menu--horizontal .el-menu-item:not(.is-disabled):hover{outline:0;color:var(--el-menu-hover-text-color);background-color:var(--el-menu-hover-bg-color)}.el-menu--horizontal>.el-menu-item.is-active{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)!important}.el-menu--collapse{width:calc(var(--el-menu-icon-width) + var(--el-menu-base-level-padding) * 2)}.el-menu--collapse>.el-menu-item [class^=el-icon],.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title [class^=el-icon],.el-menu--collapse>.el-sub-menu>.el-sub-menu__title [class^=el-icon]{margin:0;vertical-align:middle;width:var(--el-menu-icon-width);text-align:center}.el-menu--collapse>.el-menu-item .el-sub-menu__icon-arrow,.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow{display:none}.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title>span,.el-menu--collapse>.el-menu-item>span,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title>span{height:0;width:0;overflow:hidden;visibility:hidden;display:inline-block}.el-menu--collapse>.el-menu-item.is-active i{color:inherit}.el-menu--collapse .el-menu .el-sub-menu{min-width:200px}.el-menu--popup{z-index:100;min-width:200px;border:none;padding:5px 0;border-radius:var(--el-border-radius-small);box-shadow:var(--el-box-shadow-light)}.el-menu .el-icon{flex-shrink:0}.el-menu-item{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap}.el-menu-item *{vertical-align:bottom}.el-menu-item i{color:inherit}.el-menu-item:focus,.el-menu-item:hover{outline:0}.el-menu-item:hover{background-color:var(--el-menu-hover-bg-color)}.el-menu-item.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-menu-item [class^=el-icon]{margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px;vertical-align:middle}.el-menu-item.is-active{color:var(--el-menu-active-color)}.el-menu-item.is-active i{color:inherit}.el-menu-item .el-menu-tooltip__trigger{position:absolute;left:0;top:0;height:100%;width:100%;display:inline-flex;align-items:center;box-sizing:border-box;padding:0 var(--el-menu-base-level-padding)}.el-sub-menu{list-style:none;margin:0;padding-left:0}.el-sub-menu__title{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap;padding-right:calc(var(--el-menu-base-level-padding) + var(--el-menu-icon-width))}.el-sub-menu__title *{vertical-align:bottom}.el-sub-menu__title i{color:inherit}.el-sub-menu__title:focus,.el-sub-menu__title:hover{outline:0}.el-sub-menu__title.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu__title:hover{background-color:var(--el-menu-hover-bg-color)}.el-sub-menu .el-menu{border:none}.el-sub-menu .el-menu-item{height:var(--el-menu-sub-item-height);line-height:var(--el-menu-sub-item-height)}.el-sub-menu__hide-arrow .el-sub-menu__icon-arrow{display:none!important}.el-sub-menu.is-active .el-sub-menu__title{border-bottom-color:var(--el-menu-active-color)}.el-sub-menu.is-disabled .el-menu-item,.el-sub-menu.is-disabled .el-sub-menu__title{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu .el-icon{vertical-align:middle;margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px}.el-sub-menu .el-icon.el-sub-menu__icon-more{margin-right:0!important}.el-sub-menu .el-sub-menu__icon-arrow{position:absolute;top:50%;right:var(--el-menu-base-level-padding);margin-top:-6px;transition:transform var(--el-transition-duration);font-size:12px;margin-right:0;width:inherit}.el-menu-item-group>ul{padding:0}.el-menu-item-group__title{padding:7px 0 7px var(--el-menu-base-level-padding);line-height:normal;font-size:12px;color:var(--el-text-color-secondary)}.horizontal-collapse-transition .el-sub-menu__title .el-sub-menu__icon-arrow{transition:var(--el-transition-duration-fast);opacity:0}.el-message-box{--el-messagebox-title-color:var(--el-text-color-primary);--el-messagebox-width:420px;--el-messagebox-border-radius:4px;--el-messagebox-font-size:var(--el-font-size-large);--el-messagebox-content-font-size:var(--el-font-size-base);--el-messagebox-content-color:var(--el-text-color-regular);--el-messagebox-error-font-size:12px;--el-messagebox-padding-primary:15px}.el-message-box{display:inline-block;max-width:var(--el-messagebox-width);width:100%;padding-bottom:10px;vertical-align:middle;background-color:var(--el-bg-color);border-radius:var(--el-messagebox-border-radius);border:1px solid var(--el-border-color-lighter);font-size:var(--el-messagebox-font-size);box-shadow:var(--el-box-shadow-light);text-align:left;overflow:hidden;-webkit-backface-visibility:hidden;backface-visibility:hidden;box-sizing:border-box}.el-message-box:focus{outline:0!important}.el-overlay.is-message-box .el-overlay-message-box{text-align:center;position:fixed;top:0;right:0;bottom:0;left:0;padding:16px;overflow:auto}.el-overlay.is-message-box .el-overlay-message-box:after{content:"";display:inline-block;height:100%;width:0;vertical-align:middle}.el-message-box.is-draggable .el-message-box__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-message-box__header{position:relative;padding:var(--el-messagebox-padding-primary);padding-bottom:10px}.el-message-box__title{padding-left:0;margin-bottom:0;font-size:var(--el-messagebox-font-size);line-height:1;color:var(--el-messagebox-title-color)}.el-message-box__headerbtn{position:absolute;top:var(--el-messagebox-padding-primary);right:var(--el-messagebox-padding-primary);padding:0;border:none;outline:0;background:0 0;font-size:var(--el-message-close-size,16px);cursor:pointer}.el-message-box__headerbtn .el-message-box__close{color:var(--el-color-info);font-size:inherit}.el-message-box__headerbtn:focus .el-message-box__close,.el-message-box__headerbtn:hover .el-message-box__close{color:var(--el-color-primary)}.el-message-box__content{padding:10px var(--el-messagebox-padding-primary);color:var(--el-messagebox-content-color);font-size:var(--el-messagebox-content-font-size)}.el-message-box__container{position:relative}.el-message-box__input{padding-top:15px}.el-message-box__input div.invalid>input{border-color:var(--el-color-error)}.el-message-box__input div.invalid>input:focus{border-color:var(--el-color-error)}.el-message-box__status{position:absolute;top:50%;transform:translateY(-50%);font-size:24px!important}.el-message-box__status:before{padding-left:1px}.el-message-box__status.el-icon{position:absolute}.el-message-box__status+.el-message-box__message{padding-left:36px;padding-right:12px;word-break:break-word}.el-message-box__status.el-message-box-icon--success{--el-messagebox-color:var(--el-color-success);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--info{--el-messagebox-color:var(--el-color-info);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--warning{--el-messagebox-color:var(--el-color-warning);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--error{--el-messagebox-color:var(--el-color-error);color:var(--el-messagebox-color)}.el-message-box__message{margin:0}.el-message-box__message p{margin:0;line-height:24px}.el-message-box__errormsg{color:var(--el-color-error);font-size:var(--el-messagebox-error-font-size);min-height:18px;margin-top:2px}.el-message-box__btns{padding:5px 15px 0;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center}.el-message-box__btns button:nth-child(2){margin-left:10px}.el-message-box__btns-reverse{flex-direction:row-reverse}.el-message-box--center .el-message-box__title{position:relative;display:flex;align-items:center;justify-content:center}.el-message-box--center .el-message-box__status{position:relative;top:auto;padding-right:5px;text-align:center;transform:translateY(-1px)}.el-message-box--center .el-message-box__message{margin-left:0}.el-message-box--center .el-message-box__btns{justify-content:center}.el-message-box--center .el-message-box__content{padding-left:calc(var(--el-messagebox-padding-primary) + 12px);padding-right:calc(var(--el-messagebox-padding-primary) + 12px);text-align:center}.fade-in-linear-enter-active .el-overlay-message-box{-webkit-animation:msgbox-fade-in var(--el-transition-duration);animation:msgbox-fade-in var(--el-transition-duration)}.fade-in-linear-leave-active .el-overlay-message-box{animation:msgbox-fade-in var(--el-transition-duration) reverse}@-webkit-keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-message{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-border-color-lighter);--el-message-padding:15px 19px;--el-message-close-size:16px;--el-message-close-icon-color:var(--el-text-color-placeholder);--el-message-close-hover-color:var(--el-text-color-secondary)}.el-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;max-width:calc(100% - 32px);box-sizing:border-box;border-radius:var(--el-border-radius-base);border-width:var(--el-border-width);border-style:var(--el-border-style);border-color:var(--el-message-border-color);position:fixed;left:50%;top:20px;transform:translate(-50%);background-color:var(--el-message-bg-color);transition:opacity var(--el-transition-duration),transform .4s,top .4s;padding:var(--el-message-padding);display:flex;align-items:center}.el-message.is-center{justify-content:center}.el-message.is-closable .el-message__content{padding-right:31px}.el-message p{margin:0}.el-message--success{--el-message-bg-color:var(--el-color-success-light-9);--el-message-border-color:var(--el-color-success-light-8);--el-message-text-color:var(--el-color-success)}.el-message--success .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--success{color:var(--el-message-text-color)}.el-message--info{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-color-info-light-8);--el-message-text-color:var(--el-color-info)}.el-message--info .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--info{color:var(--el-message-text-color)}.el-message--warning{--el-message-bg-color:var(--el-color-warning-light-9);--el-message-border-color:var(--el-color-warning-light-8);--el-message-text-color:var(--el-color-warning)}.el-message--warning .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--warning{color:var(--el-message-text-color)}.el-message--error{--el-message-bg-color:var(--el-color-error-light-9);--el-message-border-color:var(--el-color-error-light-8);--el-message-text-color:var(--el-color-error)}.el-message--error .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--error{color:var(--el-message-text-color)}.el-message__icon{margin-right:10px}.el-message .el-message__badge{position:absolute;top:-8px;right:-8px}.el-message__content{padding:0;font-size:14px;line-height:1}.el-message__content:focus{outline-width:0}.el-message .el-message__closeBtn{position:absolute;top:50%;right:19px;transform:translateY(-50%);cursor:pointer;color:var(--el-message-close-icon-color);font-size:var(--el-message-close-size)}.el-message .el-message__closeBtn:focus{outline-width:0}.el-message .el-message__closeBtn:hover{color:var(--el-message-close-hover-color)}.el-message-fade-enter-from,.el-message-fade-leave-to{opacity:0;transform:translate(-50%,-100%)}.el-notification{--el-notification-width:330px;--el-notification-padding:14px 26px 14px 13px;--el-notification-radius:8px;--el-notification-shadow:var(--el-box-shadow-light);--el-notification-border-color:var(--el-border-color-lighter);--el-notification-icon-size:24px;--el-notification-close-font-size:var(--el-message-close-size, 16px);--el-notification-group-margin-left:13px;--el-notification-group-margin-right:8px;--el-notification-content-font-size:var(--el-font-size-base);--el-notification-content-color:var(--el-text-color-regular);--el-notification-title-font-size:16px;--el-notification-title-color:var(--el-text-color-primary);--el-notification-close-color:var(--el-text-color-secondary);--el-notification-close-hover-color:var(--el-text-color-regular)}.el-notification{display:flex;width:var(--el-notification-width);padding:var(--el-notification-padding);border-radius:var(--el-notification-radius);box-sizing:border-box;border:1px solid var(--el-notification-border-color);position:fixed;background-color:var(--el-bg-color-overlay);box-shadow:var(--el-notification-shadow);transition:opacity var(--el-transition-duration),transform var(--el-transition-duration),left var(--el-transition-duration),right var(--el-transition-duration),top .4s,bottom var(--el-transition-duration);overflow-wrap:anywhere;overflow:hidden;z-index:9999}.el-notification.right{right:16px}.el-notification.left{left:16px}.el-notification__group{margin-left:var(--el-notification-group-margin-left);margin-right:var(--el-notification-group-margin-right)}.el-notification__title{font-weight:700;font-size:var(--el-notification-title-font-size);line-height:var(--el-notification-icon-size);color:var(--el-notification-title-color);margin:0}.el-notification__content{font-size:var(--el-notification-content-font-size);line-height:24px;margin:6px 0 0;color:var(--el-notification-content-color);text-align:justify}.el-notification__content p{margin:0}.el-notification .el-notification__icon{height:var(--el-notification-icon-size);width:var(--el-notification-icon-size);font-size:var(--el-notification-icon-size)}.el-notification .el-notification__closeBtn{position:absolute;top:18px;right:15px;cursor:pointer;color:var(--el-notification-close-color);font-size:var(--el-notification-close-font-size)}.el-notification .el-notification__closeBtn:hover{color:var(--el-notification-close-hover-color)}.el-notification .el-notification--success{--el-notification-icon-color:var(--el-color-success);color:var(--el-notification-icon-color)}.el-notification .el-notification--info{--el-notification-icon-color:var(--el-color-info);color:var(--el-notification-icon-color)}.el-notification .el-notification--warning{--el-notification-icon-color:var(--el-color-warning);color:var(--el-notification-icon-color)}.el-notification .el-notification--error{--el-notification-icon-color:var(--el-color-error);color:var(--el-notification-icon-color)}.el-notification-fade-enter-from.right{right:0;transform:translate(100%)}.el-notification-fade-enter-from.left{left:0;transform:translate(-100%)}.el-notification-fade-leave-to{opacity:0}.el-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;height:100%;background-color:var(--el-overlay-color-lighter);overflow:auto}.el-overlay .el-overlay-root{height:0}.el-page-header.is-contentful .el-page-header__main{border-top:1px solid var(--el-border-color-light);margin-top:16px}.el-page-header__header{display:flex;align-items:center;justify-content:space-between;line-height:24px}.el-page-header__left{display:flex;align-items:center;margin-right:40px;position:relative}.el-page-header__back{display:flex;align-items:center;cursor:pointer}.el-page-header__left .el-divider--vertical{margin:0 16px}.el-page-header__icon{font-size:16px;margin-right:10px;display:flex;align-items:center}.el-page-header__icon .el-icon{font-size:inherit}.el-page-header__title{font-size:14px;font-weight:500}.el-page-header__content{font-size:18px;color:var(--el-text-color-primary)}.el-page-header__breadcrumb{margin-bottom:16px}.el-pagination{--el-pagination-font-size:14px;--el-pagination-bg-color:var(--el-fill-color-blank);--el-pagination-text-color:var(--el-text-color-primary);--el-pagination-border-radius:2px;--el-pagination-button-color:var(--el-text-color-primary);--el-pagination-button-width:32px;--el-pagination-button-height:32px;--el-pagination-button-disabled-color:var(--el-text-color-placeholder);--el-pagination-button-disabled-bg-color:var(--el-fill-color-blank);--el-pagination-button-bg-color:var(--el-fill-color);--el-pagination-hover-color:var(--el-color-primary);--el-pagination-font-size-small:12px;--el-pagination-button-width-small:24px;--el-pagination-button-height-small:24px;--el-pagination-item-gap:16px;white-space:nowrap;color:var(--el-pagination-text-color);font-size:var(--el-pagination-font-size);font-weight:400;display:flex;align-items:center}.el-pagination .el-input__inner{text-align:center;-moz-appearance:textfield}.el-pagination .el-select .el-input{width:128px}.el-pagination button{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pagination button *{pointer-events:none}.el-pagination button:focus{outline:0}.el-pagination button:hover{color:var(--el-pagination-hover-color)}.el-pagination button.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pagination button.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pagination button.is-disabled,.el-pagination button:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pagination button:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-pagination .btn-next .el-icon,.el-pagination .btn-prev .el-icon{display:block;font-size:12px;font-weight:700;width:inherit}.el-pagination>.is-first{margin-left:0!important}.el-pagination>.is-last{margin-right:0!important}.el-pagination .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination__sizes,.el-pagination__total{margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__total[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__jump{display:flex;align-items:center;margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__jump[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__goto{margin-right:8px}.el-pagination__editor{text-align:center;box-sizing:border-box}.el-pagination__editor.el-input{width:56px}.el-pagination__editor .el-input__inner::-webkit-inner-spin-button,.el-pagination__editor .el-input__inner::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.el-pagination__classifier{margin-left:8px}.el-pagination__rightwrapper{flex:1;display:flex;align-items:center;justify-content:flex-end}.el-pagination.is-background .btn-next,.el-pagination.is-background .btn-prev,.el-pagination.is-background .el-pager li{margin:0 4px;background-color:var(--el-pagination-button-bg-color)}.el-pagination.is-background .btn-next.is-active,.el-pagination.is-background .btn-prev.is-active,.el-pagination.is-background .el-pager li.is-active{background-color:var(--el-color-primary);color:var(--el-color-white)}.el-pagination.is-background .btn-next.is-disabled,.el-pagination.is-background .btn-next:disabled,.el-pagination.is-background .btn-prev.is-disabled,.el-pagination.is-background .btn-prev:disabled,.el-pagination.is-background .el-pager li.is-disabled,.el-pagination.is-background .el-pager li:disabled{color:var(--el-text-color-placeholder);background-color:var(--el-disabled-bg-color)}.el-pagination.is-background .btn-next.is-disabled.is-active,.el-pagination.is-background .btn-next:disabled.is-active,.el-pagination.is-background .btn-prev.is-disabled.is-active,.el-pagination.is-background .btn-prev:disabled.is-active,.el-pagination.is-background .el-pager li.is-disabled.is-active,.el-pagination.is-background .el-pager li:disabled.is-active{color:var(--el-text-color-secondary);background-color:var(--el-fill-color-dark)}.el-pagination.is-background .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination--small .btn-next,.el-pagination--small .btn-prev,.el-pagination--small .el-pager li{height:var(--el-pagination-button-height-small);line-height:var(--el-pagination-button-height-small);font-size:var(--el-pagination-font-size-small);min-width:var(--el-pagination-button-width-small)}.el-pagination--small button,.el-pagination--small span:not([class*=suffix]){font-size:var(--el-pagination-font-size-small)}.el-pagination--small .el-select .el-input{width:100px}.el-pager{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;font-size:0;padding:0;margin:0;display:flex;align-items:center}.el-pager li{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pager li *{pointer-events:none}.el-pager li:focus{outline:0}.el-pager li:hover{color:var(--el-pagination-hover-color)}.el-pager li.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pager li.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pager li.is-disabled,.el-pager li:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pager li:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-popconfirm__main{display:flex;align-items:center}.el-popconfirm__icon{margin-right:5px}.el-popconfirm__action{text-align:right;margin-top:8px}.el-popover{--el-popover-bg-color:var(--el-bg-color-overlay);--el-popover-font-size:var(--el-font-size-base);--el-popover-border-color:var(--el-border-color-lighter);--el-popover-padding:12px;--el-popover-padding-large:18px 20px;--el-popover-title-font-size:16px;--el-popover-title-text-color:var(--el-text-color-primary);--el-popover-border-radius:4px}.el-popover.el-popper{background:var(--el-popover-bg-color);min-width:150px;border-radius:var(--el-popover-border-radius);border:1px solid var(--el-popover-border-color);padding:var(--el-popover-padding);z-index:var(--el-index-popper);color:var(--el-text-color-regular);line-height:1.4;text-align:justify;font-size:var(--el-popover-font-size);box-shadow:var(--el-box-shadow-light);word-break:break-all;box-sizing:border-box}.el-popover.el-popper--plain{padding:var(--el-popover-padding-large)}.el-popover__title{color:var(--el-popover-title-text-color);font-size:var(--el-popover-title-font-size);line-height:1;margin-bottom:12px}.el-popover__reference:focus:hover,.el-popover__reference:focus:not(.focusing){outline-width:0}.el-popover.el-popper.is-dark{--el-popover-bg-color:var(--el-text-color-primary);--el-popover-border-color:var(--el-text-color-primary);--el-popover-title-text-color:var(--el-bg-color);color:var(--el-bg-color)}.el-popover.el-popper:focus,.el-popover.el-popper:focus:active{outline-width:0}.el-progress{position:relative;line-height:1;display:flex;align-items:center}.el-progress__text{font-size:14px;color:var(--el-text-color-regular);margin-left:5px;min-width:50px;line-height:1}.el-progress__text i{vertical-align:middle;display:block}.el-progress--circle,.el-progress--dashboard{display:inline-block}.el-progress--circle .el-progress__text,.el-progress--dashboard .el-progress__text{position:absolute;top:50%;left:0;width:100%;text-align:center;margin:0;transform:translateY(-50%)}.el-progress--circle .el-progress__text i,.el-progress--dashboard .el-progress__text i{vertical-align:middle;display:inline-block}.el-progress--without-text .el-progress__text{display:none}.el-progress--without-text .el-progress-bar{padding-right:0;margin-right:0;display:block}.el-progress--text-inside .el-progress-bar{padding-right:0;margin-right:0}.el-progress.is-success .el-progress-bar__inner{background-color:var(--el-color-success)}.el-progress.is-success .el-progress__text{color:var(--el-color-success)}.el-progress.is-warning .el-progress-bar__inner{background-color:var(--el-color-warning)}.el-progress.is-warning .el-progress__text{color:var(--el-color-warning)}.el-progress.is-exception .el-progress-bar__inner{background-color:var(--el-color-danger)}.el-progress.is-exception .el-progress__text{color:var(--el-color-danger)}.el-progress-bar{flex-grow:1;box-sizing:border-box}.el-progress-bar__outer{height:6px;border-radius:100px;background-color:var(--el-border-color-lighter);overflow:hidden;position:relative;vertical-align:middle}.el-progress-bar__inner{position:absolute;left:0;top:0;height:100%;background-color:var(--el-color-primary);text-align:right;border-radius:100px;line-height:1;white-space:nowrap;transition:width .6s ease}.el-progress-bar__inner:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-progress-bar__inner--indeterminate{transform:translateZ(0);-webkit-animation:indeterminate 3s infinite;animation:indeterminate 3s infinite}.el-progress-bar__inner--striped{background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.1) 50%,rgba(0,0,0,.1) 75%,transparent 75%,transparent);background-size:1.25em 1.25em}.el-progress-bar__inner--striped.el-progress-bar__inner--striped-flow{-webkit-animation:striped-flow 3s linear infinite;animation:striped-flow 3s linear infinite}.el-progress-bar__innerText{display:inline-block;vertical-align:middle;color:#fff;font-size:12px;margin:0 5px}@-webkit-keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@-webkit-keyframes indeterminate{0%{left:-100%}to{left:100%}}@keyframes indeterminate{0%{left:-100%}to{left:100%}}@-webkit-keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}@keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}.el-radio-button{--el-radio-button-checked-bg-color:var(--el-color-primary);--el-radio-button-checked-text-color:var(--el-color-white);--el-radio-button-checked-border-color:var(--el-color-primary);--el-radio-button-disabled-checked-fill:var(--el-border-color-extra-light)}.el-radio-button{position:relative;display:inline-block;outline:0}.el-radio-button__inner{display:inline-block;line-height:1;white-space:nowrap;vertical-align:middle;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);font-weight:var(--el-button-font-weight,var(--el-font-weight-primary));border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;cursor:pointer;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button__inner.is-round{padding:8px 15px}.el-radio-button__inner:hover{color:var(--el-color-primary)}.el-radio-button__inner [class*=el-icon-]{line-height:.9}.el-radio-button__inner [class*=el-icon-]+span{margin-left:5px}.el-radio-button:first-child .el-radio-button__inner{border-left:var(--el-border);border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);box-shadow:none!important}.el-radio-button__original-radio{opacity:0;outline:0;position:absolute;z-index:-1}.el-radio-button__original-radio:checked+.el-radio-button__inner{color:var(--el-radio-button-checked-text-color,var(--el-color-white));background-color:var(--el-radio-button-checked-bg-color,var(--el-color-primary));border-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));box-shadow:-1px 0 0 0 var(--el-radio-button-checked-border-color,var(--el-color-primary))}.el-radio-button__original-radio:focus-visible+.el-radio-button__inner{border-left:var(--el-border);border-left-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));outline:2px solid var(--el-radio-button-checked-border-color);outline-offset:1px;z-index:2;border-radius:var(--el-border-radius-base);box-shadow:none}.el-radio-button__original-radio:disabled+.el-radio-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-radio-button__original-radio:disabled:checked+.el-radio-button__inner{background-color:var(--el-radio-button-disabled-checked-fill)}.el-radio-button:last-child .el-radio-button__inner{border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0}.el-radio-button:first-child:last-child .el-radio-button__inner{border-radius:var(--el-border-radius-base)}.el-radio-button--large .el-radio-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button--large .el-radio-button__inner.is-round{padding:12px 19px}.el-radio-button--small .el-radio-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-radio-button--small .el-radio-button__inner.is-round{padding:5px 11px}.el-radio-group{display:inline-flex;align-items:center;flex-wrap:wrap;font-size:0}.el-radio{--el-radio-font-size:var(--el-font-size-base);--el-radio-text-color:var(--el-text-color-regular);--el-radio-font-weight:var(--el-font-weight-primary);--el-radio-input-height:14px;--el-radio-input-width:14px;--el-radio-input-border-radius:var(--el-border-radius-circle);--el-radio-input-bg-color:var(--el-fill-color-blank);--el-radio-input-border:var(--el-border);--el-radio-input-border-color:var(--el-border-color);--el-radio-input-border-color-hover:var(--el-color-primary)}.el-radio{color:var(--el-radio-text-color);font-weight:var(--el-radio-font-weight);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;outline:0;font-size:var(--el-font-size-base);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:32px;height:32px}.el-radio.el-radio--large{height:40px}.el-radio.el-radio--small{height:24px}.el-radio.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-radio.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-radio.is-bordered.is-disabled{cursor:not-allowed;border-color:var(--el-border-color-lighter)}.el-radio.is-bordered.el-radio--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--large .el-radio__label{font-size:var(--el-font-size-base)}.el-radio.is-bordered.el-radio--large .el-radio__inner{height:14px;width:14px}.el-radio.is-bordered.el-radio--small{padding:0 11px 0 7px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--small .el-radio__label{font-size:12px}.el-radio.is-bordered.el-radio--small .el-radio__inner{height:12px;width:12px}.el-radio:last-child{margin-right:0}.el-radio__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative;vertical-align:middle}.el-radio__input.is-disabled .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);cursor:not-allowed}.el-radio__input.is-disabled .el-radio__inner:after{cursor:not-allowed;background-color:var(--el-disabled-bg-color)}.el-radio__input.is-disabled .el-radio__inner+.el-radio__label{cursor:not-allowed}.el-radio__input.is-disabled.is-checked .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color)}.el-radio__input.is-disabled.is-checked .el-radio__inner:after{background-color:var(--el-text-color-placeholder)}.el-radio__input.is-disabled+span.el-radio__label{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-radio__input.is-checked .el-radio__inner{border-color:var(--el-color-primary);background:var(--el-color-primary)}.el-radio__input.is-checked .el-radio__inner:after{transform:translate(-50%,-50%) scale(1)}.el-radio__input.is-checked+.el-radio__label{color:var(--el-color-primary)}.el-radio__input.is-focus .el-radio__inner{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner{border:var(--el-radio-input-border);border-radius:var(--el-radio-input-border-radius);width:var(--el-radio-input-width);height:var(--el-radio-input-height);background-color:var(--el-radio-input-bg-color);position:relative;cursor:pointer;display:inline-block;box-sizing:border-box}.el-radio__inner:hover{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner:after{width:4px;height:4px;border-radius:var(--el-radio-input-border-radius);background-color:var(--el-color-white);content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(0);transition:transform .15s ease-in}.el-radio__original{opacity:0;outline:0;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.el-radio__original:focus-visible+.el-radio__inner{outline:2px solid var(--el-radio-input-border-color-hover);outline-offset:1px;border-radius:var(--el-radio-input-border-radius)}.el-radio:focus:not(:focus-visible):not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner{box-shadow:0 0 2px 2px var(--el-radio-input-border-color-hover)}.el-radio__label{font-size:var(--el-radio-font-size);padding-left:8px}.el-radio.el-radio--large .el-radio__label{font-size:14px}.el-radio.el-radio--large .el-radio__inner{width:14px;height:14px}.el-radio.el-radio--small .el-radio__label{font-size:12px}.el-radio.el-radio--small .el-radio__inner{width:12px;height:12px}.el-rate{--el-rate-height:20px;--el-rate-font-size:var(--el-font-size-base);--el-rate-icon-size:18px;--el-rate-icon-margin:6px;--el-rate-void-color:var(--el-border-color-darker);--el-rate-fill-color:#f7ba2a;--el-rate-disabled-void-color:var(--el-fill-color);--el-rate-text-color:var(--el-text-color-primary)}.el-rate{display:inline-flex;align-items:center;height:32px}.el-rate:active,.el-rate:focus{outline:0}.el-rate__item{cursor:pointer;display:inline-block;position:relative;font-size:0;vertical-align:middle;color:var(--el-rate-void-color);line-height:normal}.el-rate .el-rate__icon{position:relative;display:inline-block;font-size:var(--el-rate-icon-size);margin-right:var(--el-rate-icon-margin);transition:var(--el-transition-duration)}.el-rate .el-rate__icon.hover{transform:scale(1.15)}.el-rate .el-rate__icon .path2{position:absolute;left:0;top:0}.el-rate .el-rate__icon.is-active{color:var(--el-rate-fill-color)}.el-rate__decimal{position:absolute;top:0;left:0;display:inline-block;overflow:hidden;color:var(--el-rate-fill-color)}.el-rate__text{font-size:var(--el-rate-font-size);vertical-align:middle;color:var(--el-rate-text-color)}.el-rate--large{height:40px}.el-rate--small{height:24px}.el-rate--small .el-rate__icon{font-size:14px}.el-rate.is-disabled .el-rate__item{cursor:auto;color:var(--el-rate-disabled-void-color)}.el-result{--el-result-padding:40px 30px;--el-result-icon-font-size:64px;--el-result-title-font-size:20px;--el-result-title-margin-top:20px;--el-result-subtitle-margin-top:10px;--el-result-extra-margin-top:30px}.el-result{display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-result-padding)}.el-result__icon svg{width:var(--el-result-icon-font-size);height:var(--el-result-icon-font-size)}.el-result__title{margin-top:var(--el-result-title-margin-top)}.el-result__title p{margin:0;font-size:var(--el-result-title-font-size);color:var(--el-text-color-primary);line-height:1.3}.el-result__subtitle{margin-top:var(--el-result-subtitle-margin-top)}.el-result__subtitle p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);line-height:1.3}.el-result__extra{margin-top:var(--el-result-extra-margin-top)}.el-result .icon-primary{--el-result-color:var(--el-color-primary);color:var(--el-result-color)}.el-result .icon-success{--el-result-color:var(--el-color-success);color:var(--el-result-color)}.el-result .icon-warning{--el-result-color:var(--el-color-warning);color:var(--el-result-color)}.el-result .icon-danger{--el-result-color:var(--el-color-danger);color:var(--el-result-color)}.el-result .icon-error{--el-result-color:var(--el-color-error);color:var(--el-result-color)}.el-result .icon-info{--el-result-color:var(--el-color-info);color:var(--el-result-color)}.el-row{display:flex;flex-wrap:wrap;position:relative;box-sizing:border-box}.el-row.is-justify-center{justify-content:center}.el-row.is-justify-end{justify-content:flex-end}.el-row.is-justify-space-between{justify-content:space-between}.el-row.is-justify-space-around{justify-content:space-around}.el-row.is-justify-space-evenly{justify-content:space-evenly}.el-row.is-align-middle{align-items:center}.el-row.is-align-bottom{align-items:flex-end}.el-scrollbar{--el-scrollbar-opacity:.3;--el-scrollbar-bg-color:var(--el-text-color-secondary);--el-scrollbar-hover-opacity:.5;--el-scrollbar-hover-bg-color:var(--el-text-color-secondary)}.el-scrollbar{overflow:hidden;position:relative;height:100%}.el-scrollbar__wrap{overflow:auto;height:100%}.el-scrollbar__wrap--hidden-default{scrollbar-width:none}.el-scrollbar__wrap--hidden-default::-webkit-scrollbar{display:none}.el-scrollbar__thumb{position:relative;display:block;width:0;height:0;cursor:pointer;border-radius:inherit;background-color:var(--el-scrollbar-bg-color,var(--el-text-color-secondary));transition:var(--el-transition-duration) background-color;opacity:var(--el-scrollbar-opacity,.3)}.el-scrollbar__thumb:hover{background-color:var(--el-scrollbar-hover-bg-color,var(--el-text-color-secondary));opacity:var(--el-scrollbar-hover-opacity,.5)}.el-scrollbar__bar{position:absolute;right:2px;bottom:2px;z-index:1;border-radius:4px}.el-scrollbar__bar.is-vertical{width:6px;top:2px}.el-scrollbar__bar.is-vertical>div{width:100%}.el-scrollbar__bar.is-horizontal{height:6px;left:2px}.el-scrollbar__bar.is-horizontal>div{height:100%}.el-scrollbar-fade-enter-active{transition:opacity .34s ease-out}.el-scrollbar-fade-leave-active{transition:opacity .12s ease-out}.el-scrollbar-fade-enter-from,.el-scrollbar-fade-leave-active{opacity:0}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled{color:var(--el-text-color-disabled)}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown__option-item:hover:not(.hover){background-color:transparent}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-disabled.is-selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;margin:6px 0!important;padding:0!important;box-sizing:border-box}.el-select-dropdown__option-item{font-size:var(--el-select-font-size);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__option-item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__option-item.is-disabled:hover{background-color:var(--el-bg-color)}.el-select-dropdown__option-item.is-selected{background-color:var(--el-fill-color-light);font-weight:700}.el-select-dropdown__option-item.is-selected:not(.is-multiple){color:var(--el-color-primary)}.el-select-dropdown__option-item.hover{background-color:var(--el-fill-color-light)!important}.el-select-dropdown__option-item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon{position:absolute;right:20px;top:0;height:inherit;font-size:12px}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon svg{height:inherit;vertical-align:middle}.el-select-group{margin:0;padding:0}.el-select-group__wrap{position:relative;list-style:none;margin:0;padding:0}.el-select-group__wrap:not(:last-of-type){padding-bottom:24px}.el-select-group__wrap:not(:last-of-type):after{content:"";position:absolute;display:block;left:20px;right:20px;bottom:12px;height:1px;background:var(--el-border-color-light)}.el-select-group__split-dash{position:absolute;left:20px;right:20px;height:1px;background:var(--el-border-color-light)}.el-select-group__title{padding-left:20px;font-size:12px;color:var(--el-color-info);line-height:30px}.el-select-group .el-select-dropdown__item{padding-left:20px}.el-select-v2{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select-v2{display:inline-block;position:relative;vertical-align:middle;font-size:14px}.el-select-v2__wrapper{display:flex;align-items:center;flex-wrap:wrap;position:relative;box-sizing:border-box;cursor:pointer;padding:1px 30px 1px 0;border:1px solid var(--el-border-color);border-radius:var(--el-border-radius-base);background-color:var(--el-fill-color-blank);transition:var(--el-transition-duration)}.el-select-v2__wrapper:hover{border-color:var(--el-text-color-placeholder)}.el-select-v2__wrapper.is-filterable{cursor:text}.el-select-v2__wrapper.is-focused{border-color:var(--el-color-primary)}.el-select-v2__wrapper.is-hovering:not(.is-focused){border-color:var(--el-border-color-hover)}.el-select-v2__wrapper.is-disabled{cursor:not-allowed;background-color:var(--el-fill-color-light);color:var(--el-text-color-placeholder);border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled:hover{border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled.is-focus{border-color:var(--el-input-focus-border-color)}.el-select-v2__wrapper.is-disabled .is-transparent{opacity:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-select-v2__wrapper.is-disabled .el-select-v2__caret,.el-select-v2__wrapper.is-disabled .el-select-v2__combobox-input{cursor:not-allowed}.el-select-v2__wrapper .el-select-v2__input-wrapper{box-sizing:border-box;position:relative;-webkit-margin-start:12px;margin-inline-start:12px;max-width:100%;overflow:hidden}.el-select-v2__wrapper,.el-select-v2__wrapper .el-select-v2__input-wrapper{line-height:32px}.el-select-v2__wrapper .el-select-v2__input-wrapper input{--el-input-inner-height:calc(var(--el-component-size, 32px) - 8px);height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);min-width:4px;width:100%;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:0 0;border:none;margin:2px 0;outline:0;padding:0}.el-select-v2 .el-select-v2__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select-v2__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:14px}.el-select-v2__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select-v2__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select-v2__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select-v2--large .el-select-v2__wrapper .el-select-v2__combobox-input{height:32px}.el-select-v2--large .el-select-v2__caret,.el-select-v2--large .el-select-v2__suffix{height:40px}.el-select-v2--large .el-select-v2__placeholder{font-size:14px;line-height:40px}.el-select-v2--small .el-select-v2__wrapper .el-select-v2__combobox-input{height:16px}.el-select-v2--small .el-select-v2__caret,.el-select-v2--small .el-select-v2__suffix{height:24px}.el-select-v2--small .el-select-v2__placeholder{font-size:12px;line-height:24px}.el-select-v2 .el-select-v2__selection>span{display:inline-block}.el-select-v2:hover .el-select-v2__combobox-input{border-color:var(--el-select-border-color-hover)}.el-select-v2 .el-select__selection-text{text-overflow:ellipsis;display:inline-block;overflow-x:hidden;vertical-align:bottom}.el-select-v2 .el-select-v2__combobox-input{padding-right:35px;display:block;color:var(--el-text-color-regular)}.el-select-v2 .el-select-v2__combobox-input:focus{border-color:var(--el-select-input-focus-border-color)}.el-select-v2__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px}.el-select-v2__input.is-small{height:14px}.el-select-v2__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select-v2__close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__suffix{display:inline-flex;position:absolute;right:12px;height:32px;top:50%;transform:translateY(-50%);color:var(--el-input-icon-color,var(--el-text-color-placeholder))}.el-select-v2__suffix .el-input__icon{height:inherit}.el-select-v2__suffix .el-input__icon:not(:first-child){margin-left:8px}.el-select-v2__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:var(--el-transition-duration);transform:rotate(180deg);cursor:pointer}.el-select-v2__caret.is-reverse{transform:rotate(0)}.el-select-v2__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(180deg);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select-v2__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__caret.el-icon{height:inherit}.el-select-v2__caret.el-icon svg{vertical-align:middle}.el-select-v2__selection{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;width:100%}.el-select-v2__input-calculator{left:0;position:absolute;top:0;visibility:hidden;white-space:pre;z-index:999}.el-select-v2__selected-item{line-height:inherit;height:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-wrap:wrap}.el-select-v2__placeholder{position:absolute;top:50%;transform:translateY(-50%);-webkit-margin-start:12px;margin-inline-start:12px;width:calc(100% - 52px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--el-input-text-color,var(--el-text-color-regular))}.el-select-v2__placeholder.is-transparent{color:var(--el-text-color-placeholder)}.el-select-v2 .el-select-v2__selection .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 0 2px 6px;background-color:var(--el-fill-color)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;color:var(--el-color-white)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select-v2.el-select-v2--small .el-select-v2__selection .el-tag{margin:1px 0 1px 6px;height:18px}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown .el-select-dropdown__option-item.is-selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown .el-select-dropdown__item.is-disabled:hover{background-color:unset}.el-select-dropdown .el-select-dropdown__item.is-disabled.selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;padding:6px 0;margin:0;box-sizing:border-box}.el-select{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select{display:inline-block;position:relative;vertical-align:middle;line-height:32px}.el-select__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select .el-select-tags-wrapper.has-prefix{margin-left:6px}.el-select--large{line-height:40px}.el-select--large .el-select-tags-wrapper.has-prefix{margin-left:8px}.el-select--small{line-height:24px}.el-select--small .el-select-tags-wrapper.has-prefix{margin-left:4px}.el-select .el-select__tags>span{display:inline-block}.el-select:hover:not(.el-select--disabled) .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-border-color-hover) inset}.el-select .el-select__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select .el-input__wrapper{cursor:pointer}.el-select .el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select .el-input__inner{cursor:pointer}.el-select .el-input{display:flex}.el-select .el-input .el-select__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:transform var(--el-transition-duration);transform:rotate(0);cursor:pointer}.el-select .el-input .el-select__caret.is-reverse{transform:rotate(-180deg)}.el-select .el-input .el-select__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(0);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select .el-input .el-select__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select .el-input .el-select__caret.el-icon{position:relative;height:inherit;z-index:2}.el-select .el-input.is-disabled .el-input__wrapper{cursor:not-allowed}.el-select .el-input.is-disabled .el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-select-disabled-border) inset}.el-select .el-input.is-disabled .el-input__inner,.el-select .el-input.is-disabled .el-select__caret{cursor:not-allowed}.el-select .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px;background-color:transparent}.el-select__input.is-disabled{cursor:not-allowed}.el-select__input--iOS{position:absolute;left:0;top:0;z-index:6}.el-select__input.is-small{height:14px}.el-select__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select__close:hover{color:var(--el-select-close-hover-color)}.el-select__tags{position:absolute;line-height:normal;top:50%;transform:translateY(-50%);white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__tags .el-tag:last-child{margin-right:0}.el-select__tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__tags.is-disabled{cursor:not-allowed}.el-select__collapse-tags{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__collapse-tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__collapse-tags .el-tag:last-child{margin-right:0}.el-select__collapse-tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__collapse-tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__collapse-tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__collapse-tag{line-height:inherit;height:inherit;display:flex}.el-skeleton{--el-skeleton-circle-size:var(--el-avatar-size)}.el-skeleton__item{background:var(--el-skeleton-color);display:inline-block;height:16px;border-radius:var(--el-border-radius-base);width:100%}.el-skeleton__circle{border-radius:50%;width:var(--el-skeleton-circle-size);height:var(--el-skeleton-circle-size);line-height:var(--el-skeleton-circle-size)}.el-skeleton__button{height:40px;width:64px;border-radius:4px}.el-skeleton__p{width:100%}.el-skeleton__p.is-last{width:61%}.el-skeleton__p.is-first{width:33%}.el-skeleton__text{width:100%;height:var(--el-font-size-small)}.el-skeleton__caption{height:var(--el-font-size-extra-small)}.el-skeleton__h1{height:var(--el-font-size-extra-large)}.el-skeleton__h3{height:var(--el-font-size-large)}.el-skeleton__h5{height:var(--el-font-size-medium)}.el-skeleton__image{width:unset;display:flex;align-items:center;justify-content:center;border-radius:0}.el-skeleton__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:22%;height:22%}.el-skeleton{--el-skeleton-color:var(--el-fill-color);--el-skeleton-to-color:var(--el-fill-color-darker)}@-webkit-keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}@keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.el-skeleton{width:100%}.el-skeleton__first-line,.el-skeleton__paragraph{height:16px;margin-top:16px;background:var(--el-skeleton-color)}.el-skeleton.is-animated .el-skeleton__item{background:linear-gradient(90deg,var(--el-skeleton-color) 25%,var(--el-skeleton-to-color) 37%,var(--el-skeleton-color) 63%);background-size:400% 100%;-webkit-animation:el-skeleton-loading 1.4s ease infinite;animation:el-skeleton-loading 1.4s ease infinite}.el-slider{--el-slider-main-bg-color:var(--el-color-primary);--el-slider-runway-bg-color:var(--el-border-color-light);--el-slider-stop-bg-color:var(--el-color-white);--el-slider-disabled-color:var(--el-text-color-placeholder);--el-slider-border-radius:3px;--el-slider-height:6px;--el-slider-button-size:20px;--el-slider-button-wrapper-size:36px;--el-slider-button-wrapper-offset:-15px}.el-slider{width:100%;height:32px;display:flex;align-items:center}.el-slider__runway{flex:1;height:var(--el-slider-height);background-color:var(--el-slider-runway-bg-color);border-radius:var(--el-slider-border-radius);position:relative;cursor:pointer}.el-slider__runway.show-input{margin-right:30px;width:auto}.el-slider__runway.is-disabled{cursor:default}.el-slider__runway.is-disabled .el-slider__bar{background-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button{border-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button-wrapper.hover,.el-slider__runway.is-disabled .el-slider__button-wrapper:hover,.el-slider__runway.is-disabled .el-slider__button-wrapper.dragging{cursor:not-allowed}.el-slider__runway.is-disabled .el-slider__button.dragging,.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover{transform:scale(1)}.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover,.el-slider__runway.is-disabled .el-slider__button.dragging{cursor:not-allowed}.el-slider__input{flex-shrink:0;width:130px}.el-slider__bar{height:var(--el-slider-height);background-color:var(--el-slider-main-bg-color);border-top-left-radius:var(--el-slider-border-radius);border-bottom-left-radius:var(--el-slider-border-radius);position:absolute}.el-slider__button-wrapper{height:var(--el-slider-button-wrapper-size);width:var(--el-slider-button-wrapper-size);position:absolute;z-index:1;top:var(--el-slider-button-wrapper-offset);transform:translate(-50%);background-color:transparent;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:normal;outline:0}.el-slider__button-wrapper:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-slider__button-wrapper.hover,.el-slider__button-wrapper:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button-wrapper.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__button{display:inline-block;width:var(--el-slider-button-size);height:var(--el-slider-button-size);vertical-align:middle;border:solid 2px var(--el-slider-main-bg-color);background-color:var(--el-color-white);border-radius:50%;box-sizing:border-box;transition:var(--el-transition-duration-fast);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-slider__button.dragging,.el-slider__button.hover,.el-slider__button:hover{transform:scale(1.2)}.el-slider__button.hover,.el-slider__button:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__stop{position:absolute;height:var(--el-slider-height);width:var(--el-slider-height);border-radius:var(--el-border-radius-circle);background-color:var(--el-slider-stop-bg-color);transform:translate(-50%)}.el-slider__marks{top:0;left:12px;width:18px;height:100%}.el-slider__marks-text{position:absolute;transform:translate(-50%);font-size:14px;color:var(--el-color-info);margin-top:15px;white-space:pre}.el-slider.is-vertical{position:relative;display:inline-flex;width:auto;height:100%;flex:0}.el-slider.is-vertical .el-slider__runway{width:var(--el-slider-height);height:100%;margin:0 16px}.el-slider.is-vertical .el-slider__bar{width:var(--el-slider-height);height:auto;border-radius:0 0 3px 3px}.el-slider.is-vertical .el-slider__button-wrapper{top:auto;left:var(--el-slider-button-wrapper-offset);transform:translateY(50%)}.el-slider.is-vertical .el-slider__stop{transform:translateY(50%)}.el-slider.is-vertical .el-slider__marks-text{margin-top:0;left:15px;transform:translateY(50%)}.el-slider--large{height:40px}.el-slider--small{height:24px}.el-space{display:inline-flex;vertical-align:top}.el-space__item{display:flex;flex-wrap:wrap}.el-space__item>*{flex:1}.el-space--vertical{flex-direction:column}.el-time-spinner{width:100%;white-space:nowrap}.el-spinner{display:inline-block;vertical-align:middle}.el-spinner-inner{-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite;width:50px;height:50px}.el-spinner-inner .path{stroke:var(--el-border-color-lighter);stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}@-webkit-keyframes rotate{to{transform:rotate(360deg)}}@keyframes rotate{to{transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}.el-step{position:relative;flex-shrink:1}.el-step:last-of-type .el-step__line{display:none}.el-step:last-of-type.is-flex{flex-basis:auto!important;flex-shrink:0;flex-grow:0}.el-step:last-of-type .el-step__description,.el-step:last-of-type .el-step__main{padding-right:0}.el-step__head{position:relative;width:100%}.el-step__head.is-process{color:var(--el-text-color-primary);border-color:var(--el-text-color-primary)}.el-step__head.is-wait{color:var(--el-text-color-placeholder);border-color:var(--el-text-color-placeholder)}.el-step__head.is-success{color:var(--el-color-success);border-color:var(--el-color-success)}.el-step__head.is-error{color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-step__head.is-finish{color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-step__icon{position:relative;z-index:1;display:inline-flex;justify-content:center;align-items:center;width:24px;height:24px;font-size:14px;box-sizing:border-box;background:var(--el-bg-color);transition:.15s ease-out}.el-step__icon.is-text{border-radius:50%;border:2px solid;border-color:inherit}.el-step__icon.is-icon{width:40px}.el-step__icon-inner{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;font-weight:700;line-height:1;color:inherit}.el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:25px;font-weight:400}.el-step__icon-inner.is-status{transform:translateY(1px)}.el-step__line{position:absolute;border-color:inherit;background-color:var(--el-text-color-placeholder)}.el-step__line-inner{display:block;border-width:1px;border-style:solid;border-color:inherit;transition:.15s ease-out;box-sizing:border-box;width:0;height:0}.el-step__main{white-space:normal;text-align:left}.el-step__title{font-size:16px;line-height:38px}.el-step__title.is-process{font-weight:700;color:var(--el-text-color-primary)}.el-step__title.is-wait{color:var(--el-text-color-placeholder)}.el-step__title.is-success{color:var(--el-color-success)}.el-step__title.is-error{color:var(--el-color-danger)}.el-step__title.is-finish{color:var(--el-color-primary)}.el-step__description{padding-right:10%;margin-top:-5px;font-size:12px;line-height:20px;font-weight:400}.el-step__description.is-process{color:var(--el-text-color-primary)}.el-step__description.is-wait{color:var(--el-text-color-placeholder)}.el-step__description.is-success{color:var(--el-color-success)}.el-step__description.is-error{color:var(--el-color-danger)}.el-step__description.is-finish{color:var(--el-color-primary)}.el-step.is-horizontal{display:inline-block}.el-step.is-horizontal .el-step__line{height:2px;top:11px;left:0;right:0}.el-step.is-vertical{display:flex}.el-step.is-vertical .el-step__head{flex-grow:0;width:24px}.el-step.is-vertical .el-step__main{padding-left:10px;flex-grow:1}.el-step.is-vertical .el-step__title{line-height:24px;padding-bottom:8px}.el-step.is-vertical .el-step__line{width:2px;top:0;bottom:0;left:11px}.el-step.is-vertical .el-step__icon.is-icon{width:24px}.el-step.is-center .el-step__head,.el-step.is-center .el-step__main{text-align:center}.el-step.is-center .el-step__description{padding-left:20%;padding-right:20%}.el-step.is-center .el-step__line{left:50%;right:-50%}.el-step.is-simple{display:flex;align-items:center}.el-step.is-simple .el-step__head{width:auto;font-size:0;padding-right:10px}.el-step.is-simple .el-step__icon{background:0 0;width:16px;height:16px;font-size:12px}.el-step.is-simple .el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:18px}.el-step.is-simple .el-step__icon-inner.is-status{transform:scale(.8) translateY(1px)}.el-step.is-simple .el-step__main{position:relative;display:flex;align-items:stretch;flex-grow:1}.el-step.is-simple .el-step__title{font-size:16px;line-height:20px}.el-step.is-simple:not(:last-of-type) .el-step__title{max-width:50%;word-break:break-all}.el-step.is-simple .el-step__arrow{flex-grow:1;display:flex;align-items:center;justify-content:center}.el-step.is-simple .el-step__arrow:after,.el-step.is-simple .el-step__arrow:before{content:"";display:inline-block;position:absolute;height:15px;width:1px;background:var(--el-text-color-placeholder)}.el-step.is-simple .el-step__arrow:before{transform:rotate(-45deg) translateY(-4px);transform-origin:0 0}.el-step.is-simple .el-step__arrow:after{transform:rotate(45deg) translateY(4px);transform-origin:100% 100%}.el-step.is-simple:last-of-type .el-step__arrow{display:none}.el-steps{display:flex}.el-steps--simple{padding:13px 8%;border-radius:4px;background:var(--el-fill-color-light)}.el-steps--horizontal{white-space:nowrap}.el-steps--vertical{height:100%;flex-flow:column}.el-switch{--el-switch-on-color:var(--el-color-primary);--el-switch-off-color:var(--el-border-color)}.el-switch{display:inline-flex;align-items:center;position:relative;font-size:14px;line-height:20px;height:32px;vertical-align:middle}.el-switch.is-disabled .el-switch__core,.el-switch.is-disabled .el-switch__label{cursor:not-allowed}.el-switch__label{transition:var(--el-transition-duration-fast);height:20px;display:inline-block;font-size:14px;font-weight:500;cursor:pointer;vertical-align:middle;color:var(--el-text-color-primary)}.el-switch__label.is-active{color:var(--el-color-primary)}.el-switch__label--left{margin-right:10px}.el-switch__label--right{margin-left:10px}.el-switch__label *{line-height:1;font-size:14px;display:inline-block}.el-switch__label .el-icon{height:inherit}.el-switch__label .el-icon svg{vertical-align:middle}.el-switch__input{position:absolute;width:0;height:0;opacity:0;margin:0}.el-switch__input:focus-visible~.el-switch__core{outline:2px solid var(--el-switch-on-color);outline-offset:1px}.el-switch__core{display:inline-flex;position:relative;align-items:center;min-width:40px;height:20px;border:1px solid var(--el-switch-border-color,var(--el-switch-off-color));outline:0;border-radius:10px;box-sizing:border-box;background:var(--el-switch-off-color);cursor:pointer;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration)}.el-switch__core .el-switch__inner{width:100%;transition:all var(--el-transition-duration);height:16px;display:flex;justify-content:center;align-items:center;overflow:hidden;padding:0 4px 0 18px}.el-switch__core .el-switch__inner .is-icon,.el-switch__core .el-switch__inner .is-text{font-size:12px;color:var(--el-color-white);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-switch__core .el-switch__action{position:absolute;left:1px;border-radius:var(--el-border-radius-circle);transition:all var(--el-transition-duration);width:16px;height:16px;background-color:var(--el-color-white);display:flex;justify-content:center;align-items:center;color:var(--el-switch-off-color)}.el-switch.is-checked .el-switch__core{border-color:var(--el-switch-border-color,var(--el-switch-on-color));background-color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__action{left:calc(100% - 17px);color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__inner{padding:0 18px 0 4px}.el-switch.is-disabled{opacity:.6}.el-switch--wide .el-switch__label.el-switch__label--left span{left:10px}.el-switch--wide .el-switch__label.el-switch__label--right span{right:10px}.el-switch .label-fade-enter-from,.el-switch .label-fade-leave-active{opacity:0}.el-switch--large{font-size:14px;line-height:24px;height:40px}.el-switch--large .el-switch__label{height:24px;font-size:14px}.el-switch--large .el-switch__label *{font-size:14px}.el-switch--large .el-switch__core{min-width:50px;height:24px;border-radius:12px}.el-switch--large .el-switch__core .el-switch__inner{height:20px;padding:0 6px 0 22px}.el-switch--large .el-switch__core .el-switch__action{width:20px;height:20px}.el-switch--large.is-checked .el-switch__core .el-switch__action{left:calc(100% - 21px)}.el-switch--large.is-checked .el-switch__core .el-switch__inner{padding:0 22px 0 6px}.el-switch--small{font-size:12px;line-height:16px;height:24px}.el-switch--small .el-switch__label{height:16px;font-size:12px}.el-switch--small .el-switch__label *{font-size:12px}.el-switch--small .el-switch__core{min-width:30px;height:16px;border-radius:8px}.el-switch--small .el-switch__core .el-switch__inner{height:12px;padding:0 2px 0 14px}.el-switch--small .el-switch__core .el-switch__action{width:12px;height:12px}.el-switch--small.is-checked .el-switch__core .el-switch__action{left:calc(100% - 13px)}.el-switch--small.is-checked .el-switch__core .el-switch__inner{padding:0 14px 0 2px}.el-table-column--selection .cell{padding-left:14px;padding-right:14px}.el-table-filter{border:solid 1px var(--el-border-color-lighter);border-radius:2px;background-color:#fff;box-shadow:var(--el-box-shadow-light);box-sizing:border-box}.el-table-filter__list{padding:5px 0;margin:0;list-style:none;min-width:100px}.el-table-filter__list-item{line-height:36px;padding:0 10px;cursor:pointer;font-size:var(--el-font-size-base)}.el-table-filter__list-item:hover{background-color:var(--el-color-primary-light-9);color:var(--el-color-primary)}.el-table-filter__list-item.is-active{background-color:var(--el-color-primary);color:#fff}.el-table-filter__content{min-width:100px}.el-table-filter__bottom{border-top:1px solid var(--el-border-color-lighter);padding:8px}.el-table-filter__bottom button{background:0 0;border:none;color:var(--el-text-color-regular);cursor:pointer;font-size:var(--el-font-size-small);padding:0 3px}.el-table-filter__bottom button:hover{color:var(--el-color-primary)}.el-table-filter__bottom button:focus{outline:0}.el-table-filter__bottom button.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-table-filter__wrap{max-height:280px}.el-table-filter__checkbox-group{padding:10px}.el-table-filter__checkbox-group label.el-checkbox{display:flex;align-items:center;margin-right:5px;margin-bottom:12px;margin-left:5px;height:unset}.el-table-filter__checkbox-group .el-checkbox:last-child{margin-bottom:0}.el-table{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table{position:relative;overflow:hidden;box-sizing:border-box;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:100%;max-width:100%;background-color:var(--el-table-bg-color);font-size:14px;color:var(--el-table-text-color)}.el-table__inner-wrapper{position:relative;display:flex;flex-direction:column;height:100%}.el-table__inner-wrapper:before{left:0;bottom:0;width:100%;height:1px}.el-table.has-footer.el-table--fluid-height tr:last-child td.el-table__cell,.el-table.has-footer.el-table--scrollable-y tr:last-child td.el-table__cell{border-bottom-color:transparent}.el-table__empty-block{position:-webkit-sticky;position:sticky;left:0;min-height:60px;text-align:center;width:100%;display:flex;justify-content:center;align-items:center}.el-table__empty-text{line-height:60px;width:50%;color:var(--el-text-color-secondary)}.el-table__expand-column .cell{padding:0;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table__expand-icon{position:relative;cursor:pointer;color:var(--el-text-color-regular);font-size:12px;transition:transform var(--el-transition-duration-fast) ease-in-out;height:20px}.el-table__expand-icon--expanded{transform:rotate(90deg)}.el-table__expand-icon>.el-icon{font-size:12px}.el-table__expanded-cell{background-color:var(--el-table-expanded-cell-bg-color)}.el-table__expanded-cell[class*=cell]{padding:20px 50px}.el-table__expanded-cell:hover{background-color:transparent!important}.el-table__placeholder{display:inline-block;width:20px}.el-table__append-wrapper{overflow:hidden}.el-table--fit{border-right:0;border-bottom:0}.el-table--fit .el-table__cell.gutter{border-right-width:1px}.el-table thead{color:var(--el-table-header-text-color);font-weight:500}.el-table thead.is-group th.el-table__cell{background:var(--el-fill-color-light)}.el-table .el-table__cell{padding:8px 0;min-width:0;box-sizing:border-box;text-overflow:ellipsis;vertical-align:middle;position:relative;text-align:left;z-index:1}.el-table .el-table__cell.is-center{text-align:center}.el-table .el-table__cell.is-right{text-align:right}.el-table .el-table__cell.gutter{width:15px;border-right-width:0;border-bottom-width:0;padding:0}.el-table .el-table__cell.is-hidden>*{visibility:hidden}.el-table .cell{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;line-height:23px;padding:0 12px}.el-table .cell.el-tooltip{white-space:nowrap;min-width:50px}.el-table--large{font-size:var(--el-font-size-base)}.el-table--large .el-table__cell{padding:12px 0}.el-table--large .cell{padding:0 16px}.el-table--default{font-size:14px}.el-table--default .el-table__cell{padding:8px 0}.el-table--default .cell{padding:0 12px}.el-table--small{font-size:12px}.el-table--small .el-table__cell{padding:4px 0}.el-table--small .cell{padding:0 8px}.el-table tr{background-color:var(--el-table-tr-bg-color)}.el-table tr input[type=checkbox]{margin:0}.el-table td.el-table__cell,.el-table th.el-table__cell.is-leaf{border-bottom:var(--el-table-border)}.el-table th.el-table__cell.is-sortable{cursor:pointer}.el-table th.el-table__cell{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--el-table-header-bg-color)}.el-table th.el-table__cell>.cell.highlight{color:var(--el-color-primary)}.el-table th.el-table__cell.required>div:before{display:inline-block;content:"";width:8px;height:8px;border-radius:50%;background:#ff4d51;margin-right:5px;vertical-align:middle}.el-table td.el-table__cell div{box-sizing:border-box}.el-table td.el-table__cell.gutter{width:0}.el-table__footer-wrapper{border-top:var(--el-table-border)}.el-table--border .el-table__inner-wrapper:after,.el-table--border:after,.el-table--border:before,.el-table__inner-wrapper:before{content:"";position:absolute;background-color:var(--el-table-border-color);z-index:3}.el-table--border .el-table__inner-wrapper:after{left:0;top:0;width:100%;height:1px}.el-table--border:before{top:-1px;left:0;width:1px;height:100%}.el-table--border:after{top:-1px;right:0;width:1px;height:100%}.el-table--border .el-table__inner-wrapper{border-right:none;border-bottom:none}.el-table--border .el-table__footer-wrapper{position:relative;flex-shrink:0}.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table--border th.el-table__cell.gutter:last-of-type{border-bottom:var(--el-table-border);border-bottom-width:1px}.el-table--border th.el-table__cell{border-bottom:var(--el-table-border)}.el-table--hidden{visibility:hidden}.el-table__body-wrapper,.el-table__footer-wrapper,.el-table__header-wrapper{width:100%}.el-table__body-wrapper tr td.el-table-fixed-column--left,.el-table__body-wrapper tr td.el-table-fixed-column--right,.el-table__body-wrapper tr th.el-table-fixed-column--left,.el-table__body-wrapper tr th.el-table-fixed-column--right,.el-table__footer-wrapper tr td.el-table-fixed-column--left,.el-table__footer-wrapper tr td.el-table-fixed-column--right,.el-table__footer-wrapper tr th.el-table-fixed-column--left,.el-table__footer-wrapper tr th.el-table-fixed-column--right,.el-table__header-wrapper tr td.el-table-fixed-column--left,.el-table__header-wrapper tr td.el-table-fixed-column--right,.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:var(--el-bg-color)}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{content:"";position:absolute;top:0;width:10px;bottom:-1px;overflow-x:hidden;overflow-y:hidden;box-shadow:none;touch-action:none;pointer-events:none}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before{left:-10px}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{right:-10px;box-shadow:none}.el-table__body-wrapper tr td.el-table__fixed-right-patch,.el-table__body-wrapper tr th.el-table__fixed-right-patch,.el-table__footer-wrapper tr td.el-table__fixed-right-patch,.el-table__footer-wrapper tr th.el-table__fixed-right-patch,.el-table__header-wrapper tr td.el-table__fixed-right-patch,.el-table__header-wrapper tr th.el-table__fixed-right-patch{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:#fff;right:0}.el-table__header-wrapper{flex-shrink:0}.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body,.el-table__footer,.el-table__header{table-layout:fixed;border-collapse:separate}.el-table__footer-wrapper,.el-table__header-wrapper{overflow:hidden}.el-table__footer-wrapper tbody td.el-table__cell,.el-table__header-wrapper tbody td.el-table__cell{background-color:var(--el-table-row-hover-bg-color);color:var(--el-table-text-color)}.el-table__body-wrapper .el-table-column--selection>.cell,.el-table__header-wrapper .el-table-column--selection>.cell{display:inline-flex;align-items:center;height:23px}.el-table__body-wrapper .el-table-column--selection .el-checkbox,.el-table__header-wrapper .el-table-column--selection .el-checkbox{height:unset}.el-table.is-scrolling-left .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-left.el-table--border .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:var(--el-table-border)}.el-table.is-scrolling-left th.el-table-fixed-column--left{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-right th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-middle .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-none .el-table-fixed-column--left.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--left.is-last-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-last-column:before{box-shadow:none}.el-table.is-scrolling-none th.el-table-fixed-column--left,.el-table.is-scrolling-none th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body-wrapper{overflow:hidden;position:relative;flex:1}.el-table__body-wrapper .el-scrollbar__bar{z-index:2}.el-table .caret-wrapper{display:inline-flex;flex-direction:column;align-items:center;height:14px;width:24px;vertical-align:middle;cursor:pointer;overflow:initial;position:relative}.el-table .sort-caret{width:0;height:0;border:solid 5px transparent;position:absolute;left:7px}.el-table .sort-caret.ascending{border-bottom-color:var(--el-text-color-placeholder);top:-5px}.el-table .sort-caret.descending{border-top-color:var(--el-text-color-placeholder);bottom:-3px}.el-table .ascending .sort-caret.ascending{border-bottom-color:var(--el-color-primary)}.el-table .descending .sort-caret.descending{border-top-color:var(--el-color-primary)}.el-table .hidden-columns{visibility:hidden;position:absolute;z-index:-1}.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell{background:var(--el-fill-color-lighter)}.el-table--striped .el-table__body tr.el-table__row--striped.current-row td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__body tr.hover-row.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped>td.el-table__cell,.el-table__body tr.hover-row>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table__body tr.current-row>td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__column-resize-proxy{position:absolute;left:200px;top:0;bottom:0;width:0;border-left:var(--el-table-border);z-index:10}.el-table__column-filter-trigger{display:inline-block;cursor:pointer}.el-table__column-filter-trigger i{color:var(--el-color-info);font-size:14px;vertical-align:middle}.el-table__border-left-patch{top:0;left:0;width:1px;height:100%;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-bottom-patch{left:0;height:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-right-patch{top:0;height:100%;width:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table--enable-row-transition .el-table__body td.el-table__cell{transition:background-color .25s ease}.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table [class*=el-table__row--level] .el-table__expand-icon{display:inline-block;width:12px;line-height:12px;height:12px;text-align:center;margin-right:8px}.el-table .el-table.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table:not(.el-table--border) .el-table__cell{border-right:none}.el-table:not(.el-table--border)>.el-table__inner-wrapper:after{content:none}.el-table-v2{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table-v2{font-size:14px}.el-table-v2 *{box-sizing:border-box}.el-table-v2__root{position:relative}.el-table-v2__root:hover .el-table-v2__main .el-virtual-scrollbar{opacity:1}.el-table-v2__main{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0}.el-table-v2__main .el-vl__horizontal,.el-table-v2__main .el-vl__vertical{z-index:2}.el-table-v2__left{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0;box-shadow:2px 0 4px #0000000f}.el-table-v2__left .el-virtual-scrollbar{opacity:0}.el-table-v2__left .el-vl__horizontal,.el-table-v2__left .el-vl__vertical{z-index:-1}.el-table-v2__right{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);right:0;box-shadow:-2px 0 4px #0000000f}.el-table-v2__right .el-virtual-scrollbar{opacity:0}.el-table-v2__right .el-vl__horizontal,.el-table-v2__right .el-vl__vertical{z-index:-1}.el-table-v2__header-row,.el-table-v2__row{-webkit-padding-end:var(--el-table-scrollbar-size);padding-inline-end:var(--el-table-scrollbar-size)}.el-table-v2__header-wrapper{overflow:hidden}.el-table-v2__header{position:relative;overflow:hidden}.el-table-v2__footer{position:absolute;left:0;right:0;bottom:0;overflow:hidden}.el-table-v2__empty{position:absolute;left:0}.el-table-v2__overlay{position:absolute;left:0;right:0;top:0;bottom:0;z-index:9999}.el-table-v2__header-row{display:flex;border-bottom:var(--el-table-border)}.el-table-v2__header-cell{display:flex;align-items:center;padding:0 8px;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;background-color:var(--el-table-header-bg-color);color:var(--el-table-header-text-color);font-weight:700}.el-table-v2__header-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__header-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__header-cell.is-sortable{cursor:pointer}.el-table-v2__header-cell:hover .el-icon{display:block}.el-table-v2__sort-icon{transition:opacity,display var(--el-transition-duration);opacity:.6;display:none}.el-table-v2__sort-icon.is-sorting{display:block;opacity:1}.el-table-v2__row{border-bottom:var(--el-table-border);display:flex;align-items:center;transition:background-color var(--el-transition-duration)}.el-table-v2__row.is-hovered,.el-table-v2__row:hover{background-color:var(--el-table-row-hover-bg-color)}.el-table-v2__row-cell{height:100%;overflow:hidden;display:flex;align-items:center;padding:0 8px}.el-table-v2__row-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__row-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__expand-icon{margin:0 4px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table-v2__expand-icon svg{transition:transform var(--el-transition-duration)}.el-table-v2__expand-icon.is-expanded svg{transform:rotate(90deg)}.el-table-v2:not(.is-dynamic) .el-table-v2__cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-table-v2.is-dynamic .el-table-v2__row{overflow:hidden;align-items:stretch}.el-table-v2.is-dynamic .el-table-v2__row .el-table-v2__row-cell{word-break:break-all}.el-tabs{--el-tabs-header-height:40px}.el-tabs__header{padding:0;position:relative;margin:0 0 15px}.el-tabs__active-bar{position:absolute;bottom:0;left:0;height:2px;background-color:var(--el-color-primary);z-index:1;transition:width var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),transform var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);list-style:none}.el-tabs__new-tab{display:flex;align-items:center;justify-content:center;float:right;border:1px solid var(--el-border-color);height:20px;width:20px;line-height:20px;margin:10px 0 10px 10px;border-radius:3px;text-align:center;font-size:12px;color:var(--el-text-color-primary);cursor:pointer;transition:all .15s}.el-tabs__new-tab .is-icon-plus{height:inherit;width:inherit;transform:scale(.8)}.el-tabs__new-tab .is-icon-plus svg{vertical-align:middle}.el-tabs__new-tab:hover{color:var(--el-color-primary)}.el-tabs__nav-wrap{overflow:hidden;margin-bottom:-1px;position:relative}.el-tabs__nav-wrap:after{content:"";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:var(--el-border-color-light);z-index:var(--el-index-normal)}.el-tabs__nav-wrap.is-scrollable{padding:0 20px;box-sizing:border-box}.el-tabs__nav-scroll{overflow:hidden}.el-tabs__nav-next,.el-tabs__nav-prev{position:absolute;cursor:pointer;line-height:44px;font-size:12px;color:var(--el-text-color-secondary);width:20px;text-align:center}.el-tabs__nav-next{right:0}.el-tabs__nav-prev{left:0}.el-tabs__nav{display:flex;white-space:nowrap;position:relative;transition:transform var(--el-transition-duration);float:left;z-index:calc(var(--el-index-normal) + 1)}.el-tabs__nav.is-stretch{min-width:100%;display:flex}.el-tabs__nav.is-stretch>*{flex:1;text-align:center}.el-tabs__item{padding:0 20px;height:var(--el-tabs-header-height);box-sizing:border-box;display:flex;align-items:center;justify-content:center;list-style:none;font-size:var(--el-font-size-base);font-weight:500;color:var(--el-text-color-primary);position:relative}.el-tabs__item:focus,.el-tabs__item:focus:active{outline:0}.el-tabs__item:focus-visible{box-shadow:0 0 2px 2px var(--el-color-primary) inset;border-radius:3px}.el-tabs__item .is-icon-close{border-radius:50%;text-align:center;transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);margin-left:5px}.el-tabs__item .is-icon-close:before{transform:scale(.9);display:inline-block}.el-tabs__item .is-icon-close:hover{background-color:var(--el-text-color-placeholder);color:#fff}.el-tabs__item.is-active{color:var(--el-color-primary)}.el-tabs__item:hover{color:var(--el-color-primary);cursor:pointer}.el-tabs__item.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-tabs__content{overflow:hidden;position:relative}.el-tabs--card>.el-tabs__header{border-bottom:1px solid var(--el-border-color-light);height:var(--el-tabs-header-height)}.el-tabs--card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--card>.el-tabs__header .el-tabs__nav{border:1px solid var(--el-border-color-light);border-bottom:none;border-radius:4px 4px 0 0;box-sizing:border-box}.el-tabs--card>.el-tabs__header .el-tabs__active-bar{display:none}.el-tabs--card>.el-tabs__header .el-tabs__item .is-icon-close{position:relative;font-size:12px;width:0;height:14px;overflow:hidden;right:-2px;transform-origin:100% 50%}.el-tabs--card>.el-tabs__header .el-tabs__item{border-bottom:1px solid transparent;border-left:1px solid var(--el-border-color-light);transition:color var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),padding var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier)}.el-tabs--card>.el-tabs__header .el-tabs__item:first-child{border-left:none}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover{padding-left:13px;padding-right:13px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover .is-icon-close{width:14px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active{border-bottom-color:var(--el-bg-color)}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable{padding-left:20px;padding-right:20px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable .is-icon-close{width:14px}.el-tabs--border-card{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color)}.el-tabs--border-card>.el-tabs__content{padding:15px}.el-tabs--border-card>.el-tabs__header{background-color:var(--el-fill-color-light);border-bottom:1px solid var(--el-border-color-light);margin:0}.el-tabs--border-card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--border-card>.el-tabs__header .el-tabs__item{transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);border:1px solid transparent;margin-top:-1px;color:var(--el-text-color-secondary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:first-child{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item+.el-tabs__item{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay);border-right-color:var(--el-border-color);border-left-color:var(--el-border-color)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover{color:var(--el-color-primary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-disabled{color:var(--el-disabled-text-color)}.el-tabs--border-card>.el-tabs__header .is-scrollable .el-tabs__item:first-child{margin-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),.el-tabs--top .el-tabs__item.is-top:nth-child(2){padding-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:last-child,.el-tabs--bottom .el-tabs__item.is-top:last-child,.el-tabs--top .el-tabs__item.is-bottom:last-child,.el-tabs--top .el-tabs__item.is-top:last-child{padding-right:0}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2){padding-left:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover{padding-left:13px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child{padding-right:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover{padding-right:13px}.el-tabs--bottom .el-tabs__header.is-bottom{margin-bottom:0;margin-top:10px}.el-tabs--bottom.el-tabs--border-card .el-tabs__header.is-bottom{border-bottom:0;border-top:1px solid var(--el-border-color)}.el-tabs--bottom.el-tabs--border-card .el-tabs__nav-wrap.is-bottom{margin-top:-1px;margin-bottom:0}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom:not(.is-active){border:1px solid transparent}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom{margin:0 -1px -1px}.el-tabs--left,.el-tabs--right{overflow:hidden}.el-tabs--left .el-tabs__header.is-left,.el-tabs--left .el-tabs__header.is-right,.el-tabs--left .el-tabs__nav-scroll,.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__header.is-left,.el-tabs--right .el-tabs__header.is-right,.el-tabs--right .el-tabs__nav-scroll,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{height:100%}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__active-bar.is-right,.el-tabs--right .el-tabs__active-bar.is-left,.el-tabs--right .el-tabs__active-bar.is-right{top:0;bottom:auto;width:2px;height:auto}.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{margin-bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{height:30px;line-height:30px;width:100%;text-align:center;cursor:pointer}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i{transform:rotate(90deg)}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{left:auto;top:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next{right:auto;bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--left .el-tabs__nav-wrap.is-right.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-right.is-scrollable{padding:30px 0}.el-tabs--left .el-tabs__nav-wrap.is-left:after,.el-tabs--left .el-tabs__nav-wrap.is-right:after,.el-tabs--right .el-tabs__nav-wrap.is-left:after,.el-tabs--right .el-tabs__nav-wrap.is-right:after{height:100%;width:2px;bottom:auto;top:0}.el-tabs--left .el-tabs__nav.is-left,.el-tabs--left .el-tabs__nav.is-right,.el-tabs--right .el-tabs__nav.is-left,.el-tabs--right .el-tabs__nav.is-right{flex-direction:column}.el-tabs--left .el-tabs__item.is-left,.el-tabs--right .el-tabs__item.is-left{justify-content:flex-end}.el-tabs--left .el-tabs__item.is-right,.el-tabs--right .el-tabs__item.is-right{justify-content:flex-start}.el-tabs--left .el-tabs__header.is-left{float:left;margin-bottom:0;margin-right:10px}.el-tabs--left .el-tabs__nav-wrap.is-left{margin-right:-1px}.el-tabs--left .el-tabs__nav-wrap.is-left:after{left:auto;right:0}.el-tabs--left .el-tabs__active-bar.is-left{right:0;left:auto}.el-tabs--left .el-tabs__item.is-left{text-align:right}.el-tabs--left.el-tabs--card .el-tabs__active-bar.is-left{display:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left{border-left:none;border-right:1px solid var(--el-border-color-light);border-bottom:none;border-top:1px solid var(--el-border-color-light);text-align:left}.el-tabs--left.el-tabs--card .el-tabs__item.is-left:first-child{border-right:1px solid var(--el-border-color-light);border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active{border:1px solid var(--el-border-color-light);border-right-color:#fff;border-left:none;border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:first-child{border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:last-child{border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__nav{border-radius:4px 0 0 4px;border-bottom:1px solid var(--el-border-color-light);border-right:none}.el-tabs--left.el-tabs--card .el-tabs__new-tab{float:none}.el-tabs--left.el-tabs--border-card .el-tabs__header.is-left{border-right:1px solid var(--el-border-color)}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left{border:1px solid transparent;margin:-1px 0 -1px -1px}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.el-tabs--right .el-tabs__header.is-right{float:right;margin-bottom:0;margin-left:10px}.el-tabs--right .el-tabs__nav-wrap.is-right{margin-left:-1px}.el-tabs--right .el-tabs__nav-wrap.is-right:after{left:0;right:auto}.el-tabs--right .el-tabs__active-bar.is-right{left:0}.el-tabs--right.el-tabs--card .el-tabs__active-bar.is-right{display:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right{border-bottom:none;border-top:1px solid var(--el-border-color-light)}.el-tabs--right.el-tabs--card .el-tabs__item.is-right:first-child{border-left:1px solid var(--el-border-color-light);border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active{border:1px solid var(--el-border-color-light);border-left-color:#fff;border-right:none;border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:first-child{border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:last-child{border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__nav{border-radius:0 4px 4px 0;border-bottom:1px solid var(--el-border-color-light);border-left:none}.el-tabs--right.el-tabs--border-card .el-tabs__header.is-right{border-left:1px solid var(--el-border-color)}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right{border:1px solid transparent;margin:-1px -1px -1px 0}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.slideInLeft-transition,.slideInRight-transition{display:inline-block}.slideInRight-enter{-webkit-animation:slideInRight-enter var(--el-transition-duration);animation:slideInRight-enter var(--el-transition-duration)}.slideInRight-leave{position:absolute;left:0;right:0;-webkit-animation:slideInRight-leave var(--el-transition-duration);animation:slideInRight-leave var(--el-transition-duration)}.slideInLeft-enter{-webkit-animation:slideInLeft-enter var(--el-transition-duration);animation:slideInLeft-enter var(--el-transition-duration)}.slideInLeft-leave{position:absolute;left:0;right:0;-webkit-animation:slideInLeft-leave var(--el-transition-duration);animation:slideInLeft-leave var(--el-transition-duration)}@-webkit-keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@-webkit-keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}@keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}.el-tag{--el-tag-font-size:12px;--el-tag-border-radius:4px;--el-tag-border-radius-rounded:9999px}.el-tag{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary);--el-tag-text-color:var(--el-color-primary);background-color:var(--el-tag-bg-color);border-color:var(--el-tag-border-color);color:var(--el-tag-text-color);display:inline-flex;justify-content:center;align-items:center;height:24px;padding:0 9px;font-size:var(--el-tag-font-size);line-height:1;border-width:1px;border-style:solid;border-radius:var(--el-tag-border-radius);box-sizing:border-box;white-space:nowrap;--el-icon-size:14px}.el-tag.el-tag--primary{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-bg-color:var(--el-color-success-light-9);--el-tag-border-color:var(--el-color-success-light-8);--el-tag-hover-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-bg-color:var(--el-color-warning-light-9);--el-tag-border-color:var(--el-color-warning-light-8);--el-tag-hover-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-bg-color:var(--el-color-danger-light-9);--el-tag-border-color:var(--el-color-danger-light-8);--el-tag-hover-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-bg-color:var(--el-color-error-light-9);--el-tag-border-color:var(--el-color-error-light-8);--el-tag-hover-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-bg-color:var(--el-color-info-light-9);--el-tag-border-color:var(--el-color-info-light-8);--el-tag-hover-color:var(--el-color-info)}.el-tag.el-tag--primary{--el-tag-text-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-text-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-text-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-text-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-text-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-text-color:var(--el-color-info)}.el-tag.is-hit{border-color:var(--el-color-primary)}.el-tag.is-round{border-radius:var(--el-tag-border-radius-rounded)}.el-tag .el-tag__close{color:var(--el-tag-text-color)}.el-tag .el-tag__close:hover{color:var(--el-color-white);background-color:var(--el-tag-hover-color)}.el-tag .el-icon{border-radius:50%;cursor:pointer;font-size:calc(var(--el-icon-size) - 2px);height:var(--el-icon-size);width:var(--el-icon-size)}.el-tag .el-tag__close{margin-left:6px}.el-tag--dark{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3);--el-tag-text-color:var(--el-color-white)}.el-tag--dark.el-tag--primary{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3)}.el-tag--dark.el-tag--success{--el-tag-bg-color:var(--el-color-success);--el-tag-border-color:var(--el-color-success);--el-tag-hover-color:var(--el-color-success-light-3)}.el-tag--dark.el-tag--warning{--el-tag-bg-color:var(--el-color-warning);--el-tag-border-color:var(--el-color-warning);--el-tag-hover-color:var(--el-color-warning-light-3)}.el-tag--dark.el-tag--danger{--el-tag-bg-color:var(--el-color-danger);--el-tag-border-color:var(--el-color-danger);--el-tag-hover-color:var(--el-color-danger-light-3)}.el-tag--dark.el-tag--error{--el-tag-bg-color:var(--el-color-error);--el-tag-border-color:var(--el-color-error);--el-tag-hover-color:var(--el-color-error-light-3)}.el-tag--dark.el-tag--info{--el-tag-bg-color:var(--el-color-info);--el-tag-border-color:var(--el-color-info);--el-tag-hover-color:var(--el-color-info-light-3)}.el-tag--dark.el-tag--primary,.el-tag--dark.el-tag--success,.el-tag--dark.el-tag--warning,.el-tag--dark.el-tag--danger,.el-tag--dark.el-tag--error,.el-tag--dark.el-tag--info{--el-tag-text-color:var(--el-color-white)}.el-tag--plain{--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary);--el-tag-bg-color:var(--el-fill-color-blank)}.el-tag--plain.el-tag--primary{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary)}.el-tag--plain.el-tag--success{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-success-light-5);--el-tag-hover-color:var(--el-color-success)}.el-tag--plain.el-tag--warning{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-warning-light-5);--el-tag-hover-color:var(--el-color-warning)}.el-tag--plain.el-tag--danger{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-danger-light-5);--el-tag-hover-color:var(--el-color-danger)}.el-tag--plain.el-tag--error{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-error-light-5);--el-tag-hover-color:var(--el-color-error)}.el-tag--plain.el-tag--info{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-info-light-5);--el-tag-hover-color:var(--el-color-info)}.el-tag.is-closable{padding-right:5px}.el-tag--large{padding:0 11px;height:32px;--el-icon-size:16px}.el-tag--large .el-tag__close{margin-left:8px}.el-tag--large.is-closable{padding-right:7px}.el-tag--small{padding:0 7px;height:20px;--el-icon-size:12px}.el-tag--small .el-tag__close{margin-left:4px}.el-tag--small.is-closable{padding-right:3px}.el-tag--small .el-icon-close{transform:scale(.8)}.el-tag.el-tag--primary.is-hit{border-color:var(--el-color-primary)}.el-tag.el-tag--success.is-hit{border-color:var(--el-color-success)}.el-tag.el-tag--warning.is-hit{border-color:var(--el-color-warning)}.el-tag.el-tag--danger.is-hit{border-color:var(--el-color-danger)}.el-tag.el-tag--error.is-hit{border-color:var(--el-color-error)}.el-tag.el-tag--info.is-hit{border-color:var(--el-color-info)}.el-text{--el-text-font-size:var(--el-font-size-base);--el-text-color:var(--el-text-color-regular)}.el-text{align-self:center;margin:0;padding:0;font-size:var(--el-text-font-size);color:var(--el-text-color);word-break:break-all}.el-text.is-truncated{display:inline-block;max-width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.el-text--large{--el-text-font-size:var(--el-font-size-medium)}.el-text--default{--el-text-font-size:var(--el-font-size-base)}.el-text--small{--el-text-font-size:var(--el-font-size-extra-small)}.el-text.el-text--primary{--el-text-color:var(--el-color-primary)}.el-text.el-text--success{--el-text-color:var(--el-color-success)}.el-text.el-text--warning{--el-text-color:var(--el-color-warning)}.el-text.el-text--danger{--el-text-color:var(--el-color-danger)}.el-text.el-text--error{--el-text-color:var(--el-color-error)}.el-text.el-text--info{--el-text-color:var(--el-color-info)}.el-text>.el-icon{vertical-align:-2px}.time-select{margin:5px 0;min-width:0}.time-select .el-picker-panel__content{max-height:200px;margin:0}.time-select-item{padding:8px 10px;font-size:14px;line-height:20px}.time-select-item.disabled{color:var(--el-datepicker-border-color);cursor:not-allowed}.time-select-item:hover{background-color:var(--el-fill-color-light);font-weight:700;cursor:pointer}.time-select .time-select-item.selected:not(.disabled){color:var(--el-color-primary);font-weight:700}.el-timeline-item{position:relative;padding-bottom:20px}.el-timeline-item__wrapper{position:relative;padding-left:28px;top:-3px}.el-timeline-item__tail{position:absolute;left:4px;height:100%;border-left:2px solid var(--el-timeline-node-color)}.el-timeline-item .el-timeline-item__icon{color:var(--el-color-white);font-size:var(--el-font-size-small)}.el-timeline-item__node{position:absolute;background-color:var(--el-timeline-node-color);border-color:var(--el-timeline-node-color);border-radius:50%;box-sizing:border-box;display:flex;justify-content:center;align-items:center}.el-timeline-item__node--normal{left:-1px;width:var(--el-timeline-node-size-normal);height:var(--el-timeline-node-size-normal)}.el-timeline-item__node--large{left:-2px;width:var(--el-timeline-node-size-large);height:var(--el-timeline-node-size-large)}.el-timeline-item__node.is-hollow{background:var(--el-color-white);border-style:solid;border-width:2px}.el-timeline-item__node--primary{background-color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-timeline-item__node--success{background-color:var(--el-color-success);border-color:var(--el-color-success)}.el-timeline-item__node--warning{background-color:var(--el-color-warning);border-color:var(--el-color-warning)}.el-timeline-item__node--danger{background-color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-timeline-item__node--info{background-color:var(--el-color-info);border-color:var(--el-color-info)}.el-timeline-item__dot{position:absolute;display:flex;justify-content:center;align-items:center}.el-timeline-item__content{color:var(--el-text-color-primary)}.el-timeline-item__timestamp{color:var(--el-text-color-secondary);line-height:1;font-size:var(--el-font-size-small)}.el-timeline-item__timestamp.is-top{margin-bottom:8px;padding-top:4px}.el-timeline-item__timestamp.is-bottom{margin-top:8px}.el-timeline{--el-timeline-node-size-normal:12px;--el-timeline-node-size-large:14px;--el-timeline-node-color:var(--el-border-color-light)}.el-timeline{margin:0;font-size:var(--el-font-size-base);list-style:none}.el-timeline .el-timeline-item:last-child .el-timeline-item__tail{display:none}.el-timeline .el-timeline-item__center{display:flex;align-items:center}.el-timeline .el-timeline-item__center .el-timeline-item__wrapper{width:100%}.el-timeline .el-timeline-item__center .el-timeline-item__tail{top:0}.el-timeline .el-timeline-item__center:first-child .el-timeline-item__tail{height:calc(50% + 10px);top:calc(50% - 10px)}.el-timeline .el-timeline-item__center:last-child .el-timeline-item__tail{display:block;height:calc(50% - 10px)}.el-tooltip-v2__content{--el-tooltip-v2-padding:5px 10px;--el-tooltip-v2-border-radius:4px;--el-tooltip-v2-border-color:var(--el-border-color);border-radius:var(--el-tooltip-v2-border-radius);color:var(--el-color-black);background-color:var(--el-color-white);padding:var(--el-tooltip-v2-padding);border:1px solid var(--el-border-color)}.el-tooltip-v2__arrow{position:absolute;color:var(--el-color-white);width:var(--el-tooltip-v2-arrow-width);height:var(--el-tooltip-v2-arrow-height);pointer-events:none;left:var(--el-tooltip-v2-arrow-x);top:var(--el-tooltip-v2-arrow-y)}.el-tooltip-v2__arrow:before{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__arrow:after{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow{bottom:0}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:before{border-top-color:var(--el-color-white);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:after{border-top-color:var(--el-border-color);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:100%;z-index:-1}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow{top:0}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:before{border-bottom-color:var(--el-color-white);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:after{border-bottom-color:var(--el-border-color);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:100%;z-index:-1}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow{right:0}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:before{border-left-color:var(--el-color-white);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:after{border-left-color:var(--el-border-color);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:100%;z-index:-1}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow{left:0}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:before{border-right-color:var(--el-color-white);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:after{border-right-color:var(--el-border-color);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:100%;z-index:-1}.el-tooltip-v2__content.is-dark{--el-tooltip-v2-border-color:transparent;background-color:var(--el-color-black);color:var(--el-color-white);border-color:transparent}.el-tooltip-v2__content.is-dark .el-tooltip-v2__arrow{background-color:var(--el-color-black);border-color:transparent}.el-transfer{--el-transfer-border-color:var(--el-border-color-lighter);--el-transfer-border-radius:var(--el-border-radius-base);--el-transfer-panel-width:200px;--el-transfer-panel-header-height:40px;--el-transfer-panel-header-bg-color:var(--el-fill-color-light);--el-transfer-panel-footer-height:40px;--el-transfer-panel-body-height:278px;--el-transfer-item-height:30px;--el-transfer-filter-height:32px}.el-transfer{font-size:var(--el-font-size-base)}.el-transfer__buttons{display:inline-block;vertical-align:middle;padding:0 30px}.el-transfer__button{vertical-align:top}.el-transfer__button:nth-child(2){margin:0 0 0 10px}.el-transfer__button i,.el-transfer__button span{font-size:14px}.el-transfer__button .el-icon+span{margin-left:0}.el-transfer-panel{overflow:hidden;background:var(--el-bg-color-overlay);display:inline-block;text-align:left;vertical-align:middle;width:var(--el-transfer-panel-width);max-height:100%;box-sizing:border-box;position:relative}.el-transfer-panel__body{height:var(--el-transfer-panel-body-height);border-left:1px solid var(--el-transfer-border-color);border-right:1px solid var(--el-transfer-border-color);border-bottom:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius);overflow:hidden}.el-transfer-panel__body.is-with-footer{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.el-transfer-panel__list{margin:0;padding:6px 0;list-style:none;height:var(--el-transfer-panel-body-height);overflow:auto;box-sizing:border-box}.el-transfer-panel__list.is-filterable{height:calc(100% - var(--el-transfer-filter-height) - 30px);padding-top:0}.el-transfer-panel__item{height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding-left:15px;display:block!important}.el-transfer-panel__item+.el-transfer-panel__item{margin-left:0}.el-transfer-panel__item.el-checkbox{color:var(--el-text-color-regular)}.el-transfer-panel__item:hover{color:var(--el-color-primary)}.el-transfer-panel__item.el-checkbox .el-checkbox__label{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;box-sizing:border-box;padding-left:22px;line-height:var(--el-transfer-item-height)}.el-transfer-panel__item .el-checkbox__input{position:absolute;top:8px}.el-transfer-panel__filter{text-align:center;padding:15px;box-sizing:border-box}.el-transfer-panel__filter .el-input__inner{height:var(--el-transfer-filter-height);width:100%;font-size:12px;display:inline-block;box-sizing:border-box;border-radius:calc(var(--el-transfer-filter-height)/ 2)}.el-transfer-panel__filter .el-icon-circle-close{cursor:pointer}.el-transfer-panel .el-transfer-panel__header{display:flex;align-items:center;height:var(--el-transfer-panel-header-height);background:var(--el-transfer-panel-header-bg-color);margin:0;padding-left:15px;border:1px solid var(--el-transfer-border-color);border-top-left-radius:var(--el-transfer-border-radius);border-top-right-radius:var(--el-transfer-border-radius);box-sizing:border-box;color:var(--el-color-black)}.el-transfer-panel .el-transfer-panel__header .el-checkbox{position:relative;display:flex;width:100%;align-items:center}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label{font-size:16px;color:var(--el-text-color-primary);font-weight:400}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label span{position:absolute;right:15px;top:50%;transform:translate3d(0,-50%,0);color:var(--el-text-color-secondary);font-size:12px;font-weight:400}.el-transfer-panel .el-transfer-panel__footer{height:var(--el-transfer-panel-footer-height);background:var(--el-bg-color-overlay);margin:0;padding:0;border:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius)}.el-transfer-panel .el-transfer-panel__footer:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-transfer-panel .el-transfer-panel__footer .el-checkbox{padding-left:20px;color:var(--el-text-color-regular)}.el-transfer-panel .el-transfer-panel__empty{margin:0;height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding:6px 15px 0;color:var(--el-text-color-secondary);text-align:center}.el-transfer-panel .el-checkbox__label{padding-left:8px}.el-transfer-panel .el-checkbox__inner{height:14px;width:14px;border-radius:3px}.el-transfer-panel .el-checkbox__inner:after{height:6px;width:3px;left:4px}.el-tree{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree{position:relative;cursor:default;background:var(--el-fill-color-blank);color:var(--el-tree-text-color);font-size:var(--el-font-size-base)}.el-tree__empty-block{position:relative;min-height:60px;text-align:center;width:100%;height:100%}.el-tree__empty-text{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:var(--el-text-color-secondary);font-size:var(--el-font-size-base)}.el-tree__drop-indicator{position:absolute;left:0;right:0;height:1px;background-color:var(--el-color-primary)}.el-tree-node{white-space:nowrap;outline:0}.el-tree-node:focus>.el-tree-node__content{background-color:var(--el-tree-node-hover-bg-color)}.el-tree-node.is-drop-inner>.el-tree-node__content .el-tree-node__label{background-color:var(--el-color-primary);color:#fff}.el-tree-node__content{display:flex;align-items:center;height:26px;cursor:pointer}.el-tree-node__content>.el-tree-node__expand-icon{padding:6px;box-sizing:content-box}.el-tree-node__content>label.el-checkbox{margin-right:8px}.el-tree-node__content:hover{background-color:var(--el-tree-node-hover-bg-color)}.el-tree.is-dragging .el-tree-node__content{cursor:move}.el-tree.is-dragging .el-tree-node__content *{pointer-events:none}.el-tree.is-dragging.is-drop-not-allow .el-tree-node__content{cursor:not-allowed}.el-tree-node__expand-icon{cursor:pointer;color:var(--el-tree-expand-icon-color);font-size:12px;transform:rotate(0);transition:transform var(--el-transition-duration) ease-in-out}.el-tree-node__expand-icon.expanded{transform:rotate(90deg)}.el-tree-node__expand-icon.is-leaf{color:transparent;cursor:default}.el-tree-node__expand-icon.is-hidden{visibility:hidden}.el-tree-node__loading-icon{margin-right:8px;font-size:var(--el-font-size-base);color:var(--el-tree-expand-icon-color)}.el-tree-node>.el-tree-node__children{overflow:hidden;background-color:transparent}.el-tree-node.is-expanded>.el-tree-node__children{display:block}.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:var(--el-color-primary-light-9)}.el-tree-select{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree-select__popper .el-tree-node__expand-icon{margin-left:8px}.el-tree-select__popper .el-tree-node.is-checked>.el-tree-node__content .el-select-dropdown__item.selected:after{content:none}.el-tree-select__popper .el-select-dropdown__item{flex:1;background:0 0!important;padding-left:0;height:20px;line-height:20px}.el-upload{--el-upload-dragger-padding-horizontal:40px;--el-upload-dragger-padding-vertical:10px}.el-upload{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;outline:0}.el-upload__input{display:none}.el-upload__tip{font-size:12px;color:var(--el-text-color-regular);margin-top:7px}.el-upload iframe{position:absolute;z-index:-1;top:0;left:0;opacity:0}.el-upload--picture-card{--el-upload-picture-card-size:148px;background-color:var(--el-fill-color-lighter);border:1px dashed var(--el-border-color-darker);border-radius:6px;box-sizing:border-box;width:var(--el-upload-picture-card-size);height:var(--el-upload-picture-card-size);cursor:pointer;vertical-align:top;display:inline-flex;justify-content:center;align-items:center}.el-upload--picture-card i{font-size:28px;color:var(--el-text-color-secondary)}.el-upload--picture-card:hover{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload.is-drag{display:block}.el-upload:focus{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload:focus .el-upload-dragger{border-color:var(--el-color-primary)}.el-upload-dragger{padding:var(--el-upload-dragger-padding-horizontal) var(--el-upload-dragger-padding-vertical);background-color:var(--el-fill-color-blank);border:1px dashed var(--el-border-color);border-radius:6px;box-sizing:border-box;text-align:center;cursor:pointer;position:relative;overflow:hidden}.el-upload-dragger .el-icon--upload{font-size:67px;color:var(--el-text-color-placeholder);margin-bottom:16px;line-height:50px}.el-upload-dragger+.el-upload__tip{text-align:center}.el-upload-dragger~.el-upload__files{border-top:var(--el-border);margin-top:7px;padding-top:5px}.el-upload-dragger .el-upload__text{color:var(--el-text-color-regular);font-size:14px;text-align:center}.el-upload-dragger .el-upload__text em{color:var(--el-color-primary);font-style:normal}.el-upload-dragger:hover{border-color:var(--el-color-primary)}.el-upload-dragger.is-dragover{padding:calc(var(--el-upload-dragger-padding-horizontal) - 1px) calc(var(--el-upload-dragger-padding-vertical) - 1px);background-color:var(--el-color-primary-light-9);border:2px dashed var(--el-color-primary)}.el-upload-list{margin:10px 0 0;padding:0;list-style:none;position:relative}.el-upload-list__item{transition:all .5s cubic-bezier(.55,0,.1,1);font-size:14px;color:var(--el-text-color-regular);margin-bottom:5px;position:relative;box-sizing:border-box;border-radius:4px;width:100%}.el-upload-list__item .el-progress{position:absolute;top:20px;width:100%}.el-upload-list__item .el-progress__text{position:absolute;right:0;top:-13px}.el-upload-list__item .el-progress-bar{margin-right:0;padding-right:0}.el-upload-list__item .el-icon--upload-success{color:var(--el-color-success)}.el-upload-list__item .el-icon--close{display:none;position:absolute;right:5px;top:50%;cursor:pointer;opacity:.75;color:var(--el-text-color-regular);transition:opacity var(--el-transition-duration);transform:translateY(-50%)}.el-upload-list__item .el-icon--close:hover{opacity:1;color:var(--el-color-primary)}.el-upload-list__item .el-icon--close-tip{display:none;position:absolute;top:1px;right:5px;font-size:12px;cursor:pointer;opacity:1;color:var(--el-color-primary);font-style:normal}.el-upload-list__item:hover{background-color:var(--el-fill-color-light)}.el-upload-list__item:hover .el-icon--close{display:inline-flex}.el-upload-list__item:hover .el-progress__text{display:none}.el-upload-list__item .el-upload-list__item-info{display:inline-flex;justify-content:center;flex-direction:column;width:calc(100% - 30px);margin-left:4px}.el-upload-list__item.is-success .el-upload-list__item-status-label{display:inline-flex}.el-upload-list__item.is-success .el-upload-list__item-name:focus,.el-upload-list__item.is-success .el-upload-list__item-name:hover{color:var(--el-color-primary);cursor:pointer}.el-upload-list__item.is-success:focus:not(:hover) .el-icon--close-tip{display:inline-block}.el-upload-list__item.is-success:active,.el-upload-list__item.is-success:not(.focusing):focus{outline-width:0}.el-upload-list__item.is-success:active .el-icon--close-tip,.el-upload-list__item.is-success:not(.focusing):focus .el-icon--close-tip{display:none}.el-upload-list__item.is-success:focus .el-upload-list__item-status-label,.el-upload-list__item.is-success:hover .el-upload-list__item-status-label{display:none;opacity:0}.el-upload-list__item-name{color:var(--el-text-color-regular);display:inline-flex;text-align:center;align-items:center;padding:0 4px;transition:color var(--el-transition-duration);font-size:var(--el-font-size-base)}.el-upload-list__item-name .el-icon{margin-right:6px;color:var(--el-text-color-secondary)}.el-upload-list__item-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-upload-list__item-status-label{position:absolute;right:5px;top:0;line-height:inherit;display:none;height:100%;justify-content:center;align-items:center;transition:opacity var(--el-transition-duration)}.el-upload-list__item-delete{position:absolute;right:10px;top:0;font-size:12px;color:var(--el-text-color-regular);display:none}.el-upload-list__item-delete:hover{color:var(--el-color-primary)}.el-upload-list--picture-card{--el-upload-list-picture-card-size:148px;display:inline-flex;flex-wrap:wrap;margin:0}.el-upload-list--picture-card .el-upload-list__item{overflow:hidden;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;width:var(--el-upload-list-picture-card-size);height:var(--el-upload-list-picture-card-size);margin:0 8px 8px 0;padding:0;display:inline-flex}.el-upload-list--picture-card .el-upload-list__item .el-icon--check,.el-upload-list--picture-card .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture-card .el-upload-list__item .el-icon--close{display:none}.el-upload-list--picture-card .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:block}.el-upload-list--picture-card .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture-card .el-upload-list__item .el-upload-list__item-name{display:none}.el-upload-list--picture-card .el-upload-list__item-thumbnail{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.el-upload-list--picture-card .el-upload-list__item-status-label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture-card .el-upload-list__item-status-label i{font-size:12px;margin-top:11px;transform:rotate(-45deg)}.el-upload-list--picture-card .el-upload-list__item-actions{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;display:inline-flex;justify-content:center;align-items:center;color:#fff;opacity:0;font-size:20px;background-color:var(--el-overlay-color-lighter);transition:opacity var(--el-transition-duration)}.el-upload-list--picture-card .el-upload-list__item-actions span{display:none;cursor:pointer}.el-upload-list--picture-card .el-upload-list__item-actions span+span{margin-left:1rem}.el-upload-list--picture-card .el-upload-list__item-actions .el-upload-list__item-delete{position:static;font-size:inherit;color:inherit}.el-upload-list--picture-card .el-upload-list__item-actions:hover{opacity:1}.el-upload-list--picture-card .el-upload-list__item-actions:hover span{display:inline-flex}.el-upload-list--picture-card .el-progress{top:50%;left:50%;transform:translate(-50%,-50%);bottom:auto;width:126px}.el-upload-list--picture-card .el-progress .el-progress__text{top:50%}.el-upload-list--picture .el-upload-list__item{overflow:hidden;z-index:0;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;margin-top:10px;padding:10px;display:flex;align-items:center}.el-upload-list--picture .el-upload-list__item .el-icon--check,.el-upload-list--picture .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:inline-flex}.el-upload-list--picture .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name i{display:none}.el-upload-list--picture .el-upload-list__item .el-icon--close{top:5px;transform:translateY(0)}.el-upload-list--picture .el-upload-list__item-thumbnail{display:inline-flex;justify-content:center;align-items:center;width:70px;height:70px;-o-object-fit:contain;object-fit:contain;position:relative;z-index:1;background-color:var(--el-color-white)}.el-upload-list--picture .el-upload-list__item-status-label{position:absolute;right:-17px;top:-7px;width:46px;height:26px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture .el-upload-list__item-status-label i{font-size:12px;margin-top:12px;transform:rotate(-45deg)}.el-upload-list--picture .el-progress{position:relative;top:-7px}.el-upload-cover{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;z-index:10;cursor:default}.el-upload-cover:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-upload-cover img{display:block;width:100%;height:100%}.el-upload-cover__label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-cover__label i{font-size:12px;margin-top:11px;transform:rotate(-45deg);color:#fff}.el-upload-cover__progress{display:inline-block;vertical-align:middle;position:static;width:243px}.el-upload-cover__progress+.el-upload__inner{opacity:0}.el-upload-cover__content{position:absolute;top:0;left:0;width:100%;height:100%}.el-upload-cover__interact{position:absolute;bottom:0;left:0;width:100%;height:100%;background-color:var(--el-overlay-color-light);text-align:center}.el-upload-cover__interact .btn{display:inline-block;color:#fff;font-size:14px;cursor:pointer;vertical-align:middle;transition:var(--el-transition-md-fade);margin-top:60px}.el-upload-cover__interact .btn i{margin-top:0}.el-upload-cover__interact .btn span{opacity:0;transition:opacity .15s linear}.el-upload-cover__interact .btn:not(:first-child){margin-left:35px}.el-upload-cover__interact .btn:hover{transform:translateY(-13px)}.el-upload-cover__interact .btn:hover span{opacity:1}.el-upload-cover__interact .btn i{color:#fff;display:block;font-size:24px;line-height:inherit;margin:0 auto 5px}.el-upload-cover__title{position:absolute;bottom:0;left:0;background-color:#fff;height:36px;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400;text-align:left;padding:0 10px;margin:0;line-height:36px;font-size:14px;color:var(--el-text-color-primary)}.el-upload-cover+.el-upload__inner{opacity:0;position:relative;z-index:1}.el-vl__wrapper{position:relative}.el-vl__wrapper:hover .el-virtual-scrollbar,.el-vl__wrapper.always-on .el-virtual-scrollbar{opacity:1}.el-vl__window{scrollbar-width:none}.el-vl__window::-webkit-scrollbar{display:none}.el-virtual-scrollbar{opacity:0;transition:opacity .34s ease-out}.el-virtual-scrollbar.always-on{opacity:1}.el-vg__wrapper{position:relative}.el-popper{--el-popper-border-radius:var(--el-popover-border-radius, 4px)}.el-popper{position:absolute;border-radius:var(--el-popper-border-radius);padding:5px 11px;z-index:2000;font-size:12px;line-height:20px;min-width:10px;word-wrap:break-word;visibility:visible}.el-popper.is-dark{color:var(--el-bg-color);background:var(--el-text-color-primary);border:1px solid var(--el-text-color-primary)}.el-popper.is-dark .el-popper__arrow:before{border:1px solid var(--el-text-color-primary);background:var(--el-text-color-primary);right:0}.el-popper.is-light{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light)}.el-popper.is-light .el-popper__arrow:before{border:1px solid var(--el-border-color-light);background:var(--el-bg-color-overlay);right:0}.el-popper.is-pure{padding:0}.el-popper__arrow{position:absolute;width:10px;height:10px;z-index:-1}.el-popper__arrow:before{position:absolute;width:10px;height:10px;z-index:-1;content:" ";transform:rotate(45deg);background:var(--el-text-color-primary);box-sizing:border-box}.el-popper[data-popper-placement^=top]>.el-popper__arrow{bottom:-5px}.el-popper[data-popper-placement^=top]>.el-popper__arrow:before{border-bottom-right-radius:2px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow{top:-5px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow:before{border-top-left-radius:2px}.el-popper[data-popper-placement^=left]>.el-popper__arrow{right:-5px}.el-popper[data-popper-placement^=left]>.el-popper__arrow:before{border-top-right-radius:2px}.el-popper[data-popper-placement^=right]>.el-popper__arrow{left:-5px}.el-popper[data-popper-placement^=right]>.el-popper__arrow:before{border-bottom-left-radius:2px}.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent!important;border-left-color:transparent!important}.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent!important;border-right-color:transparent!important}.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent!important;border-bottom-color:transparent!important}.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent!important;border-top-color:transparent!important}.el-select-dropdown__item{font-size:var(--el-font-size-base);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__item.hover,.el-select-dropdown__item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown__item.selected{color:var(--el-color-primary);font-weight:700}.el-statistic{--el-statistic-title-font-weight:400;--el-statistic-title-font-size:var(--el-font-size-extra-small);--el-statistic-title-color:var(--el-text-color-regular);--el-statistic-content-font-weight:400;--el-statistic-content-font-size:var(--el-font-size-extra-large);--el-statistic-content-color:var(--el-text-color-primary)}.el-statistic__head{font-weight:var(--el-statistic-title-font-weight);font-size:var(--el-statistic-title-font-size);color:var(--el-statistic-title-color);line-height:20px;margin-bottom:4px}.el-statistic__content{font-weight:var(--el-statistic-content-font-weight);font-size:var(--el-statistic-content-font-size);color:var(--el-statistic-content-color)}.el-statistic__value{display:inline-block}.el-statistic__prefix{margin-right:4px;display:inline-block}.el-statistic__suffix{margin-left:4px;display:inline-block}.el-button{height:32rem!important;padding:8rem 15rem!important;font-size:14rem!important}.el-input__wrapper{padding:1rem 11rem!important}.el-input{height:32rem!important;font-size:14rem!important}.jt-drawing-row .col-left{font-size:14rem!important}.el-color-picker__trigger{height:32rem!important;padding:4rem!important}.el-radio-button__inner{padding:8rem 15rem!important;font-size:14rem}.el-textarea__inner{padding:5rem 11rem!important;font-size:14rem}.el-input__inner{height:32rem!important;font-size:14rem!important}.jt-drawing-row{display:flex;flex-direction:row;height:40rem;align-items:center}.jt-drawing-row .col-left{display:flex;align-items:center;justify-content:right;width:60rem;font-family:Alimama_ShuHeiTi_Bold;font-weight:700;margin-right:8rem}.jt-drawing-row .col-main{flex:1;display:flex;flex-direction:row}.jt-drawing-row .col-main .el-input--suffix{background-color:#fff0}.jt-drawing-row .col-main .el-input--suffix *{background-color:#fff0;color:#fff}.jt-drawing-row .col-main .el-input-number__decrease,.jt-drawing-row .col-main .el-input-number__increase{background-color:#3489ff;color:#fff}.jt-drawing-dialog{pointer-events:none}.jt-drawing-dialog .el-dialog{pointer-events:auto;position:absolute!important;background:rgba(5,45,155,.7);min-width:280rem;overflow:hidden;margin-top:0rem}.jt-drawing-dialog .el-dialog .el-dialog__header{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyCAIAAAD9fhrKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo4NTc1YTY2Yi1hY2U5LTUyNDctODM5MS01MGJjMjM4MDkxMDkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDY4MTUxMzk2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDY4MTUxMzg2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YjZlNTUzODYtMzRjZC02NDQyLWI4OTktODY4YTdiYTNkMzgyIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjg1NzVhNjZiLWFjZTktNTI0Ny04MzkxLTUwYmMyMzgwOTEwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Po+VQtwAACdUSURBVHja7H1bluM4kiUMfEjuHpFZtY4+/TGLmQ3MmTMbnf1MdUX6QyIJ2MAAAjC8+JB7ZHZXh7LKQ6IoECSBy2sXFwb4/X/+X2FfEqDv5dh35mXeC+k2CzD/+XfxL72BeVbv04KI7uP6ByD7pZTy6ToMnUTwv3f7rgWG/cNXrhz7AcVtUfOiwP/kOg6mLGRVoq1JUewjsAoLWJQ2RdlTg7CD+y+eJW3MziVU1dfK/wV2LIhXJpQJ/nQhOUFWWxDJRYjnwnfItkB2Z8w/yC7sr9fnXpj8Y/9d27hw/2D4zm/0/4V92EcRtq+bMP9J+AX98UdadxN8oy/D/tXdBeWAvsBQM7/FvwklxzemJ0xyfrflu6JG1T+Hc1mrhKEA/wfTQ9BfAD119x9Ca2R1ZjuEqwdq/Kb7C9vO3oQzZJ9AKdAzqDuoGVC5r3r3j8Gp62XoJaT9g3WBDK3crwwIdfB+mxUmyJP0HXNGAj/uM1zNQWTs8MChMOvJEQYMuDxdepBAQGM7810t2MHIioItnEqwbOx66GBadMSXHHQiCgBHFmDV8h+rJcQPEUaLk+WIFi5YDnyQXPoUs0R+oyTfEWvdkKFaskPYju0t1RLCDrxM/luoHejIm+0qbZ9g6+P2/snOBWDRQVPAggLOgMEBFRh7PoY+DPaJvUIYIvjeb3eG9b39tH6zFoL0Q9eHzVt6A1qOKMdYE7cD+lsBDCtdya7B2QINBEj1YZqMxSAwIKL7J3DVdI0WHbWgY4HdyIp2Z7d+lvreTa+hfHep/M/ZhZS9Gr7pbthqXsmtsdXpepS9MHXTi5xf5XIzX3XXf/tfBkmer2MHkPKdGr0SOckyXGzoO60IYIGBUcEdYFZKSuikFMBLT7pxQprYwXrifAZwtfto3pi9bVEcXVKSVcKtPYT5lSnMlOAaQMKKUobEv2UXF9a7kx4vbkRWnGsxAKxnAIRnrPAtg9FFYM8l93Pg/YA9A31zZCeJfOOBv3znykOv2KG6W/YVpu+xtlHUjlvWXGzu3Dqd6rflx/ZRkH+0vEFofssYCXAbtSNB7O6gxylGfNhRGFFJOdT6jbbFR4jEcHa4EqKrlkOsD2LKs2J9AlGKdVtucv4I9TdQpftrrH88BUSO3QVHI7RaboRWiJW7zy+zoW/jd4Ie0b472y+Q2F+AwHXuXv79f39/GiHr3pCgXQpSxaMeYOx7cxYGBHIKkHIKQhxJ6MOimxQI25jVdWBCy0Up941DSE4JAfKQtUURDcqawrT21YUUnVHkUVoJfByheE0DCGLysIiwkiEX6zwZctkHb3JHofU0ivee7aJx/QoxOTT6b2OVMCmE/0RU0SctOfsqnOz6rS9KszI5Umh2dJHWNjsFXSsw+7nIcCEtKuys2VfILxcWwIf8TdGrI3wxQpQHU/zi5JEjD8HWclhMxX4ecMHgi4ZesOgyBGsZWokCrWD5kPM9otXwbOLK9OphesYiOWvWFA3qddNbivHFc81iq7r8ZrrvJ2Jz/zjuRqnuvQm46rtmsFO0Yaql4w7U4fH5YuJD+JiWsB3Dj9HRYdp0J81LGE7nySMmPZfxflbAemw6wGW42RLMj+bZHEtcL1145NmiPEMWGKmNAwOMkYchZyaenRYiWmgpLx0xcGfXrjwXdMw5xSG/3ZJ/5LKXa0D++I4+R9gKVwwtuVrpNzj6HS7syt/Fuj+E5ghJAAblHeFxG2rhzyWNfgRrZ2HPNDDCVjQm2P4ltPk9kZUfRRmssXRMgzGIhftL7zdCpBuClYxYi02LC7KWwK+JSH4Yj5tEhZiyjLwfBaiq4lSKGonKgzUBK5xdQr5C9wfT/5HCfx5vJhcRkQtYKVrN77BMnjtJPT5pGHK4LCCKHSBidDe/rzQt2S+7CEINL4bBsX7XiNURcTdot5/18NIPXVfiFK8GNB/tGZYhiWBSvt/n8gnN7+9kEccCJSSH4Ai4fsG+stU3BzDI+OEPMS/K7GXgz0foAf6wgVkiYIkJMk2F7/NimBayADDClrZIJDCHLUQBGTdCcKAsPXcKWqODsqABuJPFJApGpx+sskHE20jmINK6KFuAbxvgmR2cCoTE3le5KAoeODNymG7ZKP/IcbdjNrEZTmzVfzMaySEojcE3QeokTnEoYVCFCSxGAT4e3uCU7i/oxMokDCzQKq8MFeTRyv1OquEZoU/pURFgisp1oFhnfiWaxgYCkkEGH8SZMJDi1kBadlvEEcol+x6q4tQ2TwMGw8ClHzF2snu6vN0nFx4mwOUAyILQNNPY4tN1WKUeKDAr/Cj/Cg3QPBnMmhxm4bKoD1PUSML8SmcCZmCmC+dUCwizumlWobYFbEWUs3o8psoXijTeElqsCBeCVE+4wFcEIQsVg9IZNC3hyZhgI7AY1LUVv9KWFJhM/SZioY23iHN1O6bsJGd2lS1VZra/AzY0/HatTsQXG6Vl75MOhoySNjhIHlCzvq6xxMEmVCXH4sSms9wKMmLFeA0bHMxEK9Nl5jehZrEerTM8BUHmaIU5WvHzCvWW06u0NC2pJSZohXJQw3eUXfOZggX1wYMwhn1xU2EfqjZfHYhv1/F9MhGbZjw9xIkrAM0GJG6zoUs5ZhUHRR+PhWCKMGscDDlaNPUUgzcf9+V6IUVLJFSLUSp+ahC3m/9f+v6+UHDoQ9EYCAewWu81rILXyrY4cYMkdHfEyjNNYONMPOLDVd3L1MqVeWGmSqVgiyJ1j2AYptSYtACA2Haz94jN1gOprhSLFbEThhIAErkEIO7TIkOhwPA3+6EQ9cNhUUnEdAvW+0A4SnYdmCiZGhdwHfZCkTMpjlDZD9t8KtlFp+4ATNSuyJjcc1T2KC/rOGQmtIs04uc7uC+0MtxK6GVFFei14VY0QFiEfZipdpiVCajl/RXU1Azi7DaS2HoCRNzlVOmFzTt949XvwlMlKqzoWYnqZIDjZRxvcrkZJiWYkuUwa90NDUi836fn67h2X4dZWHKi+JMANJIMWf1tMphlbj4obTFr7GjokGNSEo95LMIUtgAvfTct2haFERQgYAF6FuMxCDzaoR+rDvQOfIQc+6Af0XaCFPjWYDvV+pEPVmCizfvxv3DqfqgA07sb9sRjARdgfVS/UoLHR31svBBwn/aHa8WPlf8Q07rh1pM6KZBHytXSMB1cx1z+YnQoFYOygQjMhB6RGaZ4ed6jkIRgmuNUihYrWg0erdoxYM7+AlotFAnqZQUxOej+2QNfDa0QK5aOiFZ/gKVp6eGTM9Xjt5UJihpdrYfsFbjKHxWHAAtqStYeyUKv0Zj+dB36DoCcpVHAQd+DV2xaFnz7mEyIZ5AmpeWV2DCQHS8rCcOzDGaZkI7uDmEW6Vl2FBIjI8mU+IxFetgiRZ94n2LUA1Cu5peAm8IjUgA17nnx7qqIXLGXeG0fU9sHYm5eozMNJg9kmldiOsn516qC4TGjS/JgwEQWxYY0iqWqDbVYK2tnpddKJPeCl4O1nbG0TImKmSyOdWJxUuXZ8aFMVp9Ej6/7G3MWUIv4ivFELH7H+UsyIBf0b3qZzt8NmPC1TaiKLlZBZkuDVqjWAcFuxP4pRSseyWJlWNAfjmxQ0ysQTcvFdX6t1OW3fMyxQZ8OhO/YstLtM6xtLEuCAshgEkcDWXbo0KBJMnDDBHIb0M3Xceh7mQwacg0+CEAx1lsDNYN1Xn2nb2/3ZRz70WEWRHaUR4jZaVgY6SU5/KdZRRjSvDH7wUR/wyCQJe/bWI9WQ66oka8RIUMAiD67YDFksV6ira3UD6E+BhLHBDBvIomCE4Ij1vigaFbY3hh/y0+zRLBsH5Ect8nUjo0MZKcTY3NMj4gN8QsTXplrzFgPUhKvQC42p0JVWVobpxjbWiFNWrOVzmkIYhEAZo4EZw1dPhC1R6sLmv8hVAc9c90qPTUTA8r5DbQSVZP/GjF1epXYGSVtaZen4WsHsA4oVbgl0kc6Zv8MUkrrRZiUghSzwqGUJiv8FXuac4NxxKuCWVl4aPe72LlE93mxCIP3aca+uww976xHYMsAUkeeMhMeLkyLYtw1nUyUMAQdmVGIFpPBO0g4R2YchsTXtQ5HYsmngY0JZJxLeDK4WiYgC+fdxvVvwTggMW/7UNmF6aLYjuxYfh+Moj/E5p55rzBy8Ky1MLkwfw85ugh+UrGqaRzBL0V5IhBHNzBUOF6ZFmxhJU5JFHRRM3ChyKV0kUlOLFa0rZogBvpV6joCVWzqDCw3WO4GrcRqtnrScvScvDaMkGIU307AZ2mawIo1awW6/qJ6O+aYjH4WV6+lTNQC9w0w6wvqdHjcBWqerHwECq0MDzS9ZobJYgp3ZoEnSuZBcrPB42iBJlItZM5xfmUhkhZYA7r+Ns3OFzUtNPPIY9YGbHE6sApMvZ1UeafpRrhq2SH049okePiARMLw4lIAL2+CwGAYxSihQxwKTQbbgJ011EZTEmoAcVQxzo7wY4eiFo1gHtIhYh7YAVblTxRYcehAnYwgYJPwM+kzfx/tEsmbvLbpr4oZfuifDeysoer+wvwnDfE3g5u8f2Y6OvPclsyljPKCkkWRoOhyt0DFXZXSGdcXlg+DVqFwsi/IIYw9J7/dGBB0bUfdOppvqEVuTGWiVfesB6ptKwKsq1e1GL3p0jrAsKLWzW9wLmPhASeE35nG9WiqItzmmd/LBLNMQDfRCRPQ+EaZ+rASfYYNLNJbwiwraaEdXnHOCRNpMmBKzYIJT0oIlzWoyvuiHacOdxWCuB4mzMTJW4nOFWLGCF7pYBRzKXD+hWGnAsICPEM6oue9W7w34THCvTHf5SxZx5PbDz5Rsb3bkXrioYd2qz6lnbIYjShoVKmgi9b0acyIp30nSbSGrjL8V8BNIue75mDYkJoCoBDxkSNW5nLvo5UkT/yHcEpO6hwL2K/6b6K/rA6JClDhgYaHVVfABnj1BzlU3XNQkqzcDRBVGYrdCFTgY55pvJYZHSJh0po8oQ5ooPSOlkJLgAp6axDxeumtFZ5uyETWCXwaRyjHgJyzPM4ByglXJ+DSy7stAeIMU4xhIvg5oOEmQp6IghEBhBBCCREjx/wWOgTiJ4pMiq8RaEgTNZz1JW37m6pTnOEMhMGmEWx746PGmkdk2WzAZ2e0HUuUryBUVfAqQS3wF9nbSLDjc4MqlIr7DxjsyOkN1OIIEUppw7Qh82okgSd/yKVfyflNqpufv5Wq7KsPVSJNZh7Z3Kl8TAL3BpMfe/WfuvEbnsAc19ZJ3yOZ4ccPa9bkGBSAyZIjUtBX/3qCSpXRw2yH3lK526Jc+cus3jWNQoJzfmKpH6/IVRAuh1n95CxagkndGI0O6wgiJBHOqnuDV6OK0EzkdlAGupzeBh7lpHRZPLggxqxRAn+AFlV9KgcF8W0sOGhiP96yP9no8djVEJsUoKQPmDHcAqRSllZKQuQ5IPtCJ1JOk5ujcs+XC9A0KU1q9o/VTnWJqFSyqhaxstbQN7ncc6s741ZU1eEbTWbG2nAg7t2kDXp1GrCSYReoh4TbjyYW9jByxNUW4kHP43BfFhqP416H4KhEpOk7Gp+crbROtZpsy7C4a9/d7Pij2dcAzjtSUVIyACiTiTCsCFFXZxX9SSwmvgRgNIrxRwZegXn5CxbAy2teXCjn/IsBNwsMRRxQDUOWaazPGJmom+MqTKe1s6i5FHaHXDAxdjSfZAefbdtjO9sqRHV/qPgudmgjxqmKUNGxMm6CdUcRZrQMc5BiGKENBHQOrbASVWFuSk06vFYWrRYvufc2Euwy2wH3WGEWikZzAxVl0UpkM28i3HVXbcvPoRMrcWc9Kj/+9Dnnwzry5IQ2Zomq+LXyF8KUwZAheZ/mKOMB8PDQORWeiJJBMhWw9D2kwz8UgUthMOtu0MoG4d450TtbaUKpMoWLcS53LHPwsTO332b+g6hkIRTBMpefgcdqq8GCtTsoc/ghcNMApn6FypjgCvIC6mmudjnLKennBCU5ecQjT1k8+ZOW4HWcNmI+Oo9lbFUFstT/WTHxYq4cYTcSt0KZKWIlXytN8zZRFFlDPfe5rBK4LghdVgBmDIuK6pwEJnJraMA7pMnMV+2n9TTQCnG/gT3Ok0+EhFsToUVNzCoHiZidU4LBLJK0bjQrMEkesMIWwEqOKAuqDIbPQoxnT1X2OLVW+O4+WS+ozWxDVvih7zvws5UxyWNTm0kQQjea9oNioudYbpVKfVJ8XF9wR3Uy5TKQMiZrMU9DRClg4335nYYGSgFUmkU546r8Nkxtyaa5ZGUC7Nz96v6t7aIyKbV+lPIn6cDpVgnVw7X2wdzqpetDXylyYdkVOWyl7CiOsl3IyM5mHdVxKnMMrKN4s1wMWik/zc9wn6sFvtKBgQW3S6bjmKI6MlstCUtMJHZJLvZ+jLkLt9Fq+/nBc5N8FrCwkavveGBYbC80+FWutvP4ZCfHt/uEGvPgyB5LUeIr7CqD+QXbKgY3zR+DiQagboasadPs1IfWhmcNfZdoWJlchKkRwu9mqJ6JESfL+9bWHow/btoKBPk+72+BOsYLBd51EHP9CZ6lETMuloBYDIErwyDVprDdPrI5vVgkOWq9P/IIPVjO9semovRogYjtjRW2VSFVWCN+WAwL5mN03BNwNWhFG3RuW03izAwf3SieJoeUWHO6CdU/CWlzOeRDmY0AUGS2We2Cyhx2HHEzR7v8roNoVUrseKxl7KpX+ABgcR4koFQNEsxqznfnuVFCT8x+yNKzZVZk5hd9smb5vDLMLs/dAbnt3v4ldjarkAQFsOEVcbmrWrTL/mS0ye7vk4rPniwNRGqPggihMXrlwI18HDAHKEhd2lAMswtRptvHhgiFNcnpSBIF3EztUOYthk0hbEM/2tCnWukcoK277Ra7e5VEKyVKYbMSMQNaBZ5SM0FoDXp4sjmOM3cw1jTskrqhz4bqDi0RHPepCVVZYIiVM6P8CuPzmuU9y7EVjG8t/MdCad/RCo6hFZ4OCc8PIO8NG5eYdZvUnXIuhPAoWpjJDHXpx76LFwViGJVJrPlIov/e8CE7P9qlVKYg0TCudlDJ8CZNehXwC8Is1liLkGwP02uHmIOsiIlmipCk9HGJIidpYV/AChAkOUiTjIgs711mCYN0lLNIQ1oLlwW3rSTWxNp2URwUoTEqB7VsL1D0lXTkBCE95W37FbsgmOUmbJAsgaK0QebyFFZOByu2hyhKlOGeaKf6ZMRHw4D9C9lEcTE8S06vujcIOKSzeEoZqyqHU0NE+YSDpDmD2WIZ1K5VN/3Q3RNl46tEvXhC2dyXT/FhDasJPznuiE2exakWwywT6H3cab5OktvXN8K+k7Q6Tj4jmvdkyJNGBsnMZz2YFj3Ns7K4YOK5y2BFdxS5vsZM862Hc8gX6JKUQvZcTrCWJXthaQCAz5CJxApZsIciW0YIc7isdKZKVFjLebCT/a6aL6GWGXd3GgXUdJzyPWw0zloNoWa5Fzmgi329t9WxzgUplVwCmOdbqIANf5Dod+gvdtLMBkhhbXzAcy8YoAfKdaUXsUw03a9/CtOPMZsSVD/v5DsNF4NZ3fSHsGJWUn2tpDIHUoRZ0InD8nqJ4J/0pRxjWHjU0d4IHDDDLEN8XJaFJE+m7+WDW8JnYzA7S7fHx/j80/U2zwawHFEywHexqSO22l8ZWjKVyZRzV2omHwYKkSZ9BagkFUe+gg3E7HcpdeISdAWReQIErmQlEnLE3Gya3iMv/MS3x/cR5+1U+BPK3H7I46Z81p6+k/OxQujxd3ghkVsqaxaVB0Eqe2Bo0RHPwndKqqdMgW+yWwwVQoBK1dpQxeynvRq/Ww/qvWCUKOcPA4uqt8FsKwzcGhHG/cv+IGDt+WgSHf3Qz6O6ZEiKiQSVc/1DYByr/D0OPVkZoKmF1YplUAVonjS3ZVkIXOzSXkN3GX1i1Wpa8SQzShYJWkVT4X1Wi8s8k156nhVUlOv1IE+7VxqF0gm5KVEFwGRr1jSgblKqDMtycnTKCYXHrOdiM4dnS9jaaGDbrvcjVqwjRxENh1ruvMIkC01xZXErCMIKVPGWa5q+fpdEW+J0nJyLYK3HJ8I5YRaSt/2D0vVpO25oMCtbpWYTp/hhNPQ4fpMTgLpVfrvcpV7IimXqvE2jTyVmOOxceSQkPB0bhmtheMq83OcF+SoyEH95HbqrAxcshr22YCsSk2XBm4nc1LryoCnQzabO5ihB3gqbwa8piuA1DCqloniZHymP5yCBLpHYqlBUkoqKQn7HjTpCNjdxe07fWSfU2TmJu213e4mn4673I/U5mPm9PtbHODSyYBObqCU2+EbT1uCm/N0Is9zKXfVflzJ/VhqgzczXLR/W9X4HpZUT9RvCXAlVKcBKZTBr7uJiq5we6MWEjdrAljkEdIemamJtXtmW2vDJkPAx3T0Fl0Vpw1MmZ78sVFiyTQ09raZTldghs97Uqzk5CV+vdIfQqu8SjZytiZPKQ9kzdd3bxICGrPFlXIJ7NZtIA4xUlY2YLQ+RZrKCjWud5bfL3sY1Lb4+KPr1arCPkvI0o5qG36IeFS0zmIDOhFrdRbQTrOLm0hhIijjYbDAa1NQh6U0GB7cEsupEGj+mQY55w9+Wd9TlUdFimbKu92FniAPxAUf7YwyrETqJzdiwHCo2UKJMGOgn5XGvlX3XSfl06Ya+q1A2n4evrulCSMsviLstyolWPZBoZTX7QqHHVB1PleCgYZmazospcEGsqeDFslIY85pm05DrRIyFnGno1zDBQf4M2EjP8cCz5fO9G35m+X8BWNXPBkUtrKqB3J7PO0cKraV+050yoda6jncp7Vdni7LPWl7FADC909ChWqR+FR3BFgpZ54QNW1l4q4dn4hKL85TmR5XLjXyS4zMdt41Wpy82PgBYZ6bLb9vfHZTcbLKXPGSyb/uOsmX1UlbCTN4OIGUUTJNSdIh5nZloE4f6RMkF2c2MEal2HhoIha6TmgMZLBJyYmEyh4L05USswqegGjnklzcTs1p3B44/sHiEA5sL11eZelWmqu5/ZK345orxj76gfeiNyYQHw0aWB34/LK3pXFk3jhEomKck6HehFeUyZpLWIe+431XDKAbZza+gZ1vgm9XI7OzCwzjFi9X9BcDZHWZRRA9mY3f/Q/SuzrIJzQcHOg60gv44MLW+qpMsu4lWxpkWytvX8JTaAUGPVjG/diW3ZKbVBPVn1vo+LbNPwWxiwKdxoOmH22pXJtUzVFpIYrcqmEi9YZgDZco+sSRighsgdtOmQyaOQ1yTFFpaSQZtojqvqJiXgmxjdVXBZHSKz9sJBB8gtka2Q2Uwvz2T50S2qnLWULtwTGtbXTMxmdBbu0QHKMF2KpVKYFjrnLEeIafVTSpF4Vg3tPVEbFaHWkuvhu9SvIKdxgzzh8EsNbxg1MiwyYGwgriUV/7yrfNDh8U56lXS6l+i0i+OORjw6ODgkZDwXARQMqN50WsamYokj26yyxNN0gOBVb26mNaTA6JBFn2b5yBaDUP/vGr2KAAqFxfaiqmFuHnSVgXLGBmnL1AfWhJ1CzqKRk2iEgk5LysXXqjhWnEfYGM2S2aPxWxNp222EYxumoVFNYnmgUlBTQ5X3DinJCazTnGr8Gq1N/bE0hNbUiRo3sdC1cYd6G3zOJrZp/6gUIskLWhL+yV8+V1BquGbFNKuz2xiECdpvawZrNp8qv7coL49WLuDlMtH9daa7WCo3PBijWAHiBUbADuFWUcWoajj04aehda78GHgJNONg2nIoNXQPV+GZtNOO3nJuQykGGL1MS1hcayL9UM0L3uJGmn9tc3DdbNJnKHiVQ2F5E0tXdXmKJAxRoQbD+forirjTcECT8RzefV2Ap9jfOin6UWHdI1Thi98qFolHOoDkCRaeYLZt43RRr4GDS2r1S+pAlU3SDTwizALSYanoUOhlFR/iOHJurTkgcGFgsFBZzCLlkxf3vMUo+tk7KnTCw7fRHfRZXh4JBh8XMP6xEtR1lCS2JM6MBphut86ILg1fQxbQGPAS9tI826Xt6GpmTZpHy2fkyQ2SDt5uawmbx2UnXmenQoGdcjn+dmrpyYKrYy5w6pcCXfVQww+1a2ui4fUzUPyT4KPWJH095+HrX2SpSK+6JWtT5EVDnztyXz1sc9VBvER2N0FiLRYks8NBHQ81MJ2eZVy7EKE0i57o0mUn96sDP9sC9yoRusj0JLOVOA7CFXjerq7/9DDM5Dj4euxZQ+wiuG8xrfxtVjX0ryoFiOTkhZtNvRquxwhapqXAxdafpXSgLrfdlIaptb3sBHrVfwB7GLPBH8+dG3oDlUU8ws0ayhWOcuJD1ak5nwAYaOVAx7puzvi44EYP1mlAo49Dzf2Sd2bmKX4hXOaQ6N1NNa/SD+2ltIol7eoD0VUq3cojT3iQcirajqmdvNdmqZpuJKVtHD7oVWNU8nZAHJ6FZp6JSzW9jW+RNvXSdg1oSUtezC/0lhkRfgSNkWXUiNTzeoaIB5F+UcZViM29AIQpa8yYaBuNva+k08XP0Nwo6OCaA032MWi55CfyBT4fLVzbtLHbHuIh0MYwYC13S+6EbXBtk4BqbyYS0pBs2jEKNC8SblJO2eLmyu+PUZfHo65Ho7IPj8N6EvqeTz7YO74PXB8bPbJ0k5fy6jlJS39TxPf6f4iBGzDU7XZazni+BuN9Nn8fLTU4E0Jg1mmQISj15P7J8iaL+X0B+i53oDVvbstNoXWRZTDcY+ilXl1f/8f/+fQo7uJJS60x2kitEJs7mxw6sUm/dwOglrfart41/stHsKU9Xwdu2q0DBUqlNeZbPcktCFurrN4dBvDISzoVmNqFWD726zc/6KWpn/JF+7lLMd16cA85MS2nrWj5KAd8gM78bg+utLy2fuZ0pI4GhkdLM8y4aG6U5sysSHA+cCWfPVCjiZidQXW+og5xI26nuxESFL6uQcPoDobZ1biN7cManQtFVWg8bu+f74OsL1OQftbskcEp5WdczN23ZMpsFS7anythHMT0X9MNDs616NKqo9Qj4ZbQNZSlPJhr4biDq1blYW3B7D+1+vLEOpAXFwfIdWPcMSGhEQ5ZPSC/bOQ/S5C1YLNTo2/CfFKsw4tdJKkZYf2cr3piOuV3O4dXn43PIsvWpH92ESOAhfdf3My3Ofly/7Q5awjEdgw0MRok9bYCusMulyG7skPCDYDt3ZU6MJA5Z1WNk9p/3Tpd5577eeGKertvkTRih0RK1DUQKeaAoV7UAK7T+m6hgWNFAK/wOunw9ODPOtIqZtTqutaLrm0KNQK8hCeOwtSzUnSIncCtX/rVl/U5TdaE0wcwqm0E0h1+V3AD1OOKNF5lbToEHr8rkiGg58PWO1TuM+LgZKNLiMNWo1+hmBDmm3mXLZ/5sVFmhgKvI6DHRDc66hY84zbRXTephmx6kwvbnViJoQWfxQbcJaVcyYchlN949c8wv9UyIbtBz9ugtg2sKGVtG7/VG15aLcyZHcgBeqN1qAn3jH3t3+o4beiQDzYuAxxQ+i6+U20GKVe5O0fOH5HK379fMAqerehVB/TdPcpXCrhonMbXNIBwRZXrSEXUk6r5WOKgNjR+mDjMMidltFAAeu0IutWGcU14WKbaycCaGvZLAH7I0rH0O0Xk/oLkQmOjR5ud/At/wmeePCg6u7/BPWih+fcVAWHRjN090wJv0k1t92B7Aj/Afgtc2kdfwiauJLmBJsCUbVmi6+G+PEFoXv4Qds/cO9MMPV2CzFarmqtKUMNuDiJ/fgQNUMujWiIVZgeKOyA4MuVkqrvx0Glux1dgtPZ5oqAY0/JDZ0bjksHtWRKsF3j3Zw+p3EL/nT+Be2nAB77yfbHLyz50PXBnbykR4ZNTtPhHdGAco3ioofvO/2/UQwlDrx0BviEXjkBTK/QKcwA5ThmUYYs2U0/nN2hqunZZX4mikDlg+HhOcBy67+/TxPiltA1kNvAgstDUsuiVHRa2V/0fWfQSsIBbKrdYFLBDMLyyR01negw48cDJwJnpIttgBON9RK+WpT5E4Kl40s6f2YtQnGyKPyiM8SvukxHi5LLfVWgilTLW304TAQ1+HT5m7z/sHYHl4Dhw3Audflet1Dt1Ra7UV3/1q0FNhq4XvqPf5hDGDb3AGYdsDUEBEVhSArFaLglKhta9e3pIuWBqtQggjSmSN/sgODQPz8NUC5ceuxKzrZAvfEQ3C0Pzj8K4Iv3+/X6VxK4HgG4RgMGJIOCgRo7DAe7vy3GwIHyMZh/9ZIUCJ1N8ACn6k9eDvJPXIJ/onWSZKqgSSrDqc51wtagNL7ZjFZ5XdOEwmPfv1yHo1ZlzMWg+7x8cBUf8DoOmWZfzrHYuMW3UOCGnWo/1sDTcIYPNesvgK9treVsOAQNEotbttctblhmkoF2lpvqQbEotrry9cEz/dLkNp9nsrsOr/p2bSM7ZdNXPZDREdZJgiG/KGlk/yHwe1lgC6dSEHRDh3/YqddNKmoN8bMaf09yPHw+JAwkBbGd2Mx2WwMuT2N/JlqL+66L6Ni5x2FlwKeLHRA8pnyVtz5RwfCEHHTunuNJV+fGI+ULYjc8GZKd9ZufNdTjsXL2AkKopk/HM+e1a4v8OZHzTxjhrfq27OQb63h4SIFyQ4edKcRXuLOSfCwQT/Q+KnAFwbfqLBGPlHN/+39qLAYoHwYscwjDULKZzOVOkiT2YV1DsFlSs0KLxne7LkVS4MXEgg+OgCbzDc83lyPmg0+kJv6ijgH/ncLJv9C0keXi+vk1x0eLIlOVVqcVqKD59M800nf/4ewOlgRZSWv8LSvwoP/TgmDfTT/EhoHWDVDqFzV+O4JZWxqWpjAwGaqrXyYJ3wy56rozcU3cycSZbx+TinmjaT7zt6dLZRJPK85IX4YPvt5mrfVfoBnBA/X9RB8+wjAOrb/0ic6En/7JLh3ELzovPEDpML28eIC2HrsAcNa39VgDjApU/0AtDb5gdwE1gYeYtUDZafkIcbMFDrBMsIn1JjaUlJdiFJsuLVrStQVY86JfOetpMbSuDS4HOqjhbm+3iZ/KYDX7TsJDV4eSZL3f5p+COn8F0ok9XefX68+hd3AcVfBPq1TzK5rEBwI3nOXtBTpJNe+vJJmjih1ruQk3G/GBChr07A0IzrA5UcmAEc2XlP0G1DZF948pEb9bL0OrXi4jwIFLCnWN6e5EK7/rZbBTDh+6gYaivVNSK/VpFMIvw5gvPSb+Jf3i1+vPu9rngHEn7pleBU2I+W3XWV7JvQNyuf7eTa8kw4e4Z/pheJAev+8UiHWepa5/l5OdwbNNoG7/EON3sqG2GFK5JI9hKNOidq8IgctlAHjksUPB5n3KNKansb9eBmhGyFsAobNBzPI3B1dmgD+hDVeHun69/lWZGZ4Zf8RzrW+zYC9p/a7lA1owOFGJZi/HAp1L63e3pMU5LyBITVOvIUmyXFWpbNYaC7WVAcr/L8AA+dSd3OMf2BsAAAAASUVORK5CYII=) no-repeat;background-size:100%;margin-right:0rem;padding:6rem;text-align:center}.jt-drawing-dialog .el-dialog .el-dialog__headerbtn{height:34rem}.jt-drawing-dialog .el-dialog .el-dialog__body{padding:10rem;color:#fff}.jt-drawing-dialog .el-dialog .el-color-picker__trigger{width:120rem}.jt-drawing-dialog .el-dialog .el-body-foot{position:absolute;bottom:8rem;right:8rem;width:calc(100% - 16rem)}.jt-drawing-dialog .el-dialog .el-body-foot .el-button-group{display:flex}.jt-drawing-dialog .el-dialog .el-body-foot .el-button-group .el-button{border:solid 0rem rgb(255,0,0);flex:1}
  43512. `;
  43513. const _hoisted_1$1 = { class: "jt-drawing-dialog" };
  43514. const _hoisted_2$1 = {
  43515. slot: "title",
  43516. class: "header-title"
  43517. };
  43518. const _hoisted_3$1 = { style: { "line-height": "24rem", "font-size": "16rem", "color": "#fff", "font-family": "'Alimama_ShuHeiTi_Bold'" } };
  43519. const _hoisted_4$1 = { class: "odin-dialog__content" };
  43520. const _hoisted_5$1 = { class: "jt-drawing-row" };
  43521. const _hoisted_6$1 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u989C\u8272", -1);
  43522. const _hoisted_7$1 = { class: "col-main" };
  43523. const _hoisted_8$1 = { class: "el-body-foot" };
  43524. const _sfc_main$1 = {
  43525. __name: "CrEditProperty_MilitaryPlot.ce",
  43526. props: {
  43527. params: {
  43528. id: {
  43529. type: String,
  43530. default: () => void 0
  43531. },
  43532. color: {
  43533. type: String,
  43534. default: () => "255,255,0,0.9"
  43535. },
  43536. outlineWidth: {
  43537. type: Number,
  43538. default: () => 0
  43539. },
  43540. outlineColor: {
  43541. type: String,
  43542. default: () => "255,255,0,0.9"
  43543. }
  43544. },
  43545. showDialog: {
  43546. type: Boolean,
  43547. default: () => false
  43548. }
  43549. },
  43550. emits: ["submit", "update:showDialog", "update:params", "remove"],
  43551. setup(__props, { expose: __expose, emit }) {
  43552. const props = __props;
  43553. const language = ref("zh-cn");
  43554. const locale = computed$1(() => language.value === "zh-cn" ? zhCn : en);
  43555. const {
  43556. proxy
  43557. } = getCurrentInstance();
  43558. const predefineColors = ref([
  43559. "#ff4500",
  43560. "#ff8c00",
  43561. "#ffd700",
  43562. "#90ee90",
  43563. "#00ced1",
  43564. "#1e90ff",
  43565. "#c71585",
  43566. "rgba(255, 69, 0, 0.68)",
  43567. "rgb(255, 120, 0)",
  43568. "hsv(51, 100, 98)",
  43569. "hsva(120, 40, 94, 0.5)",
  43570. "hsl(181, 100%, 37%)",
  43571. "hsla(209, 100%, 56%, 0.73)",
  43572. "#c7158577"
  43573. ]);
  43574. const title = ref("\u5C5E\u6027\u7F16\u8F91");
  43575. const dialogVisible = ref(props.showDialog);
  43576. ref(false);
  43577. const color2 = ref(props.params.color);
  43578. const outlineWidth = ref(0);
  43579. const outlineColor = ref(props.params.outlineColor);
  43580. updateParams(props.params);
  43581. function updateParams(params) {
  43582. proxy._params = params;
  43583. switch (params.id) {
  43584. case "DrawStraightArrow":
  43585. title.value = "\u7ED8\u5236\u76F4\u7EBF\u7BAD\u5934";
  43586. break;
  43587. case "DrawAttackArrow":
  43588. title.value = "\u7ED8\u5236\u653B\u51FB\u7BAD\u5934";
  43589. break;
  43590. case "DrawPincerArrow":
  43591. title.value = "\u7ED8\u5236\u94B3\u51FB\u7BAD\u5934";
  43592. break;
  43593. case "DrawGatheringPlace":
  43594. title.value = "\u7ED8\u5236\u96C6\u7ED3\u5730";
  43595. break;
  43596. case "DrawClosedCurve":
  43597. title.value = "\u7ED8\u5236\u95ED\u5408\u66F2\u9762";
  43598. break;
  43599. case "DrawSector":
  43600. title.value = "\u7ED8\u5236\u6247\u5F62";
  43601. break;
  43602. case "DrawBowLine":
  43603. title.value = "\u7ED8\u5236\u5F13\u5F62\u7EBF";
  43604. break;
  43605. case "DrawLune":
  43606. title.value = "\u7ED8\u5236\u5F13\u5F62\u9762";
  43607. break;
  43608. case "DrawCurve":
  43609. title.value = "\u7ED8\u5236\u66F2\u7EBF";
  43610. break;
  43611. case "DrawCurveFlag":
  43612. title.value = "\u7ED8\u5236\u66F2\u7EBF\u65D7\u5E1C";
  43613. break;
  43614. case "DrawRectFlag":
  43615. title.value = "\u7ED8\u5236\u77E9\u5F62\u76F4\u89D2\u65D7\u5E1C";
  43616. break;
  43617. case "DrawTriangleFlag":
  43618. title.value = "\u7ED8\u5236\u4E09\u89D2\u65D7\u5E1C";
  43619. break;
  43620. }
  43621. color2.value = params.color;
  43622. outlineColor.value = params.outlineColor;
  43623. outlineWidth.value = params.outlineWidth;
  43624. }
  43625. __expose({});
  43626. function submit() {
  43627. let outParam = proxy._params;
  43628. outParam.color = color2.value;
  43629. outParam.outlineColor = outlineColor.value;
  43630. outParam.outlineWidth = outlineWidth.value;
  43631. emit("submit", outParam);
  43632. }
  43633. function close() {
  43634. dialogVisible.value = false;
  43635. }
  43636. function remove2() {
  43637. emit("remove", {});
  43638. dialogVisible.value = false;
  43639. }
  43640. function closeDialog() {
  43641. emit("update:showDialog", false);
  43642. }
  43643. function openDialog() {
  43644. updateParams(props.params);
  43645. }
  43646. return (_ctx, _cache) => {
  43647. return openBlock(), createElementBlock("div", _hoisted_1$1, [
  43648. createVNode(unref(ElDialog), {
  43649. modal: false,
  43650. "destroy-on-close": false,
  43651. modelValue: dialogVisible.value,
  43652. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => dialogVisible.value = $event),
  43653. title: title.value,
  43654. style: normalizeStyle({ left: "10rem", background: "rgb(0 44 126 / 68%)", height: "calc(100% - 175rem)", width: "180rem", top: "125rem" }),
  43655. onClose: closeDialog,
  43656. onOpen: openDialog,
  43657. "show-close": false
  43658. }, {
  43659. header: withCtx(() => [
  43660. createElementVNode("div", _hoisted_2$1, [
  43661. createElementVNode("span", _hoisted_3$1, toDisplayString(title.value), 1)
  43662. ])
  43663. ]),
  43664. default: withCtx(() => [
  43665. createElementVNode("div", _hoisted_4$1, [
  43666. createElementVNode("div", _hoisted_5$1, [
  43667. _hoisted_6$1,
  43668. createElementVNode("div", _hoisted_7$1, [
  43669. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  43670. default: withCtx(() => [
  43671. createVNode(unref(ElColorPicker), {
  43672. modelValue: color2.value,
  43673. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => color2.value = $event),
  43674. "show-alpha": "",
  43675. predefine: predefineColors.value,
  43676. label: "12"
  43677. }, null, 8, ["modelValue", "predefine"])
  43678. ]),
  43679. _: 1
  43680. }, 8, ["locale"])
  43681. ])
  43682. ]),
  43683. createElementVNode("div", _hoisted_8$1, [
  43684. createVNode(unref(ElButtonGroup), null, {
  43685. default: withCtx(() => [
  43686. createVNode(unref(ElButton), {
  43687. type: "primary",
  43688. icon: unref(edit_default),
  43689. onClick: _cache[1] || (_cache[1] = ($event) => submit())
  43690. }, {
  43691. default: withCtx(() => [
  43692. createTextVNode("\u4FEE\u6539")
  43693. ]),
  43694. _: 1
  43695. }, 8, ["icon"]),
  43696. createVNode(unref(ElButton), {
  43697. type: "primary",
  43698. style: { "background-color": "rgb(222, 146, 47)" },
  43699. icon: unref(delete_default),
  43700. onClick: _cache[2] || (_cache[2] = ($event) => remove2())
  43701. }, {
  43702. default: withCtx(() => [
  43703. createTextVNode("\u5220\u9664")
  43704. ]),
  43705. _: 1
  43706. }, 8, ["icon"]),
  43707. createVNode(unref(ElButton), {
  43708. type: "primary",
  43709. style: { "background-color": "rgb(126, 128, 135)" },
  43710. icon: unref(close_default),
  43711. onClick: _cache[3] || (_cache[3] = ($event) => close())
  43712. }, {
  43713. default: withCtx(() => [
  43714. createTextVNode("\u5173\u95ED")
  43715. ]),
  43716. _: 1
  43717. }, 8, ["icon"])
  43718. ]),
  43719. _: 1
  43720. })
  43721. ])
  43722. ])
  43723. ]),
  43724. _: 1
  43725. }, 8, ["modelValue", "title", "style"])
  43726. ]);
  43727. };
  43728. }
  43729. };
  43730. var DialogEditProperty$1 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["styles", [_style_0$1]]]);
  43731. Cesium.Entity.prototype.setParams = function(params) {
  43732. this._params = params;
  43733. };
  43734. Cesium.Entity.prototype.getParams = function() {
  43735. return this._params;
  43736. };
  43737. Cesium.Entity.prototype.setIsEdit = function(isEdit) {
  43738. this._isEdit = isEdit;
  43739. };
  43740. Cesium.Entity.prototype.getIsEdit = function() {
  43741. return this._isEdit;
  43742. };
  43743. class DrawMilitaryPlot {
  43744. constructor(options2) {
  43745. if (!options2.viewer)
  43746. throw new DeveloperError("no options.viewer object!");
  43747. if (!options2.Cesium)
  43748. throw new DeveloperError("no options.Cesium object!");
  43749. this._viewer = options2.viewer;
  43750. this.cesium = options2.Cesium;
  43751. this.drawArr = [];
  43752. this.Draw = "";
  43753. this.edit = new EntityEdit(this._viewer);
  43754. this.edit.activate();
  43755. this.edit.EditEndEntity.addEventListener((result) => {
  43756. if (result.Type) {
  43757. this.handleFirstPosition(result.Type);
  43758. this.edit.DrawExample = this.Draw;
  43759. }
  43760. this._editEntity = result;
  43761. });
  43762. }
  43763. static initEditPropertyParams() {
  43764. return {
  43765. id: void 0,
  43766. color: "rgba(0,255,0,0.75)",
  43767. outlineWidth: 0,
  43768. outlineColor: "rgba(255,255,255,1)"
  43769. };
  43770. }
  43771. editActivate() {
  43772. return this.edit;
  43773. }
  43774. handleFirstPosition(type2) {
  43775. this._viewer.scene.globe.depthTestAgainstTerrain = true;
  43776. switch (type2) {
  43777. case "DrawStraightArrow":
  43778. this.Draw = new MilitaryPlot.DrawStraightArrow({
  43779. viewer: this._viewer,
  43780. Cesium: this.cesium
  43781. });
  43782. break;
  43783. case "DrawAttackArrow":
  43784. this.Draw = new MilitaryPlot.DrawAttackArrow({
  43785. viewer: this._viewer,
  43786. Cesium: this.cesium
  43787. });
  43788. break;
  43789. case "DrawPincerArrow":
  43790. this.Draw = new MilitaryPlot.DrawPincerArrow({
  43791. viewer: this._viewer,
  43792. Cesium: this.cesium
  43793. });
  43794. break;
  43795. case "DrawGatheringPlace":
  43796. this.Draw = new MilitaryPlot.DrawGatheringPlace({
  43797. viewer: this._viewer,
  43798. Cesium: this.cesium
  43799. });
  43800. break;
  43801. case "DrawClosedCurve":
  43802. this.Draw = new MilitaryPlot.DrawClosedCurve({
  43803. viewer: this._viewer,
  43804. Cesium: this.cesium
  43805. });
  43806. break;
  43807. case "DrawSector":
  43808. this.Draw = new MilitaryPlot.DrawSector({
  43809. viewer: this._viewer,
  43810. Cesium: this.cesium
  43811. });
  43812. break;
  43813. case "DrawBowLine":
  43814. this.Draw = new MilitaryPlot.DrawBowLine({
  43815. viewer: this._viewer,
  43816. Cesium: this.cesium
  43817. });
  43818. break;
  43819. case "DrawBowPlane":
  43820. this.Draw = new MilitaryPlot.DrawBowPlane({
  43821. viewer: this._viewer,
  43822. Cesium: this.cesium
  43823. });
  43824. break;
  43825. case "DrawCurve":
  43826. this.Draw = new MilitaryPlot.DrawCurve({
  43827. viewer: this._viewer,
  43828. Cesium: this.cesium
  43829. });
  43830. break;
  43831. case "DrawCurveFlag":
  43832. this.Draw = new MilitaryPlot.DrawCurveFlag({
  43833. viewer: this._viewer,
  43834. Cesium: this.cesium
  43835. });
  43836. break;
  43837. case "DrawRectFlag":
  43838. this.Draw = new MilitaryPlot.DrawRectFlag({
  43839. viewer: this._viewer,
  43840. Cesium: this.cesium
  43841. });
  43842. break;
  43843. case "DrawTriangleFlag":
  43844. this.Draw = new MilitaryPlot.DrawTriangleFlag({
  43845. viewer: this._viewer,
  43846. Cesium: this.cesium
  43847. });
  43848. break;
  43849. case "DrawPoint":
  43850. this.Draw = new MilitaryPlot.DrawPoint({
  43851. viewer: this._viewer,
  43852. Cesium: this.cesium
  43853. });
  43854. break;
  43855. case "DrawPolyline":
  43856. this.Draw = new MilitaryPlot.DrawPolyline({
  43857. viewer: this._viewer,
  43858. Cesium: this.cesium
  43859. });
  43860. break;
  43861. case "DrawPolygon":
  43862. this.Draw = new MilitaryPlot.DrawPolygon({
  43863. viewer: this._viewer,
  43864. Cesium: this.cesium
  43865. });
  43866. break;
  43867. case "DrawRectangle":
  43868. this.Draw = new MilitaryPlot.DrawRectangle({
  43869. viewer: this._viewer,
  43870. Cesium: this.cesium
  43871. });
  43872. break;
  43873. case "DrawCircle":
  43874. this.Draw = new MilitaryPlot.DrawCircle({
  43875. viewer: this._viewer,
  43876. Cesium: this.cesium
  43877. });
  43878. break;
  43879. }
  43880. }
  43881. addEntity(data) {
  43882. this.handleFirstPosition(data.type);
  43883. if (this.Draw) {
  43884. let entity = this.Draw.addload(data.position);
  43885. entity._id = data.id;
  43886. return entity;
  43887. }
  43888. }
  43889. }
  43890. Object.assign(DrawMilitaryPlot.prototype, {
  43891. _setMousePointerStyle() {
  43892. document.querySelector("body").style.cursor = "crosshair";
  43893. },
  43894. _setMouseDefaultStyle() {
  43895. document.querySelector("body").style.cursor = "default";
  43896. },
  43897. _registerLeftClickEvent(handler, callChange) {
  43898. let _self = this;
  43899. if (!handler)
  43900. return;
  43901. handler.setInputAction(function(event2) {
  43902. _self._lock = true;
  43903. clearTimeout(_self._timer);
  43904. _self._timer = setTimeout(function() {
  43905. if (callChange)
  43906. callChange(event2);
  43907. _self._lock = false;
  43908. }, 200);
  43909. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  43910. },
  43911. _registerMouseMoveEvent(handler, callChange) {
  43912. let _self = this;
  43913. if (!handler)
  43914. return;
  43915. handler.setInputAction(function(event2) {
  43916. if (_self._lock === void 0 || _self._lock === false) {
  43917. if (callChange)
  43918. callChange(event2);
  43919. }
  43920. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  43921. },
  43922. _registerLeftDownEvent(handler, callChange) {
  43923. if (!handler)
  43924. return;
  43925. handler.setInputAction(function(event2) {
  43926. if (callChange)
  43927. callChange(event2);
  43928. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  43929. },
  43930. _registerLeftUpEvent(handler, callChange) {
  43931. if (!handler)
  43932. return;
  43933. handler.setInputAction(function(event2) {
  43934. if (callChange)
  43935. callChange(event2);
  43936. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  43937. },
  43938. _clearEvent(handler) {
  43939. if (!handler)
  43940. return;
  43941. handler.destroy();
  43942. handler = null;
  43943. }
  43944. });
  43945. Object.assign(DrawMilitaryPlot.prototype, {
  43946. _setEntityIsEdit(entity) {
  43947. let _self = this;
  43948. this._closePropertyEditDialog();
  43949. entity.setIsEdit(true);
  43950. this.edit.handlePickEditEntity(entity);
  43951. this._sendShowPropertyDialog(entity);
  43952. let handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  43953. this._registerLeftClickEvent(handler, function(event2) {
  43954. _self._closePropertyEditDialog();
  43955. let feature2 = _self._viewer.scene.pick(event2.position);
  43956. if (feature2 !== void 0 && feature2.id instanceof Cesium.Entity) {
  43957. let editEntity = feature2.id;
  43958. if (editEntity.Type == "DrawStraightArrow" || editEntity.Type == "DrawAttackArrow" || editEntity.Type == "DrawPincerArrow" || editEntity.Type == "DrawGatheringPlace" || editEntity.Type == "DrawClosedCurve" || editEntity.Type == "DrawSector" || editEntity.Type == "DrawBowLine" || editEntity.Type == "DrawBowPlane" || editEntity.Type == "DrawCurve" || editEntity.Type == "DrawCurveFlag" || editEntity.Type == "DrawRectFlag" || editEntity.Type == "DrawTriangleFlag" || editEntity.Type == "DrawPoint" || editEntity.Type == "DrawPolyline" || editEntity.Type == "DrawPolygon" || editEntity.Type == "DrawRectangle" || editEntity.Type == "DrawCircle") {
  43959. _self._sendShowPropertyDialog(feature2.id);
  43960. }
  43961. }
  43962. });
  43963. },
  43964. _sendShowPropertyDialog(entity) {
  43965. let _self = this;
  43966. let editEntityType = entity.Type;
  43967. if (entity.getIsEdit() === void 0 || entity.getIsEdit() === false || editEntityType === void 0) {
  43968. return;
  43969. }
  43970. let editProperty = entity.getParams();
  43971. if (editProperty !== void 0 && this.onEditProperty !== void 0) {
  43972. editProperty.id = editEntityType;
  43973. _self._openPropertyEditDialog(
  43974. editProperty,
  43975. function(params) {
  43976. _self.updateEditEntityProperty(params);
  43977. },
  43978. function() {
  43979. _self._viewer.entities.remove(entity);
  43980. _self.edit.clearAllEditVertex();
  43981. }
  43982. );
  43983. }
  43984. },
  43985. updateEditEntityProperty: function(params) {
  43986. if (this._editEntity === void 0)
  43987. return;
  43988. if (this._editEntity.getIsEdit() === void 0 || this._editEntity.getIsEdit() === false)
  43989. return;
  43990. let editEntityType = this._editEntity.Type;
  43991. if (editEntityType === void 0)
  43992. return;
  43993. let material = this._editEntity.polygon.material;
  43994. if (material instanceof Cesium.ColorMaterialProperty) {
  43995. let newMaterial = this._materialColorProperty({
  43996. color: params.color
  43997. });
  43998. this._editEntity.polygon.material = newMaterial;
  43999. }
  44000. if (this._editEntity.polyline !== void 0) {
  44001. let newMaterial = this._materialColorProperty({
  44002. color: params.outlineColor
  44003. });
  44004. this._editEntity.polyline.material = newMaterial;
  44005. this._editEntity.polyline.width = parseFloat(params.outlineWidth);
  44006. }
  44007. this._editEntity.setParams(params);
  44008. },
  44009. _materialColorProperty(options2) {
  44010. let mColor = "rgba(0,255,0,1)";
  44011. if (options2 !== void 0 && options2.color !== void 0)
  44012. mColor = options2.color;
  44013. let colorMaterial = new Cesium.ColorMaterialProperty(Cesium.Color.fromCssColorString(mColor));
  44014. colorMaterial._param = {
  44015. color: mColor
  44016. };
  44017. return colorMaterial;
  44018. }
  44019. });
  44020. Object.assign(DrawMilitaryPlot.prototype, {
  44021. drawActivate(type2) {
  44022. this._setMousePointerStyle();
  44023. this.handleFirstPosition(type2);
  44024. this.Draw.startCreate(type2);
  44025. this.Draw.DrawEndEvent.addEventListener((entity, positions, drawType) => {
  44026. console.log({
  44027. entity,
  44028. positions,
  44029. drawType
  44030. });
  44031. this._setMouseDefaultStyle();
  44032. if (entity) {
  44033. let entityParam = DrawMilitaryPlot.initEditPropertyParams();
  44034. entity.setParams(entityParam);
  44035. this._setEntityIsEdit(entity);
  44036. }
  44037. });
  44038. this.drawArr.push(this.Draw);
  44039. return this.Draw;
  44040. },
  44041. clearOne: function() {
  44042. this.Draw.clear();
  44043. },
  44044. clearAll: function() {
  44045. for (var i2 = 0; i2 < this.drawArr.length; i2++) {
  44046. this.drawArr[i2].clear();
  44047. }
  44048. this.edit.deactivate();
  44049. this._closePropertyEditDialog();
  44050. let buttonDiv = document.getElementById("drawButtonDiv");
  44051. if (buttonDiv) {
  44052. document.body.removeChild(buttonDiv);
  44053. }
  44054. }
  44055. });
  44056. Object.assign(DrawMilitaryPlot.prototype, {
  44057. _openPropertyEditDialog: function(params, callEdit, callRemove) {
  44058. this._editPropertyDialogDomId = "dialog-property-dom-militaryplot";
  44059. this._registerDOMPropertyEdit = "dialog-edit-property-militaryplot";
  44060. let PropertyEditComponent = customElements.get(this._registerDOMPropertyEdit);
  44061. if (PropertyEditComponent === void 0) {
  44062. PropertyEditComponent = defineCustomElement(DialogEditProperty$1);
  44063. customElements.define(this._registerDOMPropertyEdit, PropertyEditComponent);
  44064. }
  44065. this._closePropertyEditDialog();
  44066. let dialogPropertyElement = new PropertyEditComponent({
  44067. params
  44068. });
  44069. dialogPropertyElement.id = this._editPropertyDialogDomId;
  44070. dialogPropertyElement.showDialog = true;
  44071. document.body.appendChild(dialogPropertyElement);
  44072. dialogPropertyElement.addEventListener(
  44073. "submit",
  44074. (e) => {
  44075. if (callEdit)
  44076. callEdit(e.detail[0]);
  44077. },
  44078. false
  44079. );
  44080. dialogPropertyElement.addEventListener(
  44081. "remove",
  44082. (e) => {
  44083. if (callRemove)
  44084. callRemove();
  44085. },
  44086. false
  44087. );
  44088. },
  44089. _closePropertyEditDialog() {
  44090. let dom2 = document.getElementById(this._editPropertyDialogDomId);
  44091. if (dom2 !== null && dom2 !== void 0) {
  44092. document.body.removeChild(dom2);
  44093. }
  44094. }
  44095. });
  44096. var _style_0 = `@charset "UTF-8";:root{--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary-rgb:64,158,255;--el-color-success-rgb:103,194,58;--el-color-warning-rgb:230,162,60;--el-color-danger-rgb:245,108,108;--el-color-error-rgb:245,108,108;--el-color-info-rgb:144,147,153;--el-font-size-extra-large:20px;--el-font-size-large:18px;--el-font-size-medium:16px;--el-font-size-base:14px;--el-font-size-small:13px;--el-font-size-extra-small:12px;--el-font-family:"Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","\\5fae\\8f6f\\96c5\\9ed1",Arial,sans-serif;--el-font-weight-primary:500;--el-font-line-height-primary:24px;--el-index-normal:1;--el-index-top:1000;--el-index-popper:2000;--el-border-radius-base:4px;--el-border-radius-small:2px;--el-border-radius-round:20px;--el-border-radius-circle:100%;--el-transition-duration:.3s;--el-transition-duration-fast:.2s;--el-transition-function-ease-in-out-bezier:cubic-bezier(.645, .045, .355, 1);--el-transition-function-fast-bezier:cubic-bezier(.23, 1, .32, 1);--el-transition-all:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);--el-transition-fade:opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-md-fade:transform var(--el-transition-duration) var(--el-transition-function-fast-bezier),opacity var(--el-transition-duration) var(--el-transition-function-fast-bezier);--el-transition-fade-linear:opacity var(--el-transition-duration-fast) linear;--el-transition-border:border-color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-box-shadow:box-shadow var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-transition-color:color var(--el-transition-duration-fast) var(--el-transition-function-ease-in-out-bezier);--el-component-size-large:40px;--el-component-size:32px;--el-component-size-small:24px}:root{color-scheme:light;--el-color-white:#ffffff;--el-color-black:#000000;--el-color-primary:#409eff;--el-color-primary-light-3:#79bbff;--el-color-primary-light-5:#a0cfff;--el-color-primary-light-7:#c6e2ff;--el-color-primary-light-8:#d9ecff;--el-color-primary-light-9:#ecf5ff;--el-color-primary-dark-2:#337ecc;--el-color-success:#67c23a;--el-color-success-light-3:#95d475;--el-color-success-light-5:#b3e19d;--el-color-success-light-7:#d1edc4;--el-color-success-light-8:#e1f3d8;--el-color-success-light-9:#f0f9eb;--el-color-success-dark-2:#529b2e;--el-color-warning:#e6a23c;--el-color-warning-light-3:#eebe77;--el-color-warning-light-5:#f3d19e;--el-color-warning-light-7:#f8e3c5;--el-color-warning-light-8:#faecd8;--el-color-warning-light-9:#fdf6ec;--el-color-warning-dark-2:#b88230;--el-color-danger:#f56c6c;--el-color-danger-light-3:#f89898;--el-color-danger-light-5:#fab6b6;--el-color-danger-light-7:#fcd3d3;--el-color-danger-light-8:#fde2e2;--el-color-danger-light-9:#fef0f0;--el-color-danger-dark-2:#c45656;--el-color-error:#f56c6c;--el-color-error-light-3:#f89898;--el-color-error-light-5:#fab6b6;--el-color-error-light-7:#fcd3d3;--el-color-error-light-8:#fde2e2;--el-color-error-light-9:#fef0f0;--el-color-error-dark-2:#c45656;--el-color-info:#909399;--el-color-info-light-3:#b1b3b8;--el-color-info-light-5:#c8c9cc;--el-color-info-light-7:#dedfe0;--el-color-info-light-8:#e9e9eb;--el-color-info-light-9:#f4f4f5;--el-color-info-dark-2:#73767a;--el-bg-color:#ffffff;--el-bg-color-page:#f2f3f5;--el-bg-color-overlay:#ffffff;--el-text-color-primary:#303133;--el-text-color-regular:#606266;--el-text-color-secondary:#909399;--el-text-color-placeholder:#a8abb2;--el-text-color-disabled:#c0c4cc;--el-border-color:#dcdfe6;--el-border-color-light:#e4e7ed;--el-border-color-lighter:#ebeef5;--el-border-color-extra-light:#f2f6fc;--el-border-color-dark:#d4d7de;--el-border-color-darker:#cdd0d6;--el-fill-color:#f0f2f5;--el-fill-color-light:#f5f7fa;--el-fill-color-lighter:#fafafa;--el-fill-color-extra-light:#fafcff;--el-fill-color-dark:#ebedf0;--el-fill-color-darker:#e6e8eb;--el-fill-color-blank:#ffffff;--el-box-shadow:0px 12px 32px 4px rgba(0, 0, 0, .04),0px 8px 20px rgba(0, 0, 0, .08);--el-box-shadow-light:0px 0px 12px rgba(0, 0, 0, .12);--el-box-shadow-lighter:0px 0px 6px rgba(0, 0, 0, .12);--el-box-shadow-dark:0px 16px 48px 16px rgba(0, 0, 0, .08),0px 12px 32px rgba(0, 0, 0, .12),0px 8px 16px -8px rgba(0, 0, 0, .16);--el-disabled-bg-color:var(--el-fill-color-light);--el-disabled-text-color:var(--el-text-color-placeholder);--el-disabled-border-color:var(--el-border-color-light);--el-overlay-color:rgba(0, 0, 0, .8);--el-overlay-color-light:rgba(0, 0, 0, .7);--el-overlay-color-lighter:rgba(0, 0, 0, .5);--el-mask-color:rgba(255, 255, 255, .9);--el-mask-color-extra-light:rgba(255, 255, 255, .3);--el-border-width:1px;--el-border-style:solid;--el-border-color-hover:var(--el-text-color-disabled);--el-border:var(--el-border-width) var(--el-border-style) var(--el-border-color);--el-svg-monochrome-grey:var(--el-border-color)}.fade-in-linear-enter-active,.fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.fade-in-linear-enter-from,.fade-in-linear-leave-to{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active{transition:var(--el-transition-fade-linear)}.el-fade-in-linear-enter-from,.el-fade-in-linear-leave-to{opacity:0}.el-fade-in-enter-active,.el-fade-in-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-fade-in-enter-from,.el-fade-in-leave-active{opacity:0}.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{transition:all var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter-from,.el-zoom-in-center-leave-active{opacity:0;transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center top}.el-zoom-in-top-enter-active[data-popper-placement^=top],.el-zoom-in-top-leave-active[data-popper-placement^=top]{transform-origin:center bottom}.el-zoom-in-top-enter-from,.el-zoom-in-top-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;transform:scaleY(1);transition:var(--el-transition-md-fade);transform-origin:center bottom}.el-zoom-in-bottom-enter-from,.el-zoom-in-bottom-leave-active{opacity:0;transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;transform:scale(1);transition:var(--el-transition-md-fade);transform-origin:top left}.el-zoom-in-left-enter-from,.el-zoom-in-left-leave-active{opacity:0;transform:scale(.45)}.collapse-transition{transition:var(--el-transition-duration) height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.el-collapse-transition-enter-active,.el-collapse-transition-leave-active{transition:var(--el-transition-duration) max-height ease-in-out,var(--el-transition-duration) padding-top ease-in-out,var(--el-transition-duration) padding-bottom ease-in-out}.horizontal-collapse-transition{transition:var(--el-transition-duration) width ease-in-out,var(--el-transition-duration) padding-left ease-in-out,var(--el-transition-duration) padding-right ease-in-out}.el-list-enter-active,.el-list-leave-active{transition:all 1s}.el-list-enter-from,.el-list-leave-to{opacity:0;transform:translateY(-30px)}.el-list-leave-active{position:absolute!important}.el-opacity-transition{transition:opacity var(--el-transition-duration) cubic-bezier(.55,0,.1,1)}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotating{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.el-icon{--color:inherit;height:1em;width:1em;line-height:1em;display:inline-flex;justify-content:center;align-items:center;position:relative;fill:currentColor;color:var(--color);font-size:inherit}.el-icon.is-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon svg{height:1em;width:1em}.el-affix--fixed{position:fixed}.el-alert{--el-alert-padding:8px 16px;--el-alert-border-radius-base:var(--el-border-radius-base);--el-alert-title-font-size:13px;--el-alert-description-font-size:12px;--el-alert-close-font-size:12px;--el-alert-close-customed-font-size:13px;--el-alert-icon-size:16px;--el-alert-icon-large-size:28px;width:100%;padding:var(--el-alert-padding);margin:0;box-sizing:border-box;border-radius:var(--el-alert-border-radius-base);position:relative;background-color:var(--el-color-white);overflow:hidden;opacity:1;display:flex;align-items:center;transition:opacity var(--el-transition-duration-fast)}.el-alert.is-light .el-alert__close-btn{color:var(--el-text-color-placeholder)}.el-alert.is-dark .el-alert__close-btn,.el-alert.is-dark .el-alert__description{color:var(--el-color-white)}.el-alert.is-center{justify-content:center}.el-alert--success{--el-alert-bg-color:var(--el-color-success-light-9)}.el-alert--success.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-success)}.el-alert--success.is-light .el-alert__description{color:var(--el-color-success)}.el-alert--success.is-dark{background-color:var(--el-color-success);color:var(--el-color-white)}.el-alert--info{--el-alert-bg-color:var(--el-color-info-light-9)}.el-alert--info.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-info)}.el-alert--info.is-light .el-alert__description{color:var(--el-color-info)}.el-alert--info.is-dark{background-color:var(--el-color-info);color:var(--el-color-white)}.el-alert--warning{--el-alert-bg-color:var(--el-color-warning-light-9)}.el-alert--warning.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-warning)}.el-alert--warning.is-light .el-alert__description{color:var(--el-color-warning)}.el-alert--warning.is-dark{background-color:var(--el-color-warning);color:var(--el-color-white)}.el-alert--error{--el-alert-bg-color:var(--el-color-error-light-9)}.el-alert--error.is-light{background-color:var(--el-alert-bg-color);color:var(--el-color-error)}.el-alert--error.is-light .el-alert__description{color:var(--el-color-error)}.el-alert--error.is-dark{background-color:var(--el-color-error);color:var(--el-color-white)}.el-alert__content{display:table-cell;padding:0 8px}.el-alert .el-alert__icon{font-size:var(--el-alert-icon-size);width:var(--el-alert-icon-size)}.el-alert .el-alert__icon.is-big{font-size:var(--el-alert-icon-large-size);width:var(--el-alert-icon-large-size)}.el-alert__title{font-size:var(--el-alert-title-font-size);line-height:18px;vertical-align:text-top}.el-alert__title.is-bold{font-weight:700}.el-alert .el-alert__description{font-size:var(--el-alert-description-font-size);margin:5px 0 0}.el-alert .el-alert__close-btn{font-size:var(--el-alert-close-font-size);opacity:1;position:absolute;top:12px;right:15px;cursor:pointer}.el-alert .el-alert__close-btn.is-customed{font-style:normal;font-size:var(--el-alert-close-customed-font-size);top:9px}.el-alert-fade-enter-from,.el-alert-fade-leave-active{opacity:0}.el-aside{overflow:auto;box-sizing:border-box;flex-shrink:0;width:var(--el-aside-width,300px)}.el-autocomplete{position:relative;display:inline-block}.el-autocomplete__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-autocomplete__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-autocomplete__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-autocomplete__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-autocomplete-suggestion{border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-autocomplete-suggestion__wrap{max-height:280px;padding:10px 0;box-sizing:border-box}.el-autocomplete-suggestion__list{margin:0;padding:0}.el-autocomplete-suggestion li{padding:0 20px;margin:0;line-height:34px;cursor:pointer;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);list-style:none;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-autocomplete-suggestion li:hover,.el-autocomplete-suggestion li.highlighted{background-color:var(--el-fill-color-light)}.el-autocomplete-suggestion li.divider{margin-top:6px;border-top:1px solid var(--el-color-black)}.el-autocomplete-suggestion li.divider:last-child{margin-bottom:-6px}.el-autocomplete-suggestion.is-loading li{text-align:center;height:100px;line-height:100px;font-size:20px;color:var(--el-text-color-secondary)}.el-autocomplete-suggestion.is-loading li:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-autocomplete-suggestion.is-loading li:hover{background-color:var(--el-bg-color-overlay)}.el-autocomplete-suggestion.is-loading .el-icon-loading{vertical-align:middle}.el-avatar{--el-avatar-text-color:var(--el-color-white);--el-avatar-bg-color:var(--el-text-color-disabled);--el-avatar-text-size:14px;--el-avatar-icon-size:18px;--el-avatar-border-radius:var(--el-border-radius-base);--el-avatar-size-large:56px;--el-avatar-size-small:24px;--el-avatar-size:40px;display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;text-align:center;overflow:hidden;color:var(--el-avatar-text-color);background:var(--el-avatar-bg-color);width:var(--el-avatar-size);height:var(--el-avatar-size);font-size:var(--el-avatar-text-size)}.el-avatar>img{display:block;height:100%}.el-avatar--circle{border-radius:50%}.el-avatar--square{border-radius:var(--el-avatar-border-radius)}.el-avatar--icon{font-size:var(--el-avatar-icon-size)}.el-avatar--small{--el-avatar-size:24px}.el-avatar--large{--el-avatar-size:56px}.el-backtop{--el-backtop-bg-color:var(--el-bg-color-overlay);--el-backtop-text-color:var(--el-color-primary);--el-backtop-hover-bg-color:var(--el-border-color-extra-light);position:fixed;background-color:var(--el-backtop-bg-color);width:40px;height:40px;border-radius:50%;color:var(--el-backtop-text-color);display:flex;align-items:center;justify-content:center;font-size:20px;box-shadow:var(--el-box-shadow-lighter);cursor:pointer;z-index:5}.el-backtop:hover{background-color:var(--el-backtop-hover-bg-color)}.el-backtop__icon{font-size:20px}.el-badge{--el-badge-bg-color:var(--el-color-danger);--el-badge-radius:10px;--el-badge-font-size:12px;--el-badge-padding:6px;--el-badge-size:18px;position:relative;vertical-align:middle;display:inline-block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.el-badge__content{background-color:var(--el-badge-bg-color);border-radius:var(--el-badge-radius);color:var(--el-color-white);display:inline-flex;justify-content:center;align-items:center;font-size:var(--el-badge-font-size);height:var(--el-badge-size);padding:0 var(--el-badge-padding);white-space:nowrap;border:1px solid var(--el-bg-color)}.el-badge__content.is-fixed{position:absolute;top:0;right:calc(1px + var(--el-badge-size)/ 2);transform:translateY(-50%) translate(100%);z-index:var(--el-index-normal)}.el-badge__content.is-fixed.is-dot{right:5px}.el-badge__content.is-dot{height:8px;width:8px;padding:0;right:0;border-radius:50%}.el-badge__content--primary{background-color:var(--el-color-primary)}.el-badge__content--success{background-color:var(--el-color-success)}.el-badge__content--warning{background-color:var(--el-color-warning)}.el-badge__content--info{background-color:var(--el-color-info)}.el-badge__content--danger{background-color:var(--el-color-danger)}.el-breadcrumb{font-size:14px;line-height:1}.el-breadcrumb:after,.el-breadcrumb:before{display:table;content:""}.el-breadcrumb:after{clear:both}.el-breadcrumb__separator{margin:0 9px;font-weight:700;color:var(--el-text-color-placeholder)}.el-breadcrumb__separator.el-icon{margin:0 6px;font-weight:400}.el-breadcrumb__separator.el-icon svg{vertical-align:middle}.el-breadcrumb__item{float:left;display:inline-flex;align-items:center}.el-breadcrumb__inner{color:var(--el-text-color-regular)}.el-breadcrumb__inner a,.el-breadcrumb__inner.is-link{font-weight:700;text-decoration:none;transition:var(--el-transition-color);color:var(--el-text-color-primary)}.el-breadcrumb__inner a:hover,.el-breadcrumb__inner.is-link:hover{color:var(--el-color-primary);cursor:pointer}.el-breadcrumb__item:last-child .el-breadcrumb__inner,.el-breadcrumb__item:last-child .el-breadcrumb__inner a,.el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover,.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover{font-weight:400;color:var(--el-text-color-regular);cursor:text}.el-breadcrumb__item:last-child .el-breadcrumb__separator{display:none}.el-button-group{display:inline-block;vertical-align:middle}.el-button-group:after,.el-button-group:before{display:table;content:""}.el-button-group:after{clear:both}.el-button-group>.el-button{float:left;position:relative}.el-button-group>.el-button+.el-button{margin-left:0}.el-button-group>.el-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.el-button-group>.el-button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.el-button-group>.el-button:first-child:last-child{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base)}.el-button-group>.el-button:first-child:last-child.is-round{border-radius:var(--el-border-radius-round)}.el-button-group>.el-button:first-child:last-child.is-circle{border-radius:50%}.el-button-group>.el-button:not(:first-child):not(:last-child){border-radius:0}.el-button-group>.el-button:not(:last-child){margin-right:-1px}.el-button-group>.el-button:active,.el-button-group>.el-button:focus,.el-button-group>.el-button:hover{z-index:1}.el-button-group>.el-button.is-active{z-index:1}.el-button-group>.el-dropdown>.el-button{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--primary:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--success:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--warning:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--danger:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:first-child{border-right-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:last-child{border-left-color:var(--el-button-divide-border-color)}.el-button-group .el-button--info:not(:first-child):not(:last-child){border-left-color:var(--el-button-divide-border-color);border-right-color:var(--el-button-divide-border-color)}.el-button{--el-button-font-weight:var(--el-font-weight-primary);--el-button-border-color:var(--el-border-color);--el-button-bg-color:var(--el-fill-color-blank);--el-button-text-color:var(--el-text-color-regular);--el-button-disabled-text-color:var(--el-disabled-text-color);--el-button-disabled-bg-color:var(--el-fill-color-blank);--el-button-disabled-border-color:var(--el-border-color-light);--el-button-divide-border-color:rgba(255, 255, 255, .5);--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-color-primary-light-9);--el-button-hover-border-color:var(--el-color-primary-light-7);--el-button-active-text-color:var(--el-button-hover-text-color);--el-button-active-border-color:var(--el-color-primary);--el-button-active-bg-color:var(--el-button-hover-bg-color);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-hover-link-text-color:var(--el-color-info);--el-button-active-color:var(--el-text-color-primary)}.el-button{display:inline-flex;justify-content:center;align-items:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;color:var(--el-button-text-color);text-align:center;box-sizing:border-box;outline:0;transition:.1s;font-weight:var(--el-button-font-weight);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;-webkit-appearance:none;background-color:var(--el-button-bg-color);border:var(--el-border);border-color:var(--el-button-border-color);padding:8px 15px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button:focus,.el-button:hover{color:var(--el-button-hover-text-color);border-color:var(--el-button-hover-border-color);background-color:var(--el-button-hover-bg-color);outline:0}.el-button:active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button:focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button>span{display:inline-flex;align-items:center}.el-button+.el-button{margin-left:12px}.el-button.is-round{padding:8px 15px}.el-button::-moz-focus-inner{border:0}.el-button [class*=el-icon]+span{margin-left:6px}.el-button [class*=el-icon] svg{vertical-align:bottom}.el-button.is-plain{--el-button-hover-text-color:var(--el-color-primary);--el-button-hover-bg-color:var(--el-fill-color-blank);--el-button-hover-border-color:var(--el-color-primary)}.el-button.is-active{color:var(--el-button-active-text-color);border-color:var(--el-button-active-border-color);background-color:var(--el-button-active-bg-color);outline:0}.el-button.is-disabled,.el-button.is-disabled:focus,.el-button.is-disabled:hover{color:var(--el-button-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color);border-color:var(--el-button-disabled-border-color)}.el-button.is-loading{position:relative;pointer-events:none}.el-button.is-loading:before{z-index:1;pointer-events:none;content:"";position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:inherit;background-color:var(--el-mask-color-extra-light)}.el-button.is-round{border-radius:var(--el-border-radius-round)}.el-button.is-circle{border-radius:50%;padding:8px}.el-button.is-text{color:var(--el-button-text-color);border:0 solid transparent;background-color:transparent}.el-button.is-text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important}.el-button.is-text:not(.is-disabled):focus,.el-button.is-text:not(.is-disabled):hover{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled):focus-visible{outline:2px solid var(--el-button-outline-color);outline-offset:1px}.el-button.is-text:not(.is-disabled):active{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg{background-color:var(--el-fill-color-light)}.el-button.is-text:not(.is-disabled).is-has-bg:focus,.el-button.is-text:not(.is-disabled).is-has-bg:hover{background-color:var(--el-fill-color)}.el-button.is-text:not(.is-disabled).is-has-bg:active{background-color:var(--el-fill-color-dark)}.el-button__text--expand{letter-spacing:.3em;margin-right:-.3em}.el-button.is-link{border-color:transparent;color:var(--el-button-text-color);background:0 0;padding:2px;height:auto}.el-button.is-link:focus,.el-button.is-link:hover{color:var(--el-button-hover-link-text-color)}.el-button.is-link.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button.is-link:not(.is-disabled):focus,.el-button.is-link:not(.is-disabled):hover{border-color:transparent;background-color:transparent}.el-button.is-link:not(.is-disabled):active{color:var(--el-button-active-color);border-color:transparent;background-color:transparent}.el-button--text{border-color:transparent;background:0 0;color:var(--el-color-primary);padding-left:0;padding-right:0}.el-button--text.is-disabled{color:var(--el-button-disabled-text-color);background-color:transparent!important;border-color:transparent!important}.el-button--text:not(.is-disabled):focus,.el-button--text:not(.is-disabled):hover{color:var(--el-color-primary-light-3);border-color:transparent;background-color:transparent}.el-button--text:not(.is-disabled):active{color:var(--el-color-primary-dark-2);border-color:transparent;background-color:transparent}.el-button__link--expand{letter-spacing:.3em;margin-right:-.3em}.el-button--primary{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-primary);--el-button-border-color:var(--el-color-primary);--el-button-outline-color:var(--el-color-primary-light-5);--el-button-active-color:var(--el-color-primary-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-primary-light-5);--el-button-hover-bg-color:var(--el-color-primary-light-3);--el-button-hover-border-color:var(--el-color-primary-light-3);--el-button-active-bg-color:var(--el-color-primary-dark-2);--el-button-active-border-color:var(--el-color-primary-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-primary-light-5);--el-button-disabled-border-color:var(--el-color-primary-light-5)}.el-button--primary.is-link,.el-button--primary.is-plain,.el-button--primary.is-text{--el-button-text-color:var(--el-color-primary);--el-button-bg-color:var(--el-color-primary-light-9);--el-button-border-color:var(--el-color-primary-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-primary);--el-button-hover-border-color:var(--el-color-primary);--el-button-active-text-color:var(--el-color-white)}.el-button--primary.is-link.is-disabled,.el-button--primary.is-link.is-disabled:active,.el-button--primary.is-link.is-disabled:focus,.el-button--primary.is-link.is-disabled:hover,.el-button--primary.is-plain.is-disabled,.el-button--primary.is-plain.is-disabled:active,.el-button--primary.is-plain.is-disabled:focus,.el-button--primary.is-plain.is-disabled:hover,.el-button--primary.is-text.is-disabled,.el-button--primary.is-text.is-disabled:active,.el-button--primary.is-text.is-disabled:focus,.el-button--primary.is-text.is-disabled:hover{color:var(--el-color-primary-light-5);background-color:var(--el-color-primary-light-9);border-color:var(--el-color-primary-light-8)}.el-button--success{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-success);--el-button-border-color:var(--el-color-success);--el-button-outline-color:var(--el-color-success-light-5);--el-button-active-color:var(--el-color-success-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-success-light-5);--el-button-hover-bg-color:var(--el-color-success-light-3);--el-button-hover-border-color:var(--el-color-success-light-3);--el-button-active-bg-color:var(--el-color-success-dark-2);--el-button-active-border-color:var(--el-color-success-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-success-light-5);--el-button-disabled-border-color:var(--el-color-success-light-5)}.el-button--success.is-link,.el-button--success.is-plain,.el-button--success.is-text{--el-button-text-color:var(--el-color-success);--el-button-bg-color:var(--el-color-success-light-9);--el-button-border-color:var(--el-color-success-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-success);--el-button-hover-border-color:var(--el-color-success);--el-button-active-text-color:var(--el-color-white)}.el-button--success.is-link.is-disabled,.el-button--success.is-link.is-disabled:active,.el-button--success.is-link.is-disabled:focus,.el-button--success.is-link.is-disabled:hover,.el-button--success.is-plain.is-disabled,.el-button--success.is-plain.is-disabled:active,.el-button--success.is-plain.is-disabled:focus,.el-button--success.is-plain.is-disabled:hover,.el-button--success.is-text.is-disabled,.el-button--success.is-text.is-disabled:active,.el-button--success.is-text.is-disabled:focus,.el-button--success.is-text.is-disabled:hover{color:var(--el-color-success-light-5);background-color:var(--el-color-success-light-9);border-color:var(--el-color-success-light-8)}.el-button--warning{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-warning);--el-button-border-color:var(--el-color-warning);--el-button-outline-color:var(--el-color-warning-light-5);--el-button-active-color:var(--el-color-warning-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-warning-light-5);--el-button-hover-bg-color:var(--el-color-warning-light-3);--el-button-hover-border-color:var(--el-color-warning-light-3);--el-button-active-bg-color:var(--el-color-warning-dark-2);--el-button-active-border-color:var(--el-color-warning-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-warning-light-5);--el-button-disabled-border-color:var(--el-color-warning-light-5)}.el-button--warning.is-link,.el-button--warning.is-plain,.el-button--warning.is-text{--el-button-text-color:var(--el-color-warning);--el-button-bg-color:var(--el-color-warning-light-9);--el-button-border-color:var(--el-color-warning-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-warning);--el-button-hover-border-color:var(--el-color-warning);--el-button-active-text-color:var(--el-color-white)}.el-button--warning.is-link.is-disabled,.el-button--warning.is-link.is-disabled:active,.el-button--warning.is-link.is-disabled:focus,.el-button--warning.is-link.is-disabled:hover,.el-button--warning.is-plain.is-disabled,.el-button--warning.is-plain.is-disabled:active,.el-button--warning.is-plain.is-disabled:focus,.el-button--warning.is-plain.is-disabled:hover,.el-button--warning.is-text.is-disabled,.el-button--warning.is-text.is-disabled:active,.el-button--warning.is-text.is-disabled:focus,.el-button--warning.is-text.is-disabled:hover{color:var(--el-color-warning-light-5);background-color:var(--el-color-warning-light-9);border-color:var(--el-color-warning-light-8)}.el-button--danger{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-danger);--el-button-border-color:var(--el-color-danger);--el-button-outline-color:var(--el-color-danger-light-5);--el-button-active-color:var(--el-color-danger-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-danger-light-5);--el-button-hover-bg-color:var(--el-color-danger-light-3);--el-button-hover-border-color:var(--el-color-danger-light-3);--el-button-active-bg-color:var(--el-color-danger-dark-2);--el-button-active-border-color:var(--el-color-danger-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-danger-light-5);--el-button-disabled-border-color:var(--el-color-danger-light-5)}.el-button--danger.is-link,.el-button--danger.is-plain,.el-button--danger.is-text{--el-button-text-color:var(--el-color-danger);--el-button-bg-color:var(--el-color-danger-light-9);--el-button-border-color:var(--el-color-danger-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-danger);--el-button-hover-border-color:var(--el-color-danger);--el-button-active-text-color:var(--el-color-white)}.el-button--danger.is-link.is-disabled,.el-button--danger.is-link.is-disabled:active,.el-button--danger.is-link.is-disabled:focus,.el-button--danger.is-link.is-disabled:hover,.el-button--danger.is-plain.is-disabled,.el-button--danger.is-plain.is-disabled:active,.el-button--danger.is-plain.is-disabled:focus,.el-button--danger.is-plain.is-disabled:hover,.el-button--danger.is-text.is-disabled,.el-button--danger.is-text.is-disabled:active,.el-button--danger.is-text.is-disabled:focus,.el-button--danger.is-text.is-disabled:hover{color:var(--el-color-danger-light-5);background-color:var(--el-color-danger-light-9);border-color:var(--el-color-danger-light-8)}.el-button--info{--el-button-text-color:var(--el-color-white);--el-button-bg-color:var(--el-color-info);--el-button-border-color:var(--el-color-info);--el-button-outline-color:var(--el-color-info-light-5);--el-button-active-color:var(--el-color-info-dark-2);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-link-text-color:var(--el-color-info-light-5);--el-button-hover-bg-color:var(--el-color-info-light-3);--el-button-hover-border-color:var(--el-color-info-light-3);--el-button-active-bg-color:var(--el-color-info-dark-2);--el-button-active-border-color:var(--el-color-info-dark-2);--el-button-disabled-text-color:var(--el-color-white);--el-button-disabled-bg-color:var(--el-color-info-light-5);--el-button-disabled-border-color:var(--el-color-info-light-5)}.el-button--info.is-link,.el-button--info.is-plain,.el-button--info.is-text{--el-button-text-color:var(--el-color-info);--el-button-bg-color:var(--el-color-info-light-9);--el-button-border-color:var(--el-color-info-light-5);--el-button-hover-text-color:var(--el-color-white);--el-button-hover-bg-color:var(--el-color-info);--el-button-hover-border-color:var(--el-color-info);--el-button-active-text-color:var(--el-color-white)}.el-button--info.is-link.is-disabled,.el-button--info.is-link.is-disabled:active,.el-button--info.is-link.is-disabled:focus,.el-button--info.is-link.is-disabled:hover,.el-button--info.is-plain.is-disabled,.el-button--info.is-plain.is-disabled:active,.el-button--info.is-plain.is-disabled:focus,.el-button--info.is-plain.is-disabled:hover,.el-button--info.is-text.is-disabled,.el-button--info.is-text.is-disabled:active,.el-button--info.is-text.is-disabled:focus,.el-button--info.is-text.is-disabled:hover{color:var(--el-color-info-light-5);background-color:var(--el-color-info-light-9);border-color:var(--el-color-info-light-8)}.el-button--large{--el-button-size:40px;height:var(--el-button-size);padding:12px 19px;font-size:var(--el-font-size-base);border-radius:var(--el-border-radius-base)}.el-button--large [class*=el-icon]+span{margin-left:8px}.el-button--large.is-round{padding:12px 19px}.el-button--large.is-circle{width:var(--el-button-size);padding:12px}.el-button--small{--el-button-size:24px;height:var(--el-button-size);padding:5px 11px;font-size:12px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-button--small [class*=el-icon]+span{margin-left:4px}.el-button--small.is-round{padding:5px 11px}.el-button--small.is-circle{width:var(--el-button-size);padding:5px}.el-calendar{--el-calendar-border:var(--el-table-border, 1px solid var(--el-border-color-lighter));--el-calendar-header-border-bottom:var(--el-calendar-border);--el-calendar-selected-bg-color:var(--el-color-primary-light-9);--el-calendar-cell-width:85px;background-color:var(--el-fill-color-blank)}.el-calendar__header{display:flex;justify-content:space-between;padding:12px 20px;border-bottom:var(--el-calendar-header-border-bottom)}.el-calendar__title{color:var(--el-text-color);align-self:center}.el-calendar__body{padding:12px 20px 35px}.el-calendar-table{table-layout:fixed;width:100%}.el-calendar-table thead th{padding:12px 0;color:var(--el-text-color-regular);font-weight:400}.el-calendar-table:not(.is-range) td.next,.el-calendar-table:not(.is-range) td.prev{color:var(--el-text-color-placeholder)}.el-calendar-table td{border-bottom:var(--el-calendar-border);border-right:var(--el-calendar-border);vertical-align:top;transition:background-color var(--el-transition-duration-fast) ease}.el-calendar-table td.is-selected{background-color:var(--el-calendar-selected-bg-color)}.el-calendar-table td.is-today{color:var(--el-color-primary)}.el-calendar-table tr:first-child td{border-top:var(--el-calendar-border)}.el-calendar-table tr td:first-child{border-left:var(--el-calendar-border)}.el-calendar-table tr.el-calendar-table__row--hide-border td{border-top:none}.el-calendar-table .el-calendar-day{box-sizing:border-box;padding:8px;height:var(--el-calendar-cell-width)}.el-calendar-table .el-calendar-day:hover{cursor:pointer;background-color:var(--el-calendar-selected-bg-color)}.el-card{--el-card-border-color:var(--el-border-color-light);--el-card-border-radius:4px;--el-card-padding:20px;--el-card-bg-color:var(--el-fill-color-blank)}.el-card{border-radius:var(--el-card-border-radius);border:1px solid var(--el-card-border-color);background-color:var(--el-card-bg-color);overflow:hidden;color:var(--el-text-color-primary);transition:var(--el-transition-duration)}.el-card.is-always-shadow{box-shadow:var(--el-box-shadow-light)}.el-card.is-hover-shadow:focus,.el-card.is-hover-shadow:hover{box-shadow:var(--el-box-shadow-light)}.el-card__header{padding:calc(var(--el-card-padding) - 2px) var(--el-card-padding);border-bottom:1px solid var(--el-card-border-color);box-sizing:border-box}.el-card__body{padding:var(--el-card-padding)}.el-carousel__item{position:absolute;top:0;left:0;width:100%;height:100%;display:inline-block;overflow:hidden;z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-active{z-index:calc(var(--el-index-normal) - 1)}.el-carousel__item.is-animating{transition:transform .4s ease-in-out}.el-carousel__item--card{width:50%;transition:transform .4s ease-in-out}.el-carousel__item--card.is-in-stage{cursor:pointer;z-index:var(--el-index-normal)}.el-carousel__item--card.is-in-stage.is-hover .el-carousel__mask,.el-carousel__item--card.is-in-stage:hover .el-carousel__mask{opacity:.12}.el-carousel__item--card.is-active{z-index:calc(var(--el-index-normal) + 1)}.el-carousel__mask{position:absolute;width:100%;height:100%;top:0;left:0;background-color:var(--el-color-white);opacity:.24;transition:var(--el-transition-duration-fast)}.el-carousel{--el-carousel-arrow-font-size:12px;--el-carousel-arrow-size:36px;--el-carousel-arrow-background:rgba(31, 45, 61, .11);--el-carousel-arrow-hover-background:rgba(31, 45, 61, .23);--el-carousel-indicator-width:30px;--el-carousel-indicator-height:2px;--el-carousel-indicator-padding-horizontal:4px;--el-carousel-indicator-padding-vertical:12px;--el-carousel-indicator-out-color:var(--el-border-color-hover);position:relative}.el-carousel--horizontal{overflow-x:hidden}.el-carousel--vertical{overflow-y:hidden}.el-carousel__container{position:relative;height:300px}.el-carousel__arrow{border:none;outline:0;padding:0;margin:0;height:var(--el-carousel-arrow-size);width:var(--el-carousel-arrow-size);cursor:pointer;transition:var(--el-transition-duration);border-radius:50%;background-color:var(--el-carousel-arrow-background);color:#fff;position:absolute;top:50%;z-index:10;transform:translateY(-50%);text-align:center;font-size:var(--el-carousel-arrow-font-size);display:inline-flex;justify-content:center;align-items:center}.el-carousel__arrow--left{left:16px}.el-carousel__arrow--right{right:16px}.el-carousel__arrow:hover{background-color:var(--el-carousel-arrow-hover-background)}.el-carousel__arrow i{cursor:pointer}.el-carousel__indicators{position:absolute;list-style:none;margin:0;padding:0;z-index:calc(var(--el-index-normal) + 1)}.el-carousel__indicators--horizontal{bottom:0;left:50%;transform:translate(-50%)}.el-carousel__indicators--vertical{right:0;top:50%;transform:translateY(-50%)}.el-carousel__indicators--outside{bottom:calc(var(--el-carousel-indicator-height) + var(--el-carousel-indicator-padding-vertical) * 2);text-align:center;position:static;transform:none}.el-carousel__indicators--outside .el-carousel__indicator:hover button{opacity:.64}.el-carousel__indicators--outside button{background-color:var(--el-carousel-indicator-out-color);opacity:.24}.el-carousel__indicators--labels{left:0;right:0;transform:none;text-align:center}.el-carousel__indicators--labels .el-carousel__button{height:auto;width:auto;padding:2px 18px;font-size:12px;color:#000}.el-carousel__indicators--labels .el-carousel__indicator{padding:6px 4px}.el-carousel__indicator{background-color:transparent;cursor:pointer}.el-carousel__indicator:hover button{opacity:.72}.el-carousel__indicator--horizontal{display:inline-block;padding:var(--el-carousel-indicator-padding-vertical) var(--el-carousel-indicator-padding-horizontal)}.el-carousel__indicator--vertical{padding:var(--el-carousel-indicator-padding-horizontal) var(--el-carousel-indicator-padding-vertical)}.el-carousel__indicator--vertical .el-carousel__button{width:var(--el-carousel-indicator-height);height:calc(var(--el-carousel-indicator-width)/ 2)}.el-carousel__indicator.is-active button{opacity:1}.el-carousel__button{display:block;opacity:.48;width:var(--el-carousel-indicator-width);height:var(--el-carousel-indicator-height);background-color:#fff;border:none;outline:0;padding:0;margin:0;cursor:pointer;transition:var(--el-transition-duration)}.carousel-arrow-left-enter-from,.carousel-arrow-left-leave-active{transform:translateY(-50%) translate(-10px);opacity:0}.carousel-arrow-right-enter-from,.carousel-arrow-right-leave-active{transform:translateY(-50%) translate(10px);opacity:0}.el-cascader-panel{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader-panel{display:flex;border-radius:var(--el-cascader-menu-radius);font-size:var(--el-cascader-menu-font-size)}.el-cascader-panel.is-bordered{border:var(--el-cascader-menu-border);border-radius:var(--el-cascader-menu-radius)}.el-cascader-menu{min-width:180px;box-sizing:border-box;color:var(--el-cascader-menu-text-color);border-right:var(--el-cascader-menu-border)}.el-cascader-menu:last-child{border-right:none}.el-cascader-menu:last-child .el-cascader-node{padding-right:20px}.el-cascader-menu__wrap.el-scrollbar__wrap{height:204px}.el-cascader-menu__list{position:relative;min-height:100%;margin:0;padding:6px 0;list-style:none;box-sizing:border-box}.el-cascader-menu__hover-zone{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.el-cascader-menu__empty-text{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;color:var(--el-cascader-color-empty)}.el-cascader-menu__empty-text .is-loading{margin-right:2px}.el-cascader-node{position:relative;display:flex;align-items:center;padding:0 30px 0 20px;height:34px;line-height:34px;outline:0}.el-cascader-node.is-selectable.in-active-path{color:var(--el-cascader-menu-text-color)}.el-cascader-node.in-active-path,.el-cascader-node.is-active,.el-cascader-node.is-selectable.in-checked-path{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader-node:not(.is-disabled){cursor:pointer}.el-cascader-node:not(.is-disabled):focus,.el-cascader-node:not(.is-disabled):hover{background:var(--el-cascader-node-background-hover)}.el-cascader-node.is-disabled{color:var(--el-cascader-node-color-disabled);cursor:not-allowed}.el-cascader-node__prefix{position:absolute;left:10px}.el-cascader-node__postfix{position:absolute;right:10px}.el-cascader-node__label{flex:1;text-align:left;padding:0 8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.el-cascader-node>.el-checkbox{margin-right:0}.el-cascader-node>.el-radio{margin-right:0}.el-cascader-node>.el-radio .el-radio__label{padding-left:0}.el-cascader{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color);display:inline-block;vertical-align:middle;position:relative;font-size:var(--el-font-size-base);line-height:32px;outline:0}.el-cascader:not(.is-disabled):hover .el-input__wrapper{cursor:pointer;box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-cascader .el-input{display:flex;cursor:pointer}.el-cascader .el-input .el-input__inner{text-overflow:ellipsis;cursor:pointer}.el-cascader .el-input .el-input__suffix-inner .el-icon{height:calc(100% - 2px)}.el-cascader .el-input .el-input__suffix-inner .el-icon svg{vertical-align:middle}.el-cascader .el-input .icon-arrow-down{transition:transform var(--el-transition-duration);font-size:14px}.el-cascader .el-input .icon-arrow-down.is-reverse{transform:rotate(180deg)}.el-cascader .el-input .icon-circle-close:hover{color:var(--el-input-clear-hover-color,var(--el-text-color-secondary))}.el-cascader .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-cascader--large{font-size:14px;line-height:40px}.el-cascader--small{font-size:12px;line-height:24px}.el-cascader.is-disabled .el-cascader__label{z-index:calc(var(--el-index-normal) + 1);color:var(--el-disabled-text-color)}.el-cascader__dropdown{--el-cascader-menu-text-color:var(--el-text-color-regular);--el-cascader-menu-selected-text-color:var(--el-color-primary);--el-cascader-menu-fill:var(--el-bg-color-overlay);--el-cascader-menu-font-size:var(--el-font-size-base);--el-cascader-menu-radius:var(--el-border-radius-base);--el-cascader-menu-border:solid 1px var(--el-border-color-light);--el-cascader-menu-shadow:var(--el-box-shadow-light);--el-cascader-node-background-hover:var(--el-fill-color-light);--el-cascader-node-color-disabled:var(--el-text-color-placeholder);--el-cascader-color-empty:var(--el-text-color-placeholder);--el-cascader-tag-background:var(--el-fill-color)}.el-cascader__dropdown{font-size:var(--el-cascader-menu-font-size);border-radius:var(--el-cascader-menu-radius)}.el-cascader__dropdown.el-popper{background:var(--el-cascader-menu-fill);border:var(--el-cascader-menu-border);box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__dropdown.el-popper .el-popper__arrow:before{border:var(--el-cascader-menu-border)}.el-cascader__dropdown.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-cascader__dropdown.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-cascader__dropdown.el-popper{box-shadow:var(--el-cascader-menu-shadow)}.el-cascader__tags{position:absolute;left:0;right:30px;top:50%;transform:translateY(-50%);display:flex;flex-wrap:wrap;line-height:normal;text-align:left;box-sizing:border-box}.el-cascader__tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-cascader-tag-background)}.el-cascader__tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__collapse-tags{white-space:normal;z-index:var(--el-index-normal)}.el-cascader__collapse-tags .el-tag{display:inline-flex;align-items:center;max-width:100%;margin:2px 0 2px 6px;text-overflow:ellipsis;background:var(--el-fill-color)}.el-cascader__collapse-tags .el-tag:not(.is-hit){border-color:transparent}.el-cascader__collapse-tags .el-tag>span{flex:1;overflow:hidden;text-overflow:ellipsis}.el-cascader__collapse-tags .el-tag .el-icon-close{flex:none;background-color:var(--el-text-color-placeholder);color:var(--el-color-white)}.el-cascader__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-cascader__suggestion-panel{border-radius:var(--el-cascader-menu-radius)}.el-cascader__suggestion-list{max-height:204px;margin:0;padding:6px 0;font-size:var(--el-font-size-base);color:var(--el-cascader-menu-text-color);text-align:center}.el-cascader__suggestion-item{display:flex;justify-content:space-between;align-items:center;height:34px;padding:0 15px;text-align:left;outline:0;cursor:pointer}.el-cascader__suggestion-item:focus,.el-cascader__suggestion-item:hover{background:var(--el-cascader-node-background-hover)}.el-cascader__suggestion-item.is-checked{color:var(--el-cascader-menu-selected-text-color);font-weight:700}.el-cascader__suggestion-item>span{margin-right:10px}.el-cascader__empty-text{margin:10px 0;color:var(--el-cascader-color-empty)}.el-cascader__search-input{flex:1;height:24px;min-width:60px;margin:2px 0 2px 11px;padding:0;color:var(--el-cascader-menu-text-color);border:none;outline:0;box-sizing:border-box;background:0 0}.el-cascader__search-input::-moz-placeholder{color:transparent}.el-cascader__search-input:-ms-input-placeholder{color:transparent}.el-cascader__search-input::placeholder{color:transparent}.el-check-tag{background-color:var(--el-color-info-light-9);border-radius:var(--el-border-radius-base);color:var(--el-color-info);cursor:pointer;display:inline-block;font-size:var(--el-font-size-base);line-height:var(--el-font-size-base);padding:7px 15px;transition:var(--el-transition-all);font-weight:700}.el-check-tag:hover{background-color:var(--el-color-info-light-7)}.el-check-tag.is-checked{background-color:var(--el-color-primary-light-8);color:var(--el-color-primary)}.el-check-tag.is-checked:hover{background-color:var(--el-color-primary-light-7)}.el-checkbox-button{--el-checkbox-button-checked-bg-color:var(--el-color-primary);--el-checkbox-button-checked-text-color:var(--el-color-white);--el-checkbox-button-checked-border-color:var(--el-color-primary)}.el-checkbox-button{position:relative;display:inline-block}.el-checkbox-button__inner{display:inline-block;line-height:1;font-weight:var(--el-checkbox-font-weight);white-space:nowrap;vertical-align:middle;cursor:pointer;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button__inner.is-round{padding:8px 15px}.el-checkbox-button__inner:hover{color:var(--el-color-primary)}.el-checkbox-button__inner [class*=el-icon-]{line-height:.9}.el-checkbox-button__inner [class*=el-icon-]+span{margin-left:5px}.el-checkbox-button__original{opacity:0;outline:0;position:absolute;margin:0;z-index:-1}.el-checkbox-button.is-checked .el-checkbox-button__inner{color:var(--el-checkbox-button-checked-text-color);background-color:var(--el-checkbox-button-checked-bg-color);border-color:var(--el-checkbox-button-checked-border-color);box-shadow:-1px 0 0 0 var(--el-color-primary-light-7)}.el-checkbox-button.is-checked:first-child .el-checkbox-button__inner{border-left-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button.is-disabled .el-checkbox-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-checkbox-button.is-disabled:first-child .el-checkbox-button__inner{border-left-color:var(--el-button-disabled-border-color,var(--el-border-color-light))}.el-checkbox-button:first-child .el-checkbox-button__inner{border-left:var(--el-border);border-top-left-radius:var(--el-border-radius-base);border-bottom-left-radius:var(--el-border-radius-base);box-shadow:none!important}.el-checkbox-button.is-focus .el-checkbox-button__inner{border-color:var(--el-checkbox-button-checked-border-color)}.el-checkbox-button:last-child .el-checkbox-button__inner{border-top-right-radius:var(--el-border-radius-base);border-bottom-right-radius:var(--el-border-radius-base)}.el-checkbox-button--large .el-checkbox-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-checkbox-button--large .el-checkbox-button__inner.is-round{padding:12px 19px}.el-checkbox-button--small .el-checkbox-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-checkbox-button--small .el-checkbox-button__inner.is-round{padding:5px 11px}.el-checkbox-group{font-size:0;line-height:0}.el-checkbox{--el-checkbox-font-size:14px;--el-checkbox-font-weight:var(--el-font-weight-primary);--el-checkbox-text-color:var(--el-text-color-regular);--el-checkbox-input-height:14px;--el-checkbox-input-width:14px;--el-checkbox-border-radius:var(--el-border-radius-small);--el-checkbox-bg-color:var(--el-fill-color-blank);--el-checkbox-input-border:var(--el-border);--el-checkbox-disabled-border-color:var(--el-border-color);--el-checkbox-disabled-input-fill:var(--el-fill-color-light);--el-checkbox-disabled-icon-color:var(--el-text-color-placeholder);--el-checkbox-disabled-checked-input-fill:var(--el-border-color-extra-light);--el-checkbox-disabled-checked-input-border-color:var(--el-border-color);--el-checkbox-disabled-checked-icon-color:var(--el-text-color-placeholder);--el-checkbox-checked-text-color:var(--el-color-primary);--el-checkbox-checked-input-border-color:var(--el-color-primary);--el-checkbox-checked-bg-color:var(--el-color-primary);--el-checkbox-checked-icon-color:var(--el-color-white);--el-checkbox-input-border-color-hover:var(--el-color-primary)}.el-checkbox{color:var(--el-checkbox-text-color);font-weight:var(--el-checkbox-font-weight);font-size:var(--el-font-size-base);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:30px;height:32px}.el-checkbox.is-disabled{cursor:not-allowed}.el-checkbox.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-checkbox.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-checkbox.is-bordered.is-disabled{border-color:var(--el-border-color-lighter)}.el-checkbox.is-bordered.el-checkbox--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__label{font-size:var(--el-font-size-base)}.el-checkbox.is-bordered.el-checkbox--large .el-checkbox__inner{height:14px;width:14px}.el-checkbox.is-bordered.el-checkbox--small{padding:0 11px 0 7px;border-radius:calc(var(--el-border-radius-base) - 1px)}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner:after{height:6px;width:2px}.el-checkbox input:focus-visible+.el-checkbox__inner{outline:2px solid var(--el-checkbox-input-border-color-hover);outline-offset:1px;border-radius:var(--el-checkbox-border-radius)}.el-checkbox__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative}.el-checkbox__input.is-disabled .el-checkbox__inner{background-color:var(--el-checkbox-disabled-input-fill);border-color:var(--el-checkbox-disabled-border-color);cursor:not-allowed}.el-checkbox__input.is-disabled .el-checkbox__inner:after{cursor:not-allowed;border-color:var(--el-checkbox-disabled-icon-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner:after{border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-disabled-checked-input-fill);border-color:var(--el-checkbox-disabled-checked-input-border-color)}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner:before{background-color:var(--el-checkbox-disabled-checked-icon-color);border-color:var(--el-checkbox-disabled-checked-icon-color)}.el-checkbox__input.is-disabled+span.el-checkbox__label{color:var(--el-disabled-text-color);cursor:not-allowed}.el-checkbox__input.is-checked .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-checked .el-checkbox__inner:after{transform:rotate(45deg) scaleY(1)}.el-checkbox__input.is-checked+.el-checkbox__label{color:var(--el-checkbox-checked-text-color)}.el-checkbox__input.is-focus:not(.is-checked) .el-checkbox__original:not(:focus-visible){border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__input.is-indeterminate .el-checkbox__inner{background-color:var(--el-checkbox-checked-bg-color);border-color:var(--el-checkbox-checked-input-border-color)}.el-checkbox__input.is-indeterminate .el-checkbox__inner:before{content:"";position:absolute;display:block;background-color:var(--el-checkbox-checked-icon-color);height:2px;transform:scale(.5);left:0;right:0;top:5px}.el-checkbox__input.is-indeterminate .el-checkbox__inner:after{display:none}.el-checkbox__inner{display:inline-block;position:relative;border:var(--el-checkbox-input-border);border-radius:var(--el-checkbox-border-radius);box-sizing:border-box;width:var(--el-checkbox-input-width);height:var(--el-checkbox-input-height);background-color:var(--el-checkbox-bg-color);z-index:var(--el-index-normal);transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46),outline .25s cubic-bezier(.71,-.46,.29,1.46)}.el-checkbox__inner:hover{border-color:var(--el-checkbox-input-border-color-hover)}.el-checkbox__inner:after{box-sizing:content-box;content:"";border:1px solid var(--el-checkbox-checked-icon-color);border-left:0;border-top:0;height:7px;left:4px;position:absolute;top:1px;transform:rotate(45deg) scaleY(0);width:3px;transition:transform .15s ease-in 50ms;transform-origin:center}.el-checkbox__original{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.el-checkbox__label{display:inline-block;padding-left:8px;line-height:1;font-size:var(--el-checkbox-font-size)}.el-checkbox.el-checkbox--large{height:40px}.el-checkbox.el-checkbox--large .el-checkbox__label{font-size:14px}.el-checkbox.el-checkbox--large .el-checkbox__inner{width:14px;height:14px}.el-checkbox.el-checkbox--small{height:24px}.el-checkbox.el-checkbox--small .el-checkbox__label{font-size:12px}.el-checkbox.el-checkbox--small .el-checkbox__inner{width:12px;height:12px}.el-checkbox.el-checkbox--small .el-checkbox__input.is-indeterminate .el-checkbox__inner:before{top:4px}.el-checkbox.el-checkbox--small .el-checkbox__inner:after{width:2px;height:6px}.el-checkbox:last-of-type{margin-right:0}[class*=el-col-]{box-sizing:border-box}[class*=el-col-].is-guttered{display:block;min-height:1px}.el-col-0,.el-col-0.is-guttered{display:none}.el-col-0{max-width:0%;flex:0 0 0%}.el-col-offset-0{margin-left:0}.el-col-pull-0{position:relative;right:0}.el-col-push-0{position:relative;left:0}.el-col-1{max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-offset-1{margin-left:4.1666666667%}.el-col-pull-1{position:relative;right:4.1666666667%}.el-col-push-1{position:relative;left:4.1666666667%}.el-col-2{max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-offset-2{margin-left:8.3333333333%}.el-col-pull-2{position:relative;right:8.3333333333%}.el-col-push-2{position:relative;left:8.3333333333%}.el-col-3{max-width:12.5%;flex:0 0 12.5%}.el-col-offset-3{margin-left:12.5%}.el-col-pull-3{position:relative;right:12.5%}.el-col-push-3{position:relative;left:12.5%}.el-col-4{max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-offset-4{margin-left:16.6666666667%}.el-col-pull-4{position:relative;right:16.6666666667%}.el-col-push-4{position:relative;left:16.6666666667%}.el-col-5{max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-offset-5{margin-left:20.8333333333%}.el-col-pull-5{position:relative;right:20.8333333333%}.el-col-push-5{position:relative;left:20.8333333333%}.el-col-6{max-width:25%;flex:0 0 25%}.el-col-offset-6{margin-left:25%}.el-col-pull-6{position:relative;right:25%}.el-col-push-6{position:relative;left:25%}.el-col-7{max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-offset-7{margin-left:29.1666666667%}.el-col-pull-7{position:relative;right:29.1666666667%}.el-col-push-7{position:relative;left:29.1666666667%}.el-col-8{max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-offset-8{margin-left:33.3333333333%}.el-col-pull-8{position:relative;right:33.3333333333%}.el-col-push-8{position:relative;left:33.3333333333%}.el-col-9{max-width:37.5%;flex:0 0 37.5%}.el-col-offset-9{margin-left:37.5%}.el-col-pull-9{position:relative;right:37.5%}.el-col-push-9{position:relative;left:37.5%}.el-col-10{max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-offset-10{margin-left:41.6666666667%}.el-col-pull-10{position:relative;right:41.6666666667%}.el-col-push-10{position:relative;left:41.6666666667%}.el-col-11{max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-offset-11{margin-left:45.8333333333%}.el-col-pull-11{position:relative;right:45.8333333333%}.el-col-push-11{position:relative;left:45.8333333333%}.el-col-12{max-width:50%;flex:0 0 50%}.el-col-offset-12{margin-left:50%}.el-col-pull-12{position:relative;right:50%}.el-col-push-12{position:relative;left:50%}.el-col-13{max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-offset-13{margin-left:54.1666666667%}.el-col-pull-13{position:relative;right:54.1666666667%}.el-col-push-13{position:relative;left:54.1666666667%}.el-col-14{max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-offset-14{margin-left:58.3333333333%}.el-col-pull-14{position:relative;right:58.3333333333%}.el-col-push-14{position:relative;left:58.3333333333%}.el-col-15{max-width:62.5%;flex:0 0 62.5%}.el-col-offset-15{margin-left:62.5%}.el-col-pull-15{position:relative;right:62.5%}.el-col-push-15{position:relative;left:62.5%}.el-col-16{max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-offset-16{margin-left:66.6666666667%}.el-col-pull-16{position:relative;right:66.6666666667%}.el-col-push-16{position:relative;left:66.6666666667%}.el-col-17{max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-offset-17{margin-left:70.8333333333%}.el-col-pull-17{position:relative;right:70.8333333333%}.el-col-push-17{position:relative;left:70.8333333333%}.el-col-18{max-width:75%;flex:0 0 75%}.el-col-offset-18{margin-left:75%}.el-col-pull-18{position:relative;right:75%}.el-col-push-18{position:relative;left:75%}.el-col-19{max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-offset-19{margin-left:79.1666666667%}.el-col-pull-19{position:relative;right:79.1666666667%}.el-col-push-19{position:relative;left:79.1666666667%}.el-col-20{max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-offset-20{margin-left:83.3333333333%}.el-col-pull-20{position:relative;right:83.3333333333%}.el-col-push-20{position:relative;left:83.3333333333%}.el-col-21{max-width:87.5%;flex:0 0 87.5%}.el-col-offset-21{margin-left:87.5%}.el-col-pull-21{position:relative;right:87.5%}.el-col-push-21{position:relative;left:87.5%}.el-col-22{max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-offset-22{margin-left:91.6666666667%}.el-col-pull-22{position:relative;right:91.6666666667%}.el-col-push-22{position:relative;left:91.6666666667%}.el-col-23{max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-offset-23{margin-left:95.8333333333%}.el-col-pull-23{position:relative;right:95.8333333333%}.el-col-push-23{position:relative;left:95.8333333333%}.el-col-24{max-width:100%;flex:0 0 100%}.el-col-offset-24{margin-left:100%}.el-col-pull-24{position:relative;right:100%}.el-col-push-24{position:relative;left:100%}@media only screen and (max-width:768px){.el-col-xs-0,.el-col-xs-0.is-guttered{display:none}.el-col-xs-0{max-width:0%;flex:0 0 0%}.el-col-xs-offset-0{margin-left:0}.el-col-xs-pull-0{position:relative;right:0}.el-col-xs-push-0{position:relative;left:0}.el-col-xs-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xs-offset-1{margin-left:4.1666666667%}.el-col-xs-pull-1{position:relative;right:4.1666666667%}.el-col-xs-push-1{position:relative;left:4.1666666667%}.el-col-xs-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xs-offset-2{margin-left:8.3333333333%}.el-col-xs-pull-2{position:relative;right:8.3333333333%}.el-col-xs-push-2{position:relative;left:8.3333333333%}.el-col-xs-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xs-offset-3{margin-left:12.5%}.el-col-xs-pull-3{position:relative;right:12.5%}.el-col-xs-push-3{position:relative;left:12.5%}.el-col-xs-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xs-offset-4{margin-left:16.6666666667%}.el-col-xs-pull-4{position:relative;right:16.6666666667%}.el-col-xs-push-4{position:relative;left:16.6666666667%}.el-col-xs-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xs-offset-5{margin-left:20.8333333333%}.el-col-xs-pull-5{position:relative;right:20.8333333333%}.el-col-xs-push-5{position:relative;left:20.8333333333%}.el-col-xs-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xs-offset-6{margin-left:25%}.el-col-xs-pull-6{position:relative;right:25%}.el-col-xs-push-6{position:relative;left:25%}.el-col-xs-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xs-offset-7{margin-left:29.1666666667%}.el-col-xs-pull-7{position:relative;right:29.1666666667%}.el-col-xs-push-7{position:relative;left:29.1666666667%}.el-col-xs-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xs-offset-8{margin-left:33.3333333333%}.el-col-xs-pull-8{position:relative;right:33.3333333333%}.el-col-xs-push-8{position:relative;left:33.3333333333%}.el-col-xs-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xs-offset-9{margin-left:37.5%}.el-col-xs-pull-9{position:relative;right:37.5%}.el-col-xs-push-9{position:relative;left:37.5%}.el-col-xs-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xs-offset-10{margin-left:41.6666666667%}.el-col-xs-pull-10{position:relative;right:41.6666666667%}.el-col-xs-push-10{position:relative;left:41.6666666667%}.el-col-xs-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xs-offset-11{margin-left:45.8333333333%}.el-col-xs-pull-11{position:relative;right:45.8333333333%}.el-col-xs-push-11{position:relative;left:45.8333333333%}.el-col-xs-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xs-offset-12{margin-left:50%}.el-col-xs-pull-12{position:relative;right:50%}.el-col-xs-push-12{position:relative;left:50%}.el-col-xs-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xs-offset-13{margin-left:54.1666666667%}.el-col-xs-pull-13{position:relative;right:54.1666666667%}.el-col-xs-push-13{position:relative;left:54.1666666667%}.el-col-xs-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xs-offset-14{margin-left:58.3333333333%}.el-col-xs-pull-14{position:relative;right:58.3333333333%}.el-col-xs-push-14{position:relative;left:58.3333333333%}.el-col-xs-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xs-offset-15{margin-left:62.5%}.el-col-xs-pull-15{position:relative;right:62.5%}.el-col-xs-push-15{position:relative;left:62.5%}.el-col-xs-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xs-offset-16{margin-left:66.6666666667%}.el-col-xs-pull-16{position:relative;right:66.6666666667%}.el-col-xs-push-16{position:relative;left:66.6666666667%}.el-col-xs-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xs-offset-17{margin-left:70.8333333333%}.el-col-xs-pull-17{position:relative;right:70.8333333333%}.el-col-xs-push-17{position:relative;left:70.8333333333%}.el-col-xs-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xs-offset-18{margin-left:75%}.el-col-xs-pull-18{position:relative;right:75%}.el-col-xs-push-18{position:relative;left:75%}.el-col-xs-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xs-offset-19{margin-left:79.1666666667%}.el-col-xs-pull-19{position:relative;right:79.1666666667%}.el-col-xs-push-19{position:relative;left:79.1666666667%}.el-col-xs-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xs-offset-20{margin-left:83.3333333333%}.el-col-xs-pull-20{position:relative;right:83.3333333333%}.el-col-xs-push-20{position:relative;left:83.3333333333%}.el-col-xs-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xs-offset-21{margin-left:87.5%}.el-col-xs-pull-21{position:relative;right:87.5%}.el-col-xs-push-21{position:relative;left:87.5%}.el-col-xs-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xs-offset-22{margin-left:91.6666666667%}.el-col-xs-pull-22{position:relative;right:91.6666666667%}.el-col-xs-push-22{position:relative;left:91.6666666667%}.el-col-xs-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xs-offset-23{margin-left:95.8333333333%}.el-col-xs-pull-23{position:relative;right:95.8333333333%}.el-col-xs-push-23{position:relative;left:95.8333333333%}.el-col-xs-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xs-offset-24{margin-left:100%}.el-col-xs-pull-24{position:relative;right:100%}.el-col-xs-push-24{position:relative;left:100%}}@media only screen and (min-width:768px){.el-col-sm-0,.el-col-sm-0.is-guttered{display:none}.el-col-sm-0{max-width:0%;flex:0 0 0%}.el-col-sm-offset-0{margin-left:0}.el-col-sm-pull-0{position:relative;right:0}.el-col-sm-push-0{position:relative;left:0}.el-col-sm-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-sm-offset-1{margin-left:4.1666666667%}.el-col-sm-pull-1{position:relative;right:4.1666666667%}.el-col-sm-push-1{position:relative;left:4.1666666667%}.el-col-sm-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-sm-offset-2{margin-left:8.3333333333%}.el-col-sm-pull-2{position:relative;right:8.3333333333%}.el-col-sm-push-2{position:relative;left:8.3333333333%}.el-col-sm-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-sm-offset-3{margin-left:12.5%}.el-col-sm-pull-3{position:relative;right:12.5%}.el-col-sm-push-3{position:relative;left:12.5%}.el-col-sm-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-sm-offset-4{margin-left:16.6666666667%}.el-col-sm-pull-4{position:relative;right:16.6666666667%}.el-col-sm-push-4{position:relative;left:16.6666666667%}.el-col-sm-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-sm-offset-5{margin-left:20.8333333333%}.el-col-sm-pull-5{position:relative;right:20.8333333333%}.el-col-sm-push-5{position:relative;left:20.8333333333%}.el-col-sm-6{display:block;max-width:25%;flex:0 0 25%}.el-col-sm-offset-6{margin-left:25%}.el-col-sm-pull-6{position:relative;right:25%}.el-col-sm-push-6{position:relative;left:25%}.el-col-sm-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-sm-offset-7{margin-left:29.1666666667%}.el-col-sm-pull-7{position:relative;right:29.1666666667%}.el-col-sm-push-7{position:relative;left:29.1666666667%}.el-col-sm-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-sm-offset-8{margin-left:33.3333333333%}.el-col-sm-pull-8{position:relative;right:33.3333333333%}.el-col-sm-push-8{position:relative;left:33.3333333333%}.el-col-sm-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-sm-offset-9{margin-left:37.5%}.el-col-sm-pull-9{position:relative;right:37.5%}.el-col-sm-push-9{position:relative;left:37.5%}.el-col-sm-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-sm-offset-10{margin-left:41.6666666667%}.el-col-sm-pull-10{position:relative;right:41.6666666667%}.el-col-sm-push-10{position:relative;left:41.6666666667%}.el-col-sm-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-sm-offset-11{margin-left:45.8333333333%}.el-col-sm-pull-11{position:relative;right:45.8333333333%}.el-col-sm-push-11{position:relative;left:45.8333333333%}.el-col-sm-12{display:block;max-width:50%;flex:0 0 50%}.el-col-sm-offset-12{margin-left:50%}.el-col-sm-pull-12{position:relative;right:50%}.el-col-sm-push-12{position:relative;left:50%}.el-col-sm-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-sm-offset-13{margin-left:54.1666666667%}.el-col-sm-pull-13{position:relative;right:54.1666666667%}.el-col-sm-push-13{position:relative;left:54.1666666667%}.el-col-sm-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-sm-offset-14{margin-left:58.3333333333%}.el-col-sm-pull-14{position:relative;right:58.3333333333%}.el-col-sm-push-14{position:relative;left:58.3333333333%}.el-col-sm-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-sm-offset-15{margin-left:62.5%}.el-col-sm-pull-15{position:relative;right:62.5%}.el-col-sm-push-15{position:relative;left:62.5%}.el-col-sm-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-sm-offset-16{margin-left:66.6666666667%}.el-col-sm-pull-16{position:relative;right:66.6666666667%}.el-col-sm-push-16{position:relative;left:66.6666666667%}.el-col-sm-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-sm-offset-17{margin-left:70.8333333333%}.el-col-sm-pull-17{position:relative;right:70.8333333333%}.el-col-sm-push-17{position:relative;left:70.8333333333%}.el-col-sm-18{display:block;max-width:75%;flex:0 0 75%}.el-col-sm-offset-18{margin-left:75%}.el-col-sm-pull-18{position:relative;right:75%}.el-col-sm-push-18{position:relative;left:75%}.el-col-sm-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-sm-offset-19{margin-left:79.1666666667%}.el-col-sm-pull-19{position:relative;right:79.1666666667%}.el-col-sm-push-19{position:relative;left:79.1666666667%}.el-col-sm-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-sm-offset-20{margin-left:83.3333333333%}.el-col-sm-pull-20{position:relative;right:83.3333333333%}.el-col-sm-push-20{position:relative;left:83.3333333333%}.el-col-sm-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-sm-offset-21{margin-left:87.5%}.el-col-sm-pull-21{position:relative;right:87.5%}.el-col-sm-push-21{position:relative;left:87.5%}.el-col-sm-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-sm-offset-22{margin-left:91.6666666667%}.el-col-sm-pull-22{position:relative;right:91.6666666667%}.el-col-sm-push-22{position:relative;left:91.6666666667%}.el-col-sm-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-sm-offset-23{margin-left:95.8333333333%}.el-col-sm-pull-23{position:relative;right:95.8333333333%}.el-col-sm-push-23{position:relative;left:95.8333333333%}.el-col-sm-24{display:block;max-width:100%;flex:0 0 100%}.el-col-sm-offset-24{margin-left:100%}.el-col-sm-pull-24{position:relative;right:100%}.el-col-sm-push-24{position:relative;left:100%}}@media only screen and (min-width:992px){.el-col-md-0,.el-col-md-0.is-guttered{display:none}.el-col-md-0{max-width:0%;flex:0 0 0%}.el-col-md-offset-0{margin-left:0}.el-col-md-pull-0{position:relative;right:0}.el-col-md-push-0{position:relative;left:0}.el-col-md-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-md-offset-1{margin-left:4.1666666667%}.el-col-md-pull-1{position:relative;right:4.1666666667%}.el-col-md-push-1{position:relative;left:4.1666666667%}.el-col-md-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-md-offset-2{margin-left:8.3333333333%}.el-col-md-pull-2{position:relative;right:8.3333333333%}.el-col-md-push-2{position:relative;left:8.3333333333%}.el-col-md-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-md-offset-3{margin-left:12.5%}.el-col-md-pull-3{position:relative;right:12.5%}.el-col-md-push-3{position:relative;left:12.5%}.el-col-md-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-md-offset-4{margin-left:16.6666666667%}.el-col-md-pull-4{position:relative;right:16.6666666667%}.el-col-md-push-4{position:relative;left:16.6666666667%}.el-col-md-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-md-offset-5{margin-left:20.8333333333%}.el-col-md-pull-5{position:relative;right:20.8333333333%}.el-col-md-push-5{position:relative;left:20.8333333333%}.el-col-md-6{display:block;max-width:25%;flex:0 0 25%}.el-col-md-offset-6{margin-left:25%}.el-col-md-pull-6{position:relative;right:25%}.el-col-md-push-6{position:relative;left:25%}.el-col-md-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-md-offset-7{margin-left:29.1666666667%}.el-col-md-pull-7{position:relative;right:29.1666666667%}.el-col-md-push-7{position:relative;left:29.1666666667%}.el-col-md-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-md-offset-8{margin-left:33.3333333333%}.el-col-md-pull-8{position:relative;right:33.3333333333%}.el-col-md-push-8{position:relative;left:33.3333333333%}.el-col-md-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-md-offset-9{margin-left:37.5%}.el-col-md-pull-9{position:relative;right:37.5%}.el-col-md-push-9{position:relative;left:37.5%}.el-col-md-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-md-offset-10{margin-left:41.6666666667%}.el-col-md-pull-10{position:relative;right:41.6666666667%}.el-col-md-push-10{position:relative;left:41.6666666667%}.el-col-md-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-md-offset-11{margin-left:45.8333333333%}.el-col-md-pull-11{position:relative;right:45.8333333333%}.el-col-md-push-11{position:relative;left:45.8333333333%}.el-col-md-12{display:block;max-width:50%;flex:0 0 50%}.el-col-md-offset-12{margin-left:50%}.el-col-md-pull-12{position:relative;right:50%}.el-col-md-push-12{position:relative;left:50%}.el-col-md-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-md-offset-13{margin-left:54.1666666667%}.el-col-md-pull-13{position:relative;right:54.1666666667%}.el-col-md-push-13{position:relative;left:54.1666666667%}.el-col-md-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-md-offset-14{margin-left:58.3333333333%}.el-col-md-pull-14{position:relative;right:58.3333333333%}.el-col-md-push-14{position:relative;left:58.3333333333%}.el-col-md-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-md-offset-15{margin-left:62.5%}.el-col-md-pull-15{position:relative;right:62.5%}.el-col-md-push-15{position:relative;left:62.5%}.el-col-md-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-md-offset-16{margin-left:66.6666666667%}.el-col-md-pull-16{position:relative;right:66.6666666667%}.el-col-md-push-16{position:relative;left:66.6666666667%}.el-col-md-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-md-offset-17{margin-left:70.8333333333%}.el-col-md-pull-17{position:relative;right:70.8333333333%}.el-col-md-push-17{position:relative;left:70.8333333333%}.el-col-md-18{display:block;max-width:75%;flex:0 0 75%}.el-col-md-offset-18{margin-left:75%}.el-col-md-pull-18{position:relative;right:75%}.el-col-md-push-18{position:relative;left:75%}.el-col-md-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-md-offset-19{margin-left:79.1666666667%}.el-col-md-pull-19{position:relative;right:79.1666666667%}.el-col-md-push-19{position:relative;left:79.1666666667%}.el-col-md-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-md-offset-20{margin-left:83.3333333333%}.el-col-md-pull-20{position:relative;right:83.3333333333%}.el-col-md-push-20{position:relative;left:83.3333333333%}.el-col-md-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-md-offset-21{margin-left:87.5%}.el-col-md-pull-21{position:relative;right:87.5%}.el-col-md-push-21{position:relative;left:87.5%}.el-col-md-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-md-offset-22{margin-left:91.6666666667%}.el-col-md-pull-22{position:relative;right:91.6666666667%}.el-col-md-push-22{position:relative;left:91.6666666667%}.el-col-md-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-md-offset-23{margin-left:95.8333333333%}.el-col-md-pull-23{position:relative;right:95.8333333333%}.el-col-md-push-23{position:relative;left:95.8333333333%}.el-col-md-24{display:block;max-width:100%;flex:0 0 100%}.el-col-md-offset-24{margin-left:100%}.el-col-md-pull-24{position:relative;right:100%}.el-col-md-push-24{position:relative;left:100%}}@media only screen and (min-width:1200px){.el-col-lg-0,.el-col-lg-0.is-guttered{display:none}.el-col-lg-0{max-width:0%;flex:0 0 0%}.el-col-lg-offset-0{margin-left:0}.el-col-lg-pull-0{position:relative;right:0}.el-col-lg-push-0{position:relative;left:0}.el-col-lg-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-lg-offset-1{margin-left:4.1666666667%}.el-col-lg-pull-1{position:relative;right:4.1666666667%}.el-col-lg-push-1{position:relative;left:4.1666666667%}.el-col-lg-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-lg-offset-2{margin-left:8.3333333333%}.el-col-lg-pull-2{position:relative;right:8.3333333333%}.el-col-lg-push-2{position:relative;left:8.3333333333%}.el-col-lg-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-lg-offset-3{margin-left:12.5%}.el-col-lg-pull-3{position:relative;right:12.5%}.el-col-lg-push-3{position:relative;left:12.5%}.el-col-lg-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-lg-offset-4{margin-left:16.6666666667%}.el-col-lg-pull-4{position:relative;right:16.6666666667%}.el-col-lg-push-4{position:relative;left:16.6666666667%}.el-col-lg-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-lg-offset-5{margin-left:20.8333333333%}.el-col-lg-pull-5{position:relative;right:20.8333333333%}.el-col-lg-push-5{position:relative;left:20.8333333333%}.el-col-lg-6{display:block;max-width:25%;flex:0 0 25%}.el-col-lg-offset-6{margin-left:25%}.el-col-lg-pull-6{position:relative;right:25%}.el-col-lg-push-6{position:relative;left:25%}.el-col-lg-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-lg-offset-7{margin-left:29.1666666667%}.el-col-lg-pull-7{position:relative;right:29.1666666667%}.el-col-lg-push-7{position:relative;left:29.1666666667%}.el-col-lg-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-lg-offset-8{margin-left:33.3333333333%}.el-col-lg-pull-8{position:relative;right:33.3333333333%}.el-col-lg-push-8{position:relative;left:33.3333333333%}.el-col-lg-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-lg-offset-9{margin-left:37.5%}.el-col-lg-pull-9{position:relative;right:37.5%}.el-col-lg-push-9{position:relative;left:37.5%}.el-col-lg-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-lg-offset-10{margin-left:41.6666666667%}.el-col-lg-pull-10{position:relative;right:41.6666666667%}.el-col-lg-push-10{position:relative;left:41.6666666667%}.el-col-lg-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-lg-offset-11{margin-left:45.8333333333%}.el-col-lg-pull-11{position:relative;right:45.8333333333%}.el-col-lg-push-11{position:relative;left:45.8333333333%}.el-col-lg-12{display:block;max-width:50%;flex:0 0 50%}.el-col-lg-offset-12{margin-left:50%}.el-col-lg-pull-12{position:relative;right:50%}.el-col-lg-push-12{position:relative;left:50%}.el-col-lg-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-lg-offset-13{margin-left:54.1666666667%}.el-col-lg-pull-13{position:relative;right:54.1666666667%}.el-col-lg-push-13{position:relative;left:54.1666666667%}.el-col-lg-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-lg-offset-14{margin-left:58.3333333333%}.el-col-lg-pull-14{position:relative;right:58.3333333333%}.el-col-lg-push-14{position:relative;left:58.3333333333%}.el-col-lg-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-lg-offset-15{margin-left:62.5%}.el-col-lg-pull-15{position:relative;right:62.5%}.el-col-lg-push-15{position:relative;left:62.5%}.el-col-lg-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-lg-offset-16{margin-left:66.6666666667%}.el-col-lg-pull-16{position:relative;right:66.6666666667%}.el-col-lg-push-16{position:relative;left:66.6666666667%}.el-col-lg-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-lg-offset-17{margin-left:70.8333333333%}.el-col-lg-pull-17{position:relative;right:70.8333333333%}.el-col-lg-push-17{position:relative;left:70.8333333333%}.el-col-lg-18{display:block;max-width:75%;flex:0 0 75%}.el-col-lg-offset-18{margin-left:75%}.el-col-lg-pull-18{position:relative;right:75%}.el-col-lg-push-18{position:relative;left:75%}.el-col-lg-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-lg-offset-19{margin-left:79.1666666667%}.el-col-lg-pull-19{position:relative;right:79.1666666667%}.el-col-lg-push-19{position:relative;left:79.1666666667%}.el-col-lg-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-lg-offset-20{margin-left:83.3333333333%}.el-col-lg-pull-20{position:relative;right:83.3333333333%}.el-col-lg-push-20{position:relative;left:83.3333333333%}.el-col-lg-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-lg-offset-21{margin-left:87.5%}.el-col-lg-pull-21{position:relative;right:87.5%}.el-col-lg-push-21{position:relative;left:87.5%}.el-col-lg-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-lg-offset-22{margin-left:91.6666666667%}.el-col-lg-pull-22{position:relative;right:91.6666666667%}.el-col-lg-push-22{position:relative;left:91.6666666667%}.el-col-lg-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-lg-offset-23{margin-left:95.8333333333%}.el-col-lg-pull-23{position:relative;right:95.8333333333%}.el-col-lg-push-23{position:relative;left:95.8333333333%}.el-col-lg-24{display:block;max-width:100%;flex:0 0 100%}.el-col-lg-offset-24{margin-left:100%}.el-col-lg-pull-24{position:relative;right:100%}.el-col-lg-push-24{position:relative;left:100%}}@media only screen and (min-width:1920px){.el-col-xl-0,.el-col-xl-0.is-guttered{display:none}.el-col-xl-0{max-width:0%;flex:0 0 0%}.el-col-xl-offset-0{margin-left:0}.el-col-xl-pull-0{position:relative;right:0}.el-col-xl-push-0{position:relative;left:0}.el-col-xl-1{display:block;max-width:4.1666666667%;flex:0 0 4.1666666667%}.el-col-xl-offset-1{margin-left:4.1666666667%}.el-col-xl-pull-1{position:relative;right:4.1666666667%}.el-col-xl-push-1{position:relative;left:4.1666666667%}.el-col-xl-2{display:block;max-width:8.3333333333%;flex:0 0 8.3333333333%}.el-col-xl-offset-2{margin-left:8.3333333333%}.el-col-xl-pull-2{position:relative;right:8.3333333333%}.el-col-xl-push-2{position:relative;left:8.3333333333%}.el-col-xl-3{display:block;max-width:12.5%;flex:0 0 12.5%}.el-col-xl-offset-3{margin-left:12.5%}.el-col-xl-pull-3{position:relative;right:12.5%}.el-col-xl-push-3{position:relative;left:12.5%}.el-col-xl-4{display:block;max-width:16.6666666667%;flex:0 0 16.6666666667%}.el-col-xl-offset-4{margin-left:16.6666666667%}.el-col-xl-pull-4{position:relative;right:16.6666666667%}.el-col-xl-push-4{position:relative;left:16.6666666667%}.el-col-xl-5{display:block;max-width:20.8333333333%;flex:0 0 20.8333333333%}.el-col-xl-offset-5{margin-left:20.8333333333%}.el-col-xl-pull-5{position:relative;right:20.8333333333%}.el-col-xl-push-5{position:relative;left:20.8333333333%}.el-col-xl-6{display:block;max-width:25%;flex:0 0 25%}.el-col-xl-offset-6{margin-left:25%}.el-col-xl-pull-6{position:relative;right:25%}.el-col-xl-push-6{position:relative;left:25%}.el-col-xl-7{display:block;max-width:29.1666666667%;flex:0 0 29.1666666667%}.el-col-xl-offset-7{margin-left:29.1666666667%}.el-col-xl-pull-7{position:relative;right:29.1666666667%}.el-col-xl-push-7{position:relative;left:29.1666666667%}.el-col-xl-8{display:block;max-width:33.3333333333%;flex:0 0 33.3333333333%}.el-col-xl-offset-8{margin-left:33.3333333333%}.el-col-xl-pull-8{position:relative;right:33.3333333333%}.el-col-xl-push-8{position:relative;left:33.3333333333%}.el-col-xl-9{display:block;max-width:37.5%;flex:0 0 37.5%}.el-col-xl-offset-9{margin-left:37.5%}.el-col-xl-pull-9{position:relative;right:37.5%}.el-col-xl-push-9{position:relative;left:37.5%}.el-col-xl-10{display:block;max-width:41.6666666667%;flex:0 0 41.6666666667%}.el-col-xl-offset-10{margin-left:41.6666666667%}.el-col-xl-pull-10{position:relative;right:41.6666666667%}.el-col-xl-push-10{position:relative;left:41.6666666667%}.el-col-xl-11{display:block;max-width:45.8333333333%;flex:0 0 45.8333333333%}.el-col-xl-offset-11{margin-left:45.8333333333%}.el-col-xl-pull-11{position:relative;right:45.8333333333%}.el-col-xl-push-11{position:relative;left:45.8333333333%}.el-col-xl-12{display:block;max-width:50%;flex:0 0 50%}.el-col-xl-offset-12{margin-left:50%}.el-col-xl-pull-12{position:relative;right:50%}.el-col-xl-push-12{position:relative;left:50%}.el-col-xl-13{display:block;max-width:54.1666666667%;flex:0 0 54.1666666667%}.el-col-xl-offset-13{margin-left:54.1666666667%}.el-col-xl-pull-13{position:relative;right:54.1666666667%}.el-col-xl-push-13{position:relative;left:54.1666666667%}.el-col-xl-14{display:block;max-width:58.3333333333%;flex:0 0 58.3333333333%}.el-col-xl-offset-14{margin-left:58.3333333333%}.el-col-xl-pull-14{position:relative;right:58.3333333333%}.el-col-xl-push-14{position:relative;left:58.3333333333%}.el-col-xl-15{display:block;max-width:62.5%;flex:0 0 62.5%}.el-col-xl-offset-15{margin-left:62.5%}.el-col-xl-pull-15{position:relative;right:62.5%}.el-col-xl-push-15{position:relative;left:62.5%}.el-col-xl-16{display:block;max-width:66.6666666667%;flex:0 0 66.6666666667%}.el-col-xl-offset-16{margin-left:66.6666666667%}.el-col-xl-pull-16{position:relative;right:66.6666666667%}.el-col-xl-push-16{position:relative;left:66.6666666667%}.el-col-xl-17{display:block;max-width:70.8333333333%;flex:0 0 70.8333333333%}.el-col-xl-offset-17{margin-left:70.8333333333%}.el-col-xl-pull-17{position:relative;right:70.8333333333%}.el-col-xl-push-17{position:relative;left:70.8333333333%}.el-col-xl-18{display:block;max-width:75%;flex:0 0 75%}.el-col-xl-offset-18{margin-left:75%}.el-col-xl-pull-18{position:relative;right:75%}.el-col-xl-push-18{position:relative;left:75%}.el-col-xl-19{display:block;max-width:79.1666666667%;flex:0 0 79.1666666667%}.el-col-xl-offset-19{margin-left:79.1666666667%}.el-col-xl-pull-19{position:relative;right:79.1666666667%}.el-col-xl-push-19{position:relative;left:79.1666666667%}.el-col-xl-20{display:block;max-width:83.3333333333%;flex:0 0 83.3333333333%}.el-col-xl-offset-20{margin-left:83.3333333333%}.el-col-xl-pull-20{position:relative;right:83.3333333333%}.el-col-xl-push-20{position:relative;left:83.3333333333%}.el-col-xl-21{display:block;max-width:87.5%;flex:0 0 87.5%}.el-col-xl-offset-21{margin-left:87.5%}.el-col-xl-pull-21{position:relative;right:87.5%}.el-col-xl-push-21{position:relative;left:87.5%}.el-col-xl-22{display:block;max-width:91.6666666667%;flex:0 0 91.6666666667%}.el-col-xl-offset-22{margin-left:91.6666666667%}.el-col-xl-pull-22{position:relative;right:91.6666666667%}.el-col-xl-push-22{position:relative;left:91.6666666667%}.el-col-xl-23{display:block;max-width:95.8333333333%;flex:0 0 95.8333333333%}.el-col-xl-offset-23{margin-left:95.8333333333%}.el-col-xl-pull-23{position:relative;right:95.8333333333%}.el-col-xl-push-23{position:relative;left:95.8333333333%}.el-col-xl-24{display:block;max-width:100%;flex:0 0 100%}.el-col-xl-offset-24{margin-left:100%}.el-col-xl-pull-24{position:relative;right:100%}.el-col-xl-push-24{position:relative;left:100%}}.el-collapse{--el-collapse-border-color:var(--el-border-color-lighter);--el-collapse-header-height:48px;--el-collapse-header-bg-color:var(--el-fill-color-blank);--el-collapse-header-text-color:var(--el-text-color-primary);--el-collapse-header-font-size:13px;--el-collapse-content-bg-color:var(--el-fill-color-blank);--el-collapse-content-font-size:13px;--el-collapse-content-text-color:var(--el-text-color-primary);border-top:1px solid var(--el-collapse-border-color);border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item.is-disabled .el-collapse-item__header{color:var(--el-text-color-disabled);cursor:not-allowed}.el-collapse-item__header{display:flex;align-items:center;height:var(--el-collapse-header-height);line-height:var(--el-collapse-header-height);background-color:var(--el-collapse-header-bg-color);color:var(--el-collapse-header-text-color);cursor:pointer;border-bottom:1px solid var(--el-collapse-border-color);font-size:var(--el-collapse-header-font-size);font-weight:500;transition:border-bottom-color var(--el-transition-duration);outline:0}.el-collapse-item__arrow{margin:0 8px 0 auto;transition:transform var(--el-transition-duration);font-weight:300}.el-collapse-item__arrow.is-active{transform:rotate(90deg)}.el-collapse-item__header.focusing:focus:not(:hover){color:var(--el-color-primary)}.el-collapse-item__header.is-active{border-bottom-color:transparent}.el-collapse-item__wrap{will-change:height;background-color:var(--el-collapse-content-bg-color);overflow:hidden;box-sizing:border-box;border-bottom:1px solid var(--el-collapse-border-color)}.el-collapse-item__content{padding-bottom:25px;font-size:var(--el-collapse-content-font-size);color:var(--el-collapse-content-text-color);line-height:1.7692307692}.el-collapse-item:last-child{margin-bottom:-1px}.el-color-predefine{display:flex;font-size:12px;margin-top:8px;width:280px}.el-color-predefine__colors{display:flex;flex:1;flex-wrap:wrap}.el-color-predefine__color-selector{margin:0 0 8px 8px;width:20px;height:20px;border-radius:4px;cursor:pointer}.el-color-predefine__color-selector:nth-child(10n+1){margin-left:0}.el-color-predefine__color-selector.selected{box-shadow:0 0 3px 2px var(--el-color-primary)}.el-color-predefine__color-selector>div{display:flex;height:100%;border-radius:3px}.el-color-predefine__color-selector.is-alpha{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.el-color-hue-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-color:red;padding:0 2px;float:right}.el-color-hue-slider__bar{position:relative;background:linear-gradient(to right,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%);height:100%}.el-color-hue-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-hue-slider.is-vertical{width:12px;height:180px;padding:2px 0}.el-color-hue-slider.is-vertical .el-color-hue-slider__bar{background:linear-gradient(to bottom,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}.el-color-hue-slider.is-vertical .el-color-hue-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-svpanel{position:relative;width:280px;height:180px}.el-color-svpanel__black,.el-color-svpanel__white{position:absolute;top:0;left:0;right:0;bottom:0}.el-color-svpanel__white{background:linear-gradient(to right,#fff,rgba(255,255,255,0))}.el-color-svpanel__black{background:linear-gradient(to top,#000,rgba(0,0,0,0))}.el-color-svpanel__cursor{position:absolute}.el-color-svpanel__cursor>div{cursor:head;width:4px;height:4px;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px #0000004d,0 0 1px 2px #0006;border-radius:50%;transform:translate(-2px,-2px)}.el-color-alpha-slider{position:relative;box-sizing:border-box;width:280px;height:12px;background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-alpha-slider__bar{position:relative;background:linear-gradient(to right,rgba(255,255,255,0) 0,var(--el-bg-color) 100%);height:100%}.el-color-alpha-slider__thumb{position:absolute;cursor:pointer;box-sizing:border-box;left:0;top:0;width:4px;height:100%;border-radius:1px;background:#fff;border:1px solid var(--el-border-color-lighter);box-shadow:0 0 2px #0009;z-index:1}.el-color-alpha-slider.is-vertical{width:20px;height:180px}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__bar{background:linear-gradient(to bottom,rgba(255,255,255,0) 0,#fff 100%)}.el-color-alpha-slider.is-vertical .el-color-alpha-slider__thumb{left:0;top:0;width:100%;height:4px}.el-color-dropdown{width:300px}.el-color-dropdown__main-wrapper{margin-bottom:6px}.el-color-dropdown__main-wrapper:after{content:"";display:table;clear:both}.el-color-dropdown__btns{margin-top:12px;text-align:right}.el-color-dropdown__value{float:left;line-height:26px;font-size:12px;color:#000;width:160px}.el-color-picker{display:inline-block;position:relative;line-height:normal;outline:0}.el-color-picker:hover:not(.is-disabled) .el-color-picker__trigger{border:1px solid var(--el-border-color-hover)}.el-color-picker:focus-visible:not(.is-disabled) .el-color-picker__trigger{outline:2px solid var(--el-color-primary);outline-offset:1px}.el-color-picker.is-disabled .el-color-picker__trigger{cursor:not-allowed}.el-color-picker--large{height:40px}.el-color-picker--large .el-color-picker__trigger{height:40px;width:40px}.el-color-picker--large .el-color-picker__mask{height:38px;width:38px}.el-color-picker--small{height:24px}.el-color-picker--small .el-color-picker__trigger{height:24px;width:24px}.el-color-picker--small .el-color-picker__mask{height:22px;width:22px}.el-color-picker--small .el-color-picker__empty,.el-color-picker--small .el-color-picker__icon{transform:scale(.8)}.el-color-picker__mask{height:30px;width:30px;border-radius:4px;position:absolute;top:1px;left:1px;z-index:1;cursor:not-allowed;background-color:#ffffffb3}.el-color-picker__trigger{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;height:32px;width:32px;padding:4px;border:1px solid var(--el-border-color);border-radius:4px;font-size:0;position:relative;cursor:pointer}.el-color-picker__color{position:relative;display:block;box-sizing:border-box;border:1px solid var(--el-text-color-secondary);border-radius:var(--el-border-radius-small);width:100%;height:100%;text-align:center}.el-color-picker__color.is-alpha{background-image:linear-gradient(45deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-a) 25%,var(--el-color-picker-alpha-bg-b) 25%),linear-gradient(45deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%),linear-gradient(135deg,var(--el-color-picker-alpha-bg-b) 75%,var(--el-color-picker-alpha-bg-a) 75%);background-size:12px 12px;background-position:0 0,6px 0,6px -6px,0 6px}.el-color-picker__color-inner{display:inline-flex;justify-content:center;align-items:center;width:100%;height:100%}.el-color-picker .el-color-picker__empty{font-size:12px;color:var(--el-text-color-secondary)}.el-color-picker .el-color-picker__icon{display:inline-flex;justify-content:center;align-items:center;color:#fff;font-size:12px}.el-color-picker__panel{position:absolute;z-index:10;padding:6px;box-sizing:content-box;background-color:#fff;border-radius:var(--el-border-radius-base);box-shadow:var(--el-box-shadow-light)}.el-color-picker__panel.el-popper{border:1px solid var(--el-border-color-lighter)}.el-color-picker,.el-color-picker__panel{--el-color-picker-alpha-bg-a:#ccc;--el-color-picker-alpha-bg-b:transparent}.dark .el-color-picker,.dark .el-color-picker__panel{--el-color-picker-alpha-bg-a:#333333}.el-container{display:flex;flex-direction:row;flex:1;flex-basis:auto;box-sizing:border-box;min-width:0}.el-container.is-vertical{flex-direction:column}.el-date-table{font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-date-table.is-week-mode .el-date-table__row:hover .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table.is-week-mode .el-date-table__row:hover td.available:hover{color:var(--el-datepicker-text-color)}.el-date-table.is-week-mode .el-date-table__row:hover td:first-child .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table.is-week-mode .el-date-table__row:hover td:last-child .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table.is-week-mode .el-date-table__row.current .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td{width:32px;height:30px;padding:4px 0;box-sizing:border-box;text-align:center;cursor:pointer;position:relative}.el-date-table td .el-date-table-cell{height:30px;padding:3px 0;box-sizing:border-box}.el-date-table td .el-date-table-cell .el-date-table-cell__text{width:24px;height:24px;display:block;margin:0 auto;line-height:24px;position:absolute;left:50%;transform:translate(-50%);border-radius:50%}.el-date-table td.next-month,.el-date-table td.prev-month{color:var(--el-datepicker-off-text-color)}.el-date-table td.today{position:relative}.el-date-table td.today .el-date-table-cell__text{color:var(--el-color-primary);font-weight:700}.el-date-table td.today.end-date .el-date-table-cell__text,.el-date-table td.today.start-date .el-date-table-cell__text{color:#fff}.el-date-table td.available:hover{color:var(--el-datepicker-hover-text-color)}.el-date-table td.in-range .el-date-table-cell{background-color:var(--el-datepicker-inrange-bg-color)}.el-date-table td.in-range .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.current:not(.disabled) .el-date-table-cell__text{color:#fff;background-color:var(--el-datepicker-active-color)}.el-date-table td.current:not(.disabled):focus-visible .el-date-table-cell__text{outline:2px solid var(--el-datepicker-active-color);outline-offset:1px}.el-date-table td.end-date .el-date-table-cell,.el-date-table td.start-date .el-date-table-cell{color:#fff}.el-date-table td.end-date .el-date-table-cell__text,.el-date-table td.start-date .el-date-table-cell__text{background-color:var(--el-datepicker-active-color)}.el-date-table td.start-date .el-date-table-cell{margin-left:5px;border-top-left-radius:15px;border-bottom-left-radius:15px}.el-date-table td.end-date .el-date-table-cell{margin-right:5px;border-top-right-radius:15px;border-bottom-right-radius:15px}.el-date-table td.disabled .el-date-table-cell{background-color:var(--el-fill-color-light);opacity:1;cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-date-table td.selected .el-date-table-cell{margin-left:5px;margin-right:5px;background-color:var(--el-datepicker-inrange-bg-color);border-radius:15px}.el-date-table td.selected .el-date-table-cell:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-date-table td.selected .el-date-table-cell__text{background-color:var(--el-datepicker-active-color);color:#fff;border-radius:15px}.el-date-table td.week{font-size:80%;color:var(--el-datepicker-header-text-color)}.el-date-table td:focus{outline:0}.el-date-table th{padding:5px;color:var(--el-datepicker-header-text-color);font-weight:400;border-bottom:solid 1px var(--el-border-color-lighter)}.el-month-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-month-table td{text-align:center;padding:8px 0;cursor:pointer}.el-month-table td div{height:48px;padding:6px 0;box-sizing:border-box}.el-month-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-month-table td.today.end-date .cell,.el-month-table td.today.start-date .cell{color:#fff}.el-month-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-month-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-month-table td .cell{width:60px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);margin:0 auto;border-radius:18px}.el-month-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-month-table td.in-range div{background-color:var(--el-datepicker-inrange-bg-color)}.el-month-table td.in-range div:hover{background-color:var(--el-datepicker-inrange-hover-bg-color)}.el-month-table td.end-date div,.el-month-table td.start-date div{color:#fff}.el-month-table td.end-date .cell,.el-month-table td.start-date .cell{color:#fff;background-color:var(--el-datepicker-active-color)}.el-month-table td.start-date div{border-top-left-radius:24px;border-bottom-left-radius:24px}.el-month-table td.end-date div{border-top-right-radius:24px;border-bottom-right-radius:24px}.el-month-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-month-table td:focus-visible{outline:0}.el-month-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-year-table{font-size:12px;margin:-1px;border-collapse:collapse}.el-year-table .el-icon{color:var(--el-datepicker-icon-color)}.el-year-table td{text-align:center;padding:20px 3px;cursor:pointer}.el-year-table td.today .cell{color:var(--el-color-primary);font-weight:700}.el-year-table td.disabled .cell{background-color:var(--el-fill-color-light);cursor:not-allowed;color:var(--el-text-color-placeholder)}.el-year-table td.disabled .cell:hover{color:var(--el-text-color-placeholder)}.el-year-table td .cell{width:48px;height:36px;display:block;line-height:36px;color:var(--el-datepicker-text-color);border-radius:18px;margin:0 auto}.el-year-table td .cell:hover{color:var(--el-datepicker-hover-text-color)}.el-year-table td.current:not(.disabled) .cell{color:var(--el-datepicker-active-color)}.el-year-table td:focus-visible{outline:0}.el-year-table td:focus-visible .cell{outline:2px solid var(--el-datepicker-active-color)}.el-time-spinner.has-seconds .el-time-spinner__wrapper{width:33.3%}.el-time-spinner__wrapper{max-height:192px;overflow:auto;display:inline-block;width:50%;vertical-align:top;position:relative}.el-time-spinner__wrapper.el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default){padding-bottom:15px}.el-time-spinner__wrapper.is-arrow{box-sizing:border-box;text-align:center;overflow:hidden}.el-time-spinner__wrapper.is-arrow .el-time-spinner__list{transform:translateY(-32px)}.el-time-spinner__wrapper.is-arrow .el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:default}.el-time-spinner__arrow{font-size:12px;color:var(--el-text-color-secondary);position:absolute;left:0;width:100%;z-index:var(--el-index-normal);text-align:center;height:30px;line-height:30px;cursor:pointer}.el-time-spinner__arrow:hover{color:var(--el-color-primary)}.el-time-spinner__arrow.arrow-up{top:10px}.el-time-spinner__arrow.arrow-down{bottom:10px}.el-time-spinner__input.el-input{width:70%}.el-time-spinner__input.el-input .el-input__inner{padding:0;text-align:center}.el-time-spinner__list{padding:0;margin:0;list-style:none;text-align:center}.el-time-spinner__list:after,.el-time-spinner__list:before{content:"";display:block;width:100%;height:80px}.el-time-spinner__item{height:32px;line-height:32px;font-size:12px;color:var(--el-text-color-regular)}.el-time-spinner__item:hover:not(.is-disabled):not(.is-active){background:var(--el-fill-color-light);cursor:pointer}.el-time-spinner__item.is-active:not(.is-disabled){color:var(--el-text-color-primary);font-weight:700}.el-time-spinner__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-picker__popper{--el-datepicker-border-color:var(--el-disabled-border-color)}.el-picker__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-datepicker-border-color);box-shadow:var(--el-box-shadow-light)}.el-picker__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-datepicker-border-color)}.el-picker__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-picker__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-date-editor{--el-date-editor-width:220px;--el-date-editor-monthrange-width:300px;--el-date-editor-daterange-width:350px;--el-date-editor-datetimerange-width:400px;--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary);position:relative;display:inline-block;text-align:left}.el-date-editor.el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-date-editor.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-date-editor.el-input,.el-date-editor.el-input__wrapper{width:var(--el-date-editor-width);height:var(--el-input-height,var(--el-component-size))}.el-date-editor--monthrange{--el-date-editor-width:var(--el-date-editor-monthrange-width)}.el-date-editor--daterange,.el-date-editor--timerange{--el-date-editor-width:var(--el-date-editor-daterange-width)}.el-date-editor--datetimerange{--el-date-editor-width:var(--el-date-editor-datetimerange-width)}.el-date-editor--dates .el-input__wrapper{text-overflow:ellipsis;white-space:nowrap}.el-date-editor .close-icon,.el-date-editor .clear-icon{cursor:pointer}.el-date-editor .clear-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__icon{height:inherit;font-size:14px;color:var(--el-text-color-placeholder);float:left}.el-date-editor .el-range__icon svg{vertical-align:middle}.el-date-editor .el-range-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;outline:0;display:inline-block;height:30px;line-height:30px;margin:0;padding:0;width:39%;text-align:center;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);background-color:transparent}.el-date-editor .el-range-input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-input::placeholder{color:var(--el-text-color-placeholder)}.el-date-editor .el-range-separator{flex:1;display:inline-flex;justify-content:center;align-items:center;height:100%;padding:0 5px;margin:0;font-size:14px;word-break:keep-all;color:var(--el-text-color-primary)}.el-date-editor .el-range__close-icon{font-size:14px;color:var(--el-text-color-placeholder);height:inherit;width:unset;cursor:pointer}.el-date-editor .el-range__close-icon:hover{color:var(--el-text-color-secondary)}.el-date-editor .el-range__close-icon svg{vertical-align:middle}.el-date-editor .el-range__close-icon--hidden{opacity:0;visibility:hidden}.el-range-editor.el-input__wrapper{display:inline-flex;align-items:center;padding:0 10px}.el-range-editor.is-active,.el-range-editor.is-active:hover{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-range-editor--large{line-height:var(--el-component-size-large)}.el-range-editor--large.el-input__wrapper{height:var(--el-component-size-large)}.el-range-editor--large .el-range-separator{line-height:40px;font-size:14px}.el-range-editor--large .el-range-input{height:38px;line-height:38px;font-size:14px}.el-range-editor--small{line-height:var(--el-component-size-small)}.el-range-editor--small.el-input__wrapper{height:var(--el-component-size-small)}.el-range-editor--small .el-range-separator{line-height:24px;font-size:12px}.el-range-editor--small .el-range-input{height:22px;line-height:22px;font-size:12px}.el-range-editor.is-disabled{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled:focus,.el-range-editor.is-disabled:hover{border-color:var(--el-disabled-border-color)}.el-range-editor.is-disabled input{background-color:var(--el-disabled-bg-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-range-editor.is-disabled input::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled input::placeholder{color:var(--el-text-color-placeholder)}.el-range-editor.is-disabled .el-range-separator{color:var(--el-disabled-text-color)}.el-picker-panel{color:var(--el-text-color-regular);background:var(--el-bg-color-overlay);border-radius:var(--el-border-radius-base);line-height:30px}.el-picker-panel .el-time-panel{margin:5px 0;border:solid 1px var(--el-datepicker-border-color);background-color:var(--el-bg-color-overlay);box-shadow:var(--el-box-shadow-light)}.el-picker-panel__body-wrapper:after,.el-picker-panel__body:after{content:"";display:table;clear:both}.el-picker-panel__content{position:relative;margin:15px}.el-picker-panel__footer{border-top:1px solid var(--el-datepicker-inner-border-color);padding:4px 12px;text-align:right;background-color:var(--el-bg-color-overlay);position:relative;font-size:0}.el-picker-panel__shortcut{display:block;width:100%;border:0;background-color:transparent;line-height:28px;font-size:14px;color:var(--el-datepicker-text-color);padding-left:12px;text-align:left;outline:0;cursor:pointer}.el-picker-panel__shortcut:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__shortcut.active{background-color:#e6f1fe;color:var(--el-datepicker-active-color)}.el-picker-panel__btn{border:1px solid var(--el-fill-color-darker);color:var(--el-text-color-primary);line-height:24px;border-radius:2px;padding:0 20px;cursor:pointer;background-color:transparent;outline:0;font-size:12px}.el-picker-panel__btn[disabled]{color:var(--el-text-color-disabled);cursor:not-allowed}.el-picker-panel__icon-btn{font-size:12px;color:var(--el-datepicker-icon-color);border:0;background:0 0;cursor:pointer;outline:0;margin-top:8px}.el-picker-panel__icon-btn:hover{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn:focus-visible{color:var(--el-datepicker-hover-text-color)}.el-picker-panel__icon-btn.is-disabled{color:var(--el-text-color-disabled)}.el-picker-panel__icon-btn.is-disabled:hover{cursor:not-allowed}.el-picker-panel__icon-btn .el-icon{cursor:pointer;font-size:inherit}.el-picker-panel__link-btn{vertical-align:middle}.el-picker-panel [slot=sidebar],.el-picker-panel__sidebar{position:absolute;top:0;bottom:0;width:110px;border-right:1px solid var(--el-datepicker-inner-border-color);box-sizing:border-box;padding-top:6px;background-color:var(--el-bg-color-overlay);overflow:auto}.el-picker-panel [slot=sidebar]+.el-picker-panel__body,.el-picker-panel__sidebar+.el-picker-panel__body{margin-left:110px}.el-date-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-picker{width:322px}.el-date-picker.has-sidebar.has-time{width:434px}.el-date-picker.has-sidebar{width:438px}.el-date-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-picker .el-picker-panel__content{width:292px}.el-date-picker table{table-layout:fixed;width:100%}.el-date-picker__editor-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-picker__header{margin:12px;text-align:center}.el-date-picker__header--bordered{margin-bottom:0;padding-bottom:12px;border-bottom:solid 1px var(--el-border-color-lighter)}.el-date-picker__header--bordered+.el-picker-panel__content{margin-top:0}.el-date-picker__header-label{font-size:16px;font-weight:500;padding:0 5px;line-height:22px;text-align:center;cursor:pointer;color:var(--el-text-color-regular)}.el-date-picker__header-label:hover{color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label:focus-visible{outline:0;color:var(--el-datepicker-hover-text-color)}.el-date-picker__header-label.active{color:var(--el-datepicker-active-color)}.el-date-picker__prev-btn{float:left}.el-date-picker__next-btn{float:right}.el-date-picker__time-wrap{padding:10px;text-align:center}.el-date-picker__time-label{float:left;cursor:pointer;line-height:30px;margin-left:10px}.el-date-picker .el-time-panel{position:absolute}.el-date-range-picker{--el-datepicker-text-color:var(--el-text-color-regular);--el-datepicker-off-text-color:var(--el-text-color-placeholder);--el-datepicker-header-text-color:var(--el-text-color-regular);--el-datepicker-icon-color:var(--el-text-color-primary);--el-datepicker-border-color:var(--el-disabled-border-color);--el-datepicker-inner-border-color:var(--el-border-color-light);--el-datepicker-inrange-bg-color:var(--el-border-color-extra-light);--el-datepicker-inrange-hover-bg-color:var(--el-border-color-extra-light);--el-datepicker-active-color:var(--el-color-primary);--el-datepicker-hover-text-color:var(--el-color-primary)}.el-date-range-picker{width:646px}.el-date-range-picker.has-sidebar{width:756px}.el-date-range-picker.has-time .el-picker-panel__body-wrapper{position:relative}.el-date-range-picker table{table-layout:fixed;width:100%}.el-date-range-picker .el-picker-panel__body{min-width:513px}.el-date-range-picker .el-picker-panel__content{margin:0}.el-date-range-picker__header{position:relative;text-align:center;height:28px}.el-date-range-picker__header [class*=arrow-left]{float:left}.el-date-range-picker__header [class*=arrow-right]{float:right}.el-date-range-picker__header div{font-size:16px;font-weight:500;margin-right:50px}.el-date-range-picker__content{float:left;width:50%;box-sizing:border-box;margin:0;padding:16px}.el-date-range-picker__content.is-left{border-right:1px solid var(--el-datepicker-inner-border-color)}.el-date-range-picker__content .el-date-range-picker__header div{margin-left:50px;margin-right:50px}.el-date-range-picker__editors-wrap{box-sizing:border-box;display:table-cell}.el-date-range-picker__editors-wrap.is-right{text-align:right}.el-date-range-picker__time-header{position:relative;border-bottom:1px solid var(--el-datepicker-inner-border-color);font-size:12px;padding:8px 5px 5px;display:table;width:100%;box-sizing:border-box}.el-date-range-picker__time-header>.el-icon-arrow-right{font-size:20px;vertical-align:middle;display:table-cell;color:var(--el-datepicker-icon-color)}.el-date-range-picker__time-picker-wrap{position:relative;display:table-cell;padding:0 5px}.el-date-range-picker__time-picker-wrap .el-picker-panel{position:absolute;top:13px;right:0;z-index:1;background:#fff}.el-date-range-picker__time-picker-wrap .el-time-panel{position:absolute}.el-time-range-picker{width:354px;overflow:visible}.el-time-range-picker__content{position:relative;text-align:center;padding:10px;z-index:1}.el-time-range-picker__cell{box-sizing:border-box;margin:0;padding:4px 7px 7px;width:50%;display:inline-block}.el-time-range-picker__header{margin-bottom:5px;text-align:center;font-size:14px}.el-time-range-picker__body{border-radius:2px;border:1px solid var(--el-datepicker-border-color)}.el-time-panel{border-radius:2px;position:relative;width:180px;left:0;z-index:var(--el-index-top);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;box-sizing:content-box}.el-time-panel__content{font-size:0;position:relative;overflow:hidden}.el-time-panel__content:after,.el-time-panel__content:before{content:"";top:50%;position:absolute;margin-top:-16px;height:32px;z-index:-1;left:0;right:0;box-sizing:border-box;padding-top:6px;text-align:left}.el-time-panel__content:after{left:50%;margin-left:12%;margin-right:12%}.el-time-panel__content:before{padding-left:50%;margin-right:12%;margin-left:12%;border-top:1px solid var(--el-border-color-light);border-bottom:1px solid var(--el-border-color-light)}.el-time-panel__content.has-seconds:after{left:66.6666666667%}.el-time-panel__content.has-seconds:before{padding-left:33.3333333333%}.el-time-panel__footer{border-top:1px solid var(--el-timepicker-inner-border-color,var(--el-border-color-light));padding:4px;height:36px;line-height:25px;text-align:right;box-sizing:border-box}.el-time-panel__btn{border:none;line-height:28px;padding:0 5px;margin:0 5px;cursor:pointer;background-color:transparent;outline:0;font-size:12px;color:var(--el-text-color-primary)}.el-time-panel__btn.confirm{font-weight:800;color:var(--el-timepicker-active-color,var(--el-color-primary))}.el-descriptions{--el-descriptions-table-border:1px solid var(--el-border-color-lighter);--el-descriptions-item-bordered-label-background:var(--el-fill-color-light);box-sizing:border-box;font-size:var(--el-font-size-base);color:var(--el-text-color-primary)}.el-descriptions__header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.el-descriptions__title{color:var(--el-text-color-primary);font-size:16px;font-weight:700}.el-descriptions__body{background-color:var(--el-fill-color-blank)}.el-descriptions__body .el-descriptions__table{border-collapse:collapse;width:100%}.el-descriptions__body .el-descriptions__table .el-descriptions__cell{box-sizing:border-box;text-align:left;font-weight:400;line-height:23px;font-size:14px}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-left{text-align:left}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-center{text-align:center}.el-descriptions__body .el-descriptions__table .el-descriptions__cell.is-right{text-align:right}.el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{border:var(--el-descriptions-table-border);padding:8px 11px}.el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:12px}.el-descriptions--large{font-size:14px}.el-descriptions--large .el-descriptions__header{margin-bottom:20px}.el-descriptions--large .el-descriptions__header .el-descriptions__title{font-size:16px}.el-descriptions--large .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:14px}.el-descriptions--large .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:12px 15px}.el-descriptions--large .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:16px}.el-descriptions--small{font-size:12px}.el-descriptions--small .el-descriptions__header{margin-bottom:12px}.el-descriptions--small .el-descriptions__header .el-descriptions__title{font-size:14px}.el-descriptions--small .el-descriptions__body .el-descriptions__table .el-descriptions__cell{font-size:12px}.el-descriptions--small .el-descriptions__body .el-descriptions__table.is-bordered .el-descriptions__cell{padding:4px 7px}.el-descriptions--small .el-descriptions__body .el-descriptions__table:not(.is-bordered) .el-descriptions__cell{padding-bottom:8px}.el-descriptions__label.el-descriptions__cell.is-bordered-label{font-weight:700;color:var(--el-text-color-regular);background:var(--el-descriptions-item-bordered-label-background)}.el-descriptions__label:not(.is-bordered-label){color:var(--el-text-color-primary);margin-right:16px}.el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:6px}.el-descriptions__content.el-descriptions__cell.is-bordered-content{color:var(--el-text-color-primary)}.el-descriptions__content:not(.is-bordered-label){color:var(--el-text-color-regular)}.el-descriptions--large .el-descriptions__label:not(.is-bordered-label){margin-right:16px}.el-descriptions--large .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:8px}.el-descriptions--small .el-descriptions__label:not(.is-bordered-label){margin-right:12px}.el-descriptions--small .el-descriptions__label.el-descriptions__cell:not(.is-bordered-label).is-vertical-label{padding-bottom:4px}:root{--el-popup-modal-bg-color:var(--el-color-black);--el-popup-modal-opacity:.5}.v-modal-enter{-webkit-animation:v-modal-in var(--el-transition-duration-fast) ease;animation:v-modal-in var(--el-transition-duration-fast) ease}.v-modal-leave{-webkit-animation:v-modal-out var(--el-transition-duration-fast) ease forwards;animation:v-modal-out var(--el-transition-duration-fast) ease forwards}@-webkit-keyframes v-modal-in{0%{opacity:0}}@keyframes v-modal-in{0%{opacity:0}}@-webkit-keyframes v-modal-out{to{opacity:0}}@keyframes v-modal-out{to{opacity:0}}.v-modal{position:fixed;left:0;top:0;width:100%;height:100%;opacity:var(--el-popup-modal-opacity);background:var(--el-popup-modal-bg-color)}.el-popup-parent--hidden{overflow:hidden}.el-dialog{--el-dialog-width:50%;--el-dialog-margin-top:15vh;--el-dialog-bg-color:var(--el-bg-color);--el-dialog-box-shadow:var(--el-box-shadow);--el-dialog-title-font-size:var(--el-font-size-large);--el-dialog-content-font-size:14px;--el-dialog-font-line-height:var(--el-font-line-height-primary);--el-dialog-padding-primary:20px;--el-dialog-border-radius:var(--el-border-radius-small);position:relative;margin:var(--el-dialog-margin-top,15vh) auto 50px;background:var(--el-dialog-bg-color);border-radius:var(--el-dialog-border-radius);box-shadow:var(--el-dialog-box-shadow);box-sizing:border-box;width:var(--el-dialog-width,50%)}.el-dialog:focus{outline:0!important}.el-dialog.is-align-center{margin:auto}.el-dialog.is-fullscreen{--el-dialog-width:100%;--el-dialog-margin-top:0;margin-bottom:0;height:100%;overflow:auto}.el-dialog__wrapper{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto;margin:0}.el-dialog.is-draggable .el-dialog__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-dialog__header{padding:var(--el-dialog-padding-primary);padding-bottom:10px;margin-right:16px}.el-dialog__headerbtn{position:absolute;top:6px;right:0;padding:0;width:54px;height:54px;background:0 0;border:none;outline:0;cursor:pointer;font-size:var(--el-message-close-size,16px)}.el-dialog__headerbtn .el-dialog__close{color:var(--el-color-info);font-size:inherit}.el-dialog__headerbtn:focus .el-dialog__close,.el-dialog__headerbtn:hover .el-dialog__close{color:var(--el-color-primary)}.el-dialog__title{line-height:var(--el-dialog-font-line-height);font-size:var(--el-dialog-title-font-size);color:var(--el-text-color-primary)}.el-dialog__body{padding:calc(var(--el-dialog-padding-primary) + 10px) var(--el-dialog-padding-primary);color:var(--el-text-color-regular);font-size:var(--el-dialog-content-font-size)}.el-dialog__footer{padding:var(--el-dialog-padding-primary);padding-top:10px;text-align:right;box-sizing:border-box}.el-dialog--center{text-align:center}.el-dialog--center .el-dialog__body{text-align:initial;padding:25px calc(var(--el-dialog-padding-primary) + 5px) 30px}.el-dialog--center .el-dialog__footer{text-align:inherit}.el-overlay-dialog{position:fixed;top:0;right:0;bottom:0;left:0;overflow:auto}.dialog-fade-enter-active{-webkit-animation:modal-fade-in var(--el-transition-duration);animation:modal-fade-in var(--el-transition-duration)}.dialog-fade-enter-active .el-overlay-dialog{-webkit-animation:dialog-fade-in var(--el-transition-duration);animation:dialog-fade-in var(--el-transition-duration)}.dialog-fade-leave-active{-webkit-animation:modal-fade-out var(--el-transition-duration);animation:modal-fade-out var(--el-transition-duration)}.dialog-fade-leave-active .el-overlay-dialog{-webkit-animation:dialog-fade-out var(--el-transition-duration);animation:dialog-fade-out var(--el-transition-duration)}@-webkit-keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes dialog-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes dialog-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@-webkit-keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@keyframes modal-fade-in{0%{opacity:0}to{opacity:1}}@-webkit-keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}@keyframes modal-fade-out{0%{opacity:1}to{opacity:0}}.el-divider{position:relative}.el-divider--horizontal{display:block;height:1px;width:100%;margin:24px 0;border-top:1px var(--el-border-color) var(--el-border-style)}.el-divider--vertical{display:inline-block;width:1px;height:1em;margin:0 8px;vertical-align:middle;position:relative;border-left:1px var(--el-border-color) var(--el-border-style)}.el-divider__text{position:absolute;background-color:var(--el-bg-color);padding:0 20px;font-weight:500;color:var(--el-text-color-primary);font-size:14px}.el-divider__text.is-left{left:20px;transform:translateY(-50%)}.el-divider__text.is-center{left:50%;transform:translate(-50%) translateY(-50%)}.el-divider__text.is-right{right:20px;transform:translateY(-50%)}.el-drawer{--el-drawer-bg-color:var(--el-dialog-bg-color, var(--el-bg-color));--el-drawer-padding-primary:var(--el-dialog-padding-primary, 20px)}.el-drawer{position:absolute;box-sizing:border-box;background-color:var(--el-drawer-bg-color);display:flex;flex-direction:column;box-shadow:var(--el-box-shadow-dark);overflow:hidden;transition:all var(--el-transition-duration)}.el-drawer .rtl,.el-drawer .ltr,.el-drawer .ttb,.el-drawer .btt{transform:translate(0)}.el-drawer__sr-focus:focus{outline:0!important}.el-drawer__header{align-items:center;color:#72767b;display:flex;margin-bottom:32px;padding:var(--el-drawer-padding-primary);padding-bottom:0}.el-drawer__header>:first-child{flex:1}.el-drawer__title{margin:0;flex:1;line-height:inherit;font-size:1rem}.el-drawer__footer{padding:var(--el-drawer-padding-primary);padding-top:10px;text-align:right}.el-drawer__close-btn{display:inline-flex;border:none;cursor:pointer;font-size:var(--el-font-size-extra-large);color:inherit;background-color:transparent;outline:0}.el-drawer__close-btn:focus i,.el-drawer__close-btn:hover i{color:var(--el-color-primary)}.el-drawer__body{flex:1;padding:var(--el-drawer-padding-primary);overflow:auto}.el-drawer__body>*{box-sizing:border-box}.el-drawer.ltr,.el-drawer.rtl{height:100%;top:0;bottom:0}.el-drawer.btt,.el-drawer.ttb{width:100%;left:0;right:0}.el-drawer.ltr{left:0}.el-drawer.rtl{right:0}.el-drawer.ttb{top:0}.el-drawer.btt{bottom:0}.el-drawer-fade-enter-active,.el-drawer-fade-leave-active{transition:all var(--el-transition-duration)}.el-drawer-fade-enter-active,.el-drawer-fade-enter-from,.el-drawer-fade-enter-to,.el-drawer-fade-leave-active,.el-drawer-fade-leave-from,.el-drawer-fade-leave-to{overflow:hidden!important}.el-drawer-fade-enter-from,.el-drawer-fade-leave-to{opacity:0}.el-drawer-fade-enter-to,.el-drawer-fade-leave-from{opacity:1}.el-drawer-fade-enter-from .rtl,.el-drawer-fade-leave-to .rtl{transform:translate(100%)}.el-drawer-fade-enter-from .ltr,.el-drawer-fade-leave-to .ltr{transform:translate(-100%)}.el-drawer-fade-enter-from .ttb,.el-drawer-fade-leave-to .ttb{transform:translateY(-100%)}.el-drawer-fade-enter-from .btt,.el-drawer-fade-leave-to .btt{transform:translateY(100%)}.el-dropdown{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10;display:inline-flex;position:relative;color:var(--el-text-color-regular);font-size:var(--el-font-size-base);line-height:1;vertical-align:top}.el-dropdown.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-dropdown__popper{--el-dropdown-menu-box-shadow:var(--el-box-shadow-light);--el-dropdown-menuItem-hover-fill:var(--el-color-primary-light-9);--el-dropdown-menuItem-hover-color:var(--el-color-primary);--el-dropdown-menu-index:10}.el-dropdown__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-dropdown-menu-box-shadow)}.el-dropdown__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-dropdown__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-dropdown__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-dropdown__popper .el-dropdown-menu{border:none}.el-dropdown__popper .el-dropdown__popper-selfdefine{outline:0}.el-dropdown__popper .el-scrollbar__bar{z-index:calc(var(--el-dropdown-menu-index) + 1)}.el-dropdown__popper .el-dropdown__list{list-style:none;padding:0;margin:0;box-sizing:border-box}.el-dropdown .el-dropdown__caret-button{padding-left:0;padding-right:0;display:inline-flex;justify-content:center;align-items:center;width:32px;border-left:none}.el-dropdown .el-dropdown__caret-button>span{display:inline-flex}.el-dropdown .el-dropdown__caret-button:before{content:"";position:absolute;display:block;width:1px;top:-1px;bottom:-1px;left:0;background:var(--el-overlay-color-lighter)}.el-dropdown .el-dropdown__caret-button.el-button:before{background:var(--el-border-color);opacity:.5}.el-dropdown .el-dropdown__caret-button .el-dropdown__icon{font-size:inherit;padding-left:0}.el-dropdown .el-dropdown-selfdefine{outline:0}.el-dropdown--large .el-dropdown__caret-button{width:40px}.el-dropdown--small .el-dropdown__caret-button{width:24px}.el-dropdown-menu{position:relative;top:0;left:0;z-index:var(--el-dropdown-menu-index);padding:5px 0;margin:0;background-color:var(--el-bg-color-overlay);border:none;border-radius:var(--el-border-radius-base);box-shadow:none;list-style:none}.el-dropdown-menu__item{display:flex;align-items:center;white-space:nowrap;list-style:none;line-height:22px;padding:5px 16px;margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);cursor:pointer;outline:0}.el-dropdown-menu__item:not(.is-disabled):focus{background-color:var(--el-dropdown-menuItem-hover-fill);color:var(--el-dropdown-menuItem-hover-color)}.el-dropdown-menu__item i{margin-right:5px}.el-dropdown-menu__item--divided{margin:6px 0;border-top:1px solid var(--el-border-color-lighter)}.el-dropdown-menu__item.is-disabled{cursor:not-allowed;color:var(--el-text-color-disabled)}.el-dropdown-menu--large{padding:7px 0}.el-dropdown-menu--large .el-dropdown-menu__item{padding:7px 20px;line-height:22px;font-size:14px}.el-dropdown-menu--large .el-dropdown-menu__item--divided{margin:8px 0}.el-dropdown-menu--small{padding:3px 0}.el-dropdown-menu--small .el-dropdown-menu__item{padding:2px 12px;line-height:20px;font-size:12px}.el-dropdown-menu--small .el-dropdown-menu__item--divided{margin:4px 0}.el-empty{--el-empty-padding:40px 0;--el-empty-image-width:160px;--el-empty-description-margin-top:20px;--el-empty-bottom-margin-top:20px;--el-empty-fill-color-0:var(--el-color-white);--el-empty-fill-color-1:#fcfcfd;--el-empty-fill-color-2:#f8f9fb;--el-empty-fill-color-3:#f7f8fc;--el-empty-fill-color-4:#eeeff3;--el-empty-fill-color-5:#edeef2;--el-empty-fill-color-6:#e9ebef;--el-empty-fill-color-7:#e5e7e9;--el-empty-fill-color-8:#e0e3e9;--el-empty-fill-color-9:#d5d7de;display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-empty-padding)}.el-empty__image{width:var(--el-empty-image-width)}.el-empty__image img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;height:100%;vertical-align:top;-o-object-fit:contain;object-fit:contain}.el-empty__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:100%;height:100%;vertical-align:top}.el-empty__description{margin-top:var(--el-empty-description-margin-top)}.el-empty__description p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-secondary)}.el-empty__bottom{margin-top:var(--el-empty-bottom-margin-top)}.el-footer{--el-footer-padding:0 20px;--el-footer-height:60px;padding:var(--el-footer-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-footer-height)}.el-form{--el-form-label-font-size:var(--el-font-size-base)}.el-form--label-left .el-form-item__label{justify-content:flex-start}.el-form--label-top .el-form-item{display:block}.el-form--label-top .el-form-item .el-form-item__label{display:block;height:auto;text-align:left;margin-bottom:8px;line-height:22px}.el-form--inline .el-form-item{display:inline-flex;vertical-align:middle;margin-right:32px}.el-form--inline.el-form--label-top{display:flex;flex-wrap:wrap}.el-form--inline.el-form--label-top .el-form-item{display:block}.el-form--large.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:12px;line-height:22px}.el-form--default.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:8px;line-height:22px}.el-form--small.el-form--label-top .el-form-item .el-form-item__label{margin-bottom:4px;line-height:20px}.el-form-item{display:flex;--font-size:14px;margin-bottom:18px}.el-form-item .el-form-item{margin-bottom:0}.el-form-item .el-input__validateIcon{display:none}.el-form-item--large{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:22px}.el-form-item--large .el-form-item__label{height:40px;line-height:40px}.el-form-item--large .el-form-item__content{line-height:40px}.el-form-item--large .el-form-item__error{padding-top:4px}.el-form-item--default{--font-size:14px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--default .el-form-item__label{height:32px;line-height:32px}.el-form-item--default .el-form-item__content{line-height:32px}.el-form-item--default .el-form-item__error{padding-top:2px}.el-form-item--small{--font-size:12px;--el-form-label-font-size:var(--font-size);margin-bottom:18px}.el-form-item--small .el-form-item__label{height:24px;line-height:24px}.el-form-item--small .el-form-item__content{line-height:24px}.el-form-item--small .el-form-item__error{padding-top:2px}.el-form-item__label-wrap{display:flex}.el-form-item__label{display:inline-flex;justify-content:flex-end;align-items:flex-start;flex:0 0 auto;font-size:var(--el-form-label-font-size);color:var(--el-text-color-regular);height:32px;line-height:32px;padding:0 12px 0 0;box-sizing:border-box}.el-form-item__content{display:flex;flex-wrap:wrap;align-items:center;flex:1;line-height:32px;position:relative;font-size:var(--font-size);min-width:0}.el-form-item__content .el-input-group{vertical-align:top}.el-form-item__error{color:var(--el-color-danger);font-size:12px;line-height:1;padding-top:2px;position:absolute;top:100%;left:0}.el-form-item__error--inline{position:relative;top:auto;left:auto;display:inline-block;margin-left:10px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label-wrap>.el-form-item__label:before,.el-form-item.is-required:not(.is-no-asterisk).asterisk-left>.el-form-item__label:before{content:"*";color:var(--el-color-danger);margin-right:4px}.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label-wrap>.el-form-item__label:after,.el-form-item.is-required:not(.is-no-asterisk).asterisk-right>.el-form-item__label:after{content:"*";color:var(--el-color-danger);margin-left:4px}.el-form-item.is-error .el-select-v2__wrapper,.el-form-item.is-error .el-select-v2__wrapper:focus,.el-form-item.is-error .el-textarea__inner,.el-form-item.is-error .el-textarea__inner:focus{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-form-item.is-error .el-input-group__append .el-input__wrapper,.el-form-item.is-error .el-input-group__prepend .el-input__wrapper{box-shadow:0 0 0 1px transparent inset}.el-form-item.is-error .el-input__validateIcon{color:var(--el-color-danger)}.el-form-item--feedback .el-input__validateIcon{display:inline-flex}.el-header{--el-header-padding:0 20px;--el-header-height:60px;padding:var(--el-header-padding);box-sizing:border-box;flex-shrink:0;height:var(--el-header-height)}.el-image-viewer__wrapper{position:fixed;top:0;right:0;bottom:0;left:0}.el-image-viewer__btn{position:absolute;z-index:1;display:flex;align-items:center;justify-content:center;border-radius:50%;opacity:.8;cursor:pointer;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__btn .el-icon{font-size:inherit;cursor:pointer}.el-image-viewer__close{top:40px;right:40px;width:40px;height:40px;font-size:40px}.el-image-viewer__canvas{position:static;width:100%;height:100%;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-image-viewer__actions{left:50%;bottom:30px;transform:translate(-50%);width:282px;height:44px;padding:0 23px;background-color:var(--el-text-color-regular);border-color:#fff;border-radius:22px}.el-image-viewer__actions__inner{width:100%;height:100%;text-align:justify;cursor:default;font-size:23px;color:#fff;display:flex;align-items:center;justify-content:space-around}.el-image-viewer__prev{top:50%;transform:translateY(-50%);left:40px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__next{top:50%;transform:translateY(-50%);right:40px;text-indent:2px;width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__close{width:44px;height:44px;font-size:24px;color:#fff;background-color:var(--el-text-color-regular);border-color:#fff}.el-image-viewer__mask{position:absolute;width:100%;height:100%;top:0;left:0;opacity:.5;background:#000}.viewer-fade-enter-active{-webkit-animation:viewer-fade-in var(--el-transition-duration);animation:viewer-fade-in var(--el-transition-duration)}.viewer-fade-leave-active{-webkit-animation:viewer-fade-out var(--el-transition-duration);animation:viewer-fade-out var(--el-transition-duration)}@-webkit-keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes viewer-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes viewer-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-image__error,.el-image__inner,.el-image__placeholder,.el-image__wrapper{width:100%;height:100%}.el-image{position:relative;display:inline-block;overflow:hidden}.el-image__inner{vertical-align:top;opacity:1}.el-image__inner.is-loading{opacity:0}.el-image__wrapper{position:absolute;top:0;left:0}.el-image__placeholder{background:var(--el-fill-color-light)}.el-image__error{display:flex;justify-content:center;align-items:center;font-size:14px;background:var(--el-fill-color-light);color:var(--el-text-color-placeholder);vertical-align:middle}.el-image__preview{cursor:pointer}.el-input-number{position:relative;display:inline-flex;width:150px;line-height:30px}.el-input-number .el-input__wrapper{padding-left:42px;padding-right:42px}.el-input-number .el-input__inner{-webkit-appearance:none;-moz-appearance:textfield;text-align:center;line-height:1}.el-input-number .el-input__inner::-webkit-inner-spin-button,.el-input-number .el-input__inner::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.el-input-number__decrease,.el-input-number__increase{display:flex;justify-content:center;align-items:center;height:auto;position:absolute;z-index:1;top:1px;bottom:1px;width:32px;background:var(--el-fill-color-light);color:var(--el-text-color-regular);cursor:pointer;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-input-number__decrease:hover,.el-input-number__increase:hover{color:var(--el-color-primary)}.el-input-number__decrease:hover~.el-input:not(.is-disabled) .el-input_wrapper,.el-input-number__increase:hover~.el-input:not(.is-disabled) .el-input_wrapper{box-shadow:0 0 0 1px var(--el-input-focus-border-color,var(--el-color-primary)) inset}.el-input-number__decrease.is-disabled,.el-input-number__increase.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-input-number__increase{right:1px;border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0;border-left:var(--el-border)}.el-input-number__decrease{left:1px;border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);border-right:var(--el-border)}.el-input-number.is-disabled .el-input-number__decrease,.el-input-number.is-disabled .el-input-number__increase{border-color:var(--el-disabled-border-color);color:var(--el-disabled-border-color)}.el-input-number.is-disabled .el-input-number__decrease:hover,.el-input-number.is-disabled .el-input-number__increase:hover{color:var(--el-disabled-border-color);cursor:not-allowed}.el-input-number--large{width:180px;line-height:38px}.el-input-number--large .el-input-number__decrease,.el-input-number--large .el-input-number__increase{width:40px;font-size:14px}.el-input-number--large .el-input__wrapper{padding-left:47px;padding-right:47px}.el-input-number--small{width:120px;line-height:22px}.el-input-number--small .el-input-number__decrease,.el-input-number--small .el-input-number__increase{width:24px;font-size:12px}.el-input-number--small .el-input__wrapper{padding-left:31px;padding-right:31px}.el-input-number--small .el-input-number__decrease [class*=el-icon],.el-input-number--small .el-input-number__increase [class*=el-icon]{transform:scale(.9)}.el-input-number.is-without-controls .el-input__wrapper{padding-left:15px;padding-right:15px}.el-input-number.is-controls-right .el-input__wrapper{padding-left:15px;padding-right:42px}.el-input-number.is-controls-right .el-input-number__decrease,.el-input-number.is-controls-right .el-input-number__increase{--el-input-number-controls-height:15px;height:var(--el-input-number-controls-height);line-height:var(--el-input-number-controls-height)}.el-input-number.is-controls-right .el-input-number__decrease [class*=el-icon],.el-input-number.is-controls-right .el-input-number__increase [class*=el-icon]{transform:scale(.8)}.el-input-number.is-controls-right .el-input-number__increase{bottom:auto;left:auto;border-radius:0 var(--el-border-radius-base) 0 0;border-bottom:var(--el-border)}.el-input-number.is-controls-right .el-input-number__decrease{right:1px;top:auto;left:auto;border-right:none;border-left:var(--el-border);border-radius:0 0 var(--el-border-radius-base) 0}.el-input-number.is-controls-right[class*=large] [class*=decrease],.el-input-number.is-controls-right[class*=large] [class*=increase]{--el-input-number-controls-height:19px}.el-input-number.is-controls-right[class*=small] [class*=decrease],.el-input-number.is-controls-right[class*=small] [class*=increase]{--el-input-number-controls-height:11px}.el-textarea{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-textarea{position:relative;display:inline-block;width:100%;vertical-align:bottom;font-size:var(--el-font-size-base)}.el-textarea__inner{position:relative;display:block;resize:vertical;padding:5px 11px;line-height:1.5;box-sizing:border-box;width:100%;font-size:inherit;font-family:inherit;color:var(--el-input-text-color,var(--el-text-color-regular));background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;-webkit-appearance:none;box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);border:none}.el-textarea__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-textarea__inner:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-textarea__inner:focus{outline:0;box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-textarea .el-input__count{color:var(--el-color-info);background:var(--el-fill-color-blank);position:absolute;font-size:12px;line-height:14px;bottom:5px;right:10px}.el-textarea.is-disabled .el-textarea__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);color:var(--el-disabled-text-color);cursor:not-allowed}.el-textarea.is-disabled .el-textarea__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-disabled .el-textarea__inner::placeholder{color:var(--el-text-color-placeholder)}.el-textarea.is-exceed .el-textarea__inner{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-textarea.is-exceed .el-input__count{color:var(--el-color-danger)}.el-input{--el-input-text-color:var(--el-text-color-regular);--el-input-border:var(--el-border);--el-input-hover-border:var(--el-border-color-hover);--el-input-focus-border:var(--el-color-primary);--el-input-transparent-border:0 0 0 1px transparent inset;--el-input-border-color:var(--el-border-color);--el-input-border-radius:var(--el-border-radius-base);--el-input-bg-color:var(--el-fill-color-blank);--el-input-icon-color:var(--el-text-color-placeholder);--el-input-placeholder-color:var(--el-text-color-placeholder);--el-input-hover-border-color:var(--el-border-color-hover);--el-input-clear-hover-color:var(--el-text-color-secondary);--el-input-focus-border-color:var(--el-color-primary)}.el-input{--el-input-height:var(--el-component-size);position:relative;font-size:var(--el-font-size-base);display:inline-flex;width:100%;line-height:var(--el-input-height);box-sizing:border-box;vertical-align:middle}.el-input::-webkit-scrollbar{z-index:11;width:6px}.el-input::-webkit-scrollbar:horizontal{height:6px}.el-input::-webkit-scrollbar-thumb{border-radius:5px;width:6px;background:var(--el-text-color-disabled)}.el-input::-webkit-scrollbar-corner{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track{background:var(--el-fill-color-blank)}.el-input::-webkit-scrollbar-track-piece{background:var(--el-fill-color-blank);width:6px}.el-input .el-input__clear,.el-input .el-input__password{color:var(--el-input-icon-color);font-size:14px;cursor:pointer}.el-input .el-input__clear:hover,.el-input .el-input__password:hover{color:var(--el-input-clear-hover-color)}.el-input .el-input__count{height:100%;display:inline-flex;align-items:center;color:var(--el-color-info);font-size:12px}.el-input .el-input__count .el-input__count-inner{background:var(--el-fill-color-blank);line-height:initial;display:inline-block;padding-left:8px}.el-input__wrapper{display:inline-flex;flex-grow:1;align-items:center;justify-content:center;padding:1px 11px;background-color:var(--el-input-bg-color,var(--el-fill-color-blank));background-image:none;border-radius:var(--el-input-border-radius,var(--el-border-radius-base));transition:var(--el-transition-box-shadow);transform:translateZ(0);box-shadow:0 0 0 1px var(--el-input-border-color,var(--el-border-color)) inset}.el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-input-hover-border-color) inset}.el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-input-focus-border-color) inset}.el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 32px) - 2px);width:100%;flex-grow:1;-webkit-appearance:none;color:var(--el-input-text-color,var(--el-text-color-regular));font-size:inherit;height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);padding:0;outline:0;border:none;background:0 0;box-sizing:border-box}.el-input__inner:focus{outline:0}.el-input__inner::-moz-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner:-ms-input-placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner::placeholder{color:var(--el-input-placeholder-color,var(--el-text-color-placeholder))}.el-input__inner[type=password]::-ms-reveal{display:none}.el-input__prefix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__prefix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__prefix-inner>:last-child{margin-right:8px}.el-input__prefix-inner>:first-child,.el-input__prefix-inner>:first-child.el-input__icon{margin-left:0}.el-input__suffix{display:inline-flex;white-space:nowrap;flex-shrink:0;flex-wrap:nowrap;height:100%;text-align:center;color:var(--el-input-icon-color,var(--el-text-color-placeholder));transition:all var(--el-transition-duration);pointer-events:none}.el-input__suffix-inner{pointer-events:all;display:inline-flex;align-items:center;justify-content:center}.el-input__suffix-inner>:first-child{margin-left:8px}.el-input .el-input__icon{height:inherit;line-height:inherit;display:flex;justify-content:center;align-items:center;transition:all var(--el-transition-duration);margin-left:8px}.el-input__validateIcon{pointer-events:none}.el-input.is-active .el-input__wrapper{box-shadow:0 0 0 1px var(--el-input-focus-color,) inset}.el-input.is-disabled{cursor:not-allowed}.el-input.is-disabled .el-input__wrapper{background-color:var(--el-disabled-bg-color);box-shadow:0 0 0 1px var(--el-disabled-border-color) inset}.el-input.is-disabled .el-input__inner{color:var(--el-disabled-text-color);-webkit-text-fill-color:var(--el-disabled-text-color);cursor:not-allowed}.el-input.is-disabled .el-input__inner::-moz-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner:-ms-input-placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__inner::placeholder{color:var(--el-text-color-placeholder)}.el-input.is-disabled .el-input__icon{cursor:not-allowed}.el-input.is-exceed .el-input__wrapper{box-shadow:0 0 0 1px var(--el-color-danger) inset}.el-input.is-exceed .el-input__suffix .el-input__count{color:var(--el-color-danger)}.el-input--large{--el-input-height:var(--el-component-size-large);font-size:14px}.el-input--large .el-input__wrapper{padding:1px 15px}.el-input--large .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 40px) - 2px)}.el-input--small{--el-input-height:var(--el-component-size-small);font-size:12px}.el-input--small .el-input__wrapper{padding:1px 7px}.el-input--small .el-input__inner{--el-input-inner-height:calc(var(--el-input-height, 24px) - 2px)}.el-input-group{display:inline-flex;width:100%;align-items:stretch}.el-input-group__append,.el-input-group__prepend{background-color:var(--el-fill-color-light);color:var(--el-color-info);position:relative;display:inline-flex;align-items:center;justify-content:center;min-height:100%;border-radius:var(--el-input-border-radius);padding:0 20px;white-space:nowrap}.el-input-group__append:focus,.el-input-group__prepend:focus{outline:0}.el-input-group__append .el-button,.el-input-group__append .el-select,.el-input-group__prepend .el-button,.el-input-group__prepend .el-select{display:inline-block;margin:0 -20px}.el-input-group__append button.el-button,.el-input-group__append button.el-button:hover,.el-input-group__append div.el-select .el-input__wrapper,.el-input-group__append div.el-select:hover .el-input__wrapper,.el-input-group__prepend button.el-button,.el-input-group__prepend button.el-button:hover,.el-input-group__prepend div.el-select .el-input__wrapper,.el-input-group__prepend div.el-select:hover .el-input__wrapper{border-color:transparent;background-color:transparent;color:inherit}.el-input-group__append .el-button,.el-input-group__append .el-input,.el-input-group__prepend .el-button,.el-input-group__prepend .el-input{font-size:inherit}.el-input-group__prepend{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group__append{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--prepend>.el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input .el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:1px 0 0 0 var(--el-input-border-color) inset,0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper{box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important;z-index:2}.el-input-group--prepend .el-input-group__prepend .el-select .el-input.is-focus .el-input__wrapper:focus{outline:0;z-index:2;box-shadow:1px 0 0 0 var(--el-input-focus-border-color) inset,1px 0 0 0 var(--el-input-focus-border-color),0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--prepend .el-input-group__prepend .el-select:hover .el-input__wrapper{z-index:1;box-shadow:1px 0 0 0 var(--el-input-hover-border-color) inset,1px 0 0 0 var(--el-input-hover-border-color),0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-input-group--append>.el-input__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:0 1px 0 0 var(--el-input-border-color) inset,0 -1px 0 0 var(--el-input-border-color) inset,-1px 0 0 0 var(--el-input-border-color) inset}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select .el-input.is-focus .el-input__wrapper{z-index:2;box-shadow:-1px 0 0 0 var(--el-input-focus-border-color),-1px 0 0 0 var(--el-input-focus-border-color) inset,0 1px 0 0 var(--el-input-focus-border-color) inset,0 -1px 0 0 var(--el-input-focus-border-color) inset!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__inner{box-shadow:none!important}.el-input-group--append .el-input-group__append .el-select:hover .el-input__wrapper{z-index:1;box-shadow:-1px 0 0 0 var(--el-input-hover-border-color),-1px 0 0 0 var(--el-input-hover-border-color) inset,0 1px 0 0 var(--el-input-hover-border-color) inset,0 -1px 0 0 var(--el-input-hover-border-color) inset!important}.el-link{--el-link-font-size:var(--el-font-size-base);--el-link-font-weight:var(--el-font-weight-primary);--el-link-text-color:var(--el-text-color-regular);--el-link-hover-text-color:var(--el-color-primary);--el-link-disabled-text-color:var(--el-text-color-placeholder)}.el-link{display:inline-flex;flex-direction:row;align-items:center;justify-content:center;vertical-align:middle;position:relative;text-decoration:none;outline:0;cursor:pointer;padding:0;font-size:var(--el-link-font-size);font-weight:var(--el-link-font-weight);color:var(--el-link-text-color)}.el-link:hover{color:var(--el-link-hover-text-color)}.el-link.is-underline:hover:after{content:"";position:absolute;left:0;right:0;height:0;bottom:0;border-bottom:1px solid var(--el-link-hover-text-color)}.el-link.is-disabled{color:var(--el-link-disabled-text-color);cursor:not-allowed}.el-link [class*=el-icon-]+span{margin-left:5px}.el-link.el-link--default:after{border-color:var(--el-link-hover-text-color)}.el-link__inner{display:inline-flex;justify-content:center;align-items:center}.el-link.el-link--primary{--el-link-text-color:var(--el-color-primary);--el-link-hover-text-color:var(--el-color-primary-light-3);--el-link-disabled-text-color:var(--el-color-primary-light-5)}.el-link.el-link--primary:after{border-color:var(--el-link-text-color)}.el-link.el-link--primary.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--success{--el-link-text-color:var(--el-color-success);--el-link-hover-text-color:var(--el-color-success-light-3);--el-link-disabled-text-color:var(--el-color-success-light-5)}.el-link.el-link--success:after{border-color:var(--el-link-text-color)}.el-link.el-link--success.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning{--el-link-text-color:var(--el-color-warning);--el-link-hover-text-color:var(--el-color-warning-light-3);--el-link-disabled-text-color:var(--el-color-warning-light-5)}.el-link.el-link--warning:after{border-color:var(--el-link-text-color)}.el-link.el-link--warning.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger{--el-link-text-color:var(--el-color-danger);--el-link-hover-text-color:var(--el-color-danger-light-3);--el-link-disabled-text-color:var(--el-color-danger-light-5)}.el-link.el-link--danger:after{border-color:var(--el-link-text-color)}.el-link.el-link--danger.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--error{--el-link-text-color:var(--el-color-error);--el-link-hover-text-color:var(--el-color-error-light-3);--el-link-disabled-text-color:var(--el-color-error-light-5)}.el-link.el-link--error:after{border-color:var(--el-link-text-color)}.el-link.el-link--error.is-underline:hover:after{border-color:var(--el-link-text-color)}.el-link.el-link--info{--el-link-text-color:var(--el-color-info);--el-link-hover-text-color:var(--el-color-info-light-3);--el-link-disabled-text-color:var(--el-color-info-light-5)}.el-link.el-link--info:after{border-color:var(--el-link-text-color)}.el-link.el-link--info.is-underline:hover:after{border-color:var(--el-link-text-color)}:root{--el-loading-spinner-size:42px;--el-loading-fullscreen-spinner-size:50px}.el-loading-parent--relative{position:relative!important}.el-loading-parent--hidden{overflow:hidden!important}.el-loading-mask{position:absolute;z-index:2000;background-color:var(--el-mask-color);margin:0;top:0;right:0;bottom:0;left:0;transition:opacity var(--el-transition-duration)}.el-loading-mask.is-fullscreen{position:fixed}.el-loading-mask.is-fullscreen .el-loading-spinner{margin-top:calc((0px - var(--el-loading-fullscreen-spinner-size))/ 2)}.el-loading-mask.is-fullscreen .el-loading-spinner .circular{height:var(--el-loading-fullscreen-spinner-size);width:var(--el-loading-fullscreen-spinner-size)}.el-loading-spinner{top:50%;margin-top:calc((0px - var(--el-loading-spinner-size))/ 2);width:100%;text-align:center;position:absolute}.el-loading-spinner .el-loading-text{color:var(--el-color-primary);margin:3px 0;font-size:14px}.el-loading-spinner .circular{display:inline;height:var(--el-loading-spinner-size);width:var(--el-loading-spinner-size);-webkit-animation:loading-rotate 2s linear infinite;animation:loading-rotate 2s linear infinite}.el-loading-spinner .path{-webkit-animation:loading-dash 1.5s ease-in-out infinite;animation:loading-dash 1.5s ease-in-out infinite;stroke-dasharray:90,150;stroke-dashoffset:0;stroke-width:2;stroke:var(--el-color-primary);stroke-linecap:round}.el-loading-spinner i{color:var(--el-color-primary)}.el-loading-fade-enter-from,.el-loading-fade-leave-to{opacity:0}@-webkit-keyframes loading-rotate{to{transform:rotate(360deg)}}@keyframes loading-rotate{to{transform:rotate(360deg)}}@-webkit-keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}.el-main{--el-main-padding:20px;display:block;flex:1;flex-basis:auto;overflow:auto;box-sizing:border-box;padding:var(--el-main-padding)}:root{--el-menu-active-color:var(--el-color-primary);--el-menu-text-color:var(--el-text-color-primary);--el-menu-hover-text-color:var(--el-color-primary);--el-menu-bg-color:var(--el-fill-color-blank);--el-menu-hover-bg-color:var(--el-color-primary-light-9);--el-menu-item-height:56px;--el-menu-sub-item-height:calc(var(--el-menu-item-height) - 6px);--el-menu-horizontal-sub-item-height:36px;--el-menu-item-font-size:var(--el-font-size-base);--el-menu-item-hover-fill:var(--el-color-primary-light-9);--el-menu-border-color:var(--el-border-color);--el-menu-base-level-padding:20px;--el-menu-level-padding:20px;--el-menu-icon-width:24px}.el-menu{border-right:solid 1px var(--el-menu-border-color);list-style:none;position:relative;margin:0;padding-left:0;background-color:var(--el-menu-bg-color);box-sizing:border-box}.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-menu-item-group__title,.el-menu--vertical:not(.el-menu--collapse):not(.el-menu--popup-container) .el-sub-menu__title{white-space:nowrap;padding-left:calc(var(--el-menu-base-level-padding) + var(--el-menu-level) * var(--el-menu-level-padding))}.el-menu--horizontal{display:flex;flex-wrap:nowrap;border-bottom:solid 1px var(--el-menu-border-color);border-right:none}.el-menu--horizontal>.el-menu-item{display:inline-flex;justify-content:center;align-items:center;height:100%;margin:0;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-menu-item a,.el-menu--horizontal>.el-menu-item a:hover{color:inherit}.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover{background-color:#fff}.el-menu--horizontal>.el-sub-menu:focus,.el-menu--horizontal>.el-sub-menu:hover{outline:0}.el-menu--horizontal>.el-sub-menu:hover .el-sub-menu__title{color:var(--el-menu-hover-text-color)}.el-menu--horizontal>.el-sub-menu.is-active .el-sub-menu__title{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title{height:100%;border-bottom:2px solid transparent;color:var(--el-menu-text-color)}.el-menu--horizontal>.el-sub-menu .el-sub-menu__title:hover{background-color:var(--el-bg-color-overlay)}.el-menu--horizontal .el-menu .el-menu-item,.el-menu--horizontal .el-menu .el-sub-menu__title{background-color:var(--el-menu-bg-color);display:flex;align-items:center;height:var(--el-menu-horizontal-sub-item-height);line-height:var(--el-menu-horizontal-sub-item-height);padding:0 10px;color:var(--el-menu-text-color)}.el-menu--horizontal .el-menu .el-sub-menu__title{padding-right:40px}.el-menu--horizontal .el-menu .el-menu-item.is-active,.el-menu--horizontal .el-menu .el-sub-menu.is-active>.el-sub-menu__title{color:var(--el-menu-active-color)}.el-menu--horizontal .el-menu-item:not(.is-disabled):focus,.el-menu--horizontal .el-menu-item:not(.is-disabled):hover{outline:0;color:var(--el-menu-hover-text-color);background-color:var(--el-menu-hover-bg-color)}.el-menu--horizontal>.el-menu-item.is-active{border-bottom:2px solid var(--el-menu-active-color);color:var(--el-menu-active-color)!important}.el-menu--collapse{width:calc(var(--el-menu-icon-width) + var(--el-menu-base-level-padding) * 2)}.el-menu--collapse>.el-menu-item [class^=el-icon],.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title [class^=el-icon],.el-menu--collapse>.el-sub-menu>.el-sub-menu__title [class^=el-icon]{margin:0;vertical-align:middle;width:var(--el-menu-icon-width);text-align:center}.el-menu--collapse>.el-menu-item .el-sub-menu__icon-arrow,.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title .el-sub-menu__icon-arrow{display:none}.el-menu--collapse>.el-menu-item-group>ul>.el-sub-menu>.el-sub-menu__title>span,.el-menu--collapse>.el-menu-item>span,.el-menu--collapse>.el-sub-menu>.el-sub-menu__title>span{height:0;width:0;overflow:hidden;visibility:hidden;display:inline-block}.el-menu--collapse>.el-menu-item.is-active i{color:inherit}.el-menu--collapse .el-menu .el-sub-menu{min-width:200px}.el-menu--popup{z-index:100;min-width:200px;border:none;padding:5px 0;border-radius:var(--el-border-radius-small);box-shadow:var(--el-box-shadow-light)}.el-menu .el-icon{flex-shrink:0}.el-menu-item{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap}.el-menu-item *{vertical-align:bottom}.el-menu-item i{color:inherit}.el-menu-item:focus,.el-menu-item:hover{outline:0}.el-menu-item:hover{background-color:var(--el-menu-hover-bg-color)}.el-menu-item.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-menu-item [class^=el-icon]{margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px;vertical-align:middle}.el-menu-item.is-active{color:var(--el-menu-active-color)}.el-menu-item.is-active i{color:inherit}.el-menu-item .el-menu-tooltip__trigger{position:absolute;left:0;top:0;height:100%;width:100%;display:inline-flex;align-items:center;box-sizing:border-box;padding:0 var(--el-menu-base-level-padding)}.el-sub-menu{list-style:none;margin:0;padding-left:0}.el-sub-menu__title{display:flex;align-items:center;height:var(--el-menu-item-height);line-height:var(--el-menu-item-height);font-size:var(--el-menu-item-font-size);color:var(--el-menu-text-color);padding:0 var(--el-menu-base-level-padding);list-style:none;cursor:pointer;position:relative;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration),color var(--el-transition-duration);box-sizing:border-box;white-space:nowrap;padding-right:calc(var(--el-menu-base-level-padding) + var(--el-menu-icon-width))}.el-sub-menu__title *{vertical-align:bottom}.el-sub-menu__title i{color:inherit}.el-sub-menu__title:focus,.el-sub-menu__title:hover{outline:0}.el-sub-menu__title.is-disabled{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu__title:hover{background-color:var(--el-menu-hover-bg-color)}.el-sub-menu .el-menu{border:none}.el-sub-menu .el-menu-item{height:var(--el-menu-sub-item-height);line-height:var(--el-menu-sub-item-height)}.el-sub-menu__hide-arrow .el-sub-menu__icon-arrow{display:none!important}.el-sub-menu.is-active .el-sub-menu__title{border-bottom-color:var(--el-menu-active-color)}.el-sub-menu.is-disabled .el-menu-item,.el-sub-menu.is-disabled .el-sub-menu__title{opacity:.25;cursor:not-allowed;background:0 0!important}.el-sub-menu .el-icon{vertical-align:middle;margin-right:5px;width:var(--el-menu-icon-width);text-align:center;font-size:18px}.el-sub-menu .el-icon.el-sub-menu__icon-more{margin-right:0!important}.el-sub-menu .el-sub-menu__icon-arrow{position:absolute;top:50%;right:var(--el-menu-base-level-padding);margin-top:-6px;transition:transform var(--el-transition-duration);font-size:12px;margin-right:0;width:inherit}.el-menu-item-group>ul{padding:0}.el-menu-item-group__title{padding:7px 0 7px var(--el-menu-base-level-padding);line-height:normal;font-size:12px;color:var(--el-text-color-secondary)}.horizontal-collapse-transition .el-sub-menu__title .el-sub-menu__icon-arrow{transition:var(--el-transition-duration-fast);opacity:0}.el-message-box{--el-messagebox-title-color:var(--el-text-color-primary);--el-messagebox-width:420px;--el-messagebox-border-radius:4px;--el-messagebox-font-size:var(--el-font-size-large);--el-messagebox-content-font-size:var(--el-font-size-base);--el-messagebox-content-color:var(--el-text-color-regular);--el-messagebox-error-font-size:12px;--el-messagebox-padding-primary:15px}.el-message-box{display:inline-block;max-width:var(--el-messagebox-width);width:100%;padding-bottom:10px;vertical-align:middle;background-color:var(--el-bg-color);border-radius:var(--el-messagebox-border-radius);border:1px solid var(--el-border-color-lighter);font-size:var(--el-messagebox-font-size);box-shadow:var(--el-box-shadow-light);text-align:left;overflow:hidden;-webkit-backface-visibility:hidden;backface-visibility:hidden;box-sizing:border-box}.el-message-box:focus{outline:0!important}.el-overlay.is-message-box .el-overlay-message-box{text-align:center;position:fixed;top:0;right:0;bottom:0;left:0;padding:16px;overflow:auto}.el-overlay.is-message-box .el-overlay-message-box:after{content:"";display:inline-block;height:100%;width:0;vertical-align:middle}.el-message-box.is-draggable .el-message-box__header{cursor:move;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-message-box__header{position:relative;padding:var(--el-messagebox-padding-primary);padding-bottom:10px}.el-message-box__title{padding-left:0;margin-bottom:0;font-size:var(--el-messagebox-font-size);line-height:1;color:var(--el-messagebox-title-color)}.el-message-box__headerbtn{position:absolute;top:var(--el-messagebox-padding-primary);right:var(--el-messagebox-padding-primary);padding:0;border:none;outline:0;background:0 0;font-size:var(--el-message-close-size,16px);cursor:pointer}.el-message-box__headerbtn .el-message-box__close{color:var(--el-color-info);font-size:inherit}.el-message-box__headerbtn:focus .el-message-box__close,.el-message-box__headerbtn:hover .el-message-box__close{color:var(--el-color-primary)}.el-message-box__content{padding:10px var(--el-messagebox-padding-primary);color:var(--el-messagebox-content-color);font-size:var(--el-messagebox-content-font-size)}.el-message-box__container{position:relative}.el-message-box__input{padding-top:15px}.el-message-box__input div.invalid>input{border-color:var(--el-color-error)}.el-message-box__input div.invalid>input:focus{border-color:var(--el-color-error)}.el-message-box__status{position:absolute;top:50%;transform:translateY(-50%);font-size:24px!important}.el-message-box__status:before{padding-left:1px}.el-message-box__status.el-icon{position:absolute}.el-message-box__status+.el-message-box__message{padding-left:36px;padding-right:12px;word-break:break-word}.el-message-box__status.el-message-box-icon--success{--el-messagebox-color:var(--el-color-success);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--info{--el-messagebox-color:var(--el-color-info);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--warning{--el-messagebox-color:var(--el-color-warning);color:var(--el-messagebox-color)}.el-message-box__status.el-message-box-icon--error{--el-messagebox-color:var(--el-color-error);color:var(--el-messagebox-color)}.el-message-box__message{margin:0}.el-message-box__message p{margin:0;line-height:24px}.el-message-box__errormsg{color:var(--el-color-error);font-size:var(--el-messagebox-error-font-size);min-height:18px;margin-top:2px}.el-message-box__btns{padding:5px 15px 0;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center}.el-message-box__btns button:nth-child(2){margin-left:10px}.el-message-box__btns-reverse{flex-direction:row-reverse}.el-message-box--center .el-message-box__title{position:relative;display:flex;align-items:center;justify-content:center}.el-message-box--center .el-message-box__status{position:relative;top:auto;padding-right:5px;text-align:center;transform:translateY(-1px)}.el-message-box--center .el-message-box__message{margin-left:0}.el-message-box--center .el-message-box__btns{justify-content:center}.el-message-box--center .el-message-box__content{padding-left:calc(var(--el-messagebox-padding-primary) + 12px);padding-right:calc(var(--el-messagebox-padding-primary) + 12px);text-align:center}.fade-in-linear-enter-active .el-overlay-message-box{-webkit-animation:msgbox-fade-in var(--el-transition-duration);animation:msgbox-fade-in var(--el-transition-duration)}.fade-in-linear-leave-active .el-overlay-message-box{animation:msgbox-fade-in var(--el-transition-duration) reverse}@-webkit-keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@keyframes msgbox-fade-in{0%{transform:translate3d(0,-20px,0);opacity:0}to{transform:translateZ(0);opacity:1}}@-webkit-keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}@keyframes msgbox-fade-out{0%{transform:translateZ(0);opacity:1}to{transform:translate3d(0,-20px,0);opacity:0}}.el-message{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-border-color-lighter);--el-message-padding:15px 19px;--el-message-close-size:16px;--el-message-close-icon-color:var(--el-text-color-placeholder);--el-message-close-hover-color:var(--el-text-color-secondary)}.el-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;max-width:calc(100% - 32px);box-sizing:border-box;border-radius:var(--el-border-radius-base);border-width:var(--el-border-width);border-style:var(--el-border-style);border-color:var(--el-message-border-color);position:fixed;left:50%;top:20px;transform:translate(-50%);background-color:var(--el-message-bg-color);transition:opacity var(--el-transition-duration),transform .4s,top .4s;padding:var(--el-message-padding);display:flex;align-items:center}.el-message.is-center{justify-content:center}.el-message.is-closable .el-message__content{padding-right:31px}.el-message p{margin:0}.el-message--success{--el-message-bg-color:var(--el-color-success-light-9);--el-message-border-color:var(--el-color-success-light-8);--el-message-text-color:var(--el-color-success)}.el-message--success .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--success{color:var(--el-message-text-color)}.el-message--info{--el-message-bg-color:var(--el-color-info-light-9);--el-message-border-color:var(--el-color-info-light-8);--el-message-text-color:var(--el-color-info)}.el-message--info .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--info{color:var(--el-message-text-color)}.el-message--warning{--el-message-bg-color:var(--el-color-warning-light-9);--el-message-border-color:var(--el-color-warning-light-8);--el-message-text-color:var(--el-color-warning)}.el-message--warning .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--warning{color:var(--el-message-text-color)}.el-message--error{--el-message-bg-color:var(--el-color-error-light-9);--el-message-border-color:var(--el-color-error-light-8);--el-message-text-color:var(--el-color-error)}.el-message--error .el-message__content{color:var(--el-message-text-color);overflow-wrap:anywhere}.el-message .el-message-icon--error{color:var(--el-message-text-color)}.el-message__icon{margin-right:10px}.el-message .el-message__badge{position:absolute;top:-8px;right:-8px}.el-message__content{padding:0;font-size:14px;line-height:1}.el-message__content:focus{outline-width:0}.el-message .el-message__closeBtn{position:absolute;top:50%;right:19px;transform:translateY(-50%);cursor:pointer;color:var(--el-message-close-icon-color);font-size:var(--el-message-close-size)}.el-message .el-message__closeBtn:focus{outline-width:0}.el-message .el-message__closeBtn:hover{color:var(--el-message-close-hover-color)}.el-message-fade-enter-from,.el-message-fade-leave-to{opacity:0;transform:translate(-50%,-100%)}.el-notification{--el-notification-width:330px;--el-notification-padding:14px 26px 14px 13px;--el-notification-radius:8px;--el-notification-shadow:var(--el-box-shadow-light);--el-notification-border-color:var(--el-border-color-lighter);--el-notification-icon-size:24px;--el-notification-close-font-size:var(--el-message-close-size, 16px);--el-notification-group-margin-left:13px;--el-notification-group-margin-right:8px;--el-notification-content-font-size:var(--el-font-size-base);--el-notification-content-color:var(--el-text-color-regular);--el-notification-title-font-size:16px;--el-notification-title-color:var(--el-text-color-primary);--el-notification-close-color:var(--el-text-color-secondary);--el-notification-close-hover-color:var(--el-text-color-regular)}.el-notification{display:flex;width:var(--el-notification-width);padding:var(--el-notification-padding);border-radius:var(--el-notification-radius);box-sizing:border-box;border:1px solid var(--el-notification-border-color);position:fixed;background-color:var(--el-bg-color-overlay);box-shadow:var(--el-notification-shadow);transition:opacity var(--el-transition-duration),transform var(--el-transition-duration),left var(--el-transition-duration),right var(--el-transition-duration),top .4s,bottom var(--el-transition-duration);overflow-wrap:anywhere;overflow:hidden;z-index:9999}.el-notification.right{right:16px}.el-notification.left{left:16px}.el-notification__group{margin-left:var(--el-notification-group-margin-left);margin-right:var(--el-notification-group-margin-right)}.el-notification__title{font-weight:700;font-size:var(--el-notification-title-font-size);line-height:var(--el-notification-icon-size);color:var(--el-notification-title-color);margin:0}.el-notification__content{font-size:var(--el-notification-content-font-size);line-height:24px;margin:6px 0 0;color:var(--el-notification-content-color);text-align:justify}.el-notification__content p{margin:0}.el-notification .el-notification__icon{height:var(--el-notification-icon-size);width:var(--el-notification-icon-size);font-size:var(--el-notification-icon-size)}.el-notification .el-notification__closeBtn{position:absolute;top:18px;right:15px;cursor:pointer;color:var(--el-notification-close-color);font-size:var(--el-notification-close-font-size)}.el-notification .el-notification__closeBtn:hover{color:var(--el-notification-close-hover-color)}.el-notification .el-notification--success{--el-notification-icon-color:var(--el-color-success);color:var(--el-notification-icon-color)}.el-notification .el-notification--info{--el-notification-icon-color:var(--el-color-info);color:var(--el-notification-icon-color)}.el-notification .el-notification--warning{--el-notification-icon-color:var(--el-color-warning);color:var(--el-notification-icon-color)}.el-notification .el-notification--error{--el-notification-icon-color:var(--el-color-error);color:var(--el-notification-icon-color)}.el-notification-fade-enter-from.right{right:0;transform:translate(100%)}.el-notification-fade-enter-from.left{left:0;transform:translate(-100%)}.el-notification-fade-leave-to{opacity:0}.el-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:2000;height:100%;background-color:var(--el-overlay-color-lighter);overflow:auto}.el-overlay .el-overlay-root{height:0}.el-page-header.is-contentful .el-page-header__main{border-top:1px solid var(--el-border-color-light);margin-top:16px}.el-page-header__header{display:flex;align-items:center;justify-content:space-between;line-height:24px}.el-page-header__left{display:flex;align-items:center;margin-right:40px;position:relative}.el-page-header__back{display:flex;align-items:center;cursor:pointer}.el-page-header__left .el-divider--vertical{margin:0 16px}.el-page-header__icon{font-size:16px;margin-right:10px;display:flex;align-items:center}.el-page-header__icon .el-icon{font-size:inherit}.el-page-header__title{font-size:14px;font-weight:500}.el-page-header__content{font-size:18px;color:var(--el-text-color-primary)}.el-page-header__breadcrumb{margin-bottom:16px}.el-pagination{--el-pagination-font-size:14px;--el-pagination-bg-color:var(--el-fill-color-blank);--el-pagination-text-color:var(--el-text-color-primary);--el-pagination-border-radius:2px;--el-pagination-button-color:var(--el-text-color-primary);--el-pagination-button-width:32px;--el-pagination-button-height:32px;--el-pagination-button-disabled-color:var(--el-text-color-placeholder);--el-pagination-button-disabled-bg-color:var(--el-fill-color-blank);--el-pagination-button-bg-color:var(--el-fill-color);--el-pagination-hover-color:var(--el-color-primary);--el-pagination-font-size-small:12px;--el-pagination-button-width-small:24px;--el-pagination-button-height-small:24px;--el-pagination-item-gap:16px;white-space:nowrap;color:var(--el-pagination-text-color);font-size:var(--el-pagination-font-size);font-weight:400;display:flex;align-items:center}.el-pagination .el-input__inner{text-align:center;-moz-appearance:textfield}.el-pagination .el-select .el-input{width:128px}.el-pagination button{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pagination button *{pointer-events:none}.el-pagination button:focus{outline:0}.el-pagination button:hover{color:var(--el-pagination-hover-color)}.el-pagination button.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pagination button.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pagination button.is-disabled,.el-pagination button:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pagination button:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-pagination .btn-next .el-icon,.el-pagination .btn-prev .el-icon{display:block;font-size:12px;font-weight:700;width:inherit}.el-pagination>.is-first{margin-left:0!important}.el-pagination>.is-last{margin-right:0!important}.el-pagination .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination__sizes,.el-pagination__total{margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__total[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__jump{display:flex;align-items:center;margin-left:var(--el-pagination-item-gap);font-weight:400;color:var(--el-text-color-regular)}.el-pagination__jump[disabled=true]{color:var(--el-text-color-placeholder)}.el-pagination__goto{margin-right:8px}.el-pagination__editor{text-align:center;box-sizing:border-box}.el-pagination__editor.el-input{width:56px}.el-pagination__editor .el-input__inner::-webkit-inner-spin-button,.el-pagination__editor .el-input__inner::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.el-pagination__classifier{margin-left:8px}.el-pagination__rightwrapper{flex:1;display:flex;align-items:center;justify-content:flex-end}.el-pagination.is-background .btn-next,.el-pagination.is-background .btn-prev,.el-pagination.is-background .el-pager li{margin:0 4px;background-color:var(--el-pagination-button-bg-color)}.el-pagination.is-background .btn-next.is-active,.el-pagination.is-background .btn-prev.is-active,.el-pagination.is-background .el-pager li.is-active{background-color:var(--el-color-primary);color:var(--el-color-white)}.el-pagination.is-background .btn-next.is-disabled,.el-pagination.is-background .btn-next:disabled,.el-pagination.is-background .btn-prev.is-disabled,.el-pagination.is-background .btn-prev:disabled,.el-pagination.is-background .el-pager li.is-disabled,.el-pagination.is-background .el-pager li:disabled{color:var(--el-text-color-placeholder);background-color:var(--el-disabled-bg-color)}.el-pagination.is-background .btn-next.is-disabled.is-active,.el-pagination.is-background .btn-next:disabled.is-active,.el-pagination.is-background .btn-prev.is-disabled.is-active,.el-pagination.is-background .btn-prev:disabled.is-active,.el-pagination.is-background .el-pager li.is-disabled.is-active,.el-pagination.is-background .el-pager li:disabled.is-active{color:var(--el-text-color-secondary);background-color:var(--el-fill-color-dark)}.el-pagination.is-background .btn-prev{margin-left:var(--el-pagination-item-gap)}.el-pagination--small .btn-next,.el-pagination--small .btn-prev,.el-pagination--small .el-pager li{height:var(--el-pagination-button-height-small);line-height:var(--el-pagination-button-height-small);font-size:var(--el-pagination-font-size-small);min-width:var(--el-pagination-button-width-small)}.el-pagination--small button,.el-pagination--small span:not([class*=suffix]){font-size:var(--el-pagination-font-size-small)}.el-pagination--small .el-select .el-input{width:100px}.el-pager{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;list-style:none;font-size:0;padding:0;margin:0;display:flex;align-items:center}.el-pager li{display:flex;justify-content:center;align-items:center;font-size:var(--el-pagination-font-size);min-width:var(--el-pagination-button-width);height:var(--el-pagination-button-height);line-height:var(--el-pagination-button-height);color:var(--el-pagination-button-color);background:var(--el-pagination-bg-color);padding:0 4px;border:none;border-radius:var(--el-pagination-border-radius);cursor:pointer;text-align:center;box-sizing:border-box}.el-pager li *{pointer-events:none}.el-pager li:focus{outline:0}.el-pager li:hover{color:var(--el-pagination-hover-color)}.el-pager li.is-active{color:var(--el-pagination-hover-color);cursor:default;font-weight:700}.el-pager li.is-active.is-disabled{font-weight:700;color:var(--el-text-color-secondary)}.el-pager li.is-disabled,.el-pager li:disabled{color:var(--el-pagination-button-disabled-color);background-color:var(--el-pagination-button-disabled-bg-color);cursor:not-allowed}.el-pager li:focus-visible{outline:1px solid var(--el-pagination-hover-color);outline-offset:-1px}.el-popconfirm__main{display:flex;align-items:center}.el-popconfirm__icon{margin-right:5px}.el-popconfirm__action{text-align:right;margin-top:8px}.el-popover{--el-popover-bg-color:var(--el-bg-color-overlay);--el-popover-font-size:var(--el-font-size-base);--el-popover-border-color:var(--el-border-color-lighter);--el-popover-padding:12px;--el-popover-padding-large:18px 20px;--el-popover-title-font-size:16px;--el-popover-title-text-color:var(--el-text-color-primary);--el-popover-border-radius:4px}.el-popover.el-popper{background:var(--el-popover-bg-color);min-width:150px;border-radius:var(--el-popover-border-radius);border:1px solid var(--el-popover-border-color);padding:var(--el-popover-padding);z-index:var(--el-index-popper);color:var(--el-text-color-regular);line-height:1.4;text-align:justify;font-size:var(--el-popover-font-size);box-shadow:var(--el-box-shadow-light);word-break:break-all;box-sizing:border-box}.el-popover.el-popper--plain{padding:var(--el-popover-padding-large)}.el-popover__title{color:var(--el-popover-title-text-color);font-size:var(--el-popover-title-font-size);line-height:1;margin-bottom:12px}.el-popover__reference:focus:hover,.el-popover__reference:focus:not(.focusing){outline-width:0}.el-popover.el-popper.is-dark{--el-popover-bg-color:var(--el-text-color-primary);--el-popover-border-color:var(--el-text-color-primary);--el-popover-title-text-color:var(--el-bg-color);color:var(--el-bg-color)}.el-popover.el-popper:focus,.el-popover.el-popper:focus:active{outline-width:0}.el-progress{position:relative;line-height:1;display:flex;align-items:center}.el-progress__text{font-size:14px;color:var(--el-text-color-regular);margin-left:5px;min-width:50px;line-height:1}.el-progress__text i{vertical-align:middle;display:block}.el-progress--circle,.el-progress--dashboard{display:inline-block}.el-progress--circle .el-progress__text,.el-progress--dashboard .el-progress__text{position:absolute;top:50%;left:0;width:100%;text-align:center;margin:0;transform:translateY(-50%)}.el-progress--circle .el-progress__text i,.el-progress--dashboard .el-progress__text i{vertical-align:middle;display:inline-block}.el-progress--without-text .el-progress__text{display:none}.el-progress--without-text .el-progress-bar{padding-right:0;margin-right:0;display:block}.el-progress--text-inside .el-progress-bar{padding-right:0;margin-right:0}.el-progress.is-success .el-progress-bar__inner{background-color:var(--el-color-success)}.el-progress.is-success .el-progress__text{color:var(--el-color-success)}.el-progress.is-warning .el-progress-bar__inner{background-color:var(--el-color-warning)}.el-progress.is-warning .el-progress__text{color:var(--el-color-warning)}.el-progress.is-exception .el-progress-bar__inner{background-color:var(--el-color-danger)}.el-progress.is-exception .el-progress__text{color:var(--el-color-danger)}.el-progress-bar{flex-grow:1;box-sizing:border-box}.el-progress-bar__outer{height:6px;border-radius:100px;background-color:var(--el-border-color-lighter);overflow:hidden;position:relative;vertical-align:middle}.el-progress-bar__inner{position:absolute;left:0;top:0;height:100%;background-color:var(--el-color-primary);text-align:right;border-radius:100px;line-height:1;white-space:nowrap;transition:width .6s ease}.el-progress-bar__inner:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-progress-bar__inner--indeterminate{transform:translateZ(0);-webkit-animation:indeterminate 3s infinite;animation:indeterminate 3s infinite}.el-progress-bar__inner--striped{background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.1) 50%,rgba(0,0,0,.1) 75%,transparent 75%,transparent);background-size:1.25em 1.25em}.el-progress-bar__inner--striped.el-progress-bar__inner--striped-flow{-webkit-animation:striped-flow 3s linear infinite;animation:striped-flow 3s linear infinite}.el-progress-bar__innerText{display:inline-block;vertical-align:middle;color:#fff;font-size:12px;margin:0 5px}@-webkit-keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@keyframes progress{0%{background-position:0 0}to{background-position:32px 0}}@-webkit-keyframes indeterminate{0%{left:-100%}to{left:100%}}@keyframes indeterminate{0%{left:-100%}to{left:100%}}@-webkit-keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}@keyframes striped-flow{0%{background-position:-100%}to{background-position:100%}}.el-radio-button{--el-radio-button-checked-bg-color:var(--el-color-primary);--el-radio-button-checked-text-color:var(--el-color-white);--el-radio-button-checked-border-color:var(--el-color-primary);--el-radio-button-disabled-checked-fill:var(--el-border-color-extra-light)}.el-radio-button{position:relative;display:inline-block;outline:0}.el-radio-button__inner{display:inline-block;line-height:1;white-space:nowrap;vertical-align:middle;background:var(--el-button-bg-color,var(--el-fill-color-blank));border:var(--el-border);font-weight:var(--el-button-font-weight,var(--el-font-weight-primary));border-left:0;color:var(--el-button-text-color,var(--el-text-color-regular));-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;margin:0;position:relative;cursor:pointer;transition:var(--el-transition-all);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:8px 15px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button__inner.is-round{padding:8px 15px}.el-radio-button__inner:hover{color:var(--el-color-primary)}.el-radio-button__inner [class*=el-icon-]{line-height:.9}.el-radio-button__inner [class*=el-icon-]+span{margin-left:5px}.el-radio-button:first-child .el-radio-button__inner{border-left:var(--el-border);border-radius:var(--el-border-radius-base) 0 0 var(--el-border-radius-base);box-shadow:none!important}.el-radio-button__original-radio{opacity:0;outline:0;position:absolute;z-index:-1}.el-radio-button__original-radio:checked+.el-radio-button__inner{color:var(--el-radio-button-checked-text-color,var(--el-color-white));background-color:var(--el-radio-button-checked-bg-color,var(--el-color-primary));border-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));box-shadow:-1px 0 0 0 var(--el-radio-button-checked-border-color,var(--el-color-primary))}.el-radio-button__original-radio:focus-visible+.el-radio-button__inner{border-left:var(--el-border);border-left-color:var(--el-radio-button-checked-border-color,var(--el-color-primary));outline:2px solid var(--el-radio-button-checked-border-color);outline-offset:1px;z-index:2;border-radius:var(--el-border-radius-base);box-shadow:none}.el-radio-button__original-radio:disabled+.el-radio-button__inner{color:var(--el-disabled-text-color);cursor:not-allowed;background-image:none;background-color:var(--el-button-disabled-bg-color,var(--el-fill-color-blank));border-color:var(--el-button-disabled-border-color,var(--el-border-color-light));box-shadow:none}.el-radio-button__original-radio:disabled:checked+.el-radio-button__inner{background-color:var(--el-radio-button-disabled-checked-fill)}.el-radio-button:last-child .el-radio-button__inner{border-radius:0 var(--el-border-radius-base) var(--el-border-radius-base) 0}.el-radio-button:first-child:last-child .el-radio-button__inner{border-radius:var(--el-border-radius-base)}.el-radio-button--large .el-radio-button__inner{padding:12px 19px;font-size:var(--el-font-size-base);border-radius:0}.el-radio-button--large .el-radio-button__inner.is-round{padding:12px 19px}.el-radio-button--small .el-radio-button__inner{padding:5px 11px;font-size:12px;border-radius:0}.el-radio-button--small .el-radio-button__inner.is-round{padding:5px 11px}.el-radio-group{display:inline-flex;align-items:center;flex-wrap:wrap;font-size:0}.el-radio{--el-radio-font-size:var(--el-font-size-base);--el-radio-text-color:var(--el-text-color-regular);--el-radio-font-weight:var(--el-font-weight-primary);--el-radio-input-height:14px;--el-radio-input-width:14px;--el-radio-input-border-radius:var(--el-border-radius-circle);--el-radio-input-bg-color:var(--el-fill-color-blank);--el-radio-input-border:var(--el-border);--el-radio-input-border-color:var(--el-border-color);--el-radio-input-border-color-hover:var(--el-color-primary)}.el-radio{color:var(--el-radio-text-color);font-weight:var(--el-radio-font-weight);position:relative;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;outline:0;font-size:var(--el-font-size-base);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-right:32px;height:32px}.el-radio.el-radio--large{height:40px}.el-radio.el-radio--small{height:24px}.el-radio.is-bordered{padding:0 15px 0 9px;border-radius:var(--el-border-radius-base);border:var(--el-border);box-sizing:border-box}.el-radio.is-bordered.is-checked{border-color:var(--el-color-primary)}.el-radio.is-bordered.is-disabled{cursor:not-allowed;border-color:var(--el-border-color-lighter)}.el-radio.is-bordered.el-radio--large{padding:0 19px 0 11px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--large .el-radio__label{font-size:var(--el-font-size-base)}.el-radio.is-bordered.el-radio--large .el-radio__inner{height:14px;width:14px}.el-radio.is-bordered.el-radio--small{padding:0 11px 0 7px;border-radius:var(--el-border-radius-base)}.el-radio.is-bordered.el-radio--small .el-radio__label{font-size:12px}.el-radio.is-bordered.el-radio--small .el-radio__inner{height:12px;width:12px}.el-radio:last-child{margin-right:0}.el-radio__input{white-space:nowrap;cursor:pointer;outline:0;display:inline-flex;position:relative;vertical-align:middle}.el-radio__input.is-disabled .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color);cursor:not-allowed}.el-radio__input.is-disabled .el-radio__inner:after{cursor:not-allowed;background-color:var(--el-disabled-bg-color)}.el-radio__input.is-disabled .el-radio__inner+.el-radio__label{cursor:not-allowed}.el-radio__input.is-disabled.is-checked .el-radio__inner{background-color:var(--el-disabled-bg-color);border-color:var(--el-disabled-border-color)}.el-radio__input.is-disabled.is-checked .el-radio__inner:after{background-color:var(--el-text-color-placeholder)}.el-radio__input.is-disabled+span.el-radio__label{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-radio__input.is-checked .el-radio__inner{border-color:var(--el-color-primary);background:var(--el-color-primary)}.el-radio__input.is-checked .el-radio__inner:after{transform:translate(-50%,-50%) scale(1)}.el-radio__input.is-checked+.el-radio__label{color:var(--el-color-primary)}.el-radio__input.is-focus .el-radio__inner{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner{border:var(--el-radio-input-border);border-radius:var(--el-radio-input-border-radius);width:var(--el-radio-input-width);height:var(--el-radio-input-height);background-color:var(--el-radio-input-bg-color);position:relative;cursor:pointer;display:inline-block;box-sizing:border-box}.el-radio__inner:hover{border-color:var(--el-radio-input-border-color-hover)}.el-radio__inner:after{width:4px;height:4px;border-radius:var(--el-radio-input-border-radius);background-color:var(--el-color-white);content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) scale(0);transition:transform .15s ease-in}.el-radio__original{opacity:0;outline:0;position:absolute;z-index:-1;top:0;left:0;right:0;bottom:0;margin:0}.el-radio__original:focus-visible+.el-radio__inner{outline:2px solid var(--el-radio-input-border-color-hover);outline-offset:1px;border-radius:var(--el-radio-input-border-radius)}.el-radio:focus:not(:focus-visible):not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner{box-shadow:0 0 2px 2px var(--el-radio-input-border-color-hover)}.el-radio__label{font-size:var(--el-radio-font-size);padding-left:8px}.el-radio.el-radio--large .el-radio__label{font-size:14px}.el-radio.el-radio--large .el-radio__inner{width:14px;height:14px}.el-radio.el-radio--small .el-radio__label{font-size:12px}.el-radio.el-radio--small .el-radio__inner{width:12px;height:12px}.el-rate{--el-rate-height:20px;--el-rate-font-size:var(--el-font-size-base);--el-rate-icon-size:18px;--el-rate-icon-margin:6px;--el-rate-void-color:var(--el-border-color-darker);--el-rate-fill-color:#f7ba2a;--el-rate-disabled-void-color:var(--el-fill-color);--el-rate-text-color:var(--el-text-color-primary)}.el-rate{display:inline-flex;align-items:center;height:32px}.el-rate:active,.el-rate:focus{outline:0}.el-rate__item{cursor:pointer;display:inline-block;position:relative;font-size:0;vertical-align:middle;color:var(--el-rate-void-color);line-height:normal}.el-rate .el-rate__icon{position:relative;display:inline-block;font-size:var(--el-rate-icon-size);margin-right:var(--el-rate-icon-margin);transition:var(--el-transition-duration)}.el-rate .el-rate__icon.hover{transform:scale(1.15)}.el-rate .el-rate__icon .path2{position:absolute;left:0;top:0}.el-rate .el-rate__icon.is-active{color:var(--el-rate-fill-color)}.el-rate__decimal{position:absolute;top:0;left:0;display:inline-block;overflow:hidden;color:var(--el-rate-fill-color)}.el-rate__text{font-size:var(--el-rate-font-size);vertical-align:middle;color:var(--el-rate-text-color)}.el-rate--large{height:40px}.el-rate--small{height:24px}.el-rate--small .el-rate__icon{font-size:14px}.el-rate.is-disabled .el-rate__item{cursor:auto;color:var(--el-rate-disabled-void-color)}.el-result{--el-result-padding:40px 30px;--el-result-icon-font-size:64px;--el-result-title-font-size:20px;--el-result-title-margin-top:20px;--el-result-subtitle-margin-top:10px;--el-result-extra-margin-top:30px}.el-result{display:flex;justify-content:center;align-items:center;flex-direction:column;text-align:center;box-sizing:border-box;padding:var(--el-result-padding)}.el-result__icon svg{width:var(--el-result-icon-font-size);height:var(--el-result-icon-font-size)}.el-result__title{margin-top:var(--el-result-title-margin-top)}.el-result__title p{margin:0;font-size:var(--el-result-title-font-size);color:var(--el-text-color-primary);line-height:1.3}.el-result__subtitle{margin-top:var(--el-result-subtitle-margin-top)}.el-result__subtitle p{margin:0;font-size:var(--el-font-size-base);color:var(--el-text-color-regular);line-height:1.3}.el-result__extra{margin-top:var(--el-result-extra-margin-top)}.el-result .icon-primary{--el-result-color:var(--el-color-primary);color:var(--el-result-color)}.el-result .icon-success{--el-result-color:var(--el-color-success);color:var(--el-result-color)}.el-result .icon-warning{--el-result-color:var(--el-color-warning);color:var(--el-result-color)}.el-result .icon-danger{--el-result-color:var(--el-color-danger);color:var(--el-result-color)}.el-result .icon-error{--el-result-color:var(--el-color-error);color:var(--el-result-color)}.el-result .icon-info{--el-result-color:var(--el-color-info);color:var(--el-result-color)}.el-row{display:flex;flex-wrap:wrap;position:relative;box-sizing:border-box}.el-row.is-justify-center{justify-content:center}.el-row.is-justify-end{justify-content:flex-end}.el-row.is-justify-space-between{justify-content:space-between}.el-row.is-justify-space-around{justify-content:space-around}.el-row.is-justify-space-evenly{justify-content:space-evenly}.el-row.is-align-middle{align-items:center}.el-row.is-align-bottom{align-items:flex-end}.el-scrollbar{--el-scrollbar-opacity:.3;--el-scrollbar-bg-color:var(--el-text-color-secondary);--el-scrollbar-hover-opacity:.5;--el-scrollbar-hover-bg-color:var(--el-text-color-secondary)}.el-scrollbar{overflow:hidden;position:relative;height:100%}.el-scrollbar__wrap{overflow:auto;height:100%}.el-scrollbar__wrap--hidden-default{scrollbar-width:none}.el-scrollbar__wrap--hidden-default::-webkit-scrollbar{display:none}.el-scrollbar__thumb{position:relative;display:block;width:0;height:0;cursor:pointer;border-radius:inherit;background-color:var(--el-scrollbar-bg-color,var(--el-text-color-secondary));transition:var(--el-transition-duration) background-color;opacity:var(--el-scrollbar-opacity,.3)}.el-scrollbar__thumb:hover{background-color:var(--el-scrollbar-hover-bg-color,var(--el-text-color-secondary));opacity:var(--el-scrollbar-hover-opacity,.5)}.el-scrollbar__bar{position:absolute;right:2px;bottom:2px;z-index:1;border-radius:4px}.el-scrollbar__bar.is-vertical{width:6px;top:2px}.el-scrollbar__bar.is-vertical>div{width:100%}.el-scrollbar__bar.is-horizontal{height:6px;left:2px}.el-scrollbar__bar.is-horizontal>div{height:100%}.el-scrollbar-fade-enter-active{transition:opacity .34s ease-out}.el-scrollbar-fade-leave-active{transition:opacity .12s ease-out}.el-scrollbar-fade-enter-from,.el-scrollbar-fade-leave-active{opacity:0}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled{color:var(--el-text-color-disabled)}.el-select-dropdown__option-item.is-selected:not(.is-multiple).is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown__option-item:hover:not(.hover){background-color:transparent}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-disabled.is-selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;margin:6px 0!important;padding:0!important;box-sizing:border-box}.el-select-dropdown__option-item{font-size:var(--el-select-font-size);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__option-item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__option-item.is-disabled:hover{background-color:var(--el-bg-color)}.el-select-dropdown__option-item.is-selected{background-color:var(--el-fill-color-light);font-weight:700}.el-select-dropdown__option-item.is-selected:not(.is-multiple){color:var(--el-color-primary)}.el-select-dropdown__option-item.hover{background-color:var(--el-fill-color-light)!important}.el-select-dropdown__option-item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon{position:absolute;right:20px;top:0;height:inherit;font-size:12px}.el-select-dropdown.is-multiple .el-select-dropdown__option-item.is-selected .el-icon svg{height:inherit;vertical-align:middle}.el-select-group{margin:0;padding:0}.el-select-group__wrap{position:relative;list-style:none;margin:0;padding:0}.el-select-group__wrap:not(:last-of-type){padding-bottom:24px}.el-select-group__wrap:not(:last-of-type):after{content:"";position:absolute;display:block;left:20px;right:20px;bottom:12px;height:1px;background:var(--el-border-color-light)}.el-select-group__split-dash{position:absolute;left:20px;right:20px;height:1px;background:var(--el-border-color-light)}.el-select-group__title{padding-left:20px;font-size:12px;color:var(--el-color-info);line-height:30px}.el-select-group .el-select-dropdown__item{padding-left:20px}.el-select-v2{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select-v2{display:inline-block;position:relative;vertical-align:middle;font-size:14px}.el-select-v2__wrapper{display:flex;align-items:center;flex-wrap:wrap;position:relative;box-sizing:border-box;cursor:pointer;padding:1px 30px 1px 0;border:1px solid var(--el-border-color);border-radius:var(--el-border-radius-base);background-color:var(--el-fill-color-blank);transition:var(--el-transition-duration)}.el-select-v2__wrapper:hover{border-color:var(--el-text-color-placeholder)}.el-select-v2__wrapper.is-filterable{cursor:text}.el-select-v2__wrapper.is-focused{border-color:var(--el-color-primary)}.el-select-v2__wrapper.is-hovering:not(.is-focused){border-color:var(--el-border-color-hover)}.el-select-v2__wrapper.is-disabled{cursor:not-allowed;background-color:var(--el-fill-color-light);color:var(--el-text-color-placeholder);border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled:hover{border-color:var(--el-select-disabled-border)}.el-select-v2__wrapper.is-disabled.is-focus{border-color:var(--el-input-focus-border-color)}.el-select-v2__wrapper.is-disabled .is-transparent{opacity:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-select-v2__wrapper.is-disabled .el-select-v2__caret,.el-select-v2__wrapper.is-disabled .el-select-v2__combobox-input{cursor:not-allowed}.el-select-v2__wrapper .el-select-v2__input-wrapper{box-sizing:border-box;position:relative;-webkit-margin-start:12px;margin-inline-start:12px;max-width:100%;overflow:hidden}.el-select-v2__wrapper,.el-select-v2__wrapper .el-select-v2__input-wrapper{line-height:32px}.el-select-v2__wrapper .el-select-v2__input-wrapper input{--el-input-inner-height:calc(var(--el-component-size, 32px) - 8px);height:var(--el-input-inner-height);line-height:var(--el-input-inner-height);min-width:4px;width:100%;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:0 0;border:none;margin:2px 0;outline:0;padding:0}.el-select-v2 .el-select-v2__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select-v2__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:14px}.el-select-v2__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select-v2__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select-v2__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select-v2__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select-v2--large .el-select-v2__wrapper .el-select-v2__combobox-input{height:32px}.el-select-v2--large .el-select-v2__caret,.el-select-v2--large .el-select-v2__suffix{height:40px}.el-select-v2--large .el-select-v2__placeholder{font-size:14px;line-height:40px}.el-select-v2--small .el-select-v2__wrapper .el-select-v2__combobox-input{height:16px}.el-select-v2--small .el-select-v2__caret,.el-select-v2--small .el-select-v2__suffix{height:24px}.el-select-v2--small .el-select-v2__placeholder{font-size:12px;line-height:24px}.el-select-v2 .el-select-v2__selection>span{display:inline-block}.el-select-v2:hover .el-select-v2__combobox-input{border-color:var(--el-select-border-color-hover)}.el-select-v2 .el-select__selection-text{text-overflow:ellipsis;display:inline-block;overflow-x:hidden;vertical-align:bottom}.el-select-v2 .el-select-v2__combobox-input{padding-right:35px;display:block;color:var(--el-text-color-regular)}.el-select-v2 .el-select-v2__combobox-input:focus{border-color:var(--el-select-input-focus-border-color)}.el-select-v2__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px}.el-select-v2__input.is-small{height:14px}.el-select-v2__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select-v2__close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__suffix{display:inline-flex;position:absolute;right:12px;height:32px;top:50%;transform:translateY(-50%);color:var(--el-input-icon-color,var(--el-text-color-placeholder))}.el-select-v2__suffix .el-input__icon{height:inherit}.el-select-v2__suffix .el-input__icon:not(:first-child){margin-left:8px}.el-select-v2__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:var(--el-transition-duration);transform:rotate(180deg);cursor:pointer}.el-select-v2__caret.is-reverse{transform:rotate(0)}.el-select-v2__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(180deg);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select-v2__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select-v2__caret.el-icon{height:inherit}.el-select-v2__caret.el-icon svg{vertical-align:middle}.el-select-v2__selection{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;width:100%}.el-select-v2__input-calculator{left:0;position:absolute;top:0;visibility:hidden;white-space:pre;z-index:999}.el-select-v2__selected-item{line-height:inherit;height:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-wrap:wrap}.el-select-v2__placeholder{position:absolute;top:50%;transform:translateY(-50%);-webkit-margin-start:12px;margin-inline-start:12px;width:calc(100% - 52px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--el-input-text-color,var(--el-text-color-regular))}.el-select-v2__placeholder.is-transparent{color:var(--el-text-color-placeholder)}.el-select-v2 .el-select-v2__selection .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 0 2px 6px;background-color:var(--el-fill-color)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;color:var(--el-color-white)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select-v2 .el-select-v2__selection .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select-v2.el-select-v2--small .el-select-v2__selection .el-tag{margin:1px 0 1px 6px;height:18px}.el-select-dropdown{z-index:calc(var(--el-index-top) + 1);border-radius:var(--el-border-radius-base);box-sizing:border-box}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.hover{background-color:var(--el-fill-color-light)}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown.is-multiple .el-select-dropdown__item.selected.is-disabled:after{background-color:var(--el-text-color-disabled)}.el-select-dropdown .el-select-dropdown__option-item.is-selected:after{content:"";position:absolute;top:50%;right:20px;border-top:none;border-right:none;background-repeat:no-repeat;background-position:center;background-color:var(--el-color-primary);-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;mask-size:100% 100%;-webkit-mask:url("data:image/svg+xml;utf8,%3Csvg class='icon' width='200' height='200' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='currentColor' d='M406.656 706.944L195.84 496.256a32 32 0 10-45.248 45.248l256 256 512-512a32 32 0 00-45.248-45.248L406.592 706.944z'%3E%3C/path%3E%3C/svg%3E") no-repeat;-webkit-mask-size:100% 100%;transform:translateY(-50%);width:12px;height:12px}.el-select-dropdown .el-scrollbar.is-empty .el-select-dropdown__list{padding:0}.el-select-dropdown .el-select-dropdown__item.is-disabled:hover{background-color:unset}.el-select-dropdown .el-select-dropdown__item.is-disabled.selected{color:var(--el-text-color-disabled)}.el-select-dropdown__empty{padding:10px 0;margin:0;text-align:center;color:var(--el-text-color-secondary);font-size:var(--el-select-font-size)}.el-select-dropdown__wrap{max-height:274px}.el-select-dropdown__list{list-style:none;padding:6px 0;margin:0;box-sizing:border-box}.el-select{--el-select-border-color-hover:var(--el-border-color-hover);--el-select-disabled-border:var(--el-disabled-border-color);--el-select-font-size:var(--el-font-size-base);--el-select-close-hover-color:var(--el-text-color-secondary);--el-select-input-color:var(--el-text-color-placeholder);--el-select-multiple-input-color:var(--el-text-color-regular);--el-select-input-focus-border-color:var(--el-color-primary);--el-select-input-font-size:14px}.el-select{display:inline-block;position:relative;vertical-align:middle;line-height:32px}.el-select__popper.el-popper{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light);box-shadow:var(--el-box-shadow-light)}.el-select__popper.el-popper .el-popper__arrow:before{border:1px solid var(--el-border-color-light)}.el-select__popper.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent;border-left-color:transparent}.el-select__popper.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent;border-right-color:transparent}.el-select__popper.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent;border-bottom-color:transparent}.el-select__popper.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent;border-top-color:transparent}.el-select .el-select-tags-wrapper.has-prefix{margin-left:6px}.el-select--large{line-height:40px}.el-select--large .el-select-tags-wrapper.has-prefix{margin-left:8px}.el-select--small{line-height:24px}.el-select--small .el-select-tags-wrapper.has-prefix{margin-left:4px}.el-select .el-select__tags>span{display:inline-block}.el-select:hover:not(.el-select--disabled) .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-border-color-hover) inset}.el-select .el-select__tags-text{display:inline-block;line-height:normal;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-select .el-input__wrapper{cursor:pointer}.el-select .el-input__wrapper.is-focus{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select .el-input__inner{cursor:pointer}.el-select .el-input{display:flex}.el-select .el-input .el-select__caret{color:var(--el-select-input-color);font-size:var(--el-select-input-font-size);transition:transform var(--el-transition-duration);transform:rotate(0);cursor:pointer}.el-select .el-input .el-select__caret.is-reverse{transform:rotate(-180deg)}.el-select .el-input .el-select__caret.is-show-close{font-size:var(--el-select-font-size);text-align:center;transform:rotate(0);border-radius:var(--el-border-radius-circle);color:var(--el-select-input-color);transition:var(--el-transition-color)}.el-select .el-input .el-select__caret.is-show-close:hover{color:var(--el-select-close-hover-color)}.el-select .el-input .el-select__caret.el-icon{position:relative;height:inherit;z-index:2}.el-select .el-input.is-disabled .el-input__wrapper{cursor:not-allowed}.el-select .el-input.is-disabled .el-input__wrapper:hover{box-shadow:0 0 0 1px var(--el-select-disabled-border) inset}.el-select .el-input.is-disabled .el-input__inner,.el-select .el-input.is-disabled .el-select__caret{cursor:not-allowed}.el-select .el-input.is-focus .el-input__wrapper{box-shadow:0 0 0 1px var(--el-select-input-focus-border-color) inset!important}.el-select__input{border:none;outline:0;padding:0;margin-left:15px;color:var(--el-select-multiple-input-color);font-size:var(--el-select-font-size);-webkit-appearance:none;-moz-appearance:none;appearance:none;height:28px;background-color:transparent}.el-select__input.is-disabled{cursor:not-allowed}.el-select__input--iOS{position:absolute;left:0;top:0;z-index:6}.el-select__input.is-small{height:14px}.el-select__close{cursor:pointer;position:absolute;top:8px;z-index:var(--el-index-top);right:25px;color:var(--el-select-input-color);line-height:18px;font-size:var(--el-select-input-font-size)}.el-select__close:hover{color:var(--el-select-close-hover-color)}.el-select__tags{position:absolute;line-height:normal;top:50%;transform:translateY(-50%);white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__tags .el-tag:last-child{margin-right:0}.el-select__tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__tags.is-disabled{cursor:not-allowed}.el-select__collapse-tags{white-space:normal;z-index:var(--el-index-normal);display:flex;align-items:center;flex-wrap:wrap;cursor:pointer}.el-select__collapse-tags .el-tag{box-sizing:border-box;border-color:transparent;margin:2px 6px 2px 0}.el-select__collapse-tags .el-tag:last-child{margin-right:0}.el-select__collapse-tags .el-tag .el-icon-close{background-color:var(--el-text-color-placeholder);right:-7px;top:0;color:#fff}.el-select__collapse-tags .el-tag .el-icon-close:hover{background-color:var(--el-text-color-secondary)}.el-select__collapse-tags .el-tag .el-icon-close:before{display:block;transform:translateY(.5px)}.el-select__collapse-tags .el-tag--info{background-color:var(--el-fill-color)}.el-select__collapse-tag{line-height:inherit;height:inherit;display:flex}.el-skeleton{--el-skeleton-circle-size:var(--el-avatar-size)}.el-skeleton__item{background:var(--el-skeleton-color);display:inline-block;height:16px;border-radius:var(--el-border-radius-base);width:100%}.el-skeleton__circle{border-radius:50%;width:var(--el-skeleton-circle-size);height:var(--el-skeleton-circle-size);line-height:var(--el-skeleton-circle-size)}.el-skeleton__button{height:40px;width:64px;border-radius:4px}.el-skeleton__p{width:100%}.el-skeleton__p.is-last{width:61%}.el-skeleton__p.is-first{width:33%}.el-skeleton__text{width:100%;height:var(--el-font-size-small)}.el-skeleton__caption{height:var(--el-font-size-extra-small)}.el-skeleton__h1{height:var(--el-font-size-extra-large)}.el-skeleton__h3{height:var(--el-font-size-large)}.el-skeleton__h5{height:var(--el-font-size-medium)}.el-skeleton__image{width:unset;display:flex;align-items:center;justify-content:center;border-radius:0}.el-skeleton__image svg{color:var(--el-svg-monochrome-grey);fill:currentColor;width:22%;height:22%}.el-skeleton{--el-skeleton-color:var(--el-fill-color);--el-skeleton-to-color:var(--el-fill-color-darker)}@-webkit-keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}@keyframes el-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}.el-skeleton{width:100%}.el-skeleton__first-line,.el-skeleton__paragraph{height:16px;margin-top:16px;background:var(--el-skeleton-color)}.el-skeleton.is-animated .el-skeleton__item{background:linear-gradient(90deg,var(--el-skeleton-color) 25%,var(--el-skeleton-to-color) 37%,var(--el-skeleton-color) 63%);background-size:400% 100%;-webkit-animation:el-skeleton-loading 1.4s ease infinite;animation:el-skeleton-loading 1.4s ease infinite}.el-slider{--el-slider-main-bg-color:var(--el-color-primary);--el-slider-runway-bg-color:var(--el-border-color-light);--el-slider-stop-bg-color:var(--el-color-white);--el-slider-disabled-color:var(--el-text-color-placeholder);--el-slider-border-radius:3px;--el-slider-height:6px;--el-slider-button-size:20px;--el-slider-button-wrapper-size:36px;--el-slider-button-wrapper-offset:-15px}.el-slider{width:100%;height:32px;display:flex;align-items:center}.el-slider__runway{flex:1;height:var(--el-slider-height);background-color:var(--el-slider-runway-bg-color);border-radius:var(--el-slider-border-radius);position:relative;cursor:pointer}.el-slider__runway.show-input{margin-right:30px;width:auto}.el-slider__runway.is-disabled{cursor:default}.el-slider__runway.is-disabled .el-slider__bar{background-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button{border-color:var(--el-slider-disabled-color)}.el-slider__runway.is-disabled .el-slider__button-wrapper.hover,.el-slider__runway.is-disabled .el-slider__button-wrapper:hover,.el-slider__runway.is-disabled .el-slider__button-wrapper.dragging{cursor:not-allowed}.el-slider__runway.is-disabled .el-slider__button.dragging,.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover{transform:scale(1)}.el-slider__runway.is-disabled .el-slider__button.hover,.el-slider__runway.is-disabled .el-slider__button:hover,.el-slider__runway.is-disabled .el-slider__button.dragging{cursor:not-allowed}.el-slider__input{flex-shrink:0;width:130px}.el-slider__bar{height:var(--el-slider-height);background-color:var(--el-slider-main-bg-color);border-top-left-radius:var(--el-slider-border-radius);border-bottom-left-radius:var(--el-slider-border-radius);position:absolute}.el-slider__button-wrapper{height:var(--el-slider-button-wrapper-size);width:var(--el-slider-button-wrapper-size);position:absolute;z-index:1;top:var(--el-slider-button-wrapper-offset);transform:translate(-50%);background-color:transparent;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:normal;outline:0}.el-slider__button-wrapper:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-slider__button-wrapper.hover,.el-slider__button-wrapper:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button-wrapper.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__button{display:inline-block;width:var(--el-slider-button-size);height:var(--el-slider-button-size);vertical-align:middle;border:solid 2px var(--el-slider-main-bg-color);background-color:var(--el-color-white);border-radius:50%;box-sizing:border-box;transition:var(--el-transition-duration-fast);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-slider__button.dragging,.el-slider__button.hover,.el-slider__button:hover{transform:scale(1.2)}.el-slider__button.hover,.el-slider__button:hover{cursor:-webkit-grab;cursor:grab}.el-slider__button.dragging{cursor:-webkit-grabbing;cursor:grabbing}.el-slider__stop{position:absolute;height:var(--el-slider-height);width:var(--el-slider-height);border-radius:var(--el-border-radius-circle);background-color:var(--el-slider-stop-bg-color);transform:translate(-50%)}.el-slider__marks{top:0;left:12px;width:18px;height:100%}.el-slider__marks-text{position:absolute;transform:translate(-50%);font-size:14px;color:var(--el-color-info);margin-top:15px;white-space:pre}.el-slider.is-vertical{position:relative;display:inline-flex;width:auto;height:100%;flex:0}.el-slider.is-vertical .el-slider__runway{width:var(--el-slider-height);height:100%;margin:0 16px}.el-slider.is-vertical .el-slider__bar{width:var(--el-slider-height);height:auto;border-radius:0 0 3px 3px}.el-slider.is-vertical .el-slider__button-wrapper{top:auto;left:var(--el-slider-button-wrapper-offset);transform:translateY(50%)}.el-slider.is-vertical .el-slider__stop{transform:translateY(50%)}.el-slider.is-vertical .el-slider__marks-text{margin-top:0;left:15px;transform:translateY(50%)}.el-slider--large{height:40px}.el-slider--small{height:24px}.el-space{display:inline-flex;vertical-align:top}.el-space__item{display:flex;flex-wrap:wrap}.el-space__item>*{flex:1}.el-space--vertical{flex-direction:column}.el-time-spinner{width:100%;white-space:nowrap}.el-spinner{display:inline-block;vertical-align:middle}.el-spinner-inner{-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite;width:50px;height:50px}.el-spinner-inner .path{stroke:var(--el-border-color-lighter);stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}@-webkit-keyframes rotate{to{transform:rotate(360deg)}}@keyframes rotate{to{transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-124}}.el-step{position:relative;flex-shrink:1}.el-step:last-of-type .el-step__line{display:none}.el-step:last-of-type.is-flex{flex-basis:auto!important;flex-shrink:0;flex-grow:0}.el-step:last-of-type .el-step__description,.el-step:last-of-type .el-step__main{padding-right:0}.el-step__head{position:relative;width:100%}.el-step__head.is-process{color:var(--el-text-color-primary);border-color:var(--el-text-color-primary)}.el-step__head.is-wait{color:var(--el-text-color-placeholder);border-color:var(--el-text-color-placeholder)}.el-step__head.is-success{color:var(--el-color-success);border-color:var(--el-color-success)}.el-step__head.is-error{color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-step__head.is-finish{color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-step__icon{position:relative;z-index:1;display:inline-flex;justify-content:center;align-items:center;width:24px;height:24px;font-size:14px;box-sizing:border-box;background:var(--el-bg-color);transition:.15s ease-out}.el-step__icon.is-text{border-radius:50%;border:2px solid;border-color:inherit}.el-step__icon.is-icon{width:40px}.el-step__icon-inner{display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-align:center;font-weight:700;line-height:1;color:inherit}.el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:25px;font-weight:400}.el-step__icon-inner.is-status{transform:translateY(1px)}.el-step__line{position:absolute;border-color:inherit;background-color:var(--el-text-color-placeholder)}.el-step__line-inner{display:block;border-width:1px;border-style:solid;border-color:inherit;transition:.15s ease-out;box-sizing:border-box;width:0;height:0}.el-step__main{white-space:normal;text-align:left}.el-step__title{font-size:16px;line-height:38px}.el-step__title.is-process{font-weight:700;color:var(--el-text-color-primary)}.el-step__title.is-wait{color:var(--el-text-color-placeholder)}.el-step__title.is-success{color:var(--el-color-success)}.el-step__title.is-error{color:var(--el-color-danger)}.el-step__title.is-finish{color:var(--el-color-primary)}.el-step__description{padding-right:10%;margin-top:-5px;font-size:12px;line-height:20px;font-weight:400}.el-step__description.is-process{color:var(--el-text-color-primary)}.el-step__description.is-wait{color:var(--el-text-color-placeholder)}.el-step__description.is-success{color:var(--el-color-success)}.el-step__description.is-error{color:var(--el-color-danger)}.el-step__description.is-finish{color:var(--el-color-primary)}.el-step.is-horizontal{display:inline-block}.el-step.is-horizontal .el-step__line{height:2px;top:11px;left:0;right:0}.el-step.is-vertical{display:flex}.el-step.is-vertical .el-step__head{flex-grow:0;width:24px}.el-step.is-vertical .el-step__main{padding-left:10px;flex-grow:1}.el-step.is-vertical .el-step__title{line-height:24px;padding-bottom:8px}.el-step.is-vertical .el-step__line{width:2px;top:0;bottom:0;left:11px}.el-step.is-vertical .el-step__icon.is-icon{width:24px}.el-step.is-center .el-step__head,.el-step.is-center .el-step__main{text-align:center}.el-step.is-center .el-step__description{padding-left:20%;padding-right:20%}.el-step.is-center .el-step__line{left:50%;right:-50%}.el-step.is-simple{display:flex;align-items:center}.el-step.is-simple .el-step__head{width:auto;font-size:0;padding-right:10px}.el-step.is-simple .el-step__icon{background:0 0;width:16px;height:16px;font-size:12px}.el-step.is-simple .el-step__icon-inner[class*=el-icon]:not(.is-status){font-size:18px}.el-step.is-simple .el-step__icon-inner.is-status{transform:scale(.8) translateY(1px)}.el-step.is-simple .el-step__main{position:relative;display:flex;align-items:stretch;flex-grow:1}.el-step.is-simple .el-step__title{font-size:16px;line-height:20px}.el-step.is-simple:not(:last-of-type) .el-step__title{max-width:50%;word-break:break-all}.el-step.is-simple .el-step__arrow{flex-grow:1;display:flex;align-items:center;justify-content:center}.el-step.is-simple .el-step__arrow:after,.el-step.is-simple .el-step__arrow:before{content:"";display:inline-block;position:absolute;height:15px;width:1px;background:var(--el-text-color-placeholder)}.el-step.is-simple .el-step__arrow:before{transform:rotate(-45deg) translateY(-4px);transform-origin:0 0}.el-step.is-simple .el-step__arrow:after{transform:rotate(45deg) translateY(4px);transform-origin:100% 100%}.el-step.is-simple:last-of-type .el-step__arrow{display:none}.el-steps{display:flex}.el-steps--simple{padding:13px 8%;border-radius:4px;background:var(--el-fill-color-light)}.el-steps--horizontal{white-space:nowrap}.el-steps--vertical{height:100%;flex-flow:column}.el-switch{--el-switch-on-color:var(--el-color-primary);--el-switch-off-color:var(--el-border-color)}.el-switch{display:inline-flex;align-items:center;position:relative;font-size:14px;line-height:20px;height:32px;vertical-align:middle}.el-switch.is-disabled .el-switch__core,.el-switch.is-disabled .el-switch__label{cursor:not-allowed}.el-switch__label{transition:var(--el-transition-duration-fast);height:20px;display:inline-block;font-size:14px;font-weight:500;cursor:pointer;vertical-align:middle;color:var(--el-text-color-primary)}.el-switch__label.is-active{color:var(--el-color-primary)}.el-switch__label--left{margin-right:10px}.el-switch__label--right{margin-left:10px}.el-switch__label *{line-height:1;font-size:14px;display:inline-block}.el-switch__label .el-icon{height:inherit}.el-switch__label .el-icon svg{vertical-align:middle}.el-switch__input{position:absolute;width:0;height:0;opacity:0;margin:0}.el-switch__input:focus-visible~.el-switch__core{outline:2px solid var(--el-switch-on-color);outline-offset:1px}.el-switch__core{display:inline-flex;position:relative;align-items:center;min-width:40px;height:20px;border:1px solid var(--el-switch-border-color,var(--el-switch-off-color));outline:0;border-radius:10px;box-sizing:border-box;background:var(--el-switch-off-color);cursor:pointer;transition:border-color var(--el-transition-duration),background-color var(--el-transition-duration)}.el-switch__core .el-switch__inner{width:100%;transition:all var(--el-transition-duration);height:16px;display:flex;justify-content:center;align-items:center;overflow:hidden;padding:0 4px 0 18px}.el-switch__core .el-switch__inner .is-icon,.el-switch__core .el-switch__inner .is-text{font-size:12px;color:var(--el-color-white);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-switch__core .el-switch__action{position:absolute;left:1px;border-radius:var(--el-border-radius-circle);transition:all var(--el-transition-duration);width:16px;height:16px;background-color:var(--el-color-white);display:flex;justify-content:center;align-items:center;color:var(--el-switch-off-color)}.el-switch.is-checked .el-switch__core{border-color:var(--el-switch-border-color,var(--el-switch-on-color));background-color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__action{left:calc(100% - 17px);color:var(--el-switch-on-color)}.el-switch.is-checked .el-switch__core .el-switch__inner{padding:0 18px 0 4px}.el-switch.is-disabled{opacity:.6}.el-switch--wide .el-switch__label.el-switch__label--left span{left:10px}.el-switch--wide .el-switch__label.el-switch__label--right span{right:10px}.el-switch .label-fade-enter-from,.el-switch .label-fade-leave-active{opacity:0}.el-switch--large{font-size:14px;line-height:24px;height:40px}.el-switch--large .el-switch__label{height:24px;font-size:14px}.el-switch--large .el-switch__label *{font-size:14px}.el-switch--large .el-switch__core{min-width:50px;height:24px;border-radius:12px}.el-switch--large .el-switch__core .el-switch__inner{height:20px;padding:0 6px 0 22px}.el-switch--large .el-switch__core .el-switch__action{width:20px;height:20px}.el-switch--large.is-checked .el-switch__core .el-switch__action{left:calc(100% - 21px)}.el-switch--large.is-checked .el-switch__core .el-switch__inner{padding:0 22px 0 6px}.el-switch--small{font-size:12px;line-height:16px;height:24px}.el-switch--small .el-switch__label{height:16px;font-size:12px}.el-switch--small .el-switch__label *{font-size:12px}.el-switch--small .el-switch__core{min-width:30px;height:16px;border-radius:8px}.el-switch--small .el-switch__core .el-switch__inner{height:12px;padding:0 2px 0 14px}.el-switch--small .el-switch__core .el-switch__action{width:12px;height:12px}.el-switch--small.is-checked .el-switch__core .el-switch__action{left:calc(100% - 13px)}.el-switch--small.is-checked .el-switch__core .el-switch__inner{padding:0 14px 0 2px}.el-table-column--selection .cell{padding-left:14px;padding-right:14px}.el-table-filter{border:solid 1px var(--el-border-color-lighter);border-radius:2px;background-color:#fff;box-shadow:var(--el-box-shadow-light);box-sizing:border-box}.el-table-filter__list{padding:5px 0;margin:0;list-style:none;min-width:100px}.el-table-filter__list-item{line-height:36px;padding:0 10px;cursor:pointer;font-size:var(--el-font-size-base)}.el-table-filter__list-item:hover{background-color:var(--el-color-primary-light-9);color:var(--el-color-primary)}.el-table-filter__list-item.is-active{background-color:var(--el-color-primary);color:#fff}.el-table-filter__content{min-width:100px}.el-table-filter__bottom{border-top:1px solid var(--el-border-color-lighter);padding:8px}.el-table-filter__bottom button{background:0 0;border:none;color:var(--el-text-color-regular);cursor:pointer;font-size:var(--el-font-size-small);padding:0 3px}.el-table-filter__bottom button:hover{color:var(--el-color-primary)}.el-table-filter__bottom button:focus{outline:0}.el-table-filter__bottom button.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-table-filter__wrap{max-height:280px}.el-table-filter__checkbox-group{padding:10px}.el-table-filter__checkbox-group label.el-checkbox{display:flex;align-items:center;margin-right:5px;margin-bottom:12px;margin-left:5px;height:unset}.el-table-filter__checkbox-group .el-checkbox:last-child{margin-bottom:0}.el-table{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table{position:relative;overflow:hidden;box-sizing:border-box;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:100%;max-width:100%;background-color:var(--el-table-bg-color);font-size:14px;color:var(--el-table-text-color)}.el-table__inner-wrapper{position:relative;display:flex;flex-direction:column;height:100%}.el-table__inner-wrapper:before{left:0;bottom:0;width:100%;height:1px}.el-table.has-footer.el-table--fluid-height tr:last-child td.el-table__cell,.el-table.has-footer.el-table--scrollable-y tr:last-child td.el-table__cell{border-bottom-color:transparent}.el-table__empty-block{position:-webkit-sticky;position:sticky;left:0;min-height:60px;text-align:center;width:100%;display:flex;justify-content:center;align-items:center}.el-table__empty-text{line-height:60px;width:50%;color:var(--el-text-color-secondary)}.el-table__expand-column .cell{padding:0;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table__expand-icon{position:relative;cursor:pointer;color:var(--el-text-color-regular);font-size:12px;transition:transform var(--el-transition-duration-fast) ease-in-out;height:20px}.el-table__expand-icon--expanded{transform:rotate(90deg)}.el-table__expand-icon>.el-icon{font-size:12px}.el-table__expanded-cell{background-color:var(--el-table-expanded-cell-bg-color)}.el-table__expanded-cell[class*=cell]{padding:20px 50px}.el-table__expanded-cell:hover{background-color:transparent!important}.el-table__placeholder{display:inline-block;width:20px}.el-table__append-wrapper{overflow:hidden}.el-table--fit{border-right:0;border-bottom:0}.el-table--fit .el-table__cell.gutter{border-right-width:1px}.el-table thead{color:var(--el-table-header-text-color);font-weight:500}.el-table thead.is-group th.el-table__cell{background:var(--el-fill-color-light)}.el-table .el-table__cell{padding:8px 0;min-width:0;box-sizing:border-box;text-overflow:ellipsis;vertical-align:middle;position:relative;text-align:left;z-index:1}.el-table .el-table__cell.is-center{text-align:center}.el-table .el-table__cell.is-right{text-align:right}.el-table .el-table__cell.gutter{width:15px;border-right-width:0;border-bottom-width:0;padding:0}.el-table .el-table__cell.is-hidden>*{visibility:hidden}.el-table .cell{box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;line-height:23px;padding:0 12px}.el-table .cell.el-tooltip{white-space:nowrap;min-width:50px}.el-table--large{font-size:var(--el-font-size-base)}.el-table--large .el-table__cell{padding:12px 0}.el-table--large .cell{padding:0 16px}.el-table--default{font-size:14px}.el-table--default .el-table__cell{padding:8px 0}.el-table--default .cell{padding:0 12px}.el-table--small{font-size:12px}.el-table--small .el-table__cell{padding:4px 0}.el-table--small .cell{padding:0 8px}.el-table tr{background-color:var(--el-table-tr-bg-color)}.el-table tr input[type=checkbox]{margin:0}.el-table td.el-table__cell,.el-table th.el-table__cell.is-leaf{border-bottom:var(--el-table-border)}.el-table th.el-table__cell.is-sortable{cursor:pointer}.el-table th.el-table__cell{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:var(--el-table-header-bg-color)}.el-table th.el-table__cell>.cell.highlight{color:var(--el-color-primary)}.el-table th.el-table__cell.required>div:before{display:inline-block;content:"";width:8px;height:8px;border-radius:50%;background:#ff4d51;margin-right:5px;vertical-align:middle}.el-table td.el-table__cell div{box-sizing:border-box}.el-table td.el-table__cell.gutter{width:0}.el-table__footer-wrapper{border-top:var(--el-table-border)}.el-table--border .el-table__inner-wrapper:after,.el-table--border:after,.el-table--border:before,.el-table__inner-wrapper:before{content:"";position:absolute;background-color:var(--el-table-border-color);z-index:3}.el-table--border .el-table__inner-wrapper:after{left:0;top:0;width:100%;height:1px}.el-table--border:before{top:-1px;left:0;width:1px;height:100%}.el-table--border:after{top:-1px;right:0;width:1px;height:100%}.el-table--border .el-table__inner-wrapper{border-right:none;border-bottom:none}.el-table--border .el-table__footer-wrapper{position:relative;flex-shrink:0}.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table--border th.el-table__cell.gutter:last-of-type{border-bottom:var(--el-table-border);border-bottom-width:1px}.el-table--border th.el-table__cell{border-bottom:var(--el-table-border)}.el-table--hidden{visibility:hidden}.el-table__body-wrapper,.el-table__footer-wrapper,.el-table__header-wrapper{width:100%}.el-table__body-wrapper tr td.el-table-fixed-column--left,.el-table__body-wrapper tr td.el-table-fixed-column--right,.el-table__body-wrapper tr th.el-table-fixed-column--left,.el-table__body-wrapper tr th.el-table-fixed-column--right,.el-table__footer-wrapper tr td.el-table-fixed-column--left,.el-table__footer-wrapper tr td.el-table-fixed-column--right,.el-table__footer-wrapper tr th.el-table-fixed-column--left,.el-table__footer-wrapper tr th.el-table-fixed-column--right,.el-table__header-wrapper tr td.el-table-fixed-column--left,.el-table__header-wrapper tr td.el-table-fixed-column--right,.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:var(--el-bg-color)}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{content:"";position:absolute;top:0;width:10px;bottom:-1px;overflow-x:hidden;overflow-y:hidden;box-shadow:none;touch-action:none;pointer-events:none}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-first-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-first-column:before{left:-10px}.el-table__body-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__body-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__footer-wrapper tr th.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr td.el-table-fixed-column--right.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--left.is-last-column:before,.el-table__header-wrapper tr th.el-table-fixed-column--right.is-last-column:before{right:-10px;box-shadow:none}.el-table__body-wrapper tr td.el-table__fixed-right-patch,.el-table__body-wrapper tr th.el-table__fixed-right-patch,.el-table__footer-wrapper tr td.el-table__fixed-right-patch,.el-table__footer-wrapper tr th.el-table__fixed-right-patch,.el-table__header-wrapper tr td.el-table__fixed-right-patch,.el-table__header-wrapper tr th.el-table__fixed-right-patch{position:-webkit-sticky!important;position:sticky!important;z-index:2;background:#fff;right:0}.el-table__header-wrapper{flex-shrink:0}.el-table__header-wrapper tr th.el-table-fixed-column--left,.el-table__header-wrapper tr th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body,.el-table__footer,.el-table__header{table-layout:fixed;border-collapse:separate}.el-table__footer-wrapper,.el-table__header-wrapper{overflow:hidden}.el-table__footer-wrapper tbody td.el-table__cell,.el-table__header-wrapper tbody td.el-table__cell{background-color:var(--el-table-row-hover-bg-color);color:var(--el-table-text-color)}.el-table__body-wrapper .el-table-column--selection>.cell,.el-table__header-wrapper .el-table-column--selection>.cell{display:inline-flex;align-items:center;height:23px}.el-table__body-wrapper .el-table-column--selection .el-checkbox,.el-table__header-wrapper .el-table-column--selection .el-checkbox{height:unset}.el-table.is-scrolling-left .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-left.el-table--border .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:var(--el-table-border)}.el-table.is-scrolling-left th.el-table-fixed-column--left{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-right .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-right th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column.el-table__cell{border-right:none}.el-table.is-scrolling-middle .el-table-fixed-column--right.is-first-column:before{box-shadow:var(--el-table-fixed-right-column)}.el-table.is-scrolling-middle .el-table-fixed-column--left.is-last-column:before{box-shadow:var(--el-table-fixed-left-column)}.el-table.is-scrolling-none .el-table-fixed-column--left.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--left.is-last-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-first-column:before,.el-table.is-scrolling-none .el-table-fixed-column--right.is-last-column:before{box-shadow:none}.el-table.is-scrolling-none th.el-table-fixed-column--left,.el-table.is-scrolling-none th.el-table-fixed-column--right{background-color:var(--el-table-header-bg-color)}.el-table__body-wrapper{overflow:hidden;position:relative;flex:1}.el-table__body-wrapper .el-scrollbar__bar{z-index:2}.el-table .caret-wrapper{display:inline-flex;flex-direction:column;align-items:center;height:14px;width:24px;vertical-align:middle;cursor:pointer;overflow:initial;position:relative}.el-table .sort-caret{width:0;height:0;border:solid 5px transparent;position:absolute;left:7px}.el-table .sort-caret.ascending{border-bottom-color:var(--el-text-color-placeholder);top:-5px}.el-table .sort-caret.descending{border-top-color:var(--el-text-color-placeholder);bottom:-3px}.el-table .ascending .sort-caret.ascending{border-bottom-color:var(--el-color-primary)}.el-table .descending .sort-caret.descending{border-top-color:var(--el-color-primary)}.el-table .hidden-columns{visibility:hidden;position:absolute;z-index:-1}.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell{background:var(--el-fill-color-lighter)}.el-table--striped .el-table__body tr.el-table__row--striped.current-row td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__body tr.hover-row.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped.current-row>td.el-table__cell,.el-table__body tr.hover-row.el-table__row--striped>td.el-table__cell,.el-table__body tr.hover-row>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table__body tr.current-row>td.el-table__cell{background-color:var(--el-table-current-row-bg-color)}.el-table__column-resize-proxy{position:absolute;left:200px;top:0;bottom:0;width:0;border-left:var(--el-table-border);z-index:10}.el-table__column-filter-trigger{display:inline-block;cursor:pointer}.el-table__column-filter-trigger i{color:var(--el-color-info);font-size:14px;vertical-align:middle}.el-table__border-left-patch{top:0;left:0;width:1px;height:100%;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-bottom-patch{left:0;height:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table__border-right-patch{top:0;height:100%;width:1px;z-index:3;position:absolute;background-color:var(--el-table-border-color)}.el-table--enable-row-transition .el-table__body td.el-table__cell{transition:background-color .25s ease}.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{background-color:var(--el-table-row-hover-bg-color)}.el-table [class*=el-table__row--level] .el-table__expand-icon{display:inline-block;width:12px;line-height:12px;height:12px;text-align:center;margin-right:8px}.el-table .el-table.el-table--border .el-table__cell{border-right:var(--el-table-border)}.el-table:not(.el-table--border) .el-table__cell{border-right:none}.el-table:not(.el-table--border)>.el-table__inner-wrapper:after{content:none}.el-table-v2{--el-table-border-color:var(--el-border-color-lighter);--el-table-border:1px solid var(--el-table-border-color);--el-table-text-color:var(--el-text-color-regular);--el-table-header-text-color:var(--el-text-color-secondary);--el-table-row-hover-bg-color:var(--el-fill-color-light);--el-table-current-row-bg-color:var(--el-color-primary-light-9);--el-table-header-bg-color:var(--el-bg-color);--el-table-fixed-box-shadow:var(--el-box-shadow-light);--el-table-bg-color:var(--el-fill-color-blank);--el-table-tr-bg-color:var(--el-fill-color-blank);--el-table-expanded-cell-bg-color:var(--el-fill-color-blank);--el-table-fixed-left-column:inset 10px 0 10px -10px rgba(0, 0, 0, .15);--el-table-fixed-right-column:inset -10px 0 10px -10px rgba(0, 0, 0, .15)}.el-table-v2{font-size:14px}.el-table-v2 *{box-sizing:border-box}.el-table-v2__root{position:relative}.el-table-v2__root:hover .el-table-v2__main .el-virtual-scrollbar{opacity:1}.el-table-v2__main{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0}.el-table-v2__main .el-vl__horizontal,.el-table-v2__main .el-vl__vertical{z-index:2}.el-table-v2__left{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);left:0;box-shadow:2px 0 4px #0000000f}.el-table-v2__left .el-virtual-scrollbar{opacity:0}.el-table-v2__left .el-vl__horizontal,.el-table-v2__left .el-vl__vertical{z-index:-1}.el-table-v2__right{display:flex;flex-direction:column-reverse;position:absolute;overflow:hidden;top:0;background-color:var(--el-bg-color);right:0;box-shadow:-2px 0 4px #0000000f}.el-table-v2__right .el-virtual-scrollbar{opacity:0}.el-table-v2__right .el-vl__horizontal,.el-table-v2__right .el-vl__vertical{z-index:-1}.el-table-v2__header-row,.el-table-v2__row{-webkit-padding-end:var(--el-table-scrollbar-size);padding-inline-end:var(--el-table-scrollbar-size)}.el-table-v2__header-wrapper{overflow:hidden}.el-table-v2__header{position:relative;overflow:hidden}.el-table-v2__footer{position:absolute;left:0;right:0;bottom:0;overflow:hidden}.el-table-v2__empty{position:absolute;left:0}.el-table-v2__overlay{position:absolute;left:0;right:0;top:0;bottom:0;z-index:9999}.el-table-v2__header-row{display:flex;border-bottom:var(--el-table-border)}.el-table-v2__header-cell{display:flex;align-items:center;padding:0 8px;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;background-color:var(--el-table-header-bg-color);color:var(--el-table-header-text-color);font-weight:700}.el-table-v2__header-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__header-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__header-cell.is-sortable{cursor:pointer}.el-table-v2__header-cell:hover .el-icon{display:block}.el-table-v2__sort-icon{transition:opacity,display var(--el-transition-duration);opacity:.6;display:none}.el-table-v2__sort-icon.is-sorting{display:block;opacity:1}.el-table-v2__row{border-bottom:var(--el-table-border);display:flex;align-items:center;transition:background-color var(--el-transition-duration)}.el-table-v2__row.is-hovered,.el-table-v2__row:hover{background-color:var(--el-table-row-hover-bg-color)}.el-table-v2__row-cell{height:100%;overflow:hidden;display:flex;align-items:center;padding:0 8px}.el-table-v2__row-cell.is-align-center{justify-content:center;text-align:center}.el-table-v2__row-cell.is-align-right{justify-content:flex-end;text-align:right}.el-table-v2__expand-icon{margin:0 4px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table-v2__expand-icon svg{transition:transform var(--el-transition-duration)}.el-table-v2__expand-icon.is-expanded svg{transform:rotate(90deg)}.el-table-v2:not(.is-dynamic) .el-table-v2__cell-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-table-v2.is-dynamic .el-table-v2__row{overflow:hidden;align-items:stretch}.el-table-v2.is-dynamic .el-table-v2__row .el-table-v2__row-cell{word-break:break-all}.el-tabs{--el-tabs-header-height:40px}.el-tabs__header{padding:0;position:relative;margin:0 0 15px}.el-tabs__active-bar{position:absolute;bottom:0;left:0;height:2px;background-color:var(--el-color-primary);z-index:1;transition:width var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),transform var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);list-style:none}.el-tabs__new-tab{display:flex;align-items:center;justify-content:center;float:right;border:1px solid var(--el-border-color);height:20px;width:20px;line-height:20px;margin:10px 0 10px 10px;border-radius:3px;text-align:center;font-size:12px;color:var(--el-text-color-primary);cursor:pointer;transition:all .15s}.el-tabs__new-tab .is-icon-plus{height:inherit;width:inherit;transform:scale(.8)}.el-tabs__new-tab .is-icon-plus svg{vertical-align:middle}.el-tabs__new-tab:hover{color:var(--el-color-primary)}.el-tabs__nav-wrap{overflow:hidden;margin-bottom:-1px;position:relative}.el-tabs__nav-wrap:after{content:"";position:absolute;left:0;bottom:0;width:100%;height:2px;background-color:var(--el-border-color-light);z-index:var(--el-index-normal)}.el-tabs__nav-wrap.is-scrollable{padding:0 20px;box-sizing:border-box}.el-tabs__nav-scroll{overflow:hidden}.el-tabs__nav-next,.el-tabs__nav-prev{position:absolute;cursor:pointer;line-height:44px;font-size:12px;color:var(--el-text-color-secondary);width:20px;text-align:center}.el-tabs__nav-next{right:0}.el-tabs__nav-prev{left:0}.el-tabs__nav{display:flex;white-space:nowrap;position:relative;transition:transform var(--el-transition-duration);float:left;z-index:calc(var(--el-index-normal) + 1)}.el-tabs__nav.is-stretch{min-width:100%;display:flex}.el-tabs__nav.is-stretch>*{flex:1;text-align:center}.el-tabs__item{padding:0 20px;height:var(--el-tabs-header-height);box-sizing:border-box;display:flex;align-items:center;justify-content:center;list-style:none;font-size:var(--el-font-size-base);font-weight:500;color:var(--el-text-color-primary);position:relative}.el-tabs__item:focus,.el-tabs__item:focus:active{outline:0}.el-tabs__item:focus-visible{box-shadow:0 0 2px 2px var(--el-color-primary) inset;border-radius:3px}.el-tabs__item .is-icon-close{border-radius:50%;text-align:center;transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);margin-left:5px}.el-tabs__item .is-icon-close:before{transform:scale(.9);display:inline-block}.el-tabs__item .is-icon-close:hover{background-color:var(--el-text-color-placeholder);color:#fff}.el-tabs__item.is-active{color:var(--el-color-primary)}.el-tabs__item:hover{color:var(--el-color-primary);cursor:pointer}.el-tabs__item.is-disabled{color:var(--el-disabled-text-color);cursor:not-allowed}.el-tabs__content{overflow:hidden;position:relative}.el-tabs--card>.el-tabs__header{border-bottom:1px solid var(--el-border-color-light);height:var(--el-tabs-header-height)}.el-tabs--card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--card>.el-tabs__header .el-tabs__nav{border:1px solid var(--el-border-color-light);border-bottom:none;border-radius:4px 4px 0 0;box-sizing:border-box}.el-tabs--card>.el-tabs__header .el-tabs__active-bar{display:none}.el-tabs--card>.el-tabs__header .el-tabs__item .is-icon-close{position:relative;font-size:12px;width:0;height:14px;overflow:hidden;right:-2px;transform-origin:100% 50%}.el-tabs--card>.el-tabs__header .el-tabs__item{border-bottom:1px solid transparent;border-left:1px solid var(--el-border-color-light);transition:color var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier),padding var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier)}.el-tabs--card>.el-tabs__header .el-tabs__item:first-child{border-left:none}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover{padding-left:13px;padding-right:13px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-closable:hover .is-icon-close{width:14px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active{border-bottom-color:var(--el-bg-color)}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable{padding-left:20px;padding-right:20px}.el-tabs--card>.el-tabs__header .el-tabs__item.is-active.is-closable .is-icon-close{width:14px}.el-tabs--border-card{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color)}.el-tabs--border-card>.el-tabs__content{padding:15px}.el-tabs--border-card>.el-tabs__header{background-color:var(--el-fill-color-light);border-bottom:1px solid var(--el-border-color-light);margin:0}.el-tabs--border-card>.el-tabs__header .el-tabs__nav-wrap:after{content:none}.el-tabs--border-card>.el-tabs__header .el-tabs__item{transition:all var(--el-transition-duration) var(--el-transition-function-ease-in-out-bezier);border:1px solid transparent;margin-top:-1px;color:var(--el-text-color-secondary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:first-child{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item+.el-tabs__item{margin-left:-1px}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-active{color:var(--el-color-primary);background-color:var(--el-bg-color-overlay);border-right-color:var(--el-border-color);border-left-color:var(--el-border-color)}.el-tabs--border-card>.el-tabs__header .el-tabs__item:not(.is-disabled):hover{color:var(--el-color-primary)}.el-tabs--border-card>.el-tabs__header .el-tabs__item.is-disabled{color:var(--el-disabled-text-color)}.el-tabs--border-card>.el-tabs__header .is-scrollable .el-tabs__item:first-child{margin-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:nth-child(2),.el-tabs--bottom .el-tabs__item.is-top:nth-child(2),.el-tabs--top .el-tabs__item.is-bottom:nth-child(2),.el-tabs--top .el-tabs__item.is-top:nth-child(2){padding-left:0}.el-tabs--bottom .el-tabs__item.is-bottom:last-child,.el-tabs--bottom .el-tabs__item.is-top:last-child,.el-tabs--top .el-tabs__item.is-bottom:last-child,.el-tabs--top .el-tabs__item.is-top:last-child{padding-right:0}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2),.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2){padding-left:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:nth-child(2):not(.is-active).is-closable:hover{padding-left:13px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child{padding-right:20px}.el-tabs--bottom .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--bottom.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--left>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top .el-tabs--right>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--border-card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover,.el-tabs--top.el-tabs--card>.el-tabs__header .el-tabs__item:last-child:not(.is-active).is-closable:hover{padding-right:13px}.el-tabs--bottom .el-tabs__header.is-bottom{margin-bottom:0;margin-top:10px}.el-tabs--bottom.el-tabs--border-card .el-tabs__header.is-bottom{border-bottom:0;border-top:1px solid var(--el-border-color)}.el-tabs--bottom.el-tabs--border-card .el-tabs__nav-wrap.is-bottom{margin-top:-1px;margin-bottom:0}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom:not(.is-active){border:1px solid transparent}.el-tabs--bottom.el-tabs--border-card .el-tabs__item.is-bottom{margin:0 -1px -1px}.el-tabs--left,.el-tabs--right{overflow:hidden}.el-tabs--left .el-tabs__header.is-left,.el-tabs--left .el-tabs__header.is-right,.el-tabs--left .el-tabs__nav-scroll,.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__header.is-left,.el-tabs--right .el-tabs__header.is-right,.el-tabs--right .el-tabs__nav-scroll,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{height:100%}.el-tabs--left .el-tabs__active-bar.is-left,.el-tabs--left .el-tabs__active-bar.is-right,.el-tabs--right .el-tabs__active-bar.is-left,.el-tabs--right .el-tabs__active-bar.is-right{top:0;bottom:auto;width:2px;height:auto}.el-tabs--left .el-tabs__nav-wrap.is-left,.el-tabs--left .el-tabs__nav-wrap.is-right,.el-tabs--right .el-tabs__nav-wrap.is-left,.el-tabs--right .el-tabs__nav-wrap.is-right{margin-bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{height:30px;line-height:30px;width:100%;text-align:center;cursor:pointer}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next i,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev i{transform:rotate(90deg)}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-prev,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-prev{left:auto;top:0}.el-tabs--left .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--left .el-tabs__nav-wrap.is-right>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-left>.el-tabs__nav-next,.el-tabs--right .el-tabs__nav-wrap.is-right>.el-tabs__nav-next{right:auto;bottom:0}.el-tabs--left .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--left .el-tabs__nav-wrap.is-right.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-left.is-scrollable,.el-tabs--right .el-tabs__nav-wrap.is-right.is-scrollable{padding:30px 0}.el-tabs--left .el-tabs__nav-wrap.is-left:after,.el-tabs--left .el-tabs__nav-wrap.is-right:after,.el-tabs--right .el-tabs__nav-wrap.is-left:after,.el-tabs--right .el-tabs__nav-wrap.is-right:after{height:100%;width:2px;bottom:auto;top:0}.el-tabs--left .el-tabs__nav.is-left,.el-tabs--left .el-tabs__nav.is-right,.el-tabs--right .el-tabs__nav.is-left,.el-tabs--right .el-tabs__nav.is-right{flex-direction:column}.el-tabs--left .el-tabs__item.is-left,.el-tabs--right .el-tabs__item.is-left{justify-content:flex-end}.el-tabs--left .el-tabs__item.is-right,.el-tabs--right .el-tabs__item.is-right{justify-content:flex-start}.el-tabs--left .el-tabs__header.is-left{float:left;margin-bottom:0;margin-right:10px}.el-tabs--left .el-tabs__nav-wrap.is-left{margin-right:-1px}.el-tabs--left .el-tabs__nav-wrap.is-left:after{left:auto;right:0}.el-tabs--left .el-tabs__active-bar.is-left{right:0;left:auto}.el-tabs--left .el-tabs__item.is-left{text-align:right}.el-tabs--left.el-tabs--card .el-tabs__active-bar.is-left{display:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left{border-left:none;border-right:1px solid var(--el-border-color-light);border-bottom:none;border-top:1px solid var(--el-border-color-light);text-align:left}.el-tabs--left.el-tabs--card .el-tabs__item.is-left:first-child{border-right:1px solid var(--el-border-color-light);border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active{border:1px solid var(--el-border-color-light);border-right-color:#fff;border-left:none;border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:first-child{border-top:none}.el-tabs--left.el-tabs--card .el-tabs__item.is-left.is-active:last-child{border-bottom:none}.el-tabs--left.el-tabs--card .el-tabs__nav{border-radius:4px 0 0 4px;border-bottom:1px solid var(--el-border-color-light);border-right:none}.el-tabs--left.el-tabs--card .el-tabs__new-tab{float:none}.el-tabs--left.el-tabs--border-card .el-tabs__header.is-left{border-right:1px solid var(--el-border-color)}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left{border:1px solid transparent;margin:-1px 0 -1px -1px}.el-tabs--left.el-tabs--border-card .el-tabs__item.is-left.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.el-tabs--right .el-tabs__header.is-right{float:right;margin-bottom:0;margin-left:10px}.el-tabs--right .el-tabs__nav-wrap.is-right{margin-left:-1px}.el-tabs--right .el-tabs__nav-wrap.is-right:after{left:0;right:auto}.el-tabs--right .el-tabs__active-bar.is-right{left:0}.el-tabs--right.el-tabs--card .el-tabs__active-bar.is-right{display:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right{border-bottom:none;border-top:1px solid var(--el-border-color-light)}.el-tabs--right.el-tabs--card .el-tabs__item.is-right:first-child{border-left:1px solid var(--el-border-color-light);border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active{border:1px solid var(--el-border-color-light);border-left-color:#fff;border-right:none;border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:first-child{border-top:none}.el-tabs--right.el-tabs--card .el-tabs__item.is-right.is-active:last-child{border-bottom:none}.el-tabs--right.el-tabs--card .el-tabs__nav{border-radius:0 4px 4px 0;border-bottom:1px solid var(--el-border-color-light);border-left:none}.el-tabs--right.el-tabs--border-card .el-tabs__header.is-right{border-left:1px solid var(--el-border-color)}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right{border:1px solid transparent;margin:-1px -1px -1px 0}.el-tabs--right.el-tabs--border-card .el-tabs__item.is-right.is-active{border-color:transparent;border-top-color:#d1dbe5;border-bottom-color:#d1dbe5}.slideInLeft-transition,.slideInRight-transition{display:inline-block}.slideInRight-enter{-webkit-animation:slideInRight-enter var(--el-transition-duration);animation:slideInRight-enter var(--el-transition-duration)}.slideInRight-leave{position:absolute;left:0;right:0;-webkit-animation:slideInRight-leave var(--el-transition-duration);animation:slideInRight-leave var(--el-transition-duration)}.slideInLeft-enter{-webkit-animation:slideInLeft-enter var(--el-transition-duration);animation:slideInLeft-enter var(--el-transition-duration)}.slideInLeft-leave{position:absolute;left:0;right:0;-webkit-animation:slideInLeft-leave var(--el-transition-duration);animation:slideInLeft-leave var(--el-transition-duration)}@-webkit-keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInRight-enter{0%{opacity:0;transform-origin:0 0;transform:translate(100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@keyframes slideInRight-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(100%);opacity:0}}@-webkit-keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@keyframes slideInLeft-enter{0%{opacity:0;transform-origin:0 0;transform:translate(-100%)}to{opacity:1;transform-origin:0 0;transform:translate(0)}}@-webkit-keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}@keyframes slideInLeft-leave{0%{transform-origin:0 0;transform:translate(0);opacity:1}to{transform-origin:0 0;transform:translate(-100%);opacity:0}}.el-tag{--el-tag-font-size:12px;--el-tag-border-radius:4px;--el-tag-border-radius-rounded:9999px}.el-tag{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary);--el-tag-text-color:var(--el-color-primary);background-color:var(--el-tag-bg-color);border-color:var(--el-tag-border-color);color:var(--el-tag-text-color);display:inline-flex;justify-content:center;align-items:center;height:24px;padding:0 9px;font-size:var(--el-tag-font-size);line-height:1;border-width:1px;border-style:solid;border-radius:var(--el-tag-border-radius);box-sizing:border-box;white-space:nowrap;--el-icon-size:14px}.el-tag.el-tag--primary{--el-tag-bg-color:var(--el-color-primary-light-9);--el-tag-border-color:var(--el-color-primary-light-8);--el-tag-hover-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-bg-color:var(--el-color-success-light-9);--el-tag-border-color:var(--el-color-success-light-8);--el-tag-hover-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-bg-color:var(--el-color-warning-light-9);--el-tag-border-color:var(--el-color-warning-light-8);--el-tag-hover-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-bg-color:var(--el-color-danger-light-9);--el-tag-border-color:var(--el-color-danger-light-8);--el-tag-hover-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-bg-color:var(--el-color-error-light-9);--el-tag-border-color:var(--el-color-error-light-8);--el-tag-hover-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-bg-color:var(--el-color-info-light-9);--el-tag-border-color:var(--el-color-info-light-8);--el-tag-hover-color:var(--el-color-info)}.el-tag.el-tag--primary{--el-tag-text-color:var(--el-color-primary)}.el-tag.el-tag--success{--el-tag-text-color:var(--el-color-success)}.el-tag.el-tag--warning{--el-tag-text-color:var(--el-color-warning)}.el-tag.el-tag--danger{--el-tag-text-color:var(--el-color-danger)}.el-tag.el-tag--error{--el-tag-text-color:var(--el-color-error)}.el-tag.el-tag--info{--el-tag-text-color:var(--el-color-info)}.el-tag.is-hit{border-color:var(--el-color-primary)}.el-tag.is-round{border-radius:var(--el-tag-border-radius-rounded)}.el-tag .el-tag__close{color:var(--el-tag-text-color)}.el-tag .el-tag__close:hover{color:var(--el-color-white);background-color:var(--el-tag-hover-color)}.el-tag .el-icon{border-radius:50%;cursor:pointer;font-size:calc(var(--el-icon-size) - 2px);height:var(--el-icon-size);width:var(--el-icon-size)}.el-tag .el-tag__close{margin-left:6px}.el-tag--dark{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3);--el-tag-text-color:var(--el-color-white)}.el-tag--dark.el-tag--primary{--el-tag-bg-color:var(--el-color-primary);--el-tag-border-color:var(--el-color-primary);--el-tag-hover-color:var(--el-color-primary-light-3)}.el-tag--dark.el-tag--success{--el-tag-bg-color:var(--el-color-success);--el-tag-border-color:var(--el-color-success);--el-tag-hover-color:var(--el-color-success-light-3)}.el-tag--dark.el-tag--warning{--el-tag-bg-color:var(--el-color-warning);--el-tag-border-color:var(--el-color-warning);--el-tag-hover-color:var(--el-color-warning-light-3)}.el-tag--dark.el-tag--danger{--el-tag-bg-color:var(--el-color-danger);--el-tag-border-color:var(--el-color-danger);--el-tag-hover-color:var(--el-color-danger-light-3)}.el-tag--dark.el-tag--error{--el-tag-bg-color:var(--el-color-error);--el-tag-border-color:var(--el-color-error);--el-tag-hover-color:var(--el-color-error-light-3)}.el-tag--dark.el-tag--info{--el-tag-bg-color:var(--el-color-info);--el-tag-border-color:var(--el-color-info);--el-tag-hover-color:var(--el-color-info-light-3)}.el-tag--dark.el-tag--primary,.el-tag--dark.el-tag--success,.el-tag--dark.el-tag--warning,.el-tag--dark.el-tag--danger,.el-tag--dark.el-tag--error,.el-tag--dark.el-tag--info{--el-tag-text-color:var(--el-color-white)}.el-tag--plain{--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary);--el-tag-bg-color:var(--el-fill-color-blank)}.el-tag--plain.el-tag--primary{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-primary-light-5);--el-tag-hover-color:var(--el-color-primary)}.el-tag--plain.el-tag--success{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-success-light-5);--el-tag-hover-color:var(--el-color-success)}.el-tag--plain.el-tag--warning{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-warning-light-5);--el-tag-hover-color:var(--el-color-warning)}.el-tag--plain.el-tag--danger{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-danger-light-5);--el-tag-hover-color:var(--el-color-danger)}.el-tag--plain.el-tag--error{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-error-light-5);--el-tag-hover-color:var(--el-color-error)}.el-tag--plain.el-tag--info{--el-tag-bg-color:var(--el-fill-color-blank);--el-tag-border-color:var(--el-color-info-light-5);--el-tag-hover-color:var(--el-color-info)}.el-tag.is-closable{padding-right:5px}.el-tag--large{padding:0 11px;height:32px;--el-icon-size:16px}.el-tag--large .el-tag__close{margin-left:8px}.el-tag--large.is-closable{padding-right:7px}.el-tag--small{padding:0 7px;height:20px;--el-icon-size:12px}.el-tag--small .el-tag__close{margin-left:4px}.el-tag--small.is-closable{padding-right:3px}.el-tag--small .el-icon-close{transform:scale(.8)}.el-tag.el-tag--primary.is-hit{border-color:var(--el-color-primary)}.el-tag.el-tag--success.is-hit{border-color:var(--el-color-success)}.el-tag.el-tag--warning.is-hit{border-color:var(--el-color-warning)}.el-tag.el-tag--danger.is-hit{border-color:var(--el-color-danger)}.el-tag.el-tag--error.is-hit{border-color:var(--el-color-error)}.el-tag.el-tag--info.is-hit{border-color:var(--el-color-info)}.el-text{--el-text-font-size:var(--el-font-size-base);--el-text-color:var(--el-text-color-regular)}.el-text{align-self:center;margin:0;padding:0;font-size:var(--el-text-font-size);color:var(--el-text-color);word-break:break-all}.el-text.is-truncated{display:inline-block;max-width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.el-text--large{--el-text-font-size:var(--el-font-size-medium)}.el-text--default{--el-text-font-size:var(--el-font-size-base)}.el-text--small{--el-text-font-size:var(--el-font-size-extra-small)}.el-text.el-text--primary{--el-text-color:var(--el-color-primary)}.el-text.el-text--success{--el-text-color:var(--el-color-success)}.el-text.el-text--warning{--el-text-color:var(--el-color-warning)}.el-text.el-text--danger{--el-text-color:var(--el-color-danger)}.el-text.el-text--error{--el-text-color:var(--el-color-error)}.el-text.el-text--info{--el-text-color:var(--el-color-info)}.el-text>.el-icon{vertical-align:-2px}.time-select{margin:5px 0;min-width:0}.time-select .el-picker-panel__content{max-height:200px;margin:0}.time-select-item{padding:8px 10px;font-size:14px;line-height:20px}.time-select-item.disabled{color:var(--el-datepicker-border-color);cursor:not-allowed}.time-select-item:hover{background-color:var(--el-fill-color-light);font-weight:700;cursor:pointer}.time-select .time-select-item.selected:not(.disabled){color:var(--el-color-primary);font-weight:700}.el-timeline-item{position:relative;padding-bottom:20px}.el-timeline-item__wrapper{position:relative;padding-left:28px;top:-3px}.el-timeline-item__tail{position:absolute;left:4px;height:100%;border-left:2px solid var(--el-timeline-node-color)}.el-timeline-item .el-timeline-item__icon{color:var(--el-color-white);font-size:var(--el-font-size-small)}.el-timeline-item__node{position:absolute;background-color:var(--el-timeline-node-color);border-color:var(--el-timeline-node-color);border-radius:50%;box-sizing:border-box;display:flex;justify-content:center;align-items:center}.el-timeline-item__node--normal{left:-1px;width:var(--el-timeline-node-size-normal);height:var(--el-timeline-node-size-normal)}.el-timeline-item__node--large{left:-2px;width:var(--el-timeline-node-size-large);height:var(--el-timeline-node-size-large)}.el-timeline-item__node.is-hollow{background:var(--el-color-white);border-style:solid;border-width:2px}.el-timeline-item__node--primary{background-color:var(--el-color-primary);border-color:var(--el-color-primary)}.el-timeline-item__node--success{background-color:var(--el-color-success);border-color:var(--el-color-success)}.el-timeline-item__node--warning{background-color:var(--el-color-warning);border-color:var(--el-color-warning)}.el-timeline-item__node--danger{background-color:var(--el-color-danger);border-color:var(--el-color-danger)}.el-timeline-item__node--info{background-color:var(--el-color-info);border-color:var(--el-color-info)}.el-timeline-item__dot{position:absolute;display:flex;justify-content:center;align-items:center}.el-timeline-item__content{color:var(--el-text-color-primary)}.el-timeline-item__timestamp{color:var(--el-text-color-secondary);line-height:1;font-size:var(--el-font-size-small)}.el-timeline-item__timestamp.is-top{margin-bottom:8px;padding-top:4px}.el-timeline-item__timestamp.is-bottom{margin-top:8px}.el-timeline{--el-timeline-node-size-normal:12px;--el-timeline-node-size-large:14px;--el-timeline-node-color:var(--el-border-color-light)}.el-timeline{margin:0;font-size:var(--el-font-size-base);list-style:none}.el-timeline .el-timeline-item:last-child .el-timeline-item__tail{display:none}.el-timeline .el-timeline-item__center{display:flex;align-items:center}.el-timeline .el-timeline-item__center .el-timeline-item__wrapper{width:100%}.el-timeline .el-timeline-item__center .el-timeline-item__tail{top:0}.el-timeline .el-timeline-item__center:first-child .el-timeline-item__tail{height:calc(50% + 10px);top:calc(50% - 10px)}.el-timeline .el-timeline-item__center:last-child .el-timeline-item__tail{display:block;height:calc(50% - 10px)}.el-tooltip-v2__content{--el-tooltip-v2-padding:5px 10px;--el-tooltip-v2-border-radius:4px;--el-tooltip-v2-border-color:var(--el-border-color);border-radius:var(--el-tooltip-v2-border-radius);color:var(--el-color-black);background-color:var(--el-color-white);padding:var(--el-tooltip-v2-padding);border:1px solid var(--el-border-color)}.el-tooltip-v2__arrow{position:absolute;color:var(--el-color-white);width:var(--el-tooltip-v2-arrow-width);height:var(--el-tooltip-v2-arrow-height);pointer-events:none;left:var(--el-tooltip-v2-arrow-x);top:var(--el-tooltip-v2-arrow-y)}.el-tooltip-v2__arrow:before{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__arrow:after{content:"";width:0;height:0;border:var(--el-tooltip-v2-arrow-border-width) solid transparent;position:absolute}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow{bottom:0}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:before{border-top-color:var(--el-color-white);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=top] .el-tooltip-v2__arrow:after{border-top-color:var(--el-border-color);border-top-width:var(--el-tooltip-v2-arrow-border-width);border-bottom:0;top:100%;z-index:-1}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow{top:0}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:before{border-bottom-color:var(--el-color-white);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=bottom] .el-tooltip-v2__arrow:after{border-bottom-color:var(--el-border-color);border-bottom-width:var(--el-tooltip-v2-arrow-border-width);border-top:0;bottom:100%;z-index:-1}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow{right:0}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:before{border-left-color:var(--el-color-white);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=left] .el-tooltip-v2__arrow:after{border-left-color:var(--el-border-color);border-left-width:var(--el-tooltip-v2-arrow-border-width);border-right:0;left:100%;z-index:-1}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow{left:0}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:before{border-right-color:var(--el-color-white);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:calc(100% - 1px)}.el-tooltip-v2__content[data-side^=right] .el-tooltip-v2__arrow:after{border-right-color:var(--el-border-color);border-right-width:var(--el-tooltip-v2-arrow-border-width);border-left:0;right:100%;z-index:-1}.el-tooltip-v2__content.is-dark{--el-tooltip-v2-border-color:transparent;background-color:var(--el-color-black);color:var(--el-color-white);border-color:transparent}.el-tooltip-v2__content.is-dark .el-tooltip-v2__arrow{background-color:var(--el-color-black);border-color:transparent}.el-transfer{--el-transfer-border-color:var(--el-border-color-lighter);--el-transfer-border-radius:var(--el-border-radius-base);--el-transfer-panel-width:200px;--el-transfer-panel-header-height:40px;--el-transfer-panel-header-bg-color:var(--el-fill-color-light);--el-transfer-panel-footer-height:40px;--el-transfer-panel-body-height:278px;--el-transfer-item-height:30px;--el-transfer-filter-height:32px}.el-transfer{font-size:var(--el-font-size-base)}.el-transfer__buttons{display:inline-block;vertical-align:middle;padding:0 30px}.el-transfer__button{vertical-align:top}.el-transfer__button:nth-child(2){margin:0 0 0 10px}.el-transfer__button i,.el-transfer__button span{font-size:14px}.el-transfer__button .el-icon+span{margin-left:0}.el-transfer-panel{overflow:hidden;background:var(--el-bg-color-overlay);display:inline-block;text-align:left;vertical-align:middle;width:var(--el-transfer-panel-width);max-height:100%;box-sizing:border-box;position:relative}.el-transfer-panel__body{height:var(--el-transfer-panel-body-height);border-left:1px solid var(--el-transfer-border-color);border-right:1px solid var(--el-transfer-border-color);border-bottom:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius);overflow:hidden}.el-transfer-panel__body.is-with-footer{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.el-transfer-panel__list{margin:0;padding:6px 0;list-style:none;height:var(--el-transfer-panel-body-height);overflow:auto;box-sizing:border-box}.el-transfer-panel__list.is-filterable{height:calc(100% - var(--el-transfer-filter-height) - 30px);padding-top:0}.el-transfer-panel__item{height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding-left:15px;display:block!important}.el-transfer-panel__item+.el-transfer-panel__item{margin-left:0}.el-transfer-panel__item.el-checkbox{color:var(--el-text-color-regular)}.el-transfer-panel__item:hover{color:var(--el-color-primary)}.el-transfer-panel__item.el-checkbox .el-checkbox__label{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;box-sizing:border-box;padding-left:22px;line-height:var(--el-transfer-item-height)}.el-transfer-panel__item .el-checkbox__input{position:absolute;top:8px}.el-transfer-panel__filter{text-align:center;padding:15px;box-sizing:border-box}.el-transfer-panel__filter .el-input__inner{height:var(--el-transfer-filter-height);width:100%;font-size:12px;display:inline-block;box-sizing:border-box;border-radius:calc(var(--el-transfer-filter-height)/ 2)}.el-transfer-panel__filter .el-icon-circle-close{cursor:pointer}.el-transfer-panel .el-transfer-panel__header{display:flex;align-items:center;height:var(--el-transfer-panel-header-height);background:var(--el-transfer-panel-header-bg-color);margin:0;padding-left:15px;border:1px solid var(--el-transfer-border-color);border-top-left-radius:var(--el-transfer-border-radius);border-top-right-radius:var(--el-transfer-border-radius);box-sizing:border-box;color:var(--el-color-black)}.el-transfer-panel .el-transfer-panel__header .el-checkbox{position:relative;display:flex;width:100%;align-items:center}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label{font-size:16px;color:var(--el-text-color-primary);font-weight:400}.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label span{position:absolute;right:15px;top:50%;transform:translate3d(0,-50%,0);color:var(--el-text-color-secondary);font-size:12px;font-weight:400}.el-transfer-panel .el-transfer-panel__footer{height:var(--el-transfer-panel-footer-height);background:var(--el-bg-color-overlay);margin:0;padding:0;border:1px solid var(--el-transfer-border-color);border-bottom-left-radius:var(--el-transfer-border-radius);border-bottom-right-radius:var(--el-transfer-border-radius)}.el-transfer-panel .el-transfer-panel__footer:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-transfer-panel .el-transfer-panel__footer .el-checkbox{padding-left:20px;color:var(--el-text-color-regular)}.el-transfer-panel .el-transfer-panel__empty{margin:0;height:var(--el-transfer-item-height);line-height:var(--el-transfer-item-height);padding:6px 15px 0;color:var(--el-text-color-secondary);text-align:center}.el-transfer-panel .el-checkbox__label{padding-left:8px}.el-transfer-panel .el-checkbox__inner{height:14px;width:14px;border-radius:3px}.el-transfer-panel .el-checkbox__inner:after{height:6px;width:3px;left:4px}.el-tree{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree{position:relative;cursor:default;background:var(--el-fill-color-blank);color:var(--el-tree-text-color);font-size:var(--el-font-size-base)}.el-tree__empty-block{position:relative;min-height:60px;text-align:center;width:100%;height:100%}.el-tree__empty-text{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:var(--el-text-color-secondary);font-size:var(--el-font-size-base)}.el-tree__drop-indicator{position:absolute;left:0;right:0;height:1px;background-color:var(--el-color-primary)}.el-tree-node{white-space:nowrap;outline:0}.el-tree-node:focus>.el-tree-node__content{background-color:var(--el-tree-node-hover-bg-color)}.el-tree-node.is-drop-inner>.el-tree-node__content .el-tree-node__label{background-color:var(--el-color-primary);color:#fff}.el-tree-node__content{display:flex;align-items:center;height:26px;cursor:pointer}.el-tree-node__content>.el-tree-node__expand-icon{padding:6px;box-sizing:content-box}.el-tree-node__content>label.el-checkbox{margin-right:8px}.el-tree-node__content:hover{background-color:var(--el-tree-node-hover-bg-color)}.el-tree.is-dragging .el-tree-node__content{cursor:move}.el-tree.is-dragging .el-tree-node__content *{pointer-events:none}.el-tree.is-dragging.is-drop-not-allow .el-tree-node__content{cursor:not-allowed}.el-tree-node__expand-icon{cursor:pointer;color:var(--el-tree-expand-icon-color);font-size:12px;transform:rotate(0);transition:transform var(--el-transition-duration) ease-in-out}.el-tree-node__expand-icon.expanded{transform:rotate(90deg)}.el-tree-node__expand-icon.is-leaf{color:transparent;cursor:default}.el-tree-node__expand-icon.is-hidden{visibility:hidden}.el-tree-node__loading-icon{margin-right:8px;font-size:var(--el-font-size-base);color:var(--el-tree-expand-icon-color)}.el-tree-node>.el-tree-node__children{overflow:hidden;background-color:transparent}.el-tree-node.is-expanded>.el-tree-node__children{display:block}.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{background-color:var(--el-color-primary-light-9)}.el-tree-select{--el-tree-node-hover-bg-color:var(--el-fill-color-light);--el-tree-text-color:var(--el-text-color-regular);--el-tree-expand-icon-color:var(--el-text-color-placeholder)}.el-tree-select__popper .el-tree-node__expand-icon{margin-left:8px}.el-tree-select__popper .el-tree-node.is-checked>.el-tree-node__content .el-select-dropdown__item.selected:after{content:none}.el-tree-select__popper .el-select-dropdown__item{flex:1;background:0 0!important;padding-left:0;height:20px;line-height:20px}.el-upload{--el-upload-dragger-padding-horizontal:40px;--el-upload-dragger-padding-vertical:10px}.el-upload{display:inline-flex;justify-content:center;align-items:center;cursor:pointer;outline:0}.el-upload__input{display:none}.el-upload__tip{font-size:12px;color:var(--el-text-color-regular);margin-top:7px}.el-upload iframe{position:absolute;z-index:-1;top:0;left:0;opacity:0}.el-upload--picture-card{--el-upload-picture-card-size:148px;background-color:var(--el-fill-color-lighter);border:1px dashed var(--el-border-color-darker);border-radius:6px;box-sizing:border-box;width:var(--el-upload-picture-card-size);height:var(--el-upload-picture-card-size);cursor:pointer;vertical-align:top;display:inline-flex;justify-content:center;align-items:center}.el-upload--picture-card i{font-size:28px;color:var(--el-text-color-secondary)}.el-upload--picture-card:hover{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload.is-drag{display:block}.el-upload:focus{border-color:var(--el-color-primary);color:var(--el-color-primary)}.el-upload:focus .el-upload-dragger{border-color:var(--el-color-primary)}.el-upload-dragger{padding:var(--el-upload-dragger-padding-horizontal) var(--el-upload-dragger-padding-vertical);background-color:var(--el-fill-color-blank);border:1px dashed var(--el-border-color);border-radius:6px;box-sizing:border-box;text-align:center;cursor:pointer;position:relative;overflow:hidden}.el-upload-dragger .el-icon--upload{font-size:67px;color:var(--el-text-color-placeholder);margin-bottom:16px;line-height:50px}.el-upload-dragger+.el-upload__tip{text-align:center}.el-upload-dragger~.el-upload__files{border-top:var(--el-border);margin-top:7px;padding-top:5px}.el-upload-dragger .el-upload__text{color:var(--el-text-color-regular);font-size:14px;text-align:center}.el-upload-dragger .el-upload__text em{color:var(--el-color-primary);font-style:normal}.el-upload-dragger:hover{border-color:var(--el-color-primary)}.el-upload-dragger.is-dragover{padding:calc(var(--el-upload-dragger-padding-horizontal) - 1px) calc(var(--el-upload-dragger-padding-vertical) - 1px);background-color:var(--el-color-primary-light-9);border:2px dashed var(--el-color-primary)}.el-upload-list{margin:10px 0 0;padding:0;list-style:none;position:relative}.el-upload-list__item{transition:all .5s cubic-bezier(.55,0,.1,1);font-size:14px;color:var(--el-text-color-regular);margin-bottom:5px;position:relative;box-sizing:border-box;border-radius:4px;width:100%}.el-upload-list__item .el-progress{position:absolute;top:20px;width:100%}.el-upload-list__item .el-progress__text{position:absolute;right:0;top:-13px}.el-upload-list__item .el-progress-bar{margin-right:0;padding-right:0}.el-upload-list__item .el-icon--upload-success{color:var(--el-color-success)}.el-upload-list__item .el-icon--close{display:none;position:absolute;right:5px;top:50%;cursor:pointer;opacity:.75;color:var(--el-text-color-regular);transition:opacity var(--el-transition-duration);transform:translateY(-50%)}.el-upload-list__item .el-icon--close:hover{opacity:1;color:var(--el-color-primary)}.el-upload-list__item .el-icon--close-tip{display:none;position:absolute;top:1px;right:5px;font-size:12px;cursor:pointer;opacity:1;color:var(--el-color-primary);font-style:normal}.el-upload-list__item:hover{background-color:var(--el-fill-color-light)}.el-upload-list__item:hover .el-icon--close{display:inline-flex}.el-upload-list__item:hover .el-progress__text{display:none}.el-upload-list__item .el-upload-list__item-info{display:inline-flex;justify-content:center;flex-direction:column;width:calc(100% - 30px);margin-left:4px}.el-upload-list__item.is-success .el-upload-list__item-status-label{display:inline-flex}.el-upload-list__item.is-success .el-upload-list__item-name:focus,.el-upload-list__item.is-success .el-upload-list__item-name:hover{color:var(--el-color-primary);cursor:pointer}.el-upload-list__item.is-success:focus:not(:hover) .el-icon--close-tip{display:inline-block}.el-upload-list__item.is-success:active,.el-upload-list__item.is-success:not(.focusing):focus{outline-width:0}.el-upload-list__item.is-success:active .el-icon--close-tip,.el-upload-list__item.is-success:not(.focusing):focus .el-icon--close-tip{display:none}.el-upload-list__item.is-success:focus .el-upload-list__item-status-label,.el-upload-list__item.is-success:hover .el-upload-list__item-status-label{display:none;opacity:0}.el-upload-list__item-name{color:var(--el-text-color-regular);display:inline-flex;text-align:center;align-items:center;padding:0 4px;transition:color var(--el-transition-duration);font-size:var(--el-font-size-base)}.el-upload-list__item-name .el-icon{margin-right:6px;color:var(--el-text-color-secondary)}.el-upload-list__item-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.el-upload-list__item-status-label{position:absolute;right:5px;top:0;line-height:inherit;display:none;height:100%;justify-content:center;align-items:center;transition:opacity var(--el-transition-duration)}.el-upload-list__item-delete{position:absolute;right:10px;top:0;font-size:12px;color:var(--el-text-color-regular);display:none}.el-upload-list__item-delete:hover{color:var(--el-color-primary)}.el-upload-list--picture-card{--el-upload-list-picture-card-size:148px;display:inline-flex;flex-wrap:wrap;margin:0}.el-upload-list--picture-card .el-upload-list__item{overflow:hidden;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;width:var(--el-upload-list-picture-card-size);height:var(--el-upload-list-picture-card-size);margin:0 8px 8px 0;padding:0;display:inline-flex}.el-upload-list--picture-card .el-upload-list__item .el-icon--check,.el-upload-list--picture-card .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture-card .el-upload-list__item .el-icon--close{display:none}.el-upload-list--picture-card .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:block}.el-upload-list--picture-card .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture-card .el-upload-list__item .el-upload-list__item-name{display:none}.el-upload-list--picture-card .el-upload-list__item-thumbnail{width:100%;height:100%;-o-object-fit:contain;object-fit:contain}.el-upload-list--picture-card .el-upload-list__item-status-label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture-card .el-upload-list__item-status-label i{font-size:12px;margin-top:11px;transform:rotate(-45deg)}.el-upload-list--picture-card .el-upload-list__item-actions{position:absolute;width:100%;height:100%;left:0;top:0;cursor:default;display:inline-flex;justify-content:center;align-items:center;color:#fff;opacity:0;font-size:20px;background-color:var(--el-overlay-color-lighter);transition:opacity var(--el-transition-duration)}.el-upload-list--picture-card .el-upload-list__item-actions span{display:none;cursor:pointer}.el-upload-list--picture-card .el-upload-list__item-actions span+span{margin-left:1rem}.el-upload-list--picture-card .el-upload-list__item-actions .el-upload-list__item-delete{position:static;font-size:inherit;color:inherit}.el-upload-list--picture-card .el-upload-list__item-actions:hover{opacity:1}.el-upload-list--picture-card .el-upload-list__item-actions:hover span{display:inline-flex}.el-upload-list--picture-card .el-progress{top:50%;left:50%;transform:translate(-50%,-50%);bottom:auto;width:126px}.el-upload-list--picture-card .el-progress .el-progress__text{top:50%}.el-upload-list--picture .el-upload-list__item{overflow:hidden;z-index:0;background-color:var(--el-fill-color-blank);border:1px solid var(--el-border-color);border-radius:6px;box-sizing:border-box;margin-top:10px;padding:10px;display:flex;align-items:center}.el-upload-list--picture .el-upload-list__item .el-icon--check,.el-upload-list--picture .el-upload-list__item .el-icon--circle-check{color:#fff}.el-upload-list--picture .el-upload-list__item:hover .el-upload-list__item-status-label{opacity:0;display:inline-flex}.el-upload-list--picture .el-upload-list__item:hover .el-progress__text{display:block}.el-upload-list--picture .el-upload-list__item.is-success .el-upload-list__item-name i{display:none}.el-upload-list--picture .el-upload-list__item .el-icon--close{top:5px;transform:translateY(0)}.el-upload-list--picture .el-upload-list__item-thumbnail{display:inline-flex;justify-content:center;align-items:center;width:70px;height:70px;-o-object-fit:contain;object-fit:contain;position:relative;z-index:1;background-color:var(--el-color-white)}.el-upload-list--picture .el-upload-list__item-status-label{position:absolute;right:-17px;top:-7px;width:46px;height:26px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-list--picture .el-upload-list__item-status-label i{font-size:12px;margin-top:12px;transform:rotate(-45deg)}.el-upload-list--picture .el-progress{position:relative;top:-7px}.el-upload-cover{position:absolute;left:0;top:0;width:100%;height:100%;overflow:hidden;z-index:10;cursor:default}.el-upload-cover:after{display:inline-block;content:"";height:100%;vertical-align:middle}.el-upload-cover img{display:block;width:100%;height:100%}.el-upload-cover__label{right:-15px;top:-6px;width:40px;height:24px;background:var(--el-color-success);text-align:center;transform:rotate(45deg)}.el-upload-cover__label i{font-size:12px;margin-top:11px;transform:rotate(-45deg);color:#fff}.el-upload-cover__progress{display:inline-block;vertical-align:middle;position:static;width:243px}.el-upload-cover__progress+.el-upload__inner{opacity:0}.el-upload-cover__content{position:absolute;top:0;left:0;width:100%;height:100%}.el-upload-cover__interact{position:absolute;bottom:0;left:0;width:100%;height:100%;background-color:var(--el-overlay-color-light);text-align:center}.el-upload-cover__interact .btn{display:inline-block;color:#fff;font-size:14px;cursor:pointer;vertical-align:middle;transition:var(--el-transition-md-fade);margin-top:60px}.el-upload-cover__interact .btn i{margin-top:0}.el-upload-cover__interact .btn span{opacity:0;transition:opacity .15s linear}.el-upload-cover__interact .btn:not(:first-child){margin-left:35px}.el-upload-cover__interact .btn:hover{transform:translateY(-13px)}.el-upload-cover__interact .btn:hover span{opacity:1}.el-upload-cover__interact .btn i{color:#fff;display:block;font-size:24px;line-height:inherit;margin:0 auto 5px}.el-upload-cover__title{position:absolute;bottom:0;left:0;background-color:#fff;height:36px;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400;text-align:left;padding:0 10px;margin:0;line-height:36px;font-size:14px;color:var(--el-text-color-primary)}.el-upload-cover+.el-upload__inner{opacity:0;position:relative;z-index:1}.el-vl__wrapper{position:relative}.el-vl__wrapper:hover .el-virtual-scrollbar,.el-vl__wrapper.always-on .el-virtual-scrollbar{opacity:1}.el-vl__window{scrollbar-width:none}.el-vl__window::-webkit-scrollbar{display:none}.el-virtual-scrollbar{opacity:0;transition:opacity .34s ease-out}.el-virtual-scrollbar.always-on{opacity:1}.el-vg__wrapper{position:relative}.el-popper{--el-popper-border-radius:var(--el-popover-border-radius, 4px)}.el-popper{position:absolute;border-radius:var(--el-popper-border-radius);padding:5px 11px;z-index:2000;font-size:12px;line-height:20px;min-width:10px;word-wrap:break-word;visibility:visible}.el-popper.is-dark{color:var(--el-bg-color);background:var(--el-text-color-primary);border:1px solid var(--el-text-color-primary)}.el-popper.is-dark .el-popper__arrow:before{border:1px solid var(--el-text-color-primary);background:var(--el-text-color-primary);right:0}.el-popper.is-light{background:var(--el-bg-color-overlay);border:1px solid var(--el-border-color-light)}.el-popper.is-light .el-popper__arrow:before{border:1px solid var(--el-border-color-light);background:var(--el-bg-color-overlay);right:0}.el-popper.is-pure{padding:0}.el-popper__arrow{position:absolute;width:10px;height:10px;z-index:-1}.el-popper__arrow:before{position:absolute;width:10px;height:10px;z-index:-1;content:" ";transform:rotate(45deg);background:var(--el-text-color-primary);box-sizing:border-box}.el-popper[data-popper-placement^=top]>.el-popper__arrow{bottom:-5px}.el-popper[data-popper-placement^=top]>.el-popper__arrow:before{border-bottom-right-radius:2px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow{top:-5px}.el-popper[data-popper-placement^=bottom]>.el-popper__arrow:before{border-top-left-radius:2px}.el-popper[data-popper-placement^=left]>.el-popper__arrow{right:-5px}.el-popper[data-popper-placement^=left]>.el-popper__arrow:before{border-top-right-radius:2px}.el-popper[data-popper-placement^=right]>.el-popper__arrow{left:-5px}.el-popper[data-popper-placement^=right]>.el-popper__arrow:before{border-bottom-left-radius:2px}.el-popper[data-popper-placement^=top] .el-popper__arrow:before{border-top-color:transparent!important;border-left-color:transparent!important}.el-popper[data-popper-placement^=bottom] .el-popper__arrow:before{border-bottom-color:transparent!important;border-right-color:transparent!important}.el-popper[data-popper-placement^=left] .el-popper__arrow:before{border-left-color:transparent!important;border-bottom-color:transparent!important}.el-popper[data-popper-placement^=right] .el-popper__arrow:before{border-right-color:transparent!important;border-top-color:transparent!important}.el-select-dropdown__item{font-size:var(--el-font-size-base);padding:0 32px 0 20px;position:relative;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--el-text-color-regular);height:34px;line-height:34px;box-sizing:border-box;cursor:pointer}.el-select-dropdown__item.is-disabled{color:var(--el-text-color-placeholder);cursor:not-allowed}.el-select-dropdown__item.hover,.el-select-dropdown__item:hover{background-color:var(--el-fill-color-light)}.el-select-dropdown__item.selected{color:var(--el-color-primary);font-weight:700}.el-statistic{--el-statistic-title-font-weight:400;--el-statistic-title-font-size:var(--el-font-size-extra-small);--el-statistic-title-color:var(--el-text-color-regular);--el-statistic-content-font-weight:400;--el-statistic-content-font-size:var(--el-font-size-extra-large);--el-statistic-content-color:var(--el-text-color-primary)}.el-statistic__head{font-weight:var(--el-statistic-title-font-weight);font-size:var(--el-statistic-title-font-size);color:var(--el-statistic-title-color);line-height:20px;margin-bottom:4px}.el-statistic__content{font-weight:var(--el-statistic-content-font-weight);font-size:var(--el-statistic-content-font-size);color:var(--el-statistic-content-color)}.el-statistic__value{display:inline-block}.el-statistic__prefix{margin-right:4px;display:inline-block}.el-statistic__suffix{margin-left:4px;display:inline-block}.el-button{height:32rem!important;padding:8rem 15rem!important;font-size:14rem!important}.el-input__wrapper{padding:1rem 11rem!important}.el-input{height:32rem!important;font-size:14rem!important}.el-input-number{line-height:30rem!important;width:150rem}.el-input-number__decrease,.el-input-number__increase{top:1rem!important;bottom:1rem!important;width:32rem!important;font-size:13rem!important;background-color:#409eff}.jt-drawing-row .col-left{font-size:14rem!important}.el-color-picker__trigger{height:32rem!important;padding:4rem!important}.el-radio-button__inner{padding:8rem 15rem!important;font-size:14rem}.el-textarea__inner{padding:5rem 11rem!important;font-size:14rem}.el-input__inner{height:32rem!important;font-size:14rem!important}.el-scrollbar{color:#fff!important;background-color:#052d73!important;overflow:visible!important}.jt-drawing-row{display:flex;flex-direction:row;height:40rem;align-items:center}.jt-drawing-row .col-left{display:flex;align-items:center;justify-content:right;width:60rem;font-family:Alimama_ShuHeiTi_Bold;font-weight:700;margin-right:8rem}.jt-drawing-row .col-main{flex:1;display:flex;flex-direction:row}.jt-drawing-row .col-main .el-input--suffix{background-color:#fff0}.jt-drawing-row .col-main .el-input--suffix *{background-color:#fff0;color:#fff}.jt-drawing-row .col-main .el-input-number__decrease,.jt-drawing-row .col-main .el-input-number__increase{background-color:#409eff;color:#fff}.jt-drawing-dialog{pointer-events:none}.jt-drawing-dialog .el-dialog{pointer-events:auto;position:absolute!important;background:rgba(5,45,155,.7);min-width:280rem;overflow:hidden;left:10rem;background:rgba(0,44,126,.68);height:calc(100% - 175rem);width:180rem;top:125rem;margin-top:0rem}.jt-drawing-dialog .el-dialog .el-dialog__header{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyCAIAAAD9fhrKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA3ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo4NTc1YTY2Yi1hY2U5LTUyNDctODM5MS01MGJjMjM4MDkxMDkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RDY4MTUxMzk2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RDY4MTUxMzg2RDM1MTFFRDkzM0JDNEQ5N0IwQTIxRjYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6YjZlNTUzODYtMzRjZC02NDQyLWI4OTktODY4YTdiYTNkMzgyIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjg1NzVhNjZiLWFjZTktNTI0Ny04MzkxLTUwYmMyMzgwOTEwOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Po+VQtwAACdUSURBVHja7H1bluM4kiUMfEjuHpFZtY4+/TGLmQ3MmTMbnf1MdUX6QyIJ2MAAAjC8+JB7ZHZXh7LKQ6IoECSBy2sXFwb4/X/+X2FfEqDv5dh35mXeC+k2CzD/+XfxL72BeVbv04KI7uP6ByD7pZTy6ToMnUTwv3f7rgWG/cNXrhz7AcVtUfOiwP/kOg6mLGRVoq1JUewjsAoLWJQ2RdlTg7CD+y+eJW3MziVU1dfK/wV2LIhXJpQJ/nQhOUFWWxDJRYjnwnfItkB2Z8w/yC7sr9fnXpj8Y/9d27hw/2D4zm/0/4V92EcRtq+bMP9J+AX98UdadxN8oy/D/tXdBeWAvsBQM7/FvwklxzemJ0xyfrflu6JG1T+Hc1mrhKEA/wfTQ9BfAD119x9Ca2R1ZjuEqwdq/Kb7C9vO3oQzZJ9AKdAzqDuoGVC5r3r3j8Gp62XoJaT9g3WBDK3crwwIdfB+mxUmyJP0HXNGAj/uM1zNQWTs8MChMOvJEQYMuDxdepBAQGM7810t2MHIioItnEqwbOx66GBadMSXHHQiCgBHFmDV8h+rJcQPEUaLk+WIFi5YDnyQXPoUs0R+oyTfEWvdkKFaskPYju0t1RLCDrxM/luoHejIm+0qbZ9g6+P2/snOBWDRQVPAggLOgMEBFRh7PoY+DPaJvUIYIvjeb3eG9b39tH6zFoL0Q9eHzVt6A1qOKMdYE7cD+lsBDCtdya7B2QINBEj1YZqMxSAwIKL7J3DVdI0WHbWgY4HdyIp2Z7d+lvreTa+hfHep/M/ZhZS9Gr7pbthqXsmtsdXpepS9MHXTi5xf5XIzX3XXf/tfBkmer2MHkPKdGr0SOckyXGzoO60IYIGBUcEdYFZKSuikFMBLT7pxQprYwXrifAZwtfto3pi9bVEcXVKSVcKtPYT5lSnMlOAaQMKKUobEv2UXF9a7kx4vbkRWnGsxAKxnAIRnrPAtg9FFYM8l93Pg/YA9A31zZCeJfOOBv3znykOv2KG6W/YVpu+xtlHUjlvWXGzu3Dqd6rflx/ZRkH+0vEFofssYCXAbtSNB7O6gxylGfNhRGFFJOdT6jbbFR4jEcHa4EqKrlkOsD2LKs2J9AlGKdVtucv4I9TdQpftrrH88BUSO3QVHI7RaboRWiJW7zy+zoW/jd4Ie0b472y+Q2F+AwHXuXv79f39/GiHr3pCgXQpSxaMeYOx7cxYGBHIKkHIKQhxJ6MOimxQI25jVdWBCy0Up941DSE4JAfKQtUURDcqawrT21YUUnVHkUVoJfByheE0DCGLysIiwkiEX6zwZctkHb3JHofU0ivee7aJx/QoxOTT6b2OVMCmE/0RU0SctOfsqnOz6rS9KszI5Umh2dJHWNjsFXSsw+7nIcCEtKuys2VfILxcWwIf8TdGrI3wxQpQHU/zi5JEjD8HWclhMxX4ecMHgi4ZesOgyBGsZWokCrWD5kPM9otXwbOLK9OphesYiOWvWFA3qddNbivHFc81iq7r8ZrrvJ2Jz/zjuRqnuvQm46rtmsFO0Yaql4w7U4fH5YuJD+JiWsB3Dj9HRYdp0J81LGE7nySMmPZfxflbAemw6wGW42RLMj+bZHEtcL1145NmiPEMWGKmNAwOMkYchZyaenRYiWmgpLx0xcGfXrjwXdMw5xSG/3ZJ/5LKXa0D++I4+R9gKVwwtuVrpNzj6HS7syt/Fuj+E5ghJAAblHeFxG2rhzyWNfgRrZ2HPNDDCVjQm2P4ltPk9kZUfRRmssXRMgzGIhftL7zdCpBuClYxYi02LC7KWwK+JSH4Yj5tEhZiyjLwfBaiq4lSKGonKgzUBK5xdQr5C9wfT/5HCfx5vJhcRkQtYKVrN77BMnjtJPT5pGHK4LCCKHSBidDe/rzQt2S+7CEINL4bBsX7XiNURcTdot5/18NIPXVfiFK8GNB/tGZYhiWBSvt/n8gnN7+9kEccCJSSH4Ai4fsG+stU3BzDI+OEPMS/K7GXgz0foAf6wgVkiYIkJMk2F7/NimBayADDClrZIJDCHLUQBGTdCcKAsPXcKWqODsqABuJPFJApGpx+sskHE20jmINK6KFuAbxvgmR2cCoTE3le5KAoeODNymG7ZKP/IcbdjNrEZTmzVfzMaySEojcE3QeokTnEoYVCFCSxGAT4e3uCU7i/oxMokDCzQKq8MFeTRyv1OquEZoU/pURFgisp1oFhnfiWaxgYCkkEGH8SZMJDi1kBadlvEEcol+x6q4tQ2TwMGw8ClHzF2snu6vN0nFx4mwOUAyILQNNPY4tN1WKUeKDAr/Cj/Cg3QPBnMmhxm4bKoD1PUSML8SmcCZmCmC+dUCwizumlWobYFbEWUs3o8psoXijTeElqsCBeCVE+4wFcEIQsVg9IZNC3hyZhgI7AY1LUVv9KWFJhM/SZioY23iHN1O6bsJGd2lS1VZra/AzY0/HatTsQXG6Vl75MOhoySNjhIHlCzvq6xxMEmVCXH4sSms9wKMmLFeA0bHMxEK9Nl5jehZrEerTM8BUHmaIU5WvHzCvWW06u0NC2pJSZohXJQw3eUXfOZggX1wYMwhn1xU2EfqjZfHYhv1/F9MhGbZjw9xIkrAM0GJG6zoUs5ZhUHRR+PhWCKMGscDDlaNPUUgzcf9+V6IUVLJFSLUSp+ahC3m/9f+v6+UHDoQ9EYCAewWu81rILXyrY4cYMkdHfEyjNNYONMPOLDVd3L1MqVeWGmSqVgiyJ1j2AYptSYtACA2Haz94jN1gOprhSLFbEThhIAErkEIO7TIkOhwPA3+6EQ9cNhUUnEdAvW+0A4SnYdmCiZGhdwHfZCkTMpjlDZD9t8KtlFp+4ATNSuyJjcc1T2KC/rOGQmtIs04uc7uC+0MtxK6GVFFei14VY0QFiEfZipdpiVCajl/RXU1Azi7DaS2HoCRNzlVOmFzTt949XvwlMlKqzoWYnqZIDjZRxvcrkZJiWYkuUwa90NDUi836fn67h2X4dZWHKi+JMANJIMWf1tMphlbj4obTFr7GjokGNSEo95LMIUtgAvfTct2haFERQgYAF6FuMxCDzaoR+rDvQOfIQc+6Af0XaCFPjWYDvV+pEPVmCizfvxv3DqfqgA07sb9sRjARdgfVS/UoLHR31svBBwn/aHa8WPlf8Q07rh1pM6KZBHytXSMB1cx1z+YnQoFYOygQjMhB6RGaZ4ed6jkIRgmuNUihYrWg0erdoxYM7+AlotFAnqZQUxOej+2QNfDa0QK5aOiFZ/gKVp6eGTM9Xjt5UJihpdrYfsFbjKHxWHAAtqStYeyUKv0Zj+dB36DoCcpVHAQd+DV2xaFnz7mEyIZ5AmpeWV2DCQHS8rCcOzDGaZkI7uDmEW6Vl2FBIjI8mU+IxFetgiRZ94n2LUA1Cu5peAm8IjUgA17nnx7qqIXLGXeG0fU9sHYm5eozMNJg9kmldiOsn516qC4TGjS/JgwEQWxYY0iqWqDbVYK2tnpddKJPeCl4O1nbG0TImKmSyOdWJxUuXZ8aFMVp9Ej6/7G3MWUIv4ivFELH7H+UsyIBf0b3qZzt8NmPC1TaiKLlZBZkuDVqjWAcFuxP4pRSseyWJlWNAfjmxQ0ysQTcvFdX6t1OW3fMyxQZ8OhO/YstLtM6xtLEuCAshgEkcDWXbo0KBJMnDDBHIb0M3Xceh7mQwacg0+CEAx1lsDNYN1Xn2nb2/3ZRz70WEWRHaUR4jZaVgY6SU5/KdZRRjSvDH7wUR/wyCQJe/bWI9WQ66oka8RIUMAiD67YDFksV6ira3UD6E+BhLHBDBvIomCE4Ij1vigaFbY3hh/y0+zRLBsH5Ect8nUjo0MZKcTY3NMj4gN8QsTXplrzFgPUhKvQC42p0JVWVobpxjbWiFNWrOVzmkIYhEAZo4EZw1dPhC1R6sLmv8hVAc9c90qPTUTA8r5DbQSVZP/GjF1epXYGSVtaZen4WsHsA4oVbgl0kc6Zv8MUkrrRZiUghSzwqGUJiv8FXuac4NxxKuCWVl4aPe72LlE93mxCIP3aca+uww976xHYMsAUkeeMhMeLkyLYtw1nUyUMAQdmVGIFpPBO0g4R2YchsTXtQ5HYsmngY0JZJxLeDK4WiYgC+fdxvVvwTggMW/7UNmF6aLYjuxYfh+Moj/E5p55rzBy8Ky1MLkwfw85ugh+UrGqaRzBL0V5IhBHNzBUOF6ZFmxhJU5JFHRRM3ChyKV0kUlOLFa0rZogBvpV6joCVWzqDCw3WO4GrcRqtnrScvScvDaMkGIU307AZ2mawIo1awW6/qJ6O+aYjH4WV6+lTNQC9w0w6wvqdHjcBWqerHwECq0MDzS9ZobJYgp3ZoEnSuZBcrPB42iBJlItZM5xfmUhkhZYA7r+Ns3OFzUtNPPIY9YGbHE6sApMvZ1UeafpRrhq2SH049okePiARMLw4lIAL2+CwGAYxSihQxwKTQbbgJ011EZTEmoAcVQxzo7wY4eiFo1gHtIhYh7YAVblTxRYcehAnYwgYJPwM+kzfx/tEsmbvLbpr4oZfuifDeysoer+wvwnDfE3g5u8f2Y6OvPclsyljPKCkkWRoOhyt0DFXZXSGdcXlg+DVqFwsi/IIYw9J7/dGBB0bUfdOppvqEVuTGWiVfesB6ptKwKsq1e1GL3p0jrAsKLWzW9wLmPhASeE35nG9WiqItzmmd/LBLNMQDfRCRPQ+EaZ+rASfYYNLNJbwiwraaEdXnHOCRNpMmBKzYIJT0oIlzWoyvuiHacOdxWCuB4mzMTJW4nOFWLGCF7pYBRzKXD+hWGnAsICPEM6oue9W7w34THCvTHf5SxZx5PbDz5Rsb3bkXrioYd2qz6lnbIYjShoVKmgi9b0acyIp30nSbSGrjL8V8BNIue75mDYkJoCoBDxkSNW5nLvo5UkT/yHcEpO6hwL2K/6b6K/rA6JClDhgYaHVVfABnj1BzlU3XNQkqzcDRBVGYrdCFTgY55pvJYZHSJh0po8oQ5ooPSOlkJLgAp6axDxeumtFZ5uyETWCXwaRyjHgJyzPM4ByglXJ+DSy7stAeIMU4xhIvg5oOEmQp6IghEBhBBCCREjx/wWOgTiJ4pMiq8RaEgTNZz1JW37m6pTnOEMhMGmEWx746PGmkdk2WzAZ2e0HUuUryBUVfAqQS3wF9nbSLDjc4MqlIr7DxjsyOkN1OIIEUppw7Qh82okgSd/yKVfyflNqpufv5Wq7KsPVSJNZh7Z3Kl8TAL3BpMfe/WfuvEbnsAc19ZJ3yOZ4ccPa9bkGBSAyZIjUtBX/3qCSpXRw2yH3lK526Jc+cus3jWNQoJzfmKpH6/IVRAuh1n95CxagkndGI0O6wgiJBHOqnuDV6OK0EzkdlAGupzeBh7lpHRZPLggxqxRAn+AFlV9KgcF8W0sOGhiP96yP9no8djVEJsUoKQPmDHcAqRSllZKQuQ5IPtCJ1JOk5ujcs+XC9A0KU1q9o/VTnWJqFSyqhaxstbQN7ncc6s741ZU1eEbTWbG2nAg7t2kDXp1GrCSYReoh4TbjyYW9jByxNUW4kHP43BfFhqP416H4KhEpOk7Gp+crbROtZpsy7C4a9/d7Pij2dcAzjtSUVIyACiTiTCsCFFXZxX9SSwmvgRgNIrxRwZegXn5CxbAy2teXCjn/IsBNwsMRRxQDUOWaazPGJmom+MqTKe1s6i5FHaHXDAxdjSfZAefbdtjO9sqRHV/qPgudmgjxqmKUNGxMm6CdUcRZrQMc5BiGKENBHQOrbASVWFuSk06vFYWrRYvufc2Euwy2wH3WGEWikZzAxVl0UpkM28i3HVXbcvPoRMrcWc9Kj/+9Dnnwzry5IQ2Zomq+LXyF8KUwZAheZ/mKOMB8PDQORWeiJJBMhWw9D2kwz8UgUthMOtu0MoG4d450TtbaUKpMoWLcS53LHPwsTO332b+g6hkIRTBMpefgcdqq8GCtTsoc/ghcNMApn6FypjgCvIC6mmudjnLKennBCU5ecQjT1k8+ZOW4HWcNmI+Oo9lbFUFstT/WTHxYq4cYTcSt0KZKWIlXytN8zZRFFlDPfe5rBK4LghdVgBmDIuK6pwEJnJraMA7pMnMV+2n9TTQCnG/gT3Ok0+EhFsToUVNzCoHiZidU4LBLJK0bjQrMEkesMIWwEqOKAuqDIbPQoxnT1X2OLVW+O4+WS+ozWxDVvih7zvws5UxyWNTm0kQQjea9oNioudYbpVKfVJ8XF9wR3Uy5TKQMiZrMU9DRClg4335nYYGSgFUmkU546r8Nkxtyaa5ZGUC7Nz96v6t7aIyKbV+lPIn6cDpVgnVw7X2wdzqpetDXylyYdkVOWyl7CiOsl3IyM5mHdVxKnMMrKN4s1wMWik/zc9wn6sFvtKBgQW3S6bjmKI6MlstCUtMJHZJLvZ+jLkLt9Fq+/nBc5N8FrCwkavveGBYbC80+FWutvP4ZCfHt/uEGvPgyB5LUeIr7CqD+QXbKgY3zR+DiQagboasadPs1IfWhmcNfZdoWJlchKkRwu9mqJ6JESfL+9bWHow/btoKBPk+72+BOsYLBd51EHP9CZ6lETMuloBYDIErwyDVprDdPrI5vVgkOWq9P/IIPVjO9semovRogYjtjRW2VSFVWCN+WAwL5mN03BNwNWhFG3RuW03izAwf3SieJoeUWHO6CdU/CWlzOeRDmY0AUGS2We2Cyhx2HHEzR7v8roNoVUrseKxl7KpX+ABgcR4koFQNEsxqznfnuVFCT8x+yNKzZVZk5hd9smb5vDLMLs/dAbnt3v4ldjarkAQFsOEVcbmrWrTL/mS0ye7vk4rPniwNRGqPggihMXrlwI18HDAHKEhd2lAMswtRptvHhgiFNcnpSBIF3EztUOYthk0hbEM/2tCnWukcoK277Ra7e5VEKyVKYbMSMQNaBZ5SM0FoDXp4sjmOM3cw1jTskrqhz4bqDi0RHPepCVVZYIiVM6P8CuPzmuU9y7EVjG8t/MdCad/RCo6hFZ4OCc8PIO8NG5eYdZvUnXIuhPAoWpjJDHXpx76LFwViGJVJrPlIov/e8CE7P9qlVKYg0TCudlDJ8CZNehXwC8Is1liLkGwP02uHmIOsiIlmipCk9HGJIidpYV/AChAkOUiTjIgs711mCYN0lLNIQ1oLlwW3rSTWxNp2URwUoTEqB7VsL1D0lXTkBCE95W37FbsgmOUmbJAsgaK0QebyFFZOByu2hyhKlOGeaKf6ZMRHw4D9C9lEcTE8S06vujcIOKSzeEoZqyqHU0NE+YSDpDmD2WIZ1K5VN/3Q3RNl46tEvXhC2dyXT/FhDasJPznuiE2exakWwywT6H3cab5OktvXN8K+k7Q6Tj4jmvdkyJNGBsnMZz2YFj3Ns7K4YOK5y2BFdxS5vsZM862Hc8gX6JKUQvZcTrCWJXthaQCAz5CJxApZsIciW0YIc7isdKZKVFjLebCT/a6aL6GWGXd3GgXUdJzyPWw0zloNoWa5Fzmgi329t9WxzgUplVwCmOdbqIANf5Dod+gvdtLMBkhhbXzAcy8YoAfKdaUXsUw03a9/CtOPMZsSVD/v5DsNF4NZ3fSHsGJWUn2tpDIHUoRZ0InD8nqJ4J/0pRxjWHjU0d4IHDDDLEN8XJaFJE+m7+WDW8JnYzA7S7fHx/j80/U2zwawHFEywHexqSO22l8ZWjKVyZRzV2omHwYKkSZ9BagkFUe+gg3E7HcpdeISdAWReQIErmQlEnLE3Gya3iMv/MS3x/cR5+1U+BPK3H7I46Z81p6+k/OxQujxd3ghkVsqaxaVB0Eqe2Bo0RHPwndKqqdMgW+yWwwVQoBK1dpQxeynvRq/Ww/qvWCUKOcPA4uqt8FsKwzcGhHG/cv+IGDt+WgSHf3Qz6O6ZEiKiQSVc/1DYByr/D0OPVkZoKmF1YplUAVonjS3ZVkIXOzSXkN3GX1i1Wpa8SQzShYJWkVT4X1Wi8s8k156nhVUlOv1IE+7VxqF0gm5KVEFwGRr1jSgblKqDMtycnTKCYXHrOdiM4dnS9jaaGDbrvcjVqwjRxENh1ruvMIkC01xZXErCMIKVPGWa5q+fpdEW+J0nJyLYK3HJ8I5YRaSt/2D0vVpO25oMCtbpWYTp/hhNPQ4fpMTgLpVfrvcpV7IimXqvE2jTyVmOOxceSQkPB0bhmtheMq83OcF+SoyEH95HbqrAxcshr22YCsSk2XBm4nc1LryoCnQzabO5ihB3gqbwa8piuA1DCqloniZHymP5yCBLpHYqlBUkoqKQn7HjTpCNjdxe07fWSfU2TmJu213e4mn4673I/U5mPm9PtbHODSyYBObqCU2+EbT1uCm/N0Is9zKXfVflzJ/VhqgzczXLR/W9X4HpZUT9RvCXAlVKcBKZTBr7uJiq5we6MWEjdrAljkEdIemamJtXtmW2vDJkPAx3T0Fl0Vpw1MmZ78sVFiyTQ09raZTldghs97Uqzk5CV+vdIfQqu8SjZytiZPKQ9kzdd3bxICGrPFlXIJ7NZtIA4xUlY2YLQ+RZrKCjWud5bfL3sY1Lb4+KPr1arCPkvI0o5qG36IeFS0zmIDOhFrdRbQTrOLm0hhIijjYbDAa1NQh6U0GB7cEsupEGj+mQY55w9+Wd9TlUdFimbKu92FniAPxAUf7YwyrETqJzdiwHCo2UKJMGOgn5XGvlX3XSfl06Ya+q1A2n4evrulCSMsviLstyolWPZBoZTX7QqHHVB1PleCgYZmazospcEGsqeDFslIY85pm05DrRIyFnGno1zDBQf4M2EjP8cCz5fO9G35m+X8BWNXPBkUtrKqB3J7PO0cKraV+050yoda6jncp7Vdni7LPWl7FADC909ChWqR+FR3BFgpZ54QNW1l4q4dn4hKL85TmR5XLjXyS4zMdt41Wpy82PgBYZ6bLb9vfHZTcbLKXPGSyb/uOsmX1UlbCTN4OIGUUTJNSdIh5nZloE4f6RMkF2c2MEal2HhoIha6TmgMZLBJyYmEyh4L05USswqegGjnklzcTs1p3B44/sHiEA5sL11eZelWmqu5/ZK345orxj76gfeiNyYQHw0aWB34/LK3pXFk3jhEomKck6HehFeUyZpLWIe+431XDKAbZza+gZ1vgm9XI7OzCwzjFi9X9BcDZHWZRRA9mY3f/Q/SuzrIJzQcHOg60gv44MLW+qpMsu4lWxpkWytvX8JTaAUGPVjG/diW3ZKbVBPVn1vo+LbNPwWxiwKdxoOmH22pXJtUzVFpIYrcqmEi9YZgDZco+sSRighsgdtOmQyaOQ1yTFFpaSQZtojqvqJiXgmxjdVXBZHSKz9sJBB8gtka2Q2Uwvz2T50S2qnLWULtwTGtbXTMxmdBbu0QHKMF2KpVKYFjrnLEeIafVTSpF4Vg3tPVEbFaHWkuvhu9SvIKdxgzzh8EsNbxg1MiwyYGwgriUV/7yrfNDh8U56lXS6l+i0i+OORjw6ODgkZDwXARQMqN50WsamYokj26yyxNN0gOBVb26mNaTA6JBFn2b5yBaDUP/vGr2KAAqFxfaiqmFuHnSVgXLGBmnL1AfWhJ1CzqKRk2iEgk5LysXXqjhWnEfYGM2S2aPxWxNp222EYxumoVFNYnmgUlBTQ5X3DinJCazTnGr8Gq1N/bE0hNbUiRo3sdC1cYd6G3zOJrZp/6gUIskLWhL+yV8+V1BquGbFNKuz2xiECdpvawZrNp8qv7coL49WLuDlMtH9daa7WCo3PBijWAHiBUbADuFWUcWoajj04aehda78GHgJNONg2nIoNXQPV+GZtNOO3nJuQykGGL1MS1hcayL9UM0L3uJGmn9tc3DdbNJnKHiVQ2F5E0tXdXmKJAxRoQbD+forirjTcECT8RzefV2Ap9jfOin6UWHdI1Thi98qFolHOoDkCRaeYLZt43RRr4GDS2r1S+pAlU3SDTwizALSYanoUOhlFR/iOHJurTkgcGFgsFBZzCLlkxf3vMUo+tk7KnTCw7fRHfRZXh4JBh8XMP6xEtR1lCS2JM6MBphut86ILg1fQxbQGPAS9tI826Xt6GpmTZpHy2fkyQ2SDt5uawmbx2UnXmenQoGdcjn+dmrpyYKrYy5w6pcCXfVQww+1a2ui4fUzUPyT4KPWJH095+HrX2SpSK+6JWtT5EVDnztyXz1sc9VBvER2N0FiLRYks8NBHQ81MJ2eZVy7EKE0i57o0mUn96sDP9sC9yoRusj0JLOVOA7CFXjerq7/9DDM5Dj4euxZQ+wiuG8xrfxtVjX0ryoFiOTkhZtNvRquxwhapqXAxdafpXSgLrfdlIaptb3sBHrVfwB7GLPBH8+dG3oDlUU8ws0ayhWOcuJD1ak5nwAYaOVAx7puzvi44EYP1mlAo49Dzf2Sd2bmKX4hXOaQ6N1NNa/SD+2ltIol7eoD0VUq3cojT3iQcirajqmdvNdmqZpuJKVtHD7oVWNU8nZAHJ6FZp6JSzW9jW+RNvXSdg1oSUtezC/0lhkRfgSNkWXUiNTzeoaIB5F+UcZViM29AIQpa8yYaBuNva+k08XP0Nwo6OCaA032MWi55CfyBT4fLVzbtLHbHuIh0MYwYC13S+6EbXBtk4BqbyYS0pBs2jEKNC8SblJO2eLmyu+PUZfHo65Ho7IPj8N6EvqeTz7YO74PXB8bPbJ0k5fy6jlJS39TxPf6f4iBGzDU7XZazni+BuN9Nn8fLTU4E0Jg1mmQISj15P7J8iaL+X0B+i53oDVvbstNoXWRZTDcY+ilXl1f/8f/+fQo7uJJS60x2kitEJs7mxw6sUm/dwOglrfart41/stHsKU9Xwdu2q0DBUqlNeZbPcktCFurrN4dBvDISzoVmNqFWD726zc/6KWpn/JF+7lLMd16cA85MS2nrWj5KAd8gM78bg+utLy2fuZ0pI4GhkdLM8y4aG6U5sysSHA+cCWfPVCjiZidQXW+og5xI26nuxESFL6uQcPoDobZ1biN7cManQtFVWg8bu+f74OsL1OQftbskcEp5WdczN23ZMpsFS7anythHMT0X9MNDs616NKqo9Qj4ZbQNZSlPJhr4biDq1blYW3B7D+1+vLEOpAXFwfIdWPcMSGhEQ5ZPSC/bOQ/S5C1YLNTo2/CfFKsw4tdJKkZYf2cr3piOuV3O4dXn43PIsvWpH92ESOAhfdf3My3Ofly/7Q5awjEdgw0MRok9bYCusMulyG7skPCDYDt3ZU6MJA5Z1WNk9p/3Tpd5577eeGKertvkTRih0RK1DUQKeaAoV7UAK7T+m6hgWNFAK/wOunw9ODPOtIqZtTqutaLrm0KNQK8hCeOwtSzUnSIncCtX/rVl/U5TdaE0wcwqm0E0h1+V3AD1OOKNF5lbToEHr8rkiGg58PWO1TuM+LgZKNLiMNWo1+hmBDmm3mXLZ/5sVFmhgKvI6DHRDc66hY84zbRXTephmx6kwvbnViJoQWfxQbcJaVcyYchlN949c8wv9UyIbtBz9ugtg2sKGVtG7/VG15aLcyZHcgBeqN1qAn3jH3t3+o4beiQDzYuAxxQ+i6+U20GKVe5O0fOH5HK379fMAqerehVB/TdPcpXCrhonMbXNIBwRZXrSEXUk6r5WOKgNjR+mDjMMidltFAAeu0IutWGcU14WKbaycCaGvZLAH7I0rH0O0Xk/oLkQmOjR5ud/At/wmeePCg6u7/BPWih+fcVAWHRjN090wJv0k1t92B7Aj/Afgtc2kdfwiauJLmBJsCUbVmi6+G+PEFoXv4Qds/cO9MMPV2CzFarmqtKUMNuDiJ/fgQNUMujWiIVZgeKOyA4MuVkqrvx0Glux1dgtPZ5oqAY0/JDZ0bjksHtWRKsF3j3Zw+p3EL/nT+Be2nAB77yfbHLyz50PXBnbykR4ZNTtPhHdGAco3ioofvO/2/UQwlDrx0BviEXjkBTK/QKcwA5ThmUYYs2U0/nN2hqunZZX4mikDlg+HhOcBy67+/TxPiltA1kNvAgstDUsuiVHRa2V/0fWfQSsIBbKrdYFLBDMLyyR01negw48cDJwJnpIttgBON9RK+WpT5E4Kl40s6f2YtQnGyKPyiM8SvukxHi5LLfVWgilTLW304TAQ1+HT5m7z/sHYHl4Dhw3Audflet1Dt1Ra7UV3/1q0FNhq4XvqPf5hDGDb3AGYdsDUEBEVhSArFaLglKhta9e3pIuWBqtQggjSmSN/sgODQPz8NUC5ceuxKzrZAvfEQ3C0Pzj8K4Iv3+/X6VxK4HgG4RgMGJIOCgRo7DAe7vy3GwIHyMZh/9ZIUCJ1N8ACn6k9eDvJPXIJ/onWSZKqgSSrDqc51wtagNL7ZjFZ5XdOEwmPfv1yHo1ZlzMWg+7x8cBUf8DoOmWZfzrHYuMW3UOCGnWo/1sDTcIYPNesvgK9treVsOAQNEotbttctblhmkoF2lpvqQbEotrry9cEz/dLkNp9nsrsOr/p2bSM7ZdNXPZDREdZJgiG/KGlk/yHwe1lgC6dSEHRDh3/YqddNKmoN8bMaf09yPHw+JAwkBbGd2Mx2WwMuT2N/JlqL+66L6Ni5x2FlwKeLHRA8pnyVtz5RwfCEHHTunuNJV+fGI+ULYjc8GZKd9ZufNdTjsXL2AkKopk/HM+e1a4v8OZHzTxjhrfq27OQb63h4SIFyQ4edKcRXuLOSfCwQT/Q+KnAFwbfqLBGPlHN/+39qLAYoHwYscwjDULKZzOVOkiT2YV1DsFlSs0KLxne7LkVS4MXEgg+OgCbzDc83lyPmg0+kJv6ijgH/ncLJv9C0keXi+vk1x0eLIlOVVqcVqKD59M800nf/4ewOlgRZSWv8LSvwoP/TgmDfTT/EhoHWDVDqFzV+O4JZWxqWpjAwGaqrXyYJ3wy56rozcU3cycSZbx+TinmjaT7zt6dLZRJPK85IX4YPvt5mrfVfoBnBA/X9RB8+wjAOrb/0ic6En/7JLh3ELzovPEDpML28eIC2HrsAcNa39VgDjApU/0AtDb5gdwE1gYeYtUDZafkIcbMFDrBMsIn1JjaUlJdiFJsuLVrStQVY86JfOetpMbSuDS4HOqjhbm+3iZ/KYDX7TsJDV4eSZL3f5p+COn8F0ok9XefX68+hd3AcVfBPq1TzK5rEBwI3nOXtBTpJNe+vJJmjih1ruQk3G/GBChr07A0IzrA5UcmAEc2XlP0G1DZF948pEb9bL0OrXi4jwIFLCnWN6e5EK7/rZbBTDh+6gYaivVNSK/VpFMIvw5gvPSb+Jf3i1+vPu9rngHEn7pleBU2I+W3XWV7JvQNyuf7eTa8kw4e4Z/pheJAev+8UiHWepa5/l5OdwbNNoG7/EON3sqG2GFK5JI9hKNOidq8IgctlAHjksUPB5n3KNKansb9eBmhGyFsAobNBzPI3B1dmgD+hDVeHun69/lWZGZ4Zf8RzrW+zYC9p/a7lA1owOFGJZi/HAp1L63e3pMU5LyBITVOvIUmyXFWpbNYaC7WVAcr/L8AA+dSd3OMf2BsAAAAASUVORK5CYII=) no-repeat;background-size:100%;margin-right:0rem;padding:6rem;text-align:center}.jt-drawing-dialog .el-dialog .el-dialog__headerbtn{height:34rem}.jt-drawing-dialog .el-dialog .content{height:calc(100% - 120rem);width:92%;overflow-y:auto;padding:5rem 0 0;position:absolute}.jt-drawing-dialog .el-dialog .el-collapse{--el-collapse-border-color: rgb(0 44 126 / 0%);--el-collapse-header-text-color: #ffffff;--el-collapse-header-font-size: 13rem;--el-collapse-content-bg-color: rgb(0 44 126 / 0%);--el-collapse-content-font-size: 13rem;--el-collapse-content-text-color: rgb(216 240 255);--el-collapse-header-height: 40rem;--el-collapse-header-bg-color: rgb(30 130 255)}.jt-drawing-dialog .el-dialog .el-collapse .el-collapse-item__header{background-color:#409eff;border-bottom:2px solid rgb(22,90,190)}.jt-drawing-dialog .el-dialog .el-collapse .el-collapse-item__content{padding:10rem}.jt-drawing-dialog .el-dialog .el-dialog__body{padding:10rem;color:#fff}.jt-drawing-dialog .el-dialog .el-color-picker__trigger{width:120rem}.jt-drawing-dialog .el-dialog .el-body-foot{position:absolute;bottom:8rem;right:8rem;width:calc(100% - 16rem)}.jt-drawing-dialog .el-dialog .el-body-foot .el-button-group{display:flex}.jt-drawing-dialog .el-dialog .el-body-foot .el-button-group .el-button{border:solid 0rem rgb(255,0,0);flex:1}
  44097. `;
  44098. const _hoisted_1 = { class: "jt-drawing-dialog" };
  44099. const _hoisted_2 = {
  44100. slot: "title",
  44101. class: "header-title"
  44102. };
  44103. const _hoisted_3 = { style: { "line-height": "24rem", "font-size": "16rem", "color": "#fff", "font-family": "'Alimama_ShuHeiTi_Bold'" } };
  44104. const _hoisted_4 = { class: "content" };
  44105. const _hoisted_5 = {
  44106. class: "jt-drawing-row",
  44107. style: { "height": "60rem" }
  44108. };
  44109. const _hoisted_6 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u5185\u5BB9", -1);
  44110. const _hoisted_7 = { class: "col-main" };
  44111. const _hoisted_8 = { class: "jt-drawing-row" };
  44112. const _hoisted_9 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u5B57\u4F53", -1);
  44113. const _hoisted_10 = { class: "col-main" };
  44114. const _hoisted_11 = { class: "jt-drawing-row" };
  44115. const _hoisted_12 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u5B57\u4F53\u5927\u5C0F", -1);
  44116. const _hoisted_13 = { class: "col-main" };
  44117. const _hoisted_14 = { class: "jt-drawing-row" };
  44118. const _hoisted_15 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u52A0\u7C97", -1);
  44119. const _hoisted_16 = { class: "col-main" };
  44120. const _hoisted_17 = { class: "jt-drawing-row" };
  44121. const _hoisted_18 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u659C\u4F53", -1);
  44122. const _hoisted_19 = { class: "col-main" };
  44123. const _hoisted_20 = { class: "jt-drawing-row" };
  44124. const _hoisted_21 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u989C\u8272", -1);
  44125. const _hoisted_22 = { class: "col-main" };
  44126. const _hoisted_23 = { class: "jt-drawing-row" };
  44127. const _hoisted_24 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u8FB9\u6846", -1);
  44128. const _hoisted_25 = { class: "col-main" };
  44129. const _hoisted_26 = { class: "jt-drawing-row" };
  44130. const _hoisted_27 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u989C\u8272", -1);
  44131. const _hoisted_28 = { class: "col-main" };
  44132. const _hoisted_29 = { class: "jt-drawing-row" };
  44133. const _hoisted_30 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u5BBD\u5EA6", -1);
  44134. const _hoisted_31 = { class: "col-main" };
  44135. const _hoisted_32 = { class: "jt-drawing-row" };
  44136. const _hoisted_33 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u80CC\u666F", -1);
  44137. const _hoisted_34 = { class: "col-main" };
  44138. const _hoisted_35 = { class: "jt-drawing-row" };
  44139. const _hoisted_36 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u80CC\u666F\u989C\u8272", -1);
  44140. const _hoisted_37 = { class: "col-main" };
  44141. const _hoisted_38 = { class: "jt-drawing-row" };
  44142. const _hoisted_39 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u80CC\u666F\u5185\u8FB9\u8DDD", -1);
  44143. const _hoisted_40 = { class: "col-main" };
  44144. const _hoisted_41 = { class: "jt-drawing-row" };
  44145. const _hoisted_42 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6A2A\u5411\u504F\u79FB\u50CF\u7D20", -1);
  44146. const _hoisted_43 = { class: "col-main" };
  44147. const _hoisted_44 = { class: "jt-drawing-row" };
  44148. const _hoisted_45 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u7EB5\u5411\u504F\u79FB\u50CF\u7D20", -1);
  44149. const _hoisted_46 = { class: "col-main" };
  44150. const _hoisted_47 = { class: "jt-drawing-row" };
  44151. const _hoisted_48 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u50CF\u7D20\u5927\u5C0F", -1);
  44152. const _hoisted_49 = { class: "col-main" };
  44153. const _hoisted_50 = { class: "jt-drawing-row" };
  44154. const _hoisted_51 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u989C\u8272", -1);
  44155. const _hoisted_52 = { class: "col-main" };
  44156. const _hoisted_53 = { class: "jt-drawing-row" };
  44157. const _hoisted_54 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u8FB9\u6846", -1);
  44158. const _hoisted_55 = { class: "col-main" };
  44159. const _hoisted_56 = { class: "jt-drawing-row" };
  44160. const _hoisted_57 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u989C\u8272", -1);
  44161. const _hoisted_58 = { class: "col-main" };
  44162. const _hoisted_59 = { class: "jt-drawing-row" };
  44163. const _hoisted_60 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u5BBD\u5EA6", -1);
  44164. const _hoisted_61 = { class: "col-main" };
  44165. const _hoisted_62 = {
  44166. class: "jt-drawing-row",
  44167. style: { "height": "60rem" }
  44168. };
  44169. const _hoisted_63 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u56FE\u6807", -1);
  44170. const _hoisted_64 = { class: "col-main" };
  44171. const _hoisted_65 = { class: "jt-drawing-row" };
  44172. const _hoisted_66 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u5927\u5C0F\u6BD4\u4F8B", -1);
  44173. const _hoisted_67 = { class: "col-main" };
  44174. const _hoisted_68 = {
  44175. class: "jt-drawing-row",
  44176. style: { "height": "60rem" }
  44177. };
  44178. const _hoisted_69 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6A21\u578B\u8DEF\u5F84", -1);
  44179. const _hoisted_70 = { class: "col-main" };
  44180. const _hoisted_71 = { class: "jt-drawing-row" };
  44181. const _hoisted_72 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u900F\u660E\u5EA6", -1);
  44182. const _hoisted_73 = { class: "col-main" };
  44183. const _hoisted_74 = { class: "jt-drawing-row" };
  44184. const _hoisted_75 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u6700\u5C0F\u50CF\u7D20\u5927\u5C0F", -1);
  44185. const _hoisted_76 = { class: "col-main" };
  44186. const _hoisted_77 = { class: "jt-drawing-row" };
  44187. const _hoisted_78 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u662F\u5426\u8FB9\u6846", -1);
  44188. const _hoisted_79 = { class: "col-main" };
  44189. const _hoisted_80 = { class: "jt-drawing-row" };
  44190. const _hoisted_81 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u989C\u8272", -1);
  44191. const _hoisted_82 = { class: "col-main" };
  44192. const _hoisted_83 = { class: "jt-drawing-row" };
  44193. const _hoisted_84 = /* @__PURE__ */ createElementVNode("div", { class: "col-left" }, "\u8FB9\u6846\u5BBD\u5EA6", -1);
  44194. const _hoisted_85 = { class: "col-main" };
  44195. const _hoisted_86 = { class: "el-body-foot" };
  44196. const _sfc_main = {
  44197. __name: "CrEditProperty_Point.ce",
  44198. props: {
  44199. params: {
  44200. id: {
  44201. type: String,
  44202. default: () => void 0
  44203. },
  44204. text: {
  44205. type: String,
  44206. default: () => ""
  44207. },
  44208. font: {
  44209. type: String,
  44210. default: () => ""
  44211. },
  44212. fontSize: {
  44213. type: Number,
  44214. default: () => 24
  44215. },
  44216. color: {
  44217. type: String,
  44218. default: () => "255,255,0,0.9"
  44219. }
  44220. },
  44221. showDialog: {
  44222. type: Boolean,
  44223. default: () => false
  44224. }
  44225. },
  44226. emits: ["submit", "update:showDialog", "update:params", "remove"],
  44227. setup(__props, { emit }) {
  44228. const props = __props;
  44229. const language = ref("zh-cn");
  44230. const locale = computed$1(() => language.value === "zh-cn" ? zhCn : en);
  44231. const {
  44232. proxy
  44233. } = getCurrentInstance();
  44234. const predefineColors = ref([
  44235. "#ff4500",
  44236. "#ff8c00",
  44237. "#ffd700",
  44238. "#90ee90",
  44239. "#00ced1",
  44240. "#1e90ff",
  44241. "#c71585",
  44242. "rgba(255, 69, 0, 0.68)",
  44243. "rgb(255, 120, 0)",
  44244. "hsv(51, 100, 98)",
  44245. "hsva(120, 40, 94, 0.5)",
  44246. "hsl(181, 100%, 37%)",
  44247. "hsla(209, 100%, 56%, 0.73)",
  44248. "#c7158577"
  44249. ]);
  44250. const selectOptionsFont = [
  44251. {
  44252. value: "Helvetica",
  44253. label: "\u9ED8\u8BA4\u5B57\u4F53"
  44254. },
  44255. {
  44256. value: "Microsoft YaHei",
  44257. label: "\u5FAE\u8F6F\u96C5\u9ED1"
  44258. },
  44259. {
  44260. value: "\u5B8B\u4F53",
  44261. label: "\u5B8B\u4F53"
  44262. },
  44263. {
  44264. value: "\u6977\u4F53",
  44265. label: "\u6977\u4F53"
  44266. },
  44267. {
  44268. value: "\u96B6\u4E66",
  44269. label: "\u96B6\u4E66"
  44270. },
  44271. {
  44272. value: "\u9ED1\u4F53",
  44273. label: "\u9ED1\u4F53"
  44274. }
  44275. ];
  44276. const activeNames = ref(["1"]);
  44277. const title = ref("\u5C5E\u6027\u7F16\u8F91");
  44278. const dialogVisible = ref(props.showDialog);
  44279. const isShowLabelStyle = ref(false);
  44280. const isShowPointStyle = ref(false);
  44281. const isShowBillboardStyle = ref(false);
  44282. const isShowModelStyle = ref(false);
  44283. const label = ref({
  44284. content: "",
  44285. font: "",
  44286. fontSize: 0,
  44287. bolder: false,
  44288. italic: false,
  44289. fillColor: "",
  44290. showOutline: false,
  44291. outlineColor: "",
  44292. outlineWidth: 0,
  44293. showBackground: false,
  44294. backgroundColor: "",
  44295. backgroundPadding: 0,
  44296. pixelOffsetX: 0,
  44297. pixelOffsetY: 0
  44298. });
  44299. const point2 = ref({
  44300. color: "",
  44301. pixelSize: 10,
  44302. showOutline: false,
  44303. outlineColor: "",
  44304. outlineWidth: 0
  44305. });
  44306. const billboard = ref({
  44307. imgUrl: "",
  44308. alpha: 1,
  44309. scale: 1
  44310. });
  44311. const model = ref({
  44312. url: "",
  44313. alpha: 1,
  44314. showSilhouette: false,
  44315. silhouetteSize: 0,
  44316. silhouetteColor: "rgba(255,255,255,1)",
  44317. minimumPixelSize: 1,
  44318. maximumScale: 1,
  44319. heading: 0,
  44320. pitch: 0,
  44321. roll: 0
  44322. });
  44323. updateParams(props.params);
  44324. function updateParams(params) {
  44325. proxy._params = params;
  44326. _setShowControls(false);
  44327. if (params.id === DrawPoint.DrawType.Label) {
  44328. title.value = "\u6587\u5B57\u7F16\u8F91";
  44329. activeNames.value = ["\u6807\u6CE8\u6837\u5F0F"];
  44330. isShowLabelStyle.value = true;
  44331. label.value.content = params.label.text;
  44332. label.value.font = params.label.font;
  44333. label.value.fontSize = params.label.fontSize;
  44334. label.value.fillColor = params.label.fillColor;
  44335. label.value.showOutline = params.label.showOutline;
  44336. label.value.outlineColor = params.label.outlineColor;
  44337. label.value.outlineWidth = params.label.outlineWidth;
  44338. label.value.showBackground = params.label.showBackground;
  44339. label.value.backgroundColor = params.label.backgroundColor;
  44340. label.value.backgroundPadding = params.label.backgroundPadding;
  44341. label.value.pixelOffsetX = params.label.pixelOffsetX;
  44342. label.value.pixelOffsetY = params.label.pixelOffsetY;
  44343. } else if (params.id === DrawPoint.DrawType.Point) {
  44344. title.value = "\u70B9\u7F16\u8F91";
  44345. activeNames.value = ["\u70B9\u6837\u5F0F"];
  44346. isShowPointStyle.value = true;
  44347. point2.value.color = params.point.color;
  44348. point2.value.pixelSize = params.point.pixelSize;
  44349. point2.value.showOutline = params.point.showOutline;
  44350. point2.value.outlineColor = params.point.outlineColor;
  44351. point2.value.outlineWidth = params.point.outlineWidth;
  44352. } else if (params.id === DrawPoint.DrawType.Point2Label) {
  44353. title.value = "\u70B9\u53CA\u6587\u5B57\u7F16\u8F91";
  44354. activeNames.value = ["\u70B9\u6837\u5F0F", "\u6807\u6CE8\u6837\u5F0F"];
  44355. isShowPointStyle.value = true;
  44356. isShowLabelStyle.value = true;
  44357. point2.value.color = params.point.color;
  44358. point2.value.pixelSize = params.point.pixelSize;
  44359. point2.value.showOutline = params.point.showOutline;
  44360. point2.value.outlineColor = params.point.outlineColor;
  44361. point2.value.outlineWidth = params.point.outlineWidth;
  44362. label.value.content = params.label.text;
  44363. label.value.font = params.label.font;
  44364. label.value.fontSize = params.label.fontSize;
  44365. label.value.fillColor = params.label.fillColor;
  44366. label.value.showOutline = params.label.showOutline;
  44367. label.value.outlineColor = params.label.outlineColor;
  44368. label.value.outlineWidth = params.label.outlineWidth;
  44369. label.value.showBackground = params.label.showBackground;
  44370. label.value.backgroundColor = params.label.backgroundColor;
  44371. label.value.backgroundPadding = params.label.backgroundPadding;
  44372. label.value.pixelOffsetX = params.label.pixelOffsetX;
  44373. label.value.pixelOffsetY = params.label.pixelOffsetY;
  44374. } else if (params.id === DrawPoint.DrawType.Billboard) {
  44375. title.value = "\u5E7F\u544A\u724C\u7F16\u8F91";
  44376. activeNames.value = ["\u56FE\u7247\u6837\u5F0F"];
  44377. isShowBillboardStyle.value = true;
  44378. billboard.value.imgUrl = params.billboard.imgUrl;
  44379. billboard.value.alpha = params.billboard.alpha;
  44380. billboard.value.scale = params.billboard.scale;
  44381. } else if (params.id === DrawPoint.DrawType.Billboard2Label) {
  44382. title.value = "\u5E7F\u544A\u724C\u53CA\u6587\u5B57\u5706\u7F16\u8F91";
  44383. activeNames.value = ["\u56FE\u7247\u6837\u5F0F", "\u6807\u6CE8\u6837\u5F0F"];
  44384. isShowBillboardStyle.value = true;
  44385. isShowLabelStyle.value = true;
  44386. billboard.value.imgUrl = params.billboard.imgUrl;
  44387. billboard.value.alpha = params.billboard.alpha;
  44388. billboard.value.scale = params.billboard.scale;
  44389. label.value.content = params.label.text;
  44390. label.value.font = params.label.font;
  44391. label.value.fontSize = params.label.fontSize;
  44392. label.value.fillColor = params.label.fillColor;
  44393. label.value.showOutline = params.label.showOutline;
  44394. label.value.outlineColor = params.label.outlineColor;
  44395. label.value.outlineWidth = params.label.outlineWidth;
  44396. label.value.showBackground = params.label.showBackground;
  44397. label.value.backgroundColor = params.label.backgroundColor;
  44398. label.value.backgroundPadding = params.label.backgroundPadding;
  44399. label.value.pixelOffsetX = params.label.pixelOffsetX;
  44400. label.value.pixelOffsetY = params.label.pixelOffsetY;
  44401. } else if (params.id === DrawPoint.DrawType.Model) {
  44402. title.value = "\u5C0F\u6A21\u578B\u7F16\u8F91";
  44403. activeNames.value = ["\u5C0F\u6A21\u578B\u6837\u5F0F"];
  44404. isShowModelStyle.value = true;
  44405. model.value.url = params.model.url;
  44406. model.value.alpha = params.model.alpha;
  44407. model.value.showSilhouette = params.model.showSilhouette;
  44408. model.value.silhouetteColor = params.model.silhouetteColor;
  44409. model.value.silhouetteSize = params.model.silhouetteSize;
  44410. model.value.minimumPixelSize = params.model.minimumPixelSize;
  44411. model.value.maximumScale = params.model.maximumScale;
  44412. model.value.heading = params.model.heading;
  44413. model.value.pitch = params.model.pitch;
  44414. model.value.roll = params.model.roll;
  44415. }
  44416. }
  44417. function _setShowControls(isShow) {
  44418. isShowLabelStyle.value = isShow;
  44419. isShowPointStyle.value = isShow;
  44420. isShowBillboardStyle.value = isShow;
  44421. isShowModelStyle.value = isShow;
  44422. }
  44423. function submit() {
  44424. let outParam = proxy._params;
  44425. outParam = {
  44426. id: outParam.id,
  44427. label: {
  44428. text: label.value.content,
  44429. font: label.value.font,
  44430. fontSize: label.value.fontSize,
  44431. bolder: label.value.bolder,
  44432. italic: label.value.italic,
  44433. fillColor: label.value.fillColor,
  44434. showOutline: label.value.showOutline,
  44435. outlineWidth: label.value.outlineWidth,
  44436. outlineColor: label.value.outlineColor,
  44437. showBackground: label.value.showBackground,
  44438. backgroundColor: label.value.backgroundColor,
  44439. backgroundPadding: label.value.backgroundPadding,
  44440. pixelOffsetX: label.value.pixelOffsetX,
  44441. pixelOffsetY: label.value.pixelOffsetY
  44442. },
  44443. point: {
  44444. color: point2.value.color,
  44445. pixelSize: point2.value.pixelSize,
  44446. showOutline: point2.value.showOutline,
  44447. outlineWidth: point2.value.outlineWidth,
  44448. outlineColor: point2.value.outlineColor
  44449. },
  44450. billboard: {
  44451. imgUrl: billboard.value.imgUrl,
  44452. alpha: billboard.value.alpha,
  44453. scale: billboard.value.scale
  44454. },
  44455. model: {
  44456. url: model.value.url,
  44457. alpha: model.value.alpha,
  44458. showSilhouette: model.value.showSilhouette,
  44459. silhouetteColor: model.value.silhouetteColor,
  44460. silhouetteSize: model.value.silhouetteSize,
  44461. minimumPixelSize: model.value.minimumPixelSize,
  44462. maximumScale: model.value.maximumScale,
  44463. heading: model.value.heading,
  44464. pitch: model.value.pitch,
  44465. roll: model.value.roll
  44466. }
  44467. };
  44468. emit("submit", outParam);
  44469. }
  44470. function close() {
  44471. dialogVisible.value = false;
  44472. }
  44473. function remove2() {
  44474. emit("remove", {});
  44475. dialogVisible.value = false;
  44476. }
  44477. function closeDialog() {
  44478. emit("update:showDialog", false);
  44479. }
  44480. function openDialog() {
  44481. updateParams(props.params);
  44482. }
  44483. return (_ctx, _cache) => {
  44484. const _component_el_scrollbar = resolveComponent("el-scrollbar");
  44485. return openBlock(), createElementBlock("div", _hoisted_1, [
  44486. createVNode(unref(ElDialog), {
  44487. modal: false,
  44488. "destroy-on-close": false,
  44489. modelValue: dialogVisible.value,
  44490. "onUpdate:modelValue": _cache[31] || (_cache[31] = ($event) => dialogVisible.value = $event),
  44491. title: title.value,
  44492. onClose: closeDialog,
  44493. onOpen: openDialog,
  44494. "show-close": false
  44495. }, {
  44496. header: withCtx(() => [
  44497. createElementVNode("div", _hoisted_2, [
  44498. createElementVNode("span", _hoisted_3, toDisplayString(title.value), 1)
  44499. ])
  44500. ]),
  44501. default: withCtx(() => [
  44502. createVNode(_component_el_scrollbar, null, {
  44503. default: withCtx(() => [
  44504. createElementVNode("div", _hoisted_4, [
  44505. createVNode(unref(ElCollapse), {
  44506. modelValue: activeNames.value,
  44507. "onUpdate:modelValue": _cache[27] || (_cache[27] = ($event) => activeNames.value = $event)
  44508. }, {
  44509. default: withCtx(() => [
  44510. withDirectives(createVNode(unref(ElCollapseItem), { name: "\u6807\u6CE8\u6837\u5F0F" }, {
  44511. title: withCtx(() => [
  44512. createVNode(unref(ElIcon), { style: { "padding": "10rem" } }, {
  44513. default: withCtx(() => [
  44514. createVNode(unref(setting_default))
  44515. ]),
  44516. _: 1
  44517. }),
  44518. createTextVNode("\u6807\u6CE8\u6837\u5F0F ")
  44519. ]),
  44520. default: withCtx(() => [
  44521. createElementVNode("div", _hoisted_5, [
  44522. _hoisted_6,
  44523. createElementVNode("div", _hoisted_7, [
  44524. createVNode(unref(ElInput), {
  44525. modelValue: label.value.content,
  44526. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => label.value.content = $event),
  44527. placeholder: "\u8F93\u5165\u663E\u793A\u7684\u6587\u5B57\u5185\u5BB9",
  44528. clearable: "",
  44529. type: "textarea",
  44530. rows: 2
  44531. }, null, 8, ["modelValue"])
  44532. ])
  44533. ]),
  44534. createElementVNode("div", _hoisted_8, [
  44535. _hoisted_9,
  44536. createElementVNode("div", _hoisted_10, [
  44537. createVNode(unref(ElSelect), {
  44538. modelValue: label.value.font,
  44539. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => label.value.font = $event),
  44540. placeholder: "\u8BF7\u9009\u62E9"
  44541. }, {
  44542. default: withCtx(() => [
  44543. (openBlock(), createElementBlock(Fragment, null, renderList(selectOptionsFont, (item) => {
  44544. return createVNode(unref(ElOption), {
  44545. key: item.value,
  44546. label: item.label,
  44547. value: item.value
  44548. }, null, 8, ["label", "value"]);
  44549. }), 64))
  44550. ]),
  44551. _: 1
  44552. }, 8, ["modelValue"])
  44553. ])
  44554. ]),
  44555. createElementVNode("div", _hoisted_11, [
  44556. _hoisted_12,
  44557. createElementVNode("div", _hoisted_13, [
  44558. createVNode(unref(ElInputNumber), {
  44559. modelValue: label.value.fontSize,
  44560. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => label.value.fontSize = $event),
  44561. min: 0,
  44562. max: 100
  44563. }, null, 8, ["modelValue"])
  44564. ])
  44565. ]),
  44566. createElementVNode("div", _hoisted_14, [
  44567. _hoisted_15,
  44568. createElementVNode("div", _hoisted_16, [
  44569. createVNode(unref(ElSwitch), {
  44570. modelValue: label.value.bolder,
  44571. "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => label.value.bolder = $event)
  44572. }, null, 8, ["modelValue"])
  44573. ])
  44574. ]),
  44575. createElementVNode("div", _hoisted_17, [
  44576. _hoisted_18,
  44577. createElementVNode("div", _hoisted_19, [
  44578. createVNode(unref(ElSwitch), {
  44579. modelValue: label.value.italic,
  44580. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => label.value.italic = $event)
  44581. }, null, 8, ["modelValue"])
  44582. ])
  44583. ]),
  44584. createElementVNode("div", _hoisted_20, [
  44585. _hoisted_21,
  44586. createElementVNode("div", _hoisted_22, [
  44587. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44588. default: withCtx(() => [
  44589. createVNode(unref(ElColorPicker), {
  44590. modelValue: label.value.fillColor,
  44591. "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => label.value.fillColor = $event),
  44592. "show-alpha": "",
  44593. predefine: predefineColors.value,
  44594. label: "12"
  44595. }, null, 8, ["modelValue", "predefine"])
  44596. ]),
  44597. _: 1
  44598. }, 8, ["locale"])
  44599. ])
  44600. ]),
  44601. createElementVNode("div", _hoisted_23, [
  44602. _hoisted_24,
  44603. createElementVNode("div", _hoisted_25, [
  44604. createVNode(unref(ElSwitch), {
  44605. modelValue: label.value.showOutline,
  44606. "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => label.value.showOutline = $event)
  44607. }, null, 8, ["modelValue"])
  44608. ])
  44609. ]),
  44610. withDirectives(createElementVNode("div", _hoisted_26, [
  44611. _hoisted_27,
  44612. createElementVNode("div", _hoisted_28, [
  44613. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44614. default: withCtx(() => [
  44615. createVNode(unref(ElColorPicker), {
  44616. modelValue: label.value.outlineColor,
  44617. "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => label.value.outlineColor = $event),
  44618. "show-alpha": "",
  44619. predefine: predefineColors.value,
  44620. label: "12"
  44621. }, null, 8, ["modelValue", "predefine"])
  44622. ]),
  44623. _: 1
  44624. }, 8, ["locale"])
  44625. ])
  44626. ], 512), [
  44627. [vShow, label.value.showOutline]
  44628. ]),
  44629. withDirectives(createElementVNode("div", _hoisted_29, [
  44630. _hoisted_30,
  44631. createElementVNode("div", _hoisted_31, [
  44632. createVNode(unref(ElInputNumber), {
  44633. modelValue: label.value.outlineWidth,
  44634. "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => label.value.outlineWidth = $event),
  44635. min: 0,
  44636. max: 100
  44637. }, null, 8, ["modelValue"])
  44638. ])
  44639. ], 512), [
  44640. [vShow, label.value.showOutline]
  44641. ]),
  44642. createElementVNode("div", _hoisted_32, [
  44643. _hoisted_33,
  44644. createElementVNode("div", _hoisted_34, [
  44645. createVNode(unref(ElSwitch), {
  44646. modelValue: label.value.showBackground,
  44647. "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => label.value.showBackground = $event)
  44648. }, null, 8, ["modelValue"])
  44649. ])
  44650. ]),
  44651. withDirectives(createElementVNode("div", _hoisted_35, [
  44652. _hoisted_36,
  44653. createElementVNode("div", _hoisted_37, [
  44654. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44655. default: withCtx(() => [
  44656. createVNode(unref(ElColorPicker), {
  44657. modelValue: label.value.backgroundColor,
  44658. "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => label.value.backgroundColor = $event),
  44659. "show-alpha": "",
  44660. predefine: predefineColors.value,
  44661. label: "12"
  44662. }, null, 8, ["modelValue", "predefine"])
  44663. ]),
  44664. _: 1
  44665. }, 8, ["locale"])
  44666. ])
  44667. ], 512), [
  44668. [vShow, label.value.showBackground]
  44669. ]),
  44670. withDirectives(createElementVNode("div", _hoisted_38, [
  44671. _hoisted_39,
  44672. createElementVNode("div", _hoisted_40, [
  44673. createVNode(unref(ElInputNumber), {
  44674. modelValue: label.value.backgroundPadding,
  44675. "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => label.value.backgroundPadding = $event),
  44676. min: -100,
  44677. max: 100
  44678. }, null, 8, ["modelValue"])
  44679. ])
  44680. ], 512), [
  44681. [vShow, label.value.showBackground]
  44682. ]),
  44683. createElementVNode("div", _hoisted_41, [
  44684. _hoisted_42,
  44685. createElementVNode("div", _hoisted_43, [
  44686. createVNode(unref(ElInputNumber), {
  44687. modelValue: label.value.pixelOffsetX,
  44688. "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => label.value.pixelOffsetX = $event),
  44689. min: -100,
  44690. max: 100
  44691. }, null, 8, ["modelValue"])
  44692. ])
  44693. ]),
  44694. createElementVNode("div", _hoisted_44, [
  44695. _hoisted_45,
  44696. createElementVNode("div", _hoisted_46, [
  44697. createVNode(unref(ElInputNumber), {
  44698. modelValue: label.value.pixelOffsetY,
  44699. "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => label.value.pixelOffsetY = $event),
  44700. min: -100,
  44701. max: 100
  44702. }, null, 8, ["modelValue"])
  44703. ])
  44704. ])
  44705. ]),
  44706. _: 1
  44707. }, 512), [
  44708. [vShow, isShowLabelStyle.value]
  44709. ]),
  44710. withDirectives(createVNode(unref(ElCollapseItem), { name: "\u70B9\u6837\u5F0F" }, {
  44711. title: withCtx(() => [
  44712. createVNode(unref(ElIcon), { style: { "padding": "10rem" } }, {
  44713. default: withCtx(() => [
  44714. createVNode(unref(setting_default))
  44715. ]),
  44716. _: 1
  44717. }),
  44718. createTextVNode("\u70B9\u6837\u5F0F ")
  44719. ]),
  44720. default: withCtx(() => [
  44721. createElementVNode("div", _hoisted_47, [
  44722. _hoisted_48,
  44723. createElementVNode("div", _hoisted_49, [
  44724. createVNode(unref(ElInputNumber), {
  44725. modelValue: point2.value.pixelSize,
  44726. "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => point2.value.pixelSize = $event),
  44727. min: 0,
  44728. max: 100
  44729. }, null, 8, ["modelValue"])
  44730. ])
  44731. ]),
  44732. createElementVNode("div", _hoisted_50, [
  44733. _hoisted_51,
  44734. createElementVNode("div", _hoisted_52, [
  44735. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44736. default: withCtx(() => [
  44737. createVNode(unref(ElColorPicker), {
  44738. modelValue: point2.value.color,
  44739. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => point2.value.color = $event),
  44740. "show-alpha": "",
  44741. predefine: predefineColors.value,
  44742. label: "12"
  44743. }, null, 8, ["modelValue", "predefine"])
  44744. ]),
  44745. _: 1
  44746. }, 8, ["locale"])
  44747. ])
  44748. ]),
  44749. createElementVNode("div", _hoisted_53, [
  44750. _hoisted_54,
  44751. createElementVNode("div", _hoisted_55, [
  44752. createVNode(unref(ElSwitch), {
  44753. modelValue: point2.value.showOutline,
  44754. "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => point2.value.showOutline = $event)
  44755. }, null, 8, ["modelValue"])
  44756. ])
  44757. ]),
  44758. withDirectives(createElementVNode("div", _hoisted_56, [
  44759. _hoisted_57,
  44760. createElementVNode("div", _hoisted_58, [
  44761. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44762. default: withCtx(() => [
  44763. createVNode(unref(ElColorPicker), {
  44764. modelValue: point2.value.outlineColor,
  44765. "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => point2.value.outlineColor = $event),
  44766. "show-alpha": "",
  44767. predefine: predefineColors.value,
  44768. label: "12"
  44769. }, null, 8, ["modelValue", "predefine"])
  44770. ]),
  44771. _: 1
  44772. }, 8, ["locale"])
  44773. ])
  44774. ], 512), [
  44775. [vShow, point2.value.showOutline]
  44776. ]),
  44777. withDirectives(createElementVNode("div", _hoisted_59, [
  44778. _hoisted_60,
  44779. createElementVNode("div", _hoisted_61, [
  44780. createVNode(unref(ElInputNumber), {
  44781. modelValue: point2.value.outlineWidth,
  44782. "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => point2.value.outlineWidth = $event),
  44783. min: 0,
  44784. max: 100
  44785. }, null, 8, ["modelValue"])
  44786. ])
  44787. ], 512), [
  44788. [vShow, point2.value.showOutline]
  44789. ])
  44790. ]),
  44791. _: 1
  44792. }, 512), [
  44793. [vShow, isShowPointStyle.value]
  44794. ]),
  44795. withDirectives(createVNode(unref(ElCollapseItem), { name: "\u56FE\u7247\u6837\u5F0F" }, {
  44796. title: withCtx(() => [
  44797. createVNode(unref(ElIcon), { style: { "padding": "10rem" } }, {
  44798. default: withCtx(() => [
  44799. createVNode(unref(setting_default))
  44800. ]),
  44801. _: 1
  44802. }),
  44803. createTextVNode("\u56FE\u7247\u6837\u5F0F ")
  44804. ]),
  44805. default: withCtx(() => [
  44806. createElementVNode("div", _hoisted_62, [
  44807. _hoisted_63,
  44808. createElementVNode("div", _hoisted_64, [
  44809. createVNode(unref(ElInput), {
  44810. modelValue: billboard.value.imgUrl,
  44811. "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => billboard.value.imgUrl = $event),
  44812. placeholder: "\u8F93\u5165\u56FE\u6807\u8DEF\u5F84",
  44813. clearable: "",
  44814. type: "textarea",
  44815. rows: 2
  44816. }, null, 8, ["modelValue"])
  44817. ])
  44818. ]),
  44819. createElementVNode("div", _hoisted_65, [
  44820. _hoisted_66,
  44821. createElementVNode("div", _hoisted_67, [
  44822. createVNode(unref(ElInputNumber), {
  44823. modelValue: billboard.value.scale,
  44824. "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => billboard.value.scale = $event),
  44825. min: 1,
  44826. max: 100
  44827. }, null, 8, ["modelValue"])
  44828. ])
  44829. ])
  44830. ]),
  44831. _: 1
  44832. }, 512), [
  44833. [vShow, isShowBillboardStyle.value]
  44834. ]),
  44835. withDirectives(createVNode(unref(ElCollapseItem), { name: "\u5C0F\u6A21\u578B\u6837\u5F0F" }, {
  44836. title: withCtx(() => [
  44837. createVNode(unref(ElIcon), { style: { "padding": "10rem" } }, {
  44838. default: withCtx(() => [
  44839. createVNode(unref(setting_default))
  44840. ]),
  44841. _: 1
  44842. }),
  44843. createTextVNode("\u5C0F\u6A21\u578B\u6837\u5F0F ")
  44844. ]),
  44845. default: withCtx(() => [
  44846. createElementVNode("div", _hoisted_68, [
  44847. _hoisted_69,
  44848. createElementVNode("div", _hoisted_70, [
  44849. createVNode(unref(ElInput), {
  44850. modelValue: model.value.url,
  44851. "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => model.value.url = $event),
  44852. placeholder: "\u8F93\u5165\u6A21\u578B\u8DEF\u5F84",
  44853. clearable: "",
  44854. type: "textarea",
  44855. rows: 2
  44856. }, null, 8, ["modelValue"])
  44857. ])
  44858. ]),
  44859. createElementVNode("div", _hoisted_71, [
  44860. _hoisted_72,
  44861. createElementVNode("div", _hoisted_73, [
  44862. createVNode(unref(ElInputNumber), {
  44863. modelValue: model.value.alpha,
  44864. "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => model.value.alpha = $event),
  44865. step: 0.1,
  44866. min: 0,
  44867. max: 1
  44868. }, null, 8, ["modelValue"])
  44869. ])
  44870. ]),
  44871. createElementVNode("div", _hoisted_74, [
  44872. _hoisted_75,
  44873. createElementVNode("div", _hoisted_76, [
  44874. createVNode(unref(ElInputNumber), {
  44875. modelValue: model.value.minimumPixelSize,
  44876. "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => model.value.minimumPixelSize = $event),
  44877. step: 1,
  44878. min: 0,
  44879. max: 2e4
  44880. }, null, 8, ["modelValue"])
  44881. ])
  44882. ]),
  44883. createElementVNode("div", _hoisted_77, [
  44884. _hoisted_78,
  44885. createElementVNode("div", _hoisted_79, [
  44886. createVNode(unref(ElSwitch), {
  44887. modelValue: model.value.showSilhouette,
  44888. "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => model.value.showSilhouette = $event)
  44889. }, null, 8, ["modelValue"])
  44890. ])
  44891. ]),
  44892. withDirectives(createElementVNode("div", _hoisted_80, [
  44893. _hoisted_81,
  44894. createElementVNode("div", _hoisted_82, [
  44895. createVNode(unref(ElConfigProvider), { locale: locale.value }, {
  44896. default: withCtx(() => [
  44897. createVNode(unref(ElColorPicker), {
  44898. modelValue: model.value.silhouetteColor,
  44899. "onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => model.value.silhouetteColor = $event),
  44900. "show-alpha": "",
  44901. predefine: predefineColors.value,
  44902. label: "12"
  44903. }, null, 8, ["modelValue", "predefine"])
  44904. ]),
  44905. _: 1
  44906. }, 8, ["locale"])
  44907. ])
  44908. ], 512), [
  44909. [vShow, model.value.showSilhouette]
  44910. ]),
  44911. withDirectives(createElementVNode("div", _hoisted_83, [
  44912. _hoisted_84,
  44913. createElementVNode("div", _hoisted_85, [
  44914. createVNode(unref(ElInputNumber), {
  44915. modelValue: model.value.silhouetteSize,
  44916. "onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => model.value.silhouetteSize = $event),
  44917. step: 1,
  44918. min: 0,
  44919. max: 100
  44920. }, null, 8, ["modelValue"])
  44921. ])
  44922. ], 512), [
  44923. [vShow, model.value.showSilhouette]
  44924. ])
  44925. ]),
  44926. _: 1
  44927. }, 512), [
  44928. [vShow, isShowModelStyle.value]
  44929. ])
  44930. ]),
  44931. _: 1
  44932. }, 8, ["modelValue"])
  44933. ]),
  44934. createElementVNode("div", _hoisted_86, [
  44935. createVNode(unref(ElButtonGroup), null, {
  44936. default: withCtx(() => [
  44937. createVNode(unref(ElButton), {
  44938. type: "primary",
  44939. icon: unref(edit_default),
  44940. onClick: _cache[28] || (_cache[28] = ($event) => submit())
  44941. }, {
  44942. default: withCtx(() => [
  44943. createTextVNode("\u4FEE\u6539")
  44944. ]),
  44945. _: 1
  44946. }, 8, ["icon"]),
  44947. createVNode(unref(ElButton), {
  44948. type: "primary",
  44949. style: { "background-color": "rgb(222, 146, 47)" },
  44950. icon: unref(delete_default),
  44951. onClick: _cache[29] || (_cache[29] = ($event) => remove2())
  44952. }, {
  44953. default: withCtx(() => [
  44954. createTextVNode("\u5220\u9664")
  44955. ]),
  44956. _: 1
  44957. }, 8, ["icon"]),
  44958. createVNode(unref(ElButton), {
  44959. type: "primary",
  44960. style: { "background-color": "rgb(126, 128, 135)" },
  44961. icon: unref(close_default),
  44962. onClick: _cache[30] || (_cache[30] = ($event) => close())
  44963. }, {
  44964. default: withCtx(() => [
  44965. createTextVNode("\u5173\u95ED")
  44966. ]),
  44967. _: 1
  44968. }, 8, ["icon"])
  44969. ]),
  44970. _: 1
  44971. })
  44972. ])
  44973. ]),
  44974. _: 1
  44975. })
  44976. ]),
  44977. _: 1
  44978. }, 8, ["modelValue", "title"])
  44979. ]);
  44980. };
  44981. }
  44982. };
  44983. var DialogEditProperty = /* @__PURE__ */ _export_sfc(_sfc_main, [["styles", [_style_0]]]);
  44984. Cesium.Entity.prototype.setParams = function(params) {
  44985. this._params = params;
  44986. };
  44987. Cesium.Entity.prototype.getParams = function() {
  44988. return this._params;
  44989. };
  44990. Cesium.Entity.prototype.setEntityType = function(entityType) {
  44991. this._entityType = entityType;
  44992. };
  44993. Cesium.Entity.prototype.getEntityType = function(entityType) {
  44994. return this._entityType;
  44995. };
  44996. Cesium.Entity.prototype.setIsEdit = function(isEdit) {
  44997. this._isEdit = isEdit;
  44998. };
  44999. Cesium.Entity.prototype.getIsEdit = function() {
  45000. return this._isEdit;
  45001. };
  45002. class DrawPoint {
  45003. constructor(viewer2) {
  45004. if (!viewer2)
  45005. throw new Cesium.DeveloperError("no viewer object!");
  45006. this._viewer = viewer2;
  45007. this._viewer.scene.globe.depthTestAgainstTerrain = true;
  45008. this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
  45009. this._entities = [];
  45010. this._pointObject = new PointObject(viewer2);
  45011. }
  45012. static initEditPropertyParams() {
  45013. return {
  45014. id: void 0,
  45015. label: {
  45016. text: "\u91D1\u7530CIM\u4E09\u7EF4\u57FA\u7840\u5E73\u53F0",
  45017. font: "Helvetica",
  45018. fontSize: 24,
  45019. bolder: false,
  45020. italic: false,
  45021. fillColor: "rgba(0,255,0,0.75)",
  45022. showOutline: false,
  45023. outlineWidth: 0,
  45024. outlineColor: "rgba(255,255,255,1)",
  45025. showBackground: false,
  45026. backgroundPadding: 0,
  45027. backgroundColor: "rgba(255,255,255,1)",
  45028. pixelOffsetX: 0,
  45029. pixelOffsetY: 0
  45030. },
  45031. point: {
  45032. color: "rgba(0,255,0,0.75)",
  45033. pixelSize: 10,
  45034. showOutline: false,
  45035. outlineWidth: 0,
  45036. outlineColor: "rgba(255,255,255,1)"
  45037. },
  45038. billboard: {
  45039. imgUrl: "jt3dSDK/imgs/point/point3.png",
  45040. alpha: 1,
  45041. scale: 1
  45042. },
  45043. model: {
  45044. url: "jt3dSDK/gltf/pyramid.glb",
  45045. alpha: 1,
  45046. showSilhouette: false,
  45047. silhouetteColor: "rgba(255,255,255,1)",
  45048. silhouetteSize: 0,
  45049. minimumPixelSize: 128,
  45050. maximumScale: 2e4,
  45051. heading: 0,
  45052. pitch: 0,
  45053. roll: 0
  45054. }
  45055. };
  45056. }
  45057. _cartesian3ToGeo(position2) {
  45058. let g = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  45059. return {
  45060. longitude: Cesium.Math.toDegrees(g.longitude),
  45061. latitude: Cesium.Math.toDegrees(g.latitude),
  45062. height: g.height
  45063. };
  45064. }
  45065. _arcToDegree(arc) {
  45066. return arc / Math.PI * 180;
  45067. }
  45068. _getScreenClickPositionAndHeight(screenPoint) {
  45069. var lng = void 0, lat = void 0, height2 = void 0;
  45070. var ray = this._viewer.scene.camera.getPickRay(screenPoint);
  45071. var position2 = this._viewer.scene.globe.pick(ray, this._viewer.scene);
  45072. var cartographic = Cesium.Ellipsoid.WGS84.cartesianToCartographic(position2);
  45073. var feature2 = this._viewer.scene.pick(screenPoint);
  45074. if (feature2 == void 0) {
  45075. lng = this._arcToDegree(cartographic.longitude);
  45076. lat = this._arcToDegree(cartographic.latitude);
  45077. height2 = cartographic.height;
  45078. } else {
  45079. var cartesian = this._viewer.scene.pickPosition(screenPoint);
  45080. if (Cesium.defined(cartesian)) {
  45081. var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
  45082. lng = this._arcToDegree(cartographic.longitude);
  45083. lat = this._arcToDegree(cartographic.latitude);
  45084. height2 = cartographic.height;
  45085. }
  45086. }
  45087. return {
  45088. lng,
  45089. lat,
  45090. height: height2
  45091. };
  45092. }
  45093. _transfromFromScreenPoint(screenPosition) {
  45094. let location = this._getScreenClickPositionAndHeight(screenPosition);
  45095. var cartesian = Cesium.Cartesian3.fromDegrees(location.lng, location.lat, location.height);
  45096. return {
  45097. gLocation: location,
  45098. sLocation: cartesian
  45099. };
  45100. }
  45101. }
  45102. Object.assign(DrawPoint.prototype, {
  45103. _setMousePointerStyle() {
  45104. document.querySelector("body").style.cursor = "crosshair";
  45105. },
  45106. _setMouseDefaultStyle() {
  45107. document.querySelector("body").style.cursor = "default";
  45108. },
  45109. _registerLeftClickEvent(handler, callChange) {
  45110. let _self = this;
  45111. if (!handler)
  45112. return;
  45113. handler.setInputAction(function(event2) {
  45114. _self._lock = true;
  45115. clearTimeout(_self._timer);
  45116. _self._timer = setTimeout(function() {
  45117. if (callChange)
  45118. callChange(event2);
  45119. _self._lock = false;
  45120. }, 200);
  45121. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  45122. },
  45123. _registerMouseMoveEvent(handler, callChange) {
  45124. let _self = this;
  45125. if (!handler)
  45126. return;
  45127. handler.setInputAction(function(event2) {
  45128. if (_self._lock === void 0 || _self._lock === false) {
  45129. if (callChange)
  45130. callChange(event2);
  45131. }
  45132. }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  45133. },
  45134. _registerLeftDownEvent(handler, callChange) {
  45135. if (!handler)
  45136. return;
  45137. handler.setInputAction(function(event2) {
  45138. if (callChange)
  45139. callChange(event2);
  45140. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  45141. },
  45142. _registerLeftUpEvent(handler, callChange) {
  45143. if (!handler)
  45144. return;
  45145. handler.setInputAction(function(event2) {
  45146. if (callChange)
  45147. callChange(event2);
  45148. }, Cesium.ScreenSpaceEventType.LEFT_UP);
  45149. },
  45150. _clearEvent(handler) {
  45151. if (!handler)
  45152. return;
  45153. handler.destroy();
  45154. handler = null;
  45155. }
  45156. });
  45157. Object.assign(DrawPoint.prototype, {
  45158. draw: function(type2, options2) {
  45159. let _self = this;
  45160. _self._unActivateEdit();
  45161. this._drawEventHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  45162. this._drawType = type2;
  45163. switch (type2) {
  45164. case DrawPoint.DrawType.Model:
  45165. _self._sketchDrawModel(_self._drawEventHandler, options2);
  45166. break;
  45167. case DrawPoint.DrawType.Label:
  45168. _self._sketchDrawLabel(_self._drawEventHandler, options2);
  45169. break;
  45170. case DrawPoint.DrawType.Point:
  45171. _self._sketchDrawPoint(_self._drawEventHandler, options2);
  45172. break;
  45173. case DrawPoint.DrawType.Point2Label:
  45174. _self._sketchDrawPoint2Label(_self._drawEventHandler, options2);
  45175. break;
  45176. case DrawPoint.DrawType.Billboard:
  45177. _self._sketchDrawBillboard(_self._drawEventHandler, options2);
  45178. break;
  45179. case DrawPoint.DrawType.Billboard2Label:
  45180. _self._sketchDrawBillboard2Label(_self._drawEventHandler, options2);
  45181. break;
  45182. }
  45183. },
  45184. clearAll() {
  45185. for (var i2 = 0; i2 < this._entities.length; i2++) {
  45186. var getById = viewer.entities.getById(this._entities[i2]);
  45187. if (getById) {
  45188. this._viewer.entities.remove(getById);
  45189. }
  45190. }
  45191. this._closePropertyEditDialog();
  45192. },
  45193. _sketchDrawLabel(handler, options2) {
  45194. let _self = this;
  45195. this._registerLeftClickEvent(handler, function(event2) {
  45196. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45197. if (!Cesium.defined(loc2.sLocation))
  45198. return;
  45199. let entityParam = DrawPoint.initEditPropertyParams();
  45200. entityParam.label.font = entityParam.label.fontSize + "px " + entityParam.label.font;
  45201. entityParam.label.pixelOffset = {
  45202. x: entityParam.label.pixelOffsetX,
  45203. y: entityParam.label.pixelOffsetY
  45204. };
  45205. _self._pointObject.addLabel(loc2.sLocation, {
  45206. label: entityParam.label
  45207. }).then((entity) => {
  45208. _self._viewer.entities.add(entity);
  45209. _self._entities.push(entity.id);
  45210. entityParam = DrawPoint.initEditPropertyParams();
  45211. _self._drawEntity = entity;
  45212. _self._drawEntity.setParams(entityParam);
  45213. _self._drawEntity.setEntityType(DrawPoint.DrawType.Label);
  45214. _self._setEntityIsEdit(_self._drawEntity);
  45215. _self._clearEvent(handler);
  45216. if (options2.onComplete)
  45217. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45218. });
  45219. });
  45220. },
  45221. _sketchDrawPoint(handler, options2) {
  45222. let _self = this;
  45223. this._registerLeftClickEvent(handler, function(event2) {
  45224. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45225. if (!Cesium.defined(loc2.sLocation))
  45226. return;
  45227. let entityParam = DrawPoint.initEditPropertyParams();
  45228. _self._pointObject.addPoint(loc2.sLocation, {
  45229. point: entityParam.point
  45230. }).then((entity) => {
  45231. _self._viewer.entities.add(entity);
  45232. _self._entities.push(entity.id);
  45233. entityParam = DrawPoint.initEditPropertyParams();
  45234. _self._drawEntity = entity;
  45235. _self._drawEntity.setParams(entityParam);
  45236. _self._drawEntity.setEntityType(DrawPoint.DrawType.Point);
  45237. _self._setEntityIsEdit(_self._drawEntity);
  45238. _self._clearEvent(handler);
  45239. if (options2.onComplete)
  45240. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45241. });
  45242. });
  45243. },
  45244. _sketchDrawPoint2Label(handler, options2) {
  45245. let _self = this;
  45246. this._registerLeftClickEvent(handler, function(event2) {
  45247. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45248. if (!Cesium.defined(loc2.sLocation))
  45249. return;
  45250. let entityParam = DrawPoint.initEditPropertyParams();
  45251. entityParam.label.font = entityParam.label.fontSize + "px " + entityParam.label.font;
  45252. entityParam.label.pixelOffset = {
  45253. x: entityParam.label.pixelOffsetX,
  45254. y: entityParam.label.pixelOffsetY - 10
  45255. };
  45256. _self._pointObject.addPoint(loc2.sLocation, {
  45257. point: entityParam.point,
  45258. label: entityParam.label
  45259. }).then((entity) => {
  45260. _self._viewer.entities.add(entity);
  45261. _self._entities.push(entity.id);
  45262. entityParam = DrawPoint.initEditPropertyParams();
  45263. entityParam.label.pixelOffsetY = -10;
  45264. _self._drawEntity = entity;
  45265. _self._drawEntity.setParams(entityParam);
  45266. _self._drawEntity.setEntityType(DrawPoint.DrawType.Point2Label);
  45267. _self._setEntityIsEdit(_self._drawEntity);
  45268. _self._clearEvent(handler);
  45269. if (options2.onComplete)
  45270. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45271. });
  45272. });
  45273. },
  45274. _sketchDrawBillboard(handler, options2) {
  45275. let _self = this;
  45276. this._registerLeftClickEvent(handler, function(event2) {
  45277. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45278. if (!Cesium.defined(loc2.sLocation))
  45279. return;
  45280. let entityParam = DrawPoint.initEditPropertyParams();
  45281. _self._pointObject.addBillboard(loc2.sLocation, {
  45282. billboard: entityParam.billboard
  45283. }).then((entity) => {
  45284. _self._viewer.entities.add(entity);
  45285. _self._entities.push(entity.id);
  45286. entityParam = DrawPoint.initEditPropertyParams();
  45287. entityParam.label.pixelOffsetY = -50;
  45288. _self._drawEntity = entity;
  45289. _self._drawEntity.setParams(entityParam);
  45290. _self._drawEntity.setEntityType(DrawPoint.DrawType.Billboard);
  45291. _self._setEntityIsEdit(_self._drawEntity);
  45292. _self._clearEvent(handler);
  45293. if (options2.onComplete)
  45294. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45295. });
  45296. });
  45297. },
  45298. _sketchDrawBillboard2Label(handler, options2) {
  45299. let _self = this;
  45300. this._registerLeftClickEvent(handler, function(event2) {
  45301. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45302. if (!Cesium.defined(loc2.sLocation))
  45303. return;
  45304. let entityParam = DrawPoint.initEditPropertyParams();
  45305. entityParam.label.font = entityParam.label.fontSize + "px " + entityParam.label.font;
  45306. entityParam.label.pixelOffset = {
  45307. x: entityParam.label.pixelOffsetX,
  45308. y: entityParam.label.pixelOffsetY - 50
  45309. };
  45310. _self._pointObject.addBillboard(loc2.sLocation, {
  45311. billboard: entityParam.billboard,
  45312. label: entityParam.label
  45313. }).then((entity) => {
  45314. _self._viewer.entities.add(entity);
  45315. _self._entities.push(entity.id);
  45316. entityParam = DrawPoint.initEditPropertyParams();
  45317. _self._drawEntity = entity;
  45318. _self._drawEntity.setParams(entityParam);
  45319. _self._drawEntity.setEntityType(DrawPoint.DrawType.Billboard2Label);
  45320. _self._setEntityIsEdit(_self._drawEntity);
  45321. _self._clearEvent(handler);
  45322. if (options2.onComplete)
  45323. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45324. });
  45325. });
  45326. },
  45327. _sketchDrawModel(handler, options2) {
  45328. let _self = this;
  45329. this._registerLeftClickEvent(handler, function(event2) {
  45330. let loc2 = _self._transfromFromScreenPoint(event2.position);
  45331. if (!Cesium.defined(loc2.sLocation))
  45332. return;
  45333. let entityParam = DrawPoint.initEditPropertyParams();
  45334. _self._pointObject.addModel(loc2.sLocation, {
  45335. model: entityParam.model
  45336. }).then((entity) => {
  45337. _self._viewer.entities.add(entity);
  45338. _self._entities.push(entity.id);
  45339. entityParam = DrawPoint.initEditPropertyParams();
  45340. _self._drawEntity = entity;
  45341. _self._drawEntity.setParams(entityParam);
  45342. _self._drawEntity.setEntityType(DrawPoint.DrawType.Model);
  45343. _self._setEntityIsEdit(_self._drawEntity);
  45344. _self._clearEvent(handler);
  45345. if (options2.onComplete)
  45346. options2.onComplete(loc2.sLocation, loc2.gLocation);
  45347. });
  45348. });
  45349. },
  45350. updateEditEntityProperty: function(params) {
  45351. if (this._editEntity === void 0)
  45352. return;
  45353. if (this._editEntity.getIsEdit() === void 0 || this._editEntity.getIsEdit() === false)
  45354. return;
  45355. let editEntityType = this._editEntity.getEntityType();
  45356. if (editEntityType === void 0)
  45357. return;
  45358. if (editEntityType === DrawPoint.DrawType.Label) {
  45359. this._updateLabelProperty(params);
  45360. } else if (editEntityType === DrawPoint.DrawType.Point) {
  45361. this._updatePointProperty(params);
  45362. } else if (editEntityType === DrawPoint.DrawType.Point2Label) {
  45363. this._updatePoint2LabelProperty(params);
  45364. } else if (editEntityType === DrawPoint.DrawType.Billboard) {
  45365. this._updateBillboardProperty(params);
  45366. } else if (editEntityType === DrawPoint.DrawType.Billboard2Label) {
  45367. this._updateBillboard2LabelProperty(params);
  45368. } else if (editEntityType === DrawPoint.DrawType.Model) {
  45369. this._updateModelProperty(params);
  45370. }
  45371. },
  45372. _updateLabelProperty(params) {
  45373. let label = params.label;
  45374. this._editEntity.label.text = label.text;
  45375. let font = "";
  45376. if (label.italic) {
  45377. font += "italic ";
  45378. }
  45379. if (label.bolder) {
  45380. font += " bolder ";
  45381. }
  45382. font += label.fontSize + "px " + label.font;
  45383. this._editEntity.label.font = font;
  45384. this._editEntity.label.fillColor = Cesium.Color.fromCssColorString(label.fillColor);
  45385. this._editEntity.label.outlineColor = Cesium.Color.fromCssColorString(label.outlineColor);
  45386. this._editEntity.label.outlineWidth = parseFloat(label.outlineWidth);
  45387. this._editEntity.label.showBackground = label.showBackground;
  45388. this._editEntity.label.backgroundColor = Cesium.Color.fromCssColorString(label.backgroundColor);
  45389. this._editEntity.label.backgroundPadding = new Cesium.Cartesian2(parseFloat(label.backgroundPadding), parseFloat(label.backgroundPadding));
  45390. this._editEntity.label.pixelOffset = new Cesium.Cartesian2(parseFloat(label.pixelOffsetX), parseFloat(label.pixelOffsetY));
  45391. this._editEntity.setParams(params);
  45392. },
  45393. _updatePointProperty(params) {
  45394. let point2 = params.point;
  45395. this._editEntity.point.color = Cesium.Color.fromCssColorString(point2.color);
  45396. this._editEntity.point.pixelSize = parseFloat(point2.pixelSize);
  45397. this._editEntity.point.outlineColor = Cesium.Color.fromCssColorString(point2.outlineColor);
  45398. this._editEntity.point.outlineWidth = parseFloat(point2.outlineWidth);
  45399. this._editEntity.setParams(params);
  45400. },
  45401. _updatePoint2LabelProperty(params) {
  45402. let label = params.label;
  45403. this._editEntity.label.text = label.text;
  45404. let font = "";
  45405. if (label.italic) {
  45406. font += "italic ";
  45407. }
  45408. if (label.bolder) {
  45409. font += " bolder ";
  45410. }
  45411. font += label.fontSize + "px " + label.font;
  45412. this._editEntity.label.font = font;
  45413. this._editEntity.label.fillColor = Cesium.Color.fromCssColorString(label.fillColor);
  45414. this._editEntity.label.outlineColor = Cesium.Color.fromCssColorString(label.outlineColor);
  45415. this._editEntity.label.outlineWidth = parseFloat(label.outlineWidth);
  45416. this._editEntity.label.showBackground = label.showBackground;
  45417. this._editEntity.label.backgroundColor = Cesium.Color.fromCssColorString(label.backgroundColor);
  45418. this._editEntity.label.backgroundPadding = new Cesium.Cartesian2(parseFloat(label.backgroundPadding), parseFloat(label.backgroundPadding));
  45419. let point2 = params.point;
  45420. this._editEntity.point.color = Cesium.Color.fromCssColorString(point2.color);
  45421. this._editEntity.point.pixelSize = parseFloat(point2.pixelSize);
  45422. this._editEntity.point.outlineColor = Cesium.Color.fromCssColorString(point2.outlineColor);
  45423. this._editEntity.point.outlineWidth = parseFloat(point2.outlineWidth);
  45424. this._editEntity.setParams(params);
  45425. },
  45426. _updateBillboardProperty(params) {
  45427. let billboard = params.billboard;
  45428. this._editEntity.billboard.image = billboard.imgUrl;
  45429. this._editEntity.billboard.scale = billboard.scale;
  45430. this._editEntity.setParams(params);
  45431. },
  45432. _updateBillboard2LabelProperty(params) {
  45433. let label = params.label;
  45434. this._editEntity.label.text = label.text;
  45435. let font = "";
  45436. if (label.italic) {
  45437. font += "italic ";
  45438. }
  45439. if (label.bolder) {
  45440. font += " bolder ";
  45441. }
  45442. font += label.fontSize + "px " + label.font;
  45443. this._editEntity.label.font = font;
  45444. this._editEntity.label.fillColor = Cesium.Color.fromCssColorString(label.fillColor);
  45445. this._editEntity.label.outlineColor = Cesium.Color.fromCssColorString(label.outlineColor);
  45446. this._editEntity.label.outlineWidth = parseFloat(label.outlineWidth);
  45447. this._editEntity.label.showBackground = label.showBackground;
  45448. this._editEntity.label.backgroundColor = Cesium.Color.fromCssColorString(label.backgroundColor);
  45449. this._editEntity.label.backgroundPadding = new Cesium.Cartesian2(parseFloat(label.backgroundPadding), parseFloat(label.backgroundPadding));
  45450. this._editEntity.label.pixelOffset = new Cesium.Cartesian2(parseFloat(label.pixelOffsetX), parseFloat(label.pixelOffsetY));
  45451. let billboard = params.billboard;
  45452. this._editEntity.billboard.image = billboard.imgUrl;
  45453. this._editEntity.billboard.scale = billboard.scale;
  45454. this._editEntity.setParams(params);
  45455. }
  45456. });
  45457. Object.assign(DrawPoint.prototype, {
  45458. _setEntityIsEdit(entity) {
  45459. let _self = this;
  45460. this._unActivateEdit();
  45461. entity.setIsEdit(true);
  45462. this._sendShowPropertyDialog(entity);
  45463. let handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  45464. this._registerLeftClickEvent(handler, function(event2) {
  45465. _self._unActivateEdit();
  45466. let feature2 = _self._viewer.scene.pick(event2.position);
  45467. if (feature2 !== void 0 && feature2.id instanceof Cesium.Entity) {
  45468. let editEntityType = feature2.id.getEntityType();
  45469. if (editEntityType === DrawPoint.DrawType.Label || editEntityType === DrawPoint.DrawType.Point || editEntityType === DrawPoint.DrawType.Point2Label || editEntityType === DrawPoint.DrawType.Billboard || editEntityType === DrawPoint.DrawType.Billboard2Label || editEntityType === DrawPoint.DrawType.Model) {
  45470. feature2.id.setIsEdit(true);
  45471. _self._sendShowPropertyDialog(feature2.id);
  45472. }
  45473. }
  45474. });
  45475. this._registerMouseMoveEvent(handler, function(event2) {
  45476. let toolTip = "\u5355\u51FB\u4FEE\u6539\u5C5E\u6027\uFF0C\u5355\u51FB\u62D6\u52A8\u4FEE\u6539\u4F4D\u7F6E";
  45477. let feature2 = _self._viewer.scene.pick(event2.endPosition);
  45478. if (feature2 !== void 0 && feature2.id instanceof Cesium.Entity) {
  45479. let editEntityType = feature2.id.getEntityType();
  45480. if (editEntityType === DrawPoint.DrawType.Label || editEntityType === DrawPoint.DrawType.Point || editEntityType === DrawPoint.DrawType.Point2Label || editEntityType === DrawPoint.DrawType.Billboard || editEntityType === DrawPoint.DrawType.Billboard2Label || editEntityType === DrawPoint.DrawType.Model) {
  45481. if (feature2.id.getIsEdit()) {
  45482. toolTip = "\u5355\u51FB\u4FEE\u6539\u5C5E\u6027\uFF0C\u5355\u51FB\u62D6\u52A8\u4FEE\u6539\u4F4D\u7F6E";
  45483. CreateRemindertip(toolTip, event2.endPosition, true);
  45484. } else {
  45485. toolTip = "\u5355\u51FB\u4FEE\u6539\u5C5E\u6027";
  45486. CreateRemindertip(toolTip, event2.endPosition, true);
  45487. }
  45488. }
  45489. } else {
  45490. CreateRemindertip(toolTip, event2.endPosition, false);
  45491. }
  45492. });
  45493. },
  45494. _unActivateEdit: function() {
  45495. if (this._sketchEditHandler != void 0) {
  45496. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOWN);
  45497. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP);
  45498. this._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  45499. }
  45500. this._editEntity = void 0;
  45501. for (var i2 = 0; i2 < this._entities.length; i2++) {
  45502. var getById = this._viewer.entities.getById(this._entities[i2]);
  45503. if (getById) {
  45504. getById.setIsEdit(false);
  45505. }
  45506. }
  45507. this._closePropertyEditDialog();
  45508. },
  45509. _sendShowPropertyDialog(entity) {
  45510. let _self = this;
  45511. let editEntityType = entity.getEntityType();
  45512. if (entity.getIsEdit() === void 0 || entity.getIsEdit() === false || editEntityType === void 0) {
  45513. this._unActivateEdit();
  45514. return;
  45515. }
  45516. let editProperty = entity.getParams();
  45517. if (editProperty !== void 0 && this.onEditProperty !== void 0) {
  45518. editProperty.id = editEntityType;
  45519. _self._openPropertyEditDialog(
  45520. editProperty,
  45521. function(params) {
  45522. _self.updateEditEntityProperty(params);
  45523. },
  45524. function() {
  45525. _self._viewer.entities.remove(entity);
  45526. _self._editEntity = void 0;
  45527. }
  45528. );
  45529. }
  45530. this._activeteNormalEdit(entity);
  45531. },
  45532. _activeteNormalEdit: function(editEntity) {
  45533. let _self = this;
  45534. editEntity.getEntityType();
  45535. this._editEntity = editEntity;
  45536. if (this._sketchEditHandler === void 0) {
  45537. this._sketchEditHandler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  45538. }
  45539. this._registerLeftDownEvent(this._sketchEditHandler, function(event2) {
  45540. const pickInfo = _self._viewer.scene.pick(event2.position);
  45541. console.log(pickInfo);
  45542. if (!pickInfo) {
  45543. return;
  45544. }
  45545. console.log("\u6309\u4E0B");
  45546. _self._viewer.scene.screenSpaceCameraController.enableRotate = false;
  45547. _self._registerMouseMoveEvent(_self._sketchEditHandler, function(event3) {
  45548. console.log("\u79FB\u52A8");
  45549. const position2 = event3.endPosition;
  45550. const cartesian = _self._viewer.scene.globe.pick(_self._viewer.camera.getPickRay(position2), _self._viewer.scene);
  45551. const selectedEntity = _self._editEntity;
  45552. if (!selectedEntity) {
  45553. return false;
  45554. }
  45555. selectedEntity.position = cartesian;
  45556. });
  45557. _self._registerLeftUpEvent(_self._sketchEditHandler, function(event3) {
  45558. _self._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  45559. _self._sketchEditHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_UP);
  45560. _self._viewer.scene.screenSpaceCameraController.enableRotate = true;
  45561. console.log("\u62AC\u8D77");
  45562. });
  45563. });
  45564. },
  45565. _updateModelProperty(params) {
  45566. let model = params.model;
  45567. this._editEntity.model.uri = model.url;
  45568. this._editEntity.model.color = Cesium.Color.WHITE.withAlpha(model.alpha);
  45569. this._editEntity.model.minimumPixelSize = model.minimumPixelSize;
  45570. this._editEntity.model.maximumScale = model.maximumScale;
  45571. this._editEntity.model.silhouetteSize = model.silhouetteSize;
  45572. this._editEntity.model.silhouetteColor = new Cesium.Color.fromCssColorString(model.silhouetteColor);
  45573. var heading = Cesium.Math.toRadians(model.heading);
  45574. var pitch = model.pitch;
  45575. var roll = model.roll;
  45576. new Cesium.HeadingPitchRoll(heading, pitch, roll);
  45577. this._editEntity.setParams(params);
  45578. }
  45579. });
  45580. Object.assign(DrawPoint.prototype, {
  45581. _openPropertyEditDialog: function(params, callEdit, callRemove) {
  45582. this._editPropertyDialogDomId = "dialog-property-dom-point";
  45583. this._registerDOMPropertyEdit = "dialog-edit-property-point";
  45584. let PropertyEditComponent = customElements.get(this._registerDOMPropertyEdit);
  45585. if (PropertyEditComponent === void 0) {
  45586. PropertyEditComponent = defineCustomElement(DialogEditProperty);
  45587. customElements.define(this._registerDOMPropertyEdit, PropertyEditComponent);
  45588. }
  45589. this._closePropertyEditDialog();
  45590. let dialogPropertyElement = new PropertyEditComponent({
  45591. params
  45592. });
  45593. dialogPropertyElement.id = this._editPropertyDialogDomId;
  45594. dialogPropertyElement.showDialog = true;
  45595. document.body.appendChild(dialogPropertyElement);
  45596. dialogPropertyElement.addEventListener(
  45597. "submit",
  45598. (e) => {
  45599. if (callEdit)
  45600. callEdit(e.detail[0]);
  45601. },
  45602. false
  45603. );
  45604. dialogPropertyElement.addEventListener(
  45605. "remove",
  45606. (e) => {
  45607. if (callRemove)
  45608. callRemove();
  45609. },
  45610. false
  45611. );
  45612. },
  45613. _closePropertyEditDialog() {
  45614. let dom2 = document.getElementById(this._editPropertyDialogDomId);
  45615. if (dom2 !== null && dom2 !== void 0) {
  45616. document.body.removeChild(dom2);
  45617. }
  45618. }
  45619. });
  45620. DrawPoint.DrawType = Object.freeze({
  45621. Model: "model",
  45622. Label: "label",
  45623. Point: "point",
  45624. Point2Label: "point2Label",
  45625. Billboard: "billboard",
  45626. Billboard2Label: "billboard2Label"
  45627. });
  45628. var MultiFieldAdaptWindow$1 = "";
  45629. class MultiFieldAdaptWindow {
  45630. constructor(viewer2, position2, title, properties, offsetHeight) {
  45631. if (!viewer2)
  45632. throw new Cesium.DeveloperError("no viewer object!");
  45633. if (!position2)
  45634. throw new Cesium.DeveloperError("no position object!");
  45635. this.viewer = viewer2;
  45636. this.position = position2;
  45637. this.offsetHeight = offsetHeight;
  45638. if (position2 instanceof Cesium.Cartesian3) {
  45639. this.position = position2;
  45640. } else {
  45641. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  45642. }
  45643. if (document.getElementsByClassName("MultiField-popup").length > 0) {
  45644. document.getElementsByClassName("MultiField-popup")[0].remove();
  45645. viewer2.entities.remove(viewer2.entities.getById("MultiFieldPopupPoint"));
  45646. }
  45647. this.id = "popup_" + getGuid();
  45648. this.popupDiv = document.createElement("div");
  45649. this.popupDiv.classList.add("MultiField-popup");
  45650. this.popupDiv.id = this.id;
  45651. this.viewer.container.append(this.popupDiv);
  45652. this.popupDiv.innerHTML = this._createHtml(title, properties);
  45653. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  45654. this.initPoint();
  45655. document.getElementsByClassName("leaflet-popup-close-button")[0].onclick = () => {
  45656. this.close();
  45657. };
  45658. }
  45659. postRender() {
  45660. this.viewer.scene.canvas.height;
  45661. const windowPosition = new Cesium.Cartesian2();
  45662. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  45663. this.viewer.scene,
  45664. this.position,
  45665. windowPosition
  45666. );
  45667. let elWidth = this.popupDiv.offsetWidth;
  45668. let elHeight = this.popupDiv.offsetHeight;
  45669. if (!!this.offsetHeight) {
  45670. elHeight += this.offsetHeight;
  45671. }
  45672. this.popupDiv.style.left = windowPosition.x - elWidth / 2 + "px";
  45673. this.popupDiv.style.top = windowPosition.y - elHeight + "px";
  45674. const camerPosition = this.viewer.camera.position;
  45675. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  45676. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  45677. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  45678. this.popupDiv.style.display = "block";
  45679. } else {
  45680. this.popupDiv.style.display = "none";
  45681. }
  45682. }
  45683. _createHtml(header, content) {
  45684. let html = `
  45685. <div class="MultiField-popup-header">
  45686. ` + header + `
  45687. <span class="leaflet-popup-close-button">\xD7</span>
  45688. </div>
  45689. <div class="MultiField-popup-content">
  45690. ` + this._createTable(content) + `
  45691. </div>
  45692. <div class="MultiField-popup-tip">
  45693. </div>
  45694. `;
  45695. return html;
  45696. }
  45697. _createTable(content) {
  45698. let html = '<table class="table-popup">';
  45699. for (let key in content) {
  45700. html += `<tr><td class="title-popup">${key}</td>
  45701. <td class="value-popup">${content[key]}</td></tr>`;
  45702. }
  45703. html += "</table>";
  45704. return html;
  45705. }
  45706. initPoint() {
  45707. this.billboard = new Cesium.Entity({
  45708. id: "MultiFieldPopupPoint",
  45709. name: "popupPoint",
  45710. position: this.position,
  45711. billboard: {
  45712. image: "jt3dSDK/imgs/point/point.png",
  45713. horizontalOrigin: Cesium.HorizontalOrigin.center,
  45714. verticalOrigin: Cesium.VerticalOrigin.bottom,
  45715. scale: 1,
  45716. pixelOffset: new Cesium.Cartesian2(0, 0),
  45717. disableDepthTestDistance: Number.POSITIVE_INFINITY
  45718. }
  45719. });
  45720. this.viewer.entities.add(this.billboard);
  45721. }
  45722. }
  45723. Object.assign(MultiFieldAdaptWindow.prototype, {
  45724. close() {
  45725. this.popupDiv.remove();
  45726. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  45727. this.viewer.entities.remove(this.billboard);
  45728. }
  45729. });
  45730. var win;
  45731. if (typeof window !== "undefined") {
  45732. win = window;
  45733. } else if (typeof commonjsGlobal !== "undefined") {
  45734. win = commonjsGlobal;
  45735. } else if (typeof self !== "undefined") {
  45736. win = self;
  45737. } else {
  45738. win = {};
  45739. }
  45740. var window_1 = win;
  45741. var __viteBrowserExternal = {};
  45742. var __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  45743. __proto__: null,
  45744. "default": __viteBrowserExternal
  45745. }, Symbol.toStringTag, { value: "Module" }));
  45746. var require$$0 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);
  45747. var topLevel = typeof commonjsGlobal !== "undefined" ? commonjsGlobal : typeof window !== "undefined" ? window : {};
  45748. var minDoc = require$$0;
  45749. var doccy;
  45750. if (typeof document !== "undefined") {
  45751. doccy = document;
  45752. } else {
  45753. doccy = topLevel["__GLOBAL_DOCUMENT_CACHE@4"];
  45754. if (!doccy) {
  45755. doccy = topLevel["__GLOBAL_DOCUMENT_CACHE@4"] = minDoc;
  45756. }
  45757. }
  45758. var document_1 = doccy;
  45759. var keycode$1 = { exports: {} };
  45760. (function(module2, exports2) {
  45761. function keyCode(searchInput) {
  45762. if (searchInput && "object" === typeof searchInput) {
  45763. var hasKeyCode = searchInput.which || searchInput.keyCode || searchInput.charCode;
  45764. if (hasKeyCode)
  45765. searchInput = hasKeyCode;
  45766. }
  45767. if ("number" === typeof searchInput)
  45768. return names2[searchInput];
  45769. var search = String(searchInput);
  45770. var foundNamedKey = codes[search.toLowerCase()];
  45771. if (foundNamedKey)
  45772. return foundNamedKey;
  45773. var foundNamedKey = aliases[search.toLowerCase()];
  45774. if (foundNamedKey)
  45775. return foundNamedKey;
  45776. if (search.length === 1)
  45777. return search.charCodeAt(0);
  45778. return void 0;
  45779. }
  45780. keyCode.isEventKey = function isEventKey(event2, nameOrCode) {
  45781. if (event2 && "object" === typeof event2) {
  45782. var keyCode2 = event2.which || event2.keyCode || event2.charCode;
  45783. if (keyCode2 === null || keyCode2 === void 0) {
  45784. return false;
  45785. }
  45786. if (typeof nameOrCode === "string") {
  45787. var foundNamedKey = codes[nameOrCode.toLowerCase()];
  45788. if (foundNamedKey) {
  45789. return foundNamedKey === keyCode2;
  45790. }
  45791. var foundNamedKey = aliases[nameOrCode.toLowerCase()];
  45792. if (foundNamedKey) {
  45793. return foundNamedKey === keyCode2;
  45794. }
  45795. } else if (typeof nameOrCode === "number") {
  45796. return nameOrCode === keyCode2;
  45797. }
  45798. return false;
  45799. }
  45800. };
  45801. exports2 = module2.exports = keyCode;
  45802. var codes = exports2.code = exports2.codes = {
  45803. "backspace": 8,
  45804. "tab": 9,
  45805. "enter": 13,
  45806. "shift": 16,
  45807. "ctrl": 17,
  45808. "alt": 18,
  45809. "pause/break": 19,
  45810. "caps lock": 20,
  45811. "esc": 27,
  45812. "space": 32,
  45813. "page up": 33,
  45814. "page down": 34,
  45815. "end": 35,
  45816. "home": 36,
  45817. "left": 37,
  45818. "up": 38,
  45819. "right": 39,
  45820. "down": 40,
  45821. "insert": 45,
  45822. "delete": 46,
  45823. "command": 91,
  45824. "left command": 91,
  45825. "right command": 93,
  45826. "numpad *": 106,
  45827. "numpad +": 107,
  45828. "numpad -": 109,
  45829. "numpad .": 110,
  45830. "numpad /": 111,
  45831. "num lock": 144,
  45832. "scroll lock": 145,
  45833. "my computer": 182,
  45834. "my calculator": 183,
  45835. ";": 186,
  45836. "=": 187,
  45837. ",": 188,
  45838. "-": 189,
  45839. ".": 190,
  45840. "/": 191,
  45841. "`": 192,
  45842. "[": 219,
  45843. "\\": 220,
  45844. "]": 221,
  45845. "'": 222
  45846. };
  45847. var aliases = exports2.aliases = {
  45848. "windows": 91,
  45849. "\u21E7": 16,
  45850. "\u2325": 18,
  45851. "\u2303": 17,
  45852. "\u2318": 91,
  45853. "ctl": 17,
  45854. "control": 17,
  45855. "option": 18,
  45856. "pause": 19,
  45857. "break": 19,
  45858. "caps": 20,
  45859. "return": 13,
  45860. "escape": 27,
  45861. "spc": 32,
  45862. "spacebar": 32,
  45863. "pgup": 33,
  45864. "pgdn": 34,
  45865. "ins": 45,
  45866. "del": 46,
  45867. "cmd": 91
  45868. };
  45869. /*!
  45870. * Programatically add the following
  45871. */
  45872. for (i2 = 97; i2 < 123; i2++)
  45873. codes[String.fromCharCode(i2)] = i2 - 32;
  45874. for (var i2 = 48; i2 < 58; i2++)
  45875. codes[i2 - 48] = i2;
  45876. for (i2 = 1; i2 < 13; i2++)
  45877. codes["f" + i2] = i2 + 111;
  45878. for (i2 = 0; i2 < 10; i2++)
  45879. codes["numpad " + i2] = i2 + 96;
  45880. var names2 = exports2.names = exports2.title = {};
  45881. for (i2 in codes)
  45882. names2[codes[i2]] = i2;
  45883. for (var alias in aliases) {
  45884. codes[alias] = aliases[alias];
  45885. }
  45886. })(keycode$1, keycode$1.exports);
  45887. var keycode = keycode$1.exports;
  45888. var tuple = SafeParseTuple;
  45889. function SafeParseTuple(obj, reviver) {
  45890. var json;
  45891. var error = null;
  45892. try {
  45893. json = JSON.parse(obj, reviver);
  45894. } catch (err) {
  45895. error = err;
  45896. }
  45897. return [error, json];
  45898. }
  45899. var lib = { exports: {} };
  45900. function _extends$2() {
  45901. _extends$2 = Object.assign ? Object.assign.bind() : function(target) {
  45902. for (var i2 = 1; i2 < arguments.length; i2++) {
  45903. var source = arguments[i2];
  45904. for (var key in source) {
  45905. if (Object.prototype.hasOwnProperty.call(source, key)) {
  45906. target[key] = source[key];
  45907. }
  45908. }
  45909. }
  45910. return target;
  45911. };
  45912. return _extends$2.apply(this, arguments);
  45913. }
  45914. var _extends$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  45915. __proto__: null,
  45916. "default": _extends$2
  45917. }, Symbol.toStringTag, { value: "Module" }));
  45918. var require$$1 = /* @__PURE__ */ getAugmentedNamespace(_extends$3);
  45919. var isFunction_1 = isFunction$1;
  45920. var toString$2 = Object.prototype.toString;
  45921. function isFunction$1(fn2) {
  45922. if (!fn2) {
  45923. return false;
  45924. }
  45925. var string = toString$2.call(fn2);
  45926. return string === "[object Function]" || typeof fn2 === "function" && string !== "[object RegExp]" || typeof window !== "undefined" && (fn2 === window.setTimeout || fn2 === window.alert || fn2 === window.confirm || fn2 === window.prompt);
  45927. }
  45928. var window$3 = window_1;
  45929. var httpResponseHandler = function httpResponseHandler2(callback2, decodeResponseBody) {
  45930. if (decodeResponseBody === void 0) {
  45931. decodeResponseBody = false;
  45932. }
  45933. return function(err, response, responseBody) {
  45934. if (err) {
  45935. callback2(err);
  45936. return;
  45937. }
  45938. if (response.statusCode >= 400 && response.statusCode <= 599) {
  45939. var cause = responseBody;
  45940. if (decodeResponseBody) {
  45941. if (window$3.TextDecoder) {
  45942. var charset = getCharset(response.headers && response.headers["content-type"]);
  45943. try {
  45944. cause = new TextDecoder(charset).decode(responseBody);
  45945. } catch (e) {
  45946. }
  45947. } else {
  45948. cause = String.fromCharCode.apply(null, new Uint8Array(responseBody));
  45949. }
  45950. }
  45951. callback2({
  45952. cause
  45953. });
  45954. return;
  45955. }
  45956. callback2(null, responseBody);
  45957. };
  45958. };
  45959. function getCharset(contentTypeHeader) {
  45960. if (contentTypeHeader === void 0) {
  45961. contentTypeHeader = "";
  45962. }
  45963. return contentTypeHeader.toLowerCase().split(";").reduce(function(charset, contentType) {
  45964. var _contentType$split = contentType.split("="), type2 = _contentType$split[0], value = _contentType$split[1];
  45965. if (type2.trim() === "charset") {
  45966. return value.trim();
  45967. }
  45968. return charset;
  45969. }, "utf-8");
  45970. }
  45971. var httpHandler = httpResponseHandler;
  45972. var window$2 = window_1;
  45973. var _extends$1 = require$$1;
  45974. var isFunction = isFunction_1;
  45975. createXHR.httpHandler = httpHandler;
  45976. /**
  45977. * @license
  45978. * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
  45979. * Copyright (c) 2014 David Björklund
  45980. * Available under the MIT license
  45981. * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
  45982. */
  45983. var parseHeaders = function parseHeaders2(headers) {
  45984. var result = {};
  45985. if (!headers) {
  45986. return result;
  45987. }
  45988. headers.trim().split("\n").forEach(function(row) {
  45989. var index2 = row.indexOf(":");
  45990. var key = row.slice(0, index2).trim().toLowerCase();
  45991. var value = row.slice(index2 + 1).trim();
  45992. if (typeof result[key] === "undefined") {
  45993. result[key] = value;
  45994. } else if (Array.isArray(result[key])) {
  45995. result[key].push(value);
  45996. } else {
  45997. result[key] = [result[key], value];
  45998. }
  45999. });
  46000. return result;
  46001. };
  46002. lib.exports = createXHR;
  46003. lib.exports.default = createXHR;
  46004. createXHR.XMLHttpRequest = window$2.XMLHttpRequest || noop$2;
  46005. createXHR.XDomainRequest = "withCredentials" in new createXHR.XMLHttpRequest() ? createXHR.XMLHttpRequest : window$2.XDomainRequest;
  46006. forEachArray(["get", "put", "post", "patch", "head", "delete"], function(method) {
  46007. createXHR[method === "delete" ? "del" : method] = function(uri, options2, callback2) {
  46008. options2 = initParams(uri, options2, callback2);
  46009. options2.method = method.toUpperCase();
  46010. return _createXHR(options2);
  46011. };
  46012. });
  46013. function forEachArray(array, iterator) {
  46014. for (var i2 = 0; i2 < array.length; i2++) {
  46015. iterator(array[i2]);
  46016. }
  46017. }
  46018. function isEmpty(obj) {
  46019. for (var i2 in obj) {
  46020. if (obj.hasOwnProperty(i2))
  46021. return false;
  46022. }
  46023. return true;
  46024. }
  46025. function initParams(uri, options2, callback2) {
  46026. var params = uri;
  46027. if (isFunction(options2)) {
  46028. callback2 = options2;
  46029. if (typeof uri === "string") {
  46030. params = {
  46031. uri
  46032. };
  46033. }
  46034. } else {
  46035. params = _extends$1({}, options2, {
  46036. uri
  46037. });
  46038. }
  46039. params.callback = callback2;
  46040. return params;
  46041. }
  46042. function createXHR(uri, options2, callback2) {
  46043. options2 = initParams(uri, options2, callback2);
  46044. return _createXHR(options2);
  46045. }
  46046. function _createXHR(options2) {
  46047. if (typeof options2.callback === "undefined") {
  46048. throw new Error("callback argument missing");
  46049. }
  46050. var called = false;
  46051. var callback2 = function cbOnce(err, response, body2) {
  46052. if (!called) {
  46053. called = true;
  46054. options2.callback(err, response, body2);
  46055. }
  46056. };
  46057. function readystatechange() {
  46058. if (xhr.readyState === 4) {
  46059. setTimeout(loadFunc, 0);
  46060. }
  46061. }
  46062. function getBody() {
  46063. var body2 = void 0;
  46064. if (xhr.response) {
  46065. body2 = xhr.response;
  46066. } else {
  46067. body2 = xhr.responseText || getXml(xhr);
  46068. }
  46069. if (isJson) {
  46070. try {
  46071. body2 = JSON.parse(body2);
  46072. } catch (e) {
  46073. }
  46074. }
  46075. return body2;
  46076. }
  46077. function errorFunc(evt) {
  46078. clearTimeout(timeoutTimer);
  46079. if (!(evt instanceof Error)) {
  46080. evt = new Error("" + (evt || "Unknown XMLHttpRequest Error"));
  46081. }
  46082. evt.statusCode = 0;
  46083. return callback2(evt, failureResponse);
  46084. }
  46085. function loadFunc() {
  46086. if (aborted)
  46087. return;
  46088. var status;
  46089. clearTimeout(timeoutTimer);
  46090. if (options2.useXDR && xhr.status === void 0) {
  46091. status = 200;
  46092. } else {
  46093. status = xhr.status === 1223 ? 204 : xhr.status;
  46094. }
  46095. var response = failureResponse;
  46096. var err = null;
  46097. if (status !== 0) {
  46098. response = {
  46099. body: getBody(),
  46100. statusCode: status,
  46101. method,
  46102. headers: {},
  46103. url: uri,
  46104. rawRequest: xhr
  46105. };
  46106. if (xhr.getAllResponseHeaders) {
  46107. response.headers = parseHeaders(xhr.getAllResponseHeaders());
  46108. }
  46109. } else {
  46110. err = new Error("Internal XMLHttpRequest Error");
  46111. }
  46112. return callback2(err, response, response.body);
  46113. }
  46114. var xhr = options2.xhr || null;
  46115. if (!xhr) {
  46116. if (options2.cors || options2.useXDR) {
  46117. xhr = new createXHR.XDomainRequest();
  46118. } else {
  46119. xhr = new createXHR.XMLHttpRequest();
  46120. }
  46121. }
  46122. var key;
  46123. var aborted;
  46124. var uri = xhr.url = options2.uri || options2.url;
  46125. var method = xhr.method = options2.method || "GET";
  46126. var body = options2.body || options2.data;
  46127. var headers = xhr.headers = options2.headers || {};
  46128. var sync = !!options2.sync;
  46129. var isJson = false;
  46130. var timeoutTimer;
  46131. var failureResponse = {
  46132. body: void 0,
  46133. headers: {},
  46134. statusCode: 0,
  46135. method,
  46136. url: uri,
  46137. rawRequest: xhr
  46138. };
  46139. if ("json" in options2 && options2.json !== false) {
  46140. isJson = true;
  46141. headers["accept"] || headers["Accept"] || (headers["Accept"] = "application/json");
  46142. if (method !== "GET" && method !== "HEAD") {
  46143. headers["content-type"] || headers["Content-Type"] || (headers["Content-Type"] = "application/json");
  46144. body = JSON.stringify(options2.json === true ? body : options2.json);
  46145. }
  46146. }
  46147. xhr.onreadystatechange = readystatechange;
  46148. xhr.onload = loadFunc;
  46149. xhr.onerror = errorFunc;
  46150. xhr.onprogress = function() {
  46151. };
  46152. xhr.onabort = function() {
  46153. aborted = true;
  46154. };
  46155. xhr.ontimeout = errorFunc;
  46156. xhr.open(method, uri, !sync, options2.username, options2.password);
  46157. if (!sync) {
  46158. xhr.withCredentials = !!options2.withCredentials;
  46159. }
  46160. if (!sync && options2.timeout > 0) {
  46161. timeoutTimer = setTimeout(function() {
  46162. if (aborted)
  46163. return;
  46164. aborted = true;
  46165. xhr.abort("timeout");
  46166. var e = new Error("XMLHttpRequest timeout");
  46167. e.code = "ETIMEDOUT";
  46168. errorFunc(e);
  46169. }, options2.timeout);
  46170. }
  46171. if (xhr.setRequestHeader) {
  46172. for (key in headers) {
  46173. if (headers.hasOwnProperty(key)) {
  46174. xhr.setRequestHeader(key, headers[key]);
  46175. }
  46176. }
  46177. } else if (options2.headers && !isEmpty(options2.headers)) {
  46178. throw new Error("Headers cannot be set on an XDomainRequest object");
  46179. }
  46180. if ("responseType" in options2) {
  46181. xhr.responseType = options2.responseType;
  46182. }
  46183. if ("beforeSend" in options2 && typeof options2.beforeSend === "function") {
  46184. options2.beforeSend(xhr);
  46185. }
  46186. xhr.send(body || null);
  46187. return xhr;
  46188. }
  46189. function getXml(xhr) {
  46190. try {
  46191. if (xhr.responseType === "document") {
  46192. return xhr.responseXML;
  46193. }
  46194. var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === "parsererror";
  46195. if (xhr.responseType === "" && !firefoxBugTakenEffect) {
  46196. return xhr.responseXML;
  46197. }
  46198. } catch (e) {
  46199. }
  46200. return null;
  46201. }
  46202. function noop$2() {
  46203. }
  46204. var XHR = lib.exports;
  46205. var browserIndex = { exports: {} };
  46206. var document$1 = document_1;
  46207. var _objCreate = Object.create || function() {
  46208. function F() {
  46209. }
  46210. return function(o) {
  46211. if (arguments.length !== 1) {
  46212. throw new Error("Object.create shim only accepts one parameter.");
  46213. }
  46214. F.prototype = o;
  46215. return new F();
  46216. };
  46217. }();
  46218. function ParsingError(errorData, message) {
  46219. this.name = "ParsingError";
  46220. this.code = errorData.code;
  46221. this.message = message || errorData.message;
  46222. }
  46223. ParsingError.prototype = _objCreate(Error.prototype);
  46224. ParsingError.prototype.constructor = ParsingError;
  46225. ParsingError.Errors = {
  46226. BadSignature: {
  46227. code: 0,
  46228. message: "Malformed WebVTT signature."
  46229. },
  46230. BadTimeStamp: {
  46231. code: 1,
  46232. message: "Malformed time stamp."
  46233. }
  46234. };
  46235. function parseTimeStamp(input) {
  46236. function computeSeconds(h2, m2, s, f) {
  46237. return (h2 | 0) * 3600 + (m2 | 0) * 60 + (s | 0) + (f | 0) / 1e3;
  46238. }
  46239. var m = input.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);
  46240. if (!m) {
  46241. return null;
  46242. }
  46243. if (m[3]) {
  46244. return computeSeconds(m[1], m[2], m[3].replace(":", ""), m[4]);
  46245. } else if (m[1] > 59) {
  46246. return computeSeconds(m[1], m[2], 0, m[4]);
  46247. } else {
  46248. return computeSeconds(0, m[1], m[2], m[4]);
  46249. }
  46250. }
  46251. function Settings() {
  46252. this.values = _objCreate(null);
  46253. }
  46254. Settings.prototype = {
  46255. set: function(k, v) {
  46256. if (!this.get(k) && v !== "") {
  46257. this.values[k] = v;
  46258. }
  46259. },
  46260. get: function(k, dflt, defaultKey) {
  46261. if (defaultKey) {
  46262. return this.has(k) ? this.values[k] : dflt[defaultKey];
  46263. }
  46264. return this.has(k) ? this.values[k] : dflt;
  46265. },
  46266. has: function(k) {
  46267. return k in this.values;
  46268. },
  46269. alt: function(k, v, a) {
  46270. for (var n = 0; n < a.length; ++n) {
  46271. if (v === a[n]) {
  46272. this.set(k, v);
  46273. break;
  46274. }
  46275. }
  46276. },
  46277. integer: function(k, v) {
  46278. if (/^-?\d+$/.test(v)) {
  46279. this.set(k, parseInt(v, 10));
  46280. }
  46281. },
  46282. percent: function(k, v) {
  46283. if (v.match(/^([\d]{1,3})(\.[\d]*)?%$/)) {
  46284. v = parseFloat(v);
  46285. if (v >= 0 && v <= 100) {
  46286. this.set(k, v);
  46287. return true;
  46288. }
  46289. }
  46290. return false;
  46291. }
  46292. };
  46293. function parseOptions(input, callback2, keyValueDelim, groupDelim) {
  46294. var groups = groupDelim ? input.split(groupDelim) : [input];
  46295. for (var i2 in groups) {
  46296. if (typeof groups[i2] !== "string") {
  46297. continue;
  46298. }
  46299. var kv = groups[i2].split(keyValueDelim);
  46300. if (kv.length !== 2) {
  46301. continue;
  46302. }
  46303. var k = kv[0].trim();
  46304. var v = kv[1].trim();
  46305. callback2(k, v);
  46306. }
  46307. }
  46308. function parseCue(input, cue, regionList) {
  46309. var oInput = input;
  46310. function consumeTimeStamp() {
  46311. var ts3 = parseTimeStamp(input);
  46312. if (ts3 === null) {
  46313. throw new ParsingError(
  46314. ParsingError.Errors.BadTimeStamp,
  46315. "Malformed timestamp: " + oInput
  46316. );
  46317. }
  46318. input = input.replace(/^[^\sa-zA-Z-]+/, "");
  46319. return ts3;
  46320. }
  46321. function consumeCueSettings(input2, cue2) {
  46322. var settings = new Settings();
  46323. parseOptions(input2, function(k, v) {
  46324. switch (k) {
  46325. case "region":
  46326. for (var i2 = regionList.length - 1; i2 >= 0; i2--) {
  46327. if (regionList[i2].id === v) {
  46328. settings.set(k, regionList[i2].region);
  46329. break;
  46330. }
  46331. }
  46332. break;
  46333. case "vertical":
  46334. settings.alt(k, v, ["rl", "lr"]);
  46335. break;
  46336. case "line":
  46337. var vals = v.split(","), vals0 = vals[0];
  46338. settings.integer(k, vals0);
  46339. settings.percent(k, vals0) ? settings.set("snapToLines", false) : null;
  46340. settings.alt(k, vals0, ["auto"]);
  46341. if (vals.length === 2) {
  46342. settings.alt("lineAlign", vals[1], ["start", "center", "end"]);
  46343. }
  46344. break;
  46345. case "position":
  46346. vals = v.split(",");
  46347. settings.percent(k, vals[0]);
  46348. if (vals.length === 2) {
  46349. settings.alt("positionAlign", vals[1], ["start", "center", "end"]);
  46350. }
  46351. break;
  46352. case "size":
  46353. settings.percent(k, v);
  46354. break;
  46355. case "align":
  46356. settings.alt(k, v, ["start", "center", "end", "left", "right"]);
  46357. break;
  46358. }
  46359. }, /:/, /\s/);
  46360. cue2.region = settings.get("region", null);
  46361. cue2.vertical = settings.get("vertical", "");
  46362. try {
  46363. cue2.line = settings.get("line", "auto");
  46364. } catch (e) {
  46365. }
  46366. cue2.lineAlign = settings.get("lineAlign", "start");
  46367. cue2.snapToLines = settings.get("snapToLines", true);
  46368. cue2.size = settings.get("size", 100);
  46369. try {
  46370. cue2.align = settings.get("align", "center");
  46371. } catch (e) {
  46372. cue2.align = settings.get("align", "middle");
  46373. }
  46374. try {
  46375. cue2.position = settings.get("position", "auto");
  46376. } catch (e) {
  46377. cue2.position = settings.get("position", {
  46378. start: 0,
  46379. left: 0,
  46380. center: 50,
  46381. middle: 50,
  46382. end: 100,
  46383. right: 100
  46384. }, cue2.align);
  46385. }
  46386. cue2.positionAlign = settings.get("positionAlign", {
  46387. start: "start",
  46388. left: "start",
  46389. center: "center",
  46390. middle: "center",
  46391. end: "end",
  46392. right: "end"
  46393. }, cue2.align);
  46394. }
  46395. function skipWhitespace() {
  46396. input = input.replace(/^\s+/, "");
  46397. }
  46398. skipWhitespace();
  46399. cue.startTime = consumeTimeStamp();
  46400. skipWhitespace();
  46401. if (input.substr(0, 3) !== "-->") {
  46402. throw new ParsingError(
  46403. ParsingError.Errors.BadTimeStamp,
  46404. "Malformed time stamp (time stamps must be separated by '-->'): " + oInput
  46405. );
  46406. }
  46407. input = input.substr(3);
  46408. skipWhitespace();
  46409. cue.endTime = consumeTimeStamp();
  46410. skipWhitespace();
  46411. consumeCueSettings(input, cue);
  46412. }
  46413. var TEXTAREA_ELEMENT = document$1.createElement && document$1.createElement("textarea");
  46414. var TAG_NAME = {
  46415. c: "span",
  46416. i: "i",
  46417. b: "b",
  46418. u: "u",
  46419. ruby: "ruby",
  46420. rt: "rt",
  46421. v: "span",
  46422. lang: "span"
  46423. };
  46424. var DEFAULT_COLOR_CLASS = {
  46425. white: "rgba(255,255,255,1)",
  46426. lime: "rgba(0,255,0,1)",
  46427. cyan: "rgba(0,255,255,1)",
  46428. red: "rgba(255,0,0,1)",
  46429. yellow: "rgba(255,255,0,1)",
  46430. magenta: "rgba(255,0,255,1)",
  46431. blue: "rgba(0,0,255,1)",
  46432. black: "rgba(0,0,0,1)"
  46433. };
  46434. var TAG_ANNOTATION = {
  46435. v: "title",
  46436. lang: "lang"
  46437. };
  46438. var NEEDS_PARENT = {
  46439. rt: "ruby"
  46440. };
  46441. function parseContent(window2, input) {
  46442. function nextToken() {
  46443. if (!input) {
  46444. return null;
  46445. }
  46446. function consume(result) {
  46447. input = input.substr(result.length);
  46448. return result;
  46449. }
  46450. var m2 = input.match(/^([^<]*)(<[^>]*>?)?/);
  46451. return consume(m2[1] ? m2[1] : m2[2]);
  46452. }
  46453. function unescape2(s) {
  46454. TEXTAREA_ELEMENT.innerHTML = s;
  46455. s = TEXTAREA_ELEMENT.textContent;
  46456. TEXTAREA_ELEMENT.textContent = "";
  46457. return s;
  46458. }
  46459. function shouldAdd(current2, element) {
  46460. return !NEEDS_PARENT[element.localName] || NEEDS_PARENT[element.localName] === current2.localName;
  46461. }
  46462. function createElement(type2, annotation) {
  46463. var tagName = TAG_NAME[type2];
  46464. if (!tagName) {
  46465. return null;
  46466. }
  46467. var element = window2.document.createElement(tagName);
  46468. var name = TAG_ANNOTATION[type2];
  46469. if (name && annotation) {
  46470. element[name] = annotation.trim();
  46471. }
  46472. return element;
  46473. }
  46474. var rootDiv = window2.document.createElement("div"), current = rootDiv, t2, tagStack = [];
  46475. while ((t2 = nextToken()) !== null) {
  46476. if (t2[0] === "<") {
  46477. if (t2[1] === "/") {
  46478. if (tagStack.length && tagStack[tagStack.length - 1] === t2.substr(2).replace(">", "")) {
  46479. tagStack.pop();
  46480. current = current.parentNode;
  46481. }
  46482. continue;
  46483. }
  46484. var ts3 = parseTimeStamp(t2.substr(1, t2.length - 2));
  46485. var node;
  46486. if (ts3) {
  46487. node = window2.document.createProcessingInstruction("timestamp", ts3);
  46488. current.appendChild(node);
  46489. continue;
  46490. }
  46491. var m = t2.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);
  46492. if (!m) {
  46493. continue;
  46494. }
  46495. node = createElement(m[1], m[3]);
  46496. if (!node) {
  46497. continue;
  46498. }
  46499. if (!shouldAdd(current, node)) {
  46500. continue;
  46501. }
  46502. if (m[2]) {
  46503. var classes = m[2].split(".");
  46504. classes.forEach(function(cl) {
  46505. var bgColor = /^bg_/.test(cl);
  46506. var colorName = bgColor ? cl.slice(3) : cl;
  46507. if (DEFAULT_COLOR_CLASS.hasOwnProperty(colorName)) {
  46508. var propName = bgColor ? "background-color" : "color";
  46509. var propValue = DEFAULT_COLOR_CLASS[colorName];
  46510. node.style[propName] = propValue;
  46511. }
  46512. });
  46513. node.className = classes.join(" ");
  46514. }
  46515. tagStack.push(m[1]);
  46516. current.appendChild(node);
  46517. current = node;
  46518. continue;
  46519. }
  46520. current.appendChild(window2.document.createTextNode(unescape2(t2)));
  46521. }
  46522. return rootDiv;
  46523. }
  46524. var strongRTLRanges = [
  46525. [1470, 1470],
  46526. [1472, 1472],
  46527. [1475, 1475],
  46528. [1478, 1478],
  46529. [1488, 1514],
  46530. [1520, 1524],
  46531. [1544, 1544],
  46532. [1547, 1547],
  46533. [1549, 1549],
  46534. [1563, 1563],
  46535. [1566, 1610],
  46536. [1645, 1647],
  46537. [1649, 1749],
  46538. [1765, 1766],
  46539. [1774, 1775],
  46540. [1786, 1805],
  46541. [1807, 1808],
  46542. [1810, 1839],
  46543. [1869, 1957],
  46544. [1969, 1969],
  46545. [1984, 2026],
  46546. [2036, 2037],
  46547. [2042, 2042],
  46548. [2048, 2069],
  46549. [2074, 2074],
  46550. [2084, 2084],
  46551. [2088, 2088],
  46552. [2096, 2110],
  46553. [2112, 2136],
  46554. [2142, 2142],
  46555. [2208, 2208],
  46556. [2210, 2220],
  46557. [8207, 8207],
  46558. [64285, 64285],
  46559. [64287, 64296],
  46560. [64298, 64310],
  46561. [64312, 64316],
  46562. [64318, 64318],
  46563. [64320, 64321],
  46564. [64323, 64324],
  46565. [64326, 64449],
  46566. [64467, 64829],
  46567. [64848, 64911],
  46568. [64914, 64967],
  46569. [65008, 65020],
  46570. [65136, 65140],
  46571. [65142, 65276],
  46572. [67584, 67589],
  46573. [67592, 67592],
  46574. [67594, 67637],
  46575. [67639, 67640],
  46576. [67644, 67644],
  46577. [67647, 67669],
  46578. [67671, 67679],
  46579. [67840, 67867],
  46580. [67872, 67897],
  46581. [67903, 67903],
  46582. [67968, 68023],
  46583. [68030, 68031],
  46584. [68096, 68096],
  46585. [68112, 68115],
  46586. [68117, 68119],
  46587. [68121, 68147],
  46588. [68160, 68167],
  46589. [68176, 68184],
  46590. [68192, 68223],
  46591. [68352, 68405],
  46592. [68416, 68437],
  46593. [68440, 68466],
  46594. [68472, 68479],
  46595. [68608, 68680],
  46596. [126464, 126467],
  46597. [126469, 126495],
  46598. [126497, 126498],
  46599. [126500, 126500],
  46600. [126503, 126503],
  46601. [126505, 126514],
  46602. [126516, 126519],
  46603. [126521, 126521],
  46604. [126523, 126523],
  46605. [126530, 126530],
  46606. [126535, 126535],
  46607. [126537, 126537],
  46608. [126539, 126539],
  46609. [126541, 126543],
  46610. [126545, 126546],
  46611. [126548, 126548],
  46612. [126551, 126551],
  46613. [126553, 126553],
  46614. [126555, 126555],
  46615. [126557, 126557],
  46616. [126559, 126559],
  46617. [126561, 126562],
  46618. [126564, 126564],
  46619. [126567, 126570],
  46620. [126572, 126578],
  46621. [126580, 126583],
  46622. [126585, 126588],
  46623. [126590, 126590],
  46624. [126592, 126601],
  46625. [126603, 126619],
  46626. [126625, 126627],
  46627. [126629, 126633],
  46628. [126635, 126651],
  46629. [1114109, 1114109]
  46630. ];
  46631. function isStrongRTLChar(charCode) {
  46632. for (var i2 = 0; i2 < strongRTLRanges.length; i2++) {
  46633. var currentRange = strongRTLRanges[i2];
  46634. if (charCode >= currentRange[0] && charCode <= currentRange[1]) {
  46635. return true;
  46636. }
  46637. }
  46638. return false;
  46639. }
  46640. function determineBidi(cueDiv) {
  46641. var nodeStack = [], text = "", charCode;
  46642. if (!cueDiv || !cueDiv.childNodes) {
  46643. return "ltr";
  46644. }
  46645. function pushNodes(nodeStack2, node) {
  46646. for (var i3 = node.childNodes.length - 1; i3 >= 0; i3--) {
  46647. nodeStack2.push(node.childNodes[i3]);
  46648. }
  46649. }
  46650. function nextTextNode(nodeStack2) {
  46651. if (!nodeStack2 || !nodeStack2.length) {
  46652. return null;
  46653. }
  46654. var node = nodeStack2.pop(), text2 = node.textContent || node.innerText;
  46655. if (text2) {
  46656. var m = text2.match(/^.*(\n|\r)/);
  46657. if (m) {
  46658. nodeStack2.length = 0;
  46659. return m[0];
  46660. }
  46661. return text2;
  46662. }
  46663. if (node.tagName === "ruby") {
  46664. return nextTextNode(nodeStack2);
  46665. }
  46666. if (node.childNodes) {
  46667. pushNodes(nodeStack2, node);
  46668. return nextTextNode(nodeStack2);
  46669. }
  46670. }
  46671. pushNodes(nodeStack, cueDiv);
  46672. while (text = nextTextNode(nodeStack)) {
  46673. for (var i2 = 0; i2 < text.length; i2++) {
  46674. charCode = text.charCodeAt(i2);
  46675. if (isStrongRTLChar(charCode)) {
  46676. return "rtl";
  46677. }
  46678. }
  46679. }
  46680. return "ltr";
  46681. }
  46682. function computeLinePos(cue) {
  46683. if (typeof cue.line === "number" && (cue.snapToLines || cue.line >= 0 && cue.line <= 100)) {
  46684. return cue.line;
  46685. }
  46686. if (!cue.track || !cue.track.textTrackList || !cue.track.textTrackList.mediaElement) {
  46687. return -1;
  46688. }
  46689. var track = cue.track, trackList = track.textTrackList, count = 0;
  46690. for (var i2 = 0; i2 < trackList.length && trackList[i2] !== track; i2++) {
  46691. if (trackList[i2].mode === "showing") {
  46692. count++;
  46693. }
  46694. }
  46695. return ++count * -1;
  46696. }
  46697. function StyleBox() {
  46698. }
  46699. StyleBox.prototype.applyStyles = function(styles, div) {
  46700. div = div || this.div;
  46701. for (var prop in styles) {
  46702. if (styles.hasOwnProperty(prop)) {
  46703. div.style[prop] = styles[prop];
  46704. }
  46705. }
  46706. };
  46707. StyleBox.prototype.formatStyle = function(val, unit) {
  46708. return val === 0 ? 0 : val + unit;
  46709. };
  46710. function CueStyleBox(window2, cue, styleOptions) {
  46711. StyleBox.call(this);
  46712. this.cue = cue;
  46713. this.cueDiv = parseContent(window2, cue.text);
  46714. var styles = {
  46715. color: "rgba(255, 255, 255, 1)",
  46716. backgroundColor: "rgba(0, 0, 0, 0.8)",
  46717. position: "relative",
  46718. left: 0,
  46719. right: 0,
  46720. top: 0,
  46721. bottom: 0,
  46722. display: "inline",
  46723. writingMode: cue.vertical === "" ? "horizontal-tb" : cue.vertical === "lr" ? "vertical-lr" : "vertical-rl",
  46724. unicodeBidi: "plaintext"
  46725. };
  46726. this.applyStyles(styles, this.cueDiv);
  46727. this.div = window2.document.createElement("div");
  46728. styles = {
  46729. direction: determineBidi(this.cueDiv),
  46730. writingMode: cue.vertical === "" ? "horizontal-tb" : cue.vertical === "lr" ? "vertical-lr" : "vertical-rl",
  46731. unicodeBidi: "plaintext",
  46732. textAlign: cue.align === "middle" ? "center" : cue.align,
  46733. font: styleOptions.font,
  46734. whiteSpace: "pre-line",
  46735. position: "absolute"
  46736. };
  46737. this.applyStyles(styles);
  46738. this.div.appendChild(this.cueDiv);
  46739. var textPos = 0;
  46740. switch (cue.positionAlign) {
  46741. case "start":
  46742. textPos = cue.position;
  46743. break;
  46744. case "center":
  46745. textPos = cue.position - cue.size / 2;
  46746. break;
  46747. case "end":
  46748. textPos = cue.position - cue.size;
  46749. break;
  46750. }
  46751. if (cue.vertical === "") {
  46752. this.applyStyles({
  46753. left: this.formatStyle(textPos, "%"),
  46754. width: this.formatStyle(cue.size, "%")
  46755. });
  46756. } else {
  46757. this.applyStyles({
  46758. top: this.formatStyle(textPos, "%"),
  46759. height: this.formatStyle(cue.size, "%")
  46760. });
  46761. }
  46762. this.move = function(box) {
  46763. this.applyStyles({
  46764. top: this.formatStyle(box.top, "px"),
  46765. bottom: this.formatStyle(box.bottom, "px"),
  46766. left: this.formatStyle(box.left, "px"),
  46767. right: this.formatStyle(box.right, "px"),
  46768. height: this.formatStyle(box.height, "px"),
  46769. width: this.formatStyle(box.width, "px")
  46770. });
  46771. };
  46772. }
  46773. CueStyleBox.prototype = _objCreate(StyleBox.prototype);
  46774. CueStyleBox.prototype.constructor = CueStyleBox;
  46775. function BoxPosition(obj) {
  46776. var lh, height2, width2, top;
  46777. if (obj.div) {
  46778. height2 = obj.div.offsetHeight;
  46779. width2 = obj.div.offsetWidth;
  46780. top = obj.div.offsetTop;
  46781. var rects = (rects = obj.div.childNodes) && (rects = rects[0]) && rects.getClientRects && rects.getClientRects();
  46782. obj = obj.div.getBoundingClientRect();
  46783. lh = rects ? Math.max(rects[0] && rects[0].height || 0, obj.height / rects.length) : 0;
  46784. }
  46785. this.left = obj.left;
  46786. this.right = obj.right;
  46787. this.top = obj.top || top;
  46788. this.height = obj.height || height2;
  46789. this.bottom = obj.bottom || top + (obj.height || height2);
  46790. this.width = obj.width || width2;
  46791. this.lineHeight = lh !== void 0 ? lh : obj.lineHeight;
  46792. }
  46793. BoxPosition.prototype.move = function(axis, toMove) {
  46794. toMove = toMove !== void 0 ? toMove : this.lineHeight;
  46795. switch (axis) {
  46796. case "+x":
  46797. this.left += toMove;
  46798. this.right += toMove;
  46799. break;
  46800. case "-x":
  46801. this.left -= toMove;
  46802. this.right -= toMove;
  46803. break;
  46804. case "+y":
  46805. this.top += toMove;
  46806. this.bottom += toMove;
  46807. break;
  46808. case "-y":
  46809. this.top -= toMove;
  46810. this.bottom -= toMove;
  46811. break;
  46812. }
  46813. };
  46814. BoxPosition.prototype.overlaps = function(b2) {
  46815. return this.left < b2.right && this.right > b2.left && this.top < b2.bottom && this.bottom > b2.top;
  46816. };
  46817. BoxPosition.prototype.overlapsAny = function(boxes) {
  46818. for (var i2 = 0; i2 < boxes.length; i2++) {
  46819. if (this.overlaps(boxes[i2])) {
  46820. return true;
  46821. }
  46822. }
  46823. return false;
  46824. };
  46825. BoxPosition.prototype.within = function(container) {
  46826. return this.top >= container.top && this.bottom <= container.bottom && this.left >= container.left && this.right <= container.right;
  46827. };
  46828. BoxPosition.prototype.overlapsOppositeAxis = function(container, axis) {
  46829. switch (axis) {
  46830. case "+x":
  46831. return this.left < container.left;
  46832. case "-x":
  46833. return this.right > container.right;
  46834. case "+y":
  46835. return this.top < container.top;
  46836. case "-y":
  46837. return this.bottom > container.bottom;
  46838. }
  46839. };
  46840. BoxPosition.prototype.intersectPercentage = function(b2) {
  46841. var x = Math.max(0, Math.min(this.right, b2.right) - Math.max(this.left, b2.left)), y = Math.max(0, Math.min(this.bottom, b2.bottom) - Math.max(this.top, b2.top)), intersectArea = x * y;
  46842. return intersectArea / (this.height * this.width);
  46843. };
  46844. BoxPosition.prototype.toCSSCompatValues = function(reference) {
  46845. return {
  46846. top: this.top - reference.top,
  46847. bottom: reference.bottom - this.bottom,
  46848. left: this.left - reference.left,
  46849. right: reference.right - this.right,
  46850. height: this.height,
  46851. width: this.width
  46852. };
  46853. };
  46854. BoxPosition.getSimpleBoxPosition = function(obj) {
  46855. var height2 = obj.div ? obj.div.offsetHeight : obj.tagName ? obj.offsetHeight : 0;
  46856. var width2 = obj.div ? obj.div.offsetWidth : obj.tagName ? obj.offsetWidth : 0;
  46857. var top = obj.div ? obj.div.offsetTop : obj.tagName ? obj.offsetTop : 0;
  46858. obj = obj.div ? obj.div.getBoundingClientRect() : obj.tagName ? obj.getBoundingClientRect() : obj;
  46859. var ret = {
  46860. left: obj.left,
  46861. right: obj.right,
  46862. top: obj.top || top,
  46863. height: obj.height || height2,
  46864. bottom: obj.bottom || top + (obj.height || height2),
  46865. width: obj.width || width2
  46866. };
  46867. return ret;
  46868. };
  46869. function moveBoxToLinePosition(window2, styleBox, containerBox, boxPositions) {
  46870. function findBestPosition(b, axis2) {
  46871. var bestPosition2, specifiedPosition = new BoxPosition(b), percentage = 1;
  46872. for (var i2 = 0; i2 < axis2.length; i2++) {
  46873. while (b.overlapsOppositeAxis(containerBox, axis2[i2]) || b.within(containerBox) && b.overlapsAny(boxPositions)) {
  46874. b.move(axis2[i2]);
  46875. }
  46876. if (b.within(containerBox)) {
  46877. return b;
  46878. }
  46879. var p = b.intersectPercentage(containerBox);
  46880. if (percentage > p) {
  46881. bestPosition2 = new BoxPosition(b);
  46882. percentage = p;
  46883. }
  46884. b = new BoxPosition(specifiedPosition);
  46885. }
  46886. return bestPosition2 || specifiedPosition;
  46887. }
  46888. var boxPosition = new BoxPosition(styleBox), cue = styleBox.cue, linePos = computeLinePos(cue), axis = [];
  46889. if (cue.snapToLines) {
  46890. var size;
  46891. switch (cue.vertical) {
  46892. case "":
  46893. axis = ["+y", "-y"];
  46894. size = "height";
  46895. break;
  46896. case "rl":
  46897. axis = ["+x", "-x"];
  46898. size = "width";
  46899. break;
  46900. case "lr":
  46901. axis = ["-x", "+x"];
  46902. size = "width";
  46903. break;
  46904. }
  46905. var step = boxPosition.lineHeight, position2 = step * Math.round(linePos), maxPosition = containerBox[size] + step, initialAxis = axis[0];
  46906. if (Math.abs(position2) > maxPosition) {
  46907. position2 = position2 < 0 ? -1 : 1;
  46908. position2 *= Math.ceil(maxPosition / step) * step;
  46909. }
  46910. if (linePos < 0) {
  46911. position2 += cue.vertical === "" ? containerBox.height : containerBox.width;
  46912. axis = axis.reverse();
  46913. }
  46914. boxPosition.move(initialAxis, position2);
  46915. } else {
  46916. var calculatedPercentage = boxPosition.lineHeight / containerBox.height * 100;
  46917. switch (cue.lineAlign) {
  46918. case "center":
  46919. linePos -= calculatedPercentage / 2;
  46920. break;
  46921. case "end":
  46922. linePos -= calculatedPercentage;
  46923. break;
  46924. }
  46925. switch (cue.vertical) {
  46926. case "":
  46927. styleBox.applyStyles({
  46928. top: styleBox.formatStyle(linePos, "%")
  46929. });
  46930. break;
  46931. case "rl":
  46932. styleBox.applyStyles({
  46933. left: styleBox.formatStyle(linePos, "%")
  46934. });
  46935. break;
  46936. case "lr":
  46937. styleBox.applyStyles({
  46938. right: styleBox.formatStyle(linePos, "%")
  46939. });
  46940. break;
  46941. }
  46942. axis = ["+y", "-x", "+x", "-y"];
  46943. boxPosition = new BoxPosition(styleBox);
  46944. }
  46945. var bestPosition = findBestPosition(boxPosition, axis);
  46946. styleBox.move(bestPosition.toCSSCompatValues(containerBox));
  46947. }
  46948. function WebVTT$1() {
  46949. }
  46950. WebVTT$1.StringDecoder = function() {
  46951. return {
  46952. decode: function(data) {
  46953. if (!data) {
  46954. return "";
  46955. }
  46956. if (typeof data !== "string") {
  46957. throw new Error("Error - expected string data.");
  46958. }
  46959. return decodeURIComponent(encodeURIComponent(data));
  46960. }
  46961. };
  46962. };
  46963. WebVTT$1.convertCueToDOMTree = function(window2, cuetext) {
  46964. if (!window2 || !cuetext) {
  46965. return null;
  46966. }
  46967. return parseContent(window2, cuetext);
  46968. };
  46969. var FONT_SIZE_PERCENT = 0.05;
  46970. var FONT_STYLE = "sans-serif";
  46971. var CUE_BACKGROUND_PADDING = "1.5%";
  46972. WebVTT$1.processCues = function(window2, cues, overlay) {
  46973. if (!window2 || !cues || !overlay) {
  46974. return null;
  46975. }
  46976. while (overlay.firstChild) {
  46977. overlay.removeChild(overlay.firstChild);
  46978. }
  46979. var paddedOverlay = window2.document.createElement("div");
  46980. paddedOverlay.style.position = "absolute";
  46981. paddedOverlay.style.left = "0";
  46982. paddedOverlay.style.right = "0";
  46983. paddedOverlay.style.top = "0";
  46984. paddedOverlay.style.bottom = "0";
  46985. paddedOverlay.style.margin = CUE_BACKGROUND_PADDING;
  46986. overlay.appendChild(paddedOverlay);
  46987. function shouldCompute(cues2) {
  46988. for (var i3 = 0; i3 < cues2.length; i3++) {
  46989. if (cues2[i3].hasBeenReset || !cues2[i3].displayState) {
  46990. return true;
  46991. }
  46992. }
  46993. return false;
  46994. }
  46995. if (!shouldCompute(cues)) {
  46996. for (var i2 = 0; i2 < cues.length; i2++) {
  46997. paddedOverlay.appendChild(cues[i2].displayState);
  46998. }
  46999. return;
  47000. }
  47001. var boxPositions = [], containerBox = BoxPosition.getSimpleBoxPosition(paddedOverlay), fontSize = Math.round(containerBox.height * FONT_SIZE_PERCENT * 100) / 100;
  47002. var styleOptions = {
  47003. font: fontSize + "px " + FONT_STYLE
  47004. };
  47005. (function() {
  47006. var styleBox, cue;
  47007. for (var i3 = 0; i3 < cues.length; i3++) {
  47008. cue = cues[i3];
  47009. styleBox = new CueStyleBox(window2, cue, styleOptions);
  47010. paddedOverlay.appendChild(styleBox.div);
  47011. moveBoxToLinePosition(window2, styleBox, containerBox, boxPositions);
  47012. cue.displayState = styleBox.div;
  47013. boxPositions.push(BoxPosition.getSimpleBoxPosition(styleBox));
  47014. }
  47015. })();
  47016. };
  47017. WebVTT$1.Parser = function(window2, vttjs2, decoder) {
  47018. if (!decoder) {
  47019. decoder = vttjs2;
  47020. vttjs2 = {};
  47021. }
  47022. if (!vttjs2) {
  47023. vttjs2 = {};
  47024. }
  47025. this.window = window2;
  47026. this.vttjs = vttjs2;
  47027. this.state = "INITIAL";
  47028. this.buffer = "";
  47029. this.decoder = decoder || new TextDecoder("utf8");
  47030. this.regionList = [];
  47031. };
  47032. WebVTT$1.Parser.prototype = {
  47033. reportOrThrowError: function(e) {
  47034. if (e instanceof ParsingError) {
  47035. this.onparsingerror && this.onparsingerror(e);
  47036. } else {
  47037. throw e;
  47038. }
  47039. },
  47040. parse: function(data) {
  47041. var self2 = this;
  47042. if (data) {
  47043. self2.buffer += self2.decoder.decode(data, { stream: true });
  47044. }
  47045. function collectNextLine() {
  47046. var buffer = self2.buffer;
  47047. var pos = 0;
  47048. while (pos < buffer.length && buffer[pos] !== "\r" && buffer[pos] !== "\n") {
  47049. ++pos;
  47050. }
  47051. var line2 = buffer.substr(0, pos);
  47052. if (buffer[pos] === "\r") {
  47053. ++pos;
  47054. }
  47055. if (buffer[pos] === "\n") {
  47056. ++pos;
  47057. }
  47058. self2.buffer = buffer.substr(pos);
  47059. return line2;
  47060. }
  47061. function parseRegion(input) {
  47062. var settings = new Settings();
  47063. parseOptions(input, function(k, v) {
  47064. switch (k) {
  47065. case "id":
  47066. settings.set(k, v);
  47067. break;
  47068. case "width":
  47069. settings.percent(k, v);
  47070. break;
  47071. case "lines":
  47072. settings.integer(k, v);
  47073. break;
  47074. case "regionanchor":
  47075. case "viewportanchor":
  47076. var xy = v.split(",");
  47077. if (xy.length !== 2) {
  47078. break;
  47079. }
  47080. var anchor = new Settings();
  47081. anchor.percent("x", xy[0]);
  47082. anchor.percent("y", xy[1]);
  47083. if (!anchor.has("x") || !anchor.has("y")) {
  47084. break;
  47085. }
  47086. settings.set(k + "X", anchor.get("x"));
  47087. settings.set(k + "Y", anchor.get("y"));
  47088. break;
  47089. case "scroll":
  47090. settings.alt(k, v, ["up"]);
  47091. break;
  47092. }
  47093. }, /=/, /\s/);
  47094. if (settings.has("id")) {
  47095. var region = new (self2.vttjs.VTTRegion || self2.window.VTTRegion)();
  47096. region.width = settings.get("width", 100);
  47097. region.lines = settings.get("lines", 3);
  47098. region.regionAnchorX = settings.get("regionanchorX", 0);
  47099. region.regionAnchorY = settings.get("regionanchorY", 100);
  47100. region.viewportAnchorX = settings.get("viewportanchorX", 0);
  47101. region.viewportAnchorY = settings.get("viewportanchorY", 100);
  47102. region.scroll = settings.get("scroll", "");
  47103. self2.onregion && self2.onregion(region);
  47104. self2.regionList.push({
  47105. id: settings.get("id"),
  47106. region
  47107. });
  47108. }
  47109. }
  47110. function parseTimestampMap(input) {
  47111. var settings = new Settings();
  47112. parseOptions(input, function(k, v) {
  47113. switch (k) {
  47114. case "MPEGT":
  47115. settings.integer(k + "S", v);
  47116. break;
  47117. case "LOCA":
  47118. settings.set(k + "L", parseTimeStamp(v));
  47119. break;
  47120. }
  47121. }, /[^\d]:/, /,/);
  47122. self2.ontimestampmap && self2.ontimestampmap({
  47123. "MPEGTS": settings.get("MPEGTS"),
  47124. "LOCAL": settings.get("LOCAL")
  47125. });
  47126. }
  47127. function parseHeader(input) {
  47128. if (input.match(/X-TIMESTAMP-MAP/)) {
  47129. parseOptions(input, function(k, v) {
  47130. switch (k) {
  47131. case "X-TIMESTAMP-MAP":
  47132. parseTimestampMap(v);
  47133. break;
  47134. }
  47135. }, /=/);
  47136. } else {
  47137. parseOptions(input, function(k, v) {
  47138. switch (k) {
  47139. case "Region":
  47140. parseRegion(v);
  47141. break;
  47142. }
  47143. }, /:/);
  47144. }
  47145. }
  47146. try {
  47147. var line;
  47148. if (self2.state === "INITIAL") {
  47149. if (!/\r\n|\n/.test(self2.buffer)) {
  47150. return this;
  47151. }
  47152. line = collectNextLine();
  47153. var m = line.match(/^WEBVTT([ \t].*)?$/);
  47154. if (!m || !m[0]) {
  47155. throw new ParsingError(ParsingError.Errors.BadSignature);
  47156. }
  47157. self2.state = "HEADER";
  47158. }
  47159. var alreadyCollectedLine = false;
  47160. while (self2.buffer) {
  47161. if (!/\r\n|\n/.test(self2.buffer)) {
  47162. return this;
  47163. }
  47164. if (!alreadyCollectedLine) {
  47165. line = collectNextLine();
  47166. } else {
  47167. alreadyCollectedLine = false;
  47168. }
  47169. switch (self2.state) {
  47170. case "HEADER":
  47171. if (/:/.test(line)) {
  47172. parseHeader(line);
  47173. } else if (!line) {
  47174. self2.state = "ID";
  47175. }
  47176. continue;
  47177. case "NOTE":
  47178. if (!line) {
  47179. self2.state = "ID";
  47180. }
  47181. continue;
  47182. case "ID":
  47183. if (/^NOTE($|[ \t])/.test(line)) {
  47184. self2.state = "NOTE";
  47185. break;
  47186. }
  47187. if (!line) {
  47188. continue;
  47189. }
  47190. self2.cue = new (self2.vttjs.VTTCue || self2.window.VTTCue)(0, 0, "");
  47191. try {
  47192. self2.cue.align = "center";
  47193. } catch (e) {
  47194. self2.cue.align = "middle";
  47195. }
  47196. self2.state = "CUE";
  47197. if (line.indexOf("-->") === -1) {
  47198. self2.cue.id = line;
  47199. continue;
  47200. }
  47201. case "CUE":
  47202. try {
  47203. parseCue(line, self2.cue, self2.regionList);
  47204. } catch (e) {
  47205. self2.reportOrThrowError(e);
  47206. self2.cue = null;
  47207. self2.state = "BADCUE";
  47208. continue;
  47209. }
  47210. self2.state = "CUETEXT";
  47211. continue;
  47212. case "CUETEXT":
  47213. var hasSubstring = line.indexOf("-->") !== -1;
  47214. if (!line || hasSubstring && (alreadyCollectedLine = true)) {
  47215. self2.oncue && self2.oncue(self2.cue);
  47216. self2.cue = null;
  47217. self2.state = "ID";
  47218. continue;
  47219. }
  47220. if (self2.cue.text) {
  47221. self2.cue.text += "\n";
  47222. }
  47223. self2.cue.text += line.replace(/\u2028/g, "\n").replace(/u2029/g, "\n");
  47224. continue;
  47225. case "BADCUE":
  47226. if (!line) {
  47227. self2.state = "ID";
  47228. }
  47229. continue;
  47230. }
  47231. }
  47232. } catch (e) {
  47233. self2.reportOrThrowError(e);
  47234. if (self2.state === "CUETEXT" && self2.cue && self2.oncue) {
  47235. self2.oncue(self2.cue);
  47236. }
  47237. self2.cue = null;
  47238. self2.state = self2.state === "INITIAL" ? "BADWEBVTT" : "BADCUE";
  47239. }
  47240. return this;
  47241. },
  47242. flush: function() {
  47243. var self2 = this;
  47244. try {
  47245. self2.buffer += self2.decoder.decode();
  47246. if (self2.cue || self2.state === "HEADER") {
  47247. self2.buffer += "\n\n";
  47248. self2.parse();
  47249. }
  47250. if (self2.state === "INITIAL") {
  47251. throw new ParsingError(ParsingError.Errors.BadSignature);
  47252. }
  47253. } catch (e) {
  47254. self2.reportOrThrowError(e);
  47255. }
  47256. self2.onflush && self2.onflush();
  47257. return this;
  47258. }
  47259. };
  47260. var vtt$1 = WebVTT$1;
  47261. var autoKeyword = "auto";
  47262. var directionSetting = {
  47263. "": 1,
  47264. "lr": 1,
  47265. "rl": 1
  47266. };
  47267. var alignSetting = {
  47268. "start": 1,
  47269. "center": 1,
  47270. "end": 1,
  47271. "left": 1,
  47272. "right": 1,
  47273. "auto": 1,
  47274. "line-left": 1,
  47275. "line-right": 1
  47276. };
  47277. function findDirectionSetting(value) {
  47278. if (typeof value !== "string") {
  47279. return false;
  47280. }
  47281. var dir = directionSetting[value.toLowerCase()];
  47282. return dir ? value.toLowerCase() : false;
  47283. }
  47284. function findAlignSetting(value) {
  47285. if (typeof value !== "string") {
  47286. return false;
  47287. }
  47288. var align = alignSetting[value.toLowerCase()];
  47289. return align ? value.toLowerCase() : false;
  47290. }
  47291. function VTTCue(startTime, endTime, text) {
  47292. this.hasBeenReset = false;
  47293. var _id = "";
  47294. var _pauseOnExit = false;
  47295. var _startTime = startTime;
  47296. var _endTime = endTime;
  47297. var _text = text;
  47298. var _region = null;
  47299. var _vertical = "";
  47300. var _snapToLines = true;
  47301. var _line = "auto";
  47302. var _lineAlign = "start";
  47303. var _position = "auto";
  47304. var _positionAlign = "auto";
  47305. var _size = 100;
  47306. var _align = "center";
  47307. Object.defineProperties(this, {
  47308. "id": {
  47309. enumerable: true,
  47310. get: function() {
  47311. return _id;
  47312. },
  47313. set: function(value) {
  47314. _id = "" + value;
  47315. }
  47316. },
  47317. "pauseOnExit": {
  47318. enumerable: true,
  47319. get: function() {
  47320. return _pauseOnExit;
  47321. },
  47322. set: function(value) {
  47323. _pauseOnExit = !!value;
  47324. }
  47325. },
  47326. "startTime": {
  47327. enumerable: true,
  47328. get: function() {
  47329. return _startTime;
  47330. },
  47331. set: function(value) {
  47332. if (typeof value !== "number") {
  47333. throw new TypeError("Start time must be set to a number.");
  47334. }
  47335. _startTime = value;
  47336. this.hasBeenReset = true;
  47337. }
  47338. },
  47339. "endTime": {
  47340. enumerable: true,
  47341. get: function() {
  47342. return _endTime;
  47343. },
  47344. set: function(value) {
  47345. if (typeof value !== "number") {
  47346. throw new TypeError("End time must be set to a number.");
  47347. }
  47348. _endTime = value;
  47349. this.hasBeenReset = true;
  47350. }
  47351. },
  47352. "text": {
  47353. enumerable: true,
  47354. get: function() {
  47355. return _text;
  47356. },
  47357. set: function(value) {
  47358. _text = "" + value;
  47359. this.hasBeenReset = true;
  47360. }
  47361. },
  47362. "region": {
  47363. enumerable: true,
  47364. get: function() {
  47365. return _region;
  47366. },
  47367. set: function(value) {
  47368. _region = value;
  47369. this.hasBeenReset = true;
  47370. }
  47371. },
  47372. "vertical": {
  47373. enumerable: true,
  47374. get: function() {
  47375. return _vertical;
  47376. },
  47377. set: function(value) {
  47378. var setting = findDirectionSetting(value);
  47379. if (setting === false) {
  47380. throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");
  47381. }
  47382. _vertical = setting;
  47383. this.hasBeenReset = true;
  47384. }
  47385. },
  47386. "snapToLines": {
  47387. enumerable: true,
  47388. get: function() {
  47389. return _snapToLines;
  47390. },
  47391. set: function(value) {
  47392. _snapToLines = !!value;
  47393. this.hasBeenReset = true;
  47394. }
  47395. },
  47396. "line": {
  47397. enumerable: true,
  47398. get: function() {
  47399. return _line;
  47400. },
  47401. set: function(value) {
  47402. if (typeof value !== "number" && value !== autoKeyword) {
  47403. throw new SyntaxError("Line: an invalid number or illegal string was specified.");
  47404. }
  47405. _line = value;
  47406. this.hasBeenReset = true;
  47407. }
  47408. },
  47409. "lineAlign": {
  47410. enumerable: true,
  47411. get: function() {
  47412. return _lineAlign;
  47413. },
  47414. set: function(value) {
  47415. var setting = findAlignSetting(value);
  47416. if (!setting) {
  47417. console.warn("lineAlign: an invalid or illegal string was specified.");
  47418. } else {
  47419. _lineAlign = setting;
  47420. this.hasBeenReset = true;
  47421. }
  47422. }
  47423. },
  47424. "position": {
  47425. enumerable: true,
  47426. get: function() {
  47427. return _position;
  47428. },
  47429. set: function(value) {
  47430. if (value < 0 || value > 100) {
  47431. throw new Error("Position must be between 0 and 100.");
  47432. }
  47433. _position = value;
  47434. this.hasBeenReset = true;
  47435. }
  47436. },
  47437. "positionAlign": {
  47438. enumerable: true,
  47439. get: function() {
  47440. return _positionAlign;
  47441. },
  47442. set: function(value) {
  47443. var setting = findAlignSetting(value);
  47444. if (!setting) {
  47445. console.warn("positionAlign: an invalid or illegal string was specified.");
  47446. } else {
  47447. _positionAlign = setting;
  47448. this.hasBeenReset = true;
  47449. }
  47450. }
  47451. },
  47452. "size": {
  47453. enumerable: true,
  47454. get: function() {
  47455. return _size;
  47456. },
  47457. set: function(value) {
  47458. if (value < 0 || value > 100) {
  47459. throw new Error("Size must be between 0 and 100.");
  47460. }
  47461. _size = value;
  47462. this.hasBeenReset = true;
  47463. }
  47464. },
  47465. "align": {
  47466. enumerable: true,
  47467. get: function() {
  47468. return _align;
  47469. },
  47470. set: function(value) {
  47471. var setting = findAlignSetting(value);
  47472. if (!setting) {
  47473. throw new SyntaxError("align: an invalid or illegal alignment string was specified.");
  47474. }
  47475. _align = setting;
  47476. this.hasBeenReset = true;
  47477. }
  47478. }
  47479. });
  47480. this.displayState = void 0;
  47481. }
  47482. VTTCue.prototype.getCueAsHTML = function() {
  47483. return WebVTT.convertCueToDOMTree(window, this.text);
  47484. };
  47485. var vttcue = VTTCue;
  47486. var scrollSetting = {
  47487. "": true,
  47488. "up": true
  47489. };
  47490. function findScrollSetting(value) {
  47491. if (typeof value !== "string") {
  47492. return false;
  47493. }
  47494. var scroll = scrollSetting[value.toLowerCase()];
  47495. return scroll ? value.toLowerCase() : false;
  47496. }
  47497. function isValidPercentValue(value) {
  47498. return typeof value === "number" && (value >= 0 && value <= 100);
  47499. }
  47500. function VTTRegion() {
  47501. var _width = 100;
  47502. var _lines = 3;
  47503. var _regionAnchorX = 0;
  47504. var _regionAnchorY = 100;
  47505. var _viewportAnchorX = 0;
  47506. var _viewportAnchorY = 100;
  47507. var _scroll = "";
  47508. Object.defineProperties(this, {
  47509. "width": {
  47510. enumerable: true,
  47511. get: function() {
  47512. return _width;
  47513. },
  47514. set: function(value) {
  47515. if (!isValidPercentValue(value)) {
  47516. throw new Error("Width must be between 0 and 100.");
  47517. }
  47518. _width = value;
  47519. }
  47520. },
  47521. "lines": {
  47522. enumerable: true,
  47523. get: function() {
  47524. return _lines;
  47525. },
  47526. set: function(value) {
  47527. if (typeof value !== "number") {
  47528. throw new TypeError("Lines must be set to a number.");
  47529. }
  47530. _lines = value;
  47531. }
  47532. },
  47533. "regionAnchorY": {
  47534. enumerable: true,
  47535. get: function() {
  47536. return _regionAnchorY;
  47537. },
  47538. set: function(value) {
  47539. if (!isValidPercentValue(value)) {
  47540. throw new Error("RegionAnchorX must be between 0 and 100.");
  47541. }
  47542. _regionAnchorY = value;
  47543. }
  47544. },
  47545. "regionAnchorX": {
  47546. enumerable: true,
  47547. get: function() {
  47548. return _regionAnchorX;
  47549. },
  47550. set: function(value) {
  47551. if (!isValidPercentValue(value)) {
  47552. throw new Error("RegionAnchorY must be between 0 and 100.");
  47553. }
  47554. _regionAnchorX = value;
  47555. }
  47556. },
  47557. "viewportAnchorY": {
  47558. enumerable: true,
  47559. get: function() {
  47560. return _viewportAnchorY;
  47561. },
  47562. set: function(value) {
  47563. if (!isValidPercentValue(value)) {
  47564. throw new Error("ViewportAnchorY must be between 0 and 100.");
  47565. }
  47566. _viewportAnchorY = value;
  47567. }
  47568. },
  47569. "viewportAnchorX": {
  47570. enumerable: true,
  47571. get: function() {
  47572. return _viewportAnchorX;
  47573. },
  47574. set: function(value) {
  47575. if (!isValidPercentValue(value)) {
  47576. throw new Error("ViewportAnchorX must be between 0 and 100.");
  47577. }
  47578. _viewportAnchorX = value;
  47579. }
  47580. },
  47581. "scroll": {
  47582. enumerable: true,
  47583. get: function() {
  47584. return _scroll;
  47585. },
  47586. set: function(value) {
  47587. var setting = findScrollSetting(value);
  47588. if (setting === false) {
  47589. console.warn("Scroll: an invalid or illegal string was specified.");
  47590. } else {
  47591. _scroll = setting;
  47592. }
  47593. }
  47594. }
  47595. });
  47596. }
  47597. var vttregion = VTTRegion;
  47598. var window$1 = window_1;
  47599. var vttjs = browserIndex.exports = {
  47600. WebVTT: vtt$1,
  47601. VTTCue: vttcue,
  47602. VTTRegion: vttregion
  47603. };
  47604. window$1.vttjs = vttjs;
  47605. window$1.WebVTT = vttjs.WebVTT;
  47606. var cueShim = vttjs.VTTCue;
  47607. var regionShim = vttjs.VTTRegion;
  47608. var nativeVTTCue = window$1.VTTCue;
  47609. var nativeVTTRegion = window$1.VTTRegion;
  47610. vttjs.shim = function() {
  47611. window$1.VTTCue = cueShim;
  47612. window$1.VTTRegion = regionShim;
  47613. };
  47614. vttjs.restore = function() {
  47615. window$1.VTTCue = nativeVTTCue;
  47616. window$1.VTTRegion = nativeVTTRegion;
  47617. };
  47618. if (!window$1.VTTCue) {
  47619. vttjs.shim();
  47620. }
  47621. var vtt = browserIndex.exports;
  47622. var urlToolkit = { exports: {} };
  47623. (function(module2, exports2) {
  47624. (function(root2) {
  47625. var URL_REGEX = /^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/;
  47626. var FIRST_SEGMENT_REGEX = /^(?=([^\/?#]*))\1([^]*)$/;
  47627. var SLASH_DOT_REGEX = /(?:\/|^)\.(?=\/)/g;
  47628. var SLASH_DOT_DOT_REGEX = /(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g;
  47629. var URLToolkit2 = {
  47630. buildAbsoluteURL: function(baseURL, relativeURL, opts) {
  47631. opts = opts || {};
  47632. baseURL = baseURL.trim();
  47633. relativeURL = relativeURL.trim();
  47634. if (!relativeURL) {
  47635. if (!opts.alwaysNormalize) {
  47636. return baseURL;
  47637. }
  47638. var basePartsForNormalise = URLToolkit2.parseURL(baseURL);
  47639. if (!basePartsForNormalise) {
  47640. throw new Error("Error trying to parse base URL.");
  47641. }
  47642. basePartsForNormalise.path = URLToolkit2.normalizePath(
  47643. basePartsForNormalise.path
  47644. );
  47645. return URLToolkit2.buildURLFromParts(basePartsForNormalise);
  47646. }
  47647. var relativeParts = URLToolkit2.parseURL(relativeURL);
  47648. if (!relativeParts) {
  47649. throw new Error("Error trying to parse relative URL.");
  47650. }
  47651. if (relativeParts.scheme) {
  47652. if (!opts.alwaysNormalize) {
  47653. return relativeURL;
  47654. }
  47655. relativeParts.path = URLToolkit2.normalizePath(relativeParts.path);
  47656. return URLToolkit2.buildURLFromParts(relativeParts);
  47657. }
  47658. var baseParts = URLToolkit2.parseURL(baseURL);
  47659. if (!baseParts) {
  47660. throw new Error("Error trying to parse base URL.");
  47661. }
  47662. if (!baseParts.netLoc && baseParts.path && baseParts.path[0] !== "/") {
  47663. var pathParts = FIRST_SEGMENT_REGEX.exec(baseParts.path);
  47664. baseParts.netLoc = pathParts[1];
  47665. baseParts.path = pathParts[2];
  47666. }
  47667. if (baseParts.netLoc && !baseParts.path) {
  47668. baseParts.path = "/";
  47669. }
  47670. var builtParts = {
  47671. scheme: baseParts.scheme,
  47672. netLoc: relativeParts.netLoc,
  47673. path: null,
  47674. params: relativeParts.params,
  47675. query: relativeParts.query,
  47676. fragment: relativeParts.fragment
  47677. };
  47678. if (!relativeParts.netLoc) {
  47679. builtParts.netLoc = baseParts.netLoc;
  47680. if (relativeParts.path[0] !== "/") {
  47681. if (!relativeParts.path) {
  47682. builtParts.path = baseParts.path;
  47683. if (!relativeParts.params) {
  47684. builtParts.params = baseParts.params;
  47685. if (!relativeParts.query) {
  47686. builtParts.query = baseParts.query;
  47687. }
  47688. }
  47689. } else {
  47690. var baseURLPath = baseParts.path;
  47691. var newPath = baseURLPath.substring(0, baseURLPath.lastIndexOf("/") + 1) + relativeParts.path;
  47692. builtParts.path = URLToolkit2.normalizePath(newPath);
  47693. }
  47694. }
  47695. }
  47696. if (builtParts.path === null) {
  47697. builtParts.path = opts.alwaysNormalize ? URLToolkit2.normalizePath(relativeParts.path) : relativeParts.path;
  47698. }
  47699. return URLToolkit2.buildURLFromParts(builtParts);
  47700. },
  47701. parseURL: function(url) {
  47702. var parts = URL_REGEX.exec(url);
  47703. if (!parts) {
  47704. return null;
  47705. }
  47706. return {
  47707. scheme: parts[1] || "",
  47708. netLoc: parts[2] || "",
  47709. path: parts[3] || "",
  47710. params: parts[4] || "",
  47711. query: parts[5] || "",
  47712. fragment: parts[6] || ""
  47713. };
  47714. },
  47715. normalizePath: function(path) {
  47716. path = path.split("").reverse().join("").replace(SLASH_DOT_REGEX, "");
  47717. while (path.length !== (path = path.replace(SLASH_DOT_DOT_REGEX, "")).length) {
  47718. }
  47719. return path.split("").reverse().join("");
  47720. },
  47721. buildURLFromParts: function(parts) {
  47722. return parts.scheme + parts.netLoc + parts.path + parts.params + parts.query + parts.fragment;
  47723. }
  47724. };
  47725. module2.exports = URLToolkit2;
  47726. })();
  47727. })(urlToolkit);
  47728. var URLToolkit = urlToolkit.exports;
  47729. var DEFAULT_LOCATION$2 = "http://example.com";
  47730. var resolveUrl$4 = function resolveUrl(baseUrl, relativeUrl) {
  47731. if (/^[a-z]+:/i.test(relativeUrl)) {
  47732. return relativeUrl;
  47733. }
  47734. if (/^data:/.test(baseUrl)) {
  47735. baseUrl = window_1.location && window_1.location.href || "";
  47736. }
  47737. var nativeURL = typeof window_1.URL === "function";
  47738. var protocolLess = /^\/\//.test(baseUrl);
  47739. var removeLocation = !window_1.location && !/\/\//i.test(baseUrl);
  47740. if (nativeURL) {
  47741. baseUrl = new window_1.URL(baseUrl, window_1.location || DEFAULT_LOCATION$2);
  47742. } else if (!/\/\//i.test(baseUrl)) {
  47743. baseUrl = URLToolkit.buildAbsoluteURL(window_1.location && window_1.location.href || "", baseUrl);
  47744. }
  47745. if (nativeURL) {
  47746. var newUrl = new URL(relativeUrl, baseUrl);
  47747. if (removeLocation) {
  47748. return newUrl.href.slice(DEFAULT_LOCATION$2.length);
  47749. } else if (protocolLess) {
  47750. return newUrl.href.slice(newUrl.protocol.length);
  47751. }
  47752. return newUrl.href;
  47753. }
  47754. return URLToolkit.buildAbsoluteURL(baseUrl, relativeUrl);
  47755. };
  47756. var Stream$1 = /* @__PURE__ */ function() {
  47757. function Stream2() {
  47758. this.listeners = {};
  47759. }
  47760. var _proto = Stream2.prototype;
  47761. _proto.on = function on3(type2, listener) {
  47762. if (!this.listeners[type2]) {
  47763. this.listeners[type2] = [];
  47764. }
  47765. this.listeners[type2].push(listener);
  47766. };
  47767. _proto.off = function off2(type2, listener) {
  47768. if (!this.listeners[type2]) {
  47769. return false;
  47770. }
  47771. var index2 = this.listeners[type2].indexOf(listener);
  47772. this.listeners[type2] = this.listeners[type2].slice(0);
  47773. this.listeners[type2].splice(index2, 1);
  47774. return index2 > -1;
  47775. };
  47776. _proto.trigger = function trigger2(type2) {
  47777. var callbacks = this.listeners[type2];
  47778. if (!callbacks) {
  47779. return;
  47780. }
  47781. if (arguments.length === 2) {
  47782. var length = callbacks.length;
  47783. for (var i2 = 0; i2 < length; ++i2) {
  47784. callbacks[i2].call(this, arguments[1]);
  47785. }
  47786. } else {
  47787. var args = Array.prototype.slice.call(arguments, 1);
  47788. var _length = callbacks.length;
  47789. for (var _i = 0; _i < _length; ++_i) {
  47790. callbacks[_i].apply(this, args);
  47791. }
  47792. }
  47793. };
  47794. _proto.dispose = function dispose() {
  47795. this.listeners = {};
  47796. };
  47797. _proto.pipe = function pipe(destination2) {
  47798. this.on("data", function(data) {
  47799. destination2.push(data);
  47800. });
  47801. };
  47802. return Stream2;
  47803. }();
  47804. var atob$2 = function atob(s) {
  47805. return window_1.atob ? window_1.atob(s) : Buffer.from(s, "base64").toString("binary");
  47806. };
  47807. function decodeB64ToUint8Array$2(b64Text) {
  47808. var decodedString = atob$2(b64Text);
  47809. var array = new Uint8Array(decodedString.length);
  47810. for (var i2 = 0; i2 < decodedString.length; i2++) {
  47811. array[i2] = decodedString.charCodeAt(i2);
  47812. }
  47813. return array;
  47814. }
  47815. /*! @name m3u8-parser @version 6.1.0 @license Apache-2.0 */
  47816. class LineStream$1 extends Stream$1 {
  47817. constructor() {
  47818. super();
  47819. this.buffer = "";
  47820. }
  47821. push(data) {
  47822. let nextNewline;
  47823. this.buffer += data;
  47824. nextNewline = this.buffer.indexOf("\n");
  47825. for (; nextNewline > -1; nextNewline = this.buffer.indexOf("\n")) {
  47826. this.trigger("data", this.buffer.substring(0, nextNewline));
  47827. this.buffer = this.buffer.substring(nextNewline + 1);
  47828. }
  47829. }
  47830. }
  47831. const TAB$1 = String.fromCharCode(9);
  47832. const parseByterange$1 = function(byterangeString) {
  47833. const match = /([0-9.]*)?@?([0-9.]*)?/.exec(byterangeString || "");
  47834. const result = {};
  47835. if (match[1]) {
  47836. result.length = parseInt(match[1], 10);
  47837. }
  47838. if (match[2]) {
  47839. result.offset = parseInt(match[2], 10);
  47840. }
  47841. return result;
  47842. };
  47843. const attributeSeparator$1 = function() {
  47844. const key = "[^=]*";
  47845. const value = '"[^"]*"|[^,]*';
  47846. const keyvalue = "(?:" + key + ")=(?:" + value + ")";
  47847. return new RegExp("(?:^|,)(" + keyvalue + ")");
  47848. };
  47849. const parseAttributes$3 = function(attributes) {
  47850. const result = {};
  47851. if (!attributes) {
  47852. return result;
  47853. }
  47854. const attrs = attributes.split(attributeSeparator$1());
  47855. let i2 = attrs.length;
  47856. let attr;
  47857. while (i2--) {
  47858. if (attrs[i2] === "") {
  47859. continue;
  47860. }
  47861. attr = /([^=]*)=(.*)/.exec(attrs[i2]).slice(1);
  47862. attr[0] = attr[0].replace(/^\s+|\s+$/g, "");
  47863. attr[1] = attr[1].replace(/^\s+|\s+$/g, "");
  47864. attr[1] = attr[1].replace(/^['"](.*)['"]$/g, "$1");
  47865. result[attr[0]] = attr[1];
  47866. }
  47867. return result;
  47868. };
  47869. class ParseStream$1 extends Stream$1 {
  47870. constructor() {
  47871. super();
  47872. this.customParsers = [];
  47873. this.tagMappers = [];
  47874. }
  47875. push(line) {
  47876. let match;
  47877. let event2;
  47878. line = line.trim();
  47879. if (line.length === 0) {
  47880. return;
  47881. }
  47882. if (line[0] !== "#") {
  47883. this.trigger("data", {
  47884. type: "uri",
  47885. uri: line
  47886. });
  47887. return;
  47888. }
  47889. const newLines = this.tagMappers.reduce((acc, mapper) => {
  47890. const mappedLine = mapper(line);
  47891. if (mappedLine === line) {
  47892. return acc;
  47893. }
  47894. return acc.concat([mappedLine]);
  47895. }, [line]);
  47896. newLines.forEach((newLine) => {
  47897. for (let i2 = 0; i2 < this.customParsers.length; i2++) {
  47898. if (this.customParsers[i2].call(this, newLine)) {
  47899. return;
  47900. }
  47901. }
  47902. if (newLine.indexOf("#EXT") !== 0) {
  47903. this.trigger("data", {
  47904. type: "comment",
  47905. text: newLine.slice(1)
  47906. });
  47907. return;
  47908. }
  47909. newLine = newLine.replace("\r", "");
  47910. match = /^#EXTM3U/.exec(newLine);
  47911. if (match) {
  47912. this.trigger("data", {
  47913. type: "tag",
  47914. tagType: "m3u"
  47915. });
  47916. return;
  47917. }
  47918. match = /^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(newLine);
  47919. if (match) {
  47920. event2 = {
  47921. type: "tag",
  47922. tagType: "inf"
  47923. };
  47924. if (match[1]) {
  47925. event2.duration = parseFloat(match[1]);
  47926. }
  47927. if (match[2]) {
  47928. event2.title = match[2];
  47929. }
  47930. this.trigger("data", event2);
  47931. return;
  47932. }
  47933. match = /^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(newLine);
  47934. if (match) {
  47935. event2 = {
  47936. type: "tag",
  47937. tagType: "targetduration"
  47938. };
  47939. if (match[1]) {
  47940. event2.duration = parseInt(match[1], 10);
  47941. }
  47942. this.trigger("data", event2);
  47943. return;
  47944. }
  47945. match = /^#EXT-X-VERSION:([0-9.]*)?/.exec(newLine);
  47946. if (match) {
  47947. event2 = {
  47948. type: "tag",
  47949. tagType: "version"
  47950. };
  47951. if (match[1]) {
  47952. event2.version = parseInt(match[1], 10);
  47953. }
  47954. this.trigger("data", event2);
  47955. return;
  47956. }
  47957. match = /^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(newLine);
  47958. if (match) {
  47959. event2 = {
  47960. type: "tag",
  47961. tagType: "media-sequence"
  47962. };
  47963. if (match[1]) {
  47964. event2.number = parseInt(match[1], 10);
  47965. }
  47966. this.trigger("data", event2);
  47967. return;
  47968. }
  47969. match = /^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(newLine);
  47970. if (match) {
  47971. event2 = {
  47972. type: "tag",
  47973. tagType: "discontinuity-sequence"
  47974. };
  47975. if (match[1]) {
  47976. event2.number = parseInt(match[1], 10);
  47977. }
  47978. this.trigger("data", event2);
  47979. return;
  47980. }
  47981. match = /^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(newLine);
  47982. if (match) {
  47983. event2 = {
  47984. type: "tag",
  47985. tagType: "playlist-type"
  47986. };
  47987. if (match[1]) {
  47988. event2.playlistType = match[1];
  47989. }
  47990. this.trigger("data", event2);
  47991. return;
  47992. }
  47993. match = /^#EXT-X-BYTERANGE:(.*)?$/.exec(newLine);
  47994. if (match) {
  47995. event2 = _extends$2(parseByterange$1(match[1]), {
  47996. type: "tag",
  47997. tagType: "byterange"
  47998. });
  47999. this.trigger("data", event2);
  48000. return;
  48001. }
  48002. match = /^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(newLine);
  48003. if (match) {
  48004. event2 = {
  48005. type: "tag",
  48006. tagType: "allow-cache"
  48007. };
  48008. if (match[1]) {
  48009. event2.allowed = !/NO/.test(match[1]);
  48010. }
  48011. this.trigger("data", event2);
  48012. return;
  48013. }
  48014. match = /^#EXT-X-MAP:(.*)$/.exec(newLine);
  48015. if (match) {
  48016. event2 = {
  48017. type: "tag",
  48018. tagType: "map"
  48019. };
  48020. if (match[1]) {
  48021. const attributes = parseAttributes$3(match[1]);
  48022. if (attributes.URI) {
  48023. event2.uri = attributes.URI;
  48024. }
  48025. if (attributes.BYTERANGE) {
  48026. event2.byterange = parseByterange$1(attributes.BYTERANGE);
  48027. }
  48028. }
  48029. this.trigger("data", event2);
  48030. return;
  48031. }
  48032. match = /^#EXT-X-STREAM-INF:(.*)$/.exec(newLine);
  48033. if (match) {
  48034. event2 = {
  48035. type: "tag",
  48036. tagType: "stream-inf"
  48037. };
  48038. if (match[1]) {
  48039. event2.attributes = parseAttributes$3(match[1]);
  48040. if (event2.attributes.RESOLUTION) {
  48041. const split2 = event2.attributes.RESOLUTION.split("x");
  48042. const resolution = {};
  48043. if (split2[0]) {
  48044. resolution.width = parseInt(split2[0], 10);
  48045. }
  48046. if (split2[1]) {
  48047. resolution.height = parseInt(split2[1], 10);
  48048. }
  48049. event2.attributes.RESOLUTION = resolution;
  48050. }
  48051. if (event2.attributes.BANDWIDTH) {
  48052. event2.attributes.BANDWIDTH = parseInt(event2.attributes.BANDWIDTH, 10);
  48053. }
  48054. if (event2.attributes["FRAME-RATE"]) {
  48055. event2.attributes["FRAME-RATE"] = parseFloat(event2.attributes["FRAME-RATE"]);
  48056. }
  48057. if (event2.attributes["PROGRAM-ID"]) {
  48058. event2.attributes["PROGRAM-ID"] = parseInt(event2.attributes["PROGRAM-ID"], 10);
  48059. }
  48060. }
  48061. this.trigger("data", event2);
  48062. return;
  48063. }
  48064. match = /^#EXT-X-MEDIA:(.*)$/.exec(newLine);
  48065. if (match) {
  48066. event2 = {
  48067. type: "tag",
  48068. tagType: "media"
  48069. };
  48070. if (match[1]) {
  48071. event2.attributes = parseAttributes$3(match[1]);
  48072. }
  48073. this.trigger("data", event2);
  48074. return;
  48075. }
  48076. match = /^#EXT-X-ENDLIST/.exec(newLine);
  48077. if (match) {
  48078. this.trigger("data", {
  48079. type: "tag",
  48080. tagType: "endlist"
  48081. });
  48082. return;
  48083. }
  48084. match = /^#EXT-X-DISCONTINUITY/.exec(newLine);
  48085. if (match) {
  48086. this.trigger("data", {
  48087. type: "tag",
  48088. tagType: "discontinuity"
  48089. });
  48090. return;
  48091. }
  48092. match = /^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(newLine);
  48093. if (match) {
  48094. event2 = {
  48095. type: "tag",
  48096. tagType: "program-date-time"
  48097. };
  48098. if (match[1]) {
  48099. event2.dateTimeString = match[1];
  48100. event2.dateTimeObject = new Date(match[1]);
  48101. }
  48102. this.trigger("data", event2);
  48103. return;
  48104. }
  48105. match = /^#EXT-X-KEY:(.*)$/.exec(newLine);
  48106. if (match) {
  48107. event2 = {
  48108. type: "tag",
  48109. tagType: "key"
  48110. };
  48111. if (match[1]) {
  48112. event2.attributes = parseAttributes$3(match[1]);
  48113. if (event2.attributes.IV) {
  48114. if (event2.attributes.IV.substring(0, 2).toLowerCase() === "0x") {
  48115. event2.attributes.IV = event2.attributes.IV.substring(2);
  48116. }
  48117. event2.attributes.IV = event2.attributes.IV.match(/.{8}/g);
  48118. event2.attributes.IV[0] = parseInt(event2.attributes.IV[0], 16);
  48119. event2.attributes.IV[1] = parseInt(event2.attributes.IV[1], 16);
  48120. event2.attributes.IV[2] = parseInt(event2.attributes.IV[2], 16);
  48121. event2.attributes.IV[3] = parseInt(event2.attributes.IV[3], 16);
  48122. event2.attributes.IV = new Uint32Array(event2.attributes.IV);
  48123. }
  48124. }
  48125. this.trigger("data", event2);
  48126. return;
  48127. }
  48128. match = /^#EXT-X-START:(.*)$/.exec(newLine);
  48129. if (match) {
  48130. event2 = {
  48131. type: "tag",
  48132. tagType: "start"
  48133. };
  48134. if (match[1]) {
  48135. event2.attributes = parseAttributes$3(match[1]);
  48136. event2.attributes["TIME-OFFSET"] = parseFloat(event2.attributes["TIME-OFFSET"]);
  48137. event2.attributes.PRECISE = /YES/.test(event2.attributes.PRECISE);
  48138. }
  48139. this.trigger("data", event2);
  48140. return;
  48141. }
  48142. match = /^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(newLine);
  48143. if (match) {
  48144. event2 = {
  48145. type: "tag",
  48146. tagType: "cue-out-cont"
  48147. };
  48148. if (match[1]) {
  48149. event2.data = match[1];
  48150. } else {
  48151. event2.data = "";
  48152. }
  48153. this.trigger("data", event2);
  48154. return;
  48155. }
  48156. match = /^#EXT-X-CUE-OUT:(.*)?$/.exec(newLine);
  48157. if (match) {
  48158. event2 = {
  48159. type: "tag",
  48160. tagType: "cue-out"
  48161. };
  48162. if (match[1]) {
  48163. event2.data = match[1];
  48164. } else {
  48165. event2.data = "";
  48166. }
  48167. this.trigger("data", event2);
  48168. return;
  48169. }
  48170. match = /^#EXT-X-CUE-IN:(.*)?$/.exec(newLine);
  48171. if (match) {
  48172. event2 = {
  48173. type: "tag",
  48174. tagType: "cue-in"
  48175. };
  48176. if (match[1]) {
  48177. event2.data = match[1];
  48178. } else {
  48179. event2.data = "";
  48180. }
  48181. this.trigger("data", event2);
  48182. return;
  48183. }
  48184. match = /^#EXT-X-SKIP:(.*)$/.exec(newLine);
  48185. if (match && match[1]) {
  48186. event2 = {
  48187. type: "tag",
  48188. tagType: "skip"
  48189. };
  48190. event2.attributes = parseAttributes$3(match[1]);
  48191. if (event2.attributes.hasOwnProperty("SKIPPED-SEGMENTS")) {
  48192. event2.attributes["SKIPPED-SEGMENTS"] = parseInt(event2.attributes["SKIPPED-SEGMENTS"], 10);
  48193. }
  48194. if (event2.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")) {
  48195. event2.attributes["RECENTLY-REMOVED-DATERANGES"] = event2.attributes["RECENTLY-REMOVED-DATERANGES"].split(TAB$1);
  48196. }
  48197. this.trigger("data", event2);
  48198. return;
  48199. }
  48200. match = /^#EXT-X-PART:(.*)$/.exec(newLine);
  48201. if (match && match[1]) {
  48202. event2 = {
  48203. type: "tag",
  48204. tagType: "part"
  48205. };
  48206. event2.attributes = parseAttributes$3(match[1]);
  48207. ["DURATION"].forEach(function(key) {
  48208. if (event2.attributes.hasOwnProperty(key)) {
  48209. event2.attributes[key] = parseFloat(event2.attributes[key]);
  48210. }
  48211. });
  48212. ["INDEPENDENT", "GAP"].forEach(function(key) {
  48213. if (event2.attributes.hasOwnProperty(key)) {
  48214. event2.attributes[key] = /YES/.test(event2.attributes[key]);
  48215. }
  48216. });
  48217. if (event2.attributes.hasOwnProperty("BYTERANGE")) {
  48218. event2.attributes.byterange = parseByterange$1(event2.attributes.BYTERANGE);
  48219. }
  48220. this.trigger("data", event2);
  48221. return;
  48222. }
  48223. match = /^#EXT-X-SERVER-CONTROL:(.*)$/.exec(newLine);
  48224. if (match && match[1]) {
  48225. event2 = {
  48226. type: "tag",
  48227. tagType: "server-control"
  48228. };
  48229. event2.attributes = parseAttributes$3(match[1]);
  48230. ["CAN-SKIP-UNTIL", "PART-HOLD-BACK", "HOLD-BACK"].forEach(function(key) {
  48231. if (event2.attributes.hasOwnProperty(key)) {
  48232. event2.attributes[key] = parseFloat(event2.attributes[key]);
  48233. }
  48234. });
  48235. ["CAN-SKIP-DATERANGES", "CAN-BLOCK-RELOAD"].forEach(function(key) {
  48236. if (event2.attributes.hasOwnProperty(key)) {
  48237. event2.attributes[key] = /YES/.test(event2.attributes[key]);
  48238. }
  48239. });
  48240. this.trigger("data", event2);
  48241. return;
  48242. }
  48243. match = /^#EXT-X-PART-INF:(.*)$/.exec(newLine);
  48244. if (match && match[1]) {
  48245. event2 = {
  48246. type: "tag",
  48247. tagType: "part-inf"
  48248. };
  48249. event2.attributes = parseAttributes$3(match[1]);
  48250. ["PART-TARGET"].forEach(function(key) {
  48251. if (event2.attributes.hasOwnProperty(key)) {
  48252. event2.attributes[key] = parseFloat(event2.attributes[key]);
  48253. }
  48254. });
  48255. this.trigger("data", event2);
  48256. return;
  48257. }
  48258. match = /^#EXT-X-PRELOAD-HINT:(.*)$/.exec(newLine);
  48259. if (match && match[1]) {
  48260. event2 = {
  48261. type: "tag",
  48262. tagType: "preload-hint"
  48263. };
  48264. event2.attributes = parseAttributes$3(match[1]);
  48265. ["BYTERANGE-START", "BYTERANGE-LENGTH"].forEach(function(key) {
  48266. if (event2.attributes.hasOwnProperty(key)) {
  48267. event2.attributes[key] = parseInt(event2.attributes[key], 10);
  48268. const subkey = key === "BYTERANGE-LENGTH" ? "length" : "offset";
  48269. event2.attributes.byterange = event2.attributes.byterange || {};
  48270. event2.attributes.byterange[subkey] = event2.attributes[key];
  48271. delete event2.attributes[key];
  48272. }
  48273. });
  48274. this.trigger("data", event2);
  48275. return;
  48276. }
  48277. match = /^#EXT-X-RENDITION-REPORT:(.*)$/.exec(newLine);
  48278. if (match && match[1]) {
  48279. event2 = {
  48280. type: "tag",
  48281. tagType: "rendition-report"
  48282. };
  48283. event2.attributes = parseAttributes$3(match[1]);
  48284. ["LAST-MSN", "LAST-PART"].forEach(function(key) {
  48285. if (event2.attributes.hasOwnProperty(key)) {
  48286. event2.attributes[key] = parseInt(event2.attributes[key], 10);
  48287. }
  48288. });
  48289. this.trigger("data", event2);
  48290. return;
  48291. }
  48292. match = /^#EXT-X-DATERANGE:(.*)$/.exec(newLine);
  48293. if (match && match[1]) {
  48294. event2 = {
  48295. type: "tag",
  48296. tagType: "daterange"
  48297. };
  48298. event2.attributes = parseAttributes$3(match[1]);
  48299. ["ID", "CLASS"].forEach(function(key) {
  48300. if (event2.attributes.hasOwnProperty(key)) {
  48301. event2.attributes[key] = String(event2.attributes[key]);
  48302. }
  48303. });
  48304. ["START-DATE", "END-DATE"].forEach(function(key) {
  48305. if (event2.attributes.hasOwnProperty(key)) {
  48306. event2.attributes[key] = new Date(event2.attributes[key]);
  48307. }
  48308. });
  48309. ["DURATION", "PLANNED-DURATION"].forEach(function(key) {
  48310. if (event2.attributes.hasOwnProperty(key)) {
  48311. event2.attributes[key] = parseFloat(event2.attributes[key]);
  48312. }
  48313. });
  48314. ["END-ON-NEXT"].forEach(function(key) {
  48315. if (event2.attributes.hasOwnProperty(key)) {
  48316. event2.attributes[key] = /YES/i.test(event2.attributes[key]);
  48317. }
  48318. });
  48319. ["SCTE35-CMD", " SCTE35-OUT", "SCTE35-IN"].forEach(function(key) {
  48320. if (event2.attributes.hasOwnProperty(key)) {
  48321. event2.attributes[key] = event2.attributes[key].toString(16);
  48322. }
  48323. });
  48324. const clientAttributePattern = /^X-([A-Z]+-)+[A-Z]+$/;
  48325. for (const key in event2.attributes) {
  48326. if (!clientAttributePattern.test(key)) {
  48327. continue;
  48328. }
  48329. const isHexaDecimal = /[0-9A-Fa-f]{6}/g.test(event2.attributes[key]);
  48330. const isDecimalFloating = /^\d+(\.\d+)?$/.test(event2.attributes[key]);
  48331. event2.attributes[key] = isHexaDecimal ? event2.attributes[key].toString(16) : isDecimalFloating ? parseFloat(event2.attributes[key]) : String(event2.attributes[key]);
  48332. }
  48333. this.trigger("data", event2);
  48334. return;
  48335. }
  48336. this.trigger("data", {
  48337. type: "tag",
  48338. data: newLine.slice(4)
  48339. });
  48340. });
  48341. }
  48342. addParser({
  48343. expression,
  48344. customType,
  48345. dataParser,
  48346. segment
  48347. }) {
  48348. if (typeof dataParser !== "function") {
  48349. dataParser = (line) => line;
  48350. }
  48351. this.customParsers.push((line) => {
  48352. const match = expression.exec(line);
  48353. if (match) {
  48354. this.trigger("data", {
  48355. type: "custom",
  48356. data: dataParser(line),
  48357. customType,
  48358. segment
  48359. });
  48360. return true;
  48361. }
  48362. });
  48363. }
  48364. addTagMapper({
  48365. expression,
  48366. map
  48367. }) {
  48368. const mapFn = (line) => {
  48369. if (expression.test(line)) {
  48370. return map(line);
  48371. }
  48372. return line;
  48373. };
  48374. this.tagMappers.push(mapFn);
  48375. }
  48376. }
  48377. const camelCase$1 = (str) => str.toLowerCase().replace(/-(\w)/g, (a) => a[1].toUpperCase());
  48378. const camelCaseKeys$1 = function(attributes) {
  48379. const result = {};
  48380. Object.keys(attributes).forEach(function(key) {
  48381. result[camelCase$1(key)] = attributes[key];
  48382. });
  48383. return result;
  48384. };
  48385. const setHoldBack$1 = function(manifest) {
  48386. const {
  48387. serverControl,
  48388. targetDuration,
  48389. partTargetDuration
  48390. } = manifest;
  48391. if (!serverControl) {
  48392. return;
  48393. }
  48394. const tag = "#EXT-X-SERVER-CONTROL";
  48395. const hb = "holdBack";
  48396. const phb = "partHoldBack";
  48397. const minTargetDuration = targetDuration && targetDuration * 3;
  48398. const minPartDuration = partTargetDuration && partTargetDuration * 2;
  48399. if (targetDuration && !serverControl.hasOwnProperty(hb)) {
  48400. serverControl[hb] = minTargetDuration;
  48401. this.trigger("info", {
  48402. message: `${tag} defaulting HOLD-BACK to targetDuration * 3 (${minTargetDuration}).`
  48403. });
  48404. }
  48405. if (minTargetDuration && serverControl[hb] < minTargetDuration) {
  48406. this.trigger("warn", {
  48407. message: `${tag} clamping HOLD-BACK (${serverControl[hb]}) to targetDuration * 3 (${minTargetDuration})`
  48408. });
  48409. serverControl[hb] = minTargetDuration;
  48410. }
  48411. if (partTargetDuration && !serverControl.hasOwnProperty(phb)) {
  48412. serverControl[phb] = partTargetDuration * 3;
  48413. this.trigger("info", {
  48414. message: `${tag} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${serverControl[phb]}).`
  48415. });
  48416. }
  48417. if (partTargetDuration && serverControl[phb] < minPartDuration) {
  48418. this.trigger("warn", {
  48419. message: `${tag} clamping PART-HOLD-BACK (${serverControl[phb]}) to partTargetDuration * 2 (${minPartDuration}).`
  48420. });
  48421. serverControl[phb] = minPartDuration;
  48422. }
  48423. };
  48424. class Parser$1 extends Stream$1 {
  48425. constructor() {
  48426. super();
  48427. this.lineStream = new LineStream$1();
  48428. this.parseStream = new ParseStream$1();
  48429. this.lineStream.pipe(this.parseStream);
  48430. const self2 = this;
  48431. const uris = [];
  48432. let currentUri = {};
  48433. let currentMap;
  48434. let key;
  48435. let hasParts = false;
  48436. const noop2 = function() {
  48437. };
  48438. const defaultMediaGroups = {
  48439. "AUDIO": {},
  48440. "VIDEO": {},
  48441. "CLOSED-CAPTIONS": {},
  48442. "SUBTITLES": {}
  48443. };
  48444. const widevineUuid = "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";
  48445. let currentTimeline = 0;
  48446. this.manifest = {
  48447. allowCache: true,
  48448. discontinuityStarts: [],
  48449. segments: []
  48450. };
  48451. let lastByterangeEnd = 0;
  48452. let lastPartByterangeEnd = 0;
  48453. const daterangeTags = {};
  48454. this.on("end", () => {
  48455. if (currentUri.uri || !currentUri.parts && !currentUri.preloadHints) {
  48456. return;
  48457. }
  48458. if (!currentUri.map && currentMap) {
  48459. currentUri.map = currentMap;
  48460. }
  48461. if (!currentUri.key && key) {
  48462. currentUri.key = key;
  48463. }
  48464. if (!currentUri.timeline && typeof currentTimeline === "number") {
  48465. currentUri.timeline = currentTimeline;
  48466. }
  48467. this.manifest.preloadSegment = currentUri;
  48468. });
  48469. this.parseStream.on("data", function(entry) {
  48470. let mediaGroup;
  48471. let rendition;
  48472. ({
  48473. tag() {
  48474. ({
  48475. version() {
  48476. if (entry.version) {
  48477. this.manifest.version = entry.version;
  48478. }
  48479. },
  48480. "allow-cache"() {
  48481. this.manifest.allowCache = entry.allowed;
  48482. if (!("allowed" in entry)) {
  48483. this.trigger("info", {
  48484. message: "defaulting allowCache to YES"
  48485. });
  48486. this.manifest.allowCache = true;
  48487. }
  48488. },
  48489. byterange() {
  48490. const byterange = {};
  48491. if ("length" in entry) {
  48492. currentUri.byterange = byterange;
  48493. byterange.length = entry.length;
  48494. if (!("offset" in entry)) {
  48495. entry.offset = lastByterangeEnd;
  48496. }
  48497. }
  48498. if ("offset" in entry) {
  48499. currentUri.byterange = byterange;
  48500. byterange.offset = entry.offset;
  48501. }
  48502. lastByterangeEnd = byterange.offset + byterange.length;
  48503. },
  48504. endlist() {
  48505. this.manifest.endList = true;
  48506. },
  48507. inf() {
  48508. if (!("mediaSequence" in this.manifest)) {
  48509. this.manifest.mediaSequence = 0;
  48510. this.trigger("info", {
  48511. message: "defaulting media sequence to zero"
  48512. });
  48513. }
  48514. if (!("discontinuitySequence" in this.manifest)) {
  48515. this.manifest.discontinuitySequence = 0;
  48516. this.trigger("info", {
  48517. message: "defaulting discontinuity sequence to zero"
  48518. });
  48519. }
  48520. if (entry.duration > 0) {
  48521. currentUri.duration = entry.duration;
  48522. }
  48523. if (entry.duration === 0) {
  48524. currentUri.duration = 0.01;
  48525. this.trigger("info", {
  48526. message: "updating zero segment duration to a small value"
  48527. });
  48528. }
  48529. this.manifest.segments = uris;
  48530. },
  48531. key() {
  48532. if (!entry.attributes) {
  48533. this.trigger("warn", {
  48534. message: "ignoring key declaration without attribute list"
  48535. });
  48536. return;
  48537. }
  48538. if (entry.attributes.METHOD === "NONE") {
  48539. key = null;
  48540. return;
  48541. }
  48542. if (!entry.attributes.URI) {
  48543. this.trigger("warn", {
  48544. message: "ignoring key declaration without URI"
  48545. });
  48546. return;
  48547. }
  48548. if (entry.attributes.KEYFORMAT === "com.apple.streamingkeydelivery") {
  48549. this.manifest.contentProtection = this.manifest.contentProtection || {};
  48550. this.manifest.contentProtection["com.apple.fps.1_0"] = {
  48551. attributes: entry.attributes
  48552. };
  48553. return;
  48554. }
  48555. if (entry.attributes.KEYFORMAT === "com.microsoft.playready") {
  48556. this.manifest.contentProtection = this.manifest.contentProtection || {};
  48557. this.manifest.contentProtection["com.microsoft.playready"] = {
  48558. uri: entry.attributes.URI
  48559. };
  48560. return;
  48561. }
  48562. if (entry.attributes.KEYFORMAT === widevineUuid) {
  48563. const VALID_METHODS = ["SAMPLE-AES", "SAMPLE-AES-CTR", "SAMPLE-AES-CENC"];
  48564. if (VALID_METHODS.indexOf(entry.attributes.METHOD) === -1) {
  48565. this.trigger("warn", {
  48566. message: "invalid key method provided for Widevine"
  48567. });
  48568. return;
  48569. }
  48570. if (entry.attributes.METHOD === "SAMPLE-AES-CENC") {
  48571. this.trigger("warn", {
  48572. message: "SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"
  48573. });
  48574. }
  48575. if (entry.attributes.URI.substring(0, 23) !== "data:text/plain;base64,") {
  48576. this.trigger("warn", {
  48577. message: "invalid key URI provided for Widevine"
  48578. });
  48579. return;
  48580. }
  48581. if (!(entry.attributes.KEYID && entry.attributes.KEYID.substring(0, 2) === "0x")) {
  48582. this.trigger("warn", {
  48583. message: "invalid key ID provided for Widevine"
  48584. });
  48585. return;
  48586. }
  48587. this.manifest.contentProtection = this.manifest.contentProtection || {};
  48588. this.manifest.contentProtection["com.widevine.alpha"] = {
  48589. attributes: {
  48590. schemeIdUri: entry.attributes.KEYFORMAT,
  48591. keyId: entry.attributes.KEYID.substring(2)
  48592. },
  48593. pssh: decodeB64ToUint8Array$2(entry.attributes.URI.split(",")[1])
  48594. };
  48595. return;
  48596. }
  48597. if (!entry.attributes.METHOD) {
  48598. this.trigger("warn", {
  48599. message: "defaulting key method to AES-128"
  48600. });
  48601. }
  48602. key = {
  48603. method: entry.attributes.METHOD || "AES-128",
  48604. uri: entry.attributes.URI
  48605. };
  48606. if (typeof entry.attributes.IV !== "undefined") {
  48607. key.iv = entry.attributes.IV;
  48608. }
  48609. },
  48610. "media-sequence"() {
  48611. if (!isFinite(entry.number)) {
  48612. this.trigger("warn", {
  48613. message: "ignoring invalid media sequence: " + entry.number
  48614. });
  48615. return;
  48616. }
  48617. this.manifest.mediaSequence = entry.number;
  48618. },
  48619. "discontinuity-sequence"() {
  48620. if (!isFinite(entry.number)) {
  48621. this.trigger("warn", {
  48622. message: "ignoring invalid discontinuity sequence: " + entry.number
  48623. });
  48624. return;
  48625. }
  48626. this.manifest.discontinuitySequence = entry.number;
  48627. currentTimeline = entry.number;
  48628. },
  48629. "playlist-type"() {
  48630. if (!/VOD|EVENT/.test(entry.playlistType)) {
  48631. this.trigger("warn", {
  48632. message: "ignoring unknown playlist type: " + entry.playlist
  48633. });
  48634. return;
  48635. }
  48636. this.manifest.playlistType = entry.playlistType;
  48637. },
  48638. map() {
  48639. currentMap = {};
  48640. if (entry.uri) {
  48641. currentMap.uri = entry.uri;
  48642. }
  48643. if (entry.byterange) {
  48644. currentMap.byterange = entry.byterange;
  48645. }
  48646. if (key) {
  48647. currentMap.key = key;
  48648. }
  48649. },
  48650. "stream-inf"() {
  48651. this.manifest.playlists = uris;
  48652. this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;
  48653. if (!entry.attributes) {
  48654. this.trigger("warn", {
  48655. message: "ignoring empty stream-inf attributes"
  48656. });
  48657. return;
  48658. }
  48659. if (!currentUri.attributes) {
  48660. currentUri.attributes = {};
  48661. }
  48662. _extends$2(currentUri.attributes, entry.attributes);
  48663. },
  48664. media() {
  48665. this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;
  48666. if (!(entry.attributes && entry.attributes.TYPE && entry.attributes["GROUP-ID"] && entry.attributes.NAME)) {
  48667. this.trigger("warn", {
  48668. message: "ignoring incomplete or missing media group"
  48669. });
  48670. return;
  48671. }
  48672. const mediaGroupType = this.manifest.mediaGroups[entry.attributes.TYPE];
  48673. mediaGroupType[entry.attributes["GROUP-ID"]] = mediaGroupType[entry.attributes["GROUP-ID"]] || {};
  48674. mediaGroup = mediaGroupType[entry.attributes["GROUP-ID"]];
  48675. rendition = {
  48676. default: /yes/i.test(entry.attributes.DEFAULT)
  48677. };
  48678. if (rendition.default) {
  48679. rendition.autoselect = true;
  48680. } else {
  48681. rendition.autoselect = /yes/i.test(entry.attributes.AUTOSELECT);
  48682. }
  48683. if (entry.attributes.LANGUAGE) {
  48684. rendition.language = entry.attributes.LANGUAGE;
  48685. }
  48686. if (entry.attributes.URI) {
  48687. rendition.uri = entry.attributes.URI;
  48688. }
  48689. if (entry.attributes["INSTREAM-ID"]) {
  48690. rendition.instreamId = entry.attributes["INSTREAM-ID"];
  48691. }
  48692. if (entry.attributes.CHARACTERISTICS) {
  48693. rendition.characteristics = entry.attributes.CHARACTERISTICS;
  48694. }
  48695. if (entry.attributes.FORCED) {
  48696. rendition.forced = /yes/i.test(entry.attributes.FORCED);
  48697. }
  48698. mediaGroup[entry.attributes.NAME] = rendition;
  48699. },
  48700. discontinuity() {
  48701. currentTimeline += 1;
  48702. currentUri.discontinuity = true;
  48703. this.manifest.discontinuityStarts.push(uris.length);
  48704. },
  48705. "program-date-time"() {
  48706. if (typeof this.manifest.dateTimeString === "undefined") {
  48707. this.manifest.dateTimeString = entry.dateTimeString;
  48708. this.manifest.dateTimeObject = entry.dateTimeObject;
  48709. }
  48710. currentUri.dateTimeString = entry.dateTimeString;
  48711. currentUri.dateTimeObject = entry.dateTimeObject;
  48712. },
  48713. targetduration() {
  48714. if (!isFinite(entry.duration) || entry.duration < 0) {
  48715. this.trigger("warn", {
  48716. message: "ignoring invalid target duration: " + entry.duration
  48717. });
  48718. return;
  48719. }
  48720. this.manifest.targetDuration = entry.duration;
  48721. setHoldBack$1.call(this, this.manifest);
  48722. },
  48723. start() {
  48724. if (!entry.attributes || isNaN(entry.attributes["TIME-OFFSET"])) {
  48725. this.trigger("warn", {
  48726. message: "ignoring start declaration without appropriate attribute list"
  48727. });
  48728. return;
  48729. }
  48730. this.manifest.start = {
  48731. timeOffset: entry.attributes["TIME-OFFSET"],
  48732. precise: entry.attributes.PRECISE
  48733. };
  48734. },
  48735. "cue-out"() {
  48736. currentUri.cueOut = entry.data;
  48737. },
  48738. "cue-out-cont"() {
  48739. currentUri.cueOutCont = entry.data;
  48740. },
  48741. "cue-in"() {
  48742. currentUri.cueIn = entry.data;
  48743. },
  48744. "skip"() {
  48745. this.manifest.skip = camelCaseKeys$1(entry.attributes);
  48746. this.warnOnMissingAttributes_("#EXT-X-SKIP", entry.attributes, ["SKIPPED-SEGMENTS"]);
  48747. },
  48748. "part"() {
  48749. hasParts = true;
  48750. const segmentIndex = this.manifest.segments.length;
  48751. const part = camelCaseKeys$1(entry.attributes);
  48752. currentUri.parts = currentUri.parts || [];
  48753. currentUri.parts.push(part);
  48754. if (part.byterange) {
  48755. if (!part.byterange.hasOwnProperty("offset")) {
  48756. part.byterange.offset = lastPartByterangeEnd;
  48757. }
  48758. lastPartByterangeEnd = part.byterange.offset + part.byterange.length;
  48759. }
  48760. const partIndex = currentUri.parts.length - 1;
  48761. this.warnOnMissingAttributes_(`#EXT-X-PART #${partIndex} for segment #${segmentIndex}`, entry.attributes, ["URI", "DURATION"]);
  48762. if (this.manifest.renditionReports) {
  48763. this.manifest.renditionReports.forEach((r2, i2) => {
  48764. if (!r2.hasOwnProperty("lastPart")) {
  48765. this.trigger("warn", {
  48766. message: `#EXT-X-RENDITION-REPORT #${i2} lacks required attribute(s): LAST-PART`
  48767. });
  48768. }
  48769. });
  48770. }
  48771. },
  48772. "server-control"() {
  48773. const attrs = this.manifest.serverControl = camelCaseKeys$1(entry.attributes);
  48774. if (!attrs.hasOwnProperty("canBlockReload")) {
  48775. attrs.canBlockReload = false;
  48776. this.trigger("info", {
  48777. message: "#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"
  48778. });
  48779. }
  48780. setHoldBack$1.call(this, this.manifest);
  48781. if (attrs.canSkipDateranges && !attrs.hasOwnProperty("canSkipUntil")) {
  48782. this.trigger("warn", {
  48783. message: "#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"
  48784. });
  48785. }
  48786. },
  48787. "preload-hint"() {
  48788. const segmentIndex = this.manifest.segments.length;
  48789. const hint = camelCaseKeys$1(entry.attributes);
  48790. const isPart = hint.type && hint.type === "PART";
  48791. currentUri.preloadHints = currentUri.preloadHints || [];
  48792. currentUri.preloadHints.push(hint);
  48793. if (hint.byterange) {
  48794. if (!hint.byterange.hasOwnProperty("offset")) {
  48795. hint.byterange.offset = isPart ? lastPartByterangeEnd : 0;
  48796. if (isPart) {
  48797. lastPartByterangeEnd = hint.byterange.offset + hint.byterange.length;
  48798. }
  48799. }
  48800. }
  48801. const index2 = currentUri.preloadHints.length - 1;
  48802. this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${index2} for segment #${segmentIndex}`, entry.attributes, ["TYPE", "URI"]);
  48803. if (!hint.type) {
  48804. return;
  48805. }
  48806. for (let i2 = 0; i2 < currentUri.preloadHints.length - 1; i2++) {
  48807. const otherHint = currentUri.preloadHints[i2];
  48808. if (!otherHint.type) {
  48809. continue;
  48810. }
  48811. if (otherHint.type === hint.type) {
  48812. this.trigger("warn", {
  48813. message: `#EXT-X-PRELOAD-HINT #${index2} for segment #${segmentIndex} has the same TYPE ${hint.type} as preload hint #${i2}`
  48814. });
  48815. }
  48816. }
  48817. },
  48818. "rendition-report"() {
  48819. const report = camelCaseKeys$1(entry.attributes);
  48820. this.manifest.renditionReports = this.manifest.renditionReports || [];
  48821. this.manifest.renditionReports.push(report);
  48822. const index2 = this.manifest.renditionReports.length - 1;
  48823. const required = ["LAST-MSN", "URI"];
  48824. if (hasParts) {
  48825. required.push("LAST-PART");
  48826. }
  48827. this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${index2}`, entry.attributes, required);
  48828. },
  48829. "part-inf"() {
  48830. this.manifest.partInf = camelCaseKeys$1(entry.attributes);
  48831. this.warnOnMissingAttributes_("#EXT-X-PART-INF", entry.attributes, ["PART-TARGET"]);
  48832. if (this.manifest.partInf.partTarget) {
  48833. this.manifest.partTargetDuration = this.manifest.partInf.partTarget;
  48834. }
  48835. setHoldBack$1.call(this, this.manifest);
  48836. },
  48837. "daterange"() {
  48838. this.manifest.daterange = this.manifest.daterange || [];
  48839. this.manifest.daterange.push(camelCaseKeys$1(entry.attributes));
  48840. const index2 = this.manifest.daterange.length - 1;
  48841. this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${index2}`, entry.attributes, ["ID", "START-DATE"]);
  48842. const daterange = this.manifest.daterange[index2];
  48843. if (daterange.endDate && daterange.startDate && new Date(daterange.endDate) < new Date(daterange.startDate)) {
  48844. this.trigger("warn", {
  48845. message: "EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"
  48846. });
  48847. }
  48848. if (daterange.duration && daterange.duration < 0) {
  48849. this.trigger("warn", {
  48850. message: "EXT-X-DATERANGE DURATION must not be negative"
  48851. });
  48852. }
  48853. if (daterange.plannedDuration && daterange.plannedDuration < 0) {
  48854. this.trigger("warn", {
  48855. message: "EXT-X-DATERANGE PLANNED-DURATION must not be negative"
  48856. });
  48857. }
  48858. const endOnNextYes = !!daterange.endOnNext;
  48859. if (endOnNextYes && !daterange.class) {
  48860. this.trigger("warn", {
  48861. message: "EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"
  48862. });
  48863. }
  48864. if (endOnNextYes && (daterange.duration || daterange.endDate)) {
  48865. this.trigger("warn", {
  48866. message: "EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"
  48867. });
  48868. }
  48869. if (daterange.duration && daterange.endDate) {
  48870. const startDate = daterange.startDate;
  48871. const newDateInSeconds = startDate.setSeconds(startDate.getSeconds() + daterange.duration);
  48872. this.manifest.daterange[index2].endDate = new Date(newDateInSeconds);
  48873. }
  48874. if (daterange && !this.manifest.dateTimeString) {
  48875. this.trigger("warn", {
  48876. message: "A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"
  48877. });
  48878. }
  48879. if (!daterangeTags[daterange.id]) {
  48880. daterangeTags[daterange.id] = daterange;
  48881. } else {
  48882. for (const attribute in daterangeTags[daterange.id]) {
  48883. if (daterangeTags[daterange.id][attribute] !== daterange[attribute]) {
  48884. this.trigger("warn", {
  48885. message: "EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes and same attribute values"
  48886. });
  48887. break;
  48888. }
  48889. }
  48890. }
  48891. }
  48892. }[entry.tagType] || noop2).call(self2);
  48893. },
  48894. uri() {
  48895. currentUri.uri = entry.uri;
  48896. uris.push(currentUri);
  48897. if (this.manifest.targetDuration && !("duration" in currentUri)) {
  48898. this.trigger("warn", {
  48899. message: "defaulting segment duration to the target duration"
  48900. });
  48901. currentUri.duration = this.manifest.targetDuration;
  48902. }
  48903. if (key) {
  48904. currentUri.key = key;
  48905. }
  48906. currentUri.timeline = currentTimeline;
  48907. if (currentMap) {
  48908. currentUri.map = currentMap;
  48909. }
  48910. lastPartByterangeEnd = 0;
  48911. currentUri = {};
  48912. },
  48913. comment() {
  48914. },
  48915. custom() {
  48916. if (entry.segment) {
  48917. currentUri.custom = currentUri.custom || {};
  48918. currentUri.custom[entry.customType] = entry.data;
  48919. } else {
  48920. this.manifest.custom = this.manifest.custom || {};
  48921. this.manifest.custom[entry.customType] = entry.data;
  48922. }
  48923. }
  48924. })[entry.type].call(self2);
  48925. });
  48926. }
  48927. warnOnMissingAttributes_(identifier, attributes, required) {
  48928. const missing = [];
  48929. required.forEach(function(key) {
  48930. if (!attributes.hasOwnProperty(key)) {
  48931. missing.push(key);
  48932. }
  48933. });
  48934. if (missing.length) {
  48935. this.trigger("warn", {
  48936. message: `${identifier} lacks required attribute(s): ${missing.join(", ")}`
  48937. });
  48938. }
  48939. }
  48940. push(chunk) {
  48941. this.lineStream.push(chunk);
  48942. }
  48943. end() {
  48944. this.lineStream.push("\n");
  48945. this.trigger("end");
  48946. }
  48947. addParser(options2) {
  48948. this.parseStream.addParser(options2);
  48949. }
  48950. addTagMapper(options2) {
  48951. this.parseStream.addTagMapper(options2);
  48952. }
  48953. }
  48954. var regexs$1 = {
  48955. mp4: /^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,
  48956. webm: /^(vp0?[89]|av0?1|opus|vorbis)/,
  48957. ogg: /^(vp0?[89]|theora|flac|opus|vorbis)/,
  48958. video: /^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,
  48959. audio: /^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,
  48960. text: /^(stpp.ttml.im1t)/,
  48961. muxerVideo: /^(avc0?1)/,
  48962. muxerAudio: /^(mp4a)/,
  48963. muxerText: /a^/
  48964. };
  48965. var mediaTypes$1 = ["video", "audio", "text"];
  48966. var upperMediaTypes$1 = ["Video", "Audio", "Text"];
  48967. var translateLegacyCodec$1 = function translateLegacyCodec(codec) {
  48968. if (!codec) {
  48969. return codec;
  48970. }
  48971. return codec.replace(/avc1\.(\d+)\.(\d+)/i, function(orig, profile, avcLevel) {
  48972. var profileHex = ("00" + Number(profile).toString(16)).slice(-2);
  48973. var avcLevelHex = ("00" + Number(avcLevel).toString(16)).slice(-2);
  48974. return "avc1." + profileHex + "00" + avcLevelHex;
  48975. });
  48976. };
  48977. var parseCodecs$1 = function parseCodecs(codecString) {
  48978. if (codecString === void 0) {
  48979. codecString = "";
  48980. }
  48981. var codecs = codecString.split(",");
  48982. var result = [];
  48983. codecs.forEach(function(codec) {
  48984. codec = codec.trim();
  48985. var codecType;
  48986. mediaTypes$1.forEach(function(name) {
  48987. var match = regexs$1[name].exec(codec.toLowerCase());
  48988. if (!match || match.length <= 1) {
  48989. return;
  48990. }
  48991. codecType = name;
  48992. var type2 = codec.substring(0, match[1].length);
  48993. var details = codec.replace(type2, "");
  48994. result.push({
  48995. type: type2,
  48996. details,
  48997. mediaType: name
  48998. });
  48999. });
  49000. if (!codecType) {
  49001. result.push({
  49002. type: codec,
  49003. details: "",
  49004. mediaType: "unknown"
  49005. });
  49006. }
  49007. });
  49008. return result;
  49009. };
  49010. var codecsFromDefault$1 = function codecsFromDefault(master, audioGroupId) {
  49011. if (!master.mediaGroups.AUDIO || !audioGroupId) {
  49012. return null;
  49013. }
  49014. var audioGroup = master.mediaGroups.AUDIO[audioGroupId];
  49015. if (!audioGroup) {
  49016. return null;
  49017. }
  49018. for (var name in audioGroup) {
  49019. var audioType = audioGroup[name];
  49020. if (audioType.default && audioType.playlists) {
  49021. return parseCodecs$1(audioType.playlists[0].attributes.CODECS);
  49022. }
  49023. }
  49024. return null;
  49025. };
  49026. var isAudioCodec$1 = function isAudioCodec(codec) {
  49027. if (codec === void 0) {
  49028. codec = "";
  49029. }
  49030. return regexs$1.audio.test(codec.trim().toLowerCase());
  49031. };
  49032. var isTextCodec$1 = function isTextCodec(codec) {
  49033. if (codec === void 0) {
  49034. codec = "";
  49035. }
  49036. return regexs$1.text.test(codec.trim().toLowerCase());
  49037. };
  49038. var getMimeForCodec$1 = function getMimeForCodec(codecString) {
  49039. if (!codecString || typeof codecString !== "string") {
  49040. return;
  49041. }
  49042. var codecs = codecString.toLowerCase().split(",").map(function(c) {
  49043. return translateLegacyCodec$1(c.trim());
  49044. });
  49045. var type2 = "video";
  49046. if (codecs.length === 1 && isAudioCodec$1(codecs[0])) {
  49047. type2 = "audio";
  49048. } else if (codecs.length === 1 && isTextCodec$1(codecs[0])) {
  49049. type2 = "application";
  49050. }
  49051. var container = "mp4";
  49052. if (codecs.every(function(c) {
  49053. return regexs$1.mp4.test(c);
  49054. })) {
  49055. container = "mp4";
  49056. } else if (codecs.every(function(c) {
  49057. return regexs$1.webm.test(c);
  49058. })) {
  49059. container = "webm";
  49060. } else if (codecs.every(function(c) {
  49061. return regexs$1.ogg.test(c);
  49062. })) {
  49063. container = "ogg";
  49064. }
  49065. return type2 + "/" + container + ';codecs="' + codecString + '"';
  49066. };
  49067. var browserSupportsCodec$1 = function browserSupportsCodec(codecString) {
  49068. if (codecString === void 0) {
  49069. codecString = "";
  49070. }
  49071. return window_1.MediaSource && window_1.MediaSource.isTypeSupported && window_1.MediaSource.isTypeSupported(getMimeForCodec$1(codecString)) || false;
  49072. };
  49073. var muxerSupportsCodec$1 = function muxerSupportsCodec(codecString) {
  49074. if (codecString === void 0) {
  49075. codecString = "";
  49076. }
  49077. return codecString.toLowerCase().split(",").every(function(codec) {
  49078. codec = codec.trim();
  49079. for (var i2 = 0; i2 < upperMediaTypes$1.length; i2++) {
  49080. var type2 = upperMediaTypes$1[i2];
  49081. if (regexs$1["muxer" + type2].test(codec)) {
  49082. return true;
  49083. }
  49084. }
  49085. return false;
  49086. });
  49087. };
  49088. var DEFAULT_AUDIO_CODEC$1 = "mp4a.40.2";
  49089. var DEFAULT_VIDEO_CODEC$1 = "avc1.4d400d";
  49090. var MPEGURL_REGEX$1 = /^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;
  49091. var DASH_REGEX$1 = /^application\/dash\+xml/i;
  49092. var simpleTypeFromSourceType$1 = function simpleTypeFromSourceType(type2) {
  49093. if (MPEGURL_REGEX$1.test(type2)) {
  49094. return "hls";
  49095. }
  49096. if (DASH_REGEX$1.test(type2)) {
  49097. return "dash";
  49098. }
  49099. if (type2 === "application/vnd.videojs.vhs+json") {
  49100. return "vhs-json";
  49101. }
  49102. return null;
  49103. };
  49104. var countBits$1 = function countBits(x) {
  49105. return x.toString(2).length;
  49106. };
  49107. var countBytes$1 = function countBytes(x) {
  49108. return Math.ceil(countBits$1(x) / 8);
  49109. };
  49110. var isArrayBufferView$1 = function isArrayBufferView(obj) {
  49111. if (ArrayBuffer.isView === "function") {
  49112. return ArrayBuffer.isView(obj);
  49113. }
  49114. return obj && obj.buffer instanceof ArrayBuffer;
  49115. };
  49116. var isTypedArray$1 = function isTypedArray(obj) {
  49117. return isArrayBufferView$1(obj);
  49118. };
  49119. var toUint8$1 = function toUint8(bytes) {
  49120. if (bytes instanceof Uint8Array) {
  49121. return bytes;
  49122. }
  49123. if (!Array.isArray(bytes) && !isTypedArray$1(bytes) && !(bytes instanceof ArrayBuffer)) {
  49124. if (typeof bytes !== "number" || typeof bytes === "number" && bytes !== bytes) {
  49125. bytes = 0;
  49126. } else {
  49127. bytes = [bytes];
  49128. }
  49129. }
  49130. return new Uint8Array(bytes && bytes.buffer || bytes, bytes && bytes.byteOffset || 0, bytes && bytes.byteLength || 0);
  49131. };
  49132. var BigInt$1 = window_1.BigInt || Number;
  49133. var BYTE_TABLE$1 = [BigInt$1("0x1"), BigInt$1("0x100"), BigInt$1("0x10000"), BigInt$1("0x1000000"), BigInt$1("0x100000000"), BigInt$1("0x10000000000"), BigInt$1("0x1000000000000"), BigInt$1("0x100000000000000"), BigInt$1("0x10000000000000000")];
  49134. (function() {
  49135. var a = new Uint16Array([65484]);
  49136. var b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);
  49137. if (b[0] === 255) {
  49138. return "big";
  49139. }
  49140. if (b[0] === 204) {
  49141. return "little";
  49142. }
  49143. return "unknown";
  49144. })();
  49145. var bytesToNumber$1 = function bytesToNumber(bytes, _temp) {
  49146. var _ref = _temp === void 0 ? {} : _temp, _ref$signed = _ref.signed, signed = _ref$signed === void 0 ? false : _ref$signed, _ref$le = _ref.le, le = _ref$le === void 0 ? false : _ref$le;
  49147. bytes = toUint8$1(bytes);
  49148. var fn2 = le ? "reduce" : "reduceRight";
  49149. var obj = bytes[fn2] ? bytes[fn2] : Array.prototype[fn2];
  49150. var number = obj.call(bytes, function(total, byte, i2) {
  49151. var exponent = le ? i2 : Math.abs(i2 + 1 - bytes.length);
  49152. return total + BigInt$1(byte) * BYTE_TABLE$1[exponent];
  49153. }, BigInt$1(0));
  49154. if (signed) {
  49155. var max2 = BYTE_TABLE$1[bytes.length] / BigInt$1(2) - BigInt$1(1);
  49156. number = BigInt$1(number);
  49157. if (number > max2) {
  49158. number -= max2;
  49159. number -= max2;
  49160. number -= BigInt$1(2);
  49161. }
  49162. }
  49163. return Number(number);
  49164. };
  49165. var numberToBytes$1 = function numberToBytes(number, _temp2) {
  49166. var _ref2 = _temp2 === void 0 ? {} : _temp2, _ref2$le = _ref2.le, le = _ref2$le === void 0 ? false : _ref2$le;
  49167. if (typeof number !== "bigint" && typeof number !== "number" || typeof number === "number" && number !== number) {
  49168. number = 0;
  49169. }
  49170. number = BigInt$1(number);
  49171. var byteCount = countBytes$1(number);
  49172. var bytes = new Uint8Array(new ArrayBuffer(byteCount));
  49173. for (var i2 = 0; i2 < byteCount; i2++) {
  49174. var byteIndex = le ? i2 : Math.abs(i2 + 1 - bytes.length);
  49175. bytes[byteIndex] = Number(number / BYTE_TABLE$1[i2] & BigInt$1(255));
  49176. if (number < 0) {
  49177. bytes[byteIndex] = Math.abs(~bytes[byteIndex]);
  49178. bytes[byteIndex] -= i2 === 0 ? 1 : 2;
  49179. }
  49180. }
  49181. return bytes;
  49182. };
  49183. var stringToBytes$1 = function stringToBytes(string, stringIsBytes) {
  49184. if (typeof string !== "string" && string && typeof string.toString === "function") {
  49185. string = string.toString();
  49186. }
  49187. if (typeof string !== "string") {
  49188. return new Uint8Array();
  49189. }
  49190. if (!stringIsBytes) {
  49191. string = unescape(encodeURIComponent(string));
  49192. }
  49193. var view = new Uint8Array(string.length);
  49194. for (var i2 = 0; i2 < string.length; i2++) {
  49195. view[i2] = string.charCodeAt(i2);
  49196. }
  49197. return view;
  49198. };
  49199. var concatTypedArrays$1 = function concatTypedArrays() {
  49200. for (var _len = arguments.length, buffers = new Array(_len), _key = 0; _key < _len; _key++) {
  49201. buffers[_key] = arguments[_key];
  49202. }
  49203. buffers = buffers.filter(function(b) {
  49204. return b && (b.byteLength || b.length) && typeof b !== "string";
  49205. });
  49206. if (buffers.length <= 1) {
  49207. return toUint8$1(buffers[0]);
  49208. }
  49209. var totalLen = buffers.reduce(function(total, buf, i2) {
  49210. return total + (buf.byteLength || buf.length);
  49211. }, 0);
  49212. var tempBuffer = new Uint8Array(totalLen);
  49213. var offset = 0;
  49214. buffers.forEach(function(buf) {
  49215. buf = toUint8$1(buf);
  49216. tempBuffer.set(buf, offset);
  49217. offset += buf.byteLength;
  49218. });
  49219. return tempBuffer;
  49220. };
  49221. var bytesMatch$1 = function bytesMatch(a, b, _temp3) {
  49222. var _ref3 = _temp3 === void 0 ? {} : _temp3, _ref3$offset = _ref3.offset, offset = _ref3$offset === void 0 ? 0 : _ref3$offset, _ref3$mask = _ref3.mask, mask = _ref3$mask === void 0 ? [] : _ref3$mask;
  49223. a = toUint8$1(a);
  49224. b = toUint8$1(b);
  49225. var fn2 = b.every ? b.every : Array.prototype.every;
  49226. return b.length && a.length - offset >= b.length && fn2.call(b, function(bByte, i2) {
  49227. var aByte = mask[i2] ? mask[i2] & a[offset + i2] : a[offset + i2];
  49228. return bByte === aByte;
  49229. });
  49230. };
  49231. var DEFAULT_LOCATION$1 = "http://example.com";
  49232. var resolveUrl$3 = function resolveUrl2(baseUrl, relativeUrl) {
  49233. if (/^[a-z]+:/i.test(relativeUrl)) {
  49234. return relativeUrl;
  49235. }
  49236. if (/^data:/.test(baseUrl)) {
  49237. baseUrl = window_1.location && window_1.location.href || "";
  49238. }
  49239. var nativeURL = typeof window_1.URL === "function";
  49240. var protocolLess = /^\/\//.test(baseUrl);
  49241. var removeLocation = !window_1.location && !/\/\//i.test(baseUrl);
  49242. if (nativeURL) {
  49243. baseUrl = new window_1.URL(baseUrl, window_1.location || DEFAULT_LOCATION$1);
  49244. } else if (!/\/\//i.test(baseUrl)) {
  49245. baseUrl = URLToolkit.buildAbsoluteURL(window_1.location && window_1.location.href || "", baseUrl);
  49246. }
  49247. if (nativeURL) {
  49248. var newUrl = new URL(relativeUrl, baseUrl);
  49249. if (removeLocation) {
  49250. return newUrl.href.slice(DEFAULT_LOCATION$1.length);
  49251. } else if (protocolLess) {
  49252. return newUrl.href.slice(newUrl.protocol.length);
  49253. }
  49254. return newUrl.href;
  49255. }
  49256. return URLToolkit.buildAbsoluteURL(baseUrl, relativeUrl);
  49257. };
  49258. var forEachMediaGroup$3 = function forEachMediaGroup(master, groups, callback2) {
  49259. groups.forEach(function(mediaType) {
  49260. for (var groupKey in master.mediaGroups[mediaType]) {
  49261. for (var labelKey in master.mediaGroups[mediaType][groupKey]) {
  49262. var mediaProperties = master.mediaGroups[mediaType][groupKey][labelKey];
  49263. callback2(mediaProperties, mediaType, groupKey, labelKey);
  49264. }
  49265. }
  49266. });
  49267. };
  49268. var atob$1 = function atob2(s) {
  49269. return window_1.atob ? window_1.atob(s) : Buffer.from(s, "base64").toString("binary");
  49270. };
  49271. function decodeB64ToUint8Array$1(b64Text) {
  49272. var decodedString = atob$1(b64Text);
  49273. var array = new Uint8Array(decodedString.length);
  49274. for (var i2 = 0; i2 < decodedString.length; i2++) {
  49275. array[i2] = decodedString.charCodeAt(i2);
  49276. }
  49277. return array;
  49278. }
  49279. var dom$1 = {};
  49280. var conventions$2 = {};
  49281. function find$1(list, predicate, ac) {
  49282. if (ac === void 0) {
  49283. ac = Array.prototype;
  49284. }
  49285. if (list && typeof ac.find === "function") {
  49286. return ac.find.call(list, predicate);
  49287. }
  49288. for (var i2 = 0; i2 < list.length; i2++) {
  49289. if (Object.prototype.hasOwnProperty.call(list, i2)) {
  49290. var item = list[i2];
  49291. if (predicate.call(void 0, item, i2, list)) {
  49292. return item;
  49293. }
  49294. }
  49295. }
  49296. }
  49297. function freeze(object, oc) {
  49298. if (oc === void 0) {
  49299. oc = Object;
  49300. }
  49301. return oc && typeof oc.freeze === "function" ? oc.freeze(object) : object;
  49302. }
  49303. function assign$1(target, source) {
  49304. if (target === null || typeof target !== "object") {
  49305. throw new TypeError("target is not an object");
  49306. }
  49307. for (var key in source) {
  49308. if (Object.prototype.hasOwnProperty.call(source, key)) {
  49309. target[key] = source[key];
  49310. }
  49311. }
  49312. return target;
  49313. }
  49314. var MIME_TYPE = freeze({
  49315. HTML: "text/html",
  49316. isHTML: function(value) {
  49317. return value === MIME_TYPE.HTML;
  49318. },
  49319. XML_APPLICATION: "application/xml",
  49320. XML_TEXT: "text/xml",
  49321. XML_XHTML_APPLICATION: "application/xhtml+xml",
  49322. XML_SVG_IMAGE: "image/svg+xml"
  49323. });
  49324. var NAMESPACE$3 = freeze({
  49325. HTML: "http://www.w3.org/1999/xhtml",
  49326. isHTML: function(uri) {
  49327. return uri === NAMESPACE$3.HTML;
  49328. },
  49329. SVG: "http://www.w3.org/2000/svg",
  49330. XML: "http://www.w3.org/XML/1998/namespace",
  49331. XMLNS: "http://www.w3.org/2000/xmlns/"
  49332. });
  49333. conventions$2.assign = assign$1;
  49334. conventions$2.find = find$1;
  49335. conventions$2.freeze = freeze;
  49336. conventions$2.MIME_TYPE = MIME_TYPE;
  49337. conventions$2.NAMESPACE = NAMESPACE$3;
  49338. var conventions$1 = conventions$2;
  49339. var find = conventions$1.find;
  49340. var NAMESPACE$2 = conventions$1.NAMESPACE;
  49341. function notEmptyString(input) {
  49342. return input !== "";
  49343. }
  49344. function splitOnASCIIWhitespace(input) {
  49345. return input ? input.split(/[\t\n\f\r ]+/).filter(notEmptyString) : [];
  49346. }
  49347. function orderedSetReducer(current, element) {
  49348. if (!current.hasOwnProperty(element)) {
  49349. current[element] = true;
  49350. }
  49351. return current;
  49352. }
  49353. function toOrderedSet(input) {
  49354. if (!input)
  49355. return [];
  49356. var list = splitOnASCIIWhitespace(input);
  49357. return Object.keys(list.reduce(orderedSetReducer, {}));
  49358. }
  49359. function arrayIncludes(list) {
  49360. return function(element) {
  49361. return list && list.indexOf(element) !== -1;
  49362. };
  49363. }
  49364. function copy(src, dest) {
  49365. for (var p in src) {
  49366. if (Object.prototype.hasOwnProperty.call(src, p)) {
  49367. dest[p] = src[p];
  49368. }
  49369. }
  49370. }
  49371. function _extends(Class, Super) {
  49372. var pt2 = Class.prototype;
  49373. if (!(pt2 instanceof Super)) {
  49374. let t2 = function() {
  49375. };
  49376. t2.prototype = Super.prototype;
  49377. t2 = new t2();
  49378. copy(pt2, t2);
  49379. Class.prototype = pt2 = t2;
  49380. }
  49381. if (pt2.constructor != Class) {
  49382. if (typeof Class != "function") {
  49383. console.error("unknown Class:" + Class);
  49384. }
  49385. pt2.constructor = Class;
  49386. }
  49387. }
  49388. var NodeType = {};
  49389. var ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;
  49390. var ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2;
  49391. var TEXT_NODE = NodeType.TEXT_NODE = 3;
  49392. var CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4;
  49393. var ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5;
  49394. var ENTITY_NODE = NodeType.ENTITY_NODE = 6;
  49395. var PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;
  49396. var COMMENT_NODE = NodeType.COMMENT_NODE = 8;
  49397. var DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9;
  49398. var DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;
  49399. var DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;
  49400. var NOTATION_NODE = NodeType.NOTATION_NODE = 12;
  49401. var ExceptionCode = {};
  49402. var ExceptionMessage = {};
  49403. ExceptionCode.INDEX_SIZE_ERR = (ExceptionMessage[1] = "Index size error", 1);
  49404. ExceptionCode.DOMSTRING_SIZE_ERR = (ExceptionMessage[2] = "DOMString size error", 2);
  49405. var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = (ExceptionMessage[3] = "Hierarchy request error", 3);
  49406. ExceptionCode.WRONG_DOCUMENT_ERR = (ExceptionMessage[4] = "Wrong document", 4);
  49407. ExceptionCode.INVALID_CHARACTER_ERR = (ExceptionMessage[5] = "Invalid character", 5);
  49408. ExceptionCode.NO_DATA_ALLOWED_ERR = (ExceptionMessage[6] = "No data allowed", 6);
  49409. ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = (ExceptionMessage[7] = "No modification allowed", 7);
  49410. var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = (ExceptionMessage[8] = "Not found", 8);
  49411. ExceptionCode.NOT_SUPPORTED_ERR = (ExceptionMessage[9] = "Not supported", 9);
  49412. var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = (ExceptionMessage[10] = "Attribute in use", 10);
  49413. ExceptionCode.INVALID_STATE_ERR = (ExceptionMessage[11] = "Invalid state", 11);
  49414. ExceptionCode.SYNTAX_ERR = (ExceptionMessage[12] = "Syntax error", 12);
  49415. ExceptionCode.INVALID_MODIFICATION_ERR = (ExceptionMessage[13] = "Invalid modification", 13);
  49416. ExceptionCode.NAMESPACE_ERR = (ExceptionMessage[14] = "Invalid namespace", 14);
  49417. ExceptionCode.INVALID_ACCESS_ERR = (ExceptionMessage[15] = "Invalid access", 15);
  49418. function DOMException(code, message) {
  49419. if (message instanceof Error) {
  49420. var error = message;
  49421. } else {
  49422. error = this;
  49423. Error.call(this, ExceptionMessage[code]);
  49424. this.message = ExceptionMessage[code];
  49425. if (Error.captureStackTrace)
  49426. Error.captureStackTrace(this, DOMException);
  49427. }
  49428. error.code = code;
  49429. if (message)
  49430. this.message = this.message + ": " + message;
  49431. return error;
  49432. }
  49433. DOMException.prototype = Error.prototype;
  49434. copy(ExceptionCode, DOMException);
  49435. function NodeList() {
  49436. }
  49437. NodeList.prototype = {
  49438. length: 0,
  49439. item: function(index2) {
  49440. return this[index2] || null;
  49441. },
  49442. toString: function(isHTML, nodeFilter) {
  49443. for (var buf = [], i2 = 0; i2 < this.length; i2++) {
  49444. serializeToString(this[i2], buf, isHTML, nodeFilter);
  49445. }
  49446. return buf.join("");
  49447. },
  49448. filter: function(predicate) {
  49449. return Array.prototype.filter.call(this, predicate);
  49450. },
  49451. indexOf: function(item) {
  49452. return Array.prototype.indexOf.call(this, item);
  49453. }
  49454. };
  49455. function LiveNodeList(node, refresh) {
  49456. this._node = node;
  49457. this._refresh = refresh;
  49458. _updateLiveList(this);
  49459. }
  49460. function _updateLiveList(list) {
  49461. var inc = list._node._inc || list._node.ownerDocument._inc;
  49462. if (list._inc != inc) {
  49463. var ls = list._refresh(list._node);
  49464. __set__(list, "length", ls.length);
  49465. copy(ls, list);
  49466. list._inc = inc;
  49467. }
  49468. }
  49469. LiveNodeList.prototype.item = function(i2) {
  49470. _updateLiveList(this);
  49471. return this[i2];
  49472. };
  49473. _extends(LiveNodeList, NodeList);
  49474. function NamedNodeMap() {
  49475. }
  49476. function _findNodeIndex(list, node) {
  49477. var i2 = list.length;
  49478. while (i2--) {
  49479. if (list[i2] === node) {
  49480. return i2;
  49481. }
  49482. }
  49483. }
  49484. function _addNamedNode(el, list, newAttr, oldAttr) {
  49485. if (oldAttr) {
  49486. list[_findNodeIndex(list, oldAttr)] = newAttr;
  49487. } else {
  49488. list[list.length++] = newAttr;
  49489. }
  49490. if (el) {
  49491. newAttr.ownerElement = el;
  49492. var doc = el.ownerDocument;
  49493. if (doc) {
  49494. oldAttr && _onRemoveAttribute(doc, el, oldAttr);
  49495. _onAddAttribute(doc, el, newAttr);
  49496. }
  49497. }
  49498. }
  49499. function _removeNamedNode(el, list, attr) {
  49500. var i2 = _findNodeIndex(list, attr);
  49501. if (i2 >= 0) {
  49502. var lastIndex = list.length - 1;
  49503. while (i2 < lastIndex) {
  49504. list[i2] = list[++i2];
  49505. }
  49506. list.length = lastIndex;
  49507. if (el) {
  49508. var doc = el.ownerDocument;
  49509. if (doc) {
  49510. _onRemoveAttribute(doc, el, attr);
  49511. attr.ownerElement = null;
  49512. }
  49513. }
  49514. } else {
  49515. throw new DOMException(NOT_FOUND_ERR, new Error(el.tagName + "@" + attr));
  49516. }
  49517. }
  49518. NamedNodeMap.prototype = {
  49519. length: 0,
  49520. item: NodeList.prototype.item,
  49521. getNamedItem: function(key) {
  49522. var i2 = this.length;
  49523. while (i2--) {
  49524. var attr = this[i2];
  49525. if (attr.nodeName == key) {
  49526. return attr;
  49527. }
  49528. }
  49529. },
  49530. setNamedItem: function(attr) {
  49531. var el = attr.ownerElement;
  49532. if (el && el != this._ownerElement) {
  49533. throw new DOMException(INUSE_ATTRIBUTE_ERR);
  49534. }
  49535. var oldAttr = this.getNamedItem(attr.nodeName);
  49536. _addNamedNode(this._ownerElement, this, attr, oldAttr);
  49537. return oldAttr;
  49538. },
  49539. setNamedItemNS: function(attr) {
  49540. var el = attr.ownerElement, oldAttr;
  49541. if (el && el != this._ownerElement) {
  49542. throw new DOMException(INUSE_ATTRIBUTE_ERR);
  49543. }
  49544. oldAttr = this.getNamedItemNS(attr.namespaceURI, attr.localName);
  49545. _addNamedNode(this._ownerElement, this, attr, oldAttr);
  49546. return oldAttr;
  49547. },
  49548. removeNamedItem: function(key) {
  49549. var attr = this.getNamedItem(key);
  49550. _removeNamedNode(this._ownerElement, this, attr);
  49551. return attr;
  49552. },
  49553. removeNamedItemNS: function(namespaceURI, localName) {
  49554. var attr = this.getNamedItemNS(namespaceURI, localName);
  49555. _removeNamedNode(this._ownerElement, this, attr);
  49556. return attr;
  49557. },
  49558. getNamedItemNS: function(namespaceURI, localName) {
  49559. var i2 = this.length;
  49560. while (i2--) {
  49561. var node = this[i2];
  49562. if (node.localName == localName && node.namespaceURI == namespaceURI) {
  49563. return node;
  49564. }
  49565. }
  49566. return null;
  49567. }
  49568. };
  49569. function DOMImplementation$1() {
  49570. }
  49571. DOMImplementation$1.prototype = {
  49572. hasFeature: function(feature2, version2) {
  49573. return true;
  49574. },
  49575. createDocument: function(namespaceURI, qualifiedName, doctype) {
  49576. var doc = new Document();
  49577. doc.implementation = this;
  49578. doc.childNodes = new NodeList();
  49579. doc.doctype = doctype || null;
  49580. if (doctype) {
  49581. doc.appendChild(doctype);
  49582. }
  49583. if (qualifiedName) {
  49584. var root2 = doc.createElementNS(namespaceURI, qualifiedName);
  49585. doc.appendChild(root2);
  49586. }
  49587. return doc;
  49588. },
  49589. createDocumentType: function(qualifiedName, publicId, systemId) {
  49590. var node = new DocumentType();
  49591. node.name = qualifiedName;
  49592. node.nodeName = qualifiedName;
  49593. node.publicId = publicId || "";
  49594. node.systemId = systemId || "";
  49595. return node;
  49596. }
  49597. };
  49598. function Node() {
  49599. }
  49600. Node.prototype = {
  49601. firstChild: null,
  49602. lastChild: null,
  49603. previousSibling: null,
  49604. nextSibling: null,
  49605. attributes: null,
  49606. parentNode: null,
  49607. childNodes: null,
  49608. ownerDocument: null,
  49609. nodeValue: null,
  49610. namespaceURI: null,
  49611. prefix: null,
  49612. localName: null,
  49613. insertBefore: function(newChild, refChild) {
  49614. return _insertBefore(this, newChild, refChild);
  49615. },
  49616. replaceChild: function(newChild, oldChild) {
  49617. _insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);
  49618. if (oldChild) {
  49619. this.removeChild(oldChild);
  49620. }
  49621. },
  49622. removeChild: function(oldChild) {
  49623. return _removeChild(this, oldChild);
  49624. },
  49625. appendChild: function(newChild) {
  49626. return this.insertBefore(newChild, null);
  49627. },
  49628. hasChildNodes: function() {
  49629. return this.firstChild != null;
  49630. },
  49631. cloneNode: function(deep) {
  49632. return cloneNode(this.ownerDocument || this, this, deep);
  49633. },
  49634. normalize: function() {
  49635. var child = this.firstChild;
  49636. while (child) {
  49637. var next = child.nextSibling;
  49638. if (next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE) {
  49639. this.removeChild(next);
  49640. child.appendData(next.data);
  49641. } else {
  49642. child.normalize();
  49643. child = next;
  49644. }
  49645. }
  49646. },
  49647. isSupported: function(feature2, version2) {
  49648. return this.ownerDocument.implementation.hasFeature(feature2, version2);
  49649. },
  49650. hasAttributes: function() {
  49651. return this.attributes.length > 0;
  49652. },
  49653. lookupPrefix: function(namespaceURI) {
  49654. var el = this;
  49655. while (el) {
  49656. var map = el._nsMap;
  49657. if (map) {
  49658. for (var n in map) {
  49659. if (Object.prototype.hasOwnProperty.call(map, n) && map[n] === namespaceURI) {
  49660. return n;
  49661. }
  49662. }
  49663. }
  49664. el = el.nodeType == ATTRIBUTE_NODE ? el.ownerDocument : el.parentNode;
  49665. }
  49666. return null;
  49667. },
  49668. lookupNamespaceURI: function(prefix) {
  49669. var el = this;
  49670. while (el) {
  49671. var map = el._nsMap;
  49672. if (map) {
  49673. if (Object.prototype.hasOwnProperty.call(map, prefix)) {
  49674. return map[prefix];
  49675. }
  49676. }
  49677. el = el.nodeType == ATTRIBUTE_NODE ? el.ownerDocument : el.parentNode;
  49678. }
  49679. return null;
  49680. },
  49681. isDefaultNamespace: function(namespaceURI) {
  49682. var prefix = this.lookupPrefix(namespaceURI);
  49683. return prefix == null;
  49684. }
  49685. };
  49686. function _xmlEncoder(c) {
  49687. return c == "<" && "&lt;" || c == ">" && "&gt;" || c == "&" && "&amp;" || c == '"' && "&quot;" || "&#" + c.charCodeAt() + ";";
  49688. }
  49689. copy(NodeType, Node);
  49690. copy(NodeType, Node.prototype);
  49691. function _visitNode(node, callback2) {
  49692. if (callback2(node)) {
  49693. return true;
  49694. }
  49695. if (node = node.firstChild) {
  49696. do {
  49697. if (_visitNode(node, callback2)) {
  49698. return true;
  49699. }
  49700. } while (node = node.nextSibling);
  49701. }
  49702. }
  49703. function Document() {
  49704. this.ownerDocument = this;
  49705. }
  49706. function _onAddAttribute(doc, el, newAttr) {
  49707. doc && doc._inc++;
  49708. var ns = newAttr.namespaceURI;
  49709. if (ns === NAMESPACE$2.XMLNS) {
  49710. el._nsMap[newAttr.prefix ? newAttr.localName : ""] = newAttr.value;
  49711. }
  49712. }
  49713. function _onRemoveAttribute(doc, el, newAttr, remove2) {
  49714. doc && doc._inc++;
  49715. var ns = newAttr.namespaceURI;
  49716. if (ns === NAMESPACE$2.XMLNS) {
  49717. delete el._nsMap[newAttr.prefix ? newAttr.localName : ""];
  49718. }
  49719. }
  49720. function _onUpdateChild(doc, el, newChild) {
  49721. if (doc && doc._inc) {
  49722. doc._inc++;
  49723. var cs = el.childNodes;
  49724. if (newChild) {
  49725. cs[cs.length++] = newChild;
  49726. } else {
  49727. var child = el.firstChild;
  49728. var i2 = 0;
  49729. while (child) {
  49730. cs[i2++] = child;
  49731. child = child.nextSibling;
  49732. }
  49733. cs.length = i2;
  49734. delete cs[cs.length];
  49735. }
  49736. }
  49737. }
  49738. function _removeChild(parentNode, child) {
  49739. var previous = child.previousSibling;
  49740. var next = child.nextSibling;
  49741. if (previous) {
  49742. previous.nextSibling = next;
  49743. } else {
  49744. parentNode.firstChild = next;
  49745. }
  49746. if (next) {
  49747. next.previousSibling = previous;
  49748. } else {
  49749. parentNode.lastChild = previous;
  49750. }
  49751. child.parentNode = null;
  49752. child.previousSibling = null;
  49753. child.nextSibling = null;
  49754. _onUpdateChild(parentNode.ownerDocument, parentNode);
  49755. return child;
  49756. }
  49757. function hasValidParentNodeType(node) {
  49758. return node && (node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.ELEMENT_NODE);
  49759. }
  49760. function hasInsertableNodeType(node) {
  49761. return node && (isElementNode(node) || isTextNode$2(node) || isDocTypeNode(node) || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.COMMENT_NODE || node.nodeType === Node.PROCESSING_INSTRUCTION_NODE);
  49762. }
  49763. function isDocTypeNode(node) {
  49764. return node && node.nodeType === Node.DOCUMENT_TYPE_NODE;
  49765. }
  49766. function isElementNode(node) {
  49767. return node && node.nodeType === Node.ELEMENT_NODE;
  49768. }
  49769. function isTextNode$2(node) {
  49770. return node && node.nodeType === Node.TEXT_NODE;
  49771. }
  49772. function isElementInsertionPossible(doc, child) {
  49773. var parentChildNodes = doc.childNodes || [];
  49774. if (find(parentChildNodes, isElementNode) || isDocTypeNode(child)) {
  49775. return false;
  49776. }
  49777. var docTypeNode = find(parentChildNodes, isDocTypeNode);
  49778. return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));
  49779. }
  49780. function isElementReplacementPossible(doc, child) {
  49781. var parentChildNodes = doc.childNodes || [];
  49782. function hasElementChildThatIsNotChild(node) {
  49783. return isElementNode(node) && node !== child;
  49784. }
  49785. if (find(parentChildNodes, hasElementChildThatIsNotChild)) {
  49786. return false;
  49787. }
  49788. var docTypeNode = find(parentChildNodes, isDocTypeNode);
  49789. return !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));
  49790. }
  49791. function assertPreInsertionValidity1to5(parent, node, child) {
  49792. if (!hasValidParentNodeType(parent)) {
  49793. throw new DOMException(HIERARCHY_REQUEST_ERR, "Unexpected parent node type " + parent.nodeType);
  49794. }
  49795. if (child && child.parentNode !== parent) {
  49796. throw new DOMException(NOT_FOUND_ERR, "child not in parent");
  49797. }
  49798. if (!hasInsertableNodeType(node) || isDocTypeNode(node) && parent.nodeType !== Node.DOCUMENT_NODE) {
  49799. throw new DOMException(
  49800. HIERARCHY_REQUEST_ERR,
  49801. "Unexpected node type " + node.nodeType + " for parent node type " + parent.nodeType
  49802. );
  49803. }
  49804. }
  49805. function assertPreInsertionValidityInDocument(parent, node, child) {
  49806. var parentChildNodes = parent.childNodes || [];
  49807. var nodeChildNodes = node.childNodes || [];
  49808. if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
  49809. var nodeChildElements = nodeChildNodes.filter(isElementNode);
  49810. if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode$2)) {
  49811. throw new DOMException(HIERARCHY_REQUEST_ERR, "More than one element or text in fragment");
  49812. }
  49813. if (nodeChildElements.length === 1 && !isElementInsertionPossible(parent, child)) {
  49814. throw new DOMException(HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype");
  49815. }
  49816. }
  49817. if (isElementNode(node)) {
  49818. if (!isElementInsertionPossible(parent, child)) {
  49819. throw new DOMException(HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype");
  49820. }
  49821. }
  49822. if (isDocTypeNode(node)) {
  49823. if (find(parentChildNodes, isDocTypeNode)) {
  49824. throw new DOMException(HIERARCHY_REQUEST_ERR, "Only one doctype is allowed");
  49825. }
  49826. var parentElementChild = find(parentChildNodes, isElementNode);
  49827. if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {
  49828. throw new DOMException(HIERARCHY_REQUEST_ERR, "Doctype can only be inserted before an element");
  49829. }
  49830. if (!child && parentElementChild) {
  49831. throw new DOMException(HIERARCHY_REQUEST_ERR, "Doctype can not be appended since element is present");
  49832. }
  49833. }
  49834. }
  49835. function assertPreReplacementValidityInDocument(parent, node, child) {
  49836. var parentChildNodes = parent.childNodes || [];
  49837. var nodeChildNodes = node.childNodes || [];
  49838. if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
  49839. var nodeChildElements = nodeChildNodes.filter(isElementNode);
  49840. if (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode$2)) {
  49841. throw new DOMException(HIERARCHY_REQUEST_ERR, "More than one element or text in fragment");
  49842. }
  49843. if (nodeChildElements.length === 1 && !isElementReplacementPossible(parent, child)) {
  49844. throw new DOMException(HIERARCHY_REQUEST_ERR, "Element in fragment can not be inserted before doctype");
  49845. }
  49846. }
  49847. if (isElementNode(node)) {
  49848. if (!isElementReplacementPossible(parent, child)) {
  49849. throw new DOMException(HIERARCHY_REQUEST_ERR, "Only one element can be added and only after doctype");
  49850. }
  49851. }
  49852. if (isDocTypeNode(node)) {
  49853. let hasDoctypeChildThatIsNotChild = function(node2) {
  49854. return isDocTypeNode(node2) && node2 !== child;
  49855. };
  49856. if (find(parentChildNodes, hasDoctypeChildThatIsNotChild)) {
  49857. throw new DOMException(HIERARCHY_REQUEST_ERR, "Only one doctype is allowed");
  49858. }
  49859. var parentElementChild = find(parentChildNodes, isElementNode);
  49860. if (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {
  49861. throw new DOMException(HIERARCHY_REQUEST_ERR, "Doctype can only be inserted before an element");
  49862. }
  49863. }
  49864. }
  49865. function _insertBefore(parent, node, child, _inDocumentAssertion) {
  49866. assertPreInsertionValidity1to5(parent, node, child);
  49867. if (parent.nodeType === Node.DOCUMENT_NODE) {
  49868. (_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent, node, child);
  49869. }
  49870. var cp = node.parentNode;
  49871. if (cp) {
  49872. cp.removeChild(node);
  49873. }
  49874. if (node.nodeType === DOCUMENT_FRAGMENT_NODE) {
  49875. var newFirst = node.firstChild;
  49876. if (newFirst == null) {
  49877. return node;
  49878. }
  49879. var newLast = node.lastChild;
  49880. } else {
  49881. newFirst = newLast = node;
  49882. }
  49883. var pre = child ? child.previousSibling : parent.lastChild;
  49884. newFirst.previousSibling = pre;
  49885. newLast.nextSibling = child;
  49886. if (pre) {
  49887. pre.nextSibling = newFirst;
  49888. } else {
  49889. parent.firstChild = newFirst;
  49890. }
  49891. if (child == null) {
  49892. parent.lastChild = newLast;
  49893. } else {
  49894. child.previousSibling = newLast;
  49895. }
  49896. do {
  49897. newFirst.parentNode = parent;
  49898. } while (newFirst !== newLast && (newFirst = newFirst.nextSibling));
  49899. _onUpdateChild(parent.ownerDocument || parent, parent);
  49900. if (node.nodeType == DOCUMENT_FRAGMENT_NODE) {
  49901. node.firstChild = node.lastChild = null;
  49902. }
  49903. return node;
  49904. }
  49905. function _appendSingleChild(parentNode, newChild) {
  49906. if (newChild.parentNode) {
  49907. newChild.parentNode.removeChild(newChild);
  49908. }
  49909. newChild.parentNode = parentNode;
  49910. newChild.previousSibling = parentNode.lastChild;
  49911. newChild.nextSibling = null;
  49912. if (newChild.previousSibling) {
  49913. newChild.previousSibling.nextSibling = newChild;
  49914. } else {
  49915. parentNode.firstChild = newChild;
  49916. }
  49917. parentNode.lastChild = newChild;
  49918. _onUpdateChild(parentNode.ownerDocument, parentNode, newChild);
  49919. return newChild;
  49920. }
  49921. Document.prototype = {
  49922. nodeName: "#document",
  49923. nodeType: DOCUMENT_NODE,
  49924. doctype: null,
  49925. documentElement: null,
  49926. _inc: 1,
  49927. insertBefore: function(newChild, refChild) {
  49928. if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {
  49929. var child = newChild.firstChild;
  49930. while (child) {
  49931. var next = child.nextSibling;
  49932. this.insertBefore(child, refChild);
  49933. child = next;
  49934. }
  49935. return newChild;
  49936. }
  49937. _insertBefore(this, newChild, refChild);
  49938. newChild.ownerDocument = this;
  49939. if (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {
  49940. this.documentElement = newChild;
  49941. }
  49942. return newChild;
  49943. },
  49944. removeChild: function(oldChild) {
  49945. if (this.documentElement == oldChild) {
  49946. this.documentElement = null;
  49947. }
  49948. return _removeChild(this, oldChild);
  49949. },
  49950. replaceChild: function(newChild, oldChild) {
  49951. _insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);
  49952. newChild.ownerDocument = this;
  49953. if (oldChild) {
  49954. this.removeChild(oldChild);
  49955. }
  49956. if (isElementNode(newChild)) {
  49957. this.documentElement = newChild;
  49958. }
  49959. },
  49960. importNode: function(importedNode, deep) {
  49961. return importNode(this, importedNode, deep);
  49962. },
  49963. getElementById: function(id) {
  49964. var rtv = null;
  49965. _visitNode(this.documentElement, function(node) {
  49966. if (node.nodeType == ELEMENT_NODE) {
  49967. if (node.getAttribute("id") == id) {
  49968. rtv = node;
  49969. return true;
  49970. }
  49971. }
  49972. });
  49973. return rtv;
  49974. },
  49975. getElementsByClassName: function(classNames) {
  49976. var classNamesSet = toOrderedSet(classNames);
  49977. return new LiveNodeList(this, function(base2) {
  49978. var ls = [];
  49979. if (classNamesSet.length > 0) {
  49980. _visitNode(base2.documentElement, function(node) {
  49981. if (node !== base2 && node.nodeType === ELEMENT_NODE) {
  49982. var nodeClassNames = node.getAttribute("class");
  49983. if (nodeClassNames) {
  49984. var matches = classNames === nodeClassNames;
  49985. if (!matches) {
  49986. var nodeClassNamesSet = toOrderedSet(nodeClassNames);
  49987. matches = classNamesSet.every(arrayIncludes(nodeClassNamesSet));
  49988. }
  49989. if (matches) {
  49990. ls.push(node);
  49991. }
  49992. }
  49993. }
  49994. });
  49995. }
  49996. return ls;
  49997. });
  49998. },
  49999. createElement: function(tagName) {
  50000. var node = new Element$1();
  50001. node.ownerDocument = this;
  50002. node.nodeName = tagName;
  50003. node.tagName = tagName;
  50004. node.localName = tagName;
  50005. node.childNodes = new NodeList();
  50006. var attrs = node.attributes = new NamedNodeMap();
  50007. attrs._ownerElement = node;
  50008. return node;
  50009. },
  50010. createDocumentFragment: function() {
  50011. var node = new DocumentFragment();
  50012. node.ownerDocument = this;
  50013. node.childNodes = new NodeList();
  50014. return node;
  50015. },
  50016. createTextNode: function(data) {
  50017. var node = new Text();
  50018. node.ownerDocument = this;
  50019. node.appendData(data);
  50020. return node;
  50021. },
  50022. createComment: function(data) {
  50023. var node = new Comment();
  50024. node.ownerDocument = this;
  50025. node.appendData(data);
  50026. return node;
  50027. },
  50028. createCDATASection: function(data) {
  50029. var node = new CDATASection();
  50030. node.ownerDocument = this;
  50031. node.appendData(data);
  50032. return node;
  50033. },
  50034. createProcessingInstruction: function(target, data) {
  50035. var node = new ProcessingInstruction();
  50036. node.ownerDocument = this;
  50037. node.tagName = node.target = target;
  50038. node.nodeValue = node.data = data;
  50039. return node;
  50040. },
  50041. createAttribute: function(name) {
  50042. var node = new Attr();
  50043. node.ownerDocument = this;
  50044. node.name = name;
  50045. node.nodeName = name;
  50046. node.localName = name;
  50047. node.specified = true;
  50048. return node;
  50049. },
  50050. createEntityReference: function(name) {
  50051. var node = new EntityReference();
  50052. node.ownerDocument = this;
  50053. node.nodeName = name;
  50054. return node;
  50055. },
  50056. createElementNS: function(namespaceURI, qualifiedName) {
  50057. var node = new Element$1();
  50058. var pl = qualifiedName.split(":");
  50059. var attrs = node.attributes = new NamedNodeMap();
  50060. node.childNodes = new NodeList();
  50061. node.ownerDocument = this;
  50062. node.nodeName = qualifiedName;
  50063. node.tagName = qualifiedName;
  50064. node.namespaceURI = namespaceURI;
  50065. if (pl.length == 2) {
  50066. node.prefix = pl[0];
  50067. node.localName = pl[1];
  50068. } else {
  50069. node.localName = qualifiedName;
  50070. }
  50071. attrs._ownerElement = node;
  50072. return node;
  50073. },
  50074. createAttributeNS: function(namespaceURI, qualifiedName) {
  50075. var node = new Attr();
  50076. var pl = qualifiedName.split(":");
  50077. node.ownerDocument = this;
  50078. node.nodeName = qualifiedName;
  50079. node.name = qualifiedName;
  50080. node.namespaceURI = namespaceURI;
  50081. node.specified = true;
  50082. if (pl.length == 2) {
  50083. node.prefix = pl[0];
  50084. node.localName = pl[1];
  50085. } else {
  50086. node.localName = qualifiedName;
  50087. }
  50088. return node;
  50089. }
  50090. };
  50091. _extends(Document, Node);
  50092. function Element$1() {
  50093. this._nsMap = {};
  50094. }
  50095. Element$1.prototype = {
  50096. nodeType: ELEMENT_NODE,
  50097. hasAttribute: function(name) {
  50098. return this.getAttributeNode(name) != null;
  50099. },
  50100. getAttribute: function(name) {
  50101. var attr = this.getAttributeNode(name);
  50102. return attr && attr.value || "";
  50103. },
  50104. getAttributeNode: function(name) {
  50105. return this.attributes.getNamedItem(name);
  50106. },
  50107. setAttribute: function(name, value) {
  50108. var attr = this.ownerDocument.createAttribute(name);
  50109. attr.value = attr.nodeValue = "" + value;
  50110. this.setAttributeNode(attr);
  50111. },
  50112. removeAttribute: function(name) {
  50113. var attr = this.getAttributeNode(name);
  50114. attr && this.removeAttributeNode(attr);
  50115. },
  50116. appendChild: function(newChild) {
  50117. if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) {
  50118. return this.insertBefore(newChild, null);
  50119. } else {
  50120. return _appendSingleChild(this, newChild);
  50121. }
  50122. },
  50123. setAttributeNode: function(newAttr) {
  50124. return this.attributes.setNamedItem(newAttr);
  50125. },
  50126. setAttributeNodeNS: function(newAttr) {
  50127. return this.attributes.setNamedItemNS(newAttr);
  50128. },
  50129. removeAttributeNode: function(oldAttr) {
  50130. return this.attributes.removeNamedItem(oldAttr.nodeName);
  50131. },
  50132. removeAttributeNS: function(namespaceURI, localName) {
  50133. var old = this.getAttributeNodeNS(namespaceURI, localName);
  50134. old && this.removeAttributeNode(old);
  50135. },
  50136. hasAttributeNS: function(namespaceURI, localName) {
  50137. return this.getAttributeNodeNS(namespaceURI, localName) != null;
  50138. },
  50139. getAttributeNS: function(namespaceURI, localName) {
  50140. var attr = this.getAttributeNodeNS(namespaceURI, localName);
  50141. return attr && attr.value || "";
  50142. },
  50143. setAttributeNS: function(namespaceURI, qualifiedName, value) {
  50144. var attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);
  50145. attr.value = attr.nodeValue = "" + value;
  50146. this.setAttributeNode(attr);
  50147. },
  50148. getAttributeNodeNS: function(namespaceURI, localName) {
  50149. return this.attributes.getNamedItemNS(namespaceURI, localName);
  50150. },
  50151. getElementsByTagName: function(tagName) {
  50152. return new LiveNodeList(this, function(base2) {
  50153. var ls = [];
  50154. _visitNode(base2, function(node) {
  50155. if (node !== base2 && node.nodeType == ELEMENT_NODE && (tagName === "*" || node.tagName == tagName)) {
  50156. ls.push(node);
  50157. }
  50158. });
  50159. return ls;
  50160. });
  50161. },
  50162. getElementsByTagNameNS: function(namespaceURI, localName) {
  50163. return new LiveNodeList(this, function(base2) {
  50164. var ls = [];
  50165. _visitNode(base2, function(node) {
  50166. if (node !== base2 && node.nodeType === ELEMENT_NODE && (namespaceURI === "*" || node.namespaceURI === namespaceURI) && (localName === "*" || node.localName == localName)) {
  50167. ls.push(node);
  50168. }
  50169. });
  50170. return ls;
  50171. });
  50172. }
  50173. };
  50174. Document.prototype.getElementsByTagName = Element$1.prototype.getElementsByTagName;
  50175. Document.prototype.getElementsByTagNameNS = Element$1.prototype.getElementsByTagNameNS;
  50176. _extends(Element$1, Node);
  50177. function Attr() {
  50178. }
  50179. Attr.prototype.nodeType = ATTRIBUTE_NODE;
  50180. _extends(Attr, Node);
  50181. function CharacterData() {
  50182. }
  50183. CharacterData.prototype = {
  50184. data: "",
  50185. substringData: function(offset, count) {
  50186. return this.data.substring(offset, offset + count);
  50187. },
  50188. appendData: function(text) {
  50189. text = this.data + text;
  50190. this.nodeValue = this.data = text;
  50191. this.length = text.length;
  50192. },
  50193. insertData: function(offset, text) {
  50194. this.replaceData(offset, 0, text);
  50195. },
  50196. appendChild: function(newChild) {
  50197. throw new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR]);
  50198. },
  50199. deleteData: function(offset, count) {
  50200. this.replaceData(offset, count, "");
  50201. },
  50202. replaceData: function(offset, count, text) {
  50203. var start2 = this.data.substring(0, offset);
  50204. var end = this.data.substring(offset + count);
  50205. text = start2 + text + end;
  50206. this.nodeValue = this.data = text;
  50207. this.length = text.length;
  50208. }
  50209. };
  50210. _extends(CharacterData, Node);
  50211. function Text() {
  50212. }
  50213. Text.prototype = {
  50214. nodeName: "#text",
  50215. nodeType: TEXT_NODE,
  50216. splitText: function(offset) {
  50217. var text = this.data;
  50218. var newText = text.substring(offset);
  50219. text = text.substring(0, offset);
  50220. this.data = this.nodeValue = text;
  50221. this.length = text.length;
  50222. var newNode = this.ownerDocument.createTextNode(newText);
  50223. if (this.parentNode) {
  50224. this.parentNode.insertBefore(newNode, this.nextSibling);
  50225. }
  50226. return newNode;
  50227. }
  50228. };
  50229. _extends(Text, CharacterData);
  50230. function Comment() {
  50231. }
  50232. Comment.prototype = {
  50233. nodeName: "#comment",
  50234. nodeType: COMMENT_NODE
  50235. };
  50236. _extends(Comment, CharacterData);
  50237. function CDATASection() {
  50238. }
  50239. CDATASection.prototype = {
  50240. nodeName: "#cdata-section",
  50241. nodeType: CDATA_SECTION_NODE
  50242. };
  50243. _extends(CDATASection, CharacterData);
  50244. function DocumentType() {
  50245. }
  50246. DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
  50247. _extends(DocumentType, Node);
  50248. function Notation() {
  50249. }
  50250. Notation.prototype.nodeType = NOTATION_NODE;
  50251. _extends(Notation, Node);
  50252. function Entity() {
  50253. }
  50254. Entity.prototype.nodeType = ENTITY_NODE;
  50255. _extends(Entity, Node);
  50256. function EntityReference() {
  50257. }
  50258. EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;
  50259. _extends(EntityReference, Node);
  50260. function DocumentFragment() {
  50261. }
  50262. DocumentFragment.prototype.nodeName = "#document-fragment";
  50263. DocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE;
  50264. _extends(DocumentFragment, Node);
  50265. function ProcessingInstruction() {
  50266. }
  50267. ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
  50268. _extends(ProcessingInstruction, Node);
  50269. function XMLSerializer() {
  50270. }
  50271. XMLSerializer.prototype.serializeToString = function(node, isHtml, nodeFilter) {
  50272. return nodeSerializeToString.call(node, isHtml, nodeFilter);
  50273. };
  50274. Node.prototype.toString = nodeSerializeToString;
  50275. function nodeSerializeToString(isHtml, nodeFilter) {
  50276. var buf = [];
  50277. var refNode = this.nodeType == 9 && this.documentElement || this;
  50278. var prefix = refNode.prefix;
  50279. var uri = refNode.namespaceURI;
  50280. if (uri && prefix == null) {
  50281. var prefix = refNode.lookupPrefix(uri);
  50282. if (prefix == null) {
  50283. var visibleNamespaces = [
  50284. { namespace: uri, prefix: null }
  50285. ];
  50286. }
  50287. }
  50288. serializeToString(this, buf, isHtml, nodeFilter, visibleNamespaces);
  50289. return buf.join("");
  50290. }
  50291. function needNamespaceDefine(node, isHTML, visibleNamespaces) {
  50292. var prefix = node.prefix || "";
  50293. var uri = node.namespaceURI;
  50294. if (!uri) {
  50295. return false;
  50296. }
  50297. if (prefix === "xml" && uri === NAMESPACE$2.XML || uri === NAMESPACE$2.XMLNS) {
  50298. return false;
  50299. }
  50300. var i2 = visibleNamespaces.length;
  50301. while (i2--) {
  50302. var ns = visibleNamespaces[i2];
  50303. if (ns.prefix === prefix) {
  50304. return ns.namespace !== uri;
  50305. }
  50306. }
  50307. return true;
  50308. }
  50309. function addSerializedAttribute(buf, qualifiedName, value) {
  50310. buf.push(" ", qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"');
  50311. }
  50312. function serializeToString(node, buf, isHTML, nodeFilter, visibleNamespaces) {
  50313. if (!visibleNamespaces) {
  50314. visibleNamespaces = [];
  50315. }
  50316. if (nodeFilter) {
  50317. node = nodeFilter(node);
  50318. if (node) {
  50319. if (typeof node == "string") {
  50320. buf.push(node);
  50321. return;
  50322. }
  50323. } else {
  50324. return;
  50325. }
  50326. }
  50327. switch (node.nodeType) {
  50328. case ELEMENT_NODE:
  50329. var attrs = node.attributes;
  50330. var len = attrs.length;
  50331. var child = node.firstChild;
  50332. var nodeName = node.tagName;
  50333. isHTML = NAMESPACE$2.isHTML(node.namespaceURI) || isHTML;
  50334. var prefixedNodeName = nodeName;
  50335. if (!isHTML && !node.prefix && node.namespaceURI) {
  50336. var defaultNS;
  50337. for (var ai = 0; ai < attrs.length; ai++) {
  50338. if (attrs.item(ai).name === "xmlns") {
  50339. defaultNS = attrs.item(ai).value;
  50340. break;
  50341. }
  50342. }
  50343. if (!defaultNS) {
  50344. for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
  50345. var namespace = visibleNamespaces[nsi];
  50346. if (namespace.prefix === "" && namespace.namespace === node.namespaceURI) {
  50347. defaultNS = namespace.namespace;
  50348. break;
  50349. }
  50350. }
  50351. }
  50352. if (defaultNS !== node.namespaceURI) {
  50353. for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
  50354. var namespace = visibleNamespaces[nsi];
  50355. if (namespace.namespace === node.namespaceURI) {
  50356. if (namespace.prefix) {
  50357. prefixedNodeName = namespace.prefix + ":" + nodeName;
  50358. }
  50359. break;
  50360. }
  50361. }
  50362. }
  50363. }
  50364. buf.push("<", prefixedNodeName);
  50365. for (var i2 = 0; i2 < len; i2++) {
  50366. var attr = attrs.item(i2);
  50367. if (attr.prefix == "xmlns") {
  50368. visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });
  50369. } else if (attr.nodeName == "xmlns") {
  50370. visibleNamespaces.push({ prefix: "", namespace: attr.value });
  50371. }
  50372. }
  50373. for (var i2 = 0; i2 < len; i2++) {
  50374. var attr = attrs.item(i2);
  50375. if (needNamespaceDefine(attr, isHTML, visibleNamespaces)) {
  50376. var prefix = attr.prefix || "";
  50377. var uri = attr.namespaceURI;
  50378. addSerializedAttribute(buf, prefix ? "xmlns:" + prefix : "xmlns", uri);
  50379. visibleNamespaces.push({ prefix, namespace: uri });
  50380. }
  50381. serializeToString(attr, buf, isHTML, nodeFilter, visibleNamespaces);
  50382. }
  50383. if (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {
  50384. var prefix = node.prefix || "";
  50385. var uri = node.namespaceURI;
  50386. addSerializedAttribute(buf, prefix ? "xmlns:" + prefix : "xmlns", uri);
  50387. visibleNamespaces.push({ prefix, namespace: uri });
  50388. }
  50389. if (child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)) {
  50390. buf.push(">");
  50391. if (isHTML && /^script$/i.test(nodeName)) {
  50392. while (child) {
  50393. if (child.data) {
  50394. buf.push(child.data);
  50395. } else {
  50396. serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
  50397. }
  50398. child = child.nextSibling;
  50399. }
  50400. } else {
  50401. while (child) {
  50402. serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
  50403. child = child.nextSibling;
  50404. }
  50405. }
  50406. buf.push("</", prefixedNodeName, ">");
  50407. } else {
  50408. buf.push("/>");
  50409. }
  50410. return;
  50411. case DOCUMENT_NODE:
  50412. case DOCUMENT_FRAGMENT_NODE:
  50413. var child = node.firstChild;
  50414. while (child) {
  50415. serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
  50416. child = child.nextSibling;
  50417. }
  50418. return;
  50419. case ATTRIBUTE_NODE:
  50420. return addSerializedAttribute(buf, node.name, node.value);
  50421. case TEXT_NODE:
  50422. return buf.push(
  50423. node.data.replace(/[<&>]/g, _xmlEncoder)
  50424. );
  50425. case CDATA_SECTION_NODE:
  50426. return buf.push("<![CDATA[", node.data, "]]>");
  50427. case COMMENT_NODE:
  50428. return buf.push("<!--", node.data, "-->");
  50429. case DOCUMENT_TYPE_NODE:
  50430. var pubid = node.publicId;
  50431. var sysid = node.systemId;
  50432. buf.push("<!DOCTYPE ", node.name);
  50433. if (pubid) {
  50434. buf.push(" PUBLIC ", pubid);
  50435. if (sysid && sysid != ".") {
  50436. buf.push(" ", sysid);
  50437. }
  50438. buf.push(">");
  50439. } else if (sysid && sysid != ".") {
  50440. buf.push(" SYSTEM ", sysid, ">");
  50441. } else {
  50442. var sub = node.internalSubset;
  50443. if (sub) {
  50444. buf.push(" [", sub, "]");
  50445. }
  50446. buf.push(">");
  50447. }
  50448. return;
  50449. case PROCESSING_INSTRUCTION_NODE:
  50450. return buf.push("<?", node.target, " ", node.data, "?>");
  50451. case ENTITY_REFERENCE_NODE:
  50452. return buf.push("&", node.nodeName, ";");
  50453. default:
  50454. buf.push("??", node.nodeName);
  50455. }
  50456. }
  50457. function importNode(doc, node, deep) {
  50458. var node2;
  50459. switch (node.nodeType) {
  50460. case ELEMENT_NODE:
  50461. node2 = node.cloneNode(false);
  50462. node2.ownerDocument = doc;
  50463. case DOCUMENT_FRAGMENT_NODE:
  50464. break;
  50465. case ATTRIBUTE_NODE:
  50466. deep = true;
  50467. break;
  50468. }
  50469. if (!node2) {
  50470. node2 = node.cloneNode(false);
  50471. }
  50472. node2.ownerDocument = doc;
  50473. node2.parentNode = null;
  50474. if (deep) {
  50475. var child = node.firstChild;
  50476. while (child) {
  50477. node2.appendChild(importNode(doc, child, deep));
  50478. child = child.nextSibling;
  50479. }
  50480. }
  50481. return node2;
  50482. }
  50483. function cloneNode(doc, node, deep) {
  50484. var node2 = new node.constructor();
  50485. for (var n in node) {
  50486. if (Object.prototype.hasOwnProperty.call(node, n)) {
  50487. var v = node[n];
  50488. if (typeof v != "object") {
  50489. if (v != node2[n]) {
  50490. node2[n] = v;
  50491. }
  50492. }
  50493. }
  50494. }
  50495. if (node.childNodes) {
  50496. node2.childNodes = new NodeList();
  50497. }
  50498. node2.ownerDocument = doc;
  50499. switch (node2.nodeType) {
  50500. case ELEMENT_NODE:
  50501. var attrs = node.attributes;
  50502. var attrs2 = node2.attributes = new NamedNodeMap();
  50503. var len = attrs.length;
  50504. attrs2._ownerElement = node2;
  50505. for (var i2 = 0; i2 < len; i2++) {
  50506. node2.setAttributeNode(cloneNode(doc, attrs.item(i2), true));
  50507. }
  50508. break;
  50509. case ATTRIBUTE_NODE:
  50510. deep = true;
  50511. }
  50512. if (deep) {
  50513. var child = node.firstChild;
  50514. while (child) {
  50515. node2.appendChild(cloneNode(doc, child, deep));
  50516. child = child.nextSibling;
  50517. }
  50518. }
  50519. return node2;
  50520. }
  50521. function __set__(object, key, value) {
  50522. object[key] = value;
  50523. }
  50524. try {
  50525. if (Object.defineProperty) {
  50526. let getTextContent = function(node) {
  50527. switch (node.nodeType) {
  50528. case ELEMENT_NODE:
  50529. case DOCUMENT_FRAGMENT_NODE:
  50530. var buf = [];
  50531. node = node.firstChild;
  50532. while (node) {
  50533. if (node.nodeType !== 7 && node.nodeType !== 8) {
  50534. buf.push(getTextContent(node));
  50535. }
  50536. node = node.nextSibling;
  50537. }
  50538. return buf.join("");
  50539. default:
  50540. return node.nodeValue;
  50541. }
  50542. };
  50543. Object.defineProperty(LiveNodeList.prototype, "length", {
  50544. get: function() {
  50545. _updateLiveList(this);
  50546. return this.$$length;
  50547. }
  50548. });
  50549. Object.defineProperty(Node.prototype, "textContent", {
  50550. get: function() {
  50551. return getTextContent(this);
  50552. },
  50553. set: function(data) {
  50554. switch (this.nodeType) {
  50555. case ELEMENT_NODE:
  50556. case DOCUMENT_FRAGMENT_NODE:
  50557. while (this.firstChild) {
  50558. this.removeChild(this.firstChild);
  50559. }
  50560. if (data || String(data)) {
  50561. this.appendChild(this.ownerDocument.createTextNode(data));
  50562. }
  50563. break;
  50564. default:
  50565. this.data = data;
  50566. this.value = data;
  50567. this.nodeValue = data;
  50568. }
  50569. }
  50570. });
  50571. __set__ = function(object, key, value) {
  50572. object["$$" + key] = value;
  50573. };
  50574. }
  50575. } catch (e) {
  50576. }
  50577. dom$1.DocumentType = DocumentType;
  50578. dom$1.DOMException = DOMException;
  50579. dom$1.DOMImplementation = DOMImplementation$1;
  50580. dom$1.Element = Element$1;
  50581. dom$1.Node = Node;
  50582. dom$1.NodeList = NodeList;
  50583. dom$1.XMLSerializer = XMLSerializer;
  50584. var domParser = {};
  50585. var entities$1 = {};
  50586. (function(exports2) {
  50587. var freeze2 = conventions$2.freeze;
  50588. exports2.XML_ENTITIES = freeze2({ amp: "&", apos: "'", gt: ">", lt: "<", quot: '"' });
  50589. exports2.HTML_ENTITIES = freeze2({
  50590. lt: "<",
  50591. gt: ">",
  50592. amp: "&",
  50593. quot: '"',
  50594. apos: "'",
  50595. Agrave: "\xC0",
  50596. Aacute: "\xC1",
  50597. Acirc: "\xC2",
  50598. Atilde: "\xC3",
  50599. Auml: "\xC4",
  50600. Aring: "\xC5",
  50601. AElig: "\xC6",
  50602. Ccedil: "\xC7",
  50603. Egrave: "\xC8",
  50604. Eacute: "\xC9",
  50605. Ecirc: "\xCA",
  50606. Euml: "\xCB",
  50607. Igrave: "\xCC",
  50608. Iacute: "\xCD",
  50609. Icirc: "\xCE",
  50610. Iuml: "\xCF",
  50611. ETH: "\xD0",
  50612. Ntilde: "\xD1",
  50613. Ograve: "\xD2",
  50614. Oacute: "\xD3",
  50615. Ocirc: "\xD4",
  50616. Otilde: "\xD5",
  50617. Ouml: "\xD6",
  50618. Oslash: "\xD8",
  50619. Ugrave: "\xD9",
  50620. Uacute: "\xDA",
  50621. Ucirc: "\xDB",
  50622. Uuml: "\xDC",
  50623. Yacute: "\xDD",
  50624. THORN: "\xDE",
  50625. szlig: "\xDF",
  50626. agrave: "\xE0",
  50627. aacute: "\xE1",
  50628. acirc: "\xE2",
  50629. atilde: "\xE3",
  50630. auml: "\xE4",
  50631. aring: "\xE5",
  50632. aelig: "\xE6",
  50633. ccedil: "\xE7",
  50634. egrave: "\xE8",
  50635. eacute: "\xE9",
  50636. ecirc: "\xEA",
  50637. euml: "\xEB",
  50638. igrave: "\xEC",
  50639. iacute: "\xED",
  50640. icirc: "\xEE",
  50641. iuml: "\xEF",
  50642. eth: "\xF0",
  50643. ntilde: "\xF1",
  50644. ograve: "\xF2",
  50645. oacute: "\xF3",
  50646. ocirc: "\xF4",
  50647. otilde: "\xF5",
  50648. ouml: "\xF6",
  50649. oslash: "\xF8",
  50650. ugrave: "\xF9",
  50651. uacute: "\xFA",
  50652. ucirc: "\xFB",
  50653. uuml: "\xFC",
  50654. yacute: "\xFD",
  50655. thorn: "\xFE",
  50656. yuml: "\xFF",
  50657. nbsp: "\xA0",
  50658. iexcl: "\xA1",
  50659. cent: "\xA2",
  50660. pound: "\xA3",
  50661. curren: "\xA4",
  50662. yen: "\xA5",
  50663. brvbar: "\xA6",
  50664. sect: "\xA7",
  50665. uml: "\xA8",
  50666. copy: "\xA9",
  50667. ordf: "\xAA",
  50668. laquo: "\xAB",
  50669. not: "\xAC",
  50670. shy: "\xAD\xAD",
  50671. reg: "\xAE",
  50672. macr: "\xAF",
  50673. deg: "\xB0",
  50674. plusmn: "\xB1",
  50675. sup2: "\xB2",
  50676. sup3: "\xB3",
  50677. acute: "\xB4",
  50678. micro: "\xB5",
  50679. para: "\xB6",
  50680. middot: "\xB7",
  50681. cedil: "\xB8",
  50682. sup1: "\xB9",
  50683. ordm: "\xBA",
  50684. raquo: "\xBB",
  50685. frac14: "\xBC",
  50686. frac12: "\xBD",
  50687. frac34: "\xBE",
  50688. iquest: "\xBF",
  50689. times: "\xD7",
  50690. divide: "\xF7",
  50691. forall: "\u2200",
  50692. part: "\u2202",
  50693. exist: "\u2203",
  50694. empty: "\u2205",
  50695. nabla: "\u2207",
  50696. isin: "\u2208",
  50697. notin: "\u2209",
  50698. ni: "\u220B",
  50699. prod: "\u220F",
  50700. sum: "\u2211",
  50701. minus: "\u2212",
  50702. lowast: "\u2217",
  50703. radic: "\u221A",
  50704. prop: "\u221D",
  50705. infin: "\u221E",
  50706. ang: "\u2220",
  50707. and: "\u2227",
  50708. or: "\u2228",
  50709. cap: "\u2229",
  50710. cup: "\u222A",
  50711. "int": "\u222B",
  50712. there4: "\u2234",
  50713. sim: "\u223C",
  50714. cong: "\u2245",
  50715. asymp: "\u2248",
  50716. ne: "\u2260",
  50717. equiv: "\u2261",
  50718. le: "\u2264",
  50719. ge: "\u2265",
  50720. sub: "\u2282",
  50721. sup: "\u2283",
  50722. nsub: "\u2284",
  50723. sube: "\u2286",
  50724. supe: "\u2287",
  50725. oplus: "\u2295",
  50726. otimes: "\u2297",
  50727. perp: "\u22A5",
  50728. sdot: "\u22C5",
  50729. Alpha: "\u0391",
  50730. Beta: "\u0392",
  50731. Gamma: "\u0393",
  50732. Delta: "\u0394",
  50733. Epsilon: "\u0395",
  50734. Zeta: "\u0396",
  50735. Eta: "\u0397",
  50736. Theta: "\u0398",
  50737. Iota: "\u0399",
  50738. Kappa: "\u039A",
  50739. Lambda: "\u039B",
  50740. Mu: "\u039C",
  50741. Nu: "\u039D",
  50742. Xi: "\u039E",
  50743. Omicron: "\u039F",
  50744. Pi: "\u03A0",
  50745. Rho: "\u03A1",
  50746. Sigma: "\u03A3",
  50747. Tau: "\u03A4",
  50748. Upsilon: "\u03A5",
  50749. Phi: "\u03A6",
  50750. Chi: "\u03A7",
  50751. Psi: "\u03A8",
  50752. Omega: "\u03A9",
  50753. alpha: "\u03B1",
  50754. beta: "\u03B2",
  50755. gamma: "\u03B3",
  50756. delta: "\u03B4",
  50757. epsilon: "\u03B5",
  50758. zeta: "\u03B6",
  50759. eta: "\u03B7",
  50760. theta: "\u03B8",
  50761. iota: "\u03B9",
  50762. kappa: "\u03BA",
  50763. lambda: "\u03BB",
  50764. mu: "\u03BC",
  50765. nu: "\u03BD",
  50766. xi: "\u03BE",
  50767. omicron: "\u03BF",
  50768. pi: "\u03C0",
  50769. rho: "\u03C1",
  50770. sigmaf: "\u03C2",
  50771. sigma: "\u03C3",
  50772. tau: "\u03C4",
  50773. upsilon: "\u03C5",
  50774. phi: "\u03C6",
  50775. chi: "\u03C7",
  50776. psi: "\u03C8",
  50777. omega: "\u03C9",
  50778. thetasym: "\u03D1",
  50779. upsih: "\u03D2",
  50780. piv: "\u03D6",
  50781. OElig: "\u0152",
  50782. oelig: "\u0153",
  50783. Scaron: "\u0160",
  50784. scaron: "\u0161",
  50785. Yuml: "\u0178",
  50786. fnof: "\u0192",
  50787. circ: "\u02C6",
  50788. tilde: "\u02DC",
  50789. ensp: "\u2002",
  50790. emsp: "\u2003",
  50791. thinsp: "\u2009",
  50792. zwnj: "\u200C",
  50793. zwj: "\u200D",
  50794. lrm: "\u200E",
  50795. rlm: "\u200F",
  50796. ndash: "\u2013",
  50797. mdash: "\u2014",
  50798. lsquo: "\u2018",
  50799. rsquo: "\u2019",
  50800. sbquo: "\u201A",
  50801. ldquo: "\u201C",
  50802. rdquo: "\u201D",
  50803. bdquo: "\u201E",
  50804. dagger: "\u2020",
  50805. Dagger: "\u2021",
  50806. bull: "\u2022",
  50807. hellip: "\u2026",
  50808. permil: "\u2030",
  50809. prime: "\u2032",
  50810. Prime: "\u2033",
  50811. lsaquo: "\u2039",
  50812. rsaquo: "\u203A",
  50813. oline: "\u203E",
  50814. euro: "\u20AC",
  50815. trade: "\u2122",
  50816. larr: "\u2190",
  50817. uarr: "\u2191",
  50818. rarr: "\u2192",
  50819. darr: "\u2193",
  50820. harr: "\u2194",
  50821. crarr: "\u21B5",
  50822. lceil: "\u2308",
  50823. rceil: "\u2309",
  50824. lfloor: "\u230A",
  50825. rfloor: "\u230B",
  50826. loz: "\u25CA",
  50827. spades: "\u2660",
  50828. clubs: "\u2663",
  50829. hearts: "\u2665",
  50830. diams: "\u2666"
  50831. });
  50832. exports2.entityMap = exports2.HTML_ENTITIES;
  50833. })(entities$1);
  50834. var sax$1 = {};
  50835. var NAMESPACE$1 = conventions$2.NAMESPACE;
  50836. var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;
  50837. var nameChar = new RegExp("[\\-\\.0-9" + nameStartChar.source.slice(1, -1) + "\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");
  50838. var tagNamePattern = new RegExp("^" + nameStartChar.source + nameChar.source + "*(?::" + nameStartChar.source + nameChar.source + "*)?$");
  50839. var S_TAG = 0;
  50840. var S_ATTR = 1;
  50841. var S_ATTR_SPACE = 2;
  50842. var S_EQ = 3;
  50843. var S_ATTR_NOQUOT_VALUE = 4;
  50844. var S_ATTR_END = 5;
  50845. var S_TAG_SPACE = 6;
  50846. var S_TAG_CLOSE = 7;
  50847. function ParseError$1(message, locator) {
  50848. this.message = message;
  50849. this.locator = locator;
  50850. if (Error.captureStackTrace)
  50851. Error.captureStackTrace(this, ParseError$1);
  50852. }
  50853. ParseError$1.prototype = new Error();
  50854. ParseError$1.prototype.name = ParseError$1.name;
  50855. function XMLReader$1() {
  50856. }
  50857. XMLReader$1.prototype = {
  50858. parse: function(source, defaultNSMap, entityMap) {
  50859. var domBuilder = this.domBuilder;
  50860. domBuilder.startDocument();
  50861. _copy(defaultNSMap, defaultNSMap = {});
  50862. parse$2(
  50863. source,
  50864. defaultNSMap,
  50865. entityMap,
  50866. domBuilder,
  50867. this.errorHandler
  50868. );
  50869. domBuilder.endDocument();
  50870. }
  50871. };
  50872. function parse$2(source, defaultNSMapCopy, entityMap, domBuilder, errorHandler) {
  50873. function fixedFromCharCode(code) {
  50874. if (code > 65535) {
  50875. code -= 65536;
  50876. var surrogate1 = 55296 + (code >> 10), surrogate2 = 56320 + (code & 1023);
  50877. return String.fromCharCode(surrogate1, surrogate2);
  50878. } else {
  50879. return String.fromCharCode(code);
  50880. }
  50881. }
  50882. function entityReplacer(a2) {
  50883. var k = a2.slice(1, -1);
  50884. if (Object.hasOwnProperty.call(entityMap, k)) {
  50885. return entityMap[k];
  50886. } else if (k.charAt(0) === "#") {
  50887. return fixedFromCharCode(parseInt(k.substr(1).replace("x", "0x")));
  50888. } else {
  50889. errorHandler.error("entity not found:" + a2);
  50890. return a2;
  50891. }
  50892. }
  50893. function appendText(end2) {
  50894. if (end2 > start2) {
  50895. var xt2 = source.substring(start2, end2).replace(/&#?\w+;/g, entityReplacer);
  50896. locator && position2(start2);
  50897. domBuilder.characters(xt2, 0, end2 - start2);
  50898. start2 = end2;
  50899. }
  50900. }
  50901. function position2(p, m) {
  50902. while (p >= lineEnd && (m = linePattern.exec(source))) {
  50903. lineStart = m.index;
  50904. lineEnd = lineStart + m[0].length;
  50905. locator.lineNumber++;
  50906. }
  50907. locator.columnNumber = p - lineStart + 1;
  50908. }
  50909. var lineStart = 0;
  50910. var lineEnd = 0;
  50911. var linePattern = /.*(?:\r\n?|\n)|.*$/g;
  50912. var locator = domBuilder.locator;
  50913. var parseStack = [{ currentNSMap: defaultNSMapCopy }];
  50914. var closeMap = {};
  50915. var start2 = 0;
  50916. while (true) {
  50917. try {
  50918. var tagStart = source.indexOf("<", start2);
  50919. if (tagStart < 0) {
  50920. if (!source.substr(start2).match(/^\s*$/)) {
  50921. var doc = domBuilder.doc;
  50922. var text = doc.createTextNode(source.substr(start2));
  50923. doc.appendChild(text);
  50924. domBuilder.currentElement = text;
  50925. }
  50926. return;
  50927. }
  50928. if (tagStart > start2) {
  50929. appendText(tagStart);
  50930. }
  50931. switch (source.charAt(tagStart + 1)) {
  50932. case "/":
  50933. var end = source.indexOf(">", tagStart + 3);
  50934. var tagName = source.substring(tagStart + 2, end).replace(/[ \t\n\r]+$/g, "");
  50935. var config = parseStack.pop();
  50936. if (end < 0) {
  50937. tagName = source.substring(tagStart + 2).replace(/[\s<].*/, "");
  50938. errorHandler.error("end tag name: " + tagName + " is not complete:" + config.tagName);
  50939. end = tagStart + 1 + tagName.length;
  50940. } else if (tagName.match(/\s</)) {
  50941. tagName = tagName.replace(/[\s<].*/, "");
  50942. errorHandler.error("end tag name: " + tagName + " maybe not complete");
  50943. end = tagStart + 1 + tagName.length;
  50944. }
  50945. var localNSMap = config.localNSMap;
  50946. var endMatch = config.tagName == tagName;
  50947. var endIgnoreCaseMach = endMatch || config.tagName && config.tagName.toLowerCase() == tagName.toLowerCase();
  50948. if (endIgnoreCaseMach) {
  50949. domBuilder.endElement(config.uri, config.localName, tagName);
  50950. if (localNSMap) {
  50951. for (var prefix in localNSMap) {
  50952. if (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {
  50953. domBuilder.endPrefixMapping(prefix);
  50954. }
  50955. }
  50956. }
  50957. if (!endMatch) {
  50958. errorHandler.fatalError("end tag name: " + tagName + " is not match the current start tagName:" + config.tagName);
  50959. }
  50960. } else {
  50961. parseStack.push(config);
  50962. }
  50963. end++;
  50964. break;
  50965. case "?":
  50966. locator && position2(tagStart);
  50967. end = parseInstruction(source, tagStart, domBuilder);
  50968. break;
  50969. case "!":
  50970. locator && position2(tagStart);
  50971. end = parseDCC(source, tagStart, domBuilder, errorHandler);
  50972. break;
  50973. default:
  50974. locator && position2(tagStart);
  50975. var el = new ElementAttributes();
  50976. var currentNSMap = parseStack[parseStack.length - 1].currentNSMap;
  50977. var end = parseElementStartPart(source, tagStart, el, currentNSMap, entityReplacer, errorHandler);
  50978. var len = el.length;
  50979. if (!el.closed && fixSelfClosed(source, end, el.tagName, closeMap)) {
  50980. el.closed = true;
  50981. if (!entityMap.nbsp) {
  50982. errorHandler.warning("unclosed xml attribute");
  50983. }
  50984. }
  50985. if (locator && len) {
  50986. var locator2 = copyLocator(locator, {});
  50987. for (var i2 = 0; i2 < len; i2++) {
  50988. var a = el[i2];
  50989. position2(a.offset);
  50990. a.locator = copyLocator(locator, {});
  50991. }
  50992. domBuilder.locator = locator2;
  50993. if (appendElement$1(el, domBuilder, currentNSMap)) {
  50994. parseStack.push(el);
  50995. }
  50996. domBuilder.locator = locator;
  50997. } else {
  50998. if (appendElement$1(el, domBuilder, currentNSMap)) {
  50999. parseStack.push(el);
  51000. }
  51001. }
  51002. if (NAMESPACE$1.isHTML(el.uri) && !el.closed) {
  51003. end = parseHtmlSpecialContent(source, end, el.tagName, entityReplacer, domBuilder);
  51004. } else {
  51005. end++;
  51006. }
  51007. }
  51008. } catch (e) {
  51009. if (e instanceof ParseError$1) {
  51010. throw e;
  51011. }
  51012. errorHandler.error("element parse error: " + e);
  51013. end = -1;
  51014. }
  51015. if (end > start2) {
  51016. start2 = end;
  51017. } else {
  51018. appendText(Math.max(tagStart, start2) + 1);
  51019. }
  51020. }
  51021. }
  51022. function copyLocator(f, t2) {
  51023. t2.lineNumber = f.lineNumber;
  51024. t2.columnNumber = f.columnNumber;
  51025. return t2;
  51026. }
  51027. function parseElementStartPart(source, start2, el, currentNSMap, entityReplacer, errorHandler) {
  51028. function addAttribute(qname, value2, startIndex) {
  51029. if (el.attributeNames.hasOwnProperty(qname)) {
  51030. errorHandler.fatalError("Attribute " + qname + " redefined");
  51031. }
  51032. el.addValue(
  51033. qname,
  51034. value2.replace(/[\t\n\r]/g, " ").replace(/&#?\w+;/g, entityReplacer),
  51035. startIndex
  51036. );
  51037. }
  51038. var attrName;
  51039. var value;
  51040. var p = ++start2;
  51041. var s = S_TAG;
  51042. while (true) {
  51043. var c = source.charAt(p);
  51044. switch (c) {
  51045. case "=":
  51046. if (s === S_ATTR) {
  51047. attrName = source.slice(start2, p);
  51048. s = S_EQ;
  51049. } else if (s === S_ATTR_SPACE) {
  51050. s = S_EQ;
  51051. } else {
  51052. throw new Error("attribute equal must after attrName");
  51053. }
  51054. break;
  51055. case "'":
  51056. case '"':
  51057. if (s === S_EQ || s === S_ATTR) {
  51058. if (s === S_ATTR) {
  51059. errorHandler.warning('attribute value must after "="');
  51060. attrName = source.slice(start2, p);
  51061. }
  51062. start2 = p + 1;
  51063. p = source.indexOf(c, start2);
  51064. if (p > 0) {
  51065. value = source.slice(start2, p);
  51066. addAttribute(attrName, value, start2 - 1);
  51067. s = S_ATTR_END;
  51068. } else {
  51069. throw new Error("attribute value no end '" + c + "' match");
  51070. }
  51071. } else if (s == S_ATTR_NOQUOT_VALUE) {
  51072. value = source.slice(start2, p);
  51073. addAttribute(attrName, value, start2);
  51074. errorHandler.warning('attribute "' + attrName + '" missed start quot(' + c + ")!!");
  51075. start2 = p + 1;
  51076. s = S_ATTR_END;
  51077. } else {
  51078. throw new Error('attribute value must after "="');
  51079. }
  51080. break;
  51081. case "/":
  51082. switch (s) {
  51083. case S_TAG:
  51084. el.setTagName(source.slice(start2, p));
  51085. case S_ATTR_END:
  51086. case S_TAG_SPACE:
  51087. case S_TAG_CLOSE:
  51088. s = S_TAG_CLOSE;
  51089. el.closed = true;
  51090. case S_ATTR_NOQUOT_VALUE:
  51091. case S_ATTR:
  51092. break;
  51093. case S_ATTR_SPACE:
  51094. el.closed = true;
  51095. break;
  51096. default:
  51097. throw new Error("attribute invalid close char('/')");
  51098. }
  51099. break;
  51100. case "":
  51101. errorHandler.error("unexpected end of input");
  51102. if (s == S_TAG) {
  51103. el.setTagName(source.slice(start2, p));
  51104. }
  51105. return p;
  51106. case ">":
  51107. switch (s) {
  51108. case S_TAG:
  51109. el.setTagName(source.slice(start2, p));
  51110. case S_ATTR_END:
  51111. case S_TAG_SPACE:
  51112. case S_TAG_CLOSE:
  51113. break;
  51114. case S_ATTR_NOQUOT_VALUE:
  51115. case S_ATTR:
  51116. value = source.slice(start2, p);
  51117. if (value.slice(-1) === "/") {
  51118. el.closed = true;
  51119. value = value.slice(0, -1);
  51120. }
  51121. case S_ATTR_SPACE:
  51122. if (s === S_ATTR_SPACE) {
  51123. value = attrName;
  51124. }
  51125. if (s == S_ATTR_NOQUOT_VALUE) {
  51126. errorHandler.warning('attribute "' + value + '" missed quot(")!');
  51127. addAttribute(attrName, value, start2);
  51128. } else {
  51129. if (!NAMESPACE$1.isHTML(currentNSMap[""]) || !value.match(/^(?:disabled|checked|selected)$/i)) {
  51130. errorHandler.warning('attribute "' + value + '" missed value!! "' + value + '" instead!!');
  51131. }
  51132. addAttribute(value, value, start2);
  51133. }
  51134. break;
  51135. case S_EQ:
  51136. throw new Error("attribute value missed!!");
  51137. }
  51138. return p;
  51139. case "\x80":
  51140. c = " ";
  51141. default:
  51142. if (c <= " ") {
  51143. switch (s) {
  51144. case S_TAG:
  51145. el.setTagName(source.slice(start2, p));
  51146. s = S_TAG_SPACE;
  51147. break;
  51148. case S_ATTR:
  51149. attrName = source.slice(start2, p);
  51150. s = S_ATTR_SPACE;
  51151. break;
  51152. case S_ATTR_NOQUOT_VALUE:
  51153. var value = source.slice(start2, p);
  51154. errorHandler.warning('attribute "' + value + '" missed quot(")!!');
  51155. addAttribute(attrName, value, start2);
  51156. case S_ATTR_END:
  51157. s = S_TAG_SPACE;
  51158. break;
  51159. }
  51160. } else {
  51161. switch (s) {
  51162. case S_ATTR_SPACE:
  51163. el.tagName;
  51164. if (!NAMESPACE$1.isHTML(currentNSMap[""]) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {
  51165. errorHandler.warning('attribute "' + attrName + '" missed value!! "' + attrName + '" instead2!!');
  51166. }
  51167. addAttribute(attrName, attrName, start2);
  51168. start2 = p;
  51169. s = S_ATTR;
  51170. break;
  51171. case S_ATTR_END:
  51172. errorHandler.warning('attribute space is required"' + attrName + '"!!');
  51173. case S_TAG_SPACE:
  51174. s = S_ATTR;
  51175. start2 = p;
  51176. break;
  51177. case S_EQ:
  51178. s = S_ATTR_NOQUOT_VALUE;
  51179. start2 = p;
  51180. break;
  51181. case S_TAG_CLOSE:
  51182. throw new Error("elements closed character '/' and '>' must be connected to");
  51183. }
  51184. }
  51185. }
  51186. p++;
  51187. }
  51188. }
  51189. function appendElement$1(el, domBuilder, currentNSMap) {
  51190. var tagName = el.tagName;
  51191. var localNSMap = null;
  51192. var i2 = el.length;
  51193. while (i2--) {
  51194. var a = el[i2];
  51195. var qName = a.qName;
  51196. var value = a.value;
  51197. var nsp = qName.indexOf(":");
  51198. if (nsp > 0) {
  51199. var prefix = a.prefix = qName.slice(0, nsp);
  51200. var localName = qName.slice(nsp + 1);
  51201. var nsPrefix = prefix === "xmlns" && localName;
  51202. } else {
  51203. localName = qName;
  51204. prefix = null;
  51205. nsPrefix = qName === "xmlns" && "";
  51206. }
  51207. a.localName = localName;
  51208. if (nsPrefix !== false) {
  51209. if (localNSMap == null) {
  51210. localNSMap = {};
  51211. _copy(currentNSMap, currentNSMap = {});
  51212. }
  51213. currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;
  51214. a.uri = NAMESPACE$1.XMLNS;
  51215. domBuilder.startPrefixMapping(nsPrefix, value);
  51216. }
  51217. }
  51218. var i2 = el.length;
  51219. while (i2--) {
  51220. a = el[i2];
  51221. var prefix = a.prefix;
  51222. if (prefix) {
  51223. if (prefix === "xml") {
  51224. a.uri = NAMESPACE$1.XML;
  51225. }
  51226. if (prefix !== "xmlns") {
  51227. a.uri = currentNSMap[prefix || ""];
  51228. }
  51229. }
  51230. }
  51231. var nsp = tagName.indexOf(":");
  51232. if (nsp > 0) {
  51233. prefix = el.prefix = tagName.slice(0, nsp);
  51234. localName = el.localName = tagName.slice(nsp + 1);
  51235. } else {
  51236. prefix = null;
  51237. localName = el.localName = tagName;
  51238. }
  51239. var ns = el.uri = currentNSMap[prefix || ""];
  51240. domBuilder.startElement(ns, localName, tagName, el);
  51241. if (el.closed) {
  51242. domBuilder.endElement(ns, localName, tagName);
  51243. if (localNSMap) {
  51244. for (prefix in localNSMap) {
  51245. if (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {
  51246. domBuilder.endPrefixMapping(prefix);
  51247. }
  51248. }
  51249. }
  51250. } else {
  51251. el.currentNSMap = currentNSMap;
  51252. el.localNSMap = localNSMap;
  51253. return true;
  51254. }
  51255. }
  51256. function parseHtmlSpecialContent(source, elStartEnd, tagName, entityReplacer, domBuilder) {
  51257. if (/^(?:script|textarea)$/i.test(tagName)) {
  51258. var elEndStart = source.indexOf("</" + tagName + ">", elStartEnd);
  51259. var text = source.substring(elStartEnd + 1, elEndStart);
  51260. if (/[&<]/.test(text)) {
  51261. if (/^script$/i.test(tagName)) {
  51262. domBuilder.characters(text, 0, text.length);
  51263. return elEndStart;
  51264. }
  51265. text = text.replace(/&#?\w+;/g, entityReplacer);
  51266. domBuilder.characters(text, 0, text.length);
  51267. return elEndStart;
  51268. }
  51269. }
  51270. return elStartEnd + 1;
  51271. }
  51272. function fixSelfClosed(source, elStartEnd, tagName, closeMap) {
  51273. var pos = closeMap[tagName];
  51274. if (pos == null) {
  51275. pos = source.lastIndexOf("</" + tagName + ">");
  51276. if (pos < elStartEnd) {
  51277. pos = source.lastIndexOf("</" + tagName);
  51278. }
  51279. closeMap[tagName] = pos;
  51280. }
  51281. return pos < elStartEnd;
  51282. }
  51283. function _copy(source, target) {
  51284. for (var n in source) {
  51285. if (Object.prototype.hasOwnProperty.call(source, n)) {
  51286. target[n] = source[n];
  51287. }
  51288. }
  51289. }
  51290. function parseDCC(source, start2, domBuilder, errorHandler) {
  51291. var next = source.charAt(start2 + 2);
  51292. switch (next) {
  51293. case "-":
  51294. if (source.charAt(start2 + 3) === "-") {
  51295. var end = source.indexOf("-->", start2 + 4);
  51296. if (end > start2) {
  51297. domBuilder.comment(source, start2 + 4, end - start2 - 4);
  51298. return end + 3;
  51299. } else {
  51300. errorHandler.error("Unclosed comment");
  51301. return -1;
  51302. }
  51303. } else {
  51304. return -1;
  51305. }
  51306. default:
  51307. if (source.substr(start2 + 3, 6) == "CDATA[") {
  51308. var end = source.indexOf("]]>", start2 + 9);
  51309. domBuilder.startCDATA();
  51310. domBuilder.characters(source, start2 + 9, end - start2 - 9);
  51311. domBuilder.endCDATA();
  51312. return end + 3;
  51313. }
  51314. var matchs = split(source, start2);
  51315. var len = matchs.length;
  51316. if (len > 1 && /!doctype/i.test(matchs[0][0])) {
  51317. var name = matchs[1][0];
  51318. var pubid = false;
  51319. var sysid = false;
  51320. if (len > 3) {
  51321. if (/^public$/i.test(matchs[2][0])) {
  51322. pubid = matchs[3][0];
  51323. sysid = len > 4 && matchs[4][0];
  51324. } else if (/^system$/i.test(matchs[2][0])) {
  51325. sysid = matchs[3][0];
  51326. }
  51327. }
  51328. var lastMatch = matchs[len - 1];
  51329. domBuilder.startDTD(name, pubid, sysid);
  51330. domBuilder.endDTD();
  51331. return lastMatch.index + lastMatch[0].length;
  51332. }
  51333. }
  51334. return -1;
  51335. }
  51336. function parseInstruction(source, start2, domBuilder) {
  51337. var end = source.indexOf("?>", start2);
  51338. if (end) {
  51339. var match = source.substring(start2, end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);
  51340. if (match) {
  51341. match[0].length;
  51342. domBuilder.processingInstruction(match[1], match[2]);
  51343. return end + 2;
  51344. } else {
  51345. return -1;
  51346. }
  51347. }
  51348. return -1;
  51349. }
  51350. function ElementAttributes() {
  51351. this.attributeNames = {};
  51352. }
  51353. ElementAttributes.prototype = {
  51354. setTagName: function(tagName) {
  51355. if (!tagNamePattern.test(tagName)) {
  51356. throw new Error("invalid tagName:" + tagName);
  51357. }
  51358. this.tagName = tagName;
  51359. },
  51360. addValue: function(qName, value, offset) {
  51361. if (!tagNamePattern.test(qName)) {
  51362. throw new Error("invalid attribute:" + qName);
  51363. }
  51364. this.attributeNames[qName] = this.length;
  51365. this[this.length++] = { qName, value, offset };
  51366. },
  51367. length: 0,
  51368. getLocalName: function(i2) {
  51369. return this[i2].localName;
  51370. },
  51371. getLocator: function(i2) {
  51372. return this[i2].locator;
  51373. },
  51374. getQName: function(i2) {
  51375. return this[i2].qName;
  51376. },
  51377. getURI: function(i2) {
  51378. return this[i2].uri;
  51379. },
  51380. getValue: function(i2) {
  51381. return this[i2].value;
  51382. }
  51383. };
  51384. function split(source, start2) {
  51385. var match;
  51386. var buf = [];
  51387. var reg = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;
  51388. reg.lastIndex = start2;
  51389. reg.exec(source);
  51390. while (match = reg.exec(source)) {
  51391. buf.push(match);
  51392. if (match[1])
  51393. return buf;
  51394. }
  51395. }
  51396. sax$1.XMLReader = XMLReader$1;
  51397. sax$1.ParseError = ParseError$1;
  51398. var conventions = conventions$2;
  51399. var dom = dom$1;
  51400. var entities = entities$1;
  51401. var sax = sax$1;
  51402. var DOMImplementation = dom.DOMImplementation;
  51403. var NAMESPACE = conventions.NAMESPACE;
  51404. var ParseError = sax.ParseError;
  51405. var XMLReader = sax.XMLReader;
  51406. function normalizeLineEndings(input) {
  51407. return input.replace(/\r[\n\u0085]/g, "\n").replace(/[\r\u0085\u2028]/g, "\n");
  51408. }
  51409. function DOMParser$1(options2) {
  51410. this.options = options2 || { locator: {} };
  51411. }
  51412. DOMParser$1.prototype.parseFromString = function(source, mimeType) {
  51413. var options2 = this.options;
  51414. var sax2 = new XMLReader();
  51415. var domBuilder = options2.domBuilder || new DOMHandler();
  51416. var errorHandler = options2.errorHandler;
  51417. var locator = options2.locator;
  51418. var defaultNSMap = options2.xmlns || {};
  51419. var isHTML = /\/x?html?$/.test(mimeType);
  51420. var entityMap = isHTML ? entities.HTML_ENTITIES : entities.XML_ENTITIES;
  51421. if (locator) {
  51422. domBuilder.setDocumentLocator(locator);
  51423. }
  51424. sax2.errorHandler = buildErrorHandler(errorHandler, domBuilder, locator);
  51425. sax2.domBuilder = options2.domBuilder || domBuilder;
  51426. if (isHTML) {
  51427. defaultNSMap[""] = NAMESPACE.HTML;
  51428. }
  51429. defaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML;
  51430. var normalize = options2.normalizeLineEndings || normalizeLineEndings;
  51431. if (source && typeof source === "string") {
  51432. sax2.parse(
  51433. normalize(source),
  51434. defaultNSMap,
  51435. entityMap
  51436. );
  51437. } else {
  51438. sax2.errorHandler.error("invalid doc source");
  51439. }
  51440. return domBuilder.doc;
  51441. };
  51442. function buildErrorHandler(errorImpl, domBuilder, locator) {
  51443. if (!errorImpl) {
  51444. if (domBuilder instanceof DOMHandler) {
  51445. return domBuilder;
  51446. }
  51447. errorImpl = domBuilder;
  51448. }
  51449. var errorHandler = {};
  51450. var isCallback = errorImpl instanceof Function;
  51451. locator = locator || {};
  51452. function build(key) {
  51453. var fn2 = errorImpl[key];
  51454. if (!fn2 && isCallback) {
  51455. fn2 = errorImpl.length == 2 ? function(msg) {
  51456. errorImpl(key, msg);
  51457. } : errorImpl;
  51458. }
  51459. errorHandler[key] = fn2 && function(msg) {
  51460. fn2("[xmldom " + key + "] " + msg + _locator(locator));
  51461. } || function() {
  51462. };
  51463. }
  51464. build("warning");
  51465. build("error");
  51466. build("fatalError");
  51467. return errorHandler;
  51468. }
  51469. function DOMHandler() {
  51470. this.cdata = false;
  51471. }
  51472. function position(locator, node) {
  51473. node.lineNumber = locator.lineNumber;
  51474. node.columnNumber = locator.columnNumber;
  51475. }
  51476. DOMHandler.prototype = {
  51477. startDocument: function() {
  51478. this.doc = new DOMImplementation().createDocument(null, null, null);
  51479. if (this.locator) {
  51480. this.doc.documentURI = this.locator.systemId;
  51481. }
  51482. },
  51483. startElement: function(namespaceURI, localName, qName, attrs) {
  51484. var doc = this.doc;
  51485. var el = doc.createElementNS(namespaceURI, qName || localName);
  51486. var len = attrs.length;
  51487. appendElement(this, el);
  51488. this.currentElement = el;
  51489. this.locator && position(this.locator, el);
  51490. for (var i2 = 0; i2 < len; i2++) {
  51491. var namespaceURI = attrs.getURI(i2);
  51492. var value = attrs.getValue(i2);
  51493. var qName = attrs.getQName(i2);
  51494. var attr = doc.createAttributeNS(namespaceURI, qName);
  51495. this.locator && position(attrs.getLocator(i2), attr);
  51496. attr.value = attr.nodeValue = value;
  51497. el.setAttributeNode(attr);
  51498. }
  51499. },
  51500. endElement: function(namespaceURI, localName, qName) {
  51501. var current = this.currentElement;
  51502. current.tagName;
  51503. this.currentElement = current.parentNode;
  51504. },
  51505. startPrefixMapping: function(prefix, uri) {
  51506. },
  51507. endPrefixMapping: function(prefix) {
  51508. },
  51509. processingInstruction: function(target, data) {
  51510. var ins = this.doc.createProcessingInstruction(target, data);
  51511. this.locator && position(this.locator, ins);
  51512. appendElement(this, ins);
  51513. },
  51514. ignorableWhitespace: function(ch, start2, length) {
  51515. },
  51516. characters: function(chars, start2, length) {
  51517. chars = _toString.apply(this, arguments);
  51518. if (chars) {
  51519. if (this.cdata) {
  51520. var charNode = this.doc.createCDATASection(chars);
  51521. } else {
  51522. var charNode = this.doc.createTextNode(chars);
  51523. }
  51524. if (this.currentElement) {
  51525. this.currentElement.appendChild(charNode);
  51526. } else if (/^\s*$/.test(chars)) {
  51527. this.doc.appendChild(charNode);
  51528. }
  51529. this.locator && position(this.locator, charNode);
  51530. }
  51531. },
  51532. skippedEntity: function(name) {
  51533. },
  51534. endDocument: function() {
  51535. this.doc.normalize();
  51536. },
  51537. setDocumentLocator: function(locator) {
  51538. if (this.locator = locator) {
  51539. locator.lineNumber = 0;
  51540. }
  51541. },
  51542. comment: function(chars, start2, length) {
  51543. chars = _toString.apply(this, arguments);
  51544. var comm = this.doc.createComment(chars);
  51545. this.locator && position(this.locator, comm);
  51546. appendElement(this, comm);
  51547. },
  51548. startCDATA: function() {
  51549. this.cdata = true;
  51550. },
  51551. endCDATA: function() {
  51552. this.cdata = false;
  51553. },
  51554. startDTD: function(name, publicId, systemId) {
  51555. var impl = this.doc.implementation;
  51556. if (impl && impl.createDocumentType) {
  51557. var dt2 = impl.createDocumentType(name, publicId, systemId);
  51558. this.locator && position(this.locator, dt2);
  51559. appendElement(this, dt2);
  51560. this.doc.doctype = dt2;
  51561. }
  51562. },
  51563. warning: function(error) {
  51564. console.warn("[xmldom warning] " + error, _locator(this.locator));
  51565. },
  51566. error: function(error) {
  51567. console.error("[xmldom error] " + error, _locator(this.locator));
  51568. },
  51569. fatalError: function(error) {
  51570. throw new ParseError(error, this.locator);
  51571. }
  51572. };
  51573. function _locator(l) {
  51574. if (l) {
  51575. return "\n@" + (l.systemId || "") + "#[line:" + l.lineNumber + ",col:" + l.columnNumber + "]";
  51576. }
  51577. }
  51578. function _toString(chars, start2, length) {
  51579. if (typeof chars == "string") {
  51580. return chars.substr(start2, length);
  51581. } else {
  51582. if (chars.length >= start2 + length || start2) {
  51583. return new java.lang.String(chars, start2, length) + "";
  51584. }
  51585. return chars;
  51586. }
  51587. }
  51588. "endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g, function(key) {
  51589. DOMHandler.prototype[key] = function() {
  51590. return null;
  51591. };
  51592. });
  51593. function appendElement(hander, node) {
  51594. if (!hander.currentElement) {
  51595. hander.doc.appendChild(node);
  51596. } else {
  51597. hander.currentElement.appendChild(node);
  51598. }
  51599. }
  51600. domParser.__DOMHandler = DOMHandler;
  51601. domParser.normalizeLineEndings = normalizeLineEndings;
  51602. domParser.DOMParser = DOMParser$1;
  51603. var DOMParser = domParser.DOMParser;
  51604. /*! @name mpd-parser @version 1.1.1 @license Apache-2.0 */
  51605. const isObject$3 = (obj) => {
  51606. return !!obj && typeof obj === "object";
  51607. };
  51608. const merge$3 = (...objects) => {
  51609. return objects.reduce((result, source) => {
  51610. if (typeof source !== "object") {
  51611. return result;
  51612. }
  51613. Object.keys(source).forEach((key) => {
  51614. if (Array.isArray(result[key]) && Array.isArray(source[key])) {
  51615. result[key] = result[key].concat(source[key]);
  51616. } else if (isObject$3(result[key]) && isObject$3(source[key])) {
  51617. result[key] = merge$3(result[key], source[key]);
  51618. } else {
  51619. result[key] = source[key];
  51620. }
  51621. });
  51622. return result;
  51623. }, {});
  51624. };
  51625. const values$1 = (o) => Object.keys(o).map((k) => o[k]);
  51626. const range$1 = (start2, end) => {
  51627. const result = [];
  51628. for (let i2 = start2; i2 < end; i2++) {
  51629. result.push(i2);
  51630. }
  51631. return result;
  51632. };
  51633. const flatten$1 = (lists) => lists.reduce((x, y) => x.concat(y), []);
  51634. const from$1 = (list) => {
  51635. if (!list.length) {
  51636. return [];
  51637. }
  51638. const result = [];
  51639. for (let i2 = 0; i2 < list.length; i2++) {
  51640. result.push(list[i2]);
  51641. }
  51642. return result;
  51643. };
  51644. const findIndexes$1 = (l, key) => l.reduce((a, e, i2) => {
  51645. if (e[key]) {
  51646. a.push(i2);
  51647. }
  51648. return a;
  51649. }, []);
  51650. const union$1 = (lists, keyFunction) => {
  51651. return values$1(lists.reduce((acc, list) => {
  51652. list.forEach((el) => {
  51653. acc[keyFunction(el)] = el;
  51654. });
  51655. return acc;
  51656. }, {}));
  51657. };
  51658. var errors$1 = {
  51659. INVALID_NUMBER_OF_PERIOD: "INVALID_NUMBER_OF_PERIOD",
  51660. DASH_EMPTY_MANIFEST: "DASH_EMPTY_MANIFEST",
  51661. DASH_INVALID_XML: "DASH_INVALID_XML",
  51662. NO_BASE_URL: "NO_BASE_URL",
  51663. MISSING_SEGMENT_INFORMATION: "MISSING_SEGMENT_INFORMATION",
  51664. SEGMENT_TIME_UNSPECIFIED: "SEGMENT_TIME_UNSPECIFIED",
  51665. UNSUPPORTED_UTC_TIMING_SCHEME: "UNSUPPORTED_UTC_TIMING_SCHEME"
  51666. };
  51667. const urlTypeToSegment$1 = ({
  51668. baseUrl = "",
  51669. source = "",
  51670. range: range3 = "",
  51671. indexRange = ""
  51672. }) => {
  51673. const segment = {
  51674. uri: source,
  51675. resolvedUri: resolveUrl$3(baseUrl || "", source)
  51676. };
  51677. if (range3 || indexRange) {
  51678. const rangeStr = range3 ? range3 : indexRange;
  51679. const ranges = rangeStr.split("-");
  51680. let startRange = window_1.BigInt ? window_1.BigInt(ranges[0]) : parseInt(ranges[0], 10);
  51681. let endRange = window_1.BigInt ? window_1.BigInt(ranges[1]) : parseInt(ranges[1], 10);
  51682. if (startRange < Number.MAX_SAFE_INTEGER && typeof startRange === "bigint") {
  51683. startRange = Number(startRange);
  51684. }
  51685. if (endRange < Number.MAX_SAFE_INTEGER && typeof endRange === "bigint") {
  51686. endRange = Number(endRange);
  51687. }
  51688. let length;
  51689. if (typeof endRange === "bigint" || typeof startRange === "bigint") {
  51690. length = window_1.BigInt(endRange) - window_1.BigInt(startRange) + window_1.BigInt(1);
  51691. } else {
  51692. length = endRange - startRange + 1;
  51693. }
  51694. if (typeof length === "bigint" && length < Number.MAX_SAFE_INTEGER) {
  51695. length = Number(length);
  51696. }
  51697. segment.byterange = {
  51698. length,
  51699. offset: startRange
  51700. };
  51701. }
  51702. return segment;
  51703. };
  51704. const byteRangeToString$1 = (byterange) => {
  51705. let endRange;
  51706. if (typeof byterange.offset === "bigint" || typeof byterange.length === "bigint") {
  51707. endRange = window_1.BigInt(byterange.offset) + window_1.BigInt(byterange.length) - window_1.BigInt(1);
  51708. } else {
  51709. endRange = byterange.offset + byterange.length - 1;
  51710. }
  51711. return `${byterange.offset}-${endRange}`;
  51712. };
  51713. const parseEndNumber$1 = (endNumber) => {
  51714. if (endNumber && typeof endNumber !== "number") {
  51715. endNumber = parseInt(endNumber, 10);
  51716. }
  51717. if (isNaN(endNumber)) {
  51718. return null;
  51719. }
  51720. return endNumber;
  51721. };
  51722. const segmentRange$1 = {
  51723. static(attributes) {
  51724. const {
  51725. duration: duration5,
  51726. timescale: timescale2 = 1,
  51727. sourceDuration,
  51728. periodDuration
  51729. } = attributes;
  51730. const endNumber = parseEndNumber$1(attributes.endNumber);
  51731. const segmentDuration = duration5 / timescale2;
  51732. if (typeof endNumber === "number") {
  51733. return {
  51734. start: 0,
  51735. end: endNumber
  51736. };
  51737. }
  51738. if (typeof periodDuration === "number") {
  51739. return {
  51740. start: 0,
  51741. end: periodDuration / segmentDuration
  51742. };
  51743. }
  51744. return {
  51745. start: 0,
  51746. end: sourceDuration / segmentDuration
  51747. };
  51748. },
  51749. dynamic(attributes) {
  51750. const {
  51751. NOW,
  51752. clientOffset,
  51753. availabilityStartTime: availabilityStartTime2,
  51754. timescale: timescale2 = 1,
  51755. duration: duration5,
  51756. periodStart = 0,
  51757. minimumUpdatePeriod: minimumUpdatePeriod2 = 0,
  51758. timeShiftBufferDepth: timeShiftBufferDepth2 = Infinity
  51759. } = attributes;
  51760. const endNumber = parseEndNumber$1(attributes.endNumber);
  51761. const now2 = (NOW + clientOffset) / 1e3;
  51762. const periodStartWC = availabilityStartTime2 + periodStart;
  51763. const periodEndWC = now2 + minimumUpdatePeriod2;
  51764. const periodDuration = periodEndWC - periodStartWC;
  51765. const segmentCount = Math.ceil(periodDuration * timescale2 / duration5);
  51766. const availableStart = Math.floor((now2 - periodStartWC - timeShiftBufferDepth2) * timescale2 / duration5);
  51767. const availableEnd = Math.floor((now2 - periodStartWC) * timescale2 / duration5);
  51768. return {
  51769. start: Math.max(0, availableStart),
  51770. end: typeof endNumber === "number" ? endNumber : Math.min(segmentCount, availableEnd)
  51771. };
  51772. }
  51773. };
  51774. const toSegments$1 = (attributes) => (number) => {
  51775. const {
  51776. duration: duration5,
  51777. timescale: timescale2 = 1,
  51778. periodStart,
  51779. startNumber: startNumber2 = 1
  51780. } = attributes;
  51781. return {
  51782. number: startNumber2 + number,
  51783. duration: duration5 / timescale2,
  51784. timeline: periodStart,
  51785. time: number * duration5
  51786. };
  51787. };
  51788. const parseByDuration$1 = (attributes) => {
  51789. const {
  51790. type: type2,
  51791. duration: duration5,
  51792. timescale: timescale2 = 1,
  51793. periodDuration,
  51794. sourceDuration
  51795. } = attributes;
  51796. const {
  51797. start: start2,
  51798. end
  51799. } = segmentRange$1[type2](attributes);
  51800. const segments = range$1(start2, end).map(toSegments$1(attributes));
  51801. if (type2 === "static") {
  51802. const index2 = segments.length - 1;
  51803. const sectionDuration = typeof periodDuration === "number" ? periodDuration : sourceDuration;
  51804. segments[index2].duration = sectionDuration - duration5 / timescale2 * index2;
  51805. }
  51806. return segments;
  51807. };
  51808. const segmentsFromBase$1 = (attributes) => {
  51809. const {
  51810. baseUrl,
  51811. initialization = {},
  51812. sourceDuration,
  51813. indexRange = "",
  51814. periodStart,
  51815. presentationTime,
  51816. number = 0,
  51817. duration: duration5
  51818. } = attributes;
  51819. if (!baseUrl) {
  51820. throw new Error(errors$1.NO_BASE_URL);
  51821. }
  51822. const initSegment = urlTypeToSegment$1({
  51823. baseUrl,
  51824. source: initialization.sourceURL,
  51825. range: initialization.range
  51826. });
  51827. const segment = urlTypeToSegment$1({
  51828. baseUrl,
  51829. source: baseUrl,
  51830. indexRange
  51831. });
  51832. segment.map = initSegment;
  51833. if (duration5) {
  51834. const segmentTimeInfo = parseByDuration$1(attributes);
  51835. if (segmentTimeInfo.length) {
  51836. segment.duration = segmentTimeInfo[0].duration;
  51837. segment.timeline = segmentTimeInfo[0].timeline;
  51838. }
  51839. } else if (sourceDuration) {
  51840. segment.duration = sourceDuration;
  51841. segment.timeline = periodStart;
  51842. }
  51843. segment.presentationTime = presentationTime || periodStart;
  51844. segment.number = number;
  51845. return [segment];
  51846. };
  51847. const addSidxSegmentsToPlaylist$1$1 = (playlist, sidx, baseUrl) => {
  51848. const initSegment = playlist.sidx.map ? playlist.sidx.map : null;
  51849. const sourceDuration = playlist.sidx.duration;
  51850. const timeline = playlist.timeline || 0;
  51851. const sidxByteRange = playlist.sidx.byterange;
  51852. const sidxEnd = sidxByteRange.offset + sidxByteRange.length;
  51853. const timescale2 = sidx.timescale;
  51854. const mediaReferences = sidx.references.filter((r2) => r2.referenceType !== 1);
  51855. const segments = [];
  51856. const type2 = playlist.endList ? "static" : "dynamic";
  51857. const periodStart = playlist.sidx.timeline;
  51858. let presentationTime = periodStart;
  51859. let number = playlist.mediaSequence || 0;
  51860. let startIndex;
  51861. if (typeof sidx.firstOffset === "bigint") {
  51862. startIndex = window_1.BigInt(sidxEnd) + sidx.firstOffset;
  51863. } else {
  51864. startIndex = sidxEnd + sidx.firstOffset;
  51865. }
  51866. for (let i2 = 0; i2 < mediaReferences.length; i2++) {
  51867. const reference = sidx.references[i2];
  51868. const size = reference.referencedSize;
  51869. const duration5 = reference.subsegmentDuration;
  51870. let endIndex;
  51871. if (typeof startIndex === "bigint") {
  51872. endIndex = startIndex + window_1.BigInt(size) - window_1.BigInt(1);
  51873. } else {
  51874. endIndex = startIndex + size - 1;
  51875. }
  51876. const indexRange = `${startIndex}-${endIndex}`;
  51877. const attributes = {
  51878. baseUrl,
  51879. timescale: timescale2,
  51880. timeline,
  51881. periodStart,
  51882. presentationTime,
  51883. number,
  51884. duration: duration5,
  51885. sourceDuration,
  51886. indexRange,
  51887. type: type2
  51888. };
  51889. const segment = segmentsFromBase$1(attributes)[0];
  51890. if (initSegment) {
  51891. segment.map = initSegment;
  51892. }
  51893. segments.push(segment);
  51894. if (typeof startIndex === "bigint") {
  51895. startIndex += window_1.BigInt(size);
  51896. } else {
  51897. startIndex += size;
  51898. }
  51899. presentationTime += duration5 / timescale2;
  51900. number++;
  51901. }
  51902. playlist.segments = segments;
  51903. return playlist;
  51904. };
  51905. const SUPPORTED_MEDIA_TYPES$1 = ["AUDIO", "SUBTITLES"];
  51906. const TIME_FUDGE$1 = 1 / 60;
  51907. const getUniqueTimelineStarts$1 = (timelineStarts) => {
  51908. return union$1(timelineStarts, ({
  51909. timeline
  51910. }) => timeline).sort((a, b) => a.timeline > b.timeline ? 1 : -1);
  51911. };
  51912. const findPlaylistWithName$1 = (playlists, name) => {
  51913. for (let i2 = 0; i2 < playlists.length; i2++) {
  51914. if (playlists[i2].attributes.NAME === name) {
  51915. return playlists[i2];
  51916. }
  51917. }
  51918. return null;
  51919. };
  51920. const getMediaGroupPlaylists$1 = (manifest) => {
  51921. let mediaGroupPlaylists = [];
  51922. forEachMediaGroup$3(manifest, SUPPORTED_MEDIA_TYPES$1, (properties, type2, group, label) => {
  51923. mediaGroupPlaylists = mediaGroupPlaylists.concat(properties.playlists || []);
  51924. });
  51925. return mediaGroupPlaylists;
  51926. };
  51927. const updateMediaSequenceForPlaylist$1 = ({
  51928. playlist,
  51929. mediaSequence
  51930. }) => {
  51931. playlist.mediaSequence = mediaSequence;
  51932. playlist.segments.forEach((segment, index2) => {
  51933. segment.number = playlist.mediaSequence + index2;
  51934. });
  51935. };
  51936. const updateSequenceNumbers$1 = ({
  51937. oldPlaylists,
  51938. newPlaylists,
  51939. timelineStarts
  51940. }) => {
  51941. newPlaylists.forEach((playlist) => {
  51942. playlist.discontinuitySequence = timelineStarts.findIndex(function({
  51943. timeline
  51944. }) {
  51945. return timeline === playlist.timeline;
  51946. });
  51947. const oldPlaylist = findPlaylistWithName$1(oldPlaylists, playlist.attributes.NAME);
  51948. if (!oldPlaylist) {
  51949. return;
  51950. }
  51951. if (playlist.sidx) {
  51952. return;
  51953. }
  51954. const firstNewSegment = playlist.segments[0];
  51955. const oldMatchingSegmentIndex = oldPlaylist.segments.findIndex(function(oldSegment) {
  51956. return Math.abs(oldSegment.presentationTime - firstNewSegment.presentationTime) < TIME_FUDGE$1;
  51957. });
  51958. if (oldMatchingSegmentIndex === -1) {
  51959. updateMediaSequenceForPlaylist$1({
  51960. playlist,
  51961. mediaSequence: oldPlaylist.mediaSequence + oldPlaylist.segments.length
  51962. });
  51963. playlist.segments[0].discontinuity = true;
  51964. playlist.discontinuityStarts.unshift(0);
  51965. if (!oldPlaylist.segments.length && playlist.timeline > oldPlaylist.timeline || oldPlaylist.segments.length && playlist.timeline > oldPlaylist.segments[oldPlaylist.segments.length - 1].timeline) {
  51966. playlist.discontinuitySequence--;
  51967. }
  51968. return;
  51969. }
  51970. const oldMatchingSegment = oldPlaylist.segments[oldMatchingSegmentIndex];
  51971. if (oldMatchingSegment.discontinuity && !firstNewSegment.discontinuity) {
  51972. firstNewSegment.discontinuity = true;
  51973. playlist.discontinuityStarts.unshift(0);
  51974. playlist.discontinuitySequence--;
  51975. }
  51976. updateMediaSequenceForPlaylist$1({
  51977. playlist,
  51978. mediaSequence: oldPlaylist.segments[oldMatchingSegmentIndex].number
  51979. });
  51980. });
  51981. };
  51982. const positionManifestOnTimeline$1 = ({
  51983. oldManifest,
  51984. newManifest
  51985. }) => {
  51986. const oldPlaylists = oldManifest.playlists.concat(getMediaGroupPlaylists$1(oldManifest));
  51987. const newPlaylists = newManifest.playlists.concat(getMediaGroupPlaylists$1(newManifest));
  51988. newManifest.timelineStarts = getUniqueTimelineStarts$1([oldManifest.timelineStarts, newManifest.timelineStarts]);
  51989. updateSequenceNumbers$1({
  51990. oldPlaylists,
  51991. newPlaylists,
  51992. timelineStarts: newManifest.timelineStarts
  51993. });
  51994. return newManifest;
  51995. };
  51996. const generateSidxKey$1 = (sidx) => sidx && sidx.uri + "-" + byteRangeToString$1(sidx.byterange);
  51997. const mergeDiscontiguousPlaylists$1 = (playlists) => {
  51998. const mergedPlaylists = values$1(playlists.reduce((acc, playlist) => {
  51999. const name = playlist.attributes.id + (playlist.attributes.lang || "");
  52000. if (!acc[name]) {
  52001. acc[name] = playlist;
  52002. acc[name].attributes.timelineStarts = [];
  52003. } else {
  52004. if (playlist.segments) {
  52005. if (playlist.segments[0]) {
  52006. playlist.segments[0].discontinuity = true;
  52007. }
  52008. acc[name].segments.push(...playlist.segments);
  52009. }
  52010. if (playlist.attributes.contentProtection) {
  52011. acc[name].attributes.contentProtection = playlist.attributes.contentProtection;
  52012. }
  52013. }
  52014. acc[name].attributes.timelineStarts.push({
  52015. start: playlist.attributes.periodStart,
  52016. timeline: playlist.attributes.periodStart
  52017. });
  52018. return acc;
  52019. }, {}));
  52020. return mergedPlaylists.map((playlist) => {
  52021. playlist.discontinuityStarts = findIndexes$1(playlist.segments || [], "discontinuity");
  52022. return playlist;
  52023. });
  52024. };
  52025. const addSidxSegmentsToPlaylist$2 = (playlist, sidxMapping) => {
  52026. const sidxKey = generateSidxKey$1(playlist.sidx);
  52027. const sidxMatch = sidxKey && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx;
  52028. if (sidxMatch) {
  52029. addSidxSegmentsToPlaylist$1$1(playlist, sidxMatch, playlist.sidx.resolvedUri);
  52030. }
  52031. return playlist;
  52032. };
  52033. const addSidxSegmentsToPlaylists$1 = (playlists, sidxMapping = {}) => {
  52034. if (!Object.keys(sidxMapping).length) {
  52035. return playlists;
  52036. }
  52037. for (const i2 in playlists) {
  52038. playlists[i2] = addSidxSegmentsToPlaylist$2(playlists[i2], sidxMapping);
  52039. }
  52040. return playlists;
  52041. };
  52042. const formatAudioPlaylist$1 = ({
  52043. attributes,
  52044. segments,
  52045. sidx,
  52046. mediaSequence,
  52047. discontinuitySequence,
  52048. discontinuityStarts
  52049. }, isAudioOnly3) => {
  52050. const playlist = {
  52051. attributes: {
  52052. NAME: attributes.id,
  52053. BANDWIDTH: attributes.bandwidth,
  52054. CODECS: attributes.codecs,
  52055. ["PROGRAM-ID"]: 1
  52056. },
  52057. uri: "",
  52058. endList: attributes.type === "static",
  52059. timeline: attributes.periodStart,
  52060. resolvedUri: "",
  52061. targetDuration: attributes.duration,
  52062. discontinuitySequence,
  52063. discontinuityStarts,
  52064. timelineStarts: attributes.timelineStarts,
  52065. mediaSequence,
  52066. segments
  52067. };
  52068. if (attributes.contentProtection) {
  52069. playlist.contentProtection = attributes.contentProtection;
  52070. }
  52071. if (sidx) {
  52072. playlist.sidx = sidx;
  52073. }
  52074. if (isAudioOnly3) {
  52075. playlist.attributes.AUDIO = "audio";
  52076. playlist.attributes.SUBTITLES = "subs";
  52077. }
  52078. return playlist;
  52079. };
  52080. const formatVttPlaylist$1 = ({
  52081. attributes,
  52082. segments,
  52083. mediaSequence,
  52084. discontinuityStarts,
  52085. discontinuitySequence
  52086. }) => {
  52087. if (typeof segments === "undefined") {
  52088. segments = [{
  52089. uri: attributes.baseUrl,
  52090. timeline: attributes.periodStart,
  52091. resolvedUri: attributes.baseUrl || "",
  52092. duration: attributes.sourceDuration,
  52093. number: 0
  52094. }];
  52095. attributes.duration = attributes.sourceDuration;
  52096. }
  52097. const m3u8Attributes = {
  52098. NAME: attributes.id,
  52099. BANDWIDTH: attributes.bandwidth,
  52100. ["PROGRAM-ID"]: 1
  52101. };
  52102. if (attributes.codecs) {
  52103. m3u8Attributes.CODECS = attributes.codecs;
  52104. }
  52105. return {
  52106. attributes: m3u8Attributes,
  52107. uri: "",
  52108. endList: attributes.type === "static",
  52109. timeline: attributes.periodStart,
  52110. resolvedUri: attributes.baseUrl || "",
  52111. targetDuration: attributes.duration,
  52112. timelineStarts: attributes.timelineStarts,
  52113. discontinuityStarts,
  52114. discontinuitySequence,
  52115. mediaSequence,
  52116. segments
  52117. };
  52118. };
  52119. const organizeAudioPlaylists$1 = (playlists, sidxMapping = {}, isAudioOnly3 = false) => {
  52120. let mainPlaylist;
  52121. const formattedPlaylists = playlists.reduce((a, playlist) => {
  52122. const role = playlist.attributes.role && playlist.attributes.role.value || "";
  52123. const language = playlist.attributes.lang || "";
  52124. let label = playlist.attributes.label || "main";
  52125. if (language && !playlist.attributes.label) {
  52126. const roleLabel = role ? ` (${role})` : "";
  52127. label = `${playlist.attributes.lang}${roleLabel}`;
  52128. }
  52129. if (!a[label]) {
  52130. a[label] = {
  52131. language,
  52132. autoselect: true,
  52133. default: role === "main",
  52134. playlists: [],
  52135. uri: ""
  52136. };
  52137. }
  52138. const formatted = addSidxSegmentsToPlaylist$2(formatAudioPlaylist$1(playlist, isAudioOnly3), sidxMapping);
  52139. a[label].playlists.push(formatted);
  52140. if (typeof mainPlaylist === "undefined" && role === "main") {
  52141. mainPlaylist = playlist;
  52142. mainPlaylist.default = true;
  52143. }
  52144. return a;
  52145. }, {});
  52146. if (!mainPlaylist) {
  52147. const firstLabel = Object.keys(formattedPlaylists)[0];
  52148. formattedPlaylists[firstLabel].default = true;
  52149. }
  52150. return formattedPlaylists;
  52151. };
  52152. const organizeVttPlaylists$1 = (playlists, sidxMapping = {}) => {
  52153. return playlists.reduce((a, playlist) => {
  52154. const label = playlist.attributes.label || playlist.attributes.lang || "text";
  52155. if (!a[label]) {
  52156. a[label] = {
  52157. language: label,
  52158. default: false,
  52159. autoselect: false,
  52160. playlists: [],
  52161. uri: ""
  52162. };
  52163. }
  52164. a[label].playlists.push(addSidxSegmentsToPlaylist$2(formatVttPlaylist$1(playlist), sidxMapping));
  52165. return a;
  52166. }, {});
  52167. };
  52168. const organizeCaptionServices$1 = (captionServices) => captionServices.reduce((svcObj, svc) => {
  52169. if (!svc) {
  52170. return svcObj;
  52171. }
  52172. svc.forEach((service) => {
  52173. const {
  52174. channel,
  52175. language
  52176. } = service;
  52177. svcObj[language] = {
  52178. autoselect: false,
  52179. default: false,
  52180. instreamId: channel,
  52181. language
  52182. };
  52183. if (service.hasOwnProperty("aspectRatio")) {
  52184. svcObj[language].aspectRatio = service.aspectRatio;
  52185. }
  52186. if (service.hasOwnProperty("easyReader")) {
  52187. svcObj[language].easyReader = service.easyReader;
  52188. }
  52189. if (service.hasOwnProperty("3D")) {
  52190. svcObj[language]["3D"] = service["3D"];
  52191. }
  52192. });
  52193. return svcObj;
  52194. }, {});
  52195. const formatVideoPlaylist$1 = ({
  52196. attributes,
  52197. segments,
  52198. sidx,
  52199. discontinuityStarts
  52200. }) => {
  52201. const playlist = {
  52202. attributes: {
  52203. NAME: attributes.id,
  52204. AUDIO: "audio",
  52205. SUBTITLES: "subs",
  52206. RESOLUTION: {
  52207. width: attributes.width,
  52208. height: attributes.height
  52209. },
  52210. CODECS: attributes.codecs,
  52211. BANDWIDTH: attributes.bandwidth,
  52212. ["PROGRAM-ID"]: 1
  52213. },
  52214. uri: "",
  52215. endList: attributes.type === "static",
  52216. timeline: attributes.periodStart,
  52217. resolvedUri: "",
  52218. targetDuration: attributes.duration,
  52219. discontinuityStarts,
  52220. timelineStarts: attributes.timelineStarts,
  52221. segments
  52222. };
  52223. if (attributes.frameRate) {
  52224. playlist.attributes["FRAME-RATE"] = attributes.frameRate;
  52225. }
  52226. if (attributes.contentProtection) {
  52227. playlist.contentProtection = attributes.contentProtection;
  52228. }
  52229. if (sidx) {
  52230. playlist.sidx = sidx;
  52231. }
  52232. return playlist;
  52233. };
  52234. const videoOnly$1 = ({
  52235. attributes
  52236. }) => attributes.mimeType === "video/mp4" || attributes.mimeType === "video/webm" || attributes.contentType === "video";
  52237. const audioOnly$1 = ({
  52238. attributes
  52239. }) => attributes.mimeType === "audio/mp4" || attributes.mimeType === "audio/webm" || attributes.contentType === "audio";
  52240. const vttOnly$1 = ({
  52241. attributes
  52242. }) => attributes.mimeType === "text/vtt" || attributes.contentType === "text";
  52243. const addMediaSequenceValues$1 = (playlists, timelineStarts) => {
  52244. playlists.forEach((playlist) => {
  52245. playlist.mediaSequence = 0;
  52246. playlist.discontinuitySequence = timelineStarts.findIndex(function({
  52247. timeline
  52248. }) {
  52249. return timeline === playlist.timeline;
  52250. });
  52251. if (!playlist.segments) {
  52252. return;
  52253. }
  52254. playlist.segments.forEach((segment, index2) => {
  52255. segment.number = index2;
  52256. });
  52257. });
  52258. };
  52259. const flattenMediaGroupPlaylists$1 = (mediaGroupObject) => {
  52260. if (!mediaGroupObject) {
  52261. return [];
  52262. }
  52263. return Object.keys(mediaGroupObject).reduce((acc, label) => {
  52264. const labelContents = mediaGroupObject[label];
  52265. return acc.concat(labelContents.playlists);
  52266. }, []);
  52267. };
  52268. const toM3u8$1 = ({
  52269. dashPlaylists,
  52270. locations,
  52271. sidxMapping = {},
  52272. previousManifest,
  52273. eventStream
  52274. }) => {
  52275. if (!dashPlaylists.length) {
  52276. return {};
  52277. }
  52278. const {
  52279. sourceDuration: duration5,
  52280. type: type2,
  52281. suggestedPresentationDelay: suggestedPresentationDelay2,
  52282. minimumUpdatePeriod: minimumUpdatePeriod2
  52283. } = dashPlaylists[0].attributes;
  52284. const videoPlaylists = mergeDiscontiguousPlaylists$1(dashPlaylists.filter(videoOnly$1)).map(formatVideoPlaylist$1);
  52285. const audioPlaylists = mergeDiscontiguousPlaylists$1(dashPlaylists.filter(audioOnly$1));
  52286. const vttPlaylists = mergeDiscontiguousPlaylists$1(dashPlaylists.filter(vttOnly$1));
  52287. const captions = dashPlaylists.map((playlist) => playlist.attributes.captionServices).filter(Boolean);
  52288. const manifest = {
  52289. allowCache: true,
  52290. discontinuityStarts: [],
  52291. segments: [],
  52292. endList: true,
  52293. mediaGroups: {
  52294. AUDIO: {},
  52295. VIDEO: {},
  52296. ["CLOSED-CAPTIONS"]: {},
  52297. SUBTITLES: {}
  52298. },
  52299. uri: "",
  52300. duration: duration5,
  52301. playlists: addSidxSegmentsToPlaylists$1(videoPlaylists, sidxMapping)
  52302. };
  52303. if (minimumUpdatePeriod2 >= 0) {
  52304. manifest.minimumUpdatePeriod = minimumUpdatePeriod2 * 1e3;
  52305. }
  52306. if (locations) {
  52307. manifest.locations = locations;
  52308. }
  52309. if (type2 === "dynamic") {
  52310. manifest.suggestedPresentationDelay = suggestedPresentationDelay2;
  52311. }
  52312. if (eventStream && eventStream.length > 0) {
  52313. manifest.eventStream = eventStream;
  52314. }
  52315. const isAudioOnly3 = manifest.playlists.length === 0;
  52316. const organizedAudioGroup = audioPlaylists.length ? organizeAudioPlaylists$1(audioPlaylists, sidxMapping, isAudioOnly3) : null;
  52317. const organizedVttGroup = vttPlaylists.length ? organizeVttPlaylists$1(vttPlaylists, sidxMapping) : null;
  52318. const formattedPlaylists = videoPlaylists.concat(flattenMediaGroupPlaylists$1(organizedAudioGroup), flattenMediaGroupPlaylists$1(organizedVttGroup));
  52319. const playlistTimelineStarts = formattedPlaylists.map(({
  52320. timelineStarts
  52321. }) => timelineStarts);
  52322. manifest.timelineStarts = getUniqueTimelineStarts$1(playlistTimelineStarts);
  52323. addMediaSequenceValues$1(formattedPlaylists, manifest.timelineStarts);
  52324. if (organizedAudioGroup) {
  52325. manifest.mediaGroups.AUDIO.audio = organizedAudioGroup;
  52326. }
  52327. if (organizedVttGroup) {
  52328. manifest.mediaGroups.SUBTITLES.subs = organizedVttGroup;
  52329. }
  52330. if (captions.length) {
  52331. manifest.mediaGroups["CLOSED-CAPTIONS"].cc = organizeCaptionServices$1(captions);
  52332. }
  52333. if (previousManifest) {
  52334. return positionManifestOnTimeline$1({
  52335. oldManifest: previousManifest,
  52336. newManifest: manifest
  52337. });
  52338. }
  52339. return manifest;
  52340. };
  52341. const getLiveRValue$1 = (attributes, time, duration5) => {
  52342. const {
  52343. NOW,
  52344. clientOffset,
  52345. availabilityStartTime: availabilityStartTime2,
  52346. timescale: timescale2 = 1,
  52347. periodStart = 0,
  52348. minimumUpdatePeriod: minimumUpdatePeriod2 = 0
  52349. } = attributes;
  52350. const now2 = (NOW + clientOffset) / 1e3;
  52351. const periodStartWC = availabilityStartTime2 + periodStart;
  52352. const periodEndWC = now2 + minimumUpdatePeriod2;
  52353. const periodDuration = periodEndWC - periodStartWC;
  52354. return Math.ceil((periodDuration * timescale2 - time) / duration5);
  52355. };
  52356. const parseByTimeline$1 = (attributes, segmentTimeline) => {
  52357. const {
  52358. type: type2,
  52359. minimumUpdatePeriod: minimumUpdatePeriod2 = 0,
  52360. media = "",
  52361. sourceDuration,
  52362. timescale: timescale2 = 1,
  52363. startNumber: startNumber2 = 1,
  52364. periodStart: timeline
  52365. } = attributes;
  52366. const segments = [];
  52367. let time = -1;
  52368. for (let sIndex = 0; sIndex < segmentTimeline.length; sIndex++) {
  52369. const S = segmentTimeline[sIndex];
  52370. const duration5 = S.d;
  52371. const repeat = S.r || 0;
  52372. const segmentTime = S.t || 0;
  52373. if (time < 0) {
  52374. time = segmentTime;
  52375. }
  52376. if (segmentTime && segmentTime > time) {
  52377. time = segmentTime;
  52378. }
  52379. let count;
  52380. if (repeat < 0) {
  52381. const nextS = sIndex + 1;
  52382. if (nextS === segmentTimeline.length) {
  52383. if (type2 === "dynamic" && minimumUpdatePeriod2 > 0 && media.indexOf("$Number$") > 0) {
  52384. count = getLiveRValue$1(attributes, time, duration5);
  52385. } else {
  52386. count = (sourceDuration * timescale2 - time) / duration5;
  52387. }
  52388. } else {
  52389. count = (segmentTimeline[nextS].t - time) / duration5;
  52390. }
  52391. } else {
  52392. count = repeat + 1;
  52393. }
  52394. const end = startNumber2 + segments.length + count;
  52395. let number = startNumber2 + segments.length;
  52396. while (number < end) {
  52397. segments.push({
  52398. number,
  52399. duration: duration5 / timescale2,
  52400. time,
  52401. timeline
  52402. });
  52403. time += duration5;
  52404. number++;
  52405. }
  52406. }
  52407. return segments;
  52408. };
  52409. const identifierPattern$1 = /\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g;
  52410. const identifierReplacement$1 = (values3) => (match, identifier, format, width2) => {
  52411. if (match === "$$") {
  52412. return "$";
  52413. }
  52414. if (typeof values3[identifier] === "undefined") {
  52415. return match;
  52416. }
  52417. const value = "" + values3[identifier];
  52418. if (identifier === "RepresentationID") {
  52419. return value;
  52420. }
  52421. if (!format) {
  52422. width2 = 1;
  52423. } else {
  52424. width2 = parseInt(width2, 10);
  52425. }
  52426. if (value.length >= width2) {
  52427. return value;
  52428. }
  52429. return `${new Array(width2 - value.length + 1).join("0")}${value}`;
  52430. };
  52431. const constructTemplateUrl$1 = (url, values3) => url.replace(identifierPattern$1, identifierReplacement$1(values3));
  52432. const parseTemplateInfo$1 = (attributes, segmentTimeline) => {
  52433. if (!attributes.duration && !segmentTimeline) {
  52434. return [{
  52435. number: attributes.startNumber || 1,
  52436. duration: attributes.sourceDuration,
  52437. time: 0,
  52438. timeline: attributes.periodStart
  52439. }];
  52440. }
  52441. if (attributes.duration) {
  52442. return parseByDuration$1(attributes);
  52443. }
  52444. return parseByTimeline$1(attributes, segmentTimeline);
  52445. };
  52446. const segmentsFromTemplate$1 = (attributes, segmentTimeline) => {
  52447. const templateValues = {
  52448. RepresentationID: attributes.id,
  52449. Bandwidth: attributes.bandwidth || 0
  52450. };
  52451. const {
  52452. initialization = {
  52453. sourceURL: "",
  52454. range: ""
  52455. }
  52456. } = attributes;
  52457. const mapSegment = urlTypeToSegment$1({
  52458. baseUrl: attributes.baseUrl,
  52459. source: constructTemplateUrl$1(initialization.sourceURL, templateValues),
  52460. range: initialization.range
  52461. });
  52462. const segments = parseTemplateInfo$1(attributes, segmentTimeline);
  52463. return segments.map((segment) => {
  52464. templateValues.Number = segment.number;
  52465. templateValues.Time = segment.time;
  52466. const uri = constructTemplateUrl$1(attributes.media || "", templateValues);
  52467. const timescale2 = attributes.timescale || 1;
  52468. const presentationTimeOffset2 = attributes.presentationTimeOffset || 0;
  52469. const presentationTime = attributes.periodStart + (segment.time - presentationTimeOffset2) / timescale2;
  52470. const map = {
  52471. uri,
  52472. timeline: segment.timeline,
  52473. duration: segment.duration,
  52474. resolvedUri: resolveUrl$3(attributes.baseUrl || "", uri),
  52475. map: mapSegment,
  52476. number: segment.number,
  52477. presentationTime
  52478. };
  52479. return map;
  52480. });
  52481. };
  52482. const SegmentURLToSegmentObject$1 = (attributes, segmentUrl) => {
  52483. const {
  52484. baseUrl,
  52485. initialization = {}
  52486. } = attributes;
  52487. const initSegment = urlTypeToSegment$1({
  52488. baseUrl,
  52489. source: initialization.sourceURL,
  52490. range: initialization.range
  52491. });
  52492. const segment = urlTypeToSegment$1({
  52493. baseUrl,
  52494. source: segmentUrl.media,
  52495. range: segmentUrl.mediaRange
  52496. });
  52497. segment.map = initSegment;
  52498. return segment;
  52499. };
  52500. const segmentsFromList$1 = (attributes, segmentTimeline) => {
  52501. const {
  52502. duration: duration5,
  52503. segmentUrls = [],
  52504. periodStart
  52505. } = attributes;
  52506. if (!duration5 && !segmentTimeline || duration5 && segmentTimeline) {
  52507. throw new Error(errors$1.SEGMENT_TIME_UNSPECIFIED);
  52508. }
  52509. const segmentUrlMap = segmentUrls.map((segmentUrlObject) => SegmentURLToSegmentObject$1(attributes, segmentUrlObject));
  52510. let segmentTimeInfo;
  52511. if (duration5) {
  52512. segmentTimeInfo = parseByDuration$1(attributes);
  52513. }
  52514. if (segmentTimeline) {
  52515. segmentTimeInfo = parseByTimeline$1(attributes, segmentTimeline);
  52516. }
  52517. const segments = segmentTimeInfo.map((segmentTime, index2) => {
  52518. if (segmentUrlMap[index2]) {
  52519. const segment = segmentUrlMap[index2];
  52520. const timescale2 = attributes.timescale || 1;
  52521. const presentationTimeOffset2 = attributes.presentationTimeOffset || 0;
  52522. segment.timeline = segmentTime.timeline;
  52523. segment.duration = segmentTime.duration;
  52524. segment.number = segmentTime.number;
  52525. segment.presentationTime = periodStart + (segmentTime.time - presentationTimeOffset2) / timescale2;
  52526. return segment;
  52527. }
  52528. }).filter((segment) => segment);
  52529. return segments;
  52530. };
  52531. const generateSegments$1 = ({
  52532. attributes,
  52533. segmentInfo
  52534. }) => {
  52535. let segmentAttributes;
  52536. let segmentsFn;
  52537. if (segmentInfo.template) {
  52538. segmentsFn = segmentsFromTemplate$1;
  52539. segmentAttributes = merge$3(attributes, segmentInfo.template);
  52540. } else if (segmentInfo.base) {
  52541. segmentsFn = segmentsFromBase$1;
  52542. segmentAttributes = merge$3(attributes, segmentInfo.base);
  52543. } else if (segmentInfo.list) {
  52544. segmentsFn = segmentsFromList$1;
  52545. segmentAttributes = merge$3(attributes, segmentInfo.list);
  52546. }
  52547. const segmentsInfo = {
  52548. attributes
  52549. };
  52550. if (!segmentsFn) {
  52551. return segmentsInfo;
  52552. }
  52553. const segments = segmentsFn(segmentAttributes, segmentInfo.segmentTimeline);
  52554. if (segmentAttributes.duration) {
  52555. const {
  52556. duration: duration5,
  52557. timescale: timescale2 = 1
  52558. } = segmentAttributes;
  52559. segmentAttributes.duration = duration5 / timescale2;
  52560. } else if (segments.length) {
  52561. segmentAttributes.duration = segments.reduce((max2, segment) => {
  52562. return Math.max(max2, Math.ceil(segment.duration));
  52563. }, 0);
  52564. } else {
  52565. segmentAttributes.duration = 0;
  52566. }
  52567. segmentsInfo.attributes = segmentAttributes;
  52568. segmentsInfo.segments = segments;
  52569. if (segmentInfo.base && segmentAttributes.indexRange) {
  52570. segmentsInfo.sidx = segments[0];
  52571. segmentsInfo.segments = [];
  52572. }
  52573. return segmentsInfo;
  52574. };
  52575. const toPlaylists$1 = (representations) => representations.map(generateSegments$1);
  52576. const findChildren$1 = (element, name) => from$1(element.childNodes).filter(({
  52577. tagName
  52578. }) => tagName === name);
  52579. const getContent$1 = (element) => element.textContent.trim();
  52580. const parseDivisionValue$1 = (value) => {
  52581. return parseFloat(value.split("/").reduce((prev, current) => prev / current));
  52582. };
  52583. const parseDuration$1 = (str) => {
  52584. const SECONDS_IN_YEAR = 365 * 24 * 60 * 60;
  52585. const SECONDS_IN_MONTH = 30 * 24 * 60 * 60;
  52586. const SECONDS_IN_DAY = 24 * 60 * 60;
  52587. const SECONDS_IN_HOUR = 60 * 60;
  52588. const SECONDS_IN_MIN = 60;
  52589. const durationRegex = /P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/;
  52590. const match = durationRegex.exec(str);
  52591. if (!match) {
  52592. return 0;
  52593. }
  52594. const [year, month, day, hour, minute, second] = match.slice(1);
  52595. return parseFloat(year || 0) * SECONDS_IN_YEAR + parseFloat(month || 0) * SECONDS_IN_MONTH + parseFloat(day || 0) * SECONDS_IN_DAY + parseFloat(hour || 0) * SECONDS_IN_HOUR + parseFloat(minute || 0) * SECONDS_IN_MIN + parseFloat(second || 0);
  52596. };
  52597. const parseDate$1 = (str) => {
  52598. const dateRegex = /^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;
  52599. if (dateRegex.test(str)) {
  52600. str += "Z";
  52601. }
  52602. return Date.parse(str);
  52603. };
  52604. const parsers$1 = {
  52605. mediaPresentationDuration(value) {
  52606. return parseDuration$1(value);
  52607. },
  52608. availabilityStartTime(value) {
  52609. return parseDate$1(value) / 1e3;
  52610. },
  52611. minimumUpdatePeriod(value) {
  52612. return parseDuration$1(value);
  52613. },
  52614. suggestedPresentationDelay(value) {
  52615. return parseDuration$1(value);
  52616. },
  52617. type(value) {
  52618. return value;
  52619. },
  52620. timeShiftBufferDepth(value) {
  52621. return parseDuration$1(value);
  52622. },
  52623. start(value) {
  52624. return parseDuration$1(value);
  52625. },
  52626. width(value) {
  52627. return parseInt(value, 10);
  52628. },
  52629. height(value) {
  52630. return parseInt(value, 10);
  52631. },
  52632. bandwidth(value) {
  52633. return parseInt(value, 10);
  52634. },
  52635. frameRate(value) {
  52636. return parseDivisionValue$1(value);
  52637. },
  52638. startNumber(value) {
  52639. return parseInt(value, 10);
  52640. },
  52641. timescale(value) {
  52642. return parseInt(value, 10);
  52643. },
  52644. presentationTimeOffset(value) {
  52645. return parseInt(value, 10);
  52646. },
  52647. duration(value) {
  52648. const parsedValue = parseInt(value, 10);
  52649. if (isNaN(parsedValue)) {
  52650. return parseDuration$1(value);
  52651. }
  52652. return parsedValue;
  52653. },
  52654. d(value) {
  52655. return parseInt(value, 10);
  52656. },
  52657. t(value) {
  52658. return parseInt(value, 10);
  52659. },
  52660. r(value) {
  52661. return parseInt(value, 10);
  52662. },
  52663. presentationTime(value) {
  52664. return parseInt(value, 10);
  52665. },
  52666. DEFAULT(value) {
  52667. return value;
  52668. }
  52669. };
  52670. const parseAttributes$2 = (el) => {
  52671. if (!(el && el.attributes)) {
  52672. return {};
  52673. }
  52674. return from$1(el.attributes).reduce((a, e) => {
  52675. const parseFn = parsers$1[e.name] || parsers$1.DEFAULT;
  52676. a[e.name] = parseFn(e.value);
  52677. return a;
  52678. }, {});
  52679. };
  52680. const keySystemsMap$1 = {
  52681. "urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b": "org.w3.clearkey",
  52682. "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed": "com.widevine.alpha",
  52683. "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95": "com.microsoft.playready",
  52684. "urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb": "com.adobe.primetime"
  52685. };
  52686. const buildBaseUrls$1 = (referenceUrls, baseUrlElements) => {
  52687. if (!baseUrlElements.length) {
  52688. return referenceUrls;
  52689. }
  52690. return flatten$1(referenceUrls.map(function(reference) {
  52691. return baseUrlElements.map(function(baseUrlElement) {
  52692. return resolveUrl$3(reference, getContent$1(baseUrlElement));
  52693. });
  52694. }));
  52695. };
  52696. const getSegmentInformation$1 = (adaptationSet) => {
  52697. const segmentTemplate = findChildren$1(adaptationSet, "SegmentTemplate")[0];
  52698. const segmentList = findChildren$1(adaptationSet, "SegmentList")[0];
  52699. const segmentUrls = segmentList && findChildren$1(segmentList, "SegmentURL").map((s) => merge$3({
  52700. tag: "SegmentURL"
  52701. }, parseAttributes$2(s)));
  52702. const segmentBase = findChildren$1(adaptationSet, "SegmentBase")[0];
  52703. const segmentTimelineParentNode = segmentList || segmentTemplate;
  52704. const segmentTimeline = segmentTimelineParentNode && findChildren$1(segmentTimelineParentNode, "SegmentTimeline")[0];
  52705. const segmentInitializationParentNode = segmentList || segmentBase || segmentTemplate;
  52706. const segmentInitialization = segmentInitializationParentNode && findChildren$1(segmentInitializationParentNode, "Initialization")[0];
  52707. const template = segmentTemplate && parseAttributes$2(segmentTemplate);
  52708. if (template && segmentInitialization) {
  52709. template.initialization = segmentInitialization && parseAttributes$2(segmentInitialization);
  52710. } else if (template && template.initialization) {
  52711. template.initialization = {
  52712. sourceURL: template.initialization
  52713. };
  52714. }
  52715. const segmentInfo = {
  52716. template,
  52717. segmentTimeline: segmentTimeline && findChildren$1(segmentTimeline, "S").map((s) => parseAttributes$2(s)),
  52718. list: segmentList && merge$3(parseAttributes$2(segmentList), {
  52719. segmentUrls,
  52720. initialization: parseAttributes$2(segmentInitialization)
  52721. }),
  52722. base: segmentBase && merge$3(parseAttributes$2(segmentBase), {
  52723. initialization: parseAttributes$2(segmentInitialization)
  52724. })
  52725. };
  52726. Object.keys(segmentInfo).forEach((key) => {
  52727. if (!segmentInfo[key]) {
  52728. delete segmentInfo[key];
  52729. }
  52730. });
  52731. return segmentInfo;
  52732. };
  52733. const inheritBaseUrls$1 = (adaptationSetAttributes, adaptationSetBaseUrls, adaptationSetSegmentInfo) => (representation) => {
  52734. const repBaseUrlElements = findChildren$1(representation, "BaseURL");
  52735. const repBaseUrls = buildBaseUrls$1(adaptationSetBaseUrls, repBaseUrlElements);
  52736. const attributes = merge$3(adaptationSetAttributes, parseAttributes$2(representation));
  52737. const representationSegmentInfo = getSegmentInformation$1(representation);
  52738. return repBaseUrls.map((baseUrl) => {
  52739. return {
  52740. segmentInfo: merge$3(adaptationSetSegmentInfo, representationSegmentInfo),
  52741. attributes: merge$3(attributes, {
  52742. baseUrl
  52743. })
  52744. };
  52745. });
  52746. };
  52747. const generateKeySystemInformation$1 = (contentProtectionNodes) => {
  52748. return contentProtectionNodes.reduce((acc, node) => {
  52749. const attributes = parseAttributes$2(node);
  52750. if (attributes.schemeIdUri) {
  52751. attributes.schemeIdUri = attributes.schemeIdUri.toLowerCase();
  52752. }
  52753. const keySystem = keySystemsMap$1[attributes.schemeIdUri];
  52754. if (keySystem) {
  52755. acc[keySystem] = {
  52756. attributes
  52757. };
  52758. const psshNode = findChildren$1(node, "cenc:pssh")[0];
  52759. if (psshNode) {
  52760. const pssh = getContent$1(psshNode);
  52761. acc[keySystem].pssh = pssh && decodeB64ToUint8Array$1(pssh);
  52762. }
  52763. }
  52764. return acc;
  52765. }, {});
  52766. };
  52767. const parseCaptionServiceMetadata$1 = (service) => {
  52768. if (service.schemeIdUri === "urn:scte:dash:cc:cea-608:2015") {
  52769. const values3 = typeof service.value !== "string" ? [] : service.value.split(";");
  52770. return values3.map((value) => {
  52771. let channel;
  52772. let language;
  52773. language = value;
  52774. if (/^CC\d=/.test(value)) {
  52775. [channel, language] = value.split("=");
  52776. } else if (/^CC\d$/.test(value)) {
  52777. channel = value;
  52778. }
  52779. return {
  52780. channel,
  52781. language
  52782. };
  52783. });
  52784. } else if (service.schemeIdUri === "urn:scte:dash:cc:cea-708:2015") {
  52785. const values3 = typeof service.value !== "string" ? [] : service.value.split(";");
  52786. return values3.map((value) => {
  52787. const flags = {
  52788. "channel": void 0,
  52789. "language": void 0,
  52790. "aspectRatio": 1,
  52791. "easyReader": 0,
  52792. "3D": 0
  52793. };
  52794. if (/=/.test(value)) {
  52795. const [channel, opts = ""] = value.split("=");
  52796. flags.channel = channel;
  52797. flags.language = value;
  52798. opts.split(",").forEach((opt) => {
  52799. const [name, val] = opt.split(":");
  52800. if (name === "lang") {
  52801. flags.language = val;
  52802. } else if (name === "er") {
  52803. flags.easyReader = Number(val);
  52804. } else if (name === "war") {
  52805. flags.aspectRatio = Number(val);
  52806. } else if (name === "3D") {
  52807. flags["3D"] = Number(val);
  52808. }
  52809. });
  52810. } else {
  52811. flags.language = value;
  52812. }
  52813. if (flags.channel) {
  52814. flags.channel = "SERVICE" + flags.channel;
  52815. }
  52816. return flags;
  52817. });
  52818. }
  52819. };
  52820. const toEventStream = (period) => {
  52821. return flatten$1(findChildren$1(period.node, "EventStream").map((eventStream) => {
  52822. const eventStreamAttributes = parseAttributes$2(eventStream);
  52823. const schemeIdUri = eventStreamAttributes.schemeIdUri;
  52824. return findChildren$1(eventStream, "Event").map((event2) => {
  52825. const eventAttributes = parseAttributes$2(event2);
  52826. const presentationTime = eventAttributes.presentationTime || 0;
  52827. const timescale2 = eventStreamAttributes.timescale || 1;
  52828. const duration5 = eventAttributes.duration || 0;
  52829. const start2 = presentationTime / timescale2 + period.attributes.start;
  52830. return {
  52831. schemeIdUri,
  52832. value: eventStreamAttributes.value,
  52833. id: eventAttributes.id,
  52834. start: start2,
  52835. end: start2 + duration5 / timescale2,
  52836. messageData: getContent$1(event2) || eventAttributes.messageData,
  52837. contentEncoding: eventStreamAttributes.contentEncoding,
  52838. presentationTimeOffset: eventStreamAttributes.presentationTimeOffset || 0
  52839. };
  52840. });
  52841. }));
  52842. };
  52843. const toRepresentations$1 = (periodAttributes, periodBaseUrls, periodSegmentInfo) => (adaptationSet) => {
  52844. const adaptationSetAttributes = parseAttributes$2(adaptationSet);
  52845. const adaptationSetBaseUrls = buildBaseUrls$1(periodBaseUrls, findChildren$1(adaptationSet, "BaseURL"));
  52846. const role = findChildren$1(adaptationSet, "Role")[0];
  52847. const roleAttributes = {
  52848. role: parseAttributes$2(role)
  52849. };
  52850. let attrs = merge$3(periodAttributes, adaptationSetAttributes, roleAttributes);
  52851. const accessibility = findChildren$1(adaptationSet, "Accessibility")[0];
  52852. const captionServices = parseCaptionServiceMetadata$1(parseAttributes$2(accessibility));
  52853. if (captionServices) {
  52854. attrs = merge$3(attrs, {
  52855. captionServices
  52856. });
  52857. }
  52858. const label = findChildren$1(adaptationSet, "Label")[0];
  52859. if (label && label.childNodes.length) {
  52860. const labelVal = label.childNodes[0].nodeValue.trim();
  52861. attrs = merge$3(attrs, {
  52862. label: labelVal
  52863. });
  52864. }
  52865. const contentProtection = generateKeySystemInformation$1(findChildren$1(adaptationSet, "ContentProtection"));
  52866. if (Object.keys(contentProtection).length) {
  52867. attrs = merge$3(attrs, {
  52868. contentProtection
  52869. });
  52870. }
  52871. const segmentInfo = getSegmentInformation$1(adaptationSet);
  52872. const representations = findChildren$1(adaptationSet, "Representation");
  52873. const adaptationSetSegmentInfo = merge$3(periodSegmentInfo, segmentInfo);
  52874. return flatten$1(representations.map(inheritBaseUrls$1(attrs, adaptationSetBaseUrls, adaptationSetSegmentInfo)));
  52875. };
  52876. const toAdaptationSets$1 = (mpdAttributes, mpdBaseUrls) => (period, index2) => {
  52877. const periodBaseUrls = buildBaseUrls$1(mpdBaseUrls, findChildren$1(period.node, "BaseURL"));
  52878. const periodAttributes = merge$3(mpdAttributes, {
  52879. periodStart: period.attributes.start
  52880. });
  52881. if (typeof period.attributes.duration === "number") {
  52882. periodAttributes.periodDuration = period.attributes.duration;
  52883. }
  52884. const adaptationSets = findChildren$1(period.node, "AdaptationSet");
  52885. const periodSegmentInfo = getSegmentInformation$1(period.node);
  52886. return flatten$1(adaptationSets.map(toRepresentations$1(periodAttributes, periodBaseUrls, periodSegmentInfo)));
  52887. };
  52888. const getPeriodStart$1 = ({
  52889. attributes,
  52890. priorPeriodAttributes,
  52891. mpdType
  52892. }) => {
  52893. if (typeof attributes.start === "number") {
  52894. return attributes.start;
  52895. }
  52896. if (priorPeriodAttributes && typeof priorPeriodAttributes.start === "number" && typeof priorPeriodAttributes.duration === "number") {
  52897. return priorPeriodAttributes.start + priorPeriodAttributes.duration;
  52898. }
  52899. if (!priorPeriodAttributes && mpdType === "static") {
  52900. return 0;
  52901. }
  52902. return null;
  52903. };
  52904. const inheritAttributes$1 = (mpd, options2 = {}) => {
  52905. const {
  52906. manifestUri = "",
  52907. NOW = Date.now(),
  52908. clientOffset = 0
  52909. } = options2;
  52910. const periodNodes = findChildren$1(mpd, "Period");
  52911. if (!periodNodes.length) {
  52912. throw new Error(errors$1.INVALID_NUMBER_OF_PERIOD);
  52913. }
  52914. const locations = findChildren$1(mpd, "Location");
  52915. const mpdAttributes = parseAttributes$2(mpd);
  52916. const mpdBaseUrls = buildBaseUrls$1([manifestUri], findChildren$1(mpd, "BaseURL"));
  52917. mpdAttributes.type = mpdAttributes.type || "static";
  52918. mpdAttributes.sourceDuration = mpdAttributes.mediaPresentationDuration || 0;
  52919. mpdAttributes.NOW = NOW;
  52920. mpdAttributes.clientOffset = clientOffset;
  52921. if (locations.length) {
  52922. mpdAttributes.locations = locations.map(getContent$1);
  52923. }
  52924. const periods = [];
  52925. periodNodes.forEach((node, index2) => {
  52926. const attributes = parseAttributes$2(node);
  52927. const priorPeriod = periods[index2 - 1];
  52928. attributes.start = getPeriodStart$1({
  52929. attributes,
  52930. priorPeriodAttributes: priorPeriod ? priorPeriod.attributes : null,
  52931. mpdType: mpdAttributes.type
  52932. });
  52933. periods.push({
  52934. node,
  52935. attributes
  52936. });
  52937. });
  52938. return {
  52939. locations: mpdAttributes.locations,
  52940. representationInfo: flatten$1(periods.map(toAdaptationSets$1(mpdAttributes, mpdBaseUrls))),
  52941. eventStream: flatten$1(periods.map(toEventStream))
  52942. };
  52943. };
  52944. const stringToMpdXml$1 = (manifestString) => {
  52945. if (manifestString === "") {
  52946. throw new Error(errors$1.DASH_EMPTY_MANIFEST);
  52947. }
  52948. const parser2 = new DOMParser();
  52949. let xml;
  52950. let mpd;
  52951. try {
  52952. xml = parser2.parseFromString(manifestString, "application/xml");
  52953. mpd = xml && xml.documentElement.tagName === "MPD" ? xml.documentElement : null;
  52954. } catch (e) {
  52955. }
  52956. if (!mpd || mpd && mpd.getElementsByTagName("parsererror").length > 0) {
  52957. throw new Error(errors$1.DASH_INVALID_XML);
  52958. }
  52959. return mpd;
  52960. };
  52961. const parseUTCTimingScheme$1 = (mpd) => {
  52962. const UTCTimingNode = findChildren$1(mpd, "UTCTiming")[0];
  52963. if (!UTCTimingNode) {
  52964. return null;
  52965. }
  52966. const attributes = parseAttributes$2(UTCTimingNode);
  52967. switch (attributes.schemeIdUri) {
  52968. case "urn:mpeg:dash:utc:http-head:2014":
  52969. case "urn:mpeg:dash:utc:http-head:2012":
  52970. attributes.method = "HEAD";
  52971. break;
  52972. case "urn:mpeg:dash:utc:http-xsdate:2014":
  52973. case "urn:mpeg:dash:utc:http-iso:2014":
  52974. case "urn:mpeg:dash:utc:http-xsdate:2012":
  52975. case "urn:mpeg:dash:utc:http-iso:2012":
  52976. attributes.method = "GET";
  52977. break;
  52978. case "urn:mpeg:dash:utc:direct:2014":
  52979. case "urn:mpeg:dash:utc:direct:2012":
  52980. attributes.method = "DIRECT";
  52981. attributes.value = Date.parse(attributes.value);
  52982. break;
  52983. case "urn:mpeg:dash:utc:http-ntp:2014":
  52984. case "urn:mpeg:dash:utc:ntp:2014":
  52985. case "urn:mpeg:dash:utc:sntp:2014":
  52986. default:
  52987. throw new Error(errors$1.UNSUPPORTED_UTC_TIMING_SCHEME);
  52988. }
  52989. return attributes;
  52990. };
  52991. const parse$1 = (manifestString, options2 = {}) => {
  52992. const parsedManifestInfo = inheritAttributes$1(stringToMpdXml$1(manifestString), options2);
  52993. const playlists = toPlaylists$1(parsedManifestInfo.representationInfo);
  52994. return toM3u8$1({
  52995. dashPlaylists: playlists,
  52996. locations: parsedManifestInfo.locations,
  52997. sidxMapping: options2.sidxMapping,
  52998. previousManifest: options2.previousManifest,
  52999. eventStream: parsedManifestInfo.eventStream
  53000. });
  53001. };
  53002. const parseUTCTiming$1 = (manifestString) => parseUTCTimingScheme$1(stringToMpdXml$1(manifestString));
  53003. var MAX_UINT32$1 = Math.pow(2, 32);
  53004. var getUint64$3 = function(uint8) {
  53005. var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);
  53006. var value;
  53007. if (dv.getBigUint64) {
  53008. value = dv.getBigUint64(0);
  53009. if (value < Number.MAX_SAFE_INTEGER) {
  53010. return Number(value);
  53011. }
  53012. return value;
  53013. }
  53014. return dv.getUint32(0) * MAX_UINT32$1 + dv.getUint32(4);
  53015. };
  53016. var numbers$1 = {
  53017. getUint64: getUint64$3,
  53018. MAX_UINT32: MAX_UINT32$1
  53019. };
  53020. var getUint64$2 = numbers$1.getUint64;
  53021. var parseSidx$1 = function(data) {
  53022. var view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = {
  53023. version: data[0],
  53024. flags: new Uint8Array(data.subarray(1, 4)),
  53025. references: [],
  53026. referenceId: view.getUint32(4),
  53027. timescale: view.getUint32(8)
  53028. }, i2 = 12;
  53029. if (result.version === 0) {
  53030. result.earliestPresentationTime = view.getUint32(i2);
  53031. result.firstOffset = view.getUint32(i2 + 4);
  53032. i2 += 8;
  53033. } else {
  53034. result.earliestPresentationTime = getUint64$2(data.subarray(i2));
  53035. result.firstOffset = getUint64$2(data.subarray(i2 + 8));
  53036. i2 += 16;
  53037. }
  53038. i2 += 2;
  53039. var referenceCount = view.getUint16(i2);
  53040. i2 += 2;
  53041. for (; referenceCount > 0; i2 += 12, referenceCount--) {
  53042. result.references.push({
  53043. referenceType: (data[i2] & 128) >>> 7,
  53044. referencedSize: view.getUint32(i2) & 2147483647,
  53045. subsegmentDuration: view.getUint32(i2 + 4),
  53046. startsWithSap: !!(data[i2 + 8] & 128),
  53047. sapType: (data[i2 + 8] & 112) >>> 4,
  53048. sapDeltaTime: view.getUint32(i2 + 8) & 268435455
  53049. });
  53050. }
  53051. return result;
  53052. };
  53053. var parseSidx_1$1 = parseSidx$1;
  53054. var ID3$1 = toUint8$1([73, 68, 51]);
  53055. var getId3Size$1 = function getId3Size(bytes, offset) {
  53056. if (offset === void 0) {
  53057. offset = 0;
  53058. }
  53059. bytes = toUint8$1(bytes);
  53060. var flags = bytes[offset + 5];
  53061. var returnSize = bytes[offset + 6] << 21 | bytes[offset + 7] << 14 | bytes[offset + 8] << 7 | bytes[offset + 9];
  53062. var footerPresent = (flags & 16) >> 4;
  53063. if (footerPresent) {
  53064. return returnSize + 20;
  53065. }
  53066. return returnSize + 10;
  53067. };
  53068. var getId3Offset$1 = function getId3Offset(bytes, offset) {
  53069. if (offset === void 0) {
  53070. offset = 0;
  53071. }
  53072. bytes = toUint8$1(bytes);
  53073. if (bytes.length - offset < 10 || !bytesMatch$1(bytes, ID3$1, {
  53074. offset
  53075. })) {
  53076. return offset;
  53077. }
  53078. offset += getId3Size$1(bytes, offset);
  53079. return getId3Offset(bytes, offset);
  53080. };
  53081. var normalizePath$3 = function normalizePath(path) {
  53082. if (typeof path === "string") {
  53083. return stringToBytes$1(path);
  53084. }
  53085. if (typeof path === "number") {
  53086. return path;
  53087. }
  53088. return path;
  53089. };
  53090. var normalizePaths$3 = function normalizePaths(paths) {
  53091. if (!Array.isArray(paths)) {
  53092. return [normalizePath$3(paths)];
  53093. }
  53094. return paths.map(function(p) {
  53095. return normalizePath$3(p);
  53096. });
  53097. };
  53098. var findBox$1 = function findBox(bytes, paths, complete) {
  53099. if (complete === void 0) {
  53100. complete = false;
  53101. }
  53102. paths = normalizePaths$3(paths);
  53103. bytes = toUint8$1(bytes);
  53104. var results = [];
  53105. if (!paths.length) {
  53106. return results;
  53107. }
  53108. var i2 = 0;
  53109. while (i2 < bytes.length) {
  53110. var size = (bytes[i2] << 24 | bytes[i2 + 1] << 16 | bytes[i2 + 2] << 8 | bytes[i2 + 3]) >>> 0;
  53111. var type2 = bytes.subarray(i2 + 4, i2 + 8);
  53112. if (size === 0) {
  53113. break;
  53114. }
  53115. var end = i2 + size;
  53116. if (end > bytes.length) {
  53117. if (complete) {
  53118. break;
  53119. }
  53120. end = bytes.length;
  53121. }
  53122. var data = bytes.subarray(i2 + 8, end);
  53123. if (bytesMatch$1(type2, paths[0])) {
  53124. if (paths.length === 1) {
  53125. results.push(data);
  53126. } else {
  53127. results.push.apply(results, findBox(data, paths.slice(1), complete));
  53128. }
  53129. }
  53130. i2 = end;
  53131. }
  53132. return results;
  53133. };
  53134. var EBML_TAGS$1 = {
  53135. EBML: toUint8$1([26, 69, 223, 163]),
  53136. DocType: toUint8$1([66, 130]),
  53137. Segment: toUint8$1([24, 83, 128, 103]),
  53138. SegmentInfo: toUint8$1([21, 73, 169, 102]),
  53139. Tracks: toUint8$1([22, 84, 174, 107]),
  53140. Track: toUint8$1([174]),
  53141. TrackNumber: toUint8$1([215]),
  53142. DefaultDuration: toUint8$1([35, 227, 131]),
  53143. TrackEntry: toUint8$1([174]),
  53144. TrackType: toUint8$1([131]),
  53145. FlagDefault: toUint8$1([136]),
  53146. CodecID: toUint8$1([134]),
  53147. CodecPrivate: toUint8$1([99, 162]),
  53148. VideoTrack: toUint8$1([224]),
  53149. AudioTrack: toUint8$1([225]),
  53150. Cluster: toUint8$1([31, 67, 182, 117]),
  53151. Timestamp: toUint8$1([231]),
  53152. TimestampScale: toUint8$1([42, 215, 177]),
  53153. BlockGroup: toUint8$1([160]),
  53154. BlockDuration: toUint8$1([155]),
  53155. Block: toUint8$1([161]),
  53156. SimpleBlock: toUint8$1([163])
  53157. };
  53158. var LENGTH_TABLE$1 = [128, 64, 32, 16, 8, 4, 2, 1];
  53159. var getLength$1 = function getLength(byte) {
  53160. var len = 1;
  53161. for (var i2 = 0; i2 < LENGTH_TABLE$1.length; i2++) {
  53162. if (byte & LENGTH_TABLE$1[i2]) {
  53163. break;
  53164. }
  53165. len++;
  53166. }
  53167. return len;
  53168. };
  53169. var getvint$1 = function getvint(bytes, offset, removeLength, signed) {
  53170. if (removeLength === void 0) {
  53171. removeLength = true;
  53172. }
  53173. if (signed === void 0) {
  53174. signed = false;
  53175. }
  53176. var length = getLength$1(bytes[offset]);
  53177. var valueBytes = bytes.subarray(offset, offset + length);
  53178. if (removeLength) {
  53179. valueBytes = Array.prototype.slice.call(bytes, offset, offset + length);
  53180. valueBytes[0] ^= LENGTH_TABLE$1[length - 1];
  53181. }
  53182. return {
  53183. length,
  53184. value: bytesToNumber$1(valueBytes, {
  53185. signed
  53186. }),
  53187. bytes: valueBytes
  53188. };
  53189. };
  53190. var normalizePath$2 = function normalizePath2(path) {
  53191. if (typeof path === "string") {
  53192. return path.match(/.{1,2}/g).map(function(p) {
  53193. return normalizePath2(p);
  53194. });
  53195. }
  53196. if (typeof path === "number") {
  53197. return numberToBytes$1(path);
  53198. }
  53199. return path;
  53200. };
  53201. var normalizePaths$2 = function normalizePaths2(paths) {
  53202. if (!Array.isArray(paths)) {
  53203. return [normalizePath$2(paths)];
  53204. }
  53205. return paths.map(function(p) {
  53206. return normalizePath$2(p);
  53207. });
  53208. };
  53209. var getInfinityDataSize$1 = function getInfinityDataSize(id, bytes, offset) {
  53210. if (offset >= bytes.length) {
  53211. return bytes.length;
  53212. }
  53213. var innerid = getvint$1(bytes, offset, false);
  53214. if (bytesMatch$1(id.bytes, innerid.bytes)) {
  53215. return offset;
  53216. }
  53217. var dataHeader = getvint$1(bytes, offset + innerid.length);
  53218. return getInfinityDataSize(id, bytes, offset + dataHeader.length + dataHeader.value + innerid.length);
  53219. };
  53220. var findEbml$1 = function findEbml(bytes, paths) {
  53221. paths = normalizePaths$2(paths);
  53222. bytes = toUint8$1(bytes);
  53223. var results = [];
  53224. if (!paths.length) {
  53225. return results;
  53226. }
  53227. var i2 = 0;
  53228. while (i2 < bytes.length) {
  53229. var id = getvint$1(bytes, i2, false);
  53230. var dataHeader = getvint$1(bytes, i2 + id.length);
  53231. var dataStart = i2 + id.length + dataHeader.length;
  53232. if (dataHeader.value === 127) {
  53233. dataHeader.value = getInfinityDataSize$1(id, bytes, dataStart);
  53234. if (dataHeader.value !== bytes.length) {
  53235. dataHeader.value -= dataStart;
  53236. }
  53237. }
  53238. var dataEnd = dataStart + dataHeader.value > bytes.length ? bytes.length : dataStart + dataHeader.value;
  53239. var data = bytes.subarray(dataStart, dataEnd);
  53240. if (bytesMatch$1(paths[0], id.bytes)) {
  53241. if (paths.length === 1) {
  53242. results.push(data);
  53243. } else {
  53244. results = results.concat(findEbml(data, paths.slice(1)));
  53245. }
  53246. }
  53247. var totalLength = id.length + dataHeader.length + data.length;
  53248. i2 += totalLength;
  53249. }
  53250. return results;
  53251. };
  53252. var NAL_TYPE_ONE$1 = toUint8$1([0, 0, 0, 1]);
  53253. var NAL_TYPE_TWO$1 = toUint8$1([0, 0, 1]);
  53254. var EMULATION_PREVENTION$1 = toUint8$1([0, 0, 3]);
  53255. var discardEmulationPreventionBytes$1 = function discardEmulationPreventionBytes(bytes) {
  53256. var positions = [];
  53257. var i2 = 1;
  53258. while (i2 < bytes.length - 2) {
  53259. if (bytesMatch$1(bytes.subarray(i2, i2 + 3), EMULATION_PREVENTION$1)) {
  53260. positions.push(i2 + 2);
  53261. i2++;
  53262. }
  53263. i2++;
  53264. }
  53265. if (positions.length === 0) {
  53266. return bytes;
  53267. }
  53268. var newLength = bytes.length - positions.length;
  53269. var newData = new Uint8Array(newLength);
  53270. var sourceIndex = 0;
  53271. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  53272. if (sourceIndex === positions[0]) {
  53273. sourceIndex++;
  53274. positions.shift();
  53275. }
  53276. newData[i2] = bytes[sourceIndex];
  53277. }
  53278. return newData;
  53279. };
  53280. var findNal$1 = function findNal(bytes, dataType, types, nalLimit) {
  53281. if (nalLimit === void 0) {
  53282. nalLimit = Infinity;
  53283. }
  53284. bytes = toUint8$1(bytes);
  53285. types = [].concat(types);
  53286. var i2 = 0;
  53287. var nalStart;
  53288. var nalsFound = 0;
  53289. while (i2 < bytes.length && (nalsFound < nalLimit || nalStart)) {
  53290. var nalOffset = void 0;
  53291. if (bytesMatch$1(bytes.subarray(i2), NAL_TYPE_ONE$1)) {
  53292. nalOffset = 4;
  53293. } else if (bytesMatch$1(bytes.subarray(i2), NAL_TYPE_TWO$1)) {
  53294. nalOffset = 3;
  53295. }
  53296. if (!nalOffset) {
  53297. i2++;
  53298. continue;
  53299. }
  53300. nalsFound++;
  53301. if (nalStart) {
  53302. return discardEmulationPreventionBytes$1(bytes.subarray(nalStart, i2));
  53303. }
  53304. var nalType = void 0;
  53305. if (dataType === "h264") {
  53306. nalType = bytes[i2 + nalOffset] & 31;
  53307. } else if (dataType === "h265") {
  53308. nalType = bytes[i2 + nalOffset] >> 1 & 63;
  53309. }
  53310. if (types.indexOf(nalType) !== -1) {
  53311. nalStart = i2 + nalOffset;
  53312. }
  53313. i2 += nalOffset + (dataType === "h264" ? 1 : 2);
  53314. }
  53315. return bytes.subarray(0, 0);
  53316. };
  53317. var findH264Nal$1 = function findH264Nal(bytes, type2, nalLimit) {
  53318. return findNal$1(bytes, "h264", type2, nalLimit);
  53319. };
  53320. var findH265Nal$1 = function findH265Nal(bytes, type2, nalLimit) {
  53321. return findNal$1(bytes, "h265", type2, nalLimit);
  53322. };
  53323. var CONSTANTS$1 = {
  53324. "webm": toUint8$1([119, 101, 98, 109]),
  53325. "matroska": toUint8$1([109, 97, 116, 114, 111, 115, 107, 97]),
  53326. "flac": toUint8$1([102, 76, 97, 67]),
  53327. "ogg": toUint8$1([79, 103, 103, 83]),
  53328. "ac3": toUint8$1([11, 119]),
  53329. "riff": toUint8$1([82, 73, 70, 70]),
  53330. "avi": toUint8$1([65, 86, 73]),
  53331. "wav": toUint8$1([87, 65, 86, 69]),
  53332. "3gp": toUint8$1([102, 116, 121, 112, 51, 103]),
  53333. "mp4": toUint8$1([102, 116, 121, 112]),
  53334. "fmp4": toUint8$1([115, 116, 121, 112]),
  53335. "mov": toUint8$1([102, 116, 121, 112, 113, 116]),
  53336. "moov": toUint8$1([109, 111, 111, 118]),
  53337. "moof": toUint8$1([109, 111, 111, 102])
  53338. };
  53339. var _isLikely$1 = {
  53340. aac: function aac(bytes) {
  53341. var offset = getId3Offset$1(bytes);
  53342. return bytesMatch$1(bytes, [255, 16], {
  53343. offset,
  53344. mask: [255, 22]
  53345. });
  53346. },
  53347. mp3: function mp3(bytes) {
  53348. var offset = getId3Offset$1(bytes);
  53349. return bytesMatch$1(bytes, [255, 2], {
  53350. offset,
  53351. mask: [255, 6]
  53352. });
  53353. },
  53354. webm: function webm(bytes) {
  53355. var docType = findEbml$1(bytes, [EBML_TAGS$1.EBML, EBML_TAGS$1.DocType])[0];
  53356. return bytesMatch$1(docType, CONSTANTS$1.webm);
  53357. },
  53358. mkv: function mkv(bytes) {
  53359. var docType = findEbml$1(bytes, [EBML_TAGS$1.EBML, EBML_TAGS$1.DocType])[0];
  53360. return bytesMatch$1(docType, CONSTANTS$1.matroska);
  53361. },
  53362. mp4: function mp4(bytes) {
  53363. if (_isLikely$1["3gp"](bytes) || _isLikely$1.mov(bytes)) {
  53364. return false;
  53365. }
  53366. if (bytesMatch$1(bytes, CONSTANTS$1.mp4, {
  53367. offset: 4
  53368. }) || bytesMatch$1(bytes, CONSTANTS$1.fmp4, {
  53369. offset: 4
  53370. })) {
  53371. return true;
  53372. }
  53373. if (bytesMatch$1(bytes, CONSTANTS$1.moof, {
  53374. offset: 4
  53375. }) || bytesMatch$1(bytes, CONSTANTS$1.moov, {
  53376. offset: 4
  53377. })) {
  53378. return true;
  53379. }
  53380. },
  53381. mov: function mov(bytes) {
  53382. return bytesMatch$1(bytes, CONSTANTS$1.mov, {
  53383. offset: 4
  53384. });
  53385. },
  53386. "3gp": function gp(bytes) {
  53387. return bytesMatch$1(bytes, CONSTANTS$1["3gp"], {
  53388. offset: 4
  53389. });
  53390. },
  53391. ac3: function ac3(bytes) {
  53392. var offset = getId3Offset$1(bytes);
  53393. return bytesMatch$1(bytes, CONSTANTS$1.ac3, {
  53394. offset
  53395. });
  53396. },
  53397. ts: function ts(bytes) {
  53398. if (bytes.length < 189 && bytes.length >= 1) {
  53399. return bytes[0] === 71;
  53400. }
  53401. var i2 = 0;
  53402. while (i2 + 188 < bytes.length && i2 < 188) {
  53403. if (bytes[i2] === 71 && bytes[i2 + 188] === 71) {
  53404. return true;
  53405. }
  53406. i2 += 1;
  53407. }
  53408. return false;
  53409. },
  53410. flac: function flac(bytes) {
  53411. var offset = getId3Offset$1(bytes);
  53412. return bytesMatch$1(bytes, CONSTANTS$1.flac, {
  53413. offset
  53414. });
  53415. },
  53416. ogg: function ogg(bytes) {
  53417. return bytesMatch$1(bytes, CONSTANTS$1.ogg);
  53418. },
  53419. avi: function avi(bytes) {
  53420. return bytesMatch$1(bytes, CONSTANTS$1.riff) && bytesMatch$1(bytes, CONSTANTS$1.avi, {
  53421. offset: 8
  53422. });
  53423. },
  53424. wav: function wav(bytes) {
  53425. return bytesMatch$1(bytes, CONSTANTS$1.riff) && bytesMatch$1(bytes, CONSTANTS$1.wav, {
  53426. offset: 8
  53427. });
  53428. },
  53429. "h264": function h264(bytes) {
  53430. return findH264Nal$1(bytes, 7, 3).length;
  53431. },
  53432. "h265": function h265(bytes) {
  53433. return findH265Nal$1(bytes, [32, 33], 3).length;
  53434. }
  53435. };
  53436. var isLikelyTypes$1 = Object.keys(_isLikely$1).filter(function(t2) {
  53437. return t2 !== "ts" && t2 !== "h264" && t2 !== "h265";
  53438. }).concat(["ts", "h264", "h265"]);
  53439. isLikelyTypes$1.forEach(function(type2) {
  53440. var isLikelyFn = _isLikely$1[type2];
  53441. _isLikely$1[type2] = function(bytes) {
  53442. return isLikelyFn(toUint8$1(bytes));
  53443. };
  53444. });
  53445. var isLikely$1 = _isLikely$1;
  53446. var detectContainerForBytes$1 = function detectContainerForBytes(bytes) {
  53447. bytes = toUint8$1(bytes);
  53448. for (var i2 = 0; i2 < isLikelyTypes$1.length; i2++) {
  53449. var type2 = isLikelyTypes$1[i2];
  53450. if (isLikely$1[type2](bytes)) {
  53451. return type2;
  53452. }
  53453. }
  53454. return "";
  53455. };
  53456. var isLikelyFmp4MediaSegment$1 = function isLikelyFmp4MediaSegment(bytes) {
  53457. return findBox$1(bytes, ["moof"]).length > 0;
  53458. };
  53459. var ONE_SECOND_IN_TS$1 = 9e4, secondsToVideoTs$1, secondsToAudioTs$1, videoTsToSeconds$1, audioTsToSeconds$1, audioTsToVideoTs$1, videoTsToAudioTs$1, metadataTsToSeconds$1;
  53460. secondsToVideoTs$1 = function(seconds) {
  53461. return seconds * ONE_SECOND_IN_TS$1;
  53462. };
  53463. secondsToAudioTs$1 = function(seconds, sampleRate) {
  53464. return seconds * sampleRate;
  53465. };
  53466. videoTsToSeconds$1 = function(timestamp) {
  53467. return timestamp / ONE_SECOND_IN_TS$1;
  53468. };
  53469. audioTsToSeconds$1 = function(timestamp, sampleRate) {
  53470. return timestamp / sampleRate;
  53471. };
  53472. audioTsToVideoTs$1 = function(timestamp, sampleRate) {
  53473. return secondsToVideoTs$1(audioTsToSeconds$1(timestamp, sampleRate));
  53474. };
  53475. videoTsToAudioTs$1 = function(timestamp, sampleRate) {
  53476. return secondsToAudioTs$1(videoTsToSeconds$1(timestamp), sampleRate);
  53477. };
  53478. metadataTsToSeconds$1 = function(timestamp, timelineStartPts, keepOriginalTimestamps) {
  53479. return videoTsToSeconds$1(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);
  53480. };
  53481. var clock$1 = {
  53482. ONE_SECOND_IN_TS: ONE_SECOND_IN_TS$1,
  53483. secondsToVideoTs: secondsToVideoTs$1,
  53484. secondsToAudioTs: secondsToAudioTs$1,
  53485. videoTsToSeconds: videoTsToSeconds$1,
  53486. audioTsToSeconds: audioTsToSeconds$1,
  53487. audioTsToVideoTs: audioTsToVideoTs$1,
  53488. videoTsToAudioTs: videoTsToAudioTs$1,
  53489. metadataTsToSeconds: metadataTsToSeconds$1
  53490. };
  53491. /**
  53492. * @license
  53493. * Video.js 8.3.0 <http://videojs.com/>
  53494. * Copyright Brightcove, Inc. <https://www.brightcove.com/>
  53495. * Available under Apache License Version 2.0
  53496. * <https://github.com/videojs/video.js/blob/main/LICENSE>
  53497. *
  53498. * Includes vtt.js <https://github.com/mozilla/vtt.js>
  53499. * Available under Apache License Version 2.0
  53500. * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
  53501. */
  53502. var version$6$1 = "8.3.0";
  53503. const hooks_$1 = {};
  53504. const hooks$1 = function(type2, fn2) {
  53505. hooks_$1[type2] = hooks_$1[type2] || [];
  53506. if (fn2) {
  53507. hooks_$1[type2] = hooks_$1[type2].concat(fn2);
  53508. }
  53509. return hooks_$1[type2];
  53510. };
  53511. const hook$1 = function(type2, fn2) {
  53512. hooks$1(type2, fn2);
  53513. };
  53514. const removeHook$1 = function(type2, fn2) {
  53515. const index2 = hooks$1(type2).indexOf(fn2);
  53516. if (index2 <= -1) {
  53517. return false;
  53518. }
  53519. hooks_$1[type2] = hooks_$1[type2].slice();
  53520. hooks_$1[type2].splice(index2, 1);
  53521. return true;
  53522. };
  53523. const hookOnce$1 = function(type2, fn2) {
  53524. hooks$1(type2, [].concat(fn2).map((original) => {
  53525. const wrapper = (...args) => {
  53526. removeHook$1(type2, wrapper);
  53527. return original(...args);
  53528. };
  53529. return wrapper;
  53530. }));
  53531. };
  53532. const FullscreenApi$1 = {
  53533. prefixed: true
  53534. };
  53535. const apiMap$1 = [
  53536. ["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror", "fullscreen"],
  53537. ["webkitRequestFullscreen", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitfullscreenchange", "webkitfullscreenerror", "-webkit-full-screen"],
  53538. ["mozRequestFullScreen", "mozCancelFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozfullscreenchange", "mozfullscreenerror", "-moz-full-screen"],
  53539. ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError", "-ms-fullscreen"]
  53540. ];
  53541. const specApi$1 = apiMap$1[0];
  53542. let browserApi$1;
  53543. for (let i2 = 0; i2 < apiMap$1.length; i2++) {
  53544. if (apiMap$1[i2][1] in document_1) {
  53545. browserApi$1 = apiMap$1[i2];
  53546. break;
  53547. }
  53548. }
  53549. if (browserApi$1) {
  53550. for (let i2 = 0; i2 < browserApi$1.length; i2++) {
  53551. FullscreenApi$1[specApi$1[i2]] = browserApi$1[i2];
  53552. }
  53553. FullscreenApi$1.prefixed = browserApi$1[0] !== specApi$1[0];
  53554. }
  53555. let history$1 = [];
  53556. const LogByTypeFactory$1 = (name, log2) => (type2, level, args) => {
  53557. const lvl = log2.levels[level];
  53558. const lvlRegExp = new RegExp(`^(${lvl})$`);
  53559. if (type2 !== "log") {
  53560. args.unshift(type2.toUpperCase() + ":");
  53561. }
  53562. args.unshift(name + ":");
  53563. if (history$1) {
  53564. history$1.push([].concat(args));
  53565. const splice2 = history$1.length - 1e3;
  53566. history$1.splice(0, splice2 > 0 ? splice2 : 0);
  53567. }
  53568. if (!window_1.console) {
  53569. return;
  53570. }
  53571. let fn2 = window_1.console[type2];
  53572. if (!fn2 && type2 === "debug") {
  53573. fn2 = window_1.console.info || window_1.console.log;
  53574. }
  53575. if (!fn2 || !lvl || !lvlRegExp.test(type2)) {
  53576. return;
  53577. }
  53578. fn2[Array.isArray(args) ? "apply" : "call"](window_1.console, args);
  53579. };
  53580. function createLogger$1$1(name) {
  53581. let level = "info";
  53582. let logByType;
  53583. const log2 = function(...args) {
  53584. logByType("log", level, args);
  53585. };
  53586. logByType = LogByTypeFactory$1(name, log2);
  53587. log2.createLogger = (subname) => createLogger$1$1(name + ": " + subname);
  53588. log2.levels = {
  53589. all: "debug|log|warn|error",
  53590. off: "",
  53591. debug: "debug|log|warn|error",
  53592. info: "log|warn|error",
  53593. warn: "warn|error",
  53594. error: "error",
  53595. DEFAULT: level
  53596. };
  53597. log2.level = (lvl) => {
  53598. if (typeof lvl === "string") {
  53599. if (!log2.levels.hasOwnProperty(lvl)) {
  53600. throw new Error(`"${lvl}" in not a valid log level`);
  53601. }
  53602. level = lvl;
  53603. }
  53604. return level;
  53605. };
  53606. log2.history = () => history$1 ? [].concat(history$1) : [];
  53607. log2.history.filter = (fname) => {
  53608. return (history$1 || []).filter((historyItem) => {
  53609. return new RegExp(`.*${fname}.*`).test(historyItem[0]);
  53610. });
  53611. };
  53612. log2.history.clear = () => {
  53613. if (history$1) {
  53614. history$1.length = 0;
  53615. }
  53616. };
  53617. log2.history.disable = () => {
  53618. if (history$1 !== null) {
  53619. history$1.length = 0;
  53620. history$1 = null;
  53621. }
  53622. };
  53623. log2.history.enable = () => {
  53624. if (history$1 === null) {
  53625. history$1 = [];
  53626. }
  53627. };
  53628. log2.error = (...args) => logByType("error", level, args);
  53629. log2.warn = (...args) => logByType("warn", level, args);
  53630. log2.debug = (...args) => logByType("debug", level, args);
  53631. return log2;
  53632. }
  53633. const log$1$1 = createLogger$1$1("VIDEOJS");
  53634. const createLogger$2 = log$1$1.createLogger;
  53635. const toString$1 = Object.prototype.toString;
  53636. const keys$1 = function(object) {
  53637. return isObject$2(object) ? Object.keys(object) : [];
  53638. };
  53639. function each$1(object, fn2) {
  53640. keys$1(object).forEach((key) => fn2(object[key], key));
  53641. }
  53642. function reduce$1(object, fn2, initial = 0) {
  53643. return keys$1(object).reduce((accum, key) => fn2(accum, object[key], key), initial);
  53644. }
  53645. function isObject$2(value) {
  53646. return !!value && typeof value === "object";
  53647. }
  53648. function isPlain$1(value) {
  53649. return isObject$2(value) && toString$1.call(value) === "[object Object]" && value.constructor === Object;
  53650. }
  53651. function merge$1(...sources) {
  53652. const result = {};
  53653. sources.forEach((source) => {
  53654. if (!source) {
  53655. return;
  53656. }
  53657. each$1(source, (value, key) => {
  53658. if (!isPlain$1(value)) {
  53659. result[key] = value;
  53660. return;
  53661. }
  53662. if (!isPlain$1(result[key])) {
  53663. result[key] = {};
  53664. }
  53665. result[key] = merge$1(result[key], value);
  53666. });
  53667. });
  53668. return result;
  53669. }
  53670. function defineLazyProperty$1(obj, key, getValue2, setter = true) {
  53671. const set4 = (value) => Object.defineProperty(obj, key, {
  53672. value,
  53673. enumerable: true,
  53674. writable: true
  53675. });
  53676. const options2 = {
  53677. configurable: true,
  53678. enumerable: true,
  53679. get() {
  53680. const value = getValue2();
  53681. set4(value);
  53682. return value;
  53683. }
  53684. };
  53685. if (setter) {
  53686. options2.set = set4;
  53687. }
  53688. return Object.defineProperty(obj, key, options2);
  53689. }
  53690. var Obj = /* @__PURE__ */ Object.freeze({
  53691. __proto__: null,
  53692. each: each$1,
  53693. reduce: reduce$1,
  53694. isObject: isObject$2,
  53695. isPlain: isPlain$1,
  53696. merge: merge$1,
  53697. defineLazyProperty: defineLazyProperty$1
  53698. });
  53699. let IS_IPOD$1 = false;
  53700. let IOS_VERSION$1 = null;
  53701. let IS_ANDROID$1 = false;
  53702. let ANDROID_VERSION$1;
  53703. let IS_FIREFOX$1 = false;
  53704. let IS_EDGE$1 = false;
  53705. let IS_CHROMIUM = false;
  53706. let IS_CHROME$1 = false;
  53707. let CHROMIUM_VERSION = null;
  53708. let CHROME_VERSION$1 = null;
  53709. let IE_VERSION$1 = null;
  53710. let IS_SAFARI$1 = false;
  53711. let IS_WINDOWS$1 = false;
  53712. let IS_IPAD$1 = false;
  53713. let IS_IPHONE$1 = false;
  53714. const TOUCH_ENABLED$1 = Boolean(isReal$1() && ("ontouchstart" in window_1 || window_1.navigator.maxTouchPoints || window_1.DocumentTouch && window_1.document instanceof window_1.DocumentTouch));
  53715. const UAD = window_1.navigator && window_1.navigator.userAgentData;
  53716. if (UAD) {
  53717. IS_ANDROID$1 = UAD.platform === "Android";
  53718. IS_EDGE$1 = Boolean(UAD.brands.find((b) => b.brand === "Microsoft Edge"));
  53719. IS_CHROMIUM = Boolean(UAD.brands.find((b) => b.brand === "Chromium"));
  53720. IS_CHROME$1 = !IS_EDGE$1 && IS_CHROMIUM;
  53721. CHROMIUM_VERSION = CHROME_VERSION$1 = (UAD.brands.find((b) => b.brand === "Chromium") || {}).version || null;
  53722. IS_WINDOWS$1 = UAD.platform === "Windows";
  53723. }
  53724. if (!IS_CHROMIUM) {
  53725. const USER_AGENT2 = window_1.navigator && window_1.navigator.userAgent || "";
  53726. IS_IPOD$1 = /iPod/i.test(USER_AGENT2);
  53727. IOS_VERSION$1 = function() {
  53728. const match = USER_AGENT2.match(/OS (\d+)_/i);
  53729. if (match && match[1]) {
  53730. return match[1];
  53731. }
  53732. return null;
  53733. }();
  53734. IS_ANDROID$1 = /Android/i.test(USER_AGENT2);
  53735. ANDROID_VERSION$1 = function() {
  53736. const match = USER_AGENT2.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);
  53737. if (!match) {
  53738. return null;
  53739. }
  53740. const major = match[1] && parseFloat(match[1]);
  53741. const minor = match[2] && parseFloat(match[2]);
  53742. if (major && minor) {
  53743. return parseFloat(match[1] + "." + match[2]);
  53744. } else if (major) {
  53745. return major;
  53746. }
  53747. return null;
  53748. }();
  53749. IS_FIREFOX$1 = /Firefox/i.test(USER_AGENT2);
  53750. IS_EDGE$1 = /Edg/i.test(USER_AGENT2);
  53751. IS_CHROMIUM = /Chrome/i.test(USER_AGENT2) || /CriOS/i.test(USER_AGENT2);
  53752. IS_CHROME$1 = !IS_EDGE$1 && IS_CHROMIUM;
  53753. CHROMIUM_VERSION = CHROME_VERSION$1 = function() {
  53754. const match = USER_AGENT2.match(/(Chrome|CriOS)\/(\d+)/);
  53755. if (match && match[2]) {
  53756. return parseFloat(match[2]);
  53757. }
  53758. return null;
  53759. }();
  53760. IE_VERSION$1 = function() {
  53761. const result = /MSIE\s(\d+)\.\d/.exec(USER_AGENT2);
  53762. let version2 = result && parseFloat(result[1]);
  53763. if (!version2 && /Trident\/7.0/i.test(USER_AGENT2) && /rv:11.0/.test(USER_AGENT2)) {
  53764. version2 = 11;
  53765. }
  53766. return version2;
  53767. }();
  53768. IS_SAFARI$1 = /Safari/i.test(USER_AGENT2) && !IS_CHROME$1 && !IS_ANDROID$1 && !IS_EDGE$1;
  53769. IS_WINDOWS$1 = /Windows/i.test(USER_AGENT2);
  53770. IS_IPAD$1 = /iPad/i.test(USER_AGENT2) || IS_SAFARI$1 && TOUCH_ENABLED$1 && !/iPhone/i.test(USER_AGENT2);
  53771. IS_IPHONE$1 = /iPhone/i.test(USER_AGENT2) && !IS_IPAD$1;
  53772. }
  53773. const IS_IOS$1 = IS_IPHONE$1 || IS_IPAD$1 || IS_IPOD$1;
  53774. const IS_ANY_SAFARI$1 = (IS_SAFARI$1 || IS_IOS$1) && !IS_CHROME$1;
  53775. var browser$1 = /* @__PURE__ */ Object.freeze({
  53776. __proto__: null,
  53777. get IS_IPOD() {
  53778. return IS_IPOD$1;
  53779. },
  53780. get IOS_VERSION() {
  53781. return IOS_VERSION$1;
  53782. },
  53783. get IS_ANDROID() {
  53784. return IS_ANDROID$1;
  53785. },
  53786. get ANDROID_VERSION() {
  53787. return ANDROID_VERSION$1;
  53788. },
  53789. get IS_FIREFOX() {
  53790. return IS_FIREFOX$1;
  53791. },
  53792. get IS_EDGE() {
  53793. return IS_EDGE$1;
  53794. },
  53795. get IS_CHROMIUM() {
  53796. return IS_CHROMIUM;
  53797. },
  53798. get IS_CHROME() {
  53799. return IS_CHROME$1;
  53800. },
  53801. get CHROMIUM_VERSION() {
  53802. return CHROMIUM_VERSION;
  53803. },
  53804. get CHROME_VERSION() {
  53805. return CHROME_VERSION$1;
  53806. },
  53807. get IE_VERSION() {
  53808. return IE_VERSION$1;
  53809. },
  53810. get IS_SAFARI() {
  53811. return IS_SAFARI$1;
  53812. },
  53813. get IS_WINDOWS() {
  53814. return IS_WINDOWS$1;
  53815. },
  53816. get IS_IPAD() {
  53817. return IS_IPAD$1;
  53818. },
  53819. get IS_IPHONE() {
  53820. return IS_IPHONE$1;
  53821. },
  53822. TOUCH_ENABLED: TOUCH_ENABLED$1,
  53823. IS_IOS: IS_IOS$1,
  53824. IS_ANY_SAFARI: IS_ANY_SAFARI$1
  53825. });
  53826. function isNonBlankString$1(str) {
  53827. return typeof str === "string" && Boolean(str.trim());
  53828. }
  53829. function throwIfWhitespace$1(str) {
  53830. if (str.indexOf(" ") >= 0) {
  53831. throw new Error("class has illegal whitespace characters");
  53832. }
  53833. }
  53834. function isReal$1() {
  53835. return document_1 === window_1.document;
  53836. }
  53837. function isEl$1(value) {
  53838. return isObject$2(value) && value.nodeType === 1;
  53839. }
  53840. function isInFrame$1() {
  53841. try {
  53842. return window_1.parent !== window_1.self;
  53843. } catch (x) {
  53844. return true;
  53845. }
  53846. }
  53847. function createQuerier$1(method) {
  53848. return function(selector, context) {
  53849. if (!isNonBlankString$1(selector)) {
  53850. return document_1[method](null);
  53851. }
  53852. if (isNonBlankString$1(context)) {
  53853. context = document_1.querySelector(context);
  53854. }
  53855. const ctx = isEl$1(context) ? context : document_1;
  53856. return ctx[method] && ctx[method](selector);
  53857. };
  53858. }
  53859. function createEl$1(tagName = "div", properties = {}, attributes = {}, content) {
  53860. const el = document_1.createElement(tagName);
  53861. Object.getOwnPropertyNames(properties).forEach(function(propName) {
  53862. const val = properties[propName];
  53863. if (propName === "textContent") {
  53864. textContent$1(el, val);
  53865. } else if (el[propName] !== val || propName === "tabIndex") {
  53866. el[propName] = val;
  53867. }
  53868. });
  53869. Object.getOwnPropertyNames(attributes).forEach(function(attrName) {
  53870. el.setAttribute(attrName, attributes[attrName]);
  53871. });
  53872. if (content) {
  53873. appendContent$1(el, content);
  53874. }
  53875. return el;
  53876. }
  53877. function textContent$1(el, text) {
  53878. if (typeof el.textContent === "undefined") {
  53879. el.innerText = text;
  53880. } else {
  53881. el.textContent = text;
  53882. }
  53883. return el;
  53884. }
  53885. function prependTo$1(child, parent) {
  53886. if (parent.firstChild) {
  53887. parent.insertBefore(child, parent.firstChild);
  53888. } else {
  53889. parent.appendChild(child);
  53890. }
  53891. }
  53892. function hasClass$1(element, classToCheck) {
  53893. throwIfWhitespace$1(classToCheck);
  53894. return element.classList.contains(classToCheck);
  53895. }
  53896. function addClass$1(element, ...classesToAdd) {
  53897. element.classList.add(...classesToAdd.reduce((prev, current) => prev.concat(current.split(/\s+/)), []));
  53898. return element;
  53899. }
  53900. function removeClass$1(element, ...classesToRemove) {
  53901. if (!element) {
  53902. log$1$1.warn("removeClass was called with an element that doesn't exist");
  53903. return null;
  53904. }
  53905. element.classList.remove(...classesToRemove.reduce((prev, current) => prev.concat(current.split(/\s+/)), []));
  53906. return element;
  53907. }
  53908. function toggleClass$1(element, classToToggle, predicate) {
  53909. if (typeof predicate === "function") {
  53910. predicate = predicate(element, classToToggle);
  53911. }
  53912. if (typeof predicate !== "boolean") {
  53913. predicate = void 0;
  53914. }
  53915. classToToggle.split(/\s+/).forEach((className) => element.classList.toggle(className, predicate));
  53916. return element;
  53917. }
  53918. function setAttributes$1(el, attributes) {
  53919. Object.getOwnPropertyNames(attributes).forEach(function(attrName) {
  53920. const attrValue = attributes[attrName];
  53921. if (attrValue === null || typeof attrValue === "undefined" || attrValue === false) {
  53922. el.removeAttribute(attrName);
  53923. } else {
  53924. el.setAttribute(attrName, attrValue === true ? "" : attrValue);
  53925. }
  53926. });
  53927. }
  53928. function getAttributes$1(tag) {
  53929. const obj = {};
  53930. const knownBooleans = ",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";
  53931. if (tag && tag.attributes && tag.attributes.length > 0) {
  53932. const attrs = tag.attributes;
  53933. for (let i2 = attrs.length - 1; i2 >= 0; i2--) {
  53934. const attrName = attrs[i2].name;
  53935. let attrVal = attrs[i2].value;
  53936. if (typeof tag[attrName] === "boolean" || knownBooleans.indexOf("," + attrName + ",") !== -1) {
  53937. attrVal = attrVal !== null ? true : false;
  53938. }
  53939. obj[attrName] = attrVal;
  53940. }
  53941. }
  53942. return obj;
  53943. }
  53944. function getAttribute$1(el, attribute) {
  53945. return el.getAttribute(attribute);
  53946. }
  53947. function setAttribute$1(el, attribute, value) {
  53948. el.setAttribute(attribute, value);
  53949. }
  53950. function removeAttribute$1(el, attribute) {
  53951. el.removeAttribute(attribute);
  53952. }
  53953. function blockTextSelection$1() {
  53954. document_1.body.focus();
  53955. document_1.onselectstart = function() {
  53956. return false;
  53957. };
  53958. }
  53959. function unblockTextSelection$1() {
  53960. document_1.onselectstart = function() {
  53961. return true;
  53962. };
  53963. }
  53964. function getBoundingClientRect$1(el) {
  53965. if (el && el.getBoundingClientRect && el.parentNode) {
  53966. const rect = el.getBoundingClientRect();
  53967. const result = {};
  53968. ["bottom", "height", "left", "right", "top", "width"].forEach((k) => {
  53969. if (rect[k] !== void 0) {
  53970. result[k] = rect[k];
  53971. }
  53972. });
  53973. if (!result.height) {
  53974. result.height = parseFloat(computedStyle$1(el, "height"));
  53975. }
  53976. if (!result.width) {
  53977. result.width = parseFloat(computedStyle$1(el, "width"));
  53978. }
  53979. return result;
  53980. }
  53981. }
  53982. function findPosition$1(el) {
  53983. if (!el || el && !el.offsetParent) {
  53984. return {
  53985. left: 0,
  53986. top: 0,
  53987. width: 0,
  53988. height: 0
  53989. };
  53990. }
  53991. const width2 = el.offsetWidth;
  53992. const height2 = el.offsetHeight;
  53993. let left = 0;
  53994. let top = 0;
  53995. while (el.offsetParent && el !== document_1[FullscreenApi$1.fullscreenElement]) {
  53996. left += el.offsetLeft;
  53997. top += el.offsetTop;
  53998. el = el.offsetParent;
  53999. }
  54000. return {
  54001. left,
  54002. top,
  54003. width: width2,
  54004. height: height2
  54005. };
  54006. }
  54007. function getPointerPosition$1(el, event2) {
  54008. const translated = {
  54009. x: 0,
  54010. y: 0
  54011. };
  54012. if (IS_IOS$1) {
  54013. let item = el;
  54014. while (item && item.nodeName.toLowerCase() !== "html") {
  54015. const transform3 = computedStyle$1(item, "transform");
  54016. if (/^matrix/.test(transform3)) {
  54017. const values3 = transform3.slice(7, -1).split(/,\s/).map(Number);
  54018. translated.x += values3[4];
  54019. translated.y += values3[5];
  54020. } else if (/^matrix3d/.test(transform3)) {
  54021. const values3 = transform3.slice(9, -1).split(/,\s/).map(Number);
  54022. translated.x += values3[12];
  54023. translated.y += values3[13];
  54024. }
  54025. item = item.parentNode;
  54026. }
  54027. }
  54028. const position2 = {};
  54029. const boxTarget = findPosition$1(event2.target);
  54030. const box = findPosition$1(el);
  54031. const boxW = box.width;
  54032. const boxH = box.height;
  54033. let offsetY = event2.offsetY - (box.top - boxTarget.top);
  54034. let offsetX = event2.offsetX - (box.left - boxTarget.left);
  54035. if (event2.changedTouches) {
  54036. offsetX = event2.changedTouches[0].pageX - box.left;
  54037. offsetY = event2.changedTouches[0].pageY + box.top;
  54038. if (IS_IOS$1) {
  54039. offsetX -= translated.x;
  54040. offsetY -= translated.y;
  54041. }
  54042. }
  54043. position2.y = 1 - Math.max(0, Math.min(1, offsetY / boxH));
  54044. position2.x = Math.max(0, Math.min(1, offsetX / boxW));
  54045. return position2;
  54046. }
  54047. function isTextNode$1(value) {
  54048. return isObject$2(value) && value.nodeType === 3;
  54049. }
  54050. function emptyEl$1(el) {
  54051. while (el.firstChild) {
  54052. el.removeChild(el.firstChild);
  54053. }
  54054. return el;
  54055. }
  54056. function normalizeContent$1(content) {
  54057. if (typeof content === "function") {
  54058. content = content();
  54059. }
  54060. return (Array.isArray(content) ? content : [content]).map((value) => {
  54061. if (typeof value === "function") {
  54062. value = value();
  54063. }
  54064. if (isEl$1(value) || isTextNode$1(value)) {
  54065. return value;
  54066. }
  54067. if (typeof value === "string" && /\S/.test(value)) {
  54068. return document_1.createTextNode(value);
  54069. }
  54070. }).filter((value) => value);
  54071. }
  54072. function appendContent$1(el, content) {
  54073. normalizeContent$1(content).forEach((node) => el.appendChild(node));
  54074. return el;
  54075. }
  54076. function insertContent$1(el, content) {
  54077. return appendContent$1(emptyEl$1(el), content);
  54078. }
  54079. function isSingleLeftClick$1(event2) {
  54080. if (event2.button === void 0 && event2.buttons === void 0) {
  54081. return true;
  54082. }
  54083. if (event2.button === 0 && event2.buttons === void 0) {
  54084. return true;
  54085. }
  54086. if (event2.type === "mouseup" && event2.button === 0 && event2.buttons === 0) {
  54087. return true;
  54088. }
  54089. if (event2.button !== 0 || event2.buttons !== 1) {
  54090. return false;
  54091. }
  54092. return true;
  54093. }
  54094. const $$1 = createQuerier$1("querySelector");
  54095. const $$$1 = createQuerier$1("querySelectorAll");
  54096. function computedStyle$1(el, prop) {
  54097. if (!el || !prop) {
  54098. return "";
  54099. }
  54100. if (typeof window_1.getComputedStyle === "function") {
  54101. let computedStyleValue;
  54102. try {
  54103. computedStyleValue = window_1.getComputedStyle(el);
  54104. } catch (e) {
  54105. return "";
  54106. }
  54107. return computedStyleValue ? computedStyleValue.getPropertyValue(prop) || computedStyleValue[prop] : "";
  54108. }
  54109. return "";
  54110. }
  54111. var Dom$2 = /* @__PURE__ */ Object.freeze({
  54112. __proto__: null,
  54113. isReal: isReal$1,
  54114. isEl: isEl$1,
  54115. isInFrame: isInFrame$1,
  54116. createEl: createEl$1,
  54117. textContent: textContent$1,
  54118. prependTo: prependTo$1,
  54119. hasClass: hasClass$1,
  54120. addClass: addClass$1,
  54121. removeClass: removeClass$1,
  54122. toggleClass: toggleClass$1,
  54123. setAttributes: setAttributes$1,
  54124. getAttributes: getAttributes$1,
  54125. getAttribute: getAttribute$1,
  54126. setAttribute: setAttribute$1,
  54127. removeAttribute: removeAttribute$1,
  54128. blockTextSelection: blockTextSelection$1,
  54129. unblockTextSelection: unblockTextSelection$1,
  54130. getBoundingClientRect: getBoundingClientRect$1,
  54131. findPosition: findPosition$1,
  54132. getPointerPosition: getPointerPosition$1,
  54133. isTextNode: isTextNode$1,
  54134. emptyEl: emptyEl$1,
  54135. normalizeContent: normalizeContent$1,
  54136. appendContent: appendContent$1,
  54137. insertContent: insertContent$1,
  54138. isSingleLeftClick: isSingleLeftClick$1,
  54139. $: $$1,
  54140. $$: $$$1,
  54141. computedStyle: computedStyle$1
  54142. });
  54143. let _windowLoaded$1 = false;
  54144. let videojs$1$1;
  54145. const autoSetup$1 = function() {
  54146. if (videojs$1$1.options.autoSetup === false) {
  54147. return;
  54148. }
  54149. const vids = Array.prototype.slice.call(document_1.getElementsByTagName("video"));
  54150. const audios = Array.prototype.slice.call(document_1.getElementsByTagName("audio"));
  54151. const divs = Array.prototype.slice.call(document_1.getElementsByTagName("video-js"));
  54152. const mediaEls = vids.concat(audios, divs);
  54153. if (mediaEls && mediaEls.length > 0) {
  54154. for (let i2 = 0, e = mediaEls.length; i2 < e; i2++) {
  54155. const mediaEl = mediaEls[i2];
  54156. if (mediaEl && mediaEl.getAttribute) {
  54157. if (mediaEl.player === void 0) {
  54158. const options2 = mediaEl.getAttribute("data-setup");
  54159. if (options2 !== null) {
  54160. videojs$1$1(mediaEl);
  54161. }
  54162. }
  54163. } else {
  54164. autoSetupTimeout$1(1);
  54165. break;
  54166. }
  54167. }
  54168. } else if (!_windowLoaded$1) {
  54169. autoSetupTimeout$1(1);
  54170. }
  54171. };
  54172. function autoSetupTimeout$1(wait, vjs) {
  54173. if (!isReal$1()) {
  54174. return;
  54175. }
  54176. if (vjs) {
  54177. videojs$1$1 = vjs;
  54178. }
  54179. window_1.setTimeout(autoSetup$1, wait);
  54180. }
  54181. function setWindowLoaded$1() {
  54182. _windowLoaded$1 = true;
  54183. window_1.removeEventListener("load", setWindowLoaded$1);
  54184. }
  54185. if (isReal$1()) {
  54186. if (document_1.readyState === "complete") {
  54187. setWindowLoaded$1();
  54188. } else {
  54189. window_1.addEventListener("load", setWindowLoaded$1);
  54190. }
  54191. }
  54192. const createStyleElement$1 = function(className) {
  54193. const style = document_1.createElement("style");
  54194. style.className = className;
  54195. return style;
  54196. };
  54197. const setTextContent$1 = function(el, content) {
  54198. if (el.styleSheet) {
  54199. el.styleSheet.cssText = content;
  54200. } else {
  54201. el.textContent = content;
  54202. }
  54203. };
  54204. var DomData$1 = /* @__PURE__ */ new WeakMap();
  54205. const _initialGuid$1 = 3;
  54206. let _guid$1 = _initialGuid$1;
  54207. function newGUID$1() {
  54208. return _guid$1++;
  54209. }
  54210. function _cleanUpEvents$1(elem, type2) {
  54211. if (!DomData$1.has(elem)) {
  54212. return;
  54213. }
  54214. const data = DomData$1.get(elem);
  54215. if (data.handlers[type2].length === 0) {
  54216. delete data.handlers[type2];
  54217. if (elem.removeEventListener) {
  54218. elem.removeEventListener(type2, data.dispatcher, false);
  54219. } else if (elem.detachEvent) {
  54220. elem.detachEvent("on" + type2, data.dispatcher);
  54221. }
  54222. }
  54223. if (Object.getOwnPropertyNames(data.handlers).length <= 0) {
  54224. delete data.handlers;
  54225. delete data.dispatcher;
  54226. delete data.disabled;
  54227. }
  54228. if (Object.getOwnPropertyNames(data).length === 0) {
  54229. DomData$1.delete(elem);
  54230. }
  54231. }
  54232. function _handleMultipleEvents$1(fn2, elem, types, callback2) {
  54233. types.forEach(function(type2) {
  54234. fn2(elem, type2, callback2);
  54235. });
  54236. }
  54237. function fixEvent$1(event2) {
  54238. if (event2.fixed_) {
  54239. return event2;
  54240. }
  54241. function returnTrue() {
  54242. return true;
  54243. }
  54244. function returnFalse() {
  54245. return false;
  54246. }
  54247. if (!event2 || !event2.isPropagationStopped || !event2.isImmediatePropagationStopped) {
  54248. const old = event2 || window_1.event;
  54249. event2 = {};
  54250. for (const key in old) {
  54251. if (key !== "layerX" && key !== "layerY" && key !== "keyLocation" && key !== "webkitMovementX" && key !== "webkitMovementY" && key !== "path") {
  54252. if (!(key === "returnValue" && old.preventDefault)) {
  54253. event2[key] = old[key];
  54254. }
  54255. }
  54256. }
  54257. if (!event2.target) {
  54258. event2.target = event2.srcElement || document_1;
  54259. }
  54260. if (!event2.relatedTarget) {
  54261. event2.relatedTarget = event2.fromElement === event2.target ? event2.toElement : event2.fromElement;
  54262. }
  54263. event2.preventDefault = function() {
  54264. if (old.preventDefault) {
  54265. old.preventDefault();
  54266. }
  54267. event2.returnValue = false;
  54268. old.returnValue = false;
  54269. event2.defaultPrevented = true;
  54270. };
  54271. event2.defaultPrevented = false;
  54272. event2.stopPropagation = function() {
  54273. if (old.stopPropagation) {
  54274. old.stopPropagation();
  54275. }
  54276. event2.cancelBubble = true;
  54277. old.cancelBubble = true;
  54278. event2.isPropagationStopped = returnTrue;
  54279. };
  54280. event2.isPropagationStopped = returnFalse;
  54281. event2.stopImmediatePropagation = function() {
  54282. if (old.stopImmediatePropagation) {
  54283. old.stopImmediatePropagation();
  54284. }
  54285. event2.isImmediatePropagationStopped = returnTrue;
  54286. event2.stopPropagation();
  54287. };
  54288. event2.isImmediatePropagationStopped = returnFalse;
  54289. if (event2.clientX !== null && event2.clientX !== void 0) {
  54290. const doc = document_1.documentElement;
  54291. const body = document_1.body;
  54292. event2.pageX = event2.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
  54293. event2.pageY = event2.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
  54294. }
  54295. event2.which = event2.charCode || event2.keyCode;
  54296. if (event2.button !== null && event2.button !== void 0) {
  54297. event2.button = event2.button & 1 ? 0 : event2.button & 4 ? 1 : event2.button & 2 ? 2 : 0;
  54298. }
  54299. }
  54300. event2.fixed_ = true;
  54301. return event2;
  54302. }
  54303. let _supportsPassive$1;
  54304. const supportsPassive$1 = function() {
  54305. if (typeof _supportsPassive$1 !== "boolean") {
  54306. _supportsPassive$1 = false;
  54307. try {
  54308. const opts = Object.defineProperty({}, "passive", {
  54309. get() {
  54310. _supportsPassive$1 = true;
  54311. }
  54312. });
  54313. window_1.addEventListener("test", null, opts);
  54314. window_1.removeEventListener("test", null, opts);
  54315. } catch (e) {
  54316. }
  54317. }
  54318. return _supportsPassive$1;
  54319. };
  54320. const passiveEvents$1 = ["touchstart", "touchmove"];
  54321. function on$1(elem, type2, fn2) {
  54322. if (Array.isArray(type2)) {
  54323. return _handleMultipleEvents$1(on$1, elem, type2, fn2);
  54324. }
  54325. if (!DomData$1.has(elem)) {
  54326. DomData$1.set(elem, {});
  54327. }
  54328. const data = DomData$1.get(elem);
  54329. if (!data.handlers) {
  54330. data.handlers = {};
  54331. }
  54332. if (!data.handlers[type2]) {
  54333. data.handlers[type2] = [];
  54334. }
  54335. if (!fn2.guid) {
  54336. fn2.guid = newGUID$1();
  54337. }
  54338. data.handlers[type2].push(fn2);
  54339. if (!data.dispatcher) {
  54340. data.disabled = false;
  54341. data.dispatcher = function(event2, hash) {
  54342. if (data.disabled) {
  54343. return;
  54344. }
  54345. event2 = fixEvent$1(event2);
  54346. const handlers = data.handlers[event2.type];
  54347. if (handlers) {
  54348. const handlersCopy = handlers.slice(0);
  54349. for (let m = 0, n = handlersCopy.length; m < n; m++) {
  54350. if (event2.isImmediatePropagationStopped()) {
  54351. break;
  54352. } else {
  54353. try {
  54354. handlersCopy[m].call(elem, event2, hash);
  54355. } catch (e) {
  54356. log$1$1.error(e);
  54357. }
  54358. }
  54359. }
  54360. }
  54361. };
  54362. }
  54363. if (data.handlers[type2].length === 1) {
  54364. if (elem.addEventListener) {
  54365. let options2 = false;
  54366. if (supportsPassive$1() && passiveEvents$1.indexOf(type2) > -1) {
  54367. options2 = {
  54368. passive: true
  54369. };
  54370. }
  54371. elem.addEventListener(type2, data.dispatcher, options2);
  54372. } else if (elem.attachEvent) {
  54373. elem.attachEvent("on" + type2, data.dispatcher);
  54374. }
  54375. }
  54376. }
  54377. function off$1(elem, type2, fn2) {
  54378. if (!DomData$1.has(elem)) {
  54379. return;
  54380. }
  54381. const data = DomData$1.get(elem);
  54382. if (!data.handlers) {
  54383. return;
  54384. }
  54385. if (Array.isArray(type2)) {
  54386. return _handleMultipleEvents$1(off$1, elem, type2, fn2);
  54387. }
  54388. const removeType = function(el, t2) {
  54389. data.handlers[t2] = [];
  54390. _cleanUpEvents$1(el, t2);
  54391. };
  54392. if (type2 === void 0) {
  54393. for (const t2 in data.handlers) {
  54394. if (Object.prototype.hasOwnProperty.call(data.handlers || {}, t2)) {
  54395. removeType(elem, t2);
  54396. }
  54397. }
  54398. return;
  54399. }
  54400. const handlers = data.handlers[type2];
  54401. if (!handlers) {
  54402. return;
  54403. }
  54404. if (!fn2) {
  54405. removeType(elem, type2);
  54406. return;
  54407. }
  54408. if (fn2.guid) {
  54409. for (let n = 0; n < handlers.length; n++) {
  54410. if (handlers[n].guid === fn2.guid) {
  54411. handlers.splice(n--, 1);
  54412. }
  54413. }
  54414. }
  54415. _cleanUpEvents$1(elem, type2);
  54416. }
  54417. function trigger$1(elem, event2, hash) {
  54418. const elemData = DomData$1.has(elem) ? DomData$1.get(elem) : {};
  54419. const parent = elem.parentNode || elem.ownerDocument;
  54420. if (typeof event2 === "string") {
  54421. event2 = {
  54422. type: event2,
  54423. target: elem
  54424. };
  54425. } else if (!event2.target) {
  54426. event2.target = elem;
  54427. }
  54428. event2 = fixEvent$1(event2);
  54429. if (elemData.dispatcher) {
  54430. elemData.dispatcher.call(elem, event2, hash);
  54431. }
  54432. if (parent && !event2.isPropagationStopped() && event2.bubbles === true) {
  54433. trigger$1.call(null, parent, event2, hash);
  54434. } else if (!parent && !event2.defaultPrevented && event2.target && event2.target[event2.type]) {
  54435. if (!DomData$1.has(event2.target)) {
  54436. DomData$1.set(event2.target, {});
  54437. }
  54438. const targetData = DomData$1.get(event2.target);
  54439. if (event2.target[event2.type]) {
  54440. targetData.disabled = true;
  54441. if (typeof event2.target[event2.type] === "function") {
  54442. event2.target[event2.type]();
  54443. }
  54444. targetData.disabled = false;
  54445. }
  54446. }
  54447. return !event2.defaultPrevented;
  54448. }
  54449. function one$1(elem, type2, fn2) {
  54450. if (Array.isArray(type2)) {
  54451. return _handleMultipleEvents$1(one$1, elem, type2, fn2);
  54452. }
  54453. const func = function() {
  54454. off$1(elem, type2, func);
  54455. fn2.apply(this, arguments);
  54456. };
  54457. func.guid = fn2.guid = fn2.guid || newGUID$1();
  54458. on$1(elem, type2, func);
  54459. }
  54460. function any$1(elem, type2, fn2) {
  54461. const func = function() {
  54462. off$1(elem, type2, func);
  54463. fn2.apply(this, arguments);
  54464. };
  54465. func.guid = fn2.guid = fn2.guid || newGUID$1();
  54466. on$1(elem, type2, func);
  54467. }
  54468. var Events$1 = /* @__PURE__ */ Object.freeze({
  54469. __proto__: null,
  54470. fixEvent: fixEvent$1,
  54471. on: on$1,
  54472. off: off$1,
  54473. trigger: trigger$1,
  54474. one: one$1,
  54475. any: any$1
  54476. });
  54477. const UPDATE_REFRESH_INTERVAL$1 = 30;
  54478. const bind_ = function(context, fn2, uid) {
  54479. if (!fn2.guid) {
  54480. fn2.guid = newGUID$1();
  54481. }
  54482. const bound = fn2.bind(context);
  54483. bound.guid = uid ? uid + "_" + fn2.guid : fn2.guid;
  54484. return bound;
  54485. };
  54486. const throttle$1 = function(fn2, wait) {
  54487. let last = window_1.performance.now();
  54488. const throttled = function(...args) {
  54489. const now2 = window_1.performance.now();
  54490. if (now2 - last >= wait) {
  54491. fn2(...args);
  54492. last = now2;
  54493. }
  54494. };
  54495. return throttled;
  54496. };
  54497. const debounce$1 = function(func, wait, immediate, context = window_1) {
  54498. let timeout;
  54499. const cancel = () => {
  54500. context.clearTimeout(timeout);
  54501. timeout = null;
  54502. };
  54503. const debounced = function() {
  54504. const self2 = this;
  54505. const args = arguments;
  54506. let later = function() {
  54507. timeout = null;
  54508. later = null;
  54509. if (!immediate) {
  54510. func.apply(self2, args);
  54511. }
  54512. };
  54513. if (!timeout && immediate) {
  54514. func.apply(self2, args);
  54515. }
  54516. context.clearTimeout(timeout);
  54517. timeout = context.setTimeout(later, wait);
  54518. };
  54519. debounced.cancel = cancel;
  54520. return debounced;
  54521. };
  54522. var Fn = /* @__PURE__ */ Object.freeze({
  54523. __proto__: null,
  54524. UPDATE_REFRESH_INTERVAL: UPDATE_REFRESH_INTERVAL$1,
  54525. bind_,
  54526. throttle: throttle$1,
  54527. debounce: debounce$1
  54528. });
  54529. let EVENT_MAP$1;
  54530. class EventTarget$2$1 {
  54531. on(type2, fn2) {
  54532. const ael = this.addEventListener;
  54533. this.addEventListener = () => {
  54534. };
  54535. on$1(this, type2, fn2);
  54536. this.addEventListener = ael;
  54537. }
  54538. off(type2, fn2) {
  54539. off$1(this, type2, fn2);
  54540. }
  54541. one(type2, fn2) {
  54542. const ael = this.addEventListener;
  54543. this.addEventListener = () => {
  54544. };
  54545. one$1(this, type2, fn2);
  54546. this.addEventListener = ael;
  54547. }
  54548. any(type2, fn2) {
  54549. const ael = this.addEventListener;
  54550. this.addEventListener = () => {
  54551. };
  54552. any$1(this, type2, fn2);
  54553. this.addEventListener = ael;
  54554. }
  54555. trigger(event2) {
  54556. const type2 = event2.type || event2;
  54557. if (typeof event2 === "string") {
  54558. event2 = {
  54559. type: type2
  54560. };
  54561. }
  54562. event2 = fixEvent$1(event2);
  54563. if (this.allowedEvents_[type2] && this["on" + type2]) {
  54564. this["on" + type2](event2);
  54565. }
  54566. trigger$1(this, event2);
  54567. }
  54568. queueTrigger(event2) {
  54569. if (!EVENT_MAP$1) {
  54570. EVENT_MAP$1 = /* @__PURE__ */ new Map();
  54571. }
  54572. const type2 = event2.type || event2;
  54573. let map = EVENT_MAP$1.get(this);
  54574. if (!map) {
  54575. map = /* @__PURE__ */ new Map();
  54576. EVENT_MAP$1.set(this, map);
  54577. }
  54578. const oldTimeout = map.get(type2);
  54579. map.delete(type2);
  54580. window_1.clearTimeout(oldTimeout);
  54581. const timeout = window_1.setTimeout(() => {
  54582. map.delete(type2);
  54583. if (map.size === 0) {
  54584. map = null;
  54585. EVENT_MAP$1.delete(this);
  54586. }
  54587. this.trigger(event2);
  54588. }, 0);
  54589. map.set(type2, timeout);
  54590. }
  54591. }
  54592. EventTarget$2$1.prototype.allowedEvents_ = {};
  54593. EventTarget$2$1.prototype.addEventListener = EventTarget$2$1.prototype.on;
  54594. EventTarget$2$1.prototype.removeEventListener = EventTarget$2$1.prototype.off;
  54595. EventTarget$2$1.prototype.dispatchEvent = EventTarget$2$1.prototype.trigger;
  54596. const objName$1 = (obj) => {
  54597. if (typeof obj.name === "function") {
  54598. return obj.name();
  54599. }
  54600. if (typeof obj.name === "string") {
  54601. return obj.name;
  54602. }
  54603. if (obj.name_) {
  54604. return obj.name_;
  54605. }
  54606. if (obj.constructor && obj.constructor.name) {
  54607. return obj.constructor.name;
  54608. }
  54609. return typeof obj;
  54610. };
  54611. const isEvented$1 = (object) => object instanceof EventTarget$2$1 || !!object.eventBusEl_ && ["on", "one", "off", "trigger"].every((k) => typeof object[k] === "function");
  54612. const addEventedCallback$1 = (target, callback2) => {
  54613. if (isEvented$1(target)) {
  54614. callback2();
  54615. } else {
  54616. if (!target.eventedCallbacks) {
  54617. target.eventedCallbacks = [];
  54618. }
  54619. target.eventedCallbacks.push(callback2);
  54620. }
  54621. };
  54622. const isValidEventType$1 = (type2) => typeof type2 === "string" && /\S/.test(type2) || Array.isArray(type2) && !!type2.length;
  54623. const validateTarget$1 = (target, obj, fnName) => {
  54624. if (!target || !target.nodeName && !isEvented$1(target)) {
  54625. throw new Error(`Invalid target for ${objName$1(obj)}#${fnName}; must be a DOM node or evented object.`);
  54626. }
  54627. };
  54628. const validateEventType$1 = (type2, obj, fnName) => {
  54629. if (!isValidEventType$1(type2)) {
  54630. throw new Error(`Invalid event type for ${objName$1(obj)}#${fnName}; must be a non-empty string or array.`);
  54631. }
  54632. };
  54633. const validateListener$1 = (listener, obj, fnName) => {
  54634. if (typeof listener !== "function") {
  54635. throw new Error(`Invalid listener for ${objName$1(obj)}#${fnName}; must be a function.`);
  54636. }
  54637. };
  54638. const normalizeListenArgs$1 = (self2, args, fnName) => {
  54639. const isTargetingSelf = args.length < 3 || args[0] === self2 || args[0] === self2.eventBusEl_;
  54640. let target;
  54641. let type2;
  54642. let listener;
  54643. if (isTargetingSelf) {
  54644. target = self2.eventBusEl_;
  54645. if (args.length >= 3) {
  54646. args.shift();
  54647. }
  54648. [type2, listener] = args;
  54649. } else {
  54650. [target, type2, listener] = args;
  54651. }
  54652. validateTarget$1(target, self2, fnName);
  54653. validateEventType$1(type2, self2, fnName);
  54654. validateListener$1(listener, self2, fnName);
  54655. listener = bind_(self2, listener);
  54656. return {
  54657. isTargetingSelf,
  54658. target,
  54659. type: type2,
  54660. listener
  54661. };
  54662. };
  54663. const listen$1 = (target, method, type2, listener) => {
  54664. validateTarget$1(target, target, method);
  54665. if (target.nodeName) {
  54666. Events$1[method](target, type2, listener);
  54667. } else {
  54668. target[method](type2, listener);
  54669. }
  54670. };
  54671. const EventedMixin$1 = {
  54672. on(...args) {
  54673. const {
  54674. isTargetingSelf,
  54675. target,
  54676. type: type2,
  54677. listener
  54678. } = normalizeListenArgs$1(this, args, "on");
  54679. listen$1(target, "on", type2, listener);
  54680. if (!isTargetingSelf) {
  54681. const removeListenerOnDispose = () => this.off(target, type2, listener);
  54682. removeListenerOnDispose.guid = listener.guid;
  54683. const removeRemoverOnTargetDispose = () => this.off("dispose", removeListenerOnDispose);
  54684. removeRemoverOnTargetDispose.guid = listener.guid;
  54685. listen$1(this, "on", "dispose", removeListenerOnDispose);
  54686. listen$1(target, "on", "dispose", removeRemoverOnTargetDispose);
  54687. }
  54688. },
  54689. one(...args) {
  54690. const {
  54691. isTargetingSelf,
  54692. target,
  54693. type: type2,
  54694. listener
  54695. } = normalizeListenArgs$1(this, args, "one");
  54696. if (isTargetingSelf) {
  54697. listen$1(target, "one", type2, listener);
  54698. } else {
  54699. const wrapper = (...largs) => {
  54700. this.off(target, type2, wrapper);
  54701. listener.apply(null, largs);
  54702. };
  54703. wrapper.guid = listener.guid;
  54704. listen$1(target, "one", type2, wrapper);
  54705. }
  54706. },
  54707. any(...args) {
  54708. const {
  54709. isTargetingSelf,
  54710. target,
  54711. type: type2,
  54712. listener
  54713. } = normalizeListenArgs$1(this, args, "any");
  54714. if (isTargetingSelf) {
  54715. listen$1(target, "any", type2, listener);
  54716. } else {
  54717. const wrapper = (...largs) => {
  54718. this.off(target, type2, wrapper);
  54719. listener.apply(null, largs);
  54720. };
  54721. wrapper.guid = listener.guid;
  54722. listen$1(target, "any", type2, wrapper);
  54723. }
  54724. },
  54725. off(targetOrType, typeOrListener, listener) {
  54726. if (!targetOrType || isValidEventType$1(targetOrType)) {
  54727. off$1(this.eventBusEl_, targetOrType, typeOrListener);
  54728. } else {
  54729. const target = targetOrType;
  54730. const type2 = typeOrListener;
  54731. validateTarget$1(target, this, "off");
  54732. validateEventType$1(type2, this, "off");
  54733. validateListener$1(listener, this, "off");
  54734. listener = bind_(this, listener);
  54735. this.off("dispose", listener);
  54736. if (target.nodeName) {
  54737. off$1(target, type2, listener);
  54738. off$1(target, "dispose", listener);
  54739. } else if (isEvented$1(target)) {
  54740. target.off(type2, listener);
  54741. target.off("dispose", listener);
  54742. }
  54743. }
  54744. },
  54745. trigger(event2, hash) {
  54746. validateTarget$1(this.eventBusEl_, this, "trigger");
  54747. const type2 = event2 && typeof event2 !== "string" ? event2.type : event2;
  54748. if (!isValidEventType$1(type2)) {
  54749. throw new Error(`Invalid event type for ${objName$1(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);
  54750. }
  54751. return trigger$1(this.eventBusEl_, event2, hash);
  54752. }
  54753. };
  54754. function evented$1(target, options2 = {}) {
  54755. const {
  54756. eventBusKey
  54757. } = options2;
  54758. if (eventBusKey) {
  54759. if (!target[eventBusKey].nodeName) {
  54760. throw new Error(`The eventBusKey "${eventBusKey}" does not refer to an element.`);
  54761. }
  54762. target.eventBusEl_ = target[eventBusKey];
  54763. } else {
  54764. target.eventBusEl_ = createEl$1("span", {
  54765. className: "vjs-event-bus"
  54766. });
  54767. }
  54768. Object.assign(target, EventedMixin$1);
  54769. if (target.eventedCallbacks) {
  54770. target.eventedCallbacks.forEach((callback2) => {
  54771. callback2();
  54772. });
  54773. }
  54774. target.on("dispose", () => {
  54775. target.off();
  54776. [target, target.el_, target.eventBusEl_].forEach(function(val) {
  54777. if (val && DomData$1.has(val)) {
  54778. DomData$1.delete(val);
  54779. }
  54780. });
  54781. window_1.setTimeout(() => {
  54782. target.eventBusEl_ = null;
  54783. }, 0);
  54784. });
  54785. return target;
  54786. }
  54787. const StatefulMixin$1 = {
  54788. state: {},
  54789. setState(stateUpdates) {
  54790. if (typeof stateUpdates === "function") {
  54791. stateUpdates = stateUpdates();
  54792. }
  54793. let changes;
  54794. each$1(stateUpdates, (value, key) => {
  54795. if (this.state[key] !== value) {
  54796. changes = changes || {};
  54797. changes[key] = {
  54798. from: this.state[key],
  54799. to: value
  54800. };
  54801. }
  54802. this.state[key] = value;
  54803. });
  54804. if (changes && isEvented$1(this)) {
  54805. this.trigger({
  54806. changes,
  54807. type: "statechanged"
  54808. });
  54809. }
  54810. return changes;
  54811. }
  54812. };
  54813. function stateful$1(target, defaultState) {
  54814. Object.assign(target, StatefulMixin$1);
  54815. target.state = Object.assign({}, target.state, defaultState);
  54816. if (typeof target.handleStateChanged === "function" && isEvented$1(target)) {
  54817. target.on("statechanged", target.handleStateChanged);
  54818. }
  54819. return target;
  54820. }
  54821. const toLowerCase$1 = function(string) {
  54822. if (typeof string !== "string") {
  54823. return string;
  54824. }
  54825. return string.replace(/./, (w) => w.toLowerCase());
  54826. };
  54827. const toTitleCase$1$1 = function(string) {
  54828. if (typeof string !== "string") {
  54829. return string;
  54830. }
  54831. return string.replace(/./, (w) => w.toUpperCase());
  54832. };
  54833. const titleCaseEquals$1 = function(str1, str2) {
  54834. return toTitleCase$1$1(str1) === toTitleCase$1$1(str2);
  54835. };
  54836. var Str = /* @__PURE__ */ Object.freeze({
  54837. __proto__: null,
  54838. toLowerCase: toLowerCase$1,
  54839. toTitleCase: toTitleCase$1$1,
  54840. titleCaseEquals: titleCaseEquals$1
  54841. });
  54842. class Component$1$1 {
  54843. constructor(player, options2, ready) {
  54844. if (!player && this.play) {
  54845. this.player_ = player = this;
  54846. } else {
  54847. this.player_ = player;
  54848. }
  54849. this.isDisposed_ = false;
  54850. this.parentComponent_ = null;
  54851. this.options_ = merge$1({}, this.options_);
  54852. options2 = this.options_ = merge$1(this.options_, options2);
  54853. this.id_ = options2.id || options2.el && options2.el.id;
  54854. if (!this.id_) {
  54855. const id = player && player.id && player.id() || "no_player";
  54856. this.id_ = `${id}_component_${newGUID$1()}`;
  54857. }
  54858. this.name_ = options2.name || null;
  54859. if (options2.el) {
  54860. this.el_ = options2.el;
  54861. } else if (options2.createEl !== false) {
  54862. this.el_ = this.createEl();
  54863. }
  54864. if (options2.className && this.el_) {
  54865. options2.className.split(" ").forEach((c) => this.addClass(c));
  54866. }
  54867. ["on", "off", "one", "any", "trigger"].forEach((fn2) => {
  54868. this[fn2] = void 0;
  54869. });
  54870. if (options2.evented !== false) {
  54871. evented$1(this, {
  54872. eventBusKey: this.el_ ? "el_" : null
  54873. });
  54874. this.handleLanguagechange = this.handleLanguagechange.bind(this);
  54875. this.on(this.player_, "languagechange", this.handleLanguagechange);
  54876. }
  54877. stateful$1(this, this.constructor.defaultState);
  54878. this.children_ = [];
  54879. this.childIndex_ = {};
  54880. this.childNameIndex_ = {};
  54881. this.setTimeoutIds_ = /* @__PURE__ */ new Set();
  54882. this.setIntervalIds_ = /* @__PURE__ */ new Set();
  54883. this.rafIds_ = /* @__PURE__ */ new Set();
  54884. this.namedRafs_ = /* @__PURE__ */ new Map();
  54885. this.clearingTimersOnDispose_ = false;
  54886. if (options2.initChildren !== false) {
  54887. this.initChildren();
  54888. }
  54889. this.ready(ready);
  54890. if (options2.reportTouchActivity !== false) {
  54891. this.enableTouchActivity();
  54892. }
  54893. }
  54894. on(type2, fn2) {
  54895. }
  54896. off(type2, fn2) {
  54897. }
  54898. one(type2, fn2) {
  54899. }
  54900. any(type2, fn2) {
  54901. }
  54902. trigger(event2) {
  54903. }
  54904. dispose(options2 = {}) {
  54905. if (this.isDisposed_) {
  54906. return;
  54907. }
  54908. if (this.readyQueue_) {
  54909. this.readyQueue_.length = 0;
  54910. }
  54911. this.trigger({
  54912. type: "dispose",
  54913. bubbles: false
  54914. });
  54915. this.isDisposed_ = true;
  54916. if (this.children_) {
  54917. for (let i2 = this.children_.length - 1; i2 >= 0; i2--) {
  54918. if (this.children_[i2].dispose) {
  54919. this.children_[i2].dispose();
  54920. }
  54921. }
  54922. }
  54923. this.children_ = null;
  54924. this.childIndex_ = null;
  54925. this.childNameIndex_ = null;
  54926. this.parentComponent_ = null;
  54927. if (this.el_) {
  54928. if (this.el_.parentNode) {
  54929. if (options2.restoreEl) {
  54930. this.el_.parentNode.replaceChild(options2.restoreEl, this.el_);
  54931. } else {
  54932. this.el_.parentNode.removeChild(this.el_);
  54933. }
  54934. }
  54935. this.el_ = null;
  54936. }
  54937. this.player_ = null;
  54938. }
  54939. isDisposed() {
  54940. return Boolean(this.isDisposed_);
  54941. }
  54942. player() {
  54943. return this.player_;
  54944. }
  54945. options(obj) {
  54946. if (!obj) {
  54947. return this.options_;
  54948. }
  54949. this.options_ = merge$1(this.options_, obj);
  54950. return this.options_;
  54951. }
  54952. el() {
  54953. return this.el_;
  54954. }
  54955. createEl(tagName, properties, attributes) {
  54956. return createEl$1(tagName, properties, attributes);
  54957. }
  54958. localize(string, tokens, defaultValue2 = string) {
  54959. const code = this.player_.language && this.player_.language();
  54960. const languages = this.player_.languages && this.player_.languages();
  54961. const language = languages && languages[code];
  54962. const primaryCode = code && code.split("-")[0];
  54963. const primaryLang = languages && languages[primaryCode];
  54964. let localizedString = defaultValue2;
  54965. if (language && language[string]) {
  54966. localizedString = language[string];
  54967. } else if (primaryLang && primaryLang[string]) {
  54968. localizedString = primaryLang[string];
  54969. }
  54970. if (tokens) {
  54971. localizedString = localizedString.replace(/\{(\d+)\}/g, function(match, index2) {
  54972. const value = tokens[index2 - 1];
  54973. let ret = value;
  54974. if (typeof value === "undefined") {
  54975. ret = match;
  54976. }
  54977. return ret;
  54978. });
  54979. }
  54980. return localizedString;
  54981. }
  54982. handleLanguagechange() {
  54983. }
  54984. contentEl() {
  54985. return this.contentEl_ || this.el_;
  54986. }
  54987. id() {
  54988. return this.id_;
  54989. }
  54990. name() {
  54991. return this.name_;
  54992. }
  54993. children() {
  54994. return this.children_;
  54995. }
  54996. getChildById(id) {
  54997. return this.childIndex_[id];
  54998. }
  54999. getChild(name) {
  55000. if (!name) {
  55001. return;
  55002. }
  55003. return this.childNameIndex_[name];
  55004. }
  55005. getDescendant(...names2) {
  55006. names2 = names2.reduce((acc, n) => acc.concat(n), []);
  55007. let currentChild = this;
  55008. for (let i2 = 0; i2 < names2.length; i2++) {
  55009. currentChild = currentChild.getChild(names2[i2]);
  55010. if (!currentChild || !currentChild.getChild) {
  55011. return;
  55012. }
  55013. }
  55014. return currentChild;
  55015. }
  55016. addChild(child, options2 = {}, index2 = this.children_.length) {
  55017. let component;
  55018. let componentName;
  55019. if (typeof child === "string") {
  55020. componentName = toTitleCase$1$1(child);
  55021. const componentClassName = options2.componentClass || componentName;
  55022. options2.name = componentName;
  55023. const ComponentClass = Component$1$1.getComponent(componentClassName);
  55024. if (!ComponentClass) {
  55025. throw new Error(`Component ${componentClassName} does not exist`);
  55026. }
  55027. if (typeof ComponentClass !== "function") {
  55028. return null;
  55029. }
  55030. component = new ComponentClass(this.player_ || this, options2);
  55031. } else {
  55032. component = child;
  55033. }
  55034. if (component.parentComponent_) {
  55035. component.parentComponent_.removeChild(component);
  55036. }
  55037. this.children_.splice(index2, 0, component);
  55038. component.parentComponent_ = this;
  55039. if (typeof component.id === "function") {
  55040. this.childIndex_[component.id()] = component;
  55041. }
  55042. componentName = componentName || component.name && toTitleCase$1$1(component.name());
  55043. if (componentName) {
  55044. this.childNameIndex_[componentName] = component;
  55045. this.childNameIndex_[toLowerCase$1(componentName)] = component;
  55046. }
  55047. if (typeof component.el === "function" && component.el()) {
  55048. let refNode = null;
  55049. if (this.children_[index2 + 1]) {
  55050. if (this.children_[index2 + 1].el_) {
  55051. refNode = this.children_[index2 + 1].el_;
  55052. } else if (isEl$1(this.children_[index2 + 1])) {
  55053. refNode = this.children_[index2 + 1];
  55054. }
  55055. }
  55056. this.contentEl().insertBefore(component.el(), refNode);
  55057. }
  55058. return component;
  55059. }
  55060. removeChild(component) {
  55061. if (typeof component === "string") {
  55062. component = this.getChild(component);
  55063. }
  55064. if (!component || !this.children_) {
  55065. return;
  55066. }
  55067. let childFound = false;
  55068. for (let i2 = this.children_.length - 1; i2 >= 0; i2--) {
  55069. if (this.children_[i2] === component) {
  55070. childFound = true;
  55071. this.children_.splice(i2, 1);
  55072. break;
  55073. }
  55074. }
  55075. if (!childFound) {
  55076. return;
  55077. }
  55078. component.parentComponent_ = null;
  55079. this.childIndex_[component.id()] = null;
  55080. this.childNameIndex_[toTitleCase$1$1(component.name())] = null;
  55081. this.childNameIndex_[toLowerCase$1(component.name())] = null;
  55082. const compEl = component.el();
  55083. if (compEl && compEl.parentNode === this.contentEl()) {
  55084. this.contentEl().removeChild(component.el());
  55085. }
  55086. }
  55087. initChildren() {
  55088. const children = this.options_.children;
  55089. if (children) {
  55090. const parentOptions = this.options_;
  55091. const handleAdd = (child) => {
  55092. const name = child.name;
  55093. let opts = child.opts;
  55094. if (parentOptions[name] !== void 0) {
  55095. opts = parentOptions[name];
  55096. }
  55097. if (opts === false) {
  55098. return;
  55099. }
  55100. if (opts === true) {
  55101. opts = {};
  55102. }
  55103. opts.playerOptions = this.options_.playerOptions;
  55104. const newChild = this.addChild(name, opts);
  55105. if (newChild) {
  55106. this[name] = newChild;
  55107. }
  55108. };
  55109. let workingChildren;
  55110. const Tech2 = Component$1$1.getComponent("Tech");
  55111. if (Array.isArray(children)) {
  55112. workingChildren = children;
  55113. } else {
  55114. workingChildren = Object.keys(children);
  55115. }
  55116. workingChildren.concat(Object.keys(this.options_).filter(function(child) {
  55117. return !workingChildren.some(function(wchild) {
  55118. if (typeof wchild === "string") {
  55119. return child === wchild;
  55120. }
  55121. return child === wchild.name;
  55122. });
  55123. })).map((child) => {
  55124. let name;
  55125. let opts;
  55126. if (typeof child === "string") {
  55127. name = child;
  55128. opts = children[name] || this.options_[name] || {};
  55129. } else {
  55130. name = child.name;
  55131. opts = child;
  55132. }
  55133. return {
  55134. name,
  55135. opts
  55136. };
  55137. }).filter((child) => {
  55138. const c = Component$1$1.getComponent(child.opts.componentClass || toTitleCase$1$1(child.name));
  55139. return c && !Tech2.isTech(c);
  55140. }).forEach(handleAdd);
  55141. }
  55142. }
  55143. buildCSSClass() {
  55144. return "";
  55145. }
  55146. ready(fn2, sync = false) {
  55147. if (!fn2) {
  55148. return;
  55149. }
  55150. if (!this.isReady_) {
  55151. this.readyQueue_ = this.readyQueue_ || [];
  55152. this.readyQueue_.push(fn2);
  55153. return;
  55154. }
  55155. if (sync) {
  55156. fn2.call(this);
  55157. } else {
  55158. this.setTimeout(fn2, 1);
  55159. }
  55160. }
  55161. triggerReady() {
  55162. this.isReady_ = true;
  55163. this.setTimeout(function() {
  55164. const readyQueue = this.readyQueue_;
  55165. this.readyQueue_ = [];
  55166. if (readyQueue && readyQueue.length > 0) {
  55167. readyQueue.forEach(function(fn2) {
  55168. fn2.call(this);
  55169. }, this);
  55170. }
  55171. this.trigger("ready");
  55172. }, 1);
  55173. }
  55174. $(selector, context) {
  55175. return $$1(selector, context || this.contentEl());
  55176. }
  55177. $$(selector, context) {
  55178. return $$$1(selector, context || this.contentEl());
  55179. }
  55180. hasClass(classToCheck) {
  55181. return hasClass$1(this.el_, classToCheck);
  55182. }
  55183. addClass(...classesToAdd) {
  55184. addClass$1(this.el_, ...classesToAdd);
  55185. }
  55186. removeClass(...classesToRemove) {
  55187. removeClass$1(this.el_, ...classesToRemove);
  55188. }
  55189. toggleClass(classToToggle, predicate) {
  55190. toggleClass$1(this.el_, classToToggle, predicate);
  55191. }
  55192. show() {
  55193. this.removeClass("vjs-hidden");
  55194. }
  55195. hide() {
  55196. this.addClass("vjs-hidden");
  55197. }
  55198. lockShowing() {
  55199. this.addClass("vjs-lock-showing");
  55200. }
  55201. unlockShowing() {
  55202. this.removeClass("vjs-lock-showing");
  55203. }
  55204. getAttribute(attribute) {
  55205. return getAttribute$1(this.el_, attribute);
  55206. }
  55207. setAttribute(attribute, value) {
  55208. setAttribute$1(this.el_, attribute, value);
  55209. }
  55210. removeAttribute(attribute) {
  55211. removeAttribute$1(this.el_, attribute);
  55212. }
  55213. width(num, skipListeners) {
  55214. return this.dimension("width", num, skipListeners);
  55215. }
  55216. height(num, skipListeners) {
  55217. return this.dimension("height", num, skipListeners);
  55218. }
  55219. dimensions(width2, height2) {
  55220. this.width(width2, true);
  55221. this.height(height2);
  55222. }
  55223. dimension(widthOrHeight, num, skipListeners) {
  55224. if (num !== void 0) {
  55225. if (num === null || num !== num) {
  55226. num = 0;
  55227. }
  55228. if (("" + num).indexOf("%") !== -1 || ("" + num).indexOf("px") !== -1) {
  55229. this.el_.style[widthOrHeight] = num;
  55230. } else if (num === "auto") {
  55231. this.el_.style[widthOrHeight] = "";
  55232. } else {
  55233. this.el_.style[widthOrHeight] = num + "px";
  55234. }
  55235. if (!skipListeners) {
  55236. this.trigger("componentresize");
  55237. }
  55238. return;
  55239. }
  55240. if (!this.el_) {
  55241. return 0;
  55242. }
  55243. const val = this.el_.style[widthOrHeight];
  55244. const pxIndex = val.indexOf("px");
  55245. if (pxIndex !== -1) {
  55246. return parseInt(val.slice(0, pxIndex), 10);
  55247. }
  55248. return parseInt(this.el_["offset" + toTitleCase$1$1(widthOrHeight)], 10);
  55249. }
  55250. currentDimension(widthOrHeight) {
  55251. let computedWidthOrHeight = 0;
  55252. if (widthOrHeight !== "width" && widthOrHeight !== "height") {
  55253. throw new Error("currentDimension only accepts width or height value");
  55254. }
  55255. computedWidthOrHeight = computedStyle$1(this.el_, widthOrHeight);
  55256. computedWidthOrHeight = parseFloat(computedWidthOrHeight);
  55257. if (computedWidthOrHeight === 0 || isNaN(computedWidthOrHeight)) {
  55258. const rule = `offset${toTitleCase$1$1(widthOrHeight)}`;
  55259. computedWidthOrHeight = this.el_[rule];
  55260. }
  55261. return computedWidthOrHeight;
  55262. }
  55263. currentDimensions() {
  55264. return {
  55265. width: this.currentDimension("width"),
  55266. height: this.currentDimension("height")
  55267. };
  55268. }
  55269. currentWidth() {
  55270. return this.currentDimension("width");
  55271. }
  55272. currentHeight() {
  55273. return this.currentDimension("height");
  55274. }
  55275. focus() {
  55276. this.el_.focus();
  55277. }
  55278. blur() {
  55279. this.el_.blur();
  55280. }
  55281. handleKeyDown(event2) {
  55282. if (this.player_) {
  55283. if (!keycode.isEventKey(event2, "Tab")) {
  55284. event2.stopPropagation();
  55285. }
  55286. this.player_.handleKeyDown(event2);
  55287. }
  55288. }
  55289. handleKeyPress(event2) {
  55290. this.handleKeyDown(event2);
  55291. }
  55292. emitTapEvents() {
  55293. let touchStart = 0;
  55294. let firstTouch = null;
  55295. const tapMovementThreshold = 10;
  55296. const touchTimeThreshold = 200;
  55297. let couldBeTap;
  55298. this.on("touchstart", function(event2) {
  55299. if (event2.touches.length === 1) {
  55300. firstTouch = {
  55301. pageX: event2.touches[0].pageX,
  55302. pageY: event2.touches[0].pageY
  55303. };
  55304. touchStart = window_1.performance.now();
  55305. couldBeTap = true;
  55306. }
  55307. });
  55308. this.on("touchmove", function(event2) {
  55309. if (event2.touches.length > 1) {
  55310. couldBeTap = false;
  55311. } else if (firstTouch) {
  55312. const xdiff = event2.touches[0].pageX - firstTouch.pageX;
  55313. const ydiff = event2.touches[0].pageY - firstTouch.pageY;
  55314. const touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);
  55315. if (touchDistance > tapMovementThreshold) {
  55316. couldBeTap = false;
  55317. }
  55318. }
  55319. });
  55320. const noTap = function() {
  55321. couldBeTap = false;
  55322. };
  55323. this.on("touchleave", noTap);
  55324. this.on("touchcancel", noTap);
  55325. this.on("touchend", function(event2) {
  55326. firstTouch = null;
  55327. if (couldBeTap === true) {
  55328. const touchTime = window_1.performance.now() - touchStart;
  55329. if (touchTime < touchTimeThreshold) {
  55330. event2.preventDefault();
  55331. this.trigger("tap");
  55332. }
  55333. }
  55334. });
  55335. }
  55336. enableTouchActivity() {
  55337. if (!this.player() || !this.player().reportUserActivity) {
  55338. return;
  55339. }
  55340. const report = bind_(this.player(), this.player().reportUserActivity);
  55341. let touchHolding;
  55342. this.on("touchstart", function() {
  55343. report();
  55344. this.clearInterval(touchHolding);
  55345. touchHolding = this.setInterval(report, 250);
  55346. });
  55347. const touchEnd = function(event2) {
  55348. report();
  55349. this.clearInterval(touchHolding);
  55350. };
  55351. this.on("touchmove", report);
  55352. this.on("touchend", touchEnd);
  55353. this.on("touchcancel", touchEnd);
  55354. }
  55355. setTimeout(fn2, timeout) {
  55356. var timeoutId;
  55357. fn2 = bind_(this, fn2);
  55358. this.clearTimersOnDispose_();
  55359. timeoutId = window_1.setTimeout(() => {
  55360. if (this.setTimeoutIds_.has(timeoutId)) {
  55361. this.setTimeoutIds_.delete(timeoutId);
  55362. }
  55363. fn2();
  55364. }, timeout);
  55365. this.setTimeoutIds_.add(timeoutId);
  55366. return timeoutId;
  55367. }
  55368. clearTimeout(timeoutId) {
  55369. if (this.setTimeoutIds_.has(timeoutId)) {
  55370. this.setTimeoutIds_.delete(timeoutId);
  55371. window_1.clearTimeout(timeoutId);
  55372. }
  55373. return timeoutId;
  55374. }
  55375. setInterval(fn2, interval) {
  55376. fn2 = bind_(this, fn2);
  55377. this.clearTimersOnDispose_();
  55378. const intervalId = window_1.setInterval(fn2, interval);
  55379. this.setIntervalIds_.add(intervalId);
  55380. return intervalId;
  55381. }
  55382. clearInterval(intervalId) {
  55383. if (this.setIntervalIds_.has(intervalId)) {
  55384. this.setIntervalIds_.delete(intervalId);
  55385. window_1.clearInterval(intervalId);
  55386. }
  55387. return intervalId;
  55388. }
  55389. requestAnimationFrame(fn2) {
  55390. this.clearTimersOnDispose_();
  55391. var id;
  55392. fn2 = bind_(this, fn2);
  55393. id = window_1.requestAnimationFrame(() => {
  55394. if (this.rafIds_.has(id)) {
  55395. this.rafIds_.delete(id);
  55396. }
  55397. fn2();
  55398. });
  55399. this.rafIds_.add(id);
  55400. return id;
  55401. }
  55402. requestNamedAnimationFrame(name, fn2) {
  55403. if (this.namedRafs_.has(name)) {
  55404. return;
  55405. }
  55406. this.clearTimersOnDispose_();
  55407. fn2 = bind_(this, fn2);
  55408. const id = this.requestAnimationFrame(() => {
  55409. fn2();
  55410. if (this.namedRafs_.has(name)) {
  55411. this.namedRafs_.delete(name);
  55412. }
  55413. });
  55414. this.namedRafs_.set(name, id);
  55415. return name;
  55416. }
  55417. cancelNamedAnimationFrame(name) {
  55418. if (!this.namedRafs_.has(name)) {
  55419. return;
  55420. }
  55421. this.cancelAnimationFrame(this.namedRafs_.get(name));
  55422. this.namedRafs_.delete(name);
  55423. }
  55424. cancelAnimationFrame(id) {
  55425. if (this.rafIds_.has(id)) {
  55426. this.rafIds_.delete(id);
  55427. window_1.cancelAnimationFrame(id);
  55428. }
  55429. return id;
  55430. }
  55431. clearTimersOnDispose_() {
  55432. if (this.clearingTimersOnDispose_) {
  55433. return;
  55434. }
  55435. this.clearingTimersOnDispose_ = true;
  55436. this.one("dispose", () => {
  55437. [["namedRafs_", "cancelNamedAnimationFrame"], ["rafIds_", "cancelAnimationFrame"], ["setTimeoutIds_", "clearTimeout"], ["setIntervalIds_", "clearInterval"]].forEach(([idName, cancelName]) => {
  55438. this[idName].forEach((val, key) => this[cancelName](key));
  55439. });
  55440. this.clearingTimersOnDispose_ = false;
  55441. });
  55442. }
  55443. static registerComponent(name, ComponentToRegister) {
  55444. if (typeof name !== "string" || !name) {
  55445. throw new Error(`Illegal component name, "${name}"; must be a non-empty string.`);
  55446. }
  55447. const Tech2 = Component$1$1.getComponent("Tech");
  55448. const isTech = Tech2 && Tech2.isTech(ComponentToRegister);
  55449. const isComp = Component$1$1 === ComponentToRegister || Component$1$1.prototype.isPrototypeOf(ComponentToRegister.prototype);
  55450. if (isTech || !isComp) {
  55451. let reason;
  55452. if (isTech) {
  55453. reason = "techs must be registered using Tech.registerTech()";
  55454. } else {
  55455. reason = "must be a Component subclass";
  55456. }
  55457. throw new Error(`Illegal component, "${name}"; ${reason}.`);
  55458. }
  55459. name = toTitleCase$1$1(name);
  55460. if (!Component$1$1.components_) {
  55461. Component$1$1.components_ = {};
  55462. }
  55463. const Player2 = Component$1$1.getComponent("Player");
  55464. if (name === "Player" && Player2 && Player2.players) {
  55465. const players = Player2.players;
  55466. const playerNames = Object.keys(players);
  55467. if (players && playerNames.length > 0 && playerNames.map((pname) => players[pname]).every(Boolean)) {
  55468. throw new Error("Can not register Player component after player has been created.");
  55469. }
  55470. }
  55471. Component$1$1.components_[name] = ComponentToRegister;
  55472. Component$1$1.components_[toLowerCase$1(name)] = ComponentToRegister;
  55473. return ComponentToRegister;
  55474. }
  55475. static getComponent(name) {
  55476. if (!name || !Component$1$1.components_) {
  55477. return;
  55478. }
  55479. return Component$1$1.components_[name];
  55480. }
  55481. }
  55482. Component$1$1.registerComponent("Component", Component$1$1);
  55483. function rangeCheck$1(fnName, index2, maxIndex) {
  55484. if (typeof index2 !== "number" || index2 < 0 || index2 > maxIndex) {
  55485. throw new Error(`Failed to execute '${fnName}' on 'TimeRanges': The index provided (${index2}) is non-numeric or out of bounds (0-${maxIndex}).`);
  55486. }
  55487. }
  55488. function getRange$1(fnName, valueIndex, ranges, rangeIndex) {
  55489. rangeCheck$1(fnName, rangeIndex, ranges.length - 1);
  55490. return ranges[rangeIndex][valueIndex];
  55491. }
  55492. function createTimeRangesObj$1(ranges) {
  55493. let timeRangesObj;
  55494. if (ranges === void 0 || ranges.length === 0) {
  55495. timeRangesObj = {
  55496. length: 0,
  55497. start() {
  55498. throw new Error("This TimeRanges object is empty");
  55499. },
  55500. end() {
  55501. throw new Error("This TimeRanges object is empty");
  55502. }
  55503. };
  55504. } else {
  55505. timeRangesObj = {
  55506. length: ranges.length,
  55507. start: getRange$1.bind(null, "start", 0, ranges),
  55508. end: getRange$1.bind(null, "end", 1, ranges)
  55509. };
  55510. }
  55511. if (window_1.Symbol && window_1.Symbol.iterator) {
  55512. timeRangesObj[window_1.Symbol.iterator] = () => (ranges || []).values();
  55513. }
  55514. return timeRangesObj;
  55515. }
  55516. function createTimeRanges$1(start2, end) {
  55517. if (Array.isArray(start2)) {
  55518. return createTimeRangesObj$1(start2);
  55519. } else if (start2 === void 0 || end === void 0) {
  55520. return createTimeRangesObj$1();
  55521. }
  55522. return createTimeRangesObj$1([[start2, end]]);
  55523. }
  55524. const defaultImplementation$1 = function(seconds, guide) {
  55525. seconds = seconds < 0 ? 0 : seconds;
  55526. let s = Math.floor(seconds % 60);
  55527. let m = Math.floor(seconds / 60 % 60);
  55528. let h2 = Math.floor(seconds / 3600);
  55529. const gm = Math.floor(guide / 60 % 60);
  55530. const gh = Math.floor(guide / 3600);
  55531. if (isNaN(seconds) || seconds === Infinity) {
  55532. h2 = m = s = "-";
  55533. }
  55534. h2 = h2 > 0 || gh > 0 ? h2 + ":" : "";
  55535. m = ((h2 || gm >= 10) && m < 10 ? "0" + m : m) + ":";
  55536. s = s < 10 ? "0" + s : s;
  55537. return h2 + m + s;
  55538. };
  55539. let implementation$1 = defaultImplementation$1;
  55540. function setFormatTime$1(customImplementation) {
  55541. implementation$1 = customImplementation;
  55542. }
  55543. function resetFormatTime$1() {
  55544. implementation$1 = defaultImplementation$1;
  55545. }
  55546. function formatTime$1(seconds, guide = seconds) {
  55547. return implementation$1(seconds, guide);
  55548. }
  55549. var Time = /* @__PURE__ */ Object.freeze({
  55550. __proto__: null,
  55551. createTimeRanges: createTimeRanges$1,
  55552. createTimeRange: createTimeRanges$1,
  55553. setFormatTime: setFormatTime$1,
  55554. resetFormatTime: resetFormatTime$1,
  55555. formatTime: formatTime$1
  55556. });
  55557. function bufferedPercent$1(buffered, duration5) {
  55558. let bufferedDuration = 0;
  55559. let start2;
  55560. let end;
  55561. if (!duration5) {
  55562. return 0;
  55563. }
  55564. if (!buffered || !buffered.length) {
  55565. buffered = createTimeRanges$1(0, 0);
  55566. }
  55567. for (let i2 = 0; i2 < buffered.length; i2++) {
  55568. start2 = buffered.start(i2);
  55569. end = buffered.end(i2);
  55570. if (end > duration5) {
  55571. end = duration5;
  55572. }
  55573. bufferedDuration += end - start2;
  55574. }
  55575. return bufferedDuration / duration5;
  55576. }
  55577. function MediaError$1(value) {
  55578. if (value instanceof MediaError$1) {
  55579. return value;
  55580. }
  55581. if (typeof value === "number") {
  55582. this.code = value;
  55583. } else if (typeof value === "string") {
  55584. this.message = value;
  55585. } else if (isObject$2(value)) {
  55586. if (typeof value.code === "number") {
  55587. this.code = value.code;
  55588. }
  55589. Object.assign(this, value);
  55590. }
  55591. if (!this.message) {
  55592. this.message = MediaError$1.defaultMessages[this.code] || "";
  55593. }
  55594. }
  55595. MediaError$1.prototype.code = 0;
  55596. MediaError$1.prototype.message = "";
  55597. MediaError$1.prototype.status = null;
  55598. MediaError$1.errorTypes = ["MEDIA_ERR_CUSTOM", "MEDIA_ERR_ABORTED", "MEDIA_ERR_NETWORK", "MEDIA_ERR_DECODE", "MEDIA_ERR_SRC_NOT_SUPPORTED", "MEDIA_ERR_ENCRYPTED"];
  55599. MediaError$1.defaultMessages = {
  55600. 1: "You aborted the media playback",
  55601. 2: "A network error caused the media download to fail part-way.",
  55602. 3: "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",
  55603. 4: "The media could not be loaded, either because the server or network failed or because the format is not supported.",
  55604. 5: "The media is encrypted and we do not have the keys to decrypt it."
  55605. };
  55606. for (let errNum = 0; errNum < MediaError$1.errorTypes.length; errNum++) {
  55607. MediaError$1[MediaError$1.errorTypes[errNum]] = errNum;
  55608. MediaError$1.prototype[MediaError$1.errorTypes[errNum]] = errNum;
  55609. }
  55610. function isPromise$1(value) {
  55611. return value !== void 0 && value !== null && typeof value.then === "function";
  55612. }
  55613. function silencePromise$1(value) {
  55614. if (isPromise$1(value)) {
  55615. value.then(null, (e) => {
  55616. });
  55617. }
  55618. }
  55619. const trackToJson_$1 = function(track) {
  55620. const ret = ["kind", "label", "language", "id", "inBandMetadataTrackDispatchType", "mode", "src"].reduce((acc, prop, i2) => {
  55621. if (track[prop]) {
  55622. acc[prop] = track[prop];
  55623. }
  55624. return acc;
  55625. }, {
  55626. cues: track.cues && Array.prototype.map.call(track.cues, function(cue) {
  55627. return {
  55628. startTime: cue.startTime,
  55629. endTime: cue.endTime,
  55630. text: cue.text,
  55631. id: cue.id
  55632. };
  55633. })
  55634. });
  55635. return ret;
  55636. };
  55637. const textTracksToJson$1 = function(tech) {
  55638. const trackEls = tech.$$("track");
  55639. const trackObjs = Array.prototype.map.call(trackEls, (t2) => t2.track);
  55640. const tracks = Array.prototype.map.call(trackEls, function(trackEl) {
  55641. const json = trackToJson_$1(trackEl.track);
  55642. if (trackEl.src) {
  55643. json.src = trackEl.src;
  55644. }
  55645. return json;
  55646. });
  55647. return tracks.concat(Array.prototype.filter.call(tech.textTracks(), function(track) {
  55648. return trackObjs.indexOf(track) === -1;
  55649. }).map(trackToJson_$1));
  55650. };
  55651. const jsonToTextTracks$1 = function(json, tech) {
  55652. json.forEach(function(track) {
  55653. const addedTrack = tech.addRemoteTextTrack(track).track;
  55654. if (!track.src && track.cues) {
  55655. track.cues.forEach((cue) => addedTrack.addCue(cue));
  55656. }
  55657. });
  55658. return tech.textTracks();
  55659. };
  55660. var textTrackConverter$1 = {
  55661. textTracksToJson: textTracksToJson$1,
  55662. jsonToTextTracks: jsonToTextTracks$1,
  55663. trackToJson_: trackToJson_$1
  55664. };
  55665. const MODAL_CLASS_NAME$1 = "vjs-modal-dialog";
  55666. class ModalDialog$1 extends Component$1$1 {
  55667. constructor(player, options2) {
  55668. super(player, options2);
  55669. this.handleKeyDown_ = (e) => this.handleKeyDown(e);
  55670. this.close_ = (e) => this.close(e);
  55671. this.opened_ = this.hasBeenOpened_ = this.hasBeenFilled_ = false;
  55672. this.closeable(!this.options_.uncloseable);
  55673. this.content(this.options_.content);
  55674. this.contentEl_ = createEl$1("div", {
  55675. className: `${MODAL_CLASS_NAME$1}-content`
  55676. }, {
  55677. role: "document"
  55678. });
  55679. this.descEl_ = createEl$1("p", {
  55680. className: `${MODAL_CLASS_NAME$1}-description vjs-control-text`,
  55681. id: this.el().getAttribute("aria-describedby")
  55682. });
  55683. textContent$1(this.descEl_, this.description());
  55684. this.el_.appendChild(this.descEl_);
  55685. this.el_.appendChild(this.contentEl_);
  55686. }
  55687. createEl() {
  55688. return super.createEl("div", {
  55689. className: this.buildCSSClass(),
  55690. tabIndex: -1
  55691. }, {
  55692. "aria-describedby": `${this.id()}_description`,
  55693. "aria-hidden": "true",
  55694. "aria-label": this.label(),
  55695. "role": "dialog"
  55696. });
  55697. }
  55698. dispose() {
  55699. this.contentEl_ = null;
  55700. this.descEl_ = null;
  55701. this.previouslyActiveEl_ = null;
  55702. super.dispose();
  55703. }
  55704. buildCSSClass() {
  55705. return `${MODAL_CLASS_NAME$1} vjs-hidden ${super.buildCSSClass()}`;
  55706. }
  55707. label() {
  55708. return this.localize(this.options_.label || "Modal Window");
  55709. }
  55710. description() {
  55711. let desc = this.options_.description || this.localize("This is a modal window.");
  55712. if (this.closeable()) {
  55713. desc += " " + this.localize("This modal can be closed by pressing the Escape key or activating the close button.");
  55714. }
  55715. return desc;
  55716. }
  55717. open() {
  55718. if (!this.opened_) {
  55719. const player = this.player();
  55720. this.trigger("beforemodalopen");
  55721. this.opened_ = true;
  55722. if (this.options_.fillAlways || !this.hasBeenOpened_ && !this.hasBeenFilled_) {
  55723. this.fill();
  55724. }
  55725. this.wasPlaying_ = !player.paused();
  55726. if (this.options_.pauseOnOpen && this.wasPlaying_) {
  55727. player.pause();
  55728. }
  55729. this.on("keydown", this.handleKeyDown_);
  55730. this.hadControls_ = player.controls();
  55731. player.controls(false);
  55732. this.show();
  55733. this.conditionalFocus_();
  55734. this.el().setAttribute("aria-hidden", "false");
  55735. this.trigger("modalopen");
  55736. this.hasBeenOpened_ = true;
  55737. }
  55738. }
  55739. opened(value) {
  55740. if (typeof value === "boolean") {
  55741. this[value ? "open" : "close"]();
  55742. }
  55743. return this.opened_;
  55744. }
  55745. close() {
  55746. if (!this.opened_) {
  55747. return;
  55748. }
  55749. const player = this.player();
  55750. this.trigger("beforemodalclose");
  55751. this.opened_ = false;
  55752. if (this.wasPlaying_ && this.options_.pauseOnOpen) {
  55753. player.play();
  55754. }
  55755. this.off("keydown", this.handleKeyDown_);
  55756. if (this.hadControls_) {
  55757. player.controls(true);
  55758. }
  55759. this.hide();
  55760. this.el().setAttribute("aria-hidden", "true");
  55761. this.trigger("modalclose");
  55762. this.conditionalBlur_();
  55763. if (this.options_.temporary) {
  55764. this.dispose();
  55765. }
  55766. }
  55767. closeable(value) {
  55768. if (typeof value === "boolean") {
  55769. const closeable = this.closeable_ = !!value;
  55770. let close = this.getChild("closeButton");
  55771. if (closeable && !close) {
  55772. const temp = this.contentEl_;
  55773. this.contentEl_ = this.el_;
  55774. close = this.addChild("closeButton", {
  55775. controlText: "Close Modal Dialog"
  55776. });
  55777. this.contentEl_ = temp;
  55778. this.on(close, "close", this.close_);
  55779. }
  55780. if (!closeable && close) {
  55781. this.off(close, "close", this.close_);
  55782. this.removeChild(close);
  55783. close.dispose();
  55784. }
  55785. }
  55786. return this.closeable_;
  55787. }
  55788. fill() {
  55789. this.fillWith(this.content());
  55790. }
  55791. fillWith(content) {
  55792. const contentEl = this.contentEl();
  55793. const parentEl = contentEl.parentNode;
  55794. const nextSiblingEl = contentEl.nextSibling;
  55795. this.trigger("beforemodalfill");
  55796. this.hasBeenFilled_ = true;
  55797. parentEl.removeChild(contentEl);
  55798. this.empty();
  55799. insertContent$1(contentEl, content);
  55800. this.trigger("modalfill");
  55801. if (nextSiblingEl) {
  55802. parentEl.insertBefore(contentEl, nextSiblingEl);
  55803. } else {
  55804. parentEl.appendChild(contentEl);
  55805. }
  55806. const closeButton = this.getChild("closeButton");
  55807. if (closeButton) {
  55808. parentEl.appendChild(closeButton.el_);
  55809. }
  55810. }
  55811. empty() {
  55812. this.trigger("beforemodalempty");
  55813. emptyEl$1(this.contentEl());
  55814. this.trigger("modalempty");
  55815. }
  55816. content(value) {
  55817. if (typeof value !== "undefined") {
  55818. this.content_ = value;
  55819. }
  55820. return this.content_;
  55821. }
  55822. conditionalFocus_() {
  55823. const activeEl = document_1.activeElement;
  55824. const playerEl = this.player_.el_;
  55825. this.previouslyActiveEl_ = null;
  55826. if (playerEl.contains(activeEl) || playerEl === activeEl) {
  55827. this.previouslyActiveEl_ = activeEl;
  55828. this.focus();
  55829. }
  55830. }
  55831. conditionalBlur_() {
  55832. if (this.previouslyActiveEl_) {
  55833. this.previouslyActiveEl_.focus();
  55834. this.previouslyActiveEl_ = null;
  55835. }
  55836. }
  55837. handleKeyDown(event2) {
  55838. event2.stopPropagation();
  55839. if (keycode.isEventKey(event2, "Escape") && this.closeable()) {
  55840. event2.preventDefault();
  55841. this.close();
  55842. return;
  55843. }
  55844. if (!keycode.isEventKey(event2, "Tab")) {
  55845. return;
  55846. }
  55847. const focusableEls = this.focusableEls_();
  55848. const activeEl = this.el_.querySelector(":focus");
  55849. let focusIndex;
  55850. for (let i2 = 0; i2 < focusableEls.length; i2++) {
  55851. if (activeEl === focusableEls[i2]) {
  55852. focusIndex = i2;
  55853. break;
  55854. }
  55855. }
  55856. if (document_1.activeElement === this.el_) {
  55857. focusIndex = 0;
  55858. }
  55859. if (event2.shiftKey && focusIndex === 0) {
  55860. focusableEls[focusableEls.length - 1].focus();
  55861. event2.preventDefault();
  55862. } else if (!event2.shiftKey && focusIndex === focusableEls.length - 1) {
  55863. focusableEls[0].focus();
  55864. event2.preventDefault();
  55865. }
  55866. }
  55867. focusableEls_() {
  55868. const allChildren = this.el_.querySelectorAll("*");
  55869. return Array.prototype.filter.call(allChildren, (child) => {
  55870. return (child instanceof window_1.HTMLAnchorElement || child instanceof window_1.HTMLAreaElement) && child.hasAttribute("href") || (child instanceof window_1.HTMLInputElement || child instanceof window_1.HTMLSelectElement || child instanceof window_1.HTMLTextAreaElement || child instanceof window_1.HTMLButtonElement) && !child.hasAttribute("disabled") || child instanceof window_1.HTMLIFrameElement || child instanceof window_1.HTMLObjectElement || child instanceof window_1.HTMLEmbedElement || child.hasAttribute("tabindex") && child.getAttribute("tabindex") !== -1 || child.hasAttribute("contenteditable");
  55871. });
  55872. }
  55873. }
  55874. ModalDialog$1.prototype.options_ = {
  55875. pauseOnOpen: true,
  55876. temporary: true
  55877. };
  55878. Component$1$1.registerComponent("ModalDialog", ModalDialog$1);
  55879. class TrackList$1 extends EventTarget$2$1 {
  55880. constructor(tracks = []) {
  55881. super();
  55882. this.tracks_ = [];
  55883. Object.defineProperty(this, "length", {
  55884. get() {
  55885. return this.tracks_.length;
  55886. }
  55887. });
  55888. for (let i2 = 0; i2 < tracks.length; i2++) {
  55889. this.addTrack(tracks[i2]);
  55890. }
  55891. }
  55892. addTrack(track) {
  55893. const index2 = this.tracks_.length;
  55894. if (!("" + index2 in this)) {
  55895. Object.defineProperty(this, index2, {
  55896. get() {
  55897. return this.tracks_[index2];
  55898. }
  55899. });
  55900. }
  55901. if (this.tracks_.indexOf(track) === -1) {
  55902. this.tracks_.push(track);
  55903. this.trigger({
  55904. track,
  55905. type: "addtrack",
  55906. target: this
  55907. });
  55908. }
  55909. track.labelchange_ = () => {
  55910. this.trigger({
  55911. track,
  55912. type: "labelchange",
  55913. target: this
  55914. });
  55915. };
  55916. if (isEvented$1(track)) {
  55917. track.addEventListener("labelchange", track.labelchange_);
  55918. }
  55919. }
  55920. removeTrack(rtrack) {
  55921. let track;
  55922. for (let i2 = 0, l = this.length; i2 < l; i2++) {
  55923. if (this[i2] === rtrack) {
  55924. track = this[i2];
  55925. if (track.off) {
  55926. track.off();
  55927. }
  55928. this.tracks_.splice(i2, 1);
  55929. break;
  55930. }
  55931. }
  55932. if (!track) {
  55933. return;
  55934. }
  55935. this.trigger({
  55936. track,
  55937. type: "removetrack",
  55938. target: this
  55939. });
  55940. }
  55941. getTrackById(id) {
  55942. let result = null;
  55943. for (let i2 = 0, l = this.length; i2 < l; i2++) {
  55944. const track = this[i2];
  55945. if (track.id === id) {
  55946. result = track;
  55947. break;
  55948. }
  55949. }
  55950. return result;
  55951. }
  55952. }
  55953. TrackList$1.prototype.allowedEvents_ = {
  55954. change: "change",
  55955. addtrack: "addtrack",
  55956. removetrack: "removetrack",
  55957. labelchange: "labelchange"
  55958. };
  55959. for (const event2 in TrackList$1.prototype.allowedEvents_) {
  55960. TrackList$1.prototype["on" + event2] = null;
  55961. }
  55962. const disableOthers$1$1 = function(list, track) {
  55963. for (let i2 = 0; i2 < list.length; i2++) {
  55964. if (!Object.keys(list[i2]).length || track.id === list[i2].id) {
  55965. continue;
  55966. }
  55967. list[i2].enabled = false;
  55968. }
  55969. };
  55970. class AudioTrackList$1 extends TrackList$1 {
  55971. constructor(tracks = []) {
  55972. for (let i2 = tracks.length - 1; i2 >= 0; i2--) {
  55973. if (tracks[i2].enabled) {
  55974. disableOthers$1$1(tracks, tracks[i2]);
  55975. break;
  55976. }
  55977. }
  55978. super(tracks);
  55979. this.changing_ = false;
  55980. }
  55981. addTrack(track) {
  55982. if (track.enabled) {
  55983. disableOthers$1$1(this, track);
  55984. }
  55985. super.addTrack(track);
  55986. if (!track.addEventListener) {
  55987. return;
  55988. }
  55989. track.enabledChange_ = () => {
  55990. if (this.changing_) {
  55991. return;
  55992. }
  55993. this.changing_ = true;
  55994. disableOthers$1$1(this, track);
  55995. this.changing_ = false;
  55996. this.trigger("change");
  55997. };
  55998. track.addEventListener("enabledchange", track.enabledChange_);
  55999. }
  56000. removeTrack(rtrack) {
  56001. super.removeTrack(rtrack);
  56002. if (rtrack.removeEventListener && rtrack.enabledChange_) {
  56003. rtrack.removeEventListener("enabledchange", rtrack.enabledChange_);
  56004. rtrack.enabledChange_ = null;
  56005. }
  56006. }
  56007. }
  56008. const disableOthers$2 = function(list, track) {
  56009. for (let i2 = 0; i2 < list.length; i2++) {
  56010. if (!Object.keys(list[i2]).length || track.id === list[i2].id) {
  56011. continue;
  56012. }
  56013. list[i2].selected = false;
  56014. }
  56015. };
  56016. class VideoTrackList$1 extends TrackList$1 {
  56017. constructor(tracks = []) {
  56018. for (let i2 = tracks.length - 1; i2 >= 0; i2--) {
  56019. if (tracks[i2].selected) {
  56020. disableOthers$2(tracks, tracks[i2]);
  56021. break;
  56022. }
  56023. }
  56024. super(tracks);
  56025. this.changing_ = false;
  56026. Object.defineProperty(this, "selectedIndex", {
  56027. get() {
  56028. for (let i2 = 0; i2 < this.length; i2++) {
  56029. if (this[i2].selected) {
  56030. return i2;
  56031. }
  56032. }
  56033. return -1;
  56034. },
  56035. set() {
  56036. }
  56037. });
  56038. }
  56039. addTrack(track) {
  56040. if (track.selected) {
  56041. disableOthers$2(this, track);
  56042. }
  56043. super.addTrack(track);
  56044. if (!track.addEventListener) {
  56045. return;
  56046. }
  56047. track.selectedChange_ = () => {
  56048. if (this.changing_) {
  56049. return;
  56050. }
  56051. this.changing_ = true;
  56052. disableOthers$2(this, track);
  56053. this.changing_ = false;
  56054. this.trigger("change");
  56055. };
  56056. track.addEventListener("selectedchange", track.selectedChange_);
  56057. }
  56058. removeTrack(rtrack) {
  56059. super.removeTrack(rtrack);
  56060. if (rtrack.removeEventListener && rtrack.selectedChange_) {
  56061. rtrack.removeEventListener("selectedchange", rtrack.selectedChange_);
  56062. rtrack.selectedChange_ = null;
  56063. }
  56064. }
  56065. }
  56066. class TextTrackList$1 extends TrackList$1 {
  56067. addTrack(track) {
  56068. super.addTrack(track);
  56069. if (!this.queueChange_) {
  56070. this.queueChange_ = () => this.queueTrigger("change");
  56071. }
  56072. if (!this.triggerSelectedlanguagechange) {
  56073. this.triggerSelectedlanguagechange_ = () => this.trigger("selectedlanguagechange");
  56074. }
  56075. track.addEventListener("modechange", this.queueChange_);
  56076. const nonLanguageTextTrackKind = ["metadata", "chapters"];
  56077. if (nonLanguageTextTrackKind.indexOf(track.kind) === -1) {
  56078. track.addEventListener("modechange", this.triggerSelectedlanguagechange_);
  56079. }
  56080. }
  56081. removeTrack(rtrack) {
  56082. super.removeTrack(rtrack);
  56083. if (rtrack.removeEventListener) {
  56084. if (this.queueChange_) {
  56085. rtrack.removeEventListener("modechange", this.queueChange_);
  56086. }
  56087. if (this.selectedlanguagechange_) {
  56088. rtrack.removeEventListener("modechange", this.triggerSelectedlanguagechange_);
  56089. }
  56090. }
  56091. }
  56092. }
  56093. class HtmlTrackElementList$1 {
  56094. constructor(trackElements = []) {
  56095. this.trackElements_ = [];
  56096. Object.defineProperty(this, "length", {
  56097. get() {
  56098. return this.trackElements_.length;
  56099. }
  56100. });
  56101. for (let i2 = 0, length = trackElements.length; i2 < length; i2++) {
  56102. this.addTrackElement_(trackElements[i2]);
  56103. }
  56104. }
  56105. addTrackElement_(trackElement) {
  56106. const index2 = this.trackElements_.length;
  56107. if (!("" + index2 in this)) {
  56108. Object.defineProperty(this, index2, {
  56109. get() {
  56110. return this.trackElements_[index2];
  56111. }
  56112. });
  56113. }
  56114. if (this.trackElements_.indexOf(trackElement) === -1) {
  56115. this.trackElements_.push(trackElement);
  56116. }
  56117. }
  56118. getTrackElementByTrack_(track) {
  56119. let trackElement_;
  56120. for (let i2 = 0, length = this.trackElements_.length; i2 < length; i2++) {
  56121. if (track === this.trackElements_[i2].track) {
  56122. trackElement_ = this.trackElements_[i2];
  56123. break;
  56124. }
  56125. }
  56126. return trackElement_;
  56127. }
  56128. removeTrackElement_(trackElement) {
  56129. for (let i2 = 0, length = this.trackElements_.length; i2 < length; i2++) {
  56130. if (trackElement === this.trackElements_[i2]) {
  56131. if (this.trackElements_[i2].track && typeof this.trackElements_[i2].track.off === "function") {
  56132. this.trackElements_[i2].track.off();
  56133. }
  56134. if (typeof this.trackElements_[i2].off === "function") {
  56135. this.trackElements_[i2].off();
  56136. }
  56137. this.trackElements_.splice(i2, 1);
  56138. break;
  56139. }
  56140. }
  56141. }
  56142. }
  56143. class TextTrackCueList$1 {
  56144. constructor(cues) {
  56145. TextTrackCueList$1.prototype.setCues_.call(this, cues);
  56146. Object.defineProperty(this, "length", {
  56147. get() {
  56148. return this.length_;
  56149. }
  56150. });
  56151. }
  56152. setCues_(cues) {
  56153. const oldLength = this.length || 0;
  56154. let i2 = 0;
  56155. const l = cues.length;
  56156. this.cues_ = cues;
  56157. this.length_ = cues.length;
  56158. const defineProp = function(index2) {
  56159. if (!("" + index2 in this)) {
  56160. Object.defineProperty(this, "" + index2, {
  56161. get() {
  56162. return this.cues_[index2];
  56163. }
  56164. });
  56165. }
  56166. };
  56167. if (oldLength < l) {
  56168. i2 = oldLength;
  56169. for (; i2 < l; i2++) {
  56170. defineProp.call(this, i2);
  56171. }
  56172. }
  56173. }
  56174. getCueById(id) {
  56175. let result = null;
  56176. for (let i2 = 0, l = this.length; i2 < l; i2++) {
  56177. const cue = this[i2];
  56178. if (cue.id === id) {
  56179. result = cue;
  56180. break;
  56181. }
  56182. }
  56183. return result;
  56184. }
  56185. }
  56186. const VideoTrackKind$1 = {
  56187. alternative: "alternative",
  56188. captions: "captions",
  56189. main: "main",
  56190. sign: "sign",
  56191. subtitles: "subtitles",
  56192. commentary: "commentary"
  56193. };
  56194. const AudioTrackKind$1 = {
  56195. "alternative": "alternative",
  56196. "descriptions": "descriptions",
  56197. "main": "main",
  56198. "main-desc": "main-desc",
  56199. "translation": "translation",
  56200. "commentary": "commentary"
  56201. };
  56202. const TextTrackKind$1 = {
  56203. subtitles: "subtitles",
  56204. captions: "captions",
  56205. descriptions: "descriptions",
  56206. chapters: "chapters",
  56207. metadata: "metadata"
  56208. };
  56209. const TextTrackMode$1 = {
  56210. disabled: "disabled",
  56211. hidden: "hidden",
  56212. showing: "showing"
  56213. };
  56214. class Track$1 extends EventTarget$2$1 {
  56215. constructor(options2 = {}) {
  56216. super();
  56217. const trackProps = {
  56218. id: options2.id || "vjs_track_" + newGUID$1(),
  56219. kind: options2.kind || "",
  56220. language: options2.language || ""
  56221. };
  56222. let label = options2.label || "";
  56223. for (const key in trackProps) {
  56224. Object.defineProperty(this, key, {
  56225. get() {
  56226. return trackProps[key];
  56227. },
  56228. set() {
  56229. }
  56230. });
  56231. }
  56232. Object.defineProperty(this, "label", {
  56233. get() {
  56234. return label;
  56235. },
  56236. set(newLabel) {
  56237. if (newLabel !== label) {
  56238. label = newLabel;
  56239. this.trigger("labelchange");
  56240. }
  56241. }
  56242. });
  56243. }
  56244. }
  56245. const parseUrl$1 = function(url) {
  56246. const props = ["protocol", "hostname", "port", "pathname", "search", "hash", "host"];
  56247. const a = document_1.createElement("a");
  56248. a.href = url;
  56249. const details = {};
  56250. for (let i2 = 0; i2 < props.length; i2++) {
  56251. details[props[i2]] = a[props[i2]];
  56252. }
  56253. if (details.protocol === "http:") {
  56254. details.host = details.host.replace(/:80$/, "");
  56255. }
  56256. if (details.protocol === "https:") {
  56257. details.host = details.host.replace(/:443$/, "");
  56258. }
  56259. if (!details.protocol) {
  56260. details.protocol = window_1.location.protocol;
  56261. }
  56262. if (!details.host) {
  56263. details.host = window_1.location.host;
  56264. }
  56265. return details;
  56266. };
  56267. const getAbsoluteURL$1 = function(url) {
  56268. if (!url.match(/^https?:\/\//)) {
  56269. const a = document_1.createElement("a");
  56270. a.href = url;
  56271. url = a.href;
  56272. }
  56273. return url;
  56274. };
  56275. const getFileExtension$1 = function(path) {
  56276. if (typeof path === "string") {
  56277. const splitPathRe = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/;
  56278. const pathParts = splitPathRe.exec(path);
  56279. if (pathParts) {
  56280. return pathParts.pop().toLowerCase();
  56281. }
  56282. }
  56283. return "";
  56284. };
  56285. const isCrossOrigin$1 = function(url, winLoc = window_1.location) {
  56286. const urlInfo = parseUrl$1(url);
  56287. const srcProtocol = urlInfo.protocol === ":" ? winLoc.protocol : urlInfo.protocol;
  56288. const crossOrigin = srcProtocol + urlInfo.host !== winLoc.protocol + winLoc.host;
  56289. return crossOrigin;
  56290. };
  56291. var Url$2 = /* @__PURE__ */ Object.freeze({
  56292. __proto__: null,
  56293. parseUrl: parseUrl$1,
  56294. getAbsoluteURL: getAbsoluteURL$1,
  56295. getFileExtension: getFileExtension$1,
  56296. isCrossOrigin: isCrossOrigin$1
  56297. });
  56298. const parseCues$1 = function(srcContent, track) {
  56299. const parser2 = new window_1.WebVTT.Parser(window_1, window_1.vttjs, window_1.WebVTT.StringDecoder());
  56300. const errors2 = [];
  56301. parser2.oncue = function(cue) {
  56302. track.addCue(cue);
  56303. };
  56304. parser2.onparsingerror = function(error) {
  56305. errors2.push(error);
  56306. };
  56307. parser2.onflush = function() {
  56308. track.trigger({
  56309. type: "loadeddata",
  56310. target: track
  56311. });
  56312. };
  56313. parser2.parse(srcContent);
  56314. if (errors2.length > 0) {
  56315. if (window_1.console && window_1.console.groupCollapsed) {
  56316. window_1.console.groupCollapsed(`Text Track parsing errors for ${track.src}`);
  56317. }
  56318. errors2.forEach((error) => log$1$1.error(error));
  56319. if (window_1.console && window_1.console.groupEnd) {
  56320. window_1.console.groupEnd();
  56321. }
  56322. }
  56323. parser2.flush();
  56324. };
  56325. const loadTrack$1 = function(src, track) {
  56326. const opts = {
  56327. uri: src
  56328. };
  56329. const crossOrigin = isCrossOrigin$1(src);
  56330. if (crossOrigin) {
  56331. opts.cors = crossOrigin;
  56332. }
  56333. const withCredentials = track.tech_.crossOrigin() === "use-credentials";
  56334. if (withCredentials) {
  56335. opts.withCredentials = withCredentials;
  56336. }
  56337. XHR(opts, bind_(this, function(err, response, responseBody) {
  56338. if (err) {
  56339. return log$1$1.error(err, response);
  56340. }
  56341. track.loaded_ = true;
  56342. if (typeof window_1.WebVTT !== "function") {
  56343. if (track.tech_) {
  56344. track.tech_.any(["vttjsloaded", "vttjserror"], (event2) => {
  56345. if (event2.type === "vttjserror") {
  56346. log$1$1.error(`vttjs failed to load, stopping trying to process ${track.src}`);
  56347. return;
  56348. }
  56349. return parseCues$1(responseBody, track);
  56350. });
  56351. }
  56352. } else {
  56353. parseCues$1(responseBody, track);
  56354. }
  56355. }));
  56356. };
  56357. class TextTrack$1 extends Track$1 {
  56358. constructor(options2 = {}) {
  56359. if (!options2.tech) {
  56360. throw new Error("A tech was not provided.");
  56361. }
  56362. const settings = merge$1(options2, {
  56363. kind: TextTrackKind$1[options2.kind] || "subtitles",
  56364. language: options2.language || options2.srclang || ""
  56365. });
  56366. let mode = TextTrackMode$1[settings.mode] || "disabled";
  56367. const default_ = settings.default;
  56368. if (settings.kind === "metadata" || settings.kind === "chapters") {
  56369. mode = "hidden";
  56370. }
  56371. super(settings);
  56372. this.tech_ = settings.tech;
  56373. this.cues_ = [];
  56374. this.activeCues_ = [];
  56375. this.preload_ = this.tech_.preloadTextTracks !== false;
  56376. const cues = new TextTrackCueList$1(this.cues_);
  56377. const activeCues = new TextTrackCueList$1(this.activeCues_);
  56378. let changed = false;
  56379. this.timeupdateHandler = bind_(this, function(event2 = {}) {
  56380. if (this.tech_.isDisposed()) {
  56381. return;
  56382. }
  56383. if (!this.tech_.isReady_) {
  56384. if (event2.type !== "timeupdate") {
  56385. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  56386. }
  56387. return;
  56388. }
  56389. this.activeCues = this.activeCues;
  56390. if (changed) {
  56391. this.trigger("cuechange");
  56392. changed = false;
  56393. }
  56394. if (event2.type !== "timeupdate") {
  56395. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  56396. }
  56397. });
  56398. const disposeHandler = () => {
  56399. this.stopTracking();
  56400. };
  56401. this.tech_.one("dispose", disposeHandler);
  56402. if (mode !== "disabled") {
  56403. this.startTracking();
  56404. }
  56405. Object.defineProperties(this, {
  56406. default: {
  56407. get() {
  56408. return default_;
  56409. },
  56410. set() {
  56411. }
  56412. },
  56413. mode: {
  56414. get() {
  56415. return mode;
  56416. },
  56417. set(newMode) {
  56418. if (!TextTrackMode$1[newMode]) {
  56419. return;
  56420. }
  56421. if (mode === newMode) {
  56422. return;
  56423. }
  56424. mode = newMode;
  56425. if (!this.preload_ && mode !== "disabled" && this.cues.length === 0) {
  56426. loadTrack$1(this.src, this);
  56427. }
  56428. this.stopTracking();
  56429. if (mode !== "disabled") {
  56430. this.startTracking();
  56431. }
  56432. this.trigger("modechange");
  56433. }
  56434. },
  56435. cues: {
  56436. get() {
  56437. if (!this.loaded_) {
  56438. return null;
  56439. }
  56440. return cues;
  56441. },
  56442. set() {
  56443. }
  56444. },
  56445. activeCues: {
  56446. get() {
  56447. if (!this.loaded_) {
  56448. return null;
  56449. }
  56450. if (this.cues.length === 0) {
  56451. return activeCues;
  56452. }
  56453. const ct2 = this.tech_.currentTime();
  56454. const active = [];
  56455. for (let i2 = 0, l = this.cues.length; i2 < l; i2++) {
  56456. const cue = this.cues[i2];
  56457. if (cue.startTime <= ct2 && cue.endTime >= ct2) {
  56458. active.push(cue);
  56459. }
  56460. }
  56461. changed = false;
  56462. if (active.length !== this.activeCues_.length) {
  56463. changed = true;
  56464. } else {
  56465. for (let i2 = 0; i2 < active.length; i2++) {
  56466. if (this.activeCues_.indexOf(active[i2]) === -1) {
  56467. changed = true;
  56468. }
  56469. }
  56470. }
  56471. this.activeCues_ = active;
  56472. activeCues.setCues_(this.activeCues_);
  56473. return activeCues;
  56474. },
  56475. set() {
  56476. }
  56477. }
  56478. });
  56479. if (settings.src) {
  56480. this.src = settings.src;
  56481. if (!this.preload_) {
  56482. this.loaded_ = true;
  56483. }
  56484. if (this.preload_ || settings.kind !== "subtitles" && settings.kind !== "captions") {
  56485. loadTrack$1(this.src, this);
  56486. }
  56487. } else {
  56488. this.loaded_ = true;
  56489. }
  56490. }
  56491. startTracking() {
  56492. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  56493. this.tech_.on("timeupdate", this.timeupdateHandler);
  56494. }
  56495. stopTracking() {
  56496. if (this.rvf_) {
  56497. this.tech_.cancelVideoFrameCallback(this.rvf_);
  56498. this.rvf_ = void 0;
  56499. }
  56500. this.tech_.off("timeupdate", this.timeupdateHandler);
  56501. }
  56502. addCue(originalCue) {
  56503. let cue = originalCue;
  56504. if (window_1.vttjs && !(originalCue instanceof window_1.vttjs.VTTCue)) {
  56505. cue = new window_1.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);
  56506. for (const prop in originalCue) {
  56507. if (!(prop in cue)) {
  56508. cue[prop] = originalCue[prop];
  56509. }
  56510. }
  56511. cue.id = originalCue.id;
  56512. cue.originalCue_ = originalCue;
  56513. }
  56514. const tracks = this.tech_.textTracks();
  56515. for (let i2 = 0; i2 < tracks.length; i2++) {
  56516. if (tracks[i2] !== this) {
  56517. tracks[i2].removeCue(cue);
  56518. }
  56519. }
  56520. this.cues_.push(cue);
  56521. this.cues.setCues_(this.cues_);
  56522. }
  56523. removeCue(removeCue) {
  56524. let i2 = this.cues_.length;
  56525. while (i2--) {
  56526. const cue = this.cues_[i2];
  56527. if (cue === removeCue || cue.originalCue_ && cue.originalCue_ === removeCue) {
  56528. this.cues_.splice(i2, 1);
  56529. this.cues.setCues_(this.cues_);
  56530. break;
  56531. }
  56532. }
  56533. }
  56534. }
  56535. TextTrack$1.prototype.allowedEvents_ = {
  56536. cuechange: "cuechange"
  56537. };
  56538. class AudioTrack$1 extends Track$1 {
  56539. constructor(options2 = {}) {
  56540. const settings = merge$1(options2, {
  56541. kind: AudioTrackKind$1[options2.kind] || ""
  56542. });
  56543. super(settings);
  56544. let enabled = false;
  56545. Object.defineProperty(this, "enabled", {
  56546. get() {
  56547. return enabled;
  56548. },
  56549. set(newEnabled) {
  56550. if (typeof newEnabled !== "boolean" || newEnabled === enabled) {
  56551. return;
  56552. }
  56553. enabled = newEnabled;
  56554. this.trigger("enabledchange");
  56555. }
  56556. });
  56557. if (settings.enabled) {
  56558. this.enabled = settings.enabled;
  56559. }
  56560. this.loaded_ = true;
  56561. }
  56562. }
  56563. class VideoTrack$1 extends Track$1 {
  56564. constructor(options2 = {}) {
  56565. const settings = merge$1(options2, {
  56566. kind: VideoTrackKind$1[options2.kind] || ""
  56567. });
  56568. super(settings);
  56569. let selected = false;
  56570. Object.defineProperty(this, "selected", {
  56571. get() {
  56572. return selected;
  56573. },
  56574. set(newSelected) {
  56575. if (typeof newSelected !== "boolean" || newSelected === selected) {
  56576. return;
  56577. }
  56578. selected = newSelected;
  56579. this.trigger("selectedchange");
  56580. }
  56581. });
  56582. if (settings.selected) {
  56583. this.selected = settings.selected;
  56584. }
  56585. }
  56586. }
  56587. class HTMLTrackElement$1 extends EventTarget$2$1 {
  56588. constructor(options2 = {}) {
  56589. super();
  56590. let readyState;
  56591. const track = new TextTrack$1(options2);
  56592. this.kind = track.kind;
  56593. this.src = track.src;
  56594. this.srclang = track.language;
  56595. this.label = track.label;
  56596. this.default = track.default;
  56597. Object.defineProperties(this, {
  56598. readyState: {
  56599. get() {
  56600. return readyState;
  56601. }
  56602. },
  56603. track: {
  56604. get() {
  56605. return track;
  56606. }
  56607. }
  56608. });
  56609. readyState = HTMLTrackElement$1.NONE;
  56610. track.addEventListener("loadeddata", () => {
  56611. readyState = HTMLTrackElement$1.LOADED;
  56612. this.trigger({
  56613. type: "load",
  56614. target: this
  56615. });
  56616. });
  56617. }
  56618. }
  56619. HTMLTrackElement$1.prototype.allowedEvents_ = {
  56620. load: "load"
  56621. };
  56622. HTMLTrackElement$1.NONE = 0;
  56623. HTMLTrackElement$1.LOADING = 1;
  56624. HTMLTrackElement$1.LOADED = 2;
  56625. HTMLTrackElement$1.ERROR = 3;
  56626. const NORMAL$1 = {
  56627. audio: {
  56628. ListClass: AudioTrackList$1,
  56629. TrackClass: AudioTrack$1,
  56630. capitalName: "Audio"
  56631. },
  56632. video: {
  56633. ListClass: VideoTrackList$1,
  56634. TrackClass: VideoTrack$1,
  56635. capitalName: "Video"
  56636. },
  56637. text: {
  56638. ListClass: TextTrackList$1,
  56639. TrackClass: TextTrack$1,
  56640. capitalName: "Text"
  56641. }
  56642. };
  56643. Object.keys(NORMAL$1).forEach(function(type2) {
  56644. NORMAL$1[type2].getterName = `${type2}Tracks`;
  56645. NORMAL$1[type2].privateName = `${type2}Tracks_`;
  56646. });
  56647. const REMOTE$1 = {
  56648. remoteText: {
  56649. ListClass: TextTrackList$1,
  56650. TrackClass: TextTrack$1,
  56651. capitalName: "RemoteText",
  56652. getterName: "remoteTextTracks",
  56653. privateName: "remoteTextTracks_"
  56654. },
  56655. remoteTextEl: {
  56656. ListClass: HtmlTrackElementList$1,
  56657. TrackClass: HTMLTrackElement$1,
  56658. capitalName: "RemoteTextTrackEls",
  56659. getterName: "remoteTextTrackEls",
  56660. privateName: "remoteTextTrackEls_"
  56661. }
  56662. };
  56663. const ALL$1 = Object.assign({}, NORMAL$1, REMOTE$1);
  56664. REMOTE$1.names = Object.keys(REMOTE$1);
  56665. NORMAL$1.names = Object.keys(NORMAL$1);
  56666. ALL$1.names = [].concat(REMOTE$1.names).concat(NORMAL$1.names);
  56667. function createTrackHelper$1(self2, kind, label, language, options2 = {}) {
  56668. const tracks = self2.textTracks();
  56669. options2.kind = kind;
  56670. if (label) {
  56671. options2.label = label;
  56672. }
  56673. if (language) {
  56674. options2.language = language;
  56675. }
  56676. options2.tech = self2;
  56677. const track = new ALL$1.text.TrackClass(options2);
  56678. tracks.addTrack(track);
  56679. return track;
  56680. }
  56681. class Tech$2 extends Component$1$1 {
  56682. constructor(options2 = {}, ready = function() {
  56683. }) {
  56684. options2.reportTouchActivity = false;
  56685. super(null, options2, ready);
  56686. this.onDurationChange_ = (e) => this.onDurationChange(e);
  56687. this.trackProgress_ = (e) => this.trackProgress(e);
  56688. this.trackCurrentTime_ = (e) => this.trackCurrentTime(e);
  56689. this.stopTrackingCurrentTime_ = (e) => this.stopTrackingCurrentTime(e);
  56690. this.disposeSourceHandler_ = (e) => this.disposeSourceHandler(e);
  56691. this.queuedHanders_ = /* @__PURE__ */ new Set();
  56692. this.hasStarted_ = false;
  56693. this.on("playing", function() {
  56694. this.hasStarted_ = true;
  56695. });
  56696. this.on("loadstart", function() {
  56697. this.hasStarted_ = false;
  56698. });
  56699. ALL$1.names.forEach((name) => {
  56700. const props = ALL$1[name];
  56701. if (options2 && options2[props.getterName]) {
  56702. this[props.privateName] = options2[props.getterName];
  56703. }
  56704. });
  56705. if (!this.featuresProgressEvents) {
  56706. this.manualProgressOn();
  56707. }
  56708. if (!this.featuresTimeupdateEvents) {
  56709. this.manualTimeUpdatesOn();
  56710. }
  56711. ["Text", "Audio", "Video"].forEach((track) => {
  56712. if (options2[`native${track}Tracks`] === false) {
  56713. this[`featuresNative${track}Tracks`] = false;
  56714. }
  56715. });
  56716. if (options2.nativeCaptions === false || options2.nativeTextTracks === false) {
  56717. this.featuresNativeTextTracks = false;
  56718. } else if (options2.nativeCaptions === true || options2.nativeTextTracks === true) {
  56719. this.featuresNativeTextTracks = true;
  56720. }
  56721. if (!this.featuresNativeTextTracks) {
  56722. this.emulateTextTracks();
  56723. }
  56724. this.preloadTextTracks = options2.preloadTextTracks !== false;
  56725. this.autoRemoteTextTracks_ = new ALL$1.text.ListClass();
  56726. this.initTrackListeners();
  56727. if (!options2.nativeControlsForTouch) {
  56728. this.emitTapEvents();
  56729. }
  56730. if (this.constructor) {
  56731. this.name_ = this.constructor.name || "Unknown Tech";
  56732. }
  56733. }
  56734. triggerSourceset(src) {
  56735. if (!this.isReady_) {
  56736. this.one("ready", () => this.setTimeout(() => this.triggerSourceset(src), 1));
  56737. }
  56738. this.trigger({
  56739. src,
  56740. type: "sourceset"
  56741. });
  56742. }
  56743. manualProgressOn() {
  56744. this.on("durationchange", this.onDurationChange_);
  56745. this.manualProgress = true;
  56746. this.one("ready", this.trackProgress_);
  56747. }
  56748. manualProgressOff() {
  56749. this.manualProgress = false;
  56750. this.stopTrackingProgress();
  56751. this.off("durationchange", this.onDurationChange_);
  56752. }
  56753. trackProgress(event2) {
  56754. this.stopTrackingProgress();
  56755. this.progressInterval = this.setInterval(bind_(this, function() {
  56756. const numBufferedPercent = this.bufferedPercent();
  56757. if (this.bufferedPercent_ !== numBufferedPercent) {
  56758. this.trigger("progress");
  56759. }
  56760. this.bufferedPercent_ = numBufferedPercent;
  56761. if (numBufferedPercent === 1) {
  56762. this.stopTrackingProgress();
  56763. }
  56764. }), 500);
  56765. }
  56766. onDurationChange(event2) {
  56767. this.duration_ = this.duration();
  56768. }
  56769. buffered() {
  56770. return createTimeRanges$1(0, 0);
  56771. }
  56772. bufferedPercent() {
  56773. return bufferedPercent$1(this.buffered(), this.duration_);
  56774. }
  56775. stopTrackingProgress() {
  56776. this.clearInterval(this.progressInterval);
  56777. }
  56778. manualTimeUpdatesOn() {
  56779. this.manualTimeUpdates = true;
  56780. this.on("play", this.trackCurrentTime_);
  56781. this.on("pause", this.stopTrackingCurrentTime_);
  56782. }
  56783. manualTimeUpdatesOff() {
  56784. this.manualTimeUpdates = false;
  56785. this.stopTrackingCurrentTime();
  56786. this.off("play", this.trackCurrentTime_);
  56787. this.off("pause", this.stopTrackingCurrentTime_);
  56788. }
  56789. trackCurrentTime() {
  56790. if (this.currentTimeInterval) {
  56791. this.stopTrackingCurrentTime();
  56792. }
  56793. this.currentTimeInterval = this.setInterval(function() {
  56794. this.trigger({
  56795. type: "timeupdate",
  56796. target: this,
  56797. manuallyTriggered: true
  56798. });
  56799. }, 250);
  56800. }
  56801. stopTrackingCurrentTime() {
  56802. this.clearInterval(this.currentTimeInterval);
  56803. this.trigger({
  56804. type: "timeupdate",
  56805. target: this,
  56806. manuallyTriggered: true
  56807. });
  56808. }
  56809. dispose() {
  56810. this.clearTracks(NORMAL$1.names);
  56811. if (this.manualProgress) {
  56812. this.manualProgressOff();
  56813. }
  56814. if (this.manualTimeUpdates) {
  56815. this.manualTimeUpdatesOff();
  56816. }
  56817. super.dispose();
  56818. }
  56819. clearTracks(types) {
  56820. types = [].concat(types);
  56821. types.forEach((type2) => {
  56822. const list = this[`${type2}Tracks`]() || [];
  56823. let i2 = list.length;
  56824. while (i2--) {
  56825. const track = list[i2];
  56826. if (type2 === "text") {
  56827. this.removeRemoteTextTrack(track);
  56828. }
  56829. list.removeTrack(track);
  56830. }
  56831. });
  56832. }
  56833. cleanupAutoTextTracks() {
  56834. const list = this.autoRemoteTextTracks_ || [];
  56835. let i2 = list.length;
  56836. while (i2--) {
  56837. const track = list[i2];
  56838. this.removeRemoteTextTrack(track);
  56839. }
  56840. }
  56841. reset() {
  56842. }
  56843. crossOrigin() {
  56844. }
  56845. setCrossOrigin() {
  56846. }
  56847. error(err) {
  56848. if (err !== void 0) {
  56849. this.error_ = new MediaError$1(err);
  56850. this.trigger("error");
  56851. }
  56852. return this.error_;
  56853. }
  56854. played() {
  56855. if (this.hasStarted_) {
  56856. return createTimeRanges$1(0, 0);
  56857. }
  56858. return createTimeRanges$1();
  56859. }
  56860. play() {
  56861. }
  56862. setScrubbing(_isScrubbing) {
  56863. }
  56864. scrubbing() {
  56865. }
  56866. setCurrentTime(_seconds) {
  56867. if (this.manualTimeUpdates) {
  56868. this.trigger({
  56869. type: "timeupdate",
  56870. target: this,
  56871. manuallyTriggered: true
  56872. });
  56873. }
  56874. }
  56875. initTrackListeners() {
  56876. NORMAL$1.names.forEach((name) => {
  56877. const props = NORMAL$1[name];
  56878. const trackListChanges = () => {
  56879. this.trigger(`${name}trackchange`);
  56880. };
  56881. const tracks = this[props.getterName]();
  56882. tracks.addEventListener("removetrack", trackListChanges);
  56883. tracks.addEventListener("addtrack", trackListChanges);
  56884. this.on("dispose", () => {
  56885. tracks.removeEventListener("removetrack", trackListChanges);
  56886. tracks.removeEventListener("addtrack", trackListChanges);
  56887. });
  56888. });
  56889. }
  56890. addWebVttScript_() {
  56891. if (window_1.WebVTT) {
  56892. return;
  56893. }
  56894. if (document_1.body.contains(this.el())) {
  56895. if (!this.options_["vtt.js"] && isPlain$1(vtt) && Object.keys(vtt).length > 0) {
  56896. this.trigger("vttjsloaded");
  56897. return;
  56898. }
  56899. const script = document_1.createElement("script");
  56900. script.src = this.options_["vtt.js"] || "https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";
  56901. script.onload = () => {
  56902. this.trigger("vttjsloaded");
  56903. };
  56904. script.onerror = () => {
  56905. this.trigger("vttjserror");
  56906. };
  56907. this.on("dispose", () => {
  56908. script.onload = null;
  56909. script.onerror = null;
  56910. });
  56911. window_1.WebVTT = true;
  56912. this.el().parentNode.appendChild(script);
  56913. } else {
  56914. this.ready(this.addWebVttScript_);
  56915. }
  56916. }
  56917. emulateTextTracks() {
  56918. const tracks = this.textTracks();
  56919. const remoteTracks = this.remoteTextTracks();
  56920. const handleAddTrack = (e) => tracks.addTrack(e.track);
  56921. const handleRemoveTrack = (e) => tracks.removeTrack(e.track);
  56922. remoteTracks.on("addtrack", handleAddTrack);
  56923. remoteTracks.on("removetrack", handleRemoveTrack);
  56924. this.addWebVttScript_();
  56925. const updateDisplay = () => this.trigger("texttrackchange");
  56926. const textTracksChanges = () => {
  56927. updateDisplay();
  56928. for (let i2 = 0; i2 < tracks.length; i2++) {
  56929. const track = tracks[i2];
  56930. track.removeEventListener("cuechange", updateDisplay);
  56931. if (track.mode === "showing") {
  56932. track.addEventListener("cuechange", updateDisplay);
  56933. }
  56934. }
  56935. };
  56936. textTracksChanges();
  56937. tracks.addEventListener("change", textTracksChanges);
  56938. tracks.addEventListener("addtrack", textTracksChanges);
  56939. tracks.addEventListener("removetrack", textTracksChanges);
  56940. this.on("dispose", function() {
  56941. remoteTracks.off("addtrack", handleAddTrack);
  56942. remoteTracks.off("removetrack", handleRemoveTrack);
  56943. tracks.removeEventListener("change", textTracksChanges);
  56944. tracks.removeEventListener("addtrack", textTracksChanges);
  56945. tracks.removeEventListener("removetrack", textTracksChanges);
  56946. for (let i2 = 0; i2 < tracks.length; i2++) {
  56947. const track = tracks[i2];
  56948. track.removeEventListener("cuechange", updateDisplay);
  56949. }
  56950. });
  56951. }
  56952. addTextTrack(kind, label, language) {
  56953. if (!kind) {
  56954. throw new Error("TextTrack kind is required but was not provided");
  56955. }
  56956. return createTrackHelper$1(this, kind, label, language);
  56957. }
  56958. createRemoteTextTrack(options2) {
  56959. const track = merge$1(options2, {
  56960. tech: this
  56961. });
  56962. return new REMOTE$1.remoteTextEl.TrackClass(track);
  56963. }
  56964. addRemoteTextTrack(options2 = {}, manualCleanup) {
  56965. const htmlTrackElement = this.createRemoteTextTrack(options2);
  56966. if (typeof manualCleanup !== "boolean") {
  56967. manualCleanup = false;
  56968. }
  56969. this.remoteTextTrackEls().addTrackElement_(htmlTrackElement);
  56970. this.remoteTextTracks().addTrack(htmlTrackElement.track);
  56971. if (manualCleanup === false) {
  56972. this.ready(() => this.autoRemoteTextTracks_.addTrack(htmlTrackElement.track));
  56973. }
  56974. return htmlTrackElement;
  56975. }
  56976. removeRemoteTextTrack(track) {
  56977. const trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track);
  56978. this.remoteTextTrackEls().removeTrackElement_(trackElement);
  56979. this.remoteTextTracks().removeTrack(track);
  56980. this.autoRemoteTextTracks_.removeTrack(track);
  56981. }
  56982. getVideoPlaybackQuality() {
  56983. return {};
  56984. }
  56985. requestPictureInPicture() {
  56986. return Promise.reject();
  56987. }
  56988. disablePictureInPicture() {
  56989. return true;
  56990. }
  56991. setDisablePictureInPicture() {
  56992. }
  56993. requestVideoFrameCallback(cb) {
  56994. const id = newGUID$1();
  56995. if (!this.isReady_ || this.paused()) {
  56996. this.queuedHanders_.add(id);
  56997. this.one("playing", () => {
  56998. if (this.queuedHanders_.has(id)) {
  56999. this.queuedHanders_.delete(id);
  57000. cb();
  57001. }
  57002. });
  57003. } else {
  57004. this.requestNamedAnimationFrame(id, cb);
  57005. }
  57006. return id;
  57007. }
  57008. cancelVideoFrameCallback(id) {
  57009. if (this.queuedHanders_.has(id)) {
  57010. this.queuedHanders_.delete(id);
  57011. } else {
  57012. this.cancelNamedAnimationFrame(id);
  57013. }
  57014. }
  57015. setPoster() {
  57016. }
  57017. playsinline() {
  57018. }
  57019. setPlaysinline() {
  57020. }
  57021. overrideNativeAudioTracks(override) {
  57022. }
  57023. overrideNativeVideoTracks(override) {
  57024. }
  57025. canPlayType(_type) {
  57026. return "";
  57027. }
  57028. static canPlayType(_type) {
  57029. return "";
  57030. }
  57031. static canPlaySource(srcObj, options2) {
  57032. return Tech$2.canPlayType(srcObj.type);
  57033. }
  57034. static isTech(component) {
  57035. return component.prototype instanceof Tech$2 || component instanceof Tech$2 || component === Tech$2;
  57036. }
  57037. static registerTech(name, tech) {
  57038. if (!Tech$2.techs_) {
  57039. Tech$2.techs_ = {};
  57040. }
  57041. if (!Tech$2.isTech(tech)) {
  57042. throw new Error(`Tech ${name} must be a Tech`);
  57043. }
  57044. if (!Tech$2.canPlayType) {
  57045. throw new Error("Techs must have a static canPlayType method on them");
  57046. }
  57047. if (!Tech$2.canPlaySource) {
  57048. throw new Error("Techs must have a static canPlaySource method on them");
  57049. }
  57050. name = toTitleCase$1$1(name);
  57051. Tech$2.techs_[name] = tech;
  57052. Tech$2.techs_[toLowerCase$1(name)] = tech;
  57053. if (name !== "Tech") {
  57054. Tech$2.defaultTechOrder_.push(name);
  57055. }
  57056. return tech;
  57057. }
  57058. static getTech(name) {
  57059. if (!name) {
  57060. return;
  57061. }
  57062. if (Tech$2.techs_ && Tech$2.techs_[name]) {
  57063. return Tech$2.techs_[name];
  57064. }
  57065. name = toTitleCase$1$1(name);
  57066. if (window_1 && window_1.videojs && window_1.videojs[name]) {
  57067. log$1$1.warn(`The ${name} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`);
  57068. return window_1.videojs[name];
  57069. }
  57070. }
  57071. }
  57072. ALL$1.names.forEach(function(name) {
  57073. const props = ALL$1[name];
  57074. Tech$2.prototype[props.getterName] = function() {
  57075. this[props.privateName] = this[props.privateName] || new props.ListClass();
  57076. return this[props.privateName];
  57077. };
  57078. });
  57079. Tech$2.prototype.featuresVolumeControl = true;
  57080. Tech$2.prototype.featuresMuteControl = true;
  57081. Tech$2.prototype.featuresFullscreenResize = false;
  57082. Tech$2.prototype.featuresPlaybackRate = false;
  57083. Tech$2.prototype.featuresProgressEvents = false;
  57084. Tech$2.prototype.featuresSourceset = false;
  57085. Tech$2.prototype.featuresTimeupdateEvents = false;
  57086. Tech$2.prototype.featuresNativeTextTracks = false;
  57087. Tech$2.prototype.featuresVideoFrameCallback = false;
  57088. Tech$2.withSourceHandlers = function(_Tech) {
  57089. _Tech.registerSourceHandler = function(handler, index2) {
  57090. let handlers = _Tech.sourceHandlers;
  57091. if (!handlers) {
  57092. handlers = _Tech.sourceHandlers = [];
  57093. }
  57094. if (index2 === void 0) {
  57095. index2 = handlers.length;
  57096. }
  57097. handlers.splice(index2, 0, handler);
  57098. };
  57099. _Tech.canPlayType = function(type2) {
  57100. const handlers = _Tech.sourceHandlers || [];
  57101. let can;
  57102. for (let i2 = 0; i2 < handlers.length; i2++) {
  57103. can = handlers[i2].canPlayType(type2);
  57104. if (can) {
  57105. return can;
  57106. }
  57107. }
  57108. return "";
  57109. };
  57110. _Tech.selectSourceHandler = function(source, options2) {
  57111. const handlers = _Tech.sourceHandlers || [];
  57112. let can;
  57113. for (let i2 = 0; i2 < handlers.length; i2++) {
  57114. can = handlers[i2].canHandleSource(source, options2);
  57115. if (can) {
  57116. return handlers[i2];
  57117. }
  57118. }
  57119. return null;
  57120. };
  57121. _Tech.canPlaySource = function(srcObj, options2) {
  57122. const sh = _Tech.selectSourceHandler(srcObj, options2);
  57123. if (sh) {
  57124. return sh.canHandleSource(srcObj, options2);
  57125. }
  57126. return "";
  57127. };
  57128. const deferrable = ["seekable", "seeking", "duration"];
  57129. deferrable.forEach(function(fnName) {
  57130. const originalFn = this[fnName];
  57131. if (typeof originalFn !== "function") {
  57132. return;
  57133. }
  57134. this[fnName] = function() {
  57135. if (this.sourceHandler_ && this.sourceHandler_[fnName]) {
  57136. return this.sourceHandler_[fnName].apply(this.sourceHandler_, arguments);
  57137. }
  57138. return originalFn.apply(this, arguments);
  57139. };
  57140. }, _Tech.prototype);
  57141. _Tech.prototype.setSource = function(source) {
  57142. let sh = _Tech.selectSourceHandler(source, this.options_);
  57143. if (!sh) {
  57144. if (_Tech.nativeSourceHandler) {
  57145. sh = _Tech.nativeSourceHandler;
  57146. } else {
  57147. log$1$1.error("No source handler found for the current source.");
  57148. }
  57149. }
  57150. this.disposeSourceHandler();
  57151. this.off("dispose", this.disposeSourceHandler_);
  57152. if (sh !== _Tech.nativeSourceHandler) {
  57153. this.currentSource_ = source;
  57154. }
  57155. this.sourceHandler_ = sh.handleSource(source, this, this.options_);
  57156. this.one("dispose", this.disposeSourceHandler_);
  57157. };
  57158. _Tech.prototype.disposeSourceHandler = function() {
  57159. if (this.currentSource_) {
  57160. this.clearTracks(["audio", "video"]);
  57161. this.currentSource_ = null;
  57162. }
  57163. this.cleanupAutoTextTracks();
  57164. if (this.sourceHandler_) {
  57165. if (this.sourceHandler_.dispose) {
  57166. this.sourceHandler_.dispose();
  57167. }
  57168. this.sourceHandler_ = null;
  57169. }
  57170. };
  57171. };
  57172. Component$1$1.registerComponent("Tech", Tech$2);
  57173. Tech$2.registerTech("Tech", Tech$2);
  57174. Tech$2.defaultTechOrder_ = [];
  57175. const middlewares$1 = {};
  57176. const middlewareInstances$1 = {};
  57177. const TERMINATOR$1 = {};
  57178. function use$1(type2, middleware) {
  57179. middlewares$1[type2] = middlewares$1[type2] || [];
  57180. middlewares$1[type2].push(middleware);
  57181. }
  57182. function setSource$1(player, src, next) {
  57183. player.setTimeout(() => setSourceHelper$1(src, middlewares$1[src.type], next, player), 1);
  57184. }
  57185. function setTech$1(middleware, tech) {
  57186. middleware.forEach((mw) => mw.setTech && mw.setTech(tech));
  57187. }
  57188. function get$1(middleware, tech, method) {
  57189. return middleware.reduceRight(middlewareIterator$1(method), tech[method]());
  57190. }
  57191. function set$1(middleware, tech, method, arg) {
  57192. return tech[method](middleware.reduce(middlewareIterator$1(method), arg));
  57193. }
  57194. function mediate$1(middleware, tech, method, arg = null) {
  57195. const callMethod = "call" + toTitleCase$1$1(method);
  57196. const middlewareValue = middleware.reduce(middlewareIterator$1(callMethod), arg);
  57197. const terminated = middlewareValue === TERMINATOR$1;
  57198. const returnValue = terminated ? null : tech[method](middlewareValue);
  57199. executeRight$1(middleware, method, returnValue, terminated);
  57200. return returnValue;
  57201. }
  57202. const allowedGetters$1 = {
  57203. buffered: 1,
  57204. currentTime: 1,
  57205. duration: 1,
  57206. muted: 1,
  57207. played: 1,
  57208. paused: 1,
  57209. seekable: 1,
  57210. volume: 1,
  57211. ended: 1
  57212. };
  57213. const allowedSetters$1 = {
  57214. setCurrentTime: 1,
  57215. setMuted: 1,
  57216. setVolume: 1
  57217. };
  57218. const allowedMediators$1 = {
  57219. play: 1,
  57220. pause: 1
  57221. };
  57222. function middlewareIterator$1(method) {
  57223. return (value, mw) => {
  57224. if (value === TERMINATOR$1) {
  57225. return TERMINATOR$1;
  57226. }
  57227. if (mw[method]) {
  57228. return mw[method](value);
  57229. }
  57230. return value;
  57231. };
  57232. }
  57233. function executeRight$1(mws, method, value, terminated) {
  57234. for (let i2 = mws.length - 1; i2 >= 0; i2--) {
  57235. const mw = mws[i2];
  57236. if (mw[method]) {
  57237. mw[method](terminated, value);
  57238. }
  57239. }
  57240. }
  57241. function clearCacheForPlayer$1(player) {
  57242. middlewareInstances$1[player.id()] = null;
  57243. }
  57244. function getOrCreateFactory$1(player, mwFactory) {
  57245. const mws = middlewareInstances$1[player.id()];
  57246. let mw = null;
  57247. if (mws === void 0 || mws === null) {
  57248. mw = mwFactory(player);
  57249. middlewareInstances$1[player.id()] = [[mwFactory, mw]];
  57250. return mw;
  57251. }
  57252. for (let i2 = 0; i2 < mws.length; i2++) {
  57253. const [mwf, mwi] = mws[i2];
  57254. if (mwf !== mwFactory) {
  57255. continue;
  57256. }
  57257. mw = mwi;
  57258. }
  57259. if (mw === null) {
  57260. mw = mwFactory(player);
  57261. mws.push([mwFactory, mw]);
  57262. }
  57263. return mw;
  57264. }
  57265. function setSourceHelper$1(src = {}, middleware = [], next, player, acc = [], lastRun = false) {
  57266. const [mwFactory, ...mwrest] = middleware;
  57267. if (typeof mwFactory === "string") {
  57268. setSourceHelper$1(src, middlewares$1[mwFactory], next, player, acc, lastRun);
  57269. } else if (mwFactory) {
  57270. const mw = getOrCreateFactory$1(player, mwFactory);
  57271. if (!mw.setSource) {
  57272. acc.push(mw);
  57273. return setSourceHelper$1(src, mwrest, next, player, acc, lastRun);
  57274. }
  57275. mw.setSource(Object.assign({}, src), function(err, _src) {
  57276. if (err) {
  57277. return setSourceHelper$1(src, mwrest, next, player, acc, lastRun);
  57278. }
  57279. acc.push(mw);
  57280. setSourceHelper$1(_src, src.type === _src.type ? mwrest : middlewares$1[_src.type], next, player, acc, lastRun);
  57281. });
  57282. } else if (mwrest.length) {
  57283. setSourceHelper$1(src, mwrest, next, player, acc, lastRun);
  57284. } else if (lastRun) {
  57285. next(src, acc);
  57286. } else {
  57287. setSourceHelper$1(src, middlewares$1["*"], next, player, acc, true);
  57288. }
  57289. }
  57290. const MimetypesKind$1 = {
  57291. opus: "video/ogg",
  57292. ogv: "video/ogg",
  57293. mp4: "video/mp4",
  57294. mov: "video/mp4",
  57295. m4v: "video/mp4",
  57296. mkv: "video/x-matroska",
  57297. m4a: "audio/mp4",
  57298. mp3: "audio/mpeg",
  57299. aac: "audio/aac",
  57300. caf: "audio/x-caf",
  57301. flac: "audio/flac",
  57302. oga: "audio/ogg",
  57303. wav: "audio/wav",
  57304. m3u8: "application/x-mpegURL",
  57305. mpd: "application/dash+xml",
  57306. jpg: "image/jpeg",
  57307. jpeg: "image/jpeg",
  57308. gif: "image/gif",
  57309. png: "image/png",
  57310. svg: "image/svg+xml",
  57311. webp: "image/webp"
  57312. };
  57313. const getMimetype$1 = function(src = "") {
  57314. const ext = getFileExtension$1(src);
  57315. const mimetype = MimetypesKind$1[ext.toLowerCase()];
  57316. return mimetype || "";
  57317. };
  57318. const findMimetype$1 = (player, src) => {
  57319. if (!src) {
  57320. return "";
  57321. }
  57322. if (player.cache_.source.src === src && player.cache_.source.type) {
  57323. return player.cache_.source.type;
  57324. }
  57325. const matchingSources = player.cache_.sources.filter((s) => s.src === src);
  57326. if (matchingSources.length) {
  57327. return matchingSources[0].type;
  57328. }
  57329. const sources = player.$$("source");
  57330. for (let i2 = 0; i2 < sources.length; i2++) {
  57331. const s = sources[i2];
  57332. if (s.type && s.src && s.src === src) {
  57333. return s.type;
  57334. }
  57335. }
  57336. return getMimetype$1(src);
  57337. };
  57338. const filterSource$1 = function(src) {
  57339. if (Array.isArray(src)) {
  57340. let newsrc = [];
  57341. src.forEach(function(srcobj) {
  57342. srcobj = filterSource$1(srcobj);
  57343. if (Array.isArray(srcobj)) {
  57344. newsrc = newsrc.concat(srcobj);
  57345. } else if (isObject$2(srcobj)) {
  57346. newsrc.push(srcobj);
  57347. }
  57348. });
  57349. src = newsrc;
  57350. } else if (typeof src === "string" && src.trim()) {
  57351. src = [fixSource$1({
  57352. src
  57353. })];
  57354. } else if (isObject$2(src) && typeof src.src === "string" && src.src && src.src.trim()) {
  57355. src = [fixSource$1(src)];
  57356. } else {
  57357. src = [];
  57358. }
  57359. return src;
  57360. };
  57361. function fixSource$1(src) {
  57362. if (!src.type) {
  57363. const mimetype = getMimetype$1(src.src);
  57364. if (mimetype) {
  57365. src.type = mimetype;
  57366. }
  57367. }
  57368. return src;
  57369. }
  57370. class MediaLoader$1 extends Component$1$1 {
  57371. constructor(player, options2, ready) {
  57372. const options_ = merge$1({
  57373. createEl: false
  57374. }, options2);
  57375. super(player, options_, ready);
  57376. if (!options2.playerOptions.sources || options2.playerOptions.sources.length === 0) {
  57377. for (let i2 = 0, j = options2.playerOptions.techOrder; i2 < j.length; i2++) {
  57378. const techName = toTitleCase$1$1(j[i2]);
  57379. let tech = Tech$2.getTech(techName);
  57380. if (!techName) {
  57381. tech = Component$1$1.getComponent(techName);
  57382. }
  57383. if (tech && tech.isSupported()) {
  57384. player.loadTech_(techName);
  57385. break;
  57386. }
  57387. }
  57388. } else {
  57389. player.src(options2.playerOptions.sources);
  57390. }
  57391. }
  57392. }
  57393. Component$1$1.registerComponent("MediaLoader", MediaLoader$1);
  57394. class ClickableComponent$1 extends Component$1$1 {
  57395. constructor(player, options2) {
  57396. super(player, options2);
  57397. if (this.options_.controlText) {
  57398. this.controlText(this.options_.controlText);
  57399. }
  57400. this.handleMouseOver_ = (e) => this.handleMouseOver(e);
  57401. this.handleMouseOut_ = (e) => this.handleMouseOut(e);
  57402. this.handleClick_ = (e) => this.handleClick(e);
  57403. this.handleKeyDown_ = (e) => this.handleKeyDown(e);
  57404. this.emitTapEvents();
  57405. this.enable();
  57406. }
  57407. createEl(tag = "div", props = {}, attributes = {}) {
  57408. props = Object.assign({
  57409. className: this.buildCSSClass(),
  57410. tabIndex: 0
  57411. }, props);
  57412. if (tag === "button") {
  57413. log$1$1.error(`Creating a ClickableComponent with an HTML element of ${tag} is not supported; use a Button instead.`);
  57414. }
  57415. attributes = Object.assign({
  57416. role: "button"
  57417. }, attributes);
  57418. this.tabIndex_ = props.tabIndex;
  57419. const el = createEl$1(tag, props, attributes);
  57420. el.appendChild(createEl$1("span", {
  57421. className: "vjs-icon-placeholder"
  57422. }, {
  57423. "aria-hidden": true
  57424. }));
  57425. this.createControlTextEl(el);
  57426. return el;
  57427. }
  57428. dispose() {
  57429. this.controlTextEl_ = null;
  57430. super.dispose();
  57431. }
  57432. createControlTextEl(el) {
  57433. this.controlTextEl_ = createEl$1("span", {
  57434. className: "vjs-control-text"
  57435. }, {
  57436. "aria-live": "polite"
  57437. });
  57438. if (el) {
  57439. el.appendChild(this.controlTextEl_);
  57440. }
  57441. this.controlText(this.controlText_, el);
  57442. return this.controlTextEl_;
  57443. }
  57444. controlText(text, el = this.el()) {
  57445. if (text === void 0) {
  57446. return this.controlText_ || "Need Text";
  57447. }
  57448. const localizedText = this.localize(text);
  57449. this.controlText_ = text;
  57450. textContent$1(this.controlTextEl_, localizedText);
  57451. if (!this.nonIconControl && !this.player_.options_.noUITitleAttributes) {
  57452. el.setAttribute("title", localizedText);
  57453. }
  57454. }
  57455. buildCSSClass() {
  57456. return `vjs-control vjs-button ${super.buildCSSClass()}`;
  57457. }
  57458. enable() {
  57459. if (!this.enabled_) {
  57460. this.enabled_ = true;
  57461. this.removeClass("vjs-disabled");
  57462. this.el_.setAttribute("aria-disabled", "false");
  57463. if (typeof this.tabIndex_ !== "undefined") {
  57464. this.el_.setAttribute("tabIndex", this.tabIndex_);
  57465. }
  57466. this.on(["tap", "click"], this.handleClick_);
  57467. this.on("keydown", this.handleKeyDown_);
  57468. }
  57469. }
  57470. disable() {
  57471. this.enabled_ = false;
  57472. this.addClass("vjs-disabled");
  57473. this.el_.setAttribute("aria-disabled", "true");
  57474. if (typeof this.tabIndex_ !== "undefined") {
  57475. this.el_.removeAttribute("tabIndex");
  57476. }
  57477. this.off("mouseover", this.handleMouseOver_);
  57478. this.off("mouseout", this.handleMouseOut_);
  57479. this.off(["tap", "click"], this.handleClick_);
  57480. this.off("keydown", this.handleKeyDown_);
  57481. }
  57482. handleLanguagechange() {
  57483. this.controlText(this.controlText_);
  57484. }
  57485. handleClick(event2) {
  57486. if (this.options_.clickHandler) {
  57487. this.options_.clickHandler.call(this, arguments);
  57488. }
  57489. }
  57490. handleKeyDown(event2) {
  57491. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  57492. event2.preventDefault();
  57493. event2.stopPropagation();
  57494. this.trigger("click");
  57495. } else {
  57496. super.handleKeyDown(event2);
  57497. }
  57498. }
  57499. }
  57500. Component$1$1.registerComponent("ClickableComponent", ClickableComponent$1);
  57501. class PosterImage$1 extends ClickableComponent$1 {
  57502. constructor(player, options2) {
  57503. super(player, options2);
  57504. this.update();
  57505. this.update_ = (e) => this.update(e);
  57506. player.on("posterchange", this.update_);
  57507. }
  57508. dispose() {
  57509. this.player().off("posterchange", this.update_);
  57510. super.dispose();
  57511. }
  57512. createEl() {
  57513. return createEl$1("div", {
  57514. className: "vjs-poster"
  57515. });
  57516. }
  57517. crossOrigin(value) {
  57518. if (typeof value === "undefined") {
  57519. if (this.$("img")) {
  57520. return this.$("img").crossOrigin;
  57521. } else if (this.player_.tech_ && this.player_.tech_.isReady_) {
  57522. return this.player_.crossOrigin();
  57523. }
  57524. return this.player_.options_.crossOrigin || this.player_.options_.crossorigin || null;
  57525. }
  57526. if (value !== null && value !== "anonymous" && value !== "use-credentials") {
  57527. this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${value}"`);
  57528. return;
  57529. }
  57530. if (this.$("img")) {
  57531. this.$("img").crossOrigin = value;
  57532. }
  57533. return;
  57534. }
  57535. update(event2) {
  57536. const url = this.player().poster();
  57537. this.setSrc(url);
  57538. if (url) {
  57539. this.show();
  57540. } else {
  57541. this.hide();
  57542. }
  57543. }
  57544. setSrc(url) {
  57545. if (!url) {
  57546. this.el_.textContent = "";
  57547. return;
  57548. }
  57549. if (!this.$("img")) {
  57550. this.el_.appendChild(createEl$1("picture", {
  57551. className: "vjs-poster",
  57552. tabIndex: -1
  57553. }, {}, createEl$1("img", {
  57554. loading: "lazy",
  57555. crossOrigin: this.crossOrigin()
  57556. }, {
  57557. alt: ""
  57558. })));
  57559. }
  57560. this.$("img").src = url;
  57561. }
  57562. handleClick(event2) {
  57563. if (!this.player_.controls()) {
  57564. return;
  57565. }
  57566. if (this.player_.tech(true)) {
  57567. this.player_.tech(true).focus();
  57568. }
  57569. if (this.player_.paused()) {
  57570. silencePromise$1(this.player_.play());
  57571. } else {
  57572. this.player_.pause();
  57573. }
  57574. }
  57575. }
  57576. PosterImage$1.prototype.crossorigin = PosterImage$1.prototype.crossOrigin;
  57577. Component$1$1.registerComponent("PosterImage", PosterImage$1);
  57578. const darkGray$1 = "#222";
  57579. const lightGray$1 = "#ccc";
  57580. const fontMap$1 = {
  57581. monospace: "monospace",
  57582. sansSerif: "sans-serif",
  57583. serif: "serif",
  57584. monospaceSansSerif: '"Andale Mono", "Lucida Console", monospace',
  57585. monospaceSerif: '"Courier New", monospace',
  57586. proportionalSansSerif: "sans-serif",
  57587. proportionalSerif: "serif",
  57588. casual: '"Comic Sans MS", Impact, fantasy',
  57589. script: '"Monotype Corsiva", cursive',
  57590. smallcaps: '"Andale Mono", "Lucida Console", monospace, sans-serif'
  57591. };
  57592. function constructColor$1(color2, opacity) {
  57593. let hex;
  57594. if (color2.length === 4) {
  57595. hex = color2[1] + color2[1] + color2[2] + color2[2] + color2[3] + color2[3];
  57596. } else if (color2.length === 7) {
  57597. hex = color2.slice(1);
  57598. } else {
  57599. throw new Error("Invalid color code provided, " + color2 + "; must be formatted as e.g. #f0e or #f604e2.");
  57600. }
  57601. return "rgba(" + parseInt(hex.slice(0, 2), 16) + "," + parseInt(hex.slice(2, 4), 16) + "," + parseInt(hex.slice(4, 6), 16) + "," + opacity + ")";
  57602. }
  57603. function tryUpdateStyle$1(el, style, rule) {
  57604. try {
  57605. el.style[style] = rule;
  57606. } catch (e) {
  57607. return;
  57608. }
  57609. }
  57610. class TextTrackDisplay$1 extends Component$1$1 {
  57611. constructor(player, options2, ready) {
  57612. super(player, options2, ready);
  57613. const updateDisplayHandler = (e) => this.updateDisplay(e);
  57614. player.on("loadstart", (e) => this.toggleDisplay(e));
  57615. player.on("texttrackchange", updateDisplayHandler);
  57616. player.on("loadedmetadata", (e) => this.preselectTrack(e));
  57617. player.ready(bind_(this, function() {
  57618. if (player.tech_ && player.tech_.featuresNativeTextTracks) {
  57619. this.hide();
  57620. return;
  57621. }
  57622. player.on("fullscreenchange", updateDisplayHandler);
  57623. player.on("playerresize", updateDisplayHandler);
  57624. const screenOrientation = window_1.screen.orientation || window_1;
  57625. const changeOrientationEvent = window_1.screen.orientation ? "change" : "orientationchange";
  57626. screenOrientation.addEventListener(changeOrientationEvent, updateDisplayHandler);
  57627. player.on("dispose", () => screenOrientation.removeEventListener(changeOrientationEvent, updateDisplayHandler));
  57628. const tracks = this.options_.playerOptions.tracks || [];
  57629. for (let i2 = 0; i2 < tracks.length; i2++) {
  57630. this.player_.addRemoteTextTrack(tracks[i2], true);
  57631. }
  57632. this.preselectTrack();
  57633. }));
  57634. }
  57635. preselectTrack() {
  57636. const modes = {
  57637. captions: 1,
  57638. subtitles: 1
  57639. };
  57640. const trackList = this.player_.textTracks();
  57641. const userPref = this.player_.cache_.selectedLanguage;
  57642. let firstDesc;
  57643. let firstCaptions;
  57644. let preferredTrack;
  57645. for (let i2 = 0; i2 < trackList.length; i2++) {
  57646. const track = trackList[i2];
  57647. if (userPref && userPref.enabled && userPref.language && userPref.language === track.language && track.kind in modes) {
  57648. if (track.kind === userPref.kind) {
  57649. preferredTrack = track;
  57650. } else if (!preferredTrack) {
  57651. preferredTrack = track;
  57652. }
  57653. } else if (userPref && !userPref.enabled) {
  57654. preferredTrack = null;
  57655. firstDesc = null;
  57656. firstCaptions = null;
  57657. } else if (track.default) {
  57658. if (track.kind === "descriptions" && !firstDesc) {
  57659. firstDesc = track;
  57660. } else if (track.kind in modes && !firstCaptions) {
  57661. firstCaptions = track;
  57662. }
  57663. }
  57664. }
  57665. if (preferredTrack) {
  57666. preferredTrack.mode = "showing";
  57667. } else if (firstCaptions) {
  57668. firstCaptions.mode = "showing";
  57669. } else if (firstDesc) {
  57670. firstDesc.mode = "showing";
  57671. }
  57672. }
  57673. toggleDisplay() {
  57674. if (this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks) {
  57675. this.hide();
  57676. } else {
  57677. this.show();
  57678. }
  57679. }
  57680. createEl() {
  57681. return super.createEl("div", {
  57682. className: "vjs-text-track-display"
  57683. }, {
  57684. "translate": "yes",
  57685. "aria-live": "off",
  57686. "aria-atomic": "true"
  57687. });
  57688. }
  57689. clearDisplay() {
  57690. if (typeof window_1.WebVTT === "function") {
  57691. window_1.WebVTT.processCues(window_1, [], this.el_);
  57692. }
  57693. }
  57694. updateDisplay() {
  57695. const tracks = this.player_.textTracks();
  57696. const allowMultipleShowingTracks = this.options_.allowMultipleShowingTracks;
  57697. this.clearDisplay();
  57698. if (allowMultipleShowingTracks) {
  57699. const showingTracks = [];
  57700. for (let i3 = 0; i3 < tracks.length; ++i3) {
  57701. const track = tracks[i3];
  57702. if (track.mode !== "showing") {
  57703. continue;
  57704. }
  57705. showingTracks.push(track);
  57706. }
  57707. this.updateForTrack(showingTracks);
  57708. return;
  57709. }
  57710. let descriptionsTrack = null;
  57711. let captionsSubtitlesTrack = null;
  57712. let i2 = tracks.length;
  57713. while (i2--) {
  57714. const track = tracks[i2];
  57715. if (track.mode === "showing") {
  57716. if (track.kind === "descriptions") {
  57717. descriptionsTrack = track;
  57718. } else {
  57719. captionsSubtitlesTrack = track;
  57720. }
  57721. }
  57722. }
  57723. if (captionsSubtitlesTrack) {
  57724. if (this.getAttribute("aria-live") !== "off") {
  57725. this.setAttribute("aria-live", "off");
  57726. }
  57727. this.updateForTrack(captionsSubtitlesTrack);
  57728. } else if (descriptionsTrack) {
  57729. if (this.getAttribute("aria-live") !== "assertive") {
  57730. this.setAttribute("aria-live", "assertive");
  57731. }
  57732. this.updateForTrack(descriptionsTrack);
  57733. }
  57734. }
  57735. updateDisplayState(track) {
  57736. const overrides = this.player_.textTrackSettings.getValues();
  57737. const cues = track.activeCues;
  57738. let i2 = cues.length;
  57739. while (i2--) {
  57740. const cue = cues[i2];
  57741. if (!cue) {
  57742. continue;
  57743. }
  57744. const cueDiv = cue.displayState;
  57745. if (overrides.color) {
  57746. cueDiv.firstChild.style.color = overrides.color;
  57747. }
  57748. if (overrides.textOpacity) {
  57749. tryUpdateStyle$1(cueDiv.firstChild, "color", constructColor$1(overrides.color || "#fff", overrides.textOpacity));
  57750. }
  57751. if (overrides.backgroundColor) {
  57752. cueDiv.firstChild.style.backgroundColor = overrides.backgroundColor;
  57753. }
  57754. if (overrides.backgroundOpacity) {
  57755. tryUpdateStyle$1(cueDiv.firstChild, "backgroundColor", constructColor$1(overrides.backgroundColor || "#000", overrides.backgroundOpacity));
  57756. }
  57757. if (overrides.windowColor) {
  57758. if (overrides.windowOpacity) {
  57759. tryUpdateStyle$1(cueDiv, "backgroundColor", constructColor$1(overrides.windowColor, overrides.windowOpacity));
  57760. } else {
  57761. cueDiv.style.backgroundColor = overrides.windowColor;
  57762. }
  57763. }
  57764. if (overrides.edgeStyle) {
  57765. if (overrides.edgeStyle === "dropshadow") {
  57766. cueDiv.firstChild.style.textShadow = `2px 2px 3px ${darkGray$1}, 2px 2px 4px ${darkGray$1}, 2px 2px 5px ${darkGray$1}`;
  57767. } else if (overrides.edgeStyle === "raised") {
  57768. cueDiv.firstChild.style.textShadow = `1px 1px ${darkGray$1}, 2px 2px ${darkGray$1}, 3px 3px ${darkGray$1}`;
  57769. } else if (overrides.edgeStyle === "depressed") {
  57770. cueDiv.firstChild.style.textShadow = `1px 1px ${lightGray$1}, 0 1px ${lightGray$1}, -1px -1px ${darkGray$1}, 0 -1px ${darkGray$1}`;
  57771. } else if (overrides.edgeStyle === "uniform") {
  57772. cueDiv.firstChild.style.textShadow = `0 0 4px ${darkGray$1}, 0 0 4px ${darkGray$1}, 0 0 4px ${darkGray$1}, 0 0 4px ${darkGray$1}`;
  57773. }
  57774. }
  57775. if (overrides.fontPercent && overrides.fontPercent !== 1) {
  57776. const fontSize = window_1.parseFloat(cueDiv.style.fontSize);
  57777. cueDiv.style.fontSize = fontSize * overrides.fontPercent + "px";
  57778. cueDiv.style.height = "auto";
  57779. cueDiv.style.top = "auto";
  57780. }
  57781. if (overrides.fontFamily && overrides.fontFamily !== "default") {
  57782. if (overrides.fontFamily === "small-caps") {
  57783. cueDiv.firstChild.style.fontVariant = "small-caps";
  57784. } else {
  57785. cueDiv.firstChild.style.fontFamily = fontMap$1[overrides.fontFamily];
  57786. }
  57787. }
  57788. }
  57789. }
  57790. updateForTrack(tracks) {
  57791. if (!Array.isArray(tracks)) {
  57792. tracks = [tracks];
  57793. }
  57794. if (typeof window_1.WebVTT !== "function" || tracks.every((track) => {
  57795. return !track.activeCues;
  57796. })) {
  57797. return;
  57798. }
  57799. const cues = [];
  57800. for (let i2 = 0; i2 < tracks.length; ++i2) {
  57801. const track = tracks[i2];
  57802. for (let j = 0; j < track.activeCues.length; ++j) {
  57803. cues.push(track.activeCues[j]);
  57804. }
  57805. }
  57806. window_1.WebVTT.processCues(window_1, cues, this.el_);
  57807. for (let i2 = 0; i2 < tracks.length; ++i2) {
  57808. const track = tracks[i2];
  57809. for (let j = 0; j < track.activeCues.length; ++j) {
  57810. const cueEl = track.activeCues[j].displayState;
  57811. addClass$1(cueEl, "vjs-text-track-cue", "vjs-text-track-cue-" + (track.language ? track.language : i2));
  57812. if (track.language) {
  57813. setAttribute$1(cueEl, "lang", track.language);
  57814. }
  57815. }
  57816. if (this.player_.textTrackSettings) {
  57817. this.updateDisplayState(track);
  57818. }
  57819. }
  57820. }
  57821. }
  57822. Component$1$1.registerComponent("TextTrackDisplay", TextTrackDisplay$1);
  57823. class LoadingSpinner$1 extends Component$1$1 {
  57824. createEl() {
  57825. const isAudio = this.player_.isAudio();
  57826. const playerType = this.localize(isAudio ? "Audio Player" : "Video Player");
  57827. const controlText = createEl$1("span", {
  57828. className: "vjs-control-text",
  57829. textContent: this.localize("{1} is loading.", [playerType])
  57830. });
  57831. const el = super.createEl("div", {
  57832. className: "vjs-loading-spinner",
  57833. dir: "ltr"
  57834. });
  57835. el.appendChild(controlText);
  57836. return el;
  57837. }
  57838. handleLanguagechange() {
  57839. this.$(".vjs-control-text").textContent = this.localize("{1} is loading.", [this.player_.isAudio() ? "Audio Player" : "Video Player"]);
  57840. }
  57841. }
  57842. Component$1$1.registerComponent("LoadingSpinner", LoadingSpinner$1);
  57843. class Button$1 extends ClickableComponent$1 {
  57844. createEl(tag, props = {}, attributes = {}) {
  57845. tag = "button";
  57846. props = Object.assign({
  57847. className: this.buildCSSClass()
  57848. }, props);
  57849. attributes = Object.assign({
  57850. type: "button"
  57851. }, attributes);
  57852. const el = createEl$1(tag, props, attributes);
  57853. el.appendChild(createEl$1("span", {
  57854. className: "vjs-icon-placeholder"
  57855. }, {
  57856. "aria-hidden": true
  57857. }));
  57858. this.createControlTextEl(el);
  57859. return el;
  57860. }
  57861. addChild(child, options2 = {}) {
  57862. const className = this.constructor.name;
  57863. log$1$1.warn(`Adding an actionable (user controllable) child to a Button (${className}) is not supported; use a ClickableComponent instead.`);
  57864. return Component$1$1.prototype.addChild.call(this, child, options2);
  57865. }
  57866. enable() {
  57867. super.enable();
  57868. this.el_.removeAttribute("disabled");
  57869. }
  57870. disable() {
  57871. super.disable();
  57872. this.el_.setAttribute("disabled", "disabled");
  57873. }
  57874. handleKeyDown(event2) {
  57875. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  57876. event2.stopPropagation();
  57877. return;
  57878. }
  57879. super.handleKeyDown(event2);
  57880. }
  57881. }
  57882. Component$1$1.registerComponent("Button", Button$1);
  57883. class BigPlayButton$1 extends Button$1 {
  57884. constructor(player, options2) {
  57885. super(player, options2);
  57886. this.mouseused_ = false;
  57887. this.on("mousedown", (e) => this.handleMouseDown(e));
  57888. }
  57889. buildCSSClass() {
  57890. return "vjs-big-play-button";
  57891. }
  57892. handleClick(event2) {
  57893. const playPromise = this.player_.play();
  57894. if (this.mouseused_ && event2.clientX && event2.clientY) {
  57895. silencePromise$1(playPromise);
  57896. if (this.player_.tech(true)) {
  57897. this.player_.tech(true).focus();
  57898. }
  57899. return;
  57900. }
  57901. const cb = this.player_.getChild("controlBar");
  57902. const playToggle = cb && cb.getChild("playToggle");
  57903. if (!playToggle) {
  57904. this.player_.tech(true).focus();
  57905. return;
  57906. }
  57907. const playFocus = () => playToggle.focus();
  57908. if (isPromise$1(playPromise)) {
  57909. playPromise.then(playFocus, () => {
  57910. });
  57911. } else {
  57912. this.setTimeout(playFocus, 1);
  57913. }
  57914. }
  57915. handleKeyDown(event2) {
  57916. this.mouseused_ = false;
  57917. super.handleKeyDown(event2);
  57918. }
  57919. handleMouseDown(event2) {
  57920. this.mouseused_ = true;
  57921. }
  57922. }
  57923. BigPlayButton$1.prototype.controlText_ = "Play Video";
  57924. Component$1$1.registerComponent("BigPlayButton", BigPlayButton$1);
  57925. class CloseButton$1 extends Button$1 {
  57926. constructor(player, options2) {
  57927. super(player, options2);
  57928. this.controlText(options2 && options2.controlText || this.localize("Close"));
  57929. }
  57930. buildCSSClass() {
  57931. return `vjs-close-button ${super.buildCSSClass()}`;
  57932. }
  57933. handleClick(event2) {
  57934. this.trigger({
  57935. type: "close",
  57936. bubbles: false
  57937. });
  57938. }
  57939. handleKeyDown(event2) {
  57940. if (keycode.isEventKey(event2, "Esc")) {
  57941. event2.preventDefault();
  57942. event2.stopPropagation();
  57943. this.trigger("click");
  57944. } else {
  57945. super.handleKeyDown(event2);
  57946. }
  57947. }
  57948. }
  57949. Component$1$1.registerComponent("CloseButton", CloseButton$1);
  57950. class PlayToggle$1 extends Button$1 {
  57951. constructor(player, options2 = {}) {
  57952. super(player, options2);
  57953. options2.replay = options2.replay === void 0 || options2.replay;
  57954. this.on(player, "play", (e) => this.handlePlay(e));
  57955. this.on(player, "pause", (e) => this.handlePause(e));
  57956. if (options2.replay) {
  57957. this.on(player, "ended", (e) => this.handleEnded(e));
  57958. }
  57959. }
  57960. buildCSSClass() {
  57961. return `vjs-play-control ${super.buildCSSClass()}`;
  57962. }
  57963. handleClick(event2) {
  57964. if (this.player_.paused()) {
  57965. silencePromise$1(this.player_.play());
  57966. } else {
  57967. this.player_.pause();
  57968. }
  57969. }
  57970. handleSeeked(event2) {
  57971. this.removeClass("vjs-ended");
  57972. if (this.player_.paused()) {
  57973. this.handlePause(event2);
  57974. } else {
  57975. this.handlePlay(event2);
  57976. }
  57977. }
  57978. handlePlay(event2) {
  57979. this.removeClass("vjs-ended", "vjs-paused");
  57980. this.addClass("vjs-playing");
  57981. this.controlText("Pause");
  57982. }
  57983. handlePause(event2) {
  57984. this.removeClass("vjs-playing");
  57985. this.addClass("vjs-paused");
  57986. this.controlText("Play");
  57987. }
  57988. handleEnded(event2) {
  57989. this.removeClass("vjs-playing");
  57990. this.addClass("vjs-ended");
  57991. this.controlText("Replay");
  57992. this.one(this.player_, "seeked", (e) => this.handleSeeked(e));
  57993. }
  57994. }
  57995. PlayToggle$1.prototype.controlText_ = "Play";
  57996. Component$1$1.registerComponent("PlayToggle", PlayToggle$1);
  57997. class TimeDisplay$1 extends Component$1$1 {
  57998. constructor(player, options2) {
  57999. super(player, options2);
  58000. this.on(player, ["timeupdate", "ended"], (e) => this.updateContent(e));
  58001. this.updateTextNode_();
  58002. }
  58003. createEl() {
  58004. const className = this.buildCSSClass();
  58005. const el = super.createEl("div", {
  58006. className: `${className} vjs-time-control vjs-control`
  58007. });
  58008. const span = createEl$1("span", {
  58009. className: "vjs-control-text",
  58010. textContent: `${this.localize(this.labelText_)}\xA0`
  58011. }, {
  58012. role: "presentation"
  58013. });
  58014. el.appendChild(span);
  58015. this.contentEl_ = createEl$1("span", {
  58016. className: `${className}-display`
  58017. }, {
  58018. role: "presentation"
  58019. });
  58020. el.appendChild(this.contentEl_);
  58021. return el;
  58022. }
  58023. dispose() {
  58024. this.contentEl_ = null;
  58025. this.textNode_ = null;
  58026. super.dispose();
  58027. }
  58028. updateTextNode_(time = 0) {
  58029. time = formatTime$1(time);
  58030. if (this.formattedTime_ === time) {
  58031. return;
  58032. }
  58033. this.formattedTime_ = time;
  58034. this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_", () => {
  58035. if (!this.contentEl_) {
  58036. return;
  58037. }
  58038. let oldNode = this.textNode_;
  58039. if (oldNode && this.contentEl_.firstChild !== oldNode) {
  58040. oldNode = null;
  58041. log$1$1.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.");
  58042. }
  58043. this.textNode_ = document_1.createTextNode(this.formattedTime_);
  58044. if (!this.textNode_) {
  58045. return;
  58046. }
  58047. if (oldNode) {
  58048. this.contentEl_.replaceChild(this.textNode_, oldNode);
  58049. } else {
  58050. this.contentEl_.appendChild(this.textNode_);
  58051. }
  58052. });
  58053. }
  58054. updateContent(event2) {
  58055. }
  58056. }
  58057. TimeDisplay$1.prototype.labelText_ = "Time";
  58058. TimeDisplay$1.prototype.controlText_ = "Time";
  58059. Component$1$1.registerComponent("TimeDisplay", TimeDisplay$1);
  58060. class CurrentTimeDisplay$1 extends TimeDisplay$1 {
  58061. buildCSSClass() {
  58062. return "vjs-current-time";
  58063. }
  58064. updateContent(event2) {
  58065. let time;
  58066. if (this.player_.ended()) {
  58067. time = this.player_.duration();
  58068. } else {
  58069. time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  58070. }
  58071. this.updateTextNode_(time);
  58072. }
  58073. }
  58074. CurrentTimeDisplay$1.prototype.labelText_ = "Current Time";
  58075. CurrentTimeDisplay$1.prototype.controlText_ = "Current Time";
  58076. Component$1$1.registerComponent("CurrentTimeDisplay", CurrentTimeDisplay$1);
  58077. class DurationDisplay$1 extends TimeDisplay$1 {
  58078. constructor(player, options2) {
  58079. super(player, options2);
  58080. const updateContent = (e) => this.updateContent(e);
  58081. this.on(player, "durationchange", updateContent);
  58082. this.on(player, "loadstart", updateContent);
  58083. this.on(player, "loadedmetadata", updateContent);
  58084. }
  58085. buildCSSClass() {
  58086. return "vjs-duration";
  58087. }
  58088. updateContent(event2) {
  58089. const duration5 = this.player_.duration();
  58090. this.updateTextNode_(duration5);
  58091. }
  58092. }
  58093. DurationDisplay$1.prototype.labelText_ = "Duration";
  58094. DurationDisplay$1.prototype.controlText_ = "Duration";
  58095. Component$1$1.registerComponent("DurationDisplay", DurationDisplay$1);
  58096. class TimeDivider$1 extends Component$1$1 {
  58097. createEl() {
  58098. const el = super.createEl("div", {
  58099. className: "vjs-time-control vjs-time-divider"
  58100. }, {
  58101. "aria-hidden": true
  58102. });
  58103. const div = super.createEl("div");
  58104. const span = super.createEl("span", {
  58105. textContent: "/"
  58106. });
  58107. div.appendChild(span);
  58108. el.appendChild(div);
  58109. return el;
  58110. }
  58111. }
  58112. Component$1$1.registerComponent("TimeDivider", TimeDivider$1);
  58113. class RemainingTimeDisplay$1 extends TimeDisplay$1 {
  58114. constructor(player, options2) {
  58115. super(player, options2);
  58116. this.on(player, "durationchange", (e) => this.updateContent(e));
  58117. }
  58118. buildCSSClass() {
  58119. return "vjs-remaining-time";
  58120. }
  58121. createEl() {
  58122. const el = super.createEl();
  58123. if (this.options_.displayNegative !== false) {
  58124. el.insertBefore(createEl$1("span", {}, {
  58125. "aria-hidden": true
  58126. }, "-"), this.contentEl_);
  58127. }
  58128. return el;
  58129. }
  58130. updateContent(event2) {
  58131. if (typeof this.player_.duration() !== "number") {
  58132. return;
  58133. }
  58134. let time;
  58135. if (this.player_.ended()) {
  58136. time = 0;
  58137. } else if (this.player_.remainingTimeDisplay) {
  58138. time = this.player_.remainingTimeDisplay();
  58139. } else {
  58140. time = this.player_.remainingTime();
  58141. }
  58142. this.updateTextNode_(time);
  58143. }
  58144. }
  58145. RemainingTimeDisplay$1.prototype.labelText_ = "Remaining Time";
  58146. RemainingTimeDisplay$1.prototype.controlText_ = "Remaining Time";
  58147. Component$1$1.registerComponent("RemainingTimeDisplay", RemainingTimeDisplay$1);
  58148. class LiveDisplay$1 extends Component$1$1 {
  58149. constructor(player, options2) {
  58150. super(player, options2);
  58151. this.updateShowing();
  58152. this.on(this.player(), "durationchange", (e) => this.updateShowing(e));
  58153. }
  58154. createEl() {
  58155. const el = super.createEl("div", {
  58156. className: "vjs-live-control vjs-control"
  58157. });
  58158. this.contentEl_ = createEl$1("div", {
  58159. className: "vjs-live-display"
  58160. }, {
  58161. "aria-live": "off"
  58162. });
  58163. this.contentEl_.appendChild(createEl$1("span", {
  58164. className: "vjs-control-text",
  58165. textContent: `${this.localize("Stream Type")}\xA0`
  58166. }));
  58167. this.contentEl_.appendChild(document_1.createTextNode(this.localize("LIVE")));
  58168. el.appendChild(this.contentEl_);
  58169. return el;
  58170. }
  58171. dispose() {
  58172. this.contentEl_ = null;
  58173. super.dispose();
  58174. }
  58175. updateShowing(event2) {
  58176. if (this.player().duration() === Infinity) {
  58177. this.show();
  58178. } else {
  58179. this.hide();
  58180. }
  58181. }
  58182. }
  58183. Component$1$1.registerComponent("LiveDisplay", LiveDisplay$1);
  58184. class SeekToLive$1 extends Button$1 {
  58185. constructor(player, options2) {
  58186. super(player, options2);
  58187. this.updateLiveEdgeStatus();
  58188. if (this.player_.liveTracker) {
  58189. this.updateLiveEdgeStatusHandler_ = (e) => this.updateLiveEdgeStatus(e);
  58190. this.on(this.player_.liveTracker, "liveedgechange", this.updateLiveEdgeStatusHandler_);
  58191. }
  58192. }
  58193. createEl() {
  58194. const el = super.createEl("button", {
  58195. className: "vjs-seek-to-live-control vjs-control"
  58196. });
  58197. this.textEl_ = createEl$1("span", {
  58198. className: "vjs-seek-to-live-text",
  58199. textContent: this.localize("LIVE")
  58200. }, {
  58201. "aria-hidden": "true"
  58202. });
  58203. el.appendChild(this.textEl_);
  58204. return el;
  58205. }
  58206. updateLiveEdgeStatus() {
  58207. if (!this.player_.liveTracker || this.player_.liveTracker.atLiveEdge()) {
  58208. this.setAttribute("aria-disabled", true);
  58209. this.addClass("vjs-at-live-edge");
  58210. this.controlText("Seek to live, currently playing live");
  58211. } else {
  58212. this.setAttribute("aria-disabled", false);
  58213. this.removeClass("vjs-at-live-edge");
  58214. this.controlText("Seek to live, currently behind live");
  58215. }
  58216. }
  58217. handleClick() {
  58218. this.player_.liveTracker.seekToLiveEdge();
  58219. }
  58220. dispose() {
  58221. if (this.player_.liveTracker) {
  58222. this.off(this.player_.liveTracker, "liveedgechange", this.updateLiveEdgeStatusHandler_);
  58223. }
  58224. this.textEl_ = null;
  58225. super.dispose();
  58226. }
  58227. }
  58228. SeekToLive$1.prototype.controlText_ = "Seek to live, currently playing live";
  58229. Component$1$1.registerComponent("SeekToLive", SeekToLive$1);
  58230. function clamp$1(number, min2, max2) {
  58231. number = Number(number);
  58232. return Math.min(max2, Math.max(min2, isNaN(number) ? min2 : number));
  58233. }
  58234. var Num = /* @__PURE__ */ Object.freeze({
  58235. __proto__: null,
  58236. clamp: clamp$1
  58237. });
  58238. class Slider$1 extends Component$1$1 {
  58239. constructor(player, options2) {
  58240. super(player, options2);
  58241. this.handleMouseDown_ = (e) => this.handleMouseDown(e);
  58242. this.handleMouseUp_ = (e) => this.handleMouseUp(e);
  58243. this.handleKeyDown_ = (e) => this.handleKeyDown(e);
  58244. this.handleClick_ = (e) => this.handleClick(e);
  58245. this.handleMouseMove_ = (e) => this.handleMouseMove(e);
  58246. this.update_ = (e) => this.update(e);
  58247. this.bar = this.getChild(this.options_.barName);
  58248. this.vertical(!!this.options_.vertical);
  58249. this.enable();
  58250. }
  58251. enabled() {
  58252. return this.enabled_;
  58253. }
  58254. enable() {
  58255. if (this.enabled()) {
  58256. return;
  58257. }
  58258. this.on("mousedown", this.handleMouseDown_);
  58259. this.on("touchstart", this.handleMouseDown_);
  58260. this.on("keydown", this.handleKeyDown_);
  58261. this.on("click", this.handleClick_);
  58262. this.on(this.player_, "controlsvisible", this.update);
  58263. if (this.playerEvent) {
  58264. this.on(this.player_, this.playerEvent, this.update);
  58265. }
  58266. this.removeClass("disabled");
  58267. this.setAttribute("tabindex", 0);
  58268. this.enabled_ = true;
  58269. }
  58270. disable() {
  58271. if (!this.enabled()) {
  58272. return;
  58273. }
  58274. const doc = this.bar.el_.ownerDocument;
  58275. this.off("mousedown", this.handleMouseDown_);
  58276. this.off("touchstart", this.handleMouseDown_);
  58277. this.off("keydown", this.handleKeyDown_);
  58278. this.off("click", this.handleClick_);
  58279. this.off(this.player_, "controlsvisible", this.update_);
  58280. this.off(doc, "mousemove", this.handleMouseMove_);
  58281. this.off(doc, "mouseup", this.handleMouseUp_);
  58282. this.off(doc, "touchmove", this.handleMouseMove_);
  58283. this.off(doc, "touchend", this.handleMouseUp_);
  58284. this.removeAttribute("tabindex");
  58285. this.addClass("disabled");
  58286. if (this.playerEvent) {
  58287. this.off(this.player_, this.playerEvent, this.update);
  58288. }
  58289. this.enabled_ = false;
  58290. }
  58291. createEl(type2, props = {}, attributes = {}) {
  58292. props.className = props.className + " vjs-slider";
  58293. props = Object.assign({
  58294. tabIndex: 0
  58295. }, props);
  58296. attributes = Object.assign({
  58297. "role": "slider",
  58298. "aria-valuenow": 0,
  58299. "aria-valuemin": 0,
  58300. "aria-valuemax": 100
  58301. }, attributes);
  58302. return super.createEl(type2, props, attributes);
  58303. }
  58304. handleMouseDown(event2) {
  58305. const doc = this.bar.el_.ownerDocument;
  58306. if (event2.type === "mousedown") {
  58307. event2.preventDefault();
  58308. }
  58309. if (event2.type === "touchstart" && !IS_CHROME$1) {
  58310. event2.preventDefault();
  58311. }
  58312. blockTextSelection$1();
  58313. this.addClass("vjs-sliding");
  58314. this.trigger("slideractive");
  58315. this.on(doc, "mousemove", this.handleMouseMove_);
  58316. this.on(doc, "mouseup", this.handleMouseUp_);
  58317. this.on(doc, "touchmove", this.handleMouseMove_);
  58318. this.on(doc, "touchend", this.handleMouseUp_);
  58319. this.handleMouseMove(event2, true);
  58320. }
  58321. handleMouseMove(event2) {
  58322. }
  58323. handleMouseUp(event2) {
  58324. const doc = this.bar.el_.ownerDocument;
  58325. unblockTextSelection$1();
  58326. this.removeClass("vjs-sliding");
  58327. this.trigger("sliderinactive");
  58328. this.off(doc, "mousemove", this.handleMouseMove_);
  58329. this.off(doc, "mouseup", this.handleMouseUp_);
  58330. this.off(doc, "touchmove", this.handleMouseMove_);
  58331. this.off(doc, "touchend", this.handleMouseUp_);
  58332. this.update();
  58333. }
  58334. update() {
  58335. if (!this.el_ || !this.bar) {
  58336. return;
  58337. }
  58338. const progress = this.getProgress();
  58339. if (progress === this.progress_) {
  58340. return progress;
  58341. }
  58342. this.progress_ = progress;
  58343. this.requestNamedAnimationFrame("Slider#update", () => {
  58344. const sizeKey = this.vertical() ? "height" : "width";
  58345. this.bar.el().style[sizeKey] = (progress * 100).toFixed(2) + "%";
  58346. });
  58347. return progress;
  58348. }
  58349. getProgress() {
  58350. return Number(clamp$1(this.getPercent(), 0, 1).toFixed(4));
  58351. }
  58352. calculateDistance(event2) {
  58353. const position2 = getPointerPosition$1(this.el_, event2);
  58354. if (this.vertical()) {
  58355. return position2.y;
  58356. }
  58357. return position2.x;
  58358. }
  58359. handleKeyDown(event2) {
  58360. if (keycode.isEventKey(event2, "Left") || keycode.isEventKey(event2, "Down")) {
  58361. event2.preventDefault();
  58362. event2.stopPropagation();
  58363. this.stepBack();
  58364. } else if (keycode.isEventKey(event2, "Right") || keycode.isEventKey(event2, "Up")) {
  58365. event2.preventDefault();
  58366. event2.stopPropagation();
  58367. this.stepForward();
  58368. } else {
  58369. super.handleKeyDown(event2);
  58370. }
  58371. }
  58372. handleClick(event2) {
  58373. event2.stopPropagation();
  58374. event2.preventDefault();
  58375. }
  58376. vertical(bool) {
  58377. if (bool === void 0) {
  58378. return this.vertical_ || false;
  58379. }
  58380. this.vertical_ = !!bool;
  58381. if (this.vertical_) {
  58382. this.addClass("vjs-slider-vertical");
  58383. } else {
  58384. this.addClass("vjs-slider-horizontal");
  58385. }
  58386. }
  58387. }
  58388. Component$1$1.registerComponent("Slider", Slider$1);
  58389. const percentify$1 = (time, end) => clamp$1(time / end * 100, 0, 100).toFixed(2) + "%";
  58390. class LoadProgressBar$1 extends Component$1$1 {
  58391. constructor(player, options2) {
  58392. super(player, options2);
  58393. this.partEls_ = [];
  58394. this.on(player, "progress", (e) => this.update(e));
  58395. }
  58396. createEl() {
  58397. const el = super.createEl("div", {
  58398. className: "vjs-load-progress"
  58399. });
  58400. const wrapper = createEl$1("span", {
  58401. className: "vjs-control-text"
  58402. });
  58403. const loadedText = createEl$1("span", {
  58404. textContent: this.localize("Loaded")
  58405. });
  58406. const separator = document_1.createTextNode(": ");
  58407. this.percentageEl_ = createEl$1("span", {
  58408. className: "vjs-control-text-loaded-percentage",
  58409. textContent: "0%"
  58410. });
  58411. el.appendChild(wrapper);
  58412. wrapper.appendChild(loadedText);
  58413. wrapper.appendChild(separator);
  58414. wrapper.appendChild(this.percentageEl_);
  58415. return el;
  58416. }
  58417. dispose() {
  58418. this.partEls_ = null;
  58419. this.percentageEl_ = null;
  58420. super.dispose();
  58421. }
  58422. update(event2) {
  58423. this.requestNamedAnimationFrame("LoadProgressBar#update", () => {
  58424. const liveTracker = this.player_.liveTracker;
  58425. const buffered = this.player_.buffered();
  58426. const duration5 = liveTracker && liveTracker.isLive() ? liveTracker.seekableEnd() : this.player_.duration();
  58427. const bufferedEnd = this.player_.bufferedEnd();
  58428. const children = this.partEls_;
  58429. const percent = percentify$1(bufferedEnd, duration5);
  58430. if (this.percent_ !== percent) {
  58431. this.el_.style.width = percent;
  58432. textContent$1(this.percentageEl_, percent);
  58433. this.percent_ = percent;
  58434. }
  58435. for (let i2 = 0; i2 < buffered.length; i2++) {
  58436. const start2 = buffered.start(i2);
  58437. const end = buffered.end(i2);
  58438. let part = children[i2];
  58439. if (!part) {
  58440. part = this.el_.appendChild(createEl$1());
  58441. children[i2] = part;
  58442. }
  58443. if (part.dataset.start === start2 && part.dataset.end === end) {
  58444. continue;
  58445. }
  58446. part.dataset.start = start2;
  58447. part.dataset.end = end;
  58448. part.style.left = percentify$1(start2, bufferedEnd);
  58449. part.style.width = percentify$1(end - start2, bufferedEnd);
  58450. }
  58451. for (let i2 = children.length; i2 > buffered.length; i2--) {
  58452. this.el_.removeChild(children[i2 - 1]);
  58453. }
  58454. children.length = buffered.length;
  58455. });
  58456. }
  58457. }
  58458. Component$1$1.registerComponent("LoadProgressBar", LoadProgressBar$1);
  58459. class TimeTooltip$1 extends Component$1$1 {
  58460. constructor(player, options2) {
  58461. super(player, options2);
  58462. this.update = throttle$1(bind_(this, this.update), UPDATE_REFRESH_INTERVAL$1);
  58463. }
  58464. createEl() {
  58465. return super.createEl("div", {
  58466. className: "vjs-time-tooltip"
  58467. }, {
  58468. "aria-hidden": "true"
  58469. });
  58470. }
  58471. update(seekBarRect, seekBarPoint, content) {
  58472. const tooltipRect = findPosition$1(this.el_);
  58473. const playerRect = getBoundingClientRect$1(this.player_.el());
  58474. const seekBarPointPx = seekBarRect.width * seekBarPoint;
  58475. if (!playerRect || !tooltipRect) {
  58476. return;
  58477. }
  58478. const spaceLeftOfPoint = seekBarRect.left - playerRect.left + seekBarPointPx;
  58479. const spaceRightOfPoint = seekBarRect.width - seekBarPointPx + (playerRect.right - seekBarRect.right);
  58480. let pullTooltipBy = tooltipRect.width / 2;
  58481. if (spaceLeftOfPoint < pullTooltipBy) {
  58482. pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;
  58483. } else if (spaceRightOfPoint < pullTooltipBy) {
  58484. pullTooltipBy = spaceRightOfPoint;
  58485. }
  58486. if (pullTooltipBy < 0) {
  58487. pullTooltipBy = 0;
  58488. } else if (pullTooltipBy > tooltipRect.width) {
  58489. pullTooltipBy = tooltipRect.width;
  58490. }
  58491. pullTooltipBy = Math.round(pullTooltipBy);
  58492. this.el_.style.right = `-${pullTooltipBy}px`;
  58493. this.write(content);
  58494. }
  58495. write(content) {
  58496. textContent$1(this.el_, content);
  58497. }
  58498. updateTime(seekBarRect, seekBarPoint, time, cb) {
  58499. this.requestNamedAnimationFrame("TimeTooltip#updateTime", () => {
  58500. let content;
  58501. const duration5 = this.player_.duration();
  58502. if (this.player_.liveTracker && this.player_.liveTracker.isLive()) {
  58503. const liveWindow = this.player_.liveTracker.liveWindow();
  58504. const secondsBehind = liveWindow - seekBarPoint * liveWindow;
  58505. content = (secondsBehind < 1 ? "" : "-") + formatTime$1(secondsBehind, liveWindow);
  58506. } else {
  58507. content = formatTime$1(time, duration5);
  58508. }
  58509. this.update(seekBarRect, seekBarPoint, content);
  58510. if (cb) {
  58511. cb();
  58512. }
  58513. });
  58514. }
  58515. }
  58516. Component$1$1.registerComponent("TimeTooltip", TimeTooltip$1);
  58517. class PlayProgressBar$1 extends Component$1$1 {
  58518. constructor(player, options2) {
  58519. super(player, options2);
  58520. this.update = throttle$1(bind_(this, this.update), UPDATE_REFRESH_INTERVAL$1);
  58521. }
  58522. createEl() {
  58523. return super.createEl("div", {
  58524. className: "vjs-play-progress vjs-slider-bar"
  58525. }, {
  58526. "aria-hidden": "true"
  58527. });
  58528. }
  58529. update(seekBarRect, seekBarPoint) {
  58530. const timeTooltip = this.getChild("timeTooltip");
  58531. if (!timeTooltip) {
  58532. return;
  58533. }
  58534. const time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  58535. timeTooltip.updateTime(seekBarRect, seekBarPoint, time);
  58536. }
  58537. }
  58538. PlayProgressBar$1.prototype.options_ = {
  58539. children: []
  58540. };
  58541. if (!IS_IOS$1 && !IS_ANDROID$1) {
  58542. PlayProgressBar$1.prototype.options_.children.push("timeTooltip");
  58543. }
  58544. Component$1$1.registerComponent("PlayProgressBar", PlayProgressBar$1);
  58545. class MouseTimeDisplay$1 extends Component$1$1 {
  58546. constructor(player, options2) {
  58547. super(player, options2);
  58548. this.update = throttle$1(bind_(this, this.update), UPDATE_REFRESH_INTERVAL$1);
  58549. }
  58550. createEl() {
  58551. return super.createEl("div", {
  58552. className: "vjs-mouse-display"
  58553. });
  58554. }
  58555. update(seekBarRect, seekBarPoint) {
  58556. const time = seekBarPoint * this.player_.duration();
  58557. this.getChild("timeTooltip").updateTime(seekBarRect, seekBarPoint, time, () => {
  58558. this.el_.style.left = `${seekBarRect.width * seekBarPoint}px`;
  58559. });
  58560. }
  58561. }
  58562. MouseTimeDisplay$1.prototype.options_ = {
  58563. children: ["timeTooltip"]
  58564. };
  58565. Component$1$1.registerComponent("MouseTimeDisplay", MouseTimeDisplay$1);
  58566. const STEP_SECONDS$1 = 5;
  58567. const PAGE_KEY_MULTIPLIER$1 = 12;
  58568. class SeekBar$1 extends Slider$1 {
  58569. constructor(player, options2) {
  58570. super(player, options2);
  58571. this.setEventHandlers_();
  58572. }
  58573. setEventHandlers_() {
  58574. this.update_ = bind_(this, this.update);
  58575. this.update = throttle$1(this.update_, UPDATE_REFRESH_INTERVAL$1);
  58576. this.on(this.player_, ["ended", "durationchange", "timeupdate"], this.update);
  58577. if (this.player_.liveTracker) {
  58578. this.on(this.player_.liveTracker, "liveedgechange", this.update);
  58579. }
  58580. this.updateInterval = null;
  58581. this.enableIntervalHandler_ = (e) => this.enableInterval_(e);
  58582. this.disableIntervalHandler_ = (e) => this.disableInterval_(e);
  58583. this.on(this.player_, ["playing"], this.enableIntervalHandler_);
  58584. this.on(this.player_, ["ended", "pause", "waiting"], this.disableIntervalHandler_);
  58585. if ("hidden" in document_1 && "visibilityState" in document_1) {
  58586. this.on(document_1, "visibilitychange", this.toggleVisibility_);
  58587. }
  58588. }
  58589. toggleVisibility_(e) {
  58590. if (document_1.visibilityState === "hidden") {
  58591. this.cancelNamedAnimationFrame("SeekBar#update");
  58592. this.cancelNamedAnimationFrame("Slider#update");
  58593. this.disableInterval_(e);
  58594. } else {
  58595. if (!this.player_.ended() && !this.player_.paused()) {
  58596. this.enableInterval_();
  58597. }
  58598. this.update();
  58599. }
  58600. }
  58601. enableInterval_() {
  58602. if (this.updateInterval) {
  58603. return;
  58604. }
  58605. this.updateInterval = this.setInterval(this.update, UPDATE_REFRESH_INTERVAL$1);
  58606. }
  58607. disableInterval_(e) {
  58608. if (this.player_.liveTracker && this.player_.liveTracker.isLive() && e && e.type !== "ended") {
  58609. return;
  58610. }
  58611. if (!this.updateInterval) {
  58612. return;
  58613. }
  58614. this.clearInterval(this.updateInterval);
  58615. this.updateInterval = null;
  58616. }
  58617. createEl() {
  58618. return super.createEl("div", {
  58619. className: "vjs-progress-holder"
  58620. }, {
  58621. "aria-label": this.localize("Progress Bar")
  58622. });
  58623. }
  58624. update(event2) {
  58625. if (document_1.visibilityState === "hidden") {
  58626. return;
  58627. }
  58628. const percent = super.update();
  58629. this.requestNamedAnimationFrame("SeekBar#update", () => {
  58630. const currentTime = this.player_.ended() ? this.player_.duration() : this.getCurrentTime_();
  58631. const liveTracker = this.player_.liveTracker;
  58632. let duration5 = this.player_.duration();
  58633. if (liveTracker && liveTracker.isLive()) {
  58634. duration5 = this.player_.liveTracker.liveCurrentTime();
  58635. }
  58636. if (this.percent_ !== percent) {
  58637. this.el_.setAttribute("aria-valuenow", (percent * 100).toFixed(2));
  58638. this.percent_ = percent;
  58639. }
  58640. if (this.currentTime_ !== currentTime || this.duration_ !== duration5) {
  58641. this.el_.setAttribute("aria-valuetext", this.localize("progress bar timing: currentTime={1} duration={2}", [formatTime$1(currentTime, duration5), formatTime$1(duration5, duration5)], "{1} of {2}"));
  58642. this.currentTime_ = currentTime;
  58643. this.duration_ = duration5;
  58644. }
  58645. if (this.bar) {
  58646. this.bar.update(getBoundingClientRect$1(this.el()), this.getProgress());
  58647. }
  58648. });
  58649. return percent;
  58650. }
  58651. userSeek_(ct2) {
  58652. if (this.player_.liveTracker && this.player_.liveTracker.isLive()) {
  58653. this.player_.liveTracker.nextSeekedFromUser();
  58654. }
  58655. this.player_.currentTime(ct2);
  58656. }
  58657. getCurrentTime_() {
  58658. return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  58659. }
  58660. getPercent() {
  58661. const currentTime = this.getCurrentTime_();
  58662. let percent;
  58663. const liveTracker = this.player_.liveTracker;
  58664. if (liveTracker && liveTracker.isLive()) {
  58665. percent = (currentTime - liveTracker.seekableStart()) / liveTracker.liveWindow();
  58666. if (liveTracker.atLiveEdge()) {
  58667. percent = 1;
  58668. }
  58669. } else {
  58670. percent = currentTime / this.player_.duration();
  58671. }
  58672. return percent;
  58673. }
  58674. handleMouseDown(event2) {
  58675. if (!isSingleLeftClick$1(event2)) {
  58676. return;
  58677. }
  58678. event2.stopPropagation();
  58679. this.videoWasPlaying = !this.player_.paused();
  58680. this.player_.pause();
  58681. super.handleMouseDown(event2);
  58682. }
  58683. handleMouseMove(event2, mouseDown = false) {
  58684. if (!isSingleLeftClick$1(event2)) {
  58685. return;
  58686. }
  58687. if (!mouseDown && !this.player_.scrubbing()) {
  58688. this.player_.scrubbing(true);
  58689. }
  58690. let newTime;
  58691. const distance2 = this.calculateDistance(event2);
  58692. const liveTracker = this.player_.liveTracker;
  58693. if (!liveTracker || !liveTracker.isLive()) {
  58694. newTime = distance2 * this.player_.duration();
  58695. if (newTime === this.player_.duration()) {
  58696. newTime = newTime - 0.1;
  58697. }
  58698. } else {
  58699. if (distance2 >= 0.99) {
  58700. liveTracker.seekToLiveEdge();
  58701. return;
  58702. }
  58703. const seekableStart = liveTracker.seekableStart();
  58704. const seekableEnd = liveTracker.liveCurrentTime();
  58705. newTime = seekableStart + distance2 * liveTracker.liveWindow();
  58706. if (newTime >= seekableEnd) {
  58707. newTime = seekableEnd;
  58708. }
  58709. if (newTime <= seekableStart) {
  58710. newTime = seekableStart + 0.1;
  58711. }
  58712. if (newTime === Infinity) {
  58713. return;
  58714. }
  58715. }
  58716. this.userSeek_(newTime);
  58717. }
  58718. enable() {
  58719. super.enable();
  58720. const mouseTimeDisplay = this.getChild("mouseTimeDisplay");
  58721. if (!mouseTimeDisplay) {
  58722. return;
  58723. }
  58724. mouseTimeDisplay.show();
  58725. }
  58726. disable() {
  58727. super.disable();
  58728. const mouseTimeDisplay = this.getChild("mouseTimeDisplay");
  58729. if (!mouseTimeDisplay) {
  58730. return;
  58731. }
  58732. mouseTimeDisplay.hide();
  58733. }
  58734. handleMouseUp(event2) {
  58735. super.handleMouseUp(event2);
  58736. if (event2) {
  58737. event2.stopPropagation();
  58738. }
  58739. this.player_.scrubbing(false);
  58740. this.player_.trigger({
  58741. type: "timeupdate",
  58742. target: this,
  58743. manuallyTriggered: true
  58744. });
  58745. if (this.videoWasPlaying) {
  58746. silencePromise$1(this.player_.play());
  58747. } else {
  58748. this.update_();
  58749. }
  58750. }
  58751. stepForward() {
  58752. this.userSeek_(this.player_.currentTime() + STEP_SECONDS$1);
  58753. }
  58754. stepBack() {
  58755. this.userSeek_(this.player_.currentTime() - STEP_SECONDS$1);
  58756. }
  58757. handleAction(event2) {
  58758. if (this.player_.paused()) {
  58759. this.player_.play();
  58760. } else {
  58761. this.player_.pause();
  58762. }
  58763. }
  58764. handleKeyDown(event2) {
  58765. const liveTracker = this.player_.liveTracker;
  58766. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  58767. event2.preventDefault();
  58768. event2.stopPropagation();
  58769. this.handleAction(event2);
  58770. } else if (keycode.isEventKey(event2, "Home")) {
  58771. event2.preventDefault();
  58772. event2.stopPropagation();
  58773. this.userSeek_(0);
  58774. } else if (keycode.isEventKey(event2, "End")) {
  58775. event2.preventDefault();
  58776. event2.stopPropagation();
  58777. if (liveTracker && liveTracker.isLive()) {
  58778. this.userSeek_(liveTracker.liveCurrentTime());
  58779. } else {
  58780. this.userSeek_(this.player_.duration());
  58781. }
  58782. } else if (/^[0-9]$/.test(keycode(event2))) {
  58783. event2.preventDefault();
  58784. event2.stopPropagation();
  58785. const gotoFraction = (keycode.codes[keycode(event2)] - keycode.codes["0"]) * 10 / 100;
  58786. if (liveTracker && liveTracker.isLive()) {
  58787. this.userSeek_(liveTracker.seekableStart() + liveTracker.liveWindow() * gotoFraction);
  58788. } else {
  58789. this.userSeek_(this.player_.duration() * gotoFraction);
  58790. }
  58791. } else if (keycode.isEventKey(event2, "PgDn")) {
  58792. event2.preventDefault();
  58793. event2.stopPropagation();
  58794. this.userSeek_(this.player_.currentTime() - STEP_SECONDS$1 * PAGE_KEY_MULTIPLIER$1);
  58795. } else if (keycode.isEventKey(event2, "PgUp")) {
  58796. event2.preventDefault();
  58797. event2.stopPropagation();
  58798. this.userSeek_(this.player_.currentTime() + STEP_SECONDS$1 * PAGE_KEY_MULTIPLIER$1);
  58799. } else {
  58800. super.handleKeyDown(event2);
  58801. }
  58802. }
  58803. dispose() {
  58804. this.disableInterval_();
  58805. this.off(this.player_, ["ended", "durationchange", "timeupdate"], this.update);
  58806. if (this.player_.liveTracker) {
  58807. this.off(this.player_.liveTracker, "liveedgechange", this.update);
  58808. }
  58809. this.off(this.player_, ["playing"], this.enableIntervalHandler_);
  58810. this.off(this.player_, ["ended", "pause", "waiting"], this.disableIntervalHandler_);
  58811. if ("hidden" in document_1 && "visibilityState" in document_1) {
  58812. this.off(document_1, "visibilitychange", this.toggleVisibility_);
  58813. }
  58814. super.dispose();
  58815. }
  58816. }
  58817. SeekBar$1.prototype.options_ = {
  58818. children: ["loadProgressBar", "playProgressBar"],
  58819. barName: "playProgressBar"
  58820. };
  58821. if (!IS_IOS$1 && !IS_ANDROID$1) {
  58822. SeekBar$1.prototype.options_.children.splice(1, 0, "mouseTimeDisplay");
  58823. }
  58824. Component$1$1.registerComponent("SeekBar", SeekBar$1);
  58825. class ProgressControl$1 extends Component$1$1 {
  58826. constructor(player, options2) {
  58827. super(player, options2);
  58828. this.handleMouseMove = throttle$1(bind_(this, this.handleMouseMove), UPDATE_REFRESH_INTERVAL$1);
  58829. this.throttledHandleMouseSeek = throttle$1(bind_(this, this.handleMouseSeek), UPDATE_REFRESH_INTERVAL$1);
  58830. this.handleMouseUpHandler_ = (e) => this.handleMouseUp(e);
  58831. this.handleMouseDownHandler_ = (e) => this.handleMouseDown(e);
  58832. this.enable();
  58833. }
  58834. createEl() {
  58835. return super.createEl("div", {
  58836. className: "vjs-progress-control vjs-control"
  58837. });
  58838. }
  58839. handleMouseMove(event2) {
  58840. const seekBar = this.getChild("seekBar");
  58841. if (!seekBar) {
  58842. return;
  58843. }
  58844. const playProgressBar = seekBar.getChild("playProgressBar");
  58845. const mouseTimeDisplay = seekBar.getChild("mouseTimeDisplay");
  58846. if (!playProgressBar && !mouseTimeDisplay) {
  58847. return;
  58848. }
  58849. const seekBarEl = seekBar.el();
  58850. const seekBarRect = findPosition$1(seekBarEl);
  58851. let seekBarPoint = getPointerPosition$1(seekBarEl, event2).x;
  58852. seekBarPoint = clamp$1(seekBarPoint, 0, 1);
  58853. if (mouseTimeDisplay) {
  58854. mouseTimeDisplay.update(seekBarRect, seekBarPoint);
  58855. }
  58856. if (playProgressBar) {
  58857. playProgressBar.update(seekBarRect, seekBar.getProgress());
  58858. }
  58859. }
  58860. handleMouseSeek(event2) {
  58861. const seekBar = this.getChild("seekBar");
  58862. if (seekBar) {
  58863. seekBar.handleMouseMove(event2);
  58864. }
  58865. }
  58866. enabled() {
  58867. return this.enabled_;
  58868. }
  58869. disable() {
  58870. this.children().forEach((child) => child.disable && child.disable());
  58871. if (!this.enabled()) {
  58872. return;
  58873. }
  58874. this.off(["mousedown", "touchstart"], this.handleMouseDownHandler_);
  58875. this.off(this.el_, "mousemove", this.handleMouseMove);
  58876. this.removeListenersAddedOnMousedownAndTouchstart();
  58877. this.addClass("disabled");
  58878. this.enabled_ = false;
  58879. if (this.player_.scrubbing()) {
  58880. const seekBar = this.getChild("seekBar");
  58881. this.player_.scrubbing(false);
  58882. if (seekBar.videoWasPlaying) {
  58883. silencePromise$1(this.player_.play());
  58884. }
  58885. }
  58886. }
  58887. enable() {
  58888. this.children().forEach((child) => child.enable && child.enable());
  58889. if (this.enabled()) {
  58890. return;
  58891. }
  58892. this.on(["mousedown", "touchstart"], this.handleMouseDownHandler_);
  58893. this.on(this.el_, "mousemove", this.handleMouseMove);
  58894. this.removeClass("disabled");
  58895. this.enabled_ = true;
  58896. }
  58897. removeListenersAddedOnMousedownAndTouchstart() {
  58898. const doc = this.el_.ownerDocument;
  58899. this.off(doc, "mousemove", this.throttledHandleMouseSeek);
  58900. this.off(doc, "touchmove", this.throttledHandleMouseSeek);
  58901. this.off(doc, "mouseup", this.handleMouseUpHandler_);
  58902. this.off(doc, "touchend", this.handleMouseUpHandler_);
  58903. }
  58904. handleMouseDown(event2) {
  58905. const doc = this.el_.ownerDocument;
  58906. const seekBar = this.getChild("seekBar");
  58907. if (seekBar) {
  58908. seekBar.handleMouseDown(event2);
  58909. }
  58910. this.on(doc, "mousemove", this.throttledHandleMouseSeek);
  58911. this.on(doc, "touchmove", this.throttledHandleMouseSeek);
  58912. this.on(doc, "mouseup", this.handleMouseUpHandler_);
  58913. this.on(doc, "touchend", this.handleMouseUpHandler_);
  58914. }
  58915. handleMouseUp(event2) {
  58916. const seekBar = this.getChild("seekBar");
  58917. if (seekBar) {
  58918. seekBar.handleMouseUp(event2);
  58919. }
  58920. this.removeListenersAddedOnMousedownAndTouchstart();
  58921. }
  58922. }
  58923. ProgressControl$1.prototype.options_ = {
  58924. children: ["seekBar"]
  58925. };
  58926. Component$1$1.registerComponent("ProgressControl", ProgressControl$1);
  58927. class PictureInPictureToggle$1 extends Button$1 {
  58928. constructor(player, options2) {
  58929. super(player, options2);
  58930. this.on(player, ["enterpictureinpicture", "leavepictureinpicture"], (e) => this.handlePictureInPictureChange(e));
  58931. this.on(player, ["disablepictureinpicturechanged", "loadedmetadata"], (e) => this.handlePictureInPictureEnabledChange(e));
  58932. this.on(player, ["loadedmetadata", "audioonlymodechange", "audiopostermodechange"], () => {
  58933. const isSourceAudio = player.currentType().substring(0, 5) === "audio";
  58934. if (isSourceAudio || player.audioPosterMode() || player.audioOnlyMode()) {
  58935. if (player.isInPictureInPicture()) {
  58936. player.exitPictureInPicture();
  58937. }
  58938. this.hide();
  58939. } else {
  58940. this.show();
  58941. }
  58942. });
  58943. this.disable();
  58944. }
  58945. buildCSSClass() {
  58946. return `vjs-picture-in-picture-control ${super.buildCSSClass()}`;
  58947. }
  58948. handlePictureInPictureEnabledChange() {
  58949. if (document_1.pictureInPictureEnabled && this.player_.disablePictureInPicture() === false || this.player_.options_.enableDocumentPictureInPicture && "documentPictureInPicture" in window_1) {
  58950. this.enable();
  58951. } else {
  58952. this.disable();
  58953. }
  58954. }
  58955. handlePictureInPictureChange(event2) {
  58956. if (this.player_.isInPictureInPicture()) {
  58957. this.controlText("Exit Picture-in-Picture");
  58958. } else {
  58959. this.controlText("Picture-in-Picture");
  58960. }
  58961. this.handlePictureInPictureEnabledChange();
  58962. }
  58963. handleClick(event2) {
  58964. if (!this.player_.isInPictureInPicture()) {
  58965. this.player_.requestPictureInPicture();
  58966. } else {
  58967. this.player_.exitPictureInPicture();
  58968. }
  58969. }
  58970. }
  58971. PictureInPictureToggle$1.prototype.controlText_ = "Picture-in-Picture";
  58972. Component$1$1.registerComponent("PictureInPictureToggle", PictureInPictureToggle$1);
  58973. class FullscreenToggle$1 extends Button$1 {
  58974. constructor(player, options2) {
  58975. super(player, options2);
  58976. this.on(player, "fullscreenchange", (e) => this.handleFullscreenChange(e));
  58977. if (document_1[player.fsApi_.fullscreenEnabled] === false) {
  58978. this.disable();
  58979. }
  58980. }
  58981. buildCSSClass() {
  58982. return `vjs-fullscreen-control ${super.buildCSSClass()}`;
  58983. }
  58984. handleFullscreenChange(event2) {
  58985. if (this.player_.isFullscreen()) {
  58986. this.controlText("Exit Fullscreen");
  58987. } else {
  58988. this.controlText("Fullscreen");
  58989. }
  58990. }
  58991. handleClick(event2) {
  58992. if (!this.player_.isFullscreen()) {
  58993. this.player_.requestFullscreen();
  58994. } else {
  58995. this.player_.exitFullscreen();
  58996. }
  58997. }
  58998. }
  58999. FullscreenToggle$1.prototype.controlText_ = "Fullscreen";
  59000. Component$1$1.registerComponent("FullscreenToggle", FullscreenToggle$1);
  59001. const checkVolumeSupport$1 = function(self2, player) {
  59002. if (player.tech_ && !player.tech_.featuresVolumeControl) {
  59003. self2.addClass("vjs-hidden");
  59004. }
  59005. self2.on(player, "loadstart", function() {
  59006. if (!player.tech_.featuresVolumeControl) {
  59007. self2.addClass("vjs-hidden");
  59008. } else {
  59009. self2.removeClass("vjs-hidden");
  59010. }
  59011. });
  59012. };
  59013. class VolumeLevel$1 extends Component$1$1 {
  59014. createEl() {
  59015. const el = super.createEl("div", {
  59016. className: "vjs-volume-level"
  59017. });
  59018. el.appendChild(super.createEl("span", {
  59019. className: "vjs-control-text"
  59020. }));
  59021. return el;
  59022. }
  59023. }
  59024. Component$1$1.registerComponent("VolumeLevel", VolumeLevel$1);
  59025. class VolumeLevelTooltip$1 extends Component$1$1 {
  59026. constructor(player, options2) {
  59027. super(player, options2);
  59028. this.update = throttle$1(bind_(this, this.update), UPDATE_REFRESH_INTERVAL$1);
  59029. }
  59030. createEl() {
  59031. return super.createEl("div", {
  59032. className: "vjs-volume-tooltip"
  59033. }, {
  59034. "aria-hidden": "true"
  59035. });
  59036. }
  59037. update(rangeBarRect, rangeBarPoint, vertical, content) {
  59038. if (!vertical) {
  59039. const tooltipRect = getBoundingClientRect$1(this.el_);
  59040. const playerRect = getBoundingClientRect$1(this.player_.el());
  59041. const volumeBarPointPx = rangeBarRect.width * rangeBarPoint;
  59042. if (!playerRect || !tooltipRect) {
  59043. return;
  59044. }
  59045. const spaceLeftOfPoint = rangeBarRect.left - playerRect.left + volumeBarPointPx;
  59046. const spaceRightOfPoint = rangeBarRect.width - volumeBarPointPx + (playerRect.right - rangeBarRect.right);
  59047. let pullTooltipBy = tooltipRect.width / 2;
  59048. if (spaceLeftOfPoint < pullTooltipBy) {
  59049. pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;
  59050. } else if (spaceRightOfPoint < pullTooltipBy) {
  59051. pullTooltipBy = spaceRightOfPoint;
  59052. }
  59053. if (pullTooltipBy < 0) {
  59054. pullTooltipBy = 0;
  59055. } else if (pullTooltipBy > tooltipRect.width) {
  59056. pullTooltipBy = tooltipRect.width;
  59057. }
  59058. this.el_.style.right = `-${pullTooltipBy}px`;
  59059. }
  59060. this.write(`${content}%`);
  59061. }
  59062. write(content) {
  59063. textContent$1(this.el_, content);
  59064. }
  59065. updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, cb) {
  59066. this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume", () => {
  59067. this.update(rangeBarRect, rangeBarPoint, vertical, volume.toFixed(0));
  59068. if (cb) {
  59069. cb();
  59070. }
  59071. });
  59072. }
  59073. }
  59074. Component$1$1.registerComponent("VolumeLevelTooltip", VolumeLevelTooltip$1);
  59075. class MouseVolumeLevelDisplay$1 extends Component$1$1 {
  59076. constructor(player, options2) {
  59077. super(player, options2);
  59078. this.update = throttle$1(bind_(this, this.update), UPDATE_REFRESH_INTERVAL$1);
  59079. }
  59080. createEl() {
  59081. return super.createEl("div", {
  59082. className: "vjs-mouse-display"
  59083. });
  59084. }
  59085. update(rangeBarRect, rangeBarPoint, vertical) {
  59086. const volume = 100 * rangeBarPoint;
  59087. this.getChild("volumeLevelTooltip").updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, () => {
  59088. if (vertical) {
  59089. this.el_.style.bottom = `${rangeBarRect.height * rangeBarPoint}px`;
  59090. } else {
  59091. this.el_.style.left = `${rangeBarRect.width * rangeBarPoint}px`;
  59092. }
  59093. });
  59094. }
  59095. }
  59096. MouseVolumeLevelDisplay$1.prototype.options_ = {
  59097. children: ["volumeLevelTooltip"]
  59098. };
  59099. Component$1$1.registerComponent("MouseVolumeLevelDisplay", MouseVolumeLevelDisplay$1);
  59100. class VolumeBar$1 extends Slider$1 {
  59101. constructor(player, options2) {
  59102. super(player, options2);
  59103. this.on("slideractive", (e) => this.updateLastVolume_(e));
  59104. this.on(player, "volumechange", (e) => this.updateARIAAttributes(e));
  59105. player.ready(() => this.updateARIAAttributes());
  59106. }
  59107. createEl() {
  59108. return super.createEl("div", {
  59109. className: "vjs-volume-bar vjs-slider-bar"
  59110. }, {
  59111. "aria-label": this.localize("Volume Level"),
  59112. "aria-live": "polite"
  59113. });
  59114. }
  59115. handleMouseDown(event2) {
  59116. if (!isSingleLeftClick$1(event2)) {
  59117. return;
  59118. }
  59119. super.handleMouseDown(event2);
  59120. }
  59121. handleMouseMove(event2) {
  59122. const mouseVolumeLevelDisplay = this.getChild("mouseVolumeLevelDisplay");
  59123. if (mouseVolumeLevelDisplay) {
  59124. const volumeBarEl = this.el();
  59125. const volumeBarRect = getBoundingClientRect$1(volumeBarEl);
  59126. const vertical = this.vertical();
  59127. let volumeBarPoint = getPointerPosition$1(volumeBarEl, event2);
  59128. volumeBarPoint = vertical ? volumeBarPoint.y : volumeBarPoint.x;
  59129. volumeBarPoint = clamp$1(volumeBarPoint, 0, 1);
  59130. mouseVolumeLevelDisplay.update(volumeBarRect, volumeBarPoint, vertical);
  59131. }
  59132. if (!isSingleLeftClick$1(event2)) {
  59133. return;
  59134. }
  59135. this.checkMuted();
  59136. this.player_.volume(this.calculateDistance(event2));
  59137. }
  59138. checkMuted() {
  59139. if (this.player_.muted()) {
  59140. this.player_.muted(false);
  59141. }
  59142. }
  59143. getPercent() {
  59144. if (this.player_.muted()) {
  59145. return 0;
  59146. }
  59147. return this.player_.volume();
  59148. }
  59149. stepForward() {
  59150. this.checkMuted();
  59151. this.player_.volume(this.player_.volume() + 0.1);
  59152. }
  59153. stepBack() {
  59154. this.checkMuted();
  59155. this.player_.volume(this.player_.volume() - 0.1);
  59156. }
  59157. updateARIAAttributes(event2) {
  59158. const ariaValue = this.player_.muted() ? 0 : this.volumeAsPercentage_();
  59159. this.el_.setAttribute("aria-valuenow", ariaValue);
  59160. this.el_.setAttribute("aria-valuetext", ariaValue + "%");
  59161. }
  59162. volumeAsPercentage_() {
  59163. return Math.round(this.player_.volume() * 100);
  59164. }
  59165. updateLastVolume_() {
  59166. const volumeBeforeDrag = this.player_.volume();
  59167. this.one("sliderinactive", () => {
  59168. if (this.player_.volume() === 0) {
  59169. this.player_.lastVolume_(volumeBeforeDrag);
  59170. }
  59171. });
  59172. }
  59173. }
  59174. VolumeBar$1.prototype.options_ = {
  59175. children: ["volumeLevel"],
  59176. barName: "volumeLevel"
  59177. };
  59178. if (!IS_IOS$1 && !IS_ANDROID$1) {
  59179. VolumeBar$1.prototype.options_.children.splice(0, 0, "mouseVolumeLevelDisplay");
  59180. }
  59181. VolumeBar$1.prototype.playerEvent = "volumechange";
  59182. Component$1$1.registerComponent("VolumeBar", VolumeBar$1);
  59183. class VolumeControl$1 extends Component$1$1 {
  59184. constructor(player, options2 = {}) {
  59185. options2.vertical = options2.vertical || false;
  59186. if (typeof options2.volumeBar === "undefined" || isPlain$1(options2.volumeBar)) {
  59187. options2.volumeBar = options2.volumeBar || {};
  59188. options2.volumeBar.vertical = options2.vertical;
  59189. }
  59190. super(player, options2);
  59191. checkVolumeSupport$1(this, player);
  59192. this.throttledHandleMouseMove = throttle$1(bind_(this, this.handleMouseMove), UPDATE_REFRESH_INTERVAL$1);
  59193. this.handleMouseUpHandler_ = (e) => this.handleMouseUp(e);
  59194. this.on("mousedown", (e) => this.handleMouseDown(e));
  59195. this.on("touchstart", (e) => this.handleMouseDown(e));
  59196. this.on("mousemove", (e) => this.handleMouseMove(e));
  59197. this.on(this.volumeBar, ["focus", "slideractive"], () => {
  59198. this.volumeBar.addClass("vjs-slider-active");
  59199. this.addClass("vjs-slider-active");
  59200. this.trigger("slideractive");
  59201. });
  59202. this.on(this.volumeBar, ["blur", "sliderinactive"], () => {
  59203. this.volumeBar.removeClass("vjs-slider-active");
  59204. this.removeClass("vjs-slider-active");
  59205. this.trigger("sliderinactive");
  59206. });
  59207. }
  59208. createEl() {
  59209. let orientationClass = "vjs-volume-horizontal";
  59210. if (this.options_.vertical) {
  59211. orientationClass = "vjs-volume-vertical";
  59212. }
  59213. return super.createEl("div", {
  59214. className: `vjs-volume-control vjs-control ${orientationClass}`
  59215. });
  59216. }
  59217. handleMouseDown(event2) {
  59218. const doc = this.el_.ownerDocument;
  59219. this.on(doc, "mousemove", this.throttledHandleMouseMove);
  59220. this.on(doc, "touchmove", this.throttledHandleMouseMove);
  59221. this.on(doc, "mouseup", this.handleMouseUpHandler_);
  59222. this.on(doc, "touchend", this.handleMouseUpHandler_);
  59223. }
  59224. handleMouseUp(event2) {
  59225. const doc = this.el_.ownerDocument;
  59226. this.off(doc, "mousemove", this.throttledHandleMouseMove);
  59227. this.off(doc, "touchmove", this.throttledHandleMouseMove);
  59228. this.off(doc, "mouseup", this.handleMouseUpHandler_);
  59229. this.off(doc, "touchend", this.handleMouseUpHandler_);
  59230. }
  59231. handleMouseMove(event2) {
  59232. this.volumeBar.handleMouseMove(event2);
  59233. }
  59234. }
  59235. VolumeControl$1.prototype.options_ = {
  59236. children: ["volumeBar"]
  59237. };
  59238. Component$1$1.registerComponent("VolumeControl", VolumeControl$1);
  59239. const checkMuteSupport$1 = function(self2, player) {
  59240. if (player.tech_ && !player.tech_.featuresMuteControl) {
  59241. self2.addClass("vjs-hidden");
  59242. }
  59243. self2.on(player, "loadstart", function() {
  59244. if (!player.tech_.featuresMuteControl) {
  59245. self2.addClass("vjs-hidden");
  59246. } else {
  59247. self2.removeClass("vjs-hidden");
  59248. }
  59249. });
  59250. };
  59251. class MuteToggle$1 extends Button$1 {
  59252. constructor(player, options2) {
  59253. super(player, options2);
  59254. checkMuteSupport$1(this, player);
  59255. this.on(player, ["loadstart", "volumechange"], (e) => this.update(e));
  59256. }
  59257. buildCSSClass() {
  59258. return `vjs-mute-control ${super.buildCSSClass()}`;
  59259. }
  59260. handleClick(event2) {
  59261. const vol = this.player_.volume();
  59262. const lastVolume = this.player_.lastVolume_();
  59263. if (vol === 0) {
  59264. const volumeToSet = lastVolume < 0.1 ? 0.1 : lastVolume;
  59265. this.player_.volume(volumeToSet);
  59266. this.player_.muted(false);
  59267. } else {
  59268. this.player_.muted(this.player_.muted() ? false : true);
  59269. }
  59270. }
  59271. update(event2) {
  59272. this.updateIcon_();
  59273. this.updateControlText_();
  59274. }
  59275. updateIcon_() {
  59276. const vol = this.player_.volume();
  59277. let level = 3;
  59278. if (IS_IOS$1 && this.player_.tech_ && this.player_.tech_.el_) {
  59279. this.player_.muted(this.player_.tech_.el_.muted);
  59280. }
  59281. if (vol === 0 || this.player_.muted()) {
  59282. level = 0;
  59283. } else if (vol < 0.33) {
  59284. level = 1;
  59285. } else if (vol < 0.67) {
  59286. level = 2;
  59287. }
  59288. removeClass$1(this.el_, [0, 1, 2, 3].reduce((str, i2) => str + `${i2 ? " " : ""}vjs-vol-${i2}`, ""));
  59289. addClass$1(this.el_, `vjs-vol-${level}`);
  59290. }
  59291. updateControlText_() {
  59292. const soundOff = this.player_.muted() || this.player_.volume() === 0;
  59293. const text = soundOff ? "Unmute" : "Mute";
  59294. if (this.controlText() !== text) {
  59295. this.controlText(text);
  59296. }
  59297. }
  59298. }
  59299. MuteToggle$1.prototype.controlText_ = "Mute";
  59300. Component$1$1.registerComponent("MuteToggle", MuteToggle$1);
  59301. class VolumePanel$1 extends Component$1$1 {
  59302. constructor(player, options2 = {}) {
  59303. if (typeof options2.inline !== "undefined") {
  59304. options2.inline = options2.inline;
  59305. } else {
  59306. options2.inline = true;
  59307. }
  59308. if (typeof options2.volumeControl === "undefined" || isPlain$1(options2.volumeControl)) {
  59309. options2.volumeControl = options2.volumeControl || {};
  59310. options2.volumeControl.vertical = !options2.inline;
  59311. }
  59312. super(player, options2);
  59313. this.handleKeyPressHandler_ = (e) => this.handleKeyPress(e);
  59314. this.on(player, ["loadstart"], (e) => this.volumePanelState_(e));
  59315. this.on(this.muteToggle, "keyup", (e) => this.handleKeyPress(e));
  59316. this.on(this.volumeControl, "keyup", (e) => this.handleVolumeControlKeyUp(e));
  59317. this.on("keydown", (e) => this.handleKeyPress(e));
  59318. this.on("mouseover", (e) => this.handleMouseOver(e));
  59319. this.on("mouseout", (e) => this.handleMouseOut(e));
  59320. this.on(this.volumeControl, ["slideractive"], this.sliderActive_);
  59321. this.on(this.volumeControl, ["sliderinactive"], this.sliderInactive_);
  59322. }
  59323. sliderActive_() {
  59324. this.addClass("vjs-slider-active");
  59325. }
  59326. sliderInactive_() {
  59327. this.removeClass("vjs-slider-active");
  59328. }
  59329. volumePanelState_() {
  59330. if (this.volumeControl.hasClass("vjs-hidden") && this.muteToggle.hasClass("vjs-hidden")) {
  59331. this.addClass("vjs-hidden");
  59332. }
  59333. if (this.volumeControl.hasClass("vjs-hidden") && !this.muteToggle.hasClass("vjs-hidden")) {
  59334. this.addClass("vjs-mute-toggle-only");
  59335. }
  59336. }
  59337. createEl() {
  59338. let orientationClass = "vjs-volume-panel-horizontal";
  59339. if (!this.options_.inline) {
  59340. orientationClass = "vjs-volume-panel-vertical";
  59341. }
  59342. return super.createEl("div", {
  59343. className: `vjs-volume-panel vjs-control ${orientationClass}`
  59344. });
  59345. }
  59346. dispose() {
  59347. this.handleMouseOut();
  59348. super.dispose();
  59349. }
  59350. handleVolumeControlKeyUp(event2) {
  59351. if (keycode.isEventKey(event2, "Esc")) {
  59352. this.muteToggle.focus();
  59353. }
  59354. }
  59355. handleMouseOver(event2) {
  59356. this.addClass("vjs-hover");
  59357. on$1(document_1, "keyup", this.handleKeyPressHandler_);
  59358. }
  59359. handleMouseOut(event2) {
  59360. this.removeClass("vjs-hover");
  59361. off$1(document_1, "keyup", this.handleKeyPressHandler_);
  59362. }
  59363. handleKeyPress(event2) {
  59364. if (keycode.isEventKey(event2, "Esc")) {
  59365. this.handleMouseOut();
  59366. }
  59367. }
  59368. }
  59369. VolumePanel$1.prototype.options_ = {
  59370. children: ["muteToggle", "volumeControl"]
  59371. };
  59372. Component$1$1.registerComponent("VolumePanel", VolumePanel$1);
  59373. class SkipForward extends Button$1 {
  59374. constructor(player, options2) {
  59375. super(player, options2);
  59376. this.validOptions = [5, 10, 30];
  59377. this.skipTime = this.getSkipForwardTime();
  59378. if (this.skipTime && this.validOptions.includes(this.skipTime)) {
  59379. this.controlText(this.localize("Skip forward {1} seconds", [this.skipTime]));
  59380. this.show();
  59381. } else {
  59382. this.hide();
  59383. }
  59384. }
  59385. getSkipForwardTime() {
  59386. const playerOptions = this.options_.playerOptions;
  59387. return playerOptions.controlBar && playerOptions.controlBar.skipButtons && playerOptions.controlBar.skipButtons.forward;
  59388. }
  59389. buildCSSClass() {
  59390. return `vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`;
  59391. }
  59392. handleClick(event2) {
  59393. const currentVideoTime = this.player_.currentTime();
  59394. const liveTracker = this.player_.liveTracker;
  59395. const duration5 = liveTracker && liveTracker.isLive() ? liveTracker.seekableEnd() : this.player_.duration();
  59396. let newTime;
  59397. if (currentVideoTime + this.skipTime <= duration5) {
  59398. newTime = currentVideoTime + this.skipTime;
  59399. } else {
  59400. newTime = duration5;
  59401. }
  59402. this.player_.currentTime(newTime);
  59403. }
  59404. handleLanguagechange() {
  59405. this.controlText(this.localize("Skip forward {1} seconds", [this.skipTime]));
  59406. }
  59407. }
  59408. Component$1$1.registerComponent("SkipForward", SkipForward);
  59409. class SkipBackward extends Button$1 {
  59410. constructor(player, options2) {
  59411. super(player, options2);
  59412. this.validOptions = [5, 10, 30];
  59413. this.skipTime = this.getSkipBackwardTime();
  59414. if (this.skipTime && this.validOptions.includes(this.skipTime)) {
  59415. this.controlText(this.localize("Skip backward {1} seconds", [this.skipTime]));
  59416. this.show();
  59417. } else {
  59418. this.hide();
  59419. }
  59420. }
  59421. getSkipBackwardTime() {
  59422. const playerOptions = this.options_.playerOptions;
  59423. return playerOptions.controlBar && playerOptions.controlBar.skipButtons && playerOptions.controlBar.skipButtons.backward;
  59424. }
  59425. buildCSSClass() {
  59426. return `vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`;
  59427. }
  59428. handleClick(event2) {
  59429. const currentVideoTime = this.player_.currentTime();
  59430. const liveTracker = this.player_.liveTracker;
  59431. const seekableStart = liveTracker && liveTracker.isLive() && liveTracker.seekableStart();
  59432. let newTime;
  59433. if (seekableStart && currentVideoTime - this.skipTime <= seekableStart) {
  59434. newTime = seekableStart;
  59435. } else if (currentVideoTime >= this.skipTime) {
  59436. newTime = currentVideoTime - this.skipTime;
  59437. } else {
  59438. newTime = 0;
  59439. }
  59440. this.player_.currentTime(newTime);
  59441. }
  59442. handleLanguagechange() {
  59443. this.controlText(this.localize("Skip backward {1} seconds", [this.skipTime]));
  59444. }
  59445. }
  59446. SkipBackward.prototype.controlText_ = "Skip Backward";
  59447. Component$1$1.registerComponent("SkipBackward", SkipBackward);
  59448. class Menu$1 extends Component$1$1 {
  59449. constructor(player, options2) {
  59450. super(player, options2);
  59451. if (options2) {
  59452. this.menuButton_ = options2.menuButton;
  59453. }
  59454. this.focusedChild_ = -1;
  59455. this.on("keydown", (e) => this.handleKeyDown(e));
  59456. this.boundHandleBlur_ = (e) => this.handleBlur(e);
  59457. this.boundHandleTapClick_ = (e) => this.handleTapClick(e);
  59458. }
  59459. addEventListenerForItem(component) {
  59460. if (!(component instanceof Component$1$1)) {
  59461. return;
  59462. }
  59463. this.on(component, "blur", this.boundHandleBlur_);
  59464. this.on(component, ["tap", "click"], this.boundHandleTapClick_);
  59465. }
  59466. removeEventListenerForItem(component) {
  59467. if (!(component instanceof Component$1$1)) {
  59468. return;
  59469. }
  59470. this.off(component, "blur", this.boundHandleBlur_);
  59471. this.off(component, ["tap", "click"], this.boundHandleTapClick_);
  59472. }
  59473. removeChild(component) {
  59474. if (typeof component === "string") {
  59475. component = this.getChild(component);
  59476. }
  59477. this.removeEventListenerForItem(component);
  59478. super.removeChild(component);
  59479. }
  59480. addItem(component) {
  59481. const childComponent = this.addChild(component);
  59482. if (childComponent) {
  59483. this.addEventListenerForItem(childComponent);
  59484. }
  59485. }
  59486. createEl() {
  59487. const contentElType = this.options_.contentElType || "ul";
  59488. this.contentEl_ = createEl$1(contentElType, {
  59489. className: "vjs-menu-content"
  59490. });
  59491. this.contentEl_.setAttribute("role", "menu");
  59492. const el = super.createEl("div", {
  59493. append: this.contentEl_,
  59494. className: "vjs-menu"
  59495. });
  59496. el.appendChild(this.contentEl_);
  59497. on$1(el, "click", function(event2) {
  59498. event2.preventDefault();
  59499. event2.stopImmediatePropagation();
  59500. });
  59501. return el;
  59502. }
  59503. dispose() {
  59504. this.contentEl_ = null;
  59505. this.boundHandleBlur_ = null;
  59506. this.boundHandleTapClick_ = null;
  59507. super.dispose();
  59508. }
  59509. handleBlur(event2) {
  59510. const relatedTarget = event2.relatedTarget || document_1.activeElement;
  59511. if (!this.children().some((element) => {
  59512. return element.el() === relatedTarget;
  59513. })) {
  59514. const btn = this.menuButton_;
  59515. if (btn && btn.buttonPressed_ && relatedTarget !== btn.el().firstChild) {
  59516. btn.unpressButton();
  59517. }
  59518. }
  59519. }
  59520. handleTapClick(event2) {
  59521. if (this.menuButton_) {
  59522. this.menuButton_.unpressButton();
  59523. const childComponents = this.children();
  59524. if (!Array.isArray(childComponents)) {
  59525. return;
  59526. }
  59527. const foundComponent = childComponents.filter((component) => component.el() === event2.target)[0];
  59528. if (!foundComponent) {
  59529. return;
  59530. }
  59531. if (foundComponent.name() !== "CaptionSettingsMenuItem") {
  59532. this.menuButton_.focus();
  59533. }
  59534. }
  59535. }
  59536. handleKeyDown(event2) {
  59537. if (keycode.isEventKey(event2, "Left") || keycode.isEventKey(event2, "Down")) {
  59538. event2.preventDefault();
  59539. event2.stopPropagation();
  59540. this.stepForward();
  59541. } else if (keycode.isEventKey(event2, "Right") || keycode.isEventKey(event2, "Up")) {
  59542. event2.preventDefault();
  59543. event2.stopPropagation();
  59544. this.stepBack();
  59545. }
  59546. }
  59547. stepForward() {
  59548. let stepChild = 0;
  59549. if (this.focusedChild_ !== void 0) {
  59550. stepChild = this.focusedChild_ + 1;
  59551. }
  59552. this.focus(stepChild);
  59553. }
  59554. stepBack() {
  59555. let stepChild = 0;
  59556. if (this.focusedChild_ !== void 0) {
  59557. stepChild = this.focusedChild_ - 1;
  59558. }
  59559. this.focus(stepChild);
  59560. }
  59561. focus(item = 0) {
  59562. const children = this.children().slice();
  59563. const haveTitle = children.length && children[0].hasClass("vjs-menu-title");
  59564. if (haveTitle) {
  59565. children.shift();
  59566. }
  59567. if (children.length > 0) {
  59568. if (item < 0) {
  59569. item = 0;
  59570. } else if (item >= children.length) {
  59571. item = children.length - 1;
  59572. }
  59573. this.focusedChild_ = item;
  59574. children[item].el_.focus();
  59575. }
  59576. }
  59577. }
  59578. Component$1$1.registerComponent("Menu", Menu$1);
  59579. class MenuButton$1 extends Component$1$1 {
  59580. constructor(player, options2 = {}) {
  59581. super(player, options2);
  59582. this.menuButton_ = new Button$1(player, options2);
  59583. this.menuButton_.controlText(this.controlText_);
  59584. this.menuButton_.el_.setAttribute("aria-haspopup", "true");
  59585. const buttonClass = Button$1.prototype.buildCSSClass();
  59586. this.menuButton_.el_.className = this.buildCSSClass() + " " + buttonClass;
  59587. this.menuButton_.removeClass("vjs-control");
  59588. this.addChild(this.menuButton_);
  59589. this.update();
  59590. this.enabled_ = true;
  59591. const handleClick = (e) => this.handleClick(e);
  59592. this.handleMenuKeyUp_ = (e) => this.handleMenuKeyUp(e);
  59593. this.on(this.menuButton_, "tap", handleClick);
  59594. this.on(this.menuButton_, "click", handleClick);
  59595. this.on(this.menuButton_, "keydown", (e) => this.handleKeyDown(e));
  59596. this.on(this.menuButton_, "mouseenter", () => {
  59597. this.addClass("vjs-hover");
  59598. this.menu.show();
  59599. on$1(document_1, "keyup", this.handleMenuKeyUp_);
  59600. });
  59601. this.on("mouseleave", (e) => this.handleMouseLeave(e));
  59602. this.on("keydown", (e) => this.handleSubmenuKeyDown(e));
  59603. }
  59604. update() {
  59605. const menu = this.createMenu();
  59606. if (this.menu) {
  59607. this.menu.dispose();
  59608. this.removeChild(this.menu);
  59609. }
  59610. this.menu = menu;
  59611. this.addChild(menu);
  59612. this.buttonPressed_ = false;
  59613. this.menuButton_.el_.setAttribute("aria-expanded", "false");
  59614. if (this.items && this.items.length <= this.hideThreshold_) {
  59615. this.hide();
  59616. this.menu.contentEl_.removeAttribute("role");
  59617. } else {
  59618. this.show();
  59619. this.menu.contentEl_.setAttribute("role", "menu");
  59620. }
  59621. }
  59622. createMenu() {
  59623. const menu = new Menu$1(this.player_, {
  59624. menuButton: this
  59625. });
  59626. this.hideThreshold_ = 0;
  59627. if (this.options_.title) {
  59628. const titleEl = createEl$1("li", {
  59629. className: "vjs-menu-title",
  59630. textContent: toTitleCase$1$1(this.options_.title),
  59631. tabIndex: -1
  59632. });
  59633. const titleComponent = new Component$1$1(this.player_, {
  59634. el: titleEl
  59635. });
  59636. menu.addItem(titleComponent);
  59637. }
  59638. this.items = this.createItems();
  59639. if (this.items) {
  59640. for (let i2 = 0; i2 < this.items.length; i2++) {
  59641. menu.addItem(this.items[i2]);
  59642. }
  59643. }
  59644. return menu;
  59645. }
  59646. createItems() {
  59647. }
  59648. createEl() {
  59649. return super.createEl("div", {
  59650. className: this.buildWrapperCSSClass()
  59651. }, {});
  59652. }
  59653. buildWrapperCSSClass() {
  59654. let menuButtonClass = "vjs-menu-button";
  59655. if (this.options_.inline === true) {
  59656. menuButtonClass += "-inline";
  59657. } else {
  59658. menuButtonClass += "-popup";
  59659. }
  59660. const buttonClass = Button$1.prototype.buildCSSClass();
  59661. return `vjs-menu-button ${menuButtonClass} ${buttonClass} ${super.buildCSSClass()}`;
  59662. }
  59663. buildCSSClass() {
  59664. let menuButtonClass = "vjs-menu-button";
  59665. if (this.options_.inline === true) {
  59666. menuButtonClass += "-inline";
  59667. } else {
  59668. menuButtonClass += "-popup";
  59669. }
  59670. return `vjs-menu-button ${menuButtonClass} ${super.buildCSSClass()}`;
  59671. }
  59672. controlText(text, el = this.menuButton_.el()) {
  59673. return this.menuButton_.controlText(text, el);
  59674. }
  59675. dispose() {
  59676. this.handleMouseLeave();
  59677. super.dispose();
  59678. }
  59679. handleClick(event2) {
  59680. if (this.buttonPressed_) {
  59681. this.unpressButton();
  59682. } else {
  59683. this.pressButton();
  59684. }
  59685. }
  59686. handleMouseLeave(event2) {
  59687. this.removeClass("vjs-hover");
  59688. off$1(document_1, "keyup", this.handleMenuKeyUp_);
  59689. }
  59690. focus() {
  59691. this.menuButton_.focus();
  59692. }
  59693. blur() {
  59694. this.menuButton_.blur();
  59695. }
  59696. handleKeyDown(event2) {
  59697. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  59698. if (this.buttonPressed_) {
  59699. this.unpressButton();
  59700. }
  59701. if (!keycode.isEventKey(event2, "Tab")) {
  59702. event2.preventDefault();
  59703. this.menuButton_.focus();
  59704. }
  59705. } else if (keycode.isEventKey(event2, "Up") || keycode.isEventKey(event2, "Down")) {
  59706. if (!this.buttonPressed_) {
  59707. event2.preventDefault();
  59708. this.pressButton();
  59709. }
  59710. }
  59711. }
  59712. handleMenuKeyUp(event2) {
  59713. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  59714. this.removeClass("vjs-hover");
  59715. }
  59716. }
  59717. handleSubmenuKeyPress(event2) {
  59718. this.handleSubmenuKeyDown(event2);
  59719. }
  59720. handleSubmenuKeyDown(event2) {
  59721. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  59722. if (this.buttonPressed_) {
  59723. this.unpressButton();
  59724. }
  59725. if (!keycode.isEventKey(event2, "Tab")) {
  59726. event2.preventDefault();
  59727. this.menuButton_.focus();
  59728. }
  59729. }
  59730. }
  59731. pressButton() {
  59732. if (this.enabled_) {
  59733. this.buttonPressed_ = true;
  59734. this.menu.show();
  59735. this.menu.lockShowing();
  59736. this.menuButton_.el_.setAttribute("aria-expanded", "true");
  59737. if (IS_IOS$1 && isInFrame$1()) {
  59738. return;
  59739. }
  59740. this.menu.focus();
  59741. }
  59742. }
  59743. unpressButton() {
  59744. if (this.enabled_) {
  59745. this.buttonPressed_ = false;
  59746. this.menu.unlockShowing();
  59747. this.menu.hide();
  59748. this.menuButton_.el_.setAttribute("aria-expanded", "false");
  59749. }
  59750. }
  59751. disable() {
  59752. this.unpressButton();
  59753. this.enabled_ = false;
  59754. this.addClass("vjs-disabled");
  59755. this.menuButton_.disable();
  59756. }
  59757. enable() {
  59758. this.enabled_ = true;
  59759. this.removeClass("vjs-disabled");
  59760. this.menuButton_.enable();
  59761. }
  59762. }
  59763. Component$1$1.registerComponent("MenuButton", MenuButton$1);
  59764. class TrackButton$1 extends MenuButton$1 {
  59765. constructor(player, options2) {
  59766. const tracks = options2.tracks;
  59767. super(player, options2);
  59768. if (this.items.length <= 1) {
  59769. this.hide();
  59770. }
  59771. if (!tracks) {
  59772. return;
  59773. }
  59774. const updateHandler = bind_(this, this.update);
  59775. tracks.addEventListener("removetrack", updateHandler);
  59776. tracks.addEventListener("addtrack", updateHandler);
  59777. tracks.addEventListener("labelchange", updateHandler);
  59778. this.player_.on("ready", updateHandler);
  59779. this.player_.on("dispose", function() {
  59780. tracks.removeEventListener("removetrack", updateHandler);
  59781. tracks.removeEventListener("addtrack", updateHandler);
  59782. tracks.removeEventListener("labelchange", updateHandler);
  59783. });
  59784. }
  59785. }
  59786. Component$1$1.registerComponent("TrackButton", TrackButton$1);
  59787. const MenuKeys$1 = ["Tab", "Esc", "Up", "Down", "Right", "Left"];
  59788. class MenuItem$1 extends ClickableComponent$1 {
  59789. constructor(player, options2) {
  59790. super(player, options2);
  59791. this.selectable = options2.selectable;
  59792. this.isSelected_ = options2.selected || false;
  59793. this.multiSelectable = options2.multiSelectable;
  59794. this.selected(this.isSelected_);
  59795. if (this.selectable) {
  59796. if (this.multiSelectable) {
  59797. this.el_.setAttribute("role", "menuitemcheckbox");
  59798. } else {
  59799. this.el_.setAttribute("role", "menuitemradio");
  59800. }
  59801. } else {
  59802. this.el_.setAttribute("role", "menuitem");
  59803. }
  59804. }
  59805. createEl(type2, props, attrs) {
  59806. this.nonIconControl = true;
  59807. const el = super.createEl("li", Object.assign({
  59808. className: "vjs-menu-item",
  59809. tabIndex: -1
  59810. }, props), attrs);
  59811. el.replaceChild(createEl$1("span", {
  59812. className: "vjs-menu-item-text",
  59813. textContent: this.localize(this.options_.label)
  59814. }), el.querySelector(".vjs-icon-placeholder"));
  59815. return el;
  59816. }
  59817. handleKeyDown(event2) {
  59818. if (!MenuKeys$1.some((key) => keycode.isEventKey(event2, key))) {
  59819. super.handleKeyDown(event2);
  59820. }
  59821. }
  59822. handleClick(event2) {
  59823. this.selected(true);
  59824. }
  59825. selected(selected) {
  59826. if (this.selectable) {
  59827. if (selected) {
  59828. this.addClass("vjs-selected");
  59829. this.el_.setAttribute("aria-checked", "true");
  59830. this.controlText(", selected");
  59831. this.isSelected_ = true;
  59832. } else {
  59833. this.removeClass("vjs-selected");
  59834. this.el_.setAttribute("aria-checked", "false");
  59835. this.controlText("");
  59836. this.isSelected_ = false;
  59837. }
  59838. }
  59839. }
  59840. }
  59841. Component$1$1.registerComponent("MenuItem", MenuItem$1);
  59842. class TextTrackMenuItem$1 extends MenuItem$1 {
  59843. constructor(player, options2) {
  59844. const track = options2.track;
  59845. const tracks = player.textTracks();
  59846. options2.label = track.label || track.language || "Unknown";
  59847. options2.selected = track.mode === "showing";
  59848. super(player, options2);
  59849. this.track = track;
  59850. this.kinds = (options2.kinds || [options2.kind || this.track.kind]).filter(Boolean);
  59851. const changeHandler = (...args) => {
  59852. this.handleTracksChange.apply(this, args);
  59853. };
  59854. const selectedLanguageChangeHandler = (...args) => {
  59855. this.handleSelectedLanguageChange.apply(this, args);
  59856. };
  59857. player.on(["loadstart", "texttrackchange"], changeHandler);
  59858. tracks.addEventListener("change", changeHandler);
  59859. tracks.addEventListener("selectedlanguagechange", selectedLanguageChangeHandler);
  59860. this.on("dispose", function() {
  59861. player.off(["loadstart", "texttrackchange"], changeHandler);
  59862. tracks.removeEventListener("change", changeHandler);
  59863. tracks.removeEventListener("selectedlanguagechange", selectedLanguageChangeHandler);
  59864. });
  59865. if (tracks.onchange === void 0) {
  59866. let event2;
  59867. this.on(["tap", "click"], function() {
  59868. if (typeof window_1.Event !== "object") {
  59869. try {
  59870. event2 = new window_1.Event("change");
  59871. } catch (err) {
  59872. }
  59873. }
  59874. if (!event2) {
  59875. event2 = document_1.createEvent("Event");
  59876. event2.initEvent("change", true, true);
  59877. }
  59878. tracks.dispatchEvent(event2);
  59879. });
  59880. }
  59881. this.handleTracksChange();
  59882. }
  59883. handleClick(event2) {
  59884. const referenceTrack = this.track;
  59885. const tracks = this.player_.textTracks();
  59886. super.handleClick(event2);
  59887. if (!tracks) {
  59888. return;
  59889. }
  59890. for (let i2 = 0; i2 < tracks.length; i2++) {
  59891. const track = tracks[i2];
  59892. if (this.kinds.indexOf(track.kind) === -1) {
  59893. continue;
  59894. }
  59895. if (track === referenceTrack) {
  59896. if (track.mode !== "showing") {
  59897. track.mode = "showing";
  59898. }
  59899. } else if (track.mode !== "disabled") {
  59900. track.mode = "disabled";
  59901. }
  59902. }
  59903. }
  59904. handleTracksChange(event2) {
  59905. const shouldBeSelected = this.track.mode === "showing";
  59906. if (shouldBeSelected !== this.isSelected_) {
  59907. this.selected(shouldBeSelected);
  59908. }
  59909. }
  59910. handleSelectedLanguageChange(event2) {
  59911. if (this.track.mode === "showing") {
  59912. const selectedLanguage = this.player_.cache_.selectedLanguage;
  59913. if (selectedLanguage && selectedLanguage.enabled && selectedLanguage.language === this.track.language && selectedLanguage.kind !== this.track.kind) {
  59914. return;
  59915. }
  59916. this.player_.cache_.selectedLanguage = {
  59917. enabled: true,
  59918. language: this.track.language,
  59919. kind: this.track.kind
  59920. };
  59921. }
  59922. }
  59923. dispose() {
  59924. this.track = null;
  59925. super.dispose();
  59926. }
  59927. }
  59928. Component$1$1.registerComponent("TextTrackMenuItem", TextTrackMenuItem$1);
  59929. class OffTextTrackMenuItem$1 extends TextTrackMenuItem$1 {
  59930. constructor(player, options2) {
  59931. options2.track = {
  59932. player,
  59933. kind: options2.kind,
  59934. kinds: options2.kinds,
  59935. default: false,
  59936. mode: "disabled"
  59937. };
  59938. if (!options2.kinds) {
  59939. options2.kinds = [options2.kind];
  59940. }
  59941. if (options2.label) {
  59942. options2.track.label = options2.label;
  59943. } else {
  59944. options2.track.label = options2.kinds.join(" and ") + " off";
  59945. }
  59946. options2.selectable = true;
  59947. options2.multiSelectable = false;
  59948. super(player, options2);
  59949. }
  59950. handleTracksChange(event2) {
  59951. const tracks = this.player().textTracks();
  59952. let shouldBeSelected = true;
  59953. for (let i2 = 0, l = tracks.length; i2 < l; i2++) {
  59954. const track = tracks[i2];
  59955. if (this.options_.kinds.indexOf(track.kind) > -1 && track.mode === "showing") {
  59956. shouldBeSelected = false;
  59957. break;
  59958. }
  59959. }
  59960. if (shouldBeSelected !== this.isSelected_) {
  59961. this.selected(shouldBeSelected);
  59962. }
  59963. }
  59964. handleSelectedLanguageChange(event2) {
  59965. const tracks = this.player().textTracks();
  59966. let allHidden = true;
  59967. for (let i2 = 0, l = tracks.length; i2 < l; i2++) {
  59968. const track = tracks[i2];
  59969. if (["captions", "descriptions", "subtitles"].indexOf(track.kind) > -1 && track.mode === "showing") {
  59970. allHidden = false;
  59971. break;
  59972. }
  59973. }
  59974. if (allHidden) {
  59975. this.player_.cache_.selectedLanguage = {
  59976. enabled: false
  59977. };
  59978. }
  59979. }
  59980. handleLanguagechange() {
  59981. this.$(".vjs-menu-item-text").textContent = this.player_.localize(this.options_.label);
  59982. super.handleLanguagechange();
  59983. }
  59984. }
  59985. Component$1$1.registerComponent("OffTextTrackMenuItem", OffTextTrackMenuItem$1);
  59986. class TextTrackButton$1 extends TrackButton$1 {
  59987. constructor(player, options2 = {}) {
  59988. options2.tracks = player.textTracks();
  59989. super(player, options2);
  59990. }
  59991. createItems(items = [], TrackMenuItem = TextTrackMenuItem$1) {
  59992. let label;
  59993. if (this.label_) {
  59994. label = `${this.label_} off`;
  59995. }
  59996. items.push(new OffTextTrackMenuItem$1(this.player_, {
  59997. kinds: this.kinds_,
  59998. kind: this.kind_,
  59999. label
  60000. }));
  60001. this.hideThreshold_ += 1;
  60002. const tracks = this.player_.textTracks();
  60003. if (!Array.isArray(this.kinds_)) {
  60004. this.kinds_ = [this.kind_];
  60005. }
  60006. for (let i2 = 0; i2 < tracks.length; i2++) {
  60007. const track = tracks[i2];
  60008. if (this.kinds_.indexOf(track.kind) > -1) {
  60009. const item = new TrackMenuItem(this.player_, {
  60010. track,
  60011. kinds: this.kinds_,
  60012. kind: this.kind_,
  60013. selectable: true,
  60014. multiSelectable: false
  60015. });
  60016. item.addClass(`vjs-${track.kind}-menu-item`);
  60017. items.push(item);
  60018. }
  60019. }
  60020. return items;
  60021. }
  60022. }
  60023. Component$1$1.registerComponent("TextTrackButton", TextTrackButton$1);
  60024. class ChaptersTrackMenuItem$1 extends MenuItem$1 {
  60025. constructor(player, options2) {
  60026. const track = options2.track;
  60027. const cue = options2.cue;
  60028. const currentTime = player.currentTime();
  60029. options2.selectable = true;
  60030. options2.multiSelectable = false;
  60031. options2.label = cue.text;
  60032. options2.selected = cue.startTime <= currentTime && currentTime < cue.endTime;
  60033. super(player, options2);
  60034. this.track = track;
  60035. this.cue = cue;
  60036. }
  60037. handleClick(event2) {
  60038. super.handleClick();
  60039. this.player_.currentTime(this.cue.startTime);
  60040. }
  60041. }
  60042. Component$1$1.registerComponent("ChaptersTrackMenuItem", ChaptersTrackMenuItem$1);
  60043. class ChaptersButton$1 extends TextTrackButton$1 {
  60044. constructor(player, options2, ready) {
  60045. super(player, options2, ready);
  60046. this.selectCurrentItem_ = () => {
  60047. this.items.forEach((item) => {
  60048. item.selected(this.track_.activeCues[0] === item.cue);
  60049. });
  60050. };
  60051. }
  60052. buildCSSClass() {
  60053. return `vjs-chapters-button ${super.buildCSSClass()}`;
  60054. }
  60055. buildWrapperCSSClass() {
  60056. return `vjs-chapters-button ${super.buildWrapperCSSClass()}`;
  60057. }
  60058. update(event2) {
  60059. if (event2 && event2.track && event2.track.kind !== "chapters") {
  60060. return;
  60061. }
  60062. const track = this.findChaptersTrack();
  60063. if (track !== this.track_) {
  60064. this.setTrack(track);
  60065. super.update();
  60066. } else if (!this.items || track && track.cues && track.cues.length !== this.items.length) {
  60067. super.update();
  60068. }
  60069. }
  60070. setTrack(track) {
  60071. if (this.track_ === track) {
  60072. return;
  60073. }
  60074. if (!this.updateHandler_) {
  60075. this.updateHandler_ = this.update.bind(this);
  60076. }
  60077. if (this.track_) {
  60078. const remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
  60079. if (remoteTextTrackEl) {
  60080. remoteTextTrackEl.removeEventListener("load", this.updateHandler_);
  60081. }
  60082. this.track_.removeEventListener("cuechange", this.selectCurrentItem_);
  60083. this.track_ = null;
  60084. }
  60085. this.track_ = track;
  60086. if (this.track_) {
  60087. this.track_.mode = "hidden";
  60088. const remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
  60089. if (remoteTextTrackEl) {
  60090. remoteTextTrackEl.addEventListener("load", this.updateHandler_);
  60091. }
  60092. this.track_.addEventListener("cuechange", this.selectCurrentItem_);
  60093. }
  60094. }
  60095. findChaptersTrack() {
  60096. const tracks = this.player_.textTracks() || [];
  60097. for (let i2 = tracks.length - 1; i2 >= 0; i2--) {
  60098. const track = tracks[i2];
  60099. if (track.kind === this.kind_) {
  60100. return track;
  60101. }
  60102. }
  60103. }
  60104. getMenuCaption() {
  60105. if (this.track_ && this.track_.label) {
  60106. return this.track_.label;
  60107. }
  60108. return this.localize(toTitleCase$1$1(this.kind_));
  60109. }
  60110. createMenu() {
  60111. this.options_.title = this.getMenuCaption();
  60112. return super.createMenu();
  60113. }
  60114. createItems() {
  60115. const items = [];
  60116. if (!this.track_) {
  60117. return items;
  60118. }
  60119. const cues = this.track_.cues;
  60120. if (!cues) {
  60121. return items;
  60122. }
  60123. for (let i2 = 0, l = cues.length; i2 < l; i2++) {
  60124. const cue = cues[i2];
  60125. const mi = new ChaptersTrackMenuItem$1(this.player_, {
  60126. track: this.track_,
  60127. cue
  60128. });
  60129. items.push(mi);
  60130. }
  60131. return items;
  60132. }
  60133. }
  60134. ChaptersButton$1.prototype.kind_ = "chapters";
  60135. ChaptersButton$1.prototype.controlText_ = "Chapters";
  60136. Component$1$1.registerComponent("ChaptersButton", ChaptersButton$1);
  60137. class DescriptionsButton$1 extends TextTrackButton$1 {
  60138. constructor(player, options2, ready) {
  60139. super(player, options2, ready);
  60140. const tracks = player.textTracks();
  60141. const changeHandler = bind_(this, this.handleTracksChange);
  60142. tracks.addEventListener("change", changeHandler);
  60143. this.on("dispose", function() {
  60144. tracks.removeEventListener("change", changeHandler);
  60145. });
  60146. }
  60147. handleTracksChange(event2) {
  60148. const tracks = this.player().textTracks();
  60149. let disabled = false;
  60150. for (let i2 = 0, l = tracks.length; i2 < l; i2++) {
  60151. const track = tracks[i2];
  60152. if (track.kind !== this.kind_ && track.mode === "showing") {
  60153. disabled = true;
  60154. break;
  60155. }
  60156. }
  60157. if (disabled) {
  60158. this.disable();
  60159. } else {
  60160. this.enable();
  60161. }
  60162. }
  60163. buildCSSClass() {
  60164. return `vjs-descriptions-button ${super.buildCSSClass()}`;
  60165. }
  60166. buildWrapperCSSClass() {
  60167. return `vjs-descriptions-button ${super.buildWrapperCSSClass()}`;
  60168. }
  60169. }
  60170. DescriptionsButton$1.prototype.kind_ = "descriptions";
  60171. DescriptionsButton$1.prototype.controlText_ = "Descriptions";
  60172. Component$1$1.registerComponent("DescriptionsButton", DescriptionsButton$1);
  60173. class SubtitlesButton$1 extends TextTrackButton$1 {
  60174. constructor(player, options2, ready) {
  60175. super(player, options2, ready);
  60176. }
  60177. buildCSSClass() {
  60178. return `vjs-subtitles-button ${super.buildCSSClass()}`;
  60179. }
  60180. buildWrapperCSSClass() {
  60181. return `vjs-subtitles-button ${super.buildWrapperCSSClass()}`;
  60182. }
  60183. }
  60184. SubtitlesButton$1.prototype.kind_ = "subtitles";
  60185. SubtitlesButton$1.prototype.controlText_ = "Subtitles";
  60186. Component$1$1.registerComponent("SubtitlesButton", SubtitlesButton$1);
  60187. class CaptionSettingsMenuItem$1 extends TextTrackMenuItem$1 {
  60188. constructor(player, options2) {
  60189. options2.track = {
  60190. player,
  60191. kind: options2.kind,
  60192. label: options2.kind + " settings",
  60193. selectable: false,
  60194. default: false,
  60195. mode: "disabled"
  60196. };
  60197. options2.selectable = false;
  60198. options2.name = "CaptionSettingsMenuItem";
  60199. super(player, options2);
  60200. this.addClass("vjs-texttrack-settings");
  60201. this.controlText(", opens " + options2.kind + " settings dialog");
  60202. }
  60203. handleClick(event2) {
  60204. this.player().getChild("textTrackSettings").open();
  60205. }
  60206. handleLanguagechange() {
  60207. this.$(".vjs-menu-item-text").textContent = this.player_.localize(this.options_.kind + " settings");
  60208. super.handleLanguagechange();
  60209. }
  60210. }
  60211. Component$1$1.registerComponent("CaptionSettingsMenuItem", CaptionSettingsMenuItem$1);
  60212. class CaptionsButton$1 extends TextTrackButton$1 {
  60213. constructor(player, options2, ready) {
  60214. super(player, options2, ready);
  60215. }
  60216. buildCSSClass() {
  60217. return `vjs-captions-button ${super.buildCSSClass()}`;
  60218. }
  60219. buildWrapperCSSClass() {
  60220. return `vjs-captions-button ${super.buildWrapperCSSClass()}`;
  60221. }
  60222. createItems() {
  60223. const items = [];
  60224. if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild("textTrackSettings")) {
  60225. items.push(new CaptionSettingsMenuItem$1(this.player_, {
  60226. kind: this.kind_
  60227. }));
  60228. this.hideThreshold_ += 1;
  60229. }
  60230. return super.createItems(items);
  60231. }
  60232. }
  60233. CaptionsButton$1.prototype.kind_ = "captions";
  60234. CaptionsButton$1.prototype.controlText_ = "Captions";
  60235. Component$1$1.registerComponent("CaptionsButton", CaptionsButton$1);
  60236. class SubsCapsMenuItem$1 extends TextTrackMenuItem$1 {
  60237. createEl(type2, props, attrs) {
  60238. const el = super.createEl(type2, props, attrs);
  60239. const parentSpan = el.querySelector(".vjs-menu-item-text");
  60240. if (this.options_.track.kind === "captions") {
  60241. parentSpan.appendChild(createEl$1("span", {
  60242. className: "vjs-icon-placeholder"
  60243. }, {
  60244. "aria-hidden": true
  60245. }));
  60246. parentSpan.appendChild(createEl$1("span", {
  60247. className: "vjs-control-text",
  60248. textContent: ` ${this.localize("Captions")}`
  60249. }));
  60250. }
  60251. return el;
  60252. }
  60253. }
  60254. Component$1$1.registerComponent("SubsCapsMenuItem", SubsCapsMenuItem$1);
  60255. class SubsCapsButton$1 extends TextTrackButton$1 {
  60256. constructor(player, options2 = {}) {
  60257. super(player, options2);
  60258. this.label_ = "subtitles";
  60259. if (["en", "en-us", "en-ca", "fr-ca"].indexOf(this.player_.language_) > -1) {
  60260. this.label_ = "captions";
  60261. }
  60262. this.menuButton_.controlText(toTitleCase$1$1(this.label_));
  60263. }
  60264. buildCSSClass() {
  60265. return `vjs-subs-caps-button ${super.buildCSSClass()}`;
  60266. }
  60267. buildWrapperCSSClass() {
  60268. return `vjs-subs-caps-button ${super.buildWrapperCSSClass()}`;
  60269. }
  60270. createItems() {
  60271. let items = [];
  60272. if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild("textTrackSettings")) {
  60273. items.push(new CaptionSettingsMenuItem$1(this.player_, {
  60274. kind: this.label_
  60275. }));
  60276. this.hideThreshold_ += 1;
  60277. }
  60278. items = super.createItems(items, SubsCapsMenuItem$1);
  60279. return items;
  60280. }
  60281. }
  60282. SubsCapsButton$1.prototype.kinds_ = ["captions", "subtitles"];
  60283. SubsCapsButton$1.prototype.controlText_ = "Subtitles";
  60284. Component$1$1.registerComponent("SubsCapsButton", SubsCapsButton$1);
  60285. class AudioTrackMenuItem$1 extends MenuItem$1 {
  60286. constructor(player, options2) {
  60287. const track = options2.track;
  60288. const tracks = player.audioTracks();
  60289. options2.label = track.label || track.language || "Unknown";
  60290. options2.selected = track.enabled;
  60291. super(player, options2);
  60292. this.track = track;
  60293. this.addClass(`vjs-${track.kind}-menu-item`);
  60294. const changeHandler = (...args) => {
  60295. this.handleTracksChange.apply(this, args);
  60296. };
  60297. tracks.addEventListener("change", changeHandler);
  60298. this.on("dispose", () => {
  60299. tracks.removeEventListener("change", changeHandler);
  60300. });
  60301. }
  60302. createEl(type2, props, attrs) {
  60303. const el = super.createEl(type2, props, attrs);
  60304. const parentSpan = el.querySelector(".vjs-menu-item-text");
  60305. if (this.options_.track.kind === "main-desc") {
  60306. parentSpan.appendChild(createEl$1("span", {
  60307. className: "vjs-icon-placeholder"
  60308. }, {
  60309. "aria-hidden": true
  60310. }));
  60311. parentSpan.appendChild(createEl$1("span", {
  60312. className: "vjs-control-text",
  60313. textContent: " " + this.localize("Descriptions")
  60314. }));
  60315. }
  60316. return el;
  60317. }
  60318. handleClick(event2) {
  60319. super.handleClick(event2);
  60320. this.track.enabled = true;
  60321. if (this.player_.tech_.featuresNativeAudioTracks) {
  60322. const tracks = this.player_.audioTracks();
  60323. for (let i2 = 0; i2 < tracks.length; i2++) {
  60324. const track = tracks[i2];
  60325. if (track === this.track) {
  60326. continue;
  60327. }
  60328. track.enabled = track === this.track;
  60329. }
  60330. }
  60331. }
  60332. handleTracksChange(event2) {
  60333. this.selected(this.track.enabled);
  60334. }
  60335. }
  60336. Component$1$1.registerComponent("AudioTrackMenuItem", AudioTrackMenuItem$1);
  60337. class AudioTrackButton$1 extends TrackButton$1 {
  60338. constructor(player, options2 = {}) {
  60339. options2.tracks = player.audioTracks();
  60340. super(player, options2);
  60341. }
  60342. buildCSSClass() {
  60343. return `vjs-audio-button ${super.buildCSSClass()}`;
  60344. }
  60345. buildWrapperCSSClass() {
  60346. return `vjs-audio-button ${super.buildWrapperCSSClass()}`;
  60347. }
  60348. createItems(items = []) {
  60349. this.hideThreshold_ = 1;
  60350. const tracks = this.player_.audioTracks();
  60351. for (let i2 = 0; i2 < tracks.length; i2++) {
  60352. const track = tracks[i2];
  60353. items.push(new AudioTrackMenuItem$1(this.player_, {
  60354. track,
  60355. selectable: true,
  60356. multiSelectable: false
  60357. }));
  60358. }
  60359. return items;
  60360. }
  60361. }
  60362. AudioTrackButton$1.prototype.controlText_ = "Audio Track";
  60363. Component$1$1.registerComponent("AudioTrackButton", AudioTrackButton$1);
  60364. class PlaybackRateMenuItem$1 extends MenuItem$1 {
  60365. constructor(player, options2) {
  60366. const label = options2.rate;
  60367. const rate = parseFloat(label, 10);
  60368. options2.label = label;
  60369. options2.selected = rate === player.playbackRate();
  60370. options2.selectable = true;
  60371. options2.multiSelectable = false;
  60372. super(player, options2);
  60373. this.label = label;
  60374. this.rate = rate;
  60375. this.on(player, "ratechange", (e) => this.update(e));
  60376. }
  60377. handleClick(event2) {
  60378. super.handleClick();
  60379. this.player().playbackRate(this.rate);
  60380. }
  60381. update(event2) {
  60382. this.selected(this.player().playbackRate() === this.rate);
  60383. }
  60384. }
  60385. PlaybackRateMenuItem$1.prototype.contentElType = "button";
  60386. Component$1$1.registerComponent("PlaybackRateMenuItem", PlaybackRateMenuItem$1);
  60387. class PlaybackRateMenuButton$1 extends MenuButton$1 {
  60388. constructor(player, options2) {
  60389. super(player, options2);
  60390. this.menuButton_.el_.setAttribute("aria-describedby", this.labelElId_);
  60391. this.updateVisibility();
  60392. this.updateLabel();
  60393. this.on(player, "loadstart", (e) => this.updateVisibility(e));
  60394. this.on(player, "ratechange", (e) => this.updateLabel(e));
  60395. this.on(player, "playbackrateschange", (e) => this.handlePlaybackRateschange(e));
  60396. }
  60397. createEl() {
  60398. const el = super.createEl();
  60399. this.labelElId_ = "vjs-playback-rate-value-label-" + this.id_;
  60400. this.labelEl_ = createEl$1("div", {
  60401. className: "vjs-playback-rate-value",
  60402. id: this.labelElId_,
  60403. textContent: "1x"
  60404. });
  60405. el.appendChild(this.labelEl_);
  60406. return el;
  60407. }
  60408. dispose() {
  60409. this.labelEl_ = null;
  60410. super.dispose();
  60411. }
  60412. buildCSSClass() {
  60413. return `vjs-playback-rate ${super.buildCSSClass()}`;
  60414. }
  60415. buildWrapperCSSClass() {
  60416. return `vjs-playback-rate ${super.buildWrapperCSSClass()}`;
  60417. }
  60418. createItems() {
  60419. const rates = this.playbackRates();
  60420. const items = [];
  60421. for (let i2 = rates.length - 1; i2 >= 0; i2--) {
  60422. items.push(new PlaybackRateMenuItem$1(this.player(), {
  60423. rate: rates[i2] + "x"
  60424. }));
  60425. }
  60426. return items;
  60427. }
  60428. handlePlaybackRateschange(event2) {
  60429. this.update();
  60430. }
  60431. playbackRates() {
  60432. const player = this.player();
  60433. return player.playbackRates && player.playbackRates() || [];
  60434. }
  60435. playbackRateSupported() {
  60436. return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && this.playbackRates().length > 0;
  60437. }
  60438. updateVisibility(event2) {
  60439. if (this.playbackRateSupported()) {
  60440. this.removeClass("vjs-hidden");
  60441. } else {
  60442. this.addClass("vjs-hidden");
  60443. }
  60444. }
  60445. updateLabel(event2) {
  60446. if (this.playbackRateSupported()) {
  60447. this.labelEl_.textContent = this.player().playbackRate() + "x";
  60448. }
  60449. }
  60450. }
  60451. PlaybackRateMenuButton$1.prototype.controlText_ = "Playback Rate";
  60452. Component$1$1.registerComponent("PlaybackRateMenuButton", PlaybackRateMenuButton$1);
  60453. class Spacer$1 extends Component$1$1 {
  60454. buildCSSClass() {
  60455. return `vjs-spacer ${super.buildCSSClass()}`;
  60456. }
  60457. createEl(tag = "div", props = {}, attributes = {}) {
  60458. if (!props.className) {
  60459. props.className = this.buildCSSClass();
  60460. }
  60461. return super.createEl(tag, props, attributes);
  60462. }
  60463. }
  60464. Component$1$1.registerComponent("Spacer", Spacer$1);
  60465. class CustomControlSpacer$1 extends Spacer$1 {
  60466. buildCSSClass() {
  60467. return `vjs-custom-control-spacer ${super.buildCSSClass()}`;
  60468. }
  60469. createEl() {
  60470. return super.createEl("div", {
  60471. className: this.buildCSSClass(),
  60472. textContent: "\xA0"
  60473. });
  60474. }
  60475. }
  60476. Component$1$1.registerComponent("CustomControlSpacer", CustomControlSpacer$1);
  60477. class ControlBar$1 extends Component$1$1 {
  60478. createEl() {
  60479. return super.createEl("div", {
  60480. className: "vjs-control-bar",
  60481. dir: "ltr"
  60482. });
  60483. }
  60484. }
  60485. ControlBar$1.prototype.options_ = {
  60486. children: ["playToggle", "skipBackward", "skipForward", "volumePanel", "currentTimeDisplay", "timeDivider", "durationDisplay", "progressControl", "liveDisplay", "seekToLive", "remainingTimeDisplay", "customControlSpacer", "playbackRateMenuButton", "chaptersButton", "descriptionsButton", "subsCapsButton", "audioTrackButton", "fullscreenToggle"]
  60487. };
  60488. if ("exitPictureInPicture" in document_1) {
  60489. ControlBar$1.prototype.options_.children.splice(ControlBar$1.prototype.options_.children.length - 1, 0, "pictureInPictureToggle");
  60490. }
  60491. Component$1$1.registerComponent("ControlBar", ControlBar$1);
  60492. class ErrorDisplay$1 extends ModalDialog$1 {
  60493. constructor(player, options2) {
  60494. super(player, options2);
  60495. this.on(player, "error", (e) => this.open(e));
  60496. }
  60497. buildCSSClass() {
  60498. return `vjs-error-display ${super.buildCSSClass()}`;
  60499. }
  60500. content() {
  60501. const error = this.player().error();
  60502. return error ? this.localize(error.message) : "";
  60503. }
  60504. }
  60505. ErrorDisplay$1.prototype.options_ = Object.assign({}, ModalDialog$1.prototype.options_, {
  60506. pauseOnOpen: false,
  60507. fillAlways: true,
  60508. temporary: false,
  60509. uncloseable: true
  60510. });
  60511. Component$1$1.registerComponent("ErrorDisplay", ErrorDisplay$1);
  60512. const LOCAL_STORAGE_KEY$1$1 = "vjs-text-track-settings";
  60513. const COLOR_BLACK$1 = ["#000", "Black"];
  60514. const COLOR_BLUE$1 = ["#00F", "Blue"];
  60515. const COLOR_CYAN$1 = ["#0FF", "Cyan"];
  60516. const COLOR_GREEN$1 = ["#0F0", "Green"];
  60517. const COLOR_MAGENTA$1 = ["#F0F", "Magenta"];
  60518. const COLOR_RED$1 = ["#F00", "Red"];
  60519. const COLOR_WHITE$1 = ["#FFF", "White"];
  60520. const COLOR_YELLOW$1 = ["#FF0", "Yellow"];
  60521. const OPACITY_OPAQUE$1 = ["1", "Opaque"];
  60522. const OPACITY_SEMI$1 = ["0.5", "Semi-Transparent"];
  60523. const OPACITY_TRANS$1 = ["0", "Transparent"];
  60524. const selectConfigs$1 = {
  60525. backgroundColor: {
  60526. selector: ".vjs-bg-color > select",
  60527. id: "captions-background-color-%s",
  60528. label: "Color",
  60529. options: [COLOR_BLACK$1, COLOR_WHITE$1, COLOR_RED$1, COLOR_GREEN$1, COLOR_BLUE$1, COLOR_YELLOW$1, COLOR_MAGENTA$1, COLOR_CYAN$1]
  60530. },
  60531. backgroundOpacity: {
  60532. selector: ".vjs-bg-opacity > select",
  60533. id: "captions-background-opacity-%s",
  60534. label: "Opacity",
  60535. options: [OPACITY_OPAQUE$1, OPACITY_SEMI$1, OPACITY_TRANS$1]
  60536. },
  60537. color: {
  60538. selector: ".vjs-text-color > select",
  60539. id: "captions-foreground-color-%s",
  60540. label: "Color",
  60541. options: [COLOR_WHITE$1, COLOR_BLACK$1, COLOR_RED$1, COLOR_GREEN$1, COLOR_BLUE$1, COLOR_YELLOW$1, COLOR_MAGENTA$1, COLOR_CYAN$1]
  60542. },
  60543. edgeStyle: {
  60544. selector: ".vjs-edge-style > select",
  60545. id: "%s",
  60546. label: "Text Edge Style",
  60547. options: [["none", "None"], ["raised", "Raised"], ["depressed", "Depressed"], ["uniform", "Uniform"], ["dropshadow", "Dropshadow"]]
  60548. },
  60549. fontFamily: {
  60550. selector: ".vjs-font-family > select",
  60551. id: "captions-font-family-%s",
  60552. label: "Font Family",
  60553. options: [["proportionalSansSerif", "Proportional Sans-Serif"], ["monospaceSansSerif", "Monospace Sans-Serif"], ["proportionalSerif", "Proportional Serif"], ["monospaceSerif", "Monospace Serif"], ["casual", "Casual"], ["script", "Script"], ["small-caps", "Small Caps"]]
  60554. },
  60555. fontPercent: {
  60556. selector: ".vjs-font-percent > select",
  60557. id: "captions-font-size-%s",
  60558. label: "Font Size",
  60559. options: [["0.50", "50%"], ["0.75", "75%"], ["1.00", "100%"], ["1.25", "125%"], ["1.50", "150%"], ["1.75", "175%"], ["2.00", "200%"], ["3.00", "300%"], ["4.00", "400%"]],
  60560. default: 2,
  60561. parser: (v) => v === "1.00" ? null : Number(v)
  60562. },
  60563. textOpacity: {
  60564. selector: ".vjs-text-opacity > select",
  60565. id: "captions-foreground-opacity-%s",
  60566. label: "Opacity",
  60567. options: [OPACITY_OPAQUE$1, OPACITY_SEMI$1]
  60568. },
  60569. windowColor: {
  60570. selector: ".vjs-window-color > select",
  60571. id: "captions-window-color-%s",
  60572. label: "Color"
  60573. },
  60574. windowOpacity: {
  60575. selector: ".vjs-window-opacity > select",
  60576. id: "captions-window-opacity-%s",
  60577. label: "Opacity",
  60578. options: [OPACITY_TRANS$1, OPACITY_SEMI$1, OPACITY_OPAQUE$1]
  60579. }
  60580. };
  60581. selectConfigs$1.windowColor.options = selectConfigs$1.backgroundColor.options;
  60582. function parseOptionValue$1(value, parser2) {
  60583. if (parser2) {
  60584. value = parser2(value);
  60585. }
  60586. if (value && value !== "none") {
  60587. return value;
  60588. }
  60589. }
  60590. function getSelectedOptionValue$1(el, parser2) {
  60591. const value = el.options[el.options.selectedIndex].value;
  60592. return parseOptionValue$1(value, parser2);
  60593. }
  60594. function setSelectedOption$1(el, value, parser2) {
  60595. if (!value) {
  60596. return;
  60597. }
  60598. for (let i2 = 0; i2 < el.options.length; i2++) {
  60599. if (parseOptionValue$1(el.options[i2].value, parser2) === value) {
  60600. el.selectedIndex = i2;
  60601. break;
  60602. }
  60603. }
  60604. }
  60605. class TextTrackSettings$1 extends ModalDialog$1 {
  60606. constructor(player, options2) {
  60607. options2.temporary = false;
  60608. super(player, options2);
  60609. this.updateDisplay = this.updateDisplay.bind(this);
  60610. this.fill();
  60611. this.hasBeenOpened_ = this.hasBeenFilled_ = true;
  60612. this.endDialog = createEl$1("p", {
  60613. className: "vjs-control-text",
  60614. textContent: this.localize("End of dialog window.")
  60615. });
  60616. this.el().appendChild(this.endDialog);
  60617. this.setDefaults();
  60618. if (options2.persistTextTrackSettings === void 0) {
  60619. this.options_.persistTextTrackSettings = this.options_.playerOptions.persistTextTrackSettings;
  60620. }
  60621. this.on(this.$(".vjs-done-button"), "click", () => {
  60622. this.saveSettings();
  60623. this.close();
  60624. });
  60625. this.on(this.$(".vjs-default-button"), "click", () => {
  60626. this.setDefaults();
  60627. this.updateDisplay();
  60628. });
  60629. each$1(selectConfigs$1, (config) => {
  60630. this.on(this.$(config.selector), "change", this.updateDisplay);
  60631. });
  60632. if (this.options_.persistTextTrackSettings) {
  60633. this.restoreSettings();
  60634. }
  60635. }
  60636. dispose() {
  60637. this.endDialog = null;
  60638. super.dispose();
  60639. }
  60640. createElSelect_(key, legendId = "", type2 = "label") {
  60641. const config = selectConfigs$1[key];
  60642. const id = config.id.replace("%s", this.id_);
  60643. const selectLabelledbyIds = [legendId, id].join(" ").trim();
  60644. return [`<${type2} id="${id}" class="${type2 === "label" ? "vjs-label" : ""}">`, this.localize(config.label), `</${type2}>`, `<select aria-labelledby="${selectLabelledbyIds}">`].concat(config.options.map((o) => {
  60645. const optionId = id + "-" + o[1].replace(/\W+/g, "");
  60646. return [`<option id="${optionId}" value="${o[0]}" `, `aria-labelledby="${selectLabelledbyIds} ${optionId}">`, this.localize(o[1]), "</option>"].join("");
  60647. })).concat("</select>").join("");
  60648. }
  60649. createElFgColor_() {
  60650. const legendId = `captions-text-legend-${this.id_}`;
  60651. return ['<fieldset class="vjs-fg vjs-track-setting">', `<legend id="${legendId}">`, this.localize("Text"), "</legend>", '<span class="vjs-text-color">', this.createElSelect_("color", legendId), "</span>", '<span class="vjs-text-opacity vjs-opacity">', this.createElSelect_("textOpacity", legendId), "</span>", "</fieldset>"].join("");
  60652. }
  60653. createElBgColor_() {
  60654. const legendId = `captions-background-${this.id_}`;
  60655. return ['<fieldset class="vjs-bg vjs-track-setting">', `<legend id="${legendId}">`, this.localize("Text Background"), "</legend>", '<span class="vjs-bg-color">', this.createElSelect_("backgroundColor", legendId), "</span>", '<span class="vjs-bg-opacity vjs-opacity">', this.createElSelect_("backgroundOpacity", legendId), "</span>", "</fieldset>"].join("");
  60656. }
  60657. createElWinColor_() {
  60658. const legendId = `captions-window-${this.id_}`;
  60659. return ['<fieldset class="vjs-window vjs-track-setting">', `<legend id="${legendId}">`, this.localize("Caption Area Background"), "</legend>", '<span class="vjs-window-color">', this.createElSelect_("windowColor", legendId), "</span>", '<span class="vjs-window-opacity vjs-opacity">', this.createElSelect_("windowOpacity", legendId), "</span>", "</fieldset>"].join("");
  60660. }
  60661. createElColors_() {
  60662. return createEl$1("div", {
  60663. className: "vjs-track-settings-colors",
  60664. innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join("")
  60665. });
  60666. }
  60667. createElFont_() {
  60668. return createEl$1("div", {
  60669. className: "vjs-track-settings-font",
  60670. innerHTML: ['<fieldset class="vjs-font-percent vjs-track-setting">', this.createElSelect_("fontPercent", "", "legend"), "</fieldset>", '<fieldset class="vjs-edge-style vjs-track-setting">', this.createElSelect_("edgeStyle", "", "legend"), "</fieldset>", '<fieldset class="vjs-font-family vjs-track-setting">', this.createElSelect_("fontFamily", "", "legend"), "</fieldset>"].join("")
  60671. });
  60672. }
  60673. createElControls_() {
  60674. const defaultsDescription = this.localize("restore all settings to the default values");
  60675. return createEl$1("div", {
  60676. className: "vjs-track-settings-controls",
  60677. innerHTML: [`<button type="button" class="vjs-default-button" title="${defaultsDescription}">`, this.localize("Reset"), `<span class="vjs-control-text"> ${defaultsDescription}</span>`, "</button>", `<button type="button" class="vjs-done-button">${this.localize("Done")}</button>`].join("")
  60678. });
  60679. }
  60680. content() {
  60681. return [this.createElColors_(), this.createElFont_(), this.createElControls_()];
  60682. }
  60683. label() {
  60684. return this.localize("Caption Settings Dialog");
  60685. }
  60686. description() {
  60687. return this.localize("Beginning of dialog window. Escape will cancel and close the window.");
  60688. }
  60689. buildCSSClass() {
  60690. return super.buildCSSClass() + " vjs-text-track-settings";
  60691. }
  60692. getValues() {
  60693. return reduce$1(selectConfigs$1, (accum, config, key) => {
  60694. const value = getSelectedOptionValue$1(this.$(config.selector), config.parser);
  60695. if (value !== void 0) {
  60696. accum[key] = value;
  60697. }
  60698. return accum;
  60699. }, {});
  60700. }
  60701. setValues(values3) {
  60702. each$1(selectConfigs$1, (config, key) => {
  60703. setSelectedOption$1(this.$(config.selector), values3[key], config.parser);
  60704. });
  60705. }
  60706. setDefaults() {
  60707. each$1(selectConfigs$1, (config) => {
  60708. const index2 = config.hasOwnProperty("default") ? config.default : 0;
  60709. this.$(config.selector).selectedIndex = index2;
  60710. });
  60711. }
  60712. restoreSettings() {
  60713. let values3;
  60714. try {
  60715. values3 = JSON.parse(window_1.localStorage.getItem(LOCAL_STORAGE_KEY$1$1));
  60716. } catch (err) {
  60717. log$1$1.warn(err);
  60718. }
  60719. if (values3) {
  60720. this.setValues(values3);
  60721. }
  60722. }
  60723. saveSettings() {
  60724. if (!this.options_.persistTextTrackSettings) {
  60725. return;
  60726. }
  60727. const values3 = this.getValues();
  60728. try {
  60729. if (Object.keys(values3).length) {
  60730. window_1.localStorage.setItem(LOCAL_STORAGE_KEY$1$1, JSON.stringify(values3));
  60731. } else {
  60732. window_1.localStorage.removeItem(LOCAL_STORAGE_KEY$1$1);
  60733. }
  60734. } catch (err) {
  60735. log$1$1.warn(err);
  60736. }
  60737. }
  60738. updateDisplay() {
  60739. const ttDisplay = this.player_.getChild("textTrackDisplay");
  60740. if (ttDisplay) {
  60741. ttDisplay.updateDisplay();
  60742. }
  60743. }
  60744. conditionalBlur_() {
  60745. this.previouslyActiveEl_ = null;
  60746. const cb = this.player_.controlBar;
  60747. const subsCapsBtn = cb && cb.subsCapsButton;
  60748. const ccBtn = cb && cb.captionsButton;
  60749. if (subsCapsBtn) {
  60750. subsCapsBtn.focus();
  60751. } else if (ccBtn) {
  60752. ccBtn.focus();
  60753. }
  60754. }
  60755. handleLanguagechange() {
  60756. this.fill();
  60757. }
  60758. }
  60759. Component$1$1.registerComponent("TextTrackSettings", TextTrackSettings$1);
  60760. class ResizeManager$1 extends Component$1$1 {
  60761. constructor(player, options2) {
  60762. let RESIZE_OBSERVER_AVAILABLE = options2.ResizeObserver || window_1.ResizeObserver;
  60763. if (options2.ResizeObserver === null) {
  60764. RESIZE_OBSERVER_AVAILABLE = false;
  60765. }
  60766. const options_ = merge$1({
  60767. createEl: !RESIZE_OBSERVER_AVAILABLE,
  60768. reportTouchActivity: false
  60769. }, options2);
  60770. super(player, options_);
  60771. this.ResizeObserver = options2.ResizeObserver || window_1.ResizeObserver;
  60772. this.loadListener_ = null;
  60773. this.resizeObserver_ = null;
  60774. this.debouncedHandler_ = debounce$1(() => {
  60775. this.resizeHandler();
  60776. }, 100, false, this);
  60777. if (RESIZE_OBSERVER_AVAILABLE) {
  60778. this.resizeObserver_ = new this.ResizeObserver(this.debouncedHandler_);
  60779. this.resizeObserver_.observe(player.el());
  60780. } else {
  60781. this.loadListener_ = () => {
  60782. if (!this.el_ || !this.el_.contentWindow) {
  60783. return;
  60784. }
  60785. const debouncedHandler_ = this.debouncedHandler_;
  60786. let unloadListener_ = this.unloadListener_ = function() {
  60787. off$1(this, "resize", debouncedHandler_);
  60788. off$1(this, "unload", unloadListener_);
  60789. unloadListener_ = null;
  60790. };
  60791. on$1(this.el_.contentWindow, "unload", unloadListener_);
  60792. on$1(this.el_.contentWindow, "resize", debouncedHandler_);
  60793. };
  60794. this.one("load", this.loadListener_);
  60795. }
  60796. }
  60797. createEl() {
  60798. return super.createEl("iframe", {
  60799. className: "vjs-resize-manager",
  60800. tabIndex: -1,
  60801. title: this.localize("No content")
  60802. }, {
  60803. "aria-hidden": "true"
  60804. });
  60805. }
  60806. resizeHandler() {
  60807. if (!this.player_ || !this.player_.trigger) {
  60808. return;
  60809. }
  60810. this.player_.trigger("playerresize");
  60811. }
  60812. dispose() {
  60813. if (this.debouncedHandler_) {
  60814. this.debouncedHandler_.cancel();
  60815. }
  60816. if (this.resizeObserver_) {
  60817. if (this.player_.el()) {
  60818. this.resizeObserver_.unobserve(this.player_.el());
  60819. }
  60820. this.resizeObserver_.disconnect();
  60821. }
  60822. if (this.loadListener_) {
  60823. this.off("load", this.loadListener_);
  60824. }
  60825. if (this.el_ && this.el_.contentWindow && this.unloadListener_) {
  60826. this.unloadListener_.call(this.el_.contentWindow);
  60827. }
  60828. this.ResizeObserver = null;
  60829. this.resizeObserver = null;
  60830. this.debouncedHandler_ = null;
  60831. this.loadListener_ = null;
  60832. super.dispose();
  60833. }
  60834. }
  60835. Component$1$1.registerComponent("ResizeManager", ResizeManager$1);
  60836. const defaults$2 = {
  60837. trackingThreshold: 20,
  60838. liveTolerance: 15
  60839. };
  60840. class LiveTracker$1 extends Component$1$1 {
  60841. constructor(player, options2) {
  60842. const options_ = merge$1(defaults$2, options2, {
  60843. createEl: false
  60844. });
  60845. super(player, options_);
  60846. this.trackLiveHandler_ = () => this.trackLive_();
  60847. this.handlePlay_ = (e) => this.handlePlay(e);
  60848. this.handleFirstTimeupdate_ = (e) => this.handleFirstTimeupdate(e);
  60849. this.handleSeeked_ = (e) => this.handleSeeked(e);
  60850. this.seekToLiveEdge_ = (e) => this.seekToLiveEdge(e);
  60851. this.reset_();
  60852. this.on(this.player_, "durationchange", (e) => this.handleDurationchange(e));
  60853. this.on(this.player_, "canplay", () => this.toggleTracking());
  60854. }
  60855. trackLive_() {
  60856. const seekable3 = this.player_.seekable();
  60857. if (!seekable3 || !seekable3.length) {
  60858. return;
  60859. }
  60860. const newTime = Number(window_1.performance.now().toFixed(4));
  60861. const deltaTime = this.lastTime_ === -1 ? 0 : (newTime - this.lastTime_) / 1e3;
  60862. this.lastTime_ = newTime;
  60863. this.pastSeekEnd_ = this.pastSeekEnd() + deltaTime;
  60864. const liveCurrentTime = this.liveCurrentTime();
  60865. const currentTime = this.player_.currentTime();
  60866. let isBehind = this.player_.paused() || this.seekedBehindLive_ || Math.abs(liveCurrentTime - currentTime) > this.options_.liveTolerance;
  60867. if (!this.timeupdateSeen_ || liveCurrentTime === Infinity) {
  60868. isBehind = false;
  60869. }
  60870. if (isBehind !== this.behindLiveEdge_) {
  60871. this.behindLiveEdge_ = isBehind;
  60872. this.trigger("liveedgechange");
  60873. }
  60874. }
  60875. handleDurationchange() {
  60876. this.toggleTracking();
  60877. }
  60878. toggleTracking() {
  60879. if (this.player_.duration() === Infinity && this.liveWindow() >= this.options_.trackingThreshold) {
  60880. if (this.player_.options_.liveui) {
  60881. this.player_.addClass("vjs-liveui");
  60882. }
  60883. this.startTracking();
  60884. } else {
  60885. this.player_.removeClass("vjs-liveui");
  60886. this.stopTracking();
  60887. }
  60888. }
  60889. startTracking() {
  60890. if (this.isTracking()) {
  60891. return;
  60892. }
  60893. if (!this.timeupdateSeen_) {
  60894. this.timeupdateSeen_ = this.player_.hasStarted();
  60895. }
  60896. this.trackingInterval_ = this.setInterval(this.trackLiveHandler_, UPDATE_REFRESH_INTERVAL$1);
  60897. this.trackLive_();
  60898. this.on(this.player_, ["play", "pause"], this.trackLiveHandler_);
  60899. if (!this.timeupdateSeen_) {
  60900. this.one(this.player_, "play", this.handlePlay_);
  60901. this.one(this.player_, "timeupdate", this.handleFirstTimeupdate_);
  60902. } else {
  60903. this.on(this.player_, "seeked", this.handleSeeked_);
  60904. }
  60905. }
  60906. handleFirstTimeupdate() {
  60907. this.timeupdateSeen_ = true;
  60908. this.on(this.player_, "seeked", this.handleSeeked_);
  60909. }
  60910. handleSeeked() {
  60911. const timeDiff = Math.abs(this.liveCurrentTime() - this.player_.currentTime());
  60912. this.seekedBehindLive_ = this.nextSeekedFromUser_ && timeDiff > 2;
  60913. this.nextSeekedFromUser_ = false;
  60914. this.trackLive_();
  60915. }
  60916. handlePlay() {
  60917. this.one(this.player_, "timeupdate", this.seekToLiveEdge_);
  60918. }
  60919. reset_() {
  60920. this.lastTime_ = -1;
  60921. this.pastSeekEnd_ = 0;
  60922. this.lastSeekEnd_ = -1;
  60923. this.behindLiveEdge_ = true;
  60924. this.timeupdateSeen_ = false;
  60925. this.seekedBehindLive_ = false;
  60926. this.nextSeekedFromUser_ = false;
  60927. this.clearInterval(this.trackingInterval_);
  60928. this.trackingInterval_ = null;
  60929. this.off(this.player_, ["play", "pause"], this.trackLiveHandler_);
  60930. this.off(this.player_, "seeked", this.handleSeeked_);
  60931. this.off(this.player_, "play", this.handlePlay_);
  60932. this.off(this.player_, "timeupdate", this.handleFirstTimeupdate_);
  60933. this.off(this.player_, "timeupdate", this.seekToLiveEdge_);
  60934. }
  60935. nextSeekedFromUser() {
  60936. this.nextSeekedFromUser_ = true;
  60937. }
  60938. stopTracking() {
  60939. if (!this.isTracking()) {
  60940. return;
  60941. }
  60942. this.reset_();
  60943. this.trigger("liveedgechange");
  60944. }
  60945. seekableEnd() {
  60946. const seekable3 = this.player_.seekable();
  60947. const seekableEnds = [];
  60948. let i2 = seekable3 ? seekable3.length : 0;
  60949. while (i2--) {
  60950. seekableEnds.push(seekable3.end(i2));
  60951. }
  60952. return seekableEnds.length ? seekableEnds.sort()[seekableEnds.length - 1] : Infinity;
  60953. }
  60954. seekableStart() {
  60955. const seekable3 = this.player_.seekable();
  60956. const seekableStarts = [];
  60957. let i2 = seekable3 ? seekable3.length : 0;
  60958. while (i2--) {
  60959. seekableStarts.push(seekable3.start(i2));
  60960. }
  60961. return seekableStarts.length ? seekableStarts.sort()[0] : 0;
  60962. }
  60963. liveWindow() {
  60964. const liveCurrentTime = this.liveCurrentTime();
  60965. if (liveCurrentTime === Infinity) {
  60966. return 0;
  60967. }
  60968. return liveCurrentTime - this.seekableStart();
  60969. }
  60970. isLive() {
  60971. return this.isTracking();
  60972. }
  60973. atLiveEdge() {
  60974. return !this.behindLiveEdge();
  60975. }
  60976. liveCurrentTime() {
  60977. return this.pastSeekEnd() + this.seekableEnd();
  60978. }
  60979. pastSeekEnd() {
  60980. const seekableEnd = this.seekableEnd();
  60981. if (this.lastSeekEnd_ !== -1 && seekableEnd !== this.lastSeekEnd_) {
  60982. this.pastSeekEnd_ = 0;
  60983. }
  60984. this.lastSeekEnd_ = seekableEnd;
  60985. return this.pastSeekEnd_;
  60986. }
  60987. behindLiveEdge() {
  60988. return this.behindLiveEdge_;
  60989. }
  60990. isTracking() {
  60991. return typeof this.trackingInterval_ === "number";
  60992. }
  60993. seekToLiveEdge() {
  60994. this.seekedBehindLive_ = false;
  60995. if (this.atLiveEdge()) {
  60996. return;
  60997. }
  60998. this.nextSeekedFromUser_ = false;
  60999. this.player_.currentTime(this.liveCurrentTime());
  61000. }
  61001. dispose() {
  61002. this.stopTracking();
  61003. super.dispose();
  61004. }
  61005. }
  61006. Component$1$1.registerComponent("LiveTracker", LiveTracker$1);
  61007. class TitleBar extends Component$1$1 {
  61008. constructor(player, options2) {
  61009. super(player, options2);
  61010. this.on("statechanged", (e) => this.updateDom_());
  61011. this.updateDom_();
  61012. }
  61013. createEl() {
  61014. this.els = {
  61015. title: createEl$1("div", {
  61016. className: "vjs-title-bar-title",
  61017. id: `vjs-title-bar-title-${newGUID$1()}`
  61018. }),
  61019. description: createEl$1("div", {
  61020. className: "vjs-title-bar-description",
  61021. id: `vjs-title-bar-description-${newGUID$1()}`
  61022. })
  61023. };
  61024. return createEl$1("div", {
  61025. className: "vjs-title-bar"
  61026. }, {}, Object.values(this.els));
  61027. }
  61028. updateDom_() {
  61029. const tech = this.player_.tech_;
  61030. const techEl = tech && tech.el_;
  61031. const techAriaAttrs = {
  61032. title: "aria-labelledby",
  61033. description: "aria-describedby"
  61034. };
  61035. ["title", "description"].forEach((k) => {
  61036. const value = this.state[k];
  61037. const el = this.els[k];
  61038. const techAriaAttr = techAriaAttrs[k];
  61039. emptyEl$1(el);
  61040. if (value) {
  61041. textContent$1(el, value);
  61042. }
  61043. if (techEl) {
  61044. techEl.removeAttribute(techAriaAttr);
  61045. if (value) {
  61046. techEl.setAttribute(techAriaAttr, el.id);
  61047. }
  61048. }
  61049. });
  61050. if (this.state.title || this.state.description) {
  61051. this.show();
  61052. } else {
  61053. this.hide();
  61054. }
  61055. }
  61056. update(options2) {
  61057. this.setState(options2);
  61058. }
  61059. dispose() {
  61060. const tech = this.player_.tech_;
  61061. const techEl = tech && tech.el_;
  61062. if (techEl) {
  61063. techEl.removeAttribute("aria-labelledby");
  61064. techEl.removeAttribute("aria-describedby");
  61065. }
  61066. super.dispose();
  61067. this.els = null;
  61068. }
  61069. }
  61070. Component$1$1.registerComponent("TitleBar", TitleBar);
  61071. const sourcesetLoad$1 = (tech) => {
  61072. const el = tech.el();
  61073. if (el.hasAttribute("src")) {
  61074. tech.triggerSourceset(el.src);
  61075. return true;
  61076. }
  61077. const sources = tech.$$("source");
  61078. const srcUrls = [];
  61079. let src = "";
  61080. if (!sources.length) {
  61081. return false;
  61082. }
  61083. for (let i2 = 0; i2 < sources.length; i2++) {
  61084. const url = sources[i2].src;
  61085. if (url && srcUrls.indexOf(url) === -1) {
  61086. srcUrls.push(url);
  61087. }
  61088. }
  61089. if (!srcUrls.length) {
  61090. return false;
  61091. }
  61092. if (srcUrls.length === 1) {
  61093. src = srcUrls[0];
  61094. }
  61095. tech.triggerSourceset(src);
  61096. return true;
  61097. };
  61098. const innerHTMLDescriptorPolyfill$1 = Object.defineProperty({}, "innerHTML", {
  61099. get() {
  61100. return this.cloneNode(true).innerHTML;
  61101. },
  61102. set(v) {
  61103. const dummy = document_1.createElement(this.nodeName.toLowerCase());
  61104. dummy.innerHTML = v;
  61105. const docFrag = document_1.createDocumentFragment();
  61106. while (dummy.childNodes.length) {
  61107. docFrag.appendChild(dummy.childNodes[0]);
  61108. }
  61109. this.innerText = "";
  61110. window_1.Element.prototype.appendChild.call(this, docFrag);
  61111. return this.innerHTML;
  61112. }
  61113. });
  61114. const getDescriptor$1 = (priority, prop) => {
  61115. let descriptor = {};
  61116. for (let i2 = 0; i2 < priority.length; i2++) {
  61117. descriptor = Object.getOwnPropertyDescriptor(priority[i2], prop);
  61118. if (descriptor && descriptor.set && descriptor.get) {
  61119. break;
  61120. }
  61121. }
  61122. descriptor.enumerable = true;
  61123. descriptor.configurable = true;
  61124. return descriptor;
  61125. };
  61126. const getInnerHTMLDescriptor$1 = (tech) => getDescriptor$1([tech.el(), window_1.HTMLMediaElement.prototype, window_1.Element.prototype, innerHTMLDescriptorPolyfill$1], "innerHTML");
  61127. const firstSourceWatch$1 = function(tech) {
  61128. const el = tech.el();
  61129. if (el.resetSourceWatch_) {
  61130. return;
  61131. }
  61132. const old = {};
  61133. const innerDescriptor = getInnerHTMLDescriptor$1(tech);
  61134. const appendWrapper = (appendFn) => (...args) => {
  61135. const retval = appendFn.apply(el, args);
  61136. sourcesetLoad$1(tech);
  61137. return retval;
  61138. };
  61139. ["append", "appendChild", "insertAdjacentHTML"].forEach((k) => {
  61140. if (!el[k]) {
  61141. return;
  61142. }
  61143. old[k] = el[k];
  61144. el[k] = appendWrapper(old[k]);
  61145. });
  61146. Object.defineProperty(el, "innerHTML", merge$1(innerDescriptor, {
  61147. set: appendWrapper(innerDescriptor.set)
  61148. }));
  61149. el.resetSourceWatch_ = () => {
  61150. el.resetSourceWatch_ = null;
  61151. Object.keys(old).forEach((k) => {
  61152. el[k] = old[k];
  61153. });
  61154. Object.defineProperty(el, "innerHTML", innerDescriptor);
  61155. };
  61156. tech.one("sourceset", el.resetSourceWatch_);
  61157. };
  61158. const srcDescriptorPolyfill$1 = Object.defineProperty({}, "src", {
  61159. get() {
  61160. if (this.hasAttribute("src")) {
  61161. return getAbsoluteURL$1(window_1.Element.prototype.getAttribute.call(this, "src"));
  61162. }
  61163. return "";
  61164. },
  61165. set(v) {
  61166. window_1.Element.prototype.setAttribute.call(this, "src", v);
  61167. return v;
  61168. }
  61169. });
  61170. const getSrcDescriptor$1 = (tech) => getDescriptor$1([tech.el(), window_1.HTMLMediaElement.prototype, srcDescriptorPolyfill$1], "src");
  61171. const setupSourceset$1 = function(tech) {
  61172. if (!tech.featuresSourceset) {
  61173. return;
  61174. }
  61175. const el = tech.el();
  61176. if (el.resetSourceset_) {
  61177. return;
  61178. }
  61179. const srcDescriptor = getSrcDescriptor$1(tech);
  61180. const oldSetAttribute = el.setAttribute;
  61181. const oldLoad = el.load;
  61182. Object.defineProperty(el, "src", merge$1(srcDescriptor, {
  61183. set: (v) => {
  61184. const retval = srcDescriptor.set.call(el, v);
  61185. tech.triggerSourceset(el.src);
  61186. return retval;
  61187. }
  61188. }));
  61189. el.setAttribute = (n, v) => {
  61190. const retval = oldSetAttribute.call(el, n, v);
  61191. if (/src/i.test(n)) {
  61192. tech.triggerSourceset(el.src);
  61193. }
  61194. return retval;
  61195. };
  61196. el.load = () => {
  61197. const retval = oldLoad.call(el);
  61198. if (!sourcesetLoad$1(tech)) {
  61199. tech.triggerSourceset("");
  61200. firstSourceWatch$1(tech);
  61201. }
  61202. return retval;
  61203. };
  61204. if (el.currentSrc) {
  61205. tech.triggerSourceset(el.currentSrc);
  61206. } else if (!sourcesetLoad$1(tech)) {
  61207. firstSourceWatch$1(tech);
  61208. }
  61209. el.resetSourceset_ = () => {
  61210. el.resetSourceset_ = null;
  61211. el.load = oldLoad;
  61212. el.setAttribute = oldSetAttribute;
  61213. Object.defineProperty(el, "src", srcDescriptor);
  61214. if (el.resetSourceWatch_) {
  61215. el.resetSourceWatch_();
  61216. }
  61217. };
  61218. };
  61219. class Html5$2 extends Tech$2 {
  61220. constructor(options2, ready) {
  61221. super(options2, ready);
  61222. const source = options2.source;
  61223. let crossoriginTracks = false;
  61224. this.featuresVideoFrameCallback = this.featuresVideoFrameCallback && this.el_.tagName === "VIDEO";
  61225. if (source && (this.el_.currentSrc !== source.src || options2.tag && options2.tag.initNetworkState_ === 3)) {
  61226. this.setSource(source);
  61227. } else {
  61228. this.handleLateInit_(this.el_);
  61229. }
  61230. if (options2.enableSourceset) {
  61231. this.setupSourcesetHandling_();
  61232. }
  61233. this.isScrubbing_ = false;
  61234. if (this.el_.hasChildNodes()) {
  61235. const nodes = this.el_.childNodes;
  61236. let nodesLength = nodes.length;
  61237. const removeNodes = [];
  61238. while (nodesLength--) {
  61239. const node = nodes[nodesLength];
  61240. const nodeName = node.nodeName.toLowerCase();
  61241. if (nodeName === "track") {
  61242. if (!this.featuresNativeTextTracks) {
  61243. removeNodes.push(node);
  61244. } else {
  61245. this.remoteTextTrackEls().addTrackElement_(node);
  61246. this.remoteTextTracks().addTrack(node.track);
  61247. this.textTracks().addTrack(node.track);
  61248. if (!crossoriginTracks && !this.el_.hasAttribute("crossorigin") && isCrossOrigin$1(node.src)) {
  61249. crossoriginTracks = true;
  61250. }
  61251. }
  61252. }
  61253. }
  61254. for (let i2 = 0; i2 < removeNodes.length; i2++) {
  61255. this.el_.removeChild(removeNodes[i2]);
  61256. }
  61257. }
  61258. this.proxyNativeTracks_();
  61259. if (this.featuresNativeTextTracks && crossoriginTracks) {
  61260. log$1$1.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading.");
  61261. }
  61262. this.restoreMetadataTracksInIOSNativePlayer_();
  61263. if ((TOUCH_ENABLED$1 || IS_IPHONE$1) && options2.nativeControlsForTouch === true) {
  61264. this.setControls(true);
  61265. }
  61266. this.proxyWebkitFullscreen_();
  61267. this.triggerReady();
  61268. }
  61269. dispose() {
  61270. if (this.el_ && this.el_.resetSourceset_) {
  61271. this.el_.resetSourceset_();
  61272. }
  61273. Html5$2.disposeMediaElement(this.el_);
  61274. this.options_ = null;
  61275. super.dispose();
  61276. }
  61277. setupSourcesetHandling_() {
  61278. setupSourceset$1(this);
  61279. }
  61280. restoreMetadataTracksInIOSNativePlayer_() {
  61281. const textTracks = this.textTracks();
  61282. let metadataTracksPreFullscreenState;
  61283. const takeMetadataTrackSnapshot = () => {
  61284. metadataTracksPreFullscreenState = [];
  61285. for (let i2 = 0; i2 < textTracks.length; i2++) {
  61286. const track = textTracks[i2];
  61287. if (track.kind === "metadata") {
  61288. metadataTracksPreFullscreenState.push({
  61289. track,
  61290. storedMode: track.mode
  61291. });
  61292. }
  61293. }
  61294. };
  61295. takeMetadataTrackSnapshot();
  61296. textTracks.addEventListener("change", takeMetadataTrackSnapshot);
  61297. this.on("dispose", () => textTracks.removeEventListener("change", takeMetadataTrackSnapshot));
  61298. const restoreTrackMode = () => {
  61299. for (let i2 = 0; i2 < metadataTracksPreFullscreenState.length; i2++) {
  61300. const storedTrack = metadataTracksPreFullscreenState[i2];
  61301. if (storedTrack.track.mode === "disabled" && storedTrack.track.mode !== storedTrack.storedMode) {
  61302. storedTrack.track.mode = storedTrack.storedMode;
  61303. }
  61304. }
  61305. textTracks.removeEventListener("change", restoreTrackMode);
  61306. };
  61307. this.on("webkitbeginfullscreen", () => {
  61308. textTracks.removeEventListener("change", takeMetadataTrackSnapshot);
  61309. textTracks.removeEventListener("change", restoreTrackMode);
  61310. textTracks.addEventListener("change", restoreTrackMode);
  61311. });
  61312. this.on("webkitendfullscreen", () => {
  61313. textTracks.removeEventListener("change", takeMetadataTrackSnapshot);
  61314. textTracks.addEventListener("change", takeMetadataTrackSnapshot);
  61315. textTracks.removeEventListener("change", restoreTrackMode);
  61316. });
  61317. }
  61318. overrideNative_(type2, override) {
  61319. if (override !== this[`featuresNative${type2}Tracks`]) {
  61320. return;
  61321. }
  61322. const lowerCaseType = type2.toLowerCase();
  61323. if (this[`${lowerCaseType}TracksListeners_`]) {
  61324. Object.keys(this[`${lowerCaseType}TracksListeners_`]).forEach((eventName) => {
  61325. const elTracks = this.el()[`${lowerCaseType}Tracks`];
  61326. elTracks.removeEventListener(eventName, this[`${lowerCaseType}TracksListeners_`][eventName]);
  61327. });
  61328. }
  61329. this[`featuresNative${type2}Tracks`] = !override;
  61330. this[`${lowerCaseType}TracksListeners_`] = null;
  61331. this.proxyNativeTracksForType_(lowerCaseType);
  61332. }
  61333. overrideNativeAudioTracks(override) {
  61334. this.overrideNative_("Audio", override);
  61335. }
  61336. overrideNativeVideoTracks(override) {
  61337. this.overrideNative_("Video", override);
  61338. }
  61339. proxyNativeTracksForType_(name) {
  61340. const props = NORMAL$1[name];
  61341. const elTracks = this.el()[props.getterName];
  61342. const techTracks = this[props.getterName]();
  61343. if (!this[`featuresNative${props.capitalName}Tracks`] || !elTracks || !elTracks.addEventListener) {
  61344. return;
  61345. }
  61346. const listeners = {
  61347. change: (e) => {
  61348. const event2 = {
  61349. type: "change",
  61350. target: techTracks,
  61351. currentTarget: techTracks,
  61352. srcElement: techTracks
  61353. };
  61354. techTracks.trigger(event2);
  61355. if (name === "text") {
  61356. this[REMOTE$1.remoteText.getterName]().trigger(event2);
  61357. }
  61358. },
  61359. addtrack(e) {
  61360. techTracks.addTrack(e.track);
  61361. },
  61362. removetrack(e) {
  61363. techTracks.removeTrack(e.track);
  61364. }
  61365. };
  61366. const removeOldTracks = function() {
  61367. const removeTracks = [];
  61368. for (let i2 = 0; i2 < techTracks.length; i2++) {
  61369. let found = false;
  61370. for (let j = 0; j < elTracks.length; j++) {
  61371. if (elTracks[j] === techTracks[i2]) {
  61372. found = true;
  61373. break;
  61374. }
  61375. }
  61376. if (!found) {
  61377. removeTracks.push(techTracks[i2]);
  61378. }
  61379. }
  61380. while (removeTracks.length) {
  61381. techTracks.removeTrack(removeTracks.shift());
  61382. }
  61383. };
  61384. this[props.getterName + "Listeners_"] = listeners;
  61385. Object.keys(listeners).forEach((eventName) => {
  61386. const listener = listeners[eventName];
  61387. elTracks.addEventListener(eventName, listener);
  61388. this.on("dispose", (e) => elTracks.removeEventListener(eventName, listener));
  61389. });
  61390. this.on("loadstart", removeOldTracks);
  61391. this.on("dispose", (e) => this.off("loadstart", removeOldTracks));
  61392. }
  61393. proxyNativeTracks_() {
  61394. NORMAL$1.names.forEach((name) => {
  61395. this.proxyNativeTracksForType_(name);
  61396. });
  61397. }
  61398. createEl() {
  61399. let el = this.options_.tag;
  61400. if (!el || !(this.options_.playerElIngest || this.movingMediaElementInDOM)) {
  61401. if (el) {
  61402. const clone = el.cloneNode(true);
  61403. if (el.parentNode) {
  61404. el.parentNode.insertBefore(clone, el);
  61405. }
  61406. Html5$2.disposeMediaElement(el);
  61407. el = clone;
  61408. } else {
  61409. el = document_1.createElement("video");
  61410. const tagAttributes = this.options_.tag && getAttributes$1(this.options_.tag);
  61411. const attributes = merge$1({}, tagAttributes);
  61412. if (!TOUCH_ENABLED$1 || this.options_.nativeControlsForTouch !== true) {
  61413. delete attributes.controls;
  61414. }
  61415. setAttributes$1(el, Object.assign(attributes, {
  61416. id: this.options_.techId,
  61417. class: "vjs-tech"
  61418. }));
  61419. }
  61420. el.playerId = this.options_.playerId;
  61421. }
  61422. if (typeof this.options_.preload !== "undefined") {
  61423. setAttribute$1(el, "preload", this.options_.preload);
  61424. }
  61425. if (this.options_.disablePictureInPicture !== void 0) {
  61426. el.disablePictureInPicture = this.options_.disablePictureInPicture;
  61427. }
  61428. const settingsAttrs = ["loop", "muted", "playsinline", "autoplay"];
  61429. for (let i2 = 0; i2 < settingsAttrs.length; i2++) {
  61430. const attr = settingsAttrs[i2];
  61431. const value = this.options_[attr];
  61432. if (typeof value !== "undefined") {
  61433. if (value) {
  61434. setAttribute$1(el, attr, attr);
  61435. } else {
  61436. removeAttribute$1(el, attr);
  61437. }
  61438. el[attr] = value;
  61439. }
  61440. }
  61441. return el;
  61442. }
  61443. handleLateInit_(el) {
  61444. if (el.networkState === 0 || el.networkState === 3) {
  61445. return;
  61446. }
  61447. if (el.readyState === 0) {
  61448. let loadstartFired = false;
  61449. const setLoadstartFired = function() {
  61450. loadstartFired = true;
  61451. };
  61452. this.on("loadstart", setLoadstartFired);
  61453. const triggerLoadstart = function() {
  61454. if (!loadstartFired) {
  61455. this.trigger("loadstart");
  61456. }
  61457. };
  61458. this.on("loadedmetadata", triggerLoadstart);
  61459. this.ready(function() {
  61460. this.off("loadstart", setLoadstartFired);
  61461. this.off("loadedmetadata", triggerLoadstart);
  61462. if (!loadstartFired) {
  61463. this.trigger("loadstart");
  61464. }
  61465. });
  61466. return;
  61467. }
  61468. const eventsToTrigger = ["loadstart"];
  61469. eventsToTrigger.push("loadedmetadata");
  61470. if (el.readyState >= 2) {
  61471. eventsToTrigger.push("loadeddata");
  61472. }
  61473. if (el.readyState >= 3) {
  61474. eventsToTrigger.push("canplay");
  61475. }
  61476. if (el.readyState >= 4) {
  61477. eventsToTrigger.push("canplaythrough");
  61478. }
  61479. this.ready(function() {
  61480. eventsToTrigger.forEach(function(type2) {
  61481. this.trigger(type2);
  61482. }, this);
  61483. });
  61484. }
  61485. setScrubbing(isScrubbing) {
  61486. this.isScrubbing_ = isScrubbing;
  61487. }
  61488. scrubbing() {
  61489. return this.isScrubbing_;
  61490. }
  61491. setCurrentTime(seconds) {
  61492. try {
  61493. if (this.isScrubbing_ && this.el_.fastSeek && IS_ANY_SAFARI$1) {
  61494. this.el_.fastSeek(seconds);
  61495. } else {
  61496. this.el_.currentTime = seconds;
  61497. }
  61498. } catch (e) {
  61499. log$1$1(e, "Video is not ready. (Video.js)");
  61500. }
  61501. }
  61502. duration() {
  61503. if (this.el_.duration === Infinity && IS_ANDROID$1 && IS_CHROME$1 && this.el_.currentTime === 0) {
  61504. const checkProgress = () => {
  61505. if (this.el_.currentTime > 0) {
  61506. if (this.el_.duration === Infinity) {
  61507. this.trigger("durationchange");
  61508. }
  61509. this.off("timeupdate", checkProgress);
  61510. }
  61511. };
  61512. this.on("timeupdate", checkProgress);
  61513. return NaN;
  61514. }
  61515. return this.el_.duration || NaN;
  61516. }
  61517. width() {
  61518. return this.el_.offsetWidth;
  61519. }
  61520. height() {
  61521. return this.el_.offsetHeight;
  61522. }
  61523. proxyWebkitFullscreen_() {
  61524. if (!("webkitDisplayingFullscreen" in this.el_)) {
  61525. return;
  61526. }
  61527. const endFn = function() {
  61528. this.trigger("fullscreenchange", {
  61529. isFullscreen: false
  61530. });
  61531. if (this.el_.controls && !this.options_.nativeControlsForTouch && this.controls()) {
  61532. this.el_.controls = false;
  61533. }
  61534. };
  61535. const beginFn = function() {
  61536. if ("webkitPresentationMode" in this.el_ && this.el_.webkitPresentationMode !== "picture-in-picture") {
  61537. this.one("webkitendfullscreen", endFn);
  61538. this.trigger("fullscreenchange", {
  61539. isFullscreen: true,
  61540. nativeIOSFullscreen: true
  61541. });
  61542. }
  61543. };
  61544. this.on("webkitbeginfullscreen", beginFn);
  61545. this.on("dispose", () => {
  61546. this.off("webkitbeginfullscreen", beginFn);
  61547. this.off("webkitendfullscreen", endFn);
  61548. });
  61549. }
  61550. supportsFullScreen() {
  61551. return typeof this.el_.webkitEnterFullScreen === "function";
  61552. }
  61553. enterFullScreen() {
  61554. const video = this.el_;
  61555. if (video.paused && video.networkState <= video.HAVE_METADATA) {
  61556. silencePromise$1(this.el_.play());
  61557. this.setTimeout(function() {
  61558. video.pause();
  61559. try {
  61560. video.webkitEnterFullScreen();
  61561. } catch (e) {
  61562. this.trigger("fullscreenerror", e);
  61563. }
  61564. }, 0);
  61565. } else {
  61566. try {
  61567. video.webkitEnterFullScreen();
  61568. } catch (e) {
  61569. this.trigger("fullscreenerror", e);
  61570. }
  61571. }
  61572. }
  61573. exitFullScreen() {
  61574. if (!this.el_.webkitDisplayingFullscreen) {
  61575. this.trigger("fullscreenerror", new Error("The video is not fullscreen"));
  61576. return;
  61577. }
  61578. this.el_.webkitExitFullScreen();
  61579. }
  61580. requestPictureInPicture() {
  61581. return this.el_.requestPictureInPicture();
  61582. }
  61583. requestVideoFrameCallback(cb) {
  61584. if (this.featuresVideoFrameCallback && !this.el_.webkitKeys) {
  61585. return this.el_.requestVideoFrameCallback(cb);
  61586. }
  61587. return super.requestVideoFrameCallback(cb);
  61588. }
  61589. cancelVideoFrameCallback(id) {
  61590. if (this.featuresVideoFrameCallback && !this.el_.webkitKeys) {
  61591. this.el_.cancelVideoFrameCallback(id);
  61592. } else {
  61593. super.cancelVideoFrameCallback(id);
  61594. }
  61595. }
  61596. src(src) {
  61597. if (src === void 0) {
  61598. return this.el_.src;
  61599. }
  61600. this.setSrc(src);
  61601. }
  61602. reset() {
  61603. Html5$2.resetMediaElement(this.el_);
  61604. }
  61605. currentSrc() {
  61606. if (this.currentSource_) {
  61607. return this.currentSource_.src;
  61608. }
  61609. return this.el_.currentSrc;
  61610. }
  61611. setControls(val) {
  61612. this.el_.controls = !!val;
  61613. }
  61614. addTextTrack(kind, label, language) {
  61615. if (!this.featuresNativeTextTracks) {
  61616. return super.addTextTrack(kind, label, language);
  61617. }
  61618. return this.el_.addTextTrack(kind, label, language);
  61619. }
  61620. createRemoteTextTrack(options2) {
  61621. if (!this.featuresNativeTextTracks) {
  61622. return super.createRemoteTextTrack(options2);
  61623. }
  61624. const htmlTrackElement = document_1.createElement("track");
  61625. if (options2.kind) {
  61626. htmlTrackElement.kind = options2.kind;
  61627. }
  61628. if (options2.label) {
  61629. htmlTrackElement.label = options2.label;
  61630. }
  61631. if (options2.language || options2.srclang) {
  61632. htmlTrackElement.srclang = options2.language || options2.srclang;
  61633. }
  61634. if (options2.default) {
  61635. htmlTrackElement.default = options2.default;
  61636. }
  61637. if (options2.id) {
  61638. htmlTrackElement.id = options2.id;
  61639. }
  61640. if (options2.src) {
  61641. htmlTrackElement.src = options2.src;
  61642. }
  61643. return htmlTrackElement;
  61644. }
  61645. addRemoteTextTrack(options2, manualCleanup) {
  61646. const htmlTrackElement = super.addRemoteTextTrack(options2, manualCleanup);
  61647. if (this.featuresNativeTextTracks) {
  61648. this.el().appendChild(htmlTrackElement);
  61649. }
  61650. return htmlTrackElement;
  61651. }
  61652. removeRemoteTextTrack(track) {
  61653. super.removeRemoteTextTrack(track);
  61654. if (this.featuresNativeTextTracks) {
  61655. const tracks = this.$$("track");
  61656. let i2 = tracks.length;
  61657. while (i2--) {
  61658. if (track === tracks[i2] || track === tracks[i2].track) {
  61659. this.el().removeChild(tracks[i2]);
  61660. }
  61661. }
  61662. }
  61663. }
  61664. getVideoPlaybackQuality() {
  61665. if (typeof this.el().getVideoPlaybackQuality === "function") {
  61666. return this.el().getVideoPlaybackQuality();
  61667. }
  61668. const videoPlaybackQuality = {};
  61669. if (typeof this.el().webkitDroppedFrameCount !== "undefined" && typeof this.el().webkitDecodedFrameCount !== "undefined") {
  61670. videoPlaybackQuality.droppedVideoFrames = this.el().webkitDroppedFrameCount;
  61671. videoPlaybackQuality.totalVideoFrames = this.el().webkitDecodedFrameCount;
  61672. }
  61673. if (window_1.performance) {
  61674. videoPlaybackQuality.creationTime = window_1.performance.now();
  61675. }
  61676. return videoPlaybackQuality;
  61677. }
  61678. }
  61679. defineLazyProperty$1(Html5$2, "TEST_VID", function() {
  61680. if (!isReal$1()) {
  61681. return;
  61682. }
  61683. const video = document_1.createElement("video");
  61684. const track = document_1.createElement("track");
  61685. track.kind = "captions";
  61686. track.srclang = "en";
  61687. track.label = "English";
  61688. video.appendChild(track);
  61689. return video;
  61690. });
  61691. Html5$2.isSupported = function() {
  61692. try {
  61693. Html5$2.TEST_VID.volume = 0.5;
  61694. } catch (e) {
  61695. return false;
  61696. }
  61697. return !!(Html5$2.TEST_VID && Html5$2.TEST_VID.canPlayType);
  61698. };
  61699. Html5$2.canPlayType = function(type2) {
  61700. return Html5$2.TEST_VID.canPlayType(type2);
  61701. };
  61702. Html5$2.canPlaySource = function(srcObj, options2) {
  61703. return Html5$2.canPlayType(srcObj.type);
  61704. };
  61705. Html5$2.canControlVolume = function() {
  61706. try {
  61707. const volume = Html5$2.TEST_VID.volume;
  61708. Html5$2.TEST_VID.volume = volume / 2 + 0.1;
  61709. const canControl = volume !== Html5$2.TEST_VID.volume;
  61710. if (canControl && IS_IOS$1) {
  61711. window_1.setTimeout(() => {
  61712. if (Html5$2 && Html5$2.prototype) {
  61713. Html5$2.prototype.featuresVolumeControl = volume !== Html5$2.TEST_VID.volume;
  61714. }
  61715. });
  61716. return false;
  61717. }
  61718. return canControl;
  61719. } catch (e) {
  61720. return false;
  61721. }
  61722. };
  61723. Html5$2.canMuteVolume = function() {
  61724. try {
  61725. const muted = Html5$2.TEST_VID.muted;
  61726. Html5$2.TEST_VID.muted = !muted;
  61727. if (Html5$2.TEST_VID.muted) {
  61728. setAttribute$1(Html5$2.TEST_VID, "muted", "muted");
  61729. } else {
  61730. removeAttribute$1(Html5$2.TEST_VID, "muted", "muted");
  61731. }
  61732. return muted !== Html5$2.TEST_VID.muted;
  61733. } catch (e) {
  61734. return false;
  61735. }
  61736. };
  61737. Html5$2.canControlPlaybackRate = function() {
  61738. if (IS_ANDROID$1 && IS_CHROME$1 && CHROME_VERSION$1 < 58) {
  61739. return false;
  61740. }
  61741. try {
  61742. const playbackRate = Html5$2.TEST_VID.playbackRate;
  61743. Html5$2.TEST_VID.playbackRate = playbackRate / 2 + 0.1;
  61744. return playbackRate !== Html5$2.TEST_VID.playbackRate;
  61745. } catch (e) {
  61746. return false;
  61747. }
  61748. };
  61749. Html5$2.canOverrideAttributes = function() {
  61750. try {
  61751. const noop2 = () => {
  61752. };
  61753. Object.defineProperty(document_1.createElement("video"), "src", {
  61754. get: noop2,
  61755. set: noop2
  61756. });
  61757. Object.defineProperty(document_1.createElement("audio"), "src", {
  61758. get: noop2,
  61759. set: noop2
  61760. });
  61761. Object.defineProperty(document_1.createElement("video"), "innerHTML", {
  61762. get: noop2,
  61763. set: noop2
  61764. });
  61765. Object.defineProperty(document_1.createElement("audio"), "innerHTML", {
  61766. get: noop2,
  61767. set: noop2
  61768. });
  61769. } catch (e) {
  61770. return false;
  61771. }
  61772. return true;
  61773. };
  61774. Html5$2.supportsNativeTextTracks = function() {
  61775. return IS_ANY_SAFARI$1 || IS_IOS$1 && IS_CHROME$1;
  61776. };
  61777. Html5$2.supportsNativeVideoTracks = function() {
  61778. return !!(Html5$2.TEST_VID && Html5$2.TEST_VID.videoTracks);
  61779. };
  61780. Html5$2.supportsNativeAudioTracks = function() {
  61781. return !!(Html5$2.TEST_VID && Html5$2.TEST_VID.audioTracks);
  61782. };
  61783. Html5$2.Events = ["loadstart", "suspend", "abort", "error", "emptied", "stalled", "loadedmetadata", "loadeddata", "canplay", "canplaythrough", "playing", "waiting", "seeking", "seeked", "ended", "durationchange", "timeupdate", "progress", "play", "pause", "ratechange", "resize", "volumechange"];
  61784. [["featuresMuteControl", "canMuteVolume"], ["featuresPlaybackRate", "canControlPlaybackRate"], ["featuresSourceset", "canOverrideAttributes"], ["featuresNativeTextTracks", "supportsNativeTextTracks"], ["featuresNativeVideoTracks", "supportsNativeVideoTracks"], ["featuresNativeAudioTracks", "supportsNativeAudioTracks"]].forEach(function([key, fn2]) {
  61785. defineLazyProperty$1(Html5$2.prototype, key, () => Html5$2[fn2](), true);
  61786. });
  61787. Html5$2.prototype.featuresVolumeControl = Html5$2.canControlVolume();
  61788. Html5$2.prototype.movingMediaElementInDOM = !IS_IOS$1;
  61789. Html5$2.prototype.featuresFullscreenResize = true;
  61790. Html5$2.prototype.featuresProgressEvents = true;
  61791. Html5$2.prototype.featuresTimeupdateEvents = true;
  61792. Html5$2.prototype.featuresVideoFrameCallback = !!(Html5$2.TEST_VID && Html5$2.TEST_VID.requestVideoFrameCallback);
  61793. Html5$2.disposeMediaElement = function(el) {
  61794. if (!el) {
  61795. return;
  61796. }
  61797. if (el.parentNode) {
  61798. el.parentNode.removeChild(el);
  61799. }
  61800. while (el.hasChildNodes()) {
  61801. el.removeChild(el.firstChild);
  61802. }
  61803. el.removeAttribute("src");
  61804. if (typeof el.load === "function") {
  61805. (function() {
  61806. try {
  61807. el.load();
  61808. } catch (e) {
  61809. }
  61810. })();
  61811. }
  61812. };
  61813. Html5$2.resetMediaElement = function(el) {
  61814. if (!el) {
  61815. return;
  61816. }
  61817. const sources = el.querySelectorAll("source");
  61818. let i2 = sources.length;
  61819. while (i2--) {
  61820. el.removeChild(sources[i2]);
  61821. }
  61822. el.removeAttribute("src");
  61823. if (typeof el.load === "function") {
  61824. (function() {
  61825. try {
  61826. el.load();
  61827. } catch (e) {
  61828. }
  61829. })();
  61830. }
  61831. };
  61832. [
  61833. "muted",
  61834. "defaultMuted",
  61835. "autoplay",
  61836. "controls",
  61837. "loop",
  61838. "playsinline"
  61839. ].forEach(function(prop) {
  61840. Html5$2.prototype[prop] = function() {
  61841. return this.el_[prop] || this.el_.hasAttribute(prop);
  61842. };
  61843. });
  61844. [
  61845. "muted",
  61846. "defaultMuted",
  61847. "autoplay",
  61848. "loop",
  61849. "playsinline"
  61850. ].forEach(function(prop) {
  61851. Html5$2.prototype["set" + toTitleCase$1$1(prop)] = function(v) {
  61852. this.el_[prop] = v;
  61853. if (v) {
  61854. this.el_.setAttribute(prop, prop);
  61855. } else {
  61856. this.el_.removeAttribute(prop);
  61857. }
  61858. };
  61859. });
  61860. [
  61861. "paused",
  61862. "currentTime",
  61863. "buffered",
  61864. "volume",
  61865. "poster",
  61866. "preload",
  61867. "error",
  61868. "seeking",
  61869. "seekable",
  61870. "ended",
  61871. "playbackRate",
  61872. "defaultPlaybackRate",
  61873. "disablePictureInPicture",
  61874. "played",
  61875. "networkState",
  61876. "readyState",
  61877. "videoWidth",
  61878. "videoHeight",
  61879. "crossOrigin"
  61880. ].forEach(function(prop) {
  61881. Html5$2.prototype[prop] = function() {
  61882. return this.el_[prop];
  61883. };
  61884. });
  61885. [
  61886. "volume",
  61887. "src",
  61888. "poster",
  61889. "preload",
  61890. "playbackRate",
  61891. "defaultPlaybackRate",
  61892. "disablePictureInPicture",
  61893. "crossOrigin"
  61894. ].forEach(function(prop) {
  61895. Html5$2.prototype["set" + toTitleCase$1$1(prop)] = function(v) {
  61896. this.el_[prop] = v;
  61897. };
  61898. });
  61899. [
  61900. "pause",
  61901. "load",
  61902. "play"
  61903. ].forEach(function(prop) {
  61904. Html5$2.prototype[prop] = function() {
  61905. return this.el_[prop]();
  61906. };
  61907. });
  61908. Tech$2.withSourceHandlers(Html5$2);
  61909. Html5$2.nativeSourceHandler = {};
  61910. Html5$2.nativeSourceHandler.canPlayType = function(type2) {
  61911. try {
  61912. return Html5$2.TEST_VID.canPlayType(type2);
  61913. } catch (e) {
  61914. return "";
  61915. }
  61916. };
  61917. Html5$2.nativeSourceHandler.canHandleSource = function(source, options2) {
  61918. if (source.type) {
  61919. return Html5$2.nativeSourceHandler.canPlayType(source.type);
  61920. } else if (source.src) {
  61921. const ext = getFileExtension$1(source.src);
  61922. return Html5$2.nativeSourceHandler.canPlayType(`video/${ext}`);
  61923. }
  61924. return "";
  61925. };
  61926. Html5$2.nativeSourceHandler.handleSource = function(source, tech, options2) {
  61927. tech.setSrc(source.src);
  61928. };
  61929. Html5$2.nativeSourceHandler.dispose = function() {
  61930. };
  61931. Html5$2.registerSourceHandler(Html5$2.nativeSourceHandler);
  61932. Tech$2.registerTech("Html5", Html5$2);
  61933. const TECH_EVENTS_RETRIGGER$1 = [
  61934. "progress",
  61935. "abort",
  61936. "suspend",
  61937. "emptied",
  61938. "stalled",
  61939. "loadedmetadata",
  61940. "loadeddata",
  61941. "timeupdate",
  61942. "resize",
  61943. "volumechange",
  61944. "texttrackchange"
  61945. ];
  61946. const TECH_EVENTS_QUEUE$1 = {
  61947. canplay: "CanPlay",
  61948. canplaythrough: "CanPlayThrough",
  61949. playing: "Playing",
  61950. seeked: "Seeked"
  61951. };
  61952. const BREAKPOINT_ORDER$1 = ["tiny", "xsmall", "small", "medium", "large", "xlarge", "huge"];
  61953. const BREAKPOINT_CLASSES$1 = {};
  61954. BREAKPOINT_ORDER$1.forEach((k) => {
  61955. const v = k.charAt(0) === "x" ? `x-${k.substring(1)}` : k;
  61956. BREAKPOINT_CLASSES$1[k] = `vjs-layout-${v}`;
  61957. });
  61958. const DEFAULT_BREAKPOINTS$1 = {
  61959. tiny: 210,
  61960. xsmall: 320,
  61961. small: 425,
  61962. medium: 768,
  61963. large: 1440,
  61964. xlarge: 2560,
  61965. huge: Infinity
  61966. };
  61967. class Player$1 extends Component$1$1 {
  61968. constructor(tag, options2, ready) {
  61969. tag.id = tag.id || options2.id || `vjs_video_${newGUID$1()}`;
  61970. options2 = Object.assign(Player$1.getTagSettings(tag), options2);
  61971. options2.initChildren = false;
  61972. options2.createEl = false;
  61973. options2.evented = false;
  61974. options2.reportTouchActivity = false;
  61975. if (!options2.language) {
  61976. const closest = tag.closest("[lang]");
  61977. if (closest) {
  61978. options2.language = closest.getAttribute("lang");
  61979. }
  61980. }
  61981. super(null, options2, ready);
  61982. this.boundDocumentFullscreenChange_ = (e) => this.documentFullscreenChange_(e);
  61983. this.boundFullWindowOnEscKey_ = (e) => this.fullWindowOnEscKey(e);
  61984. this.boundUpdateStyleEl_ = (e) => this.updateStyleEl_(e);
  61985. this.boundApplyInitTime_ = (e) => this.applyInitTime_(e);
  61986. this.boundUpdateCurrentBreakpoint_ = (e) => this.updateCurrentBreakpoint_(e);
  61987. this.boundHandleTechClick_ = (e) => this.handleTechClick_(e);
  61988. this.boundHandleTechDoubleClick_ = (e) => this.handleTechDoubleClick_(e);
  61989. this.boundHandleTechTouchStart_ = (e) => this.handleTechTouchStart_(e);
  61990. this.boundHandleTechTouchMove_ = (e) => this.handleTechTouchMove_(e);
  61991. this.boundHandleTechTouchEnd_ = (e) => this.handleTechTouchEnd_(e);
  61992. this.boundHandleTechTap_ = (e) => this.handleTechTap_(e);
  61993. this.isFullscreen_ = false;
  61994. this.log = createLogger$2(this.id_);
  61995. this.fsApi_ = FullscreenApi$1;
  61996. this.isPosterFromTech_ = false;
  61997. this.queuedCallbacks_ = [];
  61998. this.isReady_ = false;
  61999. this.hasStarted_ = false;
  62000. this.userActive_ = false;
  62001. this.debugEnabled_ = false;
  62002. this.audioOnlyMode_ = false;
  62003. this.audioPosterMode_ = false;
  62004. this.audioOnlyCache_ = {
  62005. playerHeight: null,
  62006. hiddenChildren: []
  62007. };
  62008. if (!this.options_ || !this.options_.techOrder || !this.options_.techOrder.length) {
  62009. throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");
  62010. }
  62011. this.tag = tag;
  62012. this.tagAttributes = tag && getAttributes$1(tag);
  62013. this.language(this.options_.language);
  62014. if (options2.languages) {
  62015. const languagesToLower = {};
  62016. Object.getOwnPropertyNames(options2.languages).forEach(function(name) {
  62017. languagesToLower[name.toLowerCase()] = options2.languages[name];
  62018. });
  62019. this.languages_ = languagesToLower;
  62020. } else {
  62021. this.languages_ = Player$1.prototype.options_.languages;
  62022. }
  62023. this.resetCache_();
  62024. this.poster_ = options2.poster || "";
  62025. this.controls_ = !!options2.controls;
  62026. tag.controls = false;
  62027. tag.removeAttribute("controls");
  62028. this.changingSrc_ = false;
  62029. this.playCallbacks_ = [];
  62030. this.playTerminatedQueue_ = [];
  62031. if (tag.hasAttribute("autoplay")) {
  62032. this.autoplay(true);
  62033. } else {
  62034. this.autoplay(this.options_.autoplay);
  62035. }
  62036. if (options2.plugins) {
  62037. Object.keys(options2.plugins).forEach((name) => {
  62038. if (typeof this[name] !== "function") {
  62039. throw new Error(`plugin "${name}" does not exist`);
  62040. }
  62041. });
  62042. }
  62043. this.scrubbing_ = false;
  62044. this.el_ = this.createEl();
  62045. evented$1(this, {
  62046. eventBusKey: "el_"
  62047. });
  62048. if (this.fsApi_.requestFullscreen) {
  62049. on$1(document_1, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);
  62050. this.on(this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);
  62051. }
  62052. if (this.fluid_) {
  62053. this.on(["playerreset", "resize"], this.boundUpdateStyleEl_);
  62054. }
  62055. const playerOptionsCopy = merge$1(this.options_);
  62056. if (options2.plugins) {
  62057. Object.keys(options2.plugins).forEach((name) => {
  62058. this[name](options2.plugins[name]);
  62059. });
  62060. }
  62061. if (options2.debug) {
  62062. this.debug(true);
  62063. }
  62064. this.options_.playerOptions = playerOptionsCopy;
  62065. this.middleware_ = [];
  62066. this.playbackRates(options2.playbackRates);
  62067. this.initChildren();
  62068. this.isAudio(tag.nodeName.toLowerCase() === "audio");
  62069. if (this.controls()) {
  62070. this.addClass("vjs-controls-enabled");
  62071. } else {
  62072. this.addClass("vjs-controls-disabled");
  62073. }
  62074. this.el_.setAttribute("role", "region");
  62075. if (this.isAudio()) {
  62076. this.el_.setAttribute("aria-label", this.localize("Audio Player"));
  62077. } else {
  62078. this.el_.setAttribute("aria-label", this.localize("Video Player"));
  62079. }
  62080. if (this.isAudio()) {
  62081. this.addClass("vjs-audio");
  62082. }
  62083. if (TOUCH_ENABLED$1) {
  62084. this.addClass("vjs-touch-enabled");
  62085. }
  62086. if (!IS_IOS$1) {
  62087. this.addClass("vjs-workinghover");
  62088. }
  62089. Player$1.players[this.id_] = this;
  62090. const majorVersion = version$6$1.split(".")[0];
  62091. this.addClass(`vjs-v${majorVersion}`);
  62092. this.userActive(true);
  62093. this.reportUserActivity();
  62094. this.one("play", (e) => this.listenForUserActivity_(e));
  62095. this.on("keydown", (e) => this.handleKeyDown(e));
  62096. this.on("languagechange", (e) => this.handleLanguagechange(e));
  62097. this.breakpoints(this.options_.breakpoints);
  62098. this.responsive(this.options_.responsive);
  62099. this.on("ready", () => {
  62100. this.audioPosterMode(this.options_.audioPosterMode);
  62101. this.audioOnlyMode(this.options_.audioOnlyMode);
  62102. });
  62103. }
  62104. dispose() {
  62105. this.trigger("dispose");
  62106. this.off("dispose");
  62107. off$1(document_1, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);
  62108. off$1(document_1, "keydown", this.boundFullWindowOnEscKey_);
  62109. if (this.styleEl_ && this.styleEl_.parentNode) {
  62110. this.styleEl_.parentNode.removeChild(this.styleEl_);
  62111. this.styleEl_ = null;
  62112. }
  62113. Player$1.players[this.id_] = null;
  62114. if (this.tag && this.tag.player) {
  62115. this.tag.player = null;
  62116. }
  62117. if (this.el_ && this.el_.player) {
  62118. this.el_.player = null;
  62119. }
  62120. if (this.tech_) {
  62121. this.tech_.dispose();
  62122. this.isPosterFromTech_ = false;
  62123. this.poster_ = "";
  62124. }
  62125. if (this.playerElIngest_) {
  62126. this.playerElIngest_ = null;
  62127. }
  62128. if (this.tag) {
  62129. this.tag = null;
  62130. }
  62131. clearCacheForPlayer$1(this);
  62132. ALL$1.names.forEach((name) => {
  62133. const props = ALL$1[name];
  62134. const list = this[props.getterName]();
  62135. if (list && list.off) {
  62136. list.off();
  62137. }
  62138. });
  62139. super.dispose({
  62140. restoreEl: this.options_.restoreEl
  62141. });
  62142. }
  62143. createEl() {
  62144. let tag = this.tag;
  62145. let el;
  62146. let playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute("data-vjs-player");
  62147. const divEmbed = this.tag.tagName.toLowerCase() === "video-js";
  62148. if (playerElIngest) {
  62149. el = this.el_ = tag.parentNode;
  62150. } else if (!divEmbed) {
  62151. el = this.el_ = super.createEl("div");
  62152. }
  62153. const attrs = getAttributes$1(tag);
  62154. if (divEmbed) {
  62155. el = this.el_ = tag;
  62156. tag = this.tag = document_1.createElement("video");
  62157. while (el.children.length) {
  62158. tag.appendChild(el.firstChild);
  62159. }
  62160. if (!hasClass$1(el, "video-js")) {
  62161. addClass$1(el, "video-js");
  62162. }
  62163. el.appendChild(tag);
  62164. playerElIngest = this.playerElIngest_ = el;
  62165. Object.keys(el).forEach((k) => {
  62166. try {
  62167. tag[k] = el[k];
  62168. } catch (e) {
  62169. }
  62170. });
  62171. }
  62172. tag.setAttribute("tabindex", "-1");
  62173. attrs.tabindex = "-1";
  62174. if (IS_CHROME$1 && IS_WINDOWS$1) {
  62175. tag.setAttribute("role", "application");
  62176. attrs.role = "application";
  62177. }
  62178. tag.removeAttribute("width");
  62179. tag.removeAttribute("height");
  62180. if ("width" in attrs) {
  62181. delete attrs.width;
  62182. }
  62183. if ("height" in attrs) {
  62184. delete attrs.height;
  62185. }
  62186. Object.getOwnPropertyNames(attrs).forEach(function(attr) {
  62187. if (!(divEmbed && attr === "class")) {
  62188. el.setAttribute(attr, attrs[attr]);
  62189. }
  62190. if (divEmbed) {
  62191. tag.setAttribute(attr, attrs[attr]);
  62192. }
  62193. });
  62194. tag.playerId = tag.id;
  62195. tag.id += "_html5_api";
  62196. tag.className = "vjs-tech";
  62197. tag.player = el.player = this;
  62198. this.addClass("vjs-paused");
  62199. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE !== true) {
  62200. this.styleEl_ = createStyleElement$1("vjs-styles-dimensions");
  62201. const defaultsStyleEl = $$1(".vjs-styles-defaults");
  62202. const head = $$1("head");
  62203. head.insertBefore(this.styleEl_, defaultsStyleEl ? defaultsStyleEl.nextSibling : head.firstChild);
  62204. }
  62205. this.fill_ = false;
  62206. this.fluid_ = false;
  62207. this.width(this.options_.width);
  62208. this.height(this.options_.height);
  62209. this.fill(this.options_.fill);
  62210. this.fluid(this.options_.fluid);
  62211. this.aspectRatio(this.options_.aspectRatio);
  62212. this.crossOrigin(this.options_.crossOrigin || this.options_.crossorigin);
  62213. const links = tag.getElementsByTagName("a");
  62214. for (let i2 = 0; i2 < links.length; i2++) {
  62215. const linkEl = links.item(i2);
  62216. addClass$1(linkEl, "vjs-hidden");
  62217. linkEl.setAttribute("hidden", "hidden");
  62218. }
  62219. tag.initNetworkState_ = tag.networkState;
  62220. if (tag.parentNode && !playerElIngest) {
  62221. tag.parentNode.insertBefore(el, tag);
  62222. }
  62223. prependTo$1(tag, el);
  62224. this.children_.unshift(tag);
  62225. this.el_.setAttribute("lang", this.language_);
  62226. this.el_.setAttribute("translate", "no");
  62227. this.el_ = el;
  62228. return el;
  62229. }
  62230. crossOrigin(value) {
  62231. if (typeof value === "undefined") {
  62232. return this.techGet_("crossOrigin");
  62233. }
  62234. if (value !== null && value !== "anonymous" && value !== "use-credentials") {
  62235. log$1$1.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${value}"`);
  62236. return;
  62237. }
  62238. this.techCall_("setCrossOrigin", value);
  62239. if (this.posterImage) {
  62240. this.posterImage.crossOrigin(value);
  62241. }
  62242. return;
  62243. }
  62244. width(value) {
  62245. return this.dimension("width", value);
  62246. }
  62247. height(value) {
  62248. return this.dimension("height", value);
  62249. }
  62250. dimension(dimension, value) {
  62251. const privDimension = dimension + "_";
  62252. if (value === void 0) {
  62253. return this[privDimension] || 0;
  62254. }
  62255. if (value === "" || value === "auto") {
  62256. this[privDimension] = void 0;
  62257. this.updateStyleEl_();
  62258. return;
  62259. }
  62260. const parsedVal = parseFloat(value);
  62261. if (isNaN(parsedVal)) {
  62262. log$1$1.error(`Improper value "${value}" supplied for for ${dimension}`);
  62263. return;
  62264. }
  62265. this[privDimension] = parsedVal;
  62266. this.updateStyleEl_();
  62267. }
  62268. fluid(bool) {
  62269. if (bool === void 0) {
  62270. return !!this.fluid_;
  62271. }
  62272. this.fluid_ = !!bool;
  62273. if (isEvented$1(this)) {
  62274. this.off(["playerreset", "resize"], this.boundUpdateStyleEl_);
  62275. }
  62276. if (bool) {
  62277. this.addClass("vjs-fluid");
  62278. this.fill(false);
  62279. addEventedCallback$1(this, () => {
  62280. this.on(["playerreset", "resize"], this.boundUpdateStyleEl_);
  62281. });
  62282. } else {
  62283. this.removeClass("vjs-fluid");
  62284. }
  62285. this.updateStyleEl_();
  62286. }
  62287. fill(bool) {
  62288. if (bool === void 0) {
  62289. return !!this.fill_;
  62290. }
  62291. this.fill_ = !!bool;
  62292. if (bool) {
  62293. this.addClass("vjs-fill");
  62294. this.fluid(false);
  62295. } else {
  62296. this.removeClass("vjs-fill");
  62297. }
  62298. }
  62299. aspectRatio(ratio) {
  62300. if (ratio === void 0) {
  62301. return this.aspectRatio_;
  62302. }
  62303. if (!/^\d+\:\d+$/.test(ratio)) {
  62304. throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");
  62305. }
  62306. this.aspectRatio_ = ratio;
  62307. this.fluid(true);
  62308. this.updateStyleEl_();
  62309. }
  62310. updateStyleEl_() {
  62311. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE === true) {
  62312. const width3 = typeof this.width_ === "number" ? this.width_ : this.options_.width;
  62313. const height3 = typeof this.height_ === "number" ? this.height_ : this.options_.height;
  62314. const techEl = this.tech_ && this.tech_.el();
  62315. if (techEl) {
  62316. if (width3 >= 0) {
  62317. techEl.width = width3;
  62318. }
  62319. if (height3 >= 0) {
  62320. techEl.height = height3;
  62321. }
  62322. }
  62323. return;
  62324. }
  62325. let width2;
  62326. let height2;
  62327. let aspectRatio;
  62328. let idClass;
  62329. if (this.aspectRatio_ !== void 0 && this.aspectRatio_ !== "auto") {
  62330. aspectRatio = this.aspectRatio_;
  62331. } else if (this.videoWidth() > 0) {
  62332. aspectRatio = this.videoWidth() + ":" + this.videoHeight();
  62333. } else {
  62334. aspectRatio = "16:9";
  62335. }
  62336. const ratioParts = aspectRatio.split(":");
  62337. const ratioMultiplier = ratioParts[1] / ratioParts[0];
  62338. if (this.width_ !== void 0) {
  62339. width2 = this.width_;
  62340. } else if (this.height_ !== void 0) {
  62341. width2 = this.height_ / ratioMultiplier;
  62342. } else {
  62343. width2 = this.videoWidth() || 300;
  62344. }
  62345. if (this.height_ !== void 0) {
  62346. height2 = this.height_;
  62347. } else {
  62348. height2 = width2 * ratioMultiplier;
  62349. }
  62350. if (/^[^a-zA-Z]/.test(this.id())) {
  62351. idClass = "dimensions-" + this.id();
  62352. } else {
  62353. idClass = this.id() + "-dimensions";
  62354. }
  62355. this.addClass(idClass);
  62356. setTextContent$1(this.styleEl_, `
  62357. .${idClass} {
  62358. width: ${width2}px;
  62359. height: ${height2}px;
  62360. }
  62361. .${idClass}.vjs-fluid:not(.vjs-audio-only-mode) {
  62362. padding-top: ${ratioMultiplier * 100}%;
  62363. }
  62364. `);
  62365. }
  62366. loadTech_(techName, source) {
  62367. if (this.tech_) {
  62368. this.unloadTech_();
  62369. }
  62370. const titleTechName = toTitleCase$1$1(techName);
  62371. const camelTechName = techName.charAt(0).toLowerCase() + techName.slice(1);
  62372. if (titleTechName !== "Html5" && this.tag) {
  62373. Tech$2.getTech("Html5").disposeMediaElement(this.tag);
  62374. this.tag.player = null;
  62375. this.tag = null;
  62376. }
  62377. this.techName_ = titleTechName;
  62378. this.isReady_ = false;
  62379. let autoplay = this.autoplay();
  62380. if (typeof this.autoplay() === "string" || this.autoplay() === true && this.options_.normalizeAutoplay) {
  62381. autoplay = false;
  62382. }
  62383. const techOptions = {
  62384. source,
  62385. autoplay,
  62386. "nativeControlsForTouch": this.options_.nativeControlsForTouch,
  62387. "playerId": this.id(),
  62388. "techId": `${this.id()}_${camelTechName}_api`,
  62389. "playsinline": this.options_.playsinline,
  62390. "preload": this.options_.preload,
  62391. "loop": this.options_.loop,
  62392. "disablePictureInPicture": this.options_.disablePictureInPicture,
  62393. "muted": this.options_.muted,
  62394. "poster": this.poster(),
  62395. "language": this.language(),
  62396. "playerElIngest": this.playerElIngest_ || false,
  62397. "vtt.js": this.options_["vtt.js"],
  62398. "canOverridePoster": !!this.options_.techCanOverridePoster,
  62399. "enableSourceset": this.options_.enableSourceset
  62400. };
  62401. ALL$1.names.forEach((name) => {
  62402. const props = ALL$1[name];
  62403. techOptions[props.getterName] = this[props.privateName];
  62404. });
  62405. Object.assign(techOptions, this.options_[titleTechName]);
  62406. Object.assign(techOptions, this.options_[camelTechName]);
  62407. Object.assign(techOptions, this.options_[techName.toLowerCase()]);
  62408. if (this.tag) {
  62409. techOptions.tag = this.tag;
  62410. }
  62411. if (source && source.src === this.cache_.src && this.cache_.currentTime > 0) {
  62412. techOptions.startTime = this.cache_.currentTime;
  62413. }
  62414. const TechClass = Tech$2.getTech(techName);
  62415. if (!TechClass) {
  62416. throw new Error(`No Tech named '${titleTechName}' exists! '${titleTechName}' should be registered using videojs.registerTech()'`);
  62417. }
  62418. this.tech_ = new TechClass(techOptions);
  62419. this.tech_.ready(bind_(this, this.handleTechReady_), true);
  62420. textTrackConverter$1.jsonToTextTracks(this.textTracksJson_ || [], this.tech_);
  62421. TECH_EVENTS_RETRIGGER$1.forEach((event2) => {
  62422. this.on(this.tech_, event2, (e) => this[`handleTech${toTitleCase$1$1(event2)}_`](e));
  62423. });
  62424. Object.keys(TECH_EVENTS_QUEUE$1).forEach((event2) => {
  62425. this.on(this.tech_, event2, (eventObj) => {
  62426. if (this.tech_.playbackRate() === 0 && this.tech_.seeking()) {
  62427. this.queuedCallbacks_.push({
  62428. callback: this[`handleTech${TECH_EVENTS_QUEUE$1[event2]}_`].bind(this),
  62429. event: eventObj
  62430. });
  62431. return;
  62432. }
  62433. this[`handleTech${TECH_EVENTS_QUEUE$1[event2]}_`](eventObj);
  62434. });
  62435. });
  62436. this.on(this.tech_, "loadstart", (e) => this.handleTechLoadStart_(e));
  62437. this.on(this.tech_, "sourceset", (e) => this.handleTechSourceset_(e));
  62438. this.on(this.tech_, "waiting", (e) => this.handleTechWaiting_(e));
  62439. this.on(this.tech_, "ended", (e) => this.handleTechEnded_(e));
  62440. this.on(this.tech_, "seeking", (e) => this.handleTechSeeking_(e));
  62441. this.on(this.tech_, "play", (e) => this.handleTechPlay_(e));
  62442. this.on(this.tech_, "pause", (e) => this.handleTechPause_(e));
  62443. this.on(this.tech_, "durationchange", (e) => this.handleTechDurationChange_(e));
  62444. this.on(this.tech_, "fullscreenchange", (e, data) => this.handleTechFullscreenChange_(e, data));
  62445. this.on(this.tech_, "fullscreenerror", (e, err) => this.handleTechFullscreenError_(e, err));
  62446. this.on(this.tech_, "enterpictureinpicture", (e) => this.handleTechEnterPictureInPicture_(e));
  62447. this.on(this.tech_, "leavepictureinpicture", (e) => this.handleTechLeavePictureInPicture_(e));
  62448. this.on(this.tech_, "error", (e) => this.handleTechError_(e));
  62449. this.on(this.tech_, "posterchange", (e) => this.handleTechPosterChange_(e));
  62450. this.on(this.tech_, "textdata", (e) => this.handleTechTextData_(e));
  62451. this.on(this.tech_, "ratechange", (e) => this.handleTechRateChange_(e));
  62452. this.on(this.tech_, "loadedmetadata", this.boundUpdateStyleEl_);
  62453. this.usingNativeControls(this.techGet_("controls"));
  62454. if (this.controls() && !this.usingNativeControls()) {
  62455. this.addTechControlsListeners_();
  62456. }
  62457. if (this.tech_.el().parentNode !== this.el() && (titleTechName !== "Html5" || !this.tag)) {
  62458. prependTo$1(this.tech_.el(), this.el());
  62459. }
  62460. if (this.tag) {
  62461. this.tag.player = null;
  62462. this.tag = null;
  62463. }
  62464. }
  62465. unloadTech_() {
  62466. ALL$1.names.forEach((name) => {
  62467. const props = ALL$1[name];
  62468. this[props.privateName] = this[props.getterName]();
  62469. });
  62470. this.textTracksJson_ = textTrackConverter$1.textTracksToJson(this.tech_);
  62471. this.isReady_ = false;
  62472. this.tech_.dispose();
  62473. this.tech_ = false;
  62474. if (this.isPosterFromTech_) {
  62475. this.poster_ = "";
  62476. this.trigger("posterchange");
  62477. }
  62478. this.isPosterFromTech_ = false;
  62479. }
  62480. tech(safety) {
  62481. if (safety === void 0) {
  62482. log$1$1.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n");
  62483. }
  62484. return this.tech_;
  62485. }
  62486. addTechControlsListeners_() {
  62487. this.removeTechControlsListeners_();
  62488. this.on(this.tech_, "click", this.boundHandleTechClick_);
  62489. this.on(this.tech_, "dblclick", this.boundHandleTechDoubleClick_);
  62490. this.on(this.tech_, "touchstart", this.boundHandleTechTouchStart_);
  62491. this.on(this.tech_, "touchmove", this.boundHandleTechTouchMove_);
  62492. this.on(this.tech_, "touchend", this.boundHandleTechTouchEnd_);
  62493. this.on(this.tech_, "tap", this.boundHandleTechTap_);
  62494. }
  62495. removeTechControlsListeners_() {
  62496. this.off(this.tech_, "tap", this.boundHandleTechTap_);
  62497. this.off(this.tech_, "touchstart", this.boundHandleTechTouchStart_);
  62498. this.off(this.tech_, "touchmove", this.boundHandleTechTouchMove_);
  62499. this.off(this.tech_, "touchend", this.boundHandleTechTouchEnd_);
  62500. this.off(this.tech_, "click", this.boundHandleTechClick_);
  62501. this.off(this.tech_, "dblclick", this.boundHandleTechDoubleClick_);
  62502. }
  62503. handleTechReady_() {
  62504. this.triggerReady();
  62505. if (this.cache_.volume) {
  62506. this.techCall_("setVolume", this.cache_.volume);
  62507. }
  62508. this.handleTechPosterChange_();
  62509. this.handleTechDurationChange_();
  62510. }
  62511. handleTechLoadStart_() {
  62512. this.removeClass("vjs-ended", "vjs-seeking");
  62513. this.error(null);
  62514. this.handleTechDurationChange_();
  62515. if (!this.paused()) {
  62516. this.trigger("loadstart");
  62517. } else {
  62518. this.hasStarted(false);
  62519. this.trigger("loadstart");
  62520. }
  62521. this.manualAutoplay_(this.autoplay() === true && this.options_.normalizeAutoplay ? "play" : this.autoplay());
  62522. }
  62523. manualAutoplay_(type2) {
  62524. if (!this.tech_ || typeof type2 !== "string") {
  62525. return;
  62526. }
  62527. const resolveMuted = () => {
  62528. const previouslyMuted = this.muted();
  62529. this.muted(true);
  62530. const restoreMuted = () => {
  62531. this.muted(previouslyMuted);
  62532. };
  62533. this.playTerminatedQueue_.push(restoreMuted);
  62534. const mutedPromise = this.play();
  62535. if (!isPromise$1(mutedPromise)) {
  62536. return;
  62537. }
  62538. return mutedPromise.catch((err) => {
  62539. restoreMuted();
  62540. throw new Error(`Rejection at manualAutoplay. Restoring muted value. ${err ? err : ""}`);
  62541. });
  62542. };
  62543. let promise;
  62544. if (type2 === "any" && !this.muted()) {
  62545. promise = this.play();
  62546. if (isPromise$1(promise)) {
  62547. promise = promise.catch(resolveMuted);
  62548. }
  62549. } else if (type2 === "muted" && !this.muted()) {
  62550. promise = resolveMuted();
  62551. } else {
  62552. promise = this.play();
  62553. }
  62554. if (!isPromise$1(promise)) {
  62555. return;
  62556. }
  62557. return promise.then(() => {
  62558. this.trigger({
  62559. type: "autoplay-success",
  62560. autoplay: type2
  62561. });
  62562. }).catch(() => {
  62563. this.trigger({
  62564. type: "autoplay-failure",
  62565. autoplay: type2
  62566. });
  62567. });
  62568. }
  62569. updateSourceCaches_(srcObj = "") {
  62570. let src = srcObj;
  62571. let type2 = "";
  62572. if (typeof src !== "string") {
  62573. src = srcObj.src;
  62574. type2 = srcObj.type;
  62575. }
  62576. this.cache_.source = this.cache_.source || {};
  62577. this.cache_.sources = this.cache_.sources || [];
  62578. if (src && !type2) {
  62579. type2 = findMimetype$1(this, src);
  62580. }
  62581. this.cache_.source = merge$1({}, srcObj, {
  62582. src,
  62583. type: type2
  62584. });
  62585. const matchingSources = this.cache_.sources.filter((s) => s.src && s.src === src);
  62586. const sourceElSources = [];
  62587. const sourceEls = this.$$("source");
  62588. const matchingSourceEls = [];
  62589. for (let i2 = 0; i2 < sourceEls.length; i2++) {
  62590. const sourceObj = getAttributes$1(sourceEls[i2]);
  62591. sourceElSources.push(sourceObj);
  62592. if (sourceObj.src && sourceObj.src === src) {
  62593. matchingSourceEls.push(sourceObj.src);
  62594. }
  62595. }
  62596. if (matchingSourceEls.length && !matchingSources.length) {
  62597. this.cache_.sources = sourceElSources;
  62598. } else if (!matchingSources.length) {
  62599. this.cache_.sources = [this.cache_.source];
  62600. }
  62601. this.cache_.src = src;
  62602. }
  62603. handleTechSourceset_(event2) {
  62604. if (!this.changingSrc_) {
  62605. let updateSourceCaches = (src) => this.updateSourceCaches_(src);
  62606. const playerSrc = this.currentSource().src;
  62607. const eventSrc = event2.src;
  62608. if (playerSrc && !/^blob:/.test(playerSrc) && /^blob:/.test(eventSrc)) {
  62609. if (!this.lastSource_ || this.lastSource_.tech !== eventSrc && this.lastSource_.player !== playerSrc) {
  62610. updateSourceCaches = () => {
  62611. };
  62612. }
  62613. }
  62614. updateSourceCaches(eventSrc);
  62615. if (!event2.src) {
  62616. this.tech_.any(["sourceset", "loadstart"], (e) => {
  62617. if (e.type === "sourceset") {
  62618. return;
  62619. }
  62620. const techSrc = this.techGet("currentSrc");
  62621. this.lastSource_.tech = techSrc;
  62622. this.updateSourceCaches_(techSrc);
  62623. });
  62624. }
  62625. }
  62626. this.lastSource_ = {
  62627. player: this.currentSource().src,
  62628. tech: event2.src
  62629. };
  62630. this.trigger({
  62631. src: event2.src,
  62632. type: "sourceset"
  62633. });
  62634. }
  62635. hasStarted(request) {
  62636. if (request === void 0) {
  62637. return this.hasStarted_;
  62638. }
  62639. if (request === this.hasStarted_) {
  62640. return;
  62641. }
  62642. this.hasStarted_ = request;
  62643. if (this.hasStarted_) {
  62644. this.addClass("vjs-has-started");
  62645. } else {
  62646. this.removeClass("vjs-has-started");
  62647. }
  62648. }
  62649. handleTechPlay_() {
  62650. this.removeClass("vjs-ended", "vjs-paused");
  62651. this.addClass("vjs-playing");
  62652. this.hasStarted(true);
  62653. this.trigger("play");
  62654. }
  62655. handleTechRateChange_() {
  62656. if (this.tech_.playbackRate() > 0 && this.cache_.lastPlaybackRate === 0) {
  62657. this.queuedCallbacks_.forEach((queued) => queued.callback(queued.event));
  62658. this.queuedCallbacks_ = [];
  62659. }
  62660. this.cache_.lastPlaybackRate = this.tech_.playbackRate();
  62661. this.trigger("ratechange");
  62662. }
  62663. handleTechWaiting_() {
  62664. this.addClass("vjs-waiting");
  62665. this.trigger("waiting");
  62666. const timeWhenWaiting = this.currentTime();
  62667. const timeUpdateListener = () => {
  62668. if (timeWhenWaiting !== this.currentTime()) {
  62669. this.removeClass("vjs-waiting");
  62670. this.off("timeupdate", timeUpdateListener);
  62671. }
  62672. };
  62673. this.on("timeupdate", timeUpdateListener);
  62674. }
  62675. handleTechCanPlay_() {
  62676. this.removeClass("vjs-waiting");
  62677. this.trigger("canplay");
  62678. }
  62679. handleTechCanPlayThrough_() {
  62680. this.removeClass("vjs-waiting");
  62681. this.trigger("canplaythrough");
  62682. }
  62683. handleTechPlaying_() {
  62684. this.removeClass("vjs-waiting");
  62685. this.trigger("playing");
  62686. }
  62687. handleTechSeeking_() {
  62688. this.addClass("vjs-seeking");
  62689. this.trigger("seeking");
  62690. }
  62691. handleTechSeeked_() {
  62692. this.removeClass("vjs-seeking", "vjs-ended");
  62693. this.trigger("seeked");
  62694. }
  62695. handleTechPause_() {
  62696. this.removeClass("vjs-playing");
  62697. this.addClass("vjs-paused");
  62698. this.trigger("pause");
  62699. }
  62700. handleTechEnded_() {
  62701. this.addClass("vjs-ended");
  62702. this.removeClass("vjs-waiting");
  62703. if (this.options_.loop) {
  62704. this.currentTime(0);
  62705. this.play();
  62706. } else if (!this.paused()) {
  62707. this.pause();
  62708. }
  62709. this.trigger("ended");
  62710. }
  62711. handleTechDurationChange_() {
  62712. this.duration(this.techGet_("duration"));
  62713. }
  62714. handleTechClick_(event2) {
  62715. if (!this.controls_) {
  62716. return;
  62717. }
  62718. if (this.options_ === void 0 || this.options_.userActions === void 0 || this.options_.userActions.click === void 0 || this.options_.userActions.click !== false) {
  62719. if (this.options_ !== void 0 && this.options_.userActions !== void 0 && typeof this.options_.userActions.click === "function") {
  62720. this.options_.userActions.click.call(this, event2);
  62721. } else if (this.paused()) {
  62722. silencePromise$1(this.play());
  62723. } else {
  62724. this.pause();
  62725. }
  62726. }
  62727. }
  62728. handleTechDoubleClick_(event2) {
  62729. if (!this.controls_) {
  62730. return;
  62731. }
  62732. const inAllowedEls = Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"), (el) => el.contains(event2.target));
  62733. if (!inAllowedEls) {
  62734. if (this.options_ === void 0 || this.options_.userActions === void 0 || this.options_.userActions.doubleClick === void 0 || this.options_.userActions.doubleClick !== false) {
  62735. if (this.options_ !== void 0 && this.options_.userActions !== void 0 && typeof this.options_.userActions.doubleClick === "function") {
  62736. this.options_.userActions.doubleClick.call(this, event2);
  62737. } else if (this.isFullscreen()) {
  62738. this.exitFullscreen();
  62739. } else {
  62740. this.requestFullscreen();
  62741. }
  62742. }
  62743. }
  62744. }
  62745. handleTechTap_() {
  62746. this.userActive(!this.userActive());
  62747. }
  62748. handleTechTouchStart_() {
  62749. this.userWasActive = this.userActive();
  62750. }
  62751. handleTechTouchMove_() {
  62752. if (this.userWasActive) {
  62753. this.reportUserActivity();
  62754. }
  62755. }
  62756. handleTechTouchEnd_(event2) {
  62757. if (event2.cancelable) {
  62758. event2.preventDefault();
  62759. }
  62760. }
  62761. toggleFullscreenClass_() {
  62762. if (this.isFullscreen()) {
  62763. this.addClass("vjs-fullscreen");
  62764. } else {
  62765. this.removeClass("vjs-fullscreen");
  62766. }
  62767. }
  62768. documentFullscreenChange_(e) {
  62769. const targetPlayer = e.target.player;
  62770. if (targetPlayer && targetPlayer !== this) {
  62771. return;
  62772. }
  62773. const el = this.el();
  62774. let isFs = document_1[this.fsApi_.fullscreenElement] === el;
  62775. if (!isFs && el.matches) {
  62776. isFs = el.matches(":" + this.fsApi_.fullscreen);
  62777. } else if (!isFs && el.msMatchesSelector) {
  62778. isFs = el.msMatchesSelector(":" + this.fsApi_.fullscreen);
  62779. }
  62780. this.isFullscreen(isFs);
  62781. }
  62782. handleTechFullscreenChange_(event2, data) {
  62783. if (data) {
  62784. if (data.nativeIOSFullscreen) {
  62785. this.addClass("vjs-ios-native-fs");
  62786. this.tech_.one("webkitendfullscreen", () => {
  62787. this.removeClass("vjs-ios-native-fs");
  62788. });
  62789. }
  62790. this.isFullscreen(data.isFullscreen);
  62791. }
  62792. }
  62793. handleTechFullscreenError_(event2, err) {
  62794. this.trigger("fullscreenerror", err);
  62795. }
  62796. togglePictureInPictureClass_() {
  62797. if (this.isInPictureInPicture()) {
  62798. this.addClass("vjs-picture-in-picture");
  62799. } else {
  62800. this.removeClass("vjs-picture-in-picture");
  62801. }
  62802. }
  62803. handleTechEnterPictureInPicture_(event2) {
  62804. this.isInPictureInPicture(true);
  62805. }
  62806. handleTechLeavePictureInPicture_(event2) {
  62807. this.isInPictureInPicture(false);
  62808. }
  62809. handleTechError_() {
  62810. const error = this.tech_.error();
  62811. this.error(error);
  62812. }
  62813. handleTechTextData_() {
  62814. let data = null;
  62815. if (arguments.length > 1) {
  62816. data = arguments[1];
  62817. }
  62818. this.trigger("textdata", data);
  62819. }
  62820. getCache() {
  62821. return this.cache_;
  62822. }
  62823. resetCache_() {
  62824. this.cache_ = {
  62825. currentTime: 0,
  62826. initTime: 0,
  62827. inactivityTimeout: this.options_.inactivityTimeout,
  62828. duration: NaN,
  62829. lastVolume: 1,
  62830. lastPlaybackRate: this.defaultPlaybackRate(),
  62831. media: null,
  62832. src: "",
  62833. source: {},
  62834. sources: [],
  62835. playbackRates: [],
  62836. volume: 1
  62837. };
  62838. }
  62839. techCall_(method, arg) {
  62840. this.ready(function() {
  62841. if (method in allowedSetters$1) {
  62842. return set$1(this.middleware_, this.tech_, method, arg);
  62843. } else if (method in allowedMediators$1) {
  62844. return mediate$1(this.middleware_, this.tech_, method, arg);
  62845. }
  62846. try {
  62847. if (this.tech_) {
  62848. this.tech_[method](arg);
  62849. }
  62850. } catch (e) {
  62851. log$1$1(e);
  62852. throw e;
  62853. }
  62854. }, true);
  62855. }
  62856. techGet_(method) {
  62857. if (!this.tech_ || !this.tech_.isReady_) {
  62858. return;
  62859. }
  62860. if (method in allowedGetters$1) {
  62861. return get$1(this.middleware_, this.tech_, method);
  62862. } else if (method in allowedMediators$1) {
  62863. return mediate$1(this.middleware_, this.tech_, method);
  62864. }
  62865. try {
  62866. return this.tech_[method]();
  62867. } catch (e) {
  62868. if (this.tech_[method] === void 0) {
  62869. log$1$1(`Video.js: ${method} method not defined for ${this.techName_} playback technology.`, e);
  62870. throw e;
  62871. }
  62872. if (e.name === "TypeError") {
  62873. log$1$1(`Video.js: ${method} unavailable on ${this.techName_} playback technology element.`, e);
  62874. this.tech_.isReady_ = false;
  62875. throw e;
  62876. }
  62877. log$1$1(e);
  62878. throw e;
  62879. }
  62880. }
  62881. play() {
  62882. return new Promise((resolve2) => {
  62883. this.play_(resolve2);
  62884. });
  62885. }
  62886. play_(callback2 = silencePromise$1) {
  62887. this.playCallbacks_.push(callback2);
  62888. const isSrcReady = Boolean(!this.changingSrc_ && (this.src() || this.currentSrc()));
  62889. const isSafariOrIOS = Boolean(IS_ANY_SAFARI$1 || IS_IOS$1);
  62890. if (this.waitToPlay_) {
  62891. this.off(["ready", "loadstart"], this.waitToPlay_);
  62892. this.waitToPlay_ = null;
  62893. }
  62894. if (!this.isReady_ || !isSrcReady) {
  62895. this.waitToPlay_ = (e) => {
  62896. this.play_();
  62897. };
  62898. this.one(["ready", "loadstart"], this.waitToPlay_);
  62899. if (!isSrcReady && isSafariOrIOS) {
  62900. this.load();
  62901. }
  62902. return;
  62903. }
  62904. const val = this.techGet_("play");
  62905. const isNativeReplay = isSafariOrIOS && this.hasClass("vjs-ended");
  62906. if (isNativeReplay) {
  62907. this.resetProgressBar_();
  62908. }
  62909. if (val === null) {
  62910. this.runPlayTerminatedQueue_();
  62911. } else {
  62912. this.runPlayCallbacks_(val);
  62913. }
  62914. }
  62915. runPlayTerminatedQueue_() {
  62916. const queue = this.playTerminatedQueue_.slice(0);
  62917. this.playTerminatedQueue_ = [];
  62918. queue.forEach(function(q2) {
  62919. q2();
  62920. });
  62921. }
  62922. runPlayCallbacks_(val) {
  62923. const callbacks = this.playCallbacks_.slice(0);
  62924. this.playCallbacks_ = [];
  62925. this.playTerminatedQueue_ = [];
  62926. callbacks.forEach(function(cb) {
  62927. cb(val);
  62928. });
  62929. }
  62930. pause() {
  62931. this.techCall_("pause");
  62932. }
  62933. paused() {
  62934. return this.techGet_("paused") === false ? false : true;
  62935. }
  62936. played() {
  62937. return this.techGet_("played") || createTimeRanges$1(0, 0);
  62938. }
  62939. scrubbing(isScrubbing) {
  62940. if (typeof isScrubbing === "undefined") {
  62941. return this.scrubbing_;
  62942. }
  62943. this.scrubbing_ = !!isScrubbing;
  62944. this.techCall_("setScrubbing", this.scrubbing_);
  62945. if (isScrubbing) {
  62946. this.addClass("vjs-scrubbing");
  62947. } else {
  62948. this.removeClass("vjs-scrubbing");
  62949. }
  62950. }
  62951. currentTime(seconds) {
  62952. if (typeof seconds !== "undefined") {
  62953. if (seconds < 0) {
  62954. seconds = 0;
  62955. }
  62956. if (!this.isReady_ || this.changingSrc_ || !this.tech_ || !this.tech_.isReady_) {
  62957. this.cache_.initTime = seconds;
  62958. this.off("canplay", this.boundApplyInitTime_);
  62959. this.one("canplay", this.boundApplyInitTime_);
  62960. return;
  62961. }
  62962. this.techCall_("setCurrentTime", seconds);
  62963. this.cache_.initTime = 0;
  62964. return;
  62965. }
  62966. this.cache_.currentTime = this.techGet_("currentTime") || 0;
  62967. return this.cache_.currentTime;
  62968. }
  62969. applyInitTime_() {
  62970. this.currentTime(this.cache_.initTime);
  62971. }
  62972. duration(seconds) {
  62973. if (seconds === void 0) {
  62974. return this.cache_.duration !== void 0 ? this.cache_.duration : NaN;
  62975. }
  62976. seconds = parseFloat(seconds);
  62977. if (seconds < 0) {
  62978. seconds = Infinity;
  62979. }
  62980. if (seconds !== this.cache_.duration) {
  62981. this.cache_.duration = seconds;
  62982. if (seconds === Infinity) {
  62983. this.addClass("vjs-live");
  62984. } else {
  62985. this.removeClass("vjs-live");
  62986. }
  62987. if (!isNaN(seconds)) {
  62988. this.trigger("durationchange");
  62989. }
  62990. }
  62991. }
  62992. remainingTime() {
  62993. return this.duration() - this.currentTime();
  62994. }
  62995. remainingTimeDisplay() {
  62996. return Math.floor(this.duration()) - Math.floor(this.currentTime());
  62997. }
  62998. buffered() {
  62999. let buffered = this.techGet_("buffered");
  63000. if (!buffered || !buffered.length) {
  63001. buffered = createTimeRanges$1(0, 0);
  63002. }
  63003. return buffered;
  63004. }
  63005. bufferedPercent() {
  63006. return bufferedPercent$1(this.buffered(), this.duration());
  63007. }
  63008. bufferedEnd() {
  63009. const buffered = this.buffered();
  63010. const duration5 = this.duration();
  63011. let end = buffered.end(buffered.length - 1);
  63012. if (end > duration5) {
  63013. end = duration5;
  63014. }
  63015. return end;
  63016. }
  63017. volume(percentAsDecimal) {
  63018. let vol;
  63019. if (percentAsDecimal !== void 0) {
  63020. vol = Math.max(0, Math.min(1, parseFloat(percentAsDecimal)));
  63021. this.cache_.volume = vol;
  63022. this.techCall_("setVolume", vol);
  63023. if (vol > 0) {
  63024. this.lastVolume_(vol);
  63025. }
  63026. return;
  63027. }
  63028. vol = parseFloat(this.techGet_("volume"));
  63029. return isNaN(vol) ? 1 : vol;
  63030. }
  63031. muted(muted) {
  63032. if (muted !== void 0) {
  63033. this.techCall_("setMuted", muted);
  63034. return;
  63035. }
  63036. return this.techGet_("muted") || false;
  63037. }
  63038. defaultMuted(defaultMuted) {
  63039. if (defaultMuted !== void 0) {
  63040. return this.techCall_("setDefaultMuted", defaultMuted);
  63041. }
  63042. return this.techGet_("defaultMuted") || false;
  63043. }
  63044. lastVolume_(percentAsDecimal) {
  63045. if (percentAsDecimal !== void 0 && percentAsDecimal !== 0) {
  63046. this.cache_.lastVolume = percentAsDecimal;
  63047. return;
  63048. }
  63049. return this.cache_.lastVolume;
  63050. }
  63051. supportsFullScreen() {
  63052. return this.techGet_("supportsFullScreen") || false;
  63053. }
  63054. isFullscreen(isFS) {
  63055. if (isFS !== void 0) {
  63056. const oldValue = this.isFullscreen_;
  63057. this.isFullscreen_ = Boolean(isFS);
  63058. if (this.isFullscreen_ !== oldValue && this.fsApi_.prefixed) {
  63059. this.trigger("fullscreenchange");
  63060. }
  63061. this.toggleFullscreenClass_();
  63062. return;
  63063. }
  63064. return this.isFullscreen_;
  63065. }
  63066. requestFullscreen(fullscreenOptions) {
  63067. if (this.isInPictureInPicture()) {
  63068. this.exitPictureInPicture();
  63069. }
  63070. const self2 = this;
  63071. return new Promise((resolve2, reject2) => {
  63072. function offHandler() {
  63073. self2.off("fullscreenerror", errorHandler);
  63074. self2.off("fullscreenchange", changeHandler);
  63075. }
  63076. function changeHandler() {
  63077. offHandler();
  63078. resolve2();
  63079. }
  63080. function errorHandler(e, err) {
  63081. offHandler();
  63082. reject2(err);
  63083. }
  63084. self2.one("fullscreenchange", changeHandler);
  63085. self2.one("fullscreenerror", errorHandler);
  63086. const promise = self2.requestFullscreenHelper_(fullscreenOptions);
  63087. if (promise) {
  63088. promise.then(offHandler, offHandler);
  63089. promise.then(resolve2, reject2);
  63090. }
  63091. });
  63092. }
  63093. requestFullscreenHelper_(fullscreenOptions) {
  63094. let fsOptions;
  63095. if (!this.fsApi_.prefixed) {
  63096. fsOptions = this.options_.fullscreen && this.options_.fullscreen.options || {};
  63097. if (fullscreenOptions !== void 0) {
  63098. fsOptions = fullscreenOptions;
  63099. }
  63100. }
  63101. if (this.fsApi_.requestFullscreen) {
  63102. const promise = this.el_[this.fsApi_.requestFullscreen](fsOptions);
  63103. if (promise) {
  63104. promise.then(() => this.isFullscreen(true), () => this.isFullscreen(false));
  63105. }
  63106. return promise;
  63107. } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {
  63108. this.techCall_("enterFullScreen");
  63109. } else {
  63110. this.enterFullWindow();
  63111. }
  63112. }
  63113. exitFullscreen() {
  63114. const self2 = this;
  63115. return new Promise((resolve2, reject2) => {
  63116. function offHandler() {
  63117. self2.off("fullscreenerror", errorHandler);
  63118. self2.off("fullscreenchange", changeHandler);
  63119. }
  63120. function changeHandler() {
  63121. offHandler();
  63122. resolve2();
  63123. }
  63124. function errorHandler(e, err) {
  63125. offHandler();
  63126. reject2(err);
  63127. }
  63128. self2.one("fullscreenchange", changeHandler);
  63129. self2.one("fullscreenerror", errorHandler);
  63130. const promise = self2.exitFullscreenHelper_();
  63131. if (promise) {
  63132. promise.then(offHandler, offHandler);
  63133. promise.then(resolve2, reject2);
  63134. }
  63135. });
  63136. }
  63137. exitFullscreenHelper_() {
  63138. if (this.fsApi_.requestFullscreen) {
  63139. const promise = document_1[this.fsApi_.exitFullscreen]();
  63140. if (promise) {
  63141. silencePromise$1(promise.then(() => this.isFullscreen(false)));
  63142. }
  63143. return promise;
  63144. } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {
  63145. this.techCall_("exitFullScreen");
  63146. } else {
  63147. this.exitFullWindow();
  63148. }
  63149. }
  63150. enterFullWindow() {
  63151. this.isFullscreen(true);
  63152. this.isFullWindow = true;
  63153. this.docOrigOverflow = document_1.documentElement.style.overflow;
  63154. on$1(document_1, "keydown", this.boundFullWindowOnEscKey_);
  63155. document_1.documentElement.style.overflow = "hidden";
  63156. addClass$1(document_1.body, "vjs-full-window");
  63157. this.trigger("enterFullWindow");
  63158. }
  63159. fullWindowOnEscKey(event2) {
  63160. if (keycode.isEventKey(event2, "Esc")) {
  63161. if (this.isFullscreen() === true) {
  63162. if (!this.isFullWindow) {
  63163. this.exitFullscreen();
  63164. } else {
  63165. this.exitFullWindow();
  63166. }
  63167. }
  63168. }
  63169. }
  63170. exitFullWindow() {
  63171. this.isFullscreen(false);
  63172. this.isFullWindow = false;
  63173. off$1(document_1, "keydown", this.boundFullWindowOnEscKey_);
  63174. document_1.documentElement.style.overflow = this.docOrigOverflow;
  63175. removeClass$1(document_1.body, "vjs-full-window");
  63176. this.trigger("exitFullWindow");
  63177. }
  63178. disablePictureInPicture(value) {
  63179. if (value === void 0) {
  63180. return this.techGet_("disablePictureInPicture");
  63181. }
  63182. this.techCall_("setDisablePictureInPicture", value);
  63183. this.options_.disablePictureInPicture = value;
  63184. this.trigger("disablepictureinpicturechanged");
  63185. }
  63186. isInPictureInPicture(isPiP) {
  63187. if (isPiP !== void 0) {
  63188. this.isInPictureInPicture_ = !!isPiP;
  63189. this.togglePictureInPictureClass_();
  63190. return;
  63191. }
  63192. return !!this.isInPictureInPicture_;
  63193. }
  63194. requestPictureInPicture() {
  63195. if (this.options_.enableDocumentPictureInPicture && window_1.documentPictureInPicture) {
  63196. const pipContainer = document_1.createElement(this.el().tagName);
  63197. pipContainer.classList = this.el().classList;
  63198. pipContainer.classList.add("vjs-pip-container");
  63199. if (this.posterImage) {
  63200. pipContainer.appendChild(this.posterImage.el().cloneNode(true));
  63201. }
  63202. if (this.titleBar) {
  63203. pipContainer.appendChild(this.titleBar.el().cloneNode(true));
  63204. }
  63205. pipContainer.appendChild(createEl$1("p", {
  63206. className: "vjs-pip-text"
  63207. }, {}, this.localize("Playing in picture-in-picture")));
  63208. return window_1.documentPictureInPicture.requestWindow({
  63209. initialAspectRatio: this.videoWidth() / this.videoHeight(),
  63210. copyStyleSheets: true
  63211. }).then((pipWindow) => {
  63212. this.el_.parentNode.insertBefore(pipContainer, this.el_);
  63213. pipWindow.document.body.append(this.el_);
  63214. pipWindow.document.body.classList.add("vjs-pip-window");
  63215. this.player_.isInPictureInPicture(true);
  63216. this.player_.trigger("enterpictureinpicture");
  63217. pipWindow.addEventListener("unload", (event2) => {
  63218. const pipVideo = event2.target.querySelector(".video-js");
  63219. pipContainer.replaceWith(pipVideo);
  63220. this.player_.isInPictureInPicture(false);
  63221. this.player_.trigger("leavepictureinpicture");
  63222. });
  63223. return pipWindow;
  63224. });
  63225. }
  63226. if ("pictureInPictureEnabled" in document_1 && this.disablePictureInPicture() === false) {
  63227. return this.techGet_("requestPictureInPicture");
  63228. }
  63229. return Promise.reject("No PiP mode is available");
  63230. }
  63231. exitPictureInPicture() {
  63232. if (window_1.documentPictureInPicture && window_1.documentPictureInPicture.window) {
  63233. window_1.documentPictureInPicture.window.close();
  63234. return Promise.resolve();
  63235. }
  63236. if ("pictureInPictureEnabled" in document_1) {
  63237. return document_1.exitPictureInPicture();
  63238. }
  63239. }
  63240. handleKeyDown(event2) {
  63241. const {
  63242. userActions
  63243. } = this.options_;
  63244. if (!userActions || !userActions.hotkeys) {
  63245. return;
  63246. }
  63247. const excludeElement = (el) => {
  63248. const tagName = el.tagName.toLowerCase();
  63249. if (el.isContentEditable) {
  63250. return true;
  63251. }
  63252. const allowedInputTypes = ["button", "checkbox", "hidden", "radio", "reset", "submit"];
  63253. if (tagName === "input") {
  63254. return allowedInputTypes.indexOf(el.type) === -1;
  63255. }
  63256. const excludedTags = ["textarea"];
  63257. return excludedTags.indexOf(tagName) !== -1;
  63258. };
  63259. if (excludeElement(this.el_.ownerDocument.activeElement)) {
  63260. return;
  63261. }
  63262. if (typeof userActions.hotkeys === "function") {
  63263. userActions.hotkeys.call(this, event2);
  63264. } else {
  63265. this.handleHotkeys(event2);
  63266. }
  63267. }
  63268. handleHotkeys(event2) {
  63269. const hotkeys = this.options_.userActions ? this.options_.userActions.hotkeys : {};
  63270. const {
  63271. fullscreenKey = (keydownEvent) => keycode.isEventKey(keydownEvent, "f"),
  63272. muteKey = (keydownEvent) => keycode.isEventKey(keydownEvent, "m"),
  63273. playPauseKey = (keydownEvent) => keycode.isEventKey(keydownEvent, "k") || keycode.isEventKey(keydownEvent, "Space")
  63274. } = hotkeys;
  63275. if (fullscreenKey.call(this, event2)) {
  63276. event2.preventDefault();
  63277. event2.stopPropagation();
  63278. const FSToggle = Component$1$1.getComponent("FullscreenToggle");
  63279. if (document_1[this.fsApi_.fullscreenEnabled] !== false) {
  63280. FSToggle.prototype.handleClick.call(this, event2);
  63281. }
  63282. } else if (muteKey.call(this, event2)) {
  63283. event2.preventDefault();
  63284. event2.stopPropagation();
  63285. const MuteToggle2 = Component$1$1.getComponent("MuteToggle");
  63286. MuteToggle2.prototype.handleClick.call(this, event2);
  63287. } else if (playPauseKey.call(this, event2)) {
  63288. event2.preventDefault();
  63289. event2.stopPropagation();
  63290. const PlayToggle2 = Component$1$1.getComponent("PlayToggle");
  63291. PlayToggle2.prototype.handleClick.call(this, event2);
  63292. }
  63293. }
  63294. canPlayType(type2) {
  63295. let can;
  63296. for (let i2 = 0, j = this.options_.techOrder; i2 < j.length; i2++) {
  63297. const techName = j[i2];
  63298. let tech = Tech$2.getTech(techName);
  63299. if (!tech) {
  63300. tech = Component$1$1.getComponent(techName);
  63301. }
  63302. if (!tech) {
  63303. log$1$1.error(`The "${techName}" tech is undefined. Skipped browser support check for that tech.`);
  63304. continue;
  63305. }
  63306. if (tech.isSupported()) {
  63307. can = tech.canPlayType(type2);
  63308. if (can) {
  63309. return can;
  63310. }
  63311. }
  63312. }
  63313. return "";
  63314. }
  63315. selectSource(sources) {
  63316. const techs = this.options_.techOrder.map((techName) => {
  63317. return [techName, Tech$2.getTech(techName)];
  63318. }).filter(([techName, tech]) => {
  63319. if (tech) {
  63320. return tech.isSupported();
  63321. }
  63322. log$1$1.error(`The "${techName}" tech is undefined. Skipped browser support check for that tech.`);
  63323. return false;
  63324. });
  63325. const findFirstPassingTechSourcePair = function(outerArray, innerArray, tester) {
  63326. let found;
  63327. outerArray.some((outerChoice) => {
  63328. return innerArray.some((innerChoice) => {
  63329. found = tester(outerChoice, innerChoice);
  63330. if (found) {
  63331. return true;
  63332. }
  63333. });
  63334. });
  63335. return found;
  63336. };
  63337. let foundSourceAndTech;
  63338. const flip = (fn2) => (a, b) => fn2(b, a);
  63339. const finder = ([techName, tech], source) => {
  63340. if (tech.canPlaySource(source, this.options_[techName.toLowerCase()])) {
  63341. return {
  63342. source,
  63343. tech: techName
  63344. };
  63345. }
  63346. };
  63347. if (this.options_.sourceOrder) {
  63348. foundSourceAndTech = findFirstPassingTechSourcePair(sources, techs, flip(finder));
  63349. } else {
  63350. foundSourceAndTech = findFirstPassingTechSourcePair(techs, sources, finder);
  63351. }
  63352. return foundSourceAndTech || false;
  63353. }
  63354. handleSrc_(source, isRetry) {
  63355. if (typeof source === "undefined") {
  63356. return this.cache_.src || "";
  63357. }
  63358. if (this.resetRetryOnError_) {
  63359. this.resetRetryOnError_();
  63360. }
  63361. const sources = filterSource$1(source);
  63362. if (!sources.length) {
  63363. this.setTimeout(function() {
  63364. this.error({
  63365. code: 4,
  63366. message: this.options_.notSupportedMessage
  63367. });
  63368. }, 0);
  63369. return;
  63370. }
  63371. this.changingSrc_ = true;
  63372. if (!isRetry) {
  63373. this.cache_.sources = sources;
  63374. }
  63375. this.updateSourceCaches_(sources[0]);
  63376. setSource$1(this, sources[0], (middlewareSource, mws) => {
  63377. this.middleware_ = mws;
  63378. if (!isRetry) {
  63379. this.cache_.sources = sources;
  63380. }
  63381. this.updateSourceCaches_(middlewareSource);
  63382. const err = this.src_(middlewareSource);
  63383. if (err) {
  63384. if (sources.length > 1) {
  63385. return this.handleSrc_(sources.slice(1));
  63386. }
  63387. this.changingSrc_ = false;
  63388. this.setTimeout(function() {
  63389. this.error({
  63390. code: 4,
  63391. message: this.options_.notSupportedMessage
  63392. });
  63393. }, 0);
  63394. this.triggerReady();
  63395. return;
  63396. }
  63397. setTech$1(mws, this.tech_);
  63398. });
  63399. if (sources.length > 1) {
  63400. const retry = () => {
  63401. this.error(null);
  63402. this.handleSrc_(sources.slice(1), true);
  63403. };
  63404. const stopListeningForErrors = () => {
  63405. this.off("error", retry);
  63406. };
  63407. this.one("error", retry);
  63408. this.one("playing", stopListeningForErrors);
  63409. this.resetRetryOnError_ = () => {
  63410. this.off("error", retry);
  63411. this.off("playing", stopListeningForErrors);
  63412. };
  63413. }
  63414. }
  63415. src(source) {
  63416. return this.handleSrc_(source, false);
  63417. }
  63418. src_(source) {
  63419. const sourceTech = this.selectSource([source]);
  63420. if (!sourceTech) {
  63421. return true;
  63422. }
  63423. if (!titleCaseEquals$1(sourceTech.tech, this.techName_)) {
  63424. this.changingSrc_ = true;
  63425. this.loadTech_(sourceTech.tech, sourceTech.source);
  63426. this.tech_.ready(() => {
  63427. this.changingSrc_ = false;
  63428. });
  63429. return false;
  63430. }
  63431. this.ready(function() {
  63432. if (this.tech_.constructor.prototype.hasOwnProperty("setSource")) {
  63433. this.techCall_("setSource", source);
  63434. } else {
  63435. this.techCall_("src", source.src);
  63436. }
  63437. this.changingSrc_ = false;
  63438. }, true);
  63439. return false;
  63440. }
  63441. load() {
  63442. this.techCall_("load");
  63443. }
  63444. reset() {
  63445. if (this.paused()) {
  63446. this.doReset_();
  63447. } else {
  63448. const playPromise = this.play();
  63449. silencePromise$1(playPromise.then(() => this.doReset_()));
  63450. }
  63451. }
  63452. doReset_() {
  63453. if (this.tech_) {
  63454. this.tech_.clearTracks("text");
  63455. }
  63456. this.resetCache_();
  63457. this.poster("");
  63458. this.loadTech_(this.options_.techOrder[0], null);
  63459. this.techCall_("reset");
  63460. this.resetControlBarUI_();
  63461. if (isEvented$1(this)) {
  63462. this.trigger("playerreset");
  63463. }
  63464. }
  63465. resetControlBarUI_() {
  63466. this.resetProgressBar_();
  63467. this.resetPlaybackRate_();
  63468. this.resetVolumeBar_();
  63469. }
  63470. resetProgressBar_() {
  63471. this.currentTime(0);
  63472. const {
  63473. currentTimeDisplay,
  63474. durationDisplay,
  63475. progressControl,
  63476. remainingTimeDisplay
  63477. } = this.controlBar || {};
  63478. const {
  63479. seekBar
  63480. } = progressControl || {};
  63481. if (currentTimeDisplay) {
  63482. currentTimeDisplay.updateContent();
  63483. }
  63484. if (durationDisplay) {
  63485. durationDisplay.updateContent();
  63486. }
  63487. if (remainingTimeDisplay) {
  63488. remainingTimeDisplay.updateContent();
  63489. }
  63490. if (seekBar) {
  63491. seekBar.update();
  63492. if (seekBar.loadProgressBar) {
  63493. seekBar.loadProgressBar.update();
  63494. }
  63495. }
  63496. }
  63497. resetPlaybackRate_() {
  63498. this.playbackRate(this.defaultPlaybackRate());
  63499. this.handleTechRateChange_();
  63500. }
  63501. resetVolumeBar_() {
  63502. this.volume(1);
  63503. this.trigger("volumechange");
  63504. }
  63505. currentSources() {
  63506. const source = this.currentSource();
  63507. const sources = [];
  63508. if (Object.keys(source).length !== 0) {
  63509. sources.push(source);
  63510. }
  63511. return this.cache_.sources || sources;
  63512. }
  63513. currentSource() {
  63514. return this.cache_.source || {};
  63515. }
  63516. currentSrc() {
  63517. return this.currentSource() && this.currentSource().src || "";
  63518. }
  63519. currentType() {
  63520. return this.currentSource() && this.currentSource().type || "";
  63521. }
  63522. preload(value) {
  63523. if (value !== void 0) {
  63524. this.techCall_("setPreload", value);
  63525. this.options_.preload = value;
  63526. return;
  63527. }
  63528. return this.techGet_("preload");
  63529. }
  63530. autoplay(value) {
  63531. if (value === void 0) {
  63532. return this.options_.autoplay || false;
  63533. }
  63534. let techAutoplay;
  63535. if (typeof value === "string" && /(any|play|muted)/.test(value) || value === true && this.options_.normalizeAutoplay) {
  63536. this.options_.autoplay = value;
  63537. this.manualAutoplay_(typeof value === "string" ? value : "play");
  63538. techAutoplay = false;
  63539. } else if (!value) {
  63540. this.options_.autoplay = false;
  63541. } else {
  63542. this.options_.autoplay = true;
  63543. }
  63544. techAutoplay = typeof techAutoplay === "undefined" ? this.options_.autoplay : techAutoplay;
  63545. if (this.tech_) {
  63546. this.techCall_("setAutoplay", techAutoplay);
  63547. }
  63548. }
  63549. playsinline(value) {
  63550. if (value !== void 0) {
  63551. this.techCall_("setPlaysinline", value);
  63552. this.options_.playsinline = value;
  63553. return this;
  63554. }
  63555. return this.techGet_("playsinline");
  63556. }
  63557. loop(value) {
  63558. if (value !== void 0) {
  63559. this.techCall_("setLoop", value);
  63560. this.options_.loop = value;
  63561. return;
  63562. }
  63563. return this.techGet_("loop");
  63564. }
  63565. poster(src) {
  63566. if (src === void 0) {
  63567. return this.poster_;
  63568. }
  63569. if (!src) {
  63570. src = "";
  63571. }
  63572. if (src === this.poster_) {
  63573. return;
  63574. }
  63575. this.poster_ = src;
  63576. this.techCall_("setPoster", src);
  63577. this.isPosterFromTech_ = false;
  63578. this.trigger("posterchange");
  63579. }
  63580. handleTechPosterChange_() {
  63581. if ((!this.poster_ || this.options_.techCanOverridePoster) && this.tech_ && this.tech_.poster) {
  63582. const newPoster = this.tech_.poster() || "";
  63583. if (newPoster !== this.poster_) {
  63584. this.poster_ = newPoster;
  63585. this.isPosterFromTech_ = true;
  63586. this.trigger("posterchange");
  63587. }
  63588. }
  63589. }
  63590. controls(bool) {
  63591. if (bool === void 0) {
  63592. return !!this.controls_;
  63593. }
  63594. bool = !!bool;
  63595. if (this.controls_ === bool) {
  63596. return;
  63597. }
  63598. this.controls_ = bool;
  63599. if (this.usingNativeControls()) {
  63600. this.techCall_("setControls", bool);
  63601. }
  63602. if (this.controls_) {
  63603. this.removeClass("vjs-controls-disabled");
  63604. this.addClass("vjs-controls-enabled");
  63605. this.trigger("controlsenabled");
  63606. if (!this.usingNativeControls()) {
  63607. this.addTechControlsListeners_();
  63608. }
  63609. } else {
  63610. this.removeClass("vjs-controls-enabled");
  63611. this.addClass("vjs-controls-disabled");
  63612. this.trigger("controlsdisabled");
  63613. if (!this.usingNativeControls()) {
  63614. this.removeTechControlsListeners_();
  63615. }
  63616. }
  63617. }
  63618. usingNativeControls(bool) {
  63619. if (bool === void 0) {
  63620. return !!this.usingNativeControls_;
  63621. }
  63622. bool = !!bool;
  63623. if (this.usingNativeControls_ === bool) {
  63624. return;
  63625. }
  63626. this.usingNativeControls_ = bool;
  63627. if (this.usingNativeControls_) {
  63628. this.addClass("vjs-using-native-controls");
  63629. this.trigger("usingnativecontrols");
  63630. } else {
  63631. this.removeClass("vjs-using-native-controls");
  63632. this.trigger("usingcustomcontrols");
  63633. }
  63634. }
  63635. error(err) {
  63636. if (err === void 0) {
  63637. return this.error_ || null;
  63638. }
  63639. hooks$1("beforeerror").forEach((hookFunction) => {
  63640. const newErr = hookFunction(this, err);
  63641. if (!(isObject$2(newErr) && !Array.isArray(newErr) || typeof newErr === "string" || typeof newErr === "number" || newErr === null)) {
  63642. this.log.error("please return a value that MediaError expects in beforeerror hooks");
  63643. return;
  63644. }
  63645. err = newErr;
  63646. });
  63647. if (this.options_.suppressNotSupportedError && err && err.code === 4) {
  63648. const triggerSuppressedError = function() {
  63649. this.error(err);
  63650. };
  63651. this.options_.suppressNotSupportedError = false;
  63652. this.any(["click", "touchstart"], triggerSuppressedError);
  63653. this.one("loadstart", function() {
  63654. this.off(["click", "touchstart"], triggerSuppressedError);
  63655. });
  63656. return;
  63657. }
  63658. if (err === null) {
  63659. this.error_ = err;
  63660. this.removeClass("vjs-error");
  63661. if (this.errorDisplay) {
  63662. this.errorDisplay.close();
  63663. }
  63664. return;
  63665. }
  63666. this.error_ = new MediaError$1(err);
  63667. this.addClass("vjs-error");
  63668. log$1$1.error(`(CODE:${this.error_.code} ${MediaError$1.errorTypes[this.error_.code]})`, this.error_.message, this.error_);
  63669. this.trigger("error");
  63670. hooks$1("error").forEach((hookFunction) => hookFunction(this, this.error_));
  63671. return;
  63672. }
  63673. reportUserActivity(event2) {
  63674. this.userActivity_ = true;
  63675. }
  63676. userActive(bool) {
  63677. if (bool === void 0) {
  63678. return this.userActive_;
  63679. }
  63680. bool = !!bool;
  63681. if (bool === this.userActive_) {
  63682. return;
  63683. }
  63684. this.userActive_ = bool;
  63685. if (this.userActive_) {
  63686. this.userActivity_ = true;
  63687. this.removeClass("vjs-user-inactive");
  63688. this.addClass("vjs-user-active");
  63689. this.trigger("useractive");
  63690. return;
  63691. }
  63692. if (this.tech_) {
  63693. this.tech_.one("mousemove", function(e) {
  63694. e.stopPropagation();
  63695. e.preventDefault();
  63696. });
  63697. }
  63698. this.userActivity_ = false;
  63699. this.removeClass("vjs-user-active");
  63700. this.addClass("vjs-user-inactive");
  63701. this.trigger("userinactive");
  63702. }
  63703. listenForUserActivity_() {
  63704. let mouseInProgress;
  63705. let lastMoveX;
  63706. let lastMoveY;
  63707. const handleActivity = bind_(this, this.reportUserActivity);
  63708. const handleMouseMove = function(e) {
  63709. if (e.screenX !== lastMoveX || e.screenY !== lastMoveY) {
  63710. lastMoveX = e.screenX;
  63711. lastMoveY = e.screenY;
  63712. handleActivity();
  63713. }
  63714. };
  63715. const handleMouseDown = function() {
  63716. handleActivity();
  63717. this.clearInterval(mouseInProgress);
  63718. mouseInProgress = this.setInterval(handleActivity, 250);
  63719. };
  63720. const handleMouseUpAndMouseLeave = function(event2) {
  63721. handleActivity();
  63722. this.clearInterval(mouseInProgress);
  63723. };
  63724. this.on("mousedown", handleMouseDown);
  63725. this.on("mousemove", handleMouseMove);
  63726. this.on("mouseup", handleMouseUpAndMouseLeave);
  63727. this.on("mouseleave", handleMouseUpAndMouseLeave);
  63728. const controlBar = this.getChild("controlBar");
  63729. if (controlBar && !IS_IOS$1 && !IS_ANDROID$1) {
  63730. controlBar.on("mouseenter", function(event2) {
  63731. if (this.player().options_.inactivityTimeout !== 0) {
  63732. this.player().cache_.inactivityTimeout = this.player().options_.inactivityTimeout;
  63733. }
  63734. this.player().options_.inactivityTimeout = 0;
  63735. });
  63736. controlBar.on("mouseleave", function(event2) {
  63737. this.player().options_.inactivityTimeout = this.player().cache_.inactivityTimeout;
  63738. });
  63739. }
  63740. this.on("keydown", handleActivity);
  63741. this.on("keyup", handleActivity);
  63742. let inactivityTimeout;
  63743. this.setInterval(function() {
  63744. if (!this.userActivity_) {
  63745. return;
  63746. }
  63747. this.userActivity_ = false;
  63748. this.userActive(true);
  63749. this.clearTimeout(inactivityTimeout);
  63750. const timeout = this.options_.inactivityTimeout;
  63751. if (timeout <= 0) {
  63752. return;
  63753. }
  63754. inactivityTimeout = this.setTimeout(function() {
  63755. if (!this.userActivity_) {
  63756. this.userActive(false);
  63757. }
  63758. }, timeout);
  63759. }, 250);
  63760. }
  63761. playbackRate(rate) {
  63762. if (rate !== void 0) {
  63763. this.techCall_("setPlaybackRate", rate);
  63764. return;
  63765. }
  63766. if (this.tech_ && this.tech_.featuresPlaybackRate) {
  63767. return this.cache_.lastPlaybackRate || this.techGet_("playbackRate");
  63768. }
  63769. return 1;
  63770. }
  63771. defaultPlaybackRate(rate) {
  63772. if (rate !== void 0) {
  63773. return this.techCall_("setDefaultPlaybackRate", rate);
  63774. }
  63775. if (this.tech_ && this.tech_.featuresPlaybackRate) {
  63776. return this.techGet_("defaultPlaybackRate");
  63777. }
  63778. return 1;
  63779. }
  63780. isAudio(bool) {
  63781. if (bool !== void 0) {
  63782. this.isAudio_ = !!bool;
  63783. return;
  63784. }
  63785. return !!this.isAudio_;
  63786. }
  63787. enableAudioOnlyUI_() {
  63788. this.addClass("vjs-audio-only-mode");
  63789. const playerChildren = this.children();
  63790. const controlBar = this.getChild("ControlBar");
  63791. const controlBarHeight = controlBar && controlBar.currentHeight();
  63792. playerChildren.forEach((child) => {
  63793. if (child === controlBar) {
  63794. return;
  63795. }
  63796. if (child.el_ && !child.hasClass("vjs-hidden")) {
  63797. child.hide();
  63798. this.audioOnlyCache_.hiddenChildren.push(child);
  63799. }
  63800. });
  63801. this.audioOnlyCache_.playerHeight = this.currentHeight();
  63802. this.height(controlBarHeight);
  63803. this.trigger("audioonlymodechange");
  63804. }
  63805. disableAudioOnlyUI_() {
  63806. this.removeClass("vjs-audio-only-mode");
  63807. this.audioOnlyCache_.hiddenChildren.forEach((child) => child.show());
  63808. this.height(this.audioOnlyCache_.playerHeight);
  63809. this.trigger("audioonlymodechange");
  63810. }
  63811. audioOnlyMode(value) {
  63812. if (typeof value !== "boolean" || value === this.audioOnlyMode_) {
  63813. return this.audioOnlyMode_;
  63814. }
  63815. this.audioOnlyMode_ = value;
  63816. if (value) {
  63817. const exitPromises = [];
  63818. if (this.isInPictureInPicture()) {
  63819. exitPromises.push(this.exitPictureInPicture());
  63820. }
  63821. if (this.isFullscreen()) {
  63822. exitPromises.push(this.exitFullscreen());
  63823. }
  63824. if (this.audioPosterMode()) {
  63825. exitPromises.push(this.audioPosterMode(false));
  63826. }
  63827. return Promise.all(exitPromises).then(() => this.enableAudioOnlyUI_());
  63828. }
  63829. return Promise.resolve().then(() => this.disableAudioOnlyUI_());
  63830. }
  63831. enablePosterModeUI_() {
  63832. const tech = this.tech_ && this.tech_;
  63833. tech.hide();
  63834. this.addClass("vjs-audio-poster-mode");
  63835. this.trigger("audiopostermodechange");
  63836. }
  63837. disablePosterModeUI_() {
  63838. const tech = this.tech_ && this.tech_;
  63839. tech.show();
  63840. this.removeClass("vjs-audio-poster-mode");
  63841. this.trigger("audiopostermodechange");
  63842. }
  63843. audioPosterMode(value) {
  63844. if (typeof value !== "boolean" || value === this.audioPosterMode_) {
  63845. return this.audioPosterMode_;
  63846. }
  63847. this.audioPosterMode_ = value;
  63848. if (value) {
  63849. if (this.audioOnlyMode()) {
  63850. const audioOnlyModePromise = this.audioOnlyMode(false);
  63851. return audioOnlyModePromise.then(() => {
  63852. this.enablePosterModeUI_();
  63853. });
  63854. }
  63855. return Promise.resolve().then(() => {
  63856. this.enablePosterModeUI_();
  63857. });
  63858. }
  63859. return Promise.resolve().then(() => {
  63860. this.disablePosterModeUI_();
  63861. });
  63862. }
  63863. addTextTrack(kind, label, language) {
  63864. if (this.tech_) {
  63865. return this.tech_.addTextTrack(kind, label, language);
  63866. }
  63867. }
  63868. addRemoteTextTrack(options2, manualCleanup) {
  63869. if (this.tech_) {
  63870. return this.tech_.addRemoteTextTrack(options2, manualCleanup);
  63871. }
  63872. }
  63873. removeRemoteTextTrack(obj = {}) {
  63874. let {
  63875. track
  63876. } = obj;
  63877. if (!track) {
  63878. track = obj;
  63879. }
  63880. if (this.tech_) {
  63881. return this.tech_.removeRemoteTextTrack(track);
  63882. }
  63883. }
  63884. getVideoPlaybackQuality() {
  63885. return this.techGet_("getVideoPlaybackQuality");
  63886. }
  63887. videoWidth() {
  63888. return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0;
  63889. }
  63890. videoHeight() {
  63891. return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0;
  63892. }
  63893. language(code) {
  63894. if (code === void 0) {
  63895. return this.language_;
  63896. }
  63897. if (this.language_ !== String(code).toLowerCase()) {
  63898. this.language_ = String(code).toLowerCase();
  63899. if (isEvented$1(this)) {
  63900. this.trigger("languagechange");
  63901. }
  63902. }
  63903. }
  63904. languages() {
  63905. return merge$1(Player$1.prototype.options_.languages, this.languages_);
  63906. }
  63907. toJSON() {
  63908. const options2 = merge$1(this.options_);
  63909. const tracks = options2.tracks;
  63910. options2.tracks = [];
  63911. for (let i2 = 0; i2 < tracks.length; i2++) {
  63912. let track = tracks[i2];
  63913. track = merge$1(track);
  63914. track.player = void 0;
  63915. options2.tracks[i2] = track;
  63916. }
  63917. return options2;
  63918. }
  63919. createModal(content, options2) {
  63920. options2 = options2 || {};
  63921. options2.content = content || "";
  63922. const modal = new ModalDialog$1(this, options2);
  63923. this.addChild(modal);
  63924. modal.on("dispose", () => {
  63925. this.removeChild(modal);
  63926. });
  63927. modal.open();
  63928. return modal;
  63929. }
  63930. updateCurrentBreakpoint_() {
  63931. if (!this.responsive()) {
  63932. return;
  63933. }
  63934. const currentBreakpoint = this.currentBreakpoint();
  63935. const currentWidth = this.currentWidth();
  63936. for (let i2 = 0; i2 < BREAKPOINT_ORDER$1.length; i2++) {
  63937. const candidateBreakpoint = BREAKPOINT_ORDER$1[i2];
  63938. const maxWidth = this.breakpoints_[candidateBreakpoint];
  63939. if (currentWidth <= maxWidth) {
  63940. if (currentBreakpoint === candidateBreakpoint) {
  63941. return;
  63942. }
  63943. if (currentBreakpoint) {
  63944. this.removeClass(BREAKPOINT_CLASSES$1[currentBreakpoint]);
  63945. }
  63946. this.addClass(BREAKPOINT_CLASSES$1[candidateBreakpoint]);
  63947. this.breakpoint_ = candidateBreakpoint;
  63948. break;
  63949. }
  63950. }
  63951. }
  63952. removeCurrentBreakpoint_() {
  63953. const className = this.currentBreakpointClass();
  63954. this.breakpoint_ = "";
  63955. if (className) {
  63956. this.removeClass(className);
  63957. }
  63958. }
  63959. breakpoints(breakpoints) {
  63960. if (breakpoints === void 0) {
  63961. return Object.assign(this.breakpoints_);
  63962. }
  63963. this.breakpoint_ = "";
  63964. this.breakpoints_ = Object.assign({}, DEFAULT_BREAKPOINTS$1, breakpoints);
  63965. this.updateCurrentBreakpoint_();
  63966. return Object.assign(this.breakpoints_);
  63967. }
  63968. responsive(value) {
  63969. if (value === void 0) {
  63970. return this.responsive_;
  63971. }
  63972. value = Boolean(value);
  63973. const current = this.responsive_;
  63974. if (value === current) {
  63975. return;
  63976. }
  63977. this.responsive_ = value;
  63978. if (value) {
  63979. this.on("playerresize", this.boundUpdateCurrentBreakpoint_);
  63980. this.updateCurrentBreakpoint_();
  63981. } else {
  63982. this.off("playerresize", this.boundUpdateCurrentBreakpoint_);
  63983. this.removeCurrentBreakpoint_();
  63984. }
  63985. return value;
  63986. }
  63987. currentBreakpoint() {
  63988. return this.breakpoint_;
  63989. }
  63990. currentBreakpointClass() {
  63991. return BREAKPOINT_CLASSES$1[this.breakpoint_] || "";
  63992. }
  63993. loadMedia(media, ready) {
  63994. if (!media || typeof media !== "object") {
  63995. return;
  63996. }
  63997. this.reset();
  63998. this.cache_.media = merge$1(media);
  63999. const {
  64000. artist,
  64001. artwork,
  64002. description,
  64003. poster,
  64004. src,
  64005. textTracks,
  64006. title
  64007. } = this.cache_.media;
  64008. if (!artwork && poster) {
  64009. this.cache_.media.artwork = [{
  64010. src: poster,
  64011. type: getMimetype$1(poster)
  64012. }];
  64013. }
  64014. if (src) {
  64015. this.src(src);
  64016. }
  64017. if (poster) {
  64018. this.poster(poster);
  64019. }
  64020. if (Array.isArray(textTracks)) {
  64021. textTracks.forEach((tt2) => this.addRemoteTextTrack(tt2, false));
  64022. }
  64023. if (this.titleBar) {
  64024. this.titleBar.update({
  64025. title,
  64026. description: description || artist || ""
  64027. });
  64028. }
  64029. this.ready(ready);
  64030. }
  64031. getMedia() {
  64032. if (!this.cache_.media) {
  64033. const poster = this.poster();
  64034. const src = this.currentSources();
  64035. const textTracks = Array.prototype.map.call(this.remoteTextTracks(), (tt2) => ({
  64036. kind: tt2.kind,
  64037. label: tt2.label,
  64038. language: tt2.language,
  64039. src: tt2.src
  64040. }));
  64041. const media = {
  64042. src,
  64043. textTracks
  64044. };
  64045. if (poster) {
  64046. media.poster = poster;
  64047. media.artwork = [{
  64048. src: media.poster,
  64049. type: getMimetype$1(media.poster)
  64050. }];
  64051. }
  64052. return media;
  64053. }
  64054. return merge$1(this.cache_.media);
  64055. }
  64056. static getTagSettings(tag) {
  64057. const baseOptions = {
  64058. sources: [],
  64059. tracks: []
  64060. };
  64061. const tagOptions = getAttributes$1(tag);
  64062. const dataSetup = tagOptions["data-setup"];
  64063. if (hasClass$1(tag, "vjs-fill")) {
  64064. tagOptions.fill = true;
  64065. }
  64066. if (hasClass$1(tag, "vjs-fluid")) {
  64067. tagOptions.fluid = true;
  64068. }
  64069. if (dataSetup !== null) {
  64070. const [err, data] = tuple(dataSetup || "{}");
  64071. if (err) {
  64072. log$1$1.error(err);
  64073. }
  64074. Object.assign(tagOptions, data);
  64075. }
  64076. Object.assign(baseOptions, tagOptions);
  64077. if (tag.hasChildNodes()) {
  64078. const children = tag.childNodes;
  64079. for (let i2 = 0, j = children.length; i2 < j; i2++) {
  64080. const child = children[i2];
  64081. const childName = child.nodeName.toLowerCase();
  64082. if (childName === "source") {
  64083. baseOptions.sources.push(getAttributes$1(child));
  64084. } else if (childName === "track") {
  64085. baseOptions.tracks.push(getAttributes$1(child));
  64086. }
  64087. }
  64088. }
  64089. return baseOptions;
  64090. }
  64091. debug(enabled) {
  64092. if (enabled === void 0) {
  64093. return this.debugEnabled_;
  64094. }
  64095. if (enabled) {
  64096. this.trigger("debugon");
  64097. this.previousLogLevel_ = this.log.level;
  64098. this.log.level("debug");
  64099. this.debugEnabled_ = true;
  64100. } else {
  64101. this.trigger("debugoff");
  64102. this.log.level(this.previousLogLevel_);
  64103. this.previousLogLevel_ = void 0;
  64104. this.debugEnabled_ = false;
  64105. }
  64106. }
  64107. playbackRates(newRates) {
  64108. if (newRates === void 0) {
  64109. return this.cache_.playbackRates;
  64110. }
  64111. if (!Array.isArray(newRates)) {
  64112. return;
  64113. }
  64114. if (!newRates.every((rate) => typeof rate === "number")) {
  64115. return;
  64116. }
  64117. this.cache_.playbackRates = newRates;
  64118. this.trigger("playbackrateschange");
  64119. }
  64120. }
  64121. ALL$1.names.forEach(function(name) {
  64122. const props = ALL$1[name];
  64123. Player$1.prototype[props.getterName] = function() {
  64124. if (this.tech_) {
  64125. return this.tech_[props.getterName]();
  64126. }
  64127. this[props.privateName] = this[props.privateName] || new props.ListClass();
  64128. return this[props.privateName];
  64129. };
  64130. });
  64131. Player$1.prototype.crossorigin = Player$1.prototype.crossOrigin;
  64132. Player$1.players = {};
  64133. const navigator$3 = window_1.navigator;
  64134. Player$1.prototype.options_ = {
  64135. techOrder: Tech$2.defaultTechOrder_,
  64136. html5: {},
  64137. enableSourceset: true,
  64138. inactivityTimeout: 2e3,
  64139. playbackRates: [],
  64140. liveui: false,
  64141. children: ["mediaLoader", "posterImage", "titleBar", "textTrackDisplay", "loadingSpinner", "bigPlayButton", "liveTracker", "controlBar", "errorDisplay", "textTrackSettings", "resizeManager"],
  64142. language: navigator$3 && (navigator$3.languages && navigator$3.languages[0] || navigator$3.userLanguage || navigator$3.language) || "en",
  64143. languages: {},
  64144. notSupportedMessage: "No compatible source was found for this media.",
  64145. normalizeAutoplay: false,
  64146. fullscreen: {
  64147. options: {
  64148. navigationUI: "hide"
  64149. }
  64150. },
  64151. breakpoints: {},
  64152. responsive: false,
  64153. audioOnlyMode: false,
  64154. audioPosterMode: false
  64155. };
  64156. [
  64157. "ended",
  64158. "seeking",
  64159. "seekable",
  64160. "networkState",
  64161. "readyState"
  64162. ].forEach(function(fn2) {
  64163. Player$1.prototype[fn2] = function() {
  64164. return this.techGet_(fn2);
  64165. };
  64166. });
  64167. TECH_EVENTS_RETRIGGER$1.forEach(function(event2) {
  64168. Player$1.prototype[`handleTech${toTitleCase$1$1(event2)}_`] = function() {
  64169. return this.trigger(event2);
  64170. };
  64171. });
  64172. Component$1$1.registerComponent("Player", Player$1);
  64173. const BASE_PLUGIN_NAME$1 = "plugin";
  64174. const PLUGIN_CACHE_KEY$1 = "activePlugins_";
  64175. const pluginStorage$1 = {};
  64176. const pluginExists$1 = (name) => pluginStorage$1.hasOwnProperty(name);
  64177. const getPlugin$1 = (name) => pluginExists$1(name) ? pluginStorage$1[name] : void 0;
  64178. const markPluginAsActive$1 = (player, name) => {
  64179. player[PLUGIN_CACHE_KEY$1] = player[PLUGIN_CACHE_KEY$1] || {};
  64180. player[PLUGIN_CACHE_KEY$1][name] = true;
  64181. };
  64182. const triggerSetupEvent$1 = (player, hash, before) => {
  64183. const eventName = (before ? "before" : "") + "pluginsetup";
  64184. player.trigger(eventName, hash);
  64185. player.trigger(eventName + ":" + hash.name, hash);
  64186. };
  64187. const createBasicPlugin$1 = function(name, plugin) {
  64188. const basicPluginWrapper = function() {
  64189. triggerSetupEvent$1(this, {
  64190. name,
  64191. plugin,
  64192. instance: null
  64193. }, true);
  64194. const instance = plugin.apply(this, arguments);
  64195. markPluginAsActive$1(this, name);
  64196. triggerSetupEvent$1(this, {
  64197. name,
  64198. plugin,
  64199. instance
  64200. });
  64201. return instance;
  64202. };
  64203. Object.keys(plugin).forEach(function(prop) {
  64204. basicPluginWrapper[prop] = plugin[prop];
  64205. });
  64206. return basicPluginWrapper;
  64207. };
  64208. const createPluginFactory$1 = (name, PluginSubClass) => {
  64209. PluginSubClass.prototype.name = name;
  64210. return function(...args) {
  64211. triggerSetupEvent$1(this, {
  64212. name,
  64213. plugin: PluginSubClass,
  64214. instance: null
  64215. }, true);
  64216. const instance = new PluginSubClass(...[this, ...args]);
  64217. this[name] = () => instance;
  64218. triggerSetupEvent$1(this, instance.getEventHash());
  64219. return instance;
  64220. };
  64221. };
  64222. class Plugin$1 {
  64223. constructor(player) {
  64224. if (this.constructor === Plugin$1) {
  64225. throw new Error("Plugin must be sub-classed; not directly instantiated.");
  64226. }
  64227. this.player = player;
  64228. if (!this.log) {
  64229. this.log = this.player.log.createLogger(this.name);
  64230. }
  64231. evented$1(this);
  64232. delete this.trigger;
  64233. stateful$1(this, this.constructor.defaultState);
  64234. markPluginAsActive$1(player, this.name);
  64235. this.dispose = this.dispose.bind(this);
  64236. player.on("dispose", this.dispose);
  64237. }
  64238. version() {
  64239. return this.constructor.VERSION;
  64240. }
  64241. getEventHash(hash = {}) {
  64242. hash.name = this.name;
  64243. hash.plugin = this.constructor;
  64244. hash.instance = this;
  64245. return hash;
  64246. }
  64247. trigger(event2, hash = {}) {
  64248. return trigger$1(this.eventBusEl_, event2, this.getEventHash(hash));
  64249. }
  64250. handleStateChanged(e) {
  64251. }
  64252. dispose() {
  64253. const {
  64254. name,
  64255. player
  64256. } = this;
  64257. this.trigger("dispose");
  64258. this.off();
  64259. player.off("dispose", this.dispose);
  64260. player[PLUGIN_CACHE_KEY$1][name] = false;
  64261. this.player = this.state = null;
  64262. player[name] = createPluginFactory$1(name, pluginStorage$1[name]);
  64263. }
  64264. static isBasic(plugin) {
  64265. const p = typeof plugin === "string" ? getPlugin$1(plugin) : plugin;
  64266. return typeof p === "function" && !Plugin$1.prototype.isPrototypeOf(p.prototype);
  64267. }
  64268. static registerPlugin(name, plugin) {
  64269. if (typeof name !== "string") {
  64270. throw new Error(`Illegal plugin name, "${name}", must be a string, was ${typeof name}.`);
  64271. }
  64272. if (pluginExists$1(name)) {
  64273. log$1$1.warn(`A plugin named "${name}" already exists. You may want to avoid re-registering plugins!`);
  64274. } else if (Player$1.prototype.hasOwnProperty(name)) {
  64275. throw new Error(`Illegal plugin name, "${name}", cannot share a name with an existing player method!`);
  64276. }
  64277. if (typeof plugin !== "function") {
  64278. throw new Error(`Illegal plugin for "${name}", must be a function, was ${typeof plugin}.`);
  64279. }
  64280. pluginStorage$1[name] = plugin;
  64281. if (name !== BASE_PLUGIN_NAME$1) {
  64282. if (Plugin$1.isBasic(plugin)) {
  64283. Player$1.prototype[name] = createBasicPlugin$1(name, plugin);
  64284. } else {
  64285. Player$1.prototype[name] = createPluginFactory$1(name, plugin);
  64286. }
  64287. }
  64288. return plugin;
  64289. }
  64290. static deregisterPlugin(name) {
  64291. if (name === BASE_PLUGIN_NAME$1) {
  64292. throw new Error("Cannot de-register base plugin.");
  64293. }
  64294. if (pluginExists$1(name)) {
  64295. delete pluginStorage$1[name];
  64296. delete Player$1.prototype[name];
  64297. }
  64298. }
  64299. static getPlugins(names2 = Object.keys(pluginStorage$1)) {
  64300. let result;
  64301. names2.forEach((name) => {
  64302. const plugin = getPlugin$1(name);
  64303. if (plugin) {
  64304. result = result || {};
  64305. result[name] = plugin;
  64306. }
  64307. });
  64308. return result;
  64309. }
  64310. static getPluginVersion(name) {
  64311. const plugin = getPlugin$1(name);
  64312. return plugin && plugin.VERSION || "";
  64313. }
  64314. }
  64315. Plugin$1.getPlugin = getPlugin$1;
  64316. Plugin$1.BASE_PLUGIN_NAME = BASE_PLUGIN_NAME$1;
  64317. Plugin$1.registerPlugin(BASE_PLUGIN_NAME$1, Plugin$1);
  64318. Player$1.prototype.usingPlugin = function(name) {
  64319. return !!this[PLUGIN_CACHE_KEY$1] && this[PLUGIN_CACHE_KEY$1][name] === true;
  64320. };
  64321. Player$1.prototype.hasPlugin = function(name) {
  64322. return !!pluginExists$1(name);
  64323. };
  64324. function deprecate(message, fn2) {
  64325. let warned = false;
  64326. return function(...args) {
  64327. if (!warned) {
  64328. log$1$1.warn(message);
  64329. }
  64330. warned = true;
  64331. return fn2.apply(this, args);
  64332. };
  64333. }
  64334. function deprecateForMajor(major, oldName, newName, fn2) {
  64335. return deprecate(`${oldName} is deprecated and will be removed in ${major}.0; please use ${newName} instead.`, fn2);
  64336. }
  64337. const normalizeId$1 = (id) => id.indexOf("#") === 0 ? id.slice(1) : id;
  64338. function videojs$2(id, options2, ready) {
  64339. let player = videojs$2.getPlayer(id);
  64340. if (player) {
  64341. if (options2) {
  64342. log$1$1.warn(`Player "${id}" is already initialised. Options will not be applied.`);
  64343. }
  64344. if (ready) {
  64345. player.ready(ready);
  64346. }
  64347. return player;
  64348. }
  64349. const el = typeof id === "string" ? $$1("#" + normalizeId$1(id)) : id;
  64350. if (!isEl$1(el)) {
  64351. throw new TypeError("The element or ID supplied is not valid. (videojs)");
  64352. }
  64353. if (!el.ownerDocument.defaultView || !el.ownerDocument.body.contains(el)) {
  64354. log$1$1.warn("The element supplied is not included in the DOM");
  64355. }
  64356. options2 = options2 || {};
  64357. if (options2.restoreEl === true) {
  64358. options2.restoreEl = (el.parentNode && el.parentNode.hasAttribute("data-vjs-player") ? el.parentNode : el).cloneNode(true);
  64359. }
  64360. hooks$1("beforesetup").forEach((hookFunction) => {
  64361. const opts = hookFunction(el, merge$1(options2));
  64362. if (!isObject$2(opts) || Array.isArray(opts)) {
  64363. log$1$1.error("please return an object in beforesetup hooks");
  64364. return;
  64365. }
  64366. options2 = merge$1(options2, opts);
  64367. });
  64368. const PlayerComponent = Component$1$1.getComponent("Player");
  64369. player = new PlayerComponent(el, options2, ready);
  64370. hooks$1("setup").forEach((hookFunction) => hookFunction(player));
  64371. return player;
  64372. }
  64373. videojs$2.hooks_ = hooks_$1;
  64374. videojs$2.hooks = hooks$1;
  64375. videojs$2.hook = hook$1;
  64376. videojs$2.hookOnce = hookOnce$1;
  64377. videojs$2.removeHook = removeHook$1;
  64378. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE !== true && isReal$1()) {
  64379. let style = $$1(".vjs-styles-defaults");
  64380. if (!style) {
  64381. style = createStyleElement$1("vjs-styles-defaults");
  64382. const head = $$1("head");
  64383. if (head) {
  64384. head.insertBefore(style, head.firstChild);
  64385. }
  64386. setTextContent$1(style, `
  64387. .video-js {
  64388. width: 300px;
  64389. height: 150px;
  64390. }
  64391. .vjs-fluid:not(.vjs-audio-only-mode) {
  64392. padding-top: 56.25%
  64393. }
  64394. `);
  64395. }
  64396. }
  64397. autoSetupTimeout$1(1, videojs$2);
  64398. videojs$2.VERSION = version$6$1;
  64399. videojs$2.options = Player$1.prototype.options_;
  64400. videojs$2.getPlayers = () => Player$1.players;
  64401. videojs$2.getPlayer = (id) => {
  64402. const players = Player$1.players;
  64403. let tag;
  64404. if (typeof id === "string") {
  64405. const nId = normalizeId$1(id);
  64406. const player = players[nId];
  64407. if (player) {
  64408. return player;
  64409. }
  64410. tag = $$1("#" + nId);
  64411. } else {
  64412. tag = id;
  64413. }
  64414. if (isEl$1(tag)) {
  64415. const {
  64416. player,
  64417. playerId
  64418. } = tag;
  64419. if (player || players[playerId]) {
  64420. return player || players[playerId];
  64421. }
  64422. }
  64423. };
  64424. videojs$2.getAllPlayers = () => Object.keys(Player$1.players).map((k) => Player$1.players[k]).filter(Boolean);
  64425. videojs$2.players = Player$1.players;
  64426. videojs$2.getComponent = Component$1$1.getComponent;
  64427. videojs$2.registerComponent = (name, comp) => {
  64428. if (Tech$2.isTech(comp)) {
  64429. log$1$1.warn(`The ${name} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`);
  64430. }
  64431. Component$1$1.registerComponent.call(Component$1$1, name, comp);
  64432. };
  64433. videojs$2.getTech = Tech$2.getTech;
  64434. videojs$2.registerTech = Tech$2.registerTech;
  64435. videojs$2.use = use$1;
  64436. Object.defineProperty(videojs$2, "middleware", {
  64437. value: {},
  64438. writeable: false,
  64439. enumerable: true
  64440. });
  64441. Object.defineProperty(videojs$2.middleware, "TERMINATOR", {
  64442. value: TERMINATOR$1,
  64443. writeable: false,
  64444. enumerable: true
  64445. });
  64446. videojs$2.browser = browser$1;
  64447. videojs$2.obj = Obj;
  64448. videojs$2.mergeOptions = deprecateForMajor(9, "videojs.mergeOptions", "videojs.obj.merge", merge$1);
  64449. videojs$2.defineLazyProperty = deprecateForMajor(9, "videojs.defineLazyProperty", "videojs.obj.defineLazyProperty", defineLazyProperty$1);
  64450. videojs$2.bind = deprecateForMajor(9, "videojs.bind", "native Function.prototype.bind", bind_);
  64451. videojs$2.registerPlugin = Plugin$1.registerPlugin;
  64452. videojs$2.deregisterPlugin = Plugin$1.deregisterPlugin;
  64453. videojs$2.plugin = (name, plugin) => {
  64454. log$1$1.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");
  64455. return Plugin$1.registerPlugin(name, plugin);
  64456. };
  64457. videojs$2.getPlugins = Plugin$1.getPlugins;
  64458. videojs$2.getPlugin = Plugin$1.getPlugin;
  64459. videojs$2.getPluginVersion = Plugin$1.getPluginVersion;
  64460. videojs$2.addLanguage = function(code, data) {
  64461. code = ("" + code).toLowerCase();
  64462. videojs$2.options.languages = merge$1(videojs$2.options.languages, {
  64463. [code]: data
  64464. });
  64465. return videojs$2.options.languages[code];
  64466. };
  64467. videojs$2.log = log$1$1;
  64468. videojs$2.createLogger = createLogger$2;
  64469. videojs$2.time = Time;
  64470. videojs$2.createTimeRange = deprecateForMajor(9, "videojs.createTimeRange", "videojs.time.createTimeRanges", createTimeRanges$1);
  64471. videojs$2.createTimeRanges = deprecateForMajor(9, "videojs.createTimeRanges", "videojs.time.createTimeRanges", createTimeRanges$1);
  64472. videojs$2.formatTime = deprecateForMajor(9, "videojs.formatTime", "videojs.time.formatTime", formatTime$1);
  64473. videojs$2.setFormatTime = deprecateForMajor(9, "videojs.setFormatTime", "videojs.time.setFormatTime", setFormatTime$1);
  64474. videojs$2.resetFormatTime = deprecateForMajor(9, "videojs.resetFormatTime", "videojs.time.resetFormatTime", resetFormatTime$1);
  64475. videojs$2.parseUrl = deprecateForMajor(9, "videojs.parseUrl", "videojs.url.parseUrl", parseUrl$1);
  64476. videojs$2.isCrossOrigin = deprecateForMajor(9, "videojs.isCrossOrigin", "videojs.url.isCrossOrigin", isCrossOrigin$1);
  64477. videojs$2.EventTarget = EventTarget$2$1;
  64478. videojs$2.any = any$1;
  64479. videojs$2.on = on$1;
  64480. videojs$2.one = one$1;
  64481. videojs$2.off = off$1;
  64482. videojs$2.trigger = trigger$1;
  64483. videojs$2.xhr = XHR;
  64484. videojs$2.TextTrack = TextTrack$1;
  64485. videojs$2.AudioTrack = AudioTrack$1;
  64486. videojs$2.VideoTrack = VideoTrack$1;
  64487. ["isEl", "isTextNode", "createEl", "hasClass", "addClass", "removeClass", "toggleClass", "setAttributes", "getAttributes", "emptyEl", "appendContent", "insertContent"].forEach((k) => {
  64488. videojs$2[k] = function() {
  64489. log$1$1.warn(`videojs.${k}() is deprecated; use videojs.dom.${k}() instead`);
  64490. return Dom$2[k].apply(null, arguments);
  64491. };
  64492. });
  64493. videojs$2.computedStyle = deprecateForMajor(9, "videojs.computedStyle", "videojs.dom.computedStyle", computedStyle$1);
  64494. videojs$2.dom = Dom$2;
  64495. videojs$2.fn = Fn;
  64496. videojs$2.num = Num;
  64497. videojs$2.str = Str;
  64498. videojs$2.url = Url$2;
  64499. /*! @name videojs-contrib-quality-levels @version 3.0.0 @license Apache-2.0 */
  64500. class QualityLevel {
  64501. constructor(representation) {
  64502. let level = this;
  64503. level.id = representation.id;
  64504. level.label = level.id;
  64505. level.width = representation.width;
  64506. level.height = representation.height;
  64507. level.bitrate = representation.bandwidth;
  64508. level.frameRate = representation.frameRate;
  64509. level.enabled_ = representation.enabled;
  64510. Object.defineProperty(level, "enabled", {
  64511. get() {
  64512. return level.enabled_();
  64513. },
  64514. set(enable) {
  64515. level.enabled_(enable);
  64516. }
  64517. });
  64518. return level;
  64519. }
  64520. }
  64521. class QualityLevelList extends videojs$2.EventTarget {
  64522. constructor() {
  64523. super();
  64524. let list = this;
  64525. list.levels_ = [];
  64526. list.selectedIndex_ = -1;
  64527. Object.defineProperty(list, "selectedIndex", {
  64528. get() {
  64529. return list.selectedIndex_;
  64530. }
  64531. });
  64532. Object.defineProperty(list, "length", {
  64533. get() {
  64534. return list.levels_.length;
  64535. }
  64536. });
  64537. return list;
  64538. }
  64539. addQualityLevel(representation) {
  64540. let qualityLevel = this.getQualityLevelById(representation.id);
  64541. if (qualityLevel) {
  64542. return qualityLevel;
  64543. }
  64544. const index2 = this.levels_.length;
  64545. qualityLevel = new QualityLevel(representation);
  64546. if (!("" + index2 in this)) {
  64547. Object.defineProperty(this, index2, {
  64548. get() {
  64549. return this.levels_[index2];
  64550. }
  64551. });
  64552. }
  64553. this.levels_.push(qualityLevel);
  64554. this.trigger({
  64555. qualityLevel,
  64556. type: "addqualitylevel"
  64557. });
  64558. return qualityLevel;
  64559. }
  64560. removeQualityLevel(qualityLevel) {
  64561. let removed = null;
  64562. for (let i2 = 0, l = this.length; i2 < l; i2++) {
  64563. if (this[i2] === qualityLevel) {
  64564. removed = this.levels_.splice(i2, 1)[0];
  64565. if (this.selectedIndex_ === i2) {
  64566. this.selectedIndex_ = -1;
  64567. } else if (this.selectedIndex_ > i2) {
  64568. this.selectedIndex_--;
  64569. }
  64570. break;
  64571. }
  64572. }
  64573. if (removed) {
  64574. this.trigger({
  64575. qualityLevel,
  64576. type: "removequalitylevel"
  64577. });
  64578. }
  64579. return removed;
  64580. }
  64581. getQualityLevelById(id) {
  64582. for (let i2 = 0, l = this.length; i2 < l; i2++) {
  64583. const level = this[i2];
  64584. if (level.id === id) {
  64585. return level;
  64586. }
  64587. }
  64588. return null;
  64589. }
  64590. dispose() {
  64591. this.selectedIndex_ = -1;
  64592. this.levels_.length = 0;
  64593. }
  64594. }
  64595. QualityLevelList.prototype.allowedEvents_ = {
  64596. change: "change",
  64597. addqualitylevel: "addqualitylevel",
  64598. removequalitylevel: "removequalitylevel"
  64599. };
  64600. for (const event2 in QualityLevelList.prototype.allowedEvents_) {
  64601. QualityLevelList.prototype["on" + event2] = null;
  64602. }
  64603. var version$5$1 = "3.0.0";
  64604. const registerPlugin$1 = videojs$2.registerPlugin || videojs$2.plugin;
  64605. const initPlugin$1 = function(player, options2) {
  64606. const originalPluginFn = player.qualityLevels;
  64607. const qualityLevelList = new QualityLevelList();
  64608. const disposeHandler = function() {
  64609. qualityLevelList.dispose();
  64610. player.qualityLevels = originalPluginFn;
  64611. player.off("dispose", disposeHandler);
  64612. };
  64613. player.on("dispose", disposeHandler);
  64614. player.qualityLevels = () => qualityLevelList;
  64615. player.qualityLevels.VERSION = version$5$1;
  64616. return qualityLevelList;
  64617. };
  64618. const qualityLevels = function(options2) {
  64619. return initPlugin$1(this, videojs$2.mergeOptions({}, options2));
  64620. };
  64621. registerPlugin$1("qualityLevels", qualityLevels);
  64622. qualityLevels.VERSION = version$5$1;
  64623. /*! @name @videojs/http-streaming @version 3.0.2 @license Apache-2.0 */
  64624. const resolveUrl$2 = resolveUrl$4;
  64625. const resolveManifestRedirect$1 = (url, req) => {
  64626. if (req && req.responseURL && url !== req.responseURL) {
  64627. return req.responseURL;
  64628. }
  64629. return url;
  64630. };
  64631. const logger$1 = (source) => {
  64632. if (videojs$2.log.debug) {
  64633. return videojs$2.log.debug.bind(videojs$2, "VHS:", `${source} >`);
  64634. }
  64635. return function() {
  64636. };
  64637. };
  64638. function merge$2(...args) {
  64639. const context = videojs$2.obj || videojs$2;
  64640. const fn2 = context.merge || context.mergeOptions;
  64641. return fn2.apply(context, args);
  64642. }
  64643. function createTimeRanges$2(...args) {
  64644. const context = videojs$2.time || videojs$2;
  64645. const fn2 = context.createTimeRanges || context.createTimeRanges;
  64646. return fn2.apply(context, args);
  64647. }
  64648. const TIME_FUDGE_FACTOR$1 = 1 / 30;
  64649. const SAFE_TIME_DELTA$1 = TIME_FUDGE_FACTOR$1 * 3;
  64650. const filterRanges$1 = function(timeRanges, predicate) {
  64651. const results = [];
  64652. let i2;
  64653. if (timeRanges && timeRanges.length) {
  64654. for (i2 = 0; i2 < timeRanges.length; i2++) {
  64655. if (predicate(timeRanges.start(i2), timeRanges.end(i2))) {
  64656. results.push([timeRanges.start(i2), timeRanges.end(i2)]);
  64657. }
  64658. }
  64659. }
  64660. return createTimeRanges$2(results);
  64661. };
  64662. const findRange$1 = function(buffered, time) {
  64663. return filterRanges$1(buffered, function(start2, end) {
  64664. return start2 - SAFE_TIME_DELTA$1 <= time && end + SAFE_TIME_DELTA$1 >= time;
  64665. });
  64666. };
  64667. const findNextRange$1 = function(timeRanges, time) {
  64668. return filterRanges$1(timeRanges, function(start2) {
  64669. return start2 - TIME_FUDGE_FACTOR$1 >= time;
  64670. });
  64671. };
  64672. const findGaps$1 = function(buffered) {
  64673. if (buffered.length < 2) {
  64674. return createTimeRanges$2();
  64675. }
  64676. const ranges = [];
  64677. for (let i2 = 1; i2 < buffered.length; i2++) {
  64678. const start2 = buffered.end(i2 - 1);
  64679. const end = buffered.start(i2);
  64680. ranges.push([start2, end]);
  64681. }
  64682. return createTimeRanges$2(ranges);
  64683. };
  64684. const bufferIntersection$1 = function(bufferA, bufferB) {
  64685. let start2 = null;
  64686. let end = null;
  64687. let arity = 0;
  64688. const extents = [];
  64689. const ranges = [];
  64690. if (!bufferA || !bufferA.length || !bufferB || !bufferB.length) {
  64691. return createTimeRanges$2();
  64692. }
  64693. let count = bufferA.length;
  64694. while (count--) {
  64695. extents.push({
  64696. time: bufferA.start(count),
  64697. type: "start"
  64698. });
  64699. extents.push({
  64700. time: bufferA.end(count),
  64701. type: "end"
  64702. });
  64703. }
  64704. count = bufferB.length;
  64705. while (count--) {
  64706. extents.push({
  64707. time: bufferB.start(count),
  64708. type: "start"
  64709. });
  64710. extents.push({
  64711. time: bufferB.end(count),
  64712. type: "end"
  64713. });
  64714. }
  64715. extents.sort(function(a, b) {
  64716. return a.time - b.time;
  64717. });
  64718. for (count = 0; count < extents.length; count++) {
  64719. if (extents[count].type === "start") {
  64720. arity++;
  64721. if (arity === 2) {
  64722. start2 = extents[count].time;
  64723. }
  64724. } else if (extents[count].type === "end") {
  64725. arity--;
  64726. if (arity === 1) {
  64727. end = extents[count].time;
  64728. }
  64729. }
  64730. if (start2 !== null && end !== null) {
  64731. ranges.push([start2, end]);
  64732. start2 = null;
  64733. end = null;
  64734. }
  64735. }
  64736. return createTimeRanges$2(ranges);
  64737. };
  64738. const printableRange$1 = (range3) => {
  64739. const strArr = [];
  64740. if (!range3 || !range3.length) {
  64741. return "";
  64742. }
  64743. for (let i2 = 0; i2 < range3.length; i2++) {
  64744. strArr.push(range3.start(i2) + " => " + range3.end(i2));
  64745. }
  64746. return strArr.join(", ");
  64747. };
  64748. const timeUntilRebuffer$1 = function(buffered, currentTime, playbackRate = 1) {
  64749. const bufferedEnd = buffered.length ? buffered.end(buffered.length - 1) : 0;
  64750. return (bufferedEnd - currentTime) / playbackRate;
  64751. };
  64752. const timeRangesToArray$1 = (timeRanges) => {
  64753. const timeRangesList = [];
  64754. for (let i2 = 0; i2 < timeRanges.length; i2++) {
  64755. timeRangesList.push({
  64756. start: timeRanges.start(i2),
  64757. end: timeRanges.end(i2)
  64758. });
  64759. }
  64760. return timeRangesList;
  64761. };
  64762. const isRangeDifferent$1 = function(a, b) {
  64763. if (a === b) {
  64764. return false;
  64765. }
  64766. if (!a && b || !b && a) {
  64767. return true;
  64768. }
  64769. if (a.length !== b.length) {
  64770. return true;
  64771. }
  64772. for (let i2 = 0; i2 < a.length; i2++) {
  64773. if (a.start(i2) !== b.start(i2) || a.end(i2) !== b.end(i2)) {
  64774. return true;
  64775. }
  64776. }
  64777. return false;
  64778. };
  64779. const lastBufferedEnd$1 = function(a) {
  64780. if (!a || !a.length || !a.end) {
  64781. return;
  64782. }
  64783. return a.end(a.length - 1);
  64784. };
  64785. const timeAheadOf$1 = function(range3, startTime) {
  64786. let time = 0;
  64787. if (!range3 || !range3.length) {
  64788. return time;
  64789. }
  64790. for (let i2 = 0; i2 < range3.length; i2++) {
  64791. const start2 = range3.start(i2);
  64792. const end = range3.end(i2);
  64793. if (startTime > end) {
  64794. continue;
  64795. }
  64796. if (startTime > start2 && startTime <= end) {
  64797. time += end - startTime;
  64798. continue;
  64799. }
  64800. time += end - start2;
  64801. }
  64802. return time;
  64803. };
  64804. const segmentDurationWithParts$1 = (playlist, segment) => {
  64805. if (!segment.preload) {
  64806. return segment.duration;
  64807. }
  64808. let result = 0;
  64809. (segment.parts || []).forEach(function(p) {
  64810. result += p.duration;
  64811. });
  64812. (segment.preloadHints || []).forEach(function(p) {
  64813. if (p.type === "PART") {
  64814. result += playlist.partTargetDuration;
  64815. }
  64816. });
  64817. return result;
  64818. };
  64819. const getPartsAndSegments$1 = (playlist) => (playlist.segments || []).reduce((acc, segment, si) => {
  64820. if (segment.parts) {
  64821. segment.parts.forEach(function(part, pi) {
  64822. acc.push({
  64823. duration: part.duration,
  64824. segmentIndex: si,
  64825. partIndex: pi,
  64826. part,
  64827. segment
  64828. });
  64829. });
  64830. } else {
  64831. acc.push({
  64832. duration: segment.duration,
  64833. segmentIndex: si,
  64834. partIndex: null,
  64835. segment,
  64836. part: null
  64837. });
  64838. }
  64839. return acc;
  64840. }, []);
  64841. const getLastParts$1 = (media) => {
  64842. const lastSegment = media.segments && media.segments.length && media.segments[media.segments.length - 1];
  64843. return lastSegment && lastSegment.parts || [];
  64844. };
  64845. const getKnownPartCount$1 = ({
  64846. preloadSegment
  64847. }) => {
  64848. if (!preloadSegment) {
  64849. return;
  64850. }
  64851. const {
  64852. parts,
  64853. preloadHints
  64854. } = preloadSegment;
  64855. let partCount = (preloadHints || []).reduce((count, hint) => count + (hint.type === "PART" ? 1 : 0), 0);
  64856. partCount += parts && parts.length ? parts.length : 0;
  64857. return partCount;
  64858. };
  64859. const liveEdgeDelay$1 = (main, media) => {
  64860. if (media.endList) {
  64861. return 0;
  64862. }
  64863. if (main && main.suggestedPresentationDelay) {
  64864. return main.suggestedPresentationDelay;
  64865. }
  64866. const hasParts = getLastParts$1(media).length > 0;
  64867. if (hasParts && media.serverControl && media.serverControl.partHoldBack) {
  64868. return media.serverControl.partHoldBack;
  64869. } else if (hasParts && media.partTargetDuration) {
  64870. return media.partTargetDuration * 3;
  64871. } else if (media.serverControl && media.serverControl.holdBack) {
  64872. return media.serverControl.holdBack;
  64873. } else if (media.targetDuration) {
  64874. return media.targetDuration * 3;
  64875. }
  64876. return 0;
  64877. };
  64878. const backwardDuration$1 = function(playlist, endSequence) {
  64879. let result = 0;
  64880. let i2 = endSequence - playlist.mediaSequence;
  64881. let segment = playlist.segments[i2];
  64882. if (segment) {
  64883. if (typeof segment.start !== "undefined") {
  64884. return {
  64885. result: segment.start,
  64886. precise: true
  64887. };
  64888. }
  64889. if (typeof segment.end !== "undefined") {
  64890. return {
  64891. result: segment.end - segment.duration,
  64892. precise: true
  64893. };
  64894. }
  64895. }
  64896. while (i2--) {
  64897. segment = playlist.segments[i2];
  64898. if (typeof segment.end !== "undefined") {
  64899. return {
  64900. result: result + segment.end,
  64901. precise: true
  64902. };
  64903. }
  64904. result += segmentDurationWithParts$1(playlist, segment);
  64905. if (typeof segment.start !== "undefined") {
  64906. return {
  64907. result: result + segment.start,
  64908. precise: true
  64909. };
  64910. }
  64911. }
  64912. return {
  64913. result,
  64914. precise: false
  64915. };
  64916. };
  64917. const forwardDuration$1 = function(playlist, endSequence) {
  64918. let result = 0;
  64919. let segment;
  64920. let i2 = endSequence - playlist.mediaSequence;
  64921. for (; i2 < playlist.segments.length; i2++) {
  64922. segment = playlist.segments[i2];
  64923. if (typeof segment.start !== "undefined") {
  64924. return {
  64925. result: segment.start - result,
  64926. precise: true
  64927. };
  64928. }
  64929. result += segmentDurationWithParts$1(playlist, segment);
  64930. if (typeof segment.end !== "undefined") {
  64931. return {
  64932. result: segment.end - result,
  64933. precise: true
  64934. };
  64935. }
  64936. }
  64937. return {
  64938. result: -1,
  64939. precise: false
  64940. };
  64941. };
  64942. const intervalDuration$1 = function(playlist, endSequence, expired) {
  64943. if (typeof endSequence === "undefined") {
  64944. endSequence = playlist.mediaSequence + playlist.segments.length;
  64945. }
  64946. if (endSequence < playlist.mediaSequence) {
  64947. return 0;
  64948. }
  64949. const backward = backwardDuration$1(playlist, endSequence);
  64950. if (backward.precise) {
  64951. return backward.result;
  64952. }
  64953. const forward = forwardDuration$1(playlist, endSequence);
  64954. if (forward.precise) {
  64955. return forward.result;
  64956. }
  64957. return backward.result + expired;
  64958. };
  64959. const duration$1 = function(playlist, endSequence, expired) {
  64960. if (!playlist) {
  64961. return 0;
  64962. }
  64963. if (typeof expired !== "number") {
  64964. expired = 0;
  64965. }
  64966. if (typeof endSequence === "undefined") {
  64967. if (playlist.totalDuration) {
  64968. return playlist.totalDuration;
  64969. }
  64970. if (!playlist.endList) {
  64971. return window_1.Infinity;
  64972. }
  64973. }
  64974. return intervalDuration$1(playlist, endSequence, expired);
  64975. };
  64976. const sumDurations$1 = function({
  64977. defaultDuration,
  64978. durationList,
  64979. startIndex,
  64980. endIndex
  64981. }) {
  64982. let durations = 0;
  64983. if (startIndex > endIndex) {
  64984. [startIndex, endIndex] = [endIndex, startIndex];
  64985. }
  64986. if (startIndex < 0) {
  64987. for (let i2 = startIndex; i2 < Math.min(0, endIndex); i2++) {
  64988. durations += defaultDuration;
  64989. }
  64990. startIndex = 0;
  64991. }
  64992. for (let i2 = startIndex; i2 < endIndex; i2++) {
  64993. durations += durationList[i2].duration;
  64994. }
  64995. return durations;
  64996. };
  64997. const playlistEnd$1 = function(playlist, expired, useSafeLiveEnd, liveEdgePadding) {
  64998. if (!playlist || !playlist.segments) {
  64999. return null;
  65000. }
  65001. if (playlist.endList) {
  65002. return duration$1(playlist);
  65003. }
  65004. if (expired === null) {
  65005. return null;
  65006. }
  65007. expired = expired || 0;
  65008. let lastSegmentEndTime = intervalDuration$1(playlist, playlist.mediaSequence + playlist.segments.length, expired);
  65009. if (useSafeLiveEnd) {
  65010. liveEdgePadding = typeof liveEdgePadding === "number" ? liveEdgePadding : liveEdgeDelay$1(null, playlist);
  65011. lastSegmentEndTime -= liveEdgePadding;
  65012. }
  65013. return Math.max(0, lastSegmentEndTime);
  65014. };
  65015. const seekable$1 = function(playlist, expired, liveEdgePadding) {
  65016. const useSafeLiveEnd = true;
  65017. const seekableStart = expired || 0;
  65018. const seekableEnd = playlistEnd$1(playlist, expired, useSafeLiveEnd, liveEdgePadding);
  65019. if (seekableEnd === null) {
  65020. return createTimeRanges$2();
  65021. }
  65022. return createTimeRanges$2(seekableStart, seekableEnd);
  65023. };
  65024. const getMediaInfoForTime$1 = function({
  65025. playlist,
  65026. currentTime,
  65027. startingSegmentIndex,
  65028. startingPartIndex,
  65029. startTime,
  65030. exactManifestTimings
  65031. }) {
  65032. let time = currentTime - startTime;
  65033. const partsAndSegments = getPartsAndSegments$1(playlist);
  65034. let startIndex = 0;
  65035. for (let i2 = 0; i2 < partsAndSegments.length; i2++) {
  65036. const partAndSegment = partsAndSegments[i2];
  65037. if (startingSegmentIndex !== partAndSegment.segmentIndex) {
  65038. continue;
  65039. }
  65040. if (typeof startingPartIndex === "number" && typeof partAndSegment.partIndex === "number" && startingPartIndex !== partAndSegment.partIndex) {
  65041. continue;
  65042. }
  65043. startIndex = i2;
  65044. break;
  65045. }
  65046. if (time < 0) {
  65047. if (startIndex > 0) {
  65048. for (let i2 = startIndex - 1; i2 >= 0; i2--) {
  65049. const partAndSegment = partsAndSegments[i2];
  65050. time += partAndSegment.duration;
  65051. if (exactManifestTimings) {
  65052. if (time < 0) {
  65053. continue;
  65054. }
  65055. } else if (time + TIME_FUDGE_FACTOR$1 <= 0) {
  65056. continue;
  65057. }
  65058. return {
  65059. partIndex: partAndSegment.partIndex,
  65060. segmentIndex: partAndSegment.segmentIndex,
  65061. startTime: startTime - sumDurations$1({
  65062. defaultDuration: playlist.targetDuration,
  65063. durationList: partsAndSegments,
  65064. startIndex,
  65065. endIndex: i2
  65066. })
  65067. };
  65068. }
  65069. }
  65070. return {
  65071. partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,
  65072. segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,
  65073. startTime: currentTime
  65074. };
  65075. }
  65076. if (startIndex < 0) {
  65077. for (let i2 = startIndex; i2 < 0; i2++) {
  65078. time -= playlist.targetDuration;
  65079. if (time < 0) {
  65080. return {
  65081. partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,
  65082. segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,
  65083. startTime: currentTime
  65084. };
  65085. }
  65086. }
  65087. startIndex = 0;
  65088. }
  65089. for (let i2 = startIndex; i2 < partsAndSegments.length; i2++) {
  65090. const partAndSegment = partsAndSegments[i2];
  65091. time -= partAndSegment.duration;
  65092. if (exactManifestTimings) {
  65093. if (time > 0) {
  65094. continue;
  65095. }
  65096. } else if (time - TIME_FUDGE_FACTOR$1 >= 0) {
  65097. continue;
  65098. }
  65099. return {
  65100. partIndex: partAndSegment.partIndex,
  65101. segmentIndex: partAndSegment.segmentIndex,
  65102. startTime: startTime + sumDurations$1({
  65103. defaultDuration: playlist.targetDuration,
  65104. durationList: partsAndSegments,
  65105. startIndex,
  65106. endIndex: i2
  65107. })
  65108. };
  65109. }
  65110. return {
  65111. segmentIndex: partsAndSegments[partsAndSegments.length - 1].segmentIndex,
  65112. partIndex: partsAndSegments[partsAndSegments.length - 1].partIndex,
  65113. startTime: currentTime
  65114. };
  65115. };
  65116. const isExcluded = function(playlist) {
  65117. return playlist.excludeUntil && playlist.excludeUntil > Date.now();
  65118. };
  65119. const isIncompatible$1 = function(playlist) {
  65120. return playlist.excludeUntil && playlist.excludeUntil === Infinity;
  65121. };
  65122. const isEnabled$1 = function(playlist) {
  65123. const excluded = isExcluded(playlist);
  65124. return !playlist.disabled && !excluded;
  65125. };
  65126. const isDisabled$1 = function(playlist) {
  65127. return playlist.disabled;
  65128. };
  65129. const isAes$1 = function(media) {
  65130. for (let i2 = 0; i2 < media.segments.length; i2++) {
  65131. if (media.segments[i2].key) {
  65132. return true;
  65133. }
  65134. }
  65135. return false;
  65136. };
  65137. const hasAttribute$1 = function(attr, playlist) {
  65138. return playlist.attributes && playlist.attributes[attr];
  65139. };
  65140. const estimateSegmentRequestTime$1 = function(segmentDuration, bandwidth2, playlist, bytesReceived = 0) {
  65141. if (!hasAttribute$1("BANDWIDTH", playlist)) {
  65142. return NaN;
  65143. }
  65144. const size = segmentDuration * playlist.attributes.BANDWIDTH;
  65145. return (size - bytesReceived * 8) / bandwidth2;
  65146. };
  65147. const isLowestEnabledRendition$1 = (main, media) => {
  65148. if (main.playlists.length === 1) {
  65149. return true;
  65150. }
  65151. const currentBandwidth = media.attributes.BANDWIDTH || Number.MAX_VALUE;
  65152. return main.playlists.filter((playlist) => {
  65153. if (!isEnabled$1(playlist)) {
  65154. return false;
  65155. }
  65156. return (playlist.attributes.BANDWIDTH || 0) < currentBandwidth;
  65157. }).length === 0;
  65158. };
  65159. const playlistMatch$1 = (a, b) => {
  65160. if (!a && !b || !a && b || a && !b) {
  65161. return false;
  65162. }
  65163. if (a === b) {
  65164. return true;
  65165. }
  65166. if (a.id && b.id && a.id === b.id) {
  65167. return true;
  65168. }
  65169. if (a.resolvedUri && b.resolvedUri && a.resolvedUri === b.resolvedUri) {
  65170. return true;
  65171. }
  65172. if (a.uri && b.uri && a.uri === b.uri) {
  65173. return true;
  65174. }
  65175. return false;
  65176. };
  65177. const someAudioVariant$1 = function(main, callback2) {
  65178. const AUDIO5 = main && main.mediaGroups && main.mediaGroups.AUDIO || {};
  65179. let found = false;
  65180. for (const groupName in AUDIO5) {
  65181. for (const label in AUDIO5[groupName]) {
  65182. found = callback2(AUDIO5[groupName][label]);
  65183. if (found) {
  65184. break;
  65185. }
  65186. }
  65187. if (found) {
  65188. break;
  65189. }
  65190. }
  65191. return !!found;
  65192. };
  65193. const isAudioOnly$1 = (main) => {
  65194. if (!main || !main.playlists || !main.playlists.length) {
  65195. const found = someAudioVariant$1(main, (variant) => variant.playlists && variant.playlists.length || variant.uri);
  65196. return found;
  65197. }
  65198. for (let i2 = 0; i2 < main.playlists.length; i2++) {
  65199. const playlist = main.playlists[i2];
  65200. const CODECS = playlist.attributes && playlist.attributes.CODECS;
  65201. if (CODECS && CODECS.split(",").every((c) => isAudioCodec$1(c))) {
  65202. continue;
  65203. }
  65204. const found = someAudioVariant$1(main, (variant) => playlistMatch$1(playlist, variant));
  65205. if (found) {
  65206. continue;
  65207. }
  65208. return false;
  65209. }
  65210. return true;
  65211. };
  65212. var Playlist$1 = {
  65213. liveEdgeDelay: liveEdgeDelay$1,
  65214. duration: duration$1,
  65215. seekable: seekable$1,
  65216. getMediaInfoForTime: getMediaInfoForTime$1,
  65217. isEnabled: isEnabled$1,
  65218. isDisabled: isDisabled$1,
  65219. isExcluded,
  65220. isIncompatible: isIncompatible$1,
  65221. playlistEnd: playlistEnd$1,
  65222. isAes: isAes$1,
  65223. hasAttribute: hasAttribute$1,
  65224. estimateSegmentRequestTime: estimateSegmentRequestTime$1,
  65225. isLowestEnabledRendition: isLowestEnabledRendition$1,
  65226. isAudioOnly: isAudioOnly$1,
  65227. playlistMatch: playlistMatch$1,
  65228. segmentDurationWithParts: segmentDurationWithParts$1
  65229. };
  65230. const {
  65231. log: log$2
  65232. } = videojs$2;
  65233. const createPlaylistID$1 = (index2, uri) => {
  65234. return `${index2}-${uri}`;
  65235. };
  65236. const groupID$1 = (type2, group, label) => {
  65237. return `placeholder-uri-${type2}-${group}-${label}`;
  65238. };
  65239. const parseManifest$1 = ({
  65240. onwarn,
  65241. oninfo,
  65242. manifestString,
  65243. customTagParsers = [],
  65244. customTagMappers = [],
  65245. llhls
  65246. }) => {
  65247. const parser2 = new Parser$1();
  65248. if (onwarn) {
  65249. parser2.on("warn", onwarn);
  65250. }
  65251. if (oninfo) {
  65252. parser2.on("info", oninfo);
  65253. }
  65254. customTagParsers.forEach((customParser) => parser2.addParser(customParser));
  65255. customTagMappers.forEach((mapper) => parser2.addTagMapper(mapper));
  65256. parser2.push(manifestString);
  65257. parser2.end();
  65258. const manifest = parser2.manifest;
  65259. if (!llhls) {
  65260. ["preloadSegment", "skip", "serverControl", "renditionReports", "partInf", "partTargetDuration"].forEach(function(k) {
  65261. if (manifest.hasOwnProperty(k)) {
  65262. delete manifest[k];
  65263. }
  65264. });
  65265. if (manifest.segments) {
  65266. manifest.segments.forEach(function(segment) {
  65267. ["parts", "preloadHints"].forEach(function(k) {
  65268. if (segment.hasOwnProperty(k)) {
  65269. delete segment[k];
  65270. }
  65271. });
  65272. });
  65273. }
  65274. }
  65275. if (!manifest.targetDuration) {
  65276. let targetDuration = 10;
  65277. if (manifest.segments && manifest.segments.length) {
  65278. targetDuration = manifest.segments.reduce((acc, s) => Math.max(acc, s.duration), 0);
  65279. }
  65280. if (onwarn) {
  65281. onwarn(`manifest has no targetDuration defaulting to ${targetDuration}`);
  65282. }
  65283. manifest.targetDuration = targetDuration;
  65284. }
  65285. const parts = getLastParts$1(manifest);
  65286. if (parts.length && !manifest.partTargetDuration) {
  65287. const partTargetDuration = parts.reduce((acc, p) => Math.max(acc, p.duration), 0);
  65288. if (onwarn) {
  65289. onwarn(`manifest has no partTargetDuration defaulting to ${partTargetDuration}`);
  65290. log$2.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.");
  65291. }
  65292. manifest.partTargetDuration = partTargetDuration;
  65293. }
  65294. return manifest;
  65295. };
  65296. const forEachMediaGroup$2 = (main, callback2) => {
  65297. if (!main.mediaGroups) {
  65298. return;
  65299. }
  65300. ["AUDIO", "SUBTITLES"].forEach((mediaType) => {
  65301. if (!main.mediaGroups[mediaType]) {
  65302. return;
  65303. }
  65304. for (const groupKey in main.mediaGroups[mediaType]) {
  65305. for (const labelKey in main.mediaGroups[mediaType][groupKey]) {
  65306. const mediaProperties = main.mediaGroups[mediaType][groupKey][labelKey];
  65307. callback2(mediaProperties, mediaType, groupKey, labelKey);
  65308. }
  65309. }
  65310. });
  65311. };
  65312. const setupMediaPlaylist$1 = ({
  65313. playlist,
  65314. uri,
  65315. id
  65316. }) => {
  65317. playlist.id = id;
  65318. playlist.playlistErrors_ = 0;
  65319. if (uri) {
  65320. playlist.uri = uri;
  65321. }
  65322. playlist.attributes = playlist.attributes || {};
  65323. };
  65324. const setupMediaPlaylists$1 = (main) => {
  65325. let i2 = main.playlists.length;
  65326. while (i2--) {
  65327. const playlist = main.playlists[i2];
  65328. setupMediaPlaylist$1({
  65329. playlist,
  65330. id: createPlaylistID$1(i2, playlist.uri)
  65331. });
  65332. playlist.resolvedUri = resolveUrl$2(main.uri, playlist.uri);
  65333. main.playlists[playlist.id] = playlist;
  65334. main.playlists[playlist.uri] = playlist;
  65335. if (!playlist.attributes.BANDWIDTH) {
  65336. log$2.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.");
  65337. }
  65338. }
  65339. };
  65340. const resolveMediaGroupUris$1 = (main) => {
  65341. forEachMediaGroup$2(main, (properties) => {
  65342. if (properties.uri) {
  65343. properties.resolvedUri = resolveUrl$2(main.uri, properties.uri);
  65344. }
  65345. });
  65346. };
  65347. const mainForMedia = (media, uri) => {
  65348. const id = createPlaylistID$1(0, uri);
  65349. const main = {
  65350. mediaGroups: {
  65351. "AUDIO": {},
  65352. "VIDEO": {},
  65353. "CLOSED-CAPTIONS": {},
  65354. "SUBTITLES": {}
  65355. },
  65356. uri: window_1.location.href,
  65357. resolvedUri: window_1.location.href,
  65358. playlists: [{
  65359. uri,
  65360. id,
  65361. resolvedUri: uri,
  65362. attributes: {}
  65363. }]
  65364. };
  65365. main.playlists[id] = main.playlists[0];
  65366. main.playlists[uri] = main.playlists[0];
  65367. return main;
  65368. };
  65369. const addPropertiesToMain = (main, uri, createGroupID = groupID$1) => {
  65370. main.uri = uri;
  65371. for (let i2 = 0; i2 < main.playlists.length; i2++) {
  65372. if (!main.playlists[i2].uri) {
  65373. const phonyUri = `placeholder-uri-${i2}`;
  65374. main.playlists[i2].uri = phonyUri;
  65375. }
  65376. }
  65377. const audioOnlyMain = isAudioOnly$1(main);
  65378. forEachMediaGroup$2(main, (properties, mediaType, groupKey, labelKey) => {
  65379. if (!properties.playlists || !properties.playlists.length) {
  65380. if (audioOnlyMain && mediaType === "AUDIO" && !properties.uri) {
  65381. for (let i2 = 0; i2 < main.playlists.length; i2++) {
  65382. const p = main.playlists[i2];
  65383. if (p.attributes && p.attributes.AUDIO && p.attributes.AUDIO === groupKey) {
  65384. return;
  65385. }
  65386. }
  65387. }
  65388. properties.playlists = [_extends$2({}, properties)];
  65389. }
  65390. properties.playlists.forEach(function(p, i2) {
  65391. const groupId = createGroupID(mediaType, groupKey, labelKey, p);
  65392. const id = createPlaylistID$1(i2, groupId);
  65393. if (p.uri) {
  65394. p.resolvedUri = p.resolvedUri || resolveUrl$2(main.uri, p.uri);
  65395. } else {
  65396. p.uri = i2 === 0 ? groupId : id;
  65397. p.resolvedUri = p.uri;
  65398. }
  65399. p.id = p.id || id;
  65400. p.attributes = p.attributes || {};
  65401. main.playlists[p.id] = p;
  65402. main.playlists[p.uri] = p;
  65403. });
  65404. });
  65405. setupMediaPlaylists$1(main);
  65406. resolveMediaGroupUris$1(main);
  65407. };
  65408. const {
  65409. EventTarget: EventTarget$1$1
  65410. } = videojs$2;
  65411. const addLLHLSQueryDirectives$1 = (uri, media) => {
  65412. if (media.endList || !media.serverControl) {
  65413. return uri;
  65414. }
  65415. const parameters = {};
  65416. if (media.serverControl.canBlockReload) {
  65417. const {
  65418. preloadSegment
  65419. } = media;
  65420. let nextMSN = media.mediaSequence + media.segments.length;
  65421. if (preloadSegment) {
  65422. const parts = preloadSegment.parts || [];
  65423. const nextPart = getKnownPartCount$1(media) - 1;
  65424. if (nextPart > -1 && nextPart !== parts.length - 1) {
  65425. parameters._HLS_part = nextPart;
  65426. }
  65427. if (nextPart > -1 || parts.length) {
  65428. nextMSN--;
  65429. }
  65430. }
  65431. parameters._HLS_msn = nextMSN;
  65432. }
  65433. if (media.serverControl && media.serverControl.canSkipUntil) {
  65434. parameters._HLS_skip = media.serverControl.canSkipDateranges ? "v2" : "YES";
  65435. }
  65436. if (Object.keys(parameters).length) {
  65437. const parsedUri = new window_1.URL(uri);
  65438. ["_HLS_skip", "_HLS_msn", "_HLS_part"].forEach(function(name) {
  65439. if (!parameters.hasOwnProperty(name)) {
  65440. return;
  65441. }
  65442. parsedUri.searchParams.set(name, parameters[name]);
  65443. });
  65444. uri = parsedUri.toString();
  65445. }
  65446. return uri;
  65447. };
  65448. const updateSegment$1 = (a, b) => {
  65449. if (!a) {
  65450. return b;
  65451. }
  65452. const result = merge$2(a, b);
  65453. if (a.preloadHints && !b.preloadHints) {
  65454. delete result.preloadHints;
  65455. }
  65456. if (a.parts && !b.parts) {
  65457. delete result.parts;
  65458. } else if (a.parts && b.parts) {
  65459. for (let i2 = 0; i2 < b.parts.length; i2++) {
  65460. if (a.parts && a.parts[i2]) {
  65461. result.parts[i2] = merge$2(a.parts[i2], b.parts[i2]);
  65462. }
  65463. }
  65464. }
  65465. if (!a.skipped && b.skipped) {
  65466. result.skipped = false;
  65467. }
  65468. if (a.preload && !b.preload) {
  65469. result.preload = false;
  65470. }
  65471. return result;
  65472. };
  65473. const updateSegments$1 = (original, update, offset) => {
  65474. const oldSegments = original.slice();
  65475. const newSegments = update.slice();
  65476. offset = offset || 0;
  65477. const result = [];
  65478. let currentMap;
  65479. for (let newIndex = 0; newIndex < newSegments.length; newIndex++) {
  65480. const oldSegment = oldSegments[newIndex + offset];
  65481. const newSegment = newSegments[newIndex];
  65482. if (oldSegment) {
  65483. currentMap = oldSegment.map || currentMap;
  65484. result.push(updateSegment$1(oldSegment, newSegment));
  65485. } else {
  65486. if (currentMap && !newSegment.map) {
  65487. newSegment.map = currentMap;
  65488. }
  65489. result.push(newSegment);
  65490. }
  65491. }
  65492. return result;
  65493. };
  65494. const resolveSegmentUris$1 = (segment, baseUri) => {
  65495. if (!segment.resolvedUri && segment.uri) {
  65496. segment.resolvedUri = resolveUrl$2(baseUri, segment.uri);
  65497. }
  65498. if (segment.key && !segment.key.resolvedUri) {
  65499. segment.key.resolvedUri = resolveUrl$2(baseUri, segment.key.uri);
  65500. }
  65501. if (segment.map && !segment.map.resolvedUri) {
  65502. segment.map.resolvedUri = resolveUrl$2(baseUri, segment.map.uri);
  65503. }
  65504. if (segment.map && segment.map.key && !segment.map.key.resolvedUri) {
  65505. segment.map.key.resolvedUri = resolveUrl$2(baseUri, segment.map.key.uri);
  65506. }
  65507. if (segment.parts && segment.parts.length) {
  65508. segment.parts.forEach((p) => {
  65509. if (p.resolvedUri) {
  65510. return;
  65511. }
  65512. p.resolvedUri = resolveUrl$2(baseUri, p.uri);
  65513. });
  65514. }
  65515. if (segment.preloadHints && segment.preloadHints.length) {
  65516. segment.preloadHints.forEach((p) => {
  65517. if (p.resolvedUri) {
  65518. return;
  65519. }
  65520. p.resolvedUri = resolveUrl$2(baseUri, p.uri);
  65521. });
  65522. }
  65523. };
  65524. const getAllSegments$1 = function(media) {
  65525. const segments = media.segments || [];
  65526. const preloadSegment = media.preloadSegment;
  65527. if (preloadSegment && preloadSegment.parts && preloadSegment.parts.length) {
  65528. if (preloadSegment.preloadHints) {
  65529. for (let i2 = 0; i2 < preloadSegment.preloadHints.length; i2++) {
  65530. if (preloadSegment.preloadHints[i2].type === "MAP") {
  65531. return segments;
  65532. }
  65533. }
  65534. }
  65535. preloadSegment.duration = media.targetDuration;
  65536. preloadSegment.preload = true;
  65537. segments.push(preloadSegment);
  65538. }
  65539. return segments;
  65540. };
  65541. const isPlaylistUnchanged$1 = (a, b) => a === b || a.segments && b.segments && a.segments.length === b.segments.length && a.endList === b.endList && a.mediaSequence === b.mediaSequence && a.preloadSegment === b.preloadSegment;
  65542. const updateMain$1 = (main, newMedia, unchangedCheck = isPlaylistUnchanged$1) => {
  65543. const result = merge$2(main, {});
  65544. const oldMedia = result.playlists[newMedia.id];
  65545. if (!oldMedia) {
  65546. return null;
  65547. }
  65548. if (unchangedCheck(oldMedia, newMedia)) {
  65549. return null;
  65550. }
  65551. newMedia.segments = getAllSegments$1(newMedia);
  65552. const mergedPlaylist = merge$2(oldMedia, newMedia);
  65553. if (mergedPlaylist.preloadSegment && !newMedia.preloadSegment) {
  65554. delete mergedPlaylist.preloadSegment;
  65555. }
  65556. if (oldMedia.segments) {
  65557. if (newMedia.skip) {
  65558. newMedia.segments = newMedia.segments || [];
  65559. for (let i2 = 0; i2 < newMedia.skip.skippedSegments; i2++) {
  65560. newMedia.segments.unshift({
  65561. skipped: true
  65562. });
  65563. }
  65564. }
  65565. mergedPlaylist.segments = updateSegments$1(oldMedia.segments, newMedia.segments, newMedia.mediaSequence - oldMedia.mediaSequence);
  65566. }
  65567. mergedPlaylist.segments.forEach((segment) => {
  65568. resolveSegmentUris$1(segment, mergedPlaylist.resolvedUri);
  65569. });
  65570. for (let i2 = 0; i2 < result.playlists.length; i2++) {
  65571. if (result.playlists[i2].id === newMedia.id) {
  65572. result.playlists[i2] = mergedPlaylist;
  65573. }
  65574. }
  65575. result.playlists[newMedia.id] = mergedPlaylist;
  65576. result.playlists[newMedia.uri] = mergedPlaylist;
  65577. forEachMediaGroup$2(main, (properties, mediaType, groupKey, labelKey) => {
  65578. if (!properties.playlists) {
  65579. return;
  65580. }
  65581. for (let i2 = 0; i2 < properties.playlists.length; i2++) {
  65582. if (newMedia.id === properties.playlists[i2].id) {
  65583. properties.playlists[i2] = mergedPlaylist;
  65584. }
  65585. }
  65586. });
  65587. return result;
  65588. };
  65589. const refreshDelay$1 = (media, update) => {
  65590. const segments = media.segments || [];
  65591. const lastSegment = segments[segments.length - 1];
  65592. const lastPart = lastSegment && lastSegment.parts && lastSegment.parts[lastSegment.parts.length - 1];
  65593. const lastDuration = lastPart && lastPart.duration || lastSegment && lastSegment.duration;
  65594. if (update && lastDuration) {
  65595. return lastDuration * 1e3;
  65596. }
  65597. return (media.partTargetDuration || media.targetDuration || 10) * 500;
  65598. };
  65599. class PlaylistLoader$1 extends EventTarget$1$1 {
  65600. constructor(src, vhs, options2 = {}) {
  65601. super();
  65602. if (!src) {
  65603. throw new Error("A non-empty playlist URL or object is required");
  65604. }
  65605. this.logger_ = logger$1("PlaylistLoader");
  65606. const {
  65607. withCredentials = false
  65608. } = options2;
  65609. this.src = src;
  65610. this.vhs_ = vhs;
  65611. this.withCredentials = withCredentials;
  65612. const vhsOptions = vhs.options_;
  65613. this.customTagParsers = vhsOptions && vhsOptions.customTagParsers || [];
  65614. this.customTagMappers = vhsOptions && vhsOptions.customTagMappers || [];
  65615. this.llhls = vhsOptions && vhsOptions.llhls;
  65616. this.state = "HAVE_NOTHING";
  65617. this.handleMediaupdatetimeout_ = this.handleMediaupdatetimeout_.bind(this);
  65618. this.on("mediaupdatetimeout", this.handleMediaupdatetimeout_);
  65619. }
  65620. handleMediaupdatetimeout_() {
  65621. if (this.state !== "HAVE_METADATA") {
  65622. return;
  65623. }
  65624. const media = this.media();
  65625. let uri = resolveUrl$2(this.main.uri, media.uri);
  65626. if (this.llhls) {
  65627. uri = addLLHLSQueryDirectives$1(uri, media);
  65628. }
  65629. this.state = "HAVE_CURRENT_METADATA";
  65630. this.request = this.vhs_.xhr({
  65631. uri,
  65632. withCredentials: this.withCredentials
  65633. }, (error, req) => {
  65634. if (!this.request) {
  65635. return;
  65636. }
  65637. if (error) {
  65638. return this.playlistRequestError(this.request, this.media(), "HAVE_METADATA");
  65639. }
  65640. this.haveMetadata({
  65641. playlistString: this.request.responseText,
  65642. url: this.media().uri,
  65643. id: this.media().id
  65644. });
  65645. });
  65646. }
  65647. playlistRequestError(xhr, playlist, startingState) {
  65648. const {
  65649. uri,
  65650. id
  65651. } = playlist;
  65652. this.request = null;
  65653. if (startingState) {
  65654. this.state = startingState;
  65655. }
  65656. this.error = {
  65657. playlist: this.main.playlists[id],
  65658. status: xhr.status,
  65659. message: `HLS playlist request error at URL: ${uri}.`,
  65660. responseText: xhr.responseText,
  65661. code: xhr.status >= 500 ? 4 : 2
  65662. };
  65663. this.trigger("error");
  65664. }
  65665. parseManifest_({
  65666. url,
  65667. manifestString
  65668. }) {
  65669. return parseManifest$1({
  65670. onwarn: ({
  65671. message
  65672. }) => this.logger_(`m3u8-parser warn for ${url}: ${message}`),
  65673. oninfo: ({
  65674. message
  65675. }) => this.logger_(`m3u8-parser info for ${url}: ${message}`),
  65676. manifestString,
  65677. customTagParsers: this.customTagParsers,
  65678. customTagMappers: this.customTagMappers,
  65679. llhls: this.llhls
  65680. });
  65681. }
  65682. haveMetadata({
  65683. playlistString,
  65684. playlistObject,
  65685. url,
  65686. id
  65687. }) {
  65688. this.request = null;
  65689. this.state = "HAVE_METADATA";
  65690. const playlist = playlistObject || this.parseManifest_({
  65691. url,
  65692. manifestString: playlistString
  65693. });
  65694. playlist.lastRequest = Date.now();
  65695. setupMediaPlaylist$1({
  65696. playlist,
  65697. uri: url,
  65698. id
  65699. });
  65700. const update = updateMain$1(this.main, playlist);
  65701. this.targetDuration = playlist.partTargetDuration || playlist.targetDuration;
  65702. this.pendingMedia_ = null;
  65703. if (update) {
  65704. this.main = update;
  65705. this.media_ = this.main.playlists[id];
  65706. } else {
  65707. this.trigger("playlistunchanged");
  65708. }
  65709. this.updateMediaUpdateTimeout_(refreshDelay$1(this.media(), !!update));
  65710. this.trigger("loadedplaylist");
  65711. }
  65712. dispose() {
  65713. this.trigger("dispose");
  65714. this.stopRequest();
  65715. window_1.clearTimeout(this.mediaUpdateTimeout);
  65716. window_1.clearTimeout(this.finalRenditionTimeout);
  65717. this.off();
  65718. }
  65719. stopRequest() {
  65720. if (this.request) {
  65721. const oldRequest = this.request;
  65722. this.request = null;
  65723. oldRequest.onreadystatechange = null;
  65724. oldRequest.abort();
  65725. }
  65726. }
  65727. media(playlist, shouldDelay) {
  65728. if (!playlist) {
  65729. return this.media_;
  65730. }
  65731. if (this.state === "HAVE_NOTHING") {
  65732. throw new Error("Cannot switch media playlist from " + this.state);
  65733. }
  65734. if (typeof playlist === "string") {
  65735. if (!this.main.playlists[playlist]) {
  65736. throw new Error("Unknown playlist URI: " + playlist);
  65737. }
  65738. playlist = this.main.playlists[playlist];
  65739. }
  65740. window_1.clearTimeout(this.finalRenditionTimeout);
  65741. if (shouldDelay) {
  65742. const delay = (playlist.partTargetDuration || playlist.targetDuration) / 2 * 1e3 || 5 * 1e3;
  65743. this.finalRenditionTimeout = window_1.setTimeout(this.media.bind(this, playlist, false), delay);
  65744. return;
  65745. }
  65746. const startingState = this.state;
  65747. const mediaChange = !this.media_ || playlist.id !== this.media_.id;
  65748. const mainPlaylistRef = this.main.playlists[playlist.id];
  65749. if (mainPlaylistRef && mainPlaylistRef.endList || playlist.endList && playlist.segments.length) {
  65750. if (this.request) {
  65751. this.request.onreadystatechange = null;
  65752. this.request.abort();
  65753. this.request = null;
  65754. }
  65755. this.state = "HAVE_METADATA";
  65756. this.media_ = playlist;
  65757. if (mediaChange) {
  65758. this.trigger("mediachanging");
  65759. if (startingState === "HAVE_MAIN_MANIFEST") {
  65760. this.trigger("loadedmetadata");
  65761. } else {
  65762. this.trigger("mediachange");
  65763. }
  65764. }
  65765. return;
  65766. }
  65767. this.updateMediaUpdateTimeout_(refreshDelay$1(playlist, true));
  65768. if (!mediaChange) {
  65769. return;
  65770. }
  65771. this.state = "SWITCHING_MEDIA";
  65772. if (this.request) {
  65773. if (playlist.resolvedUri === this.request.url) {
  65774. return;
  65775. }
  65776. this.request.onreadystatechange = null;
  65777. this.request.abort();
  65778. this.request = null;
  65779. }
  65780. if (this.media_) {
  65781. this.trigger("mediachanging");
  65782. }
  65783. this.pendingMedia_ = playlist;
  65784. this.request = this.vhs_.xhr({
  65785. uri: playlist.resolvedUri,
  65786. withCredentials: this.withCredentials
  65787. }, (error, req) => {
  65788. if (!this.request) {
  65789. return;
  65790. }
  65791. playlist.lastRequest = Date.now();
  65792. playlist.resolvedUri = resolveManifestRedirect$1(playlist.resolvedUri, req);
  65793. if (error) {
  65794. return this.playlistRequestError(this.request, playlist, startingState);
  65795. }
  65796. this.haveMetadata({
  65797. playlistString: req.responseText,
  65798. url: playlist.uri,
  65799. id: playlist.id
  65800. });
  65801. if (startingState === "HAVE_MAIN_MANIFEST") {
  65802. this.trigger("loadedmetadata");
  65803. } else {
  65804. this.trigger("mediachange");
  65805. }
  65806. });
  65807. }
  65808. pause() {
  65809. if (this.mediaUpdateTimeout) {
  65810. window_1.clearTimeout(this.mediaUpdateTimeout);
  65811. this.mediaUpdateTimeout = null;
  65812. }
  65813. this.stopRequest();
  65814. if (this.state === "HAVE_NOTHING") {
  65815. this.started = false;
  65816. }
  65817. if (this.state === "SWITCHING_MEDIA") {
  65818. if (this.media_) {
  65819. this.state = "HAVE_METADATA";
  65820. } else {
  65821. this.state = "HAVE_MAIN_MANIFEST";
  65822. }
  65823. } else if (this.state === "HAVE_CURRENT_METADATA") {
  65824. this.state = "HAVE_METADATA";
  65825. }
  65826. }
  65827. load(shouldDelay) {
  65828. if (this.mediaUpdateTimeout) {
  65829. window_1.clearTimeout(this.mediaUpdateTimeout);
  65830. this.mediaUpdateTimeout = null;
  65831. }
  65832. const media = this.media();
  65833. if (shouldDelay) {
  65834. const delay = media ? (media.partTargetDuration || media.targetDuration) / 2 * 1e3 : 5 * 1e3;
  65835. this.mediaUpdateTimeout = window_1.setTimeout(() => {
  65836. this.mediaUpdateTimeout = null;
  65837. this.load();
  65838. }, delay);
  65839. return;
  65840. }
  65841. if (!this.started) {
  65842. this.start();
  65843. return;
  65844. }
  65845. if (media && !media.endList) {
  65846. this.trigger("mediaupdatetimeout");
  65847. } else {
  65848. this.trigger("loadedplaylist");
  65849. }
  65850. }
  65851. updateMediaUpdateTimeout_(delay) {
  65852. if (this.mediaUpdateTimeout) {
  65853. window_1.clearTimeout(this.mediaUpdateTimeout);
  65854. this.mediaUpdateTimeout = null;
  65855. }
  65856. if (!this.media() || this.media().endList) {
  65857. return;
  65858. }
  65859. this.mediaUpdateTimeout = window_1.setTimeout(() => {
  65860. this.mediaUpdateTimeout = null;
  65861. this.trigger("mediaupdatetimeout");
  65862. this.updateMediaUpdateTimeout_(delay);
  65863. }, delay);
  65864. }
  65865. start() {
  65866. this.started = true;
  65867. if (typeof this.src === "object") {
  65868. if (!this.src.uri) {
  65869. this.src.uri = window_1.location.href;
  65870. }
  65871. this.src.resolvedUri = this.src.uri;
  65872. setTimeout(() => {
  65873. this.setupInitialPlaylist(this.src);
  65874. }, 0);
  65875. return;
  65876. }
  65877. this.request = this.vhs_.xhr({
  65878. uri: this.src,
  65879. withCredentials: this.withCredentials
  65880. }, (error, req) => {
  65881. if (!this.request) {
  65882. return;
  65883. }
  65884. this.request = null;
  65885. if (error) {
  65886. this.error = {
  65887. status: req.status,
  65888. message: `HLS playlist request error at URL: ${this.src}.`,
  65889. responseText: req.responseText,
  65890. code: 2
  65891. };
  65892. if (this.state === "HAVE_NOTHING") {
  65893. this.started = false;
  65894. }
  65895. return this.trigger("error");
  65896. }
  65897. this.src = resolveManifestRedirect$1(this.src, req);
  65898. const manifest = this.parseManifest_({
  65899. manifestString: req.responseText,
  65900. url: this.src
  65901. });
  65902. this.setupInitialPlaylist(manifest);
  65903. });
  65904. }
  65905. srcUri() {
  65906. return typeof this.src === "string" ? this.src : this.src.uri;
  65907. }
  65908. setupInitialPlaylist(manifest) {
  65909. this.state = "HAVE_MAIN_MANIFEST";
  65910. if (manifest.playlists) {
  65911. this.main = manifest;
  65912. addPropertiesToMain(this.main, this.srcUri());
  65913. manifest.playlists.forEach((playlist) => {
  65914. playlist.segments = getAllSegments$1(playlist);
  65915. playlist.segments.forEach((segment) => {
  65916. resolveSegmentUris$1(segment, playlist.resolvedUri);
  65917. });
  65918. });
  65919. this.trigger("loadedplaylist");
  65920. if (!this.request) {
  65921. this.media(this.main.playlists[0]);
  65922. }
  65923. return;
  65924. }
  65925. const uri = this.srcUri() || window_1.location.href;
  65926. this.main = mainForMedia(manifest, uri);
  65927. this.haveMetadata({
  65928. playlistObject: manifest,
  65929. url: uri,
  65930. id: this.main.playlists[0].id
  65931. });
  65932. this.trigger("loadedmetadata");
  65933. }
  65934. }
  65935. const {
  65936. xhr: videojsXHR$1
  65937. } = videojs$2;
  65938. const callbackWrapper$1 = function(request, error, response, callback2) {
  65939. const reqResponse = request.responseType === "arraybuffer" ? request.response : request.responseText;
  65940. if (!error && reqResponse) {
  65941. request.responseTime = Date.now();
  65942. request.roundTripTime = request.responseTime - request.requestTime;
  65943. request.bytesReceived = reqResponse.byteLength || reqResponse.length;
  65944. if (!request.bandwidth) {
  65945. request.bandwidth = Math.floor(request.bytesReceived / request.roundTripTime * 8 * 1e3);
  65946. }
  65947. }
  65948. if (response.headers) {
  65949. request.responseHeaders = response.headers;
  65950. }
  65951. if (error && error.code === "ETIMEDOUT") {
  65952. request.timedout = true;
  65953. }
  65954. if (!error && !request.aborted && response.statusCode !== 200 && response.statusCode !== 206 && response.statusCode !== 0) {
  65955. error = new Error("XHR Failed with a response of: " + (request && (reqResponse || request.responseText)));
  65956. }
  65957. callback2(error, request);
  65958. };
  65959. const xhrFactory$1 = function() {
  65960. const xhr = function XhrFunction(options2, callback2) {
  65961. options2 = merge$2({
  65962. timeout: 45e3
  65963. }, options2);
  65964. const beforeRequest = XhrFunction.beforeRequest || videojs$2.Vhs.xhr.beforeRequest;
  65965. if (beforeRequest && typeof beforeRequest === "function") {
  65966. const newOptions = beforeRequest(options2);
  65967. if (newOptions) {
  65968. options2 = newOptions;
  65969. }
  65970. }
  65971. const xhrMethod = videojs$2.Vhs.xhr.original === true ? videojsXHR$1 : videojs$2.Vhs.xhr;
  65972. const request = xhrMethod(options2, function(error, response) {
  65973. return callbackWrapper$1(request, error, response, callback2);
  65974. });
  65975. const originalAbort = request.abort;
  65976. request.abort = function() {
  65977. request.aborted = true;
  65978. return originalAbort.apply(request, arguments);
  65979. };
  65980. request.uri = options2.uri;
  65981. request.requestTime = Date.now();
  65982. return request;
  65983. };
  65984. xhr.original = true;
  65985. return xhr;
  65986. };
  65987. const byterangeStr$1 = function(byterange) {
  65988. let byterangeEnd;
  65989. const byterangeStart = byterange.offset;
  65990. if (typeof byterange.offset === "bigint" || typeof byterange.length === "bigint") {
  65991. byterangeEnd = window_1.BigInt(byterange.offset) + window_1.BigInt(byterange.length) - window_1.BigInt(1);
  65992. } else {
  65993. byterangeEnd = byterange.offset + byterange.length - 1;
  65994. }
  65995. return "bytes=" + byterangeStart + "-" + byterangeEnd;
  65996. };
  65997. const segmentXhrHeaders$1 = function(segment) {
  65998. const headers = {};
  65999. if (segment.byterange) {
  66000. headers.Range = byterangeStr$1(segment.byterange);
  66001. }
  66002. return headers;
  66003. };
  66004. const textRange$1 = function(range3, i2) {
  66005. return range3.start(i2) + "-" + range3.end(i2);
  66006. };
  66007. const formatHexString$1 = function(e, i2) {
  66008. const value = e.toString(16);
  66009. return "00".substring(0, 2 - value.length) + value + (i2 % 2 ? " " : "");
  66010. };
  66011. const formatAsciiString$1 = function(e) {
  66012. if (e >= 32 && e < 126) {
  66013. return String.fromCharCode(e);
  66014. }
  66015. return ".";
  66016. };
  66017. const createTransferableMessage$1 = function(message) {
  66018. const transferable = {};
  66019. Object.keys(message).forEach((key) => {
  66020. const value = message[key];
  66021. if (isArrayBufferView$1(value)) {
  66022. transferable[key] = {
  66023. bytes: value.buffer,
  66024. byteOffset: value.byteOffset,
  66025. byteLength: value.byteLength
  66026. };
  66027. } else {
  66028. transferable[key] = value;
  66029. }
  66030. });
  66031. return transferable;
  66032. };
  66033. const initSegmentId$1 = function(initSegment) {
  66034. const byterange = initSegment.byterange || {
  66035. length: Infinity,
  66036. offset: 0
  66037. };
  66038. return [byterange.length, byterange.offset, initSegment.resolvedUri].join(",");
  66039. };
  66040. const segmentKeyId$1 = function(key) {
  66041. return key.resolvedUri;
  66042. };
  66043. const hexDump$1 = (data) => {
  66044. const bytes = Array.prototype.slice.call(data);
  66045. const step = 16;
  66046. let result = "";
  66047. let hex;
  66048. let ascii;
  66049. for (let j = 0; j < bytes.length / step; j++) {
  66050. hex = bytes.slice(j * step, j * step + step).map(formatHexString$1).join("");
  66051. ascii = bytes.slice(j * step, j * step + step).map(formatAsciiString$1).join("");
  66052. result += hex + " " + ascii + "\n";
  66053. }
  66054. return result;
  66055. };
  66056. const tagDump$1 = ({
  66057. bytes
  66058. }) => hexDump$1(bytes);
  66059. const textRanges$1 = (ranges) => {
  66060. let result = "";
  66061. let i2;
  66062. for (i2 = 0; i2 < ranges.length; i2++) {
  66063. result += textRange$1(ranges, i2) + " ";
  66064. }
  66065. return result;
  66066. };
  66067. var utils$1 = /* @__PURE__ */ Object.freeze({
  66068. __proto__: null,
  66069. createTransferableMessage: createTransferableMessage$1,
  66070. initSegmentId: initSegmentId$1,
  66071. segmentKeyId: segmentKeyId$1,
  66072. hexDump: hexDump$1,
  66073. tagDump: tagDump$1,
  66074. textRanges: textRanges$1
  66075. });
  66076. const SEGMENT_END_FUDGE_PERCENT$1 = 0.25;
  66077. const playerTimeToProgramTime$1 = (playerTime, segment) => {
  66078. if (!segment.dateTimeObject) {
  66079. return null;
  66080. }
  66081. const transmuxerPrependedSeconds = segment.videoTimingInfo.transmuxerPrependedSeconds;
  66082. const transmuxedStart = segment.videoTimingInfo.transmuxedPresentationStart;
  66083. const startOfSegment = transmuxedStart + transmuxerPrependedSeconds;
  66084. const offsetFromSegmentStart = playerTime - startOfSegment;
  66085. return new Date(segment.dateTimeObject.getTime() + offsetFromSegmentStart * 1e3);
  66086. };
  66087. const originalSegmentVideoDuration$1 = (videoTimingInfo) => {
  66088. return videoTimingInfo.transmuxedPresentationEnd - videoTimingInfo.transmuxedPresentationStart - videoTimingInfo.transmuxerPrependedSeconds;
  66089. };
  66090. const findSegmentForProgramTime$1 = (programTime, playlist) => {
  66091. let dateTimeObject;
  66092. try {
  66093. dateTimeObject = new Date(programTime);
  66094. } catch (e) {
  66095. return null;
  66096. }
  66097. if (!playlist || !playlist.segments || playlist.segments.length === 0) {
  66098. return null;
  66099. }
  66100. let segment = playlist.segments[0];
  66101. if (dateTimeObject < segment.dateTimeObject) {
  66102. return null;
  66103. }
  66104. for (let i2 = 0; i2 < playlist.segments.length - 1; i2++) {
  66105. segment = playlist.segments[i2];
  66106. const nextSegmentStart = playlist.segments[i2 + 1].dateTimeObject;
  66107. if (dateTimeObject < nextSegmentStart) {
  66108. break;
  66109. }
  66110. }
  66111. const lastSegment = playlist.segments[playlist.segments.length - 1];
  66112. const lastSegmentStart = lastSegment.dateTimeObject;
  66113. const lastSegmentDuration = lastSegment.videoTimingInfo ? originalSegmentVideoDuration$1(lastSegment.videoTimingInfo) : lastSegment.duration + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT$1;
  66114. const lastSegmentEnd = new Date(lastSegmentStart.getTime() + lastSegmentDuration * 1e3);
  66115. if (dateTimeObject > lastSegmentEnd) {
  66116. return null;
  66117. }
  66118. if (dateTimeObject > lastSegmentStart) {
  66119. segment = lastSegment;
  66120. }
  66121. return {
  66122. segment,
  66123. estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : Playlist$1.duration(playlist, playlist.mediaSequence + playlist.segments.indexOf(segment)),
  66124. type: segment.videoTimingInfo ? "accurate" : "estimate"
  66125. };
  66126. };
  66127. const findSegmentForPlayerTime$1 = (time, playlist) => {
  66128. if (!playlist || !playlist.segments || playlist.segments.length === 0) {
  66129. return null;
  66130. }
  66131. let segmentEnd = 0;
  66132. let segment;
  66133. for (let i2 = 0; i2 < playlist.segments.length; i2++) {
  66134. segment = playlist.segments[i2];
  66135. segmentEnd = segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationEnd : segmentEnd + segment.duration;
  66136. if (time <= segmentEnd) {
  66137. break;
  66138. }
  66139. }
  66140. const lastSegment = playlist.segments[playlist.segments.length - 1];
  66141. if (lastSegment.videoTimingInfo && lastSegment.videoTimingInfo.transmuxedPresentationEnd < time) {
  66142. return null;
  66143. }
  66144. if (time > segmentEnd) {
  66145. if (time > segmentEnd + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT$1) {
  66146. return null;
  66147. }
  66148. segment = lastSegment;
  66149. }
  66150. return {
  66151. segment,
  66152. estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : segmentEnd - segment.duration,
  66153. type: segment.videoTimingInfo ? "accurate" : "estimate"
  66154. };
  66155. };
  66156. const getOffsetFromTimestamp$1 = (comparisonTimeStamp, programTime) => {
  66157. let segmentDateTime;
  66158. let programDateTime;
  66159. try {
  66160. segmentDateTime = new Date(comparisonTimeStamp);
  66161. programDateTime = new Date(programTime);
  66162. } catch (e) {
  66163. }
  66164. const segmentTimeEpoch = segmentDateTime.getTime();
  66165. const programTimeEpoch = programDateTime.getTime();
  66166. return (programTimeEpoch - segmentTimeEpoch) / 1e3;
  66167. };
  66168. const verifyProgramDateTimeTags$1 = (playlist) => {
  66169. if (!playlist.segments || playlist.segments.length === 0) {
  66170. return false;
  66171. }
  66172. for (let i2 = 0; i2 < playlist.segments.length; i2++) {
  66173. const segment = playlist.segments[i2];
  66174. if (!segment.dateTimeObject) {
  66175. return false;
  66176. }
  66177. }
  66178. return true;
  66179. };
  66180. const getProgramTime$1 = ({
  66181. playlist,
  66182. time = void 0,
  66183. callback: callback2
  66184. }) => {
  66185. if (!callback2) {
  66186. throw new Error("getProgramTime: callback must be provided");
  66187. }
  66188. if (!playlist || time === void 0) {
  66189. return callback2({
  66190. message: "getProgramTime: playlist and time must be provided"
  66191. });
  66192. }
  66193. const matchedSegment = findSegmentForPlayerTime$1(time, playlist);
  66194. if (!matchedSegment) {
  66195. return callback2({
  66196. message: "valid programTime was not found"
  66197. });
  66198. }
  66199. if (matchedSegment.type === "estimate") {
  66200. return callback2({
  66201. message: "Accurate programTime could not be determined. Please seek to e.seekTime and try again",
  66202. seekTime: matchedSegment.estimatedStart
  66203. });
  66204. }
  66205. const programTimeObject = {
  66206. mediaSeconds: time
  66207. };
  66208. const programTime = playerTimeToProgramTime$1(time, matchedSegment.segment);
  66209. if (programTime) {
  66210. programTimeObject.programDateTime = programTime.toISOString();
  66211. }
  66212. return callback2(null, programTimeObject);
  66213. };
  66214. const seekToProgramTime$1 = ({
  66215. programTime,
  66216. playlist,
  66217. retryCount = 2,
  66218. seekTo,
  66219. pauseAfterSeek = true,
  66220. tech,
  66221. callback: callback2
  66222. }) => {
  66223. if (!callback2) {
  66224. throw new Error("seekToProgramTime: callback must be provided");
  66225. }
  66226. if (typeof programTime === "undefined" || !playlist || !seekTo) {
  66227. return callback2({
  66228. message: "seekToProgramTime: programTime, seekTo and playlist must be provided"
  66229. });
  66230. }
  66231. if (!playlist.endList && !tech.hasStarted_) {
  66232. return callback2({
  66233. message: "player must be playing a live stream to start buffering"
  66234. });
  66235. }
  66236. if (!verifyProgramDateTimeTags$1(playlist)) {
  66237. return callback2({
  66238. message: "programDateTime tags must be provided in the manifest " + playlist.resolvedUri
  66239. });
  66240. }
  66241. const matchedSegment = findSegmentForProgramTime$1(programTime, playlist);
  66242. if (!matchedSegment) {
  66243. return callback2({
  66244. message: `${programTime} was not found in the stream`
  66245. });
  66246. }
  66247. const segment = matchedSegment.segment;
  66248. const mediaOffset = getOffsetFromTimestamp$1(segment.dateTimeObject, programTime);
  66249. if (matchedSegment.type === "estimate") {
  66250. if (retryCount === 0) {
  66251. return callback2({
  66252. message: `${programTime} is not buffered yet. Try again`
  66253. });
  66254. }
  66255. seekTo(matchedSegment.estimatedStart + mediaOffset);
  66256. tech.one("seeked", () => {
  66257. seekToProgramTime$1({
  66258. programTime,
  66259. playlist,
  66260. retryCount: retryCount - 1,
  66261. seekTo,
  66262. pauseAfterSeek,
  66263. tech,
  66264. callback: callback2
  66265. });
  66266. });
  66267. return;
  66268. }
  66269. const seekToTime = segment.start + mediaOffset;
  66270. const seekedCallback = () => {
  66271. return callback2(null, tech.currentTime());
  66272. };
  66273. tech.one("seeked", seekedCallback);
  66274. if (pauseAfterSeek) {
  66275. tech.pause();
  66276. }
  66277. seekTo(seekToTime);
  66278. };
  66279. const callbackOnCompleted$1 = (request, cb) => {
  66280. if (request.readyState === 4) {
  66281. return cb();
  66282. }
  66283. return;
  66284. };
  66285. const containerRequest$1 = (uri, xhr, cb) => {
  66286. let bytes = [];
  66287. let id3Offset;
  66288. let finished = false;
  66289. const endRequestAndCallback = function(err, req, type2, _bytes) {
  66290. req.abort();
  66291. finished = true;
  66292. return cb(err, req, type2, _bytes);
  66293. };
  66294. const progressListener = function(error, request2) {
  66295. if (finished) {
  66296. return;
  66297. }
  66298. if (error) {
  66299. return endRequestAndCallback(error, request2, "", bytes);
  66300. }
  66301. const newPart = request2.responseText.substring(bytes && bytes.byteLength || 0, request2.responseText.length);
  66302. bytes = concatTypedArrays$1(bytes, stringToBytes$1(newPart, true));
  66303. id3Offset = id3Offset || getId3Offset$1(bytes);
  66304. if (bytes.length < 10 || id3Offset && bytes.length < id3Offset + 2) {
  66305. return callbackOnCompleted$1(request2, () => endRequestAndCallback(error, request2, "", bytes));
  66306. }
  66307. const type2 = detectContainerForBytes$1(bytes);
  66308. if (type2 === "ts" && bytes.length < 188) {
  66309. return callbackOnCompleted$1(request2, () => endRequestAndCallback(error, request2, "", bytes));
  66310. }
  66311. if (!type2 && bytes.length < 376) {
  66312. return callbackOnCompleted$1(request2, () => endRequestAndCallback(error, request2, "", bytes));
  66313. }
  66314. return endRequestAndCallback(null, request2, type2, bytes);
  66315. };
  66316. const options2 = {
  66317. uri,
  66318. beforeSend(request2) {
  66319. request2.overrideMimeType("text/plain; charset=x-user-defined");
  66320. request2.addEventListener("progress", function({
  66321. total,
  66322. loaded
  66323. }) {
  66324. return callbackWrapper$1(request2, null, {
  66325. statusCode: request2.status
  66326. }, progressListener);
  66327. });
  66328. }
  66329. };
  66330. const request = xhr(options2, function(error, response) {
  66331. return callbackWrapper$1(request, error, response, progressListener);
  66332. });
  66333. return request;
  66334. };
  66335. const {
  66336. EventTarget: EventTarget$3
  66337. } = videojs$2;
  66338. const dashPlaylistUnchanged$1 = function(a, b) {
  66339. if (!isPlaylistUnchanged$1(a, b)) {
  66340. return false;
  66341. }
  66342. if (a.sidx && b.sidx && (a.sidx.offset !== b.sidx.offset || a.sidx.length !== b.sidx.length)) {
  66343. return false;
  66344. } else if (!a.sidx && b.sidx || a.sidx && !b.sidx) {
  66345. return false;
  66346. }
  66347. if (a.segments && !b.segments || !a.segments && b.segments) {
  66348. return false;
  66349. }
  66350. if (!a.segments && !b.segments) {
  66351. return true;
  66352. }
  66353. for (let i2 = 0; i2 < a.segments.length; i2++) {
  66354. const aSegment = a.segments[i2];
  66355. const bSegment = b.segments[i2];
  66356. if (aSegment.uri !== bSegment.uri) {
  66357. return false;
  66358. }
  66359. if (!aSegment.byterange && !bSegment.byterange) {
  66360. continue;
  66361. }
  66362. const aByterange = aSegment.byterange;
  66363. const bByterange = bSegment.byterange;
  66364. if (aByterange && !bByterange || !aByterange && bByterange) {
  66365. return false;
  66366. }
  66367. if (aByterange.offset !== bByterange.offset || aByterange.length !== bByterange.length) {
  66368. return false;
  66369. }
  66370. }
  66371. return true;
  66372. };
  66373. const dashGroupId$1 = (type2, group, label, playlist) => {
  66374. const playlistId = playlist.attributes.NAME || label;
  66375. return `placeholder-uri-${type2}-${group}-${playlistId}`;
  66376. };
  66377. const parseMainXml = ({
  66378. mainXml,
  66379. srcUrl,
  66380. clientOffset,
  66381. sidxMapping,
  66382. previousManifest
  66383. }) => {
  66384. const manifest = parse$1(mainXml, {
  66385. manifestUri: srcUrl,
  66386. clientOffset,
  66387. sidxMapping,
  66388. previousManifest
  66389. });
  66390. addPropertiesToMain(manifest, srcUrl, dashGroupId$1);
  66391. return manifest;
  66392. };
  66393. const removeOldMediaGroupLabels$1 = (update, newMain) => {
  66394. forEachMediaGroup$2(update, (properties, type2, group, label) => {
  66395. if (!(label in newMain.mediaGroups[type2][group])) {
  66396. delete update.mediaGroups[type2][group][label];
  66397. }
  66398. });
  66399. };
  66400. const updateMain = (oldMain, newMain, sidxMapping) => {
  66401. let noChanges = true;
  66402. let update = merge$2(oldMain, {
  66403. duration: newMain.duration,
  66404. minimumUpdatePeriod: newMain.minimumUpdatePeriod,
  66405. timelineStarts: newMain.timelineStarts
  66406. });
  66407. for (let i2 = 0; i2 < newMain.playlists.length; i2++) {
  66408. const playlist = newMain.playlists[i2];
  66409. if (playlist.sidx) {
  66410. const sidxKey = generateSidxKey$1(playlist.sidx);
  66411. if (sidxMapping && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx) {
  66412. addSidxSegmentsToPlaylist$1$1(playlist, sidxMapping[sidxKey].sidx, playlist.sidx.resolvedUri);
  66413. }
  66414. }
  66415. const playlistUpdate = updateMain$1(update, playlist, dashPlaylistUnchanged$1);
  66416. if (playlistUpdate) {
  66417. update = playlistUpdate;
  66418. noChanges = false;
  66419. }
  66420. }
  66421. forEachMediaGroup$2(newMain, (properties, type2, group, label) => {
  66422. if (properties.playlists && properties.playlists.length) {
  66423. const id = properties.playlists[0].id;
  66424. const playlistUpdate = updateMain$1(update, properties.playlists[0], dashPlaylistUnchanged$1);
  66425. if (playlistUpdate) {
  66426. update = playlistUpdate;
  66427. if (!(label in update.mediaGroups[type2][group])) {
  66428. update.mediaGroups[type2][group][label] = properties;
  66429. }
  66430. update.mediaGroups[type2][group][label].playlists[0] = update.playlists[id];
  66431. noChanges = false;
  66432. }
  66433. }
  66434. });
  66435. removeOldMediaGroupLabels$1(update, newMain);
  66436. if (newMain.minimumUpdatePeriod !== oldMain.minimumUpdatePeriod) {
  66437. noChanges = false;
  66438. }
  66439. if (noChanges) {
  66440. return null;
  66441. }
  66442. return update;
  66443. };
  66444. const equivalentSidx$1 = (a, b) => {
  66445. const neitherMap = Boolean(!a.map && !b.map);
  66446. const equivalentMap = neitherMap || Boolean(a.map && b.map && a.map.byterange.offset === b.map.byterange.offset && a.map.byterange.length === b.map.byterange.length);
  66447. return equivalentMap && a.uri === b.uri && a.byterange.offset === b.byterange.offset && a.byterange.length === b.byterange.length;
  66448. };
  66449. const compareSidxEntry$1 = (playlists, oldSidxMapping) => {
  66450. const newSidxMapping = {};
  66451. for (const id in playlists) {
  66452. const playlist = playlists[id];
  66453. const currentSidxInfo = playlist.sidx;
  66454. if (currentSidxInfo) {
  66455. const key = generateSidxKey$1(currentSidxInfo);
  66456. if (!oldSidxMapping[key]) {
  66457. break;
  66458. }
  66459. const savedSidxInfo = oldSidxMapping[key].sidxInfo;
  66460. if (equivalentSidx$1(savedSidxInfo, currentSidxInfo)) {
  66461. newSidxMapping[key] = oldSidxMapping[key];
  66462. }
  66463. }
  66464. }
  66465. return newSidxMapping;
  66466. };
  66467. const filterChangedSidxMappings$1 = (main, oldSidxMapping) => {
  66468. const videoSidx = compareSidxEntry$1(main.playlists, oldSidxMapping);
  66469. let mediaGroupSidx = videoSidx;
  66470. forEachMediaGroup$2(main, (properties, mediaType, groupKey, labelKey) => {
  66471. if (properties.playlists && properties.playlists.length) {
  66472. const playlists = properties.playlists;
  66473. mediaGroupSidx = merge$2(mediaGroupSidx, compareSidxEntry$1(playlists, oldSidxMapping));
  66474. }
  66475. });
  66476. return mediaGroupSidx;
  66477. };
  66478. class DashPlaylistLoader$1 extends EventTarget$3 {
  66479. constructor(srcUrlOrPlaylist, vhs, options2 = {}, mainPlaylistLoader) {
  66480. super();
  66481. this.mainPlaylistLoader_ = mainPlaylistLoader || this;
  66482. if (!mainPlaylistLoader) {
  66483. this.isMain_ = true;
  66484. }
  66485. const {
  66486. withCredentials = false
  66487. } = options2;
  66488. this.vhs_ = vhs;
  66489. this.withCredentials = withCredentials;
  66490. if (!srcUrlOrPlaylist) {
  66491. throw new Error("A non-empty playlist URL or object is required");
  66492. }
  66493. this.on("minimumUpdatePeriod", () => {
  66494. this.refreshXml_();
  66495. });
  66496. this.on("mediaupdatetimeout", () => {
  66497. this.refreshMedia_(this.media().id);
  66498. });
  66499. this.state = "HAVE_NOTHING";
  66500. this.loadedPlaylists_ = {};
  66501. this.logger_ = logger$1("DashPlaylistLoader");
  66502. if (this.isMain_) {
  66503. this.mainPlaylistLoader_.srcUrl = srcUrlOrPlaylist;
  66504. this.mainPlaylistLoader_.sidxMapping_ = {};
  66505. } else {
  66506. this.childPlaylist_ = srcUrlOrPlaylist;
  66507. }
  66508. }
  66509. requestErrored_(err, request, startingState) {
  66510. if (!this.request) {
  66511. return true;
  66512. }
  66513. this.request = null;
  66514. if (err) {
  66515. this.error = typeof err === "object" && !(err instanceof Error) ? err : {
  66516. status: request.status,
  66517. message: "DASH request error at URL: " + request.uri,
  66518. response: request.response,
  66519. code: 2
  66520. };
  66521. if (startingState) {
  66522. this.state = startingState;
  66523. }
  66524. this.trigger("error");
  66525. return true;
  66526. }
  66527. }
  66528. addSidxSegments_(playlist, startingState, cb) {
  66529. const sidxKey = playlist.sidx && generateSidxKey$1(playlist.sidx);
  66530. if (!playlist.sidx || !sidxKey || this.mainPlaylistLoader_.sidxMapping_[sidxKey]) {
  66531. this.mediaRequest_ = window_1.setTimeout(() => cb(false), 0);
  66532. return;
  66533. }
  66534. const uri = resolveManifestRedirect$1(playlist.sidx.resolvedUri);
  66535. const fin = (err, request) => {
  66536. if (this.requestErrored_(err, request, startingState)) {
  66537. return;
  66538. }
  66539. const sidxMapping = this.mainPlaylistLoader_.sidxMapping_;
  66540. let sidx;
  66541. try {
  66542. sidx = parseSidx_1$1(toUint8$1(request.response).subarray(8));
  66543. } catch (e) {
  66544. this.requestErrored_(e, request, startingState);
  66545. return;
  66546. }
  66547. sidxMapping[sidxKey] = {
  66548. sidxInfo: playlist.sidx,
  66549. sidx
  66550. };
  66551. addSidxSegmentsToPlaylist$1$1(playlist, sidx, playlist.sidx.resolvedUri);
  66552. return cb(true);
  66553. };
  66554. this.request = containerRequest$1(uri, this.vhs_.xhr, (err, request, container, bytes) => {
  66555. if (err) {
  66556. return fin(err, request);
  66557. }
  66558. if (!container || container !== "mp4") {
  66559. return fin({
  66560. status: request.status,
  66561. message: `Unsupported ${container || "unknown"} container type for sidx segment at URL: ${uri}`,
  66562. response: "",
  66563. playlist,
  66564. internal: true,
  66565. playlistExclusionDuration: Infinity,
  66566. code: 2
  66567. }, request);
  66568. }
  66569. const {
  66570. offset,
  66571. length
  66572. } = playlist.sidx.byterange;
  66573. if (bytes.length >= length + offset) {
  66574. return fin(err, {
  66575. response: bytes.subarray(offset, offset + length),
  66576. status: request.status,
  66577. uri: request.uri
  66578. });
  66579. }
  66580. this.request = this.vhs_.xhr({
  66581. uri,
  66582. responseType: "arraybuffer",
  66583. headers: segmentXhrHeaders$1({
  66584. byterange: playlist.sidx.byterange
  66585. })
  66586. }, fin);
  66587. });
  66588. }
  66589. dispose() {
  66590. this.trigger("dispose");
  66591. this.stopRequest();
  66592. this.loadedPlaylists_ = {};
  66593. window_1.clearTimeout(this.minimumUpdatePeriodTimeout_);
  66594. window_1.clearTimeout(this.mediaRequest_);
  66595. window_1.clearTimeout(this.mediaUpdateTimeout);
  66596. this.mediaUpdateTimeout = null;
  66597. this.mediaRequest_ = null;
  66598. this.minimumUpdatePeriodTimeout_ = null;
  66599. if (this.mainPlaylistLoader_.createMupOnMedia_) {
  66600. this.off("loadedmetadata", this.mainPlaylistLoader_.createMupOnMedia_);
  66601. this.mainPlaylistLoader_.createMupOnMedia_ = null;
  66602. }
  66603. this.off();
  66604. }
  66605. hasPendingRequest() {
  66606. return this.request || this.mediaRequest_;
  66607. }
  66608. stopRequest() {
  66609. if (this.request) {
  66610. const oldRequest = this.request;
  66611. this.request = null;
  66612. oldRequest.onreadystatechange = null;
  66613. oldRequest.abort();
  66614. }
  66615. }
  66616. media(playlist) {
  66617. if (!playlist) {
  66618. return this.media_;
  66619. }
  66620. if (this.state === "HAVE_NOTHING") {
  66621. throw new Error("Cannot switch media playlist from " + this.state);
  66622. }
  66623. const startingState = this.state;
  66624. if (typeof playlist === "string") {
  66625. if (!this.mainPlaylistLoader_.main.playlists[playlist]) {
  66626. throw new Error("Unknown playlist URI: " + playlist);
  66627. }
  66628. playlist = this.mainPlaylistLoader_.main.playlists[playlist];
  66629. }
  66630. const mediaChange = !this.media_ || playlist.id !== this.media_.id;
  66631. if (mediaChange && this.loadedPlaylists_[playlist.id] && this.loadedPlaylists_[playlist.id].endList) {
  66632. this.state = "HAVE_METADATA";
  66633. this.media_ = playlist;
  66634. if (mediaChange) {
  66635. this.trigger("mediachanging");
  66636. this.trigger("mediachange");
  66637. }
  66638. return;
  66639. }
  66640. if (!mediaChange) {
  66641. return;
  66642. }
  66643. if (this.media_) {
  66644. this.trigger("mediachanging");
  66645. }
  66646. this.addSidxSegments_(playlist, startingState, (sidxChanged) => {
  66647. this.haveMetadata({
  66648. startingState,
  66649. playlist
  66650. });
  66651. });
  66652. }
  66653. haveMetadata({
  66654. startingState,
  66655. playlist
  66656. }) {
  66657. this.state = "HAVE_METADATA";
  66658. this.loadedPlaylists_[playlist.id] = playlist;
  66659. this.mediaRequest_ = null;
  66660. this.refreshMedia_(playlist.id);
  66661. if (startingState === "HAVE_MAIN_MANIFEST") {
  66662. this.trigger("loadedmetadata");
  66663. } else {
  66664. this.trigger("mediachange");
  66665. }
  66666. }
  66667. pause() {
  66668. if (this.mainPlaylistLoader_.createMupOnMedia_) {
  66669. this.off("loadedmetadata", this.mainPlaylistLoader_.createMupOnMedia_);
  66670. this.mainPlaylistLoader_.createMupOnMedia_ = null;
  66671. }
  66672. this.stopRequest();
  66673. window_1.clearTimeout(this.mediaUpdateTimeout);
  66674. this.mediaUpdateTimeout = null;
  66675. if (this.isMain_) {
  66676. window_1.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_);
  66677. this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_ = null;
  66678. }
  66679. if (this.state === "HAVE_NOTHING") {
  66680. this.started = false;
  66681. }
  66682. }
  66683. load(isFinalRendition) {
  66684. window_1.clearTimeout(this.mediaUpdateTimeout);
  66685. this.mediaUpdateTimeout = null;
  66686. const media = this.media();
  66687. if (isFinalRendition) {
  66688. const delay = media ? media.targetDuration / 2 * 1e3 : 5 * 1e3;
  66689. this.mediaUpdateTimeout = window_1.setTimeout(() => this.load(), delay);
  66690. return;
  66691. }
  66692. if (!this.started) {
  66693. this.start();
  66694. return;
  66695. }
  66696. if (media && !media.endList) {
  66697. if (this.isMain_ && !this.minimumUpdatePeriodTimeout_) {
  66698. this.trigger("minimumUpdatePeriod");
  66699. this.updateMinimumUpdatePeriodTimeout_();
  66700. }
  66701. this.trigger("mediaupdatetimeout");
  66702. } else {
  66703. this.trigger("loadedplaylist");
  66704. }
  66705. }
  66706. start() {
  66707. this.started = true;
  66708. if (!this.isMain_) {
  66709. this.mediaRequest_ = window_1.setTimeout(() => this.haveMain_(), 0);
  66710. return;
  66711. }
  66712. this.requestMain_((req, mainChanged) => {
  66713. this.haveMain_();
  66714. if (!this.hasPendingRequest() && !this.media_) {
  66715. this.media(this.mainPlaylistLoader_.main.playlists[0]);
  66716. }
  66717. });
  66718. }
  66719. requestMain_(cb) {
  66720. this.request = this.vhs_.xhr({
  66721. uri: this.mainPlaylistLoader_.srcUrl,
  66722. withCredentials: this.withCredentials
  66723. }, (error, req) => {
  66724. if (this.requestErrored_(error, req)) {
  66725. if (this.state === "HAVE_NOTHING") {
  66726. this.started = false;
  66727. }
  66728. return;
  66729. }
  66730. const mainChanged = req.responseText !== this.mainPlaylistLoader_.mainXml_;
  66731. this.mainPlaylistLoader_.mainXml_ = req.responseText;
  66732. if (req.responseHeaders && req.responseHeaders.date) {
  66733. this.mainLoaded_ = Date.parse(req.responseHeaders.date);
  66734. } else {
  66735. this.mainLoaded_ = Date.now();
  66736. }
  66737. this.mainPlaylistLoader_.srcUrl = resolveManifestRedirect$1(this.mainPlaylistLoader_.srcUrl, req);
  66738. if (mainChanged) {
  66739. this.handleMain_();
  66740. this.syncClientServerClock_(() => {
  66741. return cb(req, mainChanged);
  66742. });
  66743. return;
  66744. }
  66745. return cb(req, mainChanged);
  66746. });
  66747. }
  66748. syncClientServerClock_(done) {
  66749. const utcTiming = parseUTCTiming$1(this.mainPlaylistLoader_.mainXml_);
  66750. if (utcTiming === null) {
  66751. this.mainPlaylistLoader_.clientOffset_ = this.mainLoaded_ - Date.now();
  66752. return done();
  66753. }
  66754. if (utcTiming.method === "DIRECT") {
  66755. this.mainPlaylistLoader_.clientOffset_ = utcTiming.value - Date.now();
  66756. return done();
  66757. }
  66758. this.request = this.vhs_.xhr({
  66759. uri: resolveUrl$2(this.mainPlaylistLoader_.srcUrl, utcTiming.value),
  66760. method: utcTiming.method,
  66761. withCredentials: this.withCredentials
  66762. }, (error, req) => {
  66763. if (!this.request) {
  66764. return;
  66765. }
  66766. if (error) {
  66767. this.mainPlaylistLoader_.clientOffset_ = this.mainLoaded_ - Date.now();
  66768. return done();
  66769. }
  66770. let serverTime;
  66771. if (utcTiming.method === "HEAD") {
  66772. if (!req.responseHeaders || !req.responseHeaders.date) {
  66773. serverTime = this.mainLoaded_;
  66774. } else {
  66775. serverTime = Date.parse(req.responseHeaders.date);
  66776. }
  66777. } else {
  66778. serverTime = Date.parse(req.responseText);
  66779. }
  66780. this.mainPlaylistLoader_.clientOffset_ = serverTime - Date.now();
  66781. done();
  66782. });
  66783. }
  66784. haveMain_() {
  66785. this.state = "HAVE_MAIN_MANIFEST";
  66786. if (this.isMain_) {
  66787. this.trigger("loadedplaylist");
  66788. } else if (!this.media_) {
  66789. this.media(this.childPlaylist_);
  66790. }
  66791. }
  66792. handleMain_() {
  66793. this.mediaRequest_ = null;
  66794. const oldMain = this.mainPlaylistLoader_.main;
  66795. let newMain = parseMainXml({
  66796. mainXml: this.mainPlaylistLoader_.mainXml_,
  66797. srcUrl: this.mainPlaylistLoader_.srcUrl,
  66798. clientOffset: this.mainPlaylistLoader_.clientOffset_,
  66799. sidxMapping: this.mainPlaylistLoader_.sidxMapping_,
  66800. previousManifest: oldMain
  66801. });
  66802. if (oldMain) {
  66803. newMain = updateMain(oldMain, newMain, this.mainPlaylistLoader_.sidxMapping_);
  66804. }
  66805. this.mainPlaylistLoader_.main = newMain ? newMain : oldMain;
  66806. const location = this.mainPlaylistLoader_.main.locations && this.mainPlaylistLoader_.main.locations[0];
  66807. if (location && location !== this.mainPlaylistLoader_.srcUrl) {
  66808. this.mainPlaylistLoader_.srcUrl = location;
  66809. }
  66810. if (!oldMain || newMain && newMain.minimumUpdatePeriod !== oldMain.minimumUpdatePeriod) {
  66811. this.updateMinimumUpdatePeriodTimeout_();
  66812. }
  66813. return Boolean(newMain);
  66814. }
  66815. updateMinimumUpdatePeriodTimeout_() {
  66816. const mpl = this.mainPlaylistLoader_;
  66817. if (mpl.createMupOnMedia_) {
  66818. mpl.off("loadedmetadata", mpl.createMupOnMedia_);
  66819. mpl.createMupOnMedia_ = null;
  66820. }
  66821. if (mpl.minimumUpdatePeriodTimeout_) {
  66822. window_1.clearTimeout(mpl.minimumUpdatePeriodTimeout_);
  66823. mpl.minimumUpdatePeriodTimeout_ = null;
  66824. }
  66825. let mup = mpl.main && mpl.main.minimumUpdatePeriod;
  66826. if (mup === 0) {
  66827. if (mpl.media()) {
  66828. mup = mpl.media().targetDuration * 1e3;
  66829. } else {
  66830. mpl.createMupOnMedia_ = mpl.updateMinimumUpdatePeriodTimeout_;
  66831. mpl.one("loadedmetadata", mpl.createMupOnMedia_);
  66832. }
  66833. }
  66834. if (typeof mup !== "number" || mup <= 0) {
  66835. if (mup < 0) {
  66836. this.logger_(`found invalid minimumUpdatePeriod of ${mup}, not setting a timeout`);
  66837. }
  66838. return;
  66839. }
  66840. this.createMUPTimeout_(mup);
  66841. }
  66842. createMUPTimeout_(mup) {
  66843. const mpl = this.mainPlaylistLoader_;
  66844. mpl.minimumUpdatePeriodTimeout_ = window_1.setTimeout(() => {
  66845. mpl.minimumUpdatePeriodTimeout_ = null;
  66846. mpl.trigger("minimumUpdatePeriod");
  66847. mpl.createMUPTimeout_(mup);
  66848. }, mup);
  66849. }
  66850. refreshXml_() {
  66851. this.requestMain_((req, mainChanged) => {
  66852. if (!mainChanged) {
  66853. return;
  66854. }
  66855. if (this.media_) {
  66856. this.media_ = this.mainPlaylistLoader_.main.playlists[this.media_.id];
  66857. }
  66858. this.mainPlaylistLoader_.sidxMapping_ = filterChangedSidxMappings$1(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.sidxMapping_);
  66859. this.addSidxSegments_(this.media(), this.state, (sidxChanged) => {
  66860. this.refreshMedia_(this.media().id);
  66861. });
  66862. });
  66863. }
  66864. refreshMedia_(mediaID) {
  66865. if (!mediaID) {
  66866. throw new Error("refreshMedia_ must take a media id");
  66867. }
  66868. if (this.media_ && this.isMain_) {
  66869. this.handleMain_();
  66870. }
  66871. const playlists = this.mainPlaylistLoader_.main.playlists;
  66872. const mediaChanged = !this.media_ || this.media_ !== playlists[mediaID];
  66873. if (mediaChanged) {
  66874. this.media_ = playlists[mediaID];
  66875. } else {
  66876. this.trigger("playlistunchanged");
  66877. }
  66878. if (!this.mediaUpdateTimeout) {
  66879. const createMediaUpdateTimeout = () => {
  66880. if (this.media().endList) {
  66881. return;
  66882. }
  66883. this.mediaUpdateTimeout = window_1.setTimeout(() => {
  66884. this.trigger("mediaupdatetimeout");
  66885. createMediaUpdateTimeout();
  66886. }, refreshDelay$1(this.media(), Boolean(mediaChanged)));
  66887. };
  66888. createMediaUpdateTimeout();
  66889. }
  66890. this.trigger("loadedplaylist");
  66891. }
  66892. }
  66893. var Config$1 = {
  66894. GOAL_BUFFER_LENGTH: 30,
  66895. MAX_GOAL_BUFFER_LENGTH: 60,
  66896. BACK_BUFFER_LENGTH: 30,
  66897. GOAL_BUFFER_LENGTH_RATE: 1,
  66898. INITIAL_BANDWIDTH: 4194304,
  66899. BANDWIDTH_VARIANCE: 1.2,
  66900. BUFFER_LOW_WATER_LINE: 0,
  66901. MAX_BUFFER_LOW_WATER_LINE: 30,
  66902. EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE: 16,
  66903. BUFFER_LOW_WATER_LINE_RATE: 1,
  66904. BUFFER_HIGH_WATER_LINE: 30
  66905. };
  66906. const stringToArrayBuffer$1 = (string) => {
  66907. const view = new Uint8Array(new ArrayBuffer(string.length));
  66908. for (let i2 = 0; i2 < string.length; i2++) {
  66909. view[i2] = string.charCodeAt(i2);
  66910. }
  66911. return view.buffer;
  66912. };
  66913. const browserWorkerPolyFill$1 = function(workerObj) {
  66914. workerObj.on = workerObj.addEventListener;
  66915. workerObj.off = workerObj.removeEventListener;
  66916. return workerObj;
  66917. };
  66918. const createObjectURL$1 = function(str) {
  66919. try {
  66920. return URL.createObjectURL(new Blob([str], {
  66921. type: "application/javascript"
  66922. }));
  66923. } catch (e) {
  66924. const blob = new BlobBuilder();
  66925. blob.append(str);
  66926. return URL.createObjectURL(blob.getBlob());
  66927. }
  66928. };
  66929. const factory$1 = function(code) {
  66930. return function() {
  66931. const objectUrl = createObjectURL$1(code);
  66932. const worker = browserWorkerPolyFill$1(new Worker(objectUrl));
  66933. worker.objURL = objectUrl;
  66934. const terminate = worker.terminate;
  66935. worker.on = worker.addEventListener;
  66936. worker.off = worker.removeEventListener;
  66937. worker.terminate = function() {
  66938. URL.revokeObjectURL(objectUrl);
  66939. return terminate.call(this);
  66940. };
  66941. return worker;
  66942. };
  66943. };
  66944. const transform$1 = function(code) {
  66945. return `var browserWorkerPolyFill = ${browserWorkerPolyFill$1.toString()};
  66946. browserWorkerPolyFill(self);
  66947. ` + code;
  66948. };
  66949. const getWorkerString$1 = function(fn2) {
  66950. return fn2.toString().replace(/^function.+?{/, "").slice(0, -1);
  66951. };
  66952. const workerCode$1$1 = transform$1(getWorkerString$1(function() {
  66953. var commonjsGlobal2 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  66954. var Stream$8 = function() {
  66955. this.init = function() {
  66956. var listeners = {};
  66957. this.on = function(type3, listener) {
  66958. if (!listeners[type3]) {
  66959. listeners[type3] = [];
  66960. }
  66961. listeners[type3] = listeners[type3].concat(listener);
  66962. };
  66963. this.off = function(type3, listener) {
  66964. var index2;
  66965. if (!listeners[type3]) {
  66966. return false;
  66967. }
  66968. index2 = listeners[type3].indexOf(listener);
  66969. listeners[type3] = listeners[type3].slice();
  66970. listeners[type3].splice(index2, 1);
  66971. return index2 > -1;
  66972. };
  66973. this.trigger = function(type3) {
  66974. var callbacks, i2, length, args;
  66975. callbacks = listeners[type3];
  66976. if (!callbacks) {
  66977. return;
  66978. }
  66979. if (arguments.length === 2) {
  66980. length = callbacks.length;
  66981. for (i2 = 0; i2 < length; ++i2) {
  66982. callbacks[i2].call(this, arguments[1]);
  66983. }
  66984. } else {
  66985. args = [];
  66986. i2 = arguments.length;
  66987. for (i2 = 1; i2 < arguments.length; ++i2) {
  66988. args.push(arguments[i2]);
  66989. }
  66990. length = callbacks.length;
  66991. for (i2 = 0; i2 < length; ++i2) {
  66992. callbacks[i2].apply(this, args);
  66993. }
  66994. }
  66995. };
  66996. this.dispose = function() {
  66997. listeners = {};
  66998. };
  66999. };
  67000. };
  67001. Stream$8.prototype.pipe = function(destination2) {
  67002. this.on("data", function(data) {
  67003. destination2.push(data);
  67004. });
  67005. this.on("done", function(flushSource) {
  67006. destination2.flush(flushSource);
  67007. });
  67008. this.on("partialdone", function(flushSource) {
  67009. destination2.partialFlush(flushSource);
  67010. });
  67011. this.on("endedtimeline", function(flushSource) {
  67012. destination2.endTimeline(flushSource);
  67013. });
  67014. this.on("reset", function(flushSource) {
  67015. destination2.reset(flushSource);
  67016. });
  67017. return destination2;
  67018. };
  67019. Stream$8.prototype.push = function(data) {
  67020. this.trigger("data", data);
  67021. };
  67022. Stream$8.prototype.flush = function(flushSource) {
  67023. this.trigger("done", flushSource);
  67024. };
  67025. Stream$8.prototype.partialFlush = function(flushSource) {
  67026. this.trigger("partialdone", flushSource);
  67027. };
  67028. Stream$8.prototype.endTimeline = function(flushSource) {
  67029. this.trigger("endedtimeline", flushSource);
  67030. };
  67031. Stream$8.prototype.reset = function(flushSource) {
  67032. this.trigger("reset", flushSource);
  67033. };
  67034. var stream = Stream$8;
  67035. var MAX_UINT32$12 = Math.pow(2, 32);
  67036. var getUint64$32 = function(uint8) {
  67037. var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);
  67038. var value;
  67039. if (dv.getBigUint64) {
  67040. value = dv.getBigUint64(0);
  67041. if (value < Number.MAX_SAFE_INTEGER) {
  67042. return Number(value);
  67043. }
  67044. return value;
  67045. }
  67046. return dv.getUint32(0) * MAX_UINT32$12 + dv.getUint32(4);
  67047. };
  67048. var numbers2 = {
  67049. getUint64: getUint64$32,
  67050. MAX_UINT32: MAX_UINT32$12
  67051. };
  67052. var MAX_UINT322 = numbers2.MAX_UINT32;
  67053. var box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex, trun$1, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR, AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS;
  67054. (function() {
  67055. var i2;
  67056. types = {
  67057. avc1: [],
  67058. avcC: [],
  67059. btrt: [],
  67060. dinf: [],
  67061. dref: [],
  67062. esds: [],
  67063. ftyp: [],
  67064. hdlr: [],
  67065. mdat: [],
  67066. mdhd: [],
  67067. mdia: [],
  67068. mfhd: [],
  67069. minf: [],
  67070. moof: [],
  67071. moov: [],
  67072. mp4a: [],
  67073. mvex: [],
  67074. mvhd: [],
  67075. pasp: [],
  67076. sdtp: [],
  67077. smhd: [],
  67078. stbl: [],
  67079. stco: [],
  67080. stsc: [],
  67081. stsd: [],
  67082. stsz: [],
  67083. stts: [],
  67084. styp: [],
  67085. tfdt: [],
  67086. tfhd: [],
  67087. traf: [],
  67088. trak: [],
  67089. trun: [],
  67090. trex: [],
  67091. tkhd: [],
  67092. vmhd: []
  67093. };
  67094. if (typeof Uint8Array === "undefined") {
  67095. return;
  67096. }
  67097. for (i2 in types) {
  67098. if (types.hasOwnProperty(i2)) {
  67099. types[i2] = [i2.charCodeAt(0), i2.charCodeAt(1), i2.charCodeAt(2), i2.charCodeAt(3)];
  67100. }
  67101. }
  67102. MAJOR_BRAND = new Uint8Array(["i".charCodeAt(0), "s".charCodeAt(0), "o".charCodeAt(0), "m".charCodeAt(0)]);
  67103. AVC1_BRAND = new Uint8Array(["a".charCodeAt(0), "v".charCodeAt(0), "c".charCodeAt(0), "1".charCodeAt(0)]);
  67104. MINOR_VERSION = new Uint8Array([0, 0, 0, 1]);
  67105. VIDEO_HDLR = new Uint8Array([
  67106. 0,
  67107. 0,
  67108. 0,
  67109. 0,
  67110. 0,
  67111. 0,
  67112. 0,
  67113. 0,
  67114. 118,
  67115. 105,
  67116. 100,
  67117. 101,
  67118. 0,
  67119. 0,
  67120. 0,
  67121. 0,
  67122. 0,
  67123. 0,
  67124. 0,
  67125. 0,
  67126. 0,
  67127. 0,
  67128. 0,
  67129. 0,
  67130. 86,
  67131. 105,
  67132. 100,
  67133. 101,
  67134. 111,
  67135. 72,
  67136. 97,
  67137. 110,
  67138. 100,
  67139. 108,
  67140. 101,
  67141. 114,
  67142. 0
  67143. ]);
  67144. AUDIO_HDLR = new Uint8Array([
  67145. 0,
  67146. 0,
  67147. 0,
  67148. 0,
  67149. 0,
  67150. 0,
  67151. 0,
  67152. 0,
  67153. 115,
  67154. 111,
  67155. 117,
  67156. 110,
  67157. 0,
  67158. 0,
  67159. 0,
  67160. 0,
  67161. 0,
  67162. 0,
  67163. 0,
  67164. 0,
  67165. 0,
  67166. 0,
  67167. 0,
  67168. 0,
  67169. 83,
  67170. 111,
  67171. 117,
  67172. 110,
  67173. 100,
  67174. 72,
  67175. 97,
  67176. 110,
  67177. 100,
  67178. 108,
  67179. 101,
  67180. 114,
  67181. 0
  67182. ]);
  67183. HDLR_TYPES = {
  67184. video: VIDEO_HDLR,
  67185. audio: AUDIO_HDLR
  67186. };
  67187. DREF = new Uint8Array([
  67188. 0,
  67189. 0,
  67190. 0,
  67191. 0,
  67192. 0,
  67193. 0,
  67194. 0,
  67195. 1,
  67196. 0,
  67197. 0,
  67198. 0,
  67199. 12,
  67200. 117,
  67201. 114,
  67202. 108,
  67203. 32,
  67204. 0,
  67205. 0,
  67206. 0,
  67207. 1
  67208. ]);
  67209. SMHD = new Uint8Array([
  67210. 0,
  67211. 0,
  67212. 0,
  67213. 0,
  67214. 0,
  67215. 0,
  67216. 0,
  67217. 0
  67218. ]);
  67219. STCO = new Uint8Array([
  67220. 0,
  67221. 0,
  67222. 0,
  67223. 0,
  67224. 0,
  67225. 0,
  67226. 0,
  67227. 0
  67228. ]);
  67229. STSC = STCO;
  67230. STSZ = new Uint8Array([
  67231. 0,
  67232. 0,
  67233. 0,
  67234. 0,
  67235. 0,
  67236. 0,
  67237. 0,
  67238. 0,
  67239. 0,
  67240. 0,
  67241. 0,
  67242. 0
  67243. ]);
  67244. STTS = STCO;
  67245. VMHD = new Uint8Array([
  67246. 0,
  67247. 0,
  67248. 0,
  67249. 1,
  67250. 0,
  67251. 0,
  67252. 0,
  67253. 0,
  67254. 0,
  67255. 0,
  67256. 0,
  67257. 0
  67258. ]);
  67259. })();
  67260. box = function(type3) {
  67261. var payload = [], size = 0, i2, result, view;
  67262. for (i2 = 1; i2 < arguments.length; i2++) {
  67263. payload.push(arguments[i2]);
  67264. }
  67265. i2 = payload.length;
  67266. while (i2--) {
  67267. size += payload[i2].byteLength;
  67268. }
  67269. result = new Uint8Array(size + 8);
  67270. view = new DataView(result.buffer, result.byteOffset, result.byteLength);
  67271. view.setUint32(0, result.byteLength);
  67272. result.set(type3, 4);
  67273. for (i2 = 0, size = 8; i2 < payload.length; i2++) {
  67274. result.set(payload[i2], size);
  67275. size += payload[i2].byteLength;
  67276. }
  67277. return result;
  67278. };
  67279. dinf = function() {
  67280. return box(types.dinf, box(types.dref, DREF));
  67281. };
  67282. esds = function(track) {
  67283. return box(types.esds, new Uint8Array([
  67284. 0,
  67285. 0,
  67286. 0,
  67287. 0,
  67288. 3,
  67289. 25,
  67290. 0,
  67291. 0,
  67292. 0,
  67293. 4,
  67294. 17,
  67295. 64,
  67296. 21,
  67297. 0,
  67298. 6,
  67299. 0,
  67300. 0,
  67301. 0,
  67302. 218,
  67303. 192,
  67304. 0,
  67305. 0,
  67306. 218,
  67307. 192,
  67308. 5,
  67309. 2,
  67310. track.audioobjecttype << 3 | track.samplingfrequencyindex >>> 1,
  67311. track.samplingfrequencyindex << 7 | track.channelcount << 3,
  67312. 6,
  67313. 1,
  67314. 2
  67315. ]));
  67316. };
  67317. ftyp = function() {
  67318. return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND);
  67319. };
  67320. hdlr = function(type3) {
  67321. return box(types.hdlr, HDLR_TYPES[type3]);
  67322. };
  67323. mdat = function(data) {
  67324. return box(types.mdat, data);
  67325. };
  67326. mdhd = function(track) {
  67327. var result = new Uint8Array([
  67328. 0,
  67329. 0,
  67330. 0,
  67331. 0,
  67332. 0,
  67333. 0,
  67334. 0,
  67335. 2,
  67336. 0,
  67337. 0,
  67338. 0,
  67339. 3,
  67340. 0,
  67341. 1,
  67342. 95,
  67343. 144,
  67344. track.duration >>> 24 & 255,
  67345. track.duration >>> 16 & 255,
  67346. track.duration >>> 8 & 255,
  67347. track.duration & 255,
  67348. 85,
  67349. 196,
  67350. 0,
  67351. 0
  67352. ]);
  67353. if (track.samplerate) {
  67354. result[12] = track.samplerate >>> 24 & 255;
  67355. result[13] = track.samplerate >>> 16 & 255;
  67356. result[14] = track.samplerate >>> 8 & 255;
  67357. result[15] = track.samplerate & 255;
  67358. }
  67359. return box(types.mdhd, result);
  67360. };
  67361. mdia = function(track) {
  67362. return box(types.mdia, mdhd(track), hdlr(track.type), minf(track));
  67363. };
  67364. mfhd = function(sequenceNumber) {
  67365. return box(types.mfhd, new Uint8Array([
  67366. 0,
  67367. 0,
  67368. 0,
  67369. 0,
  67370. (sequenceNumber & 4278190080) >> 24,
  67371. (sequenceNumber & 16711680) >> 16,
  67372. (sequenceNumber & 65280) >> 8,
  67373. sequenceNumber & 255
  67374. ]));
  67375. };
  67376. minf = function(track) {
  67377. return box(types.minf, track.type === "video" ? box(types.vmhd, VMHD) : box(types.smhd, SMHD), dinf(), stbl(track));
  67378. };
  67379. moof = function(sequenceNumber, tracks) {
  67380. var trackFragments = [], i2 = tracks.length;
  67381. while (i2--) {
  67382. trackFragments[i2] = traf(tracks[i2]);
  67383. }
  67384. return box.apply(null, [types.moof, mfhd(sequenceNumber)].concat(trackFragments));
  67385. };
  67386. moov = function(tracks) {
  67387. var i2 = tracks.length, boxes = [];
  67388. while (i2--) {
  67389. boxes[i2] = trak(tracks[i2]);
  67390. }
  67391. return box.apply(null, [types.moov, mvhd(4294967295)].concat(boxes).concat(mvex(tracks)));
  67392. };
  67393. mvex = function(tracks) {
  67394. var i2 = tracks.length, boxes = [];
  67395. while (i2--) {
  67396. boxes[i2] = trex(tracks[i2]);
  67397. }
  67398. return box.apply(null, [types.mvex].concat(boxes));
  67399. };
  67400. mvhd = function(duration5) {
  67401. var bytes = new Uint8Array([
  67402. 0,
  67403. 0,
  67404. 0,
  67405. 0,
  67406. 0,
  67407. 0,
  67408. 0,
  67409. 1,
  67410. 0,
  67411. 0,
  67412. 0,
  67413. 2,
  67414. 0,
  67415. 1,
  67416. 95,
  67417. 144,
  67418. (duration5 & 4278190080) >> 24,
  67419. (duration5 & 16711680) >> 16,
  67420. (duration5 & 65280) >> 8,
  67421. duration5 & 255,
  67422. 0,
  67423. 1,
  67424. 0,
  67425. 0,
  67426. 1,
  67427. 0,
  67428. 0,
  67429. 0,
  67430. 0,
  67431. 0,
  67432. 0,
  67433. 0,
  67434. 0,
  67435. 0,
  67436. 0,
  67437. 0,
  67438. 0,
  67439. 1,
  67440. 0,
  67441. 0,
  67442. 0,
  67443. 0,
  67444. 0,
  67445. 0,
  67446. 0,
  67447. 0,
  67448. 0,
  67449. 0,
  67450. 0,
  67451. 0,
  67452. 0,
  67453. 0,
  67454. 0,
  67455. 1,
  67456. 0,
  67457. 0,
  67458. 0,
  67459. 0,
  67460. 0,
  67461. 0,
  67462. 0,
  67463. 0,
  67464. 0,
  67465. 0,
  67466. 0,
  67467. 0,
  67468. 0,
  67469. 0,
  67470. 64,
  67471. 0,
  67472. 0,
  67473. 0,
  67474. 0,
  67475. 0,
  67476. 0,
  67477. 0,
  67478. 0,
  67479. 0,
  67480. 0,
  67481. 0,
  67482. 0,
  67483. 0,
  67484. 0,
  67485. 0,
  67486. 0,
  67487. 0,
  67488. 0,
  67489. 0,
  67490. 0,
  67491. 0,
  67492. 0,
  67493. 0,
  67494. 0,
  67495. 0,
  67496. 0,
  67497. 0,
  67498. 255,
  67499. 255,
  67500. 255,
  67501. 255
  67502. ]);
  67503. return box(types.mvhd, bytes);
  67504. };
  67505. sdtp = function(track) {
  67506. var samples = track.samples || [], bytes = new Uint8Array(4 + samples.length), flags, i2;
  67507. for (i2 = 0; i2 < samples.length; i2++) {
  67508. flags = samples[i2].flags;
  67509. bytes[i2 + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;
  67510. }
  67511. return box(types.sdtp, bytes);
  67512. };
  67513. stbl = function(track) {
  67514. return box(types.stbl, stsd(track), box(types.stts, STTS), box(types.stsc, STSC), box(types.stsz, STSZ), box(types.stco, STCO));
  67515. };
  67516. (function() {
  67517. var videoSample, audioSample;
  67518. stsd = function(track) {
  67519. return box(types.stsd, new Uint8Array([
  67520. 0,
  67521. 0,
  67522. 0,
  67523. 0,
  67524. 0,
  67525. 0,
  67526. 0,
  67527. 1
  67528. ]), track.type === "video" ? videoSample(track) : audioSample(track));
  67529. };
  67530. videoSample = function(track) {
  67531. var sps = track.sps || [], pps = track.pps || [], sequenceParameterSets = [], pictureParameterSets = [], i2, avc1Box;
  67532. for (i2 = 0; i2 < sps.length; i2++) {
  67533. sequenceParameterSets.push((sps[i2].byteLength & 65280) >>> 8);
  67534. sequenceParameterSets.push(sps[i2].byteLength & 255);
  67535. sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i2]));
  67536. }
  67537. for (i2 = 0; i2 < pps.length; i2++) {
  67538. pictureParameterSets.push((pps[i2].byteLength & 65280) >>> 8);
  67539. pictureParameterSets.push(pps[i2].byteLength & 255);
  67540. pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i2]));
  67541. }
  67542. avc1Box = [types.avc1, new Uint8Array([
  67543. 0,
  67544. 0,
  67545. 0,
  67546. 0,
  67547. 0,
  67548. 0,
  67549. 0,
  67550. 1,
  67551. 0,
  67552. 0,
  67553. 0,
  67554. 0,
  67555. 0,
  67556. 0,
  67557. 0,
  67558. 0,
  67559. 0,
  67560. 0,
  67561. 0,
  67562. 0,
  67563. 0,
  67564. 0,
  67565. 0,
  67566. 0,
  67567. (track.width & 65280) >> 8,
  67568. track.width & 255,
  67569. (track.height & 65280) >> 8,
  67570. track.height & 255,
  67571. 0,
  67572. 72,
  67573. 0,
  67574. 0,
  67575. 0,
  67576. 72,
  67577. 0,
  67578. 0,
  67579. 0,
  67580. 0,
  67581. 0,
  67582. 0,
  67583. 0,
  67584. 1,
  67585. 19,
  67586. 118,
  67587. 105,
  67588. 100,
  67589. 101,
  67590. 111,
  67591. 106,
  67592. 115,
  67593. 45,
  67594. 99,
  67595. 111,
  67596. 110,
  67597. 116,
  67598. 114,
  67599. 105,
  67600. 98,
  67601. 45,
  67602. 104,
  67603. 108,
  67604. 115,
  67605. 0,
  67606. 0,
  67607. 0,
  67608. 0,
  67609. 0,
  67610. 0,
  67611. 0,
  67612. 0,
  67613. 0,
  67614. 0,
  67615. 0,
  67616. 0,
  67617. 0,
  67618. 24,
  67619. 17,
  67620. 17
  67621. ]), box(types.avcC, new Uint8Array([
  67622. 1,
  67623. track.profileIdc,
  67624. track.profileCompatibility,
  67625. track.levelIdc,
  67626. 255
  67627. ].concat(
  67628. [sps.length],
  67629. sequenceParameterSets,
  67630. [pps.length],
  67631. pictureParameterSets
  67632. ))), box(types.btrt, new Uint8Array([
  67633. 0,
  67634. 28,
  67635. 156,
  67636. 128,
  67637. 0,
  67638. 45,
  67639. 198,
  67640. 192,
  67641. 0,
  67642. 45,
  67643. 198,
  67644. 192
  67645. ]))];
  67646. if (track.sarRatio) {
  67647. var hSpacing = track.sarRatio[0], vSpacing = track.sarRatio[1];
  67648. avc1Box.push(box(types.pasp, new Uint8Array([(hSpacing & 4278190080) >> 24, (hSpacing & 16711680) >> 16, (hSpacing & 65280) >> 8, hSpacing & 255, (vSpacing & 4278190080) >> 24, (vSpacing & 16711680) >> 16, (vSpacing & 65280) >> 8, vSpacing & 255])));
  67649. }
  67650. return box.apply(null, avc1Box);
  67651. };
  67652. audioSample = function(track) {
  67653. return box(types.mp4a, new Uint8Array([
  67654. 0,
  67655. 0,
  67656. 0,
  67657. 0,
  67658. 0,
  67659. 0,
  67660. 0,
  67661. 1,
  67662. 0,
  67663. 0,
  67664. 0,
  67665. 0,
  67666. 0,
  67667. 0,
  67668. 0,
  67669. 0,
  67670. (track.channelcount & 65280) >> 8,
  67671. track.channelcount & 255,
  67672. (track.samplesize & 65280) >> 8,
  67673. track.samplesize & 255,
  67674. 0,
  67675. 0,
  67676. 0,
  67677. 0,
  67678. (track.samplerate & 65280) >> 8,
  67679. track.samplerate & 255,
  67680. 0,
  67681. 0
  67682. ]), esds(track));
  67683. };
  67684. })();
  67685. tkhd = function(track) {
  67686. var result = new Uint8Array([
  67687. 0,
  67688. 0,
  67689. 0,
  67690. 7,
  67691. 0,
  67692. 0,
  67693. 0,
  67694. 0,
  67695. 0,
  67696. 0,
  67697. 0,
  67698. 0,
  67699. (track.id & 4278190080) >> 24,
  67700. (track.id & 16711680) >> 16,
  67701. (track.id & 65280) >> 8,
  67702. track.id & 255,
  67703. 0,
  67704. 0,
  67705. 0,
  67706. 0,
  67707. (track.duration & 4278190080) >> 24,
  67708. (track.duration & 16711680) >> 16,
  67709. (track.duration & 65280) >> 8,
  67710. track.duration & 255,
  67711. 0,
  67712. 0,
  67713. 0,
  67714. 0,
  67715. 0,
  67716. 0,
  67717. 0,
  67718. 0,
  67719. 0,
  67720. 0,
  67721. 0,
  67722. 0,
  67723. 1,
  67724. 0,
  67725. 0,
  67726. 0,
  67727. 0,
  67728. 1,
  67729. 0,
  67730. 0,
  67731. 0,
  67732. 0,
  67733. 0,
  67734. 0,
  67735. 0,
  67736. 0,
  67737. 0,
  67738. 0,
  67739. 0,
  67740. 0,
  67741. 0,
  67742. 0,
  67743. 0,
  67744. 1,
  67745. 0,
  67746. 0,
  67747. 0,
  67748. 0,
  67749. 0,
  67750. 0,
  67751. 0,
  67752. 0,
  67753. 0,
  67754. 0,
  67755. 0,
  67756. 0,
  67757. 0,
  67758. 0,
  67759. 64,
  67760. 0,
  67761. 0,
  67762. 0,
  67763. (track.width & 65280) >> 8,
  67764. track.width & 255,
  67765. 0,
  67766. 0,
  67767. (track.height & 65280) >> 8,
  67768. track.height & 255,
  67769. 0,
  67770. 0
  67771. ]);
  67772. return box(types.tkhd, result);
  67773. };
  67774. traf = function(track) {
  67775. var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable, dataOffset, upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime;
  67776. trackFragmentHeader = box(types.tfhd, new Uint8Array([
  67777. 0,
  67778. 0,
  67779. 0,
  67780. 58,
  67781. (track.id & 4278190080) >> 24,
  67782. (track.id & 16711680) >> 16,
  67783. (track.id & 65280) >> 8,
  67784. track.id & 255,
  67785. 0,
  67786. 0,
  67787. 0,
  67788. 1,
  67789. 0,
  67790. 0,
  67791. 0,
  67792. 0,
  67793. 0,
  67794. 0,
  67795. 0,
  67796. 0,
  67797. 0,
  67798. 0,
  67799. 0,
  67800. 0
  67801. ]));
  67802. upperWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime / MAX_UINT322);
  67803. lowerWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime % MAX_UINT322);
  67804. trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([
  67805. 1,
  67806. 0,
  67807. 0,
  67808. 0,
  67809. upperWordBaseMediaDecodeTime >>> 24 & 255,
  67810. upperWordBaseMediaDecodeTime >>> 16 & 255,
  67811. upperWordBaseMediaDecodeTime >>> 8 & 255,
  67812. upperWordBaseMediaDecodeTime & 255,
  67813. lowerWordBaseMediaDecodeTime >>> 24 & 255,
  67814. lowerWordBaseMediaDecodeTime >>> 16 & 255,
  67815. lowerWordBaseMediaDecodeTime >>> 8 & 255,
  67816. lowerWordBaseMediaDecodeTime & 255
  67817. ]));
  67818. dataOffset = 32 + 20 + 8 + 16 + 8 + 8;
  67819. if (track.type === "audio") {
  67820. trackFragmentRun = trun$1(track, dataOffset);
  67821. return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun);
  67822. }
  67823. sampleDependencyTable = sdtp(track);
  67824. trackFragmentRun = trun$1(track, sampleDependencyTable.length + dataOffset);
  67825. return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable);
  67826. };
  67827. trak = function(track) {
  67828. track.duration = track.duration || 4294967295;
  67829. return box(types.trak, tkhd(track), mdia(track));
  67830. };
  67831. trex = function(track) {
  67832. var result = new Uint8Array([
  67833. 0,
  67834. 0,
  67835. 0,
  67836. 0,
  67837. (track.id & 4278190080) >> 24,
  67838. (track.id & 16711680) >> 16,
  67839. (track.id & 65280) >> 8,
  67840. track.id & 255,
  67841. 0,
  67842. 0,
  67843. 0,
  67844. 1,
  67845. 0,
  67846. 0,
  67847. 0,
  67848. 0,
  67849. 0,
  67850. 0,
  67851. 0,
  67852. 0,
  67853. 0,
  67854. 1,
  67855. 0,
  67856. 1
  67857. ]);
  67858. if (track.type !== "video") {
  67859. result[result.length - 1] = 0;
  67860. }
  67861. return box(types.trex, result);
  67862. };
  67863. (function() {
  67864. var audioTrun, videoTrun, trunHeader;
  67865. trunHeader = function(samples, offset) {
  67866. var durationPresent = 0, sizePresent = 0, flagsPresent = 0, compositionTimeOffset = 0;
  67867. if (samples.length) {
  67868. if (samples[0].duration !== void 0) {
  67869. durationPresent = 1;
  67870. }
  67871. if (samples[0].size !== void 0) {
  67872. sizePresent = 2;
  67873. }
  67874. if (samples[0].flags !== void 0) {
  67875. flagsPresent = 4;
  67876. }
  67877. if (samples[0].compositionTimeOffset !== void 0) {
  67878. compositionTimeOffset = 8;
  67879. }
  67880. }
  67881. return [
  67882. 0,
  67883. 0,
  67884. durationPresent | sizePresent | flagsPresent | compositionTimeOffset,
  67885. 1,
  67886. (samples.length & 4278190080) >>> 24,
  67887. (samples.length & 16711680) >>> 16,
  67888. (samples.length & 65280) >>> 8,
  67889. samples.length & 255,
  67890. (offset & 4278190080) >>> 24,
  67891. (offset & 16711680) >>> 16,
  67892. (offset & 65280) >>> 8,
  67893. offset & 255
  67894. ];
  67895. };
  67896. videoTrun = function(track, offset) {
  67897. var bytesOffest, bytes, header, samples, sample, i2;
  67898. samples = track.samples || [];
  67899. offset += 8 + 12 + 16 * samples.length;
  67900. header = trunHeader(samples, offset);
  67901. bytes = new Uint8Array(header.length + samples.length * 16);
  67902. bytes.set(header);
  67903. bytesOffest = header.length;
  67904. for (i2 = 0; i2 < samples.length; i2++) {
  67905. sample = samples[i2];
  67906. bytes[bytesOffest++] = (sample.duration & 4278190080) >>> 24;
  67907. bytes[bytesOffest++] = (sample.duration & 16711680) >>> 16;
  67908. bytes[bytesOffest++] = (sample.duration & 65280) >>> 8;
  67909. bytes[bytesOffest++] = sample.duration & 255;
  67910. bytes[bytesOffest++] = (sample.size & 4278190080) >>> 24;
  67911. bytes[bytesOffest++] = (sample.size & 16711680) >>> 16;
  67912. bytes[bytesOffest++] = (sample.size & 65280) >>> 8;
  67913. bytes[bytesOffest++] = sample.size & 255;
  67914. bytes[bytesOffest++] = sample.flags.isLeading << 2 | sample.flags.dependsOn;
  67915. bytes[bytesOffest++] = sample.flags.isDependedOn << 6 | sample.flags.hasRedundancy << 4 | sample.flags.paddingValue << 1 | sample.flags.isNonSyncSample;
  67916. bytes[bytesOffest++] = sample.flags.degradationPriority & 240 << 8;
  67917. bytes[bytesOffest++] = sample.flags.degradationPriority & 15;
  67918. bytes[bytesOffest++] = (sample.compositionTimeOffset & 4278190080) >>> 24;
  67919. bytes[bytesOffest++] = (sample.compositionTimeOffset & 16711680) >>> 16;
  67920. bytes[bytesOffest++] = (sample.compositionTimeOffset & 65280) >>> 8;
  67921. bytes[bytesOffest++] = sample.compositionTimeOffset & 255;
  67922. }
  67923. return box(types.trun, bytes);
  67924. };
  67925. audioTrun = function(track, offset) {
  67926. var bytes, bytesOffest, header, samples, sample, i2;
  67927. samples = track.samples || [];
  67928. offset += 8 + 12 + 8 * samples.length;
  67929. header = trunHeader(samples, offset);
  67930. bytes = new Uint8Array(header.length + samples.length * 8);
  67931. bytes.set(header);
  67932. bytesOffest = header.length;
  67933. for (i2 = 0; i2 < samples.length; i2++) {
  67934. sample = samples[i2];
  67935. bytes[bytesOffest++] = (sample.duration & 4278190080) >>> 24;
  67936. bytes[bytesOffest++] = (sample.duration & 16711680) >>> 16;
  67937. bytes[bytesOffest++] = (sample.duration & 65280) >>> 8;
  67938. bytes[bytesOffest++] = sample.duration & 255;
  67939. bytes[bytesOffest++] = (sample.size & 4278190080) >>> 24;
  67940. bytes[bytesOffest++] = (sample.size & 16711680) >>> 16;
  67941. bytes[bytesOffest++] = (sample.size & 65280) >>> 8;
  67942. bytes[bytesOffest++] = sample.size & 255;
  67943. }
  67944. return box(types.trun, bytes);
  67945. };
  67946. trun$1 = function(track, offset) {
  67947. if (track.type === "audio") {
  67948. return audioTrun(track, offset);
  67949. }
  67950. return videoTrun(track, offset);
  67951. };
  67952. })();
  67953. var mp4Generator = {
  67954. ftyp,
  67955. mdat,
  67956. moof,
  67957. moov,
  67958. initSegment: function(tracks) {
  67959. var fileType = ftyp(), movie = moov(tracks), result;
  67960. result = new Uint8Array(fileType.byteLength + movie.byteLength);
  67961. result.set(fileType);
  67962. result.set(movie, fileType.byteLength);
  67963. return result;
  67964. }
  67965. };
  67966. var groupNalsIntoFrames = function(nalUnits) {
  67967. var i2, currentNal, currentFrame = [], frames = [];
  67968. frames.byteLength = 0;
  67969. frames.nalCount = 0;
  67970. frames.duration = 0;
  67971. currentFrame.byteLength = 0;
  67972. for (i2 = 0; i2 < nalUnits.length; i2++) {
  67973. currentNal = nalUnits[i2];
  67974. if (currentNal.nalUnitType === "access_unit_delimiter_rbsp") {
  67975. if (currentFrame.length) {
  67976. currentFrame.duration = currentNal.dts - currentFrame.dts;
  67977. frames.byteLength += currentFrame.byteLength;
  67978. frames.nalCount += currentFrame.length;
  67979. frames.duration += currentFrame.duration;
  67980. frames.push(currentFrame);
  67981. }
  67982. currentFrame = [currentNal];
  67983. currentFrame.byteLength = currentNal.data.byteLength;
  67984. currentFrame.pts = currentNal.pts;
  67985. currentFrame.dts = currentNal.dts;
  67986. } else {
  67987. if (currentNal.nalUnitType === "slice_layer_without_partitioning_rbsp_idr") {
  67988. currentFrame.keyFrame = true;
  67989. }
  67990. currentFrame.duration = currentNal.dts - currentFrame.dts;
  67991. currentFrame.byteLength += currentNal.data.byteLength;
  67992. currentFrame.push(currentNal);
  67993. }
  67994. }
  67995. if (frames.length && (!currentFrame.duration || currentFrame.duration <= 0)) {
  67996. currentFrame.duration = frames[frames.length - 1].duration;
  67997. }
  67998. frames.byteLength += currentFrame.byteLength;
  67999. frames.nalCount += currentFrame.length;
  68000. frames.duration += currentFrame.duration;
  68001. frames.push(currentFrame);
  68002. return frames;
  68003. };
  68004. var groupFramesIntoGops = function(frames) {
  68005. var i2, currentFrame, currentGop = [], gops = [];
  68006. currentGop.byteLength = 0;
  68007. currentGop.nalCount = 0;
  68008. currentGop.duration = 0;
  68009. currentGop.pts = frames[0].pts;
  68010. currentGop.dts = frames[0].dts;
  68011. gops.byteLength = 0;
  68012. gops.nalCount = 0;
  68013. gops.duration = 0;
  68014. gops.pts = frames[0].pts;
  68015. gops.dts = frames[0].dts;
  68016. for (i2 = 0; i2 < frames.length; i2++) {
  68017. currentFrame = frames[i2];
  68018. if (currentFrame.keyFrame) {
  68019. if (currentGop.length) {
  68020. gops.push(currentGop);
  68021. gops.byteLength += currentGop.byteLength;
  68022. gops.nalCount += currentGop.nalCount;
  68023. gops.duration += currentGop.duration;
  68024. }
  68025. currentGop = [currentFrame];
  68026. currentGop.nalCount = currentFrame.length;
  68027. currentGop.byteLength = currentFrame.byteLength;
  68028. currentGop.pts = currentFrame.pts;
  68029. currentGop.dts = currentFrame.dts;
  68030. currentGop.duration = currentFrame.duration;
  68031. } else {
  68032. currentGop.duration += currentFrame.duration;
  68033. currentGop.nalCount += currentFrame.length;
  68034. currentGop.byteLength += currentFrame.byteLength;
  68035. currentGop.push(currentFrame);
  68036. }
  68037. }
  68038. if (gops.length && currentGop.duration <= 0) {
  68039. currentGop.duration = gops[gops.length - 1].duration;
  68040. }
  68041. gops.byteLength += currentGop.byteLength;
  68042. gops.nalCount += currentGop.nalCount;
  68043. gops.duration += currentGop.duration;
  68044. gops.push(currentGop);
  68045. return gops;
  68046. };
  68047. var extendFirstKeyFrame = function(gops) {
  68048. var currentGop;
  68049. if (!gops[0][0].keyFrame && gops.length > 1) {
  68050. currentGop = gops.shift();
  68051. gops.byteLength -= currentGop.byteLength;
  68052. gops.nalCount -= currentGop.nalCount;
  68053. gops[0][0].dts = currentGop.dts;
  68054. gops[0][0].pts = currentGop.pts;
  68055. gops[0][0].duration += currentGop.duration;
  68056. }
  68057. return gops;
  68058. };
  68059. var createDefaultSample = function() {
  68060. return {
  68061. size: 0,
  68062. flags: {
  68063. isLeading: 0,
  68064. dependsOn: 1,
  68065. isDependedOn: 0,
  68066. hasRedundancy: 0,
  68067. degradationPriority: 0,
  68068. isNonSyncSample: 1
  68069. }
  68070. };
  68071. };
  68072. var sampleForFrame = function(frame, dataOffset) {
  68073. var sample = createDefaultSample();
  68074. sample.dataOffset = dataOffset;
  68075. sample.compositionTimeOffset = frame.pts - frame.dts;
  68076. sample.duration = frame.duration;
  68077. sample.size = 4 * frame.length;
  68078. sample.size += frame.byteLength;
  68079. if (frame.keyFrame) {
  68080. sample.flags.dependsOn = 2;
  68081. sample.flags.isNonSyncSample = 0;
  68082. }
  68083. return sample;
  68084. };
  68085. var generateSampleTable$1 = function(gops, baseDataOffset) {
  68086. var h2, i2, sample, currentGop, currentFrame, dataOffset = baseDataOffset || 0, samples = [];
  68087. for (h2 = 0; h2 < gops.length; h2++) {
  68088. currentGop = gops[h2];
  68089. for (i2 = 0; i2 < currentGop.length; i2++) {
  68090. currentFrame = currentGop[i2];
  68091. sample = sampleForFrame(currentFrame, dataOffset);
  68092. dataOffset += sample.size;
  68093. samples.push(sample);
  68094. }
  68095. }
  68096. return samples;
  68097. };
  68098. var concatenateNalData = function(gops) {
  68099. var h2, i2, j, currentGop, currentFrame, currentNal, dataOffset = 0, nalsByteLength = gops.byteLength, numberOfNals = gops.nalCount, totalByteLength = nalsByteLength + 4 * numberOfNals, data = new Uint8Array(totalByteLength), view = new DataView(data.buffer);
  68100. for (h2 = 0; h2 < gops.length; h2++) {
  68101. currentGop = gops[h2];
  68102. for (i2 = 0; i2 < currentGop.length; i2++) {
  68103. currentFrame = currentGop[i2];
  68104. for (j = 0; j < currentFrame.length; j++) {
  68105. currentNal = currentFrame[j];
  68106. view.setUint32(dataOffset, currentNal.data.byteLength);
  68107. dataOffset += 4;
  68108. data.set(currentNal.data, dataOffset);
  68109. dataOffset += currentNal.data.byteLength;
  68110. }
  68111. }
  68112. }
  68113. return data;
  68114. };
  68115. var generateSampleTableForFrame = function(frame, baseDataOffset) {
  68116. var sample, dataOffset = baseDataOffset || 0, samples = [];
  68117. sample = sampleForFrame(frame, dataOffset);
  68118. samples.push(sample);
  68119. return samples;
  68120. };
  68121. var concatenateNalDataForFrame = function(frame) {
  68122. var i2, currentNal, dataOffset = 0, nalsByteLength = frame.byteLength, numberOfNals = frame.length, totalByteLength = nalsByteLength + 4 * numberOfNals, data = new Uint8Array(totalByteLength), view = new DataView(data.buffer);
  68123. for (i2 = 0; i2 < frame.length; i2++) {
  68124. currentNal = frame[i2];
  68125. view.setUint32(dataOffset, currentNal.data.byteLength);
  68126. dataOffset += 4;
  68127. data.set(currentNal.data, dataOffset);
  68128. dataOffset += currentNal.data.byteLength;
  68129. }
  68130. return data;
  68131. };
  68132. var frameUtils$1 = {
  68133. groupNalsIntoFrames,
  68134. groupFramesIntoGops,
  68135. extendFirstKeyFrame,
  68136. generateSampleTable: generateSampleTable$1,
  68137. concatenateNalData,
  68138. generateSampleTableForFrame,
  68139. concatenateNalDataForFrame
  68140. };
  68141. var highPrefix = [33, 16, 5, 32, 164, 27];
  68142. var lowPrefix = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252];
  68143. var zeroFill = function(count) {
  68144. var a = [];
  68145. while (count--) {
  68146. a.push(0);
  68147. }
  68148. return a;
  68149. };
  68150. var makeTable = function(metaTable) {
  68151. return Object.keys(metaTable).reduce(function(obj, key) {
  68152. obj[key] = new Uint8Array(metaTable[key].reduce(function(arr, part) {
  68153. return arr.concat(part);
  68154. }, []));
  68155. return obj;
  68156. }, {});
  68157. };
  68158. var silence;
  68159. var silence_1 = function() {
  68160. if (!silence) {
  68161. var coneOfSilence2 = {
  68162. 96e3: [highPrefix, [227, 64], zeroFill(154), [56]],
  68163. 88200: [highPrefix, [231], zeroFill(170), [56]],
  68164. 64e3: [highPrefix, [248, 192], zeroFill(240), [56]],
  68165. 48e3: [highPrefix, [255, 192], zeroFill(268), [55, 148, 128], zeroFill(54), [112]],
  68166. 44100: [highPrefix, [255, 192], zeroFill(268), [55, 163, 128], zeroFill(84), [112]],
  68167. 32e3: [highPrefix, [255, 192], zeroFill(268), [55, 234], zeroFill(226), [112]],
  68168. 24e3: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 112], zeroFill(126), [224]],
  68169. 16e3: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 255], zeroFill(269), [223, 108], zeroFill(195), [1, 192]],
  68170. 12e3: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 253, 128], zeroFill(259), [56]],
  68171. 11025: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 255, 192], zeroFill(268), [55, 175, 128], zeroFill(108), [112]],
  68172. 8e3: [lowPrefix, zeroFill(268), [3, 121, 16], zeroFill(47), [7]]
  68173. };
  68174. silence = makeTable(coneOfSilence2);
  68175. }
  68176. return silence;
  68177. };
  68178. var ONE_SECOND_IN_TS$4 = 9e4, secondsToVideoTs2, secondsToAudioTs2, videoTsToSeconds2, audioTsToSeconds2, audioTsToVideoTs2, videoTsToAudioTs2, metadataTsToSeconds2;
  68179. secondsToVideoTs2 = function(seconds) {
  68180. return seconds * ONE_SECOND_IN_TS$4;
  68181. };
  68182. secondsToAudioTs2 = function(seconds, sampleRate) {
  68183. return seconds * sampleRate;
  68184. };
  68185. videoTsToSeconds2 = function(timestamp) {
  68186. return timestamp / ONE_SECOND_IN_TS$4;
  68187. };
  68188. audioTsToSeconds2 = function(timestamp, sampleRate) {
  68189. return timestamp / sampleRate;
  68190. };
  68191. audioTsToVideoTs2 = function(timestamp, sampleRate) {
  68192. return secondsToVideoTs2(audioTsToSeconds2(timestamp, sampleRate));
  68193. };
  68194. videoTsToAudioTs2 = function(timestamp, sampleRate) {
  68195. return secondsToAudioTs2(videoTsToSeconds2(timestamp), sampleRate);
  68196. };
  68197. metadataTsToSeconds2 = function(timestamp, timelineStartPts, keepOriginalTimestamps) {
  68198. return videoTsToSeconds2(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);
  68199. };
  68200. var clock$2 = {
  68201. ONE_SECOND_IN_TS: ONE_SECOND_IN_TS$4,
  68202. secondsToVideoTs: secondsToVideoTs2,
  68203. secondsToAudioTs: secondsToAudioTs2,
  68204. videoTsToSeconds: videoTsToSeconds2,
  68205. audioTsToSeconds: audioTsToSeconds2,
  68206. audioTsToVideoTs: audioTsToVideoTs2,
  68207. videoTsToAudioTs: videoTsToAudioTs2,
  68208. metadataTsToSeconds: metadataTsToSeconds2
  68209. };
  68210. var coneOfSilence = silence_1;
  68211. var clock$12 = clock$2;
  68212. var sumFrameByteLengths = function(array) {
  68213. var i2, currentObj, sum = 0;
  68214. for (i2 = 0; i2 < array.length; i2++) {
  68215. currentObj = array[i2];
  68216. sum += currentObj.data.byteLength;
  68217. }
  68218. return sum;
  68219. };
  68220. var prefixWithSilence = function(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime) {
  68221. var baseMediaDecodeTimeTs, frameDuration = 0, audioGapDuration = 0, audioFillFrameCount = 0, audioFillDuration = 0, silentFrame, i2, firstFrame;
  68222. if (!frames.length) {
  68223. return;
  68224. }
  68225. baseMediaDecodeTimeTs = clock$12.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate);
  68226. frameDuration = Math.ceil(clock$12.ONE_SECOND_IN_TS / (track.samplerate / 1024));
  68227. if (audioAppendStartTs && videoBaseMediaDecodeTime) {
  68228. audioGapDuration = baseMediaDecodeTimeTs - Math.max(audioAppendStartTs, videoBaseMediaDecodeTime);
  68229. audioFillFrameCount = Math.floor(audioGapDuration / frameDuration);
  68230. audioFillDuration = audioFillFrameCount * frameDuration;
  68231. }
  68232. if (audioFillFrameCount < 1 || audioFillDuration > clock$12.ONE_SECOND_IN_TS / 2) {
  68233. return;
  68234. }
  68235. silentFrame = coneOfSilence()[track.samplerate];
  68236. if (!silentFrame) {
  68237. silentFrame = frames[0].data;
  68238. }
  68239. for (i2 = 0; i2 < audioFillFrameCount; i2++) {
  68240. firstFrame = frames[0];
  68241. frames.splice(0, 0, {
  68242. data: silentFrame,
  68243. dts: firstFrame.dts - frameDuration,
  68244. pts: firstFrame.pts - frameDuration
  68245. });
  68246. }
  68247. track.baseMediaDecodeTime -= Math.floor(clock$12.videoTsToAudioTs(audioFillDuration, track.samplerate));
  68248. return audioFillDuration;
  68249. };
  68250. var trimAdtsFramesByEarliestDts = function(adtsFrames, track, earliestAllowedDts) {
  68251. if (track.minSegmentDts >= earliestAllowedDts) {
  68252. return adtsFrames;
  68253. }
  68254. track.minSegmentDts = Infinity;
  68255. return adtsFrames.filter(function(currentFrame) {
  68256. if (currentFrame.dts >= earliestAllowedDts) {
  68257. track.minSegmentDts = Math.min(track.minSegmentDts, currentFrame.dts);
  68258. track.minSegmentPts = track.minSegmentDts;
  68259. return true;
  68260. }
  68261. return false;
  68262. });
  68263. };
  68264. var generateSampleTable = function(frames) {
  68265. var i2, currentFrame, samples = [];
  68266. for (i2 = 0; i2 < frames.length; i2++) {
  68267. currentFrame = frames[i2];
  68268. samples.push({
  68269. size: currentFrame.data.byteLength,
  68270. duration: 1024
  68271. });
  68272. }
  68273. return samples;
  68274. };
  68275. var concatenateFrameData = function(frames) {
  68276. var i2, currentFrame, dataOffset = 0, data = new Uint8Array(sumFrameByteLengths(frames));
  68277. for (i2 = 0; i2 < frames.length; i2++) {
  68278. currentFrame = frames[i2];
  68279. data.set(currentFrame.data, dataOffset);
  68280. dataOffset += currentFrame.data.byteLength;
  68281. }
  68282. return data;
  68283. };
  68284. var audioFrameUtils$1 = {
  68285. prefixWithSilence,
  68286. trimAdtsFramesByEarliestDts,
  68287. generateSampleTable,
  68288. concatenateFrameData
  68289. };
  68290. var ONE_SECOND_IN_TS$3 = clock$2.ONE_SECOND_IN_TS;
  68291. var collectDtsInfo = function(track, data) {
  68292. if (typeof data.pts === "number") {
  68293. if (track.timelineStartInfo.pts === void 0) {
  68294. track.timelineStartInfo.pts = data.pts;
  68295. }
  68296. if (track.minSegmentPts === void 0) {
  68297. track.minSegmentPts = data.pts;
  68298. } else {
  68299. track.minSegmentPts = Math.min(track.minSegmentPts, data.pts);
  68300. }
  68301. if (track.maxSegmentPts === void 0) {
  68302. track.maxSegmentPts = data.pts;
  68303. } else {
  68304. track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts);
  68305. }
  68306. }
  68307. if (typeof data.dts === "number") {
  68308. if (track.timelineStartInfo.dts === void 0) {
  68309. track.timelineStartInfo.dts = data.dts;
  68310. }
  68311. if (track.minSegmentDts === void 0) {
  68312. track.minSegmentDts = data.dts;
  68313. } else {
  68314. track.minSegmentDts = Math.min(track.minSegmentDts, data.dts);
  68315. }
  68316. if (track.maxSegmentDts === void 0) {
  68317. track.maxSegmentDts = data.dts;
  68318. } else {
  68319. track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts);
  68320. }
  68321. }
  68322. };
  68323. var clearDtsInfo = function(track) {
  68324. delete track.minSegmentDts;
  68325. delete track.maxSegmentDts;
  68326. delete track.minSegmentPts;
  68327. delete track.maxSegmentPts;
  68328. };
  68329. var calculateTrackBaseMediaDecodeTime = function(track, keepOriginalTimestamps) {
  68330. var baseMediaDecodeTime, scale, minSegmentDts = track.minSegmentDts;
  68331. if (!keepOriginalTimestamps) {
  68332. minSegmentDts -= track.timelineStartInfo.dts;
  68333. }
  68334. baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime;
  68335. baseMediaDecodeTime += minSegmentDts;
  68336. baseMediaDecodeTime = Math.max(0, baseMediaDecodeTime);
  68337. if (track.type === "audio") {
  68338. scale = track.samplerate / ONE_SECOND_IN_TS$3;
  68339. baseMediaDecodeTime *= scale;
  68340. baseMediaDecodeTime = Math.floor(baseMediaDecodeTime);
  68341. }
  68342. return baseMediaDecodeTime;
  68343. };
  68344. var trackDecodeInfo$1 = {
  68345. clearDtsInfo,
  68346. calculateTrackBaseMediaDecodeTime,
  68347. collectDtsInfo
  68348. };
  68349. var USER_DATA_REGISTERED_ITU_T_T35 = 4, RBSP_TRAILING_BITS = 128;
  68350. var parseSei = function(bytes) {
  68351. var i2 = 0, result = {
  68352. payloadType: -1,
  68353. payloadSize: 0
  68354. }, payloadType = 0, payloadSize = 0;
  68355. while (i2 < bytes.byteLength) {
  68356. if (bytes[i2] === RBSP_TRAILING_BITS) {
  68357. break;
  68358. }
  68359. while (bytes[i2] === 255) {
  68360. payloadType += 255;
  68361. i2++;
  68362. }
  68363. payloadType += bytes[i2++];
  68364. while (bytes[i2] === 255) {
  68365. payloadSize += 255;
  68366. i2++;
  68367. }
  68368. payloadSize += bytes[i2++];
  68369. if (!result.payload && payloadType === USER_DATA_REGISTERED_ITU_T_T35) {
  68370. var userIdentifier = String.fromCharCode(bytes[i2 + 3], bytes[i2 + 4], bytes[i2 + 5], bytes[i2 + 6]);
  68371. if (userIdentifier === "GA94") {
  68372. result.payloadType = payloadType;
  68373. result.payloadSize = payloadSize;
  68374. result.payload = bytes.subarray(i2, i2 + payloadSize);
  68375. break;
  68376. } else {
  68377. result.payload = void 0;
  68378. }
  68379. }
  68380. i2 += payloadSize;
  68381. payloadType = 0;
  68382. payloadSize = 0;
  68383. }
  68384. return result;
  68385. };
  68386. var parseUserData = function(sei) {
  68387. if (sei.payload[0] !== 181) {
  68388. return null;
  68389. }
  68390. if ((sei.payload[1] << 8 | sei.payload[2]) !== 49) {
  68391. return null;
  68392. }
  68393. if (String.fromCharCode(sei.payload[3], sei.payload[4], sei.payload[5], sei.payload[6]) !== "GA94") {
  68394. return null;
  68395. }
  68396. if (sei.payload[7] !== 3) {
  68397. return null;
  68398. }
  68399. return sei.payload.subarray(8, sei.payload.length - 1);
  68400. };
  68401. var parseCaptionPackets = function(pts, userData) {
  68402. var results = [], i2, count, offset, data;
  68403. if (!(userData[0] & 64)) {
  68404. return results;
  68405. }
  68406. count = userData[0] & 31;
  68407. for (i2 = 0; i2 < count; i2++) {
  68408. offset = i2 * 3;
  68409. data = {
  68410. type: userData[offset + 2] & 3,
  68411. pts
  68412. };
  68413. if (userData[offset + 2] & 4) {
  68414. data.ccData = userData[offset + 3] << 8 | userData[offset + 4];
  68415. results.push(data);
  68416. }
  68417. }
  68418. return results;
  68419. };
  68420. var discardEmulationPreventionBytes$12 = function(data) {
  68421. var length = data.byteLength, emulationPreventionBytesPositions = [], i2 = 1, newLength, newData;
  68422. while (i2 < length - 2) {
  68423. if (data[i2] === 0 && data[i2 + 1] === 0 && data[i2 + 2] === 3) {
  68424. emulationPreventionBytesPositions.push(i2 + 2);
  68425. i2 += 2;
  68426. } else {
  68427. i2++;
  68428. }
  68429. }
  68430. if (emulationPreventionBytesPositions.length === 0) {
  68431. return data;
  68432. }
  68433. newLength = length - emulationPreventionBytesPositions.length;
  68434. newData = new Uint8Array(newLength);
  68435. var sourceIndex = 0;
  68436. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  68437. if (sourceIndex === emulationPreventionBytesPositions[0]) {
  68438. sourceIndex++;
  68439. emulationPreventionBytesPositions.shift();
  68440. }
  68441. newData[i2] = data[sourceIndex];
  68442. }
  68443. return newData;
  68444. };
  68445. var captionPacketParser = {
  68446. parseSei,
  68447. parseUserData,
  68448. parseCaptionPackets,
  68449. discardEmulationPreventionBytes: discardEmulationPreventionBytes$12,
  68450. USER_DATA_REGISTERED_ITU_T_T35
  68451. };
  68452. var Stream$7 = stream;
  68453. var cea708Parser = captionPacketParser;
  68454. var CaptionStream$2 = function(options2) {
  68455. options2 = options2 || {};
  68456. CaptionStream$2.prototype.init.call(this);
  68457. this.parse708captions_ = typeof options2.parse708captions === "boolean" ? options2.parse708captions : true;
  68458. this.captionPackets_ = [];
  68459. this.ccStreams_ = [
  68460. new Cea608Stream(0, 0),
  68461. new Cea608Stream(0, 1),
  68462. new Cea608Stream(1, 0),
  68463. new Cea608Stream(1, 1)
  68464. ];
  68465. if (this.parse708captions_) {
  68466. this.cc708Stream_ = new Cea708Stream({
  68467. captionServices: options2.captionServices
  68468. });
  68469. }
  68470. this.reset();
  68471. this.ccStreams_.forEach(function(cc) {
  68472. cc.on("data", this.trigger.bind(this, "data"));
  68473. cc.on("partialdone", this.trigger.bind(this, "partialdone"));
  68474. cc.on("done", this.trigger.bind(this, "done"));
  68475. }, this);
  68476. if (this.parse708captions_) {
  68477. this.cc708Stream_.on("data", this.trigger.bind(this, "data"));
  68478. this.cc708Stream_.on("partialdone", this.trigger.bind(this, "partialdone"));
  68479. this.cc708Stream_.on("done", this.trigger.bind(this, "done"));
  68480. }
  68481. };
  68482. CaptionStream$2.prototype = new Stream$7();
  68483. CaptionStream$2.prototype.push = function(event2) {
  68484. var sei, userData, newCaptionPackets;
  68485. if (event2.nalUnitType !== "sei_rbsp") {
  68486. return;
  68487. }
  68488. sei = cea708Parser.parseSei(event2.escapedRBSP);
  68489. if (!sei.payload) {
  68490. return;
  68491. }
  68492. if (sei.payloadType !== cea708Parser.USER_DATA_REGISTERED_ITU_T_T35) {
  68493. return;
  68494. }
  68495. userData = cea708Parser.parseUserData(sei);
  68496. if (!userData) {
  68497. return;
  68498. }
  68499. if (event2.dts < this.latestDts_) {
  68500. this.ignoreNextEqualDts_ = true;
  68501. return;
  68502. } else if (event2.dts === this.latestDts_ && this.ignoreNextEqualDts_) {
  68503. this.numSameDts_--;
  68504. if (!this.numSameDts_) {
  68505. this.ignoreNextEqualDts_ = false;
  68506. }
  68507. return;
  68508. }
  68509. newCaptionPackets = cea708Parser.parseCaptionPackets(event2.pts, userData);
  68510. this.captionPackets_ = this.captionPackets_.concat(newCaptionPackets);
  68511. if (this.latestDts_ !== event2.dts) {
  68512. this.numSameDts_ = 0;
  68513. }
  68514. this.numSameDts_++;
  68515. this.latestDts_ = event2.dts;
  68516. };
  68517. CaptionStream$2.prototype.flushCCStreams = function(flushType) {
  68518. this.ccStreams_.forEach(function(cc) {
  68519. return flushType === "flush" ? cc.flush() : cc.partialFlush();
  68520. }, this);
  68521. };
  68522. CaptionStream$2.prototype.flushStream = function(flushType) {
  68523. if (!this.captionPackets_.length) {
  68524. this.flushCCStreams(flushType);
  68525. return;
  68526. }
  68527. this.captionPackets_.forEach(function(elem, idx) {
  68528. elem.presortIndex = idx;
  68529. });
  68530. this.captionPackets_.sort(function(a, b) {
  68531. if (a.pts === b.pts) {
  68532. return a.presortIndex - b.presortIndex;
  68533. }
  68534. return a.pts - b.pts;
  68535. });
  68536. this.captionPackets_.forEach(function(packet) {
  68537. if (packet.type < 2) {
  68538. this.dispatchCea608Packet(packet);
  68539. } else {
  68540. this.dispatchCea708Packet(packet);
  68541. }
  68542. }, this);
  68543. this.captionPackets_.length = 0;
  68544. this.flushCCStreams(flushType);
  68545. };
  68546. CaptionStream$2.prototype.flush = function() {
  68547. return this.flushStream("flush");
  68548. };
  68549. CaptionStream$2.prototype.partialFlush = function() {
  68550. return this.flushStream("partialFlush");
  68551. };
  68552. CaptionStream$2.prototype.reset = function() {
  68553. this.latestDts_ = null;
  68554. this.ignoreNextEqualDts_ = false;
  68555. this.numSameDts_ = 0;
  68556. this.activeCea608Channel_ = [null, null];
  68557. this.ccStreams_.forEach(function(ccStream) {
  68558. ccStream.reset();
  68559. });
  68560. };
  68561. CaptionStream$2.prototype.dispatchCea608Packet = function(packet) {
  68562. if (this.setsTextOrXDSActive(packet)) {
  68563. this.activeCea608Channel_[packet.type] = null;
  68564. } else if (this.setsChannel1Active(packet)) {
  68565. this.activeCea608Channel_[packet.type] = 0;
  68566. } else if (this.setsChannel2Active(packet)) {
  68567. this.activeCea608Channel_[packet.type] = 1;
  68568. }
  68569. if (this.activeCea608Channel_[packet.type] === null) {
  68570. return;
  68571. }
  68572. this.ccStreams_[(packet.type << 1) + this.activeCea608Channel_[packet.type]].push(packet);
  68573. };
  68574. CaptionStream$2.prototype.setsChannel1Active = function(packet) {
  68575. return (packet.ccData & 30720) === 4096;
  68576. };
  68577. CaptionStream$2.prototype.setsChannel2Active = function(packet) {
  68578. return (packet.ccData & 30720) === 6144;
  68579. };
  68580. CaptionStream$2.prototype.setsTextOrXDSActive = function(packet) {
  68581. return (packet.ccData & 28928) === 256 || (packet.ccData & 30974) === 4138 || (packet.ccData & 30974) === 6186;
  68582. };
  68583. CaptionStream$2.prototype.dispatchCea708Packet = function(packet) {
  68584. if (this.parse708captions_) {
  68585. this.cc708Stream_.push(packet);
  68586. }
  68587. };
  68588. var CHARACTER_TRANSLATION_708 = {
  68589. 127: 9834,
  68590. 4128: 32,
  68591. 4129: 160,
  68592. 4133: 8230,
  68593. 4138: 352,
  68594. 4140: 338,
  68595. 4144: 9608,
  68596. 4145: 8216,
  68597. 4146: 8217,
  68598. 4147: 8220,
  68599. 4148: 8221,
  68600. 4149: 8226,
  68601. 4153: 8482,
  68602. 4154: 353,
  68603. 4156: 339,
  68604. 4157: 8480,
  68605. 4159: 376,
  68606. 4214: 8539,
  68607. 4215: 8540,
  68608. 4216: 8541,
  68609. 4217: 8542,
  68610. 4218: 9168,
  68611. 4219: 9124,
  68612. 4220: 9123,
  68613. 4221: 9135,
  68614. 4222: 9126,
  68615. 4223: 9121,
  68616. 4256: 12600
  68617. };
  68618. var get708CharFromCode = function(code) {
  68619. var newCode = CHARACTER_TRANSLATION_708[code] || code;
  68620. if (code & 4096 && code === newCode) {
  68621. return "";
  68622. }
  68623. return String.fromCharCode(newCode);
  68624. };
  68625. var within708TextBlock = function(b) {
  68626. return 32 <= b && b <= 127 || 160 <= b && b <= 255;
  68627. };
  68628. var Cea708Window = function(windowNum) {
  68629. this.windowNum = windowNum;
  68630. this.reset();
  68631. };
  68632. Cea708Window.prototype.reset = function() {
  68633. this.clearText();
  68634. this.pendingNewLine = false;
  68635. this.winAttr = {};
  68636. this.penAttr = {};
  68637. this.penLoc = {};
  68638. this.penColor = {};
  68639. this.visible = 0;
  68640. this.rowLock = 0;
  68641. this.columnLock = 0;
  68642. this.priority = 0;
  68643. this.relativePositioning = 0;
  68644. this.anchorVertical = 0;
  68645. this.anchorHorizontal = 0;
  68646. this.anchorPoint = 0;
  68647. this.rowCount = 1;
  68648. this.virtualRowCount = this.rowCount + 1;
  68649. this.columnCount = 41;
  68650. this.windowStyle = 0;
  68651. this.penStyle = 0;
  68652. };
  68653. Cea708Window.prototype.getText = function() {
  68654. return this.rows.join("\n");
  68655. };
  68656. Cea708Window.prototype.clearText = function() {
  68657. this.rows = [""];
  68658. this.rowIdx = 0;
  68659. };
  68660. Cea708Window.prototype.newLine = function(pts) {
  68661. if (this.rows.length >= this.virtualRowCount && typeof this.beforeRowOverflow === "function") {
  68662. this.beforeRowOverflow(pts);
  68663. }
  68664. if (this.rows.length > 0) {
  68665. this.rows.push("");
  68666. this.rowIdx++;
  68667. }
  68668. while (this.rows.length > this.virtualRowCount) {
  68669. this.rows.shift();
  68670. this.rowIdx--;
  68671. }
  68672. };
  68673. Cea708Window.prototype.isEmpty = function() {
  68674. if (this.rows.length === 0) {
  68675. return true;
  68676. } else if (this.rows.length === 1) {
  68677. return this.rows[0] === "";
  68678. }
  68679. return false;
  68680. };
  68681. Cea708Window.prototype.addText = function(text) {
  68682. this.rows[this.rowIdx] += text;
  68683. };
  68684. Cea708Window.prototype.backspace = function() {
  68685. if (!this.isEmpty()) {
  68686. var row = this.rows[this.rowIdx];
  68687. this.rows[this.rowIdx] = row.substr(0, row.length - 1);
  68688. }
  68689. };
  68690. var Cea708Service = function(serviceNum, encoding, stream2) {
  68691. this.serviceNum = serviceNum;
  68692. this.text = "";
  68693. this.currentWindow = new Cea708Window(-1);
  68694. this.windows = [];
  68695. this.stream = stream2;
  68696. if (typeof encoding === "string") {
  68697. this.createTextDecoder(encoding);
  68698. }
  68699. };
  68700. Cea708Service.prototype.init = function(pts, beforeRowOverflow) {
  68701. this.startPts = pts;
  68702. for (var win3 = 0; win3 < 8; win3++) {
  68703. this.windows[win3] = new Cea708Window(win3);
  68704. if (typeof beforeRowOverflow === "function") {
  68705. this.windows[win3].beforeRowOverflow = beforeRowOverflow;
  68706. }
  68707. }
  68708. };
  68709. Cea708Service.prototype.setCurrentWindow = function(windowNum) {
  68710. this.currentWindow = this.windows[windowNum];
  68711. };
  68712. Cea708Service.prototype.createTextDecoder = function(encoding) {
  68713. if (typeof TextDecoder === "undefined") {
  68714. this.stream.trigger("log", {
  68715. level: "warn",
  68716. message: "The `encoding` option is unsupported without TextDecoder support"
  68717. });
  68718. } else {
  68719. try {
  68720. this.textDecoder_ = new TextDecoder(encoding);
  68721. } catch (error) {
  68722. this.stream.trigger("log", {
  68723. level: "warn",
  68724. message: "TextDecoder could not be created with " + encoding + " encoding. " + error
  68725. });
  68726. }
  68727. }
  68728. };
  68729. var Cea708Stream = function(options2) {
  68730. options2 = options2 || {};
  68731. Cea708Stream.prototype.init.call(this);
  68732. var self2 = this;
  68733. var captionServices = options2.captionServices || {};
  68734. var captionServiceEncodings = {};
  68735. var serviceProps;
  68736. Object.keys(captionServices).forEach((serviceName) => {
  68737. serviceProps = captionServices[serviceName];
  68738. if (/^SERVICE/.test(serviceName)) {
  68739. captionServiceEncodings[serviceName] = serviceProps.encoding;
  68740. }
  68741. });
  68742. this.serviceEncodings = captionServiceEncodings;
  68743. this.current708Packet = null;
  68744. this.services = {};
  68745. this.push = function(packet) {
  68746. if (packet.type === 3) {
  68747. self2.new708Packet();
  68748. self2.add708Bytes(packet);
  68749. } else {
  68750. if (self2.current708Packet === null) {
  68751. self2.new708Packet();
  68752. }
  68753. self2.add708Bytes(packet);
  68754. }
  68755. };
  68756. };
  68757. Cea708Stream.prototype = new Stream$7();
  68758. Cea708Stream.prototype.new708Packet = function() {
  68759. if (this.current708Packet !== null) {
  68760. this.push708Packet();
  68761. }
  68762. this.current708Packet = {
  68763. data: [],
  68764. ptsVals: []
  68765. };
  68766. };
  68767. Cea708Stream.prototype.add708Bytes = function(packet) {
  68768. var data = packet.ccData;
  68769. var byte0 = data >>> 8;
  68770. var byte1 = data & 255;
  68771. this.current708Packet.ptsVals.push(packet.pts);
  68772. this.current708Packet.data.push(byte0);
  68773. this.current708Packet.data.push(byte1);
  68774. };
  68775. Cea708Stream.prototype.push708Packet = function() {
  68776. var packet708 = this.current708Packet;
  68777. var packetData = packet708.data;
  68778. var serviceNum = null;
  68779. var blockSize = null;
  68780. var i2 = 0;
  68781. var b = packetData[i2++];
  68782. packet708.seq = b >> 6;
  68783. packet708.sizeCode = b & 63;
  68784. for (; i2 < packetData.length; i2++) {
  68785. b = packetData[i2++];
  68786. serviceNum = b >> 5;
  68787. blockSize = b & 31;
  68788. if (serviceNum === 7 && blockSize > 0) {
  68789. b = packetData[i2++];
  68790. serviceNum = b;
  68791. }
  68792. this.pushServiceBlock(serviceNum, i2, blockSize);
  68793. if (blockSize > 0) {
  68794. i2 += blockSize - 1;
  68795. }
  68796. }
  68797. };
  68798. Cea708Stream.prototype.pushServiceBlock = function(serviceNum, start2, size) {
  68799. var b;
  68800. var i2 = start2;
  68801. var packetData = this.current708Packet.data;
  68802. var service = this.services[serviceNum];
  68803. if (!service) {
  68804. service = this.initService(serviceNum, i2);
  68805. }
  68806. for (; i2 < start2 + size && i2 < packetData.length; i2++) {
  68807. b = packetData[i2];
  68808. if (within708TextBlock(b)) {
  68809. i2 = this.handleText(i2, service);
  68810. } else if (b === 24) {
  68811. i2 = this.multiByteCharacter(i2, service);
  68812. } else if (b === 16) {
  68813. i2 = this.extendedCommands(i2, service);
  68814. } else if (128 <= b && b <= 135) {
  68815. i2 = this.setCurrentWindow(i2, service);
  68816. } else if (152 <= b && b <= 159) {
  68817. i2 = this.defineWindow(i2, service);
  68818. } else if (b === 136) {
  68819. i2 = this.clearWindows(i2, service);
  68820. } else if (b === 140) {
  68821. i2 = this.deleteWindows(i2, service);
  68822. } else if (b === 137) {
  68823. i2 = this.displayWindows(i2, service);
  68824. } else if (b === 138) {
  68825. i2 = this.hideWindows(i2, service);
  68826. } else if (b === 139) {
  68827. i2 = this.toggleWindows(i2, service);
  68828. } else if (b === 151) {
  68829. i2 = this.setWindowAttributes(i2, service);
  68830. } else if (b === 144) {
  68831. i2 = this.setPenAttributes(i2, service);
  68832. } else if (b === 145) {
  68833. i2 = this.setPenColor(i2, service);
  68834. } else if (b === 146) {
  68835. i2 = this.setPenLocation(i2, service);
  68836. } else if (b === 143) {
  68837. service = this.reset(i2, service);
  68838. } else if (b === 8) {
  68839. service.currentWindow.backspace();
  68840. } else if (b === 12) {
  68841. service.currentWindow.clearText();
  68842. } else if (b === 13) {
  68843. service.currentWindow.pendingNewLine = true;
  68844. } else if (b === 14) {
  68845. service.currentWindow.clearText();
  68846. } else if (b === 141) {
  68847. i2++;
  68848. } else
  68849. ;
  68850. }
  68851. };
  68852. Cea708Stream.prototype.extendedCommands = function(i2, service) {
  68853. var packetData = this.current708Packet.data;
  68854. var b = packetData[++i2];
  68855. if (within708TextBlock(b)) {
  68856. i2 = this.handleText(i2, service, {
  68857. isExtended: true
  68858. });
  68859. }
  68860. return i2;
  68861. };
  68862. Cea708Stream.prototype.getPts = function(byteIndex) {
  68863. return this.current708Packet.ptsVals[Math.floor(byteIndex / 2)];
  68864. };
  68865. Cea708Stream.prototype.initService = function(serviceNum, i2) {
  68866. var serviceName = "SERVICE" + serviceNum;
  68867. var self2 = this;
  68868. var serviceName;
  68869. var encoding;
  68870. if (serviceName in this.serviceEncodings) {
  68871. encoding = this.serviceEncodings[serviceName];
  68872. }
  68873. this.services[serviceNum] = new Cea708Service(serviceNum, encoding, self2);
  68874. this.services[serviceNum].init(this.getPts(i2), function(pts) {
  68875. self2.flushDisplayed(pts, self2.services[serviceNum]);
  68876. });
  68877. return this.services[serviceNum];
  68878. };
  68879. Cea708Stream.prototype.handleText = function(i2, service, options2) {
  68880. var isExtended = options2 && options2.isExtended;
  68881. var isMultiByte = options2 && options2.isMultiByte;
  68882. var packetData = this.current708Packet.data;
  68883. var extended = isExtended ? 4096 : 0;
  68884. var currentByte = packetData[i2];
  68885. var nextByte = packetData[i2 + 1];
  68886. var win3 = service.currentWindow;
  68887. var char;
  68888. var charCodeArray;
  68889. if (service.textDecoder_ && !isExtended) {
  68890. if (isMultiByte) {
  68891. charCodeArray = [currentByte, nextByte];
  68892. i2++;
  68893. } else {
  68894. charCodeArray = [currentByte];
  68895. }
  68896. char = service.textDecoder_.decode(new Uint8Array(charCodeArray));
  68897. } else {
  68898. char = get708CharFromCode(extended | currentByte);
  68899. }
  68900. if (win3.pendingNewLine && !win3.isEmpty()) {
  68901. win3.newLine(this.getPts(i2));
  68902. }
  68903. win3.pendingNewLine = false;
  68904. win3.addText(char);
  68905. return i2;
  68906. };
  68907. Cea708Stream.prototype.multiByteCharacter = function(i2, service) {
  68908. var packetData = this.current708Packet.data;
  68909. var firstByte = packetData[i2 + 1];
  68910. var secondByte = packetData[i2 + 2];
  68911. if (within708TextBlock(firstByte) && within708TextBlock(secondByte)) {
  68912. i2 = this.handleText(++i2, service, {
  68913. isMultiByte: true
  68914. });
  68915. }
  68916. return i2;
  68917. };
  68918. Cea708Stream.prototype.setCurrentWindow = function(i2, service) {
  68919. var packetData = this.current708Packet.data;
  68920. var b = packetData[i2];
  68921. var windowNum = b & 7;
  68922. service.setCurrentWindow(windowNum);
  68923. return i2;
  68924. };
  68925. Cea708Stream.prototype.defineWindow = function(i2, service) {
  68926. var packetData = this.current708Packet.data;
  68927. var b = packetData[i2];
  68928. var windowNum = b & 7;
  68929. service.setCurrentWindow(windowNum);
  68930. var win3 = service.currentWindow;
  68931. b = packetData[++i2];
  68932. win3.visible = (b & 32) >> 5;
  68933. win3.rowLock = (b & 16) >> 4;
  68934. win3.columnLock = (b & 8) >> 3;
  68935. win3.priority = b & 7;
  68936. b = packetData[++i2];
  68937. win3.relativePositioning = (b & 128) >> 7;
  68938. win3.anchorVertical = b & 127;
  68939. b = packetData[++i2];
  68940. win3.anchorHorizontal = b;
  68941. b = packetData[++i2];
  68942. win3.anchorPoint = (b & 240) >> 4;
  68943. win3.rowCount = b & 15;
  68944. b = packetData[++i2];
  68945. win3.columnCount = b & 63;
  68946. b = packetData[++i2];
  68947. win3.windowStyle = (b & 56) >> 3;
  68948. win3.penStyle = b & 7;
  68949. win3.virtualRowCount = win3.rowCount + 1;
  68950. return i2;
  68951. };
  68952. Cea708Stream.prototype.setWindowAttributes = function(i2, service) {
  68953. var packetData = this.current708Packet.data;
  68954. var b = packetData[i2];
  68955. var winAttr = service.currentWindow.winAttr;
  68956. b = packetData[++i2];
  68957. winAttr.fillOpacity = (b & 192) >> 6;
  68958. winAttr.fillRed = (b & 48) >> 4;
  68959. winAttr.fillGreen = (b & 12) >> 2;
  68960. winAttr.fillBlue = b & 3;
  68961. b = packetData[++i2];
  68962. winAttr.borderType = (b & 192) >> 6;
  68963. winAttr.borderRed = (b & 48) >> 4;
  68964. winAttr.borderGreen = (b & 12) >> 2;
  68965. winAttr.borderBlue = b & 3;
  68966. b = packetData[++i2];
  68967. winAttr.borderType += (b & 128) >> 5;
  68968. winAttr.wordWrap = (b & 64) >> 6;
  68969. winAttr.printDirection = (b & 48) >> 4;
  68970. winAttr.scrollDirection = (b & 12) >> 2;
  68971. winAttr.justify = b & 3;
  68972. b = packetData[++i2];
  68973. winAttr.effectSpeed = (b & 240) >> 4;
  68974. winAttr.effectDirection = (b & 12) >> 2;
  68975. winAttr.displayEffect = b & 3;
  68976. return i2;
  68977. };
  68978. Cea708Stream.prototype.flushDisplayed = function(pts, service) {
  68979. var displayedText = [];
  68980. for (var winId = 0; winId < 8; winId++) {
  68981. if (service.windows[winId].visible && !service.windows[winId].isEmpty()) {
  68982. displayedText.push(service.windows[winId].getText());
  68983. }
  68984. }
  68985. service.endPts = pts;
  68986. service.text = displayedText.join("\n\n");
  68987. this.pushCaption(service);
  68988. service.startPts = pts;
  68989. };
  68990. Cea708Stream.prototype.pushCaption = function(service) {
  68991. if (service.text !== "") {
  68992. this.trigger("data", {
  68993. startPts: service.startPts,
  68994. endPts: service.endPts,
  68995. text: service.text,
  68996. stream: "cc708_" + service.serviceNum
  68997. });
  68998. service.text = "";
  68999. service.startPts = service.endPts;
  69000. }
  69001. };
  69002. Cea708Stream.prototype.displayWindows = function(i2, service) {
  69003. var packetData = this.current708Packet.data;
  69004. var b = packetData[++i2];
  69005. var pts = this.getPts(i2);
  69006. this.flushDisplayed(pts, service);
  69007. for (var winId = 0; winId < 8; winId++) {
  69008. if (b & 1 << winId) {
  69009. service.windows[winId].visible = 1;
  69010. }
  69011. }
  69012. return i2;
  69013. };
  69014. Cea708Stream.prototype.hideWindows = function(i2, service) {
  69015. var packetData = this.current708Packet.data;
  69016. var b = packetData[++i2];
  69017. var pts = this.getPts(i2);
  69018. this.flushDisplayed(pts, service);
  69019. for (var winId = 0; winId < 8; winId++) {
  69020. if (b & 1 << winId) {
  69021. service.windows[winId].visible = 0;
  69022. }
  69023. }
  69024. return i2;
  69025. };
  69026. Cea708Stream.prototype.toggleWindows = function(i2, service) {
  69027. var packetData = this.current708Packet.data;
  69028. var b = packetData[++i2];
  69029. var pts = this.getPts(i2);
  69030. this.flushDisplayed(pts, service);
  69031. for (var winId = 0; winId < 8; winId++) {
  69032. if (b & 1 << winId) {
  69033. service.windows[winId].visible ^= 1;
  69034. }
  69035. }
  69036. return i2;
  69037. };
  69038. Cea708Stream.prototype.clearWindows = function(i2, service) {
  69039. var packetData = this.current708Packet.data;
  69040. var b = packetData[++i2];
  69041. var pts = this.getPts(i2);
  69042. this.flushDisplayed(pts, service);
  69043. for (var winId = 0; winId < 8; winId++) {
  69044. if (b & 1 << winId) {
  69045. service.windows[winId].clearText();
  69046. }
  69047. }
  69048. return i2;
  69049. };
  69050. Cea708Stream.prototype.deleteWindows = function(i2, service) {
  69051. var packetData = this.current708Packet.data;
  69052. var b = packetData[++i2];
  69053. var pts = this.getPts(i2);
  69054. this.flushDisplayed(pts, service);
  69055. for (var winId = 0; winId < 8; winId++) {
  69056. if (b & 1 << winId) {
  69057. service.windows[winId].reset();
  69058. }
  69059. }
  69060. return i2;
  69061. };
  69062. Cea708Stream.prototype.setPenAttributes = function(i2, service) {
  69063. var packetData = this.current708Packet.data;
  69064. var b = packetData[i2];
  69065. var penAttr = service.currentWindow.penAttr;
  69066. b = packetData[++i2];
  69067. penAttr.textTag = (b & 240) >> 4;
  69068. penAttr.offset = (b & 12) >> 2;
  69069. penAttr.penSize = b & 3;
  69070. b = packetData[++i2];
  69071. penAttr.italics = (b & 128) >> 7;
  69072. penAttr.underline = (b & 64) >> 6;
  69073. penAttr.edgeType = (b & 56) >> 3;
  69074. penAttr.fontStyle = b & 7;
  69075. return i2;
  69076. };
  69077. Cea708Stream.prototype.setPenColor = function(i2, service) {
  69078. var packetData = this.current708Packet.data;
  69079. var b = packetData[i2];
  69080. var penColor = service.currentWindow.penColor;
  69081. b = packetData[++i2];
  69082. penColor.fgOpacity = (b & 192) >> 6;
  69083. penColor.fgRed = (b & 48) >> 4;
  69084. penColor.fgGreen = (b & 12) >> 2;
  69085. penColor.fgBlue = b & 3;
  69086. b = packetData[++i2];
  69087. penColor.bgOpacity = (b & 192) >> 6;
  69088. penColor.bgRed = (b & 48) >> 4;
  69089. penColor.bgGreen = (b & 12) >> 2;
  69090. penColor.bgBlue = b & 3;
  69091. b = packetData[++i2];
  69092. penColor.edgeRed = (b & 48) >> 4;
  69093. penColor.edgeGreen = (b & 12) >> 2;
  69094. penColor.edgeBlue = b & 3;
  69095. return i2;
  69096. };
  69097. Cea708Stream.prototype.setPenLocation = function(i2, service) {
  69098. var packetData = this.current708Packet.data;
  69099. var b = packetData[i2];
  69100. var penLoc = service.currentWindow.penLoc;
  69101. service.currentWindow.pendingNewLine = true;
  69102. b = packetData[++i2];
  69103. penLoc.row = b & 15;
  69104. b = packetData[++i2];
  69105. penLoc.column = b & 63;
  69106. return i2;
  69107. };
  69108. Cea708Stream.prototype.reset = function(i2, service) {
  69109. var pts = this.getPts(i2);
  69110. this.flushDisplayed(pts, service);
  69111. return this.initService(service.serviceNum, i2);
  69112. };
  69113. var CHARACTER_TRANSLATION = {
  69114. 42: 225,
  69115. 92: 233,
  69116. 94: 237,
  69117. 95: 243,
  69118. 96: 250,
  69119. 123: 231,
  69120. 124: 247,
  69121. 125: 209,
  69122. 126: 241,
  69123. 127: 9608,
  69124. 304: 174,
  69125. 305: 176,
  69126. 306: 189,
  69127. 307: 191,
  69128. 308: 8482,
  69129. 309: 162,
  69130. 310: 163,
  69131. 311: 9834,
  69132. 312: 224,
  69133. 313: 160,
  69134. 314: 232,
  69135. 315: 226,
  69136. 316: 234,
  69137. 317: 238,
  69138. 318: 244,
  69139. 319: 251,
  69140. 544: 193,
  69141. 545: 201,
  69142. 546: 211,
  69143. 547: 218,
  69144. 548: 220,
  69145. 549: 252,
  69146. 550: 8216,
  69147. 551: 161,
  69148. 552: 42,
  69149. 553: 39,
  69150. 554: 8212,
  69151. 555: 169,
  69152. 556: 8480,
  69153. 557: 8226,
  69154. 558: 8220,
  69155. 559: 8221,
  69156. 560: 192,
  69157. 561: 194,
  69158. 562: 199,
  69159. 563: 200,
  69160. 564: 202,
  69161. 565: 203,
  69162. 566: 235,
  69163. 567: 206,
  69164. 568: 207,
  69165. 569: 239,
  69166. 570: 212,
  69167. 571: 217,
  69168. 572: 249,
  69169. 573: 219,
  69170. 574: 171,
  69171. 575: 187,
  69172. 800: 195,
  69173. 801: 227,
  69174. 802: 205,
  69175. 803: 204,
  69176. 804: 236,
  69177. 805: 210,
  69178. 806: 242,
  69179. 807: 213,
  69180. 808: 245,
  69181. 809: 123,
  69182. 810: 125,
  69183. 811: 92,
  69184. 812: 94,
  69185. 813: 95,
  69186. 814: 124,
  69187. 815: 126,
  69188. 816: 196,
  69189. 817: 228,
  69190. 818: 214,
  69191. 819: 246,
  69192. 820: 223,
  69193. 821: 165,
  69194. 822: 164,
  69195. 823: 9474,
  69196. 824: 197,
  69197. 825: 229,
  69198. 826: 216,
  69199. 827: 248,
  69200. 828: 9484,
  69201. 829: 9488,
  69202. 830: 9492,
  69203. 831: 9496
  69204. };
  69205. var getCharFromCode = function(code) {
  69206. if (code === null) {
  69207. return "";
  69208. }
  69209. code = CHARACTER_TRANSLATION[code] || code;
  69210. return String.fromCharCode(code);
  69211. };
  69212. var BOTTOM_ROW = 14;
  69213. var ROWS = [4352, 4384, 4608, 4640, 5376, 5408, 5632, 5664, 5888, 5920, 4096, 4864, 4896, 5120, 5152];
  69214. var createDisplayBuffer = function() {
  69215. var result = [], i2 = BOTTOM_ROW + 1;
  69216. while (i2--) {
  69217. result.push("");
  69218. }
  69219. return result;
  69220. };
  69221. var Cea608Stream = function(field, dataChannel) {
  69222. Cea608Stream.prototype.init.call(this);
  69223. this.field_ = field || 0;
  69224. this.dataChannel_ = dataChannel || 0;
  69225. this.name_ = "CC" + ((this.field_ << 1 | this.dataChannel_) + 1);
  69226. this.setConstants();
  69227. this.reset();
  69228. this.push = function(packet) {
  69229. var data, swap, char0, char1, text;
  69230. data = packet.ccData & 32639;
  69231. if (data === this.lastControlCode_) {
  69232. this.lastControlCode_ = null;
  69233. return;
  69234. }
  69235. if ((data & 61440) === 4096) {
  69236. this.lastControlCode_ = data;
  69237. } else if (data !== this.PADDING_) {
  69238. this.lastControlCode_ = null;
  69239. }
  69240. char0 = data >>> 8;
  69241. char1 = data & 255;
  69242. if (data === this.PADDING_) {
  69243. return;
  69244. } else if (data === this.RESUME_CAPTION_LOADING_) {
  69245. this.mode_ = "popOn";
  69246. } else if (data === this.END_OF_CAPTION_) {
  69247. this.mode_ = "popOn";
  69248. this.clearFormatting(packet.pts);
  69249. this.flushDisplayed(packet.pts);
  69250. swap = this.displayed_;
  69251. this.displayed_ = this.nonDisplayed_;
  69252. this.nonDisplayed_ = swap;
  69253. this.startPts_ = packet.pts;
  69254. } else if (data === this.ROLL_UP_2_ROWS_) {
  69255. this.rollUpRows_ = 2;
  69256. this.setRollUp(packet.pts);
  69257. } else if (data === this.ROLL_UP_3_ROWS_) {
  69258. this.rollUpRows_ = 3;
  69259. this.setRollUp(packet.pts);
  69260. } else if (data === this.ROLL_UP_4_ROWS_) {
  69261. this.rollUpRows_ = 4;
  69262. this.setRollUp(packet.pts);
  69263. } else if (data === this.CARRIAGE_RETURN_) {
  69264. this.clearFormatting(packet.pts);
  69265. this.flushDisplayed(packet.pts);
  69266. this.shiftRowsUp_();
  69267. this.startPts_ = packet.pts;
  69268. } else if (data === this.BACKSPACE_) {
  69269. if (this.mode_ === "popOn") {
  69270. this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);
  69271. } else {
  69272. this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);
  69273. }
  69274. } else if (data === this.ERASE_DISPLAYED_MEMORY_) {
  69275. this.flushDisplayed(packet.pts);
  69276. this.displayed_ = createDisplayBuffer();
  69277. } else if (data === this.ERASE_NON_DISPLAYED_MEMORY_) {
  69278. this.nonDisplayed_ = createDisplayBuffer();
  69279. } else if (data === this.RESUME_DIRECT_CAPTIONING_) {
  69280. if (this.mode_ !== "paintOn") {
  69281. this.flushDisplayed(packet.pts);
  69282. this.displayed_ = createDisplayBuffer();
  69283. }
  69284. this.mode_ = "paintOn";
  69285. this.startPts_ = packet.pts;
  69286. } else if (this.isSpecialCharacter(char0, char1)) {
  69287. char0 = (char0 & 3) << 8;
  69288. text = getCharFromCode(char0 | char1);
  69289. this[this.mode_](packet.pts, text);
  69290. this.column_++;
  69291. } else if (this.isExtCharacter(char0, char1)) {
  69292. if (this.mode_ === "popOn") {
  69293. this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);
  69294. } else {
  69295. this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);
  69296. }
  69297. char0 = (char0 & 3) << 8;
  69298. text = getCharFromCode(char0 | char1);
  69299. this[this.mode_](packet.pts, text);
  69300. this.column_++;
  69301. } else if (this.isMidRowCode(char0, char1)) {
  69302. this.clearFormatting(packet.pts);
  69303. this[this.mode_](packet.pts, " ");
  69304. this.column_++;
  69305. if ((char1 & 14) === 14) {
  69306. this.addFormatting(packet.pts, ["i"]);
  69307. }
  69308. if ((char1 & 1) === 1) {
  69309. this.addFormatting(packet.pts, ["u"]);
  69310. }
  69311. } else if (this.isOffsetControlCode(char0, char1)) {
  69312. this.column_ += char1 & 3;
  69313. } else if (this.isPAC(char0, char1)) {
  69314. var row = ROWS.indexOf(data & 7968);
  69315. if (this.mode_ === "rollUp") {
  69316. if (row - this.rollUpRows_ + 1 < 0) {
  69317. row = this.rollUpRows_ - 1;
  69318. }
  69319. this.setRollUp(packet.pts, row);
  69320. }
  69321. if (row !== this.row_) {
  69322. this.clearFormatting(packet.pts);
  69323. this.row_ = row;
  69324. }
  69325. if (char1 & 1 && this.formatting_.indexOf("u") === -1) {
  69326. this.addFormatting(packet.pts, ["u"]);
  69327. }
  69328. if ((data & 16) === 16) {
  69329. this.column_ = ((data & 14) >> 1) * 4;
  69330. }
  69331. if (this.isColorPAC(char1)) {
  69332. if ((char1 & 14) === 14) {
  69333. this.addFormatting(packet.pts, ["i"]);
  69334. }
  69335. }
  69336. } else if (this.isNormalChar(char0)) {
  69337. if (char1 === 0) {
  69338. char1 = null;
  69339. }
  69340. text = getCharFromCode(char0);
  69341. text += getCharFromCode(char1);
  69342. this[this.mode_](packet.pts, text);
  69343. this.column_ += text.length;
  69344. }
  69345. };
  69346. };
  69347. Cea608Stream.prototype = new Stream$7();
  69348. Cea608Stream.prototype.flushDisplayed = function(pts) {
  69349. var content = this.displayed_.map(function(row, index2) {
  69350. try {
  69351. return row.trim();
  69352. } catch (e) {
  69353. this.trigger("log", {
  69354. level: "warn",
  69355. message: "Skipping a malformed 608 caption at index " + index2 + "."
  69356. });
  69357. return "";
  69358. }
  69359. }, this).join("\n").replace(/^\n+|\n+$/g, "");
  69360. if (content.length) {
  69361. this.trigger("data", {
  69362. startPts: this.startPts_,
  69363. endPts: pts,
  69364. text: content,
  69365. stream: this.name_
  69366. });
  69367. }
  69368. };
  69369. Cea608Stream.prototype.reset = function() {
  69370. this.mode_ = "popOn";
  69371. this.topRow_ = 0;
  69372. this.startPts_ = 0;
  69373. this.displayed_ = createDisplayBuffer();
  69374. this.nonDisplayed_ = createDisplayBuffer();
  69375. this.lastControlCode_ = null;
  69376. this.column_ = 0;
  69377. this.row_ = BOTTOM_ROW;
  69378. this.rollUpRows_ = 2;
  69379. this.formatting_ = [];
  69380. };
  69381. Cea608Stream.prototype.setConstants = function() {
  69382. if (this.dataChannel_ === 0) {
  69383. this.BASE_ = 16;
  69384. this.EXT_ = 17;
  69385. this.CONTROL_ = (20 | this.field_) << 8;
  69386. this.OFFSET_ = 23;
  69387. } else if (this.dataChannel_ === 1) {
  69388. this.BASE_ = 24;
  69389. this.EXT_ = 25;
  69390. this.CONTROL_ = (28 | this.field_) << 8;
  69391. this.OFFSET_ = 31;
  69392. }
  69393. this.PADDING_ = 0;
  69394. this.RESUME_CAPTION_LOADING_ = this.CONTROL_ | 32;
  69395. this.END_OF_CAPTION_ = this.CONTROL_ | 47;
  69396. this.ROLL_UP_2_ROWS_ = this.CONTROL_ | 37;
  69397. this.ROLL_UP_3_ROWS_ = this.CONTROL_ | 38;
  69398. this.ROLL_UP_4_ROWS_ = this.CONTROL_ | 39;
  69399. this.CARRIAGE_RETURN_ = this.CONTROL_ | 45;
  69400. this.RESUME_DIRECT_CAPTIONING_ = this.CONTROL_ | 41;
  69401. this.BACKSPACE_ = this.CONTROL_ | 33;
  69402. this.ERASE_DISPLAYED_MEMORY_ = this.CONTROL_ | 44;
  69403. this.ERASE_NON_DISPLAYED_MEMORY_ = this.CONTROL_ | 46;
  69404. };
  69405. Cea608Stream.prototype.isSpecialCharacter = function(char0, char1) {
  69406. return char0 === this.EXT_ && char1 >= 48 && char1 <= 63;
  69407. };
  69408. Cea608Stream.prototype.isExtCharacter = function(char0, char1) {
  69409. return (char0 === this.EXT_ + 1 || char0 === this.EXT_ + 2) && char1 >= 32 && char1 <= 63;
  69410. };
  69411. Cea608Stream.prototype.isMidRowCode = function(char0, char1) {
  69412. return char0 === this.EXT_ && char1 >= 32 && char1 <= 47;
  69413. };
  69414. Cea608Stream.prototype.isOffsetControlCode = function(char0, char1) {
  69415. return char0 === this.OFFSET_ && char1 >= 33 && char1 <= 35;
  69416. };
  69417. Cea608Stream.prototype.isPAC = function(char0, char1) {
  69418. return char0 >= this.BASE_ && char0 < this.BASE_ + 8 && char1 >= 64 && char1 <= 127;
  69419. };
  69420. Cea608Stream.prototype.isColorPAC = function(char1) {
  69421. return char1 >= 64 && char1 <= 79 || char1 >= 96 && char1 <= 127;
  69422. };
  69423. Cea608Stream.prototype.isNormalChar = function(char) {
  69424. return char >= 32 && char <= 127;
  69425. };
  69426. Cea608Stream.prototype.setRollUp = function(pts, newBaseRow) {
  69427. if (this.mode_ !== "rollUp") {
  69428. this.row_ = BOTTOM_ROW;
  69429. this.mode_ = "rollUp";
  69430. this.flushDisplayed(pts);
  69431. this.nonDisplayed_ = createDisplayBuffer();
  69432. this.displayed_ = createDisplayBuffer();
  69433. }
  69434. if (newBaseRow !== void 0 && newBaseRow !== this.row_) {
  69435. for (var i2 = 0; i2 < this.rollUpRows_; i2++) {
  69436. this.displayed_[newBaseRow - i2] = this.displayed_[this.row_ - i2];
  69437. this.displayed_[this.row_ - i2] = "";
  69438. }
  69439. }
  69440. if (newBaseRow === void 0) {
  69441. newBaseRow = this.row_;
  69442. }
  69443. this.topRow_ = newBaseRow - this.rollUpRows_ + 1;
  69444. };
  69445. Cea608Stream.prototype.addFormatting = function(pts, format) {
  69446. this.formatting_ = this.formatting_.concat(format);
  69447. var text = format.reduce(function(text2, format2) {
  69448. return text2 + "<" + format2 + ">";
  69449. }, "");
  69450. this[this.mode_](pts, text);
  69451. };
  69452. Cea608Stream.prototype.clearFormatting = function(pts) {
  69453. if (!this.formatting_.length) {
  69454. return;
  69455. }
  69456. var text = this.formatting_.reverse().reduce(function(text2, format) {
  69457. return text2 + "</" + format + ">";
  69458. }, "");
  69459. this.formatting_ = [];
  69460. this[this.mode_](pts, text);
  69461. };
  69462. Cea608Stream.prototype.popOn = function(pts, text) {
  69463. var baseRow = this.nonDisplayed_[this.row_];
  69464. baseRow += text;
  69465. this.nonDisplayed_[this.row_] = baseRow;
  69466. };
  69467. Cea608Stream.prototype.rollUp = function(pts, text) {
  69468. var baseRow = this.displayed_[this.row_];
  69469. baseRow += text;
  69470. this.displayed_[this.row_] = baseRow;
  69471. };
  69472. Cea608Stream.prototype.shiftRowsUp_ = function() {
  69473. var i2;
  69474. for (i2 = 0; i2 < this.topRow_; i2++) {
  69475. this.displayed_[i2] = "";
  69476. }
  69477. for (i2 = this.row_ + 1; i2 < BOTTOM_ROW + 1; i2++) {
  69478. this.displayed_[i2] = "";
  69479. }
  69480. for (i2 = this.topRow_; i2 < this.row_; i2++) {
  69481. this.displayed_[i2] = this.displayed_[i2 + 1];
  69482. }
  69483. this.displayed_[this.row_] = "";
  69484. };
  69485. Cea608Stream.prototype.paintOn = function(pts, text) {
  69486. var baseRow = this.displayed_[this.row_];
  69487. baseRow += text;
  69488. this.displayed_[this.row_] = baseRow;
  69489. };
  69490. var captionStream = {
  69491. CaptionStream: CaptionStream$2,
  69492. Cea608Stream,
  69493. Cea708Stream
  69494. };
  69495. var streamTypes = {
  69496. H264_STREAM_TYPE: 27,
  69497. ADTS_STREAM_TYPE: 15,
  69498. METADATA_STREAM_TYPE: 21
  69499. };
  69500. var Stream$6 = stream;
  69501. var MAX_TS = 8589934592;
  69502. var RO_THRESH = 4294967296;
  69503. var TYPE_SHARED = "shared";
  69504. var handleRollover$1 = function(value, reference) {
  69505. var direction = 1;
  69506. if (value > reference) {
  69507. direction = -1;
  69508. }
  69509. while (Math.abs(reference - value) > RO_THRESH) {
  69510. value += direction * MAX_TS;
  69511. }
  69512. return value;
  69513. };
  69514. var TimestampRolloverStream$1 = function(type3) {
  69515. var lastDTS, referenceDTS;
  69516. TimestampRolloverStream$1.prototype.init.call(this);
  69517. this.type_ = type3 || TYPE_SHARED;
  69518. this.push = function(data) {
  69519. if (this.type_ !== TYPE_SHARED && data.type !== this.type_) {
  69520. return;
  69521. }
  69522. if (referenceDTS === void 0) {
  69523. referenceDTS = data.dts;
  69524. }
  69525. data.dts = handleRollover$1(data.dts, referenceDTS);
  69526. data.pts = handleRollover$1(data.pts, referenceDTS);
  69527. lastDTS = data.dts;
  69528. this.trigger("data", data);
  69529. };
  69530. this.flush = function() {
  69531. referenceDTS = lastDTS;
  69532. this.trigger("done");
  69533. };
  69534. this.endTimeline = function() {
  69535. this.flush();
  69536. this.trigger("endedtimeline");
  69537. };
  69538. this.discontinuity = function() {
  69539. referenceDTS = void 0;
  69540. lastDTS = void 0;
  69541. };
  69542. this.reset = function() {
  69543. this.discontinuity();
  69544. this.trigger("reset");
  69545. };
  69546. };
  69547. TimestampRolloverStream$1.prototype = new Stream$6();
  69548. var timestampRolloverStream = {
  69549. TimestampRolloverStream: TimestampRolloverStream$1,
  69550. handleRollover: handleRollover$1
  69551. };
  69552. var typedArrayIndexOf$1 = (typedArray2, element, fromIndex) => {
  69553. if (!typedArray2) {
  69554. return -1;
  69555. }
  69556. var currentIndex = fromIndex;
  69557. for (; currentIndex < typedArray2.length; currentIndex++) {
  69558. if (typedArray2[currentIndex] === element) {
  69559. return currentIndex;
  69560. }
  69561. }
  69562. return -1;
  69563. };
  69564. var typedArray = {
  69565. typedArrayIndexOf: typedArrayIndexOf$1
  69566. };
  69567. var typedArrayIndexOf = typedArray.typedArrayIndexOf, textEncodingDescriptionByte = {
  69568. Iso88591: 0,
  69569. Utf16: 1,
  69570. Utf16be: 2,
  69571. Utf8: 3
  69572. }, percentEncode$1 = function(bytes, start2, end) {
  69573. var i2, result = "";
  69574. for (i2 = start2; i2 < end; i2++) {
  69575. result += "%" + ("00" + bytes[i2].toString(16)).slice(-2);
  69576. }
  69577. return result;
  69578. }, parseUtf8 = function(bytes, start2, end) {
  69579. return decodeURIComponent(percentEncode$1(bytes, start2, end));
  69580. }, parseIso88591$1 = function(bytes, start2, end) {
  69581. return unescape(percentEncode$1(bytes, start2, end));
  69582. }, parseSyncSafeInteger$1 = function(data) {
  69583. return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];
  69584. }, frameParsers = {
  69585. "APIC": function(frame) {
  69586. var i2 = 1, mimeTypeEndIndex, descriptionEndIndex, LINK_MIME_TYPE = "-->";
  69587. if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {
  69588. return;
  69589. }
  69590. mimeTypeEndIndex = typedArrayIndexOf(frame.data, 0, i2);
  69591. if (mimeTypeEndIndex < 0) {
  69592. return;
  69593. }
  69594. frame.mimeType = parseIso88591$1(frame.data, i2, mimeTypeEndIndex);
  69595. i2 = mimeTypeEndIndex + 1;
  69596. frame.pictureType = frame.data[i2];
  69597. i2++;
  69598. descriptionEndIndex = typedArrayIndexOf(frame.data, 0, i2);
  69599. if (descriptionEndIndex < 0) {
  69600. return;
  69601. }
  69602. frame.description = parseUtf8(frame.data, i2, descriptionEndIndex);
  69603. i2 = descriptionEndIndex + 1;
  69604. if (frame.mimeType === LINK_MIME_TYPE) {
  69605. frame.url = parseIso88591$1(frame.data, i2, frame.data.length);
  69606. } else {
  69607. frame.pictureData = frame.data.subarray(i2, frame.data.length);
  69608. }
  69609. },
  69610. "T*": function(frame) {
  69611. if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {
  69612. return;
  69613. }
  69614. frame.value = parseUtf8(frame.data, 1, frame.data.length).replace(/\0*$/, "");
  69615. frame.values = frame.value.split("\0");
  69616. },
  69617. "TXXX": function(frame) {
  69618. var descriptionEndIndex;
  69619. if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {
  69620. return;
  69621. }
  69622. descriptionEndIndex = typedArrayIndexOf(frame.data, 0, 1);
  69623. if (descriptionEndIndex === -1) {
  69624. return;
  69625. }
  69626. frame.description = parseUtf8(frame.data, 1, descriptionEndIndex);
  69627. frame.value = parseUtf8(frame.data, descriptionEndIndex + 1, frame.data.length).replace(/\0*$/, "");
  69628. frame.data = frame.value;
  69629. },
  69630. "W*": function(frame) {
  69631. frame.url = parseIso88591$1(frame.data, 0, frame.data.length).replace(/\0.*$/, "");
  69632. },
  69633. "WXXX": function(frame) {
  69634. var descriptionEndIndex;
  69635. if (frame.data[0] !== textEncodingDescriptionByte.Utf8) {
  69636. return;
  69637. }
  69638. descriptionEndIndex = typedArrayIndexOf(frame.data, 0, 1);
  69639. if (descriptionEndIndex === -1) {
  69640. return;
  69641. }
  69642. frame.description = parseUtf8(frame.data, 1, descriptionEndIndex);
  69643. frame.url = parseIso88591$1(frame.data, descriptionEndIndex + 1, frame.data.length).replace(/\0.*$/, "");
  69644. },
  69645. "PRIV": function(frame) {
  69646. var i2;
  69647. for (i2 = 0; i2 < frame.data.length; i2++) {
  69648. if (frame.data[i2] === 0) {
  69649. frame.owner = parseIso88591$1(frame.data, 0, i2);
  69650. break;
  69651. }
  69652. }
  69653. frame.privateData = frame.data.subarray(i2 + 1);
  69654. frame.data = frame.privateData;
  69655. }
  69656. };
  69657. var parseId3Frames$1 = function(data) {
  69658. var frameSize, frameHeader, frameStart = 10, tagSize = 0, frames = [];
  69659. if (data.length < 10 || data[0] !== "I".charCodeAt(0) || data[1] !== "D".charCodeAt(0) || data[2] !== "3".charCodeAt(0)) {
  69660. return;
  69661. }
  69662. tagSize = parseSyncSafeInteger$1(data.subarray(6, 10));
  69663. tagSize += 10;
  69664. var hasExtendedHeader = data[5] & 64;
  69665. if (hasExtendedHeader) {
  69666. frameStart += 4;
  69667. frameStart += parseSyncSafeInteger$1(data.subarray(10, 14));
  69668. tagSize -= parseSyncSafeInteger$1(data.subarray(16, 20));
  69669. }
  69670. do {
  69671. frameSize = parseSyncSafeInteger$1(data.subarray(frameStart + 4, frameStart + 8));
  69672. if (frameSize < 1) {
  69673. break;
  69674. }
  69675. frameHeader = String.fromCharCode(data[frameStart], data[frameStart + 1], data[frameStart + 2], data[frameStart + 3]);
  69676. var frame = {
  69677. id: frameHeader,
  69678. data: data.subarray(frameStart + 10, frameStart + frameSize + 10)
  69679. };
  69680. frame.key = frame.id;
  69681. if (frameParsers[frame.id]) {
  69682. frameParsers[frame.id](frame);
  69683. } else if (frame.id[0] === "T") {
  69684. frameParsers["T*"](frame);
  69685. } else if (frame.id[0] === "W") {
  69686. frameParsers["W*"](frame);
  69687. }
  69688. frames.push(frame);
  69689. frameStart += 10;
  69690. frameStart += frameSize;
  69691. } while (frameStart < tagSize);
  69692. return frames;
  69693. };
  69694. var parseId3 = {
  69695. parseId3Frames: parseId3Frames$1,
  69696. parseSyncSafeInteger: parseSyncSafeInteger$1,
  69697. frameParsers
  69698. };
  69699. var Stream$5 = stream, StreamTypes$3 = streamTypes, id3 = parseId3, MetadataStream;
  69700. MetadataStream = function(options2) {
  69701. var settings = {
  69702. descriptor: options2 && options2.descriptor
  69703. }, tagSize = 0, buffer = [], bufferSize = 0, i2;
  69704. MetadataStream.prototype.init.call(this);
  69705. this.dispatchType = StreamTypes$3.METADATA_STREAM_TYPE.toString(16);
  69706. if (settings.descriptor) {
  69707. for (i2 = 0; i2 < settings.descriptor.length; i2++) {
  69708. this.dispatchType += ("00" + settings.descriptor[i2].toString(16)).slice(-2);
  69709. }
  69710. }
  69711. this.push = function(chunk) {
  69712. var tag, frameStart, frameSize, frame, i3, frameHeader;
  69713. if (chunk.type !== "timed-metadata") {
  69714. return;
  69715. }
  69716. if (chunk.dataAlignmentIndicator) {
  69717. bufferSize = 0;
  69718. buffer.length = 0;
  69719. }
  69720. if (buffer.length === 0 && (chunk.data.length < 10 || chunk.data[0] !== "I".charCodeAt(0) || chunk.data[1] !== "D".charCodeAt(0) || chunk.data[2] !== "3".charCodeAt(0))) {
  69721. this.trigger("log", {
  69722. level: "warn",
  69723. message: "Skipping unrecognized metadata packet"
  69724. });
  69725. return;
  69726. }
  69727. buffer.push(chunk);
  69728. bufferSize += chunk.data.byteLength;
  69729. if (buffer.length === 1) {
  69730. tagSize = id3.parseSyncSafeInteger(chunk.data.subarray(6, 10));
  69731. tagSize += 10;
  69732. }
  69733. if (bufferSize < tagSize) {
  69734. return;
  69735. }
  69736. tag = {
  69737. data: new Uint8Array(tagSize),
  69738. frames: [],
  69739. pts: buffer[0].pts,
  69740. dts: buffer[0].dts
  69741. };
  69742. for (i3 = 0; i3 < tagSize; ) {
  69743. tag.data.set(buffer[0].data.subarray(0, tagSize - i3), i3);
  69744. i3 += buffer[0].data.byteLength;
  69745. bufferSize -= buffer[0].data.byteLength;
  69746. buffer.shift();
  69747. }
  69748. frameStart = 10;
  69749. if (tag.data[5] & 64) {
  69750. frameStart += 4;
  69751. frameStart += id3.parseSyncSafeInteger(tag.data.subarray(10, 14));
  69752. tagSize -= id3.parseSyncSafeInteger(tag.data.subarray(16, 20));
  69753. }
  69754. do {
  69755. frameSize = id3.parseSyncSafeInteger(tag.data.subarray(frameStart + 4, frameStart + 8));
  69756. if (frameSize < 1) {
  69757. this.trigger("log", {
  69758. level: "warn",
  69759. message: "Malformed ID3 frame encountered. Skipping remaining metadata parsing."
  69760. });
  69761. break;
  69762. }
  69763. frameHeader = String.fromCharCode(tag.data[frameStart], tag.data[frameStart + 1], tag.data[frameStart + 2], tag.data[frameStart + 3]);
  69764. frame = {
  69765. id: frameHeader,
  69766. data: tag.data.subarray(frameStart + 10, frameStart + frameSize + 10)
  69767. };
  69768. frame.key = frame.id;
  69769. if (id3.frameParsers[frame.id]) {
  69770. id3.frameParsers[frame.id](frame);
  69771. } else if (frame.id[0] === "T") {
  69772. id3.frameParsers["T*"](frame);
  69773. } else if (frame.id[0] === "W") {
  69774. id3.frameParsers["W*"](frame);
  69775. }
  69776. if (frame.owner === "com.apple.streaming.transportStreamTimestamp") {
  69777. var d2 = frame.data, size = (d2[3] & 1) << 30 | d2[4] << 22 | d2[5] << 14 | d2[6] << 6 | d2[7] >>> 2;
  69778. size *= 4;
  69779. size += d2[7] & 3;
  69780. frame.timeStamp = size;
  69781. if (tag.pts === void 0 && tag.dts === void 0) {
  69782. tag.pts = frame.timeStamp;
  69783. tag.dts = frame.timeStamp;
  69784. }
  69785. this.trigger("timestamp", frame);
  69786. }
  69787. tag.frames.push(frame);
  69788. frameStart += 10;
  69789. frameStart += frameSize;
  69790. } while (frameStart < tagSize);
  69791. this.trigger("data", tag);
  69792. };
  69793. };
  69794. MetadataStream.prototype = new Stream$5();
  69795. var metadataStream = MetadataStream;
  69796. var Stream$4 = stream, CaptionStream$1 = captionStream, StreamTypes$2 = streamTypes, TimestampRolloverStream = timestampRolloverStream.TimestampRolloverStream;
  69797. var TransportPacketStream, TransportParseStream, ElementaryStream;
  69798. var MP2T_PACKET_LENGTH$1 = 188, SYNC_BYTE$1 = 71;
  69799. TransportPacketStream = function() {
  69800. var buffer = new Uint8Array(MP2T_PACKET_LENGTH$1), bytesInBuffer = 0;
  69801. TransportPacketStream.prototype.init.call(this);
  69802. this.push = function(bytes) {
  69803. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH$1, everything;
  69804. if (bytesInBuffer) {
  69805. everything = new Uint8Array(bytes.byteLength + bytesInBuffer);
  69806. everything.set(buffer.subarray(0, bytesInBuffer));
  69807. everything.set(bytes, bytesInBuffer);
  69808. bytesInBuffer = 0;
  69809. } else {
  69810. everything = bytes;
  69811. }
  69812. while (endIndex < everything.byteLength) {
  69813. if (everything[startIndex] === SYNC_BYTE$1 && everything[endIndex] === SYNC_BYTE$1) {
  69814. this.trigger("data", everything.subarray(startIndex, endIndex));
  69815. startIndex += MP2T_PACKET_LENGTH$1;
  69816. endIndex += MP2T_PACKET_LENGTH$1;
  69817. continue;
  69818. }
  69819. startIndex++;
  69820. endIndex++;
  69821. }
  69822. if (startIndex < everything.byteLength) {
  69823. buffer.set(everything.subarray(startIndex), 0);
  69824. bytesInBuffer = everything.byteLength - startIndex;
  69825. }
  69826. };
  69827. this.flush = function() {
  69828. if (bytesInBuffer === MP2T_PACKET_LENGTH$1 && buffer[0] === SYNC_BYTE$1) {
  69829. this.trigger("data", buffer);
  69830. bytesInBuffer = 0;
  69831. }
  69832. this.trigger("done");
  69833. };
  69834. this.endTimeline = function() {
  69835. this.flush();
  69836. this.trigger("endedtimeline");
  69837. };
  69838. this.reset = function() {
  69839. bytesInBuffer = 0;
  69840. this.trigger("reset");
  69841. };
  69842. };
  69843. TransportPacketStream.prototype = new Stream$4();
  69844. TransportParseStream = function() {
  69845. var parsePsi, parsePat2, parsePmt2, self2;
  69846. TransportParseStream.prototype.init.call(this);
  69847. self2 = this;
  69848. this.packetsWaitingForPmt = [];
  69849. this.programMapTable = void 0;
  69850. parsePsi = function(payload, psi) {
  69851. var offset = 0;
  69852. if (psi.payloadUnitStartIndicator) {
  69853. offset += payload[offset] + 1;
  69854. }
  69855. if (psi.type === "pat") {
  69856. parsePat2(payload.subarray(offset), psi);
  69857. } else {
  69858. parsePmt2(payload.subarray(offset), psi);
  69859. }
  69860. };
  69861. parsePat2 = function(payload, pat) {
  69862. pat.section_number = payload[7];
  69863. pat.last_section_number = payload[8];
  69864. self2.pmtPid = (payload[10] & 31) << 8 | payload[11];
  69865. pat.pmtPid = self2.pmtPid;
  69866. };
  69867. parsePmt2 = function(payload, pmt) {
  69868. var sectionLength, tableEnd, programInfoLength, offset;
  69869. if (!(payload[5] & 1)) {
  69870. return;
  69871. }
  69872. self2.programMapTable = {
  69873. video: null,
  69874. audio: null,
  69875. "timed-metadata": {}
  69876. };
  69877. sectionLength = (payload[1] & 15) << 8 | payload[2];
  69878. tableEnd = 3 + sectionLength - 4;
  69879. programInfoLength = (payload[10] & 15) << 8 | payload[11];
  69880. offset = 12 + programInfoLength;
  69881. while (offset < tableEnd) {
  69882. var streamType = payload[offset];
  69883. var pid = (payload[offset + 1] & 31) << 8 | payload[offset + 2];
  69884. if (streamType === StreamTypes$2.H264_STREAM_TYPE && self2.programMapTable.video === null) {
  69885. self2.programMapTable.video = pid;
  69886. } else if (streamType === StreamTypes$2.ADTS_STREAM_TYPE && self2.programMapTable.audio === null) {
  69887. self2.programMapTable.audio = pid;
  69888. } else if (streamType === StreamTypes$2.METADATA_STREAM_TYPE) {
  69889. self2.programMapTable["timed-metadata"][pid] = streamType;
  69890. }
  69891. offset += ((payload[offset + 3] & 15) << 8 | payload[offset + 4]) + 5;
  69892. }
  69893. pmt.programMapTable = self2.programMapTable;
  69894. };
  69895. this.push = function(packet) {
  69896. var result = {}, offset = 4;
  69897. result.payloadUnitStartIndicator = !!(packet[1] & 64);
  69898. result.pid = packet[1] & 31;
  69899. result.pid <<= 8;
  69900. result.pid |= packet[2];
  69901. if ((packet[3] & 48) >>> 4 > 1) {
  69902. offset += packet[offset] + 1;
  69903. }
  69904. if (result.pid === 0) {
  69905. result.type = "pat";
  69906. parsePsi(packet.subarray(offset), result);
  69907. this.trigger("data", result);
  69908. } else if (result.pid === this.pmtPid) {
  69909. result.type = "pmt";
  69910. parsePsi(packet.subarray(offset), result);
  69911. this.trigger("data", result);
  69912. while (this.packetsWaitingForPmt.length) {
  69913. this.processPes_.apply(this, this.packetsWaitingForPmt.shift());
  69914. }
  69915. } else if (this.programMapTable === void 0) {
  69916. this.packetsWaitingForPmt.push([packet, offset, result]);
  69917. } else {
  69918. this.processPes_(packet, offset, result);
  69919. }
  69920. };
  69921. this.processPes_ = function(packet, offset, result) {
  69922. if (result.pid === this.programMapTable.video) {
  69923. result.streamType = StreamTypes$2.H264_STREAM_TYPE;
  69924. } else if (result.pid === this.programMapTable.audio) {
  69925. result.streamType = StreamTypes$2.ADTS_STREAM_TYPE;
  69926. } else {
  69927. result.streamType = this.programMapTable["timed-metadata"][result.pid];
  69928. }
  69929. result.type = "pes";
  69930. result.data = packet.subarray(offset);
  69931. this.trigger("data", result);
  69932. };
  69933. };
  69934. TransportParseStream.prototype = new Stream$4();
  69935. TransportParseStream.STREAM_TYPES = {
  69936. h264: 27,
  69937. adts: 15
  69938. };
  69939. ElementaryStream = function() {
  69940. var self2 = this, segmentHadPmt = false, video = {
  69941. data: [],
  69942. size: 0
  69943. }, audio = {
  69944. data: [],
  69945. size: 0
  69946. }, timedMetadata = {
  69947. data: [],
  69948. size: 0
  69949. }, programMapTable, parsePes = function(payload, pes) {
  69950. var ptsDtsFlags;
  69951. const startPrefix = payload[0] << 16 | payload[1] << 8 | payload[2];
  69952. pes.data = new Uint8Array();
  69953. if (startPrefix !== 1) {
  69954. return;
  69955. }
  69956. pes.packetLength = 6 + (payload[4] << 8 | payload[5]);
  69957. pes.dataAlignmentIndicator = (payload[6] & 4) !== 0;
  69958. ptsDtsFlags = payload[7];
  69959. if (ptsDtsFlags & 192) {
  69960. pes.pts = (payload[9] & 14) << 27 | (payload[10] & 255) << 20 | (payload[11] & 254) << 12 | (payload[12] & 255) << 5 | (payload[13] & 254) >>> 3;
  69961. pes.pts *= 4;
  69962. pes.pts += (payload[13] & 6) >>> 1;
  69963. pes.dts = pes.pts;
  69964. if (ptsDtsFlags & 64) {
  69965. pes.dts = (payload[14] & 14) << 27 | (payload[15] & 255) << 20 | (payload[16] & 254) << 12 | (payload[17] & 255) << 5 | (payload[18] & 254) >>> 3;
  69966. pes.dts *= 4;
  69967. pes.dts += (payload[18] & 6) >>> 1;
  69968. }
  69969. }
  69970. pes.data = payload.subarray(9 + payload[8]);
  69971. }, flushStream = function(stream2, type3, forceFlush) {
  69972. var packetData = new Uint8Array(stream2.size), event2 = {
  69973. type: type3
  69974. }, i2 = 0, offset = 0, packetFlushable = false, fragment;
  69975. if (!stream2.data.length || stream2.size < 9) {
  69976. return;
  69977. }
  69978. event2.trackId = stream2.data[0].pid;
  69979. for (i2 = 0; i2 < stream2.data.length; i2++) {
  69980. fragment = stream2.data[i2];
  69981. packetData.set(fragment.data, offset);
  69982. offset += fragment.data.byteLength;
  69983. }
  69984. parsePes(packetData, event2);
  69985. packetFlushable = type3 === "video" || event2.packetLength <= stream2.size;
  69986. if (forceFlush || packetFlushable) {
  69987. stream2.size = 0;
  69988. stream2.data.length = 0;
  69989. }
  69990. if (packetFlushable) {
  69991. self2.trigger("data", event2);
  69992. }
  69993. };
  69994. ElementaryStream.prototype.init.call(this);
  69995. this.push = function(data) {
  69996. ({
  69997. pat: function() {
  69998. },
  69999. pes: function() {
  70000. var stream2, streamType;
  70001. switch (data.streamType) {
  70002. case StreamTypes$2.H264_STREAM_TYPE:
  70003. stream2 = video;
  70004. streamType = "video";
  70005. break;
  70006. case StreamTypes$2.ADTS_STREAM_TYPE:
  70007. stream2 = audio;
  70008. streamType = "audio";
  70009. break;
  70010. case StreamTypes$2.METADATA_STREAM_TYPE:
  70011. stream2 = timedMetadata;
  70012. streamType = "timed-metadata";
  70013. break;
  70014. default:
  70015. return;
  70016. }
  70017. if (data.payloadUnitStartIndicator) {
  70018. flushStream(stream2, streamType, true);
  70019. }
  70020. stream2.data.push(data);
  70021. stream2.size += data.data.byteLength;
  70022. },
  70023. pmt: function() {
  70024. var event2 = {
  70025. type: "metadata",
  70026. tracks: []
  70027. };
  70028. programMapTable = data.programMapTable;
  70029. if (programMapTable.video !== null) {
  70030. event2.tracks.push({
  70031. timelineStartInfo: {
  70032. baseMediaDecodeTime: 0
  70033. },
  70034. id: +programMapTable.video,
  70035. codec: "avc",
  70036. type: "video"
  70037. });
  70038. }
  70039. if (programMapTable.audio !== null) {
  70040. event2.tracks.push({
  70041. timelineStartInfo: {
  70042. baseMediaDecodeTime: 0
  70043. },
  70044. id: +programMapTable.audio,
  70045. codec: "adts",
  70046. type: "audio"
  70047. });
  70048. }
  70049. segmentHadPmt = true;
  70050. self2.trigger("data", event2);
  70051. }
  70052. })[data.type]();
  70053. };
  70054. this.reset = function() {
  70055. video.size = 0;
  70056. video.data.length = 0;
  70057. audio.size = 0;
  70058. audio.data.length = 0;
  70059. this.trigger("reset");
  70060. };
  70061. this.flushStreams_ = function() {
  70062. flushStream(video, "video");
  70063. flushStream(audio, "audio");
  70064. flushStream(timedMetadata, "timed-metadata");
  70065. };
  70066. this.flush = function() {
  70067. if (!segmentHadPmt && programMapTable) {
  70068. var pmt = {
  70069. type: "metadata",
  70070. tracks: []
  70071. };
  70072. if (programMapTable.video !== null) {
  70073. pmt.tracks.push({
  70074. timelineStartInfo: {
  70075. baseMediaDecodeTime: 0
  70076. },
  70077. id: +programMapTable.video,
  70078. codec: "avc",
  70079. type: "video"
  70080. });
  70081. }
  70082. if (programMapTable.audio !== null) {
  70083. pmt.tracks.push({
  70084. timelineStartInfo: {
  70085. baseMediaDecodeTime: 0
  70086. },
  70087. id: +programMapTable.audio,
  70088. codec: "adts",
  70089. type: "audio"
  70090. });
  70091. }
  70092. self2.trigger("data", pmt);
  70093. }
  70094. segmentHadPmt = false;
  70095. this.flushStreams_();
  70096. this.trigger("done");
  70097. };
  70098. };
  70099. ElementaryStream.prototype = new Stream$4();
  70100. var m2ts$1 = {
  70101. PAT_PID: 0,
  70102. MP2T_PACKET_LENGTH: MP2T_PACKET_LENGTH$1,
  70103. TransportPacketStream,
  70104. TransportParseStream,
  70105. ElementaryStream,
  70106. TimestampRolloverStream,
  70107. CaptionStream: CaptionStream$1.CaptionStream,
  70108. Cea608Stream: CaptionStream$1.Cea608Stream,
  70109. Cea708Stream: CaptionStream$1.Cea708Stream,
  70110. MetadataStream: metadataStream
  70111. };
  70112. for (var type2 in StreamTypes$2) {
  70113. if (StreamTypes$2.hasOwnProperty(type2)) {
  70114. m2ts$1[type2] = StreamTypes$2[type2];
  70115. }
  70116. }
  70117. var m2ts_1 = m2ts$1;
  70118. var Stream$3 = stream;
  70119. var ONE_SECOND_IN_TS$2 = clock$2.ONE_SECOND_IN_TS;
  70120. var AdtsStream$1;
  70121. var ADTS_SAMPLING_FREQUENCIES$1 = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350];
  70122. AdtsStream$1 = function(handlePartialSegments) {
  70123. var buffer, frameNum = 0;
  70124. AdtsStream$1.prototype.init.call(this);
  70125. this.skipWarn_ = function(start2, end) {
  70126. this.trigger("log", {
  70127. level: "warn",
  70128. message: `adts skiping bytes ${start2} to ${end} in frame ${frameNum} outside syncword`
  70129. });
  70130. };
  70131. this.push = function(packet) {
  70132. var i2 = 0, frameLength, protectionSkipBytes, oldBuffer, sampleCount, adtsFrameDuration;
  70133. if (!handlePartialSegments) {
  70134. frameNum = 0;
  70135. }
  70136. if (packet.type !== "audio") {
  70137. return;
  70138. }
  70139. if (buffer && buffer.length) {
  70140. oldBuffer = buffer;
  70141. buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength);
  70142. buffer.set(oldBuffer);
  70143. buffer.set(packet.data, oldBuffer.byteLength);
  70144. } else {
  70145. buffer = packet.data;
  70146. }
  70147. var skip;
  70148. while (i2 + 7 < buffer.length) {
  70149. if (buffer[i2] !== 255 || (buffer[i2 + 1] & 246) !== 240) {
  70150. if (typeof skip !== "number") {
  70151. skip = i2;
  70152. }
  70153. i2++;
  70154. continue;
  70155. }
  70156. if (typeof skip === "number") {
  70157. this.skipWarn_(skip, i2);
  70158. skip = null;
  70159. }
  70160. protectionSkipBytes = (~buffer[i2 + 1] & 1) * 2;
  70161. frameLength = (buffer[i2 + 3] & 3) << 11 | buffer[i2 + 4] << 3 | (buffer[i2 + 5] & 224) >> 5;
  70162. sampleCount = ((buffer[i2 + 6] & 3) + 1) * 1024;
  70163. adtsFrameDuration = sampleCount * ONE_SECOND_IN_TS$2 / ADTS_SAMPLING_FREQUENCIES$1[(buffer[i2 + 2] & 60) >>> 2];
  70164. if (buffer.byteLength - i2 < frameLength) {
  70165. break;
  70166. }
  70167. this.trigger("data", {
  70168. pts: packet.pts + frameNum * adtsFrameDuration,
  70169. dts: packet.dts + frameNum * adtsFrameDuration,
  70170. sampleCount,
  70171. audioobjecttype: (buffer[i2 + 2] >>> 6 & 3) + 1,
  70172. channelcount: (buffer[i2 + 2] & 1) << 2 | (buffer[i2 + 3] & 192) >>> 6,
  70173. samplerate: ADTS_SAMPLING_FREQUENCIES$1[(buffer[i2 + 2] & 60) >>> 2],
  70174. samplingfrequencyindex: (buffer[i2 + 2] & 60) >>> 2,
  70175. samplesize: 16,
  70176. data: buffer.subarray(i2 + 7 + protectionSkipBytes, i2 + frameLength)
  70177. });
  70178. frameNum++;
  70179. i2 += frameLength;
  70180. }
  70181. if (typeof skip === "number") {
  70182. this.skipWarn_(skip, i2);
  70183. skip = null;
  70184. }
  70185. buffer = buffer.subarray(i2);
  70186. };
  70187. this.flush = function() {
  70188. frameNum = 0;
  70189. this.trigger("done");
  70190. };
  70191. this.reset = function() {
  70192. buffer = void 0;
  70193. this.trigger("reset");
  70194. };
  70195. this.endTimeline = function() {
  70196. buffer = void 0;
  70197. this.trigger("endedtimeline");
  70198. };
  70199. };
  70200. AdtsStream$1.prototype = new Stream$3();
  70201. var adts = AdtsStream$1;
  70202. var ExpGolomb$1;
  70203. ExpGolomb$1 = function(workingData) {
  70204. var workingBytesAvailable = workingData.byteLength, workingWord = 0, workingBitsAvailable = 0;
  70205. this.length = function() {
  70206. return 8 * workingBytesAvailable;
  70207. };
  70208. this.bitsAvailable = function() {
  70209. return 8 * workingBytesAvailable + workingBitsAvailable;
  70210. };
  70211. this.loadWord = function() {
  70212. var position2 = workingData.byteLength - workingBytesAvailable, workingBytes = new Uint8Array(4), availableBytes = Math.min(4, workingBytesAvailable);
  70213. if (availableBytes === 0) {
  70214. throw new Error("no bytes available");
  70215. }
  70216. workingBytes.set(workingData.subarray(position2, position2 + availableBytes));
  70217. workingWord = new DataView(workingBytes.buffer).getUint32(0);
  70218. workingBitsAvailable = availableBytes * 8;
  70219. workingBytesAvailable -= availableBytes;
  70220. };
  70221. this.skipBits = function(count) {
  70222. var skipBytes;
  70223. if (workingBitsAvailable > count) {
  70224. workingWord <<= count;
  70225. workingBitsAvailable -= count;
  70226. } else {
  70227. count -= workingBitsAvailable;
  70228. skipBytes = Math.floor(count / 8);
  70229. count -= skipBytes * 8;
  70230. workingBytesAvailable -= skipBytes;
  70231. this.loadWord();
  70232. workingWord <<= count;
  70233. workingBitsAvailable -= count;
  70234. }
  70235. };
  70236. this.readBits = function(size) {
  70237. var bits = Math.min(workingBitsAvailable, size), valu = workingWord >>> 32 - bits;
  70238. workingBitsAvailable -= bits;
  70239. if (workingBitsAvailable > 0) {
  70240. workingWord <<= bits;
  70241. } else if (workingBytesAvailable > 0) {
  70242. this.loadWord();
  70243. }
  70244. bits = size - bits;
  70245. if (bits > 0) {
  70246. return valu << bits | this.readBits(bits);
  70247. }
  70248. return valu;
  70249. };
  70250. this.skipLeadingZeros = function() {
  70251. var leadingZeroCount;
  70252. for (leadingZeroCount = 0; leadingZeroCount < workingBitsAvailable; ++leadingZeroCount) {
  70253. if ((workingWord & 2147483648 >>> leadingZeroCount) !== 0) {
  70254. workingWord <<= leadingZeroCount;
  70255. workingBitsAvailable -= leadingZeroCount;
  70256. return leadingZeroCount;
  70257. }
  70258. }
  70259. this.loadWord();
  70260. return leadingZeroCount + this.skipLeadingZeros();
  70261. };
  70262. this.skipUnsignedExpGolomb = function() {
  70263. this.skipBits(1 + this.skipLeadingZeros());
  70264. };
  70265. this.skipExpGolomb = function() {
  70266. this.skipBits(1 + this.skipLeadingZeros());
  70267. };
  70268. this.readUnsignedExpGolomb = function() {
  70269. var clz = this.skipLeadingZeros();
  70270. return this.readBits(clz + 1) - 1;
  70271. };
  70272. this.readExpGolomb = function() {
  70273. var valu = this.readUnsignedExpGolomb();
  70274. if (1 & valu) {
  70275. return 1 + valu >>> 1;
  70276. }
  70277. return -1 * (valu >>> 1);
  70278. };
  70279. this.readBoolean = function() {
  70280. return this.readBits(1) === 1;
  70281. };
  70282. this.readUnsignedByte = function() {
  70283. return this.readBits(8);
  70284. };
  70285. this.loadWord();
  70286. };
  70287. var expGolomb = ExpGolomb$1;
  70288. var Stream$2 = stream;
  70289. var ExpGolomb = expGolomb;
  70290. var H264Stream$1, NalByteStream;
  70291. var PROFILES_WITH_OPTIONAL_SPS_DATA;
  70292. NalByteStream = function() {
  70293. var syncPoint = 0, i2, buffer;
  70294. NalByteStream.prototype.init.call(this);
  70295. this.push = function(data) {
  70296. var swapBuffer;
  70297. if (!buffer) {
  70298. buffer = data.data;
  70299. } else {
  70300. swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength);
  70301. swapBuffer.set(buffer);
  70302. swapBuffer.set(data.data, buffer.byteLength);
  70303. buffer = swapBuffer;
  70304. }
  70305. var len = buffer.byteLength;
  70306. for (; syncPoint < len - 3; syncPoint++) {
  70307. if (buffer[syncPoint + 2] === 1) {
  70308. i2 = syncPoint + 5;
  70309. break;
  70310. }
  70311. }
  70312. while (i2 < len) {
  70313. switch (buffer[i2]) {
  70314. case 0:
  70315. if (buffer[i2 - 1] !== 0) {
  70316. i2 += 2;
  70317. break;
  70318. } else if (buffer[i2 - 2] !== 0) {
  70319. i2++;
  70320. break;
  70321. }
  70322. if (syncPoint + 3 !== i2 - 2) {
  70323. this.trigger("data", buffer.subarray(syncPoint + 3, i2 - 2));
  70324. }
  70325. do {
  70326. i2++;
  70327. } while (buffer[i2] !== 1 && i2 < len);
  70328. syncPoint = i2 - 2;
  70329. i2 += 3;
  70330. break;
  70331. case 1:
  70332. if (buffer[i2 - 1] !== 0 || buffer[i2 - 2] !== 0) {
  70333. i2 += 3;
  70334. break;
  70335. }
  70336. this.trigger("data", buffer.subarray(syncPoint + 3, i2 - 2));
  70337. syncPoint = i2 - 2;
  70338. i2 += 3;
  70339. break;
  70340. default:
  70341. i2 += 3;
  70342. break;
  70343. }
  70344. }
  70345. buffer = buffer.subarray(syncPoint);
  70346. i2 -= syncPoint;
  70347. syncPoint = 0;
  70348. };
  70349. this.reset = function() {
  70350. buffer = null;
  70351. syncPoint = 0;
  70352. this.trigger("reset");
  70353. };
  70354. this.flush = function() {
  70355. if (buffer && buffer.byteLength > 3) {
  70356. this.trigger("data", buffer.subarray(syncPoint + 3));
  70357. }
  70358. buffer = null;
  70359. syncPoint = 0;
  70360. this.trigger("done");
  70361. };
  70362. this.endTimeline = function() {
  70363. this.flush();
  70364. this.trigger("endedtimeline");
  70365. };
  70366. };
  70367. NalByteStream.prototype = new Stream$2();
  70368. PROFILES_WITH_OPTIONAL_SPS_DATA = {
  70369. 100: true,
  70370. 110: true,
  70371. 122: true,
  70372. 244: true,
  70373. 44: true,
  70374. 83: true,
  70375. 86: true,
  70376. 118: true,
  70377. 128: true,
  70378. 138: true,
  70379. 139: true,
  70380. 134: true
  70381. };
  70382. H264Stream$1 = function() {
  70383. var nalByteStream = new NalByteStream(), self2, trackId, currentPts, currentDts, discardEmulationPreventionBytes5, readSequenceParameterSet, skipScalingList;
  70384. H264Stream$1.prototype.init.call(this);
  70385. self2 = this;
  70386. this.push = function(packet) {
  70387. if (packet.type !== "video") {
  70388. return;
  70389. }
  70390. trackId = packet.trackId;
  70391. currentPts = packet.pts;
  70392. currentDts = packet.dts;
  70393. nalByteStream.push(packet);
  70394. };
  70395. nalByteStream.on("data", function(data) {
  70396. var event2 = {
  70397. trackId,
  70398. pts: currentPts,
  70399. dts: currentDts,
  70400. data,
  70401. nalUnitTypeCode: data[0] & 31
  70402. };
  70403. switch (event2.nalUnitTypeCode) {
  70404. case 5:
  70405. event2.nalUnitType = "slice_layer_without_partitioning_rbsp_idr";
  70406. break;
  70407. case 6:
  70408. event2.nalUnitType = "sei_rbsp";
  70409. event2.escapedRBSP = discardEmulationPreventionBytes5(data.subarray(1));
  70410. break;
  70411. case 7:
  70412. event2.nalUnitType = "seq_parameter_set_rbsp";
  70413. event2.escapedRBSP = discardEmulationPreventionBytes5(data.subarray(1));
  70414. event2.config = readSequenceParameterSet(event2.escapedRBSP);
  70415. break;
  70416. case 8:
  70417. event2.nalUnitType = "pic_parameter_set_rbsp";
  70418. break;
  70419. case 9:
  70420. event2.nalUnitType = "access_unit_delimiter_rbsp";
  70421. break;
  70422. }
  70423. self2.trigger("data", event2);
  70424. });
  70425. nalByteStream.on("done", function() {
  70426. self2.trigger("done");
  70427. });
  70428. nalByteStream.on("partialdone", function() {
  70429. self2.trigger("partialdone");
  70430. });
  70431. nalByteStream.on("reset", function() {
  70432. self2.trigger("reset");
  70433. });
  70434. nalByteStream.on("endedtimeline", function() {
  70435. self2.trigger("endedtimeline");
  70436. });
  70437. this.flush = function() {
  70438. nalByteStream.flush();
  70439. };
  70440. this.partialFlush = function() {
  70441. nalByteStream.partialFlush();
  70442. };
  70443. this.reset = function() {
  70444. nalByteStream.reset();
  70445. };
  70446. this.endTimeline = function() {
  70447. nalByteStream.endTimeline();
  70448. };
  70449. skipScalingList = function(count, expGolombDecoder) {
  70450. var lastScale = 8, nextScale = 8, j, deltaScale;
  70451. for (j = 0; j < count; j++) {
  70452. if (nextScale !== 0) {
  70453. deltaScale = expGolombDecoder.readExpGolomb();
  70454. nextScale = (lastScale + deltaScale + 256) % 256;
  70455. }
  70456. lastScale = nextScale === 0 ? lastScale : nextScale;
  70457. }
  70458. };
  70459. discardEmulationPreventionBytes5 = function(data) {
  70460. var length = data.byteLength, emulationPreventionBytesPositions = [], i2 = 1, newLength, newData;
  70461. while (i2 < length - 2) {
  70462. if (data[i2] === 0 && data[i2 + 1] === 0 && data[i2 + 2] === 3) {
  70463. emulationPreventionBytesPositions.push(i2 + 2);
  70464. i2 += 2;
  70465. } else {
  70466. i2++;
  70467. }
  70468. }
  70469. if (emulationPreventionBytesPositions.length === 0) {
  70470. return data;
  70471. }
  70472. newLength = length - emulationPreventionBytesPositions.length;
  70473. newData = new Uint8Array(newLength);
  70474. var sourceIndex = 0;
  70475. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  70476. if (sourceIndex === emulationPreventionBytesPositions[0]) {
  70477. sourceIndex++;
  70478. emulationPreventionBytesPositions.shift();
  70479. }
  70480. newData[i2] = data[sourceIndex];
  70481. }
  70482. return newData;
  70483. };
  70484. readSequenceParameterSet = function(data) {
  70485. var frameCropLeftOffset = 0, frameCropRightOffset = 0, frameCropTopOffset = 0, frameCropBottomOffset = 0, expGolombDecoder, profileIdc, levelIdc, profileCompatibility, chromaFormatIdc, picOrderCntType, numRefFramesInPicOrderCntCycle, picWidthInMbsMinus1, picHeightInMapUnitsMinus1, frameMbsOnlyFlag, scalingListCount, sarRatio = [1, 1], aspectRatioIdc, i2;
  70486. expGolombDecoder = new ExpGolomb(data);
  70487. profileIdc = expGolombDecoder.readUnsignedByte();
  70488. profileCompatibility = expGolombDecoder.readUnsignedByte();
  70489. levelIdc = expGolombDecoder.readUnsignedByte();
  70490. expGolombDecoder.skipUnsignedExpGolomb();
  70491. if (PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc]) {
  70492. chromaFormatIdc = expGolombDecoder.readUnsignedExpGolomb();
  70493. if (chromaFormatIdc === 3) {
  70494. expGolombDecoder.skipBits(1);
  70495. }
  70496. expGolombDecoder.skipUnsignedExpGolomb();
  70497. expGolombDecoder.skipUnsignedExpGolomb();
  70498. expGolombDecoder.skipBits(1);
  70499. if (expGolombDecoder.readBoolean()) {
  70500. scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;
  70501. for (i2 = 0; i2 < scalingListCount; i2++) {
  70502. if (expGolombDecoder.readBoolean()) {
  70503. if (i2 < 6) {
  70504. skipScalingList(16, expGolombDecoder);
  70505. } else {
  70506. skipScalingList(64, expGolombDecoder);
  70507. }
  70508. }
  70509. }
  70510. }
  70511. }
  70512. expGolombDecoder.skipUnsignedExpGolomb();
  70513. picOrderCntType = expGolombDecoder.readUnsignedExpGolomb();
  70514. if (picOrderCntType === 0) {
  70515. expGolombDecoder.readUnsignedExpGolomb();
  70516. } else if (picOrderCntType === 1) {
  70517. expGolombDecoder.skipBits(1);
  70518. expGolombDecoder.skipExpGolomb();
  70519. expGolombDecoder.skipExpGolomb();
  70520. numRefFramesInPicOrderCntCycle = expGolombDecoder.readUnsignedExpGolomb();
  70521. for (i2 = 0; i2 < numRefFramesInPicOrderCntCycle; i2++) {
  70522. expGolombDecoder.skipExpGolomb();
  70523. }
  70524. }
  70525. expGolombDecoder.skipUnsignedExpGolomb();
  70526. expGolombDecoder.skipBits(1);
  70527. picWidthInMbsMinus1 = expGolombDecoder.readUnsignedExpGolomb();
  70528. picHeightInMapUnitsMinus1 = expGolombDecoder.readUnsignedExpGolomb();
  70529. frameMbsOnlyFlag = expGolombDecoder.readBits(1);
  70530. if (frameMbsOnlyFlag === 0) {
  70531. expGolombDecoder.skipBits(1);
  70532. }
  70533. expGolombDecoder.skipBits(1);
  70534. if (expGolombDecoder.readBoolean()) {
  70535. frameCropLeftOffset = expGolombDecoder.readUnsignedExpGolomb();
  70536. frameCropRightOffset = expGolombDecoder.readUnsignedExpGolomb();
  70537. frameCropTopOffset = expGolombDecoder.readUnsignedExpGolomb();
  70538. frameCropBottomOffset = expGolombDecoder.readUnsignedExpGolomb();
  70539. }
  70540. if (expGolombDecoder.readBoolean()) {
  70541. if (expGolombDecoder.readBoolean()) {
  70542. aspectRatioIdc = expGolombDecoder.readUnsignedByte();
  70543. switch (aspectRatioIdc) {
  70544. case 1:
  70545. sarRatio = [1, 1];
  70546. break;
  70547. case 2:
  70548. sarRatio = [12, 11];
  70549. break;
  70550. case 3:
  70551. sarRatio = [10, 11];
  70552. break;
  70553. case 4:
  70554. sarRatio = [16, 11];
  70555. break;
  70556. case 5:
  70557. sarRatio = [40, 33];
  70558. break;
  70559. case 6:
  70560. sarRatio = [24, 11];
  70561. break;
  70562. case 7:
  70563. sarRatio = [20, 11];
  70564. break;
  70565. case 8:
  70566. sarRatio = [32, 11];
  70567. break;
  70568. case 9:
  70569. sarRatio = [80, 33];
  70570. break;
  70571. case 10:
  70572. sarRatio = [18, 11];
  70573. break;
  70574. case 11:
  70575. sarRatio = [15, 11];
  70576. break;
  70577. case 12:
  70578. sarRatio = [64, 33];
  70579. break;
  70580. case 13:
  70581. sarRatio = [160, 99];
  70582. break;
  70583. case 14:
  70584. sarRatio = [4, 3];
  70585. break;
  70586. case 15:
  70587. sarRatio = [3, 2];
  70588. break;
  70589. case 16:
  70590. sarRatio = [2, 1];
  70591. break;
  70592. case 255: {
  70593. sarRatio = [expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte(), expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte()];
  70594. break;
  70595. }
  70596. }
  70597. if (sarRatio) {
  70598. sarRatio[0] / sarRatio[1];
  70599. }
  70600. }
  70601. }
  70602. return {
  70603. profileIdc,
  70604. levelIdc,
  70605. profileCompatibility,
  70606. width: (picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2,
  70607. height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - frameCropTopOffset * 2 - frameCropBottomOffset * 2,
  70608. sarRatio
  70609. };
  70610. };
  70611. };
  70612. H264Stream$1.prototype = new Stream$2();
  70613. var h2643 = {
  70614. H264Stream: H264Stream$1,
  70615. NalByteStream
  70616. };
  70617. var ADTS_SAMPLING_FREQUENCIES = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350];
  70618. var parseId3TagSize = function(header, byteIndex) {
  70619. var returnSize = header[byteIndex + 6] << 21 | header[byteIndex + 7] << 14 | header[byteIndex + 8] << 7 | header[byteIndex + 9], flags = header[byteIndex + 5], footerPresent = (flags & 16) >> 4;
  70620. returnSize = returnSize >= 0 ? returnSize : 0;
  70621. if (footerPresent) {
  70622. return returnSize + 20;
  70623. }
  70624. return returnSize + 10;
  70625. };
  70626. var getId3Offset4 = function(data, offset) {
  70627. if (data.length - offset < 10 || data[offset] !== "I".charCodeAt(0) || data[offset + 1] !== "D".charCodeAt(0) || data[offset + 2] !== "3".charCodeAt(0)) {
  70628. return offset;
  70629. }
  70630. offset += parseId3TagSize(data, offset);
  70631. return getId3Offset4(data, offset);
  70632. };
  70633. var isLikelyAacData$1 = function(data) {
  70634. var offset = getId3Offset4(data, 0);
  70635. return data.length >= offset + 2 && (data[offset] & 255) === 255 && (data[offset + 1] & 240) === 240 && (data[offset + 1] & 22) === 16;
  70636. };
  70637. var parseSyncSafeInteger = function(data) {
  70638. return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];
  70639. };
  70640. var percentEncode = function(bytes, start2, end) {
  70641. var i2, result = "";
  70642. for (i2 = start2; i2 < end; i2++) {
  70643. result += "%" + ("00" + bytes[i2].toString(16)).slice(-2);
  70644. }
  70645. return result;
  70646. };
  70647. var parseIso88591 = function(bytes, start2, end) {
  70648. return unescape(percentEncode(bytes, start2, end));
  70649. };
  70650. var parseAdtsSize = function(header, byteIndex) {
  70651. var lowThree = (header[byteIndex + 5] & 224) >> 5, middle = header[byteIndex + 4] << 3, highTwo = header[byteIndex + 3] & 3 << 11;
  70652. return highTwo | middle | lowThree;
  70653. };
  70654. var parseType$4 = function(header, byteIndex) {
  70655. if (header[byteIndex] === "I".charCodeAt(0) && header[byteIndex + 1] === "D".charCodeAt(0) && header[byteIndex + 2] === "3".charCodeAt(0)) {
  70656. return "timed-metadata";
  70657. } else if (header[byteIndex] & true && (header[byteIndex + 1] & 240) === 240) {
  70658. return "audio";
  70659. }
  70660. return null;
  70661. };
  70662. var parseSampleRate = function(packet) {
  70663. var i2 = 0;
  70664. while (i2 + 5 < packet.length) {
  70665. if (packet[i2] !== 255 || (packet[i2 + 1] & 246) !== 240) {
  70666. i2++;
  70667. continue;
  70668. }
  70669. return ADTS_SAMPLING_FREQUENCIES[(packet[i2 + 2] & 60) >>> 2];
  70670. }
  70671. return null;
  70672. };
  70673. var parseAacTimestamp = function(packet) {
  70674. var frameStart, frameSize, frame, frameHeader;
  70675. frameStart = 10;
  70676. if (packet[5] & 64) {
  70677. frameStart += 4;
  70678. frameStart += parseSyncSafeInteger(packet.subarray(10, 14));
  70679. }
  70680. do {
  70681. frameSize = parseSyncSafeInteger(packet.subarray(frameStart + 4, frameStart + 8));
  70682. if (frameSize < 1) {
  70683. return null;
  70684. }
  70685. frameHeader = String.fromCharCode(packet[frameStart], packet[frameStart + 1], packet[frameStart + 2], packet[frameStart + 3]);
  70686. if (frameHeader === "PRIV") {
  70687. frame = packet.subarray(frameStart + 10, frameStart + frameSize + 10);
  70688. for (var i2 = 0; i2 < frame.byteLength; i2++) {
  70689. if (frame[i2] === 0) {
  70690. var owner = parseIso88591(frame, 0, i2);
  70691. if (owner === "com.apple.streaming.transportStreamTimestamp") {
  70692. var d2 = frame.subarray(i2 + 1);
  70693. var size = (d2[3] & 1) << 30 | d2[4] << 22 | d2[5] << 14 | d2[6] << 6 | d2[7] >>> 2;
  70694. size *= 4;
  70695. size += d2[7] & 3;
  70696. return size;
  70697. }
  70698. break;
  70699. }
  70700. }
  70701. }
  70702. frameStart += 10;
  70703. frameStart += frameSize;
  70704. } while (frameStart < packet.byteLength);
  70705. return null;
  70706. };
  70707. var utils2 = {
  70708. isLikelyAacData: isLikelyAacData$1,
  70709. parseId3TagSize,
  70710. parseAdtsSize,
  70711. parseType: parseType$4,
  70712. parseSampleRate,
  70713. parseAacTimestamp
  70714. };
  70715. var Stream$12 = stream;
  70716. var aacUtils = utils2;
  70717. var AacStream$1;
  70718. AacStream$1 = function() {
  70719. var everything = new Uint8Array(), timeStamp = 0;
  70720. AacStream$1.prototype.init.call(this);
  70721. this.setTimestamp = function(timestamp) {
  70722. timeStamp = timestamp;
  70723. };
  70724. this.push = function(bytes) {
  70725. var frameSize = 0, byteIndex = 0, bytesLeft, chunk, packet, tempLength;
  70726. if (everything.length) {
  70727. tempLength = everything.length;
  70728. everything = new Uint8Array(bytes.byteLength + tempLength);
  70729. everything.set(everything.subarray(0, tempLength));
  70730. everything.set(bytes, tempLength);
  70731. } else {
  70732. everything = bytes;
  70733. }
  70734. while (everything.length - byteIndex >= 3) {
  70735. if (everything[byteIndex] === "I".charCodeAt(0) && everything[byteIndex + 1] === "D".charCodeAt(0) && everything[byteIndex + 2] === "3".charCodeAt(0)) {
  70736. if (everything.length - byteIndex < 10) {
  70737. break;
  70738. }
  70739. frameSize = aacUtils.parseId3TagSize(everything, byteIndex);
  70740. if (byteIndex + frameSize > everything.length) {
  70741. break;
  70742. }
  70743. chunk = {
  70744. type: "timed-metadata",
  70745. data: everything.subarray(byteIndex, byteIndex + frameSize)
  70746. };
  70747. this.trigger("data", chunk);
  70748. byteIndex += frameSize;
  70749. continue;
  70750. } else if ((everything[byteIndex] & 255) === 255 && (everything[byteIndex + 1] & 240) === 240) {
  70751. if (everything.length - byteIndex < 7) {
  70752. break;
  70753. }
  70754. frameSize = aacUtils.parseAdtsSize(everything, byteIndex);
  70755. if (byteIndex + frameSize > everything.length) {
  70756. break;
  70757. }
  70758. packet = {
  70759. type: "audio",
  70760. data: everything.subarray(byteIndex, byteIndex + frameSize),
  70761. pts: timeStamp,
  70762. dts: timeStamp
  70763. };
  70764. this.trigger("data", packet);
  70765. byteIndex += frameSize;
  70766. continue;
  70767. }
  70768. byteIndex++;
  70769. }
  70770. bytesLeft = everything.length - byteIndex;
  70771. if (bytesLeft > 0) {
  70772. everything = everything.subarray(byteIndex);
  70773. } else {
  70774. everything = new Uint8Array();
  70775. }
  70776. };
  70777. this.reset = function() {
  70778. everything = new Uint8Array();
  70779. this.trigger("reset");
  70780. };
  70781. this.endTimeline = function() {
  70782. everything = new Uint8Array();
  70783. this.trigger("endedtimeline");
  70784. };
  70785. };
  70786. AacStream$1.prototype = new Stream$12();
  70787. var aac3 = AacStream$1;
  70788. var AUDIO_PROPERTIES$1 = ["audioobjecttype", "channelcount", "samplerate", "samplingfrequencyindex", "samplesize"];
  70789. var audioProperties = AUDIO_PROPERTIES$1;
  70790. var VIDEO_PROPERTIES$1 = ["width", "height", "profileIdc", "levelIdc", "profileCompatibility", "sarRatio"];
  70791. var videoProperties = VIDEO_PROPERTIES$1;
  70792. var Stream2 = stream;
  70793. var mp43 = mp4Generator;
  70794. var frameUtils = frameUtils$1;
  70795. var audioFrameUtils = audioFrameUtils$1;
  70796. var trackDecodeInfo = trackDecodeInfo$1;
  70797. var m2ts = m2ts_1;
  70798. var clock2 = clock$2;
  70799. var AdtsStream = adts;
  70800. var H264Stream = h2643.H264Stream;
  70801. var AacStream = aac3;
  70802. var isLikelyAacData = utils2.isLikelyAacData;
  70803. var ONE_SECOND_IN_TS$12 = clock$2.ONE_SECOND_IN_TS;
  70804. var AUDIO_PROPERTIES = audioProperties;
  70805. var VIDEO_PROPERTIES = videoProperties;
  70806. var VideoSegmentStream, AudioSegmentStream, Transmuxer, CoalesceStream;
  70807. var retriggerForStream = function(key, event2) {
  70808. event2.stream = key;
  70809. this.trigger("log", event2);
  70810. };
  70811. var addPipelineLogRetriggers = function(transmuxer2, pipeline) {
  70812. var keys3 = Object.keys(pipeline);
  70813. for (var i2 = 0; i2 < keys3.length; i2++) {
  70814. var key = keys3[i2];
  70815. if (key === "headOfPipeline" || !pipeline[key].on) {
  70816. continue;
  70817. }
  70818. pipeline[key].on("log", retriggerForStream.bind(transmuxer2, key));
  70819. }
  70820. };
  70821. var arrayEquals = function(a, b) {
  70822. var i2;
  70823. if (a.length !== b.length) {
  70824. return false;
  70825. }
  70826. for (i2 = 0; i2 < a.length; i2++) {
  70827. if (a[i2] !== b[i2]) {
  70828. return false;
  70829. }
  70830. }
  70831. return true;
  70832. };
  70833. var generateSegmentTimingInfo = function(baseMediaDecodeTime, startDts, startPts, endDts, endPts, prependedContentDuration) {
  70834. var ptsOffsetFromDts = startPts - startDts, decodeDuration = endDts - startDts, presentationDuration = endPts - startPts;
  70835. return {
  70836. start: {
  70837. dts: baseMediaDecodeTime,
  70838. pts: baseMediaDecodeTime + ptsOffsetFromDts
  70839. },
  70840. end: {
  70841. dts: baseMediaDecodeTime + decodeDuration,
  70842. pts: baseMediaDecodeTime + presentationDuration
  70843. },
  70844. prependedContentDuration,
  70845. baseMediaDecodeTime
  70846. };
  70847. };
  70848. AudioSegmentStream = function(track, options2) {
  70849. var adtsFrames = [], sequenceNumber, earliestAllowedDts = 0, audioAppendStartTs = 0, videoBaseMediaDecodeTime = Infinity;
  70850. options2 = options2 || {};
  70851. sequenceNumber = options2.firstSequenceNumber || 0;
  70852. AudioSegmentStream.prototype.init.call(this);
  70853. this.push = function(data) {
  70854. trackDecodeInfo.collectDtsInfo(track, data);
  70855. if (track) {
  70856. AUDIO_PROPERTIES.forEach(function(prop) {
  70857. track[prop] = data[prop];
  70858. });
  70859. }
  70860. adtsFrames.push(data);
  70861. };
  70862. this.setEarliestDts = function(earliestDts) {
  70863. earliestAllowedDts = earliestDts;
  70864. };
  70865. this.setVideoBaseMediaDecodeTime = function(baseMediaDecodeTime) {
  70866. videoBaseMediaDecodeTime = baseMediaDecodeTime;
  70867. };
  70868. this.setAudioAppendStart = function(timestamp) {
  70869. audioAppendStartTs = timestamp;
  70870. };
  70871. this.flush = function() {
  70872. var frames, moof2, mdat2, boxes, frameDuration, segmentDuration, videoClockCyclesOfSilencePrefixed;
  70873. if (adtsFrames.length === 0) {
  70874. this.trigger("done", "AudioSegmentStream");
  70875. return;
  70876. }
  70877. frames = audioFrameUtils.trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts);
  70878. track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options2.keepOriginalTimestamps);
  70879. videoClockCyclesOfSilencePrefixed = audioFrameUtils.prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime);
  70880. track.samples = audioFrameUtils.generateSampleTable(frames);
  70881. mdat2 = mp43.mdat(audioFrameUtils.concatenateFrameData(frames));
  70882. adtsFrames = [];
  70883. moof2 = mp43.moof(sequenceNumber, [track]);
  70884. boxes = new Uint8Array(moof2.byteLength + mdat2.byteLength);
  70885. sequenceNumber++;
  70886. boxes.set(moof2);
  70887. boxes.set(mdat2, moof2.byteLength);
  70888. trackDecodeInfo.clearDtsInfo(track);
  70889. frameDuration = Math.ceil(ONE_SECOND_IN_TS$12 * 1024 / track.samplerate);
  70890. if (frames.length) {
  70891. segmentDuration = frames.length * frameDuration;
  70892. this.trigger("segmentTimingInfo", generateSegmentTimingInfo(
  70893. clock2.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate),
  70894. frames[0].dts,
  70895. frames[0].pts,
  70896. frames[0].dts + segmentDuration,
  70897. frames[0].pts + segmentDuration,
  70898. videoClockCyclesOfSilencePrefixed || 0
  70899. ));
  70900. this.trigger("timingInfo", {
  70901. start: frames[0].pts,
  70902. end: frames[0].pts + segmentDuration
  70903. });
  70904. }
  70905. this.trigger("data", {
  70906. track,
  70907. boxes
  70908. });
  70909. this.trigger("done", "AudioSegmentStream");
  70910. };
  70911. this.reset = function() {
  70912. trackDecodeInfo.clearDtsInfo(track);
  70913. adtsFrames = [];
  70914. this.trigger("reset");
  70915. };
  70916. };
  70917. AudioSegmentStream.prototype = new Stream2();
  70918. VideoSegmentStream = function(track, options2) {
  70919. var sequenceNumber, nalUnits = [], gopsToAlignWith = [], config, pps;
  70920. options2 = options2 || {};
  70921. sequenceNumber = options2.firstSequenceNumber || 0;
  70922. VideoSegmentStream.prototype.init.call(this);
  70923. delete track.minPTS;
  70924. this.gopCache_ = [];
  70925. this.push = function(nalUnit) {
  70926. trackDecodeInfo.collectDtsInfo(track, nalUnit);
  70927. if (nalUnit.nalUnitType === "seq_parameter_set_rbsp" && !config) {
  70928. config = nalUnit.config;
  70929. track.sps = [nalUnit.data];
  70930. VIDEO_PROPERTIES.forEach(function(prop) {
  70931. track[prop] = config[prop];
  70932. }, this);
  70933. }
  70934. if (nalUnit.nalUnitType === "pic_parameter_set_rbsp" && !pps) {
  70935. pps = nalUnit.data;
  70936. track.pps = [nalUnit.data];
  70937. }
  70938. nalUnits.push(nalUnit);
  70939. };
  70940. this.flush = function() {
  70941. var frames, gopForFusion, gops, moof2, mdat2, boxes, prependedContentDuration = 0, firstGop, lastGop;
  70942. while (nalUnits.length) {
  70943. if (nalUnits[0].nalUnitType === "access_unit_delimiter_rbsp") {
  70944. break;
  70945. }
  70946. nalUnits.shift();
  70947. }
  70948. if (nalUnits.length === 0) {
  70949. this.resetStream_();
  70950. this.trigger("done", "VideoSegmentStream");
  70951. return;
  70952. }
  70953. frames = frameUtils.groupNalsIntoFrames(nalUnits);
  70954. gops = frameUtils.groupFramesIntoGops(frames);
  70955. if (!gops[0][0].keyFrame) {
  70956. gopForFusion = this.getGopForFusion_(nalUnits[0], track);
  70957. if (gopForFusion) {
  70958. prependedContentDuration = gopForFusion.duration;
  70959. gops.unshift(gopForFusion);
  70960. gops.byteLength += gopForFusion.byteLength;
  70961. gops.nalCount += gopForFusion.nalCount;
  70962. gops.pts = gopForFusion.pts;
  70963. gops.dts = gopForFusion.dts;
  70964. gops.duration += gopForFusion.duration;
  70965. } else {
  70966. gops = frameUtils.extendFirstKeyFrame(gops);
  70967. }
  70968. }
  70969. if (gopsToAlignWith.length) {
  70970. var alignedGops;
  70971. if (options2.alignGopsAtEnd) {
  70972. alignedGops = this.alignGopsAtEnd_(gops);
  70973. } else {
  70974. alignedGops = this.alignGopsAtStart_(gops);
  70975. }
  70976. if (!alignedGops) {
  70977. this.gopCache_.unshift({
  70978. gop: gops.pop(),
  70979. pps: track.pps,
  70980. sps: track.sps
  70981. });
  70982. this.gopCache_.length = Math.min(6, this.gopCache_.length);
  70983. nalUnits = [];
  70984. this.resetStream_();
  70985. this.trigger("done", "VideoSegmentStream");
  70986. return;
  70987. }
  70988. trackDecodeInfo.clearDtsInfo(track);
  70989. gops = alignedGops;
  70990. }
  70991. trackDecodeInfo.collectDtsInfo(track, gops);
  70992. track.samples = frameUtils.generateSampleTable(gops);
  70993. mdat2 = mp43.mdat(frameUtils.concatenateNalData(gops));
  70994. track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options2.keepOriginalTimestamps);
  70995. this.trigger("processedGopsInfo", gops.map(function(gop) {
  70996. return {
  70997. pts: gop.pts,
  70998. dts: gop.dts,
  70999. byteLength: gop.byteLength
  71000. };
  71001. }));
  71002. firstGop = gops[0];
  71003. lastGop = gops[gops.length - 1];
  71004. this.trigger("segmentTimingInfo", generateSegmentTimingInfo(track.baseMediaDecodeTime, firstGop.dts, firstGop.pts, lastGop.dts + lastGop.duration, lastGop.pts + lastGop.duration, prependedContentDuration));
  71005. this.trigger("timingInfo", {
  71006. start: gops[0].pts,
  71007. end: gops[gops.length - 1].pts + gops[gops.length - 1].duration
  71008. });
  71009. this.gopCache_.unshift({
  71010. gop: gops.pop(),
  71011. pps: track.pps,
  71012. sps: track.sps
  71013. });
  71014. this.gopCache_.length = Math.min(6, this.gopCache_.length);
  71015. nalUnits = [];
  71016. this.trigger("baseMediaDecodeTime", track.baseMediaDecodeTime);
  71017. this.trigger("timelineStartInfo", track.timelineStartInfo);
  71018. moof2 = mp43.moof(sequenceNumber, [track]);
  71019. boxes = new Uint8Array(moof2.byteLength + mdat2.byteLength);
  71020. sequenceNumber++;
  71021. boxes.set(moof2);
  71022. boxes.set(mdat2, moof2.byteLength);
  71023. this.trigger("data", {
  71024. track,
  71025. boxes
  71026. });
  71027. this.resetStream_();
  71028. this.trigger("done", "VideoSegmentStream");
  71029. };
  71030. this.reset = function() {
  71031. this.resetStream_();
  71032. nalUnits = [];
  71033. this.gopCache_.length = 0;
  71034. gopsToAlignWith.length = 0;
  71035. this.trigger("reset");
  71036. };
  71037. this.resetStream_ = function() {
  71038. trackDecodeInfo.clearDtsInfo(track);
  71039. config = void 0;
  71040. pps = void 0;
  71041. };
  71042. this.getGopForFusion_ = function(nalUnit) {
  71043. var halfSecond = 45e3, allowableOverlap = 1e4, nearestDistance = Infinity, dtsDistance, nearestGopObj, currentGop, currentGopObj, i2;
  71044. for (i2 = 0; i2 < this.gopCache_.length; i2++) {
  71045. currentGopObj = this.gopCache_[i2];
  71046. currentGop = currentGopObj.gop;
  71047. if (!(track.pps && arrayEquals(track.pps[0], currentGopObj.pps[0])) || !(track.sps && arrayEquals(track.sps[0], currentGopObj.sps[0]))) {
  71048. continue;
  71049. }
  71050. if (currentGop.dts < track.timelineStartInfo.dts) {
  71051. continue;
  71052. }
  71053. dtsDistance = nalUnit.dts - currentGop.dts - currentGop.duration;
  71054. if (dtsDistance >= -allowableOverlap && dtsDistance <= halfSecond) {
  71055. if (!nearestGopObj || nearestDistance > dtsDistance) {
  71056. nearestGopObj = currentGopObj;
  71057. nearestDistance = dtsDistance;
  71058. }
  71059. }
  71060. }
  71061. if (nearestGopObj) {
  71062. return nearestGopObj.gop;
  71063. }
  71064. return null;
  71065. };
  71066. this.alignGopsAtStart_ = function(gops) {
  71067. var alignIndex, gopIndex, align, gop, byteLength, nalCount, duration5, alignedGops;
  71068. byteLength = gops.byteLength;
  71069. nalCount = gops.nalCount;
  71070. duration5 = gops.duration;
  71071. alignIndex = gopIndex = 0;
  71072. while (alignIndex < gopsToAlignWith.length && gopIndex < gops.length) {
  71073. align = gopsToAlignWith[alignIndex];
  71074. gop = gops[gopIndex];
  71075. if (align.pts === gop.pts) {
  71076. break;
  71077. }
  71078. if (gop.pts > align.pts) {
  71079. alignIndex++;
  71080. continue;
  71081. }
  71082. gopIndex++;
  71083. byteLength -= gop.byteLength;
  71084. nalCount -= gop.nalCount;
  71085. duration5 -= gop.duration;
  71086. }
  71087. if (gopIndex === 0) {
  71088. return gops;
  71089. }
  71090. if (gopIndex === gops.length) {
  71091. return null;
  71092. }
  71093. alignedGops = gops.slice(gopIndex);
  71094. alignedGops.byteLength = byteLength;
  71095. alignedGops.duration = duration5;
  71096. alignedGops.nalCount = nalCount;
  71097. alignedGops.pts = alignedGops[0].pts;
  71098. alignedGops.dts = alignedGops[0].dts;
  71099. return alignedGops;
  71100. };
  71101. this.alignGopsAtEnd_ = function(gops) {
  71102. var alignIndex, gopIndex, align, gop, alignEndIndex, matchFound;
  71103. alignIndex = gopsToAlignWith.length - 1;
  71104. gopIndex = gops.length - 1;
  71105. alignEndIndex = null;
  71106. matchFound = false;
  71107. while (alignIndex >= 0 && gopIndex >= 0) {
  71108. align = gopsToAlignWith[alignIndex];
  71109. gop = gops[gopIndex];
  71110. if (align.pts === gop.pts) {
  71111. matchFound = true;
  71112. break;
  71113. }
  71114. if (align.pts > gop.pts) {
  71115. alignIndex--;
  71116. continue;
  71117. }
  71118. if (alignIndex === gopsToAlignWith.length - 1) {
  71119. alignEndIndex = gopIndex;
  71120. }
  71121. gopIndex--;
  71122. }
  71123. if (!matchFound && alignEndIndex === null) {
  71124. return null;
  71125. }
  71126. var trimIndex;
  71127. if (matchFound) {
  71128. trimIndex = gopIndex;
  71129. } else {
  71130. trimIndex = alignEndIndex;
  71131. }
  71132. if (trimIndex === 0) {
  71133. return gops;
  71134. }
  71135. var alignedGops = gops.slice(trimIndex);
  71136. var metadata = alignedGops.reduce(function(total, gop2) {
  71137. total.byteLength += gop2.byteLength;
  71138. total.duration += gop2.duration;
  71139. total.nalCount += gop2.nalCount;
  71140. return total;
  71141. }, {
  71142. byteLength: 0,
  71143. duration: 0,
  71144. nalCount: 0
  71145. });
  71146. alignedGops.byteLength = metadata.byteLength;
  71147. alignedGops.duration = metadata.duration;
  71148. alignedGops.nalCount = metadata.nalCount;
  71149. alignedGops.pts = alignedGops[0].pts;
  71150. alignedGops.dts = alignedGops[0].dts;
  71151. return alignedGops;
  71152. };
  71153. this.alignGopsWith = function(newGopsToAlignWith) {
  71154. gopsToAlignWith = newGopsToAlignWith;
  71155. };
  71156. };
  71157. VideoSegmentStream.prototype = new Stream2();
  71158. CoalesceStream = function(options2, metadataStream2) {
  71159. this.numberOfTracks = 0;
  71160. this.metadataStream = metadataStream2;
  71161. options2 = options2 || {};
  71162. if (typeof options2.remux !== "undefined") {
  71163. this.remuxTracks = !!options2.remux;
  71164. } else {
  71165. this.remuxTracks = true;
  71166. }
  71167. if (typeof options2.keepOriginalTimestamps === "boolean") {
  71168. this.keepOriginalTimestamps = options2.keepOriginalTimestamps;
  71169. } else {
  71170. this.keepOriginalTimestamps = false;
  71171. }
  71172. this.pendingTracks = [];
  71173. this.videoTrack = null;
  71174. this.pendingBoxes = [];
  71175. this.pendingCaptions = [];
  71176. this.pendingMetadata = [];
  71177. this.pendingBytes = 0;
  71178. this.emittedTracks = 0;
  71179. CoalesceStream.prototype.init.call(this);
  71180. this.push = function(output) {
  71181. if (output.text) {
  71182. return this.pendingCaptions.push(output);
  71183. }
  71184. if (output.frames) {
  71185. return this.pendingMetadata.push(output);
  71186. }
  71187. this.pendingTracks.push(output.track);
  71188. this.pendingBytes += output.boxes.byteLength;
  71189. if (output.track.type === "video") {
  71190. this.videoTrack = output.track;
  71191. this.pendingBoxes.push(output.boxes);
  71192. }
  71193. if (output.track.type === "audio") {
  71194. this.audioTrack = output.track;
  71195. this.pendingBoxes.unshift(output.boxes);
  71196. }
  71197. };
  71198. };
  71199. CoalesceStream.prototype = new Stream2();
  71200. CoalesceStream.prototype.flush = function(flushSource) {
  71201. var offset = 0, event2 = {
  71202. captions: [],
  71203. captionStreams: {},
  71204. metadata: [],
  71205. info: {}
  71206. }, caption, id32, initSegment, timelineStartPts = 0, i2;
  71207. if (this.pendingTracks.length < this.numberOfTracks) {
  71208. if (flushSource !== "VideoSegmentStream" && flushSource !== "AudioSegmentStream") {
  71209. return;
  71210. } else if (this.remuxTracks) {
  71211. return;
  71212. } else if (this.pendingTracks.length === 0) {
  71213. this.emittedTracks++;
  71214. if (this.emittedTracks >= this.numberOfTracks) {
  71215. this.trigger("done");
  71216. this.emittedTracks = 0;
  71217. }
  71218. return;
  71219. }
  71220. }
  71221. if (this.videoTrack) {
  71222. timelineStartPts = this.videoTrack.timelineStartInfo.pts;
  71223. VIDEO_PROPERTIES.forEach(function(prop) {
  71224. event2.info[prop] = this.videoTrack[prop];
  71225. }, this);
  71226. } else if (this.audioTrack) {
  71227. timelineStartPts = this.audioTrack.timelineStartInfo.pts;
  71228. AUDIO_PROPERTIES.forEach(function(prop) {
  71229. event2.info[prop] = this.audioTrack[prop];
  71230. }, this);
  71231. }
  71232. if (this.videoTrack || this.audioTrack) {
  71233. if (this.pendingTracks.length === 1) {
  71234. event2.type = this.pendingTracks[0].type;
  71235. } else {
  71236. event2.type = "combined";
  71237. }
  71238. this.emittedTracks += this.pendingTracks.length;
  71239. initSegment = mp43.initSegment(this.pendingTracks);
  71240. event2.initSegment = new Uint8Array(initSegment.byteLength);
  71241. event2.initSegment.set(initSegment);
  71242. event2.data = new Uint8Array(this.pendingBytes);
  71243. for (i2 = 0; i2 < this.pendingBoxes.length; i2++) {
  71244. event2.data.set(this.pendingBoxes[i2], offset);
  71245. offset += this.pendingBoxes[i2].byteLength;
  71246. }
  71247. for (i2 = 0; i2 < this.pendingCaptions.length; i2++) {
  71248. caption = this.pendingCaptions[i2];
  71249. caption.startTime = clock2.metadataTsToSeconds(caption.startPts, timelineStartPts, this.keepOriginalTimestamps);
  71250. caption.endTime = clock2.metadataTsToSeconds(caption.endPts, timelineStartPts, this.keepOriginalTimestamps);
  71251. event2.captionStreams[caption.stream] = true;
  71252. event2.captions.push(caption);
  71253. }
  71254. for (i2 = 0; i2 < this.pendingMetadata.length; i2++) {
  71255. id32 = this.pendingMetadata[i2];
  71256. id32.cueTime = clock2.metadataTsToSeconds(id32.pts, timelineStartPts, this.keepOriginalTimestamps);
  71257. event2.metadata.push(id32);
  71258. }
  71259. event2.metadata.dispatchType = this.metadataStream.dispatchType;
  71260. this.pendingTracks.length = 0;
  71261. this.videoTrack = null;
  71262. this.pendingBoxes.length = 0;
  71263. this.pendingCaptions.length = 0;
  71264. this.pendingBytes = 0;
  71265. this.pendingMetadata.length = 0;
  71266. this.trigger("data", event2);
  71267. for (i2 = 0; i2 < event2.captions.length; i2++) {
  71268. caption = event2.captions[i2];
  71269. this.trigger("caption", caption);
  71270. }
  71271. for (i2 = 0; i2 < event2.metadata.length; i2++) {
  71272. id32 = event2.metadata[i2];
  71273. this.trigger("id3Frame", id32);
  71274. }
  71275. }
  71276. if (this.emittedTracks >= this.numberOfTracks) {
  71277. this.trigger("done");
  71278. this.emittedTracks = 0;
  71279. }
  71280. };
  71281. CoalesceStream.prototype.setRemux = function(val) {
  71282. this.remuxTracks = val;
  71283. };
  71284. Transmuxer = function(options2) {
  71285. var self2 = this, hasFlushed = true, videoTrack, audioTrack;
  71286. Transmuxer.prototype.init.call(this);
  71287. options2 = options2 || {};
  71288. this.baseMediaDecodeTime = options2.baseMediaDecodeTime || 0;
  71289. this.transmuxPipeline_ = {};
  71290. this.setupAacPipeline = function() {
  71291. var pipeline = {};
  71292. this.transmuxPipeline_ = pipeline;
  71293. pipeline.type = "aac";
  71294. pipeline.metadataStream = new m2ts.MetadataStream();
  71295. pipeline.aacStream = new AacStream();
  71296. pipeline.audioTimestampRolloverStream = new m2ts.TimestampRolloverStream("audio");
  71297. pipeline.timedMetadataTimestampRolloverStream = new m2ts.TimestampRolloverStream("timed-metadata");
  71298. pipeline.adtsStream = new AdtsStream();
  71299. pipeline.coalesceStream = new CoalesceStream(options2, pipeline.metadataStream);
  71300. pipeline.headOfPipeline = pipeline.aacStream;
  71301. pipeline.aacStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream);
  71302. pipeline.aacStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);
  71303. pipeline.metadataStream.on("timestamp", function(frame) {
  71304. pipeline.aacStream.setTimestamp(frame.timeStamp);
  71305. });
  71306. pipeline.aacStream.on("data", function(data) {
  71307. if (data.type !== "timed-metadata" && data.type !== "audio" || pipeline.audioSegmentStream) {
  71308. return;
  71309. }
  71310. audioTrack = audioTrack || {
  71311. timelineStartInfo: {
  71312. baseMediaDecodeTime: self2.baseMediaDecodeTime
  71313. },
  71314. codec: "adts",
  71315. type: "audio"
  71316. };
  71317. pipeline.coalesceStream.numberOfTracks++;
  71318. pipeline.audioSegmentStream = new AudioSegmentStream(audioTrack, options2);
  71319. pipeline.audioSegmentStream.on("log", self2.getLogTrigger_("audioSegmentStream"));
  71320. pipeline.audioSegmentStream.on("timingInfo", self2.trigger.bind(self2, "audioTimingInfo"));
  71321. pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);
  71322. self2.trigger("trackinfo", {
  71323. hasAudio: !!audioTrack,
  71324. hasVideo: !!videoTrack
  71325. });
  71326. });
  71327. pipeline.coalesceStream.on("data", this.trigger.bind(this, "data"));
  71328. pipeline.coalesceStream.on("done", this.trigger.bind(this, "done"));
  71329. addPipelineLogRetriggers(this, pipeline);
  71330. };
  71331. this.setupTsPipeline = function() {
  71332. var pipeline = {};
  71333. this.transmuxPipeline_ = pipeline;
  71334. pipeline.type = "ts";
  71335. pipeline.metadataStream = new m2ts.MetadataStream();
  71336. pipeline.packetStream = new m2ts.TransportPacketStream();
  71337. pipeline.parseStream = new m2ts.TransportParseStream();
  71338. pipeline.elementaryStream = new m2ts.ElementaryStream();
  71339. pipeline.timestampRolloverStream = new m2ts.TimestampRolloverStream();
  71340. pipeline.adtsStream = new AdtsStream();
  71341. pipeline.h264Stream = new H264Stream();
  71342. pipeline.captionStream = new m2ts.CaptionStream(options2);
  71343. pipeline.coalesceStream = new CoalesceStream(options2, pipeline.metadataStream);
  71344. pipeline.headOfPipeline = pipeline.packetStream;
  71345. pipeline.packetStream.pipe(pipeline.parseStream).pipe(pipeline.elementaryStream).pipe(pipeline.timestampRolloverStream);
  71346. pipeline.timestampRolloverStream.pipe(pipeline.h264Stream);
  71347. pipeline.timestampRolloverStream.pipe(pipeline.adtsStream);
  71348. pipeline.timestampRolloverStream.pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);
  71349. pipeline.h264Stream.pipe(pipeline.captionStream).pipe(pipeline.coalesceStream);
  71350. pipeline.elementaryStream.on("data", function(data) {
  71351. var i2;
  71352. if (data.type === "metadata") {
  71353. i2 = data.tracks.length;
  71354. while (i2--) {
  71355. if (!videoTrack && data.tracks[i2].type === "video") {
  71356. videoTrack = data.tracks[i2];
  71357. videoTrack.timelineStartInfo.baseMediaDecodeTime = self2.baseMediaDecodeTime;
  71358. } else if (!audioTrack && data.tracks[i2].type === "audio") {
  71359. audioTrack = data.tracks[i2];
  71360. audioTrack.timelineStartInfo.baseMediaDecodeTime = self2.baseMediaDecodeTime;
  71361. }
  71362. }
  71363. if (videoTrack && !pipeline.videoSegmentStream) {
  71364. pipeline.coalesceStream.numberOfTracks++;
  71365. pipeline.videoSegmentStream = new VideoSegmentStream(videoTrack, options2);
  71366. pipeline.videoSegmentStream.on("log", self2.getLogTrigger_("videoSegmentStream"));
  71367. pipeline.videoSegmentStream.on("timelineStartInfo", function(timelineStartInfo) {
  71368. if (audioTrack && !options2.keepOriginalTimestamps) {
  71369. audioTrack.timelineStartInfo = timelineStartInfo;
  71370. pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts - self2.baseMediaDecodeTime);
  71371. }
  71372. });
  71373. pipeline.videoSegmentStream.on("processedGopsInfo", self2.trigger.bind(self2, "gopInfo"));
  71374. pipeline.videoSegmentStream.on("segmentTimingInfo", self2.trigger.bind(self2, "videoSegmentTimingInfo"));
  71375. pipeline.videoSegmentStream.on("baseMediaDecodeTime", function(baseMediaDecodeTime) {
  71376. if (audioTrack) {
  71377. pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime);
  71378. }
  71379. });
  71380. pipeline.videoSegmentStream.on("timingInfo", self2.trigger.bind(self2, "videoTimingInfo"));
  71381. pipeline.h264Stream.pipe(pipeline.videoSegmentStream).pipe(pipeline.coalesceStream);
  71382. }
  71383. if (audioTrack && !pipeline.audioSegmentStream) {
  71384. pipeline.coalesceStream.numberOfTracks++;
  71385. pipeline.audioSegmentStream = new AudioSegmentStream(audioTrack, options2);
  71386. pipeline.audioSegmentStream.on("log", self2.getLogTrigger_("audioSegmentStream"));
  71387. pipeline.audioSegmentStream.on("timingInfo", self2.trigger.bind(self2, "audioTimingInfo"));
  71388. pipeline.audioSegmentStream.on("segmentTimingInfo", self2.trigger.bind(self2, "audioSegmentTimingInfo"));
  71389. pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);
  71390. }
  71391. self2.trigger("trackinfo", {
  71392. hasAudio: !!audioTrack,
  71393. hasVideo: !!videoTrack
  71394. });
  71395. }
  71396. });
  71397. pipeline.coalesceStream.on("data", this.trigger.bind(this, "data"));
  71398. pipeline.coalesceStream.on("id3Frame", function(id3Frame) {
  71399. id3Frame.dispatchType = pipeline.metadataStream.dispatchType;
  71400. self2.trigger("id3Frame", id3Frame);
  71401. });
  71402. pipeline.coalesceStream.on("caption", this.trigger.bind(this, "caption"));
  71403. pipeline.coalesceStream.on("done", this.trigger.bind(this, "done"));
  71404. addPipelineLogRetriggers(this, pipeline);
  71405. };
  71406. this.setBaseMediaDecodeTime = function(baseMediaDecodeTime) {
  71407. var pipeline = this.transmuxPipeline_;
  71408. if (!options2.keepOriginalTimestamps) {
  71409. this.baseMediaDecodeTime = baseMediaDecodeTime;
  71410. }
  71411. if (audioTrack) {
  71412. audioTrack.timelineStartInfo.dts = void 0;
  71413. audioTrack.timelineStartInfo.pts = void 0;
  71414. trackDecodeInfo.clearDtsInfo(audioTrack);
  71415. if (pipeline.audioTimestampRolloverStream) {
  71416. pipeline.audioTimestampRolloverStream.discontinuity();
  71417. }
  71418. }
  71419. if (videoTrack) {
  71420. if (pipeline.videoSegmentStream) {
  71421. pipeline.videoSegmentStream.gopCache_ = [];
  71422. }
  71423. videoTrack.timelineStartInfo.dts = void 0;
  71424. videoTrack.timelineStartInfo.pts = void 0;
  71425. trackDecodeInfo.clearDtsInfo(videoTrack);
  71426. pipeline.captionStream.reset();
  71427. }
  71428. if (pipeline.timestampRolloverStream) {
  71429. pipeline.timestampRolloverStream.discontinuity();
  71430. }
  71431. };
  71432. this.setAudioAppendStart = function(timestamp) {
  71433. if (audioTrack) {
  71434. this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp);
  71435. }
  71436. };
  71437. this.setRemux = function(val) {
  71438. var pipeline = this.transmuxPipeline_;
  71439. options2.remux = val;
  71440. if (pipeline && pipeline.coalesceStream) {
  71441. pipeline.coalesceStream.setRemux(val);
  71442. }
  71443. };
  71444. this.alignGopsWith = function(gopsToAlignWith) {
  71445. if (videoTrack && this.transmuxPipeline_.videoSegmentStream) {
  71446. this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith);
  71447. }
  71448. };
  71449. this.getLogTrigger_ = function(key) {
  71450. var self3 = this;
  71451. return function(event2) {
  71452. event2.stream = key;
  71453. self3.trigger("log", event2);
  71454. };
  71455. };
  71456. this.push = function(data) {
  71457. if (hasFlushed) {
  71458. var isAac = isLikelyAacData(data);
  71459. if (isAac && this.transmuxPipeline_.type !== "aac") {
  71460. this.setupAacPipeline();
  71461. } else if (!isAac && this.transmuxPipeline_.type !== "ts") {
  71462. this.setupTsPipeline();
  71463. }
  71464. hasFlushed = false;
  71465. }
  71466. this.transmuxPipeline_.headOfPipeline.push(data);
  71467. };
  71468. this.flush = function() {
  71469. hasFlushed = true;
  71470. this.transmuxPipeline_.headOfPipeline.flush();
  71471. };
  71472. this.endTimeline = function() {
  71473. this.transmuxPipeline_.headOfPipeline.endTimeline();
  71474. };
  71475. this.reset = function() {
  71476. if (this.transmuxPipeline_.headOfPipeline) {
  71477. this.transmuxPipeline_.headOfPipeline.reset();
  71478. }
  71479. };
  71480. this.resetCaptions = function() {
  71481. if (this.transmuxPipeline_.captionStream) {
  71482. this.transmuxPipeline_.captionStream.reset();
  71483. }
  71484. };
  71485. };
  71486. Transmuxer.prototype = new Stream2();
  71487. var transmuxer = {
  71488. Transmuxer,
  71489. VideoSegmentStream,
  71490. AudioSegmentStream,
  71491. AUDIO_PROPERTIES,
  71492. VIDEO_PROPERTIES,
  71493. generateSegmentTimingInfo
  71494. };
  71495. var toUnsigned$3 = function(value) {
  71496. return value >>> 0;
  71497. };
  71498. var toHexString$1 = function(value) {
  71499. return ("00" + value.toString(16)).slice(-2);
  71500. };
  71501. var bin = {
  71502. toUnsigned: toUnsigned$3,
  71503. toHexString: toHexString$1
  71504. };
  71505. var parseType$3 = function(buffer) {
  71506. var result = "";
  71507. result += String.fromCharCode(buffer[0]);
  71508. result += String.fromCharCode(buffer[1]);
  71509. result += String.fromCharCode(buffer[2]);
  71510. result += String.fromCharCode(buffer[3]);
  71511. return result;
  71512. };
  71513. var parseType_1 = parseType$3;
  71514. var toUnsigned$2 = bin.toUnsigned;
  71515. var parseType$2 = parseType_1;
  71516. var findBox$2 = function(data, path) {
  71517. var results = [], i2, size, type3, end, subresults;
  71518. if (!path.length) {
  71519. return null;
  71520. }
  71521. for (i2 = 0; i2 < data.byteLength; ) {
  71522. size = toUnsigned$2(data[i2] << 24 | data[i2 + 1] << 16 | data[i2 + 2] << 8 | data[i2 + 3]);
  71523. type3 = parseType$2(data.subarray(i2 + 4, i2 + 8));
  71524. end = size > 1 ? i2 + size : data.byteLength;
  71525. if (type3 === path[0]) {
  71526. if (path.length === 1) {
  71527. results.push(data.subarray(i2 + 8, end));
  71528. } else {
  71529. subresults = findBox$2(data.subarray(i2 + 8, end), path.slice(1));
  71530. if (subresults.length) {
  71531. results = results.concat(subresults);
  71532. }
  71533. }
  71534. }
  71535. i2 = end;
  71536. }
  71537. return results;
  71538. };
  71539. var findBox_1 = findBox$2;
  71540. var toUnsigned$1 = bin.toUnsigned;
  71541. var getUint64$22 = numbers2.getUint64;
  71542. var tfdt = function(data) {
  71543. var result = {
  71544. version: data[0],
  71545. flags: new Uint8Array(data.subarray(1, 4))
  71546. };
  71547. if (result.version === 1) {
  71548. result.baseMediaDecodeTime = getUint64$22(data.subarray(4));
  71549. } else {
  71550. result.baseMediaDecodeTime = toUnsigned$1(data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]);
  71551. }
  71552. return result;
  71553. };
  71554. var parseTfdt$2 = tfdt;
  71555. var parseSampleFlags$1 = function(flags) {
  71556. return {
  71557. isLeading: (flags[0] & 12) >>> 2,
  71558. dependsOn: flags[0] & 3,
  71559. isDependedOn: (flags[1] & 192) >>> 6,
  71560. hasRedundancy: (flags[1] & 48) >>> 4,
  71561. paddingValue: (flags[1] & 14) >>> 1,
  71562. isNonSyncSample: flags[1] & 1,
  71563. degradationPriority: flags[2] << 8 | flags[3]
  71564. };
  71565. };
  71566. var parseSampleFlags_1 = parseSampleFlags$1;
  71567. var parseSampleFlags = parseSampleFlags_1;
  71568. var trun = function(data) {
  71569. var result = {
  71570. version: data[0],
  71571. flags: new Uint8Array(data.subarray(1, 4)),
  71572. samples: []
  71573. }, view = new DataView(data.buffer, data.byteOffset, data.byteLength), dataOffsetPresent = result.flags[2] & 1, firstSampleFlagsPresent = result.flags[2] & 4, sampleDurationPresent = result.flags[1] & 1, sampleSizePresent = result.flags[1] & 2, sampleFlagsPresent = result.flags[1] & 4, sampleCompositionTimeOffsetPresent = result.flags[1] & 8, sampleCount = view.getUint32(4), offset = 8, sample;
  71574. if (dataOffsetPresent) {
  71575. result.dataOffset = view.getInt32(offset);
  71576. offset += 4;
  71577. }
  71578. if (firstSampleFlagsPresent && sampleCount) {
  71579. sample = {
  71580. flags: parseSampleFlags(data.subarray(offset, offset + 4))
  71581. };
  71582. offset += 4;
  71583. if (sampleDurationPresent) {
  71584. sample.duration = view.getUint32(offset);
  71585. offset += 4;
  71586. }
  71587. if (sampleSizePresent) {
  71588. sample.size = view.getUint32(offset);
  71589. offset += 4;
  71590. }
  71591. if (sampleCompositionTimeOffsetPresent) {
  71592. if (result.version === 1) {
  71593. sample.compositionTimeOffset = view.getInt32(offset);
  71594. } else {
  71595. sample.compositionTimeOffset = view.getUint32(offset);
  71596. }
  71597. offset += 4;
  71598. }
  71599. result.samples.push(sample);
  71600. sampleCount--;
  71601. }
  71602. while (sampleCount--) {
  71603. sample = {};
  71604. if (sampleDurationPresent) {
  71605. sample.duration = view.getUint32(offset);
  71606. offset += 4;
  71607. }
  71608. if (sampleSizePresent) {
  71609. sample.size = view.getUint32(offset);
  71610. offset += 4;
  71611. }
  71612. if (sampleFlagsPresent) {
  71613. sample.flags = parseSampleFlags(data.subarray(offset, offset + 4));
  71614. offset += 4;
  71615. }
  71616. if (sampleCompositionTimeOffsetPresent) {
  71617. if (result.version === 1) {
  71618. sample.compositionTimeOffset = view.getInt32(offset);
  71619. } else {
  71620. sample.compositionTimeOffset = view.getUint32(offset);
  71621. }
  71622. offset += 4;
  71623. }
  71624. result.samples.push(sample);
  71625. }
  71626. return result;
  71627. };
  71628. var parseTrun$2 = trun;
  71629. var tfhd = function(data) {
  71630. var view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = {
  71631. version: data[0],
  71632. flags: new Uint8Array(data.subarray(1, 4)),
  71633. trackId: view.getUint32(4)
  71634. }, baseDataOffsetPresent = result.flags[2] & 1, sampleDescriptionIndexPresent = result.flags[2] & 2, defaultSampleDurationPresent = result.flags[2] & 8, defaultSampleSizePresent = result.flags[2] & 16, defaultSampleFlagsPresent = result.flags[2] & 32, durationIsEmpty = result.flags[0] & 65536, defaultBaseIsMoof = result.flags[0] & 131072, i2;
  71635. i2 = 8;
  71636. if (baseDataOffsetPresent) {
  71637. i2 += 4;
  71638. result.baseDataOffset = view.getUint32(12);
  71639. i2 += 4;
  71640. }
  71641. if (sampleDescriptionIndexPresent) {
  71642. result.sampleDescriptionIndex = view.getUint32(i2);
  71643. i2 += 4;
  71644. }
  71645. if (defaultSampleDurationPresent) {
  71646. result.defaultSampleDuration = view.getUint32(i2);
  71647. i2 += 4;
  71648. }
  71649. if (defaultSampleSizePresent) {
  71650. result.defaultSampleSize = view.getUint32(i2);
  71651. i2 += 4;
  71652. }
  71653. if (defaultSampleFlagsPresent) {
  71654. result.defaultSampleFlags = view.getUint32(i2);
  71655. }
  71656. if (durationIsEmpty) {
  71657. result.durationIsEmpty = true;
  71658. }
  71659. if (!baseDataOffsetPresent && defaultBaseIsMoof) {
  71660. result.baseDataOffsetIsMoof = true;
  71661. }
  71662. return result;
  71663. };
  71664. var parseTfhd$2 = tfhd;
  71665. var win2;
  71666. if (typeof window !== "undefined") {
  71667. win2 = window;
  71668. } else if (typeof commonjsGlobal2 !== "undefined") {
  71669. win2 = commonjsGlobal2;
  71670. } else if (typeof self !== "undefined") {
  71671. win2 = self;
  71672. } else {
  71673. win2 = {};
  71674. }
  71675. var window_12 = win2;
  71676. var discardEmulationPreventionBytes4 = captionPacketParser.discardEmulationPreventionBytes;
  71677. var CaptionStream = captionStream.CaptionStream;
  71678. var findBox$12 = findBox_1;
  71679. var parseTfdt$1 = parseTfdt$2;
  71680. var parseTrun$1 = parseTrun$2;
  71681. var parseTfhd$1 = parseTfhd$2;
  71682. var window$22 = window_12;
  71683. var mapToSample = function(offset, samples) {
  71684. var approximateOffset = offset;
  71685. for (var i2 = 0; i2 < samples.length; i2++) {
  71686. var sample = samples[i2];
  71687. if (approximateOffset < sample.size) {
  71688. return sample;
  71689. }
  71690. approximateOffset -= sample.size;
  71691. }
  71692. return null;
  71693. };
  71694. var findSeiNals = function(avcStream, samples, trackId) {
  71695. var avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength), result = {
  71696. logs: [],
  71697. seiNals: []
  71698. }, seiNal, i2, length, lastMatchedSample;
  71699. for (i2 = 0; i2 + 4 < avcStream.length; i2 += length) {
  71700. length = avcView.getUint32(i2);
  71701. i2 += 4;
  71702. if (length <= 0) {
  71703. continue;
  71704. }
  71705. switch (avcStream[i2] & 31) {
  71706. case 6:
  71707. var data = avcStream.subarray(i2 + 1, i2 + 1 + length);
  71708. var matchingSample = mapToSample(i2, samples);
  71709. seiNal = {
  71710. nalUnitType: "sei_rbsp",
  71711. size: length,
  71712. data,
  71713. escapedRBSP: discardEmulationPreventionBytes4(data),
  71714. trackId
  71715. };
  71716. if (matchingSample) {
  71717. seiNal.pts = matchingSample.pts;
  71718. seiNal.dts = matchingSample.dts;
  71719. lastMatchedSample = matchingSample;
  71720. } else if (lastMatchedSample) {
  71721. seiNal.pts = lastMatchedSample.pts;
  71722. seiNal.dts = lastMatchedSample.dts;
  71723. } else {
  71724. result.logs.push({
  71725. level: "warn",
  71726. message: "We've encountered a nal unit without data at " + i2 + " for trackId " + trackId + ". See mux.js#223."
  71727. });
  71728. break;
  71729. }
  71730. result.seiNals.push(seiNal);
  71731. break;
  71732. }
  71733. }
  71734. return result;
  71735. };
  71736. var parseSamples = function(truns, baseMediaDecodeTime, tfhd2) {
  71737. var currentDts = baseMediaDecodeTime;
  71738. var defaultSampleDuration = tfhd2.defaultSampleDuration || 0;
  71739. var defaultSampleSize = tfhd2.defaultSampleSize || 0;
  71740. var trackId = tfhd2.trackId;
  71741. var allSamples = [];
  71742. truns.forEach(function(trun2) {
  71743. var trackRun = parseTrun$1(trun2);
  71744. var samples = trackRun.samples;
  71745. samples.forEach(function(sample) {
  71746. if (sample.duration === void 0) {
  71747. sample.duration = defaultSampleDuration;
  71748. }
  71749. if (sample.size === void 0) {
  71750. sample.size = defaultSampleSize;
  71751. }
  71752. sample.trackId = trackId;
  71753. sample.dts = currentDts;
  71754. if (sample.compositionTimeOffset === void 0) {
  71755. sample.compositionTimeOffset = 0;
  71756. }
  71757. if (typeof currentDts === "bigint") {
  71758. sample.pts = currentDts + window$22.BigInt(sample.compositionTimeOffset);
  71759. currentDts += window$22.BigInt(sample.duration);
  71760. } else {
  71761. sample.pts = currentDts + sample.compositionTimeOffset;
  71762. currentDts += sample.duration;
  71763. }
  71764. });
  71765. allSamples = allSamples.concat(samples);
  71766. });
  71767. return allSamples;
  71768. };
  71769. var parseCaptionNals = function(segment, videoTrackId) {
  71770. var trafs = findBox$12(segment, ["moof", "traf"]);
  71771. var mdats = findBox$12(segment, ["mdat"]);
  71772. var captionNals = {};
  71773. var mdatTrafPairs = [];
  71774. mdats.forEach(function(mdat2, index2) {
  71775. var matchingTraf = trafs[index2];
  71776. mdatTrafPairs.push({
  71777. mdat: mdat2,
  71778. traf: matchingTraf
  71779. });
  71780. });
  71781. mdatTrafPairs.forEach(function(pair) {
  71782. var mdat2 = pair.mdat;
  71783. var traf2 = pair.traf;
  71784. var tfhd2 = findBox$12(traf2, ["tfhd"]);
  71785. var headerInfo = parseTfhd$1(tfhd2[0]);
  71786. var trackId = headerInfo.trackId;
  71787. var tfdt2 = findBox$12(traf2, ["tfdt"]);
  71788. var baseMediaDecodeTime = tfdt2.length > 0 ? parseTfdt$1(tfdt2[0]).baseMediaDecodeTime : 0;
  71789. var truns = findBox$12(traf2, ["trun"]);
  71790. var samples;
  71791. var result;
  71792. if (videoTrackId === trackId && truns.length > 0) {
  71793. samples = parseSamples(truns, baseMediaDecodeTime, headerInfo);
  71794. result = findSeiNals(mdat2, samples, trackId);
  71795. if (!captionNals[trackId]) {
  71796. captionNals[trackId] = {
  71797. seiNals: [],
  71798. logs: []
  71799. };
  71800. }
  71801. captionNals[trackId].seiNals = captionNals[trackId].seiNals.concat(result.seiNals);
  71802. captionNals[trackId].logs = captionNals[trackId].logs.concat(result.logs);
  71803. }
  71804. });
  71805. return captionNals;
  71806. };
  71807. var parseEmbeddedCaptions = function(segment, trackId, timescale3) {
  71808. var captionNals;
  71809. if (trackId === null) {
  71810. return null;
  71811. }
  71812. captionNals = parseCaptionNals(segment, trackId);
  71813. var trackNals = captionNals[trackId] || {};
  71814. return {
  71815. seiNals: trackNals.seiNals,
  71816. logs: trackNals.logs,
  71817. timescale: timescale3
  71818. };
  71819. };
  71820. var CaptionParser = function() {
  71821. var isInitialized = false;
  71822. var captionStream2;
  71823. var segmentCache;
  71824. var trackId;
  71825. var timescale3;
  71826. var parsedCaptions;
  71827. var parsingPartial;
  71828. this.isInitialized = function() {
  71829. return isInitialized;
  71830. };
  71831. this.init = function(options2) {
  71832. captionStream2 = new CaptionStream();
  71833. isInitialized = true;
  71834. parsingPartial = options2 ? options2.isPartial : false;
  71835. captionStream2.on("data", function(event2) {
  71836. event2.startTime = event2.startPts / timescale3;
  71837. event2.endTime = event2.endPts / timescale3;
  71838. parsedCaptions.captions.push(event2);
  71839. parsedCaptions.captionStreams[event2.stream] = true;
  71840. });
  71841. captionStream2.on("log", function(log2) {
  71842. parsedCaptions.logs.push(log2);
  71843. });
  71844. };
  71845. this.isNewInit = function(videoTrackIds, timescales) {
  71846. if (videoTrackIds && videoTrackIds.length === 0 || timescales && typeof timescales === "object" && Object.keys(timescales).length === 0) {
  71847. return false;
  71848. }
  71849. return trackId !== videoTrackIds[0] || timescale3 !== timescales[trackId];
  71850. };
  71851. this.parse = function(segment, videoTrackIds, timescales) {
  71852. var parsedData;
  71853. if (!this.isInitialized()) {
  71854. return null;
  71855. } else if (!videoTrackIds || !timescales) {
  71856. return null;
  71857. } else if (this.isNewInit(videoTrackIds, timescales)) {
  71858. trackId = videoTrackIds[0];
  71859. timescale3 = timescales[trackId];
  71860. } else if (trackId === null || !timescale3) {
  71861. segmentCache.push(segment);
  71862. return null;
  71863. }
  71864. while (segmentCache.length > 0) {
  71865. var cachedSegment = segmentCache.shift();
  71866. this.parse(cachedSegment, videoTrackIds, timescales);
  71867. }
  71868. parsedData = parseEmbeddedCaptions(segment, trackId, timescale3);
  71869. if (parsedData && parsedData.logs) {
  71870. parsedCaptions.logs = parsedCaptions.logs.concat(parsedData.logs);
  71871. }
  71872. if (parsedData === null || !parsedData.seiNals) {
  71873. if (parsedCaptions.logs.length) {
  71874. return {
  71875. logs: parsedCaptions.logs,
  71876. captions: [],
  71877. captionStreams: []
  71878. };
  71879. }
  71880. return null;
  71881. }
  71882. this.pushNals(parsedData.seiNals);
  71883. this.flushStream();
  71884. return parsedCaptions;
  71885. };
  71886. this.pushNals = function(nals) {
  71887. if (!this.isInitialized() || !nals || nals.length === 0) {
  71888. return null;
  71889. }
  71890. nals.forEach(function(nal) {
  71891. captionStream2.push(nal);
  71892. });
  71893. };
  71894. this.flushStream = function() {
  71895. if (!this.isInitialized()) {
  71896. return null;
  71897. }
  71898. if (!parsingPartial) {
  71899. captionStream2.flush();
  71900. } else {
  71901. captionStream2.partialFlush();
  71902. }
  71903. };
  71904. this.clearParsedCaptions = function() {
  71905. parsedCaptions.captions = [];
  71906. parsedCaptions.captionStreams = {};
  71907. parsedCaptions.logs = [];
  71908. };
  71909. this.resetCaptionStream = function() {
  71910. if (!this.isInitialized()) {
  71911. return null;
  71912. }
  71913. captionStream2.reset();
  71914. };
  71915. this.clearAllCaptions = function() {
  71916. this.clearParsedCaptions();
  71917. this.resetCaptionStream();
  71918. };
  71919. this.reset = function() {
  71920. segmentCache = [];
  71921. trackId = null;
  71922. timescale3 = null;
  71923. if (!parsedCaptions) {
  71924. parsedCaptions = {
  71925. captions: [],
  71926. captionStreams: {},
  71927. logs: []
  71928. };
  71929. } else {
  71930. this.clearParsedCaptions();
  71931. }
  71932. this.resetCaptionStream();
  71933. };
  71934. this.reset();
  71935. };
  71936. var captionParser = CaptionParser;
  71937. var uint8ToCString$1 = function(data) {
  71938. var index2 = 0;
  71939. var curChar = String.fromCharCode(data[index2]);
  71940. var retString = "";
  71941. while (curChar !== "\0") {
  71942. retString += curChar;
  71943. index2++;
  71944. curChar = String.fromCharCode(data[index2]);
  71945. }
  71946. retString += curChar;
  71947. return retString;
  71948. };
  71949. var string = {
  71950. uint8ToCString: uint8ToCString$1
  71951. };
  71952. var uint8ToCString = string.uint8ToCString;
  71953. var getUint64$12 = numbers2.getUint64;
  71954. var parseEmsgBox = function(boxData) {
  71955. var offset = 4;
  71956. var version2 = boxData[0];
  71957. var scheme_id_uri, value, timescale3, presentation_time, presentation_time_delta, event_duration, id, message_data;
  71958. if (version2 === 0) {
  71959. scheme_id_uri = uint8ToCString(boxData.subarray(offset));
  71960. offset += scheme_id_uri.length;
  71961. value = uint8ToCString(boxData.subarray(offset));
  71962. offset += value.length;
  71963. var dv = new DataView(boxData.buffer);
  71964. timescale3 = dv.getUint32(offset);
  71965. offset += 4;
  71966. presentation_time_delta = dv.getUint32(offset);
  71967. offset += 4;
  71968. event_duration = dv.getUint32(offset);
  71969. offset += 4;
  71970. id = dv.getUint32(offset);
  71971. offset += 4;
  71972. } else if (version2 === 1) {
  71973. var dv = new DataView(boxData.buffer);
  71974. timescale3 = dv.getUint32(offset);
  71975. offset += 4;
  71976. presentation_time = getUint64$12(boxData.subarray(offset));
  71977. offset += 8;
  71978. event_duration = dv.getUint32(offset);
  71979. offset += 4;
  71980. id = dv.getUint32(offset);
  71981. offset += 4;
  71982. scheme_id_uri = uint8ToCString(boxData.subarray(offset));
  71983. offset += scheme_id_uri.length;
  71984. value = uint8ToCString(boxData.subarray(offset));
  71985. offset += value.length;
  71986. }
  71987. message_data = new Uint8Array(boxData.subarray(offset, boxData.byteLength));
  71988. var emsgBox = {
  71989. scheme_id_uri,
  71990. value,
  71991. timescale: timescale3 ? timescale3 : 1,
  71992. presentation_time,
  71993. presentation_time_delta,
  71994. event_duration,
  71995. id,
  71996. message_data
  71997. };
  71998. return isValidEmsgBox(version2, emsgBox) ? emsgBox : void 0;
  71999. };
  72000. var scaleTime = function(presentationTime, timescale3, timeDelta, offset) {
  72001. return presentationTime || presentationTime === 0 ? presentationTime / timescale3 : offset + timeDelta / timescale3;
  72002. };
  72003. var isValidEmsgBox = function(version2, emsg2) {
  72004. var hasScheme = emsg2.scheme_id_uri !== "\0";
  72005. var isValidV0Box = version2 === 0 && isDefined(emsg2.presentation_time_delta) && hasScheme;
  72006. var isValidV1Box = version2 === 1 && isDefined(emsg2.presentation_time) && hasScheme;
  72007. return !(version2 > 1) && isValidV0Box || isValidV1Box;
  72008. };
  72009. var isDefined = function(data) {
  72010. return data !== void 0 || data !== null;
  72011. };
  72012. var emsg$1 = {
  72013. parseEmsgBox,
  72014. scaleTime
  72015. };
  72016. var toUnsigned = bin.toUnsigned;
  72017. var toHexString = bin.toHexString;
  72018. var findBox4 = findBox_1;
  72019. var parseType$1 = parseType_1;
  72020. var emsg = emsg$1;
  72021. var parseTfhd = parseTfhd$2;
  72022. var parseTrun = parseTrun$2;
  72023. var parseTfdt = parseTfdt$2;
  72024. var getUint642 = numbers2.getUint64;
  72025. var timescale2, startTime, compositionStartTime, getVideoTrackIds, getTracks, getTimescaleFromMediaHeader, getEmsgID3;
  72026. var window$12 = window_12;
  72027. var parseId3Frames = parseId3.parseId3Frames;
  72028. timescale2 = function(init) {
  72029. var result = {}, traks = findBox4(init, ["moov", "trak"]);
  72030. return traks.reduce(function(result2, trak2) {
  72031. var tkhd2, version2, index2, id, mdhd2;
  72032. tkhd2 = findBox4(trak2, ["tkhd"])[0];
  72033. if (!tkhd2) {
  72034. return null;
  72035. }
  72036. version2 = tkhd2[0];
  72037. index2 = version2 === 0 ? 12 : 20;
  72038. id = toUnsigned(tkhd2[index2] << 24 | tkhd2[index2 + 1] << 16 | tkhd2[index2 + 2] << 8 | tkhd2[index2 + 3]);
  72039. mdhd2 = findBox4(trak2, ["mdia", "mdhd"])[0];
  72040. if (!mdhd2) {
  72041. return null;
  72042. }
  72043. version2 = mdhd2[0];
  72044. index2 = version2 === 0 ? 12 : 20;
  72045. result2[id] = toUnsigned(mdhd2[index2] << 24 | mdhd2[index2 + 1] << 16 | mdhd2[index2 + 2] << 8 | mdhd2[index2 + 3]);
  72046. return result2;
  72047. }, result);
  72048. };
  72049. startTime = function(timescale3, fragment) {
  72050. var trafs;
  72051. trafs = findBox4(fragment, ["moof", "traf"]);
  72052. var lowestTime = trafs.reduce(function(acc, traf2) {
  72053. var tfhd2 = findBox4(traf2, ["tfhd"])[0];
  72054. var id = toUnsigned(tfhd2[4] << 24 | tfhd2[5] << 16 | tfhd2[6] << 8 | tfhd2[7]);
  72055. var scale = timescale3[id] || 9e4;
  72056. var tfdt2 = findBox4(traf2, ["tfdt"])[0];
  72057. var dv = new DataView(tfdt2.buffer, tfdt2.byteOffset, tfdt2.byteLength);
  72058. var baseTime;
  72059. if (tfdt2[0] === 1) {
  72060. baseTime = getUint642(tfdt2.subarray(4, 12));
  72061. } else {
  72062. baseTime = dv.getUint32(4);
  72063. }
  72064. let seconds;
  72065. if (typeof baseTime === "bigint") {
  72066. seconds = baseTime / window$12.BigInt(scale);
  72067. } else if (typeof baseTime === "number" && !isNaN(baseTime)) {
  72068. seconds = baseTime / scale;
  72069. }
  72070. if (seconds < Number.MAX_SAFE_INTEGER) {
  72071. seconds = Number(seconds);
  72072. }
  72073. if (seconds < acc) {
  72074. acc = seconds;
  72075. }
  72076. return acc;
  72077. }, Infinity);
  72078. return typeof lowestTime === "bigint" || isFinite(lowestTime) ? lowestTime : 0;
  72079. };
  72080. compositionStartTime = function(timescales, fragment) {
  72081. var trafBoxes = findBox4(fragment, ["moof", "traf"]);
  72082. var baseMediaDecodeTime = 0;
  72083. var compositionTimeOffset = 0;
  72084. var trackId;
  72085. if (trafBoxes && trafBoxes.length) {
  72086. var tfhd2 = findBox4(trafBoxes[0], ["tfhd"])[0];
  72087. var trun2 = findBox4(trafBoxes[0], ["trun"])[0];
  72088. var tfdt2 = findBox4(trafBoxes[0], ["tfdt"])[0];
  72089. if (tfhd2) {
  72090. var parsedTfhd = parseTfhd(tfhd2);
  72091. trackId = parsedTfhd.trackId;
  72092. }
  72093. if (tfdt2) {
  72094. var parsedTfdt = parseTfdt(tfdt2);
  72095. baseMediaDecodeTime = parsedTfdt.baseMediaDecodeTime;
  72096. }
  72097. if (trun2) {
  72098. var parsedTrun = parseTrun(trun2);
  72099. if (parsedTrun.samples && parsedTrun.samples.length) {
  72100. compositionTimeOffset = parsedTrun.samples[0].compositionTimeOffset || 0;
  72101. }
  72102. }
  72103. }
  72104. var timescale3 = timescales[trackId] || 9e4;
  72105. if (typeof baseMediaDecodeTime === "bigint") {
  72106. compositionTimeOffset = window$12.BigInt(compositionTimeOffset);
  72107. timescale3 = window$12.BigInt(timescale3);
  72108. }
  72109. var result = (baseMediaDecodeTime + compositionTimeOffset) / timescale3;
  72110. if (typeof result === "bigint" && result < Number.MAX_SAFE_INTEGER) {
  72111. result = Number(result);
  72112. }
  72113. return result;
  72114. };
  72115. getVideoTrackIds = function(init) {
  72116. var traks = findBox4(init, ["moov", "trak"]);
  72117. var videoTrackIds = [];
  72118. traks.forEach(function(trak2) {
  72119. var hdlrs = findBox4(trak2, ["mdia", "hdlr"]);
  72120. var tkhds = findBox4(trak2, ["tkhd"]);
  72121. hdlrs.forEach(function(hdlr2, index2) {
  72122. var handlerType = parseType$1(hdlr2.subarray(8, 12));
  72123. var tkhd2 = tkhds[index2];
  72124. var view;
  72125. var version2;
  72126. var trackId;
  72127. if (handlerType === "vide") {
  72128. view = new DataView(tkhd2.buffer, tkhd2.byteOffset, tkhd2.byteLength);
  72129. version2 = view.getUint8(0);
  72130. trackId = version2 === 0 ? view.getUint32(12) : view.getUint32(20);
  72131. videoTrackIds.push(trackId);
  72132. }
  72133. });
  72134. });
  72135. return videoTrackIds;
  72136. };
  72137. getTimescaleFromMediaHeader = function(mdhd2) {
  72138. var version2 = mdhd2[0];
  72139. var index2 = version2 === 0 ? 12 : 20;
  72140. return toUnsigned(mdhd2[index2] << 24 | mdhd2[index2 + 1] << 16 | mdhd2[index2 + 2] << 8 | mdhd2[index2 + 3]);
  72141. };
  72142. getTracks = function(init) {
  72143. var traks = findBox4(init, ["moov", "trak"]);
  72144. var tracks = [];
  72145. traks.forEach(function(trak2) {
  72146. var track = {};
  72147. var tkhd2 = findBox4(trak2, ["tkhd"])[0];
  72148. var view, tkhdVersion;
  72149. if (tkhd2) {
  72150. view = new DataView(tkhd2.buffer, tkhd2.byteOffset, tkhd2.byteLength);
  72151. tkhdVersion = view.getUint8(0);
  72152. track.id = tkhdVersion === 0 ? view.getUint32(12) : view.getUint32(20);
  72153. }
  72154. var hdlr2 = findBox4(trak2, ["mdia", "hdlr"])[0];
  72155. if (hdlr2) {
  72156. var type3 = parseType$1(hdlr2.subarray(8, 12));
  72157. if (type3 === "vide") {
  72158. track.type = "video";
  72159. } else if (type3 === "soun") {
  72160. track.type = "audio";
  72161. } else {
  72162. track.type = type3;
  72163. }
  72164. }
  72165. var stsd2 = findBox4(trak2, ["mdia", "minf", "stbl", "stsd"])[0];
  72166. if (stsd2) {
  72167. var sampleDescriptions = stsd2.subarray(8);
  72168. track.codec = parseType$1(sampleDescriptions.subarray(4, 8));
  72169. var codecBox = findBox4(sampleDescriptions, [track.codec])[0];
  72170. var codecConfig, codecConfigType;
  72171. if (codecBox) {
  72172. if (/^[asm]vc[1-9]$/i.test(track.codec)) {
  72173. codecConfig = codecBox.subarray(78);
  72174. codecConfigType = parseType$1(codecConfig.subarray(4, 8));
  72175. if (codecConfigType === "avcC" && codecConfig.length > 11) {
  72176. track.codec += ".";
  72177. track.codec += toHexString(codecConfig[9]);
  72178. track.codec += toHexString(codecConfig[10]);
  72179. track.codec += toHexString(codecConfig[11]);
  72180. } else {
  72181. track.codec = "avc1.4d400d";
  72182. }
  72183. } else if (/^mp4[a,v]$/i.test(track.codec)) {
  72184. codecConfig = codecBox.subarray(28);
  72185. codecConfigType = parseType$1(codecConfig.subarray(4, 8));
  72186. if (codecConfigType === "esds" && codecConfig.length > 20 && codecConfig[19] !== 0) {
  72187. track.codec += "." + toHexString(codecConfig[19]);
  72188. track.codec += "." + toHexString(codecConfig[20] >>> 2 & 63).replace(/^0/, "");
  72189. } else {
  72190. track.codec = "mp4a.40.2";
  72191. }
  72192. } else {
  72193. track.codec = track.codec.toLowerCase();
  72194. }
  72195. }
  72196. }
  72197. var mdhd2 = findBox4(trak2, ["mdia", "mdhd"])[0];
  72198. if (mdhd2) {
  72199. track.timescale = getTimescaleFromMediaHeader(mdhd2);
  72200. }
  72201. tracks.push(track);
  72202. });
  72203. return tracks;
  72204. };
  72205. getEmsgID3 = function(segmentData, offset = 0) {
  72206. var emsgBoxes = findBox4(segmentData, ["emsg"]);
  72207. return emsgBoxes.map((data) => {
  72208. var parsedBox = emsg.parseEmsgBox(new Uint8Array(data));
  72209. var parsedId3Frames = parseId3Frames(parsedBox.message_data);
  72210. return {
  72211. cueTime: emsg.scaleTime(parsedBox.presentation_time, parsedBox.timescale, parsedBox.presentation_time_delta, offset),
  72212. duration: emsg.scaleTime(parsedBox.event_duration, parsedBox.timescale),
  72213. frames: parsedId3Frames
  72214. };
  72215. });
  72216. };
  72217. var probe$2 = {
  72218. findBox: findBox4,
  72219. parseType: parseType$1,
  72220. timescale: timescale2,
  72221. startTime,
  72222. compositionStartTime,
  72223. videoTrackIds: getVideoTrackIds,
  72224. tracks: getTracks,
  72225. getTimescaleFromMediaHeader,
  72226. getEmsgID3
  72227. };
  72228. var StreamTypes$1 = streamTypes;
  72229. var parsePid = function(packet) {
  72230. var pid = packet[1] & 31;
  72231. pid <<= 8;
  72232. pid |= packet[2];
  72233. return pid;
  72234. };
  72235. var parsePayloadUnitStartIndicator = function(packet) {
  72236. return !!(packet[1] & 64);
  72237. };
  72238. var parseAdaptionField = function(packet) {
  72239. var offset = 0;
  72240. if ((packet[3] & 48) >>> 4 > 1) {
  72241. offset += packet[4] + 1;
  72242. }
  72243. return offset;
  72244. };
  72245. var parseType = function(packet, pmtPid) {
  72246. var pid = parsePid(packet);
  72247. if (pid === 0) {
  72248. return "pat";
  72249. } else if (pid === pmtPid) {
  72250. return "pmt";
  72251. } else if (pmtPid) {
  72252. return "pes";
  72253. }
  72254. return null;
  72255. };
  72256. var parsePat = function(packet) {
  72257. var pusi = parsePayloadUnitStartIndicator(packet);
  72258. var offset = 4 + parseAdaptionField(packet);
  72259. if (pusi) {
  72260. offset += packet[offset] + 1;
  72261. }
  72262. return (packet[offset + 10] & 31) << 8 | packet[offset + 11];
  72263. };
  72264. var parsePmt = function(packet) {
  72265. var programMapTable = {};
  72266. var pusi = parsePayloadUnitStartIndicator(packet);
  72267. var payloadOffset = 4 + parseAdaptionField(packet);
  72268. if (pusi) {
  72269. payloadOffset += packet[payloadOffset] + 1;
  72270. }
  72271. if (!(packet[payloadOffset + 5] & 1)) {
  72272. return;
  72273. }
  72274. var sectionLength, tableEnd, programInfoLength;
  72275. sectionLength = (packet[payloadOffset + 1] & 15) << 8 | packet[payloadOffset + 2];
  72276. tableEnd = 3 + sectionLength - 4;
  72277. programInfoLength = (packet[payloadOffset + 10] & 15) << 8 | packet[payloadOffset + 11];
  72278. var offset = 12 + programInfoLength;
  72279. while (offset < tableEnd) {
  72280. var i2 = payloadOffset + offset;
  72281. programMapTable[(packet[i2 + 1] & 31) << 8 | packet[i2 + 2]] = packet[i2];
  72282. offset += ((packet[i2 + 3] & 15) << 8 | packet[i2 + 4]) + 5;
  72283. }
  72284. return programMapTable;
  72285. };
  72286. var parsePesType = function(packet, programMapTable) {
  72287. var pid = parsePid(packet);
  72288. var type3 = programMapTable[pid];
  72289. switch (type3) {
  72290. case StreamTypes$1.H264_STREAM_TYPE:
  72291. return "video";
  72292. case StreamTypes$1.ADTS_STREAM_TYPE:
  72293. return "audio";
  72294. case StreamTypes$1.METADATA_STREAM_TYPE:
  72295. return "timed-metadata";
  72296. default:
  72297. return null;
  72298. }
  72299. };
  72300. var parsePesTime = function(packet) {
  72301. var pusi = parsePayloadUnitStartIndicator(packet);
  72302. if (!pusi) {
  72303. return null;
  72304. }
  72305. var offset = 4 + parseAdaptionField(packet);
  72306. if (offset >= packet.byteLength) {
  72307. return null;
  72308. }
  72309. var pes = null;
  72310. var ptsDtsFlags;
  72311. ptsDtsFlags = packet[offset + 7];
  72312. if (ptsDtsFlags & 192) {
  72313. pes = {};
  72314. pes.pts = (packet[offset + 9] & 14) << 27 | (packet[offset + 10] & 255) << 20 | (packet[offset + 11] & 254) << 12 | (packet[offset + 12] & 255) << 5 | (packet[offset + 13] & 254) >>> 3;
  72315. pes.pts *= 4;
  72316. pes.pts += (packet[offset + 13] & 6) >>> 1;
  72317. pes.dts = pes.pts;
  72318. if (ptsDtsFlags & 64) {
  72319. pes.dts = (packet[offset + 14] & 14) << 27 | (packet[offset + 15] & 255) << 20 | (packet[offset + 16] & 254) << 12 | (packet[offset + 17] & 255) << 5 | (packet[offset + 18] & 254) >>> 3;
  72320. pes.dts *= 4;
  72321. pes.dts += (packet[offset + 18] & 6) >>> 1;
  72322. }
  72323. }
  72324. return pes;
  72325. };
  72326. var parseNalUnitType = function(type3) {
  72327. switch (type3) {
  72328. case 5:
  72329. return "slice_layer_without_partitioning_rbsp_idr";
  72330. case 6:
  72331. return "sei_rbsp";
  72332. case 7:
  72333. return "seq_parameter_set_rbsp";
  72334. case 8:
  72335. return "pic_parameter_set_rbsp";
  72336. case 9:
  72337. return "access_unit_delimiter_rbsp";
  72338. default:
  72339. return null;
  72340. }
  72341. };
  72342. var videoPacketContainsKeyFrame = function(packet) {
  72343. var offset = 4 + parseAdaptionField(packet);
  72344. var frameBuffer = packet.subarray(offset);
  72345. var frameI = 0;
  72346. var frameSyncPoint = 0;
  72347. var foundKeyFrame = false;
  72348. var nalType;
  72349. for (; frameSyncPoint < frameBuffer.byteLength - 3; frameSyncPoint++) {
  72350. if (frameBuffer[frameSyncPoint + 2] === 1) {
  72351. frameI = frameSyncPoint + 5;
  72352. break;
  72353. }
  72354. }
  72355. while (frameI < frameBuffer.byteLength) {
  72356. switch (frameBuffer[frameI]) {
  72357. case 0:
  72358. if (frameBuffer[frameI - 1] !== 0) {
  72359. frameI += 2;
  72360. break;
  72361. } else if (frameBuffer[frameI - 2] !== 0) {
  72362. frameI++;
  72363. break;
  72364. }
  72365. if (frameSyncPoint + 3 !== frameI - 2) {
  72366. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  72367. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  72368. foundKeyFrame = true;
  72369. }
  72370. }
  72371. do {
  72372. frameI++;
  72373. } while (frameBuffer[frameI] !== 1 && frameI < frameBuffer.length);
  72374. frameSyncPoint = frameI - 2;
  72375. frameI += 3;
  72376. break;
  72377. case 1:
  72378. if (frameBuffer[frameI - 1] !== 0 || frameBuffer[frameI - 2] !== 0) {
  72379. frameI += 3;
  72380. break;
  72381. }
  72382. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  72383. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  72384. foundKeyFrame = true;
  72385. }
  72386. frameSyncPoint = frameI - 2;
  72387. frameI += 3;
  72388. break;
  72389. default:
  72390. frameI += 3;
  72391. break;
  72392. }
  72393. }
  72394. frameBuffer = frameBuffer.subarray(frameSyncPoint);
  72395. frameI -= frameSyncPoint;
  72396. frameSyncPoint = 0;
  72397. if (frameBuffer && frameBuffer.byteLength > 3) {
  72398. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  72399. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  72400. foundKeyFrame = true;
  72401. }
  72402. }
  72403. return foundKeyFrame;
  72404. };
  72405. var probe$1 = {
  72406. parseType,
  72407. parsePat,
  72408. parsePmt,
  72409. parsePayloadUnitStartIndicator,
  72410. parsePesType,
  72411. parsePesTime,
  72412. videoPacketContainsKeyFrame
  72413. };
  72414. var StreamTypes = streamTypes;
  72415. var handleRollover = timestampRolloverStream.handleRollover;
  72416. var probe = {};
  72417. probe.ts = probe$1;
  72418. probe.aac = utils2;
  72419. var ONE_SECOND_IN_TS2 = clock$2.ONE_SECOND_IN_TS;
  72420. var MP2T_PACKET_LENGTH = 188, SYNC_BYTE = 71;
  72421. var parsePsi_ = function(bytes, pmt) {
  72422. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3;
  72423. while (endIndex < bytes.byteLength) {
  72424. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  72425. packet = bytes.subarray(startIndex, endIndex);
  72426. type3 = probe.ts.parseType(packet, pmt.pid);
  72427. switch (type3) {
  72428. case "pat":
  72429. pmt.pid = probe.ts.parsePat(packet);
  72430. break;
  72431. case "pmt":
  72432. var table = probe.ts.parsePmt(packet);
  72433. pmt.table = pmt.table || {};
  72434. Object.keys(table).forEach(function(key) {
  72435. pmt.table[key] = table[key];
  72436. });
  72437. break;
  72438. }
  72439. startIndex += MP2T_PACKET_LENGTH;
  72440. endIndex += MP2T_PACKET_LENGTH;
  72441. continue;
  72442. }
  72443. startIndex++;
  72444. endIndex++;
  72445. }
  72446. };
  72447. var parseAudioPes_ = function(bytes, pmt, result) {
  72448. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3, pesType, pusi, parsed;
  72449. var endLoop = false;
  72450. while (endIndex <= bytes.byteLength) {
  72451. if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {
  72452. packet = bytes.subarray(startIndex, endIndex);
  72453. type3 = probe.ts.parseType(packet, pmt.pid);
  72454. switch (type3) {
  72455. case "pes":
  72456. pesType = probe.ts.parsePesType(packet, pmt.table);
  72457. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  72458. if (pesType === "audio" && pusi) {
  72459. parsed = probe.ts.parsePesTime(packet);
  72460. if (parsed) {
  72461. parsed.type = "audio";
  72462. result.audio.push(parsed);
  72463. endLoop = true;
  72464. }
  72465. }
  72466. break;
  72467. }
  72468. if (endLoop) {
  72469. break;
  72470. }
  72471. startIndex += MP2T_PACKET_LENGTH;
  72472. endIndex += MP2T_PACKET_LENGTH;
  72473. continue;
  72474. }
  72475. startIndex++;
  72476. endIndex++;
  72477. }
  72478. endIndex = bytes.byteLength;
  72479. startIndex = endIndex - MP2T_PACKET_LENGTH;
  72480. endLoop = false;
  72481. while (startIndex >= 0) {
  72482. if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {
  72483. packet = bytes.subarray(startIndex, endIndex);
  72484. type3 = probe.ts.parseType(packet, pmt.pid);
  72485. switch (type3) {
  72486. case "pes":
  72487. pesType = probe.ts.parsePesType(packet, pmt.table);
  72488. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  72489. if (pesType === "audio" && pusi) {
  72490. parsed = probe.ts.parsePesTime(packet);
  72491. if (parsed) {
  72492. parsed.type = "audio";
  72493. result.audio.push(parsed);
  72494. endLoop = true;
  72495. }
  72496. }
  72497. break;
  72498. }
  72499. if (endLoop) {
  72500. break;
  72501. }
  72502. startIndex -= MP2T_PACKET_LENGTH;
  72503. endIndex -= MP2T_PACKET_LENGTH;
  72504. continue;
  72505. }
  72506. startIndex--;
  72507. endIndex--;
  72508. }
  72509. };
  72510. var parseVideoPes_ = function(bytes, pmt, result) {
  72511. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3, pesType, pusi, parsed, frame, i2, pes;
  72512. var endLoop = false;
  72513. var currentFrame = {
  72514. data: [],
  72515. size: 0
  72516. };
  72517. while (endIndex < bytes.byteLength) {
  72518. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  72519. packet = bytes.subarray(startIndex, endIndex);
  72520. type3 = probe.ts.parseType(packet, pmt.pid);
  72521. switch (type3) {
  72522. case "pes":
  72523. pesType = probe.ts.parsePesType(packet, pmt.table);
  72524. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  72525. if (pesType === "video") {
  72526. if (pusi && !endLoop) {
  72527. parsed = probe.ts.parsePesTime(packet);
  72528. if (parsed) {
  72529. parsed.type = "video";
  72530. result.video.push(parsed);
  72531. endLoop = true;
  72532. }
  72533. }
  72534. if (!result.firstKeyFrame) {
  72535. if (pusi) {
  72536. if (currentFrame.size !== 0) {
  72537. frame = new Uint8Array(currentFrame.size);
  72538. i2 = 0;
  72539. while (currentFrame.data.length) {
  72540. pes = currentFrame.data.shift();
  72541. frame.set(pes, i2);
  72542. i2 += pes.byteLength;
  72543. }
  72544. if (probe.ts.videoPacketContainsKeyFrame(frame)) {
  72545. var firstKeyFrame = probe.ts.parsePesTime(frame);
  72546. if (firstKeyFrame) {
  72547. result.firstKeyFrame = firstKeyFrame;
  72548. result.firstKeyFrame.type = "video";
  72549. } else {
  72550. console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.");
  72551. }
  72552. }
  72553. currentFrame.size = 0;
  72554. }
  72555. }
  72556. currentFrame.data.push(packet);
  72557. currentFrame.size += packet.byteLength;
  72558. }
  72559. }
  72560. break;
  72561. }
  72562. if (endLoop && result.firstKeyFrame) {
  72563. break;
  72564. }
  72565. startIndex += MP2T_PACKET_LENGTH;
  72566. endIndex += MP2T_PACKET_LENGTH;
  72567. continue;
  72568. }
  72569. startIndex++;
  72570. endIndex++;
  72571. }
  72572. endIndex = bytes.byteLength;
  72573. startIndex = endIndex - MP2T_PACKET_LENGTH;
  72574. endLoop = false;
  72575. while (startIndex >= 0) {
  72576. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  72577. packet = bytes.subarray(startIndex, endIndex);
  72578. type3 = probe.ts.parseType(packet, pmt.pid);
  72579. switch (type3) {
  72580. case "pes":
  72581. pesType = probe.ts.parsePesType(packet, pmt.table);
  72582. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  72583. if (pesType === "video" && pusi) {
  72584. parsed = probe.ts.parsePesTime(packet);
  72585. if (parsed) {
  72586. parsed.type = "video";
  72587. result.video.push(parsed);
  72588. endLoop = true;
  72589. }
  72590. }
  72591. break;
  72592. }
  72593. if (endLoop) {
  72594. break;
  72595. }
  72596. startIndex -= MP2T_PACKET_LENGTH;
  72597. endIndex -= MP2T_PACKET_LENGTH;
  72598. continue;
  72599. }
  72600. startIndex--;
  72601. endIndex--;
  72602. }
  72603. };
  72604. var adjustTimestamp_ = function(segmentInfo, baseTimestamp) {
  72605. if (segmentInfo.audio && segmentInfo.audio.length) {
  72606. var audioBaseTimestamp = baseTimestamp;
  72607. if (typeof audioBaseTimestamp === "undefined" || isNaN(audioBaseTimestamp)) {
  72608. audioBaseTimestamp = segmentInfo.audio[0].dts;
  72609. }
  72610. segmentInfo.audio.forEach(function(info) {
  72611. info.dts = handleRollover(info.dts, audioBaseTimestamp);
  72612. info.pts = handleRollover(info.pts, audioBaseTimestamp);
  72613. info.dtsTime = info.dts / ONE_SECOND_IN_TS2;
  72614. info.ptsTime = info.pts / ONE_SECOND_IN_TS2;
  72615. });
  72616. }
  72617. if (segmentInfo.video && segmentInfo.video.length) {
  72618. var videoBaseTimestamp = baseTimestamp;
  72619. if (typeof videoBaseTimestamp === "undefined" || isNaN(videoBaseTimestamp)) {
  72620. videoBaseTimestamp = segmentInfo.video[0].dts;
  72621. }
  72622. segmentInfo.video.forEach(function(info) {
  72623. info.dts = handleRollover(info.dts, videoBaseTimestamp);
  72624. info.pts = handleRollover(info.pts, videoBaseTimestamp);
  72625. info.dtsTime = info.dts / ONE_SECOND_IN_TS2;
  72626. info.ptsTime = info.pts / ONE_SECOND_IN_TS2;
  72627. });
  72628. if (segmentInfo.firstKeyFrame) {
  72629. var frame = segmentInfo.firstKeyFrame;
  72630. frame.dts = handleRollover(frame.dts, videoBaseTimestamp);
  72631. frame.pts = handleRollover(frame.pts, videoBaseTimestamp);
  72632. frame.dtsTime = frame.dts / ONE_SECOND_IN_TS2;
  72633. frame.ptsTime = frame.pts / ONE_SECOND_IN_TS2;
  72634. }
  72635. }
  72636. };
  72637. var inspectAac_ = function(bytes) {
  72638. var endLoop = false, audioCount = 0, sampleRate = null, timestamp = null, frameSize = 0, byteIndex = 0, packet;
  72639. while (bytes.length - byteIndex >= 3) {
  72640. var type3 = probe.aac.parseType(bytes, byteIndex);
  72641. switch (type3) {
  72642. case "timed-metadata":
  72643. if (bytes.length - byteIndex < 10) {
  72644. endLoop = true;
  72645. break;
  72646. }
  72647. frameSize = probe.aac.parseId3TagSize(bytes, byteIndex);
  72648. if (frameSize > bytes.length) {
  72649. endLoop = true;
  72650. break;
  72651. }
  72652. if (timestamp === null) {
  72653. packet = bytes.subarray(byteIndex, byteIndex + frameSize);
  72654. timestamp = probe.aac.parseAacTimestamp(packet);
  72655. }
  72656. byteIndex += frameSize;
  72657. break;
  72658. case "audio":
  72659. if (bytes.length - byteIndex < 7) {
  72660. endLoop = true;
  72661. break;
  72662. }
  72663. frameSize = probe.aac.parseAdtsSize(bytes, byteIndex);
  72664. if (frameSize > bytes.length) {
  72665. endLoop = true;
  72666. break;
  72667. }
  72668. if (sampleRate === null) {
  72669. packet = bytes.subarray(byteIndex, byteIndex + frameSize);
  72670. sampleRate = probe.aac.parseSampleRate(packet);
  72671. }
  72672. audioCount++;
  72673. byteIndex += frameSize;
  72674. break;
  72675. default:
  72676. byteIndex++;
  72677. break;
  72678. }
  72679. if (endLoop) {
  72680. return null;
  72681. }
  72682. }
  72683. if (sampleRate === null || timestamp === null) {
  72684. return null;
  72685. }
  72686. var audioTimescale = ONE_SECOND_IN_TS2 / sampleRate;
  72687. var result = {
  72688. audio: [{
  72689. type: "audio",
  72690. dts: timestamp,
  72691. pts: timestamp
  72692. }, {
  72693. type: "audio",
  72694. dts: timestamp + audioCount * 1024 * audioTimescale,
  72695. pts: timestamp + audioCount * 1024 * audioTimescale
  72696. }]
  72697. };
  72698. return result;
  72699. };
  72700. var inspectTs_ = function(bytes) {
  72701. var pmt = {
  72702. pid: null,
  72703. table: null
  72704. };
  72705. var result = {};
  72706. parsePsi_(bytes, pmt);
  72707. for (var pid in pmt.table) {
  72708. if (pmt.table.hasOwnProperty(pid)) {
  72709. var type3 = pmt.table[pid];
  72710. switch (type3) {
  72711. case StreamTypes.H264_STREAM_TYPE:
  72712. result.video = [];
  72713. parseVideoPes_(bytes, pmt, result);
  72714. if (result.video.length === 0) {
  72715. delete result.video;
  72716. }
  72717. break;
  72718. case StreamTypes.ADTS_STREAM_TYPE:
  72719. result.audio = [];
  72720. parseAudioPes_(bytes, pmt, result);
  72721. if (result.audio.length === 0) {
  72722. delete result.audio;
  72723. }
  72724. break;
  72725. }
  72726. }
  72727. }
  72728. return result;
  72729. };
  72730. var inspect = function(bytes, baseTimestamp) {
  72731. var isAacData = probe.aac.isLikelyAacData(bytes);
  72732. var result;
  72733. if (isAacData) {
  72734. result = inspectAac_(bytes);
  72735. } else {
  72736. result = inspectTs_(bytes);
  72737. }
  72738. if (!result || !result.audio && !result.video) {
  72739. return null;
  72740. }
  72741. adjustTimestamp_(result, baseTimestamp);
  72742. return result;
  72743. };
  72744. var tsInspector = {
  72745. inspect,
  72746. parseAudioPes_
  72747. };
  72748. const wireTransmuxerEvents = function(self2, transmuxer2) {
  72749. transmuxer2.on("data", function(segment) {
  72750. const initArray = segment.initSegment;
  72751. segment.initSegment = {
  72752. data: initArray.buffer,
  72753. byteOffset: initArray.byteOffset,
  72754. byteLength: initArray.byteLength
  72755. };
  72756. const typedArray2 = segment.data;
  72757. segment.data = typedArray2.buffer;
  72758. self2.postMessage({
  72759. action: "data",
  72760. segment,
  72761. byteOffset: typedArray2.byteOffset,
  72762. byteLength: typedArray2.byteLength
  72763. }, [segment.data]);
  72764. });
  72765. transmuxer2.on("done", function(data) {
  72766. self2.postMessage({
  72767. action: "done"
  72768. });
  72769. });
  72770. transmuxer2.on("gopInfo", function(gopInfo) {
  72771. self2.postMessage({
  72772. action: "gopInfo",
  72773. gopInfo
  72774. });
  72775. });
  72776. transmuxer2.on("videoSegmentTimingInfo", function(timingInfo) {
  72777. const videoSegmentTimingInfo = {
  72778. start: {
  72779. decode: clock$2.videoTsToSeconds(timingInfo.start.dts),
  72780. presentation: clock$2.videoTsToSeconds(timingInfo.start.pts)
  72781. },
  72782. end: {
  72783. decode: clock$2.videoTsToSeconds(timingInfo.end.dts),
  72784. presentation: clock$2.videoTsToSeconds(timingInfo.end.pts)
  72785. },
  72786. baseMediaDecodeTime: clock$2.videoTsToSeconds(timingInfo.baseMediaDecodeTime)
  72787. };
  72788. if (timingInfo.prependedContentDuration) {
  72789. videoSegmentTimingInfo.prependedContentDuration = clock$2.videoTsToSeconds(timingInfo.prependedContentDuration);
  72790. }
  72791. self2.postMessage({
  72792. action: "videoSegmentTimingInfo",
  72793. videoSegmentTimingInfo
  72794. });
  72795. });
  72796. transmuxer2.on("audioSegmentTimingInfo", function(timingInfo) {
  72797. const audioSegmentTimingInfo = {
  72798. start: {
  72799. decode: clock$2.videoTsToSeconds(timingInfo.start.dts),
  72800. presentation: clock$2.videoTsToSeconds(timingInfo.start.pts)
  72801. },
  72802. end: {
  72803. decode: clock$2.videoTsToSeconds(timingInfo.end.dts),
  72804. presentation: clock$2.videoTsToSeconds(timingInfo.end.pts)
  72805. },
  72806. baseMediaDecodeTime: clock$2.videoTsToSeconds(timingInfo.baseMediaDecodeTime)
  72807. };
  72808. if (timingInfo.prependedContentDuration) {
  72809. audioSegmentTimingInfo.prependedContentDuration = clock$2.videoTsToSeconds(timingInfo.prependedContentDuration);
  72810. }
  72811. self2.postMessage({
  72812. action: "audioSegmentTimingInfo",
  72813. audioSegmentTimingInfo
  72814. });
  72815. });
  72816. transmuxer2.on("id3Frame", function(id3Frame) {
  72817. self2.postMessage({
  72818. action: "id3Frame",
  72819. id3Frame
  72820. });
  72821. });
  72822. transmuxer2.on("caption", function(caption) {
  72823. self2.postMessage({
  72824. action: "caption",
  72825. caption
  72826. });
  72827. });
  72828. transmuxer2.on("trackinfo", function(trackInfo) {
  72829. self2.postMessage({
  72830. action: "trackinfo",
  72831. trackInfo
  72832. });
  72833. });
  72834. transmuxer2.on("audioTimingInfo", function(audioTimingInfo) {
  72835. self2.postMessage({
  72836. action: "audioTimingInfo",
  72837. audioTimingInfo: {
  72838. start: clock$2.videoTsToSeconds(audioTimingInfo.start),
  72839. end: clock$2.videoTsToSeconds(audioTimingInfo.end)
  72840. }
  72841. });
  72842. });
  72843. transmuxer2.on("videoTimingInfo", function(videoTimingInfo) {
  72844. self2.postMessage({
  72845. action: "videoTimingInfo",
  72846. videoTimingInfo: {
  72847. start: clock$2.videoTsToSeconds(videoTimingInfo.start),
  72848. end: clock$2.videoTsToSeconds(videoTimingInfo.end)
  72849. }
  72850. });
  72851. });
  72852. transmuxer2.on("log", function(log2) {
  72853. self2.postMessage({
  72854. action: "log",
  72855. log: log2
  72856. });
  72857. });
  72858. };
  72859. class MessageHandlers {
  72860. constructor(self2, options2) {
  72861. this.options = options2 || {};
  72862. this.self = self2;
  72863. this.init();
  72864. }
  72865. init() {
  72866. if (this.transmuxer) {
  72867. this.transmuxer.dispose();
  72868. }
  72869. this.transmuxer = new transmuxer.Transmuxer(this.options);
  72870. wireTransmuxerEvents(this.self, this.transmuxer);
  72871. }
  72872. pushMp4Captions(data) {
  72873. if (!this.captionParser) {
  72874. this.captionParser = new captionParser();
  72875. this.captionParser.init();
  72876. }
  72877. const segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);
  72878. const parsed = this.captionParser.parse(segment, data.trackIds, data.timescales);
  72879. this.self.postMessage({
  72880. action: "mp4Captions",
  72881. captions: parsed && parsed.captions || [],
  72882. logs: parsed && parsed.logs || [],
  72883. data: segment.buffer
  72884. }, [segment.buffer]);
  72885. }
  72886. probeMp4StartTime({
  72887. timescales,
  72888. data
  72889. }) {
  72890. const startTime2 = probe$2.startTime(timescales, data);
  72891. this.self.postMessage({
  72892. action: "probeMp4StartTime",
  72893. startTime: startTime2,
  72894. data
  72895. }, [data.buffer]);
  72896. }
  72897. probeMp4Tracks({
  72898. data
  72899. }) {
  72900. const tracks = probe$2.tracks(data);
  72901. this.self.postMessage({
  72902. action: "probeMp4Tracks",
  72903. tracks,
  72904. data
  72905. }, [data.buffer]);
  72906. }
  72907. probeTs({
  72908. data,
  72909. baseStartTime
  72910. }) {
  72911. const tsStartTime = typeof baseStartTime === "number" && !isNaN(baseStartTime) ? baseStartTime * clock$2.ONE_SECOND_IN_TS : void 0;
  72912. const timeInfo = tsInspector.inspect(data, tsStartTime);
  72913. let result = null;
  72914. if (timeInfo) {
  72915. result = {
  72916. hasVideo: timeInfo.video && timeInfo.video.length === 2 || false,
  72917. hasAudio: timeInfo.audio && timeInfo.audio.length === 2 || false
  72918. };
  72919. if (result.hasVideo) {
  72920. result.videoStart = timeInfo.video[0].ptsTime;
  72921. }
  72922. if (result.hasAudio) {
  72923. result.audioStart = timeInfo.audio[0].ptsTime;
  72924. }
  72925. }
  72926. this.self.postMessage({
  72927. action: "probeTs",
  72928. result,
  72929. data
  72930. }, [data.buffer]);
  72931. }
  72932. clearAllMp4Captions() {
  72933. if (this.captionParser) {
  72934. this.captionParser.clearAllCaptions();
  72935. }
  72936. }
  72937. clearParsedMp4Captions() {
  72938. if (this.captionParser) {
  72939. this.captionParser.clearParsedCaptions();
  72940. }
  72941. }
  72942. push(data) {
  72943. const segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);
  72944. this.transmuxer.push(segment);
  72945. }
  72946. reset() {
  72947. this.transmuxer.reset();
  72948. }
  72949. setTimestampOffset(data) {
  72950. const timestampOffset2 = data.timestampOffset || 0;
  72951. this.transmuxer.setBaseMediaDecodeTime(Math.round(clock$2.secondsToVideoTs(timestampOffset2)));
  72952. }
  72953. setAudioAppendStart(data) {
  72954. this.transmuxer.setAudioAppendStart(Math.ceil(clock$2.secondsToVideoTs(data.appendStart)));
  72955. }
  72956. setRemux(data) {
  72957. this.transmuxer.setRemux(data.remux);
  72958. }
  72959. flush(data) {
  72960. this.transmuxer.flush();
  72961. self.postMessage({
  72962. action: "done",
  72963. type: "transmuxed"
  72964. });
  72965. }
  72966. endTimeline() {
  72967. this.transmuxer.endTimeline();
  72968. self.postMessage({
  72969. action: "endedtimeline",
  72970. type: "transmuxed"
  72971. });
  72972. }
  72973. alignGopsWith(data) {
  72974. this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice());
  72975. }
  72976. }
  72977. self.onmessage = function(event2) {
  72978. if (event2.data.action === "init" && event2.data.options) {
  72979. this.messageHandlers = new MessageHandlers(self, event2.data.options);
  72980. return;
  72981. }
  72982. if (!this.messageHandlers) {
  72983. this.messageHandlers = new MessageHandlers(self);
  72984. }
  72985. if (event2.data && event2.data.action && event2.data.action !== "init") {
  72986. if (this.messageHandlers[event2.data.action]) {
  72987. this.messageHandlers[event2.data.action](event2.data);
  72988. }
  72989. }
  72990. };
  72991. }));
  72992. var TransmuxWorker$1 = factory$1(workerCode$1$1);
  72993. const handleData_$1 = (event2, transmuxedData, callback2) => {
  72994. const {
  72995. type: type2,
  72996. initSegment,
  72997. captions,
  72998. captionStreams,
  72999. metadata,
  73000. videoFrameDtsTime,
  73001. videoFramePtsTime
  73002. } = event2.data.segment;
  73003. transmuxedData.buffer.push({
  73004. captions,
  73005. captionStreams,
  73006. metadata
  73007. });
  73008. const boxes = event2.data.segment.boxes || {
  73009. data: event2.data.segment.data
  73010. };
  73011. const result = {
  73012. type: type2,
  73013. data: new Uint8Array(boxes.data, boxes.data.byteOffset, boxes.data.byteLength),
  73014. initSegment: new Uint8Array(initSegment.data, initSegment.byteOffset, initSegment.byteLength)
  73015. };
  73016. if (typeof videoFrameDtsTime !== "undefined") {
  73017. result.videoFrameDtsTime = videoFrameDtsTime;
  73018. }
  73019. if (typeof videoFramePtsTime !== "undefined") {
  73020. result.videoFramePtsTime = videoFramePtsTime;
  73021. }
  73022. callback2(result);
  73023. };
  73024. const handleDone_$1 = ({
  73025. transmuxedData,
  73026. callback: callback2
  73027. }) => {
  73028. transmuxedData.buffer = [];
  73029. callback2(transmuxedData);
  73030. };
  73031. const handleGopInfo_$1 = (event2, transmuxedData) => {
  73032. transmuxedData.gopInfo = event2.data.gopInfo;
  73033. };
  73034. const processTransmux$1 = (options2) => {
  73035. const {
  73036. transmuxer,
  73037. bytes,
  73038. audioAppendStart,
  73039. gopsToAlignWith,
  73040. remux,
  73041. onData,
  73042. onTrackInfo,
  73043. onAudioTimingInfo,
  73044. onVideoTimingInfo,
  73045. onVideoSegmentTimingInfo,
  73046. onAudioSegmentTimingInfo,
  73047. onId3,
  73048. onCaptions,
  73049. onDone,
  73050. onEndedTimeline,
  73051. onTransmuxerLog,
  73052. isEndOfTimeline
  73053. } = options2;
  73054. const transmuxedData = {
  73055. buffer: []
  73056. };
  73057. let waitForEndedTimelineEvent = isEndOfTimeline;
  73058. const handleMessage = (event2) => {
  73059. if (transmuxer.currentTransmux !== options2) {
  73060. return;
  73061. }
  73062. if (event2.data.action === "data") {
  73063. handleData_$1(event2, transmuxedData, onData);
  73064. }
  73065. if (event2.data.action === "trackinfo") {
  73066. onTrackInfo(event2.data.trackInfo);
  73067. }
  73068. if (event2.data.action === "gopInfo") {
  73069. handleGopInfo_$1(event2, transmuxedData);
  73070. }
  73071. if (event2.data.action === "audioTimingInfo") {
  73072. onAudioTimingInfo(event2.data.audioTimingInfo);
  73073. }
  73074. if (event2.data.action === "videoTimingInfo") {
  73075. onVideoTimingInfo(event2.data.videoTimingInfo);
  73076. }
  73077. if (event2.data.action === "videoSegmentTimingInfo") {
  73078. onVideoSegmentTimingInfo(event2.data.videoSegmentTimingInfo);
  73079. }
  73080. if (event2.data.action === "audioSegmentTimingInfo") {
  73081. onAudioSegmentTimingInfo(event2.data.audioSegmentTimingInfo);
  73082. }
  73083. if (event2.data.action === "id3Frame") {
  73084. onId3([event2.data.id3Frame], event2.data.id3Frame.dispatchType);
  73085. }
  73086. if (event2.data.action === "caption") {
  73087. onCaptions(event2.data.caption);
  73088. }
  73089. if (event2.data.action === "endedtimeline") {
  73090. waitForEndedTimelineEvent = false;
  73091. onEndedTimeline();
  73092. }
  73093. if (event2.data.action === "log") {
  73094. onTransmuxerLog(event2.data.log);
  73095. }
  73096. if (event2.data.type !== "transmuxed") {
  73097. return;
  73098. }
  73099. if (waitForEndedTimelineEvent) {
  73100. return;
  73101. }
  73102. transmuxer.onmessage = null;
  73103. handleDone_$1({
  73104. transmuxedData,
  73105. callback: onDone
  73106. });
  73107. dequeue$1(transmuxer);
  73108. };
  73109. transmuxer.onmessage = handleMessage;
  73110. if (audioAppendStart) {
  73111. transmuxer.postMessage({
  73112. action: "setAudioAppendStart",
  73113. appendStart: audioAppendStart
  73114. });
  73115. }
  73116. if (Array.isArray(gopsToAlignWith)) {
  73117. transmuxer.postMessage({
  73118. action: "alignGopsWith",
  73119. gopsToAlignWith
  73120. });
  73121. }
  73122. if (typeof remux !== "undefined") {
  73123. transmuxer.postMessage({
  73124. action: "setRemux",
  73125. remux
  73126. });
  73127. }
  73128. if (bytes.byteLength) {
  73129. const buffer = bytes instanceof ArrayBuffer ? bytes : bytes.buffer;
  73130. const byteOffset = bytes instanceof ArrayBuffer ? 0 : bytes.byteOffset;
  73131. transmuxer.postMessage({
  73132. action: "push",
  73133. data: buffer,
  73134. byteOffset,
  73135. byteLength: bytes.byteLength
  73136. }, [buffer]);
  73137. }
  73138. if (isEndOfTimeline) {
  73139. transmuxer.postMessage({
  73140. action: "endTimeline"
  73141. });
  73142. }
  73143. transmuxer.postMessage({
  73144. action: "flush"
  73145. });
  73146. };
  73147. const dequeue$1 = (transmuxer) => {
  73148. transmuxer.currentTransmux = null;
  73149. if (transmuxer.transmuxQueue.length) {
  73150. transmuxer.currentTransmux = transmuxer.transmuxQueue.shift();
  73151. if (typeof transmuxer.currentTransmux === "function") {
  73152. transmuxer.currentTransmux();
  73153. } else {
  73154. processTransmux$1(transmuxer.currentTransmux);
  73155. }
  73156. }
  73157. };
  73158. const processAction$1 = (transmuxer, action) => {
  73159. transmuxer.postMessage({
  73160. action
  73161. });
  73162. dequeue$1(transmuxer);
  73163. };
  73164. const enqueueAction$1 = (action, transmuxer) => {
  73165. if (!transmuxer.currentTransmux) {
  73166. transmuxer.currentTransmux = action;
  73167. processAction$1(transmuxer, action);
  73168. return;
  73169. }
  73170. transmuxer.transmuxQueue.push(processAction$1.bind(null, transmuxer, action));
  73171. };
  73172. const reset$1 = (transmuxer) => {
  73173. enqueueAction$1("reset", transmuxer);
  73174. };
  73175. const endTimeline$1 = (transmuxer) => {
  73176. enqueueAction$1("endTimeline", transmuxer);
  73177. };
  73178. const transmux$1 = (options2) => {
  73179. if (!options2.transmuxer.currentTransmux) {
  73180. options2.transmuxer.currentTransmux = options2;
  73181. processTransmux$1(options2);
  73182. return;
  73183. }
  73184. options2.transmuxer.transmuxQueue.push(options2);
  73185. };
  73186. const createTransmuxer$1 = (options2) => {
  73187. const transmuxer = new TransmuxWorker$1();
  73188. transmuxer.currentTransmux = null;
  73189. transmuxer.transmuxQueue = [];
  73190. const term = transmuxer.terminate;
  73191. transmuxer.terminate = () => {
  73192. transmuxer.currentTransmux = null;
  73193. transmuxer.transmuxQueue.length = 0;
  73194. return term.call(transmuxer);
  73195. };
  73196. transmuxer.postMessage({
  73197. action: "init",
  73198. options: options2
  73199. });
  73200. return transmuxer;
  73201. };
  73202. var segmentTransmuxer$1 = {
  73203. reset: reset$1,
  73204. endTimeline: endTimeline$1,
  73205. transmux: transmux$1,
  73206. createTransmuxer: createTransmuxer$1
  73207. };
  73208. const workerCallback$1 = function(options2) {
  73209. const transmuxer = options2.transmuxer;
  73210. const endAction = options2.endAction || options2.action;
  73211. const callback2 = options2.callback;
  73212. const message = _extends$2({}, options2, {
  73213. endAction: null,
  73214. transmuxer: null,
  73215. callback: null
  73216. });
  73217. const listenForEndEvent = (event2) => {
  73218. if (event2.data.action !== endAction) {
  73219. return;
  73220. }
  73221. transmuxer.removeEventListener("message", listenForEndEvent);
  73222. if (event2.data.data) {
  73223. event2.data.data = new Uint8Array(event2.data.data, options2.byteOffset || 0, options2.byteLength || event2.data.data.byteLength);
  73224. if (options2.data) {
  73225. options2.data = event2.data.data;
  73226. }
  73227. }
  73228. callback2(event2.data);
  73229. };
  73230. transmuxer.addEventListener("message", listenForEndEvent);
  73231. if (options2.data) {
  73232. const isArrayBuffer = options2.data instanceof ArrayBuffer;
  73233. message.byteOffset = isArrayBuffer ? 0 : options2.data.byteOffset;
  73234. message.byteLength = options2.data.byteLength;
  73235. const transfers = [isArrayBuffer ? options2.data : options2.data.buffer];
  73236. transmuxer.postMessage(message, transfers);
  73237. } else {
  73238. transmuxer.postMessage(message);
  73239. }
  73240. };
  73241. const REQUEST_ERRORS$1 = {
  73242. FAILURE: 2,
  73243. TIMEOUT: -101,
  73244. ABORTED: -102
  73245. };
  73246. const abortAll$1 = (activeXhrs) => {
  73247. activeXhrs.forEach((xhr) => {
  73248. xhr.abort();
  73249. });
  73250. };
  73251. const getRequestStats$1 = (request) => {
  73252. return {
  73253. bandwidth: request.bandwidth,
  73254. bytesReceived: request.bytesReceived || 0,
  73255. roundTripTime: request.roundTripTime || 0
  73256. };
  73257. };
  73258. const getProgressStats$1 = (progressEvent) => {
  73259. const request = progressEvent.target;
  73260. const roundTripTime = Date.now() - request.requestTime;
  73261. const stats = {
  73262. bandwidth: Infinity,
  73263. bytesReceived: 0,
  73264. roundTripTime: roundTripTime || 0
  73265. };
  73266. stats.bytesReceived = progressEvent.loaded;
  73267. stats.bandwidth = Math.floor(stats.bytesReceived / stats.roundTripTime * 8 * 1e3);
  73268. return stats;
  73269. };
  73270. const handleErrors$1 = (error, request) => {
  73271. if (request.timedout) {
  73272. return {
  73273. status: request.status,
  73274. message: "HLS request timed-out at URL: " + request.uri,
  73275. code: REQUEST_ERRORS$1.TIMEOUT,
  73276. xhr: request
  73277. };
  73278. }
  73279. if (request.aborted) {
  73280. return {
  73281. status: request.status,
  73282. message: "HLS request aborted at URL: " + request.uri,
  73283. code: REQUEST_ERRORS$1.ABORTED,
  73284. xhr: request
  73285. };
  73286. }
  73287. if (error) {
  73288. return {
  73289. status: request.status,
  73290. message: "HLS request errored at URL: " + request.uri,
  73291. code: REQUEST_ERRORS$1.FAILURE,
  73292. xhr: request
  73293. };
  73294. }
  73295. if (request.responseType === "arraybuffer" && request.response.byteLength === 0) {
  73296. return {
  73297. status: request.status,
  73298. message: "Empty HLS response at URL: " + request.uri,
  73299. code: REQUEST_ERRORS$1.FAILURE,
  73300. xhr: request
  73301. };
  73302. }
  73303. return null;
  73304. };
  73305. const handleKeyResponse$1 = (segment, objects, finishProcessingFn) => (error, request) => {
  73306. const response = request.response;
  73307. const errorObj = handleErrors$1(error, request);
  73308. if (errorObj) {
  73309. return finishProcessingFn(errorObj, segment);
  73310. }
  73311. if (response.byteLength !== 16) {
  73312. return finishProcessingFn({
  73313. status: request.status,
  73314. message: "Invalid HLS key at URL: " + request.uri,
  73315. code: REQUEST_ERRORS$1.FAILURE,
  73316. xhr: request
  73317. }, segment);
  73318. }
  73319. const view = new DataView(response);
  73320. const bytes = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);
  73321. for (let i2 = 0; i2 < objects.length; i2++) {
  73322. objects[i2].bytes = bytes;
  73323. }
  73324. return finishProcessingFn(null, segment);
  73325. };
  73326. const parseInitSegment$1 = (segment, callback2) => {
  73327. const type2 = detectContainerForBytes$1(segment.map.bytes);
  73328. if (type2 !== "mp4") {
  73329. const uri = segment.map.resolvedUri || segment.map.uri;
  73330. return callback2({
  73331. internal: true,
  73332. message: `Found unsupported ${type2 || "unknown"} container for initialization segment at URL: ${uri}`,
  73333. code: REQUEST_ERRORS$1.FAILURE
  73334. });
  73335. }
  73336. workerCallback$1({
  73337. action: "probeMp4Tracks",
  73338. data: segment.map.bytes,
  73339. transmuxer: segment.transmuxer,
  73340. callback: ({
  73341. tracks,
  73342. data
  73343. }) => {
  73344. segment.map.bytes = data;
  73345. tracks.forEach(function(track) {
  73346. segment.map.tracks = segment.map.tracks || {};
  73347. if (segment.map.tracks[track.type]) {
  73348. return;
  73349. }
  73350. segment.map.tracks[track.type] = track;
  73351. if (typeof track.id === "number" && track.timescale) {
  73352. segment.map.timescales = segment.map.timescales || {};
  73353. segment.map.timescales[track.id] = track.timescale;
  73354. }
  73355. });
  73356. return callback2(null);
  73357. }
  73358. });
  73359. };
  73360. const handleInitSegmentResponse$1 = ({
  73361. segment,
  73362. finishProcessingFn
  73363. }) => (error, request) => {
  73364. const errorObj = handleErrors$1(error, request);
  73365. if (errorObj) {
  73366. return finishProcessingFn(errorObj, segment);
  73367. }
  73368. const bytes = new Uint8Array(request.response);
  73369. if (segment.map.key) {
  73370. segment.map.encryptedBytes = bytes;
  73371. return finishProcessingFn(null, segment);
  73372. }
  73373. segment.map.bytes = bytes;
  73374. parseInitSegment$1(segment, function(parseError) {
  73375. if (parseError) {
  73376. parseError.xhr = request;
  73377. parseError.status = request.status;
  73378. return finishProcessingFn(parseError, segment);
  73379. }
  73380. finishProcessingFn(null, segment);
  73381. });
  73382. };
  73383. const handleSegmentResponse$1 = ({
  73384. segment,
  73385. finishProcessingFn,
  73386. responseType
  73387. }) => (error, request) => {
  73388. const errorObj = handleErrors$1(error, request);
  73389. if (errorObj) {
  73390. return finishProcessingFn(errorObj, segment);
  73391. }
  73392. const newBytes = responseType === "arraybuffer" || !request.responseText ? request.response : stringToArrayBuffer$1(request.responseText.substring(segment.lastReachedChar || 0));
  73393. segment.stats = getRequestStats$1(request);
  73394. if (segment.key) {
  73395. segment.encryptedBytes = new Uint8Array(newBytes);
  73396. } else {
  73397. segment.bytes = new Uint8Array(newBytes);
  73398. }
  73399. return finishProcessingFn(null, segment);
  73400. };
  73401. const transmuxAndNotify$1 = ({
  73402. segment,
  73403. bytes,
  73404. trackInfoFn,
  73405. timingInfoFn,
  73406. videoSegmentTimingInfoFn,
  73407. audioSegmentTimingInfoFn,
  73408. id3Fn,
  73409. captionsFn,
  73410. isEndOfTimeline,
  73411. endedTimelineFn,
  73412. dataFn,
  73413. doneFn,
  73414. onTransmuxerLog
  73415. }) => {
  73416. const fmp4Tracks = segment.map && segment.map.tracks || {};
  73417. const isMuxed3 = Boolean(fmp4Tracks.audio && fmp4Tracks.video);
  73418. let audioStartFn = timingInfoFn.bind(null, segment, "audio", "start");
  73419. const audioEndFn = timingInfoFn.bind(null, segment, "audio", "end");
  73420. let videoStartFn = timingInfoFn.bind(null, segment, "video", "start");
  73421. const videoEndFn = timingInfoFn.bind(null, segment, "video", "end");
  73422. const finish = () => transmux$1({
  73423. bytes,
  73424. transmuxer: segment.transmuxer,
  73425. audioAppendStart: segment.audioAppendStart,
  73426. gopsToAlignWith: segment.gopsToAlignWith,
  73427. remux: isMuxed3,
  73428. onData: (result) => {
  73429. result.type = result.type === "combined" ? "video" : result.type;
  73430. dataFn(segment, result);
  73431. },
  73432. onTrackInfo: (trackInfo) => {
  73433. if (trackInfoFn) {
  73434. if (isMuxed3) {
  73435. trackInfo.isMuxed = true;
  73436. }
  73437. trackInfoFn(segment, trackInfo);
  73438. }
  73439. },
  73440. onAudioTimingInfo: (audioTimingInfo) => {
  73441. if (audioStartFn && typeof audioTimingInfo.start !== "undefined") {
  73442. audioStartFn(audioTimingInfo.start);
  73443. audioStartFn = null;
  73444. }
  73445. if (audioEndFn && typeof audioTimingInfo.end !== "undefined") {
  73446. audioEndFn(audioTimingInfo.end);
  73447. }
  73448. },
  73449. onVideoTimingInfo: (videoTimingInfo) => {
  73450. if (videoStartFn && typeof videoTimingInfo.start !== "undefined") {
  73451. videoStartFn(videoTimingInfo.start);
  73452. videoStartFn = null;
  73453. }
  73454. if (videoEndFn && typeof videoTimingInfo.end !== "undefined") {
  73455. videoEndFn(videoTimingInfo.end);
  73456. }
  73457. },
  73458. onVideoSegmentTimingInfo: (videoSegmentTimingInfo) => {
  73459. videoSegmentTimingInfoFn(videoSegmentTimingInfo);
  73460. },
  73461. onAudioSegmentTimingInfo: (audioSegmentTimingInfo) => {
  73462. audioSegmentTimingInfoFn(audioSegmentTimingInfo);
  73463. },
  73464. onId3: (id3Frames, dispatchType) => {
  73465. id3Fn(segment, id3Frames, dispatchType);
  73466. },
  73467. onCaptions: (captions) => {
  73468. captionsFn(segment, [captions]);
  73469. },
  73470. isEndOfTimeline,
  73471. onEndedTimeline: () => {
  73472. endedTimelineFn();
  73473. },
  73474. onTransmuxerLog,
  73475. onDone: (result) => {
  73476. if (!doneFn) {
  73477. return;
  73478. }
  73479. result.type = result.type === "combined" ? "video" : result.type;
  73480. doneFn(null, segment, result);
  73481. }
  73482. });
  73483. workerCallback$1({
  73484. action: "probeTs",
  73485. transmuxer: segment.transmuxer,
  73486. data: bytes,
  73487. baseStartTime: segment.baseStartTime,
  73488. callback: (data) => {
  73489. segment.bytes = bytes = data.data;
  73490. const probeResult = data.result;
  73491. if (probeResult) {
  73492. trackInfoFn(segment, {
  73493. hasAudio: probeResult.hasAudio,
  73494. hasVideo: probeResult.hasVideo,
  73495. isMuxed: isMuxed3
  73496. });
  73497. trackInfoFn = null;
  73498. if (probeResult.hasAudio && !isMuxed3) {
  73499. audioStartFn(probeResult.audioStart);
  73500. }
  73501. if (probeResult.hasVideo) {
  73502. videoStartFn(probeResult.videoStart);
  73503. }
  73504. audioStartFn = null;
  73505. videoStartFn = null;
  73506. }
  73507. finish();
  73508. }
  73509. });
  73510. };
  73511. const handleSegmentBytes$1 = ({
  73512. segment,
  73513. bytes,
  73514. trackInfoFn,
  73515. timingInfoFn,
  73516. videoSegmentTimingInfoFn,
  73517. audioSegmentTimingInfoFn,
  73518. id3Fn,
  73519. captionsFn,
  73520. isEndOfTimeline,
  73521. endedTimelineFn,
  73522. dataFn,
  73523. doneFn,
  73524. onTransmuxerLog
  73525. }) => {
  73526. let bytesAsUint8Array = new Uint8Array(bytes);
  73527. if (isLikelyFmp4MediaSegment$1(bytesAsUint8Array)) {
  73528. segment.isFmp4 = true;
  73529. const {
  73530. tracks
  73531. } = segment.map;
  73532. const trackInfo = {
  73533. isFmp4: true,
  73534. hasVideo: !!tracks.video,
  73535. hasAudio: !!tracks.audio
  73536. };
  73537. if (tracks.audio && tracks.audio.codec && tracks.audio.codec !== "enca") {
  73538. trackInfo.audioCodec = tracks.audio.codec;
  73539. }
  73540. if (tracks.video && tracks.video.codec && tracks.video.codec !== "encv") {
  73541. trackInfo.videoCodec = tracks.video.codec;
  73542. }
  73543. if (tracks.video && tracks.audio) {
  73544. trackInfo.isMuxed = true;
  73545. }
  73546. trackInfoFn(segment, trackInfo);
  73547. const finishLoading = (captions) => {
  73548. dataFn(segment, {
  73549. data: bytesAsUint8Array,
  73550. type: trackInfo.hasAudio && !trackInfo.isMuxed ? "audio" : "video"
  73551. });
  73552. if (captions && captions.length) {
  73553. captionsFn(segment, captions);
  73554. }
  73555. doneFn(null, segment, {});
  73556. };
  73557. workerCallback$1({
  73558. action: "probeMp4StartTime",
  73559. timescales: segment.map.timescales,
  73560. data: bytesAsUint8Array,
  73561. transmuxer: segment.transmuxer,
  73562. callback: ({
  73563. data,
  73564. startTime
  73565. }) => {
  73566. bytes = data.buffer;
  73567. segment.bytes = bytesAsUint8Array = data;
  73568. if (trackInfo.hasAudio && !trackInfo.isMuxed) {
  73569. timingInfoFn(segment, "audio", "start", startTime);
  73570. }
  73571. if (trackInfo.hasVideo) {
  73572. timingInfoFn(segment, "video", "start", startTime);
  73573. }
  73574. if (!tracks.video || !data.byteLength || !segment.transmuxer) {
  73575. finishLoading();
  73576. return;
  73577. }
  73578. workerCallback$1({
  73579. action: "pushMp4Captions",
  73580. endAction: "mp4Captions",
  73581. transmuxer: segment.transmuxer,
  73582. data: bytesAsUint8Array,
  73583. timescales: segment.map.timescales,
  73584. trackIds: [tracks.video.id],
  73585. callback: (message) => {
  73586. bytes = message.data.buffer;
  73587. segment.bytes = bytesAsUint8Array = message.data;
  73588. message.logs.forEach(function(log2) {
  73589. onTransmuxerLog(merge$2(log2, {
  73590. stream: "mp4CaptionParser"
  73591. }));
  73592. });
  73593. finishLoading(message.captions);
  73594. }
  73595. });
  73596. }
  73597. });
  73598. return;
  73599. }
  73600. if (!segment.transmuxer) {
  73601. doneFn(null, segment, {});
  73602. return;
  73603. }
  73604. if (typeof segment.container === "undefined") {
  73605. segment.container = detectContainerForBytes$1(bytesAsUint8Array);
  73606. }
  73607. if (segment.container !== "ts" && segment.container !== "aac") {
  73608. trackInfoFn(segment, {
  73609. hasAudio: false,
  73610. hasVideo: false
  73611. });
  73612. doneFn(null, segment, {});
  73613. return;
  73614. }
  73615. transmuxAndNotify$1({
  73616. segment,
  73617. bytes,
  73618. trackInfoFn,
  73619. timingInfoFn,
  73620. videoSegmentTimingInfoFn,
  73621. audioSegmentTimingInfoFn,
  73622. id3Fn,
  73623. captionsFn,
  73624. isEndOfTimeline,
  73625. endedTimelineFn,
  73626. dataFn,
  73627. doneFn,
  73628. onTransmuxerLog
  73629. });
  73630. };
  73631. const decrypt$1 = function({
  73632. id,
  73633. key,
  73634. encryptedBytes,
  73635. decryptionWorker
  73636. }, callback2) {
  73637. const decryptionHandler = (event2) => {
  73638. if (event2.data.source === id) {
  73639. decryptionWorker.removeEventListener("message", decryptionHandler);
  73640. const decrypted = event2.data.decrypted;
  73641. callback2(new Uint8Array(decrypted.bytes, decrypted.byteOffset, decrypted.byteLength));
  73642. }
  73643. };
  73644. decryptionWorker.addEventListener("message", decryptionHandler);
  73645. let keyBytes;
  73646. if (key.bytes.slice) {
  73647. keyBytes = key.bytes.slice();
  73648. } else {
  73649. keyBytes = new Uint32Array(Array.prototype.slice.call(key.bytes));
  73650. }
  73651. decryptionWorker.postMessage(createTransferableMessage$1({
  73652. source: id,
  73653. encrypted: encryptedBytes,
  73654. key: keyBytes,
  73655. iv: key.iv
  73656. }), [encryptedBytes.buffer, keyBytes.buffer]);
  73657. };
  73658. const decryptSegment$1 = ({
  73659. decryptionWorker,
  73660. segment,
  73661. trackInfoFn,
  73662. timingInfoFn,
  73663. videoSegmentTimingInfoFn,
  73664. audioSegmentTimingInfoFn,
  73665. id3Fn,
  73666. captionsFn,
  73667. isEndOfTimeline,
  73668. endedTimelineFn,
  73669. dataFn,
  73670. doneFn,
  73671. onTransmuxerLog
  73672. }) => {
  73673. decrypt$1({
  73674. id: segment.requestId,
  73675. key: segment.key,
  73676. encryptedBytes: segment.encryptedBytes,
  73677. decryptionWorker
  73678. }, (decryptedBytes) => {
  73679. segment.bytes = decryptedBytes;
  73680. handleSegmentBytes$1({
  73681. segment,
  73682. bytes: segment.bytes,
  73683. trackInfoFn,
  73684. timingInfoFn,
  73685. videoSegmentTimingInfoFn,
  73686. audioSegmentTimingInfoFn,
  73687. id3Fn,
  73688. captionsFn,
  73689. isEndOfTimeline,
  73690. endedTimelineFn,
  73691. dataFn,
  73692. doneFn,
  73693. onTransmuxerLog
  73694. });
  73695. });
  73696. };
  73697. const waitForCompletion$1 = ({
  73698. activeXhrs,
  73699. decryptionWorker,
  73700. trackInfoFn,
  73701. timingInfoFn,
  73702. videoSegmentTimingInfoFn,
  73703. audioSegmentTimingInfoFn,
  73704. id3Fn,
  73705. captionsFn,
  73706. isEndOfTimeline,
  73707. endedTimelineFn,
  73708. dataFn,
  73709. doneFn,
  73710. onTransmuxerLog
  73711. }) => {
  73712. let count = 0;
  73713. let didError = false;
  73714. return (error, segment) => {
  73715. if (didError) {
  73716. return;
  73717. }
  73718. if (error) {
  73719. didError = true;
  73720. abortAll$1(activeXhrs);
  73721. return doneFn(error, segment);
  73722. }
  73723. count += 1;
  73724. if (count === activeXhrs.length) {
  73725. const segmentFinish = function() {
  73726. if (segment.encryptedBytes) {
  73727. return decryptSegment$1({
  73728. decryptionWorker,
  73729. segment,
  73730. trackInfoFn,
  73731. timingInfoFn,
  73732. videoSegmentTimingInfoFn,
  73733. audioSegmentTimingInfoFn,
  73734. id3Fn,
  73735. captionsFn,
  73736. isEndOfTimeline,
  73737. endedTimelineFn,
  73738. dataFn,
  73739. doneFn,
  73740. onTransmuxerLog
  73741. });
  73742. }
  73743. handleSegmentBytes$1({
  73744. segment,
  73745. bytes: segment.bytes,
  73746. trackInfoFn,
  73747. timingInfoFn,
  73748. videoSegmentTimingInfoFn,
  73749. audioSegmentTimingInfoFn,
  73750. id3Fn,
  73751. captionsFn,
  73752. isEndOfTimeline,
  73753. endedTimelineFn,
  73754. dataFn,
  73755. doneFn,
  73756. onTransmuxerLog
  73757. });
  73758. };
  73759. segment.endOfAllRequests = Date.now();
  73760. if (segment.map && segment.map.encryptedBytes && !segment.map.bytes) {
  73761. return decrypt$1({
  73762. decryptionWorker,
  73763. id: segment.requestId + "-init",
  73764. encryptedBytes: segment.map.encryptedBytes,
  73765. key: segment.map.key
  73766. }, (decryptedBytes) => {
  73767. segment.map.bytes = decryptedBytes;
  73768. parseInitSegment$1(segment, (parseError) => {
  73769. if (parseError) {
  73770. abortAll$1(activeXhrs);
  73771. return doneFn(parseError, segment);
  73772. }
  73773. segmentFinish();
  73774. });
  73775. });
  73776. }
  73777. segmentFinish();
  73778. }
  73779. };
  73780. };
  73781. const handleLoadEnd$1 = ({
  73782. loadendState,
  73783. abortFn
  73784. }) => (event2) => {
  73785. const request = event2.target;
  73786. if (request.aborted && abortFn && !loadendState.calledAbortFn) {
  73787. abortFn();
  73788. loadendState.calledAbortFn = true;
  73789. }
  73790. };
  73791. const handleProgress$1 = ({
  73792. segment,
  73793. progressFn,
  73794. trackInfoFn,
  73795. timingInfoFn,
  73796. videoSegmentTimingInfoFn,
  73797. audioSegmentTimingInfoFn,
  73798. id3Fn,
  73799. captionsFn,
  73800. isEndOfTimeline,
  73801. endedTimelineFn,
  73802. dataFn
  73803. }) => (event2) => {
  73804. const request = event2.target;
  73805. if (request.aborted) {
  73806. return;
  73807. }
  73808. segment.stats = merge$2(segment.stats, getProgressStats$1(event2));
  73809. if (!segment.stats.firstBytesReceivedAt && segment.stats.bytesReceived) {
  73810. segment.stats.firstBytesReceivedAt = Date.now();
  73811. }
  73812. return progressFn(event2, segment);
  73813. };
  73814. const mediaSegmentRequest$1 = ({
  73815. xhr,
  73816. xhrOptions,
  73817. decryptionWorker,
  73818. segment,
  73819. abortFn,
  73820. progressFn,
  73821. trackInfoFn,
  73822. timingInfoFn,
  73823. videoSegmentTimingInfoFn,
  73824. audioSegmentTimingInfoFn,
  73825. id3Fn,
  73826. captionsFn,
  73827. isEndOfTimeline,
  73828. endedTimelineFn,
  73829. dataFn,
  73830. doneFn,
  73831. onTransmuxerLog
  73832. }) => {
  73833. const activeXhrs = [];
  73834. const finishProcessingFn = waitForCompletion$1({
  73835. activeXhrs,
  73836. decryptionWorker,
  73837. trackInfoFn,
  73838. timingInfoFn,
  73839. videoSegmentTimingInfoFn,
  73840. audioSegmentTimingInfoFn,
  73841. id3Fn,
  73842. captionsFn,
  73843. isEndOfTimeline,
  73844. endedTimelineFn,
  73845. dataFn,
  73846. doneFn,
  73847. onTransmuxerLog
  73848. });
  73849. if (segment.key && !segment.key.bytes) {
  73850. const objects = [segment.key];
  73851. if (segment.map && !segment.map.bytes && segment.map.key && segment.map.key.resolvedUri === segment.key.resolvedUri) {
  73852. objects.push(segment.map.key);
  73853. }
  73854. const keyRequestOptions = merge$2(xhrOptions, {
  73855. uri: segment.key.resolvedUri,
  73856. responseType: "arraybuffer"
  73857. });
  73858. const keyRequestCallback = handleKeyResponse$1(segment, objects, finishProcessingFn);
  73859. const keyXhr = xhr(keyRequestOptions, keyRequestCallback);
  73860. activeXhrs.push(keyXhr);
  73861. }
  73862. if (segment.map && !segment.map.bytes) {
  73863. const differentMapKey = segment.map.key && (!segment.key || segment.key.resolvedUri !== segment.map.key.resolvedUri);
  73864. if (differentMapKey) {
  73865. const mapKeyRequestOptions = merge$2(xhrOptions, {
  73866. uri: segment.map.key.resolvedUri,
  73867. responseType: "arraybuffer"
  73868. });
  73869. const mapKeyRequestCallback = handleKeyResponse$1(segment, [segment.map.key], finishProcessingFn);
  73870. const mapKeyXhr = xhr(mapKeyRequestOptions, mapKeyRequestCallback);
  73871. activeXhrs.push(mapKeyXhr);
  73872. }
  73873. const initSegmentOptions = merge$2(xhrOptions, {
  73874. uri: segment.map.resolvedUri,
  73875. responseType: "arraybuffer",
  73876. headers: segmentXhrHeaders$1(segment.map)
  73877. });
  73878. const initSegmentRequestCallback = handleInitSegmentResponse$1({
  73879. segment,
  73880. finishProcessingFn
  73881. });
  73882. const initSegmentXhr = xhr(initSegmentOptions, initSegmentRequestCallback);
  73883. activeXhrs.push(initSegmentXhr);
  73884. }
  73885. const segmentRequestOptions = merge$2(xhrOptions, {
  73886. uri: segment.part && segment.part.resolvedUri || segment.resolvedUri,
  73887. responseType: "arraybuffer",
  73888. headers: segmentXhrHeaders$1(segment)
  73889. });
  73890. const segmentRequestCallback = handleSegmentResponse$1({
  73891. segment,
  73892. finishProcessingFn,
  73893. responseType: segmentRequestOptions.responseType
  73894. });
  73895. const segmentXhr = xhr(segmentRequestOptions, segmentRequestCallback);
  73896. segmentXhr.addEventListener("progress", handleProgress$1({
  73897. segment,
  73898. progressFn,
  73899. trackInfoFn,
  73900. timingInfoFn,
  73901. videoSegmentTimingInfoFn,
  73902. audioSegmentTimingInfoFn,
  73903. id3Fn,
  73904. captionsFn,
  73905. isEndOfTimeline,
  73906. endedTimelineFn,
  73907. dataFn
  73908. }));
  73909. activeXhrs.push(segmentXhr);
  73910. const loadendState = {};
  73911. activeXhrs.forEach((activeXhr) => {
  73912. activeXhr.addEventListener("loadend", handleLoadEnd$1({
  73913. loadendState,
  73914. abortFn
  73915. }));
  73916. });
  73917. return () => abortAll$1(activeXhrs);
  73918. };
  73919. const logFn$1$1 = logger$1("CodecUtils");
  73920. const getCodecs$1 = function(media) {
  73921. const mediaAttributes = media.attributes || {};
  73922. if (mediaAttributes.CODECS) {
  73923. return parseCodecs$1(mediaAttributes.CODECS);
  73924. }
  73925. };
  73926. const isMaat$1 = (main, media) => {
  73927. const mediaAttributes = media.attributes || {};
  73928. return main && main.mediaGroups && main.mediaGroups.AUDIO && mediaAttributes.AUDIO && main.mediaGroups.AUDIO[mediaAttributes.AUDIO];
  73929. };
  73930. const isMuxed$1 = (main, media) => {
  73931. if (!isMaat$1(main, media)) {
  73932. return true;
  73933. }
  73934. const mediaAttributes = media.attributes || {};
  73935. const audioGroup = main.mediaGroups.AUDIO[mediaAttributes.AUDIO];
  73936. for (const groupId in audioGroup) {
  73937. if (!audioGroup[groupId].uri && !audioGroup[groupId].playlists) {
  73938. return true;
  73939. }
  73940. }
  73941. return false;
  73942. };
  73943. const unwrapCodecList$1 = function(codecList) {
  73944. const codecs = {};
  73945. codecList.forEach(({
  73946. mediaType,
  73947. type: type2,
  73948. details
  73949. }) => {
  73950. codecs[mediaType] = codecs[mediaType] || [];
  73951. codecs[mediaType].push(translateLegacyCodec$1(`${type2}${details}`));
  73952. });
  73953. Object.keys(codecs).forEach(function(mediaType) {
  73954. if (codecs[mediaType].length > 1) {
  73955. logFn$1$1(`multiple ${mediaType} codecs found as attributes: ${codecs[mediaType].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`);
  73956. codecs[mediaType] = null;
  73957. return;
  73958. }
  73959. codecs[mediaType] = codecs[mediaType][0];
  73960. });
  73961. return codecs;
  73962. };
  73963. const codecCount$1 = function(codecObj) {
  73964. let count = 0;
  73965. if (codecObj.audio) {
  73966. count++;
  73967. }
  73968. if (codecObj.video) {
  73969. count++;
  73970. }
  73971. return count;
  73972. };
  73973. const codecsForPlaylist$1 = function(main, media) {
  73974. const mediaAttributes = media.attributes || {};
  73975. const codecInfo = unwrapCodecList$1(getCodecs$1(media) || []);
  73976. if (isMaat$1(main, media) && !codecInfo.audio) {
  73977. if (!isMuxed$1(main, media)) {
  73978. const defaultCodecs = unwrapCodecList$1(codecsFromDefault$1(main, mediaAttributes.AUDIO) || []);
  73979. if (defaultCodecs.audio) {
  73980. codecInfo.audio = defaultCodecs.audio;
  73981. }
  73982. }
  73983. }
  73984. return codecInfo;
  73985. };
  73986. const logFn$2 = logger$1("PlaylistSelector");
  73987. const representationToString$1 = function(representation) {
  73988. if (!representation || !representation.playlist) {
  73989. return;
  73990. }
  73991. const playlist = representation.playlist;
  73992. return JSON.stringify({
  73993. id: playlist.id,
  73994. bandwidth: representation.bandwidth,
  73995. width: representation.width,
  73996. height: representation.height,
  73997. codecs: playlist.attributes && playlist.attributes.CODECS || ""
  73998. });
  73999. };
  74000. const safeGetComputedStyle$1 = function(el, property) {
  74001. if (!el) {
  74002. return "";
  74003. }
  74004. const result = window_1.getComputedStyle(el);
  74005. if (!result) {
  74006. return "";
  74007. }
  74008. return result[property];
  74009. };
  74010. const stableSort$1 = function(array, sortFn) {
  74011. const newArray = array.slice();
  74012. array.sort(function(left, right) {
  74013. const cmp = sortFn(left, right);
  74014. if (cmp === 0) {
  74015. return newArray.indexOf(left) - newArray.indexOf(right);
  74016. }
  74017. return cmp;
  74018. });
  74019. };
  74020. const comparePlaylistBandwidth$1 = function(left, right) {
  74021. let leftBandwidth;
  74022. let rightBandwidth;
  74023. if (left.attributes.BANDWIDTH) {
  74024. leftBandwidth = left.attributes.BANDWIDTH;
  74025. }
  74026. leftBandwidth = leftBandwidth || window_1.Number.MAX_VALUE;
  74027. if (right.attributes.BANDWIDTH) {
  74028. rightBandwidth = right.attributes.BANDWIDTH;
  74029. }
  74030. rightBandwidth = rightBandwidth || window_1.Number.MAX_VALUE;
  74031. return leftBandwidth - rightBandwidth;
  74032. };
  74033. const comparePlaylistResolution$1 = function(left, right) {
  74034. let leftWidth;
  74035. let rightWidth;
  74036. if (left.attributes.RESOLUTION && left.attributes.RESOLUTION.width) {
  74037. leftWidth = left.attributes.RESOLUTION.width;
  74038. }
  74039. leftWidth = leftWidth || window_1.Number.MAX_VALUE;
  74040. if (right.attributes.RESOLUTION && right.attributes.RESOLUTION.width) {
  74041. rightWidth = right.attributes.RESOLUTION.width;
  74042. }
  74043. rightWidth = rightWidth || window_1.Number.MAX_VALUE;
  74044. if (leftWidth === rightWidth && left.attributes.BANDWIDTH && right.attributes.BANDWIDTH) {
  74045. return left.attributes.BANDWIDTH - right.attributes.BANDWIDTH;
  74046. }
  74047. return leftWidth - rightWidth;
  74048. };
  74049. let simpleSelector$1 = function(main, playerBandwidth, playerWidth, playerHeight, limitRenditionByPlayerDimensions, playlistController) {
  74050. if (!main) {
  74051. return;
  74052. }
  74053. const options2 = {
  74054. bandwidth: playerBandwidth,
  74055. width: playerWidth,
  74056. height: playerHeight,
  74057. limitRenditionByPlayerDimensions
  74058. };
  74059. let playlists = main.playlists;
  74060. if (Playlist$1.isAudioOnly(main)) {
  74061. playlists = playlistController.getAudioTrackPlaylists_();
  74062. options2.audioOnly = true;
  74063. }
  74064. let sortedPlaylistReps = playlists.map((playlist) => {
  74065. let bandwidth2;
  74066. const width2 = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.width;
  74067. const height2 = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height;
  74068. bandwidth2 = playlist.attributes && playlist.attributes.BANDWIDTH;
  74069. bandwidth2 = bandwidth2 || window_1.Number.MAX_VALUE;
  74070. return {
  74071. bandwidth: bandwidth2,
  74072. width: width2,
  74073. height: height2,
  74074. playlist
  74075. };
  74076. });
  74077. stableSort$1(sortedPlaylistReps, (left, right) => left.bandwidth - right.bandwidth);
  74078. sortedPlaylistReps = sortedPlaylistReps.filter((rep2) => !Playlist$1.isIncompatible(rep2.playlist));
  74079. let enabledPlaylistReps = sortedPlaylistReps.filter((rep2) => Playlist$1.isEnabled(rep2.playlist));
  74080. if (!enabledPlaylistReps.length) {
  74081. enabledPlaylistReps = sortedPlaylistReps.filter((rep2) => !Playlist$1.isDisabled(rep2.playlist));
  74082. }
  74083. const bandwidthPlaylistReps = enabledPlaylistReps.filter((rep2) => rep2.bandwidth * Config$1.BANDWIDTH_VARIANCE < playerBandwidth);
  74084. let highestRemainingBandwidthRep = bandwidthPlaylistReps[bandwidthPlaylistReps.length - 1];
  74085. const bandwidthBestRep = bandwidthPlaylistReps.filter((rep2) => rep2.bandwidth === highestRemainingBandwidthRep.bandwidth)[0];
  74086. if (limitRenditionByPlayerDimensions === false) {
  74087. const chosenRep2 = bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];
  74088. if (chosenRep2 && chosenRep2.playlist) {
  74089. let type2 = "sortedPlaylistReps";
  74090. if (bandwidthBestRep) {
  74091. type2 = "bandwidthBestRep";
  74092. }
  74093. if (enabledPlaylistReps[0]) {
  74094. type2 = "enabledPlaylistReps";
  74095. }
  74096. logFn$2(`choosing ${representationToString$1(chosenRep2)} using ${type2} with options`, options2);
  74097. return chosenRep2.playlist;
  74098. }
  74099. logFn$2("could not choose a playlist with options", options2);
  74100. return null;
  74101. }
  74102. const haveResolution = bandwidthPlaylistReps.filter((rep2) => rep2.width && rep2.height);
  74103. stableSort$1(haveResolution, (left, right) => left.width - right.width);
  74104. const resolutionBestRepList = haveResolution.filter((rep2) => rep2.width === playerWidth && rep2.height === playerHeight);
  74105. highestRemainingBandwidthRep = resolutionBestRepList[resolutionBestRepList.length - 1];
  74106. const resolutionBestRep = resolutionBestRepList.filter((rep2) => rep2.bandwidth === highestRemainingBandwidthRep.bandwidth)[0];
  74107. let resolutionPlusOneList;
  74108. let resolutionPlusOneSmallest;
  74109. let resolutionPlusOneRep;
  74110. if (!resolutionBestRep) {
  74111. resolutionPlusOneList = haveResolution.filter((rep2) => rep2.width > playerWidth || rep2.height > playerHeight);
  74112. resolutionPlusOneSmallest = resolutionPlusOneList.filter((rep2) => rep2.width === resolutionPlusOneList[0].width && rep2.height === resolutionPlusOneList[0].height);
  74113. highestRemainingBandwidthRep = resolutionPlusOneSmallest[resolutionPlusOneSmallest.length - 1];
  74114. resolutionPlusOneRep = resolutionPlusOneSmallest.filter((rep2) => rep2.bandwidth === highestRemainingBandwidthRep.bandwidth)[0];
  74115. }
  74116. let leastPixelDiffRep;
  74117. if (playlistController.leastPixelDiffSelector) {
  74118. const leastPixelDiffList = haveResolution.map((rep2) => {
  74119. rep2.pixelDiff = Math.abs(rep2.width - playerWidth) + Math.abs(rep2.height - playerHeight);
  74120. return rep2;
  74121. });
  74122. stableSort$1(leastPixelDiffList, (left, right) => {
  74123. if (left.pixelDiff === right.pixelDiff) {
  74124. return right.bandwidth - left.bandwidth;
  74125. }
  74126. return left.pixelDiff - right.pixelDiff;
  74127. });
  74128. leastPixelDiffRep = leastPixelDiffList[0];
  74129. }
  74130. const chosenRep = leastPixelDiffRep || resolutionPlusOneRep || resolutionBestRep || bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];
  74131. if (chosenRep && chosenRep.playlist) {
  74132. let type2 = "sortedPlaylistReps";
  74133. if (leastPixelDiffRep) {
  74134. type2 = "leastPixelDiffRep";
  74135. } else if (resolutionPlusOneRep) {
  74136. type2 = "resolutionPlusOneRep";
  74137. } else if (resolutionBestRep) {
  74138. type2 = "resolutionBestRep";
  74139. } else if (bandwidthBestRep) {
  74140. type2 = "bandwidthBestRep";
  74141. } else if (enabledPlaylistReps[0]) {
  74142. type2 = "enabledPlaylistReps";
  74143. }
  74144. logFn$2(`choosing ${representationToString$1(chosenRep)} using ${type2} with options`, options2);
  74145. return chosenRep.playlist;
  74146. }
  74147. logFn$2("could not choose a playlist with options", options2);
  74148. return null;
  74149. };
  74150. const lastBandwidthSelector$1 = function() {
  74151. const pixelRatio = this.useDevicePixelRatio ? window_1.devicePixelRatio || 1 : 1;
  74152. return simpleSelector$1(this.playlists.main, this.systemBandwidth, parseInt(safeGetComputedStyle$1(this.tech_.el(), "width"), 10) * pixelRatio, parseInt(safeGetComputedStyle$1(this.tech_.el(), "height"), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.playlistController_);
  74153. };
  74154. const movingAverageBandwidthSelector$1 = function(decay) {
  74155. let average = -1;
  74156. let lastSystemBandwidth = -1;
  74157. if (decay < 0 || decay > 1) {
  74158. throw new Error("Moving average bandwidth decay must be between 0 and 1.");
  74159. }
  74160. return function() {
  74161. const pixelRatio = this.useDevicePixelRatio ? window_1.devicePixelRatio || 1 : 1;
  74162. if (average < 0) {
  74163. average = this.systemBandwidth;
  74164. lastSystemBandwidth = this.systemBandwidth;
  74165. }
  74166. if (this.systemBandwidth > 0 && this.systemBandwidth !== lastSystemBandwidth) {
  74167. average = decay * this.systemBandwidth + (1 - decay) * average;
  74168. lastSystemBandwidth = this.systemBandwidth;
  74169. }
  74170. return simpleSelector$1(this.playlists.main, average, parseInt(safeGetComputedStyle$1(this.tech_.el(), "width"), 10) * pixelRatio, parseInt(safeGetComputedStyle$1(this.tech_.el(), "height"), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.playlistController_);
  74171. };
  74172. };
  74173. const minRebufferMaxBandwidthSelector$1 = function(settings) {
  74174. const {
  74175. main,
  74176. currentTime,
  74177. bandwidth: bandwidth2,
  74178. duration: duration5,
  74179. segmentDuration,
  74180. timeUntilRebuffer: timeUntilRebuffer3,
  74181. currentTimeline,
  74182. syncController
  74183. } = settings;
  74184. const compatiblePlaylists = main.playlists.filter((playlist) => !Playlist$1.isIncompatible(playlist));
  74185. let enabledPlaylists = compatiblePlaylists.filter(Playlist$1.isEnabled);
  74186. if (!enabledPlaylists.length) {
  74187. enabledPlaylists = compatiblePlaylists.filter((playlist) => !Playlist$1.isDisabled(playlist));
  74188. }
  74189. const bandwidthPlaylists = enabledPlaylists.filter(Playlist$1.hasAttribute.bind(null, "BANDWIDTH"));
  74190. const rebufferingEstimates = bandwidthPlaylists.map((playlist) => {
  74191. const syncPoint = syncController.getSyncPoint(playlist, duration5, currentTimeline, currentTime);
  74192. const numRequests = syncPoint ? 1 : 2;
  74193. const requestTimeEstimate = Playlist$1.estimateSegmentRequestTime(segmentDuration, bandwidth2, playlist);
  74194. const rebufferingImpact = requestTimeEstimate * numRequests - timeUntilRebuffer3;
  74195. return {
  74196. playlist,
  74197. rebufferingImpact
  74198. };
  74199. });
  74200. const noRebufferingPlaylists = rebufferingEstimates.filter((estimate) => estimate.rebufferingImpact <= 0);
  74201. stableSort$1(noRebufferingPlaylists, (a, b) => comparePlaylistBandwidth$1(b.playlist, a.playlist));
  74202. if (noRebufferingPlaylists.length) {
  74203. return noRebufferingPlaylists[0];
  74204. }
  74205. stableSort$1(rebufferingEstimates, (a, b) => a.rebufferingImpact - b.rebufferingImpact);
  74206. return rebufferingEstimates[0] || null;
  74207. };
  74208. const lowestBitrateCompatibleVariantSelector$1 = function() {
  74209. const playlists = this.playlists.main.playlists.filter(Playlist$1.isEnabled);
  74210. stableSort$1(playlists, (a, b) => comparePlaylistBandwidth$1(a, b));
  74211. const playlistsWithVideo = playlists.filter((playlist) => !!codecsForPlaylist$1(this.playlists.main, playlist).video);
  74212. return playlistsWithVideo[0] || null;
  74213. };
  74214. const concatSegments$1 = (segmentObj) => {
  74215. let offset = 0;
  74216. let tempBuffer;
  74217. if (segmentObj.bytes) {
  74218. tempBuffer = new Uint8Array(segmentObj.bytes);
  74219. segmentObj.segments.forEach((segment) => {
  74220. tempBuffer.set(segment, offset);
  74221. offset += segment.byteLength;
  74222. });
  74223. }
  74224. return tempBuffer;
  74225. };
  74226. const createCaptionsTrackIfNotExists$1 = function(inbandTextTracks, tech, captionStream) {
  74227. if (!inbandTextTracks[captionStream]) {
  74228. tech.trigger({
  74229. type: "usage",
  74230. name: "vhs-608"
  74231. });
  74232. let instreamId = captionStream;
  74233. if (/^cc708_/.test(captionStream)) {
  74234. instreamId = "SERVICE" + captionStream.split("_")[1];
  74235. }
  74236. const track = tech.textTracks().getTrackById(instreamId);
  74237. if (track) {
  74238. inbandTextTracks[captionStream] = track;
  74239. } else {
  74240. const captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};
  74241. let label = captionStream;
  74242. let language = captionStream;
  74243. let def = false;
  74244. const captionService = captionServices[instreamId];
  74245. if (captionService) {
  74246. label = captionService.label;
  74247. language = captionService.language;
  74248. def = captionService.default;
  74249. }
  74250. inbandTextTracks[captionStream] = tech.addRemoteTextTrack({
  74251. kind: "captions",
  74252. id: instreamId,
  74253. default: def,
  74254. label,
  74255. language
  74256. }, false).track;
  74257. }
  74258. }
  74259. };
  74260. const addCaptionData$1 = function({
  74261. inbandTextTracks,
  74262. captionArray,
  74263. timestampOffset: timestampOffset2
  74264. }) {
  74265. if (!captionArray) {
  74266. return;
  74267. }
  74268. const Cue = window_1.WebKitDataCue || window_1.VTTCue;
  74269. captionArray.forEach((caption) => {
  74270. const track = caption.stream;
  74271. inbandTextTracks[track].addCue(new Cue(caption.startTime + timestampOffset2, caption.endTime + timestampOffset2, caption.text));
  74272. });
  74273. };
  74274. const deprecateOldCue$1 = function(cue) {
  74275. Object.defineProperties(cue.frame, {
  74276. id: {
  74277. get() {
  74278. videojs$2.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");
  74279. return cue.value.key;
  74280. }
  74281. },
  74282. value: {
  74283. get() {
  74284. videojs$2.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");
  74285. return cue.value.data;
  74286. }
  74287. },
  74288. privateData: {
  74289. get() {
  74290. videojs$2.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");
  74291. return cue.value.data;
  74292. }
  74293. }
  74294. });
  74295. };
  74296. const addMetadata$1 = ({
  74297. inbandTextTracks,
  74298. metadataArray,
  74299. timestampOffset: timestampOffset2,
  74300. videoDuration
  74301. }) => {
  74302. if (!metadataArray) {
  74303. return;
  74304. }
  74305. const Cue = window_1.WebKitDataCue || window_1.VTTCue;
  74306. const metadataTrack = inbandTextTracks.metadataTrack_;
  74307. if (!metadataTrack) {
  74308. return;
  74309. }
  74310. metadataArray.forEach((metadata) => {
  74311. const time = metadata.cueTime + timestampOffset2;
  74312. if (typeof time !== "number" || window_1.isNaN(time) || time < 0 || !(time < Infinity)) {
  74313. return;
  74314. }
  74315. metadata.frames.forEach((frame) => {
  74316. const cue = new Cue(time, time, frame.value || frame.url || frame.data || "");
  74317. cue.frame = frame;
  74318. cue.value = frame;
  74319. deprecateOldCue$1(cue);
  74320. metadataTrack.addCue(cue);
  74321. });
  74322. });
  74323. if (!metadataTrack.cues || !metadataTrack.cues.length) {
  74324. return;
  74325. }
  74326. const cues = metadataTrack.cues;
  74327. const cuesArray = [];
  74328. for (let i2 = 0; i2 < cues.length; i2++) {
  74329. if (cues[i2]) {
  74330. cuesArray.push(cues[i2]);
  74331. }
  74332. }
  74333. const cuesGroupedByStartTime = cuesArray.reduce((obj, cue) => {
  74334. const timeSlot = obj[cue.startTime] || [];
  74335. timeSlot.push(cue);
  74336. obj[cue.startTime] = timeSlot;
  74337. return obj;
  74338. }, {});
  74339. const sortedStartTimes = Object.keys(cuesGroupedByStartTime).sort((a, b) => Number(a) - Number(b));
  74340. sortedStartTimes.forEach((startTime, idx) => {
  74341. const cueGroup = cuesGroupedByStartTime[startTime];
  74342. const nextTime = Number(sortedStartTimes[idx + 1]) || videoDuration;
  74343. cueGroup.forEach((cue) => {
  74344. cue.endTime = nextTime;
  74345. });
  74346. });
  74347. };
  74348. const createMetadataTrackIfNotExists$1 = (inbandTextTracks, dispatchType, tech) => {
  74349. if (inbandTextTracks.metadataTrack_) {
  74350. return;
  74351. }
  74352. inbandTextTracks.metadataTrack_ = tech.addRemoteTextTrack({
  74353. kind: "metadata",
  74354. label: "Timed Metadata"
  74355. }, false).track;
  74356. inbandTextTracks.metadataTrack_.inBandMetadataTrackDispatchType = dispatchType;
  74357. };
  74358. const removeCuesFromTrack$1 = function(start2, end, track) {
  74359. let i2;
  74360. let cue;
  74361. if (!track) {
  74362. return;
  74363. }
  74364. if (!track.cues) {
  74365. return;
  74366. }
  74367. i2 = track.cues.length;
  74368. while (i2--) {
  74369. cue = track.cues[i2];
  74370. if (cue.startTime >= start2 && cue.endTime <= end) {
  74371. track.removeCue(cue);
  74372. }
  74373. }
  74374. };
  74375. const removeDuplicateCuesFromTrack$1 = function(track) {
  74376. const cues = track.cues;
  74377. if (!cues) {
  74378. return;
  74379. }
  74380. for (let i2 = 0; i2 < cues.length; i2++) {
  74381. const duplicates = [];
  74382. let occurrences = 0;
  74383. for (let j = 0; j < cues.length; j++) {
  74384. if (cues[i2].startTime === cues[j].startTime && cues[i2].endTime === cues[j].endTime && cues[i2].text === cues[j].text) {
  74385. occurrences++;
  74386. if (occurrences > 1) {
  74387. duplicates.push(cues[j]);
  74388. }
  74389. }
  74390. }
  74391. if (duplicates.length) {
  74392. duplicates.forEach((dupe) => track.removeCue(dupe));
  74393. }
  74394. }
  74395. };
  74396. const gopsSafeToAlignWith$1 = (buffer, currentTime, mapping) => {
  74397. if (typeof currentTime === "undefined" || currentTime === null || !buffer.length) {
  74398. return [];
  74399. }
  74400. const currentTimePts = Math.ceil((currentTime - mapping + 3) * clock$1.ONE_SECOND_IN_TS);
  74401. let i2;
  74402. for (i2 = 0; i2 < buffer.length; i2++) {
  74403. if (buffer[i2].pts > currentTimePts) {
  74404. break;
  74405. }
  74406. }
  74407. return buffer.slice(i2);
  74408. };
  74409. const updateGopBuffer$1 = (buffer, gops, replace) => {
  74410. if (!gops.length) {
  74411. return buffer;
  74412. }
  74413. if (replace) {
  74414. return gops.slice();
  74415. }
  74416. const start2 = gops[0].pts;
  74417. let i2 = 0;
  74418. for (i2; i2 < buffer.length; i2++) {
  74419. if (buffer[i2].pts >= start2) {
  74420. break;
  74421. }
  74422. }
  74423. return buffer.slice(0, i2).concat(gops);
  74424. };
  74425. const removeGopBuffer$1 = (buffer, start2, end, mapping) => {
  74426. const startPts = Math.ceil((start2 - mapping) * clock$1.ONE_SECOND_IN_TS);
  74427. const endPts = Math.ceil((end - mapping) * clock$1.ONE_SECOND_IN_TS);
  74428. const updatedBuffer = buffer.slice();
  74429. let i2 = buffer.length;
  74430. while (i2--) {
  74431. if (buffer[i2].pts <= endPts) {
  74432. break;
  74433. }
  74434. }
  74435. if (i2 === -1) {
  74436. return updatedBuffer;
  74437. }
  74438. let j = i2 + 1;
  74439. while (j--) {
  74440. if (buffer[j].pts <= startPts) {
  74441. break;
  74442. }
  74443. }
  74444. j = Math.max(j, 0);
  74445. updatedBuffer.splice(j, i2 - j + 1);
  74446. return updatedBuffer;
  74447. };
  74448. const shallowEqual$1 = function(a, b) {
  74449. if (!a && !b || !a && b || a && !b) {
  74450. return false;
  74451. }
  74452. if (a === b) {
  74453. return true;
  74454. }
  74455. const akeys = Object.keys(a).sort();
  74456. const bkeys = Object.keys(b).sort();
  74457. if (akeys.length !== bkeys.length) {
  74458. return false;
  74459. }
  74460. for (let i2 = 0; i2 < akeys.length; i2++) {
  74461. const key = akeys[i2];
  74462. if (key !== bkeys[i2]) {
  74463. return false;
  74464. }
  74465. if (a[key] !== b[key]) {
  74466. return false;
  74467. }
  74468. }
  74469. return true;
  74470. };
  74471. const QUOTA_EXCEEDED_ERR$1 = 22;
  74472. const getSyncSegmentCandidate$1 = function(currentTimeline, segments, targetTime) {
  74473. segments = segments || [];
  74474. const timelineSegments = [];
  74475. let time = 0;
  74476. for (let i2 = 0; i2 < segments.length; i2++) {
  74477. const segment = segments[i2];
  74478. if (currentTimeline === segment.timeline) {
  74479. timelineSegments.push(i2);
  74480. time += segment.duration;
  74481. if (time > targetTime) {
  74482. return i2;
  74483. }
  74484. }
  74485. }
  74486. if (timelineSegments.length === 0) {
  74487. return 0;
  74488. }
  74489. return timelineSegments[timelineSegments.length - 1];
  74490. };
  74491. const MIN_BACK_BUFFER$1 = 1;
  74492. const CHECK_BUFFER_DELAY$1 = 500;
  74493. const finite$1 = (num) => typeof num === "number" && isFinite(num);
  74494. const MIN_SEGMENT_DURATION_TO_SAVE_STATS$1 = 1 / 60;
  74495. const illegalMediaSwitch$1 = (loaderType, startingMedia, trackInfo) => {
  74496. if (loaderType !== "main" || !startingMedia || !trackInfo) {
  74497. return null;
  74498. }
  74499. if (!trackInfo.hasAudio && !trackInfo.hasVideo) {
  74500. return "Neither audio nor video found in segment.";
  74501. }
  74502. if (startingMedia.hasVideo && !trackInfo.hasVideo) {
  74503. return "Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.";
  74504. }
  74505. if (!startingMedia.hasVideo && trackInfo.hasVideo) {
  74506. return "Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.";
  74507. }
  74508. return null;
  74509. };
  74510. const safeBackBufferTrimTime$1 = (seekable3, currentTime, targetDuration) => {
  74511. let trimTime = currentTime - Config$1.BACK_BUFFER_LENGTH;
  74512. if (seekable3.length) {
  74513. trimTime = Math.max(trimTime, seekable3.start(0));
  74514. }
  74515. const maxTrimTime = currentTime - targetDuration;
  74516. return Math.min(maxTrimTime, trimTime);
  74517. };
  74518. const segmentInfoString$1 = (segmentInfo) => {
  74519. const {
  74520. startOfSegment,
  74521. duration: duration5,
  74522. segment,
  74523. part,
  74524. playlist: {
  74525. mediaSequence: seq,
  74526. id,
  74527. segments = []
  74528. },
  74529. mediaIndex: index2,
  74530. partIndex,
  74531. timeline
  74532. } = segmentInfo;
  74533. const segmentLen = segments.length - 1;
  74534. let selection = "mediaIndex/partIndex increment";
  74535. if (segmentInfo.getMediaInfoForTime) {
  74536. selection = `getMediaInfoForTime (${segmentInfo.getMediaInfoForTime})`;
  74537. } else if (segmentInfo.isSyncRequest) {
  74538. selection = "getSyncSegmentCandidate (isSyncRequest)";
  74539. }
  74540. if (segmentInfo.independent) {
  74541. selection += ` with independent ${segmentInfo.independent}`;
  74542. }
  74543. const hasPartIndex = typeof partIndex === "number";
  74544. const name = segmentInfo.segment.uri ? "segment" : "pre-segment";
  74545. const zeroBasedPartCount = hasPartIndex ? getKnownPartCount$1({
  74546. preloadSegment: segment
  74547. }) - 1 : 0;
  74548. return `${name} [${seq + index2}/${seq + segmentLen}]` + (hasPartIndex ? ` part [${partIndex}/${zeroBasedPartCount}]` : "") + ` segment start/end [${segment.start} => ${segment.end}]` + (hasPartIndex ? ` part start/end [${part.start} => ${part.end}]` : "") + ` startOfSegment [${startOfSegment}] duration [${duration5}] timeline [${timeline}] selected by [${selection}] playlist [${id}]`;
  74549. };
  74550. const timingInfoPropertyForMedia$1 = (mediaType) => `${mediaType}TimingInfo`;
  74551. const timestampOffsetForSegment$1 = ({
  74552. segmentTimeline,
  74553. currentTimeline,
  74554. startOfSegment,
  74555. buffered,
  74556. overrideCheck
  74557. }) => {
  74558. if (!overrideCheck && segmentTimeline === currentTimeline) {
  74559. return null;
  74560. }
  74561. if (segmentTimeline < currentTimeline) {
  74562. return startOfSegment;
  74563. }
  74564. return buffered.length ? buffered.end(buffered.length - 1) : startOfSegment;
  74565. };
  74566. const shouldWaitForTimelineChange$1 = ({
  74567. timelineChangeController,
  74568. currentTimeline,
  74569. segmentTimeline,
  74570. loaderType,
  74571. audioDisabled
  74572. }) => {
  74573. if (currentTimeline === segmentTimeline) {
  74574. return false;
  74575. }
  74576. if (loaderType === "audio") {
  74577. const lastMainTimelineChange = timelineChangeController.lastTimelineChange({
  74578. type: "main"
  74579. });
  74580. return !lastMainTimelineChange || lastMainTimelineChange.to !== segmentTimeline;
  74581. }
  74582. if (loaderType === "main" && audioDisabled) {
  74583. const pendingAudioTimelineChange = timelineChangeController.pendingTimelineChange({
  74584. type: "audio"
  74585. });
  74586. if (pendingAudioTimelineChange && pendingAudioTimelineChange.to === segmentTimeline) {
  74587. return false;
  74588. }
  74589. return true;
  74590. }
  74591. return false;
  74592. };
  74593. const mediaDuration$1 = (timingInfos) => {
  74594. let maxDuration = 0;
  74595. ["video", "audio"].forEach(function(type2) {
  74596. const typeTimingInfo = timingInfos[`${type2}TimingInfo`];
  74597. if (!typeTimingInfo) {
  74598. return;
  74599. }
  74600. const {
  74601. start: start2,
  74602. end
  74603. } = typeTimingInfo;
  74604. let duration5;
  74605. if (typeof start2 === "bigint" || typeof end === "bigint") {
  74606. duration5 = window_1.BigInt(end) - window_1.BigInt(start2);
  74607. } else if (typeof start2 === "number" && typeof end === "number") {
  74608. duration5 = end - start2;
  74609. }
  74610. if (typeof duration5 !== "undefined" && duration5 > maxDuration) {
  74611. maxDuration = duration5;
  74612. }
  74613. });
  74614. if (typeof maxDuration === "bigint" && maxDuration < Number.MAX_SAFE_INTEGER) {
  74615. maxDuration = Number(maxDuration);
  74616. }
  74617. return maxDuration;
  74618. };
  74619. const segmentTooLong$1 = ({
  74620. segmentDuration,
  74621. maxDuration
  74622. }) => {
  74623. if (!segmentDuration) {
  74624. return false;
  74625. }
  74626. return Math.round(segmentDuration) > maxDuration + TIME_FUDGE_FACTOR$1;
  74627. };
  74628. const getTroublesomeSegmentDurationMessage$1 = (segmentInfo, sourceType) => {
  74629. if (sourceType !== "hls") {
  74630. return null;
  74631. }
  74632. const segmentDuration = mediaDuration$1({
  74633. audioTimingInfo: segmentInfo.audioTimingInfo,
  74634. videoTimingInfo: segmentInfo.videoTimingInfo
  74635. });
  74636. if (!segmentDuration) {
  74637. return null;
  74638. }
  74639. const targetDuration = segmentInfo.playlist.targetDuration;
  74640. const isSegmentWayTooLong = segmentTooLong$1({
  74641. segmentDuration,
  74642. maxDuration: targetDuration * 2
  74643. });
  74644. const isSegmentSlightlyTooLong = segmentTooLong$1({
  74645. segmentDuration,
  74646. maxDuration: targetDuration
  74647. });
  74648. const segmentTooLongMessage = `Segment with index ${segmentInfo.mediaIndex} from playlist ${segmentInfo.playlist.id} has a duration of ${segmentDuration} when the reported duration is ${segmentInfo.duration} and the target duration is ${targetDuration}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;
  74649. if (isSegmentWayTooLong || isSegmentSlightlyTooLong) {
  74650. return {
  74651. severity: isSegmentWayTooLong ? "warn" : "info",
  74652. message: segmentTooLongMessage
  74653. };
  74654. }
  74655. return null;
  74656. };
  74657. class SegmentLoader$1 extends videojs$2.EventTarget {
  74658. constructor(settings, options2 = {}) {
  74659. super();
  74660. if (!settings) {
  74661. throw new TypeError("Initialization settings are required");
  74662. }
  74663. if (typeof settings.currentTime !== "function") {
  74664. throw new TypeError("No currentTime getter specified");
  74665. }
  74666. if (!settings.mediaSource) {
  74667. throw new TypeError("No MediaSource specified");
  74668. }
  74669. this.bandwidth = settings.bandwidth;
  74670. this.throughput = {
  74671. rate: 0,
  74672. count: 0
  74673. };
  74674. this.roundTrip = NaN;
  74675. this.resetStats_();
  74676. this.mediaIndex = null;
  74677. this.partIndex = null;
  74678. this.hasPlayed_ = settings.hasPlayed;
  74679. this.currentTime_ = settings.currentTime;
  74680. this.seekable_ = settings.seekable;
  74681. this.seeking_ = settings.seeking;
  74682. this.duration_ = settings.duration;
  74683. this.mediaSource_ = settings.mediaSource;
  74684. this.vhs_ = settings.vhs;
  74685. this.loaderType_ = settings.loaderType;
  74686. this.currentMediaInfo_ = void 0;
  74687. this.startingMediaInfo_ = void 0;
  74688. this.segmentMetadataTrack_ = settings.segmentMetadataTrack;
  74689. this.goalBufferLength_ = settings.goalBufferLength;
  74690. this.sourceType_ = settings.sourceType;
  74691. this.sourceUpdater_ = settings.sourceUpdater;
  74692. this.inbandTextTracks_ = settings.inbandTextTracks;
  74693. this.state_ = "INIT";
  74694. this.timelineChangeController_ = settings.timelineChangeController;
  74695. this.shouldSaveSegmentTimingInfo_ = true;
  74696. this.parse708captions_ = settings.parse708captions;
  74697. this.useDtsForTimestampOffset_ = settings.useDtsForTimestampOffset;
  74698. this.captionServices_ = settings.captionServices;
  74699. this.exactManifestTimings = settings.exactManifestTimings;
  74700. this.checkBufferTimeout_ = null;
  74701. this.error_ = void 0;
  74702. this.currentTimeline_ = -1;
  74703. this.pendingSegment_ = null;
  74704. this.xhrOptions_ = null;
  74705. this.pendingSegments_ = [];
  74706. this.audioDisabled_ = false;
  74707. this.isPendingTimestampOffset_ = false;
  74708. this.gopBuffer_ = [];
  74709. this.timeMapping_ = 0;
  74710. this.safeAppend_ = videojs$2.browser.IE_VERSION >= 11;
  74711. this.appendInitSegment_ = {
  74712. audio: true,
  74713. video: true
  74714. };
  74715. this.playlistOfLastInitSegment_ = {
  74716. audio: null,
  74717. video: null
  74718. };
  74719. this.callQueue_ = [];
  74720. this.loadQueue_ = [];
  74721. this.metadataQueue_ = {
  74722. id3: [],
  74723. caption: []
  74724. };
  74725. this.waitingOnRemove_ = false;
  74726. this.quotaExceededErrorRetryTimeout_ = null;
  74727. this.activeInitSegmentId_ = null;
  74728. this.initSegments_ = {};
  74729. this.cacheEncryptionKeys_ = settings.cacheEncryptionKeys;
  74730. this.keyCache_ = {};
  74731. this.decrypter_ = settings.decrypter;
  74732. this.syncController_ = settings.syncController;
  74733. this.syncPoint_ = {
  74734. segmentIndex: 0,
  74735. time: 0
  74736. };
  74737. this.transmuxer_ = this.createTransmuxer_();
  74738. this.triggerSyncInfoUpdate_ = () => this.trigger("syncinfoupdate");
  74739. this.syncController_.on("syncinfoupdate", this.triggerSyncInfoUpdate_);
  74740. this.mediaSource_.addEventListener("sourceopen", () => {
  74741. if (!this.isEndOfStream_()) {
  74742. this.ended_ = false;
  74743. }
  74744. });
  74745. this.fetchAtBuffer_ = false;
  74746. this.logger_ = logger$1(`SegmentLoader[${this.loaderType_}]`);
  74747. Object.defineProperty(this, "state", {
  74748. get() {
  74749. return this.state_;
  74750. },
  74751. set(newState) {
  74752. if (newState !== this.state_) {
  74753. this.logger_(`${this.state_} -> ${newState}`);
  74754. this.state_ = newState;
  74755. this.trigger("statechange");
  74756. }
  74757. }
  74758. });
  74759. this.sourceUpdater_.on("ready", () => {
  74760. if (this.hasEnoughInfoToAppend_()) {
  74761. this.processCallQueue_();
  74762. }
  74763. });
  74764. if (this.loaderType_ === "main") {
  74765. this.timelineChangeController_.on("pendingtimelinechange", () => {
  74766. if (this.hasEnoughInfoToAppend_()) {
  74767. this.processCallQueue_();
  74768. }
  74769. });
  74770. }
  74771. if (this.loaderType_ === "audio") {
  74772. this.timelineChangeController_.on("timelinechange", () => {
  74773. if (this.hasEnoughInfoToLoad_()) {
  74774. this.processLoadQueue_();
  74775. }
  74776. if (this.hasEnoughInfoToAppend_()) {
  74777. this.processCallQueue_();
  74778. }
  74779. });
  74780. }
  74781. }
  74782. createTransmuxer_() {
  74783. return segmentTransmuxer$1.createTransmuxer({
  74784. remux: false,
  74785. alignGopsAtEnd: this.safeAppend_,
  74786. keepOriginalTimestamps: true,
  74787. parse708captions: this.parse708captions_,
  74788. captionServices: this.captionServices_
  74789. });
  74790. }
  74791. resetStats_() {
  74792. this.mediaBytesTransferred = 0;
  74793. this.mediaRequests = 0;
  74794. this.mediaRequestsAborted = 0;
  74795. this.mediaRequestsTimedout = 0;
  74796. this.mediaRequestsErrored = 0;
  74797. this.mediaTransferDuration = 0;
  74798. this.mediaSecondsLoaded = 0;
  74799. this.mediaAppends = 0;
  74800. }
  74801. dispose() {
  74802. this.trigger("dispose");
  74803. this.state = "DISPOSED";
  74804. this.pause();
  74805. this.abort_();
  74806. if (this.transmuxer_) {
  74807. this.transmuxer_.terminate();
  74808. }
  74809. this.resetStats_();
  74810. if (this.checkBufferTimeout_) {
  74811. window_1.clearTimeout(this.checkBufferTimeout_);
  74812. }
  74813. if (this.syncController_ && this.triggerSyncInfoUpdate_) {
  74814. this.syncController_.off("syncinfoupdate", this.triggerSyncInfoUpdate_);
  74815. }
  74816. this.off();
  74817. }
  74818. setAudio(enable) {
  74819. this.audioDisabled_ = !enable;
  74820. if (enable) {
  74821. this.appendInitSegment_.audio = true;
  74822. } else {
  74823. this.sourceUpdater_.removeAudio(0, this.duration_());
  74824. }
  74825. }
  74826. abort() {
  74827. if (this.state !== "WAITING") {
  74828. if (this.pendingSegment_) {
  74829. this.pendingSegment_ = null;
  74830. }
  74831. return;
  74832. }
  74833. this.abort_();
  74834. this.state = "READY";
  74835. if (!this.paused()) {
  74836. this.monitorBuffer_();
  74837. }
  74838. }
  74839. abort_() {
  74840. if (this.pendingSegment_ && this.pendingSegment_.abortRequests) {
  74841. this.pendingSegment_.abortRequests();
  74842. }
  74843. this.pendingSegment_ = null;
  74844. this.callQueue_ = [];
  74845. this.loadQueue_ = [];
  74846. this.metadataQueue_.id3 = [];
  74847. this.metadataQueue_.caption = [];
  74848. this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);
  74849. this.waitingOnRemove_ = false;
  74850. window_1.clearTimeout(this.quotaExceededErrorRetryTimeout_);
  74851. this.quotaExceededErrorRetryTimeout_ = null;
  74852. }
  74853. checkForAbort_(requestId) {
  74854. if (this.state === "APPENDING" && !this.pendingSegment_) {
  74855. this.state = "READY";
  74856. return true;
  74857. }
  74858. if (!this.pendingSegment_ || this.pendingSegment_.requestId !== requestId) {
  74859. return true;
  74860. }
  74861. return false;
  74862. }
  74863. error(error) {
  74864. if (typeof error !== "undefined") {
  74865. this.logger_("error occurred:", error);
  74866. this.error_ = error;
  74867. }
  74868. this.pendingSegment_ = null;
  74869. return this.error_;
  74870. }
  74871. endOfStream() {
  74872. this.ended_ = true;
  74873. if (this.transmuxer_) {
  74874. segmentTransmuxer$1.reset(this.transmuxer_);
  74875. }
  74876. this.gopBuffer_.length = 0;
  74877. this.pause();
  74878. this.trigger("ended");
  74879. }
  74880. buffered_() {
  74881. const trackInfo = this.getMediaInfo_();
  74882. if (!this.sourceUpdater_ || !trackInfo) {
  74883. return createTimeRanges$2();
  74884. }
  74885. if (this.loaderType_ === "main") {
  74886. const {
  74887. hasAudio,
  74888. hasVideo,
  74889. isMuxed: isMuxed3
  74890. } = trackInfo;
  74891. if (hasVideo && hasAudio && !this.audioDisabled_ && !isMuxed3) {
  74892. return this.sourceUpdater_.buffered();
  74893. }
  74894. if (hasVideo) {
  74895. return this.sourceUpdater_.videoBuffered();
  74896. }
  74897. }
  74898. return this.sourceUpdater_.audioBuffered();
  74899. }
  74900. initSegmentForMap(map, set4 = false) {
  74901. if (!map) {
  74902. return null;
  74903. }
  74904. const id = initSegmentId$1(map);
  74905. let storedMap = this.initSegments_[id];
  74906. if (set4 && !storedMap && map.bytes) {
  74907. this.initSegments_[id] = storedMap = {
  74908. resolvedUri: map.resolvedUri,
  74909. byterange: map.byterange,
  74910. bytes: map.bytes,
  74911. tracks: map.tracks,
  74912. timescales: map.timescales
  74913. };
  74914. }
  74915. return storedMap || map;
  74916. }
  74917. segmentKey(key, set4 = false) {
  74918. if (!key) {
  74919. return null;
  74920. }
  74921. const id = segmentKeyId$1(key);
  74922. let storedKey = this.keyCache_[id];
  74923. if (this.cacheEncryptionKeys_ && set4 && !storedKey && key.bytes) {
  74924. this.keyCache_[id] = storedKey = {
  74925. resolvedUri: key.resolvedUri,
  74926. bytes: key.bytes
  74927. };
  74928. }
  74929. const result = {
  74930. resolvedUri: (storedKey || key).resolvedUri
  74931. };
  74932. if (storedKey) {
  74933. result.bytes = storedKey.bytes;
  74934. }
  74935. return result;
  74936. }
  74937. couldBeginLoading_() {
  74938. return this.playlist_ && !this.paused();
  74939. }
  74940. load() {
  74941. this.monitorBuffer_();
  74942. if (!this.playlist_) {
  74943. return;
  74944. }
  74945. if (this.state === "INIT" && this.couldBeginLoading_()) {
  74946. return this.init_();
  74947. }
  74948. if (!this.couldBeginLoading_() || this.state !== "READY" && this.state !== "INIT") {
  74949. return;
  74950. }
  74951. this.state = "READY";
  74952. }
  74953. init_() {
  74954. this.state = "READY";
  74955. this.resetEverything();
  74956. return this.monitorBuffer_();
  74957. }
  74958. playlist(newPlaylist, options2 = {}) {
  74959. if (!newPlaylist) {
  74960. return;
  74961. }
  74962. const oldPlaylist = this.playlist_;
  74963. const segmentInfo = this.pendingSegment_;
  74964. this.playlist_ = newPlaylist;
  74965. this.xhrOptions_ = options2;
  74966. if (this.state === "INIT") {
  74967. newPlaylist.syncInfo = {
  74968. mediaSequence: newPlaylist.mediaSequence,
  74969. time: 0
  74970. };
  74971. if (this.loaderType_ === "main") {
  74972. this.syncController_.setDateTimeMappingForStart(newPlaylist);
  74973. }
  74974. }
  74975. let oldId = null;
  74976. if (oldPlaylist) {
  74977. if (oldPlaylist.id) {
  74978. oldId = oldPlaylist.id;
  74979. } else if (oldPlaylist.uri) {
  74980. oldId = oldPlaylist.uri;
  74981. }
  74982. }
  74983. this.logger_(`playlist update [${oldId} => ${newPlaylist.id || newPlaylist.uri}]`);
  74984. this.trigger("syncinfoupdate");
  74985. if (this.state === "INIT" && this.couldBeginLoading_()) {
  74986. return this.init_();
  74987. }
  74988. if (!oldPlaylist || oldPlaylist.uri !== newPlaylist.uri) {
  74989. if (this.mediaIndex !== null) {
  74990. if (!newPlaylist.endList) {
  74991. this.resetLoader();
  74992. } else {
  74993. this.resyncLoader();
  74994. }
  74995. }
  74996. this.currentMediaInfo_ = void 0;
  74997. this.trigger("playlistupdate");
  74998. return;
  74999. }
  75000. const mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;
  75001. this.logger_(`live window shift [${mediaSequenceDiff}]`);
  75002. if (this.mediaIndex !== null) {
  75003. this.mediaIndex -= mediaSequenceDiff;
  75004. if (this.mediaIndex < 0) {
  75005. this.mediaIndex = null;
  75006. this.partIndex = null;
  75007. } else {
  75008. const segment = this.playlist_.segments[this.mediaIndex];
  75009. if (this.partIndex && (!segment.parts || !segment.parts.length || !segment.parts[this.partIndex])) {
  75010. const mediaIndex = this.mediaIndex;
  75011. this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`);
  75012. this.resetLoader();
  75013. this.mediaIndex = mediaIndex;
  75014. }
  75015. }
  75016. }
  75017. if (segmentInfo) {
  75018. segmentInfo.mediaIndex -= mediaSequenceDiff;
  75019. if (segmentInfo.mediaIndex < 0) {
  75020. segmentInfo.mediaIndex = null;
  75021. segmentInfo.partIndex = null;
  75022. } else {
  75023. if (segmentInfo.mediaIndex >= 0) {
  75024. segmentInfo.segment = newPlaylist.segments[segmentInfo.mediaIndex];
  75025. }
  75026. if (segmentInfo.partIndex >= 0 && segmentInfo.segment.parts) {
  75027. segmentInfo.part = segmentInfo.segment.parts[segmentInfo.partIndex];
  75028. }
  75029. }
  75030. }
  75031. this.syncController_.saveExpiredSegmentInfo(oldPlaylist, newPlaylist);
  75032. }
  75033. pause() {
  75034. if (this.checkBufferTimeout_) {
  75035. window_1.clearTimeout(this.checkBufferTimeout_);
  75036. this.checkBufferTimeout_ = null;
  75037. }
  75038. }
  75039. paused() {
  75040. return this.checkBufferTimeout_ === null;
  75041. }
  75042. resetEverything(done) {
  75043. this.ended_ = false;
  75044. this.activeInitSegmentId_ = null;
  75045. this.appendInitSegment_ = {
  75046. audio: true,
  75047. video: true
  75048. };
  75049. this.resetLoader();
  75050. this.remove(0, Infinity, done);
  75051. if (this.transmuxer_) {
  75052. this.transmuxer_.postMessage({
  75053. action: "clearAllMp4Captions"
  75054. });
  75055. this.transmuxer_.postMessage({
  75056. action: "reset"
  75057. });
  75058. }
  75059. }
  75060. resetLoader() {
  75061. this.fetchAtBuffer_ = false;
  75062. this.resyncLoader();
  75063. }
  75064. resyncLoader() {
  75065. if (this.transmuxer_) {
  75066. segmentTransmuxer$1.reset(this.transmuxer_);
  75067. }
  75068. this.mediaIndex = null;
  75069. this.partIndex = null;
  75070. this.syncPoint_ = null;
  75071. this.isPendingTimestampOffset_ = false;
  75072. this.callQueue_ = [];
  75073. this.loadQueue_ = [];
  75074. this.metadataQueue_.id3 = [];
  75075. this.metadataQueue_.caption = [];
  75076. this.abort();
  75077. if (this.transmuxer_) {
  75078. this.transmuxer_.postMessage({
  75079. action: "clearParsedMp4Captions"
  75080. });
  75081. }
  75082. }
  75083. remove(start2, end, done = () => {
  75084. }, force = false) {
  75085. if (end === Infinity) {
  75086. end = this.duration_();
  75087. }
  75088. if (end <= start2) {
  75089. this.logger_("skipping remove because end ${end} is <= start ${start}");
  75090. return;
  75091. }
  75092. if (!this.sourceUpdater_ || !this.getMediaInfo_()) {
  75093. this.logger_("skipping remove because no source updater or starting media info");
  75094. return;
  75095. }
  75096. let removesRemaining = 1;
  75097. const removeFinished = () => {
  75098. removesRemaining--;
  75099. if (removesRemaining === 0) {
  75100. done();
  75101. }
  75102. };
  75103. if (force || !this.audioDisabled_) {
  75104. removesRemaining++;
  75105. this.sourceUpdater_.removeAudio(start2, end, removeFinished);
  75106. }
  75107. if (force || this.loaderType_ === "main") {
  75108. this.gopBuffer_ = removeGopBuffer$1(this.gopBuffer_, start2, end, this.timeMapping_);
  75109. removesRemaining++;
  75110. this.sourceUpdater_.removeVideo(start2, end, removeFinished);
  75111. }
  75112. for (const track in this.inbandTextTracks_) {
  75113. removeCuesFromTrack$1(start2, end, this.inbandTextTracks_[track]);
  75114. }
  75115. removeCuesFromTrack$1(start2, end, this.segmentMetadataTrack_);
  75116. removeFinished();
  75117. }
  75118. monitorBuffer_() {
  75119. if (this.checkBufferTimeout_) {
  75120. window_1.clearTimeout(this.checkBufferTimeout_);
  75121. }
  75122. this.checkBufferTimeout_ = window_1.setTimeout(this.monitorBufferTick_.bind(this), 1);
  75123. }
  75124. monitorBufferTick_() {
  75125. if (this.state === "READY") {
  75126. this.fillBuffer_();
  75127. }
  75128. if (this.checkBufferTimeout_) {
  75129. window_1.clearTimeout(this.checkBufferTimeout_);
  75130. }
  75131. this.checkBufferTimeout_ = window_1.setTimeout(this.monitorBufferTick_.bind(this), CHECK_BUFFER_DELAY$1);
  75132. }
  75133. fillBuffer_() {
  75134. if (this.sourceUpdater_.updating()) {
  75135. return;
  75136. }
  75137. const segmentInfo = this.chooseNextRequest_();
  75138. if (!segmentInfo) {
  75139. return;
  75140. }
  75141. if (typeof segmentInfo.timestampOffset === "number") {
  75142. this.isPendingTimestampOffset_ = false;
  75143. this.timelineChangeController_.pendingTimelineChange({
  75144. type: this.loaderType_,
  75145. from: this.currentTimeline_,
  75146. to: segmentInfo.timeline
  75147. });
  75148. }
  75149. this.loadSegment_(segmentInfo);
  75150. }
  75151. isEndOfStream_(mediaIndex = this.mediaIndex, playlist = this.playlist_, partIndex = this.partIndex) {
  75152. if (!playlist || !this.mediaSource_) {
  75153. return false;
  75154. }
  75155. const segment = typeof mediaIndex === "number" && playlist.segments[mediaIndex];
  75156. const appendedLastSegment = mediaIndex + 1 === playlist.segments.length;
  75157. const appendedLastPart = !segment || !segment.parts || partIndex + 1 === segment.parts.length;
  75158. return playlist.endList && this.mediaSource_.readyState === "open" && appendedLastSegment && appendedLastPart;
  75159. }
  75160. chooseNextRequest_() {
  75161. const buffered = this.buffered_();
  75162. const bufferedEnd = lastBufferedEnd$1(buffered) || 0;
  75163. const bufferedTime = timeAheadOf$1(buffered, this.currentTime_());
  75164. const preloaded = !this.hasPlayed_() && bufferedTime >= 1;
  75165. const haveEnoughBuffer = bufferedTime >= this.goalBufferLength_();
  75166. const segments = this.playlist_.segments;
  75167. if (!segments.length || preloaded || haveEnoughBuffer) {
  75168. return null;
  75169. }
  75170. this.syncPoint_ = this.syncPoint_ || this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_());
  75171. const next = {
  75172. partIndex: null,
  75173. mediaIndex: null,
  75174. startOfSegment: null,
  75175. playlist: this.playlist_,
  75176. isSyncRequest: Boolean(!this.syncPoint_)
  75177. };
  75178. if (next.isSyncRequest) {
  75179. next.mediaIndex = getSyncSegmentCandidate$1(this.currentTimeline_, segments, bufferedEnd);
  75180. } else if (this.mediaIndex !== null) {
  75181. const segment = segments[this.mediaIndex];
  75182. const partIndex = typeof this.partIndex === "number" ? this.partIndex : -1;
  75183. next.startOfSegment = segment.end ? segment.end : bufferedEnd;
  75184. if (segment.parts && segment.parts[partIndex + 1]) {
  75185. next.mediaIndex = this.mediaIndex;
  75186. next.partIndex = partIndex + 1;
  75187. } else {
  75188. next.mediaIndex = this.mediaIndex + 1;
  75189. }
  75190. } else {
  75191. const {
  75192. segmentIndex,
  75193. startTime,
  75194. partIndex
  75195. } = Playlist$1.getMediaInfoForTime({
  75196. exactManifestTimings: this.exactManifestTimings,
  75197. playlist: this.playlist_,
  75198. currentTime: this.fetchAtBuffer_ ? bufferedEnd : this.currentTime_(),
  75199. startingPartIndex: this.syncPoint_.partIndex,
  75200. startingSegmentIndex: this.syncPoint_.segmentIndex,
  75201. startTime: this.syncPoint_.time
  75202. });
  75203. next.getMediaInfoForTime = this.fetchAtBuffer_ ? `bufferedEnd ${bufferedEnd}` : `currentTime ${this.currentTime_()}`;
  75204. next.mediaIndex = segmentIndex;
  75205. next.startOfSegment = startTime;
  75206. next.partIndex = partIndex;
  75207. }
  75208. const nextSegment = segments[next.mediaIndex];
  75209. let nextPart = nextSegment && typeof next.partIndex === "number" && nextSegment.parts && nextSegment.parts[next.partIndex];
  75210. if (!nextSegment || typeof next.partIndex === "number" && !nextPart) {
  75211. return null;
  75212. }
  75213. if (typeof next.partIndex !== "number" && nextSegment.parts) {
  75214. next.partIndex = 0;
  75215. nextPart = nextSegment.parts[0];
  75216. }
  75217. if (!bufferedTime && nextPart && !nextPart.independent) {
  75218. if (next.partIndex === 0) {
  75219. const lastSegment = segments[next.mediaIndex - 1];
  75220. const lastSegmentLastPart = lastSegment.parts && lastSegment.parts.length && lastSegment.parts[lastSegment.parts.length - 1];
  75221. if (lastSegmentLastPart && lastSegmentLastPart.independent) {
  75222. next.mediaIndex -= 1;
  75223. next.partIndex = lastSegment.parts.length - 1;
  75224. next.independent = "previous segment";
  75225. }
  75226. } else if (nextSegment.parts[next.partIndex - 1].independent) {
  75227. next.partIndex -= 1;
  75228. next.independent = "previous part";
  75229. }
  75230. }
  75231. const ended = this.mediaSource_ && this.mediaSource_.readyState === "ended";
  75232. if (next.mediaIndex >= segments.length - 1 && ended && !this.seeking_()) {
  75233. return null;
  75234. }
  75235. return this.generateSegmentInfo_(next);
  75236. }
  75237. generateSegmentInfo_(options2) {
  75238. const {
  75239. independent,
  75240. playlist,
  75241. mediaIndex,
  75242. startOfSegment,
  75243. isSyncRequest,
  75244. partIndex,
  75245. forceTimestampOffset,
  75246. getMediaInfoForTime: getMediaInfoForTime3
  75247. } = options2;
  75248. const segment = playlist.segments[mediaIndex];
  75249. const part = typeof partIndex === "number" && segment.parts[partIndex];
  75250. const segmentInfo = {
  75251. requestId: "segment-loader-" + Math.random(),
  75252. uri: part && part.resolvedUri || segment.resolvedUri,
  75253. mediaIndex,
  75254. partIndex: part ? partIndex : null,
  75255. isSyncRequest,
  75256. startOfSegment,
  75257. playlist,
  75258. bytes: null,
  75259. encryptedBytes: null,
  75260. timestampOffset: null,
  75261. timeline: segment.timeline,
  75262. duration: part && part.duration || segment.duration,
  75263. segment,
  75264. part,
  75265. byteLength: 0,
  75266. transmuxer: this.transmuxer_,
  75267. getMediaInfoForTime: getMediaInfoForTime3,
  75268. independent
  75269. };
  75270. const overrideCheck = typeof forceTimestampOffset !== "undefined" ? forceTimestampOffset : this.isPendingTimestampOffset_;
  75271. segmentInfo.timestampOffset = this.timestampOffsetForSegment_({
  75272. segmentTimeline: segment.timeline,
  75273. currentTimeline: this.currentTimeline_,
  75274. startOfSegment,
  75275. buffered: this.buffered_(),
  75276. overrideCheck
  75277. });
  75278. const audioBufferedEnd = lastBufferedEnd$1(this.sourceUpdater_.audioBuffered());
  75279. if (typeof audioBufferedEnd === "number") {
  75280. segmentInfo.audioAppendStart = audioBufferedEnd - this.sourceUpdater_.audioTimestampOffset();
  75281. }
  75282. if (this.sourceUpdater_.videoBuffered().length) {
  75283. segmentInfo.gopsToAlignWith = gopsSafeToAlignWith$1(
  75284. this.gopBuffer_,
  75285. this.currentTime_() - this.sourceUpdater_.videoTimestampOffset(),
  75286. this.timeMapping_
  75287. );
  75288. }
  75289. return segmentInfo;
  75290. }
  75291. timestampOffsetForSegment_(options2) {
  75292. return timestampOffsetForSegment$1(options2);
  75293. }
  75294. earlyAbortWhenNeeded_(stats) {
  75295. if (this.vhs_.tech_.paused() || !this.xhrOptions_.timeout || !this.playlist_.attributes.BANDWIDTH) {
  75296. return;
  75297. }
  75298. if (Date.now() - (stats.firstBytesReceivedAt || Date.now()) < 1e3) {
  75299. return;
  75300. }
  75301. const currentTime = this.currentTime_();
  75302. const measuredBandwidth = stats.bandwidth;
  75303. const segmentDuration = this.pendingSegment_.duration;
  75304. const requestTimeRemaining = Playlist$1.estimateSegmentRequestTime(segmentDuration, measuredBandwidth, this.playlist_, stats.bytesReceived);
  75305. const timeUntilRebuffer$1$1 = timeUntilRebuffer$1(this.buffered_(), currentTime, this.vhs_.tech_.playbackRate()) - 1;
  75306. if (requestTimeRemaining <= timeUntilRebuffer$1$1) {
  75307. return;
  75308. }
  75309. const switchCandidate = minRebufferMaxBandwidthSelector$1({
  75310. main: this.vhs_.playlists.main,
  75311. currentTime,
  75312. bandwidth: measuredBandwidth,
  75313. duration: this.duration_(),
  75314. segmentDuration,
  75315. timeUntilRebuffer: timeUntilRebuffer$1$1,
  75316. currentTimeline: this.currentTimeline_,
  75317. syncController: this.syncController_
  75318. });
  75319. if (!switchCandidate) {
  75320. return;
  75321. }
  75322. const rebufferingImpact = requestTimeRemaining - timeUntilRebuffer$1$1;
  75323. const timeSavedBySwitching = rebufferingImpact - switchCandidate.rebufferingImpact;
  75324. let minimumTimeSaving = 0.5;
  75325. if (timeUntilRebuffer$1$1 <= TIME_FUDGE_FACTOR$1) {
  75326. minimumTimeSaving = 1;
  75327. }
  75328. if (!switchCandidate.playlist || switchCandidate.playlist.uri === this.playlist_.uri || timeSavedBySwitching < minimumTimeSaving) {
  75329. return;
  75330. }
  75331. this.bandwidth = switchCandidate.playlist.attributes.BANDWIDTH * Config$1.BANDWIDTH_VARIANCE + 1;
  75332. this.trigger("earlyabort");
  75333. }
  75334. handleAbort_(segmentInfo) {
  75335. this.logger_(`Aborting ${segmentInfoString$1(segmentInfo)}`);
  75336. this.mediaRequestsAborted += 1;
  75337. }
  75338. handleProgress_(event2, simpleSegment) {
  75339. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75340. if (this.checkForAbort_(simpleSegment.requestId)) {
  75341. return;
  75342. }
  75343. this.trigger("progress");
  75344. }
  75345. handleTrackInfo_(simpleSegment, trackInfo) {
  75346. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75347. if (this.checkForAbort_(simpleSegment.requestId)) {
  75348. return;
  75349. }
  75350. if (this.checkForIllegalMediaSwitch(trackInfo)) {
  75351. return;
  75352. }
  75353. trackInfo = trackInfo || {};
  75354. if (!shallowEqual$1(this.currentMediaInfo_, trackInfo)) {
  75355. this.appendInitSegment_ = {
  75356. audio: true,
  75357. video: true
  75358. };
  75359. this.startingMediaInfo_ = trackInfo;
  75360. this.currentMediaInfo_ = trackInfo;
  75361. this.logger_("trackinfo update", trackInfo);
  75362. this.trigger("trackinfo");
  75363. }
  75364. if (this.checkForAbort_(simpleSegment.requestId)) {
  75365. return;
  75366. }
  75367. this.pendingSegment_.trackInfo = trackInfo;
  75368. if (this.hasEnoughInfoToAppend_()) {
  75369. this.processCallQueue_();
  75370. }
  75371. }
  75372. handleTimingInfo_(simpleSegment, mediaType, timeType, time) {
  75373. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75374. if (this.checkForAbort_(simpleSegment.requestId)) {
  75375. return;
  75376. }
  75377. const segmentInfo = this.pendingSegment_;
  75378. const timingInfoProperty = timingInfoPropertyForMedia$1(mediaType);
  75379. segmentInfo[timingInfoProperty] = segmentInfo[timingInfoProperty] || {};
  75380. segmentInfo[timingInfoProperty][timeType] = time;
  75381. this.logger_(`timinginfo: ${mediaType} - ${timeType} - ${time}`);
  75382. if (this.hasEnoughInfoToAppend_()) {
  75383. this.processCallQueue_();
  75384. }
  75385. }
  75386. handleCaptions_(simpleSegment, captionData) {
  75387. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75388. if (this.checkForAbort_(simpleSegment.requestId)) {
  75389. return;
  75390. }
  75391. if (captionData.length === 0) {
  75392. this.logger_("SegmentLoader received no captions from a caption event");
  75393. return;
  75394. }
  75395. const segmentInfo = this.pendingSegment_;
  75396. if (!segmentInfo.hasAppendedData_) {
  75397. this.metadataQueue_.caption.push(this.handleCaptions_.bind(this, simpleSegment, captionData));
  75398. return;
  75399. }
  75400. const timestampOffset2 = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset();
  75401. const captionTracks = {};
  75402. captionData.forEach((caption) => {
  75403. captionTracks[caption.stream] = captionTracks[caption.stream] || {
  75404. startTime: Infinity,
  75405. captions: [],
  75406. endTime: 0
  75407. };
  75408. const captionTrack = captionTracks[caption.stream];
  75409. captionTrack.startTime = Math.min(captionTrack.startTime, caption.startTime + timestampOffset2);
  75410. captionTrack.endTime = Math.max(captionTrack.endTime, caption.endTime + timestampOffset2);
  75411. captionTrack.captions.push(caption);
  75412. });
  75413. Object.keys(captionTracks).forEach((trackName) => {
  75414. const {
  75415. startTime,
  75416. endTime,
  75417. captions
  75418. } = captionTracks[trackName];
  75419. const inbandTextTracks = this.inbandTextTracks_;
  75420. this.logger_(`adding cues from ${startTime} -> ${endTime} for ${trackName}`);
  75421. createCaptionsTrackIfNotExists$1(inbandTextTracks, this.vhs_.tech_, trackName);
  75422. removeCuesFromTrack$1(startTime, endTime, inbandTextTracks[trackName]);
  75423. addCaptionData$1({
  75424. captionArray: captions,
  75425. inbandTextTracks,
  75426. timestampOffset: timestampOffset2
  75427. });
  75428. });
  75429. if (this.transmuxer_) {
  75430. this.transmuxer_.postMessage({
  75431. action: "clearParsedMp4Captions"
  75432. });
  75433. }
  75434. }
  75435. handleId3_(simpleSegment, id3Frames, dispatchType) {
  75436. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75437. if (this.checkForAbort_(simpleSegment.requestId)) {
  75438. return;
  75439. }
  75440. const segmentInfo = this.pendingSegment_;
  75441. if (!segmentInfo.hasAppendedData_) {
  75442. this.metadataQueue_.id3.push(this.handleId3_.bind(this, simpleSegment, id3Frames, dispatchType));
  75443. return;
  75444. }
  75445. const timestampOffset2 = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset();
  75446. createMetadataTrackIfNotExists$1(this.inbandTextTracks_, dispatchType, this.vhs_.tech_);
  75447. addMetadata$1({
  75448. inbandTextTracks: this.inbandTextTracks_,
  75449. metadataArray: id3Frames,
  75450. timestampOffset: timestampOffset2,
  75451. videoDuration: this.duration_()
  75452. });
  75453. }
  75454. processMetadataQueue_() {
  75455. this.metadataQueue_.id3.forEach((fn2) => fn2());
  75456. this.metadataQueue_.caption.forEach((fn2) => fn2());
  75457. this.metadataQueue_.id3 = [];
  75458. this.metadataQueue_.caption = [];
  75459. }
  75460. processCallQueue_() {
  75461. const callQueue = this.callQueue_;
  75462. this.callQueue_ = [];
  75463. callQueue.forEach((fun) => fun());
  75464. }
  75465. processLoadQueue_() {
  75466. const loadQueue = this.loadQueue_;
  75467. this.loadQueue_ = [];
  75468. loadQueue.forEach((fun) => fun());
  75469. }
  75470. hasEnoughInfoToLoad_() {
  75471. if (this.loaderType_ !== "audio") {
  75472. return true;
  75473. }
  75474. const segmentInfo = this.pendingSegment_;
  75475. if (!segmentInfo) {
  75476. return false;
  75477. }
  75478. if (!this.getCurrentMediaInfo_()) {
  75479. return true;
  75480. }
  75481. if (shouldWaitForTimelineChange$1({
  75482. timelineChangeController: this.timelineChangeController_,
  75483. currentTimeline: this.currentTimeline_,
  75484. segmentTimeline: segmentInfo.timeline,
  75485. loaderType: this.loaderType_,
  75486. audioDisabled: this.audioDisabled_
  75487. })) {
  75488. return false;
  75489. }
  75490. return true;
  75491. }
  75492. getCurrentMediaInfo_(segmentInfo = this.pendingSegment_) {
  75493. return segmentInfo && segmentInfo.trackInfo || this.currentMediaInfo_;
  75494. }
  75495. getMediaInfo_(segmentInfo = this.pendingSegment_) {
  75496. return this.getCurrentMediaInfo_(segmentInfo) || this.startingMediaInfo_;
  75497. }
  75498. getPendingSegmentPlaylist() {
  75499. return this.pendingSegment_ ? this.pendingSegment_.playlist : null;
  75500. }
  75501. hasEnoughInfoToAppend_() {
  75502. if (!this.sourceUpdater_.ready()) {
  75503. return false;
  75504. }
  75505. if (this.waitingOnRemove_ || this.quotaExceededErrorRetryTimeout_) {
  75506. return false;
  75507. }
  75508. const segmentInfo = this.pendingSegment_;
  75509. const trackInfo = this.getCurrentMediaInfo_();
  75510. if (!segmentInfo || !trackInfo) {
  75511. return false;
  75512. }
  75513. const {
  75514. hasAudio,
  75515. hasVideo,
  75516. isMuxed: isMuxed3
  75517. } = trackInfo;
  75518. if (hasVideo && !segmentInfo.videoTimingInfo) {
  75519. return false;
  75520. }
  75521. if (hasAudio && !this.audioDisabled_ && !isMuxed3 && !segmentInfo.audioTimingInfo) {
  75522. return false;
  75523. }
  75524. if (shouldWaitForTimelineChange$1({
  75525. timelineChangeController: this.timelineChangeController_,
  75526. currentTimeline: this.currentTimeline_,
  75527. segmentTimeline: segmentInfo.timeline,
  75528. loaderType: this.loaderType_,
  75529. audioDisabled: this.audioDisabled_
  75530. })) {
  75531. return false;
  75532. }
  75533. return true;
  75534. }
  75535. handleData_(simpleSegment, result) {
  75536. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  75537. if (this.checkForAbort_(simpleSegment.requestId)) {
  75538. return;
  75539. }
  75540. if (this.callQueue_.length || !this.hasEnoughInfoToAppend_()) {
  75541. this.callQueue_.push(this.handleData_.bind(this, simpleSegment, result));
  75542. return;
  75543. }
  75544. const segmentInfo = this.pendingSegment_;
  75545. this.setTimeMapping_(segmentInfo.timeline);
  75546. this.updateMediaSecondsLoaded_(segmentInfo.part || segmentInfo.segment);
  75547. if (this.mediaSource_.readyState === "closed") {
  75548. return;
  75549. }
  75550. if (simpleSegment.map) {
  75551. simpleSegment.map = this.initSegmentForMap(simpleSegment.map, true);
  75552. segmentInfo.segment.map = simpleSegment.map;
  75553. }
  75554. if (simpleSegment.key) {
  75555. this.segmentKey(simpleSegment.key, true);
  75556. }
  75557. segmentInfo.isFmp4 = simpleSegment.isFmp4;
  75558. segmentInfo.timingInfo = segmentInfo.timingInfo || {};
  75559. if (segmentInfo.isFmp4) {
  75560. this.trigger("fmp4");
  75561. segmentInfo.timingInfo.start = segmentInfo[timingInfoPropertyForMedia$1(result.type)].start;
  75562. } else {
  75563. const trackInfo = this.getCurrentMediaInfo_();
  75564. const useVideoTimingInfo = this.loaderType_ === "main" && trackInfo && trackInfo.hasVideo;
  75565. let firstVideoFrameTimeForData;
  75566. if (useVideoTimingInfo) {
  75567. firstVideoFrameTimeForData = segmentInfo.videoTimingInfo.start;
  75568. }
  75569. segmentInfo.timingInfo.start = this.trueSegmentStart_({
  75570. currentStart: segmentInfo.timingInfo.start,
  75571. playlist: segmentInfo.playlist,
  75572. mediaIndex: segmentInfo.mediaIndex,
  75573. currentVideoTimestampOffset: this.sourceUpdater_.videoTimestampOffset(),
  75574. useVideoTimingInfo,
  75575. firstVideoFrameTimeForData,
  75576. videoTimingInfo: segmentInfo.videoTimingInfo,
  75577. audioTimingInfo: segmentInfo.audioTimingInfo
  75578. });
  75579. }
  75580. this.updateAppendInitSegmentStatus(segmentInfo, result.type);
  75581. this.updateSourceBufferTimestampOffset_(segmentInfo);
  75582. if (segmentInfo.isSyncRequest) {
  75583. this.updateTimingInfoEnd_(segmentInfo);
  75584. this.syncController_.saveSegmentTimingInfo({
  75585. segmentInfo,
  75586. shouldSaveTimelineMapping: this.loaderType_ === "main"
  75587. });
  75588. const next = this.chooseNextRequest_();
  75589. if (next.mediaIndex !== segmentInfo.mediaIndex || next.partIndex !== segmentInfo.partIndex) {
  75590. this.logger_("sync segment was incorrect, not appending");
  75591. return;
  75592. }
  75593. this.logger_("sync segment was correct, appending");
  75594. }
  75595. segmentInfo.hasAppendedData_ = true;
  75596. this.processMetadataQueue_();
  75597. this.appendData_(segmentInfo, result);
  75598. }
  75599. updateAppendInitSegmentStatus(segmentInfo, type2) {
  75600. if (this.loaderType_ === "main" && typeof segmentInfo.timestampOffset === "number" && !segmentInfo.changedTimestampOffset) {
  75601. this.appendInitSegment_ = {
  75602. audio: true,
  75603. video: true
  75604. };
  75605. }
  75606. if (this.playlistOfLastInitSegment_[type2] !== segmentInfo.playlist) {
  75607. this.appendInitSegment_[type2] = true;
  75608. }
  75609. }
  75610. getInitSegmentAndUpdateState_({
  75611. type: type2,
  75612. initSegment,
  75613. map,
  75614. playlist
  75615. }) {
  75616. if (map) {
  75617. const id = initSegmentId$1(map);
  75618. if (this.activeInitSegmentId_ === id) {
  75619. return null;
  75620. }
  75621. initSegment = this.initSegmentForMap(map, true).bytes;
  75622. this.activeInitSegmentId_ = id;
  75623. }
  75624. if (initSegment && this.appendInitSegment_[type2]) {
  75625. this.playlistOfLastInitSegment_[type2] = playlist;
  75626. this.appendInitSegment_[type2] = false;
  75627. this.activeInitSegmentId_ = null;
  75628. return initSegment;
  75629. }
  75630. return null;
  75631. }
  75632. handleQuotaExceededError_({
  75633. segmentInfo,
  75634. type: type2,
  75635. bytes
  75636. }, error) {
  75637. const audioBuffered = this.sourceUpdater_.audioBuffered();
  75638. const videoBuffered = this.sourceUpdater_.videoBuffered();
  75639. if (audioBuffered.length > 1) {
  75640. this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: " + timeRangesToArray$1(audioBuffered).join(", "));
  75641. }
  75642. if (videoBuffered.length > 1) {
  75643. this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: " + timeRangesToArray$1(videoBuffered).join(", "));
  75644. }
  75645. const audioBufferStart = audioBuffered.length ? audioBuffered.start(0) : 0;
  75646. const audioBufferEnd = audioBuffered.length ? audioBuffered.end(audioBuffered.length - 1) : 0;
  75647. const videoBufferStart = videoBuffered.length ? videoBuffered.start(0) : 0;
  75648. const videoBufferEnd = videoBuffered.length ? videoBuffered.end(videoBuffered.length - 1) : 0;
  75649. if (audioBufferEnd - audioBufferStart <= MIN_BACK_BUFFER$1 && videoBufferEnd - videoBufferStart <= MIN_BACK_BUFFER$1) {
  75650. this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${bytes.byteLength}, audio buffer: ${timeRangesToArray$1(audioBuffered).join(", ")}, video buffer: ${timeRangesToArray$1(videoBuffered).join(", ")}, `);
  75651. this.error({
  75652. message: "Quota exceeded error with append of a single segment of content",
  75653. excludeUntil: Infinity
  75654. });
  75655. this.trigger("error");
  75656. return;
  75657. }
  75658. this.waitingOnRemove_ = true;
  75659. this.callQueue_.push(this.appendToSourceBuffer_.bind(this, {
  75660. segmentInfo,
  75661. type: type2,
  75662. bytes
  75663. }));
  75664. const currentTime = this.currentTime_();
  75665. const timeToRemoveUntil = currentTime - MIN_BACK_BUFFER$1;
  75666. this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${timeToRemoveUntil}`);
  75667. this.remove(0, timeToRemoveUntil, () => {
  75668. this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${MIN_BACK_BUFFER$1}s`);
  75669. this.waitingOnRemove_ = false;
  75670. this.quotaExceededErrorRetryTimeout_ = window_1.setTimeout(() => {
  75671. this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue");
  75672. this.quotaExceededErrorRetryTimeout_ = null;
  75673. this.processCallQueue_();
  75674. }, MIN_BACK_BUFFER$1 * 1e3);
  75675. }, true);
  75676. }
  75677. handleAppendError_({
  75678. segmentInfo,
  75679. type: type2,
  75680. bytes
  75681. }, error) {
  75682. if (!error) {
  75683. return;
  75684. }
  75685. if (error.code === QUOTA_EXCEEDED_ERR$1) {
  75686. this.handleQuotaExceededError_({
  75687. segmentInfo,
  75688. type: type2,
  75689. bytes
  75690. });
  75691. return;
  75692. }
  75693. this.logger_("Received non QUOTA_EXCEEDED_ERR on append", error);
  75694. this.error(`${type2} append of ${bytes.length}b failed for segment #${segmentInfo.mediaIndex} in playlist ${segmentInfo.playlist.id}`);
  75695. this.trigger("appenderror");
  75696. }
  75697. appendToSourceBuffer_({
  75698. segmentInfo,
  75699. type: type2,
  75700. initSegment,
  75701. data,
  75702. bytes
  75703. }) {
  75704. if (!bytes) {
  75705. const segments = [data];
  75706. let byteLength = data.byteLength;
  75707. if (initSegment) {
  75708. segments.unshift(initSegment);
  75709. byteLength += initSegment.byteLength;
  75710. }
  75711. bytes = concatSegments$1({
  75712. bytes: byteLength,
  75713. segments
  75714. });
  75715. }
  75716. this.sourceUpdater_.appendBuffer({
  75717. segmentInfo,
  75718. type: type2,
  75719. bytes
  75720. }, this.handleAppendError_.bind(this, {
  75721. segmentInfo,
  75722. type: type2,
  75723. bytes
  75724. }));
  75725. }
  75726. handleSegmentTimingInfo_(type2, requestId, segmentTimingInfo) {
  75727. if (!this.pendingSegment_ || requestId !== this.pendingSegment_.requestId) {
  75728. return;
  75729. }
  75730. const segment = this.pendingSegment_.segment;
  75731. const timingInfoProperty = `${type2}TimingInfo`;
  75732. if (!segment[timingInfoProperty]) {
  75733. segment[timingInfoProperty] = {};
  75734. }
  75735. segment[timingInfoProperty].transmuxerPrependedSeconds = segmentTimingInfo.prependedContentDuration || 0;
  75736. segment[timingInfoProperty].transmuxedPresentationStart = segmentTimingInfo.start.presentation;
  75737. segment[timingInfoProperty].transmuxedDecodeStart = segmentTimingInfo.start.decode;
  75738. segment[timingInfoProperty].transmuxedPresentationEnd = segmentTimingInfo.end.presentation;
  75739. segment[timingInfoProperty].transmuxedDecodeEnd = segmentTimingInfo.end.decode;
  75740. segment[timingInfoProperty].baseMediaDecodeTime = segmentTimingInfo.baseMediaDecodeTime;
  75741. }
  75742. appendData_(segmentInfo, result) {
  75743. const {
  75744. type: type2,
  75745. data
  75746. } = result;
  75747. if (!data || !data.byteLength) {
  75748. return;
  75749. }
  75750. if (type2 === "audio" && this.audioDisabled_) {
  75751. return;
  75752. }
  75753. const initSegment = this.getInitSegmentAndUpdateState_({
  75754. type: type2,
  75755. initSegment: result.initSegment,
  75756. playlist: segmentInfo.playlist,
  75757. map: segmentInfo.isFmp4 ? segmentInfo.segment.map : null
  75758. });
  75759. this.appendToSourceBuffer_({
  75760. segmentInfo,
  75761. type: type2,
  75762. initSegment,
  75763. data
  75764. });
  75765. }
  75766. loadSegment_(segmentInfo) {
  75767. this.state = "WAITING";
  75768. this.pendingSegment_ = segmentInfo;
  75769. this.trimBackBuffer_(segmentInfo);
  75770. if (typeof segmentInfo.timestampOffset === "number") {
  75771. if (this.transmuxer_) {
  75772. this.transmuxer_.postMessage({
  75773. action: "clearAllMp4Captions"
  75774. });
  75775. }
  75776. }
  75777. if (!this.hasEnoughInfoToLoad_()) {
  75778. this.loadQueue_.push(() => {
  75779. const options2 = _extends$2({}, segmentInfo, {
  75780. forceTimestampOffset: true
  75781. });
  75782. _extends$2(segmentInfo, this.generateSegmentInfo_(options2));
  75783. this.isPendingTimestampOffset_ = false;
  75784. this.updateTransmuxerAndRequestSegment_(segmentInfo);
  75785. });
  75786. return;
  75787. }
  75788. this.updateTransmuxerAndRequestSegment_(segmentInfo);
  75789. }
  75790. updateTransmuxerAndRequestSegment_(segmentInfo) {
  75791. if (this.shouldUpdateTransmuxerTimestampOffset_(segmentInfo.timestampOffset)) {
  75792. this.gopBuffer_.length = 0;
  75793. segmentInfo.gopsToAlignWith = [];
  75794. this.timeMapping_ = 0;
  75795. this.transmuxer_.postMessage({
  75796. action: "reset"
  75797. });
  75798. this.transmuxer_.postMessage({
  75799. action: "setTimestampOffset",
  75800. timestampOffset: segmentInfo.timestampOffset
  75801. });
  75802. }
  75803. const simpleSegment = this.createSimplifiedSegmentObj_(segmentInfo);
  75804. const isEndOfStream = this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex);
  75805. const isWalkingForward = this.mediaIndex !== null;
  75806. const isDiscontinuity = segmentInfo.timeline !== this.currentTimeline_ && segmentInfo.timeline > 0;
  75807. const isEndOfTimeline = isEndOfStream || isWalkingForward && isDiscontinuity;
  75808. this.logger_(`Requesting ${segmentInfoString$1(segmentInfo)}`);
  75809. if (simpleSegment.map && !simpleSegment.map.bytes) {
  75810. this.logger_("going to request init segment.");
  75811. this.appendInitSegment_ = {
  75812. video: true,
  75813. audio: true
  75814. };
  75815. }
  75816. segmentInfo.abortRequests = mediaSegmentRequest$1({
  75817. xhr: this.vhs_.xhr,
  75818. xhrOptions: this.xhrOptions_,
  75819. decryptionWorker: this.decrypter_,
  75820. segment: simpleSegment,
  75821. abortFn: this.handleAbort_.bind(this, segmentInfo),
  75822. progressFn: this.handleProgress_.bind(this),
  75823. trackInfoFn: this.handleTrackInfo_.bind(this),
  75824. timingInfoFn: this.handleTimingInfo_.bind(this),
  75825. videoSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, "video", segmentInfo.requestId),
  75826. audioSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, "audio", segmentInfo.requestId),
  75827. captionsFn: this.handleCaptions_.bind(this),
  75828. isEndOfTimeline,
  75829. endedTimelineFn: () => {
  75830. this.logger_("received endedtimeline callback");
  75831. },
  75832. id3Fn: this.handleId3_.bind(this),
  75833. dataFn: this.handleData_.bind(this),
  75834. doneFn: this.segmentRequestFinished_.bind(this),
  75835. onTransmuxerLog: ({
  75836. message,
  75837. level,
  75838. stream
  75839. }) => {
  75840. this.logger_(`${segmentInfoString$1(segmentInfo)} logged from transmuxer stream ${stream} as a ${level}: ${message}`);
  75841. }
  75842. });
  75843. }
  75844. trimBackBuffer_(segmentInfo) {
  75845. const removeToTime = safeBackBufferTrimTime$1(this.seekable_(), this.currentTime_(), this.playlist_.targetDuration || 10);
  75846. if (removeToTime > 0) {
  75847. this.remove(0, removeToTime);
  75848. }
  75849. }
  75850. createSimplifiedSegmentObj_(segmentInfo) {
  75851. const segment = segmentInfo.segment;
  75852. const part = segmentInfo.part;
  75853. const simpleSegment = {
  75854. resolvedUri: part ? part.resolvedUri : segment.resolvedUri,
  75855. byterange: part ? part.byterange : segment.byterange,
  75856. requestId: segmentInfo.requestId,
  75857. transmuxer: segmentInfo.transmuxer,
  75858. audioAppendStart: segmentInfo.audioAppendStart,
  75859. gopsToAlignWith: segmentInfo.gopsToAlignWith,
  75860. part: segmentInfo.part
  75861. };
  75862. const previousSegment = segmentInfo.playlist.segments[segmentInfo.mediaIndex - 1];
  75863. if (previousSegment && previousSegment.timeline === segment.timeline) {
  75864. if (previousSegment.videoTimingInfo) {
  75865. simpleSegment.baseStartTime = previousSegment.videoTimingInfo.transmuxedDecodeEnd;
  75866. } else if (previousSegment.audioTimingInfo) {
  75867. simpleSegment.baseStartTime = previousSegment.audioTimingInfo.transmuxedDecodeEnd;
  75868. }
  75869. }
  75870. if (segment.key) {
  75871. const iv = segment.key.iv || new Uint32Array([0, 0, 0, segmentInfo.mediaIndex + segmentInfo.playlist.mediaSequence]);
  75872. simpleSegment.key = this.segmentKey(segment.key);
  75873. simpleSegment.key.iv = iv;
  75874. }
  75875. if (segment.map) {
  75876. simpleSegment.map = this.initSegmentForMap(segment.map);
  75877. }
  75878. return simpleSegment;
  75879. }
  75880. saveTransferStats_(stats) {
  75881. this.mediaRequests += 1;
  75882. if (stats) {
  75883. this.mediaBytesTransferred += stats.bytesReceived;
  75884. this.mediaTransferDuration += stats.roundTripTime;
  75885. }
  75886. }
  75887. saveBandwidthRelatedStats_(duration5, stats) {
  75888. this.pendingSegment_.byteLength = stats.bytesReceived;
  75889. if (duration5 < MIN_SEGMENT_DURATION_TO_SAVE_STATS$1) {
  75890. this.logger_(`Ignoring segment's bandwidth because its duration of ${duration5} is less than the min to record ${MIN_SEGMENT_DURATION_TO_SAVE_STATS$1}`);
  75891. return;
  75892. }
  75893. this.bandwidth = stats.bandwidth;
  75894. this.roundTrip = stats.roundTripTime;
  75895. }
  75896. handleTimeout_() {
  75897. this.mediaRequestsTimedout += 1;
  75898. this.bandwidth = 1;
  75899. this.roundTrip = NaN;
  75900. this.trigger("bandwidthupdate");
  75901. this.trigger("timeout");
  75902. }
  75903. segmentRequestFinished_(error, simpleSegment, result) {
  75904. if (this.callQueue_.length) {
  75905. this.callQueue_.push(this.segmentRequestFinished_.bind(this, error, simpleSegment, result));
  75906. return;
  75907. }
  75908. this.saveTransferStats_(simpleSegment.stats);
  75909. if (!this.pendingSegment_) {
  75910. return;
  75911. }
  75912. if (simpleSegment.requestId !== this.pendingSegment_.requestId) {
  75913. return;
  75914. }
  75915. if (error) {
  75916. this.pendingSegment_ = null;
  75917. this.state = "READY";
  75918. if (error.code === REQUEST_ERRORS$1.ABORTED) {
  75919. return;
  75920. }
  75921. this.pause();
  75922. if (error.code === REQUEST_ERRORS$1.TIMEOUT) {
  75923. this.handleTimeout_();
  75924. return;
  75925. }
  75926. this.mediaRequestsErrored += 1;
  75927. this.error(error);
  75928. this.trigger("error");
  75929. return;
  75930. }
  75931. const segmentInfo = this.pendingSegment_;
  75932. this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);
  75933. segmentInfo.endOfAllRequests = simpleSegment.endOfAllRequests;
  75934. if (result.gopInfo) {
  75935. this.gopBuffer_ = updateGopBuffer$1(this.gopBuffer_, result.gopInfo, this.safeAppend_);
  75936. }
  75937. this.state = "APPENDING";
  75938. this.trigger("appending");
  75939. this.waitForAppendsToComplete_(segmentInfo);
  75940. }
  75941. setTimeMapping_(timeline) {
  75942. const timelineMapping = this.syncController_.mappingForTimeline(timeline);
  75943. if (timelineMapping !== null) {
  75944. this.timeMapping_ = timelineMapping;
  75945. }
  75946. }
  75947. updateMediaSecondsLoaded_(segment) {
  75948. if (typeof segment.start === "number" && typeof segment.end === "number") {
  75949. this.mediaSecondsLoaded += segment.end - segment.start;
  75950. } else {
  75951. this.mediaSecondsLoaded += segment.duration;
  75952. }
  75953. }
  75954. shouldUpdateTransmuxerTimestampOffset_(timestampOffset2) {
  75955. if (timestampOffset2 === null) {
  75956. return false;
  75957. }
  75958. if (this.loaderType_ === "main" && timestampOffset2 !== this.sourceUpdater_.videoTimestampOffset()) {
  75959. return true;
  75960. }
  75961. if (!this.audioDisabled_ && timestampOffset2 !== this.sourceUpdater_.audioTimestampOffset()) {
  75962. return true;
  75963. }
  75964. return false;
  75965. }
  75966. trueSegmentStart_({
  75967. currentStart,
  75968. playlist,
  75969. mediaIndex,
  75970. firstVideoFrameTimeForData,
  75971. currentVideoTimestampOffset,
  75972. useVideoTimingInfo,
  75973. videoTimingInfo,
  75974. audioTimingInfo
  75975. }) {
  75976. if (typeof currentStart !== "undefined") {
  75977. return currentStart;
  75978. }
  75979. if (!useVideoTimingInfo) {
  75980. return audioTimingInfo.start;
  75981. }
  75982. const previousSegment = playlist.segments[mediaIndex - 1];
  75983. if (mediaIndex === 0 || !previousSegment || typeof previousSegment.start === "undefined" || previousSegment.end !== firstVideoFrameTimeForData + currentVideoTimestampOffset) {
  75984. return firstVideoFrameTimeForData;
  75985. }
  75986. return videoTimingInfo.start;
  75987. }
  75988. waitForAppendsToComplete_(segmentInfo) {
  75989. const trackInfo = this.getCurrentMediaInfo_(segmentInfo);
  75990. if (!trackInfo) {
  75991. this.error({
  75992. message: "No starting media returned, likely due to an unsupported media format.",
  75993. playlistExclusionDuration: Infinity
  75994. });
  75995. this.trigger("error");
  75996. return;
  75997. }
  75998. const {
  75999. hasAudio,
  76000. hasVideo,
  76001. isMuxed: isMuxed3
  76002. } = trackInfo;
  76003. const waitForVideo = this.loaderType_ === "main" && hasVideo;
  76004. const waitForAudio = !this.audioDisabled_ && hasAudio && !isMuxed3;
  76005. segmentInfo.waitingOnAppends = 0;
  76006. if (!segmentInfo.hasAppendedData_) {
  76007. if (!segmentInfo.timingInfo && typeof segmentInfo.timestampOffset === "number") {
  76008. this.isPendingTimestampOffset_ = true;
  76009. }
  76010. segmentInfo.timingInfo = {
  76011. start: 0
  76012. };
  76013. segmentInfo.waitingOnAppends++;
  76014. if (!this.isPendingTimestampOffset_) {
  76015. this.updateSourceBufferTimestampOffset_(segmentInfo);
  76016. this.processMetadataQueue_();
  76017. }
  76018. this.checkAppendsDone_(segmentInfo);
  76019. return;
  76020. }
  76021. if (waitForVideo) {
  76022. segmentInfo.waitingOnAppends++;
  76023. }
  76024. if (waitForAudio) {
  76025. segmentInfo.waitingOnAppends++;
  76026. }
  76027. if (waitForVideo) {
  76028. this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));
  76029. }
  76030. if (waitForAudio) {
  76031. this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));
  76032. }
  76033. }
  76034. checkAppendsDone_(segmentInfo) {
  76035. if (this.checkForAbort_(segmentInfo.requestId)) {
  76036. return;
  76037. }
  76038. segmentInfo.waitingOnAppends--;
  76039. if (segmentInfo.waitingOnAppends === 0) {
  76040. this.handleAppendsDone_();
  76041. }
  76042. }
  76043. checkForIllegalMediaSwitch(trackInfo) {
  76044. const illegalMediaSwitchError = illegalMediaSwitch$1(this.loaderType_, this.getCurrentMediaInfo_(), trackInfo);
  76045. if (illegalMediaSwitchError) {
  76046. this.error({
  76047. message: illegalMediaSwitchError,
  76048. playlistExclusionDuration: Infinity
  76049. });
  76050. this.trigger("error");
  76051. return true;
  76052. }
  76053. return false;
  76054. }
  76055. updateSourceBufferTimestampOffset_(segmentInfo) {
  76056. if (segmentInfo.timestampOffset === null || typeof segmentInfo.timingInfo.start !== "number" || segmentInfo.changedTimestampOffset || this.loaderType_ !== "main") {
  76057. return;
  76058. }
  76059. let didChange = false;
  76060. segmentInfo.timestampOffset -= this.getSegmentStartTimeForTimestampOffsetCalculation_({
  76061. videoTimingInfo: segmentInfo.segment.videoTimingInfo,
  76062. audioTimingInfo: segmentInfo.segment.audioTimingInfo,
  76063. timingInfo: segmentInfo.timingInfo
  76064. });
  76065. segmentInfo.changedTimestampOffset = true;
  76066. if (segmentInfo.timestampOffset !== this.sourceUpdater_.videoTimestampOffset()) {
  76067. this.sourceUpdater_.videoTimestampOffset(segmentInfo.timestampOffset);
  76068. didChange = true;
  76069. }
  76070. if (segmentInfo.timestampOffset !== this.sourceUpdater_.audioTimestampOffset()) {
  76071. this.sourceUpdater_.audioTimestampOffset(segmentInfo.timestampOffset);
  76072. didChange = true;
  76073. }
  76074. if (didChange) {
  76075. this.trigger("timestampoffset");
  76076. }
  76077. }
  76078. getSegmentStartTimeForTimestampOffsetCalculation_({
  76079. videoTimingInfo,
  76080. audioTimingInfo,
  76081. timingInfo
  76082. }) {
  76083. if (!this.useDtsForTimestampOffset_) {
  76084. return timingInfo.start;
  76085. }
  76086. if (videoTimingInfo && typeof videoTimingInfo.transmuxedDecodeStart === "number") {
  76087. return videoTimingInfo.transmuxedDecodeStart;
  76088. }
  76089. if (audioTimingInfo && typeof audioTimingInfo.transmuxedDecodeStart === "number") {
  76090. return audioTimingInfo.transmuxedDecodeStart;
  76091. }
  76092. return timingInfo.start;
  76093. }
  76094. updateTimingInfoEnd_(segmentInfo) {
  76095. segmentInfo.timingInfo = segmentInfo.timingInfo || {};
  76096. const trackInfo = this.getMediaInfo_();
  76097. const useVideoTimingInfo = this.loaderType_ === "main" && trackInfo && trackInfo.hasVideo;
  76098. const prioritizedTimingInfo = useVideoTimingInfo && segmentInfo.videoTimingInfo ? segmentInfo.videoTimingInfo : segmentInfo.audioTimingInfo;
  76099. if (!prioritizedTimingInfo) {
  76100. return;
  76101. }
  76102. segmentInfo.timingInfo.end = typeof prioritizedTimingInfo.end === "number" ? prioritizedTimingInfo.end : prioritizedTimingInfo.start + segmentInfo.duration;
  76103. }
  76104. handleAppendsDone_() {
  76105. if (this.pendingSegment_) {
  76106. this.trigger("appendsdone");
  76107. }
  76108. if (!this.pendingSegment_) {
  76109. this.state = "READY";
  76110. if (!this.paused()) {
  76111. this.monitorBuffer_();
  76112. }
  76113. return;
  76114. }
  76115. const segmentInfo = this.pendingSegment_;
  76116. this.updateTimingInfoEnd_(segmentInfo);
  76117. if (this.shouldSaveSegmentTimingInfo_) {
  76118. this.syncController_.saveSegmentTimingInfo({
  76119. segmentInfo,
  76120. shouldSaveTimelineMapping: this.loaderType_ === "main"
  76121. });
  76122. }
  76123. const segmentDurationMessage = getTroublesomeSegmentDurationMessage$1(segmentInfo, this.sourceType_);
  76124. if (segmentDurationMessage) {
  76125. if (segmentDurationMessage.severity === "warn") {
  76126. videojs$2.log.warn(segmentDurationMessage.message);
  76127. } else {
  76128. this.logger_(segmentDurationMessage.message);
  76129. }
  76130. }
  76131. this.recordThroughput_(segmentInfo);
  76132. this.pendingSegment_ = null;
  76133. this.state = "READY";
  76134. if (segmentInfo.isSyncRequest) {
  76135. this.trigger("syncinfoupdate");
  76136. if (!segmentInfo.hasAppendedData_) {
  76137. this.logger_(`Throwing away un-appended sync request ${segmentInfoString$1(segmentInfo)}`);
  76138. return;
  76139. }
  76140. }
  76141. this.logger_(`Appended ${segmentInfoString$1(segmentInfo)}`);
  76142. this.addSegmentMetadataCue_(segmentInfo);
  76143. this.fetchAtBuffer_ = true;
  76144. if (this.currentTimeline_ !== segmentInfo.timeline) {
  76145. this.timelineChangeController_.lastTimelineChange({
  76146. type: this.loaderType_,
  76147. from: this.currentTimeline_,
  76148. to: segmentInfo.timeline
  76149. });
  76150. if (this.loaderType_ === "main" && !this.audioDisabled_) {
  76151. this.timelineChangeController_.lastTimelineChange({
  76152. type: "audio",
  76153. from: this.currentTimeline_,
  76154. to: segmentInfo.timeline
  76155. });
  76156. }
  76157. }
  76158. this.currentTimeline_ = segmentInfo.timeline;
  76159. this.trigger("syncinfoupdate");
  76160. const segment = segmentInfo.segment;
  76161. const part = segmentInfo.part;
  76162. const badSegmentGuess = segment.end && this.currentTime_() - segment.end > segmentInfo.playlist.targetDuration * 3;
  76163. const badPartGuess = part && part.end && this.currentTime_() - part.end > segmentInfo.playlist.partTargetDuration * 3;
  76164. if (badSegmentGuess || badPartGuess) {
  76165. this.logger_(`bad ${badSegmentGuess ? "segment" : "part"} ${segmentInfoString$1(segmentInfo)}`);
  76166. this.resetEverything();
  76167. return;
  76168. }
  76169. const isWalkingForward = this.mediaIndex !== null;
  76170. if (isWalkingForward) {
  76171. this.trigger("bandwidthupdate");
  76172. }
  76173. this.trigger("progress");
  76174. this.mediaIndex = segmentInfo.mediaIndex;
  76175. this.partIndex = segmentInfo.partIndex;
  76176. if (this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex)) {
  76177. this.endOfStream();
  76178. }
  76179. this.trigger("appended");
  76180. if (segmentInfo.hasAppendedData_) {
  76181. this.mediaAppends++;
  76182. }
  76183. if (!this.paused()) {
  76184. this.monitorBuffer_();
  76185. }
  76186. }
  76187. recordThroughput_(segmentInfo) {
  76188. if (segmentInfo.duration < MIN_SEGMENT_DURATION_TO_SAVE_STATS$1) {
  76189. this.logger_(`Ignoring segment's throughput because its duration of ${segmentInfo.duration} is less than the min to record ${MIN_SEGMENT_DURATION_TO_SAVE_STATS$1}`);
  76190. return;
  76191. }
  76192. const rate = this.throughput.rate;
  76193. const segmentProcessingTime = Date.now() - segmentInfo.endOfAllRequests + 1;
  76194. const segmentProcessingThroughput = Math.floor(segmentInfo.byteLength / segmentProcessingTime * 8 * 1e3);
  76195. this.throughput.rate += (segmentProcessingThroughput - rate) / ++this.throughput.count;
  76196. }
  76197. addSegmentMetadataCue_(segmentInfo) {
  76198. if (!this.segmentMetadataTrack_) {
  76199. return;
  76200. }
  76201. const segment = segmentInfo.segment;
  76202. const start2 = segment.start;
  76203. const end = segment.end;
  76204. if (!finite$1(start2) || !finite$1(end)) {
  76205. return;
  76206. }
  76207. removeCuesFromTrack$1(start2, end, this.segmentMetadataTrack_);
  76208. const Cue = window_1.WebKitDataCue || window_1.VTTCue;
  76209. const value = {
  76210. custom: segment.custom,
  76211. dateTimeObject: segment.dateTimeObject,
  76212. dateTimeString: segment.dateTimeString,
  76213. bandwidth: segmentInfo.playlist.attributes.BANDWIDTH,
  76214. resolution: segmentInfo.playlist.attributes.RESOLUTION,
  76215. codecs: segmentInfo.playlist.attributes.CODECS,
  76216. byteLength: segmentInfo.byteLength,
  76217. uri: segmentInfo.uri,
  76218. timeline: segmentInfo.timeline,
  76219. playlist: segmentInfo.playlist.id,
  76220. start: start2,
  76221. end
  76222. };
  76223. const data = JSON.stringify(value);
  76224. const cue = new Cue(start2, end, data);
  76225. cue.value = value;
  76226. this.segmentMetadataTrack_.addCue(cue);
  76227. }
  76228. }
  76229. function noop$1() {
  76230. }
  76231. const toTitleCase$2 = function(string) {
  76232. if (typeof string !== "string") {
  76233. return string;
  76234. }
  76235. return string.replace(/./, (w) => w.toUpperCase());
  76236. };
  76237. const bufferTypes$1 = ["video", "audio"];
  76238. const updating = (type2, sourceUpdater) => {
  76239. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76240. return sourceBuffer && sourceBuffer.updating || sourceUpdater.queuePending[type2];
  76241. };
  76242. const nextQueueIndexOfType$1 = (type2, queue) => {
  76243. for (let i2 = 0; i2 < queue.length; i2++) {
  76244. const queueEntry = queue[i2];
  76245. if (queueEntry.type === "mediaSource") {
  76246. return null;
  76247. }
  76248. if (queueEntry.type === type2) {
  76249. return i2;
  76250. }
  76251. }
  76252. return null;
  76253. };
  76254. const shiftQueue$1 = (type2, sourceUpdater) => {
  76255. if (sourceUpdater.queue.length === 0) {
  76256. return;
  76257. }
  76258. let queueIndex = 0;
  76259. let queueEntry = sourceUpdater.queue[queueIndex];
  76260. if (queueEntry.type === "mediaSource") {
  76261. if (!sourceUpdater.updating() && sourceUpdater.mediaSource.readyState !== "closed") {
  76262. sourceUpdater.queue.shift();
  76263. queueEntry.action(sourceUpdater);
  76264. if (queueEntry.doneFn) {
  76265. queueEntry.doneFn();
  76266. }
  76267. shiftQueue$1("audio", sourceUpdater);
  76268. shiftQueue$1("video", sourceUpdater);
  76269. }
  76270. return;
  76271. }
  76272. if (type2 === "mediaSource") {
  76273. return;
  76274. }
  76275. if (!sourceUpdater.ready() || sourceUpdater.mediaSource.readyState === "closed" || updating(type2, sourceUpdater)) {
  76276. return;
  76277. }
  76278. if (queueEntry.type !== type2) {
  76279. queueIndex = nextQueueIndexOfType$1(type2, sourceUpdater.queue);
  76280. if (queueIndex === null) {
  76281. return;
  76282. }
  76283. queueEntry = sourceUpdater.queue[queueIndex];
  76284. }
  76285. sourceUpdater.queue.splice(queueIndex, 1);
  76286. sourceUpdater.queuePending[type2] = queueEntry;
  76287. queueEntry.action(type2, sourceUpdater);
  76288. if (!queueEntry.doneFn) {
  76289. sourceUpdater.queuePending[type2] = null;
  76290. shiftQueue$1(type2, sourceUpdater);
  76291. return;
  76292. }
  76293. };
  76294. const cleanupBuffer$1 = (type2, sourceUpdater) => {
  76295. const buffer = sourceUpdater[`${type2}Buffer`];
  76296. const titleType = toTitleCase$2(type2);
  76297. if (!buffer) {
  76298. return;
  76299. }
  76300. buffer.removeEventListener("updateend", sourceUpdater[`on${titleType}UpdateEnd_`]);
  76301. buffer.removeEventListener("error", sourceUpdater[`on${titleType}Error_`]);
  76302. sourceUpdater.codecs[type2] = null;
  76303. sourceUpdater[`${type2}Buffer`] = null;
  76304. };
  76305. const inSourceBuffers$1 = (mediaSource, sourceBuffer) => mediaSource && sourceBuffer && Array.prototype.indexOf.call(mediaSource.sourceBuffers, sourceBuffer) !== -1;
  76306. const actions$1 = {
  76307. appendBuffer: (bytes, segmentInfo, onError2) => (type2, sourceUpdater) => {
  76308. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76309. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76310. return;
  76311. }
  76312. sourceUpdater.logger_(`Appending segment ${segmentInfo.mediaIndex}'s ${bytes.length} bytes to ${type2}Buffer`);
  76313. try {
  76314. sourceBuffer.appendBuffer(bytes);
  76315. } catch (e) {
  76316. sourceUpdater.logger_(`Error with code ${e.code} ` + (e.code === QUOTA_EXCEEDED_ERR$1 ? "(QUOTA_EXCEEDED_ERR) " : "") + `when appending segment ${segmentInfo.mediaIndex} to ${type2}Buffer`);
  76317. sourceUpdater.queuePending[type2] = null;
  76318. onError2(e);
  76319. }
  76320. },
  76321. remove: (start2, end) => (type2, sourceUpdater) => {
  76322. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76323. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76324. return;
  76325. }
  76326. sourceUpdater.logger_(`Removing ${start2} to ${end} from ${type2}Buffer`);
  76327. try {
  76328. sourceBuffer.remove(start2, end);
  76329. } catch (e) {
  76330. sourceUpdater.logger_(`Remove ${start2} to ${end} from ${type2}Buffer failed`);
  76331. }
  76332. },
  76333. timestampOffset: (offset) => (type2, sourceUpdater) => {
  76334. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76335. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76336. return;
  76337. }
  76338. sourceUpdater.logger_(`Setting ${type2}timestampOffset to ${offset}`);
  76339. sourceBuffer.timestampOffset = offset;
  76340. },
  76341. callback: (callback2) => (type2, sourceUpdater) => {
  76342. callback2();
  76343. },
  76344. endOfStream: (error) => (sourceUpdater) => {
  76345. if (sourceUpdater.mediaSource.readyState !== "open") {
  76346. return;
  76347. }
  76348. sourceUpdater.logger_(`Calling mediaSource endOfStream(${error || ""})`);
  76349. try {
  76350. sourceUpdater.mediaSource.endOfStream(error);
  76351. } catch (e) {
  76352. videojs$2.log.warn("Failed to call media source endOfStream", e);
  76353. }
  76354. },
  76355. duration: (duration5) => (sourceUpdater) => {
  76356. sourceUpdater.logger_(`Setting mediaSource duration to ${duration5}`);
  76357. try {
  76358. sourceUpdater.mediaSource.duration = duration5;
  76359. } catch (e) {
  76360. videojs$2.log.warn("Failed to set media source duration", e);
  76361. }
  76362. },
  76363. abort: () => (type2, sourceUpdater) => {
  76364. if (sourceUpdater.mediaSource.readyState !== "open") {
  76365. return;
  76366. }
  76367. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76368. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76369. return;
  76370. }
  76371. sourceUpdater.logger_(`calling abort on ${type2}Buffer`);
  76372. try {
  76373. sourceBuffer.abort();
  76374. } catch (e) {
  76375. videojs$2.log.warn(`Failed to abort on ${type2}Buffer`, e);
  76376. }
  76377. },
  76378. addSourceBuffer: (type2, codec) => (sourceUpdater) => {
  76379. const titleType = toTitleCase$2(type2);
  76380. const mime = getMimeForCodec$1(codec);
  76381. sourceUpdater.logger_(`Adding ${type2}Buffer with codec ${codec} to mediaSource`);
  76382. const sourceBuffer = sourceUpdater.mediaSource.addSourceBuffer(mime);
  76383. sourceBuffer.addEventListener("updateend", sourceUpdater[`on${titleType}UpdateEnd_`]);
  76384. sourceBuffer.addEventListener("error", sourceUpdater[`on${titleType}Error_`]);
  76385. sourceUpdater.codecs[type2] = codec;
  76386. sourceUpdater[`${type2}Buffer`] = sourceBuffer;
  76387. },
  76388. removeSourceBuffer: (type2) => (sourceUpdater) => {
  76389. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76390. cleanupBuffer$1(type2, sourceUpdater);
  76391. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76392. return;
  76393. }
  76394. sourceUpdater.logger_(`Removing ${type2}Buffer with codec ${sourceUpdater.codecs[type2]} from mediaSource`);
  76395. try {
  76396. sourceUpdater.mediaSource.removeSourceBuffer(sourceBuffer);
  76397. } catch (e) {
  76398. videojs$2.log.warn(`Failed to removeSourceBuffer ${type2}Buffer`, e);
  76399. }
  76400. },
  76401. changeType: (codec) => (type2, sourceUpdater) => {
  76402. const sourceBuffer = sourceUpdater[`${type2}Buffer`];
  76403. const mime = getMimeForCodec$1(codec);
  76404. if (!inSourceBuffers$1(sourceUpdater.mediaSource, sourceBuffer)) {
  76405. return;
  76406. }
  76407. if (sourceUpdater.codecs[type2] === codec) {
  76408. return;
  76409. }
  76410. sourceUpdater.logger_(`changing ${type2}Buffer codec from ${sourceUpdater.codecs[type2]} to ${codec}`);
  76411. sourceBuffer.changeType(mime);
  76412. sourceUpdater.codecs[type2] = codec;
  76413. }
  76414. };
  76415. const pushQueue$1 = ({
  76416. type: type2,
  76417. sourceUpdater,
  76418. action,
  76419. doneFn,
  76420. name
  76421. }) => {
  76422. sourceUpdater.queue.push({
  76423. type: type2,
  76424. action,
  76425. doneFn,
  76426. name
  76427. });
  76428. shiftQueue$1(type2, sourceUpdater);
  76429. };
  76430. const onUpdateend$1 = (type2, sourceUpdater) => (e) => {
  76431. if (sourceUpdater.queuePending[type2]) {
  76432. const doneFn = sourceUpdater.queuePending[type2].doneFn;
  76433. sourceUpdater.queuePending[type2] = null;
  76434. if (doneFn) {
  76435. doneFn(sourceUpdater[`${type2}Error_`]);
  76436. }
  76437. }
  76438. shiftQueue$1(type2, sourceUpdater);
  76439. };
  76440. class SourceUpdater$1 extends videojs$2.EventTarget {
  76441. constructor(mediaSource) {
  76442. super();
  76443. this.mediaSource = mediaSource;
  76444. this.sourceopenListener_ = () => shiftQueue$1("mediaSource", this);
  76445. this.mediaSource.addEventListener("sourceopen", this.sourceopenListener_);
  76446. this.logger_ = logger$1("SourceUpdater");
  76447. this.audioTimestampOffset_ = 0;
  76448. this.videoTimestampOffset_ = 0;
  76449. this.queue = [];
  76450. this.queuePending = {
  76451. audio: null,
  76452. video: null
  76453. };
  76454. this.delayedAudioAppendQueue_ = [];
  76455. this.videoAppendQueued_ = false;
  76456. this.codecs = {};
  76457. this.onVideoUpdateEnd_ = onUpdateend$1("video", this);
  76458. this.onAudioUpdateEnd_ = onUpdateend$1("audio", this);
  76459. this.onVideoError_ = (e) => {
  76460. this.videoError_ = e;
  76461. };
  76462. this.onAudioError_ = (e) => {
  76463. this.audioError_ = e;
  76464. };
  76465. this.createdSourceBuffers_ = false;
  76466. this.initializedEme_ = false;
  76467. this.triggeredReady_ = false;
  76468. }
  76469. initializedEme() {
  76470. this.initializedEme_ = true;
  76471. this.triggerReady();
  76472. }
  76473. hasCreatedSourceBuffers() {
  76474. return this.createdSourceBuffers_;
  76475. }
  76476. hasInitializedAnyEme() {
  76477. return this.initializedEme_;
  76478. }
  76479. ready() {
  76480. return this.hasCreatedSourceBuffers() && this.hasInitializedAnyEme();
  76481. }
  76482. createSourceBuffers(codecs) {
  76483. if (this.hasCreatedSourceBuffers()) {
  76484. return;
  76485. }
  76486. this.addOrChangeSourceBuffers(codecs);
  76487. this.createdSourceBuffers_ = true;
  76488. this.trigger("createdsourcebuffers");
  76489. this.triggerReady();
  76490. }
  76491. triggerReady() {
  76492. if (this.ready() && !this.triggeredReady_) {
  76493. this.triggeredReady_ = true;
  76494. this.trigger("ready");
  76495. }
  76496. }
  76497. addSourceBuffer(type2, codec) {
  76498. pushQueue$1({
  76499. type: "mediaSource",
  76500. sourceUpdater: this,
  76501. action: actions$1.addSourceBuffer(type2, codec),
  76502. name: "addSourceBuffer"
  76503. });
  76504. }
  76505. abort(type2) {
  76506. pushQueue$1({
  76507. type: type2,
  76508. sourceUpdater: this,
  76509. action: actions$1.abort(type2),
  76510. name: "abort"
  76511. });
  76512. }
  76513. removeSourceBuffer(type2) {
  76514. if (!this.canRemoveSourceBuffer()) {
  76515. videojs$2.log.error("removeSourceBuffer is not supported!");
  76516. return;
  76517. }
  76518. pushQueue$1({
  76519. type: "mediaSource",
  76520. sourceUpdater: this,
  76521. action: actions$1.removeSourceBuffer(type2),
  76522. name: "removeSourceBuffer"
  76523. });
  76524. }
  76525. canRemoveSourceBuffer() {
  76526. return !videojs$2.browser.IE_VERSION && !videojs$2.browser.IS_FIREFOX && window_1.MediaSource && window_1.MediaSource.prototype && typeof window_1.MediaSource.prototype.removeSourceBuffer === "function";
  76527. }
  76528. static canChangeType() {
  76529. return window_1.SourceBuffer && window_1.SourceBuffer.prototype && typeof window_1.SourceBuffer.prototype.changeType === "function";
  76530. }
  76531. canChangeType() {
  76532. return this.constructor.canChangeType();
  76533. }
  76534. changeType(type2, codec) {
  76535. if (!this.canChangeType()) {
  76536. videojs$2.log.error("changeType is not supported!");
  76537. return;
  76538. }
  76539. pushQueue$1({
  76540. type: type2,
  76541. sourceUpdater: this,
  76542. action: actions$1.changeType(codec),
  76543. name: "changeType"
  76544. });
  76545. }
  76546. addOrChangeSourceBuffers(codecs) {
  76547. if (!codecs || typeof codecs !== "object" || Object.keys(codecs).length === 0) {
  76548. throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");
  76549. }
  76550. Object.keys(codecs).forEach((type2) => {
  76551. const codec = codecs[type2];
  76552. if (!this.hasCreatedSourceBuffers()) {
  76553. return this.addSourceBuffer(type2, codec);
  76554. }
  76555. if (this.canChangeType()) {
  76556. this.changeType(type2, codec);
  76557. }
  76558. });
  76559. }
  76560. appendBuffer(options2, doneFn) {
  76561. const {
  76562. segmentInfo,
  76563. type: type2,
  76564. bytes
  76565. } = options2;
  76566. this.processedAppend_ = true;
  76567. if (type2 === "audio" && this.videoBuffer && !this.videoAppendQueued_) {
  76568. this.delayedAudioAppendQueue_.push([options2, doneFn]);
  76569. this.logger_(`delayed audio append of ${bytes.length} until video append`);
  76570. return;
  76571. }
  76572. const onError2 = doneFn;
  76573. pushQueue$1({
  76574. type: type2,
  76575. sourceUpdater: this,
  76576. action: actions$1.appendBuffer(bytes, segmentInfo || {
  76577. mediaIndex: -1
  76578. }, onError2),
  76579. doneFn,
  76580. name: "appendBuffer"
  76581. });
  76582. if (type2 === "video") {
  76583. this.videoAppendQueued_ = true;
  76584. if (!this.delayedAudioAppendQueue_.length) {
  76585. return;
  76586. }
  76587. const queue = this.delayedAudioAppendQueue_.slice();
  76588. this.logger_(`queuing delayed audio ${queue.length} appendBuffers`);
  76589. this.delayedAudioAppendQueue_.length = 0;
  76590. queue.forEach((que) => {
  76591. this.appendBuffer.apply(this, que);
  76592. });
  76593. }
  76594. }
  76595. audioBuffered() {
  76596. if (!inSourceBuffers$1(this.mediaSource, this.audioBuffer)) {
  76597. return createTimeRanges$2();
  76598. }
  76599. return this.audioBuffer.buffered ? this.audioBuffer.buffered : createTimeRanges$2();
  76600. }
  76601. videoBuffered() {
  76602. if (!inSourceBuffers$1(this.mediaSource, this.videoBuffer)) {
  76603. return createTimeRanges$2();
  76604. }
  76605. return this.videoBuffer.buffered ? this.videoBuffer.buffered : createTimeRanges$2();
  76606. }
  76607. buffered() {
  76608. const video = inSourceBuffers$1(this.mediaSource, this.videoBuffer) ? this.videoBuffer : null;
  76609. const audio = inSourceBuffers$1(this.mediaSource, this.audioBuffer) ? this.audioBuffer : null;
  76610. if (audio && !video) {
  76611. return this.audioBuffered();
  76612. }
  76613. if (video && !audio) {
  76614. return this.videoBuffered();
  76615. }
  76616. return bufferIntersection$1(this.audioBuffered(), this.videoBuffered());
  76617. }
  76618. setDuration(duration5, doneFn = noop$1) {
  76619. pushQueue$1({
  76620. type: "mediaSource",
  76621. sourceUpdater: this,
  76622. action: actions$1.duration(duration5),
  76623. name: "duration",
  76624. doneFn
  76625. });
  76626. }
  76627. endOfStream(error = null, doneFn = noop$1) {
  76628. if (typeof error !== "string") {
  76629. error = void 0;
  76630. }
  76631. pushQueue$1({
  76632. type: "mediaSource",
  76633. sourceUpdater: this,
  76634. action: actions$1.endOfStream(error),
  76635. name: "endOfStream",
  76636. doneFn
  76637. });
  76638. }
  76639. removeAudio(start2, end, done = noop$1) {
  76640. if (!this.audioBuffered().length || this.audioBuffered().end(0) === 0) {
  76641. done();
  76642. return;
  76643. }
  76644. pushQueue$1({
  76645. type: "audio",
  76646. sourceUpdater: this,
  76647. action: actions$1.remove(start2, end),
  76648. doneFn: done,
  76649. name: "remove"
  76650. });
  76651. }
  76652. removeVideo(start2, end, done = noop$1) {
  76653. if (!this.videoBuffered().length || this.videoBuffered().end(0) === 0) {
  76654. done();
  76655. return;
  76656. }
  76657. pushQueue$1({
  76658. type: "video",
  76659. sourceUpdater: this,
  76660. action: actions$1.remove(start2, end),
  76661. doneFn: done,
  76662. name: "remove"
  76663. });
  76664. }
  76665. updating() {
  76666. if (updating("audio", this) || updating("video", this)) {
  76667. return true;
  76668. }
  76669. return false;
  76670. }
  76671. audioTimestampOffset(offset) {
  76672. if (typeof offset !== "undefined" && this.audioBuffer && this.audioTimestampOffset_ !== offset) {
  76673. pushQueue$1({
  76674. type: "audio",
  76675. sourceUpdater: this,
  76676. action: actions$1.timestampOffset(offset),
  76677. name: "timestampOffset"
  76678. });
  76679. this.audioTimestampOffset_ = offset;
  76680. }
  76681. return this.audioTimestampOffset_;
  76682. }
  76683. videoTimestampOffset(offset) {
  76684. if (typeof offset !== "undefined" && this.videoBuffer && this.videoTimestampOffset !== offset) {
  76685. pushQueue$1({
  76686. type: "video",
  76687. sourceUpdater: this,
  76688. action: actions$1.timestampOffset(offset),
  76689. name: "timestampOffset"
  76690. });
  76691. this.videoTimestampOffset_ = offset;
  76692. }
  76693. return this.videoTimestampOffset_;
  76694. }
  76695. audioQueueCallback(callback2) {
  76696. if (!this.audioBuffer) {
  76697. return;
  76698. }
  76699. pushQueue$1({
  76700. type: "audio",
  76701. sourceUpdater: this,
  76702. action: actions$1.callback(callback2),
  76703. name: "callback"
  76704. });
  76705. }
  76706. videoQueueCallback(callback2) {
  76707. if (!this.videoBuffer) {
  76708. return;
  76709. }
  76710. pushQueue$1({
  76711. type: "video",
  76712. sourceUpdater: this,
  76713. action: actions$1.callback(callback2),
  76714. name: "callback"
  76715. });
  76716. }
  76717. dispose() {
  76718. this.trigger("dispose");
  76719. bufferTypes$1.forEach((type2) => {
  76720. this.abort(type2);
  76721. if (this.canRemoveSourceBuffer()) {
  76722. this.removeSourceBuffer(type2);
  76723. } else {
  76724. this[`${type2}QueueCallback`](() => cleanupBuffer$1(type2, this));
  76725. }
  76726. });
  76727. this.videoAppendQueued_ = false;
  76728. this.delayedAudioAppendQueue_.length = 0;
  76729. if (this.sourceopenListener_) {
  76730. this.mediaSource.removeEventListener("sourceopen", this.sourceopenListener_);
  76731. }
  76732. this.off();
  76733. }
  76734. }
  76735. const uint8ToUtf8$1 = (uintArray) => decodeURIComponent(escape(String.fromCharCode.apply(null, uintArray)));
  76736. const VTT_LINE_TERMINATORS$1 = new Uint8Array("\n\n".split("").map((char) => char.charCodeAt(0)));
  76737. class NoVttJsError$1 extends Error {
  76738. constructor() {
  76739. super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.");
  76740. }
  76741. }
  76742. class VTTSegmentLoader$1 extends SegmentLoader$1 {
  76743. constructor(settings, options2 = {}) {
  76744. super(settings, options2);
  76745. this.mediaSource_ = null;
  76746. this.subtitlesTrack_ = null;
  76747. this.loaderType_ = "subtitle";
  76748. this.featuresNativeTextTracks_ = settings.featuresNativeTextTracks;
  76749. this.loadVttJs = settings.loadVttJs;
  76750. this.shouldSaveSegmentTimingInfo_ = false;
  76751. }
  76752. createTransmuxer_() {
  76753. return null;
  76754. }
  76755. buffered_() {
  76756. if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues || !this.subtitlesTrack_.cues.length) {
  76757. return createTimeRanges$2();
  76758. }
  76759. const cues = this.subtitlesTrack_.cues;
  76760. const start2 = cues[0].startTime;
  76761. const end = cues[cues.length - 1].startTime;
  76762. return createTimeRanges$2([[start2, end]]);
  76763. }
  76764. initSegmentForMap(map, set4 = false) {
  76765. if (!map) {
  76766. return null;
  76767. }
  76768. const id = initSegmentId$1(map);
  76769. let storedMap = this.initSegments_[id];
  76770. if (set4 && !storedMap && map.bytes) {
  76771. const combinedByteLength = VTT_LINE_TERMINATORS$1.byteLength + map.bytes.byteLength;
  76772. const combinedSegment = new Uint8Array(combinedByteLength);
  76773. combinedSegment.set(map.bytes);
  76774. combinedSegment.set(VTT_LINE_TERMINATORS$1, map.bytes.byteLength);
  76775. this.initSegments_[id] = storedMap = {
  76776. resolvedUri: map.resolvedUri,
  76777. byterange: map.byterange,
  76778. bytes: combinedSegment
  76779. };
  76780. }
  76781. return storedMap || map;
  76782. }
  76783. couldBeginLoading_() {
  76784. return this.playlist_ && this.subtitlesTrack_ && !this.paused();
  76785. }
  76786. init_() {
  76787. this.state = "READY";
  76788. this.resetEverything();
  76789. return this.monitorBuffer_();
  76790. }
  76791. track(track) {
  76792. if (typeof track === "undefined") {
  76793. return this.subtitlesTrack_;
  76794. }
  76795. this.subtitlesTrack_ = track;
  76796. if (this.state === "INIT" && this.couldBeginLoading_()) {
  76797. this.init_();
  76798. }
  76799. return this.subtitlesTrack_;
  76800. }
  76801. remove(start2, end) {
  76802. removeCuesFromTrack$1(start2, end, this.subtitlesTrack_);
  76803. }
  76804. fillBuffer_() {
  76805. const segmentInfo = this.chooseNextRequest_();
  76806. if (!segmentInfo) {
  76807. return;
  76808. }
  76809. if (this.syncController_.timestampOffsetForTimeline(segmentInfo.timeline) === null) {
  76810. const checkTimestampOffset = () => {
  76811. this.state = "READY";
  76812. if (!this.paused()) {
  76813. this.monitorBuffer_();
  76814. }
  76815. };
  76816. this.syncController_.one("timestampoffset", checkTimestampOffset);
  76817. this.state = "WAITING_ON_TIMELINE";
  76818. return;
  76819. }
  76820. this.loadSegment_(segmentInfo);
  76821. }
  76822. timestampOffsetForSegment_() {
  76823. return null;
  76824. }
  76825. chooseNextRequest_() {
  76826. return this.skipEmptySegments_(super.chooseNextRequest_());
  76827. }
  76828. skipEmptySegments_(segmentInfo) {
  76829. while (segmentInfo && segmentInfo.segment.empty) {
  76830. if (segmentInfo.mediaIndex + 1 >= segmentInfo.playlist.segments.length) {
  76831. segmentInfo = null;
  76832. break;
  76833. }
  76834. segmentInfo = this.generateSegmentInfo_({
  76835. playlist: segmentInfo.playlist,
  76836. mediaIndex: segmentInfo.mediaIndex + 1,
  76837. startOfSegment: segmentInfo.startOfSegment + segmentInfo.duration,
  76838. isSyncRequest: segmentInfo.isSyncRequest
  76839. });
  76840. }
  76841. return segmentInfo;
  76842. }
  76843. stopForError(error) {
  76844. this.error(error);
  76845. this.state = "READY";
  76846. this.pause();
  76847. this.trigger("error");
  76848. }
  76849. segmentRequestFinished_(error, simpleSegment, result) {
  76850. if (!this.subtitlesTrack_) {
  76851. this.state = "READY";
  76852. return;
  76853. }
  76854. this.saveTransferStats_(simpleSegment.stats);
  76855. if (!this.pendingSegment_) {
  76856. this.state = "READY";
  76857. this.mediaRequestsAborted += 1;
  76858. return;
  76859. }
  76860. if (error) {
  76861. if (error.code === REQUEST_ERRORS$1.TIMEOUT) {
  76862. this.handleTimeout_();
  76863. }
  76864. if (error.code === REQUEST_ERRORS$1.ABORTED) {
  76865. this.mediaRequestsAborted += 1;
  76866. } else {
  76867. this.mediaRequestsErrored += 1;
  76868. }
  76869. this.stopForError(error);
  76870. return;
  76871. }
  76872. const segmentInfo = this.pendingSegment_;
  76873. this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);
  76874. if (simpleSegment.key) {
  76875. this.segmentKey(simpleSegment.key, true);
  76876. }
  76877. this.state = "APPENDING";
  76878. this.trigger("appending");
  76879. const segment = segmentInfo.segment;
  76880. if (segment.map) {
  76881. segment.map.bytes = simpleSegment.map.bytes;
  76882. }
  76883. segmentInfo.bytes = simpleSegment.bytes;
  76884. if (typeof window_1.WebVTT !== "function" && typeof this.loadVttJs === "function") {
  76885. this.state = "WAITING_ON_VTTJS";
  76886. this.loadVttJs().then(() => this.segmentRequestFinished_(error, simpleSegment, result), () => this.stopForError({
  76887. message: "Error loading vtt.js"
  76888. }));
  76889. return;
  76890. }
  76891. segment.requested = true;
  76892. try {
  76893. this.parseVTTCues_(segmentInfo);
  76894. } catch (e) {
  76895. this.stopForError({
  76896. message: e.message
  76897. });
  76898. return;
  76899. }
  76900. this.updateTimeMapping_(segmentInfo, this.syncController_.timelines[segmentInfo.timeline], this.playlist_);
  76901. if (segmentInfo.cues.length) {
  76902. segmentInfo.timingInfo = {
  76903. start: segmentInfo.cues[0].startTime,
  76904. end: segmentInfo.cues[segmentInfo.cues.length - 1].endTime
  76905. };
  76906. } else {
  76907. segmentInfo.timingInfo = {
  76908. start: segmentInfo.startOfSegment,
  76909. end: segmentInfo.startOfSegment + segmentInfo.duration
  76910. };
  76911. }
  76912. if (segmentInfo.isSyncRequest) {
  76913. this.trigger("syncinfoupdate");
  76914. this.pendingSegment_ = null;
  76915. this.state = "READY";
  76916. return;
  76917. }
  76918. segmentInfo.byteLength = segmentInfo.bytes.byteLength;
  76919. this.mediaSecondsLoaded += segment.duration;
  76920. segmentInfo.cues.forEach((cue) => {
  76921. this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_ ? new window_1.VTTCue(cue.startTime, cue.endTime, cue.text) : cue);
  76922. });
  76923. removeDuplicateCuesFromTrack$1(this.subtitlesTrack_);
  76924. this.handleAppendsDone_();
  76925. }
  76926. handleData_() {
  76927. }
  76928. updateTimingInfoEnd_() {
  76929. }
  76930. parseVTTCues_(segmentInfo) {
  76931. let decoder;
  76932. let decodeBytesToString = false;
  76933. if (typeof window_1.WebVTT !== "function") {
  76934. throw new NoVttJsError$1();
  76935. }
  76936. if (typeof window_1.TextDecoder === "function") {
  76937. decoder = new window_1.TextDecoder("utf8");
  76938. } else {
  76939. decoder = window_1.WebVTT.StringDecoder();
  76940. decodeBytesToString = true;
  76941. }
  76942. const parser2 = new window_1.WebVTT.Parser(window_1, window_1.vttjs, decoder);
  76943. segmentInfo.cues = [];
  76944. segmentInfo.timestampmap = {
  76945. MPEGTS: 0,
  76946. LOCAL: 0
  76947. };
  76948. parser2.oncue = segmentInfo.cues.push.bind(segmentInfo.cues);
  76949. parser2.ontimestampmap = (map) => {
  76950. segmentInfo.timestampmap = map;
  76951. };
  76952. parser2.onparsingerror = (error) => {
  76953. videojs$2.log.warn("Error encountered when parsing cues: " + error.message);
  76954. };
  76955. if (segmentInfo.segment.map) {
  76956. let mapData = segmentInfo.segment.map.bytes;
  76957. if (decodeBytesToString) {
  76958. mapData = uint8ToUtf8$1(mapData);
  76959. }
  76960. parser2.parse(mapData);
  76961. }
  76962. let segmentData = segmentInfo.bytes;
  76963. if (decodeBytesToString) {
  76964. segmentData = uint8ToUtf8$1(segmentData);
  76965. }
  76966. parser2.parse(segmentData);
  76967. parser2.flush();
  76968. }
  76969. updateTimeMapping_(segmentInfo, mappingObj, playlist) {
  76970. const segment = segmentInfo.segment;
  76971. if (!mappingObj) {
  76972. return;
  76973. }
  76974. if (!segmentInfo.cues.length) {
  76975. segment.empty = true;
  76976. return;
  76977. }
  76978. const timestampmap = segmentInfo.timestampmap;
  76979. const diff = timestampmap.MPEGTS / clock$1.ONE_SECOND_IN_TS - timestampmap.LOCAL + mappingObj.mapping;
  76980. segmentInfo.cues.forEach((cue) => {
  76981. cue.startTime += diff;
  76982. cue.endTime += diff;
  76983. });
  76984. if (!playlist.syncInfo) {
  76985. const firstStart = segmentInfo.cues[0].startTime;
  76986. const lastStart = segmentInfo.cues[segmentInfo.cues.length - 1].startTime;
  76987. playlist.syncInfo = {
  76988. mediaSequence: playlist.mediaSequence + segmentInfo.mediaIndex,
  76989. time: Math.min(firstStart, lastStart - segment.duration)
  76990. };
  76991. }
  76992. }
  76993. }
  76994. const findAdCue$1 = function(track, mediaTime) {
  76995. const cues = track.cues;
  76996. for (let i2 = 0; i2 < cues.length; i2++) {
  76997. const cue = cues[i2];
  76998. if (mediaTime >= cue.adStartTime && mediaTime <= cue.adEndTime) {
  76999. return cue;
  77000. }
  77001. }
  77002. return null;
  77003. };
  77004. const updateAdCues$1 = function(media, track, offset = 0) {
  77005. if (!media.segments) {
  77006. return;
  77007. }
  77008. let mediaTime = offset;
  77009. let cue;
  77010. for (let i2 = 0; i2 < media.segments.length; i2++) {
  77011. const segment = media.segments[i2];
  77012. if (!cue) {
  77013. cue = findAdCue$1(track, mediaTime + segment.duration / 2);
  77014. }
  77015. if (cue) {
  77016. if ("cueIn" in segment) {
  77017. cue.endTime = mediaTime;
  77018. cue.adEndTime = mediaTime;
  77019. mediaTime += segment.duration;
  77020. cue = null;
  77021. continue;
  77022. }
  77023. if (mediaTime < cue.endTime) {
  77024. mediaTime += segment.duration;
  77025. continue;
  77026. }
  77027. cue.endTime += segment.duration;
  77028. } else {
  77029. if ("cueOut" in segment) {
  77030. cue = new window_1.VTTCue(mediaTime, mediaTime + segment.duration, segment.cueOut);
  77031. cue.adStartTime = mediaTime;
  77032. cue.adEndTime = mediaTime + parseFloat(segment.cueOut);
  77033. track.addCue(cue);
  77034. }
  77035. if ("cueOutCont" in segment) {
  77036. const [adOffset, adTotal] = segment.cueOutCont.split("/").map(parseFloat);
  77037. cue = new window_1.VTTCue(mediaTime, mediaTime + segment.duration, "");
  77038. cue.adStartTime = mediaTime - adOffset;
  77039. cue.adEndTime = cue.adStartTime + adTotal;
  77040. track.addCue(cue);
  77041. }
  77042. }
  77043. mediaTime += segment.duration;
  77044. }
  77045. };
  77046. const MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC$1 = 86400;
  77047. const syncPointStrategies$1 = [
  77048. {
  77049. name: "VOD",
  77050. run: (syncController, playlist, duration5, currentTimeline, currentTime) => {
  77051. if (duration5 !== Infinity) {
  77052. const syncPoint = {
  77053. time: 0,
  77054. segmentIndex: 0,
  77055. partIndex: null
  77056. };
  77057. return syncPoint;
  77058. }
  77059. return null;
  77060. }
  77061. },
  77062. {
  77063. name: "ProgramDateTime",
  77064. run: (syncController, playlist, duration5, currentTimeline, currentTime) => {
  77065. if (!Object.keys(syncController.timelineToDatetimeMappings).length) {
  77066. return null;
  77067. }
  77068. let syncPoint = null;
  77069. let lastDistance = null;
  77070. const partsAndSegments = getPartsAndSegments$1(playlist);
  77071. currentTime = currentTime || 0;
  77072. for (let i2 = 0; i2 < partsAndSegments.length; i2++) {
  77073. const index2 = playlist.endList || currentTime === 0 ? i2 : partsAndSegments.length - (i2 + 1);
  77074. const partAndSegment = partsAndSegments[index2];
  77075. const segment = partAndSegment.segment;
  77076. const datetimeMapping = syncController.timelineToDatetimeMappings[segment.timeline];
  77077. if (!datetimeMapping || !segment.dateTimeObject) {
  77078. continue;
  77079. }
  77080. const segmentTime = segment.dateTimeObject.getTime() / 1e3;
  77081. let start2 = segmentTime + datetimeMapping;
  77082. if (segment.parts && typeof partAndSegment.partIndex === "number") {
  77083. for (let z = 0; z < partAndSegment.partIndex; z++) {
  77084. start2 += segment.parts[z].duration;
  77085. }
  77086. }
  77087. const distance2 = Math.abs(currentTime - start2);
  77088. if (lastDistance !== null && (distance2 === 0 || lastDistance < distance2)) {
  77089. break;
  77090. }
  77091. lastDistance = distance2;
  77092. syncPoint = {
  77093. time: start2,
  77094. segmentIndex: partAndSegment.segmentIndex,
  77095. partIndex: partAndSegment.partIndex
  77096. };
  77097. }
  77098. return syncPoint;
  77099. }
  77100. },
  77101. {
  77102. name: "Segment",
  77103. run: (syncController, playlist, duration5, currentTimeline, currentTime) => {
  77104. let syncPoint = null;
  77105. let lastDistance = null;
  77106. currentTime = currentTime || 0;
  77107. const partsAndSegments = getPartsAndSegments$1(playlist);
  77108. for (let i2 = 0; i2 < partsAndSegments.length; i2++) {
  77109. const index2 = playlist.endList || currentTime === 0 ? i2 : partsAndSegments.length - (i2 + 1);
  77110. const partAndSegment = partsAndSegments[index2];
  77111. const segment = partAndSegment.segment;
  77112. const start2 = partAndSegment.part && partAndSegment.part.start || segment && segment.start;
  77113. if (segment.timeline === currentTimeline && typeof start2 !== "undefined") {
  77114. const distance2 = Math.abs(currentTime - start2);
  77115. if (lastDistance !== null && lastDistance < distance2) {
  77116. break;
  77117. }
  77118. if (!syncPoint || lastDistance === null || lastDistance >= distance2) {
  77119. lastDistance = distance2;
  77120. syncPoint = {
  77121. time: start2,
  77122. segmentIndex: partAndSegment.segmentIndex,
  77123. partIndex: partAndSegment.partIndex
  77124. };
  77125. }
  77126. }
  77127. }
  77128. return syncPoint;
  77129. }
  77130. },
  77131. {
  77132. name: "Discontinuity",
  77133. run: (syncController, playlist, duration5, currentTimeline, currentTime) => {
  77134. let syncPoint = null;
  77135. currentTime = currentTime || 0;
  77136. if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {
  77137. let lastDistance = null;
  77138. for (let i2 = 0; i2 < playlist.discontinuityStarts.length; i2++) {
  77139. const segmentIndex = playlist.discontinuityStarts[i2];
  77140. const discontinuity = playlist.discontinuitySequence + i2 + 1;
  77141. const discontinuitySync = syncController.discontinuities[discontinuity];
  77142. if (discontinuitySync) {
  77143. const distance2 = Math.abs(currentTime - discontinuitySync.time);
  77144. if (lastDistance !== null && lastDistance < distance2) {
  77145. break;
  77146. }
  77147. if (!syncPoint || lastDistance === null || lastDistance >= distance2) {
  77148. lastDistance = distance2;
  77149. syncPoint = {
  77150. time: discontinuitySync.time,
  77151. segmentIndex,
  77152. partIndex: null
  77153. };
  77154. }
  77155. }
  77156. }
  77157. }
  77158. return syncPoint;
  77159. }
  77160. },
  77161. {
  77162. name: "Playlist",
  77163. run: (syncController, playlist, duration5, currentTimeline, currentTime) => {
  77164. if (playlist.syncInfo) {
  77165. const syncPoint = {
  77166. time: playlist.syncInfo.time,
  77167. segmentIndex: playlist.syncInfo.mediaSequence - playlist.mediaSequence,
  77168. partIndex: null
  77169. };
  77170. return syncPoint;
  77171. }
  77172. return null;
  77173. }
  77174. }
  77175. ];
  77176. class SyncController$1 extends videojs$2.EventTarget {
  77177. constructor(options2 = {}) {
  77178. super();
  77179. this.timelines = [];
  77180. this.discontinuities = [];
  77181. this.timelineToDatetimeMappings = {};
  77182. this.logger_ = logger$1("SyncController");
  77183. }
  77184. getSyncPoint(playlist, duration5, currentTimeline, currentTime) {
  77185. const syncPoints = this.runStrategies_(playlist, duration5, currentTimeline, currentTime);
  77186. if (!syncPoints.length) {
  77187. return null;
  77188. }
  77189. return this.selectSyncPoint_(syncPoints, {
  77190. key: "time",
  77191. value: currentTime
  77192. });
  77193. }
  77194. getExpiredTime(playlist, duration5) {
  77195. if (!playlist || !playlist.segments) {
  77196. return null;
  77197. }
  77198. const syncPoints = this.runStrategies_(playlist, duration5, playlist.discontinuitySequence, 0);
  77199. if (!syncPoints.length) {
  77200. return null;
  77201. }
  77202. const syncPoint = this.selectSyncPoint_(syncPoints, {
  77203. key: "segmentIndex",
  77204. value: 0
  77205. });
  77206. if (syncPoint.segmentIndex > 0) {
  77207. syncPoint.time *= -1;
  77208. }
  77209. return Math.abs(syncPoint.time + sumDurations$1({
  77210. defaultDuration: playlist.targetDuration,
  77211. durationList: playlist.segments,
  77212. startIndex: syncPoint.segmentIndex,
  77213. endIndex: 0
  77214. }));
  77215. }
  77216. runStrategies_(playlist, duration5, currentTimeline, currentTime) {
  77217. const syncPoints = [];
  77218. for (let i2 = 0; i2 < syncPointStrategies$1.length; i2++) {
  77219. const strategy = syncPointStrategies$1[i2];
  77220. const syncPoint = strategy.run(this, playlist, duration5, currentTimeline, currentTime);
  77221. if (syncPoint) {
  77222. syncPoint.strategy = strategy.name;
  77223. syncPoints.push({
  77224. strategy: strategy.name,
  77225. syncPoint
  77226. });
  77227. }
  77228. }
  77229. return syncPoints;
  77230. }
  77231. selectSyncPoint_(syncPoints, target) {
  77232. let bestSyncPoint = syncPoints[0].syncPoint;
  77233. let bestDistance = Math.abs(syncPoints[0].syncPoint[target.key] - target.value);
  77234. let bestStrategy = syncPoints[0].strategy;
  77235. for (let i2 = 1; i2 < syncPoints.length; i2++) {
  77236. const newDistance = Math.abs(syncPoints[i2].syncPoint[target.key] - target.value);
  77237. if (newDistance < bestDistance) {
  77238. bestDistance = newDistance;
  77239. bestSyncPoint = syncPoints[i2].syncPoint;
  77240. bestStrategy = syncPoints[i2].strategy;
  77241. }
  77242. }
  77243. this.logger_(`syncPoint for [${target.key}: ${target.value}] chosen with strategy [${bestStrategy}]: [time:${bestSyncPoint.time}, segmentIndex:${bestSyncPoint.segmentIndex}` + (typeof bestSyncPoint.partIndex === "number" ? `,partIndex:${bestSyncPoint.partIndex}` : "") + "]");
  77244. return bestSyncPoint;
  77245. }
  77246. saveExpiredSegmentInfo(oldPlaylist, newPlaylist) {
  77247. const mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;
  77248. if (mediaSequenceDiff > MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC$1) {
  77249. videojs$2.log.warn(`Not saving expired segment info. Media sequence gap ${mediaSequenceDiff} is too large.`);
  77250. return;
  77251. }
  77252. for (let i2 = mediaSequenceDiff - 1; i2 >= 0; i2--) {
  77253. const lastRemovedSegment = oldPlaylist.segments[i2];
  77254. if (lastRemovedSegment && typeof lastRemovedSegment.start !== "undefined") {
  77255. newPlaylist.syncInfo = {
  77256. mediaSequence: oldPlaylist.mediaSequence + i2,
  77257. time: lastRemovedSegment.start
  77258. };
  77259. this.logger_(`playlist refresh sync: [time:${newPlaylist.syncInfo.time}, mediaSequence: ${newPlaylist.syncInfo.mediaSequence}]`);
  77260. this.trigger("syncinfoupdate");
  77261. break;
  77262. }
  77263. }
  77264. }
  77265. setDateTimeMappingForStart(playlist) {
  77266. this.timelineToDatetimeMappings = {};
  77267. if (playlist.segments && playlist.segments.length && playlist.segments[0].dateTimeObject) {
  77268. const firstSegment = playlist.segments[0];
  77269. const playlistTimestamp = firstSegment.dateTimeObject.getTime() / 1e3;
  77270. this.timelineToDatetimeMappings[firstSegment.timeline] = -playlistTimestamp;
  77271. }
  77272. }
  77273. saveSegmentTimingInfo({
  77274. segmentInfo,
  77275. shouldSaveTimelineMapping
  77276. }) {
  77277. const didCalculateSegmentTimeMapping = this.calculateSegmentTimeMapping_(segmentInfo, segmentInfo.timingInfo, shouldSaveTimelineMapping);
  77278. const segment = segmentInfo.segment;
  77279. if (didCalculateSegmentTimeMapping) {
  77280. this.saveDiscontinuitySyncInfo_(segmentInfo);
  77281. if (!segmentInfo.playlist.syncInfo) {
  77282. segmentInfo.playlist.syncInfo = {
  77283. mediaSequence: segmentInfo.playlist.mediaSequence + segmentInfo.mediaIndex,
  77284. time: segment.start
  77285. };
  77286. }
  77287. }
  77288. const dateTime = segment.dateTimeObject;
  77289. if (segment.discontinuity && shouldSaveTimelineMapping && dateTime) {
  77290. this.timelineToDatetimeMappings[segment.timeline] = -(dateTime.getTime() / 1e3);
  77291. }
  77292. }
  77293. timestampOffsetForTimeline(timeline) {
  77294. if (typeof this.timelines[timeline] === "undefined") {
  77295. return null;
  77296. }
  77297. return this.timelines[timeline].time;
  77298. }
  77299. mappingForTimeline(timeline) {
  77300. if (typeof this.timelines[timeline] === "undefined") {
  77301. return null;
  77302. }
  77303. return this.timelines[timeline].mapping;
  77304. }
  77305. calculateSegmentTimeMapping_(segmentInfo, timingInfo, shouldSaveTimelineMapping) {
  77306. const segment = segmentInfo.segment;
  77307. const part = segmentInfo.part;
  77308. let mappingObj = this.timelines[segmentInfo.timeline];
  77309. let start2;
  77310. let end;
  77311. if (typeof segmentInfo.timestampOffset === "number") {
  77312. mappingObj = {
  77313. time: segmentInfo.startOfSegment,
  77314. mapping: segmentInfo.startOfSegment - timingInfo.start
  77315. };
  77316. if (shouldSaveTimelineMapping) {
  77317. this.timelines[segmentInfo.timeline] = mappingObj;
  77318. this.trigger("timestampoffset");
  77319. this.logger_(`time mapping for timeline ${segmentInfo.timeline}: [time: ${mappingObj.time}] [mapping: ${mappingObj.mapping}]`);
  77320. }
  77321. start2 = segmentInfo.startOfSegment;
  77322. end = timingInfo.end + mappingObj.mapping;
  77323. } else if (mappingObj) {
  77324. start2 = timingInfo.start + mappingObj.mapping;
  77325. end = timingInfo.end + mappingObj.mapping;
  77326. } else {
  77327. return false;
  77328. }
  77329. if (part) {
  77330. part.start = start2;
  77331. part.end = end;
  77332. }
  77333. if (!segment.start || start2 < segment.start) {
  77334. segment.start = start2;
  77335. }
  77336. segment.end = end;
  77337. return true;
  77338. }
  77339. saveDiscontinuitySyncInfo_(segmentInfo) {
  77340. const playlist = segmentInfo.playlist;
  77341. const segment = segmentInfo.segment;
  77342. if (segment.discontinuity) {
  77343. this.discontinuities[segment.timeline] = {
  77344. time: segment.start,
  77345. accuracy: 0
  77346. };
  77347. } else if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {
  77348. for (let i2 = 0; i2 < playlist.discontinuityStarts.length; i2++) {
  77349. const segmentIndex = playlist.discontinuityStarts[i2];
  77350. const discontinuity = playlist.discontinuitySequence + i2 + 1;
  77351. const mediaIndexDiff = segmentIndex - segmentInfo.mediaIndex;
  77352. const accuracy = Math.abs(mediaIndexDiff);
  77353. if (!this.discontinuities[discontinuity] || this.discontinuities[discontinuity].accuracy > accuracy) {
  77354. let time;
  77355. if (mediaIndexDiff < 0) {
  77356. time = segment.start - sumDurations$1({
  77357. defaultDuration: playlist.targetDuration,
  77358. durationList: playlist.segments,
  77359. startIndex: segmentInfo.mediaIndex,
  77360. endIndex: segmentIndex
  77361. });
  77362. } else {
  77363. time = segment.end + sumDurations$1({
  77364. defaultDuration: playlist.targetDuration,
  77365. durationList: playlist.segments,
  77366. startIndex: segmentInfo.mediaIndex + 1,
  77367. endIndex: segmentIndex
  77368. });
  77369. }
  77370. this.discontinuities[discontinuity] = {
  77371. time,
  77372. accuracy
  77373. };
  77374. }
  77375. }
  77376. }
  77377. }
  77378. dispose() {
  77379. this.trigger("dispose");
  77380. this.off();
  77381. }
  77382. }
  77383. class TimelineChangeController$1 extends videojs$2.EventTarget {
  77384. constructor() {
  77385. super();
  77386. this.pendingTimelineChanges_ = {};
  77387. this.lastTimelineChanges_ = {};
  77388. }
  77389. clearPendingTimelineChange(type2) {
  77390. this.pendingTimelineChanges_[type2] = null;
  77391. this.trigger("pendingtimelinechange");
  77392. }
  77393. pendingTimelineChange({
  77394. type: type2,
  77395. from: from3,
  77396. to
  77397. }) {
  77398. if (typeof from3 === "number" && typeof to === "number") {
  77399. this.pendingTimelineChanges_[type2] = {
  77400. type: type2,
  77401. from: from3,
  77402. to
  77403. };
  77404. this.trigger("pendingtimelinechange");
  77405. }
  77406. return this.pendingTimelineChanges_[type2];
  77407. }
  77408. lastTimelineChange({
  77409. type: type2,
  77410. from: from3,
  77411. to
  77412. }) {
  77413. if (typeof from3 === "number" && typeof to === "number") {
  77414. this.lastTimelineChanges_[type2] = {
  77415. type: type2,
  77416. from: from3,
  77417. to
  77418. };
  77419. delete this.pendingTimelineChanges_[type2];
  77420. this.trigger("timelinechange");
  77421. }
  77422. return this.lastTimelineChanges_[type2];
  77423. }
  77424. dispose() {
  77425. this.trigger("dispose");
  77426. this.pendingTimelineChanges_ = {};
  77427. this.lastTimelineChanges_ = {};
  77428. this.off();
  77429. }
  77430. }
  77431. const workerCode$2 = transform$1(getWorkerString$1(function() {
  77432. var Stream2 = /* @__PURE__ */ function() {
  77433. function Stream3() {
  77434. this.listeners = {};
  77435. }
  77436. var _proto = Stream3.prototype;
  77437. _proto.on = function on3(type2, listener) {
  77438. if (!this.listeners[type2]) {
  77439. this.listeners[type2] = [];
  77440. }
  77441. this.listeners[type2].push(listener);
  77442. };
  77443. _proto.off = function off2(type2, listener) {
  77444. if (!this.listeners[type2]) {
  77445. return false;
  77446. }
  77447. var index2 = this.listeners[type2].indexOf(listener);
  77448. this.listeners[type2] = this.listeners[type2].slice(0);
  77449. this.listeners[type2].splice(index2, 1);
  77450. return index2 > -1;
  77451. };
  77452. _proto.trigger = function trigger2(type2) {
  77453. var callbacks = this.listeners[type2];
  77454. if (!callbacks) {
  77455. return;
  77456. }
  77457. if (arguments.length === 2) {
  77458. var length = callbacks.length;
  77459. for (var i2 = 0; i2 < length; ++i2) {
  77460. callbacks[i2].call(this, arguments[1]);
  77461. }
  77462. } else {
  77463. var args = Array.prototype.slice.call(arguments, 1);
  77464. var _length = callbacks.length;
  77465. for (var _i = 0; _i < _length; ++_i) {
  77466. callbacks[_i].apply(this, args);
  77467. }
  77468. }
  77469. };
  77470. _proto.dispose = function dispose() {
  77471. this.listeners = {};
  77472. };
  77473. _proto.pipe = function pipe(destination2) {
  77474. this.on("data", function(data) {
  77475. destination2.push(data);
  77476. });
  77477. };
  77478. return Stream3;
  77479. }();
  77480. /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
  77481. function unpad(padded) {
  77482. return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);
  77483. }
  77484. /*! @name aes-decrypter @version 4.0.1 @license Apache-2.0 */
  77485. const precompute = function() {
  77486. const tables = [[[], [], [], [], []], [[], [], [], [], []]];
  77487. const encTable = tables[0];
  77488. const decTable = tables[1];
  77489. const sbox = encTable[4];
  77490. const sboxInv = decTable[4];
  77491. let i2;
  77492. let x;
  77493. let xInv;
  77494. const d2 = [];
  77495. const th = [];
  77496. let x2;
  77497. let x4;
  77498. let x8;
  77499. let s;
  77500. let tEnc;
  77501. let tDec;
  77502. for (i2 = 0; i2 < 256; i2++) {
  77503. th[(d2[i2] = i2 << 1 ^ (i2 >> 7) * 283) ^ i2] = i2;
  77504. }
  77505. for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {
  77506. s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;
  77507. s = s >> 8 ^ s & 255 ^ 99;
  77508. sbox[x] = s;
  77509. sboxInv[s] = x;
  77510. x8 = d2[x4 = d2[x2 = d2[x]]];
  77511. tDec = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008;
  77512. tEnc = d2[s] * 257 ^ s * 16843008;
  77513. for (i2 = 0; i2 < 4; i2++) {
  77514. encTable[i2][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;
  77515. decTable[i2][s] = tDec = tDec << 24 ^ tDec >>> 8;
  77516. }
  77517. }
  77518. for (i2 = 0; i2 < 5; i2++) {
  77519. encTable[i2] = encTable[i2].slice(0);
  77520. decTable[i2] = decTable[i2].slice(0);
  77521. }
  77522. return tables;
  77523. };
  77524. let aesTables = null;
  77525. class AES {
  77526. constructor(key) {
  77527. if (!aesTables) {
  77528. aesTables = precompute();
  77529. }
  77530. this._tables = [[aesTables[0][0].slice(), aesTables[0][1].slice(), aesTables[0][2].slice(), aesTables[0][3].slice(), aesTables[0][4].slice()], [aesTables[1][0].slice(), aesTables[1][1].slice(), aesTables[1][2].slice(), aesTables[1][3].slice(), aesTables[1][4].slice()]];
  77531. let i2;
  77532. let j;
  77533. let tmp;
  77534. const sbox = this._tables[0][4];
  77535. const decTable = this._tables[1];
  77536. const keyLen = key.length;
  77537. let rcon = 1;
  77538. if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {
  77539. throw new Error("Invalid aes key size");
  77540. }
  77541. const encKey = key.slice(0);
  77542. const decKey = [];
  77543. this._key = [encKey, decKey];
  77544. for (i2 = keyLen; i2 < 4 * keyLen + 28; i2++) {
  77545. tmp = encKey[i2 - 1];
  77546. if (i2 % keyLen === 0 || keyLen === 8 && i2 % keyLen === 4) {
  77547. tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255];
  77548. if (i2 % keyLen === 0) {
  77549. tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;
  77550. rcon = rcon << 1 ^ (rcon >> 7) * 283;
  77551. }
  77552. }
  77553. encKey[i2] = encKey[i2 - keyLen] ^ tmp;
  77554. }
  77555. for (j = 0; i2; j++, i2--) {
  77556. tmp = encKey[j & 3 ? i2 : i2 - 4];
  77557. if (i2 <= 4 || j < 4) {
  77558. decKey[j] = tmp;
  77559. } else {
  77560. decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];
  77561. }
  77562. }
  77563. }
  77564. decrypt(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {
  77565. const key = this._key[1];
  77566. let a = encrypted0 ^ key[0];
  77567. let b = encrypted3 ^ key[1];
  77568. let c = encrypted2 ^ key[2];
  77569. let d2 = encrypted1 ^ key[3];
  77570. let a2;
  77571. let b2;
  77572. let c2;
  77573. const nInnerRounds = key.length / 4 - 2;
  77574. let i2;
  77575. let kIndex = 4;
  77576. const table = this._tables[1];
  77577. const table0 = table[0];
  77578. const table1 = table[1];
  77579. const table2 = table[2];
  77580. const table3 = table[3];
  77581. const sbox = table[4];
  77582. for (i2 = 0; i2 < nInnerRounds; i2++) {
  77583. a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d2 & 255] ^ key[kIndex];
  77584. b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d2 >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];
  77585. c2 = table0[c >>> 24] ^ table1[d2 >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];
  77586. d2 = table0[d2 >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];
  77587. kIndex += 4;
  77588. a = a2;
  77589. b = b2;
  77590. c = c2;
  77591. }
  77592. for (i2 = 0; i2 < 4; i2++) {
  77593. out[(3 & -i2) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d2 & 255] ^ key[kIndex++];
  77594. a2 = a;
  77595. a = b;
  77596. b = c;
  77597. c = d2;
  77598. d2 = a2;
  77599. }
  77600. }
  77601. }
  77602. class AsyncStream extends Stream2 {
  77603. constructor() {
  77604. super(Stream2);
  77605. this.jobs = [];
  77606. this.delay = 1;
  77607. this.timeout_ = null;
  77608. }
  77609. processJob_() {
  77610. this.jobs.shift()();
  77611. if (this.jobs.length) {
  77612. this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);
  77613. } else {
  77614. this.timeout_ = null;
  77615. }
  77616. }
  77617. push(job) {
  77618. this.jobs.push(job);
  77619. if (!this.timeout_) {
  77620. this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);
  77621. }
  77622. }
  77623. }
  77624. const ntoh = function(word) {
  77625. return word << 24 | (word & 65280) << 8 | (word & 16711680) >> 8 | word >>> 24;
  77626. };
  77627. const decrypt3 = function(encrypted, key, initVector) {
  77628. const encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2);
  77629. const decipher = new AES(Array.prototype.slice.call(key));
  77630. const decrypted = new Uint8Array(encrypted.byteLength);
  77631. const decrypted32 = new Int32Array(decrypted.buffer);
  77632. let init0;
  77633. let init1;
  77634. let init2;
  77635. let init3;
  77636. let encrypted0;
  77637. let encrypted1;
  77638. let encrypted2;
  77639. let encrypted3;
  77640. let wordIx;
  77641. init0 = initVector[0];
  77642. init1 = initVector[1];
  77643. init2 = initVector[2];
  77644. init3 = initVector[3];
  77645. for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {
  77646. encrypted0 = ntoh(encrypted32[wordIx]);
  77647. encrypted1 = ntoh(encrypted32[wordIx + 1]);
  77648. encrypted2 = ntoh(encrypted32[wordIx + 2]);
  77649. encrypted3 = ntoh(encrypted32[wordIx + 3]);
  77650. decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx);
  77651. decrypted32[wordIx] = ntoh(decrypted32[wordIx] ^ init0);
  77652. decrypted32[wordIx + 1] = ntoh(decrypted32[wordIx + 1] ^ init1);
  77653. decrypted32[wordIx + 2] = ntoh(decrypted32[wordIx + 2] ^ init2);
  77654. decrypted32[wordIx + 3] = ntoh(decrypted32[wordIx + 3] ^ init3);
  77655. init0 = encrypted0;
  77656. init1 = encrypted1;
  77657. init2 = encrypted2;
  77658. init3 = encrypted3;
  77659. }
  77660. return decrypted;
  77661. };
  77662. class Decrypter2 {
  77663. constructor(encrypted, key, initVector, done) {
  77664. const step = Decrypter2.STEP;
  77665. const encrypted32 = new Int32Array(encrypted.buffer);
  77666. const decrypted = new Uint8Array(encrypted.byteLength);
  77667. let i2 = 0;
  77668. this.asyncStream_ = new AsyncStream();
  77669. this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i2, i2 + step), key, initVector, decrypted));
  77670. for (i2 = step; i2 < encrypted32.length; i2 += step) {
  77671. initVector = new Uint32Array([ntoh(encrypted32[i2 - 4]), ntoh(encrypted32[i2 - 3]), ntoh(encrypted32[i2 - 2]), ntoh(encrypted32[i2 - 1])]);
  77672. this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i2, i2 + step), key, initVector, decrypted));
  77673. }
  77674. this.asyncStream_.push(function() {
  77675. done(null, unpad(decrypted));
  77676. });
  77677. }
  77678. static get STEP() {
  77679. return 32e3;
  77680. }
  77681. decryptChunk_(encrypted, key, initVector, decrypted) {
  77682. return function() {
  77683. const bytes = decrypt3(encrypted, key, initVector);
  77684. decrypted.set(bytes, encrypted.byteOffset);
  77685. };
  77686. }
  77687. }
  77688. var commonjsGlobal2 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  77689. var win2;
  77690. if (typeof window !== "undefined") {
  77691. win2 = window;
  77692. } else if (typeof commonjsGlobal2 !== "undefined") {
  77693. win2 = commonjsGlobal2;
  77694. } else if (typeof self !== "undefined") {
  77695. win2 = self;
  77696. } else {
  77697. win2 = {};
  77698. }
  77699. var window_12 = win2;
  77700. var isArrayBufferView4 = function isArrayBufferView5(obj) {
  77701. if (ArrayBuffer.isView === "function") {
  77702. return ArrayBuffer.isView(obj);
  77703. }
  77704. return obj && obj.buffer instanceof ArrayBuffer;
  77705. };
  77706. var BigInt2 = window_12.BigInt || Number;
  77707. [BigInt2("0x1"), BigInt2("0x100"), BigInt2("0x10000"), BigInt2("0x1000000"), BigInt2("0x100000000"), BigInt2("0x10000000000"), BigInt2("0x1000000000000"), BigInt2("0x100000000000000"), BigInt2("0x10000000000000000")];
  77708. (function() {
  77709. var a = new Uint16Array([65484]);
  77710. var b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);
  77711. if (b[0] === 255) {
  77712. return "big";
  77713. }
  77714. if (b[0] === 204) {
  77715. return "little";
  77716. }
  77717. return "unknown";
  77718. })();
  77719. const createTransferableMessage3 = function(message) {
  77720. const transferable = {};
  77721. Object.keys(message).forEach((key) => {
  77722. const value = message[key];
  77723. if (isArrayBufferView4(value)) {
  77724. transferable[key] = {
  77725. bytes: value.buffer,
  77726. byteOffset: value.byteOffset,
  77727. byteLength: value.byteLength
  77728. };
  77729. } else {
  77730. transferable[key] = value;
  77731. }
  77732. });
  77733. return transferable;
  77734. };
  77735. self.onmessage = function(event2) {
  77736. const data = event2.data;
  77737. const encrypted = new Uint8Array(data.encrypted.bytes, data.encrypted.byteOffset, data.encrypted.byteLength);
  77738. const key = new Uint32Array(data.key.bytes, data.key.byteOffset, data.key.byteLength / 4);
  77739. const iv = new Uint32Array(data.iv.bytes, data.iv.byteOffset, data.iv.byteLength / 4);
  77740. new Decrypter2(encrypted, key, iv, function(err, bytes) {
  77741. self.postMessage(createTransferableMessage3({
  77742. source: data.source,
  77743. decrypted: bytes
  77744. }), [bytes.buffer]);
  77745. });
  77746. };
  77747. }));
  77748. var Decrypter$1 = factory$1(workerCode$2);
  77749. const audioTrackKind_$1 = (properties) => {
  77750. let kind = properties.default ? "main" : "alternative";
  77751. if (properties.characteristics && properties.characteristics.indexOf("public.accessibility.describes-video") >= 0) {
  77752. kind = "main-desc";
  77753. }
  77754. return kind;
  77755. };
  77756. const stopLoaders$1 = (segmentLoader, mediaType) => {
  77757. segmentLoader.abort();
  77758. segmentLoader.pause();
  77759. if (mediaType && mediaType.activePlaylistLoader) {
  77760. mediaType.activePlaylistLoader.pause();
  77761. mediaType.activePlaylistLoader = null;
  77762. }
  77763. };
  77764. const startLoaders$1 = (playlistLoader, mediaType) => {
  77765. mediaType.activePlaylistLoader = playlistLoader;
  77766. playlistLoader.load();
  77767. };
  77768. const onGroupChanged$1 = (type2, settings) => () => {
  77769. const {
  77770. segmentLoaders: {
  77771. [type2]: segmentLoader,
  77772. main: mainSegmentLoader
  77773. },
  77774. mediaTypes: {
  77775. [type2]: mediaType
  77776. }
  77777. } = settings;
  77778. const activeTrack2 = mediaType.activeTrack();
  77779. const activeGroup3 = mediaType.getActiveGroup();
  77780. const previousActiveLoader = mediaType.activePlaylistLoader;
  77781. const lastGroup = mediaType.lastGroup_;
  77782. if (activeGroup3 && lastGroup && activeGroup3.id === lastGroup.id) {
  77783. return;
  77784. }
  77785. mediaType.lastGroup_ = activeGroup3;
  77786. mediaType.lastTrack_ = activeTrack2;
  77787. stopLoaders$1(segmentLoader, mediaType);
  77788. if (!activeGroup3 || activeGroup3.isMainPlaylist) {
  77789. return;
  77790. }
  77791. if (!activeGroup3.playlistLoader) {
  77792. if (previousActiveLoader) {
  77793. mainSegmentLoader.resetEverything();
  77794. }
  77795. return;
  77796. }
  77797. segmentLoader.resyncLoader();
  77798. startLoaders$1(activeGroup3.playlistLoader, mediaType);
  77799. };
  77800. const onGroupChanging$1 = (type2, settings) => () => {
  77801. const {
  77802. segmentLoaders: {
  77803. [type2]: segmentLoader
  77804. },
  77805. mediaTypes: {
  77806. [type2]: mediaType
  77807. }
  77808. } = settings;
  77809. mediaType.lastGroup_ = null;
  77810. segmentLoader.abort();
  77811. segmentLoader.pause();
  77812. };
  77813. const onTrackChanged$1 = (type2, settings) => () => {
  77814. const {
  77815. mainPlaylistLoader,
  77816. segmentLoaders: {
  77817. [type2]: segmentLoader,
  77818. main: mainSegmentLoader
  77819. },
  77820. mediaTypes: {
  77821. [type2]: mediaType
  77822. }
  77823. } = settings;
  77824. const activeTrack2 = mediaType.activeTrack();
  77825. const activeGroup3 = mediaType.getActiveGroup();
  77826. const previousActiveLoader = mediaType.activePlaylistLoader;
  77827. const lastTrack = mediaType.lastTrack_;
  77828. if (lastTrack && activeTrack2 && lastTrack.id === activeTrack2.id) {
  77829. return;
  77830. }
  77831. mediaType.lastGroup_ = activeGroup3;
  77832. mediaType.lastTrack_ = activeTrack2;
  77833. stopLoaders$1(segmentLoader, mediaType);
  77834. if (!activeGroup3) {
  77835. return;
  77836. }
  77837. if (activeGroup3.isMainPlaylist) {
  77838. if (!activeTrack2 || !lastTrack || activeTrack2.id === lastTrack.id) {
  77839. return;
  77840. }
  77841. const pc = settings.vhs.playlistController_;
  77842. const newPlaylist = pc.selectPlaylist();
  77843. if (pc.media() === newPlaylist) {
  77844. return;
  77845. }
  77846. mediaType.logger_(`track change. Switching main audio from ${lastTrack.id} to ${activeTrack2.id}`);
  77847. mainPlaylistLoader.pause();
  77848. mainSegmentLoader.resetEverything();
  77849. pc.fastQualityChange_(newPlaylist);
  77850. return;
  77851. }
  77852. if (type2 === "AUDIO") {
  77853. if (!activeGroup3.playlistLoader) {
  77854. mainSegmentLoader.setAudio(true);
  77855. mainSegmentLoader.resetEverything();
  77856. return;
  77857. }
  77858. segmentLoader.setAudio(true);
  77859. mainSegmentLoader.setAudio(false);
  77860. }
  77861. if (previousActiveLoader === activeGroup3.playlistLoader) {
  77862. startLoaders$1(activeGroup3.playlistLoader, mediaType);
  77863. return;
  77864. }
  77865. if (segmentLoader.track) {
  77866. segmentLoader.track(activeTrack2);
  77867. }
  77868. segmentLoader.resetEverything();
  77869. startLoaders$1(activeGroup3.playlistLoader, mediaType);
  77870. };
  77871. const onError$1 = {
  77872. AUDIO: (type2, settings) => () => {
  77873. const {
  77874. segmentLoaders: {
  77875. [type2]: segmentLoader
  77876. },
  77877. mediaTypes: {
  77878. [type2]: mediaType
  77879. },
  77880. excludePlaylist
  77881. } = settings;
  77882. stopLoaders$1(segmentLoader, mediaType);
  77883. const activeTrack2 = mediaType.activeTrack();
  77884. const activeGroup3 = mediaType.activeGroup();
  77885. const id = (activeGroup3.filter((group) => group.default)[0] || activeGroup3[0]).id;
  77886. const defaultTrack = mediaType.tracks[id];
  77887. if (activeTrack2 === defaultTrack) {
  77888. excludePlaylist({
  77889. error: {
  77890. message: "Problem encountered loading the default audio track."
  77891. }
  77892. });
  77893. return;
  77894. }
  77895. videojs$2.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");
  77896. for (const trackId in mediaType.tracks) {
  77897. mediaType.tracks[trackId].enabled = mediaType.tracks[trackId] === defaultTrack;
  77898. }
  77899. mediaType.onTrackChanged();
  77900. },
  77901. SUBTITLES: (type2, settings) => () => {
  77902. const {
  77903. segmentLoaders: {
  77904. [type2]: segmentLoader
  77905. },
  77906. mediaTypes: {
  77907. [type2]: mediaType
  77908. }
  77909. } = settings;
  77910. videojs$2.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");
  77911. stopLoaders$1(segmentLoader, mediaType);
  77912. const track = mediaType.activeTrack();
  77913. if (track) {
  77914. track.mode = "disabled";
  77915. }
  77916. mediaType.onTrackChanged();
  77917. }
  77918. };
  77919. const setupListeners$1 = {
  77920. AUDIO: (type2, playlistLoader, settings) => {
  77921. if (!playlistLoader) {
  77922. return;
  77923. }
  77924. const {
  77925. tech,
  77926. requestOptions,
  77927. segmentLoaders: {
  77928. [type2]: segmentLoader
  77929. }
  77930. } = settings;
  77931. playlistLoader.on("loadedmetadata", () => {
  77932. const media = playlistLoader.media();
  77933. segmentLoader.playlist(media, requestOptions);
  77934. if (!tech.paused() || media.endList && tech.preload() !== "none") {
  77935. segmentLoader.load();
  77936. }
  77937. });
  77938. playlistLoader.on("loadedplaylist", () => {
  77939. segmentLoader.playlist(playlistLoader.media(), requestOptions);
  77940. if (!tech.paused()) {
  77941. segmentLoader.load();
  77942. }
  77943. });
  77944. playlistLoader.on("error", onError$1[type2](type2, settings));
  77945. },
  77946. SUBTITLES: (type2, playlistLoader, settings) => {
  77947. const {
  77948. tech,
  77949. requestOptions,
  77950. segmentLoaders: {
  77951. [type2]: segmentLoader
  77952. },
  77953. mediaTypes: {
  77954. [type2]: mediaType
  77955. }
  77956. } = settings;
  77957. playlistLoader.on("loadedmetadata", () => {
  77958. const media = playlistLoader.media();
  77959. segmentLoader.playlist(media, requestOptions);
  77960. segmentLoader.track(mediaType.activeTrack());
  77961. if (!tech.paused() || media.endList && tech.preload() !== "none") {
  77962. segmentLoader.load();
  77963. }
  77964. });
  77965. playlistLoader.on("loadedplaylist", () => {
  77966. segmentLoader.playlist(playlistLoader.media(), requestOptions);
  77967. if (!tech.paused()) {
  77968. segmentLoader.load();
  77969. }
  77970. });
  77971. playlistLoader.on("error", onError$1[type2](type2, settings));
  77972. }
  77973. };
  77974. const initialize$1 = {
  77975. "AUDIO": (type2, settings) => {
  77976. const {
  77977. vhs,
  77978. sourceType,
  77979. segmentLoaders: {
  77980. [type2]: segmentLoader
  77981. },
  77982. requestOptions,
  77983. main: {
  77984. mediaGroups
  77985. },
  77986. mediaTypes: {
  77987. [type2]: {
  77988. groups,
  77989. tracks,
  77990. logger_
  77991. }
  77992. },
  77993. mainPlaylistLoader
  77994. } = settings;
  77995. const audioOnlyMain = isAudioOnly$1(mainPlaylistLoader.main);
  77996. if (!mediaGroups[type2] || Object.keys(mediaGroups[type2]).length === 0) {
  77997. mediaGroups[type2] = {
  77998. main: {
  77999. default: {
  78000. default: true
  78001. }
  78002. }
  78003. };
  78004. if (audioOnlyMain) {
  78005. mediaGroups[type2].main.default.playlists = mainPlaylistLoader.main.playlists;
  78006. }
  78007. }
  78008. for (const groupId in mediaGroups[type2]) {
  78009. if (!groups[groupId]) {
  78010. groups[groupId] = [];
  78011. }
  78012. for (const variantLabel in mediaGroups[type2][groupId]) {
  78013. let properties = mediaGroups[type2][groupId][variantLabel];
  78014. let playlistLoader;
  78015. if (audioOnlyMain) {
  78016. logger_(`AUDIO group '${groupId}' label '${variantLabel}' is a main playlist`);
  78017. properties.isMainPlaylist = true;
  78018. playlistLoader = null;
  78019. } else if (sourceType === "vhs-json" && properties.playlists) {
  78020. playlistLoader = new PlaylistLoader$1(properties.playlists[0], vhs, requestOptions);
  78021. } else if (properties.resolvedUri) {
  78022. playlistLoader = new PlaylistLoader$1(properties.resolvedUri, vhs, requestOptions);
  78023. } else if (properties.playlists && sourceType === "dash") {
  78024. playlistLoader = new DashPlaylistLoader$1(properties.playlists[0], vhs, requestOptions, mainPlaylistLoader);
  78025. } else {
  78026. playlistLoader = null;
  78027. }
  78028. properties = merge$2({
  78029. id: variantLabel,
  78030. playlistLoader
  78031. }, properties);
  78032. setupListeners$1[type2](type2, properties.playlistLoader, settings);
  78033. groups[groupId].push(properties);
  78034. if (typeof tracks[variantLabel] === "undefined") {
  78035. const track = new videojs$2.AudioTrack({
  78036. id: variantLabel,
  78037. kind: audioTrackKind_$1(properties),
  78038. enabled: false,
  78039. language: properties.language,
  78040. default: properties.default,
  78041. label: variantLabel
  78042. });
  78043. tracks[variantLabel] = track;
  78044. }
  78045. }
  78046. }
  78047. segmentLoader.on("error", onError$1[type2](type2, settings));
  78048. },
  78049. "SUBTITLES": (type2, settings) => {
  78050. const {
  78051. tech,
  78052. vhs,
  78053. sourceType,
  78054. segmentLoaders: {
  78055. [type2]: segmentLoader
  78056. },
  78057. requestOptions,
  78058. main: {
  78059. mediaGroups
  78060. },
  78061. mediaTypes: {
  78062. [type2]: {
  78063. groups,
  78064. tracks
  78065. }
  78066. },
  78067. mainPlaylistLoader
  78068. } = settings;
  78069. for (const groupId in mediaGroups[type2]) {
  78070. if (!groups[groupId]) {
  78071. groups[groupId] = [];
  78072. }
  78073. for (const variantLabel in mediaGroups[type2][groupId]) {
  78074. if (mediaGroups[type2][groupId][variantLabel].forced) {
  78075. continue;
  78076. }
  78077. let properties = mediaGroups[type2][groupId][variantLabel];
  78078. let playlistLoader;
  78079. if (sourceType === "hls") {
  78080. playlistLoader = new PlaylistLoader$1(properties.resolvedUri, vhs, requestOptions);
  78081. } else if (sourceType === "dash") {
  78082. const playlists = properties.playlists.filter((p) => p.excludeUntil !== Infinity);
  78083. if (!playlists.length) {
  78084. return;
  78085. }
  78086. playlistLoader = new DashPlaylistLoader$1(properties.playlists[0], vhs, requestOptions, mainPlaylistLoader);
  78087. } else if (sourceType === "vhs-json") {
  78088. playlistLoader = new PlaylistLoader$1(
  78089. properties.playlists ? properties.playlists[0] : properties.resolvedUri,
  78090. vhs,
  78091. requestOptions
  78092. );
  78093. }
  78094. properties = merge$2({
  78095. id: variantLabel,
  78096. playlistLoader
  78097. }, properties);
  78098. setupListeners$1[type2](type2, properties.playlistLoader, settings);
  78099. groups[groupId].push(properties);
  78100. if (typeof tracks[variantLabel] === "undefined") {
  78101. const track = tech.addRemoteTextTrack({
  78102. id: variantLabel,
  78103. kind: "subtitles",
  78104. default: properties.default && properties.autoselect,
  78105. language: properties.language,
  78106. label: variantLabel
  78107. }, false).track;
  78108. tracks[variantLabel] = track;
  78109. }
  78110. }
  78111. }
  78112. segmentLoader.on("error", onError$1[type2](type2, settings));
  78113. },
  78114. "CLOSED-CAPTIONS": (type2, settings) => {
  78115. const {
  78116. tech,
  78117. main: {
  78118. mediaGroups
  78119. },
  78120. mediaTypes: {
  78121. [type2]: {
  78122. groups,
  78123. tracks
  78124. }
  78125. }
  78126. } = settings;
  78127. for (const groupId in mediaGroups[type2]) {
  78128. if (!groups[groupId]) {
  78129. groups[groupId] = [];
  78130. }
  78131. for (const variantLabel in mediaGroups[type2][groupId]) {
  78132. const properties = mediaGroups[type2][groupId][variantLabel];
  78133. if (!/^(?:CC|SERVICE)/.test(properties.instreamId)) {
  78134. continue;
  78135. }
  78136. const captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};
  78137. let newProps = {
  78138. label: variantLabel,
  78139. language: properties.language,
  78140. instreamId: properties.instreamId,
  78141. default: properties.default && properties.autoselect
  78142. };
  78143. if (captionServices[newProps.instreamId]) {
  78144. newProps = merge$2(newProps, captionServices[newProps.instreamId]);
  78145. }
  78146. if (newProps.default === void 0) {
  78147. delete newProps.default;
  78148. }
  78149. groups[groupId].push(merge$2({
  78150. id: variantLabel
  78151. }, properties));
  78152. if (typeof tracks[variantLabel] === "undefined") {
  78153. const track = tech.addRemoteTextTrack({
  78154. id: newProps.instreamId,
  78155. kind: "captions",
  78156. default: newProps.default,
  78157. language: newProps.language,
  78158. label: newProps.label
  78159. }, false).track;
  78160. tracks[variantLabel] = track;
  78161. }
  78162. }
  78163. }
  78164. }
  78165. };
  78166. const groupMatch$1 = (list, media) => {
  78167. for (let i2 = 0; i2 < list.length; i2++) {
  78168. if (playlistMatch$1(media, list[i2])) {
  78169. return true;
  78170. }
  78171. if (list[i2].playlists && groupMatch$1(list[i2].playlists, media)) {
  78172. return true;
  78173. }
  78174. }
  78175. return false;
  78176. };
  78177. const activeGroup$1 = (type2, settings) => (track) => {
  78178. const {
  78179. mainPlaylistLoader,
  78180. mediaTypes: {
  78181. [type2]: {
  78182. groups
  78183. }
  78184. }
  78185. } = settings;
  78186. const media = mainPlaylistLoader.media();
  78187. if (!media) {
  78188. return null;
  78189. }
  78190. let variants = null;
  78191. if (media.attributes[type2]) {
  78192. variants = groups[media.attributes[type2]];
  78193. }
  78194. const groupKeys = Object.keys(groups);
  78195. if (!variants) {
  78196. if (type2 === "AUDIO" && groupKeys.length > 1 && isAudioOnly$1(settings.main)) {
  78197. for (let i2 = 0; i2 < groupKeys.length; i2++) {
  78198. const groupPropertyList = groups[groupKeys[i2]];
  78199. if (groupMatch$1(groupPropertyList, media)) {
  78200. variants = groupPropertyList;
  78201. break;
  78202. }
  78203. }
  78204. } else if (groups.main) {
  78205. variants = groups.main;
  78206. } else if (groupKeys.length === 1) {
  78207. variants = groups[groupKeys[0]];
  78208. }
  78209. }
  78210. if (typeof track === "undefined") {
  78211. return variants;
  78212. }
  78213. if (track === null || !variants) {
  78214. return null;
  78215. }
  78216. return variants.filter((props) => props.id === track.id)[0] || null;
  78217. };
  78218. const activeTrack$1 = {
  78219. AUDIO: (type2, settings) => () => {
  78220. const {
  78221. mediaTypes: {
  78222. [type2]: {
  78223. tracks
  78224. }
  78225. }
  78226. } = settings;
  78227. for (const id in tracks) {
  78228. if (tracks[id].enabled) {
  78229. return tracks[id];
  78230. }
  78231. }
  78232. return null;
  78233. },
  78234. SUBTITLES: (type2, settings) => () => {
  78235. const {
  78236. mediaTypes: {
  78237. [type2]: {
  78238. tracks
  78239. }
  78240. }
  78241. } = settings;
  78242. for (const id in tracks) {
  78243. if (tracks[id].mode === "showing" || tracks[id].mode === "hidden") {
  78244. return tracks[id];
  78245. }
  78246. }
  78247. return null;
  78248. }
  78249. };
  78250. const getActiveGroup$1 = (type2, {
  78251. mediaTypes: mediaTypes2
  78252. }) => () => {
  78253. const activeTrack_ = mediaTypes2[type2].activeTrack();
  78254. if (!activeTrack_) {
  78255. return null;
  78256. }
  78257. return mediaTypes2[type2].activeGroup(activeTrack_);
  78258. };
  78259. const setupMediaGroups$1 = (settings) => {
  78260. ["AUDIO", "SUBTITLES", "CLOSED-CAPTIONS"].forEach((type2) => {
  78261. initialize$1[type2](type2, settings);
  78262. });
  78263. const {
  78264. mediaTypes: mediaTypes2,
  78265. mainPlaylistLoader,
  78266. tech,
  78267. vhs,
  78268. segmentLoaders: {
  78269. ["AUDIO"]: audioSegmentLoader,
  78270. main: mainSegmentLoader
  78271. }
  78272. } = settings;
  78273. ["AUDIO", "SUBTITLES"].forEach((type2) => {
  78274. mediaTypes2[type2].activeGroup = activeGroup$1(type2, settings);
  78275. mediaTypes2[type2].activeTrack = activeTrack$1[type2](type2, settings);
  78276. mediaTypes2[type2].onGroupChanged = onGroupChanged$1(type2, settings);
  78277. mediaTypes2[type2].onGroupChanging = onGroupChanging$1(type2, settings);
  78278. mediaTypes2[type2].onTrackChanged = onTrackChanged$1(type2, settings);
  78279. mediaTypes2[type2].getActiveGroup = getActiveGroup$1(type2, settings);
  78280. });
  78281. const audioGroup = mediaTypes2.AUDIO.activeGroup();
  78282. if (audioGroup) {
  78283. const groupId = (audioGroup.filter((group) => group.default)[0] || audioGroup[0]).id;
  78284. mediaTypes2.AUDIO.tracks[groupId].enabled = true;
  78285. mediaTypes2.AUDIO.onGroupChanged();
  78286. mediaTypes2.AUDIO.onTrackChanged();
  78287. const activeAudioGroup = mediaTypes2.AUDIO.getActiveGroup();
  78288. if (!activeAudioGroup.playlistLoader) {
  78289. mainSegmentLoader.setAudio(true);
  78290. } else {
  78291. mainSegmentLoader.setAudio(false);
  78292. audioSegmentLoader.setAudio(true);
  78293. }
  78294. }
  78295. mainPlaylistLoader.on("mediachange", () => {
  78296. ["AUDIO", "SUBTITLES"].forEach((type2) => mediaTypes2[type2].onGroupChanged());
  78297. });
  78298. mainPlaylistLoader.on("mediachanging", () => {
  78299. ["AUDIO", "SUBTITLES"].forEach((type2) => mediaTypes2[type2].onGroupChanging());
  78300. });
  78301. const onAudioTrackChanged = () => {
  78302. mediaTypes2.AUDIO.onTrackChanged();
  78303. tech.trigger({
  78304. type: "usage",
  78305. name: "vhs-audio-change"
  78306. });
  78307. };
  78308. tech.audioTracks().addEventListener("change", onAudioTrackChanged);
  78309. tech.remoteTextTracks().addEventListener("change", mediaTypes2.SUBTITLES.onTrackChanged);
  78310. vhs.on("dispose", () => {
  78311. tech.audioTracks().removeEventListener("change", onAudioTrackChanged);
  78312. tech.remoteTextTracks().removeEventListener("change", mediaTypes2.SUBTITLES.onTrackChanged);
  78313. });
  78314. tech.clearTracks("audio");
  78315. for (const id in mediaTypes2.AUDIO.tracks) {
  78316. tech.audioTracks().addTrack(mediaTypes2.AUDIO.tracks[id]);
  78317. }
  78318. };
  78319. const createMediaTypes$1 = () => {
  78320. const mediaTypes2 = {};
  78321. ["AUDIO", "SUBTITLES", "CLOSED-CAPTIONS"].forEach((type2) => {
  78322. mediaTypes2[type2] = {
  78323. groups: {},
  78324. tracks: {},
  78325. activePlaylistLoader: null,
  78326. activeGroup: noop$1,
  78327. activeTrack: noop$1,
  78328. getActiveGroup: noop$1,
  78329. onGroupChanged: noop$1,
  78330. onTrackChanged: noop$1,
  78331. lastTrack_: null,
  78332. logger_: logger$1(`MediaGroups[${type2}]`)
  78333. };
  78334. });
  78335. return mediaTypes2;
  78336. };
  78337. const ABORT_EARLY_EXCLUSION_SECONDS = 60 * 2;
  78338. let Vhs$1$1;
  78339. const loaderStats$1 = ["mediaRequests", "mediaRequestsAborted", "mediaRequestsTimedout", "mediaRequestsErrored", "mediaTransferDuration", "mediaBytesTransferred", "mediaAppends"];
  78340. const sumLoaderStat$1 = function(stat) {
  78341. return this.audioSegmentLoader_[stat] + this.mainSegmentLoader_[stat];
  78342. };
  78343. const shouldSwitchToMedia$1 = function({
  78344. currentPlaylist,
  78345. buffered,
  78346. currentTime,
  78347. nextPlaylist,
  78348. bufferLowWaterLine,
  78349. bufferHighWaterLine,
  78350. duration: duration5,
  78351. bufferBasedABR,
  78352. log: log2
  78353. }) {
  78354. if (!nextPlaylist) {
  78355. videojs$2.log.warn("We received no playlist to switch to. Please check your stream.");
  78356. return false;
  78357. }
  78358. const sharedLogLine = `allowing switch ${currentPlaylist && currentPlaylist.id || "null"} -> ${nextPlaylist.id}`;
  78359. if (!currentPlaylist) {
  78360. log2(`${sharedLogLine} as current playlist is not set`);
  78361. return true;
  78362. }
  78363. if (nextPlaylist.id === currentPlaylist.id) {
  78364. return false;
  78365. }
  78366. const isBuffered = Boolean(findRange$1(buffered, currentTime).length);
  78367. if (!currentPlaylist.endList) {
  78368. if (!isBuffered && typeof currentPlaylist.partTargetDuration === "number") {
  78369. log2(`not ${sharedLogLine} as current playlist is live llhls, but currentTime isn't in buffered.`);
  78370. return false;
  78371. }
  78372. log2(`${sharedLogLine} as current playlist is live`);
  78373. return true;
  78374. }
  78375. const forwardBuffer = timeAheadOf$1(buffered, currentTime);
  78376. const maxBufferLowWaterLine = bufferBasedABR ? Config$1.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE : Config$1.MAX_BUFFER_LOW_WATER_LINE;
  78377. if (duration5 < maxBufferLowWaterLine) {
  78378. log2(`${sharedLogLine} as duration < max low water line (${duration5} < ${maxBufferLowWaterLine})`);
  78379. return true;
  78380. }
  78381. const nextBandwidth = nextPlaylist.attributes.BANDWIDTH;
  78382. const currBandwidth = currentPlaylist.attributes.BANDWIDTH;
  78383. if (nextBandwidth < currBandwidth && (!bufferBasedABR || forwardBuffer < bufferHighWaterLine)) {
  78384. let logLine = `${sharedLogLine} as next bandwidth < current bandwidth (${nextBandwidth} < ${currBandwidth})`;
  78385. if (bufferBasedABR) {
  78386. logLine += ` and forwardBuffer < bufferHighWaterLine (${forwardBuffer} < ${bufferHighWaterLine})`;
  78387. }
  78388. log2(logLine);
  78389. return true;
  78390. }
  78391. if ((!bufferBasedABR || nextBandwidth > currBandwidth) && forwardBuffer >= bufferLowWaterLine) {
  78392. let logLine = `${sharedLogLine} as forwardBuffer >= bufferLowWaterLine (${forwardBuffer} >= ${bufferLowWaterLine})`;
  78393. if (bufferBasedABR) {
  78394. logLine += ` and next bandwidth > current bandwidth (${nextBandwidth} > ${currBandwidth})`;
  78395. }
  78396. log2(logLine);
  78397. return true;
  78398. }
  78399. log2(`not ${sharedLogLine} as no switching criteria met`);
  78400. return false;
  78401. };
  78402. class PlaylistController extends videojs$2.EventTarget {
  78403. constructor(options2) {
  78404. super();
  78405. const {
  78406. src,
  78407. withCredentials,
  78408. tech,
  78409. bandwidth: bandwidth2,
  78410. externVhs,
  78411. useCueTags,
  78412. playlistExclusionDuration,
  78413. enableLowInitialPlaylist,
  78414. sourceType,
  78415. cacheEncryptionKeys,
  78416. bufferBasedABR,
  78417. leastPixelDiffSelector,
  78418. captionServices
  78419. } = options2;
  78420. if (!src) {
  78421. throw new Error("A non-empty playlist URL or JSON manifest string is required");
  78422. }
  78423. let {
  78424. maxPlaylistRetries
  78425. } = options2;
  78426. if (maxPlaylistRetries === null || typeof maxPlaylistRetries === "undefined") {
  78427. maxPlaylistRetries = Infinity;
  78428. }
  78429. Vhs$1$1 = externVhs;
  78430. this.bufferBasedABR = Boolean(bufferBasedABR);
  78431. this.leastPixelDiffSelector = Boolean(leastPixelDiffSelector);
  78432. this.withCredentials = withCredentials;
  78433. this.tech_ = tech;
  78434. this.vhs_ = tech.vhs;
  78435. this.sourceType_ = sourceType;
  78436. this.useCueTags_ = useCueTags;
  78437. this.playlistExclusionDuration = playlistExclusionDuration;
  78438. this.maxPlaylistRetries = maxPlaylistRetries;
  78439. this.enableLowInitialPlaylist = enableLowInitialPlaylist;
  78440. if (this.useCueTags_) {
  78441. this.cueTagsTrack_ = this.tech_.addTextTrack("metadata", "ad-cues");
  78442. this.cueTagsTrack_.inBandMetadataTrackDispatchType = "";
  78443. }
  78444. this.requestOptions_ = {
  78445. withCredentials,
  78446. maxPlaylistRetries,
  78447. timeout: null
  78448. };
  78449. this.on("error", this.pauseLoading);
  78450. this.mediaTypes_ = createMediaTypes$1();
  78451. this.mediaSource = new window_1.MediaSource();
  78452. this.handleDurationChange_ = this.handleDurationChange_.bind(this);
  78453. this.handleSourceOpen_ = this.handleSourceOpen_.bind(this);
  78454. this.handleSourceEnded_ = this.handleSourceEnded_.bind(this);
  78455. this.mediaSource.addEventListener("durationchange", this.handleDurationChange_);
  78456. this.mediaSource.addEventListener("sourceopen", this.handleSourceOpen_);
  78457. this.mediaSource.addEventListener("sourceended", this.handleSourceEnded_);
  78458. this.seekable_ = createTimeRanges$2();
  78459. this.hasPlayed_ = false;
  78460. this.syncController_ = new SyncController$1(options2);
  78461. this.segmentMetadataTrack_ = tech.addRemoteTextTrack({
  78462. kind: "metadata",
  78463. label: "segment-metadata"
  78464. }, false).track;
  78465. this.decrypter_ = new Decrypter$1();
  78466. this.sourceUpdater_ = new SourceUpdater$1(this.mediaSource);
  78467. this.inbandTextTracks_ = {};
  78468. this.timelineChangeController_ = new TimelineChangeController$1();
  78469. const segmentLoaderSettings = {
  78470. vhs: this.vhs_,
  78471. parse708captions: options2.parse708captions,
  78472. useDtsForTimestampOffset: options2.useDtsForTimestampOffset,
  78473. captionServices,
  78474. mediaSource: this.mediaSource,
  78475. currentTime: this.tech_.currentTime.bind(this.tech_),
  78476. seekable: () => this.seekable(),
  78477. seeking: () => this.tech_.seeking(),
  78478. duration: () => this.duration(),
  78479. hasPlayed: () => this.hasPlayed_,
  78480. goalBufferLength: () => this.goalBufferLength(),
  78481. bandwidth: bandwidth2,
  78482. syncController: this.syncController_,
  78483. decrypter: this.decrypter_,
  78484. sourceType: this.sourceType_,
  78485. inbandTextTracks: this.inbandTextTracks_,
  78486. cacheEncryptionKeys,
  78487. sourceUpdater: this.sourceUpdater_,
  78488. timelineChangeController: this.timelineChangeController_,
  78489. exactManifestTimings: options2.exactManifestTimings
  78490. };
  78491. this.mainPlaylistLoader_ = this.sourceType_ === "dash" ? new DashPlaylistLoader$1(src, this.vhs_, this.requestOptions_) : new PlaylistLoader$1(src, this.vhs_, this.requestOptions_);
  78492. this.setupMainPlaylistLoaderListeners_();
  78493. this.mainSegmentLoader_ = new SegmentLoader$1(merge$2(segmentLoaderSettings, {
  78494. segmentMetadataTrack: this.segmentMetadataTrack_,
  78495. loaderType: "main"
  78496. }), options2);
  78497. this.audioSegmentLoader_ = new SegmentLoader$1(merge$2(segmentLoaderSettings, {
  78498. loaderType: "audio"
  78499. }), options2);
  78500. this.subtitleSegmentLoader_ = new VTTSegmentLoader$1(merge$2(segmentLoaderSettings, {
  78501. loaderType: "vtt",
  78502. featuresNativeTextTracks: this.tech_.featuresNativeTextTracks,
  78503. loadVttJs: () => new Promise((resolve2, reject2) => {
  78504. function onLoad() {
  78505. tech.off("vttjserror", onError2);
  78506. resolve2();
  78507. }
  78508. function onError2() {
  78509. tech.off("vttjsloaded", onLoad);
  78510. reject2();
  78511. }
  78512. tech.one("vttjsloaded", onLoad);
  78513. tech.one("vttjserror", onError2);
  78514. tech.addWebVttScript_();
  78515. })
  78516. }), options2);
  78517. this.setupSegmentLoaderListeners_();
  78518. if (this.bufferBasedABR) {
  78519. this.mainPlaylistLoader_.one("loadedplaylist", () => this.startABRTimer_());
  78520. this.tech_.on("pause", () => this.stopABRTimer_());
  78521. this.tech_.on("play", () => this.startABRTimer_());
  78522. }
  78523. loaderStats$1.forEach((stat) => {
  78524. this[stat + "_"] = sumLoaderStat$1.bind(this, stat);
  78525. });
  78526. this.logger_ = logger$1("pc");
  78527. this.triggeredFmp4Usage = false;
  78528. if (this.tech_.preload() === "none") {
  78529. this.loadOnPlay_ = () => {
  78530. this.loadOnPlay_ = null;
  78531. this.mainPlaylistLoader_.load();
  78532. };
  78533. this.tech_.one("play", this.loadOnPlay_);
  78534. } else {
  78535. this.mainPlaylistLoader_.load();
  78536. }
  78537. this.timeToLoadedData__ = -1;
  78538. this.mainAppendsToLoadedData__ = -1;
  78539. this.audioAppendsToLoadedData__ = -1;
  78540. const event2 = this.tech_.preload() === "none" ? "play" : "loadstart";
  78541. this.tech_.one(event2, () => {
  78542. const timeToLoadedDataStart = Date.now();
  78543. this.tech_.one("loadeddata", () => {
  78544. this.timeToLoadedData__ = Date.now() - timeToLoadedDataStart;
  78545. this.mainAppendsToLoadedData__ = this.mainSegmentLoader_.mediaAppends;
  78546. this.audioAppendsToLoadedData__ = this.audioSegmentLoader_.mediaAppends;
  78547. });
  78548. });
  78549. }
  78550. mainAppendsToLoadedData_() {
  78551. return this.mainAppendsToLoadedData__;
  78552. }
  78553. audioAppendsToLoadedData_() {
  78554. return this.audioAppendsToLoadedData__;
  78555. }
  78556. appendsToLoadedData_() {
  78557. const main = this.mainAppendsToLoadedData_();
  78558. const audio = this.audioAppendsToLoadedData_();
  78559. if (main === -1 || audio === -1) {
  78560. return -1;
  78561. }
  78562. return main + audio;
  78563. }
  78564. timeToLoadedData_() {
  78565. return this.timeToLoadedData__;
  78566. }
  78567. checkABR_(reason = "abr") {
  78568. const nextPlaylist = this.selectPlaylist();
  78569. if (nextPlaylist && this.shouldSwitchToMedia_(nextPlaylist)) {
  78570. this.switchMedia_(nextPlaylist, reason);
  78571. }
  78572. }
  78573. switchMedia_(playlist, cause, delay) {
  78574. const oldMedia = this.media();
  78575. const oldId = oldMedia && (oldMedia.id || oldMedia.uri);
  78576. const newId = playlist.id || playlist.uri;
  78577. if (oldId && oldId !== newId) {
  78578. this.logger_(`switch media ${oldId} -> ${newId} from ${cause}`);
  78579. this.tech_.trigger({
  78580. type: "usage",
  78581. name: `vhs-rendition-change-${cause}`
  78582. });
  78583. }
  78584. this.mainPlaylistLoader_.media(playlist, delay);
  78585. }
  78586. startABRTimer_() {
  78587. this.stopABRTimer_();
  78588. this.abrTimer_ = window_1.setInterval(() => this.checkABR_(), 250);
  78589. }
  78590. stopABRTimer_() {
  78591. if (this.tech_.scrubbing && this.tech_.scrubbing()) {
  78592. return;
  78593. }
  78594. window_1.clearInterval(this.abrTimer_);
  78595. this.abrTimer_ = null;
  78596. }
  78597. getAudioTrackPlaylists_() {
  78598. const main = this.main();
  78599. const defaultPlaylists = main && main.playlists || [];
  78600. if (!main || !main.mediaGroups || !main.mediaGroups.AUDIO) {
  78601. return defaultPlaylists;
  78602. }
  78603. const AUDIO5 = main.mediaGroups.AUDIO;
  78604. const groupKeys = Object.keys(AUDIO5);
  78605. let track;
  78606. if (Object.keys(this.mediaTypes_.AUDIO.groups).length) {
  78607. track = this.mediaTypes_.AUDIO.activeTrack();
  78608. } else {
  78609. const defaultGroup = AUDIO5.main || groupKeys.length && AUDIO5[groupKeys[0]];
  78610. for (const label in defaultGroup) {
  78611. if (defaultGroup[label].default) {
  78612. track = {
  78613. label
  78614. };
  78615. break;
  78616. }
  78617. }
  78618. }
  78619. if (!track) {
  78620. return defaultPlaylists;
  78621. }
  78622. const playlists = [];
  78623. for (const group in AUDIO5) {
  78624. if (AUDIO5[group][track.label]) {
  78625. const properties = AUDIO5[group][track.label];
  78626. if (properties.playlists && properties.playlists.length) {
  78627. playlists.push.apply(playlists, properties.playlists);
  78628. } else if (properties.uri) {
  78629. playlists.push(properties);
  78630. } else if (main.playlists.length) {
  78631. for (let i2 = 0; i2 < main.playlists.length; i2++) {
  78632. const playlist = main.playlists[i2];
  78633. if (playlist.attributes && playlist.attributes.AUDIO && playlist.attributes.AUDIO === group) {
  78634. playlists.push(playlist);
  78635. }
  78636. }
  78637. }
  78638. }
  78639. }
  78640. if (!playlists.length) {
  78641. return defaultPlaylists;
  78642. }
  78643. return playlists;
  78644. }
  78645. setupMainPlaylistLoaderListeners_() {
  78646. this.mainPlaylistLoader_.on("loadedmetadata", () => {
  78647. const media = this.mainPlaylistLoader_.media();
  78648. const requestTimeout = media.targetDuration * 1.5 * 1e3;
  78649. if (isLowestEnabledRendition$1(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.media())) {
  78650. this.requestOptions_.timeout = 0;
  78651. } else {
  78652. this.requestOptions_.timeout = requestTimeout;
  78653. }
  78654. if (media.endList && this.tech_.preload() !== "none") {
  78655. this.mainSegmentLoader_.playlist(media, this.requestOptions_);
  78656. this.mainSegmentLoader_.load();
  78657. }
  78658. setupMediaGroups$1({
  78659. sourceType: this.sourceType_,
  78660. segmentLoaders: {
  78661. AUDIO: this.audioSegmentLoader_,
  78662. SUBTITLES: this.subtitleSegmentLoader_,
  78663. main: this.mainSegmentLoader_
  78664. },
  78665. tech: this.tech_,
  78666. requestOptions: this.requestOptions_,
  78667. mainPlaylistLoader: this.mainPlaylistLoader_,
  78668. vhs: this.vhs_,
  78669. main: this.main(),
  78670. mediaTypes: this.mediaTypes_,
  78671. excludePlaylist: this.excludePlaylist.bind(this)
  78672. });
  78673. this.triggerPresenceUsage_(this.main(), media);
  78674. this.setupFirstPlay();
  78675. if (!this.mediaTypes_.AUDIO.activePlaylistLoader || this.mediaTypes_.AUDIO.activePlaylistLoader.media()) {
  78676. this.trigger("selectedinitialmedia");
  78677. } else {
  78678. this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata", () => {
  78679. this.trigger("selectedinitialmedia");
  78680. });
  78681. }
  78682. });
  78683. this.mainPlaylistLoader_.on("loadedplaylist", () => {
  78684. if (this.loadOnPlay_) {
  78685. this.tech_.off("play", this.loadOnPlay_);
  78686. }
  78687. let updatedPlaylist = this.mainPlaylistLoader_.media();
  78688. if (!updatedPlaylist) {
  78689. this.excludeUnsupportedVariants_();
  78690. let selectedMedia;
  78691. if (this.enableLowInitialPlaylist) {
  78692. selectedMedia = this.selectInitialPlaylist();
  78693. }
  78694. if (!selectedMedia) {
  78695. selectedMedia = this.selectPlaylist();
  78696. }
  78697. if (!selectedMedia || !this.shouldSwitchToMedia_(selectedMedia)) {
  78698. return;
  78699. }
  78700. this.initialMedia_ = selectedMedia;
  78701. this.switchMedia_(this.initialMedia_, "initial");
  78702. const haveJsonSource = this.sourceType_ === "vhs-json" && this.initialMedia_.segments;
  78703. if (!haveJsonSource) {
  78704. return;
  78705. }
  78706. updatedPlaylist = this.initialMedia_;
  78707. }
  78708. this.handleUpdatedMediaPlaylist(updatedPlaylist);
  78709. });
  78710. this.mainPlaylistLoader_.on("error", () => {
  78711. const error = this.mainPlaylistLoader_.error;
  78712. this.excludePlaylist({
  78713. playlistToExclude: error.playlist,
  78714. error
  78715. });
  78716. });
  78717. this.mainPlaylistLoader_.on("mediachanging", () => {
  78718. this.mainSegmentLoader_.abort();
  78719. this.mainSegmentLoader_.pause();
  78720. });
  78721. this.mainPlaylistLoader_.on("mediachange", () => {
  78722. const media = this.mainPlaylistLoader_.media();
  78723. const requestTimeout = media.targetDuration * 1.5 * 1e3;
  78724. if (isLowestEnabledRendition$1(this.mainPlaylistLoader_.main, this.mainPlaylistLoader_.media())) {
  78725. this.requestOptions_.timeout = 0;
  78726. } else {
  78727. this.requestOptions_.timeout = requestTimeout;
  78728. }
  78729. this.mainPlaylistLoader_.load();
  78730. this.mainSegmentLoader_.playlist(media, this.requestOptions_);
  78731. this.mainSegmentLoader_.load();
  78732. this.tech_.trigger({
  78733. type: "mediachange",
  78734. bubbles: true
  78735. });
  78736. });
  78737. this.mainPlaylistLoader_.on("playlistunchanged", () => {
  78738. const updatedPlaylist = this.mainPlaylistLoader_.media();
  78739. if (updatedPlaylist.lastExcludeReason_ === "playlist-unchanged") {
  78740. return;
  78741. }
  78742. const playlistOutdated = this.stuckAtPlaylistEnd_(updatedPlaylist);
  78743. if (playlistOutdated) {
  78744. this.excludePlaylist({
  78745. error: {
  78746. message: "Playlist no longer updating.",
  78747. reason: "playlist-unchanged"
  78748. }
  78749. });
  78750. this.tech_.trigger("playliststuck");
  78751. }
  78752. });
  78753. this.mainPlaylistLoader_.on("renditiondisabled", () => {
  78754. this.tech_.trigger({
  78755. type: "usage",
  78756. name: "vhs-rendition-disabled"
  78757. });
  78758. });
  78759. this.mainPlaylistLoader_.on("renditionenabled", () => {
  78760. this.tech_.trigger({
  78761. type: "usage",
  78762. name: "vhs-rendition-enabled"
  78763. });
  78764. });
  78765. }
  78766. handleUpdatedMediaPlaylist(updatedPlaylist) {
  78767. if (this.useCueTags_) {
  78768. this.updateAdCues_(updatedPlaylist);
  78769. }
  78770. this.mainSegmentLoader_.playlist(updatedPlaylist, this.requestOptions_);
  78771. this.updateDuration(!updatedPlaylist.endList);
  78772. if (!this.tech_.paused()) {
  78773. this.mainSegmentLoader_.load();
  78774. if (this.audioSegmentLoader_) {
  78775. this.audioSegmentLoader_.load();
  78776. }
  78777. }
  78778. }
  78779. triggerPresenceUsage_(main, media) {
  78780. const mediaGroups = main.mediaGroups || {};
  78781. let defaultDemuxed = true;
  78782. const audioGroupKeys = Object.keys(mediaGroups.AUDIO);
  78783. for (const mediaGroup in mediaGroups.AUDIO) {
  78784. for (const label in mediaGroups.AUDIO[mediaGroup]) {
  78785. const properties = mediaGroups.AUDIO[mediaGroup][label];
  78786. if (!properties.uri) {
  78787. defaultDemuxed = false;
  78788. }
  78789. }
  78790. }
  78791. if (defaultDemuxed) {
  78792. this.tech_.trigger({
  78793. type: "usage",
  78794. name: "vhs-demuxed"
  78795. });
  78796. }
  78797. if (Object.keys(mediaGroups.SUBTITLES).length) {
  78798. this.tech_.trigger({
  78799. type: "usage",
  78800. name: "vhs-webvtt"
  78801. });
  78802. }
  78803. if (Vhs$1$1.Playlist.isAes(media)) {
  78804. this.tech_.trigger({
  78805. type: "usage",
  78806. name: "vhs-aes"
  78807. });
  78808. }
  78809. if (audioGroupKeys.length && Object.keys(mediaGroups.AUDIO[audioGroupKeys[0]]).length > 1) {
  78810. this.tech_.trigger({
  78811. type: "usage",
  78812. name: "vhs-alternate-audio"
  78813. });
  78814. }
  78815. if (this.useCueTags_) {
  78816. this.tech_.trigger({
  78817. type: "usage",
  78818. name: "vhs-playlist-cue-tags"
  78819. });
  78820. }
  78821. }
  78822. shouldSwitchToMedia_(nextPlaylist) {
  78823. const currentPlaylist = this.mainPlaylistLoader_.media() || this.mainPlaylistLoader_.pendingMedia_;
  78824. const currentTime = this.tech_.currentTime();
  78825. const bufferLowWaterLine = this.bufferLowWaterLine();
  78826. const bufferHighWaterLine = this.bufferHighWaterLine();
  78827. const buffered = this.tech_.buffered();
  78828. return shouldSwitchToMedia$1({
  78829. buffered,
  78830. currentTime,
  78831. currentPlaylist,
  78832. nextPlaylist,
  78833. bufferLowWaterLine,
  78834. bufferHighWaterLine,
  78835. duration: this.duration(),
  78836. bufferBasedABR: this.bufferBasedABR,
  78837. log: this.logger_
  78838. });
  78839. }
  78840. setupSegmentLoaderListeners_() {
  78841. this.mainSegmentLoader_.on("bandwidthupdate", () => {
  78842. this.checkABR_("bandwidthupdate");
  78843. this.tech_.trigger("bandwidthupdate");
  78844. });
  78845. this.mainSegmentLoader_.on("timeout", () => {
  78846. if (this.bufferBasedABR) {
  78847. this.mainSegmentLoader_.load();
  78848. }
  78849. });
  78850. if (!this.bufferBasedABR) {
  78851. this.mainSegmentLoader_.on("progress", () => {
  78852. this.trigger("progress");
  78853. });
  78854. }
  78855. this.mainSegmentLoader_.on("error", () => {
  78856. const error = this.mainSegmentLoader_.error();
  78857. this.excludePlaylist({
  78858. playlistToExclude: error.playlist,
  78859. error
  78860. });
  78861. });
  78862. this.mainSegmentLoader_.on("appenderror", () => {
  78863. this.error = this.mainSegmentLoader_.error_;
  78864. this.trigger("error");
  78865. });
  78866. this.mainSegmentLoader_.on("syncinfoupdate", () => {
  78867. this.onSyncInfoUpdate_();
  78868. });
  78869. this.mainSegmentLoader_.on("timestampoffset", () => {
  78870. this.tech_.trigger({
  78871. type: "usage",
  78872. name: "vhs-timestamp-offset"
  78873. });
  78874. });
  78875. this.audioSegmentLoader_.on("syncinfoupdate", () => {
  78876. this.onSyncInfoUpdate_();
  78877. });
  78878. this.audioSegmentLoader_.on("appenderror", () => {
  78879. this.error = this.audioSegmentLoader_.error_;
  78880. this.trigger("error");
  78881. });
  78882. this.mainSegmentLoader_.on("ended", () => {
  78883. this.logger_("main segment loader ended");
  78884. this.onEndOfStream();
  78885. });
  78886. this.mainSegmentLoader_.on("earlyabort", (event2) => {
  78887. if (this.bufferBasedABR) {
  78888. return;
  78889. }
  78890. this.delegateLoaders_("all", ["abort"]);
  78891. this.excludePlaylist({
  78892. error: {
  78893. message: "Aborted early because there isn't enough bandwidth to complete the request without rebuffering."
  78894. },
  78895. playlistExclusionDuration: ABORT_EARLY_EXCLUSION_SECONDS
  78896. });
  78897. });
  78898. const updateCodecs = () => {
  78899. if (!this.sourceUpdater_.hasCreatedSourceBuffers()) {
  78900. return this.tryToCreateSourceBuffers_();
  78901. }
  78902. const codecs = this.getCodecsOrExclude_();
  78903. if (!codecs) {
  78904. return;
  78905. }
  78906. this.sourceUpdater_.addOrChangeSourceBuffers(codecs);
  78907. };
  78908. this.mainSegmentLoader_.on("trackinfo", updateCodecs);
  78909. this.audioSegmentLoader_.on("trackinfo", updateCodecs);
  78910. this.mainSegmentLoader_.on("fmp4", () => {
  78911. if (!this.triggeredFmp4Usage) {
  78912. this.tech_.trigger({
  78913. type: "usage",
  78914. name: "vhs-fmp4"
  78915. });
  78916. this.triggeredFmp4Usage = true;
  78917. }
  78918. });
  78919. this.audioSegmentLoader_.on("fmp4", () => {
  78920. if (!this.triggeredFmp4Usage) {
  78921. this.tech_.trigger({
  78922. type: "usage",
  78923. name: "vhs-fmp4"
  78924. });
  78925. this.triggeredFmp4Usage = true;
  78926. }
  78927. });
  78928. this.audioSegmentLoader_.on("ended", () => {
  78929. this.logger_("audioSegmentLoader ended");
  78930. this.onEndOfStream();
  78931. });
  78932. }
  78933. mediaSecondsLoaded_() {
  78934. return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded + this.mainSegmentLoader_.mediaSecondsLoaded);
  78935. }
  78936. load() {
  78937. this.mainSegmentLoader_.load();
  78938. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  78939. this.audioSegmentLoader_.load();
  78940. }
  78941. if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {
  78942. this.subtitleSegmentLoader_.load();
  78943. }
  78944. }
  78945. fastQualityChange_(media = this.selectPlaylist()) {
  78946. if (media === this.mainPlaylistLoader_.media()) {
  78947. this.logger_("skipping fastQualityChange because new media is same as old");
  78948. return;
  78949. }
  78950. this.switchMedia_(media, "fast-quality");
  78951. this.mainSegmentLoader_.resetEverything(() => {
  78952. if (videojs$2.browser.IE_VERSION || videojs$2.browser.IS_EDGE) {
  78953. this.tech_.setCurrentTime(this.tech_.currentTime() + 0.04);
  78954. } else {
  78955. this.tech_.setCurrentTime(this.tech_.currentTime());
  78956. }
  78957. });
  78958. }
  78959. play() {
  78960. if (this.setupFirstPlay()) {
  78961. return;
  78962. }
  78963. if (this.tech_.ended()) {
  78964. this.tech_.setCurrentTime(0);
  78965. }
  78966. if (this.hasPlayed_) {
  78967. this.load();
  78968. }
  78969. const seekable3 = this.tech_.seekable();
  78970. if (this.tech_.duration() === Infinity) {
  78971. if (this.tech_.currentTime() < seekable3.start(0)) {
  78972. return this.tech_.setCurrentTime(seekable3.end(seekable3.length - 1));
  78973. }
  78974. }
  78975. }
  78976. setupFirstPlay() {
  78977. const media = this.mainPlaylistLoader_.media();
  78978. if (!media || this.tech_.paused() || this.hasPlayed_) {
  78979. return false;
  78980. }
  78981. if (!media.endList) {
  78982. const seekable3 = this.seekable();
  78983. if (!seekable3.length) {
  78984. return false;
  78985. }
  78986. if (videojs$2.browser.IE_VERSION && this.tech_.readyState() === 0) {
  78987. this.tech_.one("loadedmetadata", () => {
  78988. this.trigger("firstplay");
  78989. this.tech_.setCurrentTime(seekable3.end(0));
  78990. this.hasPlayed_ = true;
  78991. });
  78992. return false;
  78993. }
  78994. this.trigger("firstplay");
  78995. this.tech_.setCurrentTime(seekable3.end(0));
  78996. }
  78997. this.hasPlayed_ = true;
  78998. this.load();
  78999. return true;
  79000. }
  79001. handleSourceOpen_() {
  79002. this.tryToCreateSourceBuffers_();
  79003. if (this.tech_.autoplay()) {
  79004. const playPromise = this.tech_.play();
  79005. if (typeof playPromise !== "undefined" && typeof playPromise.then === "function") {
  79006. playPromise.then(null, (e) => {
  79007. });
  79008. }
  79009. }
  79010. this.trigger("sourceopen");
  79011. }
  79012. handleSourceEnded_() {
  79013. if (!this.inbandTextTracks_.metadataTrack_) {
  79014. return;
  79015. }
  79016. const cues = this.inbandTextTracks_.metadataTrack_.cues;
  79017. if (!cues || !cues.length) {
  79018. return;
  79019. }
  79020. const duration5 = this.duration();
  79021. cues[cues.length - 1].endTime = isNaN(duration5) || Math.abs(duration5) === Infinity ? Number.MAX_VALUE : duration5;
  79022. }
  79023. handleDurationChange_() {
  79024. this.tech_.trigger("durationchange");
  79025. }
  79026. onEndOfStream() {
  79027. let isEndOfStream = this.mainSegmentLoader_.ended_;
  79028. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  79029. const mainMediaInfo = this.mainSegmentLoader_.getCurrentMediaInfo_();
  79030. if (!mainMediaInfo || mainMediaInfo.hasVideo) {
  79031. isEndOfStream = isEndOfStream && this.audioSegmentLoader_.ended_;
  79032. } else {
  79033. isEndOfStream = this.audioSegmentLoader_.ended_;
  79034. }
  79035. }
  79036. if (!isEndOfStream) {
  79037. return;
  79038. }
  79039. this.stopABRTimer_();
  79040. this.sourceUpdater_.endOfStream();
  79041. }
  79042. stuckAtPlaylistEnd_(playlist) {
  79043. const seekable3 = this.seekable();
  79044. if (!seekable3.length) {
  79045. return false;
  79046. }
  79047. const expired = this.syncController_.getExpiredTime(playlist, this.duration());
  79048. if (expired === null) {
  79049. return false;
  79050. }
  79051. const absolutePlaylistEnd = Vhs$1$1.Playlist.playlistEnd(playlist, expired);
  79052. const currentTime = this.tech_.currentTime();
  79053. const buffered = this.tech_.buffered();
  79054. if (!buffered.length) {
  79055. return absolutePlaylistEnd - currentTime <= SAFE_TIME_DELTA$1;
  79056. }
  79057. const bufferedEnd = buffered.end(buffered.length - 1);
  79058. return bufferedEnd - currentTime <= SAFE_TIME_DELTA$1 && absolutePlaylistEnd - bufferedEnd <= SAFE_TIME_DELTA$1;
  79059. }
  79060. excludePlaylist({
  79061. playlistToExclude = this.mainPlaylistLoader_.media(),
  79062. error = {},
  79063. playlistExclusionDuration
  79064. }) {
  79065. playlistToExclude = playlistToExclude || this.mainPlaylistLoader_.media();
  79066. playlistExclusionDuration = playlistExclusionDuration || error.playlistExclusionDuration || this.playlistExclusionDuration;
  79067. if (!playlistToExclude) {
  79068. this.error = error;
  79069. if (this.mediaSource.readyState !== "open") {
  79070. this.trigger("error");
  79071. } else {
  79072. this.sourceUpdater_.endOfStream("network");
  79073. }
  79074. return;
  79075. }
  79076. playlistToExclude.playlistErrors_++;
  79077. const playlists = this.mainPlaylistLoader_.main.playlists;
  79078. const enabledPlaylists = playlists.filter(isEnabled$1);
  79079. const isFinalRendition = enabledPlaylists.length === 1 && enabledPlaylists[0] === playlistToExclude;
  79080. if (playlists.length === 1 && playlistExclusionDuration !== Infinity) {
  79081. videojs$2.log.warn(`Problem encountered with playlist ${playlistToExclude.id}. Trying again since it is the only playlist.`);
  79082. this.tech_.trigger("retryplaylist");
  79083. return this.mainPlaylistLoader_.load(isFinalRendition);
  79084. }
  79085. if (isFinalRendition) {
  79086. let reincluded = false;
  79087. playlists.forEach((playlist) => {
  79088. if (playlist === playlistToExclude) {
  79089. return;
  79090. }
  79091. const excludeUntil2 = playlist.excludeUntil;
  79092. if (typeof excludeUntil2 !== "undefined" && excludeUntil2 !== Infinity) {
  79093. reincluded = true;
  79094. delete playlist.excludeUntil;
  79095. }
  79096. });
  79097. if (reincluded) {
  79098. videojs$2.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded.");
  79099. this.tech_.trigger("retryplaylist");
  79100. }
  79101. }
  79102. let excludeUntil;
  79103. if (playlistToExclude.playlistErrors_ > this.maxPlaylistRetries) {
  79104. excludeUntil = Infinity;
  79105. } else {
  79106. excludeUntil = Date.now() + playlistExclusionDuration * 1e3;
  79107. }
  79108. playlistToExclude.excludeUntil = excludeUntil;
  79109. if (error.reason) {
  79110. playlistToExclude.lastExcludeReason_ = error.reason;
  79111. }
  79112. this.tech_.trigger("excludeplaylist");
  79113. this.tech_.trigger({
  79114. type: "usage",
  79115. name: "vhs-rendition-excluded"
  79116. });
  79117. const nextPlaylist = this.selectPlaylist();
  79118. if (!nextPlaylist) {
  79119. this.error = "Playback cannot continue. No available working or supported playlists.";
  79120. this.trigger("error");
  79121. return;
  79122. }
  79123. const logFn2 = error.internal ? this.logger_ : videojs$2.log.warn;
  79124. const errorMessage = error.message ? " " + error.message : "";
  79125. logFn2(`${error.internal ? "Internal problem" : "Problem"} encountered with playlist ${playlistToExclude.id}.${errorMessage} Switching to playlist ${nextPlaylist.id}.`);
  79126. if (nextPlaylist.attributes.AUDIO !== playlistToExclude.attributes.AUDIO) {
  79127. this.delegateLoaders_("audio", ["abort", "pause"]);
  79128. }
  79129. if (nextPlaylist.attributes.SUBTITLES !== playlistToExclude.attributes.SUBTITLES) {
  79130. this.delegateLoaders_("subtitle", ["abort", "pause"]);
  79131. }
  79132. this.delegateLoaders_("main", ["abort", "pause"]);
  79133. const delayDuration = nextPlaylist.targetDuration / 2 * 1e3 || 5 * 1e3;
  79134. const shouldDelay = typeof nextPlaylist.lastRequest === "number" && Date.now() - nextPlaylist.lastRequest <= delayDuration;
  79135. return this.switchMedia_(nextPlaylist, "exclude", isFinalRendition || shouldDelay);
  79136. }
  79137. pauseLoading() {
  79138. this.delegateLoaders_("all", ["abort", "pause"]);
  79139. this.stopABRTimer_();
  79140. }
  79141. delegateLoaders_(filter, fnNames) {
  79142. const loaders = [];
  79143. const dontFilterPlaylist = filter === "all";
  79144. if (dontFilterPlaylist || filter === "main") {
  79145. loaders.push(this.mainPlaylistLoader_);
  79146. }
  79147. const mediaTypes2 = [];
  79148. if (dontFilterPlaylist || filter === "audio") {
  79149. mediaTypes2.push("AUDIO");
  79150. }
  79151. if (dontFilterPlaylist || filter === "subtitle") {
  79152. mediaTypes2.push("CLOSED-CAPTIONS");
  79153. mediaTypes2.push("SUBTITLES");
  79154. }
  79155. mediaTypes2.forEach((mediaType) => {
  79156. const loader = this.mediaTypes_[mediaType] && this.mediaTypes_[mediaType].activePlaylistLoader;
  79157. if (loader) {
  79158. loaders.push(loader);
  79159. }
  79160. });
  79161. ["main", "audio", "subtitle"].forEach((name) => {
  79162. const loader = this[`${name}SegmentLoader_`];
  79163. if (loader && (filter === name || filter === "all")) {
  79164. loaders.push(loader);
  79165. }
  79166. });
  79167. loaders.forEach((loader) => fnNames.forEach((fnName) => {
  79168. if (typeof loader[fnName] === "function") {
  79169. loader[fnName]();
  79170. }
  79171. }));
  79172. }
  79173. setCurrentTime(currentTime) {
  79174. const buffered = findRange$1(this.tech_.buffered(), currentTime);
  79175. if (!(this.mainPlaylistLoader_ && this.mainPlaylistLoader_.media())) {
  79176. return 0;
  79177. }
  79178. if (!this.mainPlaylistLoader_.media().segments) {
  79179. return 0;
  79180. }
  79181. if (buffered && buffered.length) {
  79182. return currentTime;
  79183. }
  79184. this.mainSegmentLoader_.resetEverything();
  79185. this.mainSegmentLoader_.abort();
  79186. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  79187. this.audioSegmentLoader_.resetEverything();
  79188. this.audioSegmentLoader_.abort();
  79189. }
  79190. if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {
  79191. this.subtitleSegmentLoader_.resetEverything();
  79192. this.subtitleSegmentLoader_.abort();
  79193. }
  79194. this.load();
  79195. }
  79196. duration() {
  79197. if (!this.mainPlaylistLoader_) {
  79198. return 0;
  79199. }
  79200. const media = this.mainPlaylistLoader_.media();
  79201. if (!media) {
  79202. return 0;
  79203. }
  79204. if (!media.endList) {
  79205. return Infinity;
  79206. }
  79207. if (this.mediaSource) {
  79208. return this.mediaSource.duration;
  79209. }
  79210. return Vhs$1$1.Playlist.duration(media);
  79211. }
  79212. seekable() {
  79213. return this.seekable_;
  79214. }
  79215. onSyncInfoUpdate_() {
  79216. let audioSeekable;
  79217. if (!this.mainPlaylistLoader_) {
  79218. return;
  79219. }
  79220. let media = this.mainPlaylistLoader_.media();
  79221. if (!media) {
  79222. return;
  79223. }
  79224. let expired = this.syncController_.getExpiredTime(media, this.duration());
  79225. if (expired === null) {
  79226. return;
  79227. }
  79228. const main = this.mainPlaylistLoader_.main;
  79229. const mainSeekable = Vhs$1$1.Playlist.seekable(media, expired, Vhs$1$1.Playlist.liveEdgeDelay(main, media));
  79230. if (mainSeekable.length === 0) {
  79231. return;
  79232. }
  79233. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  79234. media = this.mediaTypes_.AUDIO.activePlaylistLoader.media();
  79235. expired = this.syncController_.getExpiredTime(media, this.duration());
  79236. if (expired === null) {
  79237. return;
  79238. }
  79239. audioSeekable = Vhs$1$1.Playlist.seekable(media, expired, Vhs$1$1.Playlist.liveEdgeDelay(main, media));
  79240. if (audioSeekable.length === 0) {
  79241. return;
  79242. }
  79243. }
  79244. let oldEnd;
  79245. let oldStart;
  79246. if (this.seekable_ && this.seekable_.length) {
  79247. oldEnd = this.seekable_.end(0);
  79248. oldStart = this.seekable_.start(0);
  79249. }
  79250. if (!audioSeekable) {
  79251. this.seekable_ = mainSeekable;
  79252. } else if (audioSeekable.start(0) > mainSeekable.end(0) || mainSeekable.start(0) > audioSeekable.end(0)) {
  79253. this.seekable_ = mainSeekable;
  79254. } else {
  79255. this.seekable_ = createTimeRanges$2([[audioSeekable.start(0) > mainSeekable.start(0) ? audioSeekable.start(0) : mainSeekable.start(0), audioSeekable.end(0) < mainSeekable.end(0) ? audioSeekable.end(0) : mainSeekable.end(0)]]);
  79256. }
  79257. if (this.seekable_ && this.seekable_.length) {
  79258. if (this.seekable_.end(0) === oldEnd && this.seekable_.start(0) === oldStart) {
  79259. return;
  79260. }
  79261. }
  79262. this.logger_(`seekable updated [${printableRange$1(this.seekable_)}]`);
  79263. this.tech_.trigger("seekablechanged");
  79264. }
  79265. updateDuration(isLive) {
  79266. if (this.updateDuration_) {
  79267. this.mediaSource.removeEventListener("sourceopen", this.updateDuration_);
  79268. this.updateDuration_ = null;
  79269. }
  79270. if (this.mediaSource.readyState !== "open") {
  79271. this.updateDuration_ = this.updateDuration.bind(this, isLive);
  79272. this.mediaSource.addEventListener("sourceopen", this.updateDuration_);
  79273. return;
  79274. }
  79275. if (isLive) {
  79276. const seekable3 = this.seekable();
  79277. if (!seekable3.length) {
  79278. return;
  79279. }
  79280. if (isNaN(this.mediaSource.duration) || this.mediaSource.duration < seekable3.end(seekable3.length - 1)) {
  79281. this.sourceUpdater_.setDuration(seekable3.end(seekable3.length - 1));
  79282. }
  79283. return;
  79284. }
  79285. const buffered = this.tech_.buffered();
  79286. let duration5 = Vhs$1$1.Playlist.duration(this.mainPlaylistLoader_.media());
  79287. if (buffered.length > 0) {
  79288. duration5 = Math.max(duration5, buffered.end(buffered.length - 1));
  79289. }
  79290. if (this.mediaSource.duration !== duration5) {
  79291. this.sourceUpdater_.setDuration(duration5);
  79292. }
  79293. }
  79294. dispose() {
  79295. this.trigger("dispose");
  79296. this.decrypter_.terminate();
  79297. this.mainPlaylistLoader_.dispose();
  79298. this.mainSegmentLoader_.dispose();
  79299. if (this.loadOnPlay_) {
  79300. this.tech_.off("play", this.loadOnPlay_);
  79301. }
  79302. ["AUDIO", "SUBTITLES"].forEach((type2) => {
  79303. const groups = this.mediaTypes_[type2].groups;
  79304. for (const id in groups) {
  79305. groups[id].forEach((group) => {
  79306. if (group.playlistLoader) {
  79307. group.playlistLoader.dispose();
  79308. }
  79309. });
  79310. }
  79311. });
  79312. this.audioSegmentLoader_.dispose();
  79313. this.subtitleSegmentLoader_.dispose();
  79314. this.sourceUpdater_.dispose();
  79315. this.timelineChangeController_.dispose();
  79316. this.stopABRTimer_();
  79317. if (this.updateDuration_) {
  79318. this.mediaSource.removeEventListener("sourceopen", this.updateDuration_);
  79319. }
  79320. this.mediaSource.removeEventListener("durationchange", this.handleDurationChange_);
  79321. this.mediaSource.removeEventListener("sourceopen", this.handleSourceOpen_);
  79322. this.mediaSource.removeEventListener("sourceended", this.handleSourceEnded_);
  79323. this.off();
  79324. }
  79325. main() {
  79326. return this.mainPlaylistLoader_.main;
  79327. }
  79328. media() {
  79329. return this.mainPlaylistLoader_.media() || this.initialMedia_;
  79330. }
  79331. areMediaTypesKnown_() {
  79332. const usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;
  79333. const hasMainMediaInfo = !!this.mainSegmentLoader_.getCurrentMediaInfo_();
  79334. const hasAudioMediaInfo = !usingAudioLoader ? true : !!this.audioSegmentLoader_.getCurrentMediaInfo_();
  79335. if (!hasMainMediaInfo || !hasAudioMediaInfo) {
  79336. return false;
  79337. }
  79338. return true;
  79339. }
  79340. getCodecsOrExclude_() {
  79341. const media = {
  79342. main: this.mainSegmentLoader_.getCurrentMediaInfo_() || {},
  79343. audio: this.audioSegmentLoader_.getCurrentMediaInfo_() || {}
  79344. };
  79345. const playlist = this.mainSegmentLoader_.getPendingSegmentPlaylist() || this.media();
  79346. media.video = media.main;
  79347. const playlistCodecs = codecsForPlaylist$1(this.main(), playlist);
  79348. const codecs = {};
  79349. const usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;
  79350. if (media.main.hasVideo) {
  79351. codecs.video = playlistCodecs.video || media.main.videoCodec || DEFAULT_VIDEO_CODEC$1;
  79352. }
  79353. if (media.main.isMuxed) {
  79354. codecs.video += `,${playlistCodecs.audio || media.main.audioCodec || DEFAULT_AUDIO_CODEC$1}`;
  79355. }
  79356. if (media.main.hasAudio && !media.main.isMuxed || media.audio.hasAudio || usingAudioLoader) {
  79357. codecs.audio = playlistCodecs.audio || media.main.audioCodec || media.audio.audioCodec || DEFAULT_AUDIO_CODEC$1;
  79358. media.audio.isFmp4 = media.main.hasAudio && !media.main.isMuxed ? media.main.isFmp4 : media.audio.isFmp4;
  79359. }
  79360. if (!codecs.audio && !codecs.video) {
  79361. this.excludePlaylist({
  79362. playlistToExclude: playlist,
  79363. error: {
  79364. message: "Could not determine codecs for playlist."
  79365. },
  79366. playlistExclusionDuration: Infinity
  79367. });
  79368. return;
  79369. }
  79370. const supportFunction = (isFmp4, codec) => isFmp4 ? browserSupportsCodec$1(codec) : muxerSupportsCodec$1(codec);
  79371. const unsupportedCodecs = {};
  79372. let unsupportedAudio;
  79373. ["video", "audio"].forEach(function(type2) {
  79374. if (codecs.hasOwnProperty(type2) && !supportFunction(media[type2].isFmp4, codecs[type2])) {
  79375. const supporter = media[type2].isFmp4 ? "browser" : "muxer";
  79376. unsupportedCodecs[supporter] = unsupportedCodecs[supporter] || [];
  79377. unsupportedCodecs[supporter].push(codecs[type2]);
  79378. if (type2 === "audio") {
  79379. unsupportedAudio = supporter;
  79380. }
  79381. }
  79382. });
  79383. if (usingAudioLoader && unsupportedAudio && playlist.attributes.AUDIO) {
  79384. const audioGroup = playlist.attributes.AUDIO;
  79385. this.main().playlists.forEach((variant) => {
  79386. const variantAudioGroup = variant.attributes && variant.attributes.AUDIO;
  79387. if (variantAudioGroup === audioGroup && variant !== playlist) {
  79388. variant.excludeUntil = Infinity;
  79389. }
  79390. });
  79391. this.logger_(`excluding audio group ${audioGroup} as ${unsupportedAudio} does not support codec(s): "${codecs.audio}"`);
  79392. }
  79393. if (Object.keys(unsupportedCodecs).length) {
  79394. const message = Object.keys(unsupportedCodecs).reduce((acc, supporter) => {
  79395. if (acc) {
  79396. acc += ", ";
  79397. }
  79398. acc += `${supporter} does not support codec(s): "${unsupportedCodecs[supporter].join(",")}"`;
  79399. return acc;
  79400. }, "") + ".";
  79401. this.excludePlaylist({
  79402. playlistToExclude: playlist,
  79403. error: {
  79404. internal: true,
  79405. message
  79406. },
  79407. playlistExclusionDuration: Infinity
  79408. });
  79409. return;
  79410. }
  79411. if (this.sourceUpdater_.hasCreatedSourceBuffers() && !this.sourceUpdater_.canChangeType()) {
  79412. const switchMessages = [];
  79413. ["video", "audio"].forEach((type2) => {
  79414. const newCodec = (parseCodecs$1(this.sourceUpdater_.codecs[type2] || "")[0] || {}).type;
  79415. const oldCodec = (parseCodecs$1(codecs[type2] || "")[0] || {}).type;
  79416. if (newCodec && oldCodec && newCodec.toLowerCase() !== oldCodec.toLowerCase()) {
  79417. switchMessages.push(`"${this.sourceUpdater_.codecs[type2]}" -> "${codecs[type2]}"`);
  79418. }
  79419. });
  79420. if (switchMessages.length) {
  79421. this.excludePlaylist({
  79422. playlistToExclude: playlist,
  79423. error: {
  79424. message: `Codec switching not supported: ${switchMessages.join(", ")}.`,
  79425. internal: true
  79426. },
  79427. playlistExclusionDuration: Infinity
  79428. });
  79429. return;
  79430. }
  79431. }
  79432. return codecs;
  79433. }
  79434. tryToCreateSourceBuffers_() {
  79435. if (this.mediaSource.readyState !== "open" || this.sourceUpdater_.hasCreatedSourceBuffers()) {
  79436. return;
  79437. }
  79438. if (!this.areMediaTypesKnown_()) {
  79439. return;
  79440. }
  79441. const codecs = this.getCodecsOrExclude_();
  79442. if (!codecs) {
  79443. return;
  79444. }
  79445. this.sourceUpdater_.createSourceBuffers(codecs);
  79446. const codecString = [codecs.video, codecs.audio].filter(Boolean).join(",");
  79447. this.excludeIncompatibleVariants_(codecString);
  79448. }
  79449. excludeUnsupportedVariants_() {
  79450. const playlists = this.main().playlists;
  79451. const ids = [];
  79452. Object.keys(playlists).forEach((key) => {
  79453. const variant = playlists[key];
  79454. if (ids.indexOf(variant.id) !== -1) {
  79455. return;
  79456. }
  79457. ids.push(variant.id);
  79458. const codecs = codecsForPlaylist$1(this.main, variant);
  79459. const unsupported = [];
  79460. if (codecs.audio && !muxerSupportsCodec$1(codecs.audio) && !browserSupportsCodec$1(codecs.audio)) {
  79461. unsupported.push(`audio codec ${codecs.audio}`);
  79462. }
  79463. if (codecs.video && !muxerSupportsCodec$1(codecs.video) && !browserSupportsCodec$1(codecs.video)) {
  79464. unsupported.push(`video codec ${codecs.video}`);
  79465. }
  79466. if (codecs.text && codecs.text === "stpp.ttml.im1t") {
  79467. unsupported.push(`text codec ${codecs.text}`);
  79468. }
  79469. if (unsupported.length) {
  79470. variant.excludeUntil = Infinity;
  79471. this.logger_(`excluding ${variant.id} for unsupported: ${unsupported.join(", ")}`);
  79472. }
  79473. });
  79474. }
  79475. excludeIncompatibleVariants_(codecString) {
  79476. const ids = [];
  79477. const playlists = this.main().playlists;
  79478. const codecs = unwrapCodecList$1(parseCodecs$1(codecString));
  79479. const codecCount_ = codecCount$1(codecs);
  79480. const videoDetails = codecs.video && parseCodecs$1(codecs.video)[0] || null;
  79481. const audioDetails = codecs.audio && parseCodecs$1(codecs.audio)[0] || null;
  79482. Object.keys(playlists).forEach((key) => {
  79483. const variant = playlists[key];
  79484. if (ids.indexOf(variant.id) !== -1 || variant.excludeUntil === Infinity) {
  79485. return;
  79486. }
  79487. ids.push(variant.id);
  79488. const exclusionReasons = [];
  79489. const variantCodecs = codecsForPlaylist$1(this.mainPlaylistLoader_.main, variant);
  79490. const variantCodecCount = codecCount$1(variantCodecs);
  79491. if (!variantCodecs.audio && !variantCodecs.video) {
  79492. return;
  79493. }
  79494. if (variantCodecCount !== codecCount_) {
  79495. exclusionReasons.push(`codec count "${variantCodecCount}" !== "${codecCount_}"`);
  79496. }
  79497. if (!this.sourceUpdater_.canChangeType()) {
  79498. const variantVideoDetails = variantCodecs.video && parseCodecs$1(variantCodecs.video)[0] || null;
  79499. const variantAudioDetails = variantCodecs.audio && parseCodecs$1(variantCodecs.audio)[0] || null;
  79500. if (variantVideoDetails && videoDetails && variantVideoDetails.type.toLowerCase() !== videoDetails.type.toLowerCase()) {
  79501. exclusionReasons.push(`video codec "${variantVideoDetails.type}" !== "${videoDetails.type}"`);
  79502. }
  79503. if (variantAudioDetails && audioDetails && variantAudioDetails.type.toLowerCase() !== audioDetails.type.toLowerCase()) {
  79504. exclusionReasons.push(`audio codec "${variantAudioDetails.type}" !== "${audioDetails.type}"`);
  79505. }
  79506. }
  79507. if (exclusionReasons.length) {
  79508. variant.excludeUntil = Infinity;
  79509. this.logger_(`excluding ${variant.id}: ${exclusionReasons.join(" && ")}`);
  79510. }
  79511. });
  79512. }
  79513. updateAdCues_(media) {
  79514. let offset = 0;
  79515. const seekable3 = this.seekable();
  79516. if (seekable3.length) {
  79517. offset = seekable3.start(0);
  79518. }
  79519. updateAdCues$1(media, this.cueTagsTrack_, offset);
  79520. }
  79521. goalBufferLength() {
  79522. const currentTime = this.tech_.currentTime();
  79523. const initial = Config$1.GOAL_BUFFER_LENGTH;
  79524. const rate = Config$1.GOAL_BUFFER_LENGTH_RATE;
  79525. const max2 = Math.max(initial, Config$1.MAX_GOAL_BUFFER_LENGTH);
  79526. return Math.min(initial + currentTime * rate, max2);
  79527. }
  79528. bufferLowWaterLine() {
  79529. const currentTime = this.tech_.currentTime();
  79530. const initial = Config$1.BUFFER_LOW_WATER_LINE;
  79531. const rate = Config$1.BUFFER_LOW_WATER_LINE_RATE;
  79532. const max2 = Math.max(initial, Config$1.MAX_BUFFER_LOW_WATER_LINE);
  79533. const newMax = Math.max(initial, Config$1.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);
  79534. return Math.min(initial + currentTime * rate, this.bufferBasedABR ? newMax : max2);
  79535. }
  79536. bufferHighWaterLine() {
  79537. return Config$1.BUFFER_HIGH_WATER_LINE;
  79538. }
  79539. }
  79540. const enableFunction$1 = (loader, playlistID, changePlaylistFn) => (enable) => {
  79541. const playlist = loader.main.playlists[playlistID];
  79542. const incompatible = isIncompatible$1(playlist);
  79543. const currentlyEnabled = isEnabled$1(playlist);
  79544. if (typeof enable === "undefined") {
  79545. return currentlyEnabled;
  79546. }
  79547. if (enable) {
  79548. delete playlist.disabled;
  79549. } else {
  79550. playlist.disabled = true;
  79551. }
  79552. if (enable !== currentlyEnabled && !incompatible) {
  79553. changePlaylistFn();
  79554. if (enable) {
  79555. loader.trigger("renditionenabled");
  79556. } else {
  79557. loader.trigger("renditiondisabled");
  79558. }
  79559. }
  79560. return enable;
  79561. };
  79562. class Representation$1 {
  79563. constructor(vhsHandler, playlist, id) {
  79564. const {
  79565. playlistController_: pc
  79566. } = vhsHandler;
  79567. const qualityChangeFunction = pc.fastQualityChange_.bind(pc);
  79568. if (playlist.attributes) {
  79569. const resolution = playlist.attributes.RESOLUTION;
  79570. this.width = resolution && resolution.width;
  79571. this.height = resolution && resolution.height;
  79572. this.bandwidth = playlist.attributes.BANDWIDTH;
  79573. this.frameRate = playlist.attributes["FRAME-RATE"];
  79574. }
  79575. this.codecs = codecsForPlaylist$1(pc.main(), playlist);
  79576. this.playlist = playlist;
  79577. this.id = id;
  79578. this.enabled = enableFunction$1(vhsHandler.playlists, playlist.id, qualityChangeFunction);
  79579. }
  79580. }
  79581. const renditionSelectionMixin$1 = function(vhsHandler) {
  79582. vhsHandler.representations = () => {
  79583. const main = vhsHandler.playlistController_.main();
  79584. const playlists = isAudioOnly$1(main) ? vhsHandler.playlistController_.getAudioTrackPlaylists_() : main.playlists;
  79585. if (!playlists) {
  79586. return [];
  79587. }
  79588. return playlists.filter((media) => !isIncompatible$1(media)).map((e, i2) => new Representation$1(vhsHandler, e, e.id));
  79589. };
  79590. };
  79591. const timerCancelEvents$1 = ["seeking", "seeked", "pause", "playing", "error"];
  79592. class PlaybackWatcher$1 {
  79593. constructor(options2) {
  79594. this.playlistController_ = options2.playlistController;
  79595. this.tech_ = options2.tech;
  79596. this.seekable = options2.seekable;
  79597. this.allowSeeksWithinUnsafeLiveWindow = options2.allowSeeksWithinUnsafeLiveWindow;
  79598. this.liveRangeSafeTimeDelta = options2.liveRangeSafeTimeDelta;
  79599. this.media = options2.media;
  79600. this.consecutiveUpdates = 0;
  79601. this.lastRecordedTime = null;
  79602. this.checkCurrentTimeTimeout_ = null;
  79603. this.logger_ = logger$1("PlaybackWatcher");
  79604. this.logger_("initialize");
  79605. const playHandler = () => this.monitorCurrentTime_();
  79606. const canPlayHandler = () => this.monitorCurrentTime_();
  79607. const waitingHandler = () => this.techWaiting_();
  79608. const cancelTimerHandler = () => this.resetTimeUpdate_();
  79609. const pc = this.playlistController_;
  79610. const loaderTypes = ["main", "subtitle", "audio"];
  79611. const loaderChecks = {};
  79612. loaderTypes.forEach((type2) => {
  79613. loaderChecks[type2] = {
  79614. reset: () => this.resetSegmentDownloads_(type2),
  79615. updateend: () => this.checkSegmentDownloads_(type2)
  79616. };
  79617. pc[`${type2}SegmentLoader_`].on("appendsdone", loaderChecks[type2].updateend);
  79618. pc[`${type2}SegmentLoader_`].on("playlistupdate", loaderChecks[type2].reset);
  79619. this.tech_.on(["seeked", "seeking"], loaderChecks[type2].reset);
  79620. });
  79621. const setSeekingHandlers = (fn2) => {
  79622. ["main", "audio"].forEach((type2) => {
  79623. pc[`${type2}SegmentLoader_`][fn2]("appended", this.seekingAppendCheck_);
  79624. });
  79625. };
  79626. this.seekingAppendCheck_ = () => {
  79627. if (this.fixesBadSeeks_()) {
  79628. this.consecutiveUpdates = 0;
  79629. this.lastRecordedTime = this.tech_.currentTime();
  79630. setSeekingHandlers("off");
  79631. }
  79632. };
  79633. this.clearSeekingAppendCheck_ = () => setSeekingHandlers("off");
  79634. this.watchForBadSeeking_ = () => {
  79635. this.clearSeekingAppendCheck_();
  79636. setSeekingHandlers("on");
  79637. };
  79638. this.tech_.on("seeked", this.clearSeekingAppendCheck_);
  79639. this.tech_.on("seeking", this.watchForBadSeeking_);
  79640. this.tech_.on("waiting", waitingHandler);
  79641. this.tech_.on(timerCancelEvents$1, cancelTimerHandler);
  79642. this.tech_.on("canplay", canPlayHandler);
  79643. this.tech_.one("play", playHandler);
  79644. this.dispose = () => {
  79645. this.clearSeekingAppendCheck_();
  79646. this.logger_("dispose");
  79647. this.tech_.off("waiting", waitingHandler);
  79648. this.tech_.off(timerCancelEvents$1, cancelTimerHandler);
  79649. this.tech_.off("canplay", canPlayHandler);
  79650. this.tech_.off("play", playHandler);
  79651. this.tech_.off("seeking", this.watchForBadSeeking_);
  79652. this.tech_.off("seeked", this.clearSeekingAppendCheck_);
  79653. loaderTypes.forEach((type2) => {
  79654. pc[`${type2}SegmentLoader_`].off("appendsdone", loaderChecks[type2].updateend);
  79655. pc[`${type2}SegmentLoader_`].off("playlistupdate", loaderChecks[type2].reset);
  79656. this.tech_.off(["seeked", "seeking"], loaderChecks[type2].reset);
  79657. });
  79658. if (this.checkCurrentTimeTimeout_) {
  79659. window_1.clearTimeout(this.checkCurrentTimeTimeout_);
  79660. }
  79661. this.resetTimeUpdate_();
  79662. };
  79663. }
  79664. monitorCurrentTime_() {
  79665. this.checkCurrentTime_();
  79666. if (this.checkCurrentTimeTimeout_) {
  79667. window_1.clearTimeout(this.checkCurrentTimeTimeout_);
  79668. }
  79669. this.checkCurrentTimeTimeout_ = window_1.setTimeout(this.monitorCurrentTime_.bind(this), 250);
  79670. }
  79671. resetSegmentDownloads_(type2) {
  79672. const loader = this.playlistController_[`${type2}SegmentLoader_`];
  79673. if (this[`${type2}StalledDownloads_`] > 0) {
  79674. this.logger_(`resetting possible stalled download count for ${type2} loader`);
  79675. }
  79676. this[`${type2}StalledDownloads_`] = 0;
  79677. this[`${type2}Buffered_`] = loader.buffered_();
  79678. }
  79679. checkSegmentDownloads_(type2) {
  79680. const pc = this.playlistController_;
  79681. const loader = pc[`${type2}SegmentLoader_`];
  79682. const buffered = loader.buffered_();
  79683. const isBufferedDifferent = isRangeDifferent$1(this[`${type2}Buffered_`], buffered);
  79684. this[`${type2}Buffered_`] = buffered;
  79685. if (isBufferedDifferent) {
  79686. this.resetSegmentDownloads_(type2);
  79687. return;
  79688. }
  79689. this[`${type2}StalledDownloads_`]++;
  79690. this.logger_(`found #${this[`${type2}StalledDownloads_`]} ${type2} appends that did not increase buffer (possible stalled download)`, {
  79691. playlistId: loader.playlist_ && loader.playlist_.id,
  79692. buffered: timeRangesToArray$1(buffered)
  79693. });
  79694. if (this[`${type2}StalledDownloads_`] < 10) {
  79695. return;
  79696. }
  79697. this.logger_(`${type2} loader stalled download exclusion`);
  79698. this.resetSegmentDownloads_(type2);
  79699. this.tech_.trigger({
  79700. type: "usage",
  79701. name: `vhs-${type2}-download-exclusion`
  79702. });
  79703. if (type2 === "subtitle") {
  79704. return;
  79705. }
  79706. pc.excludePlaylist({
  79707. error: {
  79708. message: `Excessive ${type2} segment downloading detected.`
  79709. },
  79710. playlistExclusionDuration: Infinity
  79711. });
  79712. }
  79713. checkCurrentTime_() {
  79714. if (this.tech_.paused() || this.tech_.seeking()) {
  79715. return;
  79716. }
  79717. const currentTime = this.tech_.currentTime();
  79718. const buffered = this.tech_.buffered();
  79719. if (this.lastRecordedTime === currentTime && (!buffered.length || currentTime + SAFE_TIME_DELTA$1 >= buffered.end(buffered.length - 1))) {
  79720. return this.techWaiting_();
  79721. }
  79722. if (this.consecutiveUpdates >= 5 && currentTime === this.lastRecordedTime) {
  79723. this.consecutiveUpdates++;
  79724. this.waiting_();
  79725. } else if (currentTime === this.lastRecordedTime) {
  79726. this.consecutiveUpdates++;
  79727. } else {
  79728. this.consecutiveUpdates = 0;
  79729. this.lastRecordedTime = currentTime;
  79730. }
  79731. }
  79732. resetTimeUpdate_() {
  79733. this.consecutiveUpdates = 0;
  79734. }
  79735. fixesBadSeeks_() {
  79736. const seeking = this.tech_.seeking();
  79737. if (!seeking) {
  79738. return false;
  79739. }
  79740. const seekable3 = this.seekable();
  79741. const currentTime = this.tech_.currentTime();
  79742. const isAfterSeekableRange = this.afterSeekableWindow_(seekable3, currentTime, this.media(), this.allowSeeksWithinUnsafeLiveWindow);
  79743. let seekTo;
  79744. if (isAfterSeekableRange) {
  79745. const seekableEnd = seekable3.end(seekable3.length - 1);
  79746. seekTo = seekableEnd;
  79747. }
  79748. if (this.beforeSeekableWindow_(seekable3, currentTime)) {
  79749. const seekableStart = seekable3.start(0);
  79750. seekTo = seekableStart + (seekableStart === seekable3.end(0) ? 0 : SAFE_TIME_DELTA$1);
  79751. }
  79752. if (typeof seekTo !== "undefined") {
  79753. this.logger_(`Trying to seek outside of seekable at time ${currentTime} with seekable range ${printableRange$1(seekable3)}. Seeking to ${seekTo}.`);
  79754. this.tech_.setCurrentTime(seekTo);
  79755. return true;
  79756. }
  79757. const sourceUpdater = this.playlistController_.sourceUpdater_;
  79758. const buffered = this.tech_.buffered();
  79759. const audioBuffered = sourceUpdater.audioBuffer ? sourceUpdater.audioBuffered() : null;
  79760. const videoBuffered = sourceUpdater.videoBuffer ? sourceUpdater.videoBuffered() : null;
  79761. const media = this.media();
  79762. const minAppendedDuration = media.partTargetDuration ? media.partTargetDuration : (media.targetDuration - TIME_FUDGE_FACTOR$1) * 2;
  79763. const bufferedToCheck = [audioBuffered, videoBuffered];
  79764. for (let i2 = 0; i2 < bufferedToCheck.length; i2++) {
  79765. if (!bufferedToCheck[i2]) {
  79766. continue;
  79767. }
  79768. const timeAhead = timeAheadOf$1(bufferedToCheck[i2], currentTime);
  79769. if (timeAhead < minAppendedDuration) {
  79770. return false;
  79771. }
  79772. }
  79773. const nextRange = findNextRange$1(buffered, currentTime);
  79774. if (nextRange.length === 0) {
  79775. return false;
  79776. }
  79777. seekTo = nextRange.start(0) + SAFE_TIME_DELTA$1;
  79778. this.logger_(`Buffered region starts (${nextRange.start(0)}) just beyond seek point (${currentTime}). Seeking to ${seekTo}.`);
  79779. this.tech_.setCurrentTime(seekTo);
  79780. return true;
  79781. }
  79782. waiting_() {
  79783. if (this.techWaiting_()) {
  79784. return;
  79785. }
  79786. const currentTime = this.tech_.currentTime();
  79787. const buffered = this.tech_.buffered();
  79788. const currentRange = findRange$1(buffered, currentTime);
  79789. if (currentRange.length && currentTime + 3 <= currentRange.end(0)) {
  79790. this.resetTimeUpdate_();
  79791. this.tech_.setCurrentTime(currentTime);
  79792. this.logger_(`Stopped at ${currentTime} while inside a buffered region [${currentRange.start(0)} -> ${currentRange.end(0)}]. Attempting to resume playback by seeking to the current time.`);
  79793. this.tech_.trigger({
  79794. type: "usage",
  79795. name: "vhs-unknown-waiting"
  79796. });
  79797. return;
  79798. }
  79799. }
  79800. techWaiting_() {
  79801. const seekable3 = this.seekable();
  79802. const currentTime = this.tech_.currentTime();
  79803. if (this.tech_.seeking()) {
  79804. return true;
  79805. }
  79806. if (this.beforeSeekableWindow_(seekable3, currentTime)) {
  79807. const livePoint = seekable3.end(seekable3.length - 1);
  79808. this.logger_(`Fell out of live window at time ${currentTime}. Seeking to live point (seekable end) ${livePoint}`);
  79809. this.resetTimeUpdate_();
  79810. this.tech_.setCurrentTime(livePoint);
  79811. this.tech_.trigger({
  79812. type: "usage",
  79813. name: "vhs-live-resync"
  79814. });
  79815. return true;
  79816. }
  79817. const sourceUpdater = this.tech_.vhs.playlistController_.sourceUpdater_;
  79818. const buffered = this.tech_.buffered();
  79819. const videoUnderflow = this.videoUnderflow_({
  79820. audioBuffered: sourceUpdater.audioBuffered(),
  79821. videoBuffered: sourceUpdater.videoBuffered(),
  79822. currentTime
  79823. });
  79824. if (videoUnderflow) {
  79825. this.resetTimeUpdate_();
  79826. this.tech_.setCurrentTime(currentTime);
  79827. this.tech_.trigger({
  79828. type: "usage",
  79829. name: "vhs-video-underflow"
  79830. });
  79831. return true;
  79832. }
  79833. const nextRange = findNextRange$1(buffered, currentTime);
  79834. if (nextRange.length > 0) {
  79835. this.logger_(`Stopped at ${currentTime} and seeking to ${nextRange.start(0)}`);
  79836. this.resetTimeUpdate_();
  79837. this.skipTheGap_(currentTime);
  79838. return true;
  79839. }
  79840. return false;
  79841. }
  79842. afterSeekableWindow_(seekable3, currentTime, playlist, allowSeeksWithinUnsafeLiveWindow = false) {
  79843. if (!seekable3.length) {
  79844. return false;
  79845. }
  79846. let allowedEnd = seekable3.end(seekable3.length - 1) + SAFE_TIME_DELTA$1;
  79847. const isLive = !playlist.endList;
  79848. if (isLive && allowSeeksWithinUnsafeLiveWindow) {
  79849. allowedEnd = seekable3.end(seekable3.length - 1) + playlist.targetDuration * 3;
  79850. }
  79851. if (currentTime > allowedEnd) {
  79852. return true;
  79853. }
  79854. return false;
  79855. }
  79856. beforeSeekableWindow_(seekable3, currentTime) {
  79857. if (seekable3.length && seekable3.start(0) > 0 && currentTime < seekable3.start(0) - this.liveRangeSafeTimeDelta) {
  79858. return true;
  79859. }
  79860. return false;
  79861. }
  79862. videoUnderflow_({
  79863. videoBuffered,
  79864. audioBuffered,
  79865. currentTime
  79866. }) {
  79867. if (!videoBuffered) {
  79868. return;
  79869. }
  79870. let gap;
  79871. if (videoBuffered.length && audioBuffered.length) {
  79872. const lastVideoRange = findRange$1(videoBuffered, currentTime - 3);
  79873. const videoRange = findRange$1(videoBuffered, currentTime);
  79874. const audioRange = findRange$1(audioBuffered, currentTime);
  79875. if (audioRange.length && !videoRange.length && lastVideoRange.length) {
  79876. gap = {
  79877. start: lastVideoRange.end(0),
  79878. end: audioRange.end(0)
  79879. };
  79880. }
  79881. } else {
  79882. const nextRange = findNextRange$1(videoBuffered, currentTime);
  79883. if (!nextRange.length) {
  79884. gap = this.gapFromVideoUnderflow_(videoBuffered, currentTime);
  79885. }
  79886. }
  79887. if (gap) {
  79888. this.logger_(`Encountered a gap in video from ${gap.start} to ${gap.end}. Seeking to current time ${currentTime}`);
  79889. return true;
  79890. }
  79891. return false;
  79892. }
  79893. skipTheGap_(scheduledCurrentTime) {
  79894. const buffered = this.tech_.buffered();
  79895. const currentTime = this.tech_.currentTime();
  79896. const nextRange = findNextRange$1(buffered, currentTime);
  79897. this.resetTimeUpdate_();
  79898. if (nextRange.length === 0 || currentTime !== scheduledCurrentTime) {
  79899. return;
  79900. }
  79901. this.logger_("skipTheGap_:", "currentTime:", currentTime, "scheduled currentTime:", scheduledCurrentTime, "nextRange start:", nextRange.start(0));
  79902. this.tech_.setCurrentTime(nextRange.start(0) + TIME_FUDGE_FACTOR$1);
  79903. this.tech_.trigger({
  79904. type: "usage",
  79905. name: "vhs-gap-skip"
  79906. });
  79907. }
  79908. gapFromVideoUnderflow_(buffered, currentTime) {
  79909. const gaps = findGaps$1(buffered);
  79910. for (let i2 = 0; i2 < gaps.length; i2++) {
  79911. const start2 = gaps.start(i2);
  79912. const end = gaps.end(i2);
  79913. if (currentTime - start2 < 4 && currentTime - start2 > 2) {
  79914. return {
  79915. start: start2,
  79916. end
  79917. };
  79918. }
  79919. }
  79920. return null;
  79921. }
  79922. }
  79923. const defaultOptions$1 = {
  79924. errorInterval: 30,
  79925. getSource(next) {
  79926. const tech = this.tech({
  79927. IWillNotUseThisInPlugins: true
  79928. });
  79929. const sourceObj = tech.currentSource_ || this.currentSource();
  79930. return next(sourceObj);
  79931. }
  79932. };
  79933. const initPlugin$2 = function(player, options2) {
  79934. let lastCalled = 0;
  79935. let seekTo = 0;
  79936. const localOptions = merge$2(defaultOptions$1, options2);
  79937. player.ready(() => {
  79938. player.trigger({
  79939. type: "usage",
  79940. name: "vhs-error-reload-initialized"
  79941. });
  79942. });
  79943. const loadedMetadataHandler = function() {
  79944. if (seekTo) {
  79945. player.currentTime(seekTo);
  79946. }
  79947. };
  79948. const setSource2 = function(sourceObj) {
  79949. if (sourceObj === null || sourceObj === void 0) {
  79950. return;
  79951. }
  79952. seekTo = player.duration() !== Infinity && player.currentTime() || 0;
  79953. player.one("loadedmetadata", loadedMetadataHandler);
  79954. player.src(sourceObj);
  79955. player.trigger({
  79956. type: "usage",
  79957. name: "vhs-error-reload"
  79958. });
  79959. player.play();
  79960. };
  79961. const errorHandler = function() {
  79962. if (Date.now() - lastCalled < localOptions.errorInterval * 1e3) {
  79963. player.trigger({
  79964. type: "usage",
  79965. name: "vhs-error-reload-canceled"
  79966. });
  79967. return;
  79968. }
  79969. if (!localOptions.getSource || typeof localOptions.getSource !== "function") {
  79970. videojs$2.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");
  79971. return;
  79972. }
  79973. lastCalled = Date.now();
  79974. return localOptions.getSource.call(player, setSource2);
  79975. };
  79976. const cleanupEvents = function() {
  79977. player.off("loadedmetadata", loadedMetadataHandler);
  79978. player.off("error", errorHandler);
  79979. player.off("dispose", cleanupEvents);
  79980. };
  79981. const reinitPlugin = function(newOptions) {
  79982. cleanupEvents();
  79983. initPlugin$2(player, newOptions);
  79984. };
  79985. player.on("error", errorHandler);
  79986. player.on("dispose", cleanupEvents);
  79987. player.reloadSourceOnError = reinitPlugin;
  79988. };
  79989. const reloadSourceOnError$1 = function(options2) {
  79990. initPlugin$2(this, options2);
  79991. };
  79992. var version$4$1 = "3.0.2";
  79993. var version$3$1 = "6.3.0";
  79994. var version$2$1 = "1.0.1";
  79995. var version$1$2 = "6.0.0";
  79996. var version$7 = "4.0.1";
  79997. const Vhs$2 = {
  79998. PlaylistLoader: PlaylistLoader$1,
  79999. Playlist: Playlist$1,
  80000. utils: utils$1,
  80001. STANDARD_PLAYLIST_SELECTOR: lastBandwidthSelector$1,
  80002. INITIAL_PLAYLIST_SELECTOR: lowestBitrateCompatibleVariantSelector$1,
  80003. lastBandwidthSelector: lastBandwidthSelector$1,
  80004. movingAverageBandwidthSelector: movingAverageBandwidthSelector$1,
  80005. comparePlaylistBandwidth: comparePlaylistBandwidth$1,
  80006. comparePlaylistResolution: comparePlaylistResolution$1,
  80007. xhr: xhrFactory$1()
  80008. };
  80009. Object.keys(Config$1).forEach((prop) => {
  80010. Object.defineProperty(Vhs$2, prop, {
  80011. get() {
  80012. videojs$2.log.warn(`using Vhs.${prop} is UNSAFE be sure you know what you are doing`);
  80013. return Config$1[prop];
  80014. },
  80015. set(value) {
  80016. videojs$2.log.warn(`using Vhs.${prop} is UNSAFE be sure you know what you are doing`);
  80017. if (typeof value !== "number" || value < 0) {
  80018. videojs$2.log.warn(`value of Vhs.${prop} must be greater than or equal to 0`);
  80019. return;
  80020. }
  80021. Config$1[prop] = value;
  80022. }
  80023. });
  80024. });
  80025. const LOCAL_STORAGE_KEY$2 = "videojs-vhs";
  80026. const handleVhsMediaChange$1 = function(qualityLevels2, playlistLoader) {
  80027. const newPlaylist = playlistLoader.media();
  80028. let selectedIndex = -1;
  80029. for (let i2 = 0; i2 < qualityLevels2.length; i2++) {
  80030. if (qualityLevels2[i2].id === newPlaylist.id) {
  80031. selectedIndex = i2;
  80032. break;
  80033. }
  80034. }
  80035. qualityLevels2.selectedIndex_ = selectedIndex;
  80036. qualityLevels2.trigger({
  80037. selectedIndex,
  80038. type: "change"
  80039. });
  80040. };
  80041. const handleVhsLoadedMetadata$1 = function(qualityLevels2, vhs) {
  80042. vhs.representations().forEach((rep2) => {
  80043. qualityLevels2.addQualityLevel(rep2);
  80044. });
  80045. handleVhsMediaChange$1(qualityLevels2, vhs.playlists);
  80046. };
  80047. Vhs$2.canPlaySource = function() {
  80048. return videojs$2.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.");
  80049. };
  80050. const emeKeySystems$1 = (keySystemOptions, mainPlaylist, audioPlaylist) => {
  80051. if (!keySystemOptions) {
  80052. return keySystemOptions;
  80053. }
  80054. let codecs = {};
  80055. if (mainPlaylist && mainPlaylist.attributes && mainPlaylist.attributes.CODECS) {
  80056. codecs = unwrapCodecList$1(parseCodecs$1(mainPlaylist.attributes.CODECS));
  80057. }
  80058. if (audioPlaylist && audioPlaylist.attributes && audioPlaylist.attributes.CODECS) {
  80059. codecs.audio = audioPlaylist.attributes.CODECS;
  80060. }
  80061. const videoContentType = getMimeForCodec$1(codecs.video);
  80062. const audioContentType = getMimeForCodec$1(codecs.audio);
  80063. const keySystemContentTypes = {};
  80064. for (const keySystem in keySystemOptions) {
  80065. keySystemContentTypes[keySystem] = {};
  80066. if (audioContentType) {
  80067. keySystemContentTypes[keySystem].audioContentType = audioContentType;
  80068. }
  80069. if (videoContentType) {
  80070. keySystemContentTypes[keySystem].videoContentType = videoContentType;
  80071. }
  80072. if (mainPlaylist.contentProtection && mainPlaylist.contentProtection[keySystem] && mainPlaylist.contentProtection[keySystem].pssh) {
  80073. keySystemContentTypes[keySystem].pssh = mainPlaylist.contentProtection[keySystem].pssh;
  80074. }
  80075. if (typeof keySystemOptions[keySystem] === "string") {
  80076. keySystemContentTypes[keySystem].url = keySystemOptions[keySystem];
  80077. }
  80078. }
  80079. return merge$2(keySystemOptions, keySystemContentTypes);
  80080. };
  80081. const getAllPsshKeySystemsOptions$1 = (playlists, keySystems) => {
  80082. return playlists.reduce((keySystemsArr, playlist) => {
  80083. if (!playlist.contentProtection) {
  80084. return keySystemsArr;
  80085. }
  80086. const keySystemsOptions = keySystems.reduce((keySystemsObj, keySystem) => {
  80087. const keySystemOptions = playlist.contentProtection[keySystem];
  80088. if (keySystemOptions && keySystemOptions.pssh) {
  80089. keySystemsObj[keySystem] = {
  80090. pssh: keySystemOptions.pssh
  80091. };
  80092. }
  80093. return keySystemsObj;
  80094. }, {});
  80095. if (Object.keys(keySystemsOptions).length) {
  80096. keySystemsArr.push(keySystemsOptions);
  80097. }
  80098. return keySystemsArr;
  80099. }, []);
  80100. };
  80101. const waitForKeySessionCreation$1 = ({
  80102. player,
  80103. sourceKeySystems,
  80104. audioMedia,
  80105. mainPlaylists
  80106. }) => {
  80107. if (!player.eme.initializeMediaKeys) {
  80108. return Promise.resolve();
  80109. }
  80110. const playlists = audioMedia ? mainPlaylists.concat([audioMedia]) : mainPlaylists;
  80111. const keySystemsOptionsArr = getAllPsshKeySystemsOptions$1(playlists, Object.keys(sourceKeySystems));
  80112. const initializationFinishedPromises = [];
  80113. const keySessionCreatedPromises = [];
  80114. keySystemsOptionsArr.forEach((keySystemsOptions) => {
  80115. keySessionCreatedPromises.push(new Promise((resolve2, reject2) => {
  80116. player.tech_.one("keysessioncreated", resolve2);
  80117. }));
  80118. initializationFinishedPromises.push(new Promise((resolve2, reject2) => {
  80119. player.eme.initializeMediaKeys({
  80120. keySystems: keySystemsOptions
  80121. }, (err) => {
  80122. if (err) {
  80123. reject2(err);
  80124. return;
  80125. }
  80126. resolve2();
  80127. });
  80128. }));
  80129. });
  80130. return Promise.race([
  80131. Promise.all(initializationFinishedPromises),
  80132. Promise.race(keySessionCreatedPromises)
  80133. ]);
  80134. };
  80135. const setupEmeOptions$1 = ({
  80136. player,
  80137. sourceKeySystems,
  80138. media,
  80139. audioMedia
  80140. }) => {
  80141. const sourceOptions = emeKeySystems$1(sourceKeySystems, media, audioMedia);
  80142. if (!sourceOptions) {
  80143. return false;
  80144. }
  80145. player.currentSource().keySystems = sourceOptions;
  80146. if (sourceOptions && !player.eme) {
  80147. videojs$2.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin");
  80148. return false;
  80149. }
  80150. return true;
  80151. };
  80152. const getVhsLocalStorage$1 = () => {
  80153. if (!window_1.localStorage) {
  80154. return null;
  80155. }
  80156. const storedObject = window_1.localStorage.getItem(LOCAL_STORAGE_KEY$2);
  80157. if (!storedObject) {
  80158. return null;
  80159. }
  80160. try {
  80161. return JSON.parse(storedObject);
  80162. } catch (e) {
  80163. return null;
  80164. }
  80165. };
  80166. const updateVhsLocalStorage$1 = (options2) => {
  80167. if (!window_1.localStorage) {
  80168. return false;
  80169. }
  80170. let objectToStore = getVhsLocalStorage$1();
  80171. objectToStore = objectToStore ? merge$2(objectToStore, options2) : options2;
  80172. try {
  80173. window_1.localStorage.setItem(LOCAL_STORAGE_KEY$2, JSON.stringify(objectToStore));
  80174. } catch (e) {
  80175. return false;
  80176. }
  80177. return objectToStore;
  80178. };
  80179. const expandDataUri$1 = (dataUri) => {
  80180. if (dataUri.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,") === 0) {
  80181. return JSON.parse(dataUri.substring(dataUri.indexOf(",") + 1));
  80182. }
  80183. return dataUri;
  80184. };
  80185. Vhs$2.supportsNativeHls = function() {
  80186. if (!document_1 || !document_1.createElement) {
  80187. return false;
  80188. }
  80189. const video = document_1.createElement("video");
  80190. if (!videojs$2.getTech("Html5").isSupported()) {
  80191. return false;
  80192. }
  80193. const canPlay = [
  80194. "application/vnd.apple.mpegurl",
  80195. "audio/mpegurl",
  80196. "audio/x-mpegurl",
  80197. "application/x-mpegurl",
  80198. "video/x-mpegurl",
  80199. "video/mpegurl",
  80200. "application/mpegurl"
  80201. ];
  80202. return canPlay.some(function(canItPlay) {
  80203. return /maybe|probably/i.test(video.canPlayType(canItPlay));
  80204. });
  80205. }();
  80206. Vhs$2.supportsNativeDash = function() {
  80207. if (!document_1 || !document_1.createElement || !videojs$2.getTech("Html5").isSupported()) {
  80208. return false;
  80209. }
  80210. return /maybe|probably/i.test(document_1.createElement("video").canPlayType("application/dash+xml"));
  80211. }();
  80212. Vhs$2.supportsTypeNatively = (type2) => {
  80213. if (type2 === "hls") {
  80214. return Vhs$2.supportsNativeHls;
  80215. }
  80216. if (type2 === "dash") {
  80217. return Vhs$2.supportsNativeDash;
  80218. }
  80219. return false;
  80220. };
  80221. Vhs$2.isSupported = function() {
  80222. return videojs$2.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.");
  80223. };
  80224. const Component$2 = videojs$2.getComponent("Component");
  80225. class VhsHandler$1 extends Component$2 {
  80226. constructor(source, tech, options2) {
  80227. super(tech, options2.vhs);
  80228. if (typeof options2.initialBandwidth === "number") {
  80229. this.options_.bandwidth = options2.initialBandwidth;
  80230. }
  80231. this.logger_ = logger$1("VhsHandler");
  80232. if (tech.options_ && tech.options_.playerId) {
  80233. const _player = videojs$2.getPlayer(tech.options_.playerId);
  80234. this.player_ = _player;
  80235. }
  80236. this.tech_ = tech;
  80237. this.source_ = source;
  80238. this.stats = {};
  80239. this.ignoreNextSeekingEvent_ = false;
  80240. this.setOptions_();
  80241. if (this.options_.overrideNative && tech.overrideNativeAudioTracks && tech.overrideNativeVideoTracks) {
  80242. tech.overrideNativeAudioTracks(true);
  80243. tech.overrideNativeVideoTracks(true);
  80244. } else if (this.options_.overrideNative && (tech.featuresNativeVideoTracks || tech.featuresNativeAudioTracks)) {
  80245. throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");
  80246. }
  80247. this.on(document_1, ["fullscreenchange", "webkitfullscreenchange", "mozfullscreenchange", "MSFullscreenChange"], (event2) => {
  80248. const fullscreenElement = document_1.fullscreenElement || document_1.webkitFullscreenElement || document_1.mozFullScreenElement || document_1.msFullscreenElement;
  80249. if (fullscreenElement && fullscreenElement.contains(this.tech_.el())) {
  80250. this.playlistController_.fastQualityChange_();
  80251. } else {
  80252. this.playlistController_.checkABR_();
  80253. }
  80254. });
  80255. this.on(this.tech_, "seeking", function() {
  80256. if (this.ignoreNextSeekingEvent_) {
  80257. this.ignoreNextSeekingEvent_ = false;
  80258. return;
  80259. }
  80260. this.setCurrentTime(this.tech_.currentTime());
  80261. });
  80262. this.on(this.tech_, "error", function() {
  80263. if (this.tech_.error() && this.playlistController_) {
  80264. this.playlistController_.pauseLoading();
  80265. }
  80266. });
  80267. this.on(this.tech_, "play", this.play);
  80268. }
  80269. setOptions_() {
  80270. this.options_.withCredentials = this.options_.withCredentials || false;
  80271. this.options_.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions === false ? false : true;
  80272. this.options_.useDevicePixelRatio = this.options_.useDevicePixelRatio || false;
  80273. this.options_.useBandwidthFromLocalStorage = typeof this.source_.useBandwidthFromLocalStorage !== "undefined" ? this.source_.useBandwidthFromLocalStorage : this.options_.useBandwidthFromLocalStorage || false;
  80274. this.options_.useNetworkInformationApi = this.options_.useNetworkInformationApi || false;
  80275. this.options_.useDtsForTimestampOffset = this.options_.useDtsForTimestampOffset || false;
  80276. this.options_.customTagParsers = this.options_.customTagParsers || [];
  80277. this.options_.customTagMappers = this.options_.customTagMappers || [];
  80278. this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || false;
  80279. this.options_.llhls = this.options_.llhls === false ? false : true;
  80280. this.options_.bufferBasedABR = this.options_.bufferBasedABR || false;
  80281. if (typeof this.options_.playlistExclusionDuration !== "number") {
  80282. this.options_.playlistExclusionDuration = 5 * 60;
  80283. }
  80284. if (typeof this.options_.bandwidth !== "number") {
  80285. if (this.options_.useBandwidthFromLocalStorage) {
  80286. const storedObject = getVhsLocalStorage$1();
  80287. if (storedObject && storedObject.bandwidth) {
  80288. this.options_.bandwidth = storedObject.bandwidth;
  80289. this.tech_.trigger({
  80290. type: "usage",
  80291. name: "vhs-bandwidth-from-local-storage"
  80292. });
  80293. }
  80294. if (storedObject && storedObject.throughput) {
  80295. this.options_.throughput = storedObject.throughput;
  80296. this.tech_.trigger({
  80297. type: "usage",
  80298. name: "vhs-throughput-from-local-storage"
  80299. });
  80300. }
  80301. }
  80302. }
  80303. if (typeof this.options_.bandwidth !== "number") {
  80304. this.options_.bandwidth = Config$1.INITIAL_BANDWIDTH;
  80305. }
  80306. this.options_.enableLowInitialPlaylist = this.options_.enableLowInitialPlaylist && this.options_.bandwidth === Config$1.INITIAL_BANDWIDTH;
  80307. ["withCredentials", "useDevicePixelRatio", "limitRenditionByPlayerDimensions", "bandwidth", "customTagParsers", "customTagMappers", "cacheEncryptionKeys", "playlistSelector", "initialPlaylistSelector", "bufferBasedABR", "liveRangeSafeTimeDelta", "llhls", "useNetworkInformationApi", "useDtsForTimestampOffset", "exactManifestTimings", "leastPixelDiffSelector"].forEach((option) => {
  80308. if (typeof this.source_[option] !== "undefined") {
  80309. this.options_[option] = this.source_[option];
  80310. }
  80311. });
  80312. this.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions;
  80313. this.useDevicePixelRatio = this.options_.useDevicePixelRatio;
  80314. }
  80315. src(src, type2) {
  80316. if (!src) {
  80317. return;
  80318. }
  80319. this.setOptions_();
  80320. this.options_.src = expandDataUri$1(this.source_.src);
  80321. this.options_.tech = this.tech_;
  80322. this.options_.externVhs = Vhs$2;
  80323. this.options_.sourceType = simpleTypeFromSourceType$1(type2);
  80324. this.options_.seekTo = (time) => {
  80325. this.tech_.setCurrentTime(time);
  80326. };
  80327. this.playlistController_ = new PlaylistController(this.options_);
  80328. const playbackWatcherOptions = merge$2({
  80329. liveRangeSafeTimeDelta: SAFE_TIME_DELTA$1
  80330. }, this.options_, {
  80331. seekable: () => this.seekable(),
  80332. media: () => this.playlistController_.media(),
  80333. playlistController: this.playlistController_
  80334. });
  80335. this.playbackWatcher_ = new PlaybackWatcher$1(playbackWatcherOptions);
  80336. this.playlistController_.on("error", () => {
  80337. const player = videojs$2.players[this.tech_.options_.playerId];
  80338. let error = this.playlistController_.error;
  80339. if (typeof error === "object" && !error.code) {
  80340. error.code = 3;
  80341. } else if (typeof error === "string") {
  80342. error = {
  80343. message: error,
  80344. code: 3
  80345. };
  80346. }
  80347. player.error(error);
  80348. });
  80349. const defaultSelector = this.options_.bufferBasedABR ? Vhs$2.movingAverageBandwidthSelector(0.55) : Vhs$2.STANDARD_PLAYLIST_SELECTOR;
  80350. this.playlistController_.selectPlaylist = this.selectPlaylist ? this.selectPlaylist.bind(this) : defaultSelector.bind(this);
  80351. this.playlistController_.selectInitialPlaylist = Vhs$2.INITIAL_PLAYLIST_SELECTOR.bind(this);
  80352. this.playlists = this.playlistController_.mainPlaylistLoader_;
  80353. this.mediaSource = this.playlistController_.mediaSource;
  80354. Object.defineProperties(this, {
  80355. selectPlaylist: {
  80356. get() {
  80357. return this.playlistController_.selectPlaylist;
  80358. },
  80359. set(selectPlaylist) {
  80360. this.playlistController_.selectPlaylist = selectPlaylist.bind(this);
  80361. }
  80362. },
  80363. throughput: {
  80364. get() {
  80365. return this.playlistController_.mainSegmentLoader_.throughput.rate;
  80366. },
  80367. set(throughput) {
  80368. this.playlistController_.mainSegmentLoader_.throughput.rate = throughput;
  80369. this.playlistController_.mainSegmentLoader_.throughput.count = 1;
  80370. }
  80371. },
  80372. bandwidth: {
  80373. get() {
  80374. let playerBandwidthEst = this.playlistController_.mainSegmentLoader_.bandwidth;
  80375. const networkInformation = window_1.navigator.connection || window_1.navigator.mozConnection || window_1.navigator.webkitConnection;
  80376. const tenMbpsAsBitsPerSecond = 1e7;
  80377. if (this.options_.useNetworkInformationApi && networkInformation) {
  80378. const networkInfoBandwidthEstBitsPerSec = networkInformation.downlink * 1e3 * 1e3;
  80379. if (networkInfoBandwidthEstBitsPerSec >= tenMbpsAsBitsPerSecond && playerBandwidthEst >= tenMbpsAsBitsPerSecond) {
  80380. playerBandwidthEst = Math.max(playerBandwidthEst, networkInfoBandwidthEstBitsPerSec);
  80381. } else {
  80382. playerBandwidthEst = networkInfoBandwidthEstBitsPerSec;
  80383. }
  80384. }
  80385. return playerBandwidthEst;
  80386. },
  80387. set(bandwidth2) {
  80388. this.playlistController_.mainSegmentLoader_.bandwidth = bandwidth2;
  80389. this.playlistController_.mainSegmentLoader_.throughput = {
  80390. rate: 0,
  80391. count: 0
  80392. };
  80393. }
  80394. },
  80395. systemBandwidth: {
  80396. get() {
  80397. const invBandwidth = 1 / (this.bandwidth || 1);
  80398. let invThroughput;
  80399. if (this.throughput > 0) {
  80400. invThroughput = 1 / this.throughput;
  80401. } else {
  80402. invThroughput = 0;
  80403. }
  80404. const systemBitrate = Math.floor(1 / (invBandwidth + invThroughput));
  80405. return systemBitrate;
  80406. },
  80407. set() {
  80408. videojs$2.log.error('The "systemBandwidth" property is read-only');
  80409. }
  80410. }
  80411. });
  80412. if (this.options_.bandwidth) {
  80413. this.bandwidth = this.options_.bandwidth;
  80414. }
  80415. if (this.options_.throughput) {
  80416. this.throughput = this.options_.throughput;
  80417. }
  80418. Object.defineProperties(this.stats, {
  80419. bandwidth: {
  80420. get: () => this.bandwidth || 0,
  80421. enumerable: true
  80422. },
  80423. mediaRequests: {
  80424. get: () => this.playlistController_.mediaRequests_() || 0,
  80425. enumerable: true
  80426. },
  80427. mediaRequestsAborted: {
  80428. get: () => this.playlistController_.mediaRequestsAborted_() || 0,
  80429. enumerable: true
  80430. },
  80431. mediaRequestsTimedout: {
  80432. get: () => this.playlistController_.mediaRequestsTimedout_() || 0,
  80433. enumerable: true
  80434. },
  80435. mediaRequestsErrored: {
  80436. get: () => this.playlistController_.mediaRequestsErrored_() || 0,
  80437. enumerable: true
  80438. },
  80439. mediaTransferDuration: {
  80440. get: () => this.playlistController_.mediaTransferDuration_() || 0,
  80441. enumerable: true
  80442. },
  80443. mediaBytesTransferred: {
  80444. get: () => this.playlistController_.mediaBytesTransferred_() || 0,
  80445. enumerable: true
  80446. },
  80447. mediaSecondsLoaded: {
  80448. get: () => this.playlistController_.mediaSecondsLoaded_() || 0,
  80449. enumerable: true
  80450. },
  80451. mediaAppends: {
  80452. get: () => this.playlistController_.mediaAppends_() || 0,
  80453. enumerable: true
  80454. },
  80455. mainAppendsToLoadedData: {
  80456. get: () => this.playlistController_.mainAppendsToLoadedData_() || 0,
  80457. enumerable: true
  80458. },
  80459. audioAppendsToLoadedData: {
  80460. get: () => this.playlistController_.audioAppendsToLoadedData_() || 0,
  80461. enumerable: true
  80462. },
  80463. appendsToLoadedData: {
  80464. get: () => this.playlistController_.appendsToLoadedData_() || 0,
  80465. enumerable: true
  80466. },
  80467. timeToLoadedData: {
  80468. get: () => this.playlistController_.timeToLoadedData_() || 0,
  80469. enumerable: true
  80470. },
  80471. buffered: {
  80472. get: () => timeRangesToArray$1(this.tech_.buffered()),
  80473. enumerable: true
  80474. },
  80475. currentTime: {
  80476. get: () => this.tech_.currentTime(),
  80477. enumerable: true
  80478. },
  80479. currentSource: {
  80480. get: () => this.tech_.currentSource_,
  80481. enumerable: true
  80482. },
  80483. currentTech: {
  80484. get: () => this.tech_.name_,
  80485. enumerable: true
  80486. },
  80487. duration: {
  80488. get: () => this.tech_.duration(),
  80489. enumerable: true
  80490. },
  80491. main: {
  80492. get: () => this.playlists.main,
  80493. enumerable: true
  80494. },
  80495. playerDimensions: {
  80496. get: () => this.tech_.currentDimensions(),
  80497. enumerable: true
  80498. },
  80499. seekable: {
  80500. get: () => timeRangesToArray$1(this.tech_.seekable()),
  80501. enumerable: true
  80502. },
  80503. timestamp: {
  80504. get: () => Date.now(),
  80505. enumerable: true
  80506. },
  80507. videoPlaybackQuality: {
  80508. get: () => this.tech_.getVideoPlaybackQuality(),
  80509. enumerable: true
  80510. }
  80511. });
  80512. this.tech_.one("canplay", this.playlistController_.setupFirstPlay.bind(this.playlistController_));
  80513. this.tech_.on("bandwidthupdate", () => {
  80514. if (this.options_.useBandwidthFromLocalStorage) {
  80515. updateVhsLocalStorage$1({
  80516. bandwidth: this.bandwidth,
  80517. throughput: Math.round(this.throughput)
  80518. });
  80519. }
  80520. });
  80521. this.playlistController_.on("selectedinitialmedia", () => {
  80522. renditionSelectionMixin$1(this);
  80523. });
  80524. this.playlistController_.sourceUpdater_.on("createdsourcebuffers", () => {
  80525. this.setupEme_();
  80526. });
  80527. this.on(this.playlistController_, "progress", function() {
  80528. this.tech_.trigger("progress");
  80529. });
  80530. this.on(this.playlistController_, "firstplay", function() {
  80531. this.ignoreNextSeekingEvent_ = true;
  80532. });
  80533. this.setupQualityLevels_();
  80534. if (!this.tech_.el()) {
  80535. return;
  80536. }
  80537. this.mediaSourceUrl_ = window_1.URL.createObjectURL(this.playlistController_.mediaSource);
  80538. this.tech_.src(this.mediaSourceUrl_);
  80539. }
  80540. createKeySessions_() {
  80541. const audioPlaylistLoader = this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;
  80542. this.logger_("waiting for EME key session creation");
  80543. waitForKeySessionCreation$1({
  80544. player: this.player_,
  80545. sourceKeySystems: this.source_.keySystems,
  80546. audioMedia: audioPlaylistLoader && audioPlaylistLoader.media(),
  80547. mainPlaylists: this.playlists.main.playlists
  80548. }).then(() => {
  80549. this.logger_("created EME key session");
  80550. this.playlistController_.sourceUpdater_.initializedEme();
  80551. }).catch((err) => {
  80552. this.logger_("error while creating EME key session", err);
  80553. this.player_.error({
  80554. message: "Failed to initialize media keys for EME",
  80555. code: 3
  80556. });
  80557. });
  80558. }
  80559. handleWaitingForKey_() {
  80560. this.logger_("waitingforkey fired, attempting to create any new key sessions");
  80561. this.createKeySessions_();
  80562. }
  80563. setupEme_() {
  80564. const audioPlaylistLoader = this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;
  80565. const didSetupEmeOptions = setupEmeOptions$1({
  80566. player: this.player_,
  80567. sourceKeySystems: this.source_.keySystems,
  80568. media: this.playlists.media(),
  80569. audioMedia: audioPlaylistLoader && audioPlaylistLoader.media()
  80570. });
  80571. this.player_.tech_.on("keystatuschange", (e) => {
  80572. if (e.status !== "output-restricted") {
  80573. return;
  80574. }
  80575. const mainPlaylist = this.playlistController_.main();
  80576. if (!mainPlaylist || !mainPlaylist.playlists) {
  80577. return;
  80578. }
  80579. const excludedHDPlaylists = [];
  80580. mainPlaylist.playlists.forEach((playlist) => {
  80581. if (playlist && playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height >= 720) {
  80582. if (!playlist.excludeUntil || playlist.excludeUntil < Infinity) {
  80583. playlist.excludeUntil = Infinity;
  80584. excludedHDPlaylists.push(playlist);
  80585. }
  80586. }
  80587. });
  80588. if (excludedHDPlaylists.length) {
  80589. videojs$2.log.warn('DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.', ...excludedHDPlaylists);
  80590. this.playlistController_.fastQualityChange_();
  80591. }
  80592. });
  80593. this.handleWaitingForKey_ = this.handleWaitingForKey_.bind(this);
  80594. this.player_.tech_.on("waitingforkey", this.handleWaitingForKey_);
  80595. if (videojs$2.browser.IE_VERSION === 11 || !didSetupEmeOptions) {
  80596. this.playlistController_.sourceUpdater_.initializedEme();
  80597. return;
  80598. }
  80599. this.createKeySessions_();
  80600. }
  80601. setupQualityLevels_() {
  80602. const player = videojs$2.players[this.tech_.options_.playerId];
  80603. if (!player || !player.qualityLevels || this.qualityLevels_) {
  80604. return;
  80605. }
  80606. this.qualityLevels_ = player.qualityLevels();
  80607. this.playlistController_.on("selectedinitialmedia", () => {
  80608. handleVhsLoadedMetadata$1(this.qualityLevels_, this);
  80609. });
  80610. this.playlists.on("mediachange", () => {
  80611. handleVhsMediaChange$1(this.qualityLevels_, this.playlists);
  80612. });
  80613. }
  80614. static version() {
  80615. return {
  80616. "@videojs/http-streaming": version$4$1,
  80617. "mux.js": version$3$1,
  80618. "mpd-parser": version$2$1,
  80619. "m3u8-parser": version$1$2,
  80620. "aes-decrypter": version$7
  80621. };
  80622. }
  80623. version() {
  80624. return this.constructor.version();
  80625. }
  80626. canChangeType() {
  80627. return SourceUpdater$1.canChangeType();
  80628. }
  80629. play() {
  80630. this.playlistController_.play();
  80631. }
  80632. setCurrentTime(currentTime) {
  80633. this.playlistController_.setCurrentTime(currentTime);
  80634. }
  80635. duration() {
  80636. return this.playlistController_.duration();
  80637. }
  80638. seekable() {
  80639. return this.playlistController_.seekable();
  80640. }
  80641. dispose() {
  80642. if (this.playbackWatcher_) {
  80643. this.playbackWatcher_.dispose();
  80644. }
  80645. if (this.playlistController_) {
  80646. this.playlistController_.dispose();
  80647. }
  80648. if (this.qualityLevels_) {
  80649. this.qualityLevels_.dispose();
  80650. }
  80651. if (this.tech_ && this.tech_.vhs) {
  80652. delete this.tech_.vhs;
  80653. }
  80654. if (this.mediaSourceUrl_ && window_1.URL.revokeObjectURL) {
  80655. window_1.URL.revokeObjectURL(this.mediaSourceUrl_);
  80656. this.mediaSourceUrl_ = null;
  80657. }
  80658. if (this.tech_) {
  80659. this.tech_.off("waitingforkey", this.handleWaitingForKey_);
  80660. }
  80661. super.dispose();
  80662. }
  80663. convertToProgramTime(time, callback2) {
  80664. return getProgramTime$1({
  80665. playlist: this.playlistController_.media(),
  80666. time,
  80667. callback: callback2
  80668. });
  80669. }
  80670. seekToProgramTime(programTime, callback2, pauseAfterSeek = true, retryCount = 2) {
  80671. return seekToProgramTime$1({
  80672. programTime,
  80673. playlist: this.playlistController_.media(),
  80674. retryCount,
  80675. pauseAfterSeek,
  80676. seekTo: this.options_.seekTo,
  80677. tech: this.options_.tech,
  80678. callback: callback2
  80679. });
  80680. }
  80681. }
  80682. const VhsSourceHandler$1 = {
  80683. name: "videojs-http-streaming",
  80684. VERSION: version$4$1,
  80685. canHandleSource(srcObj, options2 = {}) {
  80686. const localOptions = merge$2(videojs$2.options, options2);
  80687. return VhsSourceHandler$1.canPlayType(srcObj.type, localOptions);
  80688. },
  80689. handleSource(source, tech, options2 = {}) {
  80690. const localOptions = merge$2(videojs$2.options, options2);
  80691. tech.vhs = new VhsHandler$1(source, tech, localOptions);
  80692. tech.vhs.xhr = xhrFactory$1();
  80693. tech.vhs.src(source.src, source.type);
  80694. return tech.vhs;
  80695. },
  80696. canPlayType(type2, options2) {
  80697. const simpleType = simpleTypeFromSourceType$1(type2);
  80698. if (!simpleType) {
  80699. return "";
  80700. }
  80701. const overrideNative = VhsSourceHandler$1.getOverrideNative(options2);
  80702. const supportsTypeNatively = Vhs$2.supportsTypeNatively(simpleType);
  80703. const canUseMsePlayback = !supportsTypeNatively || overrideNative;
  80704. return canUseMsePlayback ? "maybe" : "";
  80705. },
  80706. getOverrideNative(options2 = {}) {
  80707. const {
  80708. vhs = {}
  80709. } = options2;
  80710. const defaultOverrideNative = !(videojs$2.browser.IS_ANY_SAFARI || videojs$2.browser.IS_IOS);
  80711. const {
  80712. overrideNative = defaultOverrideNative
  80713. } = vhs;
  80714. return overrideNative;
  80715. }
  80716. };
  80717. const supportsNativeMediaSources$1 = () => {
  80718. return browserSupportsCodec$1("avc1.4d400d,mp4a.40.2");
  80719. };
  80720. if (supportsNativeMediaSources$1()) {
  80721. videojs$2.getTech("Html5").registerSourceHandler(VhsSourceHandler$1, 0);
  80722. }
  80723. videojs$2.VhsHandler = VhsHandler$1;
  80724. videojs$2.VhsSourceHandler = VhsSourceHandler$1;
  80725. videojs$2.Vhs = Vhs$2;
  80726. if (!videojs$2.use) {
  80727. videojs$2.registerComponent("Vhs", Vhs$2);
  80728. }
  80729. videojs$2.options.vhs = videojs$2.options.vhs || {};
  80730. if (!videojs$2.getPlugin || !videojs$2.getPlugin("reloadSourceOnError")) {
  80731. videojs$2.registerPlugin("reloadSourceOnError", reloadSourceOnError$1);
  80732. }
  80733. var videoJs = "";
  80734. function _assertThisInitialized(self2) {
  80735. if (self2 === void 0) {
  80736. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  80737. }
  80738. return self2;
  80739. }
  80740. function _setPrototypeOf(o, p) {
  80741. _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
  80742. o2.__proto__ = p2;
  80743. return o2;
  80744. };
  80745. return _setPrototypeOf(o, p);
  80746. }
  80747. function _inheritsLoose(subClass, superClass) {
  80748. subClass.prototype = Object.create(superClass.prototype);
  80749. subClass.prototype.constructor = subClass;
  80750. _setPrototypeOf(subClass, superClass);
  80751. }
  80752. function _isNativeReflectConstruct() {
  80753. if (typeof Reflect === "undefined" || !Reflect.construct)
  80754. return false;
  80755. if (Reflect.construct.sham)
  80756. return false;
  80757. if (typeof Proxy === "function")
  80758. return true;
  80759. try {
  80760. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
  80761. }));
  80762. return true;
  80763. } catch (e) {
  80764. return false;
  80765. }
  80766. }
  80767. function _construct(Parent, args, Class) {
  80768. if (_isNativeReflectConstruct()) {
  80769. _construct = Reflect.construct.bind();
  80770. } else {
  80771. _construct = function _construct2(Parent2, args2, Class2) {
  80772. var a = [null];
  80773. a.push.apply(a, args2);
  80774. var Constructor = Function.bind.apply(Parent2, a);
  80775. var instance = new Constructor();
  80776. if (Class2)
  80777. _setPrototypeOf(instance, Class2.prototype);
  80778. return instance;
  80779. };
  80780. }
  80781. return _construct.apply(null, arguments);
  80782. }
  80783. function _inherits(subClass, superClass) {
  80784. if (typeof superClass !== "function" && superClass !== null) {
  80785. throw new TypeError("Super expression must either be null or a function");
  80786. }
  80787. subClass.prototype = Object.create(superClass && superClass.prototype, {
  80788. constructor: {
  80789. value: subClass,
  80790. writable: true,
  80791. configurable: true
  80792. }
  80793. });
  80794. Object.defineProperty(subClass, "prototype", {
  80795. writable: false
  80796. });
  80797. if (superClass)
  80798. _setPrototypeOf(subClass, superClass);
  80799. }
  80800. var DEFAULT_LOCATION = "http://example.com";
  80801. var resolveUrl$1 = function resolveUrl3(baseUrl, relativeUrl) {
  80802. if (/^[a-z]+:/i.test(relativeUrl)) {
  80803. return relativeUrl;
  80804. }
  80805. if (/^data:/.test(baseUrl)) {
  80806. baseUrl = window_1.location && window_1.location.href || "";
  80807. }
  80808. var nativeURL = typeof window_1.URL === "function";
  80809. var protocolLess = /^\/\//.test(baseUrl);
  80810. var removeLocation = !window_1.location && !/\/\//i.test(baseUrl);
  80811. if (nativeURL) {
  80812. baseUrl = new window_1.URL(baseUrl, window_1.location || DEFAULT_LOCATION);
  80813. } else if (!/\/\//i.test(baseUrl)) {
  80814. baseUrl = URLToolkit.buildAbsoluteURL(window_1.location && window_1.location.href || "", baseUrl);
  80815. }
  80816. if (nativeURL) {
  80817. var newUrl = new URL(relativeUrl, baseUrl);
  80818. if (removeLocation) {
  80819. return newUrl.href.slice(DEFAULT_LOCATION.length);
  80820. } else if (protocolLess) {
  80821. return newUrl.href.slice(newUrl.protocol.length);
  80822. }
  80823. return newUrl.href;
  80824. }
  80825. return URLToolkit.buildAbsoluteURL(baseUrl, relativeUrl);
  80826. };
  80827. var Stream = /* @__PURE__ */ function() {
  80828. function Stream2() {
  80829. this.listeners = {};
  80830. }
  80831. var _proto = Stream2.prototype;
  80832. _proto.on = function on3(type2, listener) {
  80833. if (!this.listeners[type2]) {
  80834. this.listeners[type2] = [];
  80835. }
  80836. this.listeners[type2].push(listener);
  80837. };
  80838. _proto.off = function off2(type2, listener) {
  80839. if (!this.listeners[type2]) {
  80840. return false;
  80841. }
  80842. var index2 = this.listeners[type2].indexOf(listener);
  80843. this.listeners[type2] = this.listeners[type2].slice(0);
  80844. this.listeners[type2].splice(index2, 1);
  80845. return index2 > -1;
  80846. };
  80847. _proto.trigger = function trigger2(type2) {
  80848. var callbacks = this.listeners[type2];
  80849. if (!callbacks) {
  80850. return;
  80851. }
  80852. if (arguments.length === 2) {
  80853. var length = callbacks.length;
  80854. for (var i2 = 0; i2 < length; ++i2) {
  80855. callbacks[i2].call(this, arguments[1]);
  80856. }
  80857. } else {
  80858. var args = Array.prototype.slice.call(arguments, 1);
  80859. var _length = callbacks.length;
  80860. for (var _i = 0; _i < _length; ++_i) {
  80861. callbacks[_i].apply(this, args);
  80862. }
  80863. }
  80864. };
  80865. _proto.dispose = function dispose() {
  80866. this.listeners = {};
  80867. };
  80868. _proto.pipe = function pipe(destination2) {
  80869. this.on("data", function(data) {
  80870. destination2.push(data);
  80871. });
  80872. };
  80873. return Stream2;
  80874. }();
  80875. var atob3 = function atob4(s) {
  80876. return window_1.atob ? window_1.atob(s) : Buffer.from(s, "base64").toString("binary");
  80877. };
  80878. function decodeB64ToUint8Array(b64Text) {
  80879. var decodedString = atob3(b64Text);
  80880. var array = new Uint8Array(decodedString.length);
  80881. for (var i2 = 0; i2 < decodedString.length; i2++) {
  80882. array[i2] = decodedString.charCodeAt(i2);
  80883. }
  80884. return array;
  80885. }
  80886. /*! @name m3u8-parser @version 4.8.0 @license Apache-2.0 */
  80887. var LineStream = /* @__PURE__ */ function(_Stream) {
  80888. _inheritsLoose(LineStream2, _Stream);
  80889. function LineStream2() {
  80890. var _this;
  80891. _this = _Stream.call(this) || this;
  80892. _this.buffer = "";
  80893. return _this;
  80894. }
  80895. var _proto = LineStream2.prototype;
  80896. _proto.push = function push(data) {
  80897. var nextNewline;
  80898. this.buffer += data;
  80899. nextNewline = this.buffer.indexOf("\n");
  80900. for (; nextNewline > -1; nextNewline = this.buffer.indexOf("\n")) {
  80901. this.trigger("data", this.buffer.substring(0, nextNewline));
  80902. this.buffer = this.buffer.substring(nextNewline + 1);
  80903. }
  80904. };
  80905. return LineStream2;
  80906. }(Stream);
  80907. var TAB = String.fromCharCode(9);
  80908. var parseByterange = function parseByterange2(byterangeString) {
  80909. var match = /([0-9.]*)?@?([0-9.]*)?/.exec(byterangeString || "");
  80910. var result = {};
  80911. if (match[1]) {
  80912. result.length = parseInt(match[1], 10);
  80913. }
  80914. if (match[2]) {
  80915. result.offset = parseInt(match[2], 10);
  80916. }
  80917. return result;
  80918. };
  80919. var attributeSeparator = function attributeSeparator2() {
  80920. var key = "[^=]*";
  80921. var value = '"[^"]*"|[^,]*';
  80922. var keyvalue = "(?:" + key + ")=(?:" + value + ")";
  80923. return new RegExp("(?:^|,)(" + keyvalue + ")");
  80924. };
  80925. var parseAttributes$1 = function parseAttributes(attributes) {
  80926. var attrs = attributes.split(attributeSeparator());
  80927. var result = {};
  80928. var i2 = attrs.length;
  80929. var attr;
  80930. while (i2--) {
  80931. if (attrs[i2] === "") {
  80932. continue;
  80933. }
  80934. attr = /([^=]*)=(.*)/.exec(attrs[i2]).slice(1);
  80935. attr[0] = attr[0].replace(/^\s+|\s+$/g, "");
  80936. attr[1] = attr[1].replace(/^\s+|\s+$/g, "");
  80937. attr[1] = attr[1].replace(/^['"](.*)['"]$/g, "$1");
  80938. result[attr[0]] = attr[1];
  80939. }
  80940. return result;
  80941. };
  80942. var ParseStream = /* @__PURE__ */ function(_Stream) {
  80943. _inheritsLoose(ParseStream2, _Stream);
  80944. function ParseStream2() {
  80945. var _this;
  80946. _this = _Stream.call(this) || this;
  80947. _this.customParsers = [];
  80948. _this.tagMappers = [];
  80949. return _this;
  80950. }
  80951. var _proto = ParseStream2.prototype;
  80952. _proto.push = function push(line) {
  80953. var _this2 = this;
  80954. var match;
  80955. var event2;
  80956. line = line.trim();
  80957. if (line.length === 0) {
  80958. return;
  80959. }
  80960. if (line[0] !== "#") {
  80961. this.trigger("data", {
  80962. type: "uri",
  80963. uri: line
  80964. });
  80965. return;
  80966. }
  80967. var newLines = this.tagMappers.reduce(function(acc, mapper) {
  80968. var mappedLine = mapper(line);
  80969. if (mappedLine === line) {
  80970. return acc;
  80971. }
  80972. return acc.concat([mappedLine]);
  80973. }, [line]);
  80974. newLines.forEach(function(newLine) {
  80975. for (var i2 = 0; i2 < _this2.customParsers.length; i2++) {
  80976. if (_this2.customParsers[i2].call(_this2, newLine)) {
  80977. return;
  80978. }
  80979. }
  80980. if (newLine.indexOf("#EXT") !== 0) {
  80981. _this2.trigger("data", {
  80982. type: "comment",
  80983. text: newLine.slice(1)
  80984. });
  80985. return;
  80986. }
  80987. newLine = newLine.replace("\r", "");
  80988. match = /^#EXTM3U/.exec(newLine);
  80989. if (match) {
  80990. _this2.trigger("data", {
  80991. type: "tag",
  80992. tagType: "m3u"
  80993. });
  80994. return;
  80995. }
  80996. match = /^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(newLine);
  80997. if (match) {
  80998. event2 = {
  80999. type: "tag",
  81000. tagType: "inf"
  81001. };
  81002. if (match[1]) {
  81003. event2.duration = parseFloat(match[1]);
  81004. }
  81005. if (match[2]) {
  81006. event2.title = match[2];
  81007. }
  81008. _this2.trigger("data", event2);
  81009. return;
  81010. }
  81011. match = /^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(newLine);
  81012. if (match) {
  81013. event2 = {
  81014. type: "tag",
  81015. tagType: "targetduration"
  81016. };
  81017. if (match[1]) {
  81018. event2.duration = parseInt(match[1], 10);
  81019. }
  81020. _this2.trigger("data", event2);
  81021. return;
  81022. }
  81023. match = /^#EXT-X-VERSION:?([0-9.]*)?/.exec(newLine);
  81024. if (match) {
  81025. event2 = {
  81026. type: "tag",
  81027. tagType: "version"
  81028. };
  81029. if (match[1]) {
  81030. event2.version = parseInt(match[1], 10);
  81031. }
  81032. _this2.trigger("data", event2);
  81033. return;
  81034. }
  81035. match = /^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(newLine);
  81036. if (match) {
  81037. event2 = {
  81038. type: "tag",
  81039. tagType: "media-sequence"
  81040. };
  81041. if (match[1]) {
  81042. event2.number = parseInt(match[1], 10);
  81043. }
  81044. _this2.trigger("data", event2);
  81045. return;
  81046. }
  81047. match = /^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(newLine);
  81048. if (match) {
  81049. event2 = {
  81050. type: "tag",
  81051. tagType: "discontinuity-sequence"
  81052. };
  81053. if (match[1]) {
  81054. event2.number = parseInt(match[1], 10);
  81055. }
  81056. _this2.trigger("data", event2);
  81057. return;
  81058. }
  81059. match = /^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(newLine);
  81060. if (match) {
  81061. event2 = {
  81062. type: "tag",
  81063. tagType: "playlist-type"
  81064. };
  81065. if (match[1]) {
  81066. event2.playlistType = match[1];
  81067. }
  81068. _this2.trigger("data", event2);
  81069. return;
  81070. }
  81071. match = /^#EXT-X-BYTERANGE:?(.*)?$/.exec(newLine);
  81072. if (match) {
  81073. event2 = _extends$2(parseByterange(match[1]), {
  81074. type: "tag",
  81075. tagType: "byterange"
  81076. });
  81077. _this2.trigger("data", event2);
  81078. return;
  81079. }
  81080. match = /^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(newLine);
  81081. if (match) {
  81082. event2 = {
  81083. type: "tag",
  81084. tagType: "allow-cache"
  81085. };
  81086. if (match[1]) {
  81087. event2.allowed = !/NO/.test(match[1]);
  81088. }
  81089. _this2.trigger("data", event2);
  81090. return;
  81091. }
  81092. match = /^#EXT-X-MAP:?(.*)$/.exec(newLine);
  81093. if (match) {
  81094. event2 = {
  81095. type: "tag",
  81096. tagType: "map"
  81097. };
  81098. if (match[1]) {
  81099. var attributes = parseAttributes$1(match[1]);
  81100. if (attributes.URI) {
  81101. event2.uri = attributes.URI;
  81102. }
  81103. if (attributes.BYTERANGE) {
  81104. event2.byterange = parseByterange(attributes.BYTERANGE);
  81105. }
  81106. }
  81107. _this2.trigger("data", event2);
  81108. return;
  81109. }
  81110. match = /^#EXT-X-STREAM-INF:?(.*)$/.exec(newLine);
  81111. if (match) {
  81112. event2 = {
  81113. type: "tag",
  81114. tagType: "stream-inf"
  81115. };
  81116. if (match[1]) {
  81117. event2.attributes = parseAttributes$1(match[1]);
  81118. if (event2.attributes.RESOLUTION) {
  81119. var split2 = event2.attributes.RESOLUTION.split("x");
  81120. var resolution = {};
  81121. if (split2[0]) {
  81122. resolution.width = parseInt(split2[0], 10);
  81123. }
  81124. if (split2[1]) {
  81125. resolution.height = parseInt(split2[1], 10);
  81126. }
  81127. event2.attributes.RESOLUTION = resolution;
  81128. }
  81129. if (event2.attributes.BANDWIDTH) {
  81130. event2.attributes.BANDWIDTH = parseInt(event2.attributes.BANDWIDTH, 10);
  81131. }
  81132. if (event2.attributes["FRAME-RATE"]) {
  81133. event2.attributes["FRAME-RATE"] = parseFloat(event2.attributes["FRAME-RATE"]);
  81134. }
  81135. if (event2.attributes["PROGRAM-ID"]) {
  81136. event2.attributes["PROGRAM-ID"] = parseInt(event2.attributes["PROGRAM-ID"], 10);
  81137. }
  81138. }
  81139. _this2.trigger("data", event2);
  81140. return;
  81141. }
  81142. match = /^#EXT-X-MEDIA:?(.*)$/.exec(newLine);
  81143. if (match) {
  81144. event2 = {
  81145. type: "tag",
  81146. tagType: "media"
  81147. };
  81148. if (match[1]) {
  81149. event2.attributes = parseAttributes$1(match[1]);
  81150. }
  81151. _this2.trigger("data", event2);
  81152. return;
  81153. }
  81154. match = /^#EXT-X-ENDLIST/.exec(newLine);
  81155. if (match) {
  81156. _this2.trigger("data", {
  81157. type: "tag",
  81158. tagType: "endlist"
  81159. });
  81160. return;
  81161. }
  81162. match = /^#EXT-X-DISCONTINUITY/.exec(newLine);
  81163. if (match) {
  81164. _this2.trigger("data", {
  81165. type: "tag",
  81166. tagType: "discontinuity"
  81167. });
  81168. return;
  81169. }
  81170. match = /^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(newLine);
  81171. if (match) {
  81172. event2 = {
  81173. type: "tag",
  81174. tagType: "program-date-time"
  81175. };
  81176. if (match[1]) {
  81177. event2.dateTimeString = match[1];
  81178. event2.dateTimeObject = new Date(match[1]);
  81179. }
  81180. _this2.trigger("data", event2);
  81181. return;
  81182. }
  81183. match = /^#EXT-X-KEY:?(.*)$/.exec(newLine);
  81184. if (match) {
  81185. event2 = {
  81186. type: "tag",
  81187. tagType: "key"
  81188. };
  81189. if (match[1]) {
  81190. event2.attributes = parseAttributes$1(match[1]);
  81191. if (event2.attributes.IV) {
  81192. if (event2.attributes.IV.substring(0, 2).toLowerCase() === "0x") {
  81193. event2.attributes.IV = event2.attributes.IV.substring(2);
  81194. }
  81195. event2.attributes.IV = event2.attributes.IV.match(/.{8}/g);
  81196. event2.attributes.IV[0] = parseInt(event2.attributes.IV[0], 16);
  81197. event2.attributes.IV[1] = parseInt(event2.attributes.IV[1], 16);
  81198. event2.attributes.IV[2] = parseInt(event2.attributes.IV[2], 16);
  81199. event2.attributes.IV[3] = parseInt(event2.attributes.IV[3], 16);
  81200. event2.attributes.IV = new Uint32Array(event2.attributes.IV);
  81201. }
  81202. }
  81203. _this2.trigger("data", event2);
  81204. return;
  81205. }
  81206. match = /^#EXT-X-START:?(.*)$/.exec(newLine);
  81207. if (match) {
  81208. event2 = {
  81209. type: "tag",
  81210. tagType: "start"
  81211. };
  81212. if (match[1]) {
  81213. event2.attributes = parseAttributes$1(match[1]);
  81214. event2.attributes["TIME-OFFSET"] = parseFloat(event2.attributes["TIME-OFFSET"]);
  81215. event2.attributes.PRECISE = /YES/.test(event2.attributes.PRECISE);
  81216. }
  81217. _this2.trigger("data", event2);
  81218. return;
  81219. }
  81220. match = /^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(newLine);
  81221. if (match) {
  81222. event2 = {
  81223. type: "tag",
  81224. tagType: "cue-out-cont"
  81225. };
  81226. if (match[1]) {
  81227. event2.data = match[1];
  81228. } else {
  81229. event2.data = "";
  81230. }
  81231. _this2.trigger("data", event2);
  81232. return;
  81233. }
  81234. match = /^#EXT-X-CUE-OUT:?(.*)?$/.exec(newLine);
  81235. if (match) {
  81236. event2 = {
  81237. type: "tag",
  81238. tagType: "cue-out"
  81239. };
  81240. if (match[1]) {
  81241. event2.data = match[1];
  81242. } else {
  81243. event2.data = "";
  81244. }
  81245. _this2.trigger("data", event2);
  81246. return;
  81247. }
  81248. match = /^#EXT-X-CUE-IN:?(.*)?$/.exec(newLine);
  81249. if (match) {
  81250. event2 = {
  81251. type: "tag",
  81252. tagType: "cue-in"
  81253. };
  81254. if (match[1]) {
  81255. event2.data = match[1];
  81256. } else {
  81257. event2.data = "";
  81258. }
  81259. _this2.trigger("data", event2);
  81260. return;
  81261. }
  81262. match = /^#EXT-X-SKIP:(.*)$/.exec(newLine);
  81263. if (match && match[1]) {
  81264. event2 = {
  81265. type: "tag",
  81266. tagType: "skip"
  81267. };
  81268. event2.attributes = parseAttributes$1(match[1]);
  81269. if (event2.attributes.hasOwnProperty("SKIPPED-SEGMENTS")) {
  81270. event2.attributes["SKIPPED-SEGMENTS"] = parseInt(event2.attributes["SKIPPED-SEGMENTS"], 10);
  81271. }
  81272. if (event2.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")) {
  81273. event2.attributes["RECENTLY-REMOVED-DATERANGES"] = event2.attributes["RECENTLY-REMOVED-DATERANGES"].split(TAB);
  81274. }
  81275. _this2.trigger("data", event2);
  81276. return;
  81277. }
  81278. match = /^#EXT-X-PART:(.*)$/.exec(newLine);
  81279. if (match && match[1]) {
  81280. event2 = {
  81281. type: "tag",
  81282. tagType: "part"
  81283. };
  81284. event2.attributes = parseAttributes$1(match[1]);
  81285. ["DURATION"].forEach(function(key) {
  81286. if (event2.attributes.hasOwnProperty(key)) {
  81287. event2.attributes[key] = parseFloat(event2.attributes[key]);
  81288. }
  81289. });
  81290. ["INDEPENDENT", "GAP"].forEach(function(key) {
  81291. if (event2.attributes.hasOwnProperty(key)) {
  81292. event2.attributes[key] = /YES/.test(event2.attributes[key]);
  81293. }
  81294. });
  81295. if (event2.attributes.hasOwnProperty("BYTERANGE")) {
  81296. event2.attributes.byterange = parseByterange(event2.attributes.BYTERANGE);
  81297. }
  81298. _this2.trigger("data", event2);
  81299. return;
  81300. }
  81301. match = /^#EXT-X-SERVER-CONTROL:(.*)$/.exec(newLine);
  81302. if (match && match[1]) {
  81303. event2 = {
  81304. type: "tag",
  81305. tagType: "server-control"
  81306. };
  81307. event2.attributes = parseAttributes$1(match[1]);
  81308. ["CAN-SKIP-UNTIL", "PART-HOLD-BACK", "HOLD-BACK"].forEach(function(key) {
  81309. if (event2.attributes.hasOwnProperty(key)) {
  81310. event2.attributes[key] = parseFloat(event2.attributes[key]);
  81311. }
  81312. });
  81313. ["CAN-SKIP-DATERANGES", "CAN-BLOCK-RELOAD"].forEach(function(key) {
  81314. if (event2.attributes.hasOwnProperty(key)) {
  81315. event2.attributes[key] = /YES/.test(event2.attributes[key]);
  81316. }
  81317. });
  81318. _this2.trigger("data", event2);
  81319. return;
  81320. }
  81321. match = /^#EXT-X-PART-INF:(.*)$/.exec(newLine);
  81322. if (match && match[1]) {
  81323. event2 = {
  81324. type: "tag",
  81325. tagType: "part-inf"
  81326. };
  81327. event2.attributes = parseAttributes$1(match[1]);
  81328. ["PART-TARGET"].forEach(function(key) {
  81329. if (event2.attributes.hasOwnProperty(key)) {
  81330. event2.attributes[key] = parseFloat(event2.attributes[key]);
  81331. }
  81332. });
  81333. _this2.trigger("data", event2);
  81334. return;
  81335. }
  81336. match = /^#EXT-X-PRELOAD-HINT:(.*)$/.exec(newLine);
  81337. if (match && match[1]) {
  81338. event2 = {
  81339. type: "tag",
  81340. tagType: "preload-hint"
  81341. };
  81342. event2.attributes = parseAttributes$1(match[1]);
  81343. ["BYTERANGE-START", "BYTERANGE-LENGTH"].forEach(function(key) {
  81344. if (event2.attributes.hasOwnProperty(key)) {
  81345. event2.attributes[key] = parseInt(event2.attributes[key], 10);
  81346. var subkey = key === "BYTERANGE-LENGTH" ? "length" : "offset";
  81347. event2.attributes.byterange = event2.attributes.byterange || {};
  81348. event2.attributes.byterange[subkey] = event2.attributes[key];
  81349. delete event2.attributes[key];
  81350. }
  81351. });
  81352. _this2.trigger("data", event2);
  81353. return;
  81354. }
  81355. match = /^#EXT-X-RENDITION-REPORT:(.*)$/.exec(newLine);
  81356. if (match && match[1]) {
  81357. event2 = {
  81358. type: "tag",
  81359. tagType: "rendition-report"
  81360. };
  81361. event2.attributes = parseAttributes$1(match[1]);
  81362. ["LAST-MSN", "LAST-PART"].forEach(function(key) {
  81363. if (event2.attributes.hasOwnProperty(key)) {
  81364. event2.attributes[key] = parseInt(event2.attributes[key], 10);
  81365. }
  81366. });
  81367. _this2.trigger("data", event2);
  81368. return;
  81369. }
  81370. _this2.trigger("data", {
  81371. type: "tag",
  81372. data: newLine.slice(4)
  81373. });
  81374. });
  81375. };
  81376. _proto.addParser = function addParser(_ref) {
  81377. var _this3 = this;
  81378. var expression = _ref.expression, customType = _ref.customType, dataParser = _ref.dataParser, segment = _ref.segment;
  81379. if (typeof dataParser !== "function") {
  81380. dataParser = function dataParser2(line) {
  81381. return line;
  81382. };
  81383. }
  81384. this.customParsers.push(function(line) {
  81385. var match = expression.exec(line);
  81386. if (match) {
  81387. _this3.trigger("data", {
  81388. type: "custom",
  81389. data: dataParser(line),
  81390. customType,
  81391. segment
  81392. });
  81393. return true;
  81394. }
  81395. });
  81396. };
  81397. _proto.addTagMapper = function addTagMapper(_ref2) {
  81398. var expression = _ref2.expression, map = _ref2.map;
  81399. var mapFn = function mapFn2(line) {
  81400. if (expression.test(line)) {
  81401. return map(line);
  81402. }
  81403. return line;
  81404. };
  81405. this.tagMappers.push(mapFn);
  81406. };
  81407. return ParseStream2;
  81408. }(Stream);
  81409. var camelCase = function camelCase2(str) {
  81410. return str.toLowerCase().replace(/-(\w)/g, function(a) {
  81411. return a[1].toUpperCase();
  81412. });
  81413. };
  81414. var camelCaseKeys = function camelCaseKeys2(attributes) {
  81415. var result = {};
  81416. Object.keys(attributes).forEach(function(key) {
  81417. result[camelCase(key)] = attributes[key];
  81418. });
  81419. return result;
  81420. };
  81421. var setHoldBack = function setHoldBack2(manifest) {
  81422. var serverControl = manifest.serverControl, targetDuration = manifest.targetDuration, partTargetDuration = manifest.partTargetDuration;
  81423. if (!serverControl) {
  81424. return;
  81425. }
  81426. var tag = "#EXT-X-SERVER-CONTROL";
  81427. var hb = "holdBack";
  81428. var phb = "partHoldBack";
  81429. var minTargetDuration = targetDuration && targetDuration * 3;
  81430. var minPartDuration = partTargetDuration && partTargetDuration * 2;
  81431. if (targetDuration && !serverControl.hasOwnProperty(hb)) {
  81432. serverControl[hb] = minTargetDuration;
  81433. this.trigger("info", {
  81434. message: tag + " defaulting HOLD-BACK to targetDuration * 3 (" + minTargetDuration + ")."
  81435. });
  81436. }
  81437. if (minTargetDuration && serverControl[hb] < minTargetDuration) {
  81438. this.trigger("warn", {
  81439. message: tag + " clamping HOLD-BACK (" + serverControl[hb] + ") to targetDuration * 3 (" + minTargetDuration + ")"
  81440. });
  81441. serverControl[hb] = minTargetDuration;
  81442. }
  81443. if (partTargetDuration && !serverControl.hasOwnProperty(phb)) {
  81444. serverControl[phb] = partTargetDuration * 3;
  81445. this.trigger("info", {
  81446. message: tag + " defaulting PART-HOLD-BACK to partTargetDuration * 3 (" + serverControl[phb] + ")."
  81447. });
  81448. }
  81449. if (partTargetDuration && serverControl[phb] < minPartDuration) {
  81450. this.trigger("warn", {
  81451. message: tag + " clamping PART-HOLD-BACK (" + serverControl[phb] + ") to partTargetDuration * 2 (" + minPartDuration + ")."
  81452. });
  81453. serverControl[phb] = minPartDuration;
  81454. }
  81455. };
  81456. var Parser = /* @__PURE__ */ function(_Stream) {
  81457. _inheritsLoose(Parser2, _Stream);
  81458. function Parser2() {
  81459. var _this;
  81460. _this = _Stream.call(this) || this;
  81461. _this.lineStream = new LineStream();
  81462. _this.parseStream = new ParseStream();
  81463. _this.lineStream.pipe(_this.parseStream);
  81464. var self2 = _assertThisInitialized(_this);
  81465. var uris = [];
  81466. var currentUri = {};
  81467. var currentMap;
  81468. var _key;
  81469. var hasParts = false;
  81470. var noop2 = function noop3() {
  81471. };
  81472. var defaultMediaGroups = {
  81473. "AUDIO": {},
  81474. "VIDEO": {},
  81475. "CLOSED-CAPTIONS": {},
  81476. "SUBTITLES": {}
  81477. };
  81478. var widevineUuid = "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";
  81479. var currentTimeline = 0;
  81480. _this.manifest = {
  81481. allowCache: true,
  81482. discontinuityStarts: [],
  81483. segments: []
  81484. };
  81485. var lastByterangeEnd = 0;
  81486. var lastPartByterangeEnd = 0;
  81487. _this.on("end", function() {
  81488. if (currentUri.uri || !currentUri.parts && !currentUri.preloadHints) {
  81489. return;
  81490. }
  81491. if (!currentUri.map && currentMap) {
  81492. currentUri.map = currentMap;
  81493. }
  81494. if (!currentUri.key && _key) {
  81495. currentUri.key = _key;
  81496. }
  81497. if (!currentUri.timeline && typeof currentTimeline === "number") {
  81498. currentUri.timeline = currentTimeline;
  81499. }
  81500. _this.manifest.preloadSegment = currentUri;
  81501. });
  81502. _this.parseStream.on("data", function(entry) {
  81503. var mediaGroup;
  81504. var rendition;
  81505. ({
  81506. tag: function tag() {
  81507. ({
  81508. version: function version2() {
  81509. if (entry.version) {
  81510. this.manifest.version = entry.version;
  81511. }
  81512. },
  81513. "allow-cache": function allowCache() {
  81514. this.manifest.allowCache = entry.allowed;
  81515. if (!("allowed" in entry)) {
  81516. this.trigger("info", {
  81517. message: "defaulting allowCache to YES"
  81518. });
  81519. this.manifest.allowCache = true;
  81520. }
  81521. },
  81522. byterange: function byterange() {
  81523. var byterange2 = {};
  81524. if ("length" in entry) {
  81525. currentUri.byterange = byterange2;
  81526. byterange2.length = entry.length;
  81527. if (!("offset" in entry)) {
  81528. entry.offset = lastByterangeEnd;
  81529. }
  81530. }
  81531. if ("offset" in entry) {
  81532. currentUri.byterange = byterange2;
  81533. byterange2.offset = entry.offset;
  81534. }
  81535. lastByterangeEnd = byterange2.offset + byterange2.length;
  81536. },
  81537. endlist: function endlist() {
  81538. this.manifest.endList = true;
  81539. },
  81540. inf: function inf() {
  81541. if (!("mediaSequence" in this.manifest)) {
  81542. this.manifest.mediaSequence = 0;
  81543. this.trigger("info", {
  81544. message: "defaulting media sequence to zero"
  81545. });
  81546. }
  81547. if (!("discontinuitySequence" in this.manifest)) {
  81548. this.manifest.discontinuitySequence = 0;
  81549. this.trigger("info", {
  81550. message: "defaulting discontinuity sequence to zero"
  81551. });
  81552. }
  81553. if (entry.duration > 0) {
  81554. currentUri.duration = entry.duration;
  81555. }
  81556. if (entry.duration === 0) {
  81557. currentUri.duration = 0.01;
  81558. this.trigger("info", {
  81559. message: "updating zero segment duration to a small value"
  81560. });
  81561. }
  81562. this.manifest.segments = uris;
  81563. },
  81564. key: function key() {
  81565. if (!entry.attributes) {
  81566. this.trigger("warn", {
  81567. message: "ignoring key declaration without attribute list"
  81568. });
  81569. return;
  81570. }
  81571. if (entry.attributes.METHOD === "NONE") {
  81572. _key = null;
  81573. return;
  81574. }
  81575. if (!entry.attributes.URI) {
  81576. this.trigger("warn", {
  81577. message: "ignoring key declaration without URI"
  81578. });
  81579. return;
  81580. }
  81581. if (entry.attributes.KEYFORMAT === "com.apple.streamingkeydelivery") {
  81582. this.manifest.contentProtection = this.manifest.contentProtection || {};
  81583. this.manifest.contentProtection["com.apple.fps.1_0"] = {
  81584. attributes: entry.attributes
  81585. };
  81586. return;
  81587. }
  81588. if (entry.attributes.KEYFORMAT === "com.microsoft.playready") {
  81589. this.manifest.contentProtection = this.manifest.contentProtection || {};
  81590. this.manifest.contentProtection["com.microsoft.playready"] = {
  81591. uri: entry.attributes.URI
  81592. };
  81593. return;
  81594. }
  81595. if (entry.attributes.KEYFORMAT === widevineUuid) {
  81596. var VALID_METHODS = ["SAMPLE-AES", "SAMPLE-AES-CTR", "SAMPLE-AES-CENC"];
  81597. if (VALID_METHODS.indexOf(entry.attributes.METHOD) === -1) {
  81598. this.trigger("warn", {
  81599. message: "invalid key method provided for Widevine"
  81600. });
  81601. return;
  81602. }
  81603. if (entry.attributes.METHOD === "SAMPLE-AES-CENC") {
  81604. this.trigger("warn", {
  81605. message: "SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"
  81606. });
  81607. }
  81608. if (entry.attributes.URI.substring(0, 23) !== "data:text/plain;base64,") {
  81609. this.trigger("warn", {
  81610. message: "invalid key URI provided for Widevine"
  81611. });
  81612. return;
  81613. }
  81614. if (!(entry.attributes.KEYID && entry.attributes.KEYID.substring(0, 2) === "0x")) {
  81615. this.trigger("warn", {
  81616. message: "invalid key ID provided for Widevine"
  81617. });
  81618. return;
  81619. }
  81620. this.manifest.contentProtection = this.manifest.contentProtection || {};
  81621. this.manifest.contentProtection["com.widevine.alpha"] = {
  81622. attributes: {
  81623. schemeIdUri: entry.attributes.KEYFORMAT,
  81624. keyId: entry.attributes.KEYID.substring(2)
  81625. },
  81626. pssh: decodeB64ToUint8Array(entry.attributes.URI.split(",")[1])
  81627. };
  81628. return;
  81629. }
  81630. if (!entry.attributes.METHOD) {
  81631. this.trigger("warn", {
  81632. message: "defaulting key method to AES-128"
  81633. });
  81634. }
  81635. _key = {
  81636. method: entry.attributes.METHOD || "AES-128",
  81637. uri: entry.attributes.URI
  81638. };
  81639. if (typeof entry.attributes.IV !== "undefined") {
  81640. _key.iv = entry.attributes.IV;
  81641. }
  81642. },
  81643. "media-sequence": function mediaSequence() {
  81644. if (!isFinite(entry.number)) {
  81645. this.trigger("warn", {
  81646. message: "ignoring invalid media sequence: " + entry.number
  81647. });
  81648. return;
  81649. }
  81650. this.manifest.mediaSequence = entry.number;
  81651. },
  81652. "discontinuity-sequence": function discontinuitySequence() {
  81653. if (!isFinite(entry.number)) {
  81654. this.trigger("warn", {
  81655. message: "ignoring invalid discontinuity sequence: " + entry.number
  81656. });
  81657. return;
  81658. }
  81659. this.manifest.discontinuitySequence = entry.number;
  81660. currentTimeline = entry.number;
  81661. },
  81662. "playlist-type": function playlistType() {
  81663. if (!/VOD|EVENT/.test(entry.playlistType)) {
  81664. this.trigger("warn", {
  81665. message: "ignoring unknown playlist type: " + entry.playlist
  81666. });
  81667. return;
  81668. }
  81669. this.manifest.playlistType = entry.playlistType;
  81670. },
  81671. map: function map() {
  81672. currentMap = {};
  81673. if (entry.uri) {
  81674. currentMap.uri = entry.uri;
  81675. }
  81676. if (entry.byterange) {
  81677. currentMap.byterange = entry.byterange;
  81678. }
  81679. if (_key) {
  81680. currentMap.key = _key;
  81681. }
  81682. },
  81683. "stream-inf": function streamInf() {
  81684. this.manifest.playlists = uris;
  81685. this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;
  81686. if (!entry.attributes) {
  81687. this.trigger("warn", {
  81688. message: "ignoring empty stream-inf attributes"
  81689. });
  81690. return;
  81691. }
  81692. if (!currentUri.attributes) {
  81693. currentUri.attributes = {};
  81694. }
  81695. _extends$2(currentUri.attributes, entry.attributes);
  81696. },
  81697. media: function media() {
  81698. this.manifest.mediaGroups = this.manifest.mediaGroups || defaultMediaGroups;
  81699. if (!(entry.attributes && entry.attributes.TYPE && entry.attributes["GROUP-ID"] && entry.attributes.NAME)) {
  81700. this.trigger("warn", {
  81701. message: "ignoring incomplete or missing media group"
  81702. });
  81703. return;
  81704. }
  81705. var mediaGroupType = this.manifest.mediaGroups[entry.attributes.TYPE];
  81706. mediaGroupType[entry.attributes["GROUP-ID"]] = mediaGroupType[entry.attributes["GROUP-ID"]] || {};
  81707. mediaGroup = mediaGroupType[entry.attributes["GROUP-ID"]];
  81708. rendition = {
  81709. default: /yes/i.test(entry.attributes.DEFAULT)
  81710. };
  81711. if (rendition.default) {
  81712. rendition.autoselect = true;
  81713. } else {
  81714. rendition.autoselect = /yes/i.test(entry.attributes.AUTOSELECT);
  81715. }
  81716. if (entry.attributes.LANGUAGE) {
  81717. rendition.language = entry.attributes.LANGUAGE;
  81718. }
  81719. if (entry.attributes.URI) {
  81720. rendition.uri = entry.attributes.URI;
  81721. }
  81722. if (entry.attributes["INSTREAM-ID"]) {
  81723. rendition.instreamId = entry.attributes["INSTREAM-ID"];
  81724. }
  81725. if (entry.attributes.CHARACTERISTICS) {
  81726. rendition.characteristics = entry.attributes.CHARACTERISTICS;
  81727. }
  81728. if (entry.attributes.FORCED) {
  81729. rendition.forced = /yes/i.test(entry.attributes.FORCED);
  81730. }
  81731. mediaGroup[entry.attributes.NAME] = rendition;
  81732. },
  81733. discontinuity: function discontinuity() {
  81734. currentTimeline += 1;
  81735. currentUri.discontinuity = true;
  81736. this.manifest.discontinuityStarts.push(uris.length);
  81737. },
  81738. "program-date-time": function programDateTime() {
  81739. if (typeof this.manifest.dateTimeString === "undefined") {
  81740. this.manifest.dateTimeString = entry.dateTimeString;
  81741. this.manifest.dateTimeObject = entry.dateTimeObject;
  81742. }
  81743. currentUri.dateTimeString = entry.dateTimeString;
  81744. currentUri.dateTimeObject = entry.dateTimeObject;
  81745. },
  81746. targetduration: function targetduration() {
  81747. if (!isFinite(entry.duration) || entry.duration < 0) {
  81748. this.trigger("warn", {
  81749. message: "ignoring invalid target duration: " + entry.duration
  81750. });
  81751. return;
  81752. }
  81753. this.manifest.targetDuration = entry.duration;
  81754. setHoldBack.call(this, this.manifest);
  81755. },
  81756. start: function start2() {
  81757. if (!entry.attributes || isNaN(entry.attributes["TIME-OFFSET"])) {
  81758. this.trigger("warn", {
  81759. message: "ignoring start declaration without appropriate attribute list"
  81760. });
  81761. return;
  81762. }
  81763. this.manifest.start = {
  81764. timeOffset: entry.attributes["TIME-OFFSET"],
  81765. precise: entry.attributes.PRECISE
  81766. };
  81767. },
  81768. "cue-out": function cueOut() {
  81769. currentUri.cueOut = entry.data;
  81770. },
  81771. "cue-out-cont": function cueOutCont() {
  81772. currentUri.cueOutCont = entry.data;
  81773. },
  81774. "cue-in": function cueIn() {
  81775. currentUri.cueIn = entry.data;
  81776. },
  81777. "skip": function skip() {
  81778. this.manifest.skip = camelCaseKeys(entry.attributes);
  81779. this.warnOnMissingAttributes_("#EXT-X-SKIP", entry.attributes, ["SKIPPED-SEGMENTS"]);
  81780. },
  81781. "part": function part() {
  81782. var _this2 = this;
  81783. hasParts = true;
  81784. var segmentIndex = this.manifest.segments.length;
  81785. var part2 = camelCaseKeys(entry.attributes);
  81786. currentUri.parts = currentUri.parts || [];
  81787. currentUri.parts.push(part2);
  81788. if (part2.byterange) {
  81789. if (!part2.byterange.hasOwnProperty("offset")) {
  81790. part2.byterange.offset = lastPartByterangeEnd;
  81791. }
  81792. lastPartByterangeEnd = part2.byterange.offset + part2.byterange.length;
  81793. }
  81794. var partIndex = currentUri.parts.length - 1;
  81795. this.warnOnMissingAttributes_("#EXT-X-PART #" + partIndex + " for segment #" + segmentIndex, entry.attributes, ["URI", "DURATION"]);
  81796. if (this.manifest.renditionReports) {
  81797. this.manifest.renditionReports.forEach(function(r2, i2) {
  81798. if (!r2.hasOwnProperty("lastPart")) {
  81799. _this2.trigger("warn", {
  81800. message: "#EXT-X-RENDITION-REPORT #" + i2 + " lacks required attribute(s): LAST-PART"
  81801. });
  81802. }
  81803. });
  81804. }
  81805. },
  81806. "server-control": function serverControl() {
  81807. var attrs = this.manifest.serverControl = camelCaseKeys(entry.attributes);
  81808. if (!attrs.hasOwnProperty("canBlockReload")) {
  81809. attrs.canBlockReload = false;
  81810. this.trigger("info", {
  81811. message: "#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"
  81812. });
  81813. }
  81814. setHoldBack.call(this, this.manifest);
  81815. if (attrs.canSkipDateranges && !attrs.hasOwnProperty("canSkipUntil")) {
  81816. this.trigger("warn", {
  81817. message: "#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"
  81818. });
  81819. }
  81820. },
  81821. "preload-hint": function preloadHint() {
  81822. var segmentIndex = this.manifest.segments.length;
  81823. var hint = camelCaseKeys(entry.attributes);
  81824. var isPart = hint.type && hint.type === "PART";
  81825. currentUri.preloadHints = currentUri.preloadHints || [];
  81826. currentUri.preloadHints.push(hint);
  81827. if (hint.byterange) {
  81828. if (!hint.byterange.hasOwnProperty("offset")) {
  81829. hint.byterange.offset = isPart ? lastPartByterangeEnd : 0;
  81830. if (isPart) {
  81831. lastPartByterangeEnd = hint.byterange.offset + hint.byterange.length;
  81832. }
  81833. }
  81834. }
  81835. var index2 = currentUri.preloadHints.length - 1;
  81836. this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #" + index2 + " for segment #" + segmentIndex, entry.attributes, ["TYPE", "URI"]);
  81837. if (!hint.type) {
  81838. return;
  81839. }
  81840. for (var i2 = 0; i2 < currentUri.preloadHints.length - 1; i2++) {
  81841. var otherHint = currentUri.preloadHints[i2];
  81842. if (!otherHint.type) {
  81843. continue;
  81844. }
  81845. if (otherHint.type === hint.type) {
  81846. this.trigger("warn", {
  81847. message: "#EXT-X-PRELOAD-HINT #" + index2 + " for segment #" + segmentIndex + " has the same TYPE " + hint.type + " as preload hint #" + i2
  81848. });
  81849. }
  81850. }
  81851. },
  81852. "rendition-report": function renditionReport() {
  81853. var report = camelCaseKeys(entry.attributes);
  81854. this.manifest.renditionReports = this.manifest.renditionReports || [];
  81855. this.manifest.renditionReports.push(report);
  81856. var index2 = this.manifest.renditionReports.length - 1;
  81857. var required = ["LAST-MSN", "URI"];
  81858. if (hasParts) {
  81859. required.push("LAST-PART");
  81860. }
  81861. this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #" + index2, entry.attributes, required);
  81862. },
  81863. "part-inf": function partInf() {
  81864. this.manifest.partInf = camelCaseKeys(entry.attributes);
  81865. this.warnOnMissingAttributes_("#EXT-X-PART-INF", entry.attributes, ["PART-TARGET"]);
  81866. if (this.manifest.partInf.partTarget) {
  81867. this.manifest.partTargetDuration = this.manifest.partInf.partTarget;
  81868. }
  81869. setHoldBack.call(this, this.manifest);
  81870. }
  81871. }[entry.tagType] || noop2).call(self2);
  81872. },
  81873. uri: function uri() {
  81874. currentUri.uri = entry.uri;
  81875. uris.push(currentUri);
  81876. if (this.manifest.targetDuration && !("duration" in currentUri)) {
  81877. this.trigger("warn", {
  81878. message: "defaulting segment duration to the target duration"
  81879. });
  81880. currentUri.duration = this.manifest.targetDuration;
  81881. }
  81882. if (_key) {
  81883. currentUri.key = _key;
  81884. }
  81885. currentUri.timeline = currentTimeline;
  81886. if (currentMap) {
  81887. currentUri.map = currentMap;
  81888. }
  81889. lastPartByterangeEnd = 0;
  81890. currentUri = {};
  81891. },
  81892. comment: function comment() {
  81893. },
  81894. custom: function custom() {
  81895. if (entry.segment) {
  81896. currentUri.custom = currentUri.custom || {};
  81897. currentUri.custom[entry.customType] = entry.data;
  81898. } else {
  81899. this.manifest.custom = this.manifest.custom || {};
  81900. this.manifest.custom[entry.customType] = entry.data;
  81901. }
  81902. }
  81903. })[entry.type].call(self2);
  81904. });
  81905. return _this;
  81906. }
  81907. var _proto = Parser2.prototype;
  81908. _proto.warnOnMissingAttributes_ = function warnOnMissingAttributes_(identifier, attributes, required) {
  81909. var missing = [];
  81910. required.forEach(function(key) {
  81911. if (!attributes.hasOwnProperty(key)) {
  81912. missing.push(key);
  81913. }
  81914. });
  81915. if (missing.length) {
  81916. this.trigger("warn", {
  81917. message: identifier + " lacks required attribute(s): " + missing.join(", ")
  81918. });
  81919. }
  81920. };
  81921. _proto.push = function push(chunk) {
  81922. this.lineStream.push(chunk);
  81923. };
  81924. _proto.end = function end() {
  81925. this.lineStream.push("\n");
  81926. this.trigger("end");
  81927. };
  81928. _proto.addParser = function addParser(options2) {
  81929. this.parseStream.addParser(options2);
  81930. };
  81931. _proto.addTagMapper = function addTagMapper(options2) {
  81932. this.parseStream.addTagMapper(options2);
  81933. };
  81934. return Parser2;
  81935. }(Stream);
  81936. var regexs = {
  81937. mp4: /^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,
  81938. webm: /^(vp0?[89]|av0?1|opus|vorbis)/,
  81939. ogg: /^(vp0?[89]|theora|flac|opus|vorbis)/,
  81940. video: /^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,
  81941. audio: /^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,
  81942. text: /^(stpp.ttml.im1t)/,
  81943. muxerVideo: /^(avc0?1)/,
  81944. muxerAudio: /^(mp4a)/,
  81945. muxerText: /a^/
  81946. };
  81947. var mediaTypes = ["video", "audio", "text"];
  81948. var upperMediaTypes = ["Video", "Audio", "Text"];
  81949. var translateLegacyCodec2 = function translateLegacyCodec3(codec) {
  81950. if (!codec) {
  81951. return codec;
  81952. }
  81953. return codec.replace(/avc1\.(\d+)\.(\d+)/i, function(orig, profile, avcLevel) {
  81954. var profileHex = ("00" + Number(profile).toString(16)).slice(-2);
  81955. var avcLevelHex = ("00" + Number(avcLevel).toString(16)).slice(-2);
  81956. return "avc1." + profileHex + "00" + avcLevelHex;
  81957. });
  81958. };
  81959. var parseCodecs2 = function parseCodecs3(codecString) {
  81960. if (codecString === void 0) {
  81961. codecString = "";
  81962. }
  81963. var codecs = codecString.split(",");
  81964. var result = [];
  81965. codecs.forEach(function(codec) {
  81966. codec = codec.trim();
  81967. var codecType;
  81968. mediaTypes.forEach(function(name) {
  81969. var match = regexs[name].exec(codec.toLowerCase());
  81970. if (!match || match.length <= 1) {
  81971. return;
  81972. }
  81973. codecType = name;
  81974. var type2 = codec.substring(0, match[1].length);
  81975. var details = codec.replace(type2, "");
  81976. result.push({
  81977. type: type2,
  81978. details,
  81979. mediaType: name
  81980. });
  81981. });
  81982. if (!codecType) {
  81983. result.push({
  81984. type: codec,
  81985. details: "",
  81986. mediaType: "unknown"
  81987. });
  81988. }
  81989. });
  81990. return result;
  81991. };
  81992. var codecsFromDefault2 = function codecsFromDefault3(master, audioGroupId) {
  81993. if (!master.mediaGroups.AUDIO || !audioGroupId) {
  81994. return null;
  81995. }
  81996. var audioGroup = master.mediaGroups.AUDIO[audioGroupId];
  81997. if (!audioGroup) {
  81998. return null;
  81999. }
  82000. for (var name in audioGroup) {
  82001. var audioType = audioGroup[name];
  82002. if (audioType.default && audioType.playlists) {
  82003. return parseCodecs2(audioType.playlists[0].attributes.CODECS);
  82004. }
  82005. }
  82006. return null;
  82007. };
  82008. var isAudioCodec2 = function isAudioCodec3(codec) {
  82009. if (codec === void 0) {
  82010. codec = "";
  82011. }
  82012. return regexs.audio.test(codec.trim().toLowerCase());
  82013. };
  82014. var isTextCodec2 = function isTextCodec3(codec) {
  82015. if (codec === void 0) {
  82016. codec = "";
  82017. }
  82018. return regexs.text.test(codec.trim().toLowerCase());
  82019. };
  82020. var getMimeForCodec2 = function getMimeForCodec3(codecString) {
  82021. if (!codecString || typeof codecString !== "string") {
  82022. return;
  82023. }
  82024. var codecs = codecString.toLowerCase().split(",").map(function(c) {
  82025. return translateLegacyCodec2(c.trim());
  82026. });
  82027. var type2 = "video";
  82028. if (codecs.length === 1 && isAudioCodec2(codecs[0])) {
  82029. type2 = "audio";
  82030. } else if (codecs.length === 1 && isTextCodec2(codecs[0])) {
  82031. type2 = "application";
  82032. }
  82033. var container = "mp4";
  82034. if (codecs.every(function(c) {
  82035. return regexs.mp4.test(c);
  82036. })) {
  82037. container = "mp4";
  82038. } else if (codecs.every(function(c) {
  82039. return regexs.webm.test(c);
  82040. })) {
  82041. container = "webm";
  82042. } else if (codecs.every(function(c) {
  82043. return regexs.ogg.test(c);
  82044. })) {
  82045. container = "ogg";
  82046. }
  82047. return type2 + "/" + container + ';codecs="' + codecString + '"';
  82048. };
  82049. var browserSupportsCodec2 = function browserSupportsCodec3(codecString) {
  82050. if (codecString === void 0) {
  82051. codecString = "";
  82052. }
  82053. return window_1.MediaSource && window_1.MediaSource.isTypeSupported && window_1.MediaSource.isTypeSupported(getMimeForCodec2(codecString)) || false;
  82054. };
  82055. var muxerSupportsCodec2 = function muxerSupportsCodec3(codecString) {
  82056. if (codecString === void 0) {
  82057. codecString = "";
  82058. }
  82059. return codecString.toLowerCase().split(",").every(function(codec) {
  82060. codec = codec.trim();
  82061. for (var i2 = 0; i2 < upperMediaTypes.length; i2++) {
  82062. var type2 = upperMediaTypes[i2];
  82063. if (regexs["muxer" + type2].test(codec)) {
  82064. return true;
  82065. }
  82066. }
  82067. return false;
  82068. });
  82069. };
  82070. var DEFAULT_AUDIO_CODEC = "mp4a.40.2";
  82071. var DEFAULT_VIDEO_CODEC = "avc1.4d400d";
  82072. var MPEGURL_REGEX = /^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;
  82073. var DASH_REGEX = /^application\/dash\+xml/i;
  82074. var simpleTypeFromSourceType2 = function simpleTypeFromSourceType3(type2) {
  82075. if (MPEGURL_REGEX.test(type2)) {
  82076. return "hls";
  82077. }
  82078. if (DASH_REGEX.test(type2)) {
  82079. return "dash";
  82080. }
  82081. if (type2 === "application/vnd.videojs.vhs+json") {
  82082. return "vhs-json";
  82083. }
  82084. return null;
  82085. };
  82086. var countBits2 = function countBits3(x) {
  82087. return x.toString(2).length;
  82088. };
  82089. var countBytes2 = function countBytes3(x) {
  82090. return Math.ceil(countBits2(x) / 8);
  82091. };
  82092. var isArrayBufferView2 = function isArrayBufferView3(obj) {
  82093. if (ArrayBuffer.isView === "function") {
  82094. return ArrayBuffer.isView(obj);
  82095. }
  82096. return obj && obj.buffer instanceof ArrayBuffer;
  82097. };
  82098. var isTypedArray2 = function isTypedArray3(obj) {
  82099. return isArrayBufferView2(obj);
  82100. };
  82101. var toUint82 = function toUint83(bytes) {
  82102. if (bytes instanceof Uint8Array) {
  82103. return bytes;
  82104. }
  82105. if (!Array.isArray(bytes) && !isTypedArray2(bytes) && !(bytes instanceof ArrayBuffer)) {
  82106. if (typeof bytes !== "number" || typeof bytes === "number" && bytes !== bytes) {
  82107. bytes = 0;
  82108. } else {
  82109. bytes = [bytes];
  82110. }
  82111. }
  82112. return new Uint8Array(bytes && bytes.buffer || bytes, bytes && bytes.byteOffset || 0, bytes && bytes.byteLength || 0);
  82113. };
  82114. var BigInt = window_1.BigInt || Number;
  82115. var BYTE_TABLE = [BigInt("0x1"), BigInt("0x100"), BigInt("0x10000"), BigInt("0x1000000"), BigInt("0x100000000"), BigInt("0x10000000000"), BigInt("0x1000000000000"), BigInt("0x100000000000000"), BigInt("0x10000000000000000")];
  82116. (function() {
  82117. var a = new Uint16Array([65484]);
  82118. var b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);
  82119. if (b[0] === 255) {
  82120. return "big";
  82121. }
  82122. if (b[0] === 204) {
  82123. return "little";
  82124. }
  82125. return "unknown";
  82126. })();
  82127. var bytesToNumber2 = function bytesToNumber3(bytes, _temp) {
  82128. var _ref = _temp === void 0 ? {} : _temp, _ref$signed = _ref.signed, signed = _ref$signed === void 0 ? false : _ref$signed, _ref$le = _ref.le, le = _ref$le === void 0 ? false : _ref$le;
  82129. bytes = toUint82(bytes);
  82130. var fn2 = le ? "reduce" : "reduceRight";
  82131. var obj = bytes[fn2] ? bytes[fn2] : Array.prototype[fn2];
  82132. var number = obj.call(bytes, function(total, byte, i2) {
  82133. var exponent = le ? i2 : Math.abs(i2 + 1 - bytes.length);
  82134. return total + BigInt(byte) * BYTE_TABLE[exponent];
  82135. }, BigInt(0));
  82136. if (signed) {
  82137. var max2 = BYTE_TABLE[bytes.length] / BigInt(2) - BigInt(1);
  82138. number = BigInt(number);
  82139. if (number > max2) {
  82140. number -= max2;
  82141. number -= max2;
  82142. number -= BigInt(2);
  82143. }
  82144. }
  82145. return Number(number);
  82146. };
  82147. var numberToBytes2 = function numberToBytes3(number, _temp2) {
  82148. var _ref2 = _temp2 === void 0 ? {} : _temp2, _ref2$le = _ref2.le, le = _ref2$le === void 0 ? false : _ref2$le;
  82149. if (typeof number !== "bigint" && typeof number !== "number" || typeof number === "number" && number !== number) {
  82150. number = 0;
  82151. }
  82152. number = BigInt(number);
  82153. var byteCount = countBytes2(number);
  82154. var bytes = new Uint8Array(new ArrayBuffer(byteCount));
  82155. for (var i2 = 0; i2 < byteCount; i2++) {
  82156. var byteIndex = le ? i2 : Math.abs(i2 + 1 - bytes.length);
  82157. bytes[byteIndex] = Number(number / BYTE_TABLE[i2] & BigInt(255));
  82158. if (number < 0) {
  82159. bytes[byteIndex] = Math.abs(~bytes[byteIndex]);
  82160. bytes[byteIndex] -= i2 === 0 ? 1 : 2;
  82161. }
  82162. }
  82163. return bytes;
  82164. };
  82165. var stringToBytes2 = function stringToBytes3(string, stringIsBytes) {
  82166. if (typeof string !== "string" && string && typeof string.toString === "function") {
  82167. string = string.toString();
  82168. }
  82169. if (typeof string !== "string") {
  82170. return new Uint8Array();
  82171. }
  82172. if (!stringIsBytes) {
  82173. string = unescape(encodeURIComponent(string));
  82174. }
  82175. var view = new Uint8Array(string.length);
  82176. for (var i2 = 0; i2 < string.length; i2++) {
  82177. view[i2] = string.charCodeAt(i2);
  82178. }
  82179. return view;
  82180. };
  82181. var concatTypedArrays2 = function concatTypedArrays3() {
  82182. for (var _len = arguments.length, buffers = new Array(_len), _key = 0; _key < _len; _key++) {
  82183. buffers[_key] = arguments[_key];
  82184. }
  82185. buffers = buffers.filter(function(b) {
  82186. return b && (b.byteLength || b.length) && typeof b !== "string";
  82187. });
  82188. if (buffers.length <= 1) {
  82189. return toUint82(buffers[0]);
  82190. }
  82191. var totalLen = buffers.reduce(function(total, buf, i2) {
  82192. return total + (buf.byteLength || buf.length);
  82193. }, 0);
  82194. var tempBuffer = new Uint8Array(totalLen);
  82195. var offset = 0;
  82196. buffers.forEach(function(buf) {
  82197. buf = toUint82(buf);
  82198. tempBuffer.set(buf, offset);
  82199. offset += buf.byteLength;
  82200. });
  82201. return tempBuffer;
  82202. };
  82203. var bytesMatch2 = function bytesMatch3(a, b, _temp3) {
  82204. var _ref3 = _temp3 === void 0 ? {} : _temp3, _ref3$offset = _ref3.offset, offset = _ref3$offset === void 0 ? 0 : _ref3$offset, _ref3$mask = _ref3.mask, mask = _ref3$mask === void 0 ? [] : _ref3$mask;
  82205. a = toUint82(a);
  82206. b = toUint82(b);
  82207. var fn2 = b.every ? b.every : Array.prototype.every;
  82208. return b.length && a.length - offset >= b.length && fn2.call(b, function(bByte, i2) {
  82209. var aByte = mask[i2] ? mask[i2] & a[offset + i2] : a[offset + i2];
  82210. return bByte === aByte;
  82211. });
  82212. };
  82213. var forEachMediaGroup$1 = function forEachMediaGroup2(master, groups, callback2) {
  82214. groups.forEach(function(mediaType) {
  82215. for (var groupKey in master.mediaGroups[mediaType]) {
  82216. for (var labelKey in master.mediaGroups[mediaType][groupKey]) {
  82217. var mediaProperties = master.mediaGroups[mediaType][groupKey][labelKey];
  82218. callback2(mediaProperties, mediaType, groupKey, labelKey);
  82219. }
  82220. }
  82221. });
  82222. };
  82223. /*! @name mpd-parser @version 0.22.1 @license Apache-2.0 */
  82224. var isObject$1 = function isObject(obj) {
  82225. return !!obj && typeof obj === "object";
  82226. };
  82227. var merge = function merge2() {
  82228. for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {
  82229. objects[_key] = arguments[_key];
  82230. }
  82231. return objects.reduce(function(result, source) {
  82232. if (typeof source !== "object") {
  82233. return result;
  82234. }
  82235. Object.keys(source).forEach(function(key) {
  82236. if (Array.isArray(result[key]) && Array.isArray(source[key])) {
  82237. result[key] = result[key].concat(source[key]);
  82238. } else if (isObject$1(result[key]) && isObject$1(source[key])) {
  82239. result[key] = merge2(result[key], source[key]);
  82240. } else {
  82241. result[key] = source[key];
  82242. }
  82243. });
  82244. return result;
  82245. }, {});
  82246. };
  82247. var values = function values2(o) {
  82248. return Object.keys(o).map(function(k) {
  82249. return o[k];
  82250. });
  82251. };
  82252. var range = function range2(start2, end) {
  82253. var result = [];
  82254. for (var i2 = start2; i2 < end; i2++) {
  82255. result.push(i2);
  82256. }
  82257. return result;
  82258. };
  82259. var flatten = function flatten2(lists) {
  82260. return lists.reduce(function(x, y) {
  82261. return x.concat(y);
  82262. }, []);
  82263. };
  82264. var from = function from2(list) {
  82265. if (!list.length) {
  82266. return [];
  82267. }
  82268. var result = [];
  82269. for (var i2 = 0; i2 < list.length; i2++) {
  82270. result.push(list[i2]);
  82271. }
  82272. return result;
  82273. };
  82274. var findIndexes = function findIndexes2(l, key) {
  82275. return l.reduce(function(a, e, i2) {
  82276. if (e[key]) {
  82277. a.push(i2);
  82278. }
  82279. return a;
  82280. }, []);
  82281. };
  82282. var findIndex = function findIndex2(list, matchingFunction) {
  82283. for (var i2 = 0; i2 < list.length; i2++) {
  82284. if (matchingFunction(list[i2])) {
  82285. return i2;
  82286. }
  82287. }
  82288. return -1;
  82289. };
  82290. var union = function union2(lists, keyFunction) {
  82291. return values(lists.reduce(function(acc, list) {
  82292. list.forEach(function(el) {
  82293. acc[keyFunction(el)] = el;
  82294. });
  82295. return acc;
  82296. }, {}));
  82297. };
  82298. var errors = {
  82299. INVALID_NUMBER_OF_PERIOD: "INVALID_NUMBER_OF_PERIOD",
  82300. DASH_EMPTY_MANIFEST: "DASH_EMPTY_MANIFEST",
  82301. DASH_INVALID_XML: "DASH_INVALID_XML",
  82302. NO_BASE_URL: "NO_BASE_URL",
  82303. MISSING_SEGMENT_INFORMATION: "MISSING_SEGMENT_INFORMATION",
  82304. SEGMENT_TIME_UNSPECIFIED: "SEGMENT_TIME_UNSPECIFIED",
  82305. UNSUPPORTED_UTC_TIMING_SCHEME: "UNSUPPORTED_UTC_TIMING_SCHEME"
  82306. };
  82307. var urlTypeToSegment = function urlTypeToSegment2(_ref) {
  82308. var _ref$baseUrl = _ref.baseUrl, baseUrl = _ref$baseUrl === void 0 ? "" : _ref$baseUrl, _ref$source = _ref.source, source = _ref$source === void 0 ? "" : _ref$source, _ref$range = _ref.range, range3 = _ref$range === void 0 ? "" : _ref$range, _ref$indexRange = _ref.indexRange, indexRange = _ref$indexRange === void 0 ? "" : _ref$indexRange;
  82309. var segment = {
  82310. uri: source,
  82311. resolvedUri: resolveUrl$1(baseUrl || "", source)
  82312. };
  82313. if (range3 || indexRange) {
  82314. var rangeStr = range3 ? range3 : indexRange;
  82315. var ranges = rangeStr.split("-");
  82316. var startRange = window_1.BigInt ? window_1.BigInt(ranges[0]) : parseInt(ranges[0], 10);
  82317. var endRange = window_1.BigInt ? window_1.BigInt(ranges[1]) : parseInt(ranges[1], 10);
  82318. if (startRange < Number.MAX_SAFE_INTEGER && typeof startRange === "bigint") {
  82319. startRange = Number(startRange);
  82320. }
  82321. if (endRange < Number.MAX_SAFE_INTEGER && typeof endRange === "bigint") {
  82322. endRange = Number(endRange);
  82323. }
  82324. var length;
  82325. if (typeof endRange === "bigint" || typeof startRange === "bigint") {
  82326. length = window_1.BigInt(endRange) - window_1.BigInt(startRange) + window_1.BigInt(1);
  82327. } else {
  82328. length = endRange - startRange + 1;
  82329. }
  82330. if (typeof length === "bigint" && length < Number.MAX_SAFE_INTEGER) {
  82331. length = Number(length);
  82332. }
  82333. segment.byterange = {
  82334. length,
  82335. offset: startRange
  82336. };
  82337. }
  82338. return segment;
  82339. };
  82340. var byteRangeToString = function byteRangeToString2(byterange) {
  82341. var endRange;
  82342. if (typeof byterange.offset === "bigint" || typeof byterange.length === "bigint") {
  82343. endRange = window_1.BigInt(byterange.offset) + window_1.BigInt(byterange.length) - window_1.BigInt(1);
  82344. } else {
  82345. endRange = byterange.offset + byterange.length - 1;
  82346. }
  82347. return byterange.offset + "-" + endRange;
  82348. };
  82349. var parseEndNumber = function parseEndNumber2(endNumber) {
  82350. if (endNumber && typeof endNumber !== "number") {
  82351. endNumber = parseInt(endNumber, 10);
  82352. }
  82353. if (isNaN(endNumber)) {
  82354. return null;
  82355. }
  82356. return endNumber;
  82357. };
  82358. var segmentRange = {
  82359. static: function _static(attributes) {
  82360. var duration5 = attributes.duration, _attributes$timescale = attributes.timescale, timescale2 = _attributes$timescale === void 0 ? 1 : _attributes$timescale, sourceDuration = attributes.sourceDuration, periodDuration = attributes.periodDuration;
  82361. var endNumber = parseEndNumber(attributes.endNumber);
  82362. var segmentDuration = duration5 / timescale2;
  82363. if (typeof endNumber === "number") {
  82364. return {
  82365. start: 0,
  82366. end: endNumber
  82367. };
  82368. }
  82369. if (typeof periodDuration === "number") {
  82370. return {
  82371. start: 0,
  82372. end: periodDuration / segmentDuration
  82373. };
  82374. }
  82375. return {
  82376. start: 0,
  82377. end: sourceDuration / segmentDuration
  82378. };
  82379. },
  82380. dynamic: function dynamic(attributes) {
  82381. var NOW = attributes.NOW, clientOffset = attributes.clientOffset, availabilityStartTime2 = attributes.availabilityStartTime, _attributes$timescale2 = attributes.timescale, timescale2 = _attributes$timescale2 === void 0 ? 1 : _attributes$timescale2, duration5 = attributes.duration, _attributes$periodSta = attributes.periodStart, periodStart = _attributes$periodSta === void 0 ? 0 : _attributes$periodSta, _attributes$minimumUp = attributes.minimumUpdatePeriod, minimumUpdatePeriod2 = _attributes$minimumUp === void 0 ? 0 : _attributes$minimumUp, _attributes$timeShift = attributes.timeShiftBufferDepth, timeShiftBufferDepth2 = _attributes$timeShift === void 0 ? Infinity : _attributes$timeShift;
  82382. var endNumber = parseEndNumber(attributes.endNumber);
  82383. var now2 = (NOW + clientOffset) / 1e3;
  82384. var periodStartWC = availabilityStartTime2 + periodStart;
  82385. var periodEndWC = now2 + minimumUpdatePeriod2;
  82386. var periodDuration = periodEndWC - periodStartWC;
  82387. var segmentCount = Math.ceil(periodDuration * timescale2 / duration5);
  82388. var availableStart = Math.floor((now2 - periodStartWC - timeShiftBufferDepth2) * timescale2 / duration5);
  82389. var availableEnd = Math.floor((now2 - periodStartWC) * timescale2 / duration5);
  82390. return {
  82391. start: Math.max(0, availableStart),
  82392. end: typeof endNumber === "number" ? endNumber : Math.min(segmentCount, availableEnd)
  82393. };
  82394. }
  82395. };
  82396. var toSegments = function toSegments2(attributes) {
  82397. return function(number) {
  82398. var duration5 = attributes.duration, _attributes$timescale3 = attributes.timescale, timescale2 = _attributes$timescale3 === void 0 ? 1 : _attributes$timescale3, periodStart = attributes.periodStart, _attributes$startNumb = attributes.startNumber, startNumber2 = _attributes$startNumb === void 0 ? 1 : _attributes$startNumb;
  82399. return {
  82400. number: startNumber2 + number,
  82401. duration: duration5 / timescale2,
  82402. timeline: periodStart,
  82403. time: number * duration5
  82404. };
  82405. };
  82406. };
  82407. var parseByDuration = function parseByDuration2(attributes) {
  82408. var type2 = attributes.type, duration5 = attributes.duration, _attributes$timescale4 = attributes.timescale, timescale2 = _attributes$timescale4 === void 0 ? 1 : _attributes$timescale4, periodDuration = attributes.periodDuration, sourceDuration = attributes.sourceDuration;
  82409. var _segmentRange$type = segmentRange[type2](attributes), start2 = _segmentRange$type.start, end = _segmentRange$type.end;
  82410. var segments = range(start2, end).map(toSegments(attributes));
  82411. if (type2 === "static") {
  82412. var index2 = segments.length - 1;
  82413. var sectionDuration = typeof periodDuration === "number" ? periodDuration : sourceDuration;
  82414. segments[index2].duration = sectionDuration - duration5 / timescale2 * index2;
  82415. }
  82416. return segments;
  82417. };
  82418. var segmentsFromBase = function segmentsFromBase2(attributes) {
  82419. var baseUrl = attributes.baseUrl, _attributes$initializ = attributes.initialization, initialization = _attributes$initializ === void 0 ? {} : _attributes$initializ, sourceDuration = attributes.sourceDuration, _attributes$indexRang = attributes.indexRange, indexRange = _attributes$indexRang === void 0 ? "" : _attributes$indexRang, periodStart = attributes.periodStart, presentationTime = attributes.presentationTime, _attributes$number = attributes.number, number = _attributes$number === void 0 ? 0 : _attributes$number, duration5 = attributes.duration;
  82420. if (!baseUrl) {
  82421. throw new Error(errors.NO_BASE_URL);
  82422. }
  82423. var initSegment = urlTypeToSegment({
  82424. baseUrl,
  82425. source: initialization.sourceURL,
  82426. range: initialization.range
  82427. });
  82428. var segment = urlTypeToSegment({
  82429. baseUrl,
  82430. source: baseUrl,
  82431. indexRange
  82432. });
  82433. segment.map = initSegment;
  82434. if (duration5) {
  82435. var segmentTimeInfo = parseByDuration(attributes);
  82436. if (segmentTimeInfo.length) {
  82437. segment.duration = segmentTimeInfo[0].duration;
  82438. segment.timeline = segmentTimeInfo[0].timeline;
  82439. }
  82440. } else if (sourceDuration) {
  82441. segment.duration = sourceDuration;
  82442. segment.timeline = periodStart;
  82443. }
  82444. segment.presentationTime = presentationTime || periodStart;
  82445. segment.number = number;
  82446. return [segment];
  82447. };
  82448. var addSidxSegmentsToPlaylist$1 = function addSidxSegmentsToPlaylist(playlist, sidx, baseUrl) {
  82449. var initSegment = playlist.sidx.map ? playlist.sidx.map : null;
  82450. var sourceDuration = playlist.sidx.duration;
  82451. var timeline = playlist.timeline || 0;
  82452. var sidxByteRange = playlist.sidx.byterange;
  82453. var sidxEnd = sidxByteRange.offset + sidxByteRange.length;
  82454. var timescale2 = sidx.timescale;
  82455. var mediaReferences = sidx.references.filter(function(r2) {
  82456. return r2.referenceType !== 1;
  82457. });
  82458. var segments = [];
  82459. var type2 = playlist.endList ? "static" : "dynamic";
  82460. var periodStart = playlist.sidx.timeline;
  82461. var presentationTime = periodStart;
  82462. var number = playlist.mediaSequence || 0;
  82463. var startIndex;
  82464. if (typeof sidx.firstOffset === "bigint") {
  82465. startIndex = window_1.BigInt(sidxEnd) + sidx.firstOffset;
  82466. } else {
  82467. startIndex = sidxEnd + sidx.firstOffset;
  82468. }
  82469. for (var i2 = 0; i2 < mediaReferences.length; i2++) {
  82470. var reference = sidx.references[i2];
  82471. var size = reference.referencedSize;
  82472. var duration5 = reference.subsegmentDuration;
  82473. var endIndex = void 0;
  82474. if (typeof startIndex === "bigint") {
  82475. endIndex = startIndex + window_1.BigInt(size) - window_1.BigInt(1);
  82476. } else {
  82477. endIndex = startIndex + size - 1;
  82478. }
  82479. var indexRange = startIndex + "-" + endIndex;
  82480. var attributes = {
  82481. baseUrl,
  82482. timescale: timescale2,
  82483. timeline,
  82484. periodStart,
  82485. presentationTime,
  82486. number,
  82487. duration: duration5,
  82488. sourceDuration,
  82489. indexRange,
  82490. type: type2
  82491. };
  82492. var segment = segmentsFromBase(attributes)[0];
  82493. if (initSegment) {
  82494. segment.map = initSegment;
  82495. }
  82496. segments.push(segment);
  82497. if (typeof startIndex === "bigint") {
  82498. startIndex += window_1.BigInt(size);
  82499. } else {
  82500. startIndex += size;
  82501. }
  82502. presentationTime += duration5 / timescale2;
  82503. number++;
  82504. }
  82505. playlist.segments = segments;
  82506. return playlist;
  82507. };
  82508. var SUPPORTED_MEDIA_TYPES = ["AUDIO", "SUBTITLES"];
  82509. var TIME_FUDGE = 1 / 60;
  82510. var getUniqueTimelineStarts = function getUniqueTimelineStarts2(timelineStarts) {
  82511. return union(timelineStarts, function(_ref) {
  82512. var timeline = _ref.timeline;
  82513. return timeline;
  82514. }).sort(function(a, b) {
  82515. return a.timeline > b.timeline ? 1 : -1;
  82516. });
  82517. };
  82518. var findPlaylistWithName = function findPlaylistWithName2(playlists, name) {
  82519. for (var i2 = 0; i2 < playlists.length; i2++) {
  82520. if (playlists[i2].attributes.NAME === name) {
  82521. return playlists[i2];
  82522. }
  82523. }
  82524. return null;
  82525. };
  82526. var getMediaGroupPlaylists = function getMediaGroupPlaylists2(manifest) {
  82527. var mediaGroupPlaylists = [];
  82528. forEachMediaGroup$1(manifest, SUPPORTED_MEDIA_TYPES, function(properties, type2, group, label) {
  82529. mediaGroupPlaylists = mediaGroupPlaylists.concat(properties.playlists || []);
  82530. });
  82531. return mediaGroupPlaylists;
  82532. };
  82533. var updateMediaSequenceForPlaylist = function updateMediaSequenceForPlaylist2(_ref2) {
  82534. var playlist = _ref2.playlist, mediaSequence = _ref2.mediaSequence;
  82535. playlist.mediaSequence = mediaSequence;
  82536. playlist.segments.forEach(function(segment, index2) {
  82537. segment.number = playlist.mediaSequence + index2;
  82538. });
  82539. };
  82540. var updateSequenceNumbers = function updateSequenceNumbers2(_ref3) {
  82541. var oldPlaylists = _ref3.oldPlaylists, newPlaylists = _ref3.newPlaylists, timelineStarts = _ref3.timelineStarts;
  82542. newPlaylists.forEach(function(playlist) {
  82543. playlist.discontinuitySequence = findIndex(timelineStarts, function(_ref4) {
  82544. var timeline = _ref4.timeline;
  82545. return timeline === playlist.timeline;
  82546. });
  82547. var oldPlaylist = findPlaylistWithName(oldPlaylists, playlist.attributes.NAME);
  82548. if (!oldPlaylist) {
  82549. return;
  82550. }
  82551. if (playlist.sidx) {
  82552. return;
  82553. }
  82554. var firstNewSegment = playlist.segments[0];
  82555. var oldMatchingSegmentIndex = findIndex(oldPlaylist.segments, function(oldSegment) {
  82556. return Math.abs(oldSegment.presentationTime - firstNewSegment.presentationTime) < TIME_FUDGE;
  82557. });
  82558. if (oldMatchingSegmentIndex === -1) {
  82559. updateMediaSequenceForPlaylist({
  82560. playlist,
  82561. mediaSequence: oldPlaylist.mediaSequence + oldPlaylist.segments.length
  82562. });
  82563. playlist.segments[0].discontinuity = true;
  82564. playlist.discontinuityStarts.unshift(0);
  82565. if (!oldPlaylist.segments.length && playlist.timeline > oldPlaylist.timeline || oldPlaylist.segments.length && playlist.timeline > oldPlaylist.segments[oldPlaylist.segments.length - 1].timeline) {
  82566. playlist.discontinuitySequence--;
  82567. }
  82568. return;
  82569. }
  82570. var oldMatchingSegment = oldPlaylist.segments[oldMatchingSegmentIndex];
  82571. if (oldMatchingSegment.discontinuity && !firstNewSegment.discontinuity) {
  82572. firstNewSegment.discontinuity = true;
  82573. playlist.discontinuityStarts.unshift(0);
  82574. playlist.discontinuitySequence--;
  82575. }
  82576. updateMediaSequenceForPlaylist({
  82577. playlist,
  82578. mediaSequence: oldPlaylist.segments[oldMatchingSegmentIndex].number
  82579. });
  82580. });
  82581. };
  82582. var positionManifestOnTimeline = function positionManifestOnTimeline2(_ref5) {
  82583. var oldManifest = _ref5.oldManifest, newManifest = _ref5.newManifest;
  82584. var oldPlaylists = oldManifest.playlists.concat(getMediaGroupPlaylists(oldManifest));
  82585. var newPlaylists = newManifest.playlists.concat(getMediaGroupPlaylists(newManifest));
  82586. newManifest.timelineStarts = getUniqueTimelineStarts([oldManifest.timelineStarts, newManifest.timelineStarts]);
  82587. updateSequenceNumbers({
  82588. oldPlaylists,
  82589. newPlaylists,
  82590. timelineStarts: newManifest.timelineStarts
  82591. });
  82592. return newManifest;
  82593. };
  82594. var generateSidxKey = function generateSidxKey2(sidx) {
  82595. return sidx && sidx.uri + "-" + byteRangeToString(sidx.byterange);
  82596. };
  82597. var mergeDiscontiguousPlaylists = function mergeDiscontiguousPlaylists2(playlists) {
  82598. var mergedPlaylists = values(playlists.reduce(function(acc, playlist) {
  82599. var name = playlist.attributes.id + (playlist.attributes.lang || "");
  82600. if (!acc[name]) {
  82601. acc[name] = playlist;
  82602. acc[name].attributes.timelineStarts = [];
  82603. } else {
  82604. if (playlist.segments) {
  82605. var _acc$name$segments;
  82606. if (playlist.segments[0]) {
  82607. playlist.segments[0].discontinuity = true;
  82608. }
  82609. (_acc$name$segments = acc[name].segments).push.apply(_acc$name$segments, playlist.segments);
  82610. }
  82611. if (playlist.attributes.contentProtection) {
  82612. acc[name].attributes.contentProtection = playlist.attributes.contentProtection;
  82613. }
  82614. }
  82615. acc[name].attributes.timelineStarts.push({
  82616. start: playlist.attributes.periodStart,
  82617. timeline: playlist.attributes.periodStart
  82618. });
  82619. return acc;
  82620. }, {}));
  82621. return mergedPlaylists.map(function(playlist) {
  82622. playlist.discontinuityStarts = findIndexes(playlist.segments || [], "discontinuity");
  82623. return playlist;
  82624. });
  82625. };
  82626. var addSidxSegmentsToPlaylist2 = function addSidxSegmentsToPlaylist3(playlist, sidxMapping) {
  82627. var sidxKey = generateSidxKey(playlist.sidx);
  82628. var sidxMatch = sidxKey && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx;
  82629. if (sidxMatch) {
  82630. addSidxSegmentsToPlaylist$1(playlist, sidxMatch, playlist.sidx.resolvedUri);
  82631. }
  82632. return playlist;
  82633. };
  82634. var addSidxSegmentsToPlaylists = function addSidxSegmentsToPlaylists2(playlists, sidxMapping) {
  82635. if (sidxMapping === void 0) {
  82636. sidxMapping = {};
  82637. }
  82638. if (!Object.keys(sidxMapping).length) {
  82639. return playlists;
  82640. }
  82641. for (var i2 in playlists) {
  82642. playlists[i2] = addSidxSegmentsToPlaylist2(playlists[i2], sidxMapping);
  82643. }
  82644. return playlists;
  82645. };
  82646. var formatAudioPlaylist = function formatAudioPlaylist2(_ref, isAudioOnly3) {
  82647. var _attributes;
  82648. var attributes = _ref.attributes, segments = _ref.segments, sidx = _ref.sidx, mediaSequence = _ref.mediaSequence, discontinuitySequence = _ref.discontinuitySequence, discontinuityStarts = _ref.discontinuityStarts;
  82649. var playlist = {
  82650. attributes: (_attributes = {
  82651. NAME: attributes.id,
  82652. BANDWIDTH: attributes.bandwidth,
  82653. CODECS: attributes.codecs
  82654. }, _attributes["PROGRAM-ID"] = 1, _attributes),
  82655. uri: "",
  82656. endList: attributes.type === "static",
  82657. timeline: attributes.periodStart,
  82658. resolvedUri: "",
  82659. targetDuration: attributes.duration,
  82660. discontinuitySequence,
  82661. discontinuityStarts,
  82662. timelineStarts: attributes.timelineStarts,
  82663. mediaSequence,
  82664. segments
  82665. };
  82666. if (attributes.contentProtection) {
  82667. playlist.contentProtection = attributes.contentProtection;
  82668. }
  82669. if (sidx) {
  82670. playlist.sidx = sidx;
  82671. }
  82672. if (isAudioOnly3) {
  82673. playlist.attributes.AUDIO = "audio";
  82674. playlist.attributes.SUBTITLES = "subs";
  82675. }
  82676. return playlist;
  82677. };
  82678. var formatVttPlaylist = function formatVttPlaylist2(_ref2) {
  82679. var _m3u8Attributes;
  82680. var attributes = _ref2.attributes, segments = _ref2.segments, mediaSequence = _ref2.mediaSequence, discontinuityStarts = _ref2.discontinuityStarts, discontinuitySequence = _ref2.discontinuitySequence;
  82681. if (typeof segments === "undefined") {
  82682. segments = [{
  82683. uri: attributes.baseUrl,
  82684. timeline: attributes.periodStart,
  82685. resolvedUri: attributes.baseUrl || "",
  82686. duration: attributes.sourceDuration,
  82687. number: 0
  82688. }];
  82689. attributes.duration = attributes.sourceDuration;
  82690. }
  82691. var m3u8Attributes = (_m3u8Attributes = {
  82692. NAME: attributes.id,
  82693. BANDWIDTH: attributes.bandwidth
  82694. }, _m3u8Attributes["PROGRAM-ID"] = 1, _m3u8Attributes);
  82695. if (attributes.codecs) {
  82696. m3u8Attributes.CODECS = attributes.codecs;
  82697. }
  82698. return {
  82699. attributes: m3u8Attributes,
  82700. uri: "",
  82701. endList: attributes.type === "static",
  82702. timeline: attributes.periodStart,
  82703. resolvedUri: attributes.baseUrl || "",
  82704. targetDuration: attributes.duration,
  82705. timelineStarts: attributes.timelineStarts,
  82706. discontinuityStarts,
  82707. discontinuitySequence,
  82708. mediaSequence,
  82709. segments
  82710. };
  82711. };
  82712. var organizeAudioPlaylists = function organizeAudioPlaylists2(playlists, sidxMapping, isAudioOnly3) {
  82713. if (sidxMapping === void 0) {
  82714. sidxMapping = {};
  82715. }
  82716. if (isAudioOnly3 === void 0) {
  82717. isAudioOnly3 = false;
  82718. }
  82719. var mainPlaylist;
  82720. var formattedPlaylists = playlists.reduce(function(a, playlist) {
  82721. var role = playlist.attributes.role && playlist.attributes.role.value || "";
  82722. var language = playlist.attributes.lang || "";
  82723. var label = playlist.attributes.label || "main";
  82724. if (language && !playlist.attributes.label) {
  82725. var roleLabel = role ? " (" + role + ")" : "";
  82726. label = "" + playlist.attributes.lang + roleLabel;
  82727. }
  82728. if (!a[label]) {
  82729. a[label] = {
  82730. language,
  82731. autoselect: true,
  82732. default: role === "main",
  82733. playlists: [],
  82734. uri: ""
  82735. };
  82736. }
  82737. var formatted = addSidxSegmentsToPlaylist2(formatAudioPlaylist(playlist, isAudioOnly3), sidxMapping);
  82738. a[label].playlists.push(formatted);
  82739. if (typeof mainPlaylist === "undefined" && role === "main") {
  82740. mainPlaylist = playlist;
  82741. mainPlaylist.default = true;
  82742. }
  82743. return a;
  82744. }, {});
  82745. if (!mainPlaylist) {
  82746. var firstLabel = Object.keys(formattedPlaylists)[0];
  82747. formattedPlaylists[firstLabel].default = true;
  82748. }
  82749. return formattedPlaylists;
  82750. };
  82751. var organizeVttPlaylists = function organizeVttPlaylists2(playlists, sidxMapping) {
  82752. if (sidxMapping === void 0) {
  82753. sidxMapping = {};
  82754. }
  82755. return playlists.reduce(function(a, playlist) {
  82756. var label = playlist.attributes.lang || "text";
  82757. if (!a[label]) {
  82758. a[label] = {
  82759. language: label,
  82760. default: false,
  82761. autoselect: false,
  82762. playlists: [],
  82763. uri: ""
  82764. };
  82765. }
  82766. a[label].playlists.push(addSidxSegmentsToPlaylist2(formatVttPlaylist(playlist), sidxMapping));
  82767. return a;
  82768. }, {});
  82769. };
  82770. var organizeCaptionServices = function organizeCaptionServices2(captionServices) {
  82771. return captionServices.reduce(function(svcObj, svc) {
  82772. if (!svc) {
  82773. return svcObj;
  82774. }
  82775. svc.forEach(function(service) {
  82776. var channel = service.channel, language = service.language;
  82777. svcObj[language] = {
  82778. autoselect: false,
  82779. default: false,
  82780. instreamId: channel,
  82781. language
  82782. };
  82783. if (service.hasOwnProperty("aspectRatio")) {
  82784. svcObj[language].aspectRatio = service.aspectRatio;
  82785. }
  82786. if (service.hasOwnProperty("easyReader")) {
  82787. svcObj[language].easyReader = service.easyReader;
  82788. }
  82789. if (service.hasOwnProperty("3D")) {
  82790. svcObj[language]["3D"] = service["3D"];
  82791. }
  82792. });
  82793. return svcObj;
  82794. }, {});
  82795. };
  82796. var formatVideoPlaylist = function formatVideoPlaylist2(_ref3) {
  82797. var _attributes2;
  82798. var attributes = _ref3.attributes, segments = _ref3.segments, sidx = _ref3.sidx, discontinuityStarts = _ref3.discontinuityStarts;
  82799. var playlist = {
  82800. attributes: (_attributes2 = {
  82801. NAME: attributes.id,
  82802. AUDIO: "audio",
  82803. SUBTITLES: "subs",
  82804. RESOLUTION: {
  82805. width: attributes.width,
  82806. height: attributes.height
  82807. },
  82808. CODECS: attributes.codecs,
  82809. BANDWIDTH: attributes.bandwidth
  82810. }, _attributes2["PROGRAM-ID"] = 1, _attributes2),
  82811. uri: "",
  82812. endList: attributes.type === "static",
  82813. timeline: attributes.periodStart,
  82814. resolvedUri: "",
  82815. targetDuration: attributes.duration,
  82816. discontinuityStarts,
  82817. timelineStarts: attributes.timelineStarts,
  82818. segments
  82819. };
  82820. if (attributes.frameRate) {
  82821. playlist.attributes["FRAME-RATE"] = attributes.frameRate;
  82822. }
  82823. if (attributes.contentProtection) {
  82824. playlist.contentProtection = attributes.contentProtection;
  82825. }
  82826. if (sidx) {
  82827. playlist.sidx = sidx;
  82828. }
  82829. return playlist;
  82830. };
  82831. var videoOnly = function videoOnly2(_ref4) {
  82832. var attributes = _ref4.attributes;
  82833. return attributes.mimeType === "video/mp4" || attributes.mimeType === "video/webm" || attributes.contentType === "video";
  82834. };
  82835. var audioOnly = function audioOnly2(_ref5) {
  82836. var attributes = _ref5.attributes;
  82837. return attributes.mimeType === "audio/mp4" || attributes.mimeType === "audio/webm" || attributes.contentType === "audio";
  82838. };
  82839. var vttOnly = function vttOnly2(_ref6) {
  82840. var attributes = _ref6.attributes;
  82841. return attributes.mimeType === "text/vtt" || attributes.contentType === "text";
  82842. };
  82843. var addMediaSequenceValues = function addMediaSequenceValues2(playlists, timelineStarts) {
  82844. playlists.forEach(function(playlist) {
  82845. playlist.mediaSequence = 0;
  82846. playlist.discontinuitySequence = findIndex(timelineStarts, function(_ref7) {
  82847. var timeline = _ref7.timeline;
  82848. return timeline === playlist.timeline;
  82849. });
  82850. if (!playlist.segments) {
  82851. return;
  82852. }
  82853. playlist.segments.forEach(function(segment, index2) {
  82854. segment.number = index2;
  82855. });
  82856. });
  82857. };
  82858. var flattenMediaGroupPlaylists = function flattenMediaGroupPlaylists2(mediaGroupObject) {
  82859. if (!mediaGroupObject) {
  82860. return [];
  82861. }
  82862. return Object.keys(mediaGroupObject).reduce(function(acc, label) {
  82863. var labelContents = mediaGroupObject[label];
  82864. return acc.concat(labelContents.playlists);
  82865. }, []);
  82866. };
  82867. var toM3u8 = function toM3u82(_ref8) {
  82868. var _mediaGroups;
  82869. var dashPlaylists = _ref8.dashPlaylists, locations = _ref8.locations, _ref8$sidxMapping = _ref8.sidxMapping, sidxMapping = _ref8$sidxMapping === void 0 ? {} : _ref8$sidxMapping, previousManifest = _ref8.previousManifest;
  82870. if (!dashPlaylists.length) {
  82871. return {};
  82872. }
  82873. var _dashPlaylists$0$attr = dashPlaylists[0].attributes, duration5 = _dashPlaylists$0$attr.sourceDuration, type2 = _dashPlaylists$0$attr.type, suggestedPresentationDelay2 = _dashPlaylists$0$attr.suggestedPresentationDelay, minimumUpdatePeriod2 = _dashPlaylists$0$attr.minimumUpdatePeriod;
  82874. var videoPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(videoOnly)).map(formatVideoPlaylist);
  82875. var audioPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(audioOnly));
  82876. var vttPlaylists = mergeDiscontiguousPlaylists(dashPlaylists.filter(vttOnly));
  82877. var captions = dashPlaylists.map(function(playlist) {
  82878. return playlist.attributes.captionServices;
  82879. }).filter(Boolean);
  82880. var manifest = {
  82881. allowCache: true,
  82882. discontinuityStarts: [],
  82883. segments: [],
  82884. endList: true,
  82885. mediaGroups: (_mediaGroups = {
  82886. AUDIO: {},
  82887. VIDEO: {}
  82888. }, _mediaGroups["CLOSED-CAPTIONS"] = {}, _mediaGroups.SUBTITLES = {}, _mediaGroups),
  82889. uri: "",
  82890. duration: duration5,
  82891. playlists: addSidxSegmentsToPlaylists(videoPlaylists, sidxMapping)
  82892. };
  82893. if (minimumUpdatePeriod2 >= 0) {
  82894. manifest.minimumUpdatePeriod = minimumUpdatePeriod2 * 1e3;
  82895. }
  82896. if (locations) {
  82897. manifest.locations = locations;
  82898. }
  82899. if (type2 === "dynamic") {
  82900. manifest.suggestedPresentationDelay = suggestedPresentationDelay2;
  82901. }
  82902. var isAudioOnly3 = manifest.playlists.length === 0;
  82903. var organizedAudioGroup = audioPlaylists.length ? organizeAudioPlaylists(audioPlaylists, sidxMapping, isAudioOnly3) : null;
  82904. var organizedVttGroup = vttPlaylists.length ? organizeVttPlaylists(vttPlaylists, sidxMapping) : null;
  82905. var formattedPlaylists = videoPlaylists.concat(flattenMediaGroupPlaylists(organizedAudioGroup), flattenMediaGroupPlaylists(organizedVttGroup));
  82906. var playlistTimelineStarts = formattedPlaylists.map(function(_ref9) {
  82907. var timelineStarts = _ref9.timelineStarts;
  82908. return timelineStarts;
  82909. });
  82910. manifest.timelineStarts = getUniqueTimelineStarts(playlistTimelineStarts);
  82911. addMediaSequenceValues(formattedPlaylists, manifest.timelineStarts);
  82912. if (organizedAudioGroup) {
  82913. manifest.mediaGroups.AUDIO.audio = organizedAudioGroup;
  82914. }
  82915. if (organizedVttGroup) {
  82916. manifest.mediaGroups.SUBTITLES.subs = organizedVttGroup;
  82917. }
  82918. if (captions.length) {
  82919. manifest.mediaGroups["CLOSED-CAPTIONS"].cc = organizeCaptionServices(captions);
  82920. }
  82921. if (previousManifest) {
  82922. return positionManifestOnTimeline({
  82923. oldManifest: previousManifest,
  82924. newManifest: manifest
  82925. });
  82926. }
  82927. return manifest;
  82928. };
  82929. var getLiveRValue = function getLiveRValue2(attributes, time, duration5) {
  82930. var NOW = attributes.NOW, clientOffset = attributes.clientOffset, availabilityStartTime2 = attributes.availabilityStartTime, _attributes$timescale = attributes.timescale, timescale2 = _attributes$timescale === void 0 ? 1 : _attributes$timescale, _attributes$periodSta = attributes.periodStart, periodStart = _attributes$periodSta === void 0 ? 0 : _attributes$periodSta, _attributes$minimumUp = attributes.minimumUpdatePeriod, minimumUpdatePeriod2 = _attributes$minimumUp === void 0 ? 0 : _attributes$minimumUp;
  82931. var now2 = (NOW + clientOffset) / 1e3;
  82932. var periodStartWC = availabilityStartTime2 + periodStart;
  82933. var periodEndWC = now2 + minimumUpdatePeriod2;
  82934. var periodDuration = periodEndWC - periodStartWC;
  82935. return Math.ceil((periodDuration * timescale2 - time) / duration5);
  82936. };
  82937. var parseByTimeline = function parseByTimeline2(attributes, segmentTimeline) {
  82938. var type2 = attributes.type, _attributes$minimumUp2 = attributes.minimumUpdatePeriod, minimumUpdatePeriod2 = _attributes$minimumUp2 === void 0 ? 0 : _attributes$minimumUp2, _attributes$media = attributes.media, media = _attributes$media === void 0 ? "" : _attributes$media, sourceDuration = attributes.sourceDuration, _attributes$timescale2 = attributes.timescale, timescale2 = _attributes$timescale2 === void 0 ? 1 : _attributes$timescale2, _attributes$startNumb = attributes.startNumber, startNumber2 = _attributes$startNumb === void 0 ? 1 : _attributes$startNumb, timeline = attributes.periodStart;
  82939. var segments = [];
  82940. var time = -1;
  82941. for (var sIndex = 0; sIndex < segmentTimeline.length; sIndex++) {
  82942. var S = segmentTimeline[sIndex];
  82943. var duration5 = S.d;
  82944. var repeat = S.r || 0;
  82945. var segmentTime = S.t || 0;
  82946. if (time < 0) {
  82947. time = segmentTime;
  82948. }
  82949. if (segmentTime && segmentTime > time) {
  82950. time = segmentTime;
  82951. }
  82952. var count = void 0;
  82953. if (repeat < 0) {
  82954. var nextS = sIndex + 1;
  82955. if (nextS === segmentTimeline.length) {
  82956. if (type2 === "dynamic" && minimumUpdatePeriod2 > 0 && media.indexOf("$Number$") > 0) {
  82957. count = getLiveRValue(attributes, time, duration5);
  82958. } else {
  82959. count = (sourceDuration * timescale2 - time) / duration5;
  82960. }
  82961. } else {
  82962. count = (segmentTimeline[nextS].t - time) / duration5;
  82963. }
  82964. } else {
  82965. count = repeat + 1;
  82966. }
  82967. var end = startNumber2 + segments.length + count;
  82968. var number = startNumber2 + segments.length;
  82969. while (number < end) {
  82970. segments.push({
  82971. number,
  82972. duration: duration5 / timescale2,
  82973. time,
  82974. timeline
  82975. });
  82976. time += duration5;
  82977. number++;
  82978. }
  82979. }
  82980. return segments;
  82981. };
  82982. var identifierPattern = /\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g;
  82983. var identifierReplacement = function identifierReplacement2(values3) {
  82984. return function(match, identifier, format, width2) {
  82985. if (match === "$$") {
  82986. return "$";
  82987. }
  82988. if (typeof values3[identifier] === "undefined") {
  82989. return match;
  82990. }
  82991. var value = "" + values3[identifier];
  82992. if (identifier === "RepresentationID") {
  82993. return value;
  82994. }
  82995. if (!format) {
  82996. width2 = 1;
  82997. } else {
  82998. width2 = parseInt(width2, 10);
  82999. }
  83000. if (value.length >= width2) {
  83001. return value;
  83002. }
  83003. return "" + new Array(width2 - value.length + 1).join("0") + value;
  83004. };
  83005. };
  83006. var constructTemplateUrl = function constructTemplateUrl2(url, values3) {
  83007. return url.replace(identifierPattern, identifierReplacement(values3));
  83008. };
  83009. var parseTemplateInfo = function parseTemplateInfo2(attributes, segmentTimeline) {
  83010. if (!attributes.duration && !segmentTimeline) {
  83011. return [{
  83012. number: attributes.startNumber || 1,
  83013. duration: attributes.sourceDuration,
  83014. time: 0,
  83015. timeline: attributes.periodStart
  83016. }];
  83017. }
  83018. if (attributes.duration) {
  83019. return parseByDuration(attributes);
  83020. }
  83021. return parseByTimeline(attributes, segmentTimeline);
  83022. };
  83023. var segmentsFromTemplate = function segmentsFromTemplate2(attributes, segmentTimeline) {
  83024. var templateValues = {
  83025. RepresentationID: attributes.id,
  83026. Bandwidth: attributes.bandwidth || 0
  83027. };
  83028. var _attributes$initializ = attributes.initialization, initialization = _attributes$initializ === void 0 ? {
  83029. sourceURL: "",
  83030. range: ""
  83031. } : _attributes$initializ;
  83032. var mapSegment = urlTypeToSegment({
  83033. baseUrl: attributes.baseUrl,
  83034. source: constructTemplateUrl(initialization.sourceURL, templateValues),
  83035. range: initialization.range
  83036. });
  83037. var segments = parseTemplateInfo(attributes, segmentTimeline);
  83038. return segments.map(function(segment) {
  83039. templateValues.Number = segment.number;
  83040. templateValues.Time = segment.time;
  83041. var uri = constructTemplateUrl(attributes.media || "", templateValues);
  83042. var timescale2 = attributes.timescale || 1;
  83043. var presentationTimeOffset2 = attributes.presentationTimeOffset || 0;
  83044. var presentationTime = attributes.periodStart + (segment.time - presentationTimeOffset2) / timescale2;
  83045. var map = {
  83046. uri,
  83047. timeline: segment.timeline,
  83048. duration: segment.duration,
  83049. resolvedUri: resolveUrl$1(attributes.baseUrl || "", uri),
  83050. map: mapSegment,
  83051. number: segment.number,
  83052. presentationTime
  83053. };
  83054. return map;
  83055. });
  83056. };
  83057. var SegmentURLToSegmentObject = function SegmentURLToSegmentObject2(attributes, segmentUrl) {
  83058. var baseUrl = attributes.baseUrl, _attributes$initializ = attributes.initialization, initialization = _attributes$initializ === void 0 ? {} : _attributes$initializ;
  83059. var initSegment = urlTypeToSegment({
  83060. baseUrl,
  83061. source: initialization.sourceURL,
  83062. range: initialization.range
  83063. });
  83064. var segment = urlTypeToSegment({
  83065. baseUrl,
  83066. source: segmentUrl.media,
  83067. range: segmentUrl.mediaRange
  83068. });
  83069. segment.map = initSegment;
  83070. return segment;
  83071. };
  83072. var segmentsFromList = function segmentsFromList2(attributes, segmentTimeline) {
  83073. var duration5 = attributes.duration, _attributes$segmentUr = attributes.segmentUrls, segmentUrls = _attributes$segmentUr === void 0 ? [] : _attributes$segmentUr, periodStart = attributes.periodStart;
  83074. if (!duration5 && !segmentTimeline || duration5 && segmentTimeline) {
  83075. throw new Error(errors.SEGMENT_TIME_UNSPECIFIED);
  83076. }
  83077. var segmentUrlMap = segmentUrls.map(function(segmentUrlObject) {
  83078. return SegmentURLToSegmentObject(attributes, segmentUrlObject);
  83079. });
  83080. var segmentTimeInfo;
  83081. if (duration5) {
  83082. segmentTimeInfo = parseByDuration(attributes);
  83083. }
  83084. if (segmentTimeline) {
  83085. segmentTimeInfo = parseByTimeline(attributes, segmentTimeline);
  83086. }
  83087. var segments = segmentTimeInfo.map(function(segmentTime, index2) {
  83088. if (segmentUrlMap[index2]) {
  83089. var segment = segmentUrlMap[index2];
  83090. var timescale2 = attributes.timescale || 1;
  83091. var presentationTimeOffset2 = attributes.presentationTimeOffset || 0;
  83092. segment.timeline = segmentTime.timeline;
  83093. segment.duration = segmentTime.duration;
  83094. segment.number = segmentTime.number;
  83095. segment.presentationTime = periodStart + (segmentTime.time - presentationTimeOffset2) / timescale2;
  83096. return segment;
  83097. }
  83098. }).filter(function(segment) {
  83099. return segment;
  83100. });
  83101. return segments;
  83102. };
  83103. var generateSegments = function generateSegments2(_ref) {
  83104. var attributes = _ref.attributes, segmentInfo = _ref.segmentInfo;
  83105. var segmentAttributes;
  83106. var segmentsFn;
  83107. if (segmentInfo.template) {
  83108. segmentsFn = segmentsFromTemplate;
  83109. segmentAttributes = merge(attributes, segmentInfo.template);
  83110. } else if (segmentInfo.base) {
  83111. segmentsFn = segmentsFromBase;
  83112. segmentAttributes = merge(attributes, segmentInfo.base);
  83113. } else if (segmentInfo.list) {
  83114. segmentsFn = segmentsFromList;
  83115. segmentAttributes = merge(attributes, segmentInfo.list);
  83116. }
  83117. var segmentsInfo = {
  83118. attributes
  83119. };
  83120. if (!segmentsFn) {
  83121. return segmentsInfo;
  83122. }
  83123. var segments = segmentsFn(segmentAttributes, segmentInfo.segmentTimeline);
  83124. if (segmentAttributes.duration) {
  83125. var _segmentAttributes = segmentAttributes, duration5 = _segmentAttributes.duration, _segmentAttributes$ti = _segmentAttributes.timescale, timescale2 = _segmentAttributes$ti === void 0 ? 1 : _segmentAttributes$ti;
  83126. segmentAttributes.duration = duration5 / timescale2;
  83127. } else if (segments.length) {
  83128. segmentAttributes.duration = segments.reduce(function(max2, segment) {
  83129. return Math.max(max2, Math.ceil(segment.duration));
  83130. }, 0);
  83131. } else {
  83132. segmentAttributes.duration = 0;
  83133. }
  83134. segmentsInfo.attributes = segmentAttributes;
  83135. segmentsInfo.segments = segments;
  83136. if (segmentInfo.base && segmentAttributes.indexRange) {
  83137. segmentsInfo.sidx = segments[0];
  83138. segmentsInfo.segments = [];
  83139. }
  83140. return segmentsInfo;
  83141. };
  83142. var toPlaylists = function toPlaylists2(representations) {
  83143. return representations.map(generateSegments);
  83144. };
  83145. var findChildren = function findChildren2(element, name) {
  83146. return from(element.childNodes).filter(function(_ref) {
  83147. var tagName = _ref.tagName;
  83148. return tagName === name;
  83149. });
  83150. };
  83151. var getContent = function getContent2(element) {
  83152. return element.textContent.trim();
  83153. };
  83154. var parseDivisionValue = function parseDivisionValue2(value) {
  83155. return parseFloat(value.split("/").reduce(function(prev, current) {
  83156. return prev / current;
  83157. }));
  83158. };
  83159. var parseDuration = function parseDuration2(str) {
  83160. var SECONDS_IN_YEAR = 365 * 24 * 60 * 60;
  83161. var SECONDS_IN_MONTH = 30 * 24 * 60 * 60;
  83162. var SECONDS_IN_DAY = 24 * 60 * 60;
  83163. var SECONDS_IN_HOUR = 60 * 60;
  83164. var SECONDS_IN_MIN = 60;
  83165. var durationRegex = /P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/;
  83166. var match = durationRegex.exec(str);
  83167. if (!match) {
  83168. return 0;
  83169. }
  83170. var _match$slice = match.slice(1), year = _match$slice[0], month = _match$slice[1], day = _match$slice[2], hour = _match$slice[3], minute = _match$slice[4], second = _match$slice[5];
  83171. return parseFloat(year || 0) * SECONDS_IN_YEAR + parseFloat(month || 0) * SECONDS_IN_MONTH + parseFloat(day || 0) * SECONDS_IN_DAY + parseFloat(hour || 0) * SECONDS_IN_HOUR + parseFloat(minute || 0) * SECONDS_IN_MIN + parseFloat(second || 0);
  83172. };
  83173. var parseDate = function parseDate2(str) {
  83174. var dateRegex = /^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;
  83175. if (dateRegex.test(str)) {
  83176. str += "Z";
  83177. }
  83178. return Date.parse(str);
  83179. };
  83180. var parsers = {
  83181. mediaPresentationDuration: function mediaPresentationDuration(value) {
  83182. return parseDuration(value);
  83183. },
  83184. availabilityStartTime: function availabilityStartTime(value) {
  83185. return parseDate(value) / 1e3;
  83186. },
  83187. minimumUpdatePeriod: function minimumUpdatePeriod(value) {
  83188. return parseDuration(value);
  83189. },
  83190. suggestedPresentationDelay: function suggestedPresentationDelay(value) {
  83191. return parseDuration(value);
  83192. },
  83193. type: function type(value) {
  83194. return value;
  83195. },
  83196. timeShiftBufferDepth: function timeShiftBufferDepth(value) {
  83197. return parseDuration(value);
  83198. },
  83199. start: function start(value) {
  83200. return parseDuration(value);
  83201. },
  83202. width: function width(value) {
  83203. return parseInt(value, 10);
  83204. },
  83205. height: function height(value) {
  83206. return parseInt(value, 10);
  83207. },
  83208. bandwidth: function bandwidth(value) {
  83209. return parseInt(value, 10);
  83210. },
  83211. frameRate: function frameRate(value) {
  83212. return parseDivisionValue(value);
  83213. },
  83214. startNumber: function startNumber(value) {
  83215. return parseInt(value, 10);
  83216. },
  83217. timescale: function timescale(value) {
  83218. return parseInt(value, 10);
  83219. },
  83220. presentationTimeOffset: function presentationTimeOffset(value) {
  83221. return parseInt(value, 10);
  83222. },
  83223. duration: function duration(value) {
  83224. var parsedValue = parseInt(value, 10);
  83225. if (isNaN(parsedValue)) {
  83226. return parseDuration(value);
  83227. }
  83228. return parsedValue;
  83229. },
  83230. d: function d(value) {
  83231. return parseInt(value, 10);
  83232. },
  83233. t: function t(value) {
  83234. return parseInt(value, 10);
  83235. },
  83236. r: function r(value) {
  83237. return parseInt(value, 10);
  83238. },
  83239. DEFAULT: function DEFAULT(value) {
  83240. return value;
  83241. }
  83242. };
  83243. var parseAttributes2 = function parseAttributes3(el) {
  83244. if (!(el && el.attributes)) {
  83245. return {};
  83246. }
  83247. return from(el.attributes).reduce(function(a, e) {
  83248. var parseFn = parsers[e.name] || parsers.DEFAULT;
  83249. a[e.name] = parseFn(e.value);
  83250. return a;
  83251. }, {});
  83252. };
  83253. var keySystemsMap = {
  83254. "urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b": "org.w3.clearkey",
  83255. "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed": "com.widevine.alpha",
  83256. "urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95": "com.microsoft.playready",
  83257. "urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb": "com.adobe.primetime"
  83258. };
  83259. var buildBaseUrls = function buildBaseUrls2(referenceUrls, baseUrlElements) {
  83260. if (!baseUrlElements.length) {
  83261. return referenceUrls;
  83262. }
  83263. return flatten(referenceUrls.map(function(reference) {
  83264. return baseUrlElements.map(function(baseUrlElement) {
  83265. return resolveUrl$1(reference, getContent(baseUrlElement));
  83266. });
  83267. }));
  83268. };
  83269. var getSegmentInformation = function getSegmentInformation2(adaptationSet) {
  83270. var segmentTemplate = findChildren(adaptationSet, "SegmentTemplate")[0];
  83271. var segmentList = findChildren(adaptationSet, "SegmentList")[0];
  83272. var segmentUrls = segmentList && findChildren(segmentList, "SegmentURL").map(function(s) {
  83273. return merge({
  83274. tag: "SegmentURL"
  83275. }, parseAttributes2(s));
  83276. });
  83277. var segmentBase = findChildren(adaptationSet, "SegmentBase")[0];
  83278. var segmentTimelineParentNode = segmentList || segmentTemplate;
  83279. var segmentTimeline = segmentTimelineParentNode && findChildren(segmentTimelineParentNode, "SegmentTimeline")[0];
  83280. var segmentInitializationParentNode = segmentList || segmentBase || segmentTemplate;
  83281. var segmentInitialization = segmentInitializationParentNode && findChildren(segmentInitializationParentNode, "Initialization")[0];
  83282. var template = segmentTemplate && parseAttributes2(segmentTemplate);
  83283. if (template && segmentInitialization) {
  83284. template.initialization = segmentInitialization && parseAttributes2(segmentInitialization);
  83285. } else if (template && template.initialization) {
  83286. template.initialization = {
  83287. sourceURL: template.initialization
  83288. };
  83289. }
  83290. var segmentInfo = {
  83291. template,
  83292. segmentTimeline: segmentTimeline && findChildren(segmentTimeline, "S").map(function(s) {
  83293. return parseAttributes2(s);
  83294. }),
  83295. list: segmentList && merge(parseAttributes2(segmentList), {
  83296. segmentUrls,
  83297. initialization: parseAttributes2(segmentInitialization)
  83298. }),
  83299. base: segmentBase && merge(parseAttributes2(segmentBase), {
  83300. initialization: parseAttributes2(segmentInitialization)
  83301. })
  83302. };
  83303. Object.keys(segmentInfo).forEach(function(key) {
  83304. if (!segmentInfo[key]) {
  83305. delete segmentInfo[key];
  83306. }
  83307. });
  83308. return segmentInfo;
  83309. };
  83310. var inheritBaseUrls = function inheritBaseUrls2(adaptationSetAttributes, adaptationSetBaseUrls, adaptationSetSegmentInfo) {
  83311. return function(representation) {
  83312. var repBaseUrlElements = findChildren(representation, "BaseURL");
  83313. var repBaseUrls = buildBaseUrls(adaptationSetBaseUrls, repBaseUrlElements);
  83314. var attributes = merge(adaptationSetAttributes, parseAttributes2(representation));
  83315. var representationSegmentInfo = getSegmentInformation(representation);
  83316. return repBaseUrls.map(function(baseUrl) {
  83317. return {
  83318. segmentInfo: merge(adaptationSetSegmentInfo, representationSegmentInfo),
  83319. attributes: merge(attributes, {
  83320. baseUrl
  83321. })
  83322. };
  83323. });
  83324. };
  83325. };
  83326. var generateKeySystemInformation = function generateKeySystemInformation2(contentProtectionNodes) {
  83327. return contentProtectionNodes.reduce(function(acc, node) {
  83328. var attributes = parseAttributes2(node);
  83329. if (attributes.schemeIdUri) {
  83330. attributes.schemeIdUri = attributes.schemeIdUri.toLowerCase();
  83331. }
  83332. var keySystem = keySystemsMap[attributes.schemeIdUri];
  83333. if (keySystem) {
  83334. acc[keySystem] = {
  83335. attributes
  83336. };
  83337. var psshNode = findChildren(node, "cenc:pssh")[0];
  83338. if (psshNode) {
  83339. var pssh = getContent(psshNode);
  83340. acc[keySystem].pssh = pssh && decodeB64ToUint8Array(pssh);
  83341. }
  83342. }
  83343. return acc;
  83344. }, {});
  83345. };
  83346. var parseCaptionServiceMetadata = function parseCaptionServiceMetadata2(service) {
  83347. if (service.schemeIdUri === "urn:scte:dash:cc:cea-608:2015") {
  83348. var values3 = typeof service.value !== "string" ? [] : service.value.split(";");
  83349. return values3.map(function(value) {
  83350. var channel;
  83351. var language;
  83352. language = value;
  83353. if (/^CC\d=/.test(value)) {
  83354. var _value$split = value.split("=");
  83355. channel = _value$split[0];
  83356. language = _value$split[1];
  83357. } else if (/^CC\d$/.test(value)) {
  83358. channel = value;
  83359. }
  83360. return {
  83361. channel,
  83362. language
  83363. };
  83364. });
  83365. } else if (service.schemeIdUri === "urn:scte:dash:cc:cea-708:2015") {
  83366. var _values = typeof service.value !== "string" ? [] : service.value.split(";");
  83367. return _values.map(function(value) {
  83368. var flags = {
  83369. "channel": void 0,
  83370. "language": void 0,
  83371. "aspectRatio": 1,
  83372. "easyReader": 0,
  83373. "3D": 0
  83374. };
  83375. if (/=/.test(value)) {
  83376. var _value$split2 = value.split("="), channel = _value$split2[0], _value$split2$ = _value$split2[1], opts = _value$split2$ === void 0 ? "" : _value$split2$;
  83377. flags.channel = channel;
  83378. flags.language = value;
  83379. opts.split(",").forEach(function(opt) {
  83380. var _opt$split = opt.split(":"), name = _opt$split[0], val = _opt$split[1];
  83381. if (name === "lang") {
  83382. flags.language = val;
  83383. } else if (name === "er") {
  83384. flags.easyReader = Number(val);
  83385. } else if (name === "war") {
  83386. flags.aspectRatio = Number(val);
  83387. } else if (name === "3D") {
  83388. flags["3D"] = Number(val);
  83389. }
  83390. });
  83391. } else {
  83392. flags.language = value;
  83393. }
  83394. if (flags.channel) {
  83395. flags.channel = "SERVICE" + flags.channel;
  83396. }
  83397. return flags;
  83398. });
  83399. }
  83400. };
  83401. var toRepresentations = function toRepresentations2(periodAttributes, periodBaseUrls, periodSegmentInfo) {
  83402. return function(adaptationSet) {
  83403. var adaptationSetAttributes = parseAttributes2(adaptationSet);
  83404. var adaptationSetBaseUrls = buildBaseUrls(periodBaseUrls, findChildren(adaptationSet, "BaseURL"));
  83405. var role = findChildren(adaptationSet, "Role")[0];
  83406. var roleAttributes = {
  83407. role: parseAttributes2(role)
  83408. };
  83409. var attrs = merge(periodAttributes, adaptationSetAttributes, roleAttributes);
  83410. var accessibility = findChildren(adaptationSet, "Accessibility")[0];
  83411. var captionServices = parseCaptionServiceMetadata(parseAttributes2(accessibility));
  83412. if (captionServices) {
  83413. attrs = merge(attrs, {
  83414. captionServices
  83415. });
  83416. }
  83417. var label = findChildren(adaptationSet, "Label")[0];
  83418. if (label && label.childNodes.length) {
  83419. var labelVal = label.childNodes[0].nodeValue.trim();
  83420. attrs = merge(attrs, {
  83421. label: labelVal
  83422. });
  83423. }
  83424. var contentProtection = generateKeySystemInformation(findChildren(adaptationSet, "ContentProtection"));
  83425. if (Object.keys(contentProtection).length) {
  83426. attrs = merge(attrs, {
  83427. contentProtection
  83428. });
  83429. }
  83430. var segmentInfo = getSegmentInformation(adaptationSet);
  83431. var representations = findChildren(adaptationSet, "Representation");
  83432. var adaptationSetSegmentInfo = merge(periodSegmentInfo, segmentInfo);
  83433. return flatten(representations.map(inheritBaseUrls(attrs, adaptationSetBaseUrls, adaptationSetSegmentInfo)));
  83434. };
  83435. };
  83436. var toAdaptationSets = function toAdaptationSets2(mpdAttributes, mpdBaseUrls) {
  83437. return function(period, index2) {
  83438. var periodBaseUrls = buildBaseUrls(mpdBaseUrls, findChildren(period.node, "BaseURL"));
  83439. var periodAttributes = merge(mpdAttributes, {
  83440. periodStart: period.attributes.start
  83441. });
  83442. if (typeof period.attributes.duration === "number") {
  83443. periodAttributes.periodDuration = period.attributes.duration;
  83444. }
  83445. var adaptationSets = findChildren(period.node, "AdaptationSet");
  83446. var periodSegmentInfo = getSegmentInformation(period.node);
  83447. return flatten(adaptationSets.map(toRepresentations(periodAttributes, periodBaseUrls, periodSegmentInfo)));
  83448. };
  83449. };
  83450. var getPeriodStart = function getPeriodStart2(_ref) {
  83451. var attributes = _ref.attributes, priorPeriodAttributes = _ref.priorPeriodAttributes, mpdType = _ref.mpdType;
  83452. if (typeof attributes.start === "number") {
  83453. return attributes.start;
  83454. }
  83455. if (priorPeriodAttributes && typeof priorPeriodAttributes.start === "number" && typeof priorPeriodAttributes.duration === "number") {
  83456. return priorPeriodAttributes.start + priorPeriodAttributes.duration;
  83457. }
  83458. if (!priorPeriodAttributes && mpdType === "static") {
  83459. return 0;
  83460. }
  83461. return null;
  83462. };
  83463. var inheritAttributes = function inheritAttributes2(mpd, options2) {
  83464. if (options2 === void 0) {
  83465. options2 = {};
  83466. }
  83467. var _options = options2, _options$manifestUri = _options.manifestUri, manifestUri = _options$manifestUri === void 0 ? "" : _options$manifestUri, _options$NOW = _options.NOW, NOW = _options$NOW === void 0 ? Date.now() : _options$NOW, _options$clientOffset = _options.clientOffset, clientOffset = _options$clientOffset === void 0 ? 0 : _options$clientOffset;
  83468. var periodNodes = findChildren(mpd, "Period");
  83469. if (!periodNodes.length) {
  83470. throw new Error(errors.INVALID_NUMBER_OF_PERIOD);
  83471. }
  83472. var locations = findChildren(mpd, "Location");
  83473. var mpdAttributes = parseAttributes2(mpd);
  83474. var mpdBaseUrls = buildBaseUrls([manifestUri], findChildren(mpd, "BaseURL"));
  83475. mpdAttributes.type = mpdAttributes.type || "static";
  83476. mpdAttributes.sourceDuration = mpdAttributes.mediaPresentationDuration || 0;
  83477. mpdAttributes.NOW = NOW;
  83478. mpdAttributes.clientOffset = clientOffset;
  83479. if (locations.length) {
  83480. mpdAttributes.locations = locations.map(getContent);
  83481. }
  83482. var periods = [];
  83483. periodNodes.forEach(function(node, index2) {
  83484. var attributes = parseAttributes2(node);
  83485. var priorPeriod = periods[index2 - 1];
  83486. attributes.start = getPeriodStart({
  83487. attributes,
  83488. priorPeriodAttributes: priorPeriod ? priorPeriod.attributes : null,
  83489. mpdType: mpdAttributes.type
  83490. });
  83491. periods.push({
  83492. node,
  83493. attributes
  83494. });
  83495. });
  83496. return {
  83497. locations: mpdAttributes.locations,
  83498. representationInfo: flatten(periods.map(toAdaptationSets(mpdAttributes, mpdBaseUrls)))
  83499. };
  83500. };
  83501. var stringToMpdXml = function stringToMpdXml2(manifestString) {
  83502. if (manifestString === "") {
  83503. throw new Error(errors.DASH_EMPTY_MANIFEST);
  83504. }
  83505. var parser2 = new DOMParser();
  83506. var xml;
  83507. var mpd;
  83508. try {
  83509. xml = parser2.parseFromString(manifestString, "application/xml");
  83510. mpd = xml && xml.documentElement.tagName === "MPD" ? xml.documentElement : null;
  83511. } catch (e) {
  83512. }
  83513. if (!mpd || mpd && mpd.getElementsByTagName("parsererror").length > 0) {
  83514. throw new Error(errors.DASH_INVALID_XML);
  83515. }
  83516. return mpd;
  83517. };
  83518. var parseUTCTimingScheme = function parseUTCTimingScheme2(mpd) {
  83519. var UTCTimingNode = findChildren(mpd, "UTCTiming")[0];
  83520. if (!UTCTimingNode) {
  83521. return null;
  83522. }
  83523. var attributes = parseAttributes2(UTCTimingNode);
  83524. switch (attributes.schemeIdUri) {
  83525. case "urn:mpeg:dash:utc:http-head:2014":
  83526. case "urn:mpeg:dash:utc:http-head:2012":
  83527. attributes.method = "HEAD";
  83528. break;
  83529. case "urn:mpeg:dash:utc:http-xsdate:2014":
  83530. case "urn:mpeg:dash:utc:http-iso:2014":
  83531. case "urn:mpeg:dash:utc:http-xsdate:2012":
  83532. case "urn:mpeg:dash:utc:http-iso:2012":
  83533. attributes.method = "GET";
  83534. break;
  83535. case "urn:mpeg:dash:utc:direct:2014":
  83536. case "urn:mpeg:dash:utc:direct:2012":
  83537. attributes.method = "DIRECT";
  83538. attributes.value = Date.parse(attributes.value);
  83539. break;
  83540. case "urn:mpeg:dash:utc:http-ntp:2014":
  83541. case "urn:mpeg:dash:utc:ntp:2014":
  83542. case "urn:mpeg:dash:utc:sntp:2014":
  83543. default:
  83544. throw new Error(errors.UNSUPPORTED_UTC_TIMING_SCHEME);
  83545. }
  83546. return attributes;
  83547. };
  83548. var parse = function parse2(manifestString, options2) {
  83549. if (options2 === void 0) {
  83550. options2 = {};
  83551. }
  83552. var parsedManifestInfo = inheritAttributes(stringToMpdXml(manifestString), options2);
  83553. var playlists = toPlaylists(parsedManifestInfo.representationInfo);
  83554. return toM3u8({
  83555. dashPlaylists: playlists,
  83556. locations: parsedManifestInfo.locations,
  83557. sidxMapping: options2.sidxMapping,
  83558. previousManifest: options2.previousManifest
  83559. });
  83560. };
  83561. var parseUTCTiming = function parseUTCTiming2(manifestString) {
  83562. return parseUTCTimingScheme(stringToMpdXml(manifestString));
  83563. };
  83564. var MAX_UINT32 = Math.pow(2, 32);
  83565. var getUint64$1 = function(uint8) {
  83566. var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);
  83567. var value;
  83568. if (dv.getBigUint64) {
  83569. value = dv.getBigUint64(0);
  83570. if (value < Number.MAX_SAFE_INTEGER) {
  83571. return Number(value);
  83572. }
  83573. return value;
  83574. }
  83575. return dv.getUint32(0) * MAX_UINT32 + dv.getUint32(4);
  83576. };
  83577. var numbers = {
  83578. getUint64: getUint64$1,
  83579. MAX_UINT32
  83580. };
  83581. var getUint64 = numbers.getUint64;
  83582. var parseSidx = function(data) {
  83583. var view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = {
  83584. version: data[0],
  83585. flags: new Uint8Array(data.subarray(1, 4)),
  83586. references: [],
  83587. referenceId: view.getUint32(4),
  83588. timescale: view.getUint32(8)
  83589. }, i2 = 12;
  83590. if (result.version === 0) {
  83591. result.earliestPresentationTime = view.getUint32(i2);
  83592. result.firstOffset = view.getUint32(i2 + 4);
  83593. i2 += 8;
  83594. } else {
  83595. result.earliestPresentationTime = getUint64(data.subarray(i2));
  83596. result.firstOffset = getUint64(data.subarray(i2 + 8));
  83597. i2 += 16;
  83598. }
  83599. i2 += 2;
  83600. var referenceCount = view.getUint16(i2);
  83601. i2 += 2;
  83602. for (; referenceCount > 0; i2 += 12, referenceCount--) {
  83603. result.references.push({
  83604. referenceType: (data[i2] & 128) >>> 7,
  83605. referencedSize: view.getUint32(i2) & 2147483647,
  83606. subsegmentDuration: view.getUint32(i2 + 4),
  83607. startsWithSap: !!(data[i2 + 8] & 128),
  83608. sapType: (data[i2 + 8] & 112) >>> 4,
  83609. sapDeltaTime: view.getUint32(i2 + 8) & 268435455
  83610. });
  83611. }
  83612. return result;
  83613. };
  83614. var parseSidx_1 = parseSidx;
  83615. var ID3 = toUint82([73, 68, 51]);
  83616. var getId3Size2 = function getId3Size3(bytes, offset) {
  83617. if (offset === void 0) {
  83618. offset = 0;
  83619. }
  83620. bytes = toUint82(bytes);
  83621. var flags = bytes[offset + 5];
  83622. var returnSize = bytes[offset + 6] << 21 | bytes[offset + 7] << 14 | bytes[offset + 8] << 7 | bytes[offset + 9];
  83623. var footerPresent = (flags & 16) >> 4;
  83624. if (footerPresent) {
  83625. return returnSize + 20;
  83626. }
  83627. return returnSize + 10;
  83628. };
  83629. var getId3Offset2 = function getId3Offset3(bytes, offset) {
  83630. if (offset === void 0) {
  83631. offset = 0;
  83632. }
  83633. bytes = toUint82(bytes);
  83634. if (bytes.length - offset < 10 || !bytesMatch2(bytes, ID3, {
  83635. offset
  83636. })) {
  83637. return offset;
  83638. }
  83639. offset += getId3Size2(bytes, offset);
  83640. return getId3Offset3(bytes, offset);
  83641. };
  83642. var normalizePath$1 = function normalizePath3(path) {
  83643. if (typeof path === "string") {
  83644. return stringToBytes2(path);
  83645. }
  83646. if (typeof path === "number") {
  83647. return path;
  83648. }
  83649. return path;
  83650. };
  83651. var normalizePaths$1 = function normalizePaths3(paths) {
  83652. if (!Array.isArray(paths)) {
  83653. return [normalizePath$1(paths)];
  83654. }
  83655. return paths.map(function(p) {
  83656. return normalizePath$1(p);
  83657. });
  83658. };
  83659. var findBox2 = function findBox3(bytes, paths, complete) {
  83660. if (complete === void 0) {
  83661. complete = false;
  83662. }
  83663. paths = normalizePaths$1(paths);
  83664. bytes = toUint82(bytes);
  83665. var results = [];
  83666. if (!paths.length) {
  83667. return results;
  83668. }
  83669. var i2 = 0;
  83670. while (i2 < bytes.length) {
  83671. var size = (bytes[i2] << 24 | bytes[i2 + 1] << 16 | bytes[i2 + 2] << 8 | bytes[i2 + 3]) >>> 0;
  83672. var type2 = bytes.subarray(i2 + 4, i2 + 8);
  83673. if (size === 0) {
  83674. break;
  83675. }
  83676. var end = i2 + size;
  83677. if (end > bytes.length) {
  83678. if (complete) {
  83679. break;
  83680. }
  83681. end = bytes.length;
  83682. }
  83683. var data = bytes.subarray(i2 + 8, end);
  83684. if (bytesMatch2(type2, paths[0])) {
  83685. if (paths.length === 1) {
  83686. results.push(data);
  83687. } else {
  83688. results.push.apply(results, findBox3(data, paths.slice(1), complete));
  83689. }
  83690. }
  83691. i2 = end;
  83692. }
  83693. return results;
  83694. };
  83695. var EBML_TAGS = {
  83696. EBML: toUint82([26, 69, 223, 163]),
  83697. DocType: toUint82([66, 130]),
  83698. Segment: toUint82([24, 83, 128, 103]),
  83699. SegmentInfo: toUint82([21, 73, 169, 102]),
  83700. Tracks: toUint82([22, 84, 174, 107]),
  83701. Track: toUint82([174]),
  83702. TrackNumber: toUint82([215]),
  83703. DefaultDuration: toUint82([35, 227, 131]),
  83704. TrackEntry: toUint82([174]),
  83705. TrackType: toUint82([131]),
  83706. FlagDefault: toUint82([136]),
  83707. CodecID: toUint82([134]),
  83708. CodecPrivate: toUint82([99, 162]),
  83709. VideoTrack: toUint82([224]),
  83710. AudioTrack: toUint82([225]),
  83711. Cluster: toUint82([31, 67, 182, 117]),
  83712. Timestamp: toUint82([231]),
  83713. TimestampScale: toUint82([42, 215, 177]),
  83714. BlockGroup: toUint82([160]),
  83715. BlockDuration: toUint82([155]),
  83716. Block: toUint82([161]),
  83717. SimpleBlock: toUint82([163])
  83718. };
  83719. var LENGTH_TABLE = [128, 64, 32, 16, 8, 4, 2, 1];
  83720. var getLength2 = function getLength3(byte) {
  83721. var len = 1;
  83722. for (var i2 = 0; i2 < LENGTH_TABLE.length; i2++) {
  83723. if (byte & LENGTH_TABLE[i2]) {
  83724. break;
  83725. }
  83726. len++;
  83727. }
  83728. return len;
  83729. };
  83730. var getvint2 = function getvint3(bytes, offset, removeLength, signed) {
  83731. if (removeLength === void 0) {
  83732. removeLength = true;
  83733. }
  83734. if (signed === void 0) {
  83735. signed = false;
  83736. }
  83737. var length = getLength2(bytes[offset]);
  83738. var valueBytes = bytes.subarray(offset, offset + length);
  83739. if (removeLength) {
  83740. valueBytes = Array.prototype.slice.call(bytes, offset, offset + length);
  83741. valueBytes[0] ^= LENGTH_TABLE[length - 1];
  83742. }
  83743. return {
  83744. length,
  83745. value: bytesToNumber2(valueBytes, {
  83746. signed
  83747. }),
  83748. bytes: valueBytes
  83749. };
  83750. };
  83751. var normalizePath4 = function normalizePath5(path) {
  83752. if (typeof path === "string") {
  83753. return path.match(/.{1,2}/g).map(function(p) {
  83754. return normalizePath5(p);
  83755. });
  83756. }
  83757. if (typeof path === "number") {
  83758. return numberToBytes2(path);
  83759. }
  83760. return path;
  83761. };
  83762. var normalizePaths4 = function normalizePaths5(paths) {
  83763. if (!Array.isArray(paths)) {
  83764. return [normalizePath4(paths)];
  83765. }
  83766. return paths.map(function(p) {
  83767. return normalizePath4(p);
  83768. });
  83769. };
  83770. var getInfinityDataSize2 = function getInfinityDataSize3(id, bytes, offset) {
  83771. if (offset >= bytes.length) {
  83772. return bytes.length;
  83773. }
  83774. var innerid = getvint2(bytes, offset, false);
  83775. if (bytesMatch2(id.bytes, innerid.bytes)) {
  83776. return offset;
  83777. }
  83778. var dataHeader = getvint2(bytes, offset + innerid.length);
  83779. return getInfinityDataSize3(id, bytes, offset + dataHeader.length + dataHeader.value + innerid.length);
  83780. };
  83781. var findEbml2 = function findEbml3(bytes, paths) {
  83782. paths = normalizePaths4(paths);
  83783. bytes = toUint82(bytes);
  83784. var results = [];
  83785. if (!paths.length) {
  83786. return results;
  83787. }
  83788. var i2 = 0;
  83789. while (i2 < bytes.length) {
  83790. var id = getvint2(bytes, i2, false);
  83791. var dataHeader = getvint2(bytes, i2 + id.length);
  83792. var dataStart = i2 + id.length + dataHeader.length;
  83793. if (dataHeader.value === 127) {
  83794. dataHeader.value = getInfinityDataSize2(id, bytes, dataStart);
  83795. if (dataHeader.value !== bytes.length) {
  83796. dataHeader.value -= dataStart;
  83797. }
  83798. }
  83799. var dataEnd = dataStart + dataHeader.value > bytes.length ? bytes.length : dataStart + dataHeader.value;
  83800. var data = bytes.subarray(dataStart, dataEnd);
  83801. if (bytesMatch2(paths[0], id.bytes)) {
  83802. if (paths.length === 1) {
  83803. results.push(data);
  83804. } else {
  83805. results = results.concat(findEbml3(data, paths.slice(1)));
  83806. }
  83807. }
  83808. var totalLength = id.length + dataHeader.length + data.length;
  83809. i2 += totalLength;
  83810. }
  83811. return results;
  83812. };
  83813. var NAL_TYPE_ONE = toUint82([0, 0, 0, 1]);
  83814. var NAL_TYPE_TWO = toUint82([0, 0, 1]);
  83815. var EMULATION_PREVENTION = toUint82([0, 0, 3]);
  83816. var discardEmulationPreventionBytes2 = function discardEmulationPreventionBytes3(bytes) {
  83817. var positions = [];
  83818. var i2 = 1;
  83819. while (i2 < bytes.length - 2) {
  83820. if (bytesMatch2(bytes.subarray(i2, i2 + 3), EMULATION_PREVENTION)) {
  83821. positions.push(i2 + 2);
  83822. i2++;
  83823. }
  83824. i2++;
  83825. }
  83826. if (positions.length === 0) {
  83827. return bytes;
  83828. }
  83829. var newLength = bytes.length - positions.length;
  83830. var newData = new Uint8Array(newLength);
  83831. var sourceIndex = 0;
  83832. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  83833. if (sourceIndex === positions[0]) {
  83834. sourceIndex++;
  83835. positions.shift();
  83836. }
  83837. newData[i2] = bytes[sourceIndex];
  83838. }
  83839. return newData;
  83840. };
  83841. var findNal2 = function findNal3(bytes, dataType, types, nalLimit) {
  83842. if (nalLimit === void 0) {
  83843. nalLimit = Infinity;
  83844. }
  83845. bytes = toUint82(bytes);
  83846. types = [].concat(types);
  83847. var i2 = 0;
  83848. var nalStart;
  83849. var nalsFound = 0;
  83850. while (i2 < bytes.length && (nalsFound < nalLimit || nalStart)) {
  83851. var nalOffset = void 0;
  83852. if (bytesMatch2(bytes.subarray(i2), NAL_TYPE_ONE)) {
  83853. nalOffset = 4;
  83854. } else if (bytesMatch2(bytes.subarray(i2), NAL_TYPE_TWO)) {
  83855. nalOffset = 3;
  83856. }
  83857. if (!nalOffset) {
  83858. i2++;
  83859. continue;
  83860. }
  83861. nalsFound++;
  83862. if (nalStart) {
  83863. return discardEmulationPreventionBytes2(bytes.subarray(nalStart, i2));
  83864. }
  83865. var nalType = void 0;
  83866. if (dataType === "h264") {
  83867. nalType = bytes[i2 + nalOffset] & 31;
  83868. } else if (dataType === "h265") {
  83869. nalType = bytes[i2 + nalOffset] >> 1 & 63;
  83870. }
  83871. if (types.indexOf(nalType) !== -1) {
  83872. nalStart = i2 + nalOffset;
  83873. }
  83874. i2 += nalOffset + (dataType === "h264" ? 1 : 2);
  83875. }
  83876. return bytes.subarray(0, 0);
  83877. };
  83878. var findH264Nal2 = function findH264Nal3(bytes, type2, nalLimit) {
  83879. return findNal2(bytes, "h264", type2, nalLimit);
  83880. };
  83881. var findH265Nal2 = function findH265Nal3(bytes, type2, nalLimit) {
  83882. return findNal2(bytes, "h265", type2, nalLimit);
  83883. };
  83884. var CONSTANTS = {
  83885. "webm": toUint82([119, 101, 98, 109]),
  83886. "matroska": toUint82([109, 97, 116, 114, 111, 115, 107, 97]),
  83887. "flac": toUint82([102, 76, 97, 67]),
  83888. "ogg": toUint82([79, 103, 103, 83]),
  83889. "ac3": toUint82([11, 119]),
  83890. "riff": toUint82([82, 73, 70, 70]),
  83891. "avi": toUint82([65, 86, 73]),
  83892. "wav": toUint82([87, 65, 86, 69]),
  83893. "3gp": toUint82([102, 116, 121, 112, 51, 103]),
  83894. "mp4": toUint82([102, 116, 121, 112]),
  83895. "fmp4": toUint82([115, 116, 121, 112]),
  83896. "mov": toUint82([102, 116, 121, 112, 113, 116]),
  83897. "moov": toUint82([109, 111, 111, 118]),
  83898. "moof": toUint82([109, 111, 111, 102])
  83899. };
  83900. var _isLikely = {
  83901. aac: function aac2(bytes) {
  83902. var offset = getId3Offset2(bytes);
  83903. return bytesMatch2(bytes, [255, 16], {
  83904. offset,
  83905. mask: [255, 22]
  83906. });
  83907. },
  83908. mp3: function mp32(bytes) {
  83909. var offset = getId3Offset2(bytes);
  83910. return bytesMatch2(bytes, [255, 2], {
  83911. offset,
  83912. mask: [255, 6]
  83913. });
  83914. },
  83915. webm: function webm2(bytes) {
  83916. var docType = findEbml2(bytes, [EBML_TAGS.EBML, EBML_TAGS.DocType])[0];
  83917. return bytesMatch2(docType, CONSTANTS.webm);
  83918. },
  83919. mkv: function mkv2(bytes) {
  83920. var docType = findEbml2(bytes, [EBML_TAGS.EBML, EBML_TAGS.DocType])[0];
  83921. return bytesMatch2(docType, CONSTANTS.matroska);
  83922. },
  83923. mp4: function mp42(bytes) {
  83924. if (_isLikely["3gp"](bytes) || _isLikely.mov(bytes)) {
  83925. return false;
  83926. }
  83927. if (bytesMatch2(bytes, CONSTANTS.mp4, {
  83928. offset: 4
  83929. }) || bytesMatch2(bytes, CONSTANTS.fmp4, {
  83930. offset: 4
  83931. })) {
  83932. return true;
  83933. }
  83934. if (bytesMatch2(bytes, CONSTANTS.moof, {
  83935. offset: 4
  83936. }) || bytesMatch2(bytes, CONSTANTS.moov, {
  83937. offset: 4
  83938. })) {
  83939. return true;
  83940. }
  83941. },
  83942. mov: function mov2(bytes) {
  83943. return bytesMatch2(bytes, CONSTANTS.mov, {
  83944. offset: 4
  83945. });
  83946. },
  83947. "3gp": function gp2(bytes) {
  83948. return bytesMatch2(bytes, CONSTANTS["3gp"], {
  83949. offset: 4
  83950. });
  83951. },
  83952. ac3: function ac32(bytes) {
  83953. var offset = getId3Offset2(bytes);
  83954. return bytesMatch2(bytes, CONSTANTS.ac3, {
  83955. offset
  83956. });
  83957. },
  83958. ts: function ts2(bytes) {
  83959. if (bytes.length < 189 && bytes.length >= 1) {
  83960. return bytes[0] === 71;
  83961. }
  83962. var i2 = 0;
  83963. while (i2 + 188 < bytes.length && i2 < 188) {
  83964. if (bytes[i2] === 71 && bytes[i2 + 188] === 71) {
  83965. return true;
  83966. }
  83967. i2 += 1;
  83968. }
  83969. return false;
  83970. },
  83971. flac: function flac2(bytes) {
  83972. var offset = getId3Offset2(bytes);
  83973. return bytesMatch2(bytes, CONSTANTS.flac, {
  83974. offset
  83975. });
  83976. },
  83977. ogg: function ogg2(bytes) {
  83978. return bytesMatch2(bytes, CONSTANTS.ogg);
  83979. },
  83980. avi: function avi2(bytes) {
  83981. return bytesMatch2(bytes, CONSTANTS.riff) && bytesMatch2(bytes, CONSTANTS.avi, {
  83982. offset: 8
  83983. });
  83984. },
  83985. wav: function wav2(bytes) {
  83986. return bytesMatch2(bytes, CONSTANTS.riff) && bytesMatch2(bytes, CONSTANTS.wav, {
  83987. offset: 8
  83988. });
  83989. },
  83990. "h264": function h2642(bytes) {
  83991. return findH264Nal2(bytes, 7, 3).length;
  83992. },
  83993. "h265": function h2652(bytes) {
  83994. return findH265Nal2(bytes, [32, 33], 3).length;
  83995. }
  83996. };
  83997. var isLikelyTypes = Object.keys(_isLikely).filter(function(t2) {
  83998. return t2 !== "ts" && t2 !== "h264" && t2 !== "h265";
  83999. }).concat(["ts", "h264", "h265"]);
  84000. isLikelyTypes.forEach(function(type2) {
  84001. var isLikelyFn = _isLikely[type2];
  84002. _isLikely[type2] = function(bytes) {
  84003. return isLikelyFn(toUint82(bytes));
  84004. };
  84005. });
  84006. var isLikely = _isLikely;
  84007. var detectContainerForBytes2 = function detectContainerForBytes3(bytes) {
  84008. bytes = toUint82(bytes);
  84009. for (var i2 = 0; i2 < isLikelyTypes.length; i2++) {
  84010. var type2 = isLikelyTypes[i2];
  84011. if (isLikely[type2](bytes)) {
  84012. return type2;
  84013. }
  84014. }
  84015. return "";
  84016. };
  84017. var isLikelyFmp4MediaSegment2 = function isLikelyFmp4MediaSegment3(bytes) {
  84018. return findBox2(bytes, ["moof"]).length > 0;
  84019. };
  84020. var ONE_SECOND_IN_TS = 9e4, secondsToVideoTs, secondsToAudioTs, videoTsToSeconds, audioTsToSeconds, audioTsToVideoTs, videoTsToAudioTs, metadataTsToSeconds;
  84021. secondsToVideoTs = function(seconds) {
  84022. return seconds * ONE_SECOND_IN_TS;
  84023. };
  84024. secondsToAudioTs = function(seconds, sampleRate) {
  84025. return seconds * sampleRate;
  84026. };
  84027. videoTsToSeconds = function(timestamp) {
  84028. return timestamp / ONE_SECOND_IN_TS;
  84029. };
  84030. audioTsToSeconds = function(timestamp, sampleRate) {
  84031. return timestamp / sampleRate;
  84032. };
  84033. audioTsToVideoTs = function(timestamp, sampleRate) {
  84034. return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate));
  84035. };
  84036. videoTsToAudioTs = function(timestamp, sampleRate) {
  84037. return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate);
  84038. };
  84039. metadataTsToSeconds = function(timestamp, timelineStartPts, keepOriginalTimestamps) {
  84040. return videoTsToSeconds(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);
  84041. };
  84042. var clock = {
  84043. ONE_SECOND_IN_TS,
  84044. secondsToVideoTs,
  84045. secondsToAudioTs,
  84046. videoTsToSeconds,
  84047. audioTsToSeconds,
  84048. audioTsToVideoTs,
  84049. videoTsToAudioTs,
  84050. metadataTsToSeconds
  84051. };
  84052. function _getPrototypeOf(o) {
  84053. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o2) {
  84054. return o2.__proto__ || Object.getPrototypeOf(o2);
  84055. };
  84056. return _getPrototypeOf(o);
  84057. }
  84058. function _isNativeFunction(fn2) {
  84059. return Function.toString.call(fn2).indexOf("[native code]") !== -1;
  84060. }
  84061. function _wrapNativeSuper(Class) {
  84062. var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
  84063. _wrapNativeSuper = function _wrapNativeSuper2(Class2) {
  84064. if (Class2 === null || !_isNativeFunction(Class2))
  84065. return Class2;
  84066. if (typeof Class2 !== "function") {
  84067. throw new TypeError("Super expression must either be null or a function");
  84068. }
  84069. if (typeof _cache !== "undefined") {
  84070. if (_cache.has(Class2))
  84071. return _cache.get(Class2);
  84072. _cache.set(Class2, Wrapper);
  84073. }
  84074. function Wrapper() {
  84075. return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
  84076. }
  84077. Wrapper.prototype = Object.create(Class2.prototype, {
  84078. constructor: {
  84079. value: Wrapper,
  84080. enumerable: false,
  84081. writable: true,
  84082. configurable: true
  84083. }
  84084. });
  84085. return _setPrototypeOf(Wrapper, Class2);
  84086. };
  84087. return _wrapNativeSuper(Class);
  84088. }
  84089. /**
  84090. * @license
  84091. * Video.js 7.21.4 <http://videojs.com/>
  84092. * Copyright Brightcove, Inc. <https://www.brightcove.com/>
  84093. * Available under Apache License Version 2.0
  84094. * <https://github.com/videojs/video.js/blob/main/LICENSE>
  84095. *
  84096. * Includes vtt.js <https://github.com/mozilla/vtt.js>
  84097. * Available under Apache License Version 2.0
  84098. * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
  84099. */
  84100. var version$5 = "7.21.4";
  84101. var hooks_ = {};
  84102. var hooks = function hooks2(type2, fn2) {
  84103. hooks_[type2] = hooks_[type2] || [];
  84104. if (fn2) {
  84105. hooks_[type2] = hooks_[type2].concat(fn2);
  84106. }
  84107. return hooks_[type2];
  84108. };
  84109. var hook = function hook2(type2, fn2) {
  84110. hooks(type2, fn2);
  84111. };
  84112. var removeHook = function removeHook2(type2, fn2) {
  84113. var index2 = hooks(type2).indexOf(fn2);
  84114. if (index2 <= -1) {
  84115. return false;
  84116. }
  84117. hooks_[type2] = hooks_[type2].slice();
  84118. hooks_[type2].splice(index2, 1);
  84119. return true;
  84120. };
  84121. var hookOnce = function hookOnce2(type2, fn2) {
  84122. hooks(type2, [].concat(fn2).map(function(original) {
  84123. var wrapper = function wrapper2() {
  84124. removeHook(type2, wrapper2);
  84125. return original.apply(void 0, arguments);
  84126. };
  84127. return wrapper;
  84128. }));
  84129. };
  84130. var FullscreenApi = {
  84131. prefixed: true
  84132. };
  84133. var apiMap = [
  84134. ["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror", "fullscreen"],
  84135. ["webkitRequestFullscreen", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitfullscreenchange", "webkitfullscreenerror", "-webkit-full-screen"],
  84136. ["mozRequestFullScreen", "mozCancelFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozfullscreenchange", "mozfullscreenerror", "-moz-full-screen"],
  84137. ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError", "-ms-fullscreen"]
  84138. ];
  84139. var specApi = apiMap[0];
  84140. var browserApi;
  84141. for (var i$2 = 0; i$2 < apiMap.length; i$2++) {
  84142. if (apiMap[i$2][1] in document_1) {
  84143. browserApi = apiMap[i$2];
  84144. break;
  84145. }
  84146. }
  84147. if (browserApi) {
  84148. for (var _i$1 = 0; _i$1 < browserApi.length; _i$1++) {
  84149. FullscreenApi[specApi[_i$1]] = browserApi[_i$1];
  84150. }
  84151. FullscreenApi.prefixed = browserApi[0] !== specApi[0];
  84152. }
  84153. var history = [];
  84154. var LogByTypeFactory = function LogByTypeFactory2(name, log2) {
  84155. return function(type2, level, args) {
  84156. var lvl = log2.levels[level];
  84157. var lvlRegExp = new RegExp("^(" + lvl + ")$");
  84158. if (type2 !== "log") {
  84159. args.unshift(type2.toUpperCase() + ":");
  84160. }
  84161. args.unshift(name + ":");
  84162. if (history) {
  84163. history.push([].concat(args));
  84164. var splice2 = history.length - 1e3;
  84165. history.splice(0, splice2 > 0 ? splice2 : 0);
  84166. }
  84167. if (!window_1.console) {
  84168. return;
  84169. }
  84170. var fn2 = window_1.console[type2];
  84171. if (!fn2 && type2 === "debug") {
  84172. fn2 = window_1.console.info || window_1.console.log;
  84173. }
  84174. if (!fn2 || !lvl || !lvlRegExp.test(type2)) {
  84175. return;
  84176. }
  84177. fn2[Array.isArray(args) ? "apply" : "call"](window_1.console, args);
  84178. };
  84179. };
  84180. function createLogger$1(name) {
  84181. var level = "info";
  84182. var logByType;
  84183. var log2 = function log3() {
  84184. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  84185. args[_key] = arguments[_key];
  84186. }
  84187. logByType("log", level, args);
  84188. };
  84189. logByType = LogByTypeFactory(name, log2);
  84190. log2.createLogger = function(subname) {
  84191. return createLogger$1(name + ": " + subname);
  84192. };
  84193. log2.levels = {
  84194. all: "debug|log|warn|error",
  84195. off: "",
  84196. debug: "debug|log|warn|error",
  84197. info: "log|warn|error",
  84198. warn: "warn|error",
  84199. error: "error",
  84200. DEFAULT: level
  84201. };
  84202. log2.level = function(lvl) {
  84203. if (typeof lvl === "string") {
  84204. if (!log2.levels.hasOwnProperty(lvl)) {
  84205. throw new Error('"' + lvl + '" in not a valid log level');
  84206. }
  84207. level = lvl;
  84208. }
  84209. return level;
  84210. };
  84211. log2.history = function() {
  84212. return history ? [].concat(history) : [];
  84213. };
  84214. log2.history.filter = function(fname) {
  84215. return (history || []).filter(function(historyItem) {
  84216. return new RegExp(".*" + fname + ".*").test(historyItem[0]);
  84217. });
  84218. };
  84219. log2.history.clear = function() {
  84220. if (history) {
  84221. history.length = 0;
  84222. }
  84223. };
  84224. log2.history.disable = function() {
  84225. if (history !== null) {
  84226. history.length = 0;
  84227. history = null;
  84228. }
  84229. };
  84230. log2.history.enable = function() {
  84231. if (history === null) {
  84232. history = [];
  84233. }
  84234. };
  84235. log2.error = function() {
  84236. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  84237. args[_key2] = arguments[_key2];
  84238. }
  84239. return logByType("error", level, args);
  84240. };
  84241. log2.warn = function() {
  84242. for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  84243. args[_key3] = arguments[_key3];
  84244. }
  84245. return logByType("warn", level, args);
  84246. };
  84247. log2.debug = function() {
  84248. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  84249. args[_key4] = arguments[_key4];
  84250. }
  84251. return logByType("debug", level, args);
  84252. };
  84253. return log2;
  84254. }
  84255. var log$1 = createLogger$1("VIDEOJS");
  84256. var createLogger = log$1.createLogger;
  84257. var toString = Object.prototype.toString;
  84258. var keys = function keys2(object) {
  84259. return isObject2(object) ? Object.keys(object) : [];
  84260. };
  84261. function each(object, fn2) {
  84262. keys(object).forEach(function(key) {
  84263. return fn2(object[key], key);
  84264. });
  84265. }
  84266. function reduce(object, fn2, initial) {
  84267. if (initial === void 0) {
  84268. initial = 0;
  84269. }
  84270. return keys(object).reduce(function(accum, key) {
  84271. return fn2(accum, object[key], key);
  84272. }, initial);
  84273. }
  84274. function assign(target) {
  84275. for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  84276. sources[_key - 1] = arguments[_key];
  84277. }
  84278. if (Object.assign) {
  84279. return _extends$2.apply(void 0, [target].concat(sources));
  84280. }
  84281. sources.forEach(function(source) {
  84282. if (!source) {
  84283. return;
  84284. }
  84285. each(source, function(value, key) {
  84286. target[key] = value;
  84287. });
  84288. });
  84289. return target;
  84290. }
  84291. function isObject2(value) {
  84292. return !!value && typeof value === "object";
  84293. }
  84294. function isPlain(value) {
  84295. return isObject2(value) && toString.call(value) === "[object Object]" && value.constructor === Object;
  84296. }
  84297. function computedStyle(el, prop) {
  84298. if (!el || !prop) {
  84299. return "";
  84300. }
  84301. if (typeof window_1.getComputedStyle === "function") {
  84302. var computedStyleValue;
  84303. try {
  84304. computedStyleValue = window_1.getComputedStyle(el);
  84305. } catch (e) {
  84306. return "";
  84307. }
  84308. return computedStyleValue ? computedStyleValue.getPropertyValue(prop) || computedStyleValue[prop] : "";
  84309. }
  84310. return "";
  84311. }
  84312. var USER_AGENT = window_1.navigator && window_1.navigator.userAgent || "";
  84313. var webkitVersionMap = /AppleWebKit\/([\d.]+)/i.exec(USER_AGENT);
  84314. var appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null;
  84315. var IS_IPOD = /iPod/i.test(USER_AGENT);
  84316. var IOS_VERSION = function() {
  84317. var match = USER_AGENT.match(/OS (\d+)_/i);
  84318. if (match && match[1]) {
  84319. return match[1];
  84320. }
  84321. return null;
  84322. }();
  84323. var IS_ANDROID = /Android/i.test(USER_AGENT);
  84324. var ANDROID_VERSION = function() {
  84325. var match = USER_AGENT.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);
  84326. if (!match) {
  84327. return null;
  84328. }
  84329. var major = match[1] && parseFloat(match[1]);
  84330. var minor = match[2] && parseFloat(match[2]);
  84331. if (major && minor) {
  84332. return parseFloat(match[1] + "." + match[2]);
  84333. } else if (major) {
  84334. return major;
  84335. }
  84336. return null;
  84337. }();
  84338. var IS_NATIVE_ANDROID = IS_ANDROID && ANDROID_VERSION < 5 && appleWebkitVersion < 537;
  84339. var IS_FIREFOX = /Firefox/i.test(USER_AGENT);
  84340. var IS_EDGE = /Edg/i.test(USER_AGENT);
  84341. var IS_CHROME = !IS_EDGE && (/Chrome/i.test(USER_AGENT) || /CriOS/i.test(USER_AGENT));
  84342. var CHROME_VERSION = function() {
  84343. var match = USER_AGENT.match(/(Chrome|CriOS)\/(\d+)/);
  84344. if (match && match[2]) {
  84345. return parseFloat(match[2]);
  84346. }
  84347. return null;
  84348. }();
  84349. var IE_VERSION = function() {
  84350. var result = /MSIE\s(\d+)\.\d/.exec(USER_AGENT);
  84351. var version2 = result && parseFloat(result[1]);
  84352. if (!version2 && /Trident\/7.0/i.test(USER_AGENT) && /rv:11.0/.test(USER_AGENT)) {
  84353. version2 = 11;
  84354. }
  84355. return version2;
  84356. }();
  84357. var IS_SAFARI = /Safari/i.test(USER_AGENT) && !IS_CHROME && !IS_ANDROID && !IS_EDGE;
  84358. var IS_WINDOWS = /Windows/i.test(USER_AGENT);
  84359. var TOUCH_ENABLED = Boolean(isReal() && ("ontouchstart" in window_1 || window_1.navigator.maxTouchPoints || window_1.DocumentTouch && window_1.document instanceof window_1.DocumentTouch));
  84360. var IS_IPAD = /iPad/i.test(USER_AGENT) || IS_SAFARI && TOUCH_ENABLED && !/iPhone/i.test(USER_AGENT);
  84361. var IS_IPHONE = /iPhone/i.test(USER_AGENT) && !IS_IPAD;
  84362. var IS_IOS = IS_IPHONE || IS_IPAD || IS_IPOD;
  84363. var IS_ANY_SAFARI = (IS_SAFARI || IS_IOS) && !IS_CHROME;
  84364. var browser = /* @__PURE__ */ Object.freeze({
  84365. __proto__: null,
  84366. IS_IPOD,
  84367. IOS_VERSION,
  84368. IS_ANDROID,
  84369. ANDROID_VERSION,
  84370. IS_NATIVE_ANDROID,
  84371. IS_FIREFOX,
  84372. IS_EDGE,
  84373. IS_CHROME,
  84374. CHROME_VERSION,
  84375. IE_VERSION,
  84376. IS_SAFARI,
  84377. IS_WINDOWS,
  84378. TOUCH_ENABLED,
  84379. IS_IPAD,
  84380. IS_IPHONE,
  84381. IS_IOS,
  84382. IS_ANY_SAFARI
  84383. });
  84384. function isNonBlankString(str) {
  84385. return typeof str === "string" && Boolean(str.trim());
  84386. }
  84387. function throwIfWhitespace(str) {
  84388. if (str.indexOf(" ") >= 0) {
  84389. throw new Error("class has illegal whitespace characters");
  84390. }
  84391. }
  84392. function classRegExp(className) {
  84393. return new RegExp("(^|\\s)" + className + "($|\\s)");
  84394. }
  84395. function isReal() {
  84396. return document_1 === window_1.document;
  84397. }
  84398. function isEl(value) {
  84399. return isObject2(value) && value.nodeType === 1;
  84400. }
  84401. function isInFrame() {
  84402. try {
  84403. return window_1.parent !== window_1.self;
  84404. } catch (x) {
  84405. return true;
  84406. }
  84407. }
  84408. function createQuerier(method) {
  84409. return function(selector, context) {
  84410. if (!isNonBlankString(selector)) {
  84411. return document_1[method](null);
  84412. }
  84413. if (isNonBlankString(context)) {
  84414. context = document_1.querySelector(context);
  84415. }
  84416. var ctx = isEl(context) ? context : document_1;
  84417. return ctx[method] && ctx[method](selector);
  84418. };
  84419. }
  84420. function createEl(tagName, properties, attributes, content) {
  84421. if (tagName === void 0) {
  84422. tagName = "div";
  84423. }
  84424. if (properties === void 0) {
  84425. properties = {};
  84426. }
  84427. if (attributes === void 0) {
  84428. attributes = {};
  84429. }
  84430. var el = document_1.createElement(tagName);
  84431. Object.getOwnPropertyNames(properties).forEach(function(propName) {
  84432. var val = properties[propName];
  84433. if (propName.indexOf("aria-") !== -1 || propName === "role" || propName === "type") {
  84434. log$1.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\n" + ("createEl(type, properties, attributes). Attempting to set " + propName + " to " + val + "."));
  84435. el.setAttribute(propName, val);
  84436. } else if (propName === "textContent") {
  84437. textContent(el, val);
  84438. } else if (el[propName] !== val || propName === "tabIndex") {
  84439. el[propName] = val;
  84440. }
  84441. });
  84442. Object.getOwnPropertyNames(attributes).forEach(function(attrName) {
  84443. el.setAttribute(attrName, attributes[attrName]);
  84444. });
  84445. if (content) {
  84446. appendContent(el, content);
  84447. }
  84448. return el;
  84449. }
  84450. function textContent(el, text) {
  84451. if (typeof el.textContent === "undefined") {
  84452. el.innerText = text;
  84453. } else {
  84454. el.textContent = text;
  84455. }
  84456. return el;
  84457. }
  84458. function prependTo(child, parent) {
  84459. if (parent.firstChild) {
  84460. parent.insertBefore(child, parent.firstChild);
  84461. } else {
  84462. parent.appendChild(child);
  84463. }
  84464. }
  84465. function hasClass(element, classToCheck) {
  84466. throwIfWhitespace(classToCheck);
  84467. if (element.classList) {
  84468. return element.classList.contains(classToCheck);
  84469. }
  84470. return classRegExp(classToCheck).test(element.className);
  84471. }
  84472. function addClass(element, classToAdd) {
  84473. if (element.classList) {
  84474. element.classList.add(classToAdd);
  84475. } else if (!hasClass(element, classToAdd)) {
  84476. element.className = (element.className + " " + classToAdd).trim();
  84477. }
  84478. return element;
  84479. }
  84480. function removeClass(element, classToRemove) {
  84481. if (!element) {
  84482. log$1.warn("removeClass was called with an element that doesn't exist");
  84483. return null;
  84484. }
  84485. if (element.classList) {
  84486. element.classList.remove(classToRemove);
  84487. } else {
  84488. throwIfWhitespace(classToRemove);
  84489. element.className = element.className.split(/\s+/).filter(function(c) {
  84490. return c !== classToRemove;
  84491. }).join(" ");
  84492. }
  84493. return element;
  84494. }
  84495. function toggleClass(element, classToToggle, predicate) {
  84496. var has = hasClass(element, classToToggle);
  84497. if (typeof predicate === "function") {
  84498. predicate = predicate(element, classToToggle);
  84499. }
  84500. if (typeof predicate !== "boolean") {
  84501. predicate = !has;
  84502. }
  84503. if (predicate === has) {
  84504. return;
  84505. }
  84506. if (predicate) {
  84507. addClass(element, classToToggle);
  84508. } else {
  84509. removeClass(element, classToToggle);
  84510. }
  84511. return element;
  84512. }
  84513. function setAttributes(el, attributes) {
  84514. Object.getOwnPropertyNames(attributes).forEach(function(attrName) {
  84515. var attrValue = attributes[attrName];
  84516. if (attrValue === null || typeof attrValue === "undefined" || attrValue === false) {
  84517. el.removeAttribute(attrName);
  84518. } else {
  84519. el.setAttribute(attrName, attrValue === true ? "" : attrValue);
  84520. }
  84521. });
  84522. }
  84523. function getAttributes(tag) {
  84524. var obj = {};
  84525. var knownBooleans = ",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";
  84526. if (tag && tag.attributes && tag.attributes.length > 0) {
  84527. var attrs = tag.attributes;
  84528. for (var i2 = attrs.length - 1; i2 >= 0; i2--) {
  84529. var attrName = attrs[i2].name;
  84530. var attrVal = attrs[i2].value;
  84531. if (typeof tag[attrName] === "boolean" || knownBooleans.indexOf("," + attrName + ",") !== -1) {
  84532. attrVal = attrVal !== null ? true : false;
  84533. }
  84534. obj[attrName] = attrVal;
  84535. }
  84536. }
  84537. return obj;
  84538. }
  84539. function getAttribute(el, attribute) {
  84540. return el.getAttribute(attribute);
  84541. }
  84542. function setAttribute(el, attribute, value) {
  84543. el.setAttribute(attribute, value);
  84544. }
  84545. function removeAttribute(el, attribute) {
  84546. el.removeAttribute(attribute);
  84547. }
  84548. function blockTextSelection() {
  84549. document_1.body.focus();
  84550. document_1.onselectstart = function() {
  84551. return false;
  84552. };
  84553. }
  84554. function unblockTextSelection() {
  84555. document_1.onselectstart = function() {
  84556. return true;
  84557. };
  84558. }
  84559. function getBoundingClientRect(el) {
  84560. if (el && el.getBoundingClientRect && el.parentNode) {
  84561. var rect = el.getBoundingClientRect();
  84562. var result = {};
  84563. ["bottom", "height", "left", "right", "top", "width"].forEach(function(k) {
  84564. if (rect[k] !== void 0) {
  84565. result[k] = rect[k];
  84566. }
  84567. });
  84568. if (!result.height) {
  84569. result.height = parseFloat(computedStyle(el, "height"));
  84570. }
  84571. if (!result.width) {
  84572. result.width = parseFloat(computedStyle(el, "width"));
  84573. }
  84574. return result;
  84575. }
  84576. }
  84577. function findPosition(el) {
  84578. if (!el || el && !el.offsetParent) {
  84579. return {
  84580. left: 0,
  84581. top: 0,
  84582. width: 0,
  84583. height: 0
  84584. };
  84585. }
  84586. var width2 = el.offsetWidth;
  84587. var height2 = el.offsetHeight;
  84588. var left = 0;
  84589. var top = 0;
  84590. while (el.offsetParent && el !== document_1[FullscreenApi.fullscreenElement]) {
  84591. left += el.offsetLeft;
  84592. top += el.offsetTop;
  84593. el = el.offsetParent;
  84594. }
  84595. return {
  84596. left,
  84597. top,
  84598. width: width2,
  84599. height: height2
  84600. };
  84601. }
  84602. function getPointerPosition(el, event2) {
  84603. var translated = {
  84604. x: 0,
  84605. y: 0
  84606. };
  84607. if (IS_IOS) {
  84608. var item = el;
  84609. while (item && item.nodeName.toLowerCase() !== "html") {
  84610. var transform3 = computedStyle(item, "transform");
  84611. if (/^matrix/.test(transform3)) {
  84612. var values3 = transform3.slice(7, -1).split(/,\s/).map(Number);
  84613. translated.x += values3[4];
  84614. translated.y += values3[5];
  84615. } else if (/^matrix3d/.test(transform3)) {
  84616. var _values = transform3.slice(9, -1).split(/,\s/).map(Number);
  84617. translated.x += _values[12];
  84618. translated.y += _values[13];
  84619. }
  84620. item = item.parentNode;
  84621. }
  84622. }
  84623. var position2 = {};
  84624. var boxTarget = findPosition(event2.target);
  84625. var box = findPosition(el);
  84626. var boxW = box.width;
  84627. var boxH = box.height;
  84628. var offsetY = event2.offsetY - (box.top - boxTarget.top);
  84629. var offsetX = event2.offsetX - (box.left - boxTarget.left);
  84630. if (event2.changedTouches) {
  84631. offsetX = event2.changedTouches[0].pageX - box.left;
  84632. offsetY = event2.changedTouches[0].pageY + box.top;
  84633. if (IS_IOS) {
  84634. offsetX -= translated.x;
  84635. offsetY -= translated.y;
  84636. }
  84637. }
  84638. position2.y = 1 - Math.max(0, Math.min(1, offsetY / boxH));
  84639. position2.x = Math.max(0, Math.min(1, offsetX / boxW));
  84640. return position2;
  84641. }
  84642. function isTextNode(value) {
  84643. return isObject2(value) && value.nodeType === 3;
  84644. }
  84645. function emptyEl(el) {
  84646. while (el.firstChild) {
  84647. el.removeChild(el.firstChild);
  84648. }
  84649. return el;
  84650. }
  84651. function normalizeContent(content) {
  84652. if (typeof content === "function") {
  84653. content = content();
  84654. }
  84655. return (Array.isArray(content) ? content : [content]).map(function(value) {
  84656. if (typeof value === "function") {
  84657. value = value();
  84658. }
  84659. if (isEl(value) || isTextNode(value)) {
  84660. return value;
  84661. }
  84662. if (typeof value === "string" && /\S/.test(value)) {
  84663. return document_1.createTextNode(value);
  84664. }
  84665. }).filter(function(value) {
  84666. return value;
  84667. });
  84668. }
  84669. function appendContent(el, content) {
  84670. normalizeContent(content).forEach(function(node) {
  84671. return el.appendChild(node);
  84672. });
  84673. return el;
  84674. }
  84675. function insertContent(el, content) {
  84676. return appendContent(emptyEl(el), content);
  84677. }
  84678. function isSingleLeftClick(event2) {
  84679. if (event2.button === void 0 && event2.buttons === void 0) {
  84680. return true;
  84681. }
  84682. if (event2.button === 0 && event2.buttons === void 0) {
  84683. return true;
  84684. }
  84685. if (event2.type === "mouseup" && event2.button === 0 && event2.buttons === 0) {
  84686. return true;
  84687. }
  84688. if (event2.button !== 0 || event2.buttons !== 1) {
  84689. return false;
  84690. }
  84691. return true;
  84692. }
  84693. var $ = createQuerier("querySelector");
  84694. var $$ = createQuerier("querySelectorAll");
  84695. var Dom$1 = /* @__PURE__ */ Object.freeze({
  84696. __proto__: null,
  84697. isReal,
  84698. isEl,
  84699. isInFrame,
  84700. createEl,
  84701. textContent,
  84702. prependTo,
  84703. hasClass,
  84704. addClass,
  84705. removeClass,
  84706. toggleClass,
  84707. setAttributes,
  84708. getAttributes,
  84709. getAttribute,
  84710. setAttribute,
  84711. removeAttribute,
  84712. blockTextSelection,
  84713. unblockTextSelection,
  84714. getBoundingClientRect,
  84715. findPosition,
  84716. getPointerPosition,
  84717. isTextNode,
  84718. emptyEl,
  84719. normalizeContent,
  84720. appendContent,
  84721. insertContent,
  84722. isSingleLeftClick,
  84723. $,
  84724. $$
  84725. });
  84726. var _windowLoaded = false;
  84727. var videojs$1;
  84728. var autoSetup = function autoSetup2() {
  84729. if (videojs$1.options.autoSetup === false) {
  84730. return;
  84731. }
  84732. var vids = Array.prototype.slice.call(document_1.getElementsByTagName("video"));
  84733. var audios = Array.prototype.slice.call(document_1.getElementsByTagName("audio"));
  84734. var divs = Array.prototype.slice.call(document_1.getElementsByTagName("video-js"));
  84735. var mediaEls = vids.concat(audios, divs);
  84736. if (mediaEls && mediaEls.length > 0) {
  84737. for (var i2 = 0, e = mediaEls.length; i2 < e; i2++) {
  84738. var mediaEl = mediaEls[i2];
  84739. if (mediaEl && mediaEl.getAttribute) {
  84740. if (mediaEl.player === void 0) {
  84741. var options2 = mediaEl.getAttribute("data-setup");
  84742. if (options2 !== null) {
  84743. videojs$1(mediaEl);
  84744. }
  84745. }
  84746. } else {
  84747. autoSetupTimeout(1);
  84748. break;
  84749. }
  84750. }
  84751. } else if (!_windowLoaded) {
  84752. autoSetupTimeout(1);
  84753. }
  84754. };
  84755. function autoSetupTimeout(wait, vjs) {
  84756. if (!isReal()) {
  84757. return;
  84758. }
  84759. if (vjs) {
  84760. videojs$1 = vjs;
  84761. }
  84762. window_1.setTimeout(autoSetup, wait);
  84763. }
  84764. function setWindowLoaded() {
  84765. _windowLoaded = true;
  84766. window_1.removeEventListener("load", setWindowLoaded);
  84767. }
  84768. if (isReal()) {
  84769. if (document_1.readyState === "complete") {
  84770. setWindowLoaded();
  84771. } else {
  84772. window_1.addEventListener("load", setWindowLoaded);
  84773. }
  84774. }
  84775. var createStyleElement = function createStyleElement2(className) {
  84776. var style = document_1.createElement("style");
  84777. style.className = className;
  84778. return style;
  84779. };
  84780. var setTextContent = function setTextContent2(el, content) {
  84781. if (el.styleSheet) {
  84782. el.styleSheet.cssText = content;
  84783. } else {
  84784. el.textContent = content;
  84785. }
  84786. };
  84787. var _initialGuid = 3;
  84788. var _guid = _initialGuid;
  84789. function newGUID() {
  84790. return _guid++;
  84791. }
  84792. var FakeWeakMap;
  84793. if (!window_1.WeakMap) {
  84794. FakeWeakMap = /* @__PURE__ */ function() {
  84795. function FakeWeakMap2() {
  84796. this.vdata = "vdata" + Math.floor(window_1.performance && window_1.performance.now() || Date.now());
  84797. this.data = {};
  84798. }
  84799. var _proto = FakeWeakMap2.prototype;
  84800. _proto.set = function set4(key, value) {
  84801. var access = key[this.vdata] || newGUID();
  84802. if (!key[this.vdata]) {
  84803. key[this.vdata] = access;
  84804. }
  84805. this.data[access] = value;
  84806. return this;
  84807. };
  84808. _proto.get = function get7(key) {
  84809. var access = key[this.vdata];
  84810. if (access) {
  84811. return this.data[access];
  84812. }
  84813. log$1("We have no data for this element", key);
  84814. return void 0;
  84815. };
  84816. _proto.has = function has(key) {
  84817. var access = key[this.vdata];
  84818. return access in this.data;
  84819. };
  84820. _proto["delete"] = function _delete(key) {
  84821. var access = key[this.vdata];
  84822. if (access) {
  84823. delete this.data[access];
  84824. delete key[this.vdata];
  84825. }
  84826. };
  84827. return FakeWeakMap2;
  84828. }();
  84829. }
  84830. var DomData = window_1.WeakMap ? /* @__PURE__ */ new WeakMap() : new FakeWeakMap();
  84831. function _cleanUpEvents(elem, type2) {
  84832. if (!DomData.has(elem)) {
  84833. return;
  84834. }
  84835. var data = DomData.get(elem);
  84836. if (data.handlers[type2].length === 0) {
  84837. delete data.handlers[type2];
  84838. if (elem.removeEventListener) {
  84839. elem.removeEventListener(type2, data.dispatcher, false);
  84840. } else if (elem.detachEvent) {
  84841. elem.detachEvent("on" + type2, data.dispatcher);
  84842. }
  84843. }
  84844. if (Object.getOwnPropertyNames(data.handlers).length <= 0) {
  84845. delete data.handlers;
  84846. delete data.dispatcher;
  84847. delete data.disabled;
  84848. }
  84849. if (Object.getOwnPropertyNames(data).length === 0) {
  84850. DomData["delete"](elem);
  84851. }
  84852. }
  84853. function _handleMultipleEvents(fn2, elem, types, callback2) {
  84854. types.forEach(function(type2) {
  84855. fn2(elem, type2, callback2);
  84856. });
  84857. }
  84858. function fixEvent(event2) {
  84859. if (event2.fixed_) {
  84860. return event2;
  84861. }
  84862. function returnTrue() {
  84863. return true;
  84864. }
  84865. function returnFalse() {
  84866. return false;
  84867. }
  84868. if (!event2 || !event2.isPropagationStopped || !event2.isImmediatePropagationStopped) {
  84869. var old = event2 || window_1.event;
  84870. event2 = {};
  84871. for (var key in old) {
  84872. if (key !== "layerX" && key !== "layerY" && key !== "keyLocation" && key !== "webkitMovementX" && key !== "webkitMovementY" && key !== "path") {
  84873. if (!(key === "returnValue" && old.preventDefault)) {
  84874. event2[key] = old[key];
  84875. }
  84876. }
  84877. }
  84878. if (!event2.target) {
  84879. event2.target = event2.srcElement || document_1;
  84880. }
  84881. if (!event2.relatedTarget) {
  84882. event2.relatedTarget = event2.fromElement === event2.target ? event2.toElement : event2.fromElement;
  84883. }
  84884. event2.preventDefault = function() {
  84885. if (old.preventDefault) {
  84886. old.preventDefault();
  84887. }
  84888. event2.returnValue = false;
  84889. old.returnValue = false;
  84890. event2.defaultPrevented = true;
  84891. };
  84892. event2.defaultPrevented = false;
  84893. event2.stopPropagation = function() {
  84894. if (old.stopPropagation) {
  84895. old.stopPropagation();
  84896. }
  84897. event2.cancelBubble = true;
  84898. old.cancelBubble = true;
  84899. event2.isPropagationStopped = returnTrue;
  84900. };
  84901. event2.isPropagationStopped = returnFalse;
  84902. event2.stopImmediatePropagation = function() {
  84903. if (old.stopImmediatePropagation) {
  84904. old.stopImmediatePropagation();
  84905. }
  84906. event2.isImmediatePropagationStopped = returnTrue;
  84907. event2.stopPropagation();
  84908. };
  84909. event2.isImmediatePropagationStopped = returnFalse;
  84910. if (event2.clientX !== null && event2.clientX !== void 0) {
  84911. var doc = document_1.documentElement;
  84912. var body = document_1.body;
  84913. event2.pageX = event2.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
  84914. event2.pageY = event2.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0);
  84915. }
  84916. event2.which = event2.charCode || event2.keyCode;
  84917. if (event2.button !== null && event2.button !== void 0) {
  84918. event2.button = event2.button & 1 ? 0 : event2.button & 4 ? 1 : event2.button & 2 ? 2 : 0;
  84919. }
  84920. }
  84921. event2.fixed_ = true;
  84922. return event2;
  84923. }
  84924. var _supportsPassive;
  84925. var supportsPassive = function supportsPassive2() {
  84926. if (typeof _supportsPassive !== "boolean") {
  84927. _supportsPassive = false;
  84928. try {
  84929. var opts = Object.defineProperty({}, "passive", {
  84930. get: function get7() {
  84931. _supportsPassive = true;
  84932. }
  84933. });
  84934. window_1.addEventListener("test", null, opts);
  84935. window_1.removeEventListener("test", null, opts);
  84936. } catch (e) {
  84937. }
  84938. }
  84939. return _supportsPassive;
  84940. };
  84941. var passiveEvents = ["touchstart", "touchmove"];
  84942. function on(elem, type2, fn2) {
  84943. if (Array.isArray(type2)) {
  84944. return _handleMultipleEvents(on, elem, type2, fn2);
  84945. }
  84946. if (!DomData.has(elem)) {
  84947. DomData.set(elem, {});
  84948. }
  84949. var data = DomData.get(elem);
  84950. if (!data.handlers) {
  84951. data.handlers = {};
  84952. }
  84953. if (!data.handlers[type2]) {
  84954. data.handlers[type2] = [];
  84955. }
  84956. if (!fn2.guid) {
  84957. fn2.guid = newGUID();
  84958. }
  84959. data.handlers[type2].push(fn2);
  84960. if (!data.dispatcher) {
  84961. data.disabled = false;
  84962. data.dispatcher = function(event2, hash) {
  84963. if (data.disabled) {
  84964. return;
  84965. }
  84966. event2 = fixEvent(event2);
  84967. var handlers = data.handlers[event2.type];
  84968. if (handlers) {
  84969. var handlersCopy = handlers.slice(0);
  84970. for (var m = 0, n = handlersCopy.length; m < n; m++) {
  84971. if (event2.isImmediatePropagationStopped()) {
  84972. break;
  84973. } else {
  84974. try {
  84975. handlersCopy[m].call(elem, event2, hash);
  84976. } catch (e) {
  84977. log$1.error(e);
  84978. }
  84979. }
  84980. }
  84981. }
  84982. };
  84983. }
  84984. if (data.handlers[type2].length === 1) {
  84985. if (elem.addEventListener) {
  84986. var options2 = false;
  84987. if (supportsPassive() && passiveEvents.indexOf(type2) > -1) {
  84988. options2 = {
  84989. passive: true
  84990. };
  84991. }
  84992. elem.addEventListener(type2, data.dispatcher, options2);
  84993. } else if (elem.attachEvent) {
  84994. elem.attachEvent("on" + type2, data.dispatcher);
  84995. }
  84996. }
  84997. }
  84998. function off(elem, type2, fn2) {
  84999. if (!DomData.has(elem)) {
  85000. return;
  85001. }
  85002. var data = DomData.get(elem);
  85003. if (!data.handlers) {
  85004. return;
  85005. }
  85006. if (Array.isArray(type2)) {
  85007. return _handleMultipleEvents(off, elem, type2, fn2);
  85008. }
  85009. var removeType = function removeType2(el, t3) {
  85010. data.handlers[t3] = [];
  85011. _cleanUpEvents(el, t3);
  85012. };
  85013. if (type2 === void 0) {
  85014. for (var t2 in data.handlers) {
  85015. if (Object.prototype.hasOwnProperty.call(data.handlers || {}, t2)) {
  85016. removeType(elem, t2);
  85017. }
  85018. }
  85019. return;
  85020. }
  85021. var handlers = data.handlers[type2];
  85022. if (!handlers) {
  85023. return;
  85024. }
  85025. if (!fn2) {
  85026. removeType(elem, type2);
  85027. return;
  85028. }
  85029. if (fn2.guid) {
  85030. for (var n = 0; n < handlers.length; n++) {
  85031. if (handlers[n].guid === fn2.guid) {
  85032. handlers.splice(n--, 1);
  85033. }
  85034. }
  85035. }
  85036. _cleanUpEvents(elem, type2);
  85037. }
  85038. function trigger(elem, event2, hash) {
  85039. var elemData = DomData.has(elem) ? DomData.get(elem) : {};
  85040. var parent = elem.parentNode || elem.ownerDocument;
  85041. if (typeof event2 === "string") {
  85042. event2 = {
  85043. type: event2,
  85044. target: elem
  85045. };
  85046. } else if (!event2.target) {
  85047. event2.target = elem;
  85048. }
  85049. event2 = fixEvent(event2);
  85050. if (elemData.dispatcher) {
  85051. elemData.dispatcher.call(elem, event2, hash);
  85052. }
  85053. if (parent && !event2.isPropagationStopped() && event2.bubbles === true) {
  85054. trigger.call(null, parent, event2, hash);
  85055. } else if (!parent && !event2.defaultPrevented && event2.target && event2.target[event2.type]) {
  85056. if (!DomData.has(event2.target)) {
  85057. DomData.set(event2.target, {});
  85058. }
  85059. var targetData = DomData.get(event2.target);
  85060. if (event2.target[event2.type]) {
  85061. targetData.disabled = true;
  85062. if (typeof event2.target[event2.type] === "function") {
  85063. event2.target[event2.type]();
  85064. }
  85065. targetData.disabled = false;
  85066. }
  85067. }
  85068. return !event2.defaultPrevented;
  85069. }
  85070. function one(elem, type2, fn2) {
  85071. if (Array.isArray(type2)) {
  85072. return _handleMultipleEvents(one, elem, type2, fn2);
  85073. }
  85074. var func = function func2() {
  85075. off(elem, type2, func2);
  85076. fn2.apply(this, arguments);
  85077. };
  85078. func.guid = fn2.guid = fn2.guid || newGUID();
  85079. on(elem, type2, func);
  85080. }
  85081. function any(elem, type2, fn2) {
  85082. var func = function func2() {
  85083. off(elem, type2, func2);
  85084. fn2.apply(this, arguments);
  85085. };
  85086. func.guid = fn2.guid = fn2.guid || newGUID();
  85087. on(elem, type2, func);
  85088. }
  85089. var Events = /* @__PURE__ */ Object.freeze({
  85090. __proto__: null,
  85091. fixEvent,
  85092. on,
  85093. off,
  85094. trigger,
  85095. one,
  85096. any
  85097. });
  85098. var UPDATE_REFRESH_INTERVAL = 30;
  85099. var bind = function bind2(context, fn2, uid) {
  85100. if (!fn2.guid) {
  85101. fn2.guid = newGUID();
  85102. }
  85103. var bound = fn2.bind(context);
  85104. bound.guid = uid ? uid + "_" + fn2.guid : fn2.guid;
  85105. return bound;
  85106. };
  85107. var throttle = function throttle2(fn2, wait) {
  85108. var last = window_1.performance.now();
  85109. var throttled = function throttled2() {
  85110. var now2 = window_1.performance.now();
  85111. if (now2 - last >= wait) {
  85112. fn2.apply(void 0, arguments);
  85113. last = now2;
  85114. }
  85115. };
  85116. return throttled;
  85117. };
  85118. var debounce = function debounce2(func, wait, immediate, context) {
  85119. if (context === void 0) {
  85120. context = window_1;
  85121. }
  85122. var timeout;
  85123. var cancel = function cancel2() {
  85124. context.clearTimeout(timeout);
  85125. timeout = null;
  85126. };
  85127. var debounced = function debounced2() {
  85128. var self2 = this;
  85129. var args = arguments;
  85130. var _later = function later() {
  85131. timeout = null;
  85132. _later = null;
  85133. if (!immediate) {
  85134. func.apply(self2, args);
  85135. }
  85136. };
  85137. if (!timeout && immediate) {
  85138. func.apply(self2, args);
  85139. }
  85140. context.clearTimeout(timeout);
  85141. timeout = context.setTimeout(_later, wait);
  85142. };
  85143. debounced.cancel = cancel;
  85144. return debounced;
  85145. };
  85146. var EventTarget$2 = function EventTarget() {
  85147. };
  85148. EventTarget$2.prototype.allowedEvents_ = {};
  85149. EventTarget$2.prototype.on = function(type2, fn2) {
  85150. var ael = this.addEventListener;
  85151. this.addEventListener = function() {
  85152. };
  85153. on(this, type2, fn2);
  85154. this.addEventListener = ael;
  85155. };
  85156. EventTarget$2.prototype.addEventListener = EventTarget$2.prototype.on;
  85157. EventTarget$2.prototype.off = function(type2, fn2) {
  85158. off(this, type2, fn2);
  85159. };
  85160. EventTarget$2.prototype.removeEventListener = EventTarget$2.prototype.off;
  85161. EventTarget$2.prototype.one = function(type2, fn2) {
  85162. var ael = this.addEventListener;
  85163. this.addEventListener = function() {
  85164. };
  85165. one(this, type2, fn2);
  85166. this.addEventListener = ael;
  85167. };
  85168. EventTarget$2.prototype.any = function(type2, fn2) {
  85169. var ael = this.addEventListener;
  85170. this.addEventListener = function() {
  85171. };
  85172. any(this, type2, fn2);
  85173. this.addEventListener = ael;
  85174. };
  85175. EventTarget$2.prototype.trigger = function(event2) {
  85176. var type2 = event2.type || event2;
  85177. if (typeof event2 === "string") {
  85178. event2 = {
  85179. type: type2
  85180. };
  85181. }
  85182. event2 = fixEvent(event2);
  85183. if (this.allowedEvents_[type2] && this["on" + type2]) {
  85184. this["on" + type2](event2);
  85185. }
  85186. trigger(this, event2);
  85187. };
  85188. EventTarget$2.prototype.dispatchEvent = EventTarget$2.prototype.trigger;
  85189. var EVENT_MAP;
  85190. EventTarget$2.prototype.queueTrigger = function(event2) {
  85191. var _this = this;
  85192. if (!EVENT_MAP) {
  85193. EVENT_MAP = /* @__PURE__ */ new Map();
  85194. }
  85195. var type2 = event2.type || event2;
  85196. var map = EVENT_MAP.get(this);
  85197. if (!map) {
  85198. map = /* @__PURE__ */ new Map();
  85199. EVENT_MAP.set(this, map);
  85200. }
  85201. var oldTimeout = map.get(type2);
  85202. map["delete"](type2);
  85203. window_1.clearTimeout(oldTimeout);
  85204. var timeout = window_1.setTimeout(function() {
  85205. map["delete"](type2);
  85206. if (map.size === 0) {
  85207. map = null;
  85208. EVENT_MAP["delete"](_this);
  85209. }
  85210. _this.trigger(event2);
  85211. }, 0);
  85212. map.set(type2, timeout);
  85213. };
  85214. var objName = function objName2(obj) {
  85215. if (typeof obj.name === "function") {
  85216. return obj.name();
  85217. }
  85218. if (typeof obj.name === "string") {
  85219. return obj.name;
  85220. }
  85221. if (obj.name_) {
  85222. return obj.name_;
  85223. }
  85224. if (obj.constructor && obj.constructor.name) {
  85225. return obj.constructor.name;
  85226. }
  85227. return typeof obj;
  85228. };
  85229. var isEvented = function isEvented2(object) {
  85230. return object instanceof EventTarget$2 || !!object.eventBusEl_ && ["on", "one", "off", "trigger"].every(function(k) {
  85231. return typeof object[k] === "function";
  85232. });
  85233. };
  85234. var addEventedCallback = function addEventedCallback2(target, callback2) {
  85235. if (isEvented(target)) {
  85236. callback2();
  85237. } else {
  85238. if (!target.eventedCallbacks) {
  85239. target.eventedCallbacks = [];
  85240. }
  85241. target.eventedCallbacks.push(callback2);
  85242. }
  85243. };
  85244. var isValidEventType = function isValidEventType2(type2) {
  85245. return typeof type2 === "string" && /\S/.test(type2) || Array.isArray(type2) && !!type2.length;
  85246. };
  85247. var validateTarget = function validateTarget2(target, obj, fnName) {
  85248. if (!target || !target.nodeName && !isEvented(target)) {
  85249. throw new Error("Invalid target for " + objName(obj) + "#" + fnName + "; must be a DOM node or evented object.");
  85250. }
  85251. };
  85252. var validateEventType = function validateEventType2(type2, obj, fnName) {
  85253. if (!isValidEventType(type2)) {
  85254. throw new Error("Invalid event type for " + objName(obj) + "#" + fnName + "; must be a non-empty string or array.");
  85255. }
  85256. };
  85257. var validateListener = function validateListener2(listener, obj, fnName) {
  85258. if (typeof listener !== "function") {
  85259. throw new Error("Invalid listener for " + objName(obj) + "#" + fnName + "; must be a function.");
  85260. }
  85261. };
  85262. var normalizeListenArgs = function normalizeListenArgs2(self2, args, fnName) {
  85263. var isTargetingSelf = args.length < 3 || args[0] === self2 || args[0] === self2.eventBusEl_;
  85264. var target;
  85265. var type2;
  85266. var listener;
  85267. if (isTargetingSelf) {
  85268. target = self2.eventBusEl_;
  85269. if (args.length >= 3) {
  85270. args.shift();
  85271. }
  85272. type2 = args[0];
  85273. listener = args[1];
  85274. } else {
  85275. target = args[0];
  85276. type2 = args[1];
  85277. listener = args[2];
  85278. }
  85279. validateTarget(target, self2, fnName);
  85280. validateEventType(type2, self2, fnName);
  85281. validateListener(listener, self2, fnName);
  85282. listener = bind(self2, listener);
  85283. return {
  85284. isTargetingSelf,
  85285. target,
  85286. type: type2,
  85287. listener
  85288. };
  85289. };
  85290. var listen = function listen2(target, method, type2, listener) {
  85291. validateTarget(target, target, method);
  85292. if (target.nodeName) {
  85293. Events[method](target, type2, listener);
  85294. } else {
  85295. target[method](type2, listener);
  85296. }
  85297. };
  85298. var EventedMixin = {
  85299. on: function on2() {
  85300. var _this = this;
  85301. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  85302. args[_key] = arguments[_key];
  85303. }
  85304. var _normalizeListenArgs = normalizeListenArgs(this, args, "on"), isTargetingSelf = _normalizeListenArgs.isTargetingSelf, target = _normalizeListenArgs.target, type2 = _normalizeListenArgs.type, listener = _normalizeListenArgs.listener;
  85305. listen(target, "on", type2, listener);
  85306. if (!isTargetingSelf) {
  85307. var removeListenerOnDispose = function removeListenerOnDispose2() {
  85308. return _this.off(target, type2, listener);
  85309. };
  85310. removeListenerOnDispose.guid = listener.guid;
  85311. var removeRemoverOnTargetDispose = function removeRemoverOnTargetDispose2() {
  85312. return _this.off("dispose", removeListenerOnDispose);
  85313. };
  85314. removeRemoverOnTargetDispose.guid = listener.guid;
  85315. listen(this, "on", "dispose", removeListenerOnDispose);
  85316. listen(target, "on", "dispose", removeRemoverOnTargetDispose);
  85317. }
  85318. },
  85319. one: function one2() {
  85320. var _this2 = this;
  85321. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  85322. args[_key2] = arguments[_key2];
  85323. }
  85324. var _normalizeListenArgs2 = normalizeListenArgs(this, args, "one"), isTargetingSelf = _normalizeListenArgs2.isTargetingSelf, target = _normalizeListenArgs2.target, type2 = _normalizeListenArgs2.type, listener = _normalizeListenArgs2.listener;
  85325. if (isTargetingSelf) {
  85326. listen(target, "one", type2, listener);
  85327. } else {
  85328. var wrapper = function wrapper2() {
  85329. _this2.off(target, type2, wrapper2);
  85330. for (var _len3 = arguments.length, largs = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
  85331. largs[_key3] = arguments[_key3];
  85332. }
  85333. listener.apply(null, largs);
  85334. };
  85335. wrapper.guid = listener.guid;
  85336. listen(target, "one", type2, wrapper);
  85337. }
  85338. },
  85339. any: function any2() {
  85340. var _this3 = this;
  85341. for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
  85342. args[_key4] = arguments[_key4];
  85343. }
  85344. var _normalizeListenArgs3 = normalizeListenArgs(this, args, "any"), isTargetingSelf = _normalizeListenArgs3.isTargetingSelf, target = _normalizeListenArgs3.target, type2 = _normalizeListenArgs3.type, listener = _normalizeListenArgs3.listener;
  85345. if (isTargetingSelf) {
  85346. listen(target, "any", type2, listener);
  85347. } else {
  85348. var wrapper = function wrapper2() {
  85349. _this3.off(target, type2, wrapper2);
  85350. for (var _len5 = arguments.length, largs = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
  85351. largs[_key5] = arguments[_key5];
  85352. }
  85353. listener.apply(null, largs);
  85354. };
  85355. wrapper.guid = listener.guid;
  85356. listen(target, "any", type2, wrapper);
  85357. }
  85358. },
  85359. off: function off$12(targetOrType, typeOrListener, listener) {
  85360. if (!targetOrType || isValidEventType(targetOrType)) {
  85361. off(this.eventBusEl_, targetOrType, typeOrListener);
  85362. } else {
  85363. var target = targetOrType;
  85364. var type2 = typeOrListener;
  85365. validateTarget(target, this, "off");
  85366. validateEventType(type2, this, "off");
  85367. validateListener(listener, this, "off");
  85368. listener = bind(this, listener);
  85369. this.off("dispose", listener);
  85370. if (target.nodeName) {
  85371. off(target, type2, listener);
  85372. off(target, "dispose", listener);
  85373. } else if (isEvented(target)) {
  85374. target.off(type2, listener);
  85375. target.off("dispose", listener);
  85376. }
  85377. }
  85378. },
  85379. trigger: function trigger$12(event2, hash) {
  85380. validateTarget(this.eventBusEl_, this, "trigger");
  85381. var type2 = event2 && typeof event2 !== "string" ? event2.type : event2;
  85382. if (!isValidEventType(type2)) {
  85383. var error = "Invalid event type for " + objName(this) + "#trigger; must be a non-empty string or object with a type key that has a non-empty value.";
  85384. if (event2) {
  85385. (this.log || log$1).error(error);
  85386. } else {
  85387. throw new Error(error);
  85388. }
  85389. }
  85390. return trigger(this.eventBusEl_, event2, hash);
  85391. }
  85392. };
  85393. function evented(target, options2) {
  85394. if (options2 === void 0) {
  85395. options2 = {};
  85396. }
  85397. var _options = options2, eventBusKey = _options.eventBusKey;
  85398. if (eventBusKey) {
  85399. if (!target[eventBusKey].nodeName) {
  85400. throw new Error('The eventBusKey "' + eventBusKey + '" does not refer to an element.');
  85401. }
  85402. target.eventBusEl_ = target[eventBusKey];
  85403. } else {
  85404. target.eventBusEl_ = createEl("span", {
  85405. className: "vjs-event-bus"
  85406. });
  85407. }
  85408. assign(target, EventedMixin);
  85409. if (target.eventedCallbacks) {
  85410. target.eventedCallbacks.forEach(function(callback2) {
  85411. callback2();
  85412. });
  85413. }
  85414. target.on("dispose", function() {
  85415. target.off();
  85416. [target, target.el_, target.eventBusEl_].forEach(function(val) {
  85417. if (val && DomData.has(val)) {
  85418. DomData["delete"](val);
  85419. }
  85420. });
  85421. window_1.setTimeout(function() {
  85422. target.eventBusEl_ = null;
  85423. }, 0);
  85424. });
  85425. return target;
  85426. }
  85427. var StatefulMixin = {
  85428. state: {},
  85429. setState: function setState(stateUpdates) {
  85430. var _this = this;
  85431. if (typeof stateUpdates === "function") {
  85432. stateUpdates = stateUpdates();
  85433. }
  85434. var changes;
  85435. each(stateUpdates, function(value, key) {
  85436. if (_this.state[key] !== value) {
  85437. changes = changes || {};
  85438. changes[key] = {
  85439. from: _this.state[key],
  85440. to: value
  85441. };
  85442. }
  85443. _this.state[key] = value;
  85444. });
  85445. if (changes && isEvented(this)) {
  85446. this.trigger({
  85447. changes,
  85448. type: "statechanged"
  85449. });
  85450. }
  85451. return changes;
  85452. }
  85453. };
  85454. function stateful(target, defaultState) {
  85455. assign(target, StatefulMixin);
  85456. target.state = assign({}, target.state, defaultState);
  85457. if (typeof target.handleStateChanged === "function" && isEvented(target)) {
  85458. target.on("statechanged", target.handleStateChanged);
  85459. }
  85460. return target;
  85461. }
  85462. var toLowerCase = function toLowerCase2(string) {
  85463. if (typeof string !== "string") {
  85464. return string;
  85465. }
  85466. return string.replace(/./, function(w) {
  85467. return w.toLowerCase();
  85468. });
  85469. };
  85470. var toTitleCase$1 = function toTitleCase(string) {
  85471. if (typeof string !== "string") {
  85472. return string;
  85473. }
  85474. return string.replace(/./, function(w) {
  85475. return w.toUpperCase();
  85476. });
  85477. };
  85478. var titleCaseEquals = function titleCaseEquals2(str1, str2) {
  85479. return toTitleCase$1(str1) === toTitleCase$1(str2);
  85480. };
  85481. function mergeOptions$3() {
  85482. var result = {};
  85483. for (var _len = arguments.length, sources = new Array(_len), _key = 0; _key < _len; _key++) {
  85484. sources[_key] = arguments[_key];
  85485. }
  85486. sources.forEach(function(source) {
  85487. if (!source) {
  85488. return;
  85489. }
  85490. each(source, function(value, key) {
  85491. if (!isPlain(value)) {
  85492. result[key] = value;
  85493. return;
  85494. }
  85495. if (!isPlain(result[key])) {
  85496. result[key] = {};
  85497. }
  85498. result[key] = mergeOptions$3(result[key], value);
  85499. });
  85500. });
  85501. return result;
  85502. }
  85503. var MapSham = /* @__PURE__ */ function() {
  85504. function MapSham2() {
  85505. this.map_ = {};
  85506. }
  85507. var _proto = MapSham2.prototype;
  85508. _proto.has = function has(key) {
  85509. return key in this.map_;
  85510. };
  85511. _proto["delete"] = function _delete(key) {
  85512. var has = this.has(key);
  85513. delete this.map_[key];
  85514. return has;
  85515. };
  85516. _proto.set = function set4(key, value) {
  85517. this.map_[key] = value;
  85518. return this;
  85519. };
  85520. _proto.forEach = function forEach(callback2, thisArg) {
  85521. for (var key in this.map_) {
  85522. callback2.call(thisArg, this.map_[key], key, this);
  85523. }
  85524. };
  85525. return MapSham2;
  85526. }();
  85527. var Map$1 = window_1.Map ? window_1.Map : MapSham;
  85528. var SetSham = /* @__PURE__ */ function() {
  85529. function SetSham2() {
  85530. this.set_ = {};
  85531. }
  85532. var _proto = SetSham2.prototype;
  85533. _proto.has = function has(key) {
  85534. return key in this.set_;
  85535. };
  85536. _proto["delete"] = function _delete(key) {
  85537. var has = this.has(key);
  85538. delete this.set_[key];
  85539. return has;
  85540. };
  85541. _proto.add = function add(key) {
  85542. this.set_[key] = 1;
  85543. return this;
  85544. };
  85545. _proto.forEach = function forEach(callback2, thisArg) {
  85546. for (var key in this.set_) {
  85547. callback2.call(thisArg, key, key, this);
  85548. }
  85549. };
  85550. return SetSham2;
  85551. }();
  85552. var Set$1 = window_1.Set ? window_1.Set : SetSham;
  85553. var Component$1 = /* @__PURE__ */ function() {
  85554. function Component2(player, options2, ready) {
  85555. var _this = this;
  85556. if (!player && this.play) {
  85557. this.player_ = player = this;
  85558. } else {
  85559. this.player_ = player;
  85560. }
  85561. this.isDisposed_ = false;
  85562. this.parentComponent_ = null;
  85563. this.options_ = mergeOptions$3({}, this.options_);
  85564. options2 = this.options_ = mergeOptions$3(this.options_, options2);
  85565. this.id_ = options2.id || options2.el && options2.el.id;
  85566. if (!this.id_) {
  85567. var id = player && player.id && player.id() || "no_player";
  85568. this.id_ = id + "_component_" + newGUID();
  85569. }
  85570. this.name_ = options2.name || null;
  85571. if (options2.el) {
  85572. this.el_ = options2.el;
  85573. } else if (options2.createEl !== false) {
  85574. this.el_ = this.createEl();
  85575. }
  85576. if (options2.className && this.el_) {
  85577. options2.className.split(" ").forEach(function(c) {
  85578. return _this.addClass(c);
  85579. });
  85580. }
  85581. if (options2.evented !== false) {
  85582. evented(this, {
  85583. eventBusKey: this.el_ ? "el_" : null
  85584. });
  85585. this.handleLanguagechange = this.handleLanguagechange.bind(this);
  85586. this.on(this.player_, "languagechange", this.handleLanguagechange);
  85587. }
  85588. stateful(this, this.constructor.defaultState);
  85589. this.children_ = [];
  85590. this.childIndex_ = {};
  85591. this.childNameIndex_ = {};
  85592. this.setTimeoutIds_ = new Set$1();
  85593. this.setIntervalIds_ = new Set$1();
  85594. this.rafIds_ = new Set$1();
  85595. this.namedRafs_ = new Map$1();
  85596. this.clearingTimersOnDispose_ = false;
  85597. if (options2.initChildren !== false) {
  85598. this.initChildren();
  85599. }
  85600. this.ready(ready);
  85601. if (options2.reportTouchActivity !== false) {
  85602. this.enableTouchActivity();
  85603. }
  85604. }
  85605. var _proto = Component2.prototype;
  85606. _proto.dispose = function dispose(options2) {
  85607. if (options2 === void 0) {
  85608. options2 = {};
  85609. }
  85610. if (this.isDisposed_) {
  85611. return;
  85612. }
  85613. if (this.readyQueue_) {
  85614. this.readyQueue_.length = 0;
  85615. }
  85616. this.trigger({
  85617. type: "dispose",
  85618. bubbles: false
  85619. });
  85620. this.isDisposed_ = true;
  85621. if (this.children_) {
  85622. for (var i2 = this.children_.length - 1; i2 >= 0; i2--) {
  85623. if (this.children_[i2].dispose) {
  85624. this.children_[i2].dispose();
  85625. }
  85626. }
  85627. }
  85628. this.children_ = null;
  85629. this.childIndex_ = null;
  85630. this.childNameIndex_ = null;
  85631. this.parentComponent_ = null;
  85632. if (this.el_) {
  85633. if (this.el_.parentNode) {
  85634. if (options2.restoreEl) {
  85635. this.el_.parentNode.replaceChild(options2.restoreEl, this.el_);
  85636. } else {
  85637. this.el_.parentNode.removeChild(this.el_);
  85638. }
  85639. }
  85640. this.el_ = null;
  85641. }
  85642. this.player_ = null;
  85643. };
  85644. _proto.isDisposed = function isDisposed() {
  85645. return Boolean(this.isDisposed_);
  85646. };
  85647. _proto.player = function player() {
  85648. return this.player_;
  85649. };
  85650. _proto.options = function options2(obj) {
  85651. if (!obj) {
  85652. return this.options_;
  85653. }
  85654. this.options_ = mergeOptions$3(this.options_, obj);
  85655. return this.options_;
  85656. };
  85657. _proto.el = function el() {
  85658. return this.el_;
  85659. };
  85660. _proto.createEl = function createEl$12(tagName, properties, attributes) {
  85661. return createEl(tagName, properties, attributes);
  85662. };
  85663. _proto.localize = function localize(string, tokens, defaultValue2) {
  85664. if (defaultValue2 === void 0) {
  85665. defaultValue2 = string;
  85666. }
  85667. var code = this.player_.language && this.player_.language();
  85668. var languages = this.player_.languages && this.player_.languages();
  85669. var language = languages && languages[code];
  85670. var primaryCode = code && code.split("-")[0];
  85671. var primaryLang = languages && languages[primaryCode];
  85672. var localizedString = defaultValue2;
  85673. if (language && language[string]) {
  85674. localizedString = language[string];
  85675. } else if (primaryLang && primaryLang[string]) {
  85676. localizedString = primaryLang[string];
  85677. }
  85678. if (tokens) {
  85679. localizedString = localizedString.replace(/\{(\d+)\}/g, function(match, index2) {
  85680. var value = tokens[index2 - 1];
  85681. var ret = value;
  85682. if (typeof value === "undefined") {
  85683. ret = match;
  85684. }
  85685. return ret;
  85686. });
  85687. }
  85688. return localizedString;
  85689. };
  85690. _proto.handleLanguagechange = function handleLanguagechange() {
  85691. };
  85692. _proto.contentEl = function contentEl() {
  85693. return this.contentEl_ || this.el_;
  85694. };
  85695. _proto.id = function id() {
  85696. return this.id_;
  85697. };
  85698. _proto.name = function name() {
  85699. return this.name_;
  85700. };
  85701. _proto.children = function children() {
  85702. return this.children_;
  85703. };
  85704. _proto.getChildById = function getChildById(id) {
  85705. return this.childIndex_[id];
  85706. };
  85707. _proto.getChild = function getChild(name) {
  85708. if (!name) {
  85709. return;
  85710. }
  85711. return this.childNameIndex_[name];
  85712. };
  85713. _proto.getDescendant = function getDescendant() {
  85714. for (var _len = arguments.length, names2 = new Array(_len), _key = 0; _key < _len; _key++) {
  85715. names2[_key] = arguments[_key];
  85716. }
  85717. names2 = names2.reduce(function(acc, n) {
  85718. return acc.concat(n);
  85719. }, []);
  85720. var currentChild = this;
  85721. for (var i2 = 0; i2 < names2.length; i2++) {
  85722. currentChild = currentChild.getChild(names2[i2]);
  85723. if (!currentChild || !currentChild.getChild) {
  85724. return;
  85725. }
  85726. }
  85727. return currentChild;
  85728. };
  85729. _proto.addChild = function addChild(child, options2, index2) {
  85730. if (options2 === void 0) {
  85731. options2 = {};
  85732. }
  85733. if (index2 === void 0) {
  85734. index2 = this.children_.length;
  85735. }
  85736. var component;
  85737. var componentName;
  85738. if (typeof child === "string") {
  85739. componentName = toTitleCase$1(child);
  85740. var componentClassName = options2.componentClass || componentName;
  85741. options2.name = componentName;
  85742. var ComponentClass = Component2.getComponent(componentClassName);
  85743. if (!ComponentClass) {
  85744. throw new Error("Component " + componentClassName + " does not exist");
  85745. }
  85746. if (typeof ComponentClass !== "function") {
  85747. return null;
  85748. }
  85749. component = new ComponentClass(this.player_ || this, options2);
  85750. } else {
  85751. component = child;
  85752. }
  85753. if (component.parentComponent_) {
  85754. component.parentComponent_.removeChild(component);
  85755. }
  85756. this.children_.splice(index2, 0, component);
  85757. component.parentComponent_ = this;
  85758. if (typeof component.id === "function") {
  85759. this.childIndex_[component.id()] = component;
  85760. }
  85761. componentName = componentName || component.name && toTitleCase$1(component.name());
  85762. if (componentName) {
  85763. this.childNameIndex_[componentName] = component;
  85764. this.childNameIndex_[toLowerCase(componentName)] = component;
  85765. }
  85766. if (typeof component.el === "function" && component.el()) {
  85767. var refNode = null;
  85768. if (this.children_[index2 + 1]) {
  85769. if (this.children_[index2 + 1].el_) {
  85770. refNode = this.children_[index2 + 1].el_;
  85771. } else if (isEl(this.children_[index2 + 1])) {
  85772. refNode = this.children_[index2 + 1];
  85773. }
  85774. }
  85775. this.contentEl().insertBefore(component.el(), refNode);
  85776. }
  85777. return component;
  85778. };
  85779. _proto.removeChild = function removeChild(component) {
  85780. if (typeof component === "string") {
  85781. component = this.getChild(component);
  85782. }
  85783. if (!component || !this.children_) {
  85784. return;
  85785. }
  85786. var childFound = false;
  85787. for (var i2 = this.children_.length - 1; i2 >= 0; i2--) {
  85788. if (this.children_[i2] === component) {
  85789. childFound = true;
  85790. this.children_.splice(i2, 1);
  85791. break;
  85792. }
  85793. }
  85794. if (!childFound) {
  85795. return;
  85796. }
  85797. component.parentComponent_ = null;
  85798. this.childIndex_[component.id()] = null;
  85799. this.childNameIndex_[toTitleCase$1(component.name())] = null;
  85800. this.childNameIndex_[toLowerCase(component.name())] = null;
  85801. var compEl = component.el();
  85802. if (compEl && compEl.parentNode === this.contentEl()) {
  85803. this.contentEl().removeChild(component.el());
  85804. }
  85805. };
  85806. _proto.initChildren = function initChildren() {
  85807. var _this2 = this;
  85808. var children = this.options_.children;
  85809. if (children) {
  85810. var parentOptions = this.options_;
  85811. var handleAdd = function handleAdd2(child) {
  85812. var name = child.name;
  85813. var opts = child.opts;
  85814. if (parentOptions[name] !== void 0) {
  85815. opts = parentOptions[name];
  85816. }
  85817. if (opts === false) {
  85818. return;
  85819. }
  85820. if (opts === true) {
  85821. opts = {};
  85822. }
  85823. opts.playerOptions = _this2.options_.playerOptions;
  85824. var newChild = _this2.addChild(name, opts);
  85825. if (newChild) {
  85826. _this2[name] = newChild;
  85827. }
  85828. };
  85829. var workingChildren;
  85830. var Tech2 = Component2.getComponent("Tech");
  85831. if (Array.isArray(children)) {
  85832. workingChildren = children;
  85833. } else {
  85834. workingChildren = Object.keys(children);
  85835. }
  85836. workingChildren.concat(Object.keys(this.options_).filter(function(child) {
  85837. return !workingChildren.some(function(wchild) {
  85838. if (typeof wchild === "string") {
  85839. return child === wchild;
  85840. }
  85841. return child === wchild.name;
  85842. });
  85843. })).map(function(child) {
  85844. var name;
  85845. var opts;
  85846. if (typeof child === "string") {
  85847. name = child;
  85848. opts = children[name] || _this2.options_[name] || {};
  85849. } else {
  85850. name = child.name;
  85851. opts = child;
  85852. }
  85853. return {
  85854. name,
  85855. opts
  85856. };
  85857. }).filter(function(child) {
  85858. var c = Component2.getComponent(child.opts.componentClass || toTitleCase$1(child.name));
  85859. return c && !Tech2.isTech(c);
  85860. }).forEach(handleAdd);
  85861. }
  85862. };
  85863. _proto.buildCSSClass = function buildCSSClass() {
  85864. return "";
  85865. };
  85866. _proto.ready = function ready(fn2, sync) {
  85867. if (sync === void 0) {
  85868. sync = false;
  85869. }
  85870. if (!fn2) {
  85871. return;
  85872. }
  85873. if (!this.isReady_) {
  85874. this.readyQueue_ = this.readyQueue_ || [];
  85875. this.readyQueue_.push(fn2);
  85876. return;
  85877. }
  85878. if (sync) {
  85879. fn2.call(this);
  85880. } else {
  85881. this.setTimeout(fn2, 1);
  85882. }
  85883. };
  85884. _proto.triggerReady = function triggerReady() {
  85885. this.isReady_ = true;
  85886. this.setTimeout(function() {
  85887. var readyQueue = this.readyQueue_;
  85888. this.readyQueue_ = [];
  85889. if (readyQueue && readyQueue.length > 0) {
  85890. readyQueue.forEach(function(fn2) {
  85891. fn2.call(this);
  85892. }, this);
  85893. }
  85894. this.trigger("ready");
  85895. }, 1);
  85896. };
  85897. _proto.$ = function $$12(selector, context) {
  85898. return $(selector, context || this.contentEl());
  85899. };
  85900. _proto.$$ = function $$$12(selector, context) {
  85901. return $$(selector, context || this.contentEl());
  85902. };
  85903. _proto.hasClass = function hasClass$12(classToCheck) {
  85904. return hasClass(this.el_, classToCheck);
  85905. };
  85906. _proto.addClass = function addClass$12(classToAdd) {
  85907. addClass(this.el_, classToAdd);
  85908. };
  85909. _proto.removeClass = function removeClass$12(classToRemove) {
  85910. removeClass(this.el_, classToRemove);
  85911. };
  85912. _proto.toggleClass = function toggleClass$12(classToToggle, predicate) {
  85913. toggleClass(this.el_, classToToggle, predicate);
  85914. };
  85915. _proto.show = function show() {
  85916. this.removeClass("vjs-hidden");
  85917. };
  85918. _proto.hide = function hide() {
  85919. this.addClass("vjs-hidden");
  85920. };
  85921. _proto.lockShowing = function lockShowing() {
  85922. this.addClass("vjs-lock-showing");
  85923. };
  85924. _proto.unlockShowing = function unlockShowing() {
  85925. this.removeClass("vjs-lock-showing");
  85926. };
  85927. _proto.getAttribute = function getAttribute$12(attribute) {
  85928. return getAttribute(this.el_, attribute);
  85929. };
  85930. _proto.setAttribute = function setAttribute$12(attribute, value) {
  85931. setAttribute(this.el_, attribute, value);
  85932. };
  85933. _proto.removeAttribute = function removeAttribute$12(attribute) {
  85934. removeAttribute(this.el_, attribute);
  85935. };
  85936. _proto.width = function width2(num, skipListeners) {
  85937. return this.dimension("width", num, skipListeners);
  85938. };
  85939. _proto.height = function height2(num, skipListeners) {
  85940. return this.dimension("height", num, skipListeners);
  85941. };
  85942. _proto.dimensions = function dimensions(width2, height2) {
  85943. this.width(width2, true);
  85944. this.height(height2);
  85945. };
  85946. _proto.dimension = function dimension(widthOrHeight, num, skipListeners) {
  85947. if (num !== void 0) {
  85948. if (num === null || num !== num) {
  85949. num = 0;
  85950. }
  85951. if (("" + num).indexOf("%") !== -1 || ("" + num).indexOf("px") !== -1) {
  85952. this.el_.style[widthOrHeight] = num;
  85953. } else if (num === "auto") {
  85954. this.el_.style[widthOrHeight] = "";
  85955. } else {
  85956. this.el_.style[widthOrHeight] = num + "px";
  85957. }
  85958. if (!skipListeners) {
  85959. this.trigger("componentresize");
  85960. }
  85961. return;
  85962. }
  85963. if (!this.el_) {
  85964. return 0;
  85965. }
  85966. var val = this.el_.style[widthOrHeight];
  85967. var pxIndex = val.indexOf("px");
  85968. if (pxIndex !== -1) {
  85969. return parseInt(val.slice(0, pxIndex), 10);
  85970. }
  85971. return parseInt(this.el_["offset" + toTitleCase$1(widthOrHeight)], 10);
  85972. };
  85973. _proto.currentDimension = function currentDimension(widthOrHeight) {
  85974. var computedWidthOrHeight = 0;
  85975. if (widthOrHeight !== "width" && widthOrHeight !== "height") {
  85976. throw new Error("currentDimension only accepts width or height value");
  85977. }
  85978. computedWidthOrHeight = computedStyle(this.el_, widthOrHeight);
  85979. computedWidthOrHeight = parseFloat(computedWidthOrHeight);
  85980. if (computedWidthOrHeight === 0 || isNaN(computedWidthOrHeight)) {
  85981. var rule = "offset" + toTitleCase$1(widthOrHeight);
  85982. computedWidthOrHeight = this.el_[rule];
  85983. }
  85984. return computedWidthOrHeight;
  85985. };
  85986. _proto.currentDimensions = function currentDimensions() {
  85987. return {
  85988. width: this.currentDimension("width"),
  85989. height: this.currentDimension("height")
  85990. };
  85991. };
  85992. _proto.currentWidth = function currentWidth() {
  85993. return this.currentDimension("width");
  85994. };
  85995. _proto.currentHeight = function currentHeight() {
  85996. return this.currentDimension("height");
  85997. };
  85998. _proto.focus = function focus() {
  85999. this.el_.focus();
  86000. };
  86001. _proto.blur = function blur() {
  86002. this.el_.blur();
  86003. };
  86004. _proto.handleKeyDown = function handleKeyDown(event2) {
  86005. if (this.player_) {
  86006. if (!keycode.isEventKey(event2, "Tab")) {
  86007. event2.stopPropagation();
  86008. }
  86009. this.player_.handleKeyDown(event2);
  86010. }
  86011. };
  86012. _proto.handleKeyPress = function handleKeyPress(event2) {
  86013. this.handleKeyDown(event2);
  86014. };
  86015. _proto.emitTapEvents = function emitTapEvents() {
  86016. var touchStart = 0;
  86017. var firstTouch = null;
  86018. var tapMovementThreshold = 10;
  86019. var touchTimeThreshold = 200;
  86020. var couldBeTap;
  86021. this.on("touchstart", function(event2) {
  86022. if (event2.touches.length === 1) {
  86023. firstTouch = {
  86024. pageX: event2.touches[0].pageX,
  86025. pageY: event2.touches[0].pageY
  86026. };
  86027. touchStart = window_1.performance.now();
  86028. couldBeTap = true;
  86029. }
  86030. });
  86031. this.on("touchmove", function(event2) {
  86032. if (event2.touches.length > 1) {
  86033. couldBeTap = false;
  86034. } else if (firstTouch) {
  86035. var xdiff = event2.touches[0].pageX - firstTouch.pageX;
  86036. var ydiff = event2.touches[0].pageY - firstTouch.pageY;
  86037. var touchDistance = Math.sqrt(xdiff * xdiff + ydiff * ydiff);
  86038. if (touchDistance > tapMovementThreshold) {
  86039. couldBeTap = false;
  86040. }
  86041. }
  86042. });
  86043. var noTap = function noTap2() {
  86044. couldBeTap = false;
  86045. };
  86046. this.on("touchleave", noTap);
  86047. this.on("touchcancel", noTap);
  86048. this.on("touchend", function(event2) {
  86049. firstTouch = null;
  86050. if (couldBeTap === true) {
  86051. var touchTime = window_1.performance.now() - touchStart;
  86052. if (touchTime < touchTimeThreshold) {
  86053. event2.preventDefault();
  86054. this.trigger("tap");
  86055. }
  86056. }
  86057. });
  86058. };
  86059. _proto.enableTouchActivity = function enableTouchActivity() {
  86060. if (!this.player() || !this.player().reportUserActivity) {
  86061. return;
  86062. }
  86063. var report = bind(this.player(), this.player().reportUserActivity);
  86064. var touchHolding;
  86065. this.on("touchstart", function() {
  86066. report();
  86067. this.clearInterval(touchHolding);
  86068. touchHolding = this.setInterval(report, 250);
  86069. });
  86070. var touchEnd = function touchEnd2(event2) {
  86071. report();
  86072. this.clearInterval(touchHolding);
  86073. };
  86074. this.on("touchmove", report);
  86075. this.on("touchend", touchEnd);
  86076. this.on("touchcancel", touchEnd);
  86077. };
  86078. _proto.setTimeout = function setTimeout2(fn2, timeout) {
  86079. var _this3 = this;
  86080. var timeoutId;
  86081. fn2 = bind(this, fn2);
  86082. this.clearTimersOnDispose_();
  86083. timeoutId = window_1.setTimeout(function() {
  86084. if (_this3.setTimeoutIds_.has(timeoutId)) {
  86085. _this3.setTimeoutIds_["delete"](timeoutId);
  86086. }
  86087. fn2();
  86088. }, timeout);
  86089. this.setTimeoutIds_.add(timeoutId);
  86090. return timeoutId;
  86091. };
  86092. _proto.clearTimeout = function clearTimeout2(timeoutId) {
  86093. if (this.setTimeoutIds_.has(timeoutId)) {
  86094. this.setTimeoutIds_["delete"](timeoutId);
  86095. window_1.clearTimeout(timeoutId);
  86096. }
  86097. return timeoutId;
  86098. };
  86099. _proto.setInterval = function setInterval2(fn2, interval) {
  86100. fn2 = bind(this, fn2);
  86101. this.clearTimersOnDispose_();
  86102. var intervalId = window_1.setInterval(fn2, interval);
  86103. this.setIntervalIds_.add(intervalId);
  86104. return intervalId;
  86105. };
  86106. _proto.clearInterval = function clearInterval2(intervalId) {
  86107. if (this.setIntervalIds_.has(intervalId)) {
  86108. this.setIntervalIds_["delete"](intervalId);
  86109. window_1.clearInterval(intervalId);
  86110. }
  86111. return intervalId;
  86112. };
  86113. _proto.requestAnimationFrame = function requestAnimationFrame(fn2) {
  86114. var _this4 = this;
  86115. if (!this.supportsRaf_) {
  86116. return this.setTimeout(fn2, 1e3 / 60);
  86117. }
  86118. this.clearTimersOnDispose_();
  86119. var id;
  86120. fn2 = bind(this, fn2);
  86121. id = window_1.requestAnimationFrame(function() {
  86122. if (_this4.rafIds_.has(id)) {
  86123. _this4.rafIds_["delete"](id);
  86124. }
  86125. fn2();
  86126. });
  86127. this.rafIds_.add(id);
  86128. return id;
  86129. };
  86130. _proto.requestNamedAnimationFrame = function requestNamedAnimationFrame(name, fn2) {
  86131. var _this5 = this;
  86132. if (this.namedRafs_.has(name)) {
  86133. return;
  86134. }
  86135. this.clearTimersOnDispose_();
  86136. fn2 = bind(this, fn2);
  86137. var id = this.requestAnimationFrame(function() {
  86138. fn2();
  86139. if (_this5.namedRafs_.has(name)) {
  86140. _this5.namedRafs_["delete"](name);
  86141. }
  86142. });
  86143. this.namedRafs_.set(name, id);
  86144. return name;
  86145. };
  86146. _proto.cancelNamedAnimationFrame = function cancelNamedAnimationFrame(name) {
  86147. if (!this.namedRafs_.has(name)) {
  86148. return;
  86149. }
  86150. this.cancelAnimationFrame(this.namedRafs_.get(name));
  86151. this.namedRafs_["delete"](name);
  86152. };
  86153. _proto.cancelAnimationFrame = function cancelAnimationFrame(id) {
  86154. if (!this.supportsRaf_) {
  86155. return this.clearTimeout(id);
  86156. }
  86157. if (this.rafIds_.has(id)) {
  86158. this.rafIds_["delete"](id);
  86159. window_1.cancelAnimationFrame(id);
  86160. }
  86161. return id;
  86162. };
  86163. _proto.clearTimersOnDispose_ = function clearTimersOnDispose_() {
  86164. var _this6 = this;
  86165. if (this.clearingTimersOnDispose_) {
  86166. return;
  86167. }
  86168. this.clearingTimersOnDispose_ = true;
  86169. this.one("dispose", function() {
  86170. [["namedRafs_", "cancelNamedAnimationFrame"], ["rafIds_", "cancelAnimationFrame"], ["setTimeoutIds_", "clearTimeout"], ["setIntervalIds_", "clearInterval"]].forEach(function(_ref) {
  86171. var idName = _ref[0], cancelName = _ref[1];
  86172. _this6[idName].forEach(function(val, key) {
  86173. return _this6[cancelName](key);
  86174. });
  86175. });
  86176. _this6.clearingTimersOnDispose_ = false;
  86177. });
  86178. };
  86179. Component2.registerComponent = function registerComponent(name, ComponentToRegister) {
  86180. if (typeof name !== "string" || !name) {
  86181. throw new Error('Illegal component name, "' + name + '"; must be a non-empty string.');
  86182. }
  86183. var Tech2 = Component2.getComponent("Tech");
  86184. var isTech = Tech2 && Tech2.isTech(ComponentToRegister);
  86185. var isComp = Component2 === ComponentToRegister || Component2.prototype.isPrototypeOf(ComponentToRegister.prototype);
  86186. if (isTech || !isComp) {
  86187. var reason;
  86188. if (isTech) {
  86189. reason = "techs must be registered using Tech.registerTech()";
  86190. } else {
  86191. reason = "must be a Component subclass";
  86192. }
  86193. throw new Error('Illegal component, "' + name + '"; ' + reason + ".");
  86194. }
  86195. name = toTitleCase$1(name);
  86196. if (!Component2.components_) {
  86197. Component2.components_ = {};
  86198. }
  86199. var Player2 = Component2.getComponent("Player");
  86200. if (name === "Player" && Player2 && Player2.players) {
  86201. var players = Player2.players;
  86202. var playerNames = Object.keys(players);
  86203. if (players && playerNames.length > 0 && playerNames.map(function(pname) {
  86204. return players[pname];
  86205. }).every(Boolean)) {
  86206. throw new Error("Can not register Player component after player has been created.");
  86207. }
  86208. }
  86209. Component2.components_[name] = ComponentToRegister;
  86210. Component2.components_[toLowerCase(name)] = ComponentToRegister;
  86211. return ComponentToRegister;
  86212. };
  86213. Component2.getComponent = function getComponent(name) {
  86214. if (!name || !Component2.components_) {
  86215. return;
  86216. }
  86217. return Component2.components_[name];
  86218. };
  86219. return Component2;
  86220. }();
  86221. Component$1.prototype.supportsRaf_ = typeof window_1.requestAnimationFrame === "function" && typeof window_1.cancelAnimationFrame === "function";
  86222. Component$1.registerComponent("Component", Component$1);
  86223. function rangeCheck(fnName, index2, maxIndex) {
  86224. if (typeof index2 !== "number" || index2 < 0 || index2 > maxIndex) {
  86225. throw new Error("Failed to execute '" + fnName + "' on 'TimeRanges': The index provided (" + index2 + ") is non-numeric or out of bounds (0-" + maxIndex + ").");
  86226. }
  86227. }
  86228. function getRange(fnName, valueIndex, ranges, rangeIndex) {
  86229. rangeCheck(fnName, rangeIndex, ranges.length - 1);
  86230. return ranges[rangeIndex][valueIndex];
  86231. }
  86232. function createTimeRangesObj(ranges) {
  86233. var timeRangesObj;
  86234. if (ranges === void 0 || ranges.length === 0) {
  86235. timeRangesObj = {
  86236. length: 0,
  86237. start: function start2() {
  86238. throw new Error("This TimeRanges object is empty");
  86239. },
  86240. end: function end() {
  86241. throw new Error("This TimeRanges object is empty");
  86242. }
  86243. };
  86244. } else {
  86245. timeRangesObj = {
  86246. length: ranges.length,
  86247. start: getRange.bind(null, "start", 0, ranges),
  86248. end: getRange.bind(null, "end", 1, ranges)
  86249. };
  86250. }
  86251. if (window_1.Symbol && window_1.Symbol.iterator) {
  86252. timeRangesObj[window_1.Symbol.iterator] = function() {
  86253. return (ranges || []).values();
  86254. };
  86255. }
  86256. return timeRangesObj;
  86257. }
  86258. function createTimeRanges(start2, end) {
  86259. if (Array.isArray(start2)) {
  86260. return createTimeRangesObj(start2);
  86261. } else if (start2 === void 0 || end === void 0) {
  86262. return createTimeRangesObj();
  86263. }
  86264. return createTimeRangesObj([[start2, end]]);
  86265. }
  86266. function bufferedPercent(buffered, duration5) {
  86267. var bufferedDuration = 0;
  86268. var start2;
  86269. var end;
  86270. if (!duration5) {
  86271. return 0;
  86272. }
  86273. if (!buffered || !buffered.length) {
  86274. buffered = createTimeRanges(0, 0);
  86275. }
  86276. for (var i2 = 0; i2 < buffered.length; i2++) {
  86277. start2 = buffered.start(i2);
  86278. end = buffered.end(i2);
  86279. if (end > duration5) {
  86280. end = duration5;
  86281. }
  86282. bufferedDuration += end - start2;
  86283. }
  86284. return bufferedDuration / duration5;
  86285. }
  86286. function MediaError(value) {
  86287. if (value instanceof MediaError) {
  86288. return value;
  86289. }
  86290. if (typeof value === "number") {
  86291. this.code = value;
  86292. } else if (typeof value === "string") {
  86293. this.message = value;
  86294. } else if (isObject2(value)) {
  86295. if (typeof value.code === "number") {
  86296. this.code = value.code;
  86297. }
  86298. assign(this, value);
  86299. }
  86300. if (!this.message) {
  86301. this.message = MediaError.defaultMessages[this.code] || "";
  86302. }
  86303. }
  86304. MediaError.prototype.code = 0;
  86305. MediaError.prototype.message = "";
  86306. MediaError.prototype.status = null;
  86307. MediaError.errorTypes = ["MEDIA_ERR_CUSTOM", "MEDIA_ERR_ABORTED", "MEDIA_ERR_NETWORK", "MEDIA_ERR_DECODE", "MEDIA_ERR_SRC_NOT_SUPPORTED", "MEDIA_ERR_ENCRYPTED"];
  86308. MediaError.defaultMessages = {
  86309. 1: "You aborted the media playback",
  86310. 2: "A network error caused the media download to fail part-way.",
  86311. 3: "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",
  86312. 4: "The media could not be loaded, either because the server or network failed or because the format is not supported.",
  86313. 5: "The media is encrypted and we do not have the keys to decrypt it."
  86314. };
  86315. for (var errNum = 0; errNum < MediaError.errorTypes.length; errNum++) {
  86316. MediaError[MediaError.errorTypes[errNum]] = errNum;
  86317. MediaError.prototype[MediaError.errorTypes[errNum]] = errNum;
  86318. }
  86319. function isPromise(value) {
  86320. return value !== void 0 && value !== null && typeof value.then === "function";
  86321. }
  86322. function silencePromise(value) {
  86323. if (isPromise(value)) {
  86324. value.then(null, function(e) {
  86325. });
  86326. }
  86327. }
  86328. var trackToJson_ = function trackToJson_2(track) {
  86329. var ret = ["kind", "label", "language", "id", "inBandMetadataTrackDispatchType", "mode", "src"].reduce(function(acc, prop, i2) {
  86330. if (track[prop]) {
  86331. acc[prop] = track[prop];
  86332. }
  86333. return acc;
  86334. }, {
  86335. cues: track.cues && Array.prototype.map.call(track.cues, function(cue) {
  86336. return {
  86337. startTime: cue.startTime,
  86338. endTime: cue.endTime,
  86339. text: cue.text,
  86340. id: cue.id
  86341. };
  86342. })
  86343. });
  86344. return ret;
  86345. };
  86346. var textTracksToJson = function textTracksToJson2(tech) {
  86347. var trackEls = tech.$$("track");
  86348. var trackObjs = Array.prototype.map.call(trackEls, function(t2) {
  86349. return t2.track;
  86350. });
  86351. var tracks = Array.prototype.map.call(trackEls, function(trackEl) {
  86352. var json = trackToJson_(trackEl.track);
  86353. if (trackEl.src) {
  86354. json.src = trackEl.src;
  86355. }
  86356. return json;
  86357. });
  86358. return tracks.concat(Array.prototype.filter.call(tech.textTracks(), function(track) {
  86359. return trackObjs.indexOf(track) === -1;
  86360. }).map(trackToJson_));
  86361. };
  86362. var jsonToTextTracks = function jsonToTextTracks2(json, tech) {
  86363. json.forEach(function(track) {
  86364. var addedTrack = tech.addRemoteTextTrack(track).track;
  86365. if (!track.src && track.cues) {
  86366. track.cues.forEach(function(cue) {
  86367. return addedTrack.addCue(cue);
  86368. });
  86369. }
  86370. });
  86371. return tech.textTracks();
  86372. };
  86373. var textTrackConverter = {
  86374. textTracksToJson,
  86375. jsonToTextTracks,
  86376. trackToJson_
  86377. };
  86378. var MODAL_CLASS_NAME = "vjs-modal-dialog";
  86379. var ModalDialog = /* @__PURE__ */ function(_Component) {
  86380. _inheritsLoose(ModalDialog2, _Component);
  86381. function ModalDialog2(player, options2) {
  86382. var _this;
  86383. _this = _Component.call(this, player, options2) || this;
  86384. _this.handleKeyDown_ = function(e) {
  86385. return _this.handleKeyDown(e);
  86386. };
  86387. _this.close_ = function(e) {
  86388. return _this.close(e);
  86389. };
  86390. _this.opened_ = _this.hasBeenOpened_ = _this.hasBeenFilled_ = false;
  86391. _this.closeable(!_this.options_.uncloseable);
  86392. _this.content(_this.options_.content);
  86393. _this.contentEl_ = createEl("div", {
  86394. className: MODAL_CLASS_NAME + "-content"
  86395. }, {
  86396. role: "document"
  86397. });
  86398. _this.descEl_ = createEl("p", {
  86399. className: MODAL_CLASS_NAME + "-description vjs-control-text",
  86400. id: _this.el().getAttribute("aria-describedby")
  86401. });
  86402. textContent(_this.descEl_, _this.description());
  86403. _this.el_.appendChild(_this.descEl_);
  86404. _this.el_.appendChild(_this.contentEl_);
  86405. return _this;
  86406. }
  86407. var _proto = ModalDialog2.prototype;
  86408. _proto.createEl = function createEl2() {
  86409. return _Component.prototype.createEl.call(this, "div", {
  86410. className: this.buildCSSClass(),
  86411. tabIndex: -1
  86412. }, {
  86413. "aria-describedby": this.id() + "_description",
  86414. "aria-hidden": "true",
  86415. "aria-label": this.label(),
  86416. "role": "dialog"
  86417. });
  86418. };
  86419. _proto.dispose = function dispose() {
  86420. this.contentEl_ = null;
  86421. this.descEl_ = null;
  86422. this.previouslyActiveEl_ = null;
  86423. _Component.prototype.dispose.call(this);
  86424. };
  86425. _proto.buildCSSClass = function buildCSSClass() {
  86426. return MODAL_CLASS_NAME + " vjs-hidden " + _Component.prototype.buildCSSClass.call(this);
  86427. };
  86428. _proto.label = function label() {
  86429. return this.localize(this.options_.label || "Modal Window");
  86430. };
  86431. _proto.description = function description() {
  86432. var desc = this.options_.description || this.localize("This is a modal window.");
  86433. if (this.closeable()) {
  86434. desc += " " + this.localize("This modal can be closed by pressing the Escape key or activating the close button.");
  86435. }
  86436. return desc;
  86437. };
  86438. _proto.open = function open() {
  86439. if (!this.opened_) {
  86440. var player = this.player();
  86441. this.trigger("beforemodalopen");
  86442. this.opened_ = true;
  86443. if (this.options_.fillAlways || !this.hasBeenOpened_ && !this.hasBeenFilled_) {
  86444. this.fill();
  86445. }
  86446. this.wasPlaying_ = !player.paused();
  86447. if (this.options_.pauseOnOpen && this.wasPlaying_) {
  86448. player.pause();
  86449. }
  86450. this.on("keydown", this.handleKeyDown_);
  86451. this.hadControls_ = player.controls();
  86452. player.controls(false);
  86453. this.show();
  86454. this.conditionalFocus_();
  86455. this.el().setAttribute("aria-hidden", "false");
  86456. this.trigger("modalopen");
  86457. this.hasBeenOpened_ = true;
  86458. }
  86459. };
  86460. _proto.opened = function opened(value) {
  86461. if (typeof value === "boolean") {
  86462. this[value ? "open" : "close"]();
  86463. }
  86464. return this.opened_;
  86465. };
  86466. _proto.close = function close() {
  86467. if (!this.opened_) {
  86468. return;
  86469. }
  86470. var player = this.player();
  86471. this.trigger("beforemodalclose");
  86472. this.opened_ = false;
  86473. if (this.wasPlaying_ && this.options_.pauseOnOpen) {
  86474. player.play();
  86475. }
  86476. this.off("keydown", this.handleKeyDown_);
  86477. if (this.hadControls_) {
  86478. player.controls(true);
  86479. }
  86480. this.hide();
  86481. this.el().setAttribute("aria-hidden", "true");
  86482. this.trigger("modalclose");
  86483. this.conditionalBlur_();
  86484. if (this.options_.temporary) {
  86485. this.dispose();
  86486. }
  86487. };
  86488. _proto.closeable = function closeable(value) {
  86489. if (typeof value === "boolean") {
  86490. var closeable2 = this.closeable_ = !!value;
  86491. var close = this.getChild("closeButton");
  86492. if (closeable2 && !close) {
  86493. var temp = this.contentEl_;
  86494. this.contentEl_ = this.el_;
  86495. close = this.addChild("closeButton", {
  86496. controlText: "Close Modal Dialog"
  86497. });
  86498. this.contentEl_ = temp;
  86499. this.on(close, "close", this.close_);
  86500. }
  86501. if (!closeable2 && close) {
  86502. this.off(close, "close", this.close_);
  86503. this.removeChild(close);
  86504. close.dispose();
  86505. }
  86506. }
  86507. return this.closeable_;
  86508. };
  86509. _proto.fill = function fill() {
  86510. this.fillWith(this.content());
  86511. };
  86512. _proto.fillWith = function fillWith(content) {
  86513. var contentEl = this.contentEl();
  86514. var parentEl = contentEl.parentNode;
  86515. var nextSiblingEl = contentEl.nextSibling;
  86516. this.trigger("beforemodalfill");
  86517. this.hasBeenFilled_ = true;
  86518. parentEl.removeChild(contentEl);
  86519. this.empty();
  86520. insertContent(contentEl, content);
  86521. this.trigger("modalfill");
  86522. if (nextSiblingEl) {
  86523. parentEl.insertBefore(contentEl, nextSiblingEl);
  86524. } else {
  86525. parentEl.appendChild(contentEl);
  86526. }
  86527. var closeButton = this.getChild("closeButton");
  86528. if (closeButton) {
  86529. parentEl.appendChild(closeButton.el_);
  86530. }
  86531. };
  86532. _proto.empty = function empty() {
  86533. this.trigger("beforemodalempty");
  86534. emptyEl(this.contentEl());
  86535. this.trigger("modalempty");
  86536. };
  86537. _proto.content = function content(value) {
  86538. if (typeof value !== "undefined") {
  86539. this.content_ = value;
  86540. }
  86541. return this.content_;
  86542. };
  86543. _proto.conditionalFocus_ = function conditionalFocus_() {
  86544. var activeEl = document_1.activeElement;
  86545. var playerEl = this.player_.el_;
  86546. this.previouslyActiveEl_ = null;
  86547. if (playerEl.contains(activeEl) || playerEl === activeEl) {
  86548. this.previouslyActiveEl_ = activeEl;
  86549. this.focus();
  86550. }
  86551. };
  86552. _proto.conditionalBlur_ = function conditionalBlur_() {
  86553. if (this.previouslyActiveEl_) {
  86554. this.previouslyActiveEl_.focus();
  86555. this.previouslyActiveEl_ = null;
  86556. }
  86557. };
  86558. _proto.handleKeyDown = function handleKeyDown(event2) {
  86559. event2.stopPropagation();
  86560. if (keycode.isEventKey(event2, "Escape") && this.closeable()) {
  86561. event2.preventDefault();
  86562. this.close();
  86563. return;
  86564. }
  86565. if (!keycode.isEventKey(event2, "Tab")) {
  86566. return;
  86567. }
  86568. var focusableEls = this.focusableEls_();
  86569. var activeEl = this.el_.querySelector(":focus");
  86570. var focusIndex;
  86571. for (var i2 = 0; i2 < focusableEls.length; i2++) {
  86572. if (activeEl === focusableEls[i2]) {
  86573. focusIndex = i2;
  86574. break;
  86575. }
  86576. }
  86577. if (document_1.activeElement === this.el_) {
  86578. focusIndex = 0;
  86579. }
  86580. if (event2.shiftKey && focusIndex === 0) {
  86581. focusableEls[focusableEls.length - 1].focus();
  86582. event2.preventDefault();
  86583. } else if (!event2.shiftKey && focusIndex === focusableEls.length - 1) {
  86584. focusableEls[0].focus();
  86585. event2.preventDefault();
  86586. }
  86587. };
  86588. _proto.focusableEls_ = function focusableEls_() {
  86589. var allChildren = this.el_.querySelectorAll("*");
  86590. return Array.prototype.filter.call(allChildren, function(child) {
  86591. return (child instanceof window_1.HTMLAnchorElement || child instanceof window_1.HTMLAreaElement) && child.hasAttribute("href") || (child instanceof window_1.HTMLInputElement || child instanceof window_1.HTMLSelectElement || child instanceof window_1.HTMLTextAreaElement || child instanceof window_1.HTMLButtonElement) && !child.hasAttribute("disabled") || child instanceof window_1.HTMLIFrameElement || child instanceof window_1.HTMLObjectElement || child instanceof window_1.HTMLEmbedElement || child.hasAttribute("tabindex") && child.getAttribute("tabindex") !== -1 || child.hasAttribute("contenteditable");
  86592. });
  86593. };
  86594. return ModalDialog2;
  86595. }(Component$1);
  86596. ModalDialog.prototype.options_ = {
  86597. pauseOnOpen: true,
  86598. temporary: true
  86599. };
  86600. Component$1.registerComponent("ModalDialog", ModalDialog);
  86601. var TrackList = /* @__PURE__ */ function(_EventTarget) {
  86602. _inheritsLoose(TrackList2, _EventTarget);
  86603. function TrackList2(tracks) {
  86604. var _this;
  86605. if (tracks === void 0) {
  86606. tracks = [];
  86607. }
  86608. _this = _EventTarget.call(this) || this;
  86609. _this.tracks_ = [];
  86610. Object.defineProperty(_assertThisInitialized(_this), "length", {
  86611. get: function get7() {
  86612. return this.tracks_.length;
  86613. }
  86614. });
  86615. for (var i2 = 0; i2 < tracks.length; i2++) {
  86616. _this.addTrack(tracks[i2]);
  86617. }
  86618. return _this;
  86619. }
  86620. var _proto = TrackList2.prototype;
  86621. _proto.addTrack = function addTrack(track) {
  86622. var _this2 = this;
  86623. var index2 = this.tracks_.length;
  86624. if (!("" + index2 in this)) {
  86625. Object.defineProperty(this, index2, {
  86626. get: function get7() {
  86627. return this.tracks_[index2];
  86628. }
  86629. });
  86630. }
  86631. if (this.tracks_.indexOf(track) === -1) {
  86632. this.tracks_.push(track);
  86633. this.trigger({
  86634. track,
  86635. type: "addtrack",
  86636. target: this
  86637. });
  86638. }
  86639. track.labelchange_ = function() {
  86640. _this2.trigger({
  86641. track,
  86642. type: "labelchange",
  86643. target: _this2
  86644. });
  86645. };
  86646. if (isEvented(track)) {
  86647. track.addEventListener("labelchange", track.labelchange_);
  86648. }
  86649. };
  86650. _proto.removeTrack = function removeTrack(rtrack) {
  86651. var track;
  86652. for (var i2 = 0, l = this.length; i2 < l; i2++) {
  86653. if (this[i2] === rtrack) {
  86654. track = this[i2];
  86655. if (track.off) {
  86656. track.off();
  86657. }
  86658. this.tracks_.splice(i2, 1);
  86659. break;
  86660. }
  86661. }
  86662. if (!track) {
  86663. return;
  86664. }
  86665. this.trigger({
  86666. track,
  86667. type: "removetrack",
  86668. target: this
  86669. });
  86670. };
  86671. _proto.getTrackById = function getTrackById(id) {
  86672. var result = null;
  86673. for (var i2 = 0, l = this.length; i2 < l; i2++) {
  86674. var track = this[i2];
  86675. if (track.id === id) {
  86676. result = track;
  86677. break;
  86678. }
  86679. }
  86680. return result;
  86681. };
  86682. return TrackList2;
  86683. }(EventTarget$2);
  86684. TrackList.prototype.allowedEvents_ = {
  86685. change: "change",
  86686. addtrack: "addtrack",
  86687. removetrack: "removetrack",
  86688. labelchange: "labelchange"
  86689. };
  86690. for (var event$1 in TrackList.prototype.allowedEvents_) {
  86691. TrackList.prototype["on" + event$1] = null;
  86692. }
  86693. var disableOthers$1 = function disableOthers(list, track) {
  86694. for (var i2 = 0; i2 < list.length; i2++) {
  86695. if (!Object.keys(list[i2]).length || track.id === list[i2].id) {
  86696. continue;
  86697. }
  86698. list[i2].enabled = false;
  86699. }
  86700. };
  86701. var AudioTrackList = /* @__PURE__ */ function(_TrackList) {
  86702. _inheritsLoose(AudioTrackList2, _TrackList);
  86703. function AudioTrackList2(tracks) {
  86704. var _this;
  86705. if (tracks === void 0) {
  86706. tracks = [];
  86707. }
  86708. for (var i2 = tracks.length - 1; i2 >= 0; i2--) {
  86709. if (tracks[i2].enabled) {
  86710. disableOthers$1(tracks, tracks[i2]);
  86711. break;
  86712. }
  86713. }
  86714. _this = _TrackList.call(this, tracks) || this;
  86715. _this.changing_ = false;
  86716. return _this;
  86717. }
  86718. var _proto = AudioTrackList2.prototype;
  86719. _proto.addTrack = function addTrack(track) {
  86720. var _this2 = this;
  86721. if (track.enabled) {
  86722. disableOthers$1(this, track);
  86723. }
  86724. _TrackList.prototype.addTrack.call(this, track);
  86725. if (!track.addEventListener) {
  86726. return;
  86727. }
  86728. track.enabledChange_ = function() {
  86729. if (_this2.changing_) {
  86730. return;
  86731. }
  86732. _this2.changing_ = true;
  86733. disableOthers$1(_this2, track);
  86734. _this2.changing_ = false;
  86735. _this2.trigger("change");
  86736. };
  86737. track.addEventListener("enabledchange", track.enabledChange_);
  86738. };
  86739. _proto.removeTrack = function removeTrack(rtrack) {
  86740. _TrackList.prototype.removeTrack.call(this, rtrack);
  86741. if (rtrack.removeEventListener && rtrack.enabledChange_) {
  86742. rtrack.removeEventListener("enabledchange", rtrack.enabledChange_);
  86743. rtrack.enabledChange_ = null;
  86744. }
  86745. };
  86746. return AudioTrackList2;
  86747. }(TrackList);
  86748. var disableOthers2 = function disableOthers3(list, track) {
  86749. for (var i2 = 0; i2 < list.length; i2++) {
  86750. if (!Object.keys(list[i2]).length || track.id === list[i2].id) {
  86751. continue;
  86752. }
  86753. list[i2].selected = false;
  86754. }
  86755. };
  86756. var VideoTrackList = /* @__PURE__ */ function(_TrackList) {
  86757. _inheritsLoose(VideoTrackList2, _TrackList);
  86758. function VideoTrackList2(tracks) {
  86759. var _this;
  86760. if (tracks === void 0) {
  86761. tracks = [];
  86762. }
  86763. for (var i2 = tracks.length - 1; i2 >= 0; i2--) {
  86764. if (tracks[i2].selected) {
  86765. disableOthers2(tracks, tracks[i2]);
  86766. break;
  86767. }
  86768. }
  86769. _this = _TrackList.call(this, tracks) || this;
  86770. _this.changing_ = false;
  86771. Object.defineProperty(_assertThisInitialized(_this), "selectedIndex", {
  86772. get: function get7() {
  86773. for (var _i = 0; _i < this.length; _i++) {
  86774. if (this[_i].selected) {
  86775. return _i;
  86776. }
  86777. }
  86778. return -1;
  86779. },
  86780. set: function set4() {
  86781. }
  86782. });
  86783. return _this;
  86784. }
  86785. var _proto = VideoTrackList2.prototype;
  86786. _proto.addTrack = function addTrack(track) {
  86787. var _this2 = this;
  86788. if (track.selected) {
  86789. disableOthers2(this, track);
  86790. }
  86791. _TrackList.prototype.addTrack.call(this, track);
  86792. if (!track.addEventListener) {
  86793. return;
  86794. }
  86795. track.selectedChange_ = function() {
  86796. if (_this2.changing_) {
  86797. return;
  86798. }
  86799. _this2.changing_ = true;
  86800. disableOthers2(_this2, track);
  86801. _this2.changing_ = false;
  86802. _this2.trigger("change");
  86803. };
  86804. track.addEventListener("selectedchange", track.selectedChange_);
  86805. };
  86806. _proto.removeTrack = function removeTrack(rtrack) {
  86807. _TrackList.prototype.removeTrack.call(this, rtrack);
  86808. if (rtrack.removeEventListener && rtrack.selectedChange_) {
  86809. rtrack.removeEventListener("selectedchange", rtrack.selectedChange_);
  86810. rtrack.selectedChange_ = null;
  86811. }
  86812. };
  86813. return VideoTrackList2;
  86814. }(TrackList);
  86815. var TextTrackList = /* @__PURE__ */ function(_TrackList) {
  86816. _inheritsLoose(TextTrackList2, _TrackList);
  86817. function TextTrackList2() {
  86818. return _TrackList.apply(this, arguments) || this;
  86819. }
  86820. var _proto = TextTrackList2.prototype;
  86821. _proto.addTrack = function addTrack(track) {
  86822. var _this = this;
  86823. _TrackList.prototype.addTrack.call(this, track);
  86824. if (!this.queueChange_) {
  86825. this.queueChange_ = function() {
  86826. return _this.queueTrigger("change");
  86827. };
  86828. }
  86829. if (!this.triggerSelectedlanguagechange) {
  86830. this.triggerSelectedlanguagechange_ = function() {
  86831. return _this.trigger("selectedlanguagechange");
  86832. };
  86833. }
  86834. track.addEventListener("modechange", this.queueChange_);
  86835. var nonLanguageTextTrackKind = ["metadata", "chapters"];
  86836. if (nonLanguageTextTrackKind.indexOf(track.kind) === -1) {
  86837. track.addEventListener("modechange", this.triggerSelectedlanguagechange_);
  86838. }
  86839. };
  86840. _proto.removeTrack = function removeTrack(rtrack) {
  86841. _TrackList.prototype.removeTrack.call(this, rtrack);
  86842. if (rtrack.removeEventListener) {
  86843. if (this.queueChange_) {
  86844. rtrack.removeEventListener("modechange", this.queueChange_);
  86845. }
  86846. if (this.selectedlanguagechange_) {
  86847. rtrack.removeEventListener("modechange", this.triggerSelectedlanguagechange_);
  86848. }
  86849. }
  86850. };
  86851. return TextTrackList2;
  86852. }(TrackList);
  86853. var HtmlTrackElementList = /* @__PURE__ */ function() {
  86854. function HtmlTrackElementList2(trackElements) {
  86855. if (trackElements === void 0) {
  86856. trackElements = [];
  86857. }
  86858. this.trackElements_ = [];
  86859. Object.defineProperty(this, "length", {
  86860. get: function get7() {
  86861. return this.trackElements_.length;
  86862. }
  86863. });
  86864. for (var i2 = 0, length = trackElements.length; i2 < length; i2++) {
  86865. this.addTrackElement_(trackElements[i2]);
  86866. }
  86867. }
  86868. var _proto = HtmlTrackElementList2.prototype;
  86869. _proto.addTrackElement_ = function addTrackElement_(trackElement) {
  86870. var index2 = this.trackElements_.length;
  86871. if (!("" + index2 in this)) {
  86872. Object.defineProperty(this, index2, {
  86873. get: function get7() {
  86874. return this.trackElements_[index2];
  86875. }
  86876. });
  86877. }
  86878. if (this.trackElements_.indexOf(trackElement) === -1) {
  86879. this.trackElements_.push(trackElement);
  86880. }
  86881. };
  86882. _proto.getTrackElementByTrack_ = function getTrackElementByTrack_(track) {
  86883. var trackElement_;
  86884. for (var i2 = 0, length = this.trackElements_.length; i2 < length; i2++) {
  86885. if (track === this.trackElements_[i2].track) {
  86886. trackElement_ = this.trackElements_[i2];
  86887. break;
  86888. }
  86889. }
  86890. return trackElement_;
  86891. };
  86892. _proto.removeTrackElement_ = function removeTrackElement_(trackElement) {
  86893. for (var i2 = 0, length = this.trackElements_.length; i2 < length; i2++) {
  86894. if (trackElement === this.trackElements_[i2]) {
  86895. if (this.trackElements_[i2].track && typeof this.trackElements_[i2].track.off === "function") {
  86896. this.trackElements_[i2].track.off();
  86897. }
  86898. if (typeof this.trackElements_[i2].off === "function") {
  86899. this.trackElements_[i2].off();
  86900. }
  86901. this.trackElements_.splice(i2, 1);
  86902. break;
  86903. }
  86904. }
  86905. };
  86906. return HtmlTrackElementList2;
  86907. }();
  86908. var TextTrackCueList = /* @__PURE__ */ function() {
  86909. function TextTrackCueList2(cues) {
  86910. TextTrackCueList2.prototype.setCues_.call(this, cues);
  86911. Object.defineProperty(this, "length", {
  86912. get: function get7() {
  86913. return this.length_;
  86914. }
  86915. });
  86916. }
  86917. var _proto = TextTrackCueList2.prototype;
  86918. _proto.setCues_ = function setCues_(cues) {
  86919. var oldLength = this.length || 0;
  86920. var i2 = 0;
  86921. var l = cues.length;
  86922. this.cues_ = cues;
  86923. this.length_ = cues.length;
  86924. var defineProp = function defineProp2(index2) {
  86925. if (!("" + index2 in this)) {
  86926. Object.defineProperty(this, "" + index2, {
  86927. get: function get7() {
  86928. return this.cues_[index2];
  86929. }
  86930. });
  86931. }
  86932. };
  86933. if (oldLength < l) {
  86934. i2 = oldLength;
  86935. for (; i2 < l; i2++) {
  86936. defineProp.call(this, i2);
  86937. }
  86938. }
  86939. };
  86940. _proto.getCueById = function getCueById(id) {
  86941. var result = null;
  86942. for (var i2 = 0, l = this.length; i2 < l; i2++) {
  86943. var cue = this[i2];
  86944. if (cue.id === id) {
  86945. result = cue;
  86946. break;
  86947. }
  86948. }
  86949. return result;
  86950. };
  86951. return TextTrackCueList2;
  86952. }();
  86953. var VideoTrackKind = {
  86954. alternative: "alternative",
  86955. captions: "captions",
  86956. main: "main",
  86957. sign: "sign",
  86958. subtitles: "subtitles",
  86959. commentary: "commentary"
  86960. };
  86961. var AudioTrackKind = {
  86962. "alternative": "alternative",
  86963. "descriptions": "descriptions",
  86964. "main": "main",
  86965. "main-desc": "main-desc",
  86966. "translation": "translation",
  86967. "commentary": "commentary"
  86968. };
  86969. var TextTrackKind = {
  86970. subtitles: "subtitles",
  86971. captions: "captions",
  86972. descriptions: "descriptions",
  86973. chapters: "chapters",
  86974. metadata: "metadata"
  86975. };
  86976. var TextTrackMode = {
  86977. disabled: "disabled",
  86978. hidden: "hidden",
  86979. showing: "showing"
  86980. };
  86981. var Track = /* @__PURE__ */ function(_EventTarget) {
  86982. _inheritsLoose(Track2, _EventTarget);
  86983. function Track2(options2) {
  86984. var _this;
  86985. if (options2 === void 0) {
  86986. options2 = {};
  86987. }
  86988. _this = _EventTarget.call(this) || this;
  86989. var trackProps = {
  86990. id: options2.id || "vjs_track_" + newGUID(),
  86991. kind: options2.kind || "",
  86992. language: options2.language || ""
  86993. };
  86994. var label = options2.label || "";
  86995. var _loop = function _loop2(key2) {
  86996. Object.defineProperty(_assertThisInitialized(_this), key2, {
  86997. get: function get7() {
  86998. return trackProps[key2];
  86999. },
  87000. set: function set4() {
  87001. }
  87002. });
  87003. };
  87004. for (var key in trackProps) {
  87005. _loop(key);
  87006. }
  87007. Object.defineProperty(_assertThisInitialized(_this), "label", {
  87008. get: function get7() {
  87009. return label;
  87010. },
  87011. set: function set4(newLabel) {
  87012. if (newLabel !== label) {
  87013. label = newLabel;
  87014. this.trigger("labelchange");
  87015. }
  87016. }
  87017. });
  87018. return _this;
  87019. }
  87020. return Track2;
  87021. }(EventTarget$2);
  87022. var parseUrl = function parseUrl2(url) {
  87023. var props = ["protocol", "hostname", "port", "pathname", "search", "hash", "host"];
  87024. var a = document_1.createElement("a");
  87025. a.href = url;
  87026. var details = {};
  87027. for (var i2 = 0; i2 < props.length; i2++) {
  87028. details[props[i2]] = a[props[i2]];
  87029. }
  87030. if (details.protocol === "http:") {
  87031. details.host = details.host.replace(/:80$/, "");
  87032. }
  87033. if (details.protocol === "https:") {
  87034. details.host = details.host.replace(/:443$/, "");
  87035. }
  87036. if (!details.protocol) {
  87037. details.protocol = window_1.location.protocol;
  87038. }
  87039. if (!details.host) {
  87040. details.host = window_1.location.host;
  87041. }
  87042. return details;
  87043. };
  87044. var getAbsoluteURL = function getAbsoluteURL2(url) {
  87045. if (!url.match(/^https?:\/\//)) {
  87046. var a = document_1.createElement("a");
  87047. a.href = url;
  87048. url = a.href;
  87049. }
  87050. return url;
  87051. };
  87052. var getFileExtension = function getFileExtension2(path) {
  87053. if (typeof path === "string") {
  87054. var splitPathRe = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/;
  87055. var pathParts = splitPathRe.exec(path);
  87056. if (pathParts) {
  87057. return pathParts.pop().toLowerCase();
  87058. }
  87059. }
  87060. return "";
  87061. };
  87062. var isCrossOrigin = function isCrossOrigin2(url, winLoc) {
  87063. if (winLoc === void 0) {
  87064. winLoc = window_1.location;
  87065. }
  87066. var urlInfo = parseUrl(url);
  87067. var srcProtocol = urlInfo.protocol === ":" ? winLoc.protocol : urlInfo.protocol;
  87068. var crossOrigin = srcProtocol + urlInfo.host !== winLoc.protocol + winLoc.host;
  87069. return crossOrigin;
  87070. };
  87071. var Url$1 = /* @__PURE__ */ Object.freeze({
  87072. __proto__: null,
  87073. parseUrl,
  87074. getAbsoluteURL,
  87075. getFileExtension,
  87076. isCrossOrigin
  87077. });
  87078. var parseCues = function parseCues2(srcContent, track) {
  87079. var parser2 = new window_1.WebVTT.Parser(window_1, window_1.vttjs, window_1.WebVTT.StringDecoder());
  87080. var errors2 = [];
  87081. parser2.oncue = function(cue) {
  87082. track.addCue(cue);
  87083. };
  87084. parser2.onparsingerror = function(error) {
  87085. errors2.push(error);
  87086. };
  87087. parser2.onflush = function() {
  87088. track.trigger({
  87089. type: "loadeddata",
  87090. target: track
  87091. });
  87092. };
  87093. parser2.parse(srcContent);
  87094. if (errors2.length > 0) {
  87095. if (window_1.console && window_1.console.groupCollapsed) {
  87096. window_1.console.groupCollapsed("Text Track parsing errors for " + track.src);
  87097. }
  87098. errors2.forEach(function(error) {
  87099. return log$1.error(error);
  87100. });
  87101. if (window_1.console && window_1.console.groupEnd) {
  87102. window_1.console.groupEnd();
  87103. }
  87104. }
  87105. parser2.flush();
  87106. };
  87107. var loadTrack = function loadTrack2(src, track) {
  87108. var opts = {
  87109. uri: src
  87110. };
  87111. var crossOrigin = isCrossOrigin(src);
  87112. if (crossOrigin) {
  87113. opts.cors = crossOrigin;
  87114. }
  87115. var withCredentials = track.tech_.crossOrigin() === "use-credentials";
  87116. if (withCredentials) {
  87117. opts.withCredentials = withCredentials;
  87118. }
  87119. XHR(opts, bind(this, function(err, response, responseBody) {
  87120. if (err) {
  87121. return log$1.error(err, response);
  87122. }
  87123. track.loaded_ = true;
  87124. if (typeof window_1.WebVTT !== "function") {
  87125. if (track.tech_) {
  87126. track.tech_.any(["vttjsloaded", "vttjserror"], function(event2) {
  87127. if (event2.type === "vttjserror") {
  87128. log$1.error("vttjs failed to load, stopping trying to process " + track.src);
  87129. return;
  87130. }
  87131. return parseCues(responseBody, track);
  87132. });
  87133. }
  87134. } else {
  87135. parseCues(responseBody, track);
  87136. }
  87137. }));
  87138. };
  87139. var TextTrack = /* @__PURE__ */ function(_Track) {
  87140. _inheritsLoose(TextTrack2, _Track);
  87141. function TextTrack2(options2) {
  87142. var _this;
  87143. if (options2 === void 0) {
  87144. options2 = {};
  87145. }
  87146. if (!options2.tech) {
  87147. throw new Error("A tech was not provided.");
  87148. }
  87149. var settings = mergeOptions$3(options2, {
  87150. kind: TextTrackKind[options2.kind] || "subtitles",
  87151. language: options2.language || options2.srclang || ""
  87152. });
  87153. var mode = TextTrackMode[settings.mode] || "disabled";
  87154. var default_ = settings["default"];
  87155. if (settings.kind === "metadata" || settings.kind === "chapters") {
  87156. mode = "hidden";
  87157. }
  87158. _this = _Track.call(this, settings) || this;
  87159. _this.tech_ = settings.tech;
  87160. _this.cues_ = [];
  87161. _this.activeCues_ = [];
  87162. _this.preload_ = _this.tech_.preloadTextTracks !== false;
  87163. var cues = new TextTrackCueList(_this.cues_);
  87164. var activeCues = new TextTrackCueList(_this.activeCues_);
  87165. var changed = false;
  87166. _this.timeupdateHandler = bind(_assertThisInitialized(_this), function(event2) {
  87167. if (event2 === void 0) {
  87168. event2 = {};
  87169. }
  87170. if (this.tech_.isDisposed()) {
  87171. return;
  87172. }
  87173. if (!this.tech_.isReady_) {
  87174. if (event2.type !== "timeupdate") {
  87175. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  87176. }
  87177. return;
  87178. }
  87179. this.activeCues = this.activeCues;
  87180. if (changed) {
  87181. this.trigger("cuechange");
  87182. changed = false;
  87183. }
  87184. if (event2.type !== "timeupdate") {
  87185. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  87186. }
  87187. });
  87188. var disposeHandler = function disposeHandler2() {
  87189. _this.stopTracking();
  87190. };
  87191. _this.tech_.one("dispose", disposeHandler);
  87192. if (mode !== "disabled") {
  87193. _this.startTracking();
  87194. }
  87195. Object.defineProperties(_assertThisInitialized(_this), {
  87196. "default": {
  87197. get: function get7() {
  87198. return default_;
  87199. },
  87200. set: function set4() {
  87201. }
  87202. },
  87203. mode: {
  87204. get: function get7() {
  87205. return mode;
  87206. },
  87207. set: function set4(newMode) {
  87208. if (!TextTrackMode[newMode]) {
  87209. return;
  87210. }
  87211. if (mode === newMode) {
  87212. return;
  87213. }
  87214. mode = newMode;
  87215. if (!this.preload_ && mode !== "disabled" && this.cues.length === 0) {
  87216. loadTrack(this.src, this);
  87217. }
  87218. this.stopTracking();
  87219. if (mode !== "disabled") {
  87220. this.startTracking();
  87221. }
  87222. this.trigger("modechange");
  87223. }
  87224. },
  87225. cues: {
  87226. get: function get7() {
  87227. if (!this.loaded_) {
  87228. return null;
  87229. }
  87230. return cues;
  87231. },
  87232. set: function set4() {
  87233. }
  87234. },
  87235. activeCues: {
  87236. get: function get7() {
  87237. if (!this.loaded_) {
  87238. return null;
  87239. }
  87240. if (this.cues.length === 0) {
  87241. return activeCues;
  87242. }
  87243. var ct2 = this.tech_.currentTime();
  87244. var active = [];
  87245. for (var i2 = 0, l = this.cues.length; i2 < l; i2++) {
  87246. var cue = this.cues[i2];
  87247. if (cue.startTime <= ct2 && cue.endTime >= ct2) {
  87248. active.push(cue);
  87249. } else if (cue.startTime === cue.endTime && cue.startTime <= ct2 && cue.startTime + 0.5 >= ct2) {
  87250. active.push(cue);
  87251. }
  87252. }
  87253. changed = false;
  87254. if (active.length !== this.activeCues_.length) {
  87255. changed = true;
  87256. } else {
  87257. for (var _i = 0; _i < active.length; _i++) {
  87258. if (this.activeCues_.indexOf(active[_i]) === -1) {
  87259. changed = true;
  87260. }
  87261. }
  87262. }
  87263. this.activeCues_ = active;
  87264. activeCues.setCues_(this.activeCues_);
  87265. return activeCues;
  87266. },
  87267. set: function set4() {
  87268. }
  87269. }
  87270. });
  87271. if (settings.src) {
  87272. _this.src = settings.src;
  87273. if (!_this.preload_) {
  87274. _this.loaded_ = true;
  87275. }
  87276. if (_this.preload_ || settings.kind !== "subtitles" && settings.kind !== "captions") {
  87277. loadTrack(_this.src, _assertThisInitialized(_this));
  87278. }
  87279. } else {
  87280. _this.loaded_ = true;
  87281. }
  87282. return _this;
  87283. }
  87284. var _proto = TextTrack2.prototype;
  87285. _proto.startTracking = function startTracking() {
  87286. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler);
  87287. this.tech_.on("timeupdate", this.timeupdateHandler);
  87288. };
  87289. _proto.stopTracking = function stopTracking() {
  87290. if (this.rvf_) {
  87291. this.tech_.cancelVideoFrameCallback(this.rvf_);
  87292. this.rvf_ = void 0;
  87293. }
  87294. this.tech_.off("timeupdate", this.timeupdateHandler);
  87295. };
  87296. _proto.addCue = function addCue(originalCue) {
  87297. var cue = originalCue;
  87298. if (window_1.vttjs && !(originalCue instanceof window_1.vttjs.VTTCue)) {
  87299. cue = new window_1.vttjs.VTTCue(originalCue.startTime, originalCue.endTime, originalCue.text);
  87300. for (var prop in originalCue) {
  87301. if (!(prop in cue)) {
  87302. cue[prop] = originalCue[prop];
  87303. }
  87304. }
  87305. cue.id = originalCue.id;
  87306. cue.originalCue_ = originalCue;
  87307. }
  87308. var tracks = this.tech_.textTracks();
  87309. for (var i2 = 0; i2 < tracks.length; i2++) {
  87310. if (tracks[i2] !== this) {
  87311. tracks[i2].removeCue(cue);
  87312. }
  87313. }
  87314. this.cues_.push(cue);
  87315. this.cues.setCues_(this.cues_);
  87316. };
  87317. _proto.removeCue = function removeCue(_removeCue) {
  87318. var i2 = this.cues_.length;
  87319. while (i2--) {
  87320. var cue = this.cues_[i2];
  87321. if (cue === _removeCue || cue.originalCue_ && cue.originalCue_ === _removeCue) {
  87322. this.cues_.splice(i2, 1);
  87323. this.cues.setCues_(this.cues_);
  87324. break;
  87325. }
  87326. }
  87327. };
  87328. return TextTrack2;
  87329. }(Track);
  87330. TextTrack.prototype.allowedEvents_ = {
  87331. cuechange: "cuechange"
  87332. };
  87333. var AudioTrack = /* @__PURE__ */ function(_Track) {
  87334. _inheritsLoose(AudioTrack2, _Track);
  87335. function AudioTrack2(options2) {
  87336. var _this;
  87337. if (options2 === void 0) {
  87338. options2 = {};
  87339. }
  87340. var settings = mergeOptions$3(options2, {
  87341. kind: AudioTrackKind[options2.kind] || ""
  87342. });
  87343. _this = _Track.call(this, settings) || this;
  87344. var enabled = false;
  87345. Object.defineProperty(_assertThisInitialized(_this), "enabled", {
  87346. get: function get7() {
  87347. return enabled;
  87348. },
  87349. set: function set4(newEnabled) {
  87350. if (typeof newEnabled !== "boolean" || newEnabled === enabled) {
  87351. return;
  87352. }
  87353. enabled = newEnabled;
  87354. this.trigger("enabledchange");
  87355. }
  87356. });
  87357. if (settings.enabled) {
  87358. _this.enabled = settings.enabled;
  87359. }
  87360. _this.loaded_ = true;
  87361. return _this;
  87362. }
  87363. return AudioTrack2;
  87364. }(Track);
  87365. var VideoTrack = /* @__PURE__ */ function(_Track) {
  87366. _inheritsLoose(VideoTrack2, _Track);
  87367. function VideoTrack2(options2) {
  87368. var _this;
  87369. if (options2 === void 0) {
  87370. options2 = {};
  87371. }
  87372. var settings = mergeOptions$3(options2, {
  87373. kind: VideoTrackKind[options2.kind] || ""
  87374. });
  87375. _this = _Track.call(this, settings) || this;
  87376. var selected = false;
  87377. Object.defineProperty(_assertThisInitialized(_this), "selected", {
  87378. get: function get7() {
  87379. return selected;
  87380. },
  87381. set: function set4(newSelected) {
  87382. if (typeof newSelected !== "boolean" || newSelected === selected) {
  87383. return;
  87384. }
  87385. selected = newSelected;
  87386. this.trigger("selectedchange");
  87387. }
  87388. });
  87389. if (settings.selected) {
  87390. _this.selected = settings.selected;
  87391. }
  87392. return _this;
  87393. }
  87394. return VideoTrack2;
  87395. }(Track);
  87396. var NONE = 0;
  87397. var LOADING = 1;
  87398. var LOADED = 2;
  87399. var ERROR = 3;
  87400. var HTMLTrackElement = /* @__PURE__ */ function(_EventTarget) {
  87401. _inheritsLoose(HTMLTrackElement2, _EventTarget);
  87402. function HTMLTrackElement2(options2) {
  87403. var _this;
  87404. if (options2 === void 0) {
  87405. options2 = {};
  87406. }
  87407. _this = _EventTarget.call(this) || this;
  87408. var readyState;
  87409. var track = new TextTrack(options2);
  87410. _this.kind = track.kind;
  87411. _this.src = track.src;
  87412. _this.srclang = track.language;
  87413. _this.label = track.label;
  87414. _this["default"] = track["default"];
  87415. Object.defineProperties(_assertThisInitialized(_this), {
  87416. readyState: {
  87417. get: function get7() {
  87418. return readyState;
  87419. }
  87420. },
  87421. track: {
  87422. get: function get7() {
  87423. return track;
  87424. }
  87425. }
  87426. });
  87427. readyState = NONE;
  87428. track.addEventListener("loadeddata", function() {
  87429. readyState = LOADED;
  87430. _this.trigger({
  87431. type: "load",
  87432. target: _assertThisInitialized(_this)
  87433. });
  87434. });
  87435. return _this;
  87436. }
  87437. return HTMLTrackElement2;
  87438. }(EventTarget$2);
  87439. HTMLTrackElement.prototype.allowedEvents_ = {
  87440. load: "load"
  87441. };
  87442. HTMLTrackElement.NONE = NONE;
  87443. HTMLTrackElement.LOADING = LOADING;
  87444. HTMLTrackElement.LOADED = LOADED;
  87445. HTMLTrackElement.ERROR = ERROR;
  87446. var NORMAL = {
  87447. audio: {
  87448. ListClass: AudioTrackList,
  87449. TrackClass: AudioTrack,
  87450. capitalName: "Audio"
  87451. },
  87452. video: {
  87453. ListClass: VideoTrackList,
  87454. TrackClass: VideoTrack,
  87455. capitalName: "Video"
  87456. },
  87457. text: {
  87458. ListClass: TextTrackList,
  87459. TrackClass: TextTrack,
  87460. capitalName: "Text"
  87461. }
  87462. };
  87463. Object.keys(NORMAL).forEach(function(type2) {
  87464. NORMAL[type2].getterName = type2 + "Tracks";
  87465. NORMAL[type2].privateName = type2 + "Tracks_";
  87466. });
  87467. var REMOTE = {
  87468. remoteText: {
  87469. ListClass: TextTrackList,
  87470. TrackClass: TextTrack,
  87471. capitalName: "RemoteText",
  87472. getterName: "remoteTextTracks",
  87473. privateName: "remoteTextTracks_"
  87474. },
  87475. remoteTextEl: {
  87476. ListClass: HtmlTrackElementList,
  87477. TrackClass: HTMLTrackElement,
  87478. capitalName: "RemoteTextTrackEls",
  87479. getterName: "remoteTextTrackEls",
  87480. privateName: "remoteTextTrackEls_"
  87481. }
  87482. };
  87483. var ALL = _extends$2({}, NORMAL, REMOTE);
  87484. REMOTE.names = Object.keys(REMOTE);
  87485. NORMAL.names = Object.keys(NORMAL);
  87486. ALL.names = [].concat(REMOTE.names).concat(NORMAL.names);
  87487. function createTrackHelper(self2, kind, label, language, options2) {
  87488. if (options2 === void 0) {
  87489. options2 = {};
  87490. }
  87491. var tracks = self2.textTracks();
  87492. options2.kind = kind;
  87493. if (label) {
  87494. options2.label = label;
  87495. }
  87496. if (language) {
  87497. options2.language = language;
  87498. }
  87499. options2.tech = self2;
  87500. var track = new ALL.text.TrackClass(options2);
  87501. tracks.addTrack(track);
  87502. return track;
  87503. }
  87504. var Tech$1 = /* @__PURE__ */ function(_Component) {
  87505. _inheritsLoose(Tech2, _Component);
  87506. function Tech2(options2, ready) {
  87507. var _this;
  87508. if (options2 === void 0) {
  87509. options2 = {};
  87510. }
  87511. if (ready === void 0) {
  87512. ready = function ready2() {
  87513. };
  87514. }
  87515. options2.reportTouchActivity = false;
  87516. _this = _Component.call(this, null, options2, ready) || this;
  87517. _this.onDurationChange_ = function(e) {
  87518. return _this.onDurationChange(e);
  87519. };
  87520. _this.trackProgress_ = function(e) {
  87521. return _this.trackProgress(e);
  87522. };
  87523. _this.trackCurrentTime_ = function(e) {
  87524. return _this.trackCurrentTime(e);
  87525. };
  87526. _this.stopTrackingCurrentTime_ = function(e) {
  87527. return _this.stopTrackingCurrentTime(e);
  87528. };
  87529. _this.disposeSourceHandler_ = function(e) {
  87530. return _this.disposeSourceHandler(e);
  87531. };
  87532. _this.queuedHanders_ = /* @__PURE__ */ new Set();
  87533. _this.hasStarted_ = false;
  87534. _this.on("playing", function() {
  87535. this.hasStarted_ = true;
  87536. });
  87537. _this.on("loadstart", function() {
  87538. this.hasStarted_ = false;
  87539. });
  87540. ALL.names.forEach(function(name) {
  87541. var props = ALL[name];
  87542. if (options2 && options2[props.getterName]) {
  87543. _this[props.privateName] = options2[props.getterName];
  87544. }
  87545. });
  87546. if (!_this.featuresProgressEvents) {
  87547. _this.manualProgressOn();
  87548. }
  87549. if (!_this.featuresTimeupdateEvents) {
  87550. _this.manualTimeUpdatesOn();
  87551. }
  87552. ["Text", "Audio", "Video"].forEach(function(track) {
  87553. if (options2["native" + track + "Tracks"] === false) {
  87554. _this["featuresNative" + track + "Tracks"] = false;
  87555. }
  87556. });
  87557. if (options2.nativeCaptions === false || options2.nativeTextTracks === false) {
  87558. _this.featuresNativeTextTracks = false;
  87559. } else if (options2.nativeCaptions === true || options2.nativeTextTracks === true) {
  87560. _this.featuresNativeTextTracks = true;
  87561. }
  87562. if (!_this.featuresNativeTextTracks) {
  87563. _this.emulateTextTracks();
  87564. }
  87565. _this.preloadTextTracks = options2.preloadTextTracks !== false;
  87566. _this.autoRemoteTextTracks_ = new ALL.text.ListClass();
  87567. _this.initTrackListeners();
  87568. if (!options2.nativeControlsForTouch) {
  87569. _this.emitTapEvents();
  87570. }
  87571. if (_this.constructor) {
  87572. _this.name_ = _this.constructor.name || "Unknown Tech";
  87573. }
  87574. return _this;
  87575. }
  87576. var _proto = Tech2.prototype;
  87577. _proto.triggerSourceset = function triggerSourceset(src) {
  87578. var _this2 = this;
  87579. if (!this.isReady_) {
  87580. this.one("ready", function() {
  87581. return _this2.setTimeout(function() {
  87582. return _this2.triggerSourceset(src);
  87583. }, 1);
  87584. });
  87585. }
  87586. this.trigger({
  87587. src,
  87588. type: "sourceset"
  87589. });
  87590. };
  87591. _proto.manualProgressOn = function manualProgressOn() {
  87592. this.on("durationchange", this.onDurationChange_);
  87593. this.manualProgress = true;
  87594. this.one("ready", this.trackProgress_);
  87595. };
  87596. _proto.manualProgressOff = function manualProgressOff() {
  87597. this.manualProgress = false;
  87598. this.stopTrackingProgress();
  87599. this.off("durationchange", this.onDurationChange_);
  87600. };
  87601. _proto.trackProgress = function trackProgress(event2) {
  87602. this.stopTrackingProgress();
  87603. this.progressInterval = this.setInterval(bind(this, function() {
  87604. var numBufferedPercent = this.bufferedPercent();
  87605. if (this.bufferedPercent_ !== numBufferedPercent) {
  87606. this.trigger("progress");
  87607. }
  87608. this.bufferedPercent_ = numBufferedPercent;
  87609. if (numBufferedPercent === 1) {
  87610. this.stopTrackingProgress();
  87611. }
  87612. }), 500);
  87613. };
  87614. _proto.onDurationChange = function onDurationChange(event2) {
  87615. this.duration_ = this.duration();
  87616. };
  87617. _proto.buffered = function buffered() {
  87618. return createTimeRanges(0, 0);
  87619. };
  87620. _proto.bufferedPercent = function bufferedPercent$12() {
  87621. return bufferedPercent(this.buffered(), this.duration_);
  87622. };
  87623. _proto.stopTrackingProgress = function stopTrackingProgress() {
  87624. this.clearInterval(this.progressInterval);
  87625. };
  87626. _proto.manualTimeUpdatesOn = function manualTimeUpdatesOn() {
  87627. this.manualTimeUpdates = true;
  87628. this.on("play", this.trackCurrentTime_);
  87629. this.on("pause", this.stopTrackingCurrentTime_);
  87630. };
  87631. _proto.manualTimeUpdatesOff = function manualTimeUpdatesOff() {
  87632. this.manualTimeUpdates = false;
  87633. this.stopTrackingCurrentTime();
  87634. this.off("play", this.trackCurrentTime_);
  87635. this.off("pause", this.stopTrackingCurrentTime_);
  87636. };
  87637. _proto.trackCurrentTime = function trackCurrentTime() {
  87638. if (this.currentTimeInterval) {
  87639. this.stopTrackingCurrentTime();
  87640. }
  87641. this.currentTimeInterval = this.setInterval(function() {
  87642. this.trigger({
  87643. type: "timeupdate",
  87644. target: this,
  87645. manuallyTriggered: true
  87646. });
  87647. }, 250);
  87648. };
  87649. _proto.stopTrackingCurrentTime = function stopTrackingCurrentTime() {
  87650. this.clearInterval(this.currentTimeInterval);
  87651. this.trigger({
  87652. type: "timeupdate",
  87653. target: this,
  87654. manuallyTriggered: true
  87655. });
  87656. };
  87657. _proto.dispose = function dispose() {
  87658. this.clearTracks(NORMAL.names);
  87659. if (this.manualProgress) {
  87660. this.manualProgressOff();
  87661. }
  87662. if (this.manualTimeUpdates) {
  87663. this.manualTimeUpdatesOff();
  87664. }
  87665. _Component.prototype.dispose.call(this);
  87666. };
  87667. _proto.clearTracks = function clearTracks(types) {
  87668. var _this3 = this;
  87669. types = [].concat(types);
  87670. types.forEach(function(type2) {
  87671. var list = _this3[type2 + "Tracks"]() || [];
  87672. var i2 = list.length;
  87673. while (i2--) {
  87674. var track = list[i2];
  87675. if (type2 === "text") {
  87676. _this3.removeRemoteTextTrack(track);
  87677. }
  87678. list.removeTrack(track);
  87679. }
  87680. });
  87681. };
  87682. _proto.cleanupAutoTextTracks = function cleanupAutoTextTracks() {
  87683. var list = this.autoRemoteTextTracks_ || [];
  87684. var i2 = list.length;
  87685. while (i2--) {
  87686. var track = list[i2];
  87687. this.removeRemoteTextTrack(track);
  87688. }
  87689. };
  87690. _proto.reset = function reset3() {
  87691. };
  87692. _proto.crossOrigin = function crossOrigin() {
  87693. };
  87694. _proto.setCrossOrigin = function setCrossOrigin() {
  87695. };
  87696. _proto.error = function error(err) {
  87697. if (err !== void 0) {
  87698. this.error_ = new MediaError(err);
  87699. this.trigger("error");
  87700. }
  87701. return this.error_;
  87702. };
  87703. _proto.played = function played() {
  87704. if (this.hasStarted_) {
  87705. return createTimeRanges(0, 0);
  87706. }
  87707. return createTimeRanges();
  87708. };
  87709. _proto.play = function play() {
  87710. };
  87711. _proto.setScrubbing = function setScrubbing() {
  87712. };
  87713. _proto.scrubbing = function scrubbing() {
  87714. };
  87715. _proto.setCurrentTime = function setCurrentTime() {
  87716. if (this.manualTimeUpdates) {
  87717. this.trigger({
  87718. type: "timeupdate",
  87719. target: this,
  87720. manuallyTriggered: true
  87721. });
  87722. }
  87723. };
  87724. _proto.initTrackListeners = function initTrackListeners() {
  87725. var _this4 = this;
  87726. NORMAL.names.forEach(function(name) {
  87727. var props = NORMAL[name];
  87728. var trackListChanges = function trackListChanges2() {
  87729. _this4.trigger(name + "trackchange");
  87730. };
  87731. var tracks = _this4[props.getterName]();
  87732. tracks.addEventListener("removetrack", trackListChanges);
  87733. tracks.addEventListener("addtrack", trackListChanges);
  87734. _this4.on("dispose", function() {
  87735. tracks.removeEventListener("removetrack", trackListChanges);
  87736. tracks.removeEventListener("addtrack", trackListChanges);
  87737. });
  87738. });
  87739. };
  87740. _proto.addWebVttScript_ = function addWebVttScript_() {
  87741. var _this5 = this;
  87742. if (window_1.WebVTT) {
  87743. return;
  87744. }
  87745. if (document_1.body.contains(this.el())) {
  87746. if (!this.options_["vtt.js"] && isPlain(vtt) && Object.keys(vtt).length > 0) {
  87747. this.trigger("vttjsloaded");
  87748. return;
  87749. }
  87750. var script = document_1.createElement("script");
  87751. script.src = this.options_["vtt.js"] || "https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";
  87752. script.onload = function() {
  87753. _this5.trigger("vttjsloaded");
  87754. };
  87755. script.onerror = function() {
  87756. _this5.trigger("vttjserror");
  87757. };
  87758. this.on("dispose", function() {
  87759. script.onload = null;
  87760. script.onerror = null;
  87761. });
  87762. window_1.WebVTT = true;
  87763. this.el().parentNode.appendChild(script);
  87764. } else {
  87765. this.ready(this.addWebVttScript_);
  87766. }
  87767. };
  87768. _proto.emulateTextTracks = function emulateTextTracks() {
  87769. var _this6 = this;
  87770. var tracks = this.textTracks();
  87771. var remoteTracks = this.remoteTextTracks();
  87772. var handleAddTrack = function handleAddTrack2(e) {
  87773. return tracks.addTrack(e.track);
  87774. };
  87775. var handleRemoveTrack = function handleRemoveTrack2(e) {
  87776. return tracks.removeTrack(e.track);
  87777. };
  87778. remoteTracks.on("addtrack", handleAddTrack);
  87779. remoteTracks.on("removetrack", handleRemoveTrack);
  87780. this.addWebVttScript_();
  87781. var updateDisplay = function updateDisplay2() {
  87782. return _this6.trigger("texttrackchange");
  87783. };
  87784. var textTracksChanges = function textTracksChanges2() {
  87785. updateDisplay();
  87786. for (var i2 = 0; i2 < tracks.length; i2++) {
  87787. var track = tracks[i2];
  87788. track.removeEventListener("cuechange", updateDisplay);
  87789. if (track.mode === "showing") {
  87790. track.addEventListener("cuechange", updateDisplay);
  87791. }
  87792. }
  87793. };
  87794. textTracksChanges();
  87795. tracks.addEventListener("change", textTracksChanges);
  87796. tracks.addEventListener("addtrack", textTracksChanges);
  87797. tracks.addEventListener("removetrack", textTracksChanges);
  87798. this.on("dispose", function() {
  87799. remoteTracks.off("addtrack", handleAddTrack);
  87800. remoteTracks.off("removetrack", handleRemoveTrack);
  87801. tracks.removeEventListener("change", textTracksChanges);
  87802. tracks.removeEventListener("addtrack", textTracksChanges);
  87803. tracks.removeEventListener("removetrack", textTracksChanges);
  87804. for (var i2 = 0; i2 < tracks.length; i2++) {
  87805. var track = tracks[i2];
  87806. track.removeEventListener("cuechange", updateDisplay);
  87807. }
  87808. });
  87809. };
  87810. _proto.addTextTrack = function addTextTrack(kind, label, language) {
  87811. if (!kind) {
  87812. throw new Error("TextTrack kind is required but was not provided");
  87813. }
  87814. return createTrackHelper(this, kind, label, language);
  87815. };
  87816. _proto.createRemoteTextTrack = function createRemoteTextTrack(options2) {
  87817. var track = mergeOptions$3(options2, {
  87818. tech: this
  87819. });
  87820. return new REMOTE.remoteTextEl.TrackClass(track);
  87821. };
  87822. _proto.addRemoteTextTrack = function addRemoteTextTrack(options2, manualCleanup) {
  87823. var _this7 = this;
  87824. if (options2 === void 0) {
  87825. options2 = {};
  87826. }
  87827. var htmlTrackElement = this.createRemoteTextTrack(options2);
  87828. if (manualCleanup !== true && manualCleanup !== false) {
  87829. log$1.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js');
  87830. manualCleanup = true;
  87831. }
  87832. this.remoteTextTrackEls().addTrackElement_(htmlTrackElement);
  87833. this.remoteTextTracks().addTrack(htmlTrackElement.track);
  87834. if (manualCleanup !== true) {
  87835. this.ready(function() {
  87836. return _this7.autoRemoteTextTracks_.addTrack(htmlTrackElement.track);
  87837. });
  87838. }
  87839. return htmlTrackElement;
  87840. };
  87841. _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) {
  87842. var trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track);
  87843. this.remoteTextTrackEls().removeTrackElement_(trackElement);
  87844. this.remoteTextTracks().removeTrack(track);
  87845. this.autoRemoteTextTracks_.removeTrack(track);
  87846. };
  87847. _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {
  87848. return {};
  87849. };
  87850. _proto.requestPictureInPicture = function requestPictureInPicture() {
  87851. var PromiseClass = this.options_.Promise || window_1.Promise;
  87852. if (PromiseClass) {
  87853. return PromiseClass.reject();
  87854. }
  87855. };
  87856. _proto.disablePictureInPicture = function disablePictureInPicture() {
  87857. return true;
  87858. };
  87859. _proto.setDisablePictureInPicture = function setDisablePictureInPicture() {
  87860. };
  87861. _proto.requestVideoFrameCallback = function requestVideoFrameCallback(cb) {
  87862. var _this8 = this;
  87863. var id = newGUID();
  87864. if (!this.isReady_ || this.paused()) {
  87865. this.queuedHanders_.add(id);
  87866. this.one("playing", function() {
  87867. if (_this8.queuedHanders_.has(id)) {
  87868. _this8.queuedHanders_["delete"](id);
  87869. cb();
  87870. }
  87871. });
  87872. } else {
  87873. this.requestNamedAnimationFrame(id, cb);
  87874. }
  87875. return id;
  87876. };
  87877. _proto.cancelVideoFrameCallback = function cancelVideoFrameCallback(id) {
  87878. if (this.queuedHanders_.has(id)) {
  87879. this.queuedHanders_["delete"](id);
  87880. } else {
  87881. this.cancelNamedAnimationFrame(id);
  87882. }
  87883. };
  87884. _proto.setPoster = function setPoster() {
  87885. };
  87886. _proto.playsinline = function playsinline() {
  87887. };
  87888. _proto.setPlaysinline = function setPlaysinline() {
  87889. };
  87890. _proto.overrideNativeAudioTracks = function overrideNativeAudioTracks() {
  87891. };
  87892. _proto.overrideNativeVideoTracks = function overrideNativeVideoTracks() {
  87893. };
  87894. _proto.canPlayType = function canPlayType3() {
  87895. return "";
  87896. };
  87897. Tech2.canPlayType = function canPlayType3() {
  87898. return "";
  87899. };
  87900. Tech2.canPlaySource = function canPlaySource(srcObj, options2) {
  87901. return Tech2.canPlayType(srcObj.type);
  87902. };
  87903. Tech2.isTech = function isTech(component) {
  87904. return component.prototype instanceof Tech2 || component instanceof Tech2 || component === Tech2;
  87905. };
  87906. Tech2.registerTech = function registerTech(name, tech) {
  87907. if (!Tech2.techs_) {
  87908. Tech2.techs_ = {};
  87909. }
  87910. if (!Tech2.isTech(tech)) {
  87911. throw new Error("Tech " + name + " must be a Tech");
  87912. }
  87913. if (!Tech2.canPlayType) {
  87914. throw new Error("Techs must have a static canPlayType method on them");
  87915. }
  87916. if (!Tech2.canPlaySource) {
  87917. throw new Error("Techs must have a static canPlaySource method on them");
  87918. }
  87919. name = toTitleCase$1(name);
  87920. Tech2.techs_[name] = tech;
  87921. Tech2.techs_[toLowerCase(name)] = tech;
  87922. if (name !== "Tech") {
  87923. Tech2.defaultTechOrder_.push(name);
  87924. }
  87925. return tech;
  87926. };
  87927. Tech2.getTech = function getTech(name) {
  87928. if (!name) {
  87929. return;
  87930. }
  87931. if (Tech2.techs_ && Tech2.techs_[name]) {
  87932. return Tech2.techs_[name];
  87933. }
  87934. name = toTitleCase$1(name);
  87935. if (window_1 && window_1.videojs && window_1.videojs[name]) {
  87936. log$1.warn("The " + name + " tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)");
  87937. return window_1.videojs[name];
  87938. }
  87939. };
  87940. return Tech2;
  87941. }(Component$1);
  87942. ALL.names.forEach(function(name) {
  87943. var props = ALL[name];
  87944. Tech$1.prototype[props.getterName] = function() {
  87945. this[props.privateName] = this[props.privateName] || new props.ListClass();
  87946. return this[props.privateName];
  87947. };
  87948. });
  87949. Tech$1.prototype.featuresVolumeControl = true;
  87950. Tech$1.prototype.featuresMuteControl = true;
  87951. Tech$1.prototype.featuresFullscreenResize = false;
  87952. Tech$1.prototype.featuresPlaybackRate = false;
  87953. Tech$1.prototype.featuresProgressEvents = false;
  87954. Tech$1.prototype.featuresSourceset = false;
  87955. Tech$1.prototype.featuresTimeupdateEvents = false;
  87956. Tech$1.prototype.featuresNativeTextTracks = false;
  87957. Tech$1.prototype.featuresVideoFrameCallback = false;
  87958. Tech$1.withSourceHandlers = function(_Tech) {
  87959. _Tech.registerSourceHandler = function(handler, index2) {
  87960. var handlers = _Tech.sourceHandlers;
  87961. if (!handlers) {
  87962. handlers = _Tech.sourceHandlers = [];
  87963. }
  87964. if (index2 === void 0) {
  87965. index2 = handlers.length;
  87966. }
  87967. handlers.splice(index2, 0, handler);
  87968. };
  87969. _Tech.canPlayType = function(type2) {
  87970. var handlers = _Tech.sourceHandlers || [];
  87971. var can;
  87972. for (var i2 = 0; i2 < handlers.length; i2++) {
  87973. can = handlers[i2].canPlayType(type2);
  87974. if (can) {
  87975. return can;
  87976. }
  87977. }
  87978. return "";
  87979. };
  87980. _Tech.selectSourceHandler = function(source, options2) {
  87981. var handlers = _Tech.sourceHandlers || [];
  87982. var can;
  87983. for (var i2 = 0; i2 < handlers.length; i2++) {
  87984. can = handlers[i2].canHandleSource(source, options2);
  87985. if (can) {
  87986. return handlers[i2];
  87987. }
  87988. }
  87989. return null;
  87990. };
  87991. _Tech.canPlaySource = function(srcObj, options2) {
  87992. var sh = _Tech.selectSourceHandler(srcObj, options2);
  87993. if (sh) {
  87994. return sh.canHandleSource(srcObj, options2);
  87995. }
  87996. return "";
  87997. };
  87998. var deferrable = ["seekable", "seeking", "duration"];
  87999. deferrable.forEach(function(fnName) {
  88000. var originalFn = this[fnName];
  88001. if (typeof originalFn !== "function") {
  88002. return;
  88003. }
  88004. this[fnName] = function() {
  88005. if (this.sourceHandler_ && this.sourceHandler_[fnName]) {
  88006. return this.sourceHandler_[fnName].apply(this.sourceHandler_, arguments);
  88007. }
  88008. return originalFn.apply(this, arguments);
  88009. };
  88010. }, _Tech.prototype);
  88011. _Tech.prototype.setSource = function(source) {
  88012. var sh = _Tech.selectSourceHandler(source, this.options_);
  88013. if (!sh) {
  88014. if (_Tech.nativeSourceHandler) {
  88015. sh = _Tech.nativeSourceHandler;
  88016. } else {
  88017. log$1.error("No source handler found for the current source.");
  88018. }
  88019. }
  88020. this.disposeSourceHandler();
  88021. this.off("dispose", this.disposeSourceHandler_);
  88022. if (sh !== _Tech.nativeSourceHandler) {
  88023. this.currentSource_ = source;
  88024. }
  88025. this.sourceHandler_ = sh.handleSource(source, this, this.options_);
  88026. this.one("dispose", this.disposeSourceHandler_);
  88027. };
  88028. _Tech.prototype.disposeSourceHandler = function() {
  88029. if (this.currentSource_) {
  88030. this.clearTracks(["audio", "video"]);
  88031. this.currentSource_ = null;
  88032. }
  88033. this.cleanupAutoTextTracks();
  88034. if (this.sourceHandler_) {
  88035. if (this.sourceHandler_.dispose) {
  88036. this.sourceHandler_.dispose();
  88037. }
  88038. this.sourceHandler_ = null;
  88039. }
  88040. };
  88041. };
  88042. Component$1.registerComponent("Tech", Tech$1);
  88043. Tech$1.registerTech("Tech", Tech$1);
  88044. Tech$1.defaultTechOrder_ = [];
  88045. var middlewares = {};
  88046. var middlewareInstances = {};
  88047. var TERMINATOR = {};
  88048. function use(type2, middleware) {
  88049. middlewares[type2] = middlewares[type2] || [];
  88050. middlewares[type2].push(middleware);
  88051. }
  88052. function setSource(player, src, next) {
  88053. player.setTimeout(function() {
  88054. return setSourceHelper(src, middlewares[src.type], next, player);
  88055. }, 1);
  88056. }
  88057. function setTech(middleware, tech) {
  88058. middleware.forEach(function(mw) {
  88059. return mw.setTech && mw.setTech(tech);
  88060. });
  88061. }
  88062. function get(middleware, tech, method) {
  88063. return middleware.reduceRight(middlewareIterator(method), tech[method]());
  88064. }
  88065. function set(middleware, tech, method, arg) {
  88066. return tech[method](middleware.reduce(middlewareIterator(method), arg));
  88067. }
  88068. function mediate(middleware, tech, method, arg) {
  88069. if (arg === void 0) {
  88070. arg = null;
  88071. }
  88072. var callMethod = "call" + toTitleCase$1(method);
  88073. var middlewareValue = middleware.reduce(middlewareIterator(callMethod), arg);
  88074. var terminated = middlewareValue === TERMINATOR;
  88075. var returnValue = terminated ? null : tech[method](middlewareValue);
  88076. executeRight(middleware, method, returnValue, terminated);
  88077. return returnValue;
  88078. }
  88079. var allowedGetters = {
  88080. buffered: 1,
  88081. currentTime: 1,
  88082. duration: 1,
  88083. muted: 1,
  88084. played: 1,
  88085. paused: 1,
  88086. seekable: 1,
  88087. volume: 1,
  88088. ended: 1
  88089. };
  88090. var allowedSetters = {
  88091. setCurrentTime: 1,
  88092. setMuted: 1,
  88093. setVolume: 1
  88094. };
  88095. var allowedMediators = {
  88096. play: 1,
  88097. pause: 1
  88098. };
  88099. function middlewareIterator(method) {
  88100. return function(value, mw) {
  88101. if (value === TERMINATOR) {
  88102. return TERMINATOR;
  88103. }
  88104. if (mw[method]) {
  88105. return mw[method](value);
  88106. }
  88107. return value;
  88108. };
  88109. }
  88110. function executeRight(mws, method, value, terminated) {
  88111. for (var i2 = mws.length - 1; i2 >= 0; i2--) {
  88112. var mw = mws[i2];
  88113. if (mw[method]) {
  88114. mw[method](terminated, value);
  88115. }
  88116. }
  88117. }
  88118. function clearCacheForPlayer(player) {
  88119. middlewareInstances[player.id()] = null;
  88120. }
  88121. function getOrCreateFactory(player, mwFactory) {
  88122. var mws = middlewareInstances[player.id()];
  88123. var mw = null;
  88124. if (mws === void 0 || mws === null) {
  88125. mw = mwFactory(player);
  88126. middlewareInstances[player.id()] = [[mwFactory, mw]];
  88127. return mw;
  88128. }
  88129. for (var i2 = 0; i2 < mws.length; i2++) {
  88130. var _mws$i = mws[i2], mwf = _mws$i[0], mwi = _mws$i[1];
  88131. if (mwf !== mwFactory) {
  88132. continue;
  88133. }
  88134. mw = mwi;
  88135. }
  88136. if (mw === null) {
  88137. mw = mwFactory(player);
  88138. mws.push([mwFactory, mw]);
  88139. }
  88140. return mw;
  88141. }
  88142. function setSourceHelper(src, middleware, next, player, acc, lastRun) {
  88143. if (src === void 0) {
  88144. src = {};
  88145. }
  88146. if (middleware === void 0) {
  88147. middleware = [];
  88148. }
  88149. if (acc === void 0) {
  88150. acc = [];
  88151. }
  88152. if (lastRun === void 0) {
  88153. lastRun = false;
  88154. }
  88155. var _middleware = middleware, mwFactory = _middleware[0], mwrest = _middleware.slice(1);
  88156. if (typeof mwFactory === "string") {
  88157. setSourceHelper(src, middlewares[mwFactory], next, player, acc, lastRun);
  88158. } else if (mwFactory) {
  88159. var mw = getOrCreateFactory(player, mwFactory);
  88160. if (!mw.setSource) {
  88161. acc.push(mw);
  88162. return setSourceHelper(src, mwrest, next, player, acc, lastRun);
  88163. }
  88164. mw.setSource(assign({}, src), function(err, _src) {
  88165. if (err) {
  88166. return setSourceHelper(src, mwrest, next, player, acc, lastRun);
  88167. }
  88168. acc.push(mw);
  88169. setSourceHelper(_src, src.type === _src.type ? mwrest : middlewares[_src.type], next, player, acc, lastRun);
  88170. });
  88171. } else if (mwrest.length) {
  88172. setSourceHelper(src, mwrest, next, player, acc, lastRun);
  88173. } else if (lastRun) {
  88174. next(src, acc);
  88175. } else {
  88176. setSourceHelper(src, middlewares["*"], next, player, acc, true);
  88177. }
  88178. }
  88179. var MimetypesKind = {
  88180. opus: "video/ogg",
  88181. ogv: "video/ogg",
  88182. mp4: "video/mp4",
  88183. mov: "video/mp4",
  88184. m4v: "video/mp4",
  88185. mkv: "video/x-matroska",
  88186. m4a: "audio/mp4",
  88187. mp3: "audio/mpeg",
  88188. aac: "audio/aac",
  88189. caf: "audio/x-caf",
  88190. flac: "audio/flac",
  88191. oga: "audio/ogg",
  88192. wav: "audio/wav",
  88193. m3u8: "application/x-mpegURL",
  88194. mpd: "application/dash+xml",
  88195. jpg: "image/jpeg",
  88196. jpeg: "image/jpeg",
  88197. gif: "image/gif",
  88198. png: "image/png",
  88199. svg: "image/svg+xml",
  88200. webp: "image/webp"
  88201. };
  88202. var getMimetype = function getMimetype2(src) {
  88203. if (src === void 0) {
  88204. src = "";
  88205. }
  88206. var ext = getFileExtension(src);
  88207. var mimetype = MimetypesKind[ext.toLowerCase()];
  88208. return mimetype || "";
  88209. };
  88210. var findMimetype = function findMimetype2(player, src) {
  88211. if (!src) {
  88212. return "";
  88213. }
  88214. if (player.cache_.source.src === src && player.cache_.source.type) {
  88215. return player.cache_.source.type;
  88216. }
  88217. var matchingSources = player.cache_.sources.filter(function(s2) {
  88218. return s2.src === src;
  88219. });
  88220. if (matchingSources.length) {
  88221. return matchingSources[0].type;
  88222. }
  88223. var sources = player.$$("source");
  88224. for (var i2 = 0; i2 < sources.length; i2++) {
  88225. var s = sources[i2];
  88226. if (s.type && s.src && s.src === src) {
  88227. return s.type;
  88228. }
  88229. }
  88230. return getMimetype(src);
  88231. };
  88232. var filterSource = function filterSource2(src) {
  88233. if (Array.isArray(src)) {
  88234. var newsrc = [];
  88235. src.forEach(function(srcobj) {
  88236. srcobj = filterSource2(srcobj);
  88237. if (Array.isArray(srcobj)) {
  88238. newsrc = newsrc.concat(srcobj);
  88239. } else if (isObject2(srcobj)) {
  88240. newsrc.push(srcobj);
  88241. }
  88242. });
  88243. src = newsrc;
  88244. } else if (typeof src === "string" && src.trim()) {
  88245. src = [fixSource({
  88246. src
  88247. })];
  88248. } else if (isObject2(src) && typeof src.src === "string" && src.src && src.src.trim()) {
  88249. src = [fixSource(src)];
  88250. } else {
  88251. src = [];
  88252. }
  88253. return src;
  88254. };
  88255. function fixSource(src) {
  88256. if (!src.type) {
  88257. var mimetype = getMimetype(src.src);
  88258. if (mimetype) {
  88259. src.type = mimetype;
  88260. }
  88261. }
  88262. return src;
  88263. }
  88264. var MediaLoader = /* @__PURE__ */ function(_Component) {
  88265. _inheritsLoose(MediaLoader2, _Component);
  88266. function MediaLoader2(player, options2, ready) {
  88267. var _this;
  88268. var options_ = mergeOptions$3({
  88269. createEl: false
  88270. }, options2);
  88271. _this = _Component.call(this, player, options_, ready) || this;
  88272. if (!options2.playerOptions.sources || options2.playerOptions.sources.length === 0) {
  88273. for (var i2 = 0, j = options2.playerOptions.techOrder; i2 < j.length; i2++) {
  88274. var techName = toTitleCase$1(j[i2]);
  88275. var tech = Tech$1.getTech(techName);
  88276. if (!techName) {
  88277. tech = Component$1.getComponent(techName);
  88278. }
  88279. if (tech && tech.isSupported()) {
  88280. player.loadTech_(techName);
  88281. break;
  88282. }
  88283. }
  88284. } else {
  88285. player.src(options2.playerOptions.sources);
  88286. }
  88287. return _this;
  88288. }
  88289. return MediaLoader2;
  88290. }(Component$1);
  88291. Component$1.registerComponent("MediaLoader", MediaLoader);
  88292. var ClickableComponent = /* @__PURE__ */ function(_Component) {
  88293. _inheritsLoose(ClickableComponent2, _Component);
  88294. function ClickableComponent2(player, options2) {
  88295. var _this;
  88296. _this = _Component.call(this, player, options2) || this;
  88297. if (_this.options_.controlText) {
  88298. _this.controlText(_this.options_.controlText);
  88299. }
  88300. _this.handleMouseOver_ = function(e) {
  88301. return _this.handleMouseOver(e);
  88302. };
  88303. _this.handleMouseOut_ = function(e) {
  88304. return _this.handleMouseOut(e);
  88305. };
  88306. _this.handleClick_ = function(e) {
  88307. return _this.handleClick(e);
  88308. };
  88309. _this.handleKeyDown_ = function(e) {
  88310. return _this.handleKeyDown(e);
  88311. };
  88312. _this.emitTapEvents();
  88313. _this.enable();
  88314. return _this;
  88315. }
  88316. var _proto = ClickableComponent2.prototype;
  88317. _proto.createEl = function createEl$12(tag, props, attributes) {
  88318. if (tag === void 0) {
  88319. tag = "div";
  88320. }
  88321. if (props === void 0) {
  88322. props = {};
  88323. }
  88324. if (attributes === void 0) {
  88325. attributes = {};
  88326. }
  88327. props = assign({
  88328. className: this.buildCSSClass(),
  88329. tabIndex: 0
  88330. }, props);
  88331. if (tag === "button") {
  88332. log$1.error("Creating a ClickableComponent with an HTML element of " + tag + " is not supported; use a Button instead.");
  88333. }
  88334. attributes = assign({
  88335. role: "button"
  88336. }, attributes);
  88337. this.tabIndex_ = props.tabIndex;
  88338. var el = createEl(tag, props, attributes);
  88339. el.appendChild(createEl("span", {
  88340. className: "vjs-icon-placeholder"
  88341. }, {
  88342. "aria-hidden": true
  88343. }));
  88344. this.createControlTextEl(el);
  88345. return el;
  88346. };
  88347. _proto.dispose = function dispose() {
  88348. this.controlTextEl_ = null;
  88349. _Component.prototype.dispose.call(this);
  88350. };
  88351. _proto.createControlTextEl = function createControlTextEl(el) {
  88352. this.controlTextEl_ = createEl("span", {
  88353. className: "vjs-control-text"
  88354. }, {
  88355. "aria-live": "polite"
  88356. });
  88357. if (el) {
  88358. el.appendChild(this.controlTextEl_);
  88359. }
  88360. this.controlText(this.controlText_, el);
  88361. return this.controlTextEl_;
  88362. };
  88363. _proto.controlText = function controlText(text, el) {
  88364. if (el === void 0) {
  88365. el = this.el();
  88366. }
  88367. if (text === void 0) {
  88368. return this.controlText_ || "Need Text";
  88369. }
  88370. var localizedText = this.localize(text);
  88371. this.controlText_ = text;
  88372. textContent(this.controlTextEl_, localizedText);
  88373. if (!this.nonIconControl && !this.player_.options_.noUITitleAttributes) {
  88374. el.setAttribute("title", localizedText);
  88375. }
  88376. };
  88377. _proto.buildCSSClass = function buildCSSClass() {
  88378. return "vjs-control vjs-button " + _Component.prototype.buildCSSClass.call(this);
  88379. };
  88380. _proto.enable = function enable() {
  88381. if (!this.enabled_) {
  88382. this.enabled_ = true;
  88383. this.removeClass("vjs-disabled");
  88384. this.el_.setAttribute("aria-disabled", "false");
  88385. if (typeof this.tabIndex_ !== "undefined") {
  88386. this.el_.setAttribute("tabIndex", this.tabIndex_);
  88387. }
  88388. this.on(["tap", "click"], this.handleClick_);
  88389. this.on("keydown", this.handleKeyDown_);
  88390. }
  88391. };
  88392. _proto.disable = function disable() {
  88393. this.enabled_ = false;
  88394. this.addClass("vjs-disabled");
  88395. this.el_.setAttribute("aria-disabled", "true");
  88396. if (typeof this.tabIndex_ !== "undefined") {
  88397. this.el_.removeAttribute("tabIndex");
  88398. }
  88399. this.off("mouseover", this.handleMouseOver_);
  88400. this.off("mouseout", this.handleMouseOut_);
  88401. this.off(["tap", "click"], this.handleClick_);
  88402. this.off("keydown", this.handleKeyDown_);
  88403. };
  88404. _proto.handleLanguagechange = function handleLanguagechange() {
  88405. this.controlText(this.controlText_);
  88406. };
  88407. _proto.handleClick = function handleClick(event2) {
  88408. if (this.options_.clickHandler) {
  88409. this.options_.clickHandler.call(this, arguments);
  88410. }
  88411. };
  88412. _proto.handleKeyDown = function handleKeyDown(event2) {
  88413. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  88414. event2.preventDefault();
  88415. event2.stopPropagation();
  88416. this.trigger("click");
  88417. } else {
  88418. _Component.prototype.handleKeyDown.call(this, event2);
  88419. }
  88420. };
  88421. return ClickableComponent2;
  88422. }(Component$1);
  88423. Component$1.registerComponent("ClickableComponent", ClickableComponent);
  88424. var PosterImage = /* @__PURE__ */ function(_ClickableComponent) {
  88425. _inheritsLoose(PosterImage2, _ClickableComponent);
  88426. function PosterImage2(player, options2) {
  88427. var _this;
  88428. _this = _ClickableComponent.call(this, player, options2) || this;
  88429. _this.update();
  88430. _this.update_ = function(e) {
  88431. return _this.update(e);
  88432. };
  88433. player.on("posterchange", _this.update_);
  88434. return _this;
  88435. }
  88436. var _proto = PosterImage2.prototype;
  88437. _proto.dispose = function dispose() {
  88438. this.player().off("posterchange", this.update_);
  88439. _ClickableComponent.prototype.dispose.call(this);
  88440. };
  88441. _proto.createEl = function createEl$12() {
  88442. var el = createEl("div", {
  88443. className: "vjs-poster",
  88444. tabIndex: -1
  88445. });
  88446. return el;
  88447. };
  88448. _proto.update = function update(event2) {
  88449. var url = this.player().poster();
  88450. this.setSrc(url);
  88451. if (url) {
  88452. this.show();
  88453. } else {
  88454. this.hide();
  88455. }
  88456. };
  88457. _proto.setSrc = function setSrc(url) {
  88458. var backgroundImage = "";
  88459. if (url) {
  88460. backgroundImage = 'url("' + url + '")';
  88461. }
  88462. this.el_.style.backgroundImage = backgroundImage;
  88463. };
  88464. _proto.handleClick = function handleClick(event2) {
  88465. if (!this.player_.controls()) {
  88466. return;
  88467. }
  88468. var sourceIsEncrypted = this.player_.usingPlugin("eme") && this.player_.eme.sessions && this.player_.eme.sessions.length > 0;
  88469. if (this.player_.tech(true) && !((IE_VERSION || IS_EDGE) && sourceIsEncrypted)) {
  88470. this.player_.tech(true).focus();
  88471. }
  88472. if (this.player_.paused()) {
  88473. silencePromise(this.player_.play());
  88474. } else {
  88475. this.player_.pause();
  88476. }
  88477. };
  88478. return PosterImage2;
  88479. }(ClickableComponent);
  88480. Component$1.registerComponent("PosterImage", PosterImage);
  88481. var darkGray = "#222";
  88482. var lightGray = "#ccc";
  88483. var fontMap = {
  88484. monospace: "monospace",
  88485. sansSerif: "sans-serif",
  88486. serif: "serif",
  88487. monospaceSansSerif: '"Andale Mono", "Lucida Console", monospace',
  88488. monospaceSerif: '"Courier New", monospace',
  88489. proportionalSansSerif: "sans-serif",
  88490. proportionalSerif: "serif",
  88491. casual: '"Comic Sans MS", Impact, fantasy',
  88492. script: '"Monotype Corsiva", cursive',
  88493. smallcaps: '"Andale Mono", "Lucida Console", monospace, sans-serif'
  88494. };
  88495. function constructColor(color2, opacity) {
  88496. var hex;
  88497. if (color2.length === 4) {
  88498. hex = color2[1] + color2[1] + color2[2] + color2[2] + color2[3] + color2[3];
  88499. } else if (color2.length === 7) {
  88500. hex = color2.slice(1);
  88501. } else {
  88502. throw new Error("Invalid color code provided, " + color2 + "; must be formatted as e.g. #f0e or #f604e2.");
  88503. }
  88504. return "rgba(" + parseInt(hex.slice(0, 2), 16) + "," + parseInt(hex.slice(2, 4), 16) + "," + parseInt(hex.slice(4, 6), 16) + "," + opacity + ")";
  88505. }
  88506. function tryUpdateStyle(el, style, rule) {
  88507. try {
  88508. el.style[style] = rule;
  88509. } catch (e) {
  88510. return;
  88511. }
  88512. }
  88513. var TextTrackDisplay = /* @__PURE__ */ function(_Component) {
  88514. _inheritsLoose(TextTrackDisplay2, _Component);
  88515. function TextTrackDisplay2(player, options2, ready) {
  88516. var _this;
  88517. _this = _Component.call(this, player, options2, ready) || this;
  88518. var updateDisplayHandler = function updateDisplayHandler2(e) {
  88519. return _this.updateDisplay(e);
  88520. };
  88521. player.on("loadstart", function(e) {
  88522. return _this.toggleDisplay(e);
  88523. });
  88524. player.on("texttrackchange", updateDisplayHandler);
  88525. player.on("loadedmetadata", function(e) {
  88526. return _this.preselectTrack(e);
  88527. });
  88528. player.ready(bind(_assertThisInitialized(_this), function() {
  88529. if (player.tech_ && player.tech_.featuresNativeTextTracks) {
  88530. this.hide();
  88531. return;
  88532. }
  88533. player.on("fullscreenchange", updateDisplayHandler);
  88534. player.on("playerresize", updateDisplayHandler);
  88535. window_1.addEventListener("orientationchange", updateDisplayHandler);
  88536. player.on("dispose", function() {
  88537. return window_1.removeEventListener("orientationchange", updateDisplayHandler);
  88538. });
  88539. var tracks = this.options_.playerOptions.tracks || [];
  88540. for (var i2 = 0; i2 < tracks.length; i2++) {
  88541. this.player_.addRemoteTextTrack(tracks[i2], true);
  88542. }
  88543. this.preselectTrack();
  88544. }));
  88545. return _this;
  88546. }
  88547. var _proto = TextTrackDisplay2.prototype;
  88548. _proto.preselectTrack = function preselectTrack() {
  88549. var modes = {
  88550. captions: 1,
  88551. subtitles: 1
  88552. };
  88553. var trackList = this.player_.textTracks();
  88554. var userPref = this.player_.cache_.selectedLanguage;
  88555. var firstDesc;
  88556. var firstCaptions;
  88557. var preferredTrack;
  88558. for (var i2 = 0; i2 < trackList.length; i2++) {
  88559. var track = trackList[i2];
  88560. if (userPref && userPref.enabled && userPref.language && userPref.language === track.language && track.kind in modes) {
  88561. if (track.kind === userPref.kind) {
  88562. preferredTrack = track;
  88563. } else if (!preferredTrack) {
  88564. preferredTrack = track;
  88565. }
  88566. } else if (userPref && !userPref.enabled) {
  88567. preferredTrack = null;
  88568. firstDesc = null;
  88569. firstCaptions = null;
  88570. } else if (track["default"]) {
  88571. if (track.kind === "descriptions" && !firstDesc) {
  88572. firstDesc = track;
  88573. } else if (track.kind in modes && !firstCaptions) {
  88574. firstCaptions = track;
  88575. }
  88576. }
  88577. }
  88578. if (preferredTrack) {
  88579. preferredTrack.mode = "showing";
  88580. } else if (firstCaptions) {
  88581. firstCaptions.mode = "showing";
  88582. } else if (firstDesc) {
  88583. firstDesc.mode = "showing";
  88584. }
  88585. };
  88586. _proto.toggleDisplay = function toggleDisplay() {
  88587. if (this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks) {
  88588. this.hide();
  88589. } else {
  88590. this.show();
  88591. }
  88592. };
  88593. _proto.createEl = function createEl2() {
  88594. return _Component.prototype.createEl.call(this, "div", {
  88595. className: "vjs-text-track-display"
  88596. }, {
  88597. "translate": "yes",
  88598. "aria-live": "off",
  88599. "aria-atomic": "true"
  88600. });
  88601. };
  88602. _proto.clearDisplay = function clearDisplay() {
  88603. if (typeof window_1.WebVTT === "function") {
  88604. window_1.WebVTT.processCues(window_1, [], this.el_);
  88605. }
  88606. };
  88607. _proto.updateDisplay = function updateDisplay() {
  88608. var tracks = this.player_.textTracks();
  88609. var allowMultipleShowingTracks = this.options_.allowMultipleShowingTracks;
  88610. this.clearDisplay();
  88611. if (allowMultipleShowingTracks) {
  88612. var showingTracks = [];
  88613. for (var _i = 0; _i < tracks.length; ++_i) {
  88614. var track = tracks[_i];
  88615. if (track.mode !== "showing") {
  88616. continue;
  88617. }
  88618. showingTracks.push(track);
  88619. }
  88620. this.updateForTrack(showingTracks);
  88621. return;
  88622. }
  88623. var descriptionsTrack = null;
  88624. var captionsSubtitlesTrack = null;
  88625. var i2 = tracks.length;
  88626. while (i2--) {
  88627. var _track = tracks[i2];
  88628. if (_track.mode === "showing") {
  88629. if (_track.kind === "descriptions") {
  88630. descriptionsTrack = _track;
  88631. } else {
  88632. captionsSubtitlesTrack = _track;
  88633. }
  88634. }
  88635. }
  88636. if (captionsSubtitlesTrack) {
  88637. if (this.getAttribute("aria-live") !== "off") {
  88638. this.setAttribute("aria-live", "off");
  88639. }
  88640. this.updateForTrack(captionsSubtitlesTrack);
  88641. } else if (descriptionsTrack) {
  88642. if (this.getAttribute("aria-live") !== "assertive") {
  88643. this.setAttribute("aria-live", "assertive");
  88644. }
  88645. this.updateForTrack(descriptionsTrack);
  88646. }
  88647. };
  88648. _proto.updateDisplayState = function updateDisplayState(track) {
  88649. var overrides = this.player_.textTrackSettings.getValues();
  88650. var cues = track.activeCues;
  88651. var i2 = cues.length;
  88652. while (i2--) {
  88653. var cue = cues[i2];
  88654. if (!cue) {
  88655. continue;
  88656. }
  88657. var cueDiv = cue.displayState;
  88658. if (overrides.color) {
  88659. cueDiv.firstChild.style.color = overrides.color;
  88660. }
  88661. if (overrides.textOpacity) {
  88662. tryUpdateStyle(cueDiv.firstChild, "color", constructColor(overrides.color || "#fff", overrides.textOpacity));
  88663. }
  88664. if (overrides.backgroundColor) {
  88665. cueDiv.firstChild.style.backgroundColor = overrides.backgroundColor;
  88666. }
  88667. if (overrides.backgroundOpacity) {
  88668. tryUpdateStyle(cueDiv.firstChild, "backgroundColor", constructColor(overrides.backgroundColor || "#000", overrides.backgroundOpacity));
  88669. }
  88670. if (overrides.windowColor) {
  88671. if (overrides.windowOpacity) {
  88672. tryUpdateStyle(cueDiv, "backgroundColor", constructColor(overrides.windowColor, overrides.windowOpacity));
  88673. } else {
  88674. cueDiv.style.backgroundColor = overrides.windowColor;
  88675. }
  88676. }
  88677. if (overrides.edgeStyle) {
  88678. if (overrides.edgeStyle === "dropshadow") {
  88679. cueDiv.firstChild.style.textShadow = "2px 2px 3px " + darkGray + ", 2px 2px 4px " + darkGray + ", 2px 2px 5px " + darkGray;
  88680. } else if (overrides.edgeStyle === "raised") {
  88681. cueDiv.firstChild.style.textShadow = "1px 1px " + darkGray + ", 2px 2px " + darkGray + ", 3px 3px " + darkGray;
  88682. } else if (overrides.edgeStyle === "depressed") {
  88683. cueDiv.firstChild.style.textShadow = "1px 1px " + lightGray + ", 0 1px " + lightGray + ", -1px -1px " + darkGray + ", 0 -1px " + darkGray;
  88684. } else if (overrides.edgeStyle === "uniform") {
  88685. cueDiv.firstChild.style.textShadow = "0 0 4px " + darkGray + ", 0 0 4px " + darkGray + ", 0 0 4px " + darkGray + ", 0 0 4px " + darkGray;
  88686. }
  88687. }
  88688. if (overrides.fontPercent && overrides.fontPercent !== 1) {
  88689. var fontSize = window_1.parseFloat(cueDiv.style.fontSize);
  88690. cueDiv.style.fontSize = fontSize * overrides.fontPercent + "px";
  88691. cueDiv.style.height = "auto";
  88692. cueDiv.style.top = "auto";
  88693. }
  88694. if (overrides.fontFamily && overrides.fontFamily !== "default") {
  88695. if (overrides.fontFamily === "small-caps") {
  88696. cueDiv.firstChild.style.fontVariant = "small-caps";
  88697. } else {
  88698. cueDiv.firstChild.style.fontFamily = fontMap[overrides.fontFamily];
  88699. }
  88700. }
  88701. }
  88702. };
  88703. _proto.updateForTrack = function updateForTrack(tracks) {
  88704. if (!Array.isArray(tracks)) {
  88705. tracks = [tracks];
  88706. }
  88707. if (typeof window_1.WebVTT !== "function" || tracks.every(function(track2) {
  88708. return !track2.activeCues;
  88709. })) {
  88710. return;
  88711. }
  88712. var cues = [];
  88713. for (var i2 = 0; i2 < tracks.length; ++i2) {
  88714. var track = tracks[i2];
  88715. for (var j = 0; j < track.activeCues.length; ++j) {
  88716. cues.push(track.activeCues[j]);
  88717. }
  88718. }
  88719. window_1.WebVTT.processCues(window_1, cues, this.el_);
  88720. for (var _i2 = 0; _i2 < tracks.length; ++_i2) {
  88721. var _track2 = tracks[_i2];
  88722. for (var _j = 0; _j < _track2.activeCues.length; ++_j) {
  88723. var cueEl = _track2.activeCues[_j].displayState;
  88724. addClass(cueEl, "vjs-text-track-cue");
  88725. addClass(cueEl, "vjs-text-track-cue-" + (_track2.language ? _track2.language : _i2));
  88726. if (_track2.language) {
  88727. setAttribute(cueEl, "lang", _track2.language);
  88728. }
  88729. }
  88730. if (this.player_.textTrackSettings) {
  88731. this.updateDisplayState(_track2);
  88732. }
  88733. }
  88734. };
  88735. return TextTrackDisplay2;
  88736. }(Component$1);
  88737. Component$1.registerComponent("TextTrackDisplay", TextTrackDisplay);
  88738. var LoadingSpinner = /* @__PURE__ */ function(_Component) {
  88739. _inheritsLoose(LoadingSpinner2, _Component);
  88740. function LoadingSpinner2() {
  88741. return _Component.apply(this, arguments) || this;
  88742. }
  88743. var _proto = LoadingSpinner2.prototype;
  88744. _proto.createEl = function createEl$12() {
  88745. var isAudio = this.player_.isAudio();
  88746. var playerType = this.localize(isAudio ? "Audio Player" : "Video Player");
  88747. var controlText = createEl("span", {
  88748. className: "vjs-control-text",
  88749. textContent: this.localize("{1} is loading.", [playerType])
  88750. });
  88751. var el = _Component.prototype.createEl.call(this, "div", {
  88752. className: "vjs-loading-spinner",
  88753. dir: "ltr"
  88754. });
  88755. el.appendChild(controlText);
  88756. return el;
  88757. };
  88758. return LoadingSpinner2;
  88759. }(Component$1);
  88760. Component$1.registerComponent("LoadingSpinner", LoadingSpinner);
  88761. var Button = /* @__PURE__ */ function(_ClickableComponent) {
  88762. _inheritsLoose(Button2, _ClickableComponent);
  88763. function Button2() {
  88764. return _ClickableComponent.apply(this, arguments) || this;
  88765. }
  88766. var _proto = Button2.prototype;
  88767. _proto.createEl = function createEl$12(tag, props, attributes) {
  88768. if (props === void 0) {
  88769. props = {};
  88770. }
  88771. if (attributes === void 0) {
  88772. attributes = {};
  88773. }
  88774. tag = "button";
  88775. props = assign({
  88776. className: this.buildCSSClass()
  88777. }, props);
  88778. attributes = assign({
  88779. type: "button"
  88780. }, attributes);
  88781. var el = createEl(tag, props, attributes);
  88782. el.appendChild(createEl("span", {
  88783. className: "vjs-icon-placeholder"
  88784. }, {
  88785. "aria-hidden": true
  88786. }));
  88787. this.createControlTextEl(el);
  88788. return el;
  88789. };
  88790. _proto.addChild = function addChild(child, options2) {
  88791. if (options2 === void 0) {
  88792. options2 = {};
  88793. }
  88794. var className = this.constructor.name;
  88795. log$1.warn("Adding an actionable (user controllable) child to a Button (" + className + ") is not supported; use a ClickableComponent instead.");
  88796. return Component$1.prototype.addChild.call(this, child, options2);
  88797. };
  88798. _proto.enable = function enable() {
  88799. _ClickableComponent.prototype.enable.call(this);
  88800. this.el_.removeAttribute("disabled");
  88801. };
  88802. _proto.disable = function disable() {
  88803. _ClickableComponent.prototype.disable.call(this);
  88804. this.el_.setAttribute("disabled", "disabled");
  88805. };
  88806. _proto.handleKeyDown = function handleKeyDown(event2) {
  88807. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  88808. event2.stopPropagation();
  88809. return;
  88810. }
  88811. _ClickableComponent.prototype.handleKeyDown.call(this, event2);
  88812. };
  88813. return Button2;
  88814. }(ClickableComponent);
  88815. Component$1.registerComponent("Button", Button);
  88816. var BigPlayButton = /* @__PURE__ */ function(_Button) {
  88817. _inheritsLoose(BigPlayButton2, _Button);
  88818. function BigPlayButton2(player, options2) {
  88819. var _this;
  88820. _this = _Button.call(this, player, options2) || this;
  88821. _this.mouseused_ = false;
  88822. _this.on("mousedown", function(e) {
  88823. return _this.handleMouseDown(e);
  88824. });
  88825. return _this;
  88826. }
  88827. var _proto = BigPlayButton2.prototype;
  88828. _proto.buildCSSClass = function buildCSSClass() {
  88829. return "vjs-big-play-button";
  88830. };
  88831. _proto.handleClick = function handleClick(event2) {
  88832. var playPromise = this.player_.play();
  88833. if (this.mouseused_ && event2.clientX && event2.clientY) {
  88834. var sourceIsEncrypted = this.player_.usingPlugin("eme") && this.player_.eme.sessions && this.player_.eme.sessions.length > 0;
  88835. silencePromise(playPromise);
  88836. if (this.player_.tech(true) && !((IE_VERSION || IS_EDGE) && sourceIsEncrypted)) {
  88837. this.player_.tech(true).focus();
  88838. }
  88839. return;
  88840. }
  88841. var cb = this.player_.getChild("controlBar");
  88842. var playToggle = cb && cb.getChild("playToggle");
  88843. if (!playToggle) {
  88844. this.player_.tech(true).focus();
  88845. return;
  88846. }
  88847. var playFocus = function playFocus2() {
  88848. return playToggle.focus();
  88849. };
  88850. if (isPromise(playPromise)) {
  88851. playPromise.then(playFocus, function() {
  88852. });
  88853. } else {
  88854. this.setTimeout(playFocus, 1);
  88855. }
  88856. };
  88857. _proto.handleKeyDown = function handleKeyDown(event2) {
  88858. this.mouseused_ = false;
  88859. _Button.prototype.handleKeyDown.call(this, event2);
  88860. };
  88861. _proto.handleMouseDown = function handleMouseDown(event2) {
  88862. this.mouseused_ = true;
  88863. };
  88864. return BigPlayButton2;
  88865. }(Button);
  88866. BigPlayButton.prototype.controlText_ = "Play Video";
  88867. Component$1.registerComponent("BigPlayButton", BigPlayButton);
  88868. var CloseButton = /* @__PURE__ */ function(_Button) {
  88869. _inheritsLoose(CloseButton2, _Button);
  88870. function CloseButton2(player, options2) {
  88871. var _this;
  88872. _this = _Button.call(this, player, options2) || this;
  88873. _this.controlText(options2 && options2.controlText || _this.localize("Close"));
  88874. return _this;
  88875. }
  88876. var _proto = CloseButton2.prototype;
  88877. _proto.buildCSSClass = function buildCSSClass() {
  88878. return "vjs-close-button " + _Button.prototype.buildCSSClass.call(this);
  88879. };
  88880. _proto.handleClick = function handleClick(event2) {
  88881. this.trigger({
  88882. type: "close",
  88883. bubbles: false
  88884. });
  88885. };
  88886. _proto.handleKeyDown = function handleKeyDown(event2) {
  88887. if (keycode.isEventKey(event2, "Esc")) {
  88888. event2.preventDefault();
  88889. event2.stopPropagation();
  88890. this.trigger("click");
  88891. } else {
  88892. _Button.prototype.handleKeyDown.call(this, event2);
  88893. }
  88894. };
  88895. return CloseButton2;
  88896. }(Button);
  88897. Component$1.registerComponent("CloseButton", CloseButton);
  88898. var PlayToggle = /* @__PURE__ */ function(_Button) {
  88899. _inheritsLoose(PlayToggle2, _Button);
  88900. function PlayToggle2(player, options2) {
  88901. var _this;
  88902. if (options2 === void 0) {
  88903. options2 = {};
  88904. }
  88905. _this = _Button.call(this, player, options2) || this;
  88906. options2.replay = options2.replay === void 0 || options2.replay;
  88907. _this.on(player, "play", function(e) {
  88908. return _this.handlePlay(e);
  88909. });
  88910. _this.on(player, "pause", function(e) {
  88911. return _this.handlePause(e);
  88912. });
  88913. if (options2.replay) {
  88914. _this.on(player, "ended", function(e) {
  88915. return _this.handleEnded(e);
  88916. });
  88917. }
  88918. return _this;
  88919. }
  88920. var _proto = PlayToggle2.prototype;
  88921. _proto.buildCSSClass = function buildCSSClass() {
  88922. return "vjs-play-control " + _Button.prototype.buildCSSClass.call(this);
  88923. };
  88924. _proto.handleClick = function handleClick(event2) {
  88925. if (this.player_.paused()) {
  88926. silencePromise(this.player_.play());
  88927. } else {
  88928. this.player_.pause();
  88929. }
  88930. };
  88931. _proto.handleSeeked = function handleSeeked(event2) {
  88932. this.removeClass("vjs-ended");
  88933. if (this.player_.paused()) {
  88934. this.handlePause(event2);
  88935. } else {
  88936. this.handlePlay(event2);
  88937. }
  88938. };
  88939. _proto.handlePlay = function handlePlay(event2) {
  88940. this.removeClass("vjs-ended");
  88941. this.removeClass("vjs-paused");
  88942. this.addClass("vjs-playing");
  88943. this.controlText("Pause");
  88944. };
  88945. _proto.handlePause = function handlePause(event2) {
  88946. this.removeClass("vjs-playing");
  88947. this.addClass("vjs-paused");
  88948. this.controlText("Play");
  88949. };
  88950. _proto.handleEnded = function handleEnded(event2) {
  88951. var _this2 = this;
  88952. this.removeClass("vjs-playing");
  88953. this.addClass("vjs-ended");
  88954. this.controlText("Replay");
  88955. this.one(this.player_, "seeked", function(e) {
  88956. return _this2.handleSeeked(e);
  88957. });
  88958. };
  88959. return PlayToggle2;
  88960. }(Button);
  88961. PlayToggle.prototype.controlText_ = "Play";
  88962. Component$1.registerComponent("PlayToggle", PlayToggle);
  88963. var defaultImplementation = function defaultImplementation2(seconds, guide) {
  88964. seconds = seconds < 0 ? 0 : seconds;
  88965. var s = Math.floor(seconds % 60);
  88966. var m = Math.floor(seconds / 60 % 60);
  88967. var h2 = Math.floor(seconds / 3600);
  88968. var gm = Math.floor(guide / 60 % 60);
  88969. var gh = Math.floor(guide / 3600);
  88970. if (isNaN(seconds) || seconds === Infinity) {
  88971. h2 = m = s = "-";
  88972. }
  88973. h2 = h2 > 0 || gh > 0 ? h2 + ":" : "";
  88974. m = ((h2 || gm >= 10) && m < 10 ? "0" + m : m) + ":";
  88975. s = s < 10 ? "0" + s : s;
  88976. return h2 + m + s;
  88977. };
  88978. var implementation = defaultImplementation;
  88979. function setFormatTime(customImplementation) {
  88980. implementation = customImplementation;
  88981. }
  88982. function resetFormatTime() {
  88983. implementation = defaultImplementation;
  88984. }
  88985. function formatTime(seconds, guide) {
  88986. if (guide === void 0) {
  88987. guide = seconds;
  88988. }
  88989. return implementation(seconds, guide);
  88990. }
  88991. var TimeDisplay = /* @__PURE__ */ function(_Component) {
  88992. _inheritsLoose(TimeDisplay2, _Component);
  88993. function TimeDisplay2(player, options2) {
  88994. var _this;
  88995. _this = _Component.call(this, player, options2) || this;
  88996. _this.on(player, ["timeupdate", "ended"], function(e) {
  88997. return _this.updateContent(e);
  88998. });
  88999. _this.updateTextNode_();
  89000. return _this;
  89001. }
  89002. var _proto = TimeDisplay2.prototype;
  89003. _proto.createEl = function createEl$12() {
  89004. var className = this.buildCSSClass();
  89005. var el = _Component.prototype.createEl.call(this, "div", {
  89006. className: className + " vjs-time-control vjs-control"
  89007. });
  89008. var span = createEl("span", {
  89009. className: "vjs-control-text",
  89010. textContent: this.localize(this.labelText_) + "\xA0"
  89011. }, {
  89012. role: "presentation"
  89013. });
  89014. el.appendChild(span);
  89015. this.contentEl_ = createEl("span", {
  89016. className: className + "-display"
  89017. }, {
  89018. "aria-live": "off",
  89019. "role": "presentation"
  89020. });
  89021. el.appendChild(this.contentEl_);
  89022. return el;
  89023. };
  89024. _proto.dispose = function dispose() {
  89025. this.contentEl_ = null;
  89026. this.textNode_ = null;
  89027. _Component.prototype.dispose.call(this);
  89028. };
  89029. _proto.updateTextNode_ = function updateTextNode_(time) {
  89030. var _this2 = this;
  89031. if (time === void 0) {
  89032. time = 0;
  89033. }
  89034. time = formatTime(time);
  89035. if (this.formattedTime_ === time) {
  89036. return;
  89037. }
  89038. this.formattedTime_ = time;
  89039. this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_", function() {
  89040. if (!_this2.contentEl_) {
  89041. return;
  89042. }
  89043. var oldNode = _this2.textNode_;
  89044. if (oldNode && _this2.contentEl_.firstChild !== oldNode) {
  89045. oldNode = null;
  89046. log$1.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.");
  89047. }
  89048. _this2.textNode_ = document_1.createTextNode(_this2.formattedTime_);
  89049. if (!_this2.textNode_) {
  89050. return;
  89051. }
  89052. if (oldNode) {
  89053. _this2.contentEl_.replaceChild(_this2.textNode_, oldNode);
  89054. } else {
  89055. _this2.contentEl_.appendChild(_this2.textNode_);
  89056. }
  89057. });
  89058. };
  89059. _proto.updateContent = function updateContent(event2) {
  89060. };
  89061. return TimeDisplay2;
  89062. }(Component$1);
  89063. TimeDisplay.prototype.labelText_ = "Time";
  89064. TimeDisplay.prototype.controlText_ = "Time";
  89065. Component$1.registerComponent("TimeDisplay", TimeDisplay);
  89066. var CurrentTimeDisplay = /* @__PURE__ */ function(_TimeDisplay) {
  89067. _inheritsLoose(CurrentTimeDisplay2, _TimeDisplay);
  89068. function CurrentTimeDisplay2() {
  89069. return _TimeDisplay.apply(this, arguments) || this;
  89070. }
  89071. var _proto = CurrentTimeDisplay2.prototype;
  89072. _proto.buildCSSClass = function buildCSSClass() {
  89073. return "vjs-current-time";
  89074. };
  89075. _proto.updateContent = function updateContent(event2) {
  89076. var time;
  89077. if (this.player_.ended()) {
  89078. time = this.player_.duration();
  89079. } else {
  89080. time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  89081. }
  89082. this.updateTextNode_(time);
  89083. };
  89084. return CurrentTimeDisplay2;
  89085. }(TimeDisplay);
  89086. CurrentTimeDisplay.prototype.labelText_ = "Current Time";
  89087. CurrentTimeDisplay.prototype.controlText_ = "Current Time";
  89088. Component$1.registerComponent("CurrentTimeDisplay", CurrentTimeDisplay);
  89089. var DurationDisplay = /* @__PURE__ */ function(_TimeDisplay) {
  89090. _inheritsLoose(DurationDisplay2, _TimeDisplay);
  89091. function DurationDisplay2(player, options2) {
  89092. var _this;
  89093. _this = _TimeDisplay.call(this, player, options2) || this;
  89094. var updateContent = function updateContent2(e) {
  89095. return _this.updateContent(e);
  89096. };
  89097. _this.on(player, "durationchange", updateContent);
  89098. _this.on(player, "loadstart", updateContent);
  89099. _this.on(player, "loadedmetadata", updateContent);
  89100. return _this;
  89101. }
  89102. var _proto = DurationDisplay2.prototype;
  89103. _proto.buildCSSClass = function buildCSSClass() {
  89104. return "vjs-duration";
  89105. };
  89106. _proto.updateContent = function updateContent(event2) {
  89107. var duration5 = this.player_.duration();
  89108. this.updateTextNode_(duration5);
  89109. };
  89110. return DurationDisplay2;
  89111. }(TimeDisplay);
  89112. DurationDisplay.prototype.labelText_ = "Duration";
  89113. DurationDisplay.prototype.controlText_ = "Duration";
  89114. Component$1.registerComponent("DurationDisplay", DurationDisplay);
  89115. var TimeDivider = /* @__PURE__ */ function(_Component) {
  89116. _inheritsLoose(TimeDivider2, _Component);
  89117. function TimeDivider2() {
  89118. return _Component.apply(this, arguments) || this;
  89119. }
  89120. var _proto = TimeDivider2.prototype;
  89121. _proto.createEl = function createEl2() {
  89122. var el = _Component.prototype.createEl.call(this, "div", {
  89123. className: "vjs-time-control vjs-time-divider"
  89124. }, {
  89125. "aria-hidden": true
  89126. });
  89127. var div = _Component.prototype.createEl.call(this, "div");
  89128. var span = _Component.prototype.createEl.call(this, "span", {
  89129. textContent: "/"
  89130. });
  89131. div.appendChild(span);
  89132. el.appendChild(div);
  89133. return el;
  89134. };
  89135. return TimeDivider2;
  89136. }(Component$1);
  89137. Component$1.registerComponent("TimeDivider", TimeDivider);
  89138. var RemainingTimeDisplay = /* @__PURE__ */ function(_TimeDisplay) {
  89139. _inheritsLoose(RemainingTimeDisplay2, _TimeDisplay);
  89140. function RemainingTimeDisplay2(player, options2) {
  89141. var _this;
  89142. _this = _TimeDisplay.call(this, player, options2) || this;
  89143. _this.on(player, "durationchange", function(e) {
  89144. return _this.updateContent(e);
  89145. });
  89146. return _this;
  89147. }
  89148. var _proto = RemainingTimeDisplay2.prototype;
  89149. _proto.buildCSSClass = function buildCSSClass() {
  89150. return "vjs-remaining-time";
  89151. };
  89152. _proto.createEl = function createEl$12() {
  89153. var el = _TimeDisplay.prototype.createEl.call(this);
  89154. if (this.options_.displayNegative !== false) {
  89155. el.insertBefore(createEl("span", {}, {
  89156. "aria-hidden": true
  89157. }, "-"), this.contentEl_);
  89158. }
  89159. return el;
  89160. };
  89161. _proto.updateContent = function updateContent(event2) {
  89162. if (typeof this.player_.duration() !== "number") {
  89163. return;
  89164. }
  89165. var time;
  89166. if (this.player_.ended()) {
  89167. time = 0;
  89168. } else if (this.player_.remainingTimeDisplay) {
  89169. time = this.player_.remainingTimeDisplay();
  89170. } else {
  89171. time = this.player_.remainingTime();
  89172. }
  89173. this.updateTextNode_(time);
  89174. };
  89175. return RemainingTimeDisplay2;
  89176. }(TimeDisplay);
  89177. RemainingTimeDisplay.prototype.labelText_ = "Remaining Time";
  89178. RemainingTimeDisplay.prototype.controlText_ = "Remaining Time";
  89179. Component$1.registerComponent("RemainingTimeDisplay", RemainingTimeDisplay);
  89180. var LiveDisplay = /* @__PURE__ */ function(_Component) {
  89181. _inheritsLoose(LiveDisplay2, _Component);
  89182. function LiveDisplay2(player, options2) {
  89183. var _this;
  89184. _this = _Component.call(this, player, options2) || this;
  89185. _this.updateShowing();
  89186. _this.on(_this.player(), "durationchange", function(e) {
  89187. return _this.updateShowing(e);
  89188. });
  89189. return _this;
  89190. }
  89191. var _proto = LiveDisplay2.prototype;
  89192. _proto.createEl = function createEl$12() {
  89193. var el = _Component.prototype.createEl.call(this, "div", {
  89194. className: "vjs-live-control vjs-control"
  89195. });
  89196. this.contentEl_ = createEl("div", {
  89197. className: "vjs-live-display"
  89198. }, {
  89199. "aria-live": "off"
  89200. });
  89201. this.contentEl_.appendChild(createEl("span", {
  89202. className: "vjs-control-text",
  89203. textContent: this.localize("Stream Type") + "\xA0"
  89204. }));
  89205. this.contentEl_.appendChild(document_1.createTextNode(this.localize("LIVE")));
  89206. el.appendChild(this.contentEl_);
  89207. return el;
  89208. };
  89209. _proto.dispose = function dispose() {
  89210. this.contentEl_ = null;
  89211. _Component.prototype.dispose.call(this);
  89212. };
  89213. _proto.updateShowing = function updateShowing(event2) {
  89214. if (this.player().duration() === Infinity) {
  89215. this.show();
  89216. } else {
  89217. this.hide();
  89218. }
  89219. };
  89220. return LiveDisplay2;
  89221. }(Component$1);
  89222. Component$1.registerComponent("LiveDisplay", LiveDisplay);
  89223. var SeekToLive = /* @__PURE__ */ function(_Button) {
  89224. _inheritsLoose(SeekToLive2, _Button);
  89225. function SeekToLive2(player, options2) {
  89226. var _this;
  89227. _this = _Button.call(this, player, options2) || this;
  89228. _this.updateLiveEdgeStatus();
  89229. if (_this.player_.liveTracker) {
  89230. _this.updateLiveEdgeStatusHandler_ = function(e) {
  89231. return _this.updateLiveEdgeStatus(e);
  89232. };
  89233. _this.on(_this.player_.liveTracker, "liveedgechange", _this.updateLiveEdgeStatusHandler_);
  89234. }
  89235. return _this;
  89236. }
  89237. var _proto = SeekToLive2.prototype;
  89238. _proto.createEl = function createEl$12() {
  89239. var el = _Button.prototype.createEl.call(this, "button", {
  89240. className: "vjs-seek-to-live-control vjs-control"
  89241. });
  89242. this.textEl_ = createEl("span", {
  89243. className: "vjs-seek-to-live-text",
  89244. textContent: this.localize("LIVE")
  89245. }, {
  89246. "aria-hidden": "true"
  89247. });
  89248. el.appendChild(this.textEl_);
  89249. return el;
  89250. };
  89251. _proto.updateLiveEdgeStatus = function updateLiveEdgeStatus() {
  89252. if (!this.player_.liveTracker || this.player_.liveTracker.atLiveEdge()) {
  89253. this.setAttribute("aria-disabled", true);
  89254. this.addClass("vjs-at-live-edge");
  89255. this.controlText("Seek to live, currently playing live");
  89256. } else {
  89257. this.setAttribute("aria-disabled", false);
  89258. this.removeClass("vjs-at-live-edge");
  89259. this.controlText("Seek to live, currently behind live");
  89260. }
  89261. };
  89262. _proto.handleClick = function handleClick() {
  89263. this.player_.liveTracker.seekToLiveEdge();
  89264. };
  89265. _proto.dispose = function dispose() {
  89266. if (this.player_.liveTracker) {
  89267. this.off(this.player_.liveTracker, "liveedgechange", this.updateLiveEdgeStatusHandler_);
  89268. }
  89269. this.textEl_ = null;
  89270. _Button.prototype.dispose.call(this);
  89271. };
  89272. return SeekToLive2;
  89273. }(Button);
  89274. SeekToLive.prototype.controlText_ = "Seek to live, currently playing live";
  89275. Component$1.registerComponent("SeekToLive", SeekToLive);
  89276. var clamp = function clamp2(number, min2, max2) {
  89277. number = Number(number);
  89278. return Math.min(max2, Math.max(min2, isNaN(number) ? min2 : number));
  89279. };
  89280. var Slider = /* @__PURE__ */ function(_Component) {
  89281. _inheritsLoose(Slider2, _Component);
  89282. function Slider2(player, options2) {
  89283. var _this;
  89284. _this = _Component.call(this, player, options2) || this;
  89285. _this.handleMouseDown_ = function(e) {
  89286. return _this.handleMouseDown(e);
  89287. };
  89288. _this.handleMouseUp_ = function(e) {
  89289. return _this.handleMouseUp(e);
  89290. };
  89291. _this.handleKeyDown_ = function(e) {
  89292. return _this.handleKeyDown(e);
  89293. };
  89294. _this.handleClick_ = function(e) {
  89295. return _this.handleClick(e);
  89296. };
  89297. _this.handleMouseMove_ = function(e) {
  89298. return _this.handleMouseMove(e);
  89299. };
  89300. _this.update_ = function(e) {
  89301. return _this.update(e);
  89302. };
  89303. _this.bar = _this.getChild(_this.options_.barName);
  89304. _this.vertical(!!_this.options_.vertical);
  89305. _this.enable();
  89306. return _this;
  89307. }
  89308. var _proto = Slider2.prototype;
  89309. _proto.enabled = function enabled() {
  89310. return this.enabled_;
  89311. };
  89312. _proto.enable = function enable() {
  89313. if (this.enabled()) {
  89314. return;
  89315. }
  89316. this.on("mousedown", this.handleMouseDown_);
  89317. this.on("touchstart", this.handleMouseDown_);
  89318. this.on("keydown", this.handleKeyDown_);
  89319. this.on("click", this.handleClick_);
  89320. this.on(this.player_, "controlsvisible", this.update);
  89321. if (this.playerEvent) {
  89322. this.on(this.player_, this.playerEvent, this.update);
  89323. }
  89324. this.removeClass("disabled");
  89325. this.setAttribute("tabindex", 0);
  89326. this.enabled_ = true;
  89327. };
  89328. _proto.disable = function disable() {
  89329. if (!this.enabled()) {
  89330. return;
  89331. }
  89332. var doc = this.bar.el_.ownerDocument;
  89333. this.off("mousedown", this.handleMouseDown_);
  89334. this.off("touchstart", this.handleMouseDown_);
  89335. this.off("keydown", this.handleKeyDown_);
  89336. this.off("click", this.handleClick_);
  89337. this.off(this.player_, "controlsvisible", this.update_);
  89338. this.off(doc, "mousemove", this.handleMouseMove_);
  89339. this.off(doc, "mouseup", this.handleMouseUp_);
  89340. this.off(doc, "touchmove", this.handleMouseMove_);
  89341. this.off(doc, "touchend", this.handleMouseUp_);
  89342. this.removeAttribute("tabindex");
  89343. this.addClass("disabled");
  89344. if (this.playerEvent) {
  89345. this.off(this.player_, this.playerEvent, this.update);
  89346. }
  89347. this.enabled_ = false;
  89348. };
  89349. _proto.createEl = function createEl2(type2, props, attributes) {
  89350. if (props === void 0) {
  89351. props = {};
  89352. }
  89353. if (attributes === void 0) {
  89354. attributes = {};
  89355. }
  89356. props.className = props.className + " vjs-slider";
  89357. props = assign({
  89358. tabIndex: 0
  89359. }, props);
  89360. attributes = assign({
  89361. "role": "slider",
  89362. "aria-valuenow": 0,
  89363. "aria-valuemin": 0,
  89364. "aria-valuemax": 100,
  89365. "tabIndex": 0
  89366. }, attributes);
  89367. return _Component.prototype.createEl.call(this, type2, props, attributes);
  89368. };
  89369. _proto.handleMouseDown = function handleMouseDown(event2) {
  89370. var doc = this.bar.el_.ownerDocument;
  89371. if (event2.type === "mousedown") {
  89372. event2.preventDefault();
  89373. }
  89374. if (event2.type === "touchstart" && !IS_CHROME) {
  89375. event2.preventDefault();
  89376. }
  89377. blockTextSelection();
  89378. this.addClass("vjs-sliding");
  89379. this.trigger("slideractive");
  89380. this.on(doc, "mousemove", this.handleMouseMove_);
  89381. this.on(doc, "mouseup", this.handleMouseUp_);
  89382. this.on(doc, "touchmove", this.handleMouseMove_);
  89383. this.on(doc, "touchend", this.handleMouseUp_);
  89384. this.handleMouseMove(event2, true);
  89385. };
  89386. _proto.handleMouseMove = function handleMouseMove(event2) {
  89387. };
  89388. _proto.handleMouseUp = function handleMouseUp() {
  89389. var doc = this.bar.el_.ownerDocument;
  89390. unblockTextSelection();
  89391. this.removeClass("vjs-sliding");
  89392. this.trigger("sliderinactive");
  89393. this.off(doc, "mousemove", this.handleMouseMove_);
  89394. this.off(doc, "mouseup", this.handleMouseUp_);
  89395. this.off(doc, "touchmove", this.handleMouseMove_);
  89396. this.off(doc, "touchend", this.handleMouseUp_);
  89397. this.update();
  89398. };
  89399. _proto.update = function update() {
  89400. var _this2 = this;
  89401. if (!this.el_ || !this.bar) {
  89402. return;
  89403. }
  89404. var progress = this.getProgress();
  89405. if (progress === this.progress_) {
  89406. return progress;
  89407. }
  89408. this.progress_ = progress;
  89409. this.requestNamedAnimationFrame("Slider#update", function() {
  89410. var sizeKey = _this2.vertical() ? "height" : "width";
  89411. _this2.bar.el().style[sizeKey] = (progress * 100).toFixed(2) + "%";
  89412. });
  89413. return progress;
  89414. };
  89415. _proto.getProgress = function getProgress() {
  89416. return Number(clamp(this.getPercent(), 0, 1).toFixed(4));
  89417. };
  89418. _proto.calculateDistance = function calculateDistance(event2) {
  89419. var position2 = getPointerPosition(this.el_, event2);
  89420. if (this.vertical()) {
  89421. return position2.y;
  89422. }
  89423. return position2.x;
  89424. };
  89425. _proto.handleKeyDown = function handleKeyDown(event2) {
  89426. if (keycode.isEventKey(event2, "Left") || keycode.isEventKey(event2, "Down")) {
  89427. event2.preventDefault();
  89428. event2.stopPropagation();
  89429. this.stepBack();
  89430. } else if (keycode.isEventKey(event2, "Right") || keycode.isEventKey(event2, "Up")) {
  89431. event2.preventDefault();
  89432. event2.stopPropagation();
  89433. this.stepForward();
  89434. } else {
  89435. _Component.prototype.handleKeyDown.call(this, event2);
  89436. }
  89437. };
  89438. _proto.handleClick = function handleClick(event2) {
  89439. event2.stopPropagation();
  89440. event2.preventDefault();
  89441. };
  89442. _proto.vertical = function vertical(bool) {
  89443. if (bool === void 0) {
  89444. return this.vertical_ || false;
  89445. }
  89446. this.vertical_ = !!bool;
  89447. if (this.vertical_) {
  89448. this.addClass("vjs-slider-vertical");
  89449. } else {
  89450. this.addClass("vjs-slider-horizontal");
  89451. }
  89452. };
  89453. return Slider2;
  89454. }(Component$1);
  89455. Component$1.registerComponent("Slider", Slider);
  89456. var percentify = function percentify2(time, end) {
  89457. return clamp(time / end * 100, 0, 100).toFixed(2) + "%";
  89458. };
  89459. var LoadProgressBar = /* @__PURE__ */ function(_Component) {
  89460. _inheritsLoose(LoadProgressBar2, _Component);
  89461. function LoadProgressBar2(player, options2) {
  89462. var _this;
  89463. _this = _Component.call(this, player, options2) || this;
  89464. _this.partEls_ = [];
  89465. _this.on(player, "progress", function(e) {
  89466. return _this.update(e);
  89467. });
  89468. return _this;
  89469. }
  89470. var _proto = LoadProgressBar2.prototype;
  89471. _proto.createEl = function createEl$12() {
  89472. var el = _Component.prototype.createEl.call(this, "div", {
  89473. className: "vjs-load-progress"
  89474. });
  89475. var wrapper = createEl("span", {
  89476. className: "vjs-control-text"
  89477. });
  89478. var loadedText = createEl("span", {
  89479. textContent: this.localize("Loaded")
  89480. });
  89481. var separator = document_1.createTextNode(": ");
  89482. this.percentageEl_ = createEl("span", {
  89483. className: "vjs-control-text-loaded-percentage",
  89484. textContent: "0%"
  89485. });
  89486. el.appendChild(wrapper);
  89487. wrapper.appendChild(loadedText);
  89488. wrapper.appendChild(separator);
  89489. wrapper.appendChild(this.percentageEl_);
  89490. return el;
  89491. };
  89492. _proto.dispose = function dispose() {
  89493. this.partEls_ = null;
  89494. this.percentageEl_ = null;
  89495. _Component.prototype.dispose.call(this);
  89496. };
  89497. _proto.update = function update(event2) {
  89498. var _this2 = this;
  89499. this.requestNamedAnimationFrame("LoadProgressBar#update", function() {
  89500. var liveTracker = _this2.player_.liveTracker;
  89501. var buffered = _this2.player_.buffered();
  89502. var duration5 = liveTracker && liveTracker.isLive() ? liveTracker.seekableEnd() : _this2.player_.duration();
  89503. var bufferedEnd = _this2.player_.bufferedEnd();
  89504. var children = _this2.partEls_;
  89505. var percent = percentify(bufferedEnd, duration5);
  89506. if (_this2.percent_ !== percent) {
  89507. _this2.el_.style.width = percent;
  89508. textContent(_this2.percentageEl_, percent);
  89509. _this2.percent_ = percent;
  89510. }
  89511. for (var i2 = 0; i2 < buffered.length; i2++) {
  89512. var start2 = buffered.start(i2);
  89513. var end = buffered.end(i2);
  89514. var part = children[i2];
  89515. if (!part) {
  89516. part = _this2.el_.appendChild(createEl());
  89517. children[i2] = part;
  89518. }
  89519. if (part.dataset.start === start2 && part.dataset.end === end) {
  89520. continue;
  89521. }
  89522. part.dataset.start = start2;
  89523. part.dataset.end = end;
  89524. part.style.left = percentify(start2, bufferedEnd);
  89525. part.style.width = percentify(end - start2, bufferedEnd);
  89526. }
  89527. for (var _i = children.length; _i > buffered.length; _i--) {
  89528. _this2.el_.removeChild(children[_i - 1]);
  89529. }
  89530. children.length = buffered.length;
  89531. });
  89532. };
  89533. return LoadProgressBar2;
  89534. }(Component$1);
  89535. Component$1.registerComponent("LoadProgressBar", LoadProgressBar);
  89536. var TimeTooltip = /* @__PURE__ */ function(_Component) {
  89537. _inheritsLoose(TimeTooltip2, _Component);
  89538. function TimeTooltip2(player, options2) {
  89539. var _this;
  89540. _this = _Component.call(this, player, options2) || this;
  89541. _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);
  89542. return _this;
  89543. }
  89544. var _proto = TimeTooltip2.prototype;
  89545. _proto.createEl = function createEl2() {
  89546. return _Component.prototype.createEl.call(this, "div", {
  89547. className: "vjs-time-tooltip"
  89548. }, {
  89549. "aria-hidden": "true"
  89550. });
  89551. };
  89552. _proto.update = function update(seekBarRect, seekBarPoint, content) {
  89553. var tooltipRect = findPosition(this.el_);
  89554. var playerRect = getBoundingClientRect(this.player_.el());
  89555. var seekBarPointPx = seekBarRect.width * seekBarPoint;
  89556. if (!playerRect || !tooltipRect) {
  89557. return;
  89558. }
  89559. var spaceLeftOfPoint = seekBarRect.left - playerRect.left + seekBarPointPx;
  89560. var spaceRightOfPoint = seekBarRect.width - seekBarPointPx + (playerRect.right - seekBarRect.right);
  89561. var pullTooltipBy = tooltipRect.width / 2;
  89562. if (spaceLeftOfPoint < pullTooltipBy) {
  89563. pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;
  89564. } else if (spaceRightOfPoint < pullTooltipBy) {
  89565. pullTooltipBy = spaceRightOfPoint;
  89566. }
  89567. if (pullTooltipBy < 0) {
  89568. pullTooltipBy = 0;
  89569. } else if (pullTooltipBy > tooltipRect.width) {
  89570. pullTooltipBy = tooltipRect.width;
  89571. }
  89572. pullTooltipBy = Math.round(pullTooltipBy);
  89573. this.el_.style.right = "-" + pullTooltipBy + "px";
  89574. this.write(content);
  89575. };
  89576. _proto.write = function write(content) {
  89577. textContent(this.el_, content);
  89578. };
  89579. _proto.updateTime = function updateTime(seekBarRect, seekBarPoint, time, cb) {
  89580. var _this2 = this;
  89581. this.requestNamedAnimationFrame("TimeTooltip#updateTime", function() {
  89582. var content;
  89583. var duration5 = _this2.player_.duration();
  89584. if (_this2.player_.liveTracker && _this2.player_.liveTracker.isLive()) {
  89585. var liveWindow = _this2.player_.liveTracker.liveWindow();
  89586. var secondsBehind = liveWindow - seekBarPoint * liveWindow;
  89587. content = (secondsBehind < 1 ? "" : "-") + formatTime(secondsBehind, liveWindow);
  89588. } else {
  89589. content = formatTime(time, duration5);
  89590. }
  89591. _this2.update(seekBarRect, seekBarPoint, content);
  89592. if (cb) {
  89593. cb();
  89594. }
  89595. });
  89596. };
  89597. return TimeTooltip2;
  89598. }(Component$1);
  89599. Component$1.registerComponent("TimeTooltip", TimeTooltip);
  89600. var PlayProgressBar = /* @__PURE__ */ function(_Component) {
  89601. _inheritsLoose(PlayProgressBar2, _Component);
  89602. function PlayProgressBar2(player, options2) {
  89603. var _this;
  89604. _this = _Component.call(this, player, options2) || this;
  89605. _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);
  89606. return _this;
  89607. }
  89608. var _proto = PlayProgressBar2.prototype;
  89609. _proto.createEl = function createEl2() {
  89610. return _Component.prototype.createEl.call(this, "div", {
  89611. className: "vjs-play-progress vjs-slider-bar"
  89612. }, {
  89613. "aria-hidden": "true"
  89614. });
  89615. };
  89616. _proto.update = function update(seekBarRect, seekBarPoint) {
  89617. var timeTooltip = this.getChild("timeTooltip");
  89618. if (!timeTooltip) {
  89619. return;
  89620. }
  89621. var time = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  89622. timeTooltip.updateTime(seekBarRect, seekBarPoint, time);
  89623. };
  89624. return PlayProgressBar2;
  89625. }(Component$1);
  89626. PlayProgressBar.prototype.options_ = {
  89627. children: []
  89628. };
  89629. if (!IS_IOS && !IS_ANDROID) {
  89630. PlayProgressBar.prototype.options_.children.push("timeTooltip");
  89631. }
  89632. Component$1.registerComponent("PlayProgressBar", PlayProgressBar);
  89633. var MouseTimeDisplay = /* @__PURE__ */ function(_Component) {
  89634. _inheritsLoose(MouseTimeDisplay2, _Component);
  89635. function MouseTimeDisplay2(player, options2) {
  89636. var _this;
  89637. _this = _Component.call(this, player, options2) || this;
  89638. _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);
  89639. return _this;
  89640. }
  89641. var _proto = MouseTimeDisplay2.prototype;
  89642. _proto.createEl = function createEl2() {
  89643. return _Component.prototype.createEl.call(this, "div", {
  89644. className: "vjs-mouse-display"
  89645. });
  89646. };
  89647. _proto.update = function update(seekBarRect, seekBarPoint) {
  89648. var _this2 = this;
  89649. var time = seekBarPoint * this.player_.duration();
  89650. this.getChild("timeTooltip").updateTime(seekBarRect, seekBarPoint, time, function() {
  89651. _this2.el_.style.left = seekBarRect.width * seekBarPoint + "px";
  89652. });
  89653. };
  89654. return MouseTimeDisplay2;
  89655. }(Component$1);
  89656. MouseTimeDisplay.prototype.options_ = {
  89657. children: ["timeTooltip"]
  89658. };
  89659. Component$1.registerComponent("MouseTimeDisplay", MouseTimeDisplay);
  89660. var STEP_SECONDS = 5;
  89661. var PAGE_KEY_MULTIPLIER = 12;
  89662. var SeekBar = /* @__PURE__ */ function(_Slider) {
  89663. _inheritsLoose(SeekBar2, _Slider);
  89664. function SeekBar2(player, options2) {
  89665. var _this;
  89666. _this = _Slider.call(this, player, options2) || this;
  89667. _this.setEventHandlers_();
  89668. return _this;
  89669. }
  89670. var _proto = SeekBar2.prototype;
  89671. _proto.setEventHandlers_ = function setEventHandlers_() {
  89672. var _this2 = this;
  89673. this.update_ = bind(this, this.update);
  89674. this.update = throttle(this.update_, UPDATE_REFRESH_INTERVAL);
  89675. this.on(this.player_, ["ended", "durationchange", "timeupdate"], this.update);
  89676. if (this.player_.liveTracker) {
  89677. this.on(this.player_.liveTracker, "liveedgechange", this.update);
  89678. }
  89679. this.updateInterval = null;
  89680. this.enableIntervalHandler_ = function(e) {
  89681. return _this2.enableInterval_(e);
  89682. };
  89683. this.disableIntervalHandler_ = function(e) {
  89684. return _this2.disableInterval_(e);
  89685. };
  89686. this.on(this.player_, ["playing"], this.enableIntervalHandler_);
  89687. this.on(this.player_, ["ended", "pause", "waiting"], this.disableIntervalHandler_);
  89688. if ("hidden" in document_1 && "visibilityState" in document_1) {
  89689. this.on(document_1, "visibilitychange", this.toggleVisibility_);
  89690. }
  89691. };
  89692. _proto.toggleVisibility_ = function toggleVisibility_(e) {
  89693. if (document_1.visibilityState === "hidden") {
  89694. this.cancelNamedAnimationFrame("SeekBar#update");
  89695. this.cancelNamedAnimationFrame("Slider#update");
  89696. this.disableInterval_(e);
  89697. } else {
  89698. if (!this.player_.ended() && !this.player_.paused()) {
  89699. this.enableInterval_();
  89700. }
  89701. this.update();
  89702. }
  89703. };
  89704. _proto.enableInterval_ = function enableInterval_() {
  89705. if (this.updateInterval) {
  89706. return;
  89707. }
  89708. this.updateInterval = this.setInterval(this.update, UPDATE_REFRESH_INTERVAL);
  89709. };
  89710. _proto.disableInterval_ = function disableInterval_(e) {
  89711. if (this.player_.liveTracker && this.player_.liveTracker.isLive() && e && e.type !== "ended") {
  89712. return;
  89713. }
  89714. if (!this.updateInterval) {
  89715. return;
  89716. }
  89717. this.clearInterval(this.updateInterval);
  89718. this.updateInterval = null;
  89719. };
  89720. _proto.createEl = function createEl2() {
  89721. return _Slider.prototype.createEl.call(this, "div", {
  89722. className: "vjs-progress-holder"
  89723. }, {
  89724. "aria-label": this.localize("Progress Bar")
  89725. });
  89726. };
  89727. _proto.update = function update(event2) {
  89728. var _this3 = this;
  89729. if (document_1.visibilityState === "hidden") {
  89730. return;
  89731. }
  89732. var percent = _Slider.prototype.update.call(this);
  89733. this.requestNamedAnimationFrame("SeekBar#update", function() {
  89734. var currentTime = _this3.player_.ended() ? _this3.player_.duration() : _this3.getCurrentTime_();
  89735. var liveTracker = _this3.player_.liveTracker;
  89736. var duration5 = _this3.player_.duration();
  89737. if (liveTracker && liveTracker.isLive()) {
  89738. duration5 = _this3.player_.liveTracker.liveCurrentTime();
  89739. }
  89740. if (_this3.percent_ !== percent) {
  89741. _this3.el_.setAttribute("aria-valuenow", (percent * 100).toFixed(2));
  89742. _this3.percent_ = percent;
  89743. }
  89744. if (_this3.currentTime_ !== currentTime || _this3.duration_ !== duration5) {
  89745. _this3.el_.setAttribute("aria-valuetext", _this3.localize("progress bar timing: currentTime={1} duration={2}", [formatTime(currentTime, duration5), formatTime(duration5, duration5)], "{1} of {2}"));
  89746. _this3.currentTime_ = currentTime;
  89747. _this3.duration_ = duration5;
  89748. }
  89749. if (_this3.bar) {
  89750. _this3.bar.update(getBoundingClientRect(_this3.el()), _this3.getProgress());
  89751. }
  89752. });
  89753. return percent;
  89754. };
  89755. _proto.userSeek_ = function userSeek_(ct2) {
  89756. if (this.player_.liveTracker && this.player_.liveTracker.isLive()) {
  89757. this.player_.liveTracker.nextSeekedFromUser();
  89758. }
  89759. this.player_.currentTime(ct2);
  89760. };
  89761. _proto.getCurrentTime_ = function getCurrentTime_() {
  89762. return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  89763. };
  89764. _proto.getPercent = function getPercent() {
  89765. var currentTime = this.getCurrentTime_();
  89766. var percent;
  89767. var liveTracker = this.player_.liveTracker;
  89768. if (liveTracker && liveTracker.isLive()) {
  89769. percent = (currentTime - liveTracker.seekableStart()) / liveTracker.liveWindow();
  89770. if (liveTracker.atLiveEdge()) {
  89771. percent = 1;
  89772. }
  89773. } else {
  89774. percent = currentTime / this.player_.duration();
  89775. }
  89776. return percent;
  89777. };
  89778. _proto.handleMouseDown = function handleMouseDown(event2) {
  89779. if (!isSingleLeftClick(event2)) {
  89780. return;
  89781. }
  89782. event2.stopPropagation();
  89783. this.videoWasPlaying = !this.player_.paused();
  89784. this.player_.pause();
  89785. _Slider.prototype.handleMouseDown.call(this, event2);
  89786. };
  89787. _proto.handleMouseMove = function handleMouseMove(event2, mouseDown) {
  89788. if (mouseDown === void 0) {
  89789. mouseDown = false;
  89790. }
  89791. if (!isSingleLeftClick(event2)) {
  89792. return;
  89793. }
  89794. if (!mouseDown && !this.player_.scrubbing()) {
  89795. this.player_.scrubbing(true);
  89796. }
  89797. var newTime;
  89798. var distance2 = this.calculateDistance(event2);
  89799. var liveTracker = this.player_.liveTracker;
  89800. if (!liveTracker || !liveTracker.isLive()) {
  89801. newTime = distance2 * this.player_.duration();
  89802. if (newTime === this.player_.duration()) {
  89803. newTime = newTime - 0.1;
  89804. }
  89805. } else {
  89806. if (distance2 >= 0.99) {
  89807. liveTracker.seekToLiveEdge();
  89808. return;
  89809. }
  89810. var seekableStart = liveTracker.seekableStart();
  89811. var seekableEnd = liveTracker.liveCurrentTime();
  89812. newTime = seekableStart + distance2 * liveTracker.liveWindow();
  89813. if (newTime >= seekableEnd) {
  89814. newTime = seekableEnd;
  89815. }
  89816. if (newTime <= seekableStart) {
  89817. newTime = seekableStart + 0.1;
  89818. }
  89819. if (newTime === Infinity) {
  89820. return;
  89821. }
  89822. }
  89823. this.userSeek_(newTime);
  89824. };
  89825. _proto.enable = function enable() {
  89826. _Slider.prototype.enable.call(this);
  89827. var mouseTimeDisplay = this.getChild("mouseTimeDisplay");
  89828. if (!mouseTimeDisplay) {
  89829. return;
  89830. }
  89831. mouseTimeDisplay.show();
  89832. };
  89833. _proto.disable = function disable() {
  89834. _Slider.prototype.disable.call(this);
  89835. var mouseTimeDisplay = this.getChild("mouseTimeDisplay");
  89836. if (!mouseTimeDisplay) {
  89837. return;
  89838. }
  89839. mouseTimeDisplay.hide();
  89840. };
  89841. _proto.handleMouseUp = function handleMouseUp(event2) {
  89842. _Slider.prototype.handleMouseUp.call(this, event2);
  89843. if (event2) {
  89844. event2.stopPropagation();
  89845. }
  89846. this.player_.scrubbing(false);
  89847. this.player_.trigger({
  89848. type: "timeupdate",
  89849. target: this,
  89850. manuallyTriggered: true
  89851. });
  89852. if (this.videoWasPlaying) {
  89853. silencePromise(this.player_.play());
  89854. } else {
  89855. this.update_();
  89856. }
  89857. };
  89858. _proto.stepForward = function stepForward() {
  89859. this.userSeek_(this.player_.currentTime() + STEP_SECONDS);
  89860. };
  89861. _proto.stepBack = function stepBack() {
  89862. this.userSeek_(this.player_.currentTime() - STEP_SECONDS);
  89863. };
  89864. _proto.handleAction = function handleAction(event2) {
  89865. if (this.player_.paused()) {
  89866. this.player_.play();
  89867. } else {
  89868. this.player_.pause();
  89869. }
  89870. };
  89871. _proto.handleKeyDown = function handleKeyDown(event2) {
  89872. var liveTracker = this.player_.liveTracker;
  89873. if (keycode.isEventKey(event2, "Space") || keycode.isEventKey(event2, "Enter")) {
  89874. event2.preventDefault();
  89875. event2.stopPropagation();
  89876. this.handleAction(event2);
  89877. } else if (keycode.isEventKey(event2, "Home")) {
  89878. event2.preventDefault();
  89879. event2.stopPropagation();
  89880. this.userSeek_(0);
  89881. } else if (keycode.isEventKey(event2, "End")) {
  89882. event2.preventDefault();
  89883. event2.stopPropagation();
  89884. if (liveTracker && liveTracker.isLive()) {
  89885. this.userSeek_(liveTracker.liveCurrentTime());
  89886. } else {
  89887. this.userSeek_(this.player_.duration());
  89888. }
  89889. } else if (/^[0-9]$/.test(keycode(event2))) {
  89890. event2.preventDefault();
  89891. event2.stopPropagation();
  89892. var gotoFraction = (keycode.codes[keycode(event2)] - keycode.codes["0"]) * 10 / 100;
  89893. if (liveTracker && liveTracker.isLive()) {
  89894. this.userSeek_(liveTracker.seekableStart() + liveTracker.liveWindow() * gotoFraction);
  89895. } else {
  89896. this.userSeek_(this.player_.duration() * gotoFraction);
  89897. }
  89898. } else if (keycode.isEventKey(event2, "PgDn")) {
  89899. event2.preventDefault();
  89900. event2.stopPropagation();
  89901. this.userSeek_(this.player_.currentTime() - STEP_SECONDS * PAGE_KEY_MULTIPLIER);
  89902. } else if (keycode.isEventKey(event2, "PgUp")) {
  89903. event2.preventDefault();
  89904. event2.stopPropagation();
  89905. this.userSeek_(this.player_.currentTime() + STEP_SECONDS * PAGE_KEY_MULTIPLIER);
  89906. } else {
  89907. _Slider.prototype.handleKeyDown.call(this, event2);
  89908. }
  89909. };
  89910. _proto.dispose = function dispose() {
  89911. this.disableInterval_();
  89912. this.off(this.player_, ["ended", "durationchange", "timeupdate"], this.update);
  89913. if (this.player_.liveTracker) {
  89914. this.off(this.player_.liveTracker, "liveedgechange", this.update);
  89915. }
  89916. this.off(this.player_, ["playing"], this.enableIntervalHandler_);
  89917. this.off(this.player_, ["ended", "pause", "waiting"], this.disableIntervalHandler_);
  89918. if ("hidden" in document_1 && "visibilityState" in document_1) {
  89919. this.off(document_1, "visibilitychange", this.toggleVisibility_);
  89920. }
  89921. _Slider.prototype.dispose.call(this);
  89922. };
  89923. return SeekBar2;
  89924. }(Slider);
  89925. SeekBar.prototype.options_ = {
  89926. children: ["loadProgressBar", "playProgressBar"],
  89927. barName: "playProgressBar"
  89928. };
  89929. if (!IS_IOS && !IS_ANDROID) {
  89930. SeekBar.prototype.options_.children.splice(1, 0, "mouseTimeDisplay");
  89931. }
  89932. Component$1.registerComponent("SeekBar", SeekBar);
  89933. var ProgressControl = /* @__PURE__ */ function(_Component) {
  89934. _inheritsLoose(ProgressControl2, _Component);
  89935. function ProgressControl2(player, options2) {
  89936. var _this;
  89937. _this = _Component.call(this, player, options2) || this;
  89938. _this.handleMouseMove = throttle(bind(_assertThisInitialized(_this), _this.handleMouseMove), UPDATE_REFRESH_INTERVAL);
  89939. _this.throttledHandleMouseSeek = throttle(bind(_assertThisInitialized(_this), _this.handleMouseSeek), UPDATE_REFRESH_INTERVAL);
  89940. _this.handleMouseUpHandler_ = function(e) {
  89941. return _this.handleMouseUp(e);
  89942. };
  89943. _this.handleMouseDownHandler_ = function(e) {
  89944. return _this.handleMouseDown(e);
  89945. };
  89946. _this.enable();
  89947. return _this;
  89948. }
  89949. var _proto = ProgressControl2.prototype;
  89950. _proto.createEl = function createEl2() {
  89951. return _Component.prototype.createEl.call(this, "div", {
  89952. className: "vjs-progress-control vjs-control"
  89953. });
  89954. };
  89955. _proto.handleMouseMove = function handleMouseMove(event2) {
  89956. var seekBar = this.getChild("seekBar");
  89957. if (!seekBar) {
  89958. return;
  89959. }
  89960. var playProgressBar = seekBar.getChild("playProgressBar");
  89961. var mouseTimeDisplay = seekBar.getChild("mouseTimeDisplay");
  89962. if (!playProgressBar && !mouseTimeDisplay) {
  89963. return;
  89964. }
  89965. var seekBarEl = seekBar.el();
  89966. var seekBarRect = findPosition(seekBarEl);
  89967. var seekBarPoint = getPointerPosition(seekBarEl, event2).x;
  89968. seekBarPoint = clamp(seekBarPoint, 0, 1);
  89969. if (mouseTimeDisplay) {
  89970. mouseTimeDisplay.update(seekBarRect, seekBarPoint);
  89971. }
  89972. if (playProgressBar) {
  89973. playProgressBar.update(seekBarRect, seekBar.getProgress());
  89974. }
  89975. };
  89976. _proto.handleMouseSeek = function handleMouseSeek(event2) {
  89977. var seekBar = this.getChild("seekBar");
  89978. if (seekBar) {
  89979. seekBar.handleMouseMove(event2);
  89980. }
  89981. };
  89982. _proto.enabled = function enabled() {
  89983. return this.enabled_;
  89984. };
  89985. _proto.disable = function disable() {
  89986. this.children().forEach(function(child) {
  89987. return child.disable && child.disable();
  89988. });
  89989. if (!this.enabled()) {
  89990. return;
  89991. }
  89992. this.off(["mousedown", "touchstart"], this.handleMouseDownHandler_);
  89993. this.off(this.el_, "mousemove", this.handleMouseMove);
  89994. this.removeListenersAddedOnMousedownAndTouchstart();
  89995. this.addClass("disabled");
  89996. this.enabled_ = false;
  89997. if (this.player_.scrubbing()) {
  89998. var seekBar = this.getChild("seekBar");
  89999. this.player_.scrubbing(false);
  90000. if (seekBar.videoWasPlaying) {
  90001. silencePromise(this.player_.play());
  90002. }
  90003. }
  90004. };
  90005. _proto.enable = function enable() {
  90006. this.children().forEach(function(child) {
  90007. return child.enable && child.enable();
  90008. });
  90009. if (this.enabled()) {
  90010. return;
  90011. }
  90012. this.on(["mousedown", "touchstart"], this.handleMouseDownHandler_);
  90013. this.on(this.el_, "mousemove", this.handleMouseMove);
  90014. this.removeClass("disabled");
  90015. this.enabled_ = true;
  90016. };
  90017. _proto.removeListenersAddedOnMousedownAndTouchstart = function removeListenersAddedOnMousedownAndTouchstart() {
  90018. var doc = this.el_.ownerDocument;
  90019. this.off(doc, "mousemove", this.throttledHandleMouseSeek);
  90020. this.off(doc, "touchmove", this.throttledHandleMouseSeek);
  90021. this.off(doc, "mouseup", this.handleMouseUpHandler_);
  90022. this.off(doc, "touchend", this.handleMouseUpHandler_);
  90023. };
  90024. _proto.handleMouseDown = function handleMouseDown(event2) {
  90025. var doc = this.el_.ownerDocument;
  90026. var seekBar = this.getChild("seekBar");
  90027. if (seekBar) {
  90028. seekBar.handleMouseDown(event2);
  90029. }
  90030. this.on(doc, "mousemove", this.throttledHandleMouseSeek);
  90031. this.on(doc, "touchmove", this.throttledHandleMouseSeek);
  90032. this.on(doc, "mouseup", this.handleMouseUpHandler_);
  90033. this.on(doc, "touchend", this.handleMouseUpHandler_);
  90034. };
  90035. _proto.handleMouseUp = function handleMouseUp(event2) {
  90036. var seekBar = this.getChild("seekBar");
  90037. if (seekBar) {
  90038. seekBar.handleMouseUp(event2);
  90039. }
  90040. this.removeListenersAddedOnMousedownAndTouchstart();
  90041. };
  90042. return ProgressControl2;
  90043. }(Component$1);
  90044. ProgressControl.prototype.options_ = {
  90045. children: ["seekBar"]
  90046. };
  90047. Component$1.registerComponent("ProgressControl", ProgressControl);
  90048. var PictureInPictureToggle = /* @__PURE__ */ function(_Button) {
  90049. _inheritsLoose(PictureInPictureToggle2, _Button);
  90050. function PictureInPictureToggle2(player, options2) {
  90051. var _this;
  90052. _this = _Button.call(this, player, options2) || this;
  90053. _this.on(player, ["enterpictureinpicture", "leavepictureinpicture"], function(e) {
  90054. return _this.handlePictureInPictureChange(e);
  90055. });
  90056. _this.on(player, ["disablepictureinpicturechanged", "loadedmetadata"], function(e) {
  90057. return _this.handlePictureInPictureEnabledChange(e);
  90058. });
  90059. _this.on(player, ["loadedmetadata", "audioonlymodechange", "audiopostermodechange"], function() {
  90060. var isSourceAudio = player.currentType().substring(0, 5) === "audio";
  90061. if (isSourceAudio || player.audioPosterMode() || player.audioOnlyMode()) {
  90062. if (player.isInPictureInPicture()) {
  90063. player.exitPictureInPicture();
  90064. }
  90065. _this.hide();
  90066. } else {
  90067. _this.show();
  90068. }
  90069. });
  90070. _this.disable();
  90071. return _this;
  90072. }
  90073. var _proto = PictureInPictureToggle2.prototype;
  90074. _proto.buildCSSClass = function buildCSSClass() {
  90075. return "vjs-picture-in-picture-control " + _Button.prototype.buildCSSClass.call(this);
  90076. };
  90077. _proto.handlePictureInPictureEnabledChange = function handlePictureInPictureEnabledChange() {
  90078. if (document_1.pictureInPictureEnabled && this.player_.disablePictureInPicture() === false) {
  90079. this.enable();
  90080. } else {
  90081. this.disable();
  90082. }
  90083. };
  90084. _proto.handlePictureInPictureChange = function handlePictureInPictureChange(event2) {
  90085. if (this.player_.isInPictureInPicture()) {
  90086. this.controlText("Exit Picture-in-Picture");
  90087. } else {
  90088. this.controlText("Picture-in-Picture");
  90089. }
  90090. this.handlePictureInPictureEnabledChange();
  90091. };
  90092. _proto.handleClick = function handleClick(event2) {
  90093. if (!this.player_.isInPictureInPicture()) {
  90094. this.player_.requestPictureInPicture();
  90095. } else {
  90096. this.player_.exitPictureInPicture();
  90097. }
  90098. };
  90099. return PictureInPictureToggle2;
  90100. }(Button);
  90101. PictureInPictureToggle.prototype.controlText_ = "Picture-in-Picture";
  90102. Component$1.registerComponent("PictureInPictureToggle", PictureInPictureToggle);
  90103. var FullscreenToggle = /* @__PURE__ */ function(_Button) {
  90104. _inheritsLoose(FullscreenToggle2, _Button);
  90105. function FullscreenToggle2(player, options2) {
  90106. var _this;
  90107. _this = _Button.call(this, player, options2) || this;
  90108. _this.on(player, "fullscreenchange", function(e) {
  90109. return _this.handleFullscreenChange(e);
  90110. });
  90111. if (document_1[player.fsApi_.fullscreenEnabled] === false) {
  90112. _this.disable();
  90113. }
  90114. return _this;
  90115. }
  90116. var _proto = FullscreenToggle2.prototype;
  90117. _proto.buildCSSClass = function buildCSSClass() {
  90118. return "vjs-fullscreen-control " + _Button.prototype.buildCSSClass.call(this);
  90119. };
  90120. _proto.handleFullscreenChange = function handleFullscreenChange(event2) {
  90121. if (this.player_.isFullscreen()) {
  90122. this.controlText("Non-Fullscreen");
  90123. } else {
  90124. this.controlText("Fullscreen");
  90125. }
  90126. };
  90127. _proto.handleClick = function handleClick(event2) {
  90128. if (!this.player_.isFullscreen()) {
  90129. this.player_.requestFullscreen();
  90130. } else {
  90131. this.player_.exitFullscreen();
  90132. }
  90133. };
  90134. return FullscreenToggle2;
  90135. }(Button);
  90136. FullscreenToggle.prototype.controlText_ = "Fullscreen";
  90137. Component$1.registerComponent("FullscreenToggle", FullscreenToggle);
  90138. var checkVolumeSupport = function checkVolumeSupport2(self2, player) {
  90139. if (player.tech_ && !player.tech_.featuresVolumeControl) {
  90140. self2.addClass("vjs-hidden");
  90141. }
  90142. self2.on(player, "loadstart", function() {
  90143. if (!player.tech_.featuresVolumeControl) {
  90144. self2.addClass("vjs-hidden");
  90145. } else {
  90146. self2.removeClass("vjs-hidden");
  90147. }
  90148. });
  90149. };
  90150. var VolumeLevel = /* @__PURE__ */ function(_Component) {
  90151. _inheritsLoose(VolumeLevel2, _Component);
  90152. function VolumeLevel2() {
  90153. return _Component.apply(this, arguments) || this;
  90154. }
  90155. var _proto = VolumeLevel2.prototype;
  90156. _proto.createEl = function createEl2() {
  90157. var el = _Component.prototype.createEl.call(this, "div", {
  90158. className: "vjs-volume-level"
  90159. });
  90160. el.appendChild(_Component.prototype.createEl.call(this, "span", {
  90161. className: "vjs-control-text"
  90162. }));
  90163. return el;
  90164. };
  90165. return VolumeLevel2;
  90166. }(Component$1);
  90167. Component$1.registerComponent("VolumeLevel", VolumeLevel);
  90168. var VolumeLevelTooltip = /* @__PURE__ */ function(_Component) {
  90169. _inheritsLoose(VolumeLevelTooltip2, _Component);
  90170. function VolumeLevelTooltip2(player, options2) {
  90171. var _this;
  90172. _this = _Component.call(this, player, options2) || this;
  90173. _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);
  90174. return _this;
  90175. }
  90176. var _proto = VolumeLevelTooltip2.prototype;
  90177. _proto.createEl = function createEl2() {
  90178. return _Component.prototype.createEl.call(this, "div", {
  90179. className: "vjs-volume-tooltip"
  90180. }, {
  90181. "aria-hidden": "true"
  90182. });
  90183. };
  90184. _proto.update = function update(rangeBarRect, rangeBarPoint, vertical, content) {
  90185. if (!vertical) {
  90186. var tooltipRect = getBoundingClientRect(this.el_);
  90187. var playerRect = getBoundingClientRect(this.player_.el());
  90188. var volumeBarPointPx = rangeBarRect.width * rangeBarPoint;
  90189. if (!playerRect || !tooltipRect) {
  90190. return;
  90191. }
  90192. var spaceLeftOfPoint = rangeBarRect.left - playerRect.left + volumeBarPointPx;
  90193. var spaceRightOfPoint = rangeBarRect.width - volumeBarPointPx + (playerRect.right - rangeBarRect.right);
  90194. var pullTooltipBy = tooltipRect.width / 2;
  90195. if (spaceLeftOfPoint < pullTooltipBy) {
  90196. pullTooltipBy += pullTooltipBy - spaceLeftOfPoint;
  90197. } else if (spaceRightOfPoint < pullTooltipBy) {
  90198. pullTooltipBy = spaceRightOfPoint;
  90199. }
  90200. if (pullTooltipBy < 0) {
  90201. pullTooltipBy = 0;
  90202. } else if (pullTooltipBy > tooltipRect.width) {
  90203. pullTooltipBy = tooltipRect.width;
  90204. }
  90205. this.el_.style.right = "-" + pullTooltipBy + "px";
  90206. }
  90207. this.write(content + "%");
  90208. };
  90209. _proto.write = function write(content) {
  90210. textContent(this.el_, content);
  90211. };
  90212. _proto.updateVolume = function updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, cb) {
  90213. var _this2 = this;
  90214. this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume", function() {
  90215. _this2.update(rangeBarRect, rangeBarPoint, vertical, volume.toFixed(0));
  90216. if (cb) {
  90217. cb();
  90218. }
  90219. });
  90220. };
  90221. return VolumeLevelTooltip2;
  90222. }(Component$1);
  90223. Component$1.registerComponent("VolumeLevelTooltip", VolumeLevelTooltip);
  90224. var MouseVolumeLevelDisplay = /* @__PURE__ */ function(_Component) {
  90225. _inheritsLoose(MouseVolumeLevelDisplay2, _Component);
  90226. function MouseVolumeLevelDisplay2(player, options2) {
  90227. var _this;
  90228. _this = _Component.call(this, player, options2) || this;
  90229. _this.update = throttle(bind(_assertThisInitialized(_this), _this.update), UPDATE_REFRESH_INTERVAL);
  90230. return _this;
  90231. }
  90232. var _proto = MouseVolumeLevelDisplay2.prototype;
  90233. _proto.createEl = function createEl2() {
  90234. return _Component.prototype.createEl.call(this, "div", {
  90235. className: "vjs-mouse-display"
  90236. });
  90237. };
  90238. _proto.update = function update(rangeBarRect, rangeBarPoint, vertical) {
  90239. var _this2 = this;
  90240. var volume = 100 * rangeBarPoint;
  90241. this.getChild("volumeLevelTooltip").updateVolume(rangeBarRect, rangeBarPoint, vertical, volume, function() {
  90242. if (vertical) {
  90243. _this2.el_.style.bottom = rangeBarRect.height * rangeBarPoint + "px";
  90244. } else {
  90245. _this2.el_.style.left = rangeBarRect.width * rangeBarPoint + "px";
  90246. }
  90247. });
  90248. };
  90249. return MouseVolumeLevelDisplay2;
  90250. }(Component$1);
  90251. MouseVolumeLevelDisplay.prototype.options_ = {
  90252. children: ["volumeLevelTooltip"]
  90253. };
  90254. Component$1.registerComponent("MouseVolumeLevelDisplay", MouseVolumeLevelDisplay);
  90255. var VolumeBar = /* @__PURE__ */ function(_Slider) {
  90256. _inheritsLoose(VolumeBar2, _Slider);
  90257. function VolumeBar2(player, options2) {
  90258. var _this;
  90259. _this = _Slider.call(this, player, options2) || this;
  90260. _this.on("slideractive", function(e) {
  90261. return _this.updateLastVolume_(e);
  90262. });
  90263. _this.on(player, "volumechange", function(e) {
  90264. return _this.updateARIAAttributes(e);
  90265. });
  90266. player.ready(function() {
  90267. return _this.updateARIAAttributes();
  90268. });
  90269. return _this;
  90270. }
  90271. var _proto = VolumeBar2.prototype;
  90272. _proto.createEl = function createEl2() {
  90273. return _Slider.prototype.createEl.call(this, "div", {
  90274. className: "vjs-volume-bar vjs-slider-bar"
  90275. }, {
  90276. "aria-label": this.localize("Volume Level"),
  90277. "aria-live": "polite"
  90278. });
  90279. };
  90280. _proto.handleMouseDown = function handleMouseDown(event2) {
  90281. if (!isSingleLeftClick(event2)) {
  90282. return;
  90283. }
  90284. _Slider.prototype.handleMouseDown.call(this, event2);
  90285. };
  90286. _proto.handleMouseMove = function handleMouseMove(event2) {
  90287. var mouseVolumeLevelDisplay = this.getChild("mouseVolumeLevelDisplay");
  90288. if (mouseVolumeLevelDisplay) {
  90289. var volumeBarEl = this.el();
  90290. var volumeBarRect = getBoundingClientRect(volumeBarEl);
  90291. var vertical = this.vertical();
  90292. var volumeBarPoint = getPointerPosition(volumeBarEl, event2);
  90293. volumeBarPoint = vertical ? volumeBarPoint.y : volumeBarPoint.x;
  90294. volumeBarPoint = clamp(volumeBarPoint, 0, 1);
  90295. mouseVolumeLevelDisplay.update(volumeBarRect, volumeBarPoint, vertical);
  90296. }
  90297. if (!isSingleLeftClick(event2)) {
  90298. return;
  90299. }
  90300. this.checkMuted();
  90301. this.player_.volume(this.calculateDistance(event2));
  90302. };
  90303. _proto.checkMuted = function checkMuted() {
  90304. if (this.player_.muted()) {
  90305. this.player_.muted(false);
  90306. }
  90307. };
  90308. _proto.getPercent = function getPercent() {
  90309. if (this.player_.muted()) {
  90310. return 0;
  90311. }
  90312. return this.player_.volume();
  90313. };
  90314. _proto.stepForward = function stepForward() {
  90315. this.checkMuted();
  90316. this.player_.volume(this.player_.volume() + 0.1);
  90317. };
  90318. _proto.stepBack = function stepBack() {
  90319. this.checkMuted();
  90320. this.player_.volume(this.player_.volume() - 0.1);
  90321. };
  90322. _proto.updateARIAAttributes = function updateARIAAttributes(event2) {
  90323. var ariaValue = this.player_.muted() ? 0 : this.volumeAsPercentage_();
  90324. this.el_.setAttribute("aria-valuenow", ariaValue);
  90325. this.el_.setAttribute("aria-valuetext", ariaValue + "%");
  90326. };
  90327. _proto.volumeAsPercentage_ = function volumeAsPercentage_() {
  90328. return Math.round(this.player_.volume() * 100);
  90329. };
  90330. _proto.updateLastVolume_ = function updateLastVolume_() {
  90331. var _this2 = this;
  90332. var volumeBeforeDrag = this.player_.volume();
  90333. this.one("sliderinactive", function() {
  90334. if (_this2.player_.volume() === 0) {
  90335. _this2.player_.lastVolume_(volumeBeforeDrag);
  90336. }
  90337. });
  90338. };
  90339. return VolumeBar2;
  90340. }(Slider);
  90341. VolumeBar.prototype.options_ = {
  90342. children: ["volumeLevel"],
  90343. barName: "volumeLevel"
  90344. };
  90345. if (!IS_IOS && !IS_ANDROID) {
  90346. VolumeBar.prototype.options_.children.splice(0, 0, "mouseVolumeLevelDisplay");
  90347. }
  90348. VolumeBar.prototype.playerEvent = "volumechange";
  90349. Component$1.registerComponent("VolumeBar", VolumeBar);
  90350. var VolumeControl = /* @__PURE__ */ function(_Component) {
  90351. _inheritsLoose(VolumeControl2, _Component);
  90352. function VolumeControl2(player, options2) {
  90353. var _this;
  90354. if (options2 === void 0) {
  90355. options2 = {};
  90356. }
  90357. options2.vertical = options2.vertical || false;
  90358. if (typeof options2.volumeBar === "undefined" || isPlain(options2.volumeBar)) {
  90359. options2.volumeBar = options2.volumeBar || {};
  90360. options2.volumeBar.vertical = options2.vertical;
  90361. }
  90362. _this = _Component.call(this, player, options2) || this;
  90363. checkVolumeSupport(_assertThisInitialized(_this), player);
  90364. _this.throttledHandleMouseMove = throttle(bind(_assertThisInitialized(_this), _this.handleMouseMove), UPDATE_REFRESH_INTERVAL);
  90365. _this.handleMouseUpHandler_ = function(e) {
  90366. return _this.handleMouseUp(e);
  90367. };
  90368. _this.on("mousedown", function(e) {
  90369. return _this.handleMouseDown(e);
  90370. });
  90371. _this.on("touchstart", function(e) {
  90372. return _this.handleMouseDown(e);
  90373. });
  90374. _this.on("mousemove", function(e) {
  90375. return _this.handleMouseMove(e);
  90376. });
  90377. _this.on(_this.volumeBar, ["focus", "slideractive"], function() {
  90378. _this.volumeBar.addClass("vjs-slider-active");
  90379. _this.addClass("vjs-slider-active");
  90380. _this.trigger("slideractive");
  90381. });
  90382. _this.on(_this.volumeBar, ["blur", "sliderinactive"], function() {
  90383. _this.volumeBar.removeClass("vjs-slider-active");
  90384. _this.removeClass("vjs-slider-active");
  90385. _this.trigger("sliderinactive");
  90386. });
  90387. return _this;
  90388. }
  90389. var _proto = VolumeControl2.prototype;
  90390. _proto.createEl = function createEl2() {
  90391. var orientationClass = "vjs-volume-horizontal";
  90392. if (this.options_.vertical) {
  90393. orientationClass = "vjs-volume-vertical";
  90394. }
  90395. return _Component.prototype.createEl.call(this, "div", {
  90396. className: "vjs-volume-control vjs-control " + orientationClass
  90397. });
  90398. };
  90399. _proto.handleMouseDown = function handleMouseDown(event2) {
  90400. var doc = this.el_.ownerDocument;
  90401. this.on(doc, "mousemove", this.throttledHandleMouseMove);
  90402. this.on(doc, "touchmove", this.throttledHandleMouseMove);
  90403. this.on(doc, "mouseup", this.handleMouseUpHandler_);
  90404. this.on(doc, "touchend", this.handleMouseUpHandler_);
  90405. };
  90406. _proto.handleMouseUp = function handleMouseUp(event2) {
  90407. var doc = this.el_.ownerDocument;
  90408. this.off(doc, "mousemove", this.throttledHandleMouseMove);
  90409. this.off(doc, "touchmove", this.throttledHandleMouseMove);
  90410. this.off(doc, "mouseup", this.handleMouseUpHandler_);
  90411. this.off(doc, "touchend", this.handleMouseUpHandler_);
  90412. };
  90413. _proto.handleMouseMove = function handleMouseMove(event2) {
  90414. this.volumeBar.handleMouseMove(event2);
  90415. };
  90416. return VolumeControl2;
  90417. }(Component$1);
  90418. VolumeControl.prototype.options_ = {
  90419. children: ["volumeBar"]
  90420. };
  90421. Component$1.registerComponent("VolumeControl", VolumeControl);
  90422. var checkMuteSupport = function checkMuteSupport2(self2, player) {
  90423. if (player.tech_ && !player.tech_.featuresMuteControl) {
  90424. self2.addClass("vjs-hidden");
  90425. }
  90426. self2.on(player, "loadstart", function() {
  90427. if (!player.tech_.featuresMuteControl) {
  90428. self2.addClass("vjs-hidden");
  90429. } else {
  90430. self2.removeClass("vjs-hidden");
  90431. }
  90432. });
  90433. };
  90434. var MuteToggle = /* @__PURE__ */ function(_Button) {
  90435. _inheritsLoose(MuteToggle2, _Button);
  90436. function MuteToggle2(player, options2) {
  90437. var _this;
  90438. _this = _Button.call(this, player, options2) || this;
  90439. checkMuteSupport(_assertThisInitialized(_this), player);
  90440. _this.on(player, ["loadstart", "volumechange"], function(e) {
  90441. return _this.update(e);
  90442. });
  90443. return _this;
  90444. }
  90445. var _proto = MuteToggle2.prototype;
  90446. _proto.buildCSSClass = function buildCSSClass() {
  90447. return "vjs-mute-control " + _Button.prototype.buildCSSClass.call(this);
  90448. };
  90449. _proto.handleClick = function handleClick(event2) {
  90450. var vol = this.player_.volume();
  90451. var lastVolume = this.player_.lastVolume_();
  90452. if (vol === 0) {
  90453. var volumeToSet = lastVolume < 0.1 ? 0.1 : lastVolume;
  90454. this.player_.volume(volumeToSet);
  90455. this.player_.muted(false);
  90456. } else {
  90457. this.player_.muted(this.player_.muted() ? false : true);
  90458. }
  90459. };
  90460. _proto.update = function update(event2) {
  90461. this.updateIcon_();
  90462. this.updateControlText_();
  90463. };
  90464. _proto.updateIcon_ = function updateIcon_() {
  90465. var vol = this.player_.volume();
  90466. var level = 3;
  90467. if (IS_IOS && this.player_.tech_ && this.player_.tech_.el_) {
  90468. this.player_.muted(this.player_.tech_.el_.muted);
  90469. }
  90470. if (vol === 0 || this.player_.muted()) {
  90471. level = 0;
  90472. } else if (vol < 0.33) {
  90473. level = 1;
  90474. } else if (vol < 0.67) {
  90475. level = 2;
  90476. }
  90477. for (var i2 = 0; i2 < 4; i2++) {
  90478. removeClass(this.el_, "vjs-vol-" + i2);
  90479. }
  90480. addClass(this.el_, "vjs-vol-" + level);
  90481. };
  90482. _proto.updateControlText_ = function updateControlText_() {
  90483. var soundOff = this.player_.muted() || this.player_.volume() === 0;
  90484. var text = soundOff ? "Unmute" : "Mute";
  90485. if (this.controlText() !== text) {
  90486. this.controlText(text);
  90487. }
  90488. };
  90489. return MuteToggle2;
  90490. }(Button);
  90491. MuteToggle.prototype.controlText_ = "Mute";
  90492. Component$1.registerComponent("MuteToggle", MuteToggle);
  90493. var VolumePanel = /* @__PURE__ */ function(_Component) {
  90494. _inheritsLoose(VolumePanel2, _Component);
  90495. function VolumePanel2(player, options2) {
  90496. var _this;
  90497. if (options2 === void 0) {
  90498. options2 = {};
  90499. }
  90500. if (typeof options2.inline !== "undefined") {
  90501. options2.inline = options2.inline;
  90502. } else {
  90503. options2.inline = true;
  90504. }
  90505. if (typeof options2.volumeControl === "undefined" || isPlain(options2.volumeControl)) {
  90506. options2.volumeControl = options2.volumeControl || {};
  90507. options2.volumeControl.vertical = !options2.inline;
  90508. }
  90509. _this = _Component.call(this, player, options2) || this;
  90510. _this.handleKeyPressHandler_ = function(e) {
  90511. return _this.handleKeyPress(e);
  90512. };
  90513. _this.on(player, ["loadstart"], function(e) {
  90514. return _this.volumePanelState_(e);
  90515. });
  90516. _this.on(_this.muteToggle, "keyup", function(e) {
  90517. return _this.handleKeyPress(e);
  90518. });
  90519. _this.on(_this.volumeControl, "keyup", function(e) {
  90520. return _this.handleVolumeControlKeyUp(e);
  90521. });
  90522. _this.on("keydown", function(e) {
  90523. return _this.handleKeyPress(e);
  90524. });
  90525. _this.on("mouseover", function(e) {
  90526. return _this.handleMouseOver(e);
  90527. });
  90528. _this.on("mouseout", function(e) {
  90529. return _this.handleMouseOut(e);
  90530. });
  90531. _this.on(_this.volumeControl, ["slideractive"], _this.sliderActive_);
  90532. _this.on(_this.volumeControl, ["sliderinactive"], _this.sliderInactive_);
  90533. return _this;
  90534. }
  90535. var _proto = VolumePanel2.prototype;
  90536. _proto.sliderActive_ = function sliderActive_() {
  90537. this.addClass("vjs-slider-active");
  90538. };
  90539. _proto.sliderInactive_ = function sliderInactive_() {
  90540. this.removeClass("vjs-slider-active");
  90541. };
  90542. _proto.volumePanelState_ = function volumePanelState_() {
  90543. if (this.volumeControl.hasClass("vjs-hidden") && this.muteToggle.hasClass("vjs-hidden")) {
  90544. this.addClass("vjs-hidden");
  90545. }
  90546. if (this.volumeControl.hasClass("vjs-hidden") && !this.muteToggle.hasClass("vjs-hidden")) {
  90547. this.addClass("vjs-mute-toggle-only");
  90548. }
  90549. };
  90550. _proto.createEl = function createEl2() {
  90551. var orientationClass = "vjs-volume-panel-horizontal";
  90552. if (!this.options_.inline) {
  90553. orientationClass = "vjs-volume-panel-vertical";
  90554. }
  90555. return _Component.prototype.createEl.call(this, "div", {
  90556. className: "vjs-volume-panel vjs-control " + orientationClass
  90557. });
  90558. };
  90559. _proto.dispose = function dispose() {
  90560. this.handleMouseOut();
  90561. _Component.prototype.dispose.call(this);
  90562. };
  90563. _proto.handleVolumeControlKeyUp = function handleVolumeControlKeyUp(event2) {
  90564. if (keycode.isEventKey(event2, "Esc")) {
  90565. this.muteToggle.focus();
  90566. }
  90567. };
  90568. _proto.handleMouseOver = function handleMouseOver(event2) {
  90569. this.addClass("vjs-hover");
  90570. on(document_1, "keyup", this.handleKeyPressHandler_);
  90571. };
  90572. _proto.handleMouseOut = function handleMouseOut(event2) {
  90573. this.removeClass("vjs-hover");
  90574. off(document_1, "keyup", this.handleKeyPressHandler_);
  90575. };
  90576. _proto.handleKeyPress = function handleKeyPress(event2) {
  90577. if (keycode.isEventKey(event2, "Esc")) {
  90578. this.handleMouseOut();
  90579. }
  90580. };
  90581. return VolumePanel2;
  90582. }(Component$1);
  90583. VolumePanel.prototype.options_ = {
  90584. children: ["muteToggle", "volumeControl"]
  90585. };
  90586. Component$1.registerComponent("VolumePanel", VolumePanel);
  90587. var Menu = /* @__PURE__ */ function(_Component) {
  90588. _inheritsLoose(Menu2, _Component);
  90589. function Menu2(player, options2) {
  90590. var _this;
  90591. _this = _Component.call(this, player, options2) || this;
  90592. if (options2) {
  90593. _this.menuButton_ = options2.menuButton;
  90594. }
  90595. _this.focusedChild_ = -1;
  90596. _this.on("keydown", function(e) {
  90597. return _this.handleKeyDown(e);
  90598. });
  90599. _this.boundHandleBlur_ = function(e) {
  90600. return _this.handleBlur(e);
  90601. };
  90602. _this.boundHandleTapClick_ = function(e) {
  90603. return _this.handleTapClick(e);
  90604. };
  90605. return _this;
  90606. }
  90607. var _proto = Menu2.prototype;
  90608. _proto.addEventListenerForItem = function addEventListenerForItem(component) {
  90609. if (!(component instanceof Component$1)) {
  90610. return;
  90611. }
  90612. this.on(component, "blur", this.boundHandleBlur_);
  90613. this.on(component, ["tap", "click"], this.boundHandleTapClick_);
  90614. };
  90615. _proto.removeEventListenerForItem = function removeEventListenerForItem(component) {
  90616. if (!(component instanceof Component$1)) {
  90617. return;
  90618. }
  90619. this.off(component, "blur", this.boundHandleBlur_);
  90620. this.off(component, ["tap", "click"], this.boundHandleTapClick_);
  90621. };
  90622. _proto.removeChild = function removeChild(component) {
  90623. if (typeof component === "string") {
  90624. component = this.getChild(component);
  90625. }
  90626. this.removeEventListenerForItem(component);
  90627. _Component.prototype.removeChild.call(this, component);
  90628. };
  90629. _proto.addItem = function addItem(component) {
  90630. var childComponent = this.addChild(component);
  90631. if (childComponent) {
  90632. this.addEventListenerForItem(childComponent);
  90633. }
  90634. };
  90635. _proto.createEl = function createEl$12() {
  90636. var contentElType = this.options_.contentElType || "ul";
  90637. this.contentEl_ = createEl(contentElType, {
  90638. className: "vjs-menu-content"
  90639. });
  90640. this.contentEl_.setAttribute("role", "menu");
  90641. var el = _Component.prototype.createEl.call(this, "div", {
  90642. append: this.contentEl_,
  90643. className: "vjs-menu"
  90644. });
  90645. el.appendChild(this.contentEl_);
  90646. on(el, "click", function(event2) {
  90647. event2.preventDefault();
  90648. event2.stopImmediatePropagation();
  90649. });
  90650. return el;
  90651. };
  90652. _proto.dispose = function dispose() {
  90653. this.contentEl_ = null;
  90654. this.boundHandleBlur_ = null;
  90655. this.boundHandleTapClick_ = null;
  90656. _Component.prototype.dispose.call(this);
  90657. };
  90658. _proto.handleBlur = function handleBlur(event2) {
  90659. var relatedTarget = event2.relatedTarget || document_1.activeElement;
  90660. if (!this.children().some(function(element) {
  90661. return element.el() === relatedTarget;
  90662. })) {
  90663. var btn = this.menuButton_;
  90664. if (btn && btn.buttonPressed_ && relatedTarget !== btn.el().firstChild) {
  90665. btn.unpressButton();
  90666. }
  90667. }
  90668. };
  90669. _proto.handleTapClick = function handleTapClick(event2) {
  90670. if (this.menuButton_) {
  90671. this.menuButton_.unpressButton();
  90672. var childComponents = this.children();
  90673. if (!Array.isArray(childComponents)) {
  90674. return;
  90675. }
  90676. var foundComponent = childComponents.filter(function(component) {
  90677. return component.el() === event2.target;
  90678. })[0];
  90679. if (!foundComponent) {
  90680. return;
  90681. }
  90682. if (foundComponent.name() !== "CaptionSettingsMenuItem") {
  90683. this.menuButton_.focus();
  90684. }
  90685. }
  90686. };
  90687. _proto.handleKeyDown = function handleKeyDown(event2) {
  90688. if (keycode.isEventKey(event2, "Left") || keycode.isEventKey(event2, "Down")) {
  90689. event2.preventDefault();
  90690. event2.stopPropagation();
  90691. this.stepForward();
  90692. } else if (keycode.isEventKey(event2, "Right") || keycode.isEventKey(event2, "Up")) {
  90693. event2.preventDefault();
  90694. event2.stopPropagation();
  90695. this.stepBack();
  90696. }
  90697. };
  90698. _proto.stepForward = function stepForward() {
  90699. var stepChild = 0;
  90700. if (this.focusedChild_ !== void 0) {
  90701. stepChild = this.focusedChild_ + 1;
  90702. }
  90703. this.focus(stepChild);
  90704. };
  90705. _proto.stepBack = function stepBack() {
  90706. var stepChild = 0;
  90707. if (this.focusedChild_ !== void 0) {
  90708. stepChild = this.focusedChild_ - 1;
  90709. }
  90710. this.focus(stepChild);
  90711. };
  90712. _proto.focus = function focus(item) {
  90713. if (item === void 0) {
  90714. item = 0;
  90715. }
  90716. var children = this.children().slice();
  90717. var haveTitle = children.length && children[0].hasClass("vjs-menu-title");
  90718. if (haveTitle) {
  90719. children.shift();
  90720. }
  90721. if (children.length > 0) {
  90722. if (item < 0) {
  90723. item = 0;
  90724. } else if (item >= children.length) {
  90725. item = children.length - 1;
  90726. }
  90727. this.focusedChild_ = item;
  90728. children[item].el_.focus();
  90729. }
  90730. };
  90731. return Menu2;
  90732. }(Component$1);
  90733. Component$1.registerComponent("Menu", Menu);
  90734. var MenuButton = /* @__PURE__ */ function(_Component) {
  90735. _inheritsLoose(MenuButton2, _Component);
  90736. function MenuButton2(player, options2) {
  90737. var _this;
  90738. if (options2 === void 0) {
  90739. options2 = {};
  90740. }
  90741. _this = _Component.call(this, player, options2) || this;
  90742. _this.menuButton_ = new Button(player, options2);
  90743. _this.menuButton_.controlText(_this.controlText_);
  90744. _this.menuButton_.el_.setAttribute("aria-haspopup", "true");
  90745. var buttonClass = Button.prototype.buildCSSClass();
  90746. _this.menuButton_.el_.className = _this.buildCSSClass() + " " + buttonClass;
  90747. _this.menuButton_.removeClass("vjs-control");
  90748. _this.addChild(_this.menuButton_);
  90749. _this.update();
  90750. _this.enabled_ = true;
  90751. var handleClick = function handleClick2(e) {
  90752. return _this.handleClick(e);
  90753. };
  90754. _this.handleMenuKeyUp_ = function(e) {
  90755. return _this.handleMenuKeyUp(e);
  90756. };
  90757. _this.on(_this.menuButton_, "tap", handleClick);
  90758. _this.on(_this.menuButton_, "click", handleClick);
  90759. _this.on(_this.menuButton_, "keydown", function(e) {
  90760. return _this.handleKeyDown(e);
  90761. });
  90762. _this.on(_this.menuButton_, "mouseenter", function() {
  90763. _this.addClass("vjs-hover");
  90764. _this.menu.show();
  90765. on(document_1, "keyup", _this.handleMenuKeyUp_);
  90766. });
  90767. _this.on("mouseleave", function(e) {
  90768. return _this.handleMouseLeave(e);
  90769. });
  90770. _this.on("keydown", function(e) {
  90771. return _this.handleSubmenuKeyDown(e);
  90772. });
  90773. return _this;
  90774. }
  90775. var _proto = MenuButton2.prototype;
  90776. _proto.update = function update() {
  90777. var menu = this.createMenu();
  90778. if (this.menu) {
  90779. this.menu.dispose();
  90780. this.removeChild(this.menu);
  90781. }
  90782. this.menu = menu;
  90783. this.addChild(menu);
  90784. this.buttonPressed_ = false;
  90785. this.menuButton_.el_.setAttribute("aria-expanded", "false");
  90786. if (this.items && this.items.length <= this.hideThreshold_) {
  90787. this.hide();
  90788. this.menu.contentEl_.removeAttribute("role");
  90789. } else {
  90790. this.show();
  90791. this.menu.contentEl_.setAttribute("role", "menu");
  90792. }
  90793. };
  90794. _proto.createMenu = function createMenu() {
  90795. var menu = new Menu(this.player_, {
  90796. menuButton: this
  90797. });
  90798. this.hideThreshold_ = 0;
  90799. if (this.options_.title) {
  90800. var titleEl = createEl("li", {
  90801. className: "vjs-menu-title",
  90802. textContent: toTitleCase$1(this.options_.title),
  90803. tabIndex: -1
  90804. });
  90805. var titleComponent = new Component$1(this.player_, {
  90806. el: titleEl
  90807. });
  90808. menu.addItem(titleComponent);
  90809. }
  90810. this.items = this.createItems();
  90811. if (this.items) {
  90812. for (var i2 = 0; i2 < this.items.length; i2++) {
  90813. menu.addItem(this.items[i2]);
  90814. }
  90815. }
  90816. return menu;
  90817. };
  90818. _proto.createItems = function createItems() {
  90819. };
  90820. _proto.createEl = function createEl2() {
  90821. return _Component.prototype.createEl.call(this, "div", {
  90822. className: this.buildWrapperCSSClass()
  90823. }, {});
  90824. };
  90825. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  90826. var menuButtonClass = "vjs-menu-button";
  90827. if (this.options_.inline === true) {
  90828. menuButtonClass += "-inline";
  90829. } else {
  90830. menuButtonClass += "-popup";
  90831. }
  90832. var buttonClass = Button.prototype.buildCSSClass();
  90833. return "vjs-menu-button " + menuButtonClass + " " + buttonClass + " " + _Component.prototype.buildCSSClass.call(this);
  90834. };
  90835. _proto.buildCSSClass = function buildCSSClass() {
  90836. var menuButtonClass = "vjs-menu-button";
  90837. if (this.options_.inline === true) {
  90838. menuButtonClass += "-inline";
  90839. } else {
  90840. menuButtonClass += "-popup";
  90841. }
  90842. return "vjs-menu-button " + menuButtonClass + " " + _Component.prototype.buildCSSClass.call(this);
  90843. };
  90844. _proto.controlText = function controlText(text, el) {
  90845. if (el === void 0) {
  90846. el = this.menuButton_.el();
  90847. }
  90848. return this.menuButton_.controlText(text, el);
  90849. };
  90850. _proto.dispose = function dispose() {
  90851. this.handleMouseLeave();
  90852. _Component.prototype.dispose.call(this);
  90853. };
  90854. _proto.handleClick = function handleClick(event2) {
  90855. if (this.buttonPressed_) {
  90856. this.unpressButton();
  90857. } else {
  90858. this.pressButton();
  90859. }
  90860. };
  90861. _proto.handleMouseLeave = function handleMouseLeave(event2) {
  90862. this.removeClass("vjs-hover");
  90863. off(document_1, "keyup", this.handleMenuKeyUp_);
  90864. };
  90865. _proto.focus = function focus() {
  90866. this.menuButton_.focus();
  90867. };
  90868. _proto.blur = function blur() {
  90869. this.menuButton_.blur();
  90870. };
  90871. _proto.handleKeyDown = function handleKeyDown(event2) {
  90872. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  90873. if (this.buttonPressed_) {
  90874. this.unpressButton();
  90875. }
  90876. if (!keycode.isEventKey(event2, "Tab")) {
  90877. event2.preventDefault();
  90878. this.menuButton_.focus();
  90879. }
  90880. } else if (keycode.isEventKey(event2, "Up") || keycode.isEventKey(event2, "Down")) {
  90881. if (!this.buttonPressed_) {
  90882. event2.preventDefault();
  90883. this.pressButton();
  90884. }
  90885. }
  90886. };
  90887. _proto.handleMenuKeyUp = function handleMenuKeyUp(event2) {
  90888. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  90889. this.removeClass("vjs-hover");
  90890. }
  90891. };
  90892. _proto.handleSubmenuKeyPress = function handleSubmenuKeyPress(event2) {
  90893. this.handleSubmenuKeyDown(event2);
  90894. };
  90895. _proto.handleSubmenuKeyDown = function handleSubmenuKeyDown(event2) {
  90896. if (keycode.isEventKey(event2, "Esc") || keycode.isEventKey(event2, "Tab")) {
  90897. if (this.buttonPressed_) {
  90898. this.unpressButton();
  90899. }
  90900. if (!keycode.isEventKey(event2, "Tab")) {
  90901. event2.preventDefault();
  90902. this.menuButton_.focus();
  90903. }
  90904. }
  90905. };
  90906. _proto.pressButton = function pressButton() {
  90907. if (this.enabled_) {
  90908. this.buttonPressed_ = true;
  90909. this.menu.show();
  90910. this.menu.lockShowing();
  90911. this.menuButton_.el_.setAttribute("aria-expanded", "true");
  90912. if (IS_IOS && isInFrame()) {
  90913. return;
  90914. }
  90915. this.menu.focus();
  90916. }
  90917. };
  90918. _proto.unpressButton = function unpressButton() {
  90919. if (this.enabled_) {
  90920. this.buttonPressed_ = false;
  90921. this.menu.unlockShowing();
  90922. this.menu.hide();
  90923. this.menuButton_.el_.setAttribute("aria-expanded", "false");
  90924. }
  90925. };
  90926. _proto.disable = function disable() {
  90927. this.unpressButton();
  90928. this.enabled_ = false;
  90929. this.addClass("vjs-disabled");
  90930. this.menuButton_.disable();
  90931. };
  90932. _proto.enable = function enable() {
  90933. this.enabled_ = true;
  90934. this.removeClass("vjs-disabled");
  90935. this.menuButton_.enable();
  90936. };
  90937. return MenuButton2;
  90938. }(Component$1);
  90939. Component$1.registerComponent("MenuButton", MenuButton);
  90940. var TrackButton = /* @__PURE__ */ function(_MenuButton) {
  90941. _inheritsLoose(TrackButton2, _MenuButton);
  90942. function TrackButton2(player, options2) {
  90943. var _this;
  90944. var tracks = options2.tracks;
  90945. _this = _MenuButton.call(this, player, options2) || this;
  90946. if (_this.items.length <= 1) {
  90947. _this.hide();
  90948. }
  90949. if (!tracks) {
  90950. return _assertThisInitialized(_this);
  90951. }
  90952. var updateHandler = bind(_assertThisInitialized(_this), _this.update);
  90953. tracks.addEventListener("removetrack", updateHandler);
  90954. tracks.addEventListener("addtrack", updateHandler);
  90955. tracks.addEventListener("labelchange", updateHandler);
  90956. _this.player_.on("ready", updateHandler);
  90957. _this.player_.on("dispose", function() {
  90958. tracks.removeEventListener("removetrack", updateHandler);
  90959. tracks.removeEventListener("addtrack", updateHandler);
  90960. tracks.removeEventListener("labelchange", updateHandler);
  90961. });
  90962. return _this;
  90963. }
  90964. return TrackButton2;
  90965. }(MenuButton);
  90966. Component$1.registerComponent("TrackButton", TrackButton);
  90967. var MenuKeys = ["Tab", "Esc", "Up", "Down", "Right", "Left"];
  90968. var MenuItem = /* @__PURE__ */ function(_ClickableComponent) {
  90969. _inheritsLoose(MenuItem2, _ClickableComponent);
  90970. function MenuItem2(player, options2) {
  90971. var _this;
  90972. _this = _ClickableComponent.call(this, player, options2) || this;
  90973. _this.selectable = options2.selectable;
  90974. _this.isSelected_ = options2.selected || false;
  90975. _this.multiSelectable = options2.multiSelectable;
  90976. _this.selected(_this.isSelected_);
  90977. if (_this.selectable) {
  90978. if (_this.multiSelectable) {
  90979. _this.el_.setAttribute("role", "menuitemcheckbox");
  90980. } else {
  90981. _this.el_.setAttribute("role", "menuitemradio");
  90982. }
  90983. } else {
  90984. _this.el_.setAttribute("role", "menuitem");
  90985. }
  90986. return _this;
  90987. }
  90988. var _proto = MenuItem2.prototype;
  90989. _proto.createEl = function createEl$12(type2, props, attrs) {
  90990. this.nonIconControl = true;
  90991. var el = _ClickableComponent.prototype.createEl.call(this, "li", assign({
  90992. className: "vjs-menu-item",
  90993. tabIndex: -1
  90994. }, props), attrs);
  90995. el.replaceChild(createEl("span", {
  90996. className: "vjs-menu-item-text",
  90997. textContent: this.localize(this.options_.label)
  90998. }), el.querySelector(".vjs-icon-placeholder"));
  90999. return el;
  91000. };
  91001. _proto.handleKeyDown = function handleKeyDown(event2) {
  91002. if (!MenuKeys.some(function(key) {
  91003. return keycode.isEventKey(event2, key);
  91004. })) {
  91005. _ClickableComponent.prototype.handleKeyDown.call(this, event2);
  91006. }
  91007. };
  91008. _proto.handleClick = function handleClick(event2) {
  91009. this.selected(true);
  91010. };
  91011. _proto.selected = function selected(_selected) {
  91012. if (this.selectable) {
  91013. if (_selected) {
  91014. this.addClass("vjs-selected");
  91015. this.el_.setAttribute("aria-checked", "true");
  91016. this.controlText(", selected");
  91017. this.isSelected_ = true;
  91018. } else {
  91019. this.removeClass("vjs-selected");
  91020. this.el_.setAttribute("aria-checked", "false");
  91021. this.controlText("");
  91022. this.isSelected_ = false;
  91023. }
  91024. }
  91025. };
  91026. return MenuItem2;
  91027. }(ClickableComponent);
  91028. Component$1.registerComponent("MenuItem", MenuItem);
  91029. var TextTrackMenuItem = /* @__PURE__ */ function(_MenuItem) {
  91030. _inheritsLoose(TextTrackMenuItem2, _MenuItem);
  91031. function TextTrackMenuItem2(player, options2) {
  91032. var _this;
  91033. var track = options2.track;
  91034. var tracks = player.textTracks();
  91035. options2.label = track.label || track.language || "Unknown";
  91036. options2.selected = track.mode === "showing";
  91037. _this = _MenuItem.call(this, player, options2) || this;
  91038. _this.track = track;
  91039. _this.kinds = (options2.kinds || [options2.kind || _this.track.kind]).filter(Boolean);
  91040. var changeHandler = function changeHandler2() {
  91041. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  91042. args[_key] = arguments[_key];
  91043. }
  91044. _this.handleTracksChange.apply(_assertThisInitialized(_this), args);
  91045. };
  91046. var selectedLanguageChangeHandler = function selectedLanguageChangeHandler2() {
  91047. for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  91048. args[_key2] = arguments[_key2];
  91049. }
  91050. _this.handleSelectedLanguageChange.apply(_assertThisInitialized(_this), args);
  91051. };
  91052. player.on(["loadstart", "texttrackchange"], changeHandler);
  91053. tracks.addEventListener("change", changeHandler);
  91054. tracks.addEventListener("selectedlanguagechange", selectedLanguageChangeHandler);
  91055. _this.on("dispose", function() {
  91056. player.off(["loadstart", "texttrackchange"], changeHandler);
  91057. tracks.removeEventListener("change", changeHandler);
  91058. tracks.removeEventListener("selectedlanguagechange", selectedLanguageChangeHandler);
  91059. });
  91060. if (tracks.onchange === void 0) {
  91061. var event2;
  91062. _this.on(["tap", "click"], function() {
  91063. if (typeof window_1.Event !== "object") {
  91064. try {
  91065. event2 = new window_1.Event("change");
  91066. } catch (err) {
  91067. }
  91068. }
  91069. if (!event2) {
  91070. event2 = document_1.createEvent("Event");
  91071. event2.initEvent("change", true, true);
  91072. }
  91073. tracks.dispatchEvent(event2);
  91074. });
  91075. }
  91076. _this.handleTracksChange();
  91077. return _this;
  91078. }
  91079. var _proto = TextTrackMenuItem2.prototype;
  91080. _proto.handleClick = function handleClick(event2) {
  91081. var referenceTrack = this.track;
  91082. var tracks = this.player_.textTracks();
  91083. _MenuItem.prototype.handleClick.call(this, event2);
  91084. if (!tracks) {
  91085. return;
  91086. }
  91087. for (var i2 = 0; i2 < tracks.length; i2++) {
  91088. var track = tracks[i2];
  91089. if (this.kinds.indexOf(track.kind) === -1) {
  91090. continue;
  91091. }
  91092. if (track === referenceTrack) {
  91093. if (track.mode !== "showing") {
  91094. track.mode = "showing";
  91095. }
  91096. } else if (track.mode !== "disabled") {
  91097. track.mode = "disabled";
  91098. }
  91099. }
  91100. };
  91101. _proto.handleTracksChange = function handleTracksChange(event2) {
  91102. var shouldBeSelected = this.track.mode === "showing";
  91103. if (shouldBeSelected !== this.isSelected_) {
  91104. this.selected(shouldBeSelected);
  91105. }
  91106. };
  91107. _proto.handleSelectedLanguageChange = function handleSelectedLanguageChange(event2) {
  91108. if (this.track.mode === "showing") {
  91109. var selectedLanguage = this.player_.cache_.selectedLanguage;
  91110. if (selectedLanguage && selectedLanguage.enabled && selectedLanguage.language === this.track.language && selectedLanguage.kind !== this.track.kind) {
  91111. return;
  91112. }
  91113. this.player_.cache_.selectedLanguage = {
  91114. enabled: true,
  91115. language: this.track.language,
  91116. kind: this.track.kind
  91117. };
  91118. }
  91119. };
  91120. _proto.dispose = function dispose() {
  91121. this.track = null;
  91122. _MenuItem.prototype.dispose.call(this);
  91123. };
  91124. return TextTrackMenuItem2;
  91125. }(MenuItem);
  91126. Component$1.registerComponent("TextTrackMenuItem", TextTrackMenuItem);
  91127. var OffTextTrackMenuItem = /* @__PURE__ */ function(_TextTrackMenuItem) {
  91128. _inheritsLoose(OffTextTrackMenuItem2, _TextTrackMenuItem);
  91129. function OffTextTrackMenuItem2(player, options2) {
  91130. options2.track = {
  91131. player,
  91132. kind: options2.kind,
  91133. kinds: options2.kinds,
  91134. "default": false,
  91135. mode: "disabled"
  91136. };
  91137. if (!options2.kinds) {
  91138. options2.kinds = [options2.kind];
  91139. }
  91140. if (options2.label) {
  91141. options2.track.label = options2.label;
  91142. } else {
  91143. options2.track.label = options2.kinds.join(" and ") + " off";
  91144. }
  91145. options2.selectable = true;
  91146. options2.multiSelectable = false;
  91147. return _TextTrackMenuItem.call(this, player, options2) || this;
  91148. }
  91149. var _proto = OffTextTrackMenuItem2.prototype;
  91150. _proto.handleTracksChange = function handleTracksChange(event2) {
  91151. var tracks = this.player().textTracks();
  91152. var shouldBeSelected = true;
  91153. for (var i2 = 0, l = tracks.length; i2 < l; i2++) {
  91154. var track = tracks[i2];
  91155. if (this.options_.kinds.indexOf(track.kind) > -1 && track.mode === "showing") {
  91156. shouldBeSelected = false;
  91157. break;
  91158. }
  91159. }
  91160. if (shouldBeSelected !== this.isSelected_) {
  91161. this.selected(shouldBeSelected);
  91162. }
  91163. };
  91164. _proto.handleSelectedLanguageChange = function handleSelectedLanguageChange(event2) {
  91165. var tracks = this.player().textTracks();
  91166. var allHidden = true;
  91167. for (var i2 = 0, l = tracks.length; i2 < l; i2++) {
  91168. var track = tracks[i2];
  91169. if (["captions", "descriptions", "subtitles"].indexOf(track.kind) > -1 && track.mode === "showing") {
  91170. allHidden = false;
  91171. break;
  91172. }
  91173. }
  91174. if (allHidden) {
  91175. this.player_.cache_.selectedLanguage = {
  91176. enabled: false
  91177. };
  91178. }
  91179. };
  91180. return OffTextTrackMenuItem2;
  91181. }(TextTrackMenuItem);
  91182. Component$1.registerComponent("OffTextTrackMenuItem", OffTextTrackMenuItem);
  91183. var TextTrackButton = /* @__PURE__ */ function(_TrackButton) {
  91184. _inheritsLoose(TextTrackButton2, _TrackButton);
  91185. function TextTrackButton2(player, options2) {
  91186. if (options2 === void 0) {
  91187. options2 = {};
  91188. }
  91189. options2.tracks = player.textTracks();
  91190. return _TrackButton.call(this, player, options2) || this;
  91191. }
  91192. var _proto = TextTrackButton2.prototype;
  91193. _proto.createItems = function createItems(items, TrackMenuItem) {
  91194. if (items === void 0) {
  91195. items = [];
  91196. }
  91197. if (TrackMenuItem === void 0) {
  91198. TrackMenuItem = TextTrackMenuItem;
  91199. }
  91200. var label;
  91201. if (this.label_) {
  91202. label = this.label_ + " off";
  91203. }
  91204. items.push(new OffTextTrackMenuItem(this.player_, {
  91205. kinds: this.kinds_,
  91206. kind: this.kind_,
  91207. label
  91208. }));
  91209. this.hideThreshold_ += 1;
  91210. var tracks = this.player_.textTracks();
  91211. if (!Array.isArray(this.kinds_)) {
  91212. this.kinds_ = [this.kind_];
  91213. }
  91214. for (var i2 = 0; i2 < tracks.length; i2++) {
  91215. var track = tracks[i2];
  91216. if (this.kinds_.indexOf(track.kind) > -1) {
  91217. var item = new TrackMenuItem(this.player_, {
  91218. track,
  91219. kinds: this.kinds_,
  91220. kind: this.kind_,
  91221. selectable: true,
  91222. multiSelectable: false
  91223. });
  91224. item.addClass("vjs-" + track.kind + "-menu-item");
  91225. items.push(item);
  91226. }
  91227. }
  91228. return items;
  91229. };
  91230. return TextTrackButton2;
  91231. }(TrackButton);
  91232. Component$1.registerComponent("TextTrackButton", TextTrackButton);
  91233. var ChaptersTrackMenuItem = /* @__PURE__ */ function(_MenuItem) {
  91234. _inheritsLoose(ChaptersTrackMenuItem2, _MenuItem);
  91235. function ChaptersTrackMenuItem2(player, options2) {
  91236. var _this;
  91237. var track = options2.track;
  91238. var cue = options2.cue;
  91239. var currentTime = player.currentTime();
  91240. options2.selectable = true;
  91241. options2.multiSelectable = false;
  91242. options2.label = cue.text;
  91243. options2.selected = cue.startTime <= currentTime && currentTime < cue.endTime;
  91244. _this = _MenuItem.call(this, player, options2) || this;
  91245. _this.track = track;
  91246. _this.cue = cue;
  91247. return _this;
  91248. }
  91249. var _proto = ChaptersTrackMenuItem2.prototype;
  91250. _proto.handleClick = function handleClick(event2) {
  91251. _MenuItem.prototype.handleClick.call(this);
  91252. this.player_.currentTime(this.cue.startTime);
  91253. };
  91254. return ChaptersTrackMenuItem2;
  91255. }(MenuItem);
  91256. Component$1.registerComponent("ChaptersTrackMenuItem", ChaptersTrackMenuItem);
  91257. var ChaptersButton = /* @__PURE__ */ function(_TextTrackButton) {
  91258. _inheritsLoose(ChaptersButton2, _TextTrackButton);
  91259. function ChaptersButton2(player, options2, ready) {
  91260. var _this;
  91261. _this = _TextTrackButton.call(this, player, options2, ready) || this;
  91262. _this.selectCurrentItem_ = function() {
  91263. _this.items.forEach(function(item) {
  91264. item.selected(_this.track_.activeCues[0] === item.cue);
  91265. });
  91266. };
  91267. return _this;
  91268. }
  91269. var _proto = ChaptersButton2.prototype;
  91270. _proto.buildCSSClass = function buildCSSClass() {
  91271. return "vjs-chapters-button " + _TextTrackButton.prototype.buildCSSClass.call(this);
  91272. };
  91273. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91274. return "vjs-chapters-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);
  91275. };
  91276. _proto.update = function update(event2) {
  91277. if (event2 && event2.track && event2.track.kind !== "chapters") {
  91278. return;
  91279. }
  91280. var track = this.findChaptersTrack();
  91281. if (track !== this.track_) {
  91282. this.setTrack(track);
  91283. _TextTrackButton.prototype.update.call(this);
  91284. } else if (!this.items || track && track.cues && track.cues.length !== this.items.length) {
  91285. _TextTrackButton.prototype.update.call(this);
  91286. }
  91287. };
  91288. _proto.setTrack = function setTrack(track) {
  91289. if (this.track_ === track) {
  91290. return;
  91291. }
  91292. if (!this.updateHandler_) {
  91293. this.updateHandler_ = this.update.bind(this);
  91294. }
  91295. if (this.track_) {
  91296. var remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
  91297. if (remoteTextTrackEl) {
  91298. remoteTextTrackEl.removeEventListener("load", this.updateHandler_);
  91299. }
  91300. this.track_.removeEventListener("cuechange", this.selectCurrentItem_);
  91301. this.track_ = null;
  91302. }
  91303. this.track_ = track;
  91304. if (this.track_) {
  91305. this.track_.mode = "hidden";
  91306. var _remoteTextTrackEl = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
  91307. if (_remoteTextTrackEl) {
  91308. _remoteTextTrackEl.addEventListener("load", this.updateHandler_);
  91309. }
  91310. this.track_.addEventListener("cuechange", this.selectCurrentItem_);
  91311. }
  91312. };
  91313. _proto.findChaptersTrack = function findChaptersTrack() {
  91314. var tracks = this.player_.textTracks() || [];
  91315. for (var i2 = tracks.length - 1; i2 >= 0; i2--) {
  91316. var track = tracks[i2];
  91317. if (track.kind === this.kind_) {
  91318. return track;
  91319. }
  91320. }
  91321. };
  91322. _proto.getMenuCaption = function getMenuCaption() {
  91323. if (this.track_ && this.track_.label) {
  91324. return this.track_.label;
  91325. }
  91326. return this.localize(toTitleCase$1(this.kind_));
  91327. };
  91328. _proto.createMenu = function createMenu() {
  91329. this.options_.title = this.getMenuCaption();
  91330. return _TextTrackButton.prototype.createMenu.call(this);
  91331. };
  91332. _proto.createItems = function createItems() {
  91333. var items = [];
  91334. if (!this.track_) {
  91335. return items;
  91336. }
  91337. var cues = this.track_.cues;
  91338. if (!cues) {
  91339. return items;
  91340. }
  91341. for (var i2 = 0, l = cues.length; i2 < l; i2++) {
  91342. var cue = cues[i2];
  91343. var mi = new ChaptersTrackMenuItem(this.player_, {
  91344. track: this.track_,
  91345. cue
  91346. });
  91347. items.push(mi);
  91348. }
  91349. return items;
  91350. };
  91351. return ChaptersButton2;
  91352. }(TextTrackButton);
  91353. ChaptersButton.prototype.kind_ = "chapters";
  91354. ChaptersButton.prototype.controlText_ = "Chapters";
  91355. Component$1.registerComponent("ChaptersButton", ChaptersButton);
  91356. var DescriptionsButton = /* @__PURE__ */ function(_TextTrackButton) {
  91357. _inheritsLoose(DescriptionsButton2, _TextTrackButton);
  91358. function DescriptionsButton2(player, options2, ready) {
  91359. var _this;
  91360. _this = _TextTrackButton.call(this, player, options2, ready) || this;
  91361. var tracks = player.textTracks();
  91362. var changeHandler = bind(_assertThisInitialized(_this), _this.handleTracksChange);
  91363. tracks.addEventListener("change", changeHandler);
  91364. _this.on("dispose", function() {
  91365. tracks.removeEventListener("change", changeHandler);
  91366. });
  91367. return _this;
  91368. }
  91369. var _proto = DescriptionsButton2.prototype;
  91370. _proto.handleTracksChange = function handleTracksChange(event2) {
  91371. var tracks = this.player().textTracks();
  91372. var disabled = false;
  91373. for (var i2 = 0, l = tracks.length; i2 < l; i2++) {
  91374. var track = tracks[i2];
  91375. if (track.kind !== this.kind_ && track.mode === "showing") {
  91376. disabled = true;
  91377. break;
  91378. }
  91379. }
  91380. if (disabled) {
  91381. this.disable();
  91382. } else {
  91383. this.enable();
  91384. }
  91385. };
  91386. _proto.buildCSSClass = function buildCSSClass() {
  91387. return "vjs-descriptions-button " + _TextTrackButton.prototype.buildCSSClass.call(this);
  91388. };
  91389. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91390. return "vjs-descriptions-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);
  91391. };
  91392. return DescriptionsButton2;
  91393. }(TextTrackButton);
  91394. DescriptionsButton.prototype.kind_ = "descriptions";
  91395. DescriptionsButton.prototype.controlText_ = "Descriptions";
  91396. Component$1.registerComponent("DescriptionsButton", DescriptionsButton);
  91397. var SubtitlesButton = /* @__PURE__ */ function(_TextTrackButton) {
  91398. _inheritsLoose(SubtitlesButton2, _TextTrackButton);
  91399. function SubtitlesButton2(player, options2, ready) {
  91400. return _TextTrackButton.call(this, player, options2, ready) || this;
  91401. }
  91402. var _proto = SubtitlesButton2.prototype;
  91403. _proto.buildCSSClass = function buildCSSClass() {
  91404. return "vjs-subtitles-button " + _TextTrackButton.prototype.buildCSSClass.call(this);
  91405. };
  91406. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91407. return "vjs-subtitles-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);
  91408. };
  91409. return SubtitlesButton2;
  91410. }(TextTrackButton);
  91411. SubtitlesButton.prototype.kind_ = "subtitles";
  91412. SubtitlesButton.prototype.controlText_ = "Subtitles";
  91413. Component$1.registerComponent("SubtitlesButton", SubtitlesButton);
  91414. var CaptionSettingsMenuItem = /* @__PURE__ */ function(_TextTrackMenuItem) {
  91415. _inheritsLoose(CaptionSettingsMenuItem2, _TextTrackMenuItem);
  91416. function CaptionSettingsMenuItem2(player, options2) {
  91417. var _this;
  91418. options2.track = {
  91419. player,
  91420. kind: options2.kind,
  91421. label: options2.kind + " settings",
  91422. selectable: false,
  91423. "default": false,
  91424. mode: "disabled"
  91425. };
  91426. options2.selectable = false;
  91427. options2.name = "CaptionSettingsMenuItem";
  91428. _this = _TextTrackMenuItem.call(this, player, options2) || this;
  91429. _this.addClass("vjs-texttrack-settings");
  91430. _this.controlText(", opens " + options2.kind + " settings dialog");
  91431. return _this;
  91432. }
  91433. var _proto = CaptionSettingsMenuItem2.prototype;
  91434. _proto.handleClick = function handleClick(event2) {
  91435. this.player().getChild("textTrackSettings").open();
  91436. };
  91437. return CaptionSettingsMenuItem2;
  91438. }(TextTrackMenuItem);
  91439. Component$1.registerComponent("CaptionSettingsMenuItem", CaptionSettingsMenuItem);
  91440. var CaptionsButton = /* @__PURE__ */ function(_TextTrackButton) {
  91441. _inheritsLoose(CaptionsButton2, _TextTrackButton);
  91442. function CaptionsButton2(player, options2, ready) {
  91443. return _TextTrackButton.call(this, player, options2, ready) || this;
  91444. }
  91445. var _proto = CaptionsButton2.prototype;
  91446. _proto.buildCSSClass = function buildCSSClass() {
  91447. return "vjs-captions-button " + _TextTrackButton.prototype.buildCSSClass.call(this);
  91448. };
  91449. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91450. return "vjs-captions-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);
  91451. };
  91452. _proto.createItems = function createItems() {
  91453. var items = [];
  91454. if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild("textTrackSettings")) {
  91455. items.push(new CaptionSettingsMenuItem(this.player_, {
  91456. kind: this.kind_
  91457. }));
  91458. this.hideThreshold_ += 1;
  91459. }
  91460. return _TextTrackButton.prototype.createItems.call(this, items);
  91461. };
  91462. return CaptionsButton2;
  91463. }(TextTrackButton);
  91464. CaptionsButton.prototype.kind_ = "captions";
  91465. CaptionsButton.prototype.controlText_ = "Captions";
  91466. Component$1.registerComponent("CaptionsButton", CaptionsButton);
  91467. var SubsCapsMenuItem = /* @__PURE__ */ function(_TextTrackMenuItem) {
  91468. _inheritsLoose(SubsCapsMenuItem2, _TextTrackMenuItem);
  91469. function SubsCapsMenuItem2() {
  91470. return _TextTrackMenuItem.apply(this, arguments) || this;
  91471. }
  91472. var _proto = SubsCapsMenuItem2.prototype;
  91473. _proto.createEl = function createEl$12(type2, props, attrs) {
  91474. var el = _TextTrackMenuItem.prototype.createEl.call(this, type2, props, attrs);
  91475. var parentSpan = el.querySelector(".vjs-menu-item-text");
  91476. if (this.options_.track.kind === "captions") {
  91477. parentSpan.appendChild(createEl("span", {
  91478. className: "vjs-icon-placeholder"
  91479. }, {
  91480. "aria-hidden": true
  91481. }));
  91482. parentSpan.appendChild(createEl("span", {
  91483. className: "vjs-control-text",
  91484. textContent: " " + this.localize("Captions")
  91485. }));
  91486. }
  91487. return el;
  91488. };
  91489. return SubsCapsMenuItem2;
  91490. }(TextTrackMenuItem);
  91491. Component$1.registerComponent("SubsCapsMenuItem", SubsCapsMenuItem);
  91492. var SubsCapsButton = /* @__PURE__ */ function(_TextTrackButton) {
  91493. _inheritsLoose(SubsCapsButton2, _TextTrackButton);
  91494. function SubsCapsButton2(player, options2) {
  91495. var _this;
  91496. if (options2 === void 0) {
  91497. options2 = {};
  91498. }
  91499. _this = _TextTrackButton.call(this, player, options2) || this;
  91500. _this.label_ = "subtitles";
  91501. if (["en", "en-us", "en-ca", "fr-ca"].indexOf(_this.player_.language_) > -1) {
  91502. _this.label_ = "captions";
  91503. }
  91504. _this.menuButton_.controlText(toTitleCase$1(_this.label_));
  91505. return _this;
  91506. }
  91507. var _proto = SubsCapsButton2.prototype;
  91508. _proto.buildCSSClass = function buildCSSClass() {
  91509. return "vjs-subs-caps-button " + _TextTrackButton.prototype.buildCSSClass.call(this);
  91510. };
  91511. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91512. return "vjs-subs-caps-button " + _TextTrackButton.prototype.buildWrapperCSSClass.call(this);
  91513. };
  91514. _proto.createItems = function createItems() {
  91515. var items = [];
  91516. if (!(this.player().tech_ && this.player().tech_.featuresNativeTextTracks) && this.player().getChild("textTrackSettings")) {
  91517. items.push(new CaptionSettingsMenuItem(this.player_, {
  91518. kind: this.label_
  91519. }));
  91520. this.hideThreshold_ += 1;
  91521. }
  91522. items = _TextTrackButton.prototype.createItems.call(this, items, SubsCapsMenuItem);
  91523. return items;
  91524. };
  91525. return SubsCapsButton2;
  91526. }(TextTrackButton);
  91527. SubsCapsButton.prototype.kinds_ = ["captions", "subtitles"];
  91528. SubsCapsButton.prototype.controlText_ = "Subtitles";
  91529. Component$1.registerComponent("SubsCapsButton", SubsCapsButton);
  91530. var AudioTrackMenuItem = /* @__PURE__ */ function(_MenuItem) {
  91531. _inheritsLoose(AudioTrackMenuItem2, _MenuItem);
  91532. function AudioTrackMenuItem2(player, options2) {
  91533. var _this;
  91534. var track = options2.track;
  91535. var tracks = player.audioTracks();
  91536. options2.label = track.label || track.language || "Unknown";
  91537. options2.selected = track.enabled;
  91538. _this = _MenuItem.call(this, player, options2) || this;
  91539. _this.track = track;
  91540. _this.addClass("vjs-" + track.kind + "-menu-item");
  91541. var changeHandler = function changeHandler2() {
  91542. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  91543. args[_key] = arguments[_key];
  91544. }
  91545. _this.handleTracksChange.apply(_assertThisInitialized(_this), args);
  91546. };
  91547. tracks.addEventListener("change", changeHandler);
  91548. _this.on("dispose", function() {
  91549. tracks.removeEventListener("change", changeHandler);
  91550. });
  91551. return _this;
  91552. }
  91553. var _proto = AudioTrackMenuItem2.prototype;
  91554. _proto.createEl = function createEl$12(type2, props, attrs) {
  91555. var el = _MenuItem.prototype.createEl.call(this, type2, props, attrs);
  91556. var parentSpan = el.querySelector(".vjs-menu-item-text");
  91557. if (this.options_.track.kind === "main-desc") {
  91558. parentSpan.appendChild(createEl("span", {
  91559. className: "vjs-icon-placeholder"
  91560. }, {
  91561. "aria-hidden": true
  91562. }));
  91563. parentSpan.appendChild(createEl("span", {
  91564. className: "vjs-control-text",
  91565. textContent: " " + this.localize("Descriptions")
  91566. }));
  91567. }
  91568. return el;
  91569. };
  91570. _proto.handleClick = function handleClick(event2) {
  91571. _MenuItem.prototype.handleClick.call(this, event2);
  91572. this.track.enabled = true;
  91573. if (this.player_.tech_.featuresNativeAudioTracks) {
  91574. var tracks = this.player_.audioTracks();
  91575. for (var i2 = 0; i2 < tracks.length; i2++) {
  91576. var track = tracks[i2];
  91577. if (track === this.track) {
  91578. continue;
  91579. }
  91580. track.enabled = track === this.track;
  91581. }
  91582. }
  91583. };
  91584. _proto.handleTracksChange = function handleTracksChange(event2) {
  91585. this.selected(this.track.enabled);
  91586. };
  91587. return AudioTrackMenuItem2;
  91588. }(MenuItem);
  91589. Component$1.registerComponent("AudioTrackMenuItem", AudioTrackMenuItem);
  91590. var AudioTrackButton = /* @__PURE__ */ function(_TrackButton) {
  91591. _inheritsLoose(AudioTrackButton2, _TrackButton);
  91592. function AudioTrackButton2(player, options2) {
  91593. if (options2 === void 0) {
  91594. options2 = {};
  91595. }
  91596. options2.tracks = player.audioTracks();
  91597. return _TrackButton.call(this, player, options2) || this;
  91598. }
  91599. var _proto = AudioTrackButton2.prototype;
  91600. _proto.buildCSSClass = function buildCSSClass() {
  91601. return "vjs-audio-button " + _TrackButton.prototype.buildCSSClass.call(this);
  91602. };
  91603. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91604. return "vjs-audio-button " + _TrackButton.prototype.buildWrapperCSSClass.call(this);
  91605. };
  91606. _proto.createItems = function createItems(items) {
  91607. if (items === void 0) {
  91608. items = [];
  91609. }
  91610. this.hideThreshold_ = 1;
  91611. var tracks = this.player_.audioTracks();
  91612. for (var i2 = 0; i2 < tracks.length; i2++) {
  91613. var track = tracks[i2];
  91614. items.push(new AudioTrackMenuItem(this.player_, {
  91615. track,
  91616. selectable: true,
  91617. multiSelectable: false
  91618. }));
  91619. }
  91620. return items;
  91621. };
  91622. return AudioTrackButton2;
  91623. }(TrackButton);
  91624. AudioTrackButton.prototype.controlText_ = "Audio Track";
  91625. Component$1.registerComponent("AudioTrackButton", AudioTrackButton);
  91626. var PlaybackRateMenuItem = /* @__PURE__ */ function(_MenuItem) {
  91627. _inheritsLoose(PlaybackRateMenuItem2, _MenuItem);
  91628. function PlaybackRateMenuItem2(player, options2) {
  91629. var _this;
  91630. var label = options2.rate;
  91631. var rate = parseFloat(label, 10);
  91632. options2.label = label;
  91633. options2.selected = rate === player.playbackRate();
  91634. options2.selectable = true;
  91635. options2.multiSelectable = false;
  91636. _this = _MenuItem.call(this, player, options2) || this;
  91637. _this.label = label;
  91638. _this.rate = rate;
  91639. _this.on(player, "ratechange", function(e) {
  91640. return _this.update(e);
  91641. });
  91642. return _this;
  91643. }
  91644. var _proto = PlaybackRateMenuItem2.prototype;
  91645. _proto.handleClick = function handleClick(event2) {
  91646. _MenuItem.prototype.handleClick.call(this);
  91647. this.player().playbackRate(this.rate);
  91648. };
  91649. _proto.update = function update(event2) {
  91650. this.selected(this.player().playbackRate() === this.rate);
  91651. };
  91652. return PlaybackRateMenuItem2;
  91653. }(MenuItem);
  91654. PlaybackRateMenuItem.prototype.contentElType = "button";
  91655. Component$1.registerComponent("PlaybackRateMenuItem", PlaybackRateMenuItem);
  91656. var PlaybackRateMenuButton = /* @__PURE__ */ function(_MenuButton) {
  91657. _inheritsLoose(PlaybackRateMenuButton2, _MenuButton);
  91658. function PlaybackRateMenuButton2(player, options2) {
  91659. var _this;
  91660. _this = _MenuButton.call(this, player, options2) || this;
  91661. _this.menuButton_.el_.setAttribute("aria-describedby", _this.labelElId_);
  91662. _this.updateVisibility();
  91663. _this.updateLabel();
  91664. _this.on(player, "loadstart", function(e) {
  91665. return _this.updateVisibility(e);
  91666. });
  91667. _this.on(player, "ratechange", function(e) {
  91668. return _this.updateLabel(e);
  91669. });
  91670. _this.on(player, "playbackrateschange", function(e) {
  91671. return _this.handlePlaybackRateschange(e);
  91672. });
  91673. return _this;
  91674. }
  91675. var _proto = PlaybackRateMenuButton2.prototype;
  91676. _proto.createEl = function createEl$12() {
  91677. var el = _MenuButton.prototype.createEl.call(this);
  91678. this.labelElId_ = "vjs-playback-rate-value-label-" + this.id_;
  91679. this.labelEl_ = createEl("div", {
  91680. className: "vjs-playback-rate-value",
  91681. id: this.labelElId_,
  91682. textContent: "1x"
  91683. });
  91684. el.appendChild(this.labelEl_);
  91685. return el;
  91686. };
  91687. _proto.dispose = function dispose() {
  91688. this.labelEl_ = null;
  91689. _MenuButton.prototype.dispose.call(this);
  91690. };
  91691. _proto.buildCSSClass = function buildCSSClass() {
  91692. return "vjs-playback-rate " + _MenuButton.prototype.buildCSSClass.call(this);
  91693. };
  91694. _proto.buildWrapperCSSClass = function buildWrapperCSSClass() {
  91695. return "vjs-playback-rate " + _MenuButton.prototype.buildWrapperCSSClass.call(this);
  91696. };
  91697. _proto.createItems = function createItems() {
  91698. var rates = this.playbackRates();
  91699. var items = [];
  91700. for (var i2 = rates.length - 1; i2 >= 0; i2--) {
  91701. items.push(new PlaybackRateMenuItem(this.player(), {
  91702. rate: rates[i2] + "x"
  91703. }));
  91704. }
  91705. return items;
  91706. };
  91707. _proto.updateARIAAttributes = function updateARIAAttributes() {
  91708. this.el().setAttribute("aria-valuenow", this.player().playbackRate());
  91709. };
  91710. _proto.handleClick = function handleClick(event2) {
  91711. var currentRate = this.player().playbackRate();
  91712. var rates = this.playbackRates();
  91713. var currentIndex = rates.indexOf(currentRate);
  91714. var newIndex = (currentIndex + 1) % rates.length;
  91715. this.player().playbackRate(rates[newIndex]);
  91716. };
  91717. _proto.handlePlaybackRateschange = function handlePlaybackRateschange(event2) {
  91718. this.update();
  91719. };
  91720. _proto.playbackRates = function playbackRates() {
  91721. var player = this.player();
  91722. return player.playbackRates && player.playbackRates() || [];
  91723. };
  91724. _proto.playbackRateSupported = function playbackRateSupported() {
  91725. return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && this.playbackRates().length > 0;
  91726. };
  91727. _proto.updateVisibility = function updateVisibility(event2) {
  91728. if (this.playbackRateSupported()) {
  91729. this.removeClass("vjs-hidden");
  91730. } else {
  91731. this.addClass("vjs-hidden");
  91732. }
  91733. };
  91734. _proto.updateLabel = function updateLabel(event2) {
  91735. if (this.playbackRateSupported()) {
  91736. this.labelEl_.textContent = this.player().playbackRate() + "x";
  91737. }
  91738. };
  91739. return PlaybackRateMenuButton2;
  91740. }(MenuButton);
  91741. PlaybackRateMenuButton.prototype.controlText_ = "Playback Rate";
  91742. Component$1.registerComponent("PlaybackRateMenuButton", PlaybackRateMenuButton);
  91743. var Spacer = /* @__PURE__ */ function(_Component) {
  91744. _inheritsLoose(Spacer2, _Component);
  91745. function Spacer2() {
  91746. return _Component.apply(this, arguments) || this;
  91747. }
  91748. var _proto = Spacer2.prototype;
  91749. _proto.buildCSSClass = function buildCSSClass() {
  91750. return "vjs-spacer " + _Component.prototype.buildCSSClass.call(this);
  91751. };
  91752. _proto.createEl = function createEl2(tag, props, attributes) {
  91753. if (tag === void 0) {
  91754. tag = "div";
  91755. }
  91756. if (props === void 0) {
  91757. props = {};
  91758. }
  91759. if (attributes === void 0) {
  91760. attributes = {};
  91761. }
  91762. if (!props.className) {
  91763. props.className = this.buildCSSClass();
  91764. }
  91765. return _Component.prototype.createEl.call(this, tag, props, attributes);
  91766. };
  91767. return Spacer2;
  91768. }(Component$1);
  91769. Component$1.registerComponent("Spacer", Spacer);
  91770. var CustomControlSpacer = /* @__PURE__ */ function(_Spacer) {
  91771. _inheritsLoose(CustomControlSpacer2, _Spacer);
  91772. function CustomControlSpacer2() {
  91773. return _Spacer.apply(this, arguments) || this;
  91774. }
  91775. var _proto = CustomControlSpacer2.prototype;
  91776. _proto.buildCSSClass = function buildCSSClass() {
  91777. return "vjs-custom-control-spacer " + _Spacer.prototype.buildCSSClass.call(this);
  91778. };
  91779. _proto.createEl = function createEl2() {
  91780. return _Spacer.prototype.createEl.call(this, "div", {
  91781. className: this.buildCSSClass(),
  91782. textContent: "\xA0"
  91783. });
  91784. };
  91785. return CustomControlSpacer2;
  91786. }(Spacer);
  91787. Component$1.registerComponent("CustomControlSpacer", CustomControlSpacer);
  91788. var ControlBar = /* @__PURE__ */ function(_Component) {
  91789. _inheritsLoose(ControlBar2, _Component);
  91790. function ControlBar2() {
  91791. return _Component.apply(this, arguments) || this;
  91792. }
  91793. var _proto = ControlBar2.prototype;
  91794. _proto.createEl = function createEl2() {
  91795. return _Component.prototype.createEl.call(this, "div", {
  91796. className: "vjs-control-bar",
  91797. dir: "ltr"
  91798. });
  91799. };
  91800. return ControlBar2;
  91801. }(Component$1);
  91802. ControlBar.prototype.options_ = {
  91803. children: ["playToggle", "volumePanel", "currentTimeDisplay", "timeDivider", "durationDisplay", "progressControl", "liveDisplay", "seekToLive", "remainingTimeDisplay", "customControlSpacer", "playbackRateMenuButton", "chaptersButton", "descriptionsButton", "subsCapsButton", "audioTrackButton", "fullscreenToggle"]
  91804. };
  91805. if ("exitPictureInPicture" in document_1) {
  91806. ControlBar.prototype.options_.children.splice(ControlBar.prototype.options_.children.length - 1, 0, "pictureInPictureToggle");
  91807. }
  91808. Component$1.registerComponent("ControlBar", ControlBar);
  91809. var ErrorDisplay = /* @__PURE__ */ function(_ModalDialog) {
  91810. _inheritsLoose(ErrorDisplay2, _ModalDialog);
  91811. function ErrorDisplay2(player, options2) {
  91812. var _this;
  91813. _this = _ModalDialog.call(this, player, options2) || this;
  91814. _this.on(player, "error", function(e) {
  91815. return _this.open(e);
  91816. });
  91817. return _this;
  91818. }
  91819. var _proto = ErrorDisplay2.prototype;
  91820. _proto.buildCSSClass = function buildCSSClass() {
  91821. return "vjs-error-display " + _ModalDialog.prototype.buildCSSClass.call(this);
  91822. };
  91823. _proto.content = function content() {
  91824. var error = this.player().error();
  91825. return error ? this.localize(error.message) : "";
  91826. };
  91827. return ErrorDisplay2;
  91828. }(ModalDialog);
  91829. ErrorDisplay.prototype.options_ = _extends$2({}, ModalDialog.prototype.options_, {
  91830. pauseOnOpen: false,
  91831. fillAlways: true,
  91832. temporary: false,
  91833. uncloseable: true
  91834. });
  91835. Component$1.registerComponent("ErrorDisplay", ErrorDisplay);
  91836. var LOCAL_STORAGE_KEY$1 = "vjs-text-track-settings";
  91837. var COLOR_BLACK = ["#000", "Black"];
  91838. var COLOR_BLUE = ["#00F", "Blue"];
  91839. var COLOR_CYAN = ["#0FF", "Cyan"];
  91840. var COLOR_GREEN = ["#0F0", "Green"];
  91841. var COLOR_MAGENTA = ["#F0F", "Magenta"];
  91842. var COLOR_RED = ["#F00", "Red"];
  91843. var COLOR_WHITE = ["#FFF", "White"];
  91844. var COLOR_YELLOW = ["#FF0", "Yellow"];
  91845. var OPACITY_OPAQUE = ["1", "Opaque"];
  91846. var OPACITY_SEMI = ["0.5", "Semi-Transparent"];
  91847. var OPACITY_TRANS = ["0", "Transparent"];
  91848. var selectConfigs = {
  91849. backgroundColor: {
  91850. selector: ".vjs-bg-color > select",
  91851. id: "captions-background-color-%s",
  91852. label: "Color",
  91853. options: [COLOR_BLACK, COLOR_WHITE, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN]
  91854. },
  91855. backgroundOpacity: {
  91856. selector: ".vjs-bg-opacity > select",
  91857. id: "captions-background-opacity-%s",
  91858. label: "Transparency",
  91859. options: [OPACITY_OPAQUE, OPACITY_SEMI, OPACITY_TRANS]
  91860. },
  91861. color: {
  91862. selector: ".vjs-fg-color > select",
  91863. id: "captions-foreground-color-%s",
  91864. label: "Color",
  91865. options: [COLOR_WHITE, COLOR_BLACK, COLOR_RED, COLOR_GREEN, COLOR_BLUE, COLOR_YELLOW, COLOR_MAGENTA, COLOR_CYAN]
  91866. },
  91867. edgeStyle: {
  91868. selector: ".vjs-edge-style > select",
  91869. id: "%s",
  91870. label: "Text Edge Style",
  91871. options: [["none", "None"], ["raised", "Raised"], ["depressed", "Depressed"], ["uniform", "Uniform"], ["dropshadow", "Dropshadow"]]
  91872. },
  91873. fontFamily: {
  91874. selector: ".vjs-font-family > select",
  91875. id: "captions-font-family-%s",
  91876. label: "Font Family",
  91877. options: [["proportionalSansSerif", "Proportional Sans-Serif"], ["monospaceSansSerif", "Monospace Sans-Serif"], ["proportionalSerif", "Proportional Serif"], ["monospaceSerif", "Monospace Serif"], ["casual", "Casual"], ["script", "Script"], ["small-caps", "Small Caps"]]
  91878. },
  91879. fontPercent: {
  91880. selector: ".vjs-font-percent > select",
  91881. id: "captions-font-size-%s",
  91882. label: "Font Size",
  91883. options: [["0.50", "50%"], ["0.75", "75%"], ["1.00", "100%"], ["1.25", "125%"], ["1.50", "150%"], ["1.75", "175%"], ["2.00", "200%"], ["3.00", "300%"], ["4.00", "400%"]],
  91884. "default": 2,
  91885. parser: function parser(v) {
  91886. return v === "1.00" ? null : Number(v);
  91887. }
  91888. },
  91889. textOpacity: {
  91890. selector: ".vjs-text-opacity > select",
  91891. id: "captions-foreground-opacity-%s",
  91892. label: "Transparency",
  91893. options: [OPACITY_OPAQUE, OPACITY_SEMI]
  91894. },
  91895. windowColor: {
  91896. selector: ".vjs-window-color > select",
  91897. id: "captions-window-color-%s",
  91898. label: "Color"
  91899. },
  91900. windowOpacity: {
  91901. selector: ".vjs-window-opacity > select",
  91902. id: "captions-window-opacity-%s",
  91903. label: "Transparency",
  91904. options: [OPACITY_TRANS, OPACITY_SEMI, OPACITY_OPAQUE]
  91905. }
  91906. };
  91907. selectConfigs.windowColor.options = selectConfigs.backgroundColor.options;
  91908. function parseOptionValue(value, parser2) {
  91909. if (parser2) {
  91910. value = parser2(value);
  91911. }
  91912. if (value && value !== "none") {
  91913. return value;
  91914. }
  91915. }
  91916. function getSelectedOptionValue(el, parser2) {
  91917. var value = el.options[el.options.selectedIndex].value;
  91918. return parseOptionValue(value, parser2);
  91919. }
  91920. function setSelectedOption(el, value, parser2) {
  91921. if (!value) {
  91922. return;
  91923. }
  91924. for (var i2 = 0; i2 < el.options.length; i2++) {
  91925. if (parseOptionValue(el.options[i2].value, parser2) === value) {
  91926. el.selectedIndex = i2;
  91927. break;
  91928. }
  91929. }
  91930. }
  91931. var TextTrackSettings = /* @__PURE__ */ function(_ModalDialog) {
  91932. _inheritsLoose(TextTrackSettings2, _ModalDialog);
  91933. function TextTrackSettings2(player, options2) {
  91934. var _this;
  91935. options2.temporary = false;
  91936. _this = _ModalDialog.call(this, player, options2) || this;
  91937. _this.updateDisplay = _this.updateDisplay.bind(_assertThisInitialized(_this));
  91938. _this.fill();
  91939. _this.hasBeenOpened_ = _this.hasBeenFilled_ = true;
  91940. _this.endDialog = createEl("p", {
  91941. className: "vjs-control-text",
  91942. textContent: _this.localize("End of dialog window.")
  91943. });
  91944. _this.el().appendChild(_this.endDialog);
  91945. _this.setDefaults();
  91946. if (options2.persistTextTrackSettings === void 0) {
  91947. _this.options_.persistTextTrackSettings = _this.options_.playerOptions.persistTextTrackSettings;
  91948. }
  91949. _this.on(_this.$(".vjs-done-button"), "click", function() {
  91950. _this.saveSettings();
  91951. _this.close();
  91952. });
  91953. _this.on(_this.$(".vjs-default-button"), "click", function() {
  91954. _this.setDefaults();
  91955. _this.updateDisplay();
  91956. });
  91957. each(selectConfigs, function(config) {
  91958. _this.on(_this.$(config.selector), "change", _this.updateDisplay);
  91959. });
  91960. if (_this.options_.persistTextTrackSettings) {
  91961. _this.restoreSettings();
  91962. }
  91963. return _this;
  91964. }
  91965. var _proto = TextTrackSettings2.prototype;
  91966. _proto.dispose = function dispose() {
  91967. this.endDialog = null;
  91968. _ModalDialog.prototype.dispose.call(this);
  91969. };
  91970. _proto.createElSelect_ = function createElSelect_(key, legendId, type2) {
  91971. var _this2 = this;
  91972. if (legendId === void 0) {
  91973. legendId = "";
  91974. }
  91975. if (type2 === void 0) {
  91976. type2 = "label";
  91977. }
  91978. var config = selectConfigs[key];
  91979. var id = config.id.replace("%s", this.id_);
  91980. var selectLabelledbyIds = [legendId, id].join(" ").trim();
  91981. return ["<" + type2 + ' id="' + id + '" class="' + (type2 === "label" ? "vjs-label" : "") + '">', this.localize(config.label), "</" + type2 + ">", '<select aria-labelledby="' + selectLabelledbyIds + '">'].concat(config.options.map(function(o) {
  91982. var optionId = id + "-" + o[1].replace(/\W+/g, "");
  91983. return ['<option id="' + optionId + '" value="' + o[0] + '" ', 'aria-labelledby="' + selectLabelledbyIds + " " + optionId + '">', _this2.localize(o[1]), "</option>"].join("");
  91984. })).concat("</select>").join("");
  91985. };
  91986. _proto.createElFgColor_ = function createElFgColor_() {
  91987. var legendId = "captions-text-legend-" + this.id_;
  91988. return ['<fieldset class="vjs-fg-color vjs-track-setting">', '<legend id="' + legendId + '">', this.localize("Text"), "</legend>", this.createElSelect_("color", legendId), '<span class="vjs-text-opacity vjs-opacity">', this.createElSelect_("textOpacity", legendId), "</span>", "</fieldset>"].join("");
  91989. };
  91990. _proto.createElBgColor_ = function createElBgColor_() {
  91991. var legendId = "captions-background-" + this.id_;
  91992. return ['<fieldset class="vjs-bg-color vjs-track-setting">', '<legend id="' + legendId + '">', this.localize("Background"), "</legend>", this.createElSelect_("backgroundColor", legendId), '<span class="vjs-bg-opacity vjs-opacity">', this.createElSelect_("backgroundOpacity", legendId), "</span>", "</fieldset>"].join("");
  91993. };
  91994. _proto.createElWinColor_ = function createElWinColor_() {
  91995. var legendId = "captions-window-" + this.id_;
  91996. return ['<fieldset class="vjs-window-color vjs-track-setting">', '<legend id="' + legendId + '">', this.localize("Window"), "</legend>", this.createElSelect_("windowColor", legendId), '<span class="vjs-window-opacity vjs-opacity">', this.createElSelect_("windowOpacity", legendId), "</span>", "</fieldset>"].join("");
  91997. };
  91998. _proto.createElColors_ = function createElColors_() {
  91999. return createEl("div", {
  92000. className: "vjs-track-settings-colors",
  92001. innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join("")
  92002. });
  92003. };
  92004. _proto.createElFont_ = function createElFont_() {
  92005. return createEl("div", {
  92006. className: "vjs-track-settings-font",
  92007. innerHTML: ['<fieldset class="vjs-font-percent vjs-track-setting">', this.createElSelect_("fontPercent", "", "legend"), "</fieldset>", '<fieldset class="vjs-edge-style vjs-track-setting">', this.createElSelect_("edgeStyle", "", "legend"), "</fieldset>", '<fieldset class="vjs-font-family vjs-track-setting">', this.createElSelect_("fontFamily", "", "legend"), "</fieldset>"].join("")
  92008. });
  92009. };
  92010. _proto.createElControls_ = function createElControls_() {
  92011. var defaultsDescription = this.localize("restore all settings to the default values");
  92012. return createEl("div", {
  92013. className: "vjs-track-settings-controls",
  92014. innerHTML: ['<button type="button" class="vjs-default-button" title="' + defaultsDescription + '">', this.localize("Reset"), '<span class="vjs-control-text"> ' + defaultsDescription + "</span>", "</button>", '<button type="button" class="vjs-done-button">' + this.localize("Done") + "</button>"].join("")
  92015. });
  92016. };
  92017. _proto.content = function content() {
  92018. return [this.createElColors_(), this.createElFont_(), this.createElControls_()];
  92019. };
  92020. _proto.label = function label() {
  92021. return this.localize("Caption Settings Dialog");
  92022. };
  92023. _proto.description = function description() {
  92024. return this.localize("Beginning of dialog window. Escape will cancel and close the window.");
  92025. };
  92026. _proto.buildCSSClass = function buildCSSClass() {
  92027. return _ModalDialog.prototype.buildCSSClass.call(this) + " vjs-text-track-settings";
  92028. };
  92029. _proto.getValues = function getValues() {
  92030. var _this3 = this;
  92031. return reduce(selectConfigs, function(accum, config, key) {
  92032. var value = getSelectedOptionValue(_this3.$(config.selector), config.parser);
  92033. if (value !== void 0) {
  92034. accum[key] = value;
  92035. }
  92036. return accum;
  92037. }, {});
  92038. };
  92039. _proto.setValues = function setValues(values3) {
  92040. var _this4 = this;
  92041. each(selectConfigs, function(config, key) {
  92042. setSelectedOption(_this4.$(config.selector), values3[key], config.parser);
  92043. });
  92044. };
  92045. _proto.setDefaults = function setDefaults() {
  92046. var _this5 = this;
  92047. each(selectConfigs, function(config) {
  92048. var index2 = config.hasOwnProperty("default") ? config["default"] : 0;
  92049. _this5.$(config.selector).selectedIndex = index2;
  92050. });
  92051. };
  92052. _proto.restoreSettings = function restoreSettings() {
  92053. var values3;
  92054. try {
  92055. values3 = JSON.parse(window_1.localStorage.getItem(LOCAL_STORAGE_KEY$1));
  92056. } catch (err) {
  92057. log$1.warn(err);
  92058. }
  92059. if (values3) {
  92060. this.setValues(values3);
  92061. }
  92062. };
  92063. _proto.saveSettings = function saveSettings() {
  92064. if (!this.options_.persistTextTrackSettings) {
  92065. return;
  92066. }
  92067. var values3 = this.getValues();
  92068. try {
  92069. if (Object.keys(values3).length) {
  92070. window_1.localStorage.setItem(LOCAL_STORAGE_KEY$1, JSON.stringify(values3));
  92071. } else {
  92072. window_1.localStorage.removeItem(LOCAL_STORAGE_KEY$1);
  92073. }
  92074. } catch (err) {
  92075. log$1.warn(err);
  92076. }
  92077. };
  92078. _proto.updateDisplay = function updateDisplay() {
  92079. var ttDisplay = this.player_.getChild("textTrackDisplay");
  92080. if (ttDisplay) {
  92081. ttDisplay.updateDisplay();
  92082. }
  92083. };
  92084. _proto.conditionalBlur_ = function conditionalBlur_() {
  92085. this.previouslyActiveEl_ = null;
  92086. var cb = this.player_.controlBar;
  92087. var subsCapsBtn = cb && cb.subsCapsButton;
  92088. var ccBtn = cb && cb.captionsButton;
  92089. if (subsCapsBtn) {
  92090. subsCapsBtn.focus();
  92091. } else if (ccBtn) {
  92092. ccBtn.focus();
  92093. }
  92094. };
  92095. return TextTrackSettings2;
  92096. }(ModalDialog);
  92097. Component$1.registerComponent("TextTrackSettings", TextTrackSettings);
  92098. var ResizeManager = /* @__PURE__ */ function(_Component) {
  92099. _inheritsLoose(ResizeManager2, _Component);
  92100. function ResizeManager2(player, options2) {
  92101. var _this;
  92102. var RESIZE_OBSERVER_AVAILABLE = options2.ResizeObserver || window_1.ResizeObserver;
  92103. if (options2.ResizeObserver === null) {
  92104. RESIZE_OBSERVER_AVAILABLE = false;
  92105. }
  92106. var options_ = mergeOptions$3({
  92107. createEl: !RESIZE_OBSERVER_AVAILABLE,
  92108. reportTouchActivity: false
  92109. }, options2);
  92110. _this = _Component.call(this, player, options_) || this;
  92111. _this.ResizeObserver = options2.ResizeObserver || window_1.ResizeObserver;
  92112. _this.loadListener_ = null;
  92113. _this.resizeObserver_ = null;
  92114. _this.debouncedHandler_ = debounce(function() {
  92115. _this.resizeHandler();
  92116. }, 100, false, _assertThisInitialized(_this));
  92117. if (RESIZE_OBSERVER_AVAILABLE) {
  92118. _this.resizeObserver_ = new _this.ResizeObserver(_this.debouncedHandler_);
  92119. _this.resizeObserver_.observe(player.el());
  92120. } else {
  92121. _this.loadListener_ = function() {
  92122. if (!_this.el_ || !_this.el_.contentWindow) {
  92123. return;
  92124. }
  92125. var debouncedHandler_ = _this.debouncedHandler_;
  92126. var unloadListener_ = _this.unloadListener_ = function() {
  92127. off(this, "resize", debouncedHandler_);
  92128. off(this, "unload", unloadListener_);
  92129. unloadListener_ = null;
  92130. };
  92131. on(_this.el_.contentWindow, "unload", unloadListener_);
  92132. on(_this.el_.contentWindow, "resize", debouncedHandler_);
  92133. };
  92134. _this.one("load", _this.loadListener_);
  92135. }
  92136. return _this;
  92137. }
  92138. var _proto = ResizeManager2.prototype;
  92139. _proto.createEl = function createEl2() {
  92140. return _Component.prototype.createEl.call(this, "iframe", {
  92141. className: "vjs-resize-manager",
  92142. tabIndex: -1,
  92143. title: this.localize("No content")
  92144. }, {
  92145. "aria-hidden": "true"
  92146. });
  92147. };
  92148. _proto.resizeHandler = function resizeHandler() {
  92149. if (!this.player_ || !this.player_.trigger) {
  92150. return;
  92151. }
  92152. this.player_.trigger("playerresize");
  92153. };
  92154. _proto.dispose = function dispose() {
  92155. if (this.debouncedHandler_) {
  92156. this.debouncedHandler_.cancel();
  92157. }
  92158. if (this.resizeObserver_) {
  92159. if (this.player_.el()) {
  92160. this.resizeObserver_.unobserve(this.player_.el());
  92161. }
  92162. this.resizeObserver_.disconnect();
  92163. }
  92164. if (this.loadListener_) {
  92165. this.off("load", this.loadListener_);
  92166. }
  92167. if (this.el_ && this.el_.contentWindow && this.unloadListener_) {
  92168. this.unloadListener_.call(this.el_.contentWindow);
  92169. }
  92170. this.ResizeObserver = null;
  92171. this.resizeObserver = null;
  92172. this.debouncedHandler_ = null;
  92173. this.loadListener_ = null;
  92174. _Component.prototype.dispose.call(this);
  92175. };
  92176. return ResizeManager2;
  92177. }(Component$1);
  92178. Component$1.registerComponent("ResizeManager", ResizeManager);
  92179. var defaults$1 = {
  92180. trackingThreshold: 20,
  92181. liveTolerance: 15
  92182. };
  92183. var LiveTracker = /* @__PURE__ */ function(_Component) {
  92184. _inheritsLoose(LiveTracker2, _Component);
  92185. function LiveTracker2(player, options2) {
  92186. var _this;
  92187. var options_ = mergeOptions$3(defaults$1, options2, {
  92188. createEl: false
  92189. });
  92190. _this = _Component.call(this, player, options_) || this;
  92191. _this.handleVisibilityChange_ = function(e) {
  92192. return _this.handleVisibilityChange(e);
  92193. };
  92194. _this.trackLiveHandler_ = function() {
  92195. return _this.trackLive_();
  92196. };
  92197. _this.handlePlay_ = function(e) {
  92198. return _this.handlePlay(e);
  92199. };
  92200. _this.handleFirstTimeupdate_ = function(e) {
  92201. return _this.handleFirstTimeupdate(e);
  92202. };
  92203. _this.handleSeeked_ = function(e) {
  92204. return _this.handleSeeked(e);
  92205. };
  92206. _this.seekToLiveEdge_ = function(e) {
  92207. return _this.seekToLiveEdge(e);
  92208. };
  92209. _this.reset_();
  92210. _this.on(_this.player_, "durationchange", function(e) {
  92211. return _this.handleDurationchange(e);
  92212. });
  92213. _this.on(_this.player_, "canplay", function() {
  92214. return _this.toggleTracking();
  92215. });
  92216. if (IE_VERSION && "hidden" in document_1 && "visibilityState" in document_1) {
  92217. _this.on(document_1, "visibilitychange", _this.handleVisibilityChange_);
  92218. }
  92219. return _this;
  92220. }
  92221. var _proto = LiveTracker2.prototype;
  92222. _proto.handleVisibilityChange = function handleVisibilityChange() {
  92223. if (this.player_.duration() !== Infinity) {
  92224. return;
  92225. }
  92226. if (document_1.hidden) {
  92227. this.stopTracking();
  92228. } else {
  92229. this.startTracking();
  92230. }
  92231. };
  92232. _proto.trackLive_ = function trackLive_() {
  92233. var seekable3 = this.player_.seekable();
  92234. if (!seekable3 || !seekable3.length) {
  92235. return;
  92236. }
  92237. var newTime = Number(window_1.performance.now().toFixed(4));
  92238. var deltaTime = this.lastTime_ === -1 ? 0 : (newTime - this.lastTime_) / 1e3;
  92239. this.lastTime_ = newTime;
  92240. this.pastSeekEnd_ = this.pastSeekEnd() + deltaTime;
  92241. var liveCurrentTime = this.liveCurrentTime();
  92242. var currentTime = this.player_.currentTime();
  92243. var isBehind = this.player_.paused() || this.seekedBehindLive_ || Math.abs(liveCurrentTime - currentTime) > this.options_.liveTolerance;
  92244. if (!this.timeupdateSeen_ || liveCurrentTime === Infinity) {
  92245. isBehind = false;
  92246. }
  92247. if (isBehind !== this.behindLiveEdge_) {
  92248. this.behindLiveEdge_ = isBehind;
  92249. this.trigger("liveedgechange");
  92250. }
  92251. };
  92252. _proto.handleDurationchange = function handleDurationchange() {
  92253. this.toggleTracking();
  92254. };
  92255. _proto.toggleTracking = function toggleTracking() {
  92256. if (this.player_.duration() === Infinity && this.liveWindow() >= this.options_.trackingThreshold) {
  92257. if (this.player_.options_.liveui) {
  92258. this.player_.addClass("vjs-liveui");
  92259. }
  92260. this.startTracking();
  92261. } else {
  92262. this.player_.removeClass("vjs-liveui");
  92263. this.stopTracking();
  92264. }
  92265. };
  92266. _proto.startTracking = function startTracking() {
  92267. if (this.isTracking()) {
  92268. return;
  92269. }
  92270. if (!this.timeupdateSeen_) {
  92271. this.timeupdateSeen_ = this.player_.hasStarted();
  92272. }
  92273. this.trackingInterval_ = this.setInterval(this.trackLiveHandler_, UPDATE_REFRESH_INTERVAL);
  92274. this.trackLive_();
  92275. this.on(this.player_, ["play", "pause"], this.trackLiveHandler_);
  92276. if (!this.timeupdateSeen_) {
  92277. this.one(this.player_, "play", this.handlePlay_);
  92278. this.one(this.player_, "timeupdate", this.handleFirstTimeupdate_);
  92279. } else {
  92280. this.on(this.player_, "seeked", this.handleSeeked_);
  92281. }
  92282. };
  92283. _proto.handleFirstTimeupdate = function handleFirstTimeupdate() {
  92284. this.timeupdateSeen_ = true;
  92285. this.on(this.player_, "seeked", this.handleSeeked_);
  92286. };
  92287. _proto.handleSeeked = function handleSeeked() {
  92288. var timeDiff = Math.abs(this.liveCurrentTime() - this.player_.currentTime());
  92289. this.seekedBehindLive_ = this.nextSeekedFromUser_ && timeDiff > 2;
  92290. this.nextSeekedFromUser_ = false;
  92291. this.trackLive_();
  92292. };
  92293. _proto.handlePlay = function handlePlay() {
  92294. this.one(this.player_, "timeupdate", this.seekToLiveEdge_);
  92295. };
  92296. _proto.reset_ = function reset_() {
  92297. this.lastTime_ = -1;
  92298. this.pastSeekEnd_ = 0;
  92299. this.lastSeekEnd_ = -1;
  92300. this.behindLiveEdge_ = true;
  92301. this.timeupdateSeen_ = false;
  92302. this.seekedBehindLive_ = false;
  92303. this.nextSeekedFromUser_ = false;
  92304. this.clearInterval(this.trackingInterval_);
  92305. this.trackingInterval_ = null;
  92306. this.off(this.player_, ["play", "pause"], this.trackLiveHandler_);
  92307. this.off(this.player_, "seeked", this.handleSeeked_);
  92308. this.off(this.player_, "play", this.handlePlay_);
  92309. this.off(this.player_, "timeupdate", this.handleFirstTimeupdate_);
  92310. this.off(this.player_, "timeupdate", this.seekToLiveEdge_);
  92311. };
  92312. _proto.nextSeekedFromUser = function nextSeekedFromUser() {
  92313. this.nextSeekedFromUser_ = true;
  92314. };
  92315. _proto.stopTracking = function stopTracking() {
  92316. if (!this.isTracking()) {
  92317. return;
  92318. }
  92319. this.reset_();
  92320. this.trigger("liveedgechange");
  92321. };
  92322. _proto.seekableEnd = function seekableEnd() {
  92323. var seekable3 = this.player_.seekable();
  92324. var seekableEnds = [];
  92325. var i2 = seekable3 ? seekable3.length : 0;
  92326. while (i2--) {
  92327. seekableEnds.push(seekable3.end(i2));
  92328. }
  92329. return seekableEnds.length ? seekableEnds.sort()[seekableEnds.length - 1] : Infinity;
  92330. };
  92331. _proto.seekableStart = function seekableStart() {
  92332. var seekable3 = this.player_.seekable();
  92333. var seekableStarts = [];
  92334. var i2 = seekable3 ? seekable3.length : 0;
  92335. while (i2--) {
  92336. seekableStarts.push(seekable3.start(i2));
  92337. }
  92338. return seekableStarts.length ? seekableStarts.sort()[0] : 0;
  92339. };
  92340. _proto.liveWindow = function liveWindow() {
  92341. var liveCurrentTime = this.liveCurrentTime();
  92342. if (liveCurrentTime === Infinity) {
  92343. return 0;
  92344. }
  92345. return liveCurrentTime - this.seekableStart();
  92346. };
  92347. _proto.isLive = function isLive() {
  92348. return this.isTracking();
  92349. };
  92350. _proto.atLiveEdge = function atLiveEdge() {
  92351. return !this.behindLiveEdge();
  92352. };
  92353. _proto.liveCurrentTime = function liveCurrentTime() {
  92354. return this.pastSeekEnd() + this.seekableEnd();
  92355. };
  92356. _proto.pastSeekEnd = function pastSeekEnd() {
  92357. var seekableEnd = this.seekableEnd();
  92358. if (this.lastSeekEnd_ !== -1 && seekableEnd !== this.lastSeekEnd_) {
  92359. this.pastSeekEnd_ = 0;
  92360. }
  92361. this.lastSeekEnd_ = seekableEnd;
  92362. return this.pastSeekEnd_;
  92363. };
  92364. _proto.behindLiveEdge = function behindLiveEdge() {
  92365. return this.behindLiveEdge_;
  92366. };
  92367. _proto.isTracking = function isTracking() {
  92368. return typeof this.trackingInterval_ === "number";
  92369. };
  92370. _proto.seekToLiveEdge = function seekToLiveEdge() {
  92371. this.seekedBehindLive_ = false;
  92372. if (this.atLiveEdge()) {
  92373. return;
  92374. }
  92375. this.nextSeekedFromUser_ = false;
  92376. this.player_.currentTime(this.liveCurrentTime());
  92377. };
  92378. _proto.dispose = function dispose() {
  92379. this.off(document_1, "visibilitychange", this.handleVisibilityChange_);
  92380. this.stopTracking();
  92381. _Component.prototype.dispose.call(this);
  92382. };
  92383. return LiveTracker2;
  92384. }(Component$1);
  92385. Component$1.registerComponent("LiveTracker", LiveTracker);
  92386. var sourcesetLoad = function sourcesetLoad2(tech) {
  92387. var el = tech.el();
  92388. if (el.hasAttribute("src")) {
  92389. tech.triggerSourceset(el.src);
  92390. return true;
  92391. }
  92392. var sources = tech.$$("source");
  92393. var srcUrls = [];
  92394. var src = "";
  92395. if (!sources.length) {
  92396. return false;
  92397. }
  92398. for (var i2 = 0; i2 < sources.length; i2++) {
  92399. var url = sources[i2].src;
  92400. if (url && srcUrls.indexOf(url) === -1) {
  92401. srcUrls.push(url);
  92402. }
  92403. }
  92404. if (!srcUrls.length) {
  92405. return false;
  92406. }
  92407. if (srcUrls.length === 1) {
  92408. src = srcUrls[0];
  92409. }
  92410. tech.triggerSourceset(src);
  92411. return true;
  92412. };
  92413. var innerHTMLDescriptorPolyfill = Object.defineProperty({}, "innerHTML", {
  92414. get: function get2() {
  92415. return this.cloneNode(true).innerHTML;
  92416. },
  92417. set: function set2(v) {
  92418. var dummy = document_1.createElement(this.nodeName.toLowerCase());
  92419. dummy.innerHTML = v;
  92420. var docFrag = document_1.createDocumentFragment();
  92421. while (dummy.childNodes.length) {
  92422. docFrag.appendChild(dummy.childNodes[0]);
  92423. }
  92424. this.innerText = "";
  92425. window_1.Element.prototype.appendChild.call(this, docFrag);
  92426. return this.innerHTML;
  92427. }
  92428. });
  92429. var getDescriptor = function getDescriptor2(priority, prop) {
  92430. var descriptor = {};
  92431. for (var i2 = 0; i2 < priority.length; i2++) {
  92432. descriptor = Object.getOwnPropertyDescriptor(priority[i2], prop);
  92433. if (descriptor && descriptor.set && descriptor.get) {
  92434. break;
  92435. }
  92436. }
  92437. descriptor.enumerable = true;
  92438. descriptor.configurable = true;
  92439. return descriptor;
  92440. };
  92441. var getInnerHTMLDescriptor = function getInnerHTMLDescriptor2(tech) {
  92442. return getDescriptor([tech.el(), window_1.HTMLMediaElement.prototype, window_1.Element.prototype, innerHTMLDescriptorPolyfill], "innerHTML");
  92443. };
  92444. var firstSourceWatch = function firstSourceWatch2(tech) {
  92445. var el = tech.el();
  92446. if (el.resetSourceWatch_) {
  92447. return;
  92448. }
  92449. var old = {};
  92450. var innerDescriptor = getInnerHTMLDescriptor(tech);
  92451. var appendWrapper = function appendWrapper2(appendFn) {
  92452. return function() {
  92453. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  92454. args[_key] = arguments[_key];
  92455. }
  92456. var retval = appendFn.apply(el, args);
  92457. sourcesetLoad(tech);
  92458. return retval;
  92459. };
  92460. };
  92461. ["append", "appendChild", "insertAdjacentHTML"].forEach(function(k) {
  92462. if (!el[k]) {
  92463. return;
  92464. }
  92465. old[k] = el[k];
  92466. el[k] = appendWrapper(old[k]);
  92467. });
  92468. Object.defineProperty(el, "innerHTML", mergeOptions$3(innerDescriptor, {
  92469. set: appendWrapper(innerDescriptor.set)
  92470. }));
  92471. el.resetSourceWatch_ = function() {
  92472. el.resetSourceWatch_ = null;
  92473. Object.keys(old).forEach(function(k) {
  92474. el[k] = old[k];
  92475. });
  92476. Object.defineProperty(el, "innerHTML", innerDescriptor);
  92477. };
  92478. tech.one("sourceset", el.resetSourceWatch_);
  92479. };
  92480. var srcDescriptorPolyfill = Object.defineProperty({}, "src", {
  92481. get: function get3() {
  92482. if (this.hasAttribute("src")) {
  92483. return getAbsoluteURL(window_1.Element.prototype.getAttribute.call(this, "src"));
  92484. }
  92485. return "";
  92486. },
  92487. set: function set3(v) {
  92488. window_1.Element.prototype.setAttribute.call(this, "src", v);
  92489. return v;
  92490. }
  92491. });
  92492. var getSrcDescriptor = function getSrcDescriptor2(tech) {
  92493. return getDescriptor([tech.el(), window_1.HTMLMediaElement.prototype, srcDescriptorPolyfill], "src");
  92494. };
  92495. var setupSourceset = function setupSourceset2(tech) {
  92496. if (!tech.featuresSourceset) {
  92497. return;
  92498. }
  92499. var el = tech.el();
  92500. if (el.resetSourceset_) {
  92501. return;
  92502. }
  92503. var srcDescriptor = getSrcDescriptor(tech);
  92504. var oldSetAttribute = el.setAttribute;
  92505. var oldLoad = el.load;
  92506. Object.defineProperty(el, "src", mergeOptions$3(srcDescriptor, {
  92507. set: function set4(v) {
  92508. var retval = srcDescriptor.set.call(el, v);
  92509. tech.triggerSourceset(el.src);
  92510. return retval;
  92511. }
  92512. }));
  92513. el.setAttribute = function(n, v) {
  92514. var retval = oldSetAttribute.call(el, n, v);
  92515. if (/src/i.test(n)) {
  92516. tech.triggerSourceset(el.src);
  92517. }
  92518. return retval;
  92519. };
  92520. el.load = function() {
  92521. var retval = oldLoad.call(el);
  92522. if (!sourcesetLoad(tech)) {
  92523. tech.triggerSourceset("");
  92524. firstSourceWatch(tech);
  92525. }
  92526. return retval;
  92527. };
  92528. if (el.currentSrc) {
  92529. tech.triggerSourceset(el.currentSrc);
  92530. } else if (!sourcesetLoad(tech)) {
  92531. firstSourceWatch(tech);
  92532. }
  92533. el.resetSourceset_ = function() {
  92534. el.resetSourceset_ = null;
  92535. el.load = oldLoad;
  92536. el.setAttribute = oldSetAttribute;
  92537. Object.defineProperty(el, "src", srcDescriptor);
  92538. if (el.resetSourceWatch_) {
  92539. el.resetSourceWatch_();
  92540. }
  92541. };
  92542. };
  92543. var defineLazyProperty = function defineLazyProperty2(obj, key, getValue2, setter) {
  92544. if (setter === void 0) {
  92545. setter = true;
  92546. }
  92547. var set4 = function set5(value) {
  92548. return Object.defineProperty(obj, key, {
  92549. value,
  92550. enumerable: true,
  92551. writable: true
  92552. });
  92553. };
  92554. var options2 = {
  92555. configurable: true,
  92556. enumerable: true,
  92557. get: function get7() {
  92558. var value = getValue2();
  92559. set4(value);
  92560. return value;
  92561. }
  92562. };
  92563. if (setter) {
  92564. options2.set = set4;
  92565. }
  92566. return Object.defineProperty(obj, key, options2);
  92567. };
  92568. var Html5$1 = /* @__PURE__ */ function(_Tech) {
  92569. _inheritsLoose(Html52, _Tech);
  92570. function Html52(options2, ready) {
  92571. var _this;
  92572. _this = _Tech.call(this, options2, ready) || this;
  92573. var source = options2.source;
  92574. var crossoriginTracks = false;
  92575. _this.featuresVideoFrameCallback = _this.featuresVideoFrameCallback && _this.el_.tagName === "VIDEO";
  92576. if (source && (_this.el_.currentSrc !== source.src || options2.tag && options2.tag.initNetworkState_ === 3)) {
  92577. _this.setSource(source);
  92578. } else {
  92579. _this.handleLateInit_(_this.el_);
  92580. }
  92581. if (options2.enableSourceset) {
  92582. _this.setupSourcesetHandling_();
  92583. }
  92584. _this.isScrubbing_ = false;
  92585. if (_this.el_.hasChildNodes()) {
  92586. var nodes = _this.el_.childNodes;
  92587. var nodesLength = nodes.length;
  92588. var removeNodes = [];
  92589. while (nodesLength--) {
  92590. var node = nodes[nodesLength];
  92591. var nodeName = node.nodeName.toLowerCase();
  92592. if (nodeName === "track") {
  92593. if (!_this.featuresNativeTextTracks) {
  92594. removeNodes.push(node);
  92595. } else {
  92596. _this.remoteTextTrackEls().addTrackElement_(node);
  92597. _this.remoteTextTracks().addTrack(node.track);
  92598. _this.textTracks().addTrack(node.track);
  92599. if (!crossoriginTracks && !_this.el_.hasAttribute("crossorigin") && isCrossOrigin(node.src)) {
  92600. crossoriginTracks = true;
  92601. }
  92602. }
  92603. }
  92604. }
  92605. for (var i2 = 0; i2 < removeNodes.length; i2++) {
  92606. _this.el_.removeChild(removeNodes[i2]);
  92607. }
  92608. }
  92609. _this.proxyNativeTracks_();
  92610. if (_this.featuresNativeTextTracks && crossoriginTracks) {
  92611. log$1.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading.");
  92612. }
  92613. _this.restoreMetadataTracksInIOSNativePlayer_();
  92614. if ((TOUCH_ENABLED || IS_IPHONE || IS_NATIVE_ANDROID) && options2.nativeControlsForTouch === true) {
  92615. _this.setControls(true);
  92616. }
  92617. _this.proxyWebkitFullscreen_();
  92618. _this.triggerReady();
  92619. return _this;
  92620. }
  92621. var _proto = Html52.prototype;
  92622. _proto.dispose = function dispose() {
  92623. if (this.el_ && this.el_.resetSourceset_) {
  92624. this.el_.resetSourceset_();
  92625. }
  92626. Html52.disposeMediaElement(this.el_);
  92627. this.options_ = null;
  92628. _Tech.prototype.dispose.call(this);
  92629. };
  92630. _proto.setupSourcesetHandling_ = function setupSourcesetHandling_() {
  92631. setupSourceset(this);
  92632. };
  92633. _proto.restoreMetadataTracksInIOSNativePlayer_ = function restoreMetadataTracksInIOSNativePlayer_() {
  92634. var textTracks = this.textTracks();
  92635. var metadataTracksPreFullscreenState;
  92636. var takeMetadataTrackSnapshot = function takeMetadataTrackSnapshot2() {
  92637. metadataTracksPreFullscreenState = [];
  92638. for (var i2 = 0; i2 < textTracks.length; i2++) {
  92639. var track = textTracks[i2];
  92640. if (track.kind === "metadata") {
  92641. metadataTracksPreFullscreenState.push({
  92642. track,
  92643. storedMode: track.mode
  92644. });
  92645. }
  92646. }
  92647. };
  92648. takeMetadataTrackSnapshot();
  92649. textTracks.addEventListener("change", takeMetadataTrackSnapshot);
  92650. this.on("dispose", function() {
  92651. return textTracks.removeEventListener("change", takeMetadataTrackSnapshot);
  92652. });
  92653. var restoreTrackMode = function restoreTrackMode2() {
  92654. for (var i2 = 0; i2 < metadataTracksPreFullscreenState.length; i2++) {
  92655. var storedTrack = metadataTracksPreFullscreenState[i2];
  92656. if (storedTrack.track.mode === "disabled" && storedTrack.track.mode !== storedTrack.storedMode) {
  92657. storedTrack.track.mode = storedTrack.storedMode;
  92658. }
  92659. }
  92660. textTracks.removeEventListener("change", restoreTrackMode2);
  92661. };
  92662. this.on("webkitbeginfullscreen", function() {
  92663. textTracks.removeEventListener("change", takeMetadataTrackSnapshot);
  92664. textTracks.removeEventListener("change", restoreTrackMode);
  92665. textTracks.addEventListener("change", restoreTrackMode);
  92666. });
  92667. this.on("webkitendfullscreen", function() {
  92668. textTracks.removeEventListener("change", takeMetadataTrackSnapshot);
  92669. textTracks.addEventListener("change", takeMetadataTrackSnapshot);
  92670. textTracks.removeEventListener("change", restoreTrackMode);
  92671. });
  92672. };
  92673. _proto.overrideNative_ = function overrideNative_(type2, override) {
  92674. var _this2 = this;
  92675. if (override !== this["featuresNative" + type2 + "Tracks"]) {
  92676. return;
  92677. }
  92678. var lowerCaseType = type2.toLowerCase();
  92679. if (this[lowerCaseType + "TracksListeners_"]) {
  92680. Object.keys(this[lowerCaseType + "TracksListeners_"]).forEach(function(eventName) {
  92681. var elTracks = _this2.el()[lowerCaseType + "Tracks"];
  92682. elTracks.removeEventListener(eventName, _this2[lowerCaseType + "TracksListeners_"][eventName]);
  92683. });
  92684. }
  92685. this["featuresNative" + type2 + "Tracks"] = !override;
  92686. this[lowerCaseType + "TracksListeners_"] = null;
  92687. this.proxyNativeTracksForType_(lowerCaseType);
  92688. };
  92689. _proto.overrideNativeAudioTracks = function overrideNativeAudioTracks(override) {
  92690. this.overrideNative_("Audio", override);
  92691. };
  92692. _proto.overrideNativeVideoTracks = function overrideNativeVideoTracks(override) {
  92693. this.overrideNative_("Video", override);
  92694. };
  92695. _proto.proxyNativeTracksForType_ = function proxyNativeTracksForType_(name) {
  92696. var _this3 = this;
  92697. var props = NORMAL[name];
  92698. var elTracks = this.el()[props.getterName];
  92699. var techTracks = this[props.getterName]();
  92700. if (!this["featuresNative" + props.capitalName + "Tracks"] || !elTracks || !elTracks.addEventListener) {
  92701. return;
  92702. }
  92703. var listeners = {
  92704. change: function change(e) {
  92705. var event2 = {
  92706. type: "change",
  92707. target: techTracks,
  92708. currentTarget: techTracks,
  92709. srcElement: techTracks
  92710. };
  92711. techTracks.trigger(event2);
  92712. if (name === "text") {
  92713. _this3[REMOTE.remoteText.getterName]().trigger(event2);
  92714. }
  92715. },
  92716. addtrack: function addtrack(e) {
  92717. techTracks.addTrack(e.track);
  92718. },
  92719. removetrack: function removetrack(e) {
  92720. techTracks.removeTrack(e.track);
  92721. }
  92722. };
  92723. var removeOldTracks = function removeOldTracks2() {
  92724. var removeTracks = [];
  92725. for (var i2 = 0; i2 < techTracks.length; i2++) {
  92726. var found = false;
  92727. for (var j = 0; j < elTracks.length; j++) {
  92728. if (elTracks[j] === techTracks[i2]) {
  92729. found = true;
  92730. break;
  92731. }
  92732. }
  92733. if (!found) {
  92734. removeTracks.push(techTracks[i2]);
  92735. }
  92736. }
  92737. while (removeTracks.length) {
  92738. techTracks.removeTrack(removeTracks.shift());
  92739. }
  92740. };
  92741. this[props.getterName + "Listeners_"] = listeners;
  92742. Object.keys(listeners).forEach(function(eventName) {
  92743. var listener = listeners[eventName];
  92744. elTracks.addEventListener(eventName, listener);
  92745. _this3.on("dispose", function(e) {
  92746. return elTracks.removeEventListener(eventName, listener);
  92747. });
  92748. });
  92749. this.on("loadstart", removeOldTracks);
  92750. this.on("dispose", function(e) {
  92751. return _this3.off("loadstart", removeOldTracks);
  92752. });
  92753. };
  92754. _proto.proxyNativeTracks_ = function proxyNativeTracks_() {
  92755. var _this4 = this;
  92756. NORMAL.names.forEach(function(name) {
  92757. _this4.proxyNativeTracksForType_(name);
  92758. });
  92759. };
  92760. _proto.createEl = function createEl2() {
  92761. var el = this.options_.tag;
  92762. if (!el || !(this.options_.playerElIngest || this.movingMediaElementInDOM)) {
  92763. if (el) {
  92764. var clone = el.cloneNode(true);
  92765. if (el.parentNode) {
  92766. el.parentNode.insertBefore(clone, el);
  92767. }
  92768. Html52.disposeMediaElement(el);
  92769. el = clone;
  92770. } else {
  92771. el = document_1.createElement("video");
  92772. var tagAttributes = this.options_.tag && getAttributes(this.options_.tag);
  92773. var attributes = mergeOptions$3({}, tagAttributes);
  92774. if (!TOUCH_ENABLED || this.options_.nativeControlsForTouch !== true) {
  92775. delete attributes.controls;
  92776. }
  92777. setAttributes(el, assign(attributes, {
  92778. id: this.options_.techId,
  92779. "class": "vjs-tech"
  92780. }));
  92781. }
  92782. el.playerId = this.options_.playerId;
  92783. }
  92784. if (typeof this.options_.preload !== "undefined") {
  92785. setAttribute(el, "preload", this.options_.preload);
  92786. }
  92787. if (this.options_.disablePictureInPicture !== void 0) {
  92788. el.disablePictureInPicture = this.options_.disablePictureInPicture;
  92789. }
  92790. var settingsAttrs = ["loop", "muted", "playsinline", "autoplay"];
  92791. for (var i2 = 0; i2 < settingsAttrs.length; i2++) {
  92792. var attr = settingsAttrs[i2];
  92793. var value = this.options_[attr];
  92794. if (typeof value !== "undefined") {
  92795. if (value) {
  92796. setAttribute(el, attr, attr);
  92797. } else {
  92798. removeAttribute(el, attr);
  92799. }
  92800. el[attr] = value;
  92801. }
  92802. }
  92803. return el;
  92804. };
  92805. _proto.handleLateInit_ = function handleLateInit_(el) {
  92806. if (el.networkState === 0 || el.networkState === 3) {
  92807. return;
  92808. }
  92809. if (el.readyState === 0) {
  92810. var loadstartFired = false;
  92811. var setLoadstartFired = function setLoadstartFired2() {
  92812. loadstartFired = true;
  92813. };
  92814. this.on("loadstart", setLoadstartFired);
  92815. var triggerLoadstart = function triggerLoadstart2() {
  92816. if (!loadstartFired) {
  92817. this.trigger("loadstart");
  92818. }
  92819. };
  92820. this.on("loadedmetadata", triggerLoadstart);
  92821. this.ready(function() {
  92822. this.off("loadstart", setLoadstartFired);
  92823. this.off("loadedmetadata", triggerLoadstart);
  92824. if (!loadstartFired) {
  92825. this.trigger("loadstart");
  92826. }
  92827. });
  92828. return;
  92829. }
  92830. var eventsToTrigger = ["loadstart"];
  92831. eventsToTrigger.push("loadedmetadata");
  92832. if (el.readyState >= 2) {
  92833. eventsToTrigger.push("loadeddata");
  92834. }
  92835. if (el.readyState >= 3) {
  92836. eventsToTrigger.push("canplay");
  92837. }
  92838. if (el.readyState >= 4) {
  92839. eventsToTrigger.push("canplaythrough");
  92840. }
  92841. this.ready(function() {
  92842. eventsToTrigger.forEach(function(type2) {
  92843. this.trigger(type2);
  92844. }, this);
  92845. });
  92846. };
  92847. _proto.setScrubbing = function setScrubbing(isScrubbing) {
  92848. this.isScrubbing_ = isScrubbing;
  92849. };
  92850. _proto.scrubbing = function scrubbing() {
  92851. return this.isScrubbing_;
  92852. };
  92853. _proto.setCurrentTime = function setCurrentTime(seconds) {
  92854. try {
  92855. if (this.isScrubbing_ && this.el_.fastSeek && IS_ANY_SAFARI) {
  92856. this.el_.fastSeek(seconds);
  92857. } else {
  92858. this.el_.currentTime = seconds;
  92859. }
  92860. } catch (e) {
  92861. log$1(e, "Video is not ready. (Video.js)");
  92862. }
  92863. };
  92864. _proto.duration = function duration5() {
  92865. var _this5 = this;
  92866. if (this.el_.duration === Infinity && IS_ANDROID && IS_CHROME && this.el_.currentTime === 0) {
  92867. var checkProgress = function checkProgress2() {
  92868. if (_this5.el_.currentTime > 0) {
  92869. if (_this5.el_.duration === Infinity) {
  92870. _this5.trigger("durationchange");
  92871. }
  92872. _this5.off("timeupdate", checkProgress2);
  92873. }
  92874. };
  92875. this.on("timeupdate", checkProgress);
  92876. return NaN;
  92877. }
  92878. return this.el_.duration || NaN;
  92879. };
  92880. _proto.width = function width2() {
  92881. return this.el_.offsetWidth;
  92882. };
  92883. _proto.height = function height2() {
  92884. return this.el_.offsetHeight;
  92885. };
  92886. _proto.proxyWebkitFullscreen_ = function proxyWebkitFullscreen_() {
  92887. var _this6 = this;
  92888. if (!("webkitDisplayingFullscreen" in this.el_)) {
  92889. return;
  92890. }
  92891. var endFn = function endFn2() {
  92892. this.trigger("fullscreenchange", {
  92893. isFullscreen: false
  92894. });
  92895. if (this.el_.controls && !this.options_.nativeControlsForTouch && this.controls()) {
  92896. this.el_.controls = false;
  92897. }
  92898. };
  92899. var beginFn = function beginFn2() {
  92900. if ("webkitPresentationMode" in this.el_ && this.el_.webkitPresentationMode !== "picture-in-picture") {
  92901. this.one("webkitendfullscreen", endFn);
  92902. this.trigger("fullscreenchange", {
  92903. isFullscreen: true,
  92904. nativeIOSFullscreen: true
  92905. });
  92906. }
  92907. };
  92908. this.on("webkitbeginfullscreen", beginFn);
  92909. this.on("dispose", function() {
  92910. _this6.off("webkitbeginfullscreen", beginFn);
  92911. _this6.off("webkitendfullscreen", endFn);
  92912. });
  92913. };
  92914. _proto.supportsFullScreen = function supportsFullScreen() {
  92915. if (typeof this.el_.webkitEnterFullScreen === "function") {
  92916. var userAgent = window_1.navigator && window_1.navigator.userAgent || "";
  92917. if (/Android/.test(userAgent) || !/Chrome|Mac OS X 10.5/.test(userAgent)) {
  92918. return true;
  92919. }
  92920. }
  92921. return false;
  92922. };
  92923. _proto.enterFullScreen = function enterFullScreen() {
  92924. var video = this.el_;
  92925. if (video.paused && video.networkState <= video.HAVE_METADATA) {
  92926. silencePromise(this.el_.play());
  92927. this.setTimeout(function() {
  92928. video.pause();
  92929. try {
  92930. video.webkitEnterFullScreen();
  92931. } catch (e) {
  92932. this.trigger("fullscreenerror", e);
  92933. }
  92934. }, 0);
  92935. } else {
  92936. try {
  92937. video.webkitEnterFullScreen();
  92938. } catch (e) {
  92939. this.trigger("fullscreenerror", e);
  92940. }
  92941. }
  92942. };
  92943. _proto.exitFullScreen = function exitFullScreen() {
  92944. if (!this.el_.webkitDisplayingFullscreen) {
  92945. this.trigger("fullscreenerror", new Error("The video is not fullscreen"));
  92946. return;
  92947. }
  92948. this.el_.webkitExitFullScreen();
  92949. };
  92950. _proto.requestPictureInPicture = function requestPictureInPicture() {
  92951. return this.el_.requestPictureInPicture();
  92952. };
  92953. _proto.requestVideoFrameCallback = function requestVideoFrameCallback(cb) {
  92954. if (this.featuresVideoFrameCallback && !this.el_.webkitKeys) {
  92955. return this.el_.requestVideoFrameCallback(cb);
  92956. }
  92957. return _Tech.prototype.requestVideoFrameCallback.call(this, cb);
  92958. };
  92959. _proto.cancelVideoFrameCallback = function cancelVideoFrameCallback(id) {
  92960. if (this.featuresVideoFrameCallback && !this.el_.webkitKeys) {
  92961. this.el_.cancelVideoFrameCallback(id);
  92962. } else {
  92963. _Tech.prototype.cancelVideoFrameCallback.call(this, id);
  92964. }
  92965. };
  92966. _proto.src = function src(_src) {
  92967. if (_src === void 0) {
  92968. return this.el_.src;
  92969. }
  92970. this.setSrc(_src);
  92971. };
  92972. _proto.reset = function reset3() {
  92973. Html52.resetMediaElement(this.el_);
  92974. };
  92975. _proto.currentSrc = function currentSrc() {
  92976. if (this.currentSource_) {
  92977. return this.currentSource_.src;
  92978. }
  92979. return this.el_.currentSrc;
  92980. };
  92981. _proto.setControls = function setControls(val) {
  92982. this.el_.controls = !!val;
  92983. };
  92984. _proto.addTextTrack = function addTextTrack(kind, label, language) {
  92985. if (!this.featuresNativeTextTracks) {
  92986. return _Tech.prototype.addTextTrack.call(this, kind, label, language);
  92987. }
  92988. return this.el_.addTextTrack(kind, label, language);
  92989. };
  92990. _proto.createRemoteTextTrack = function createRemoteTextTrack(options2) {
  92991. if (!this.featuresNativeTextTracks) {
  92992. return _Tech.prototype.createRemoteTextTrack.call(this, options2);
  92993. }
  92994. var htmlTrackElement = document_1.createElement("track");
  92995. if (options2.kind) {
  92996. htmlTrackElement.kind = options2.kind;
  92997. }
  92998. if (options2.label) {
  92999. htmlTrackElement.label = options2.label;
  93000. }
  93001. if (options2.language || options2.srclang) {
  93002. htmlTrackElement.srclang = options2.language || options2.srclang;
  93003. }
  93004. if (options2["default"]) {
  93005. htmlTrackElement["default"] = options2["default"];
  93006. }
  93007. if (options2.id) {
  93008. htmlTrackElement.id = options2.id;
  93009. }
  93010. if (options2.src) {
  93011. htmlTrackElement.src = options2.src;
  93012. }
  93013. return htmlTrackElement;
  93014. };
  93015. _proto.addRemoteTextTrack = function addRemoteTextTrack(options2, manualCleanup) {
  93016. var htmlTrackElement = _Tech.prototype.addRemoteTextTrack.call(this, options2, manualCleanup);
  93017. if (this.featuresNativeTextTracks) {
  93018. this.el().appendChild(htmlTrackElement);
  93019. }
  93020. return htmlTrackElement;
  93021. };
  93022. _proto.removeRemoteTextTrack = function removeRemoteTextTrack(track) {
  93023. _Tech.prototype.removeRemoteTextTrack.call(this, track);
  93024. if (this.featuresNativeTextTracks) {
  93025. var tracks = this.$$("track");
  93026. var i2 = tracks.length;
  93027. while (i2--) {
  93028. if (track === tracks[i2] || track === tracks[i2].track) {
  93029. this.el().removeChild(tracks[i2]);
  93030. }
  93031. }
  93032. }
  93033. };
  93034. _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {
  93035. if (typeof this.el().getVideoPlaybackQuality === "function") {
  93036. return this.el().getVideoPlaybackQuality();
  93037. }
  93038. var videoPlaybackQuality = {};
  93039. if (typeof this.el().webkitDroppedFrameCount !== "undefined" && typeof this.el().webkitDecodedFrameCount !== "undefined") {
  93040. videoPlaybackQuality.droppedVideoFrames = this.el().webkitDroppedFrameCount;
  93041. videoPlaybackQuality.totalVideoFrames = this.el().webkitDecodedFrameCount;
  93042. }
  93043. if (window_1.performance && typeof window_1.performance.now === "function") {
  93044. videoPlaybackQuality.creationTime = window_1.performance.now();
  93045. } else if (window_1.performance && window_1.performance.timing && typeof window_1.performance.timing.navigationStart === "number") {
  93046. videoPlaybackQuality.creationTime = window_1.Date.now() - window_1.performance.timing.navigationStart;
  93047. }
  93048. return videoPlaybackQuality;
  93049. };
  93050. return Html52;
  93051. }(Tech$1);
  93052. defineLazyProperty(Html5$1, "TEST_VID", function() {
  93053. if (!isReal()) {
  93054. return;
  93055. }
  93056. var video = document_1.createElement("video");
  93057. var track = document_1.createElement("track");
  93058. track.kind = "captions";
  93059. track.srclang = "en";
  93060. track.label = "English";
  93061. video.appendChild(track);
  93062. return video;
  93063. });
  93064. Html5$1.isSupported = function() {
  93065. try {
  93066. Html5$1.TEST_VID.volume = 0.5;
  93067. } catch (e) {
  93068. return false;
  93069. }
  93070. return !!(Html5$1.TEST_VID && Html5$1.TEST_VID.canPlayType);
  93071. };
  93072. Html5$1.canPlayType = function(type2) {
  93073. return Html5$1.TEST_VID.canPlayType(type2);
  93074. };
  93075. Html5$1.canPlaySource = function(srcObj, options2) {
  93076. return Html5$1.canPlayType(srcObj.type);
  93077. };
  93078. Html5$1.canControlVolume = function() {
  93079. try {
  93080. var volume = Html5$1.TEST_VID.volume;
  93081. Html5$1.TEST_VID.volume = volume / 2 + 0.1;
  93082. var canControl = volume !== Html5$1.TEST_VID.volume;
  93083. if (canControl && IS_IOS) {
  93084. window_1.setTimeout(function() {
  93085. if (Html5$1 && Html5$1.prototype) {
  93086. Html5$1.prototype.featuresVolumeControl = volume !== Html5$1.TEST_VID.volume;
  93087. }
  93088. });
  93089. return false;
  93090. }
  93091. return canControl;
  93092. } catch (e) {
  93093. return false;
  93094. }
  93095. };
  93096. Html5$1.canMuteVolume = function() {
  93097. try {
  93098. var muted = Html5$1.TEST_VID.muted;
  93099. Html5$1.TEST_VID.muted = !muted;
  93100. if (Html5$1.TEST_VID.muted) {
  93101. setAttribute(Html5$1.TEST_VID, "muted", "muted");
  93102. } else {
  93103. removeAttribute(Html5$1.TEST_VID, "muted", "muted");
  93104. }
  93105. return muted !== Html5$1.TEST_VID.muted;
  93106. } catch (e) {
  93107. return false;
  93108. }
  93109. };
  93110. Html5$1.canControlPlaybackRate = function() {
  93111. if (IS_ANDROID && IS_CHROME && CHROME_VERSION < 58) {
  93112. return false;
  93113. }
  93114. try {
  93115. var playbackRate = Html5$1.TEST_VID.playbackRate;
  93116. Html5$1.TEST_VID.playbackRate = playbackRate / 2 + 0.1;
  93117. return playbackRate !== Html5$1.TEST_VID.playbackRate;
  93118. } catch (e) {
  93119. return false;
  93120. }
  93121. };
  93122. Html5$1.canOverrideAttributes = function() {
  93123. try {
  93124. var noop2 = function noop3() {
  93125. };
  93126. Object.defineProperty(document_1.createElement("video"), "src", {
  93127. get: noop2,
  93128. set: noop2
  93129. });
  93130. Object.defineProperty(document_1.createElement("audio"), "src", {
  93131. get: noop2,
  93132. set: noop2
  93133. });
  93134. Object.defineProperty(document_1.createElement("video"), "innerHTML", {
  93135. get: noop2,
  93136. set: noop2
  93137. });
  93138. Object.defineProperty(document_1.createElement("audio"), "innerHTML", {
  93139. get: noop2,
  93140. set: noop2
  93141. });
  93142. } catch (e) {
  93143. return false;
  93144. }
  93145. return true;
  93146. };
  93147. Html5$1.supportsNativeTextTracks = function() {
  93148. return IS_ANY_SAFARI || IS_IOS && IS_CHROME;
  93149. };
  93150. Html5$1.supportsNativeVideoTracks = function() {
  93151. return !!(Html5$1.TEST_VID && Html5$1.TEST_VID.videoTracks);
  93152. };
  93153. Html5$1.supportsNativeAudioTracks = function() {
  93154. return !!(Html5$1.TEST_VID && Html5$1.TEST_VID.audioTracks);
  93155. };
  93156. Html5$1.Events = ["loadstart", "suspend", "abort", "error", "emptied", "stalled", "loadedmetadata", "loadeddata", "canplay", "canplaythrough", "playing", "waiting", "seeking", "seeked", "ended", "durationchange", "timeupdate", "progress", "play", "pause", "ratechange", "resize", "volumechange"];
  93157. [["featuresMuteControl", "canMuteVolume"], ["featuresPlaybackRate", "canControlPlaybackRate"], ["featuresSourceset", "canOverrideAttributes"], ["featuresNativeTextTracks", "supportsNativeTextTracks"], ["featuresNativeVideoTracks", "supportsNativeVideoTracks"], ["featuresNativeAudioTracks", "supportsNativeAudioTracks"]].forEach(function(_ref) {
  93158. var key = _ref[0], fn2 = _ref[1];
  93159. defineLazyProperty(Html5$1.prototype, key, function() {
  93160. return Html5$1[fn2]();
  93161. }, true);
  93162. });
  93163. Html5$1.prototype.featuresVolumeControl = Html5$1.canControlVolume();
  93164. Html5$1.prototype.movingMediaElementInDOM = !IS_IOS;
  93165. Html5$1.prototype.featuresFullscreenResize = true;
  93166. Html5$1.prototype.featuresProgressEvents = true;
  93167. Html5$1.prototype.featuresTimeupdateEvents = true;
  93168. Html5$1.prototype.featuresVideoFrameCallback = !!(Html5$1.TEST_VID && Html5$1.TEST_VID.requestVideoFrameCallback);
  93169. var canPlayType;
  93170. Html5$1.patchCanPlayType = function() {
  93171. if (ANDROID_VERSION >= 4 && !IS_FIREFOX && !IS_CHROME) {
  93172. canPlayType = Html5$1.TEST_VID && Html5$1.TEST_VID.constructor.prototype.canPlayType;
  93173. Html5$1.TEST_VID.constructor.prototype.canPlayType = function(type2) {
  93174. var mpegurlRE = /^application\/(?:x-|vnd\.apple\.)mpegurl/i;
  93175. if (type2 && mpegurlRE.test(type2)) {
  93176. return "maybe";
  93177. }
  93178. return canPlayType.call(this, type2);
  93179. };
  93180. }
  93181. };
  93182. Html5$1.unpatchCanPlayType = function() {
  93183. var r2 = Html5$1.TEST_VID.constructor.prototype.canPlayType;
  93184. if (canPlayType) {
  93185. Html5$1.TEST_VID.constructor.prototype.canPlayType = canPlayType;
  93186. }
  93187. return r2;
  93188. };
  93189. Html5$1.patchCanPlayType();
  93190. Html5$1.disposeMediaElement = function(el) {
  93191. if (!el) {
  93192. return;
  93193. }
  93194. if (el.parentNode) {
  93195. el.parentNode.removeChild(el);
  93196. }
  93197. while (el.hasChildNodes()) {
  93198. el.removeChild(el.firstChild);
  93199. }
  93200. el.removeAttribute("src");
  93201. if (typeof el.load === "function") {
  93202. (function() {
  93203. try {
  93204. el.load();
  93205. } catch (e) {
  93206. }
  93207. })();
  93208. }
  93209. };
  93210. Html5$1.resetMediaElement = function(el) {
  93211. if (!el) {
  93212. return;
  93213. }
  93214. var sources = el.querySelectorAll("source");
  93215. var i2 = sources.length;
  93216. while (i2--) {
  93217. el.removeChild(sources[i2]);
  93218. }
  93219. el.removeAttribute("src");
  93220. if (typeof el.load === "function") {
  93221. (function() {
  93222. try {
  93223. el.load();
  93224. } catch (e) {
  93225. }
  93226. })();
  93227. }
  93228. };
  93229. [
  93230. "muted",
  93231. "defaultMuted",
  93232. "autoplay",
  93233. "controls",
  93234. "loop",
  93235. "playsinline"
  93236. ].forEach(function(prop) {
  93237. Html5$1.prototype[prop] = function() {
  93238. return this.el_[prop] || this.el_.hasAttribute(prop);
  93239. };
  93240. });
  93241. [
  93242. "muted",
  93243. "defaultMuted",
  93244. "autoplay",
  93245. "loop",
  93246. "playsinline"
  93247. ].forEach(function(prop) {
  93248. Html5$1.prototype["set" + toTitleCase$1(prop)] = function(v) {
  93249. this.el_[prop] = v;
  93250. if (v) {
  93251. this.el_.setAttribute(prop, prop);
  93252. } else {
  93253. this.el_.removeAttribute(prop);
  93254. }
  93255. };
  93256. });
  93257. [
  93258. "paused",
  93259. "currentTime",
  93260. "buffered",
  93261. "volume",
  93262. "poster",
  93263. "preload",
  93264. "error",
  93265. "seeking",
  93266. "seekable",
  93267. "ended",
  93268. "playbackRate",
  93269. "defaultPlaybackRate",
  93270. "disablePictureInPicture",
  93271. "played",
  93272. "networkState",
  93273. "readyState",
  93274. "videoWidth",
  93275. "videoHeight",
  93276. "crossOrigin"
  93277. ].forEach(function(prop) {
  93278. Html5$1.prototype[prop] = function() {
  93279. return this.el_[prop];
  93280. };
  93281. });
  93282. [
  93283. "volume",
  93284. "src",
  93285. "poster",
  93286. "preload",
  93287. "playbackRate",
  93288. "defaultPlaybackRate",
  93289. "disablePictureInPicture",
  93290. "crossOrigin"
  93291. ].forEach(function(prop) {
  93292. Html5$1.prototype["set" + toTitleCase$1(prop)] = function(v) {
  93293. this.el_[prop] = v;
  93294. };
  93295. });
  93296. [
  93297. "pause",
  93298. "load",
  93299. "play"
  93300. ].forEach(function(prop) {
  93301. Html5$1.prototype[prop] = function() {
  93302. return this.el_[prop]();
  93303. };
  93304. });
  93305. Tech$1.withSourceHandlers(Html5$1);
  93306. Html5$1.nativeSourceHandler = {};
  93307. Html5$1.nativeSourceHandler.canPlayType = function(type2) {
  93308. try {
  93309. return Html5$1.TEST_VID.canPlayType(type2);
  93310. } catch (e) {
  93311. return "";
  93312. }
  93313. };
  93314. Html5$1.nativeSourceHandler.canHandleSource = function(source, options2) {
  93315. if (source.type) {
  93316. return Html5$1.nativeSourceHandler.canPlayType(source.type);
  93317. } else if (source.src) {
  93318. var ext = getFileExtension(source.src);
  93319. return Html5$1.nativeSourceHandler.canPlayType("video/" + ext);
  93320. }
  93321. return "";
  93322. };
  93323. Html5$1.nativeSourceHandler.handleSource = function(source, tech, options2) {
  93324. tech.setSrc(source.src);
  93325. };
  93326. Html5$1.nativeSourceHandler.dispose = function() {
  93327. };
  93328. Html5$1.registerSourceHandler(Html5$1.nativeSourceHandler);
  93329. Tech$1.registerTech("Html5", Html5$1);
  93330. var TECH_EVENTS_RETRIGGER = [
  93331. "progress",
  93332. "abort",
  93333. "suspend",
  93334. "emptied",
  93335. "stalled",
  93336. "loadedmetadata",
  93337. "loadeddata",
  93338. "timeupdate",
  93339. "resize",
  93340. "volumechange",
  93341. "texttrackchange"
  93342. ];
  93343. var TECH_EVENTS_QUEUE = {
  93344. canplay: "CanPlay",
  93345. canplaythrough: "CanPlayThrough",
  93346. playing: "Playing",
  93347. seeked: "Seeked"
  93348. };
  93349. var BREAKPOINT_ORDER = ["tiny", "xsmall", "small", "medium", "large", "xlarge", "huge"];
  93350. var BREAKPOINT_CLASSES = {};
  93351. BREAKPOINT_ORDER.forEach(function(k) {
  93352. var v = k.charAt(0) === "x" ? "x-" + k.substring(1) : k;
  93353. BREAKPOINT_CLASSES[k] = "vjs-layout-" + v;
  93354. });
  93355. var DEFAULT_BREAKPOINTS = {
  93356. tiny: 210,
  93357. xsmall: 320,
  93358. small: 425,
  93359. medium: 768,
  93360. large: 1440,
  93361. xlarge: 2560,
  93362. huge: Infinity
  93363. };
  93364. var Player = /* @__PURE__ */ function(_Component) {
  93365. _inheritsLoose(Player2, _Component);
  93366. function Player2(tag, options2, ready) {
  93367. var _this;
  93368. tag.id = tag.id || options2.id || "vjs_video_" + newGUID();
  93369. options2 = assign(Player2.getTagSettings(tag), options2);
  93370. options2.initChildren = false;
  93371. options2.createEl = false;
  93372. options2.evented = false;
  93373. options2.reportTouchActivity = false;
  93374. if (!options2.language) {
  93375. if (typeof tag.closest === "function") {
  93376. var closest = tag.closest("[lang]");
  93377. if (closest && closest.getAttribute) {
  93378. options2.language = closest.getAttribute("lang");
  93379. }
  93380. } else {
  93381. var element = tag;
  93382. while (element && element.nodeType === 1) {
  93383. if (getAttributes(element).hasOwnProperty("lang")) {
  93384. options2.language = element.getAttribute("lang");
  93385. break;
  93386. }
  93387. element = element.parentNode;
  93388. }
  93389. }
  93390. }
  93391. _this = _Component.call(this, null, options2, ready) || this;
  93392. _this.boundDocumentFullscreenChange_ = function(e) {
  93393. return _this.documentFullscreenChange_(e);
  93394. };
  93395. _this.boundFullWindowOnEscKey_ = function(e) {
  93396. return _this.fullWindowOnEscKey(e);
  93397. };
  93398. _this.boundUpdateStyleEl_ = function(e) {
  93399. return _this.updateStyleEl_(e);
  93400. };
  93401. _this.boundApplyInitTime_ = function(e) {
  93402. return _this.applyInitTime_(e);
  93403. };
  93404. _this.boundUpdateCurrentBreakpoint_ = function(e) {
  93405. return _this.updateCurrentBreakpoint_(e);
  93406. };
  93407. _this.boundHandleTechClick_ = function(e) {
  93408. return _this.handleTechClick_(e);
  93409. };
  93410. _this.boundHandleTechDoubleClick_ = function(e) {
  93411. return _this.handleTechDoubleClick_(e);
  93412. };
  93413. _this.boundHandleTechTouchStart_ = function(e) {
  93414. return _this.handleTechTouchStart_(e);
  93415. };
  93416. _this.boundHandleTechTouchMove_ = function(e) {
  93417. return _this.handleTechTouchMove_(e);
  93418. };
  93419. _this.boundHandleTechTouchEnd_ = function(e) {
  93420. return _this.handleTechTouchEnd_(e);
  93421. };
  93422. _this.boundHandleTechTap_ = function(e) {
  93423. return _this.handleTechTap_(e);
  93424. };
  93425. _this.isFullscreen_ = false;
  93426. _this.log = createLogger(_this.id_);
  93427. _this.fsApi_ = FullscreenApi;
  93428. _this.isPosterFromTech_ = false;
  93429. _this.queuedCallbacks_ = [];
  93430. _this.isReady_ = false;
  93431. _this.hasStarted_ = false;
  93432. _this.userActive_ = false;
  93433. _this.debugEnabled_ = false;
  93434. _this.audioOnlyMode_ = false;
  93435. _this.audioPosterMode_ = false;
  93436. _this.audioOnlyCache_ = {
  93437. playerHeight: null,
  93438. hiddenChildren: []
  93439. };
  93440. if (!_this.options_ || !_this.options_.techOrder || !_this.options_.techOrder.length) {
  93441. throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");
  93442. }
  93443. _this.tag = tag;
  93444. _this.tagAttributes = tag && getAttributes(tag);
  93445. _this.language(_this.options_.language);
  93446. if (options2.languages) {
  93447. var languagesToLower = {};
  93448. Object.getOwnPropertyNames(options2.languages).forEach(function(name) {
  93449. languagesToLower[name.toLowerCase()] = options2.languages[name];
  93450. });
  93451. _this.languages_ = languagesToLower;
  93452. } else {
  93453. _this.languages_ = Player2.prototype.options_.languages;
  93454. }
  93455. _this.resetCache_();
  93456. _this.poster_ = options2.poster || "";
  93457. _this.controls_ = !!options2.controls;
  93458. tag.controls = false;
  93459. tag.removeAttribute("controls");
  93460. _this.changingSrc_ = false;
  93461. _this.playCallbacks_ = [];
  93462. _this.playTerminatedQueue_ = [];
  93463. if (tag.hasAttribute("autoplay")) {
  93464. _this.autoplay(true);
  93465. } else {
  93466. _this.autoplay(_this.options_.autoplay);
  93467. }
  93468. if (options2.plugins) {
  93469. Object.keys(options2.plugins).forEach(function(name) {
  93470. if (typeof _this[name] !== "function") {
  93471. throw new Error('plugin "' + name + '" does not exist');
  93472. }
  93473. });
  93474. }
  93475. _this.scrubbing_ = false;
  93476. _this.el_ = _this.createEl();
  93477. evented(_assertThisInitialized(_this), {
  93478. eventBusKey: "el_"
  93479. });
  93480. if (_this.fsApi_.requestFullscreen) {
  93481. on(document_1, _this.fsApi_.fullscreenchange, _this.boundDocumentFullscreenChange_);
  93482. _this.on(_this.fsApi_.fullscreenchange, _this.boundDocumentFullscreenChange_);
  93483. }
  93484. if (_this.fluid_) {
  93485. _this.on(["playerreset", "resize"], _this.boundUpdateStyleEl_);
  93486. }
  93487. var playerOptionsCopy = mergeOptions$3(_this.options_);
  93488. if (options2.plugins) {
  93489. Object.keys(options2.plugins).forEach(function(name) {
  93490. _this[name](options2.plugins[name]);
  93491. });
  93492. }
  93493. if (options2.debug) {
  93494. _this.debug(true);
  93495. }
  93496. _this.options_.playerOptions = playerOptionsCopy;
  93497. _this.middleware_ = [];
  93498. _this.playbackRates(options2.playbackRates);
  93499. _this.initChildren();
  93500. _this.isAudio(tag.nodeName.toLowerCase() === "audio");
  93501. if (_this.controls()) {
  93502. _this.addClass("vjs-controls-enabled");
  93503. } else {
  93504. _this.addClass("vjs-controls-disabled");
  93505. }
  93506. _this.el_.setAttribute("role", "region");
  93507. if (_this.isAudio()) {
  93508. _this.el_.setAttribute("aria-label", _this.localize("Audio Player"));
  93509. } else {
  93510. _this.el_.setAttribute("aria-label", _this.localize("Video Player"));
  93511. }
  93512. if (_this.isAudio()) {
  93513. _this.addClass("vjs-audio");
  93514. }
  93515. if (_this.flexNotSupported_()) {
  93516. _this.addClass("vjs-no-flex");
  93517. }
  93518. if (TOUCH_ENABLED) {
  93519. _this.addClass("vjs-touch-enabled");
  93520. }
  93521. if (!IS_IOS) {
  93522. _this.addClass("vjs-workinghover");
  93523. }
  93524. Player2.players[_this.id_] = _assertThisInitialized(_this);
  93525. var majorVersion = version$5.split(".")[0];
  93526. _this.addClass("vjs-v" + majorVersion);
  93527. _this.userActive(true);
  93528. _this.reportUserActivity();
  93529. _this.one("play", function(e) {
  93530. return _this.listenForUserActivity_(e);
  93531. });
  93532. _this.on("stageclick", function(e) {
  93533. return _this.handleStageClick_(e);
  93534. });
  93535. _this.on("keydown", function(e) {
  93536. return _this.handleKeyDown(e);
  93537. });
  93538. _this.on("languagechange", function(e) {
  93539. return _this.handleLanguagechange(e);
  93540. });
  93541. _this.breakpoints(_this.options_.breakpoints);
  93542. _this.responsive(_this.options_.responsive);
  93543. _this.on("ready", function() {
  93544. _this.audioPosterMode(_this.options_.audioPosterMode);
  93545. _this.audioOnlyMode(_this.options_.audioOnlyMode);
  93546. });
  93547. return _this;
  93548. }
  93549. var _proto = Player2.prototype;
  93550. _proto.dispose = function dispose() {
  93551. var _this2 = this;
  93552. this.trigger("dispose");
  93553. this.off("dispose");
  93554. off(document_1, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_);
  93555. off(document_1, "keydown", this.boundFullWindowOnEscKey_);
  93556. if (this.styleEl_ && this.styleEl_.parentNode) {
  93557. this.styleEl_.parentNode.removeChild(this.styleEl_);
  93558. this.styleEl_ = null;
  93559. }
  93560. Player2.players[this.id_] = null;
  93561. if (this.tag && this.tag.player) {
  93562. this.tag.player = null;
  93563. }
  93564. if (this.el_ && this.el_.player) {
  93565. this.el_.player = null;
  93566. }
  93567. if (this.tech_) {
  93568. this.tech_.dispose();
  93569. this.isPosterFromTech_ = false;
  93570. this.poster_ = "";
  93571. }
  93572. if (this.playerElIngest_) {
  93573. this.playerElIngest_ = null;
  93574. }
  93575. if (this.tag) {
  93576. this.tag = null;
  93577. }
  93578. clearCacheForPlayer(this);
  93579. ALL.names.forEach(function(name) {
  93580. var props = ALL[name];
  93581. var list = _this2[props.getterName]();
  93582. if (list && list.off) {
  93583. list.off();
  93584. }
  93585. });
  93586. _Component.prototype.dispose.call(this, {
  93587. restoreEl: this.options_.restoreEl
  93588. });
  93589. };
  93590. _proto.createEl = function createEl2() {
  93591. var tag = this.tag;
  93592. var el;
  93593. var playerElIngest = this.playerElIngest_ = tag.parentNode && tag.parentNode.hasAttribute && tag.parentNode.hasAttribute("data-vjs-player");
  93594. var divEmbed = this.tag.tagName.toLowerCase() === "video-js";
  93595. if (playerElIngest) {
  93596. el = this.el_ = tag.parentNode;
  93597. } else if (!divEmbed) {
  93598. el = this.el_ = _Component.prototype.createEl.call(this, "div");
  93599. }
  93600. var attrs = getAttributes(tag);
  93601. if (divEmbed) {
  93602. el = this.el_ = tag;
  93603. tag = this.tag = document_1.createElement("video");
  93604. while (el.children.length) {
  93605. tag.appendChild(el.firstChild);
  93606. }
  93607. if (!hasClass(el, "video-js")) {
  93608. addClass(el, "video-js");
  93609. }
  93610. el.appendChild(tag);
  93611. playerElIngest = this.playerElIngest_ = el;
  93612. Object.keys(el).forEach(function(k) {
  93613. try {
  93614. tag[k] = el[k];
  93615. } catch (e) {
  93616. }
  93617. });
  93618. }
  93619. tag.setAttribute("tabindex", "-1");
  93620. attrs.tabindex = "-1";
  93621. if (IE_VERSION || IS_CHROME && IS_WINDOWS) {
  93622. tag.setAttribute("role", "application");
  93623. attrs.role = "application";
  93624. }
  93625. tag.removeAttribute("width");
  93626. tag.removeAttribute("height");
  93627. if ("width" in attrs) {
  93628. delete attrs.width;
  93629. }
  93630. if ("height" in attrs) {
  93631. delete attrs.height;
  93632. }
  93633. Object.getOwnPropertyNames(attrs).forEach(function(attr) {
  93634. if (!(divEmbed && attr === "class")) {
  93635. el.setAttribute(attr, attrs[attr]);
  93636. }
  93637. if (divEmbed) {
  93638. tag.setAttribute(attr, attrs[attr]);
  93639. }
  93640. });
  93641. tag.playerId = tag.id;
  93642. tag.id += "_html5_api";
  93643. tag.className = "vjs-tech";
  93644. tag.player = el.player = this;
  93645. this.addClass("vjs-paused");
  93646. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE !== true) {
  93647. this.styleEl_ = createStyleElement("vjs-styles-dimensions");
  93648. var defaultsStyleEl = $(".vjs-styles-defaults");
  93649. var head = $("head");
  93650. head.insertBefore(this.styleEl_, defaultsStyleEl ? defaultsStyleEl.nextSibling : head.firstChild);
  93651. }
  93652. this.fill_ = false;
  93653. this.fluid_ = false;
  93654. this.width(this.options_.width);
  93655. this.height(this.options_.height);
  93656. this.fill(this.options_.fill);
  93657. this.fluid(this.options_.fluid);
  93658. this.aspectRatio(this.options_.aspectRatio);
  93659. this.crossOrigin(this.options_.crossOrigin || this.options_.crossorigin);
  93660. var links = tag.getElementsByTagName("a");
  93661. for (var i2 = 0; i2 < links.length; i2++) {
  93662. var linkEl = links.item(i2);
  93663. addClass(linkEl, "vjs-hidden");
  93664. linkEl.setAttribute("hidden", "hidden");
  93665. }
  93666. tag.initNetworkState_ = tag.networkState;
  93667. if (tag.parentNode && !playerElIngest) {
  93668. tag.parentNode.insertBefore(el, tag);
  93669. }
  93670. prependTo(tag, el);
  93671. this.children_.unshift(tag);
  93672. this.el_.setAttribute("lang", this.language_);
  93673. this.el_.setAttribute("translate", "no");
  93674. this.el_ = el;
  93675. return el;
  93676. };
  93677. _proto.crossOrigin = function crossOrigin(value) {
  93678. if (!value) {
  93679. return this.techGet_("crossOrigin");
  93680. }
  93681. if (value !== "anonymous" && value !== "use-credentials") {
  93682. log$1.warn('crossOrigin must be "anonymous" or "use-credentials", given "' + value + '"');
  93683. return;
  93684. }
  93685. this.techCall_("setCrossOrigin", value);
  93686. return;
  93687. };
  93688. _proto.width = function width2(value) {
  93689. return this.dimension("width", value);
  93690. };
  93691. _proto.height = function height2(value) {
  93692. return this.dimension("height", value);
  93693. };
  93694. _proto.dimension = function dimension(_dimension, value) {
  93695. var privDimension = _dimension + "_";
  93696. if (value === void 0) {
  93697. return this[privDimension] || 0;
  93698. }
  93699. if (value === "" || value === "auto") {
  93700. this[privDimension] = void 0;
  93701. this.updateStyleEl_();
  93702. return;
  93703. }
  93704. var parsedVal = parseFloat(value);
  93705. if (isNaN(parsedVal)) {
  93706. log$1.error('Improper value "' + value + '" supplied for for ' + _dimension);
  93707. return;
  93708. }
  93709. this[privDimension] = parsedVal;
  93710. this.updateStyleEl_();
  93711. };
  93712. _proto.fluid = function fluid(bool) {
  93713. var _this3 = this;
  93714. if (bool === void 0) {
  93715. return !!this.fluid_;
  93716. }
  93717. this.fluid_ = !!bool;
  93718. if (isEvented(this)) {
  93719. this.off(["playerreset", "resize"], this.boundUpdateStyleEl_);
  93720. }
  93721. if (bool) {
  93722. this.addClass("vjs-fluid");
  93723. this.fill(false);
  93724. addEventedCallback(this, function() {
  93725. _this3.on(["playerreset", "resize"], _this3.boundUpdateStyleEl_);
  93726. });
  93727. } else {
  93728. this.removeClass("vjs-fluid");
  93729. }
  93730. this.updateStyleEl_();
  93731. };
  93732. _proto.fill = function fill(bool) {
  93733. if (bool === void 0) {
  93734. return !!this.fill_;
  93735. }
  93736. this.fill_ = !!bool;
  93737. if (bool) {
  93738. this.addClass("vjs-fill");
  93739. this.fluid(false);
  93740. } else {
  93741. this.removeClass("vjs-fill");
  93742. }
  93743. };
  93744. _proto.aspectRatio = function aspectRatio(ratio) {
  93745. if (ratio === void 0) {
  93746. return this.aspectRatio_;
  93747. }
  93748. if (!/^\d+\:\d+$/.test(ratio)) {
  93749. throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");
  93750. }
  93751. this.aspectRatio_ = ratio;
  93752. this.fluid(true);
  93753. this.updateStyleEl_();
  93754. };
  93755. _proto.updateStyleEl_ = function updateStyleEl_() {
  93756. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE === true) {
  93757. var _width = typeof this.width_ === "number" ? this.width_ : this.options_.width;
  93758. var _height = typeof this.height_ === "number" ? this.height_ : this.options_.height;
  93759. var techEl = this.tech_ && this.tech_.el();
  93760. if (techEl) {
  93761. if (_width >= 0) {
  93762. techEl.width = _width;
  93763. }
  93764. if (_height >= 0) {
  93765. techEl.height = _height;
  93766. }
  93767. }
  93768. return;
  93769. }
  93770. var width2;
  93771. var height2;
  93772. var aspectRatio;
  93773. var idClass;
  93774. if (this.aspectRatio_ !== void 0 && this.aspectRatio_ !== "auto") {
  93775. aspectRatio = this.aspectRatio_;
  93776. } else if (this.videoWidth() > 0) {
  93777. aspectRatio = this.videoWidth() + ":" + this.videoHeight();
  93778. } else {
  93779. aspectRatio = "16:9";
  93780. }
  93781. var ratioParts = aspectRatio.split(":");
  93782. var ratioMultiplier = ratioParts[1] / ratioParts[0];
  93783. if (this.width_ !== void 0) {
  93784. width2 = this.width_;
  93785. } else if (this.height_ !== void 0) {
  93786. width2 = this.height_ / ratioMultiplier;
  93787. } else {
  93788. width2 = this.videoWidth() || 300;
  93789. }
  93790. if (this.height_ !== void 0) {
  93791. height2 = this.height_;
  93792. } else {
  93793. height2 = width2 * ratioMultiplier;
  93794. }
  93795. if (/^[^a-zA-Z]/.test(this.id())) {
  93796. idClass = "dimensions-" + this.id();
  93797. } else {
  93798. idClass = this.id() + "-dimensions";
  93799. }
  93800. this.addClass(idClass);
  93801. setTextContent(this.styleEl_, "\n ." + idClass + " {\n width: " + width2 + "px;\n height: " + height2 + "px;\n }\n\n ." + idClass + ".vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: " + ratioMultiplier * 100 + "%;\n }\n ");
  93802. };
  93803. _proto.loadTech_ = function loadTech_(techName, source) {
  93804. var _this4 = this;
  93805. if (this.tech_) {
  93806. this.unloadTech_();
  93807. }
  93808. var titleTechName = toTitleCase$1(techName);
  93809. var camelTechName = techName.charAt(0).toLowerCase() + techName.slice(1);
  93810. if (titleTechName !== "Html5" && this.tag) {
  93811. Tech$1.getTech("Html5").disposeMediaElement(this.tag);
  93812. this.tag.player = null;
  93813. this.tag = null;
  93814. }
  93815. this.techName_ = titleTechName;
  93816. this.isReady_ = false;
  93817. var autoplay = this.autoplay();
  93818. if (typeof this.autoplay() === "string" || this.autoplay() === true && this.options_.normalizeAutoplay) {
  93819. autoplay = false;
  93820. }
  93821. var techOptions = {
  93822. source,
  93823. autoplay,
  93824. "nativeControlsForTouch": this.options_.nativeControlsForTouch,
  93825. "playerId": this.id(),
  93826. "techId": this.id() + "_" + camelTechName + "_api",
  93827. "playsinline": this.options_.playsinline,
  93828. "preload": this.options_.preload,
  93829. "loop": this.options_.loop,
  93830. "disablePictureInPicture": this.options_.disablePictureInPicture,
  93831. "muted": this.options_.muted,
  93832. "poster": this.poster(),
  93833. "language": this.language(),
  93834. "playerElIngest": this.playerElIngest_ || false,
  93835. "vtt.js": this.options_["vtt.js"],
  93836. "canOverridePoster": !!this.options_.techCanOverridePoster,
  93837. "enableSourceset": this.options_.enableSourceset,
  93838. "Promise": this.options_.Promise
  93839. };
  93840. ALL.names.forEach(function(name) {
  93841. var props = ALL[name];
  93842. techOptions[props.getterName] = _this4[props.privateName];
  93843. });
  93844. assign(techOptions, this.options_[titleTechName]);
  93845. assign(techOptions, this.options_[camelTechName]);
  93846. assign(techOptions, this.options_[techName.toLowerCase()]);
  93847. if (this.tag) {
  93848. techOptions.tag = this.tag;
  93849. }
  93850. if (source && source.src === this.cache_.src && this.cache_.currentTime > 0) {
  93851. techOptions.startTime = this.cache_.currentTime;
  93852. }
  93853. var TechClass = Tech$1.getTech(techName);
  93854. if (!TechClass) {
  93855. throw new Error("No Tech named '" + titleTechName + "' exists! '" + titleTechName + "' should be registered using videojs.registerTech()'");
  93856. }
  93857. this.tech_ = new TechClass(techOptions);
  93858. this.tech_.ready(bind(this, this.handleTechReady_), true);
  93859. textTrackConverter.jsonToTextTracks(this.textTracksJson_ || [], this.tech_);
  93860. TECH_EVENTS_RETRIGGER.forEach(function(event2) {
  93861. _this4.on(_this4.tech_, event2, function(e) {
  93862. return _this4["handleTech" + toTitleCase$1(event2) + "_"](e);
  93863. });
  93864. });
  93865. Object.keys(TECH_EVENTS_QUEUE).forEach(function(event2) {
  93866. _this4.on(_this4.tech_, event2, function(eventObj) {
  93867. if (_this4.tech_.playbackRate() === 0 && _this4.tech_.seeking()) {
  93868. _this4.queuedCallbacks_.push({
  93869. callback: _this4["handleTech" + TECH_EVENTS_QUEUE[event2] + "_"].bind(_this4),
  93870. event: eventObj
  93871. });
  93872. return;
  93873. }
  93874. _this4["handleTech" + TECH_EVENTS_QUEUE[event2] + "_"](eventObj);
  93875. });
  93876. });
  93877. this.on(this.tech_, "loadstart", function(e) {
  93878. return _this4.handleTechLoadStart_(e);
  93879. });
  93880. this.on(this.tech_, "sourceset", function(e) {
  93881. return _this4.handleTechSourceset_(e);
  93882. });
  93883. this.on(this.tech_, "waiting", function(e) {
  93884. return _this4.handleTechWaiting_(e);
  93885. });
  93886. this.on(this.tech_, "ended", function(e) {
  93887. return _this4.handleTechEnded_(e);
  93888. });
  93889. this.on(this.tech_, "seeking", function(e) {
  93890. return _this4.handleTechSeeking_(e);
  93891. });
  93892. this.on(this.tech_, "play", function(e) {
  93893. return _this4.handleTechPlay_(e);
  93894. });
  93895. this.on(this.tech_, "firstplay", function(e) {
  93896. return _this4.handleTechFirstPlay_(e);
  93897. });
  93898. this.on(this.tech_, "pause", function(e) {
  93899. return _this4.handleTechPause_(e);
  93900. });
  93901. this.on(this.tech_, "durationchange", function(e) {
  93902. return _this4.handleTechDurationChange_(e);
  93903. });
  93904. this.on(this.tech_, "fullscreenchange", function(e, data) {
  93905. return _this4.handleTechFullscreenChange_(e, data);
  93906. });
  93907. this.on(this.tech_, "fullscreenerror", function(e, err) {
  93908. return _this4.handleTechFullscreenError_(e, err);
  93909. });
  93910. this.on(this.tech_, "enterpictureinpicture", function(e) {
  93911. return _this4.handleTechEnterPictureInPicture_(e);
  93912. });
  93913. this.on(this.tech_, "leavepictureinpicture", function(e) {
  93914. return _this4.handleTechLeavePictureInPicture_(e);
  93915. });
  93916. this.on(this.tech_, "error", function(e) {
  93917. return _this4.handleTechError_(e);
  93918. });
  93919. this.on(this.tech_, "posterchange", function(e) {
  93920. return _this4.handleTechPosterChange_(e);
  93921. });
  93922. this.on(this.tech_, "textdata", function(e) {
  93923. return _this4.handleTechTextData_(e);
  93924. });
  93925. this.on(this.tech_, "ratechange", function(e) {
  93926. return _this4.handleTechRateChange_(e);
  93927. });
  93928. this.on(this.tech_, "loadedmetadata", this.boundUpdateStyleEl_);
  93929. this.usingNativeControls(this.techGet_("controls"));
  93930. if (this.controls() && !this.usingNativeControls()) {
  93931. this.addTechControlsListeners_();
  93932. }
  93933. if (this.tech_.el().parentNode !== this.el() && (titleTechName !== "Html5" || !this.tag)) {
  93934. prependTo(this.tech_.el(), this.el());
  93935. }
  93936. if (this.tag) {
  93937. this.tag.player = null;
  93938. this.tag = null;
  93939. }
  93940. };
  93941. _proto.unloadTech_ = function unloadTech_() {
  93942. var _this5 = this;
  93943. ALL.names.forEach(function(name) {
  93944. var props = ALL[name];
  93945. _this5[props.privateName] = _this5[props.getterName]();
  93946. });
  93947. this.textTracksJson_ = textTrackConverter.textTracksToJson(this.tech_);
  93948. this.isReady_ = false;
  93949. this.tech_.dispose();
  93950. this.tech_ = false;
  93951. if (this.isPosterFromTech_) {
  93952. this.poster_ = "";
  93953. this.trigger("posterchange");
  93954. }
  93955. this.isPosterFromTech_ = false;
  93956. };
  93957. _proto.tech = function tech(safety) {
  93958. if (safety === void 0) {
  93959. log$1.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n");
  93960. }
  93961. return this.tech_;
  93962. };
  93963. _proto.addTechControlsListeners_ = function addTechControlsListeners_() {
  93964. this.removeTechControlsListeners_();
  93965. this.on(this.tech_, "click", this.boundHandleTechClick_);
  93966. this.on(this.tech_, "dblclick", this.boundHandleTechDoubleClick_);
  93967. this.on(this.tech_, "touchstart", this.boundHandleTechTouchStart_);
  93968. this.on(this.tech_, "touchmove", this.boundHandleTechTouchMove_);
  93969. this.on(this.tech_, "touchend", this.boundHandleTechTouchEnd_);
  93970. this.on(this.tech_, "tap", this.boundHandleTechTap_);
  93971. };
  93972. _proto.removeTechControlsListeners_ = function removeTechControlsListeners_() {
  93973. this.off(this.tech_, "tap", this.boundHandleTechTap_);
  93974. this.off(this.tech_, "touchstart", this.boundHandleTechTouchStart_);
  93975. this.off(this.tech_, "touchmove", this.boundHandleTechTouchMove_);
  93976. this.off(this.tech_, "touchend", this.boundHandleTechTouchEnd_);
  93977. this.off(this.tech_, "click", this.boundHandleTechClick_);
  93978. this.off(this.tech_, "dblclick", this.boundHandleTechDoubleClick_);
  93979. };
  93980. _proto.handleTechReady_ = function handleTechReady_() {
  93981. this.triggerReady();
  93982. if (this.cache_.volume) {
  93983. this.techCall_("setVolume", this.cache_.volume);
  93984. }
  93985. this.handleTechPosterChange_();
  93986. this.handleTechDurationChange_();
  93987. };
  93988. _proto.handleTechLoadStart_ = function handleTechLoadStart_() {
  93989. this.removeClass("vjs-ended");
  93990. this.removeClass("vjs-seeking");
  93991. this.error(null);
  93992. this.handleTechDurationChange_();
  93993. if (!this.paused()) {
  93994. this.trigger("loadstart");
  93995. this.trigger("firstplay");
  93996. } else {
  93997. this.hasStarted(false);
  93998. this.trigger("loadstart");
  93999. }
  94000. this.manualAutoplay_(this.autoplay() === true && this.options_.normalizeAutoplay ? "play" : this.autoplay());
  94001. };
  94002. _proto.manualAutoplay_ = function manualAutoplay_(type2) {
  94003. var _this6 = this;
  94004. if (!this.tech_ || typeof type2 !== "string") {
  94005. return;
  94006. }
  94007. var resolveMuted = function resolveMuted2() {
  94008. var previouslyMuted = _this6.muted();
  94009. _this6.muted(true);
  94010. var restoreMuted = function restoreMuted2() {
  94011. _this6.muted(previouslyMuted);
  94012. };
  94013. _this6.playTerminatedQueue_.push(restoreMuted);
  94014. var mutedPromise = _this6.play();
  94015. if (!isPromise(mutedPromise)) {
  94016. return;
  94017. }
  94018. return mutedPromise["catch"](function(err) {
  94019. restoreMuted();
  94020. throw new Error("Rejection at manualAutoplay. Restoring muted value. " + (err ? err : ""));
  94021. });
  94022. };
  94023. var promise;
  94024. if (type2 === "any" && !this.muted()) {
  94025. promise = this.play();
  94026. if (isPromise(promise)) {
  94027. promise = promise["catch"](resolveMuted);
  94028. }
  94029. } else if (type2 === "muted" && !this.muted()) {
  94030. promise = resolveMuted();
  94031. } else {
  94032. promise = this.play();
  94033. }
  94034. if (!isPromise(promise)) {
  94035. return;
  94036. }
  94037. return promise.then(function() {
  94038. _this6.trigger({
  94039. type: "autoplay-success",
  94040. autoplay: type2
  94041. });
  94042. })["catch"](function() {
  94043. _this6.trigger({
  94044. type: "autoplay-failure",
  94045. autoplay: type2
  94046. });
  94047. });
  94048. };
  94049. _proto.updateSourceCaches_ = function updateSourceCaches_(srcObj) {
  94050. if (srcObj === void 0) {
  94051. srcObj = "";
  94052. }
  94053. var src = srcObj;
  94054. var type2 = "";
  94055. if (typeof src !== "string") {
  94056. src = srcObj.src;
  94057. type2 = srcObj.type;
  94058. }
  94059. this.cache_.source = this.cache_.source || {};
  94060. this.cache_.sources = this.cache_.sources || [];
  94061. if (src && !type2) {
  94062. type2 = findMimetype(this, src);
  94063. }
  94064. this.cache_.source = mergeOptions$3({}, srcObj, {
  94065. src,
  94066. type: type2
  94067. });
  94068. var matchingSources = this.cache_.sources.filter(function(s) {
  94069. return s.src && s.src === src;
  94070. });
  94071. var sourceElSources = [];
  94072. var sourceEls = this.$$("source");
  94073. var matchingSourceEls = [];
  94074. for (var i2 = 0; i2 < sourceEls.length; i2++) {
  94075. var sourceObj = getAttributes(sourceEls[i2]);
  94076. sourceElSources.push(sourceObj);
  94077. if (sourceObj.src && sourceObj.src === src) {
  94078. matchingSourceEls.push(sourceObj.src);
  94079. }
  94080. }
  94081. if (matchingSourceEls.length && !matchingSources.length) {
  94082. this.cache_.sources = sourceElSources;
  94083. } else if (!matchingSources.length) {
  94084. this.cache_.sources = [this.cache_.source];
  94085. }
  94086. this.cache_.src = src;
  94087. };
  94088. _proto.handleTechSourceset_ = function handleTechSourceset_(event2) {
  94089. var _this7 = this;
  94090. if (!this.changingSrc_) {
  94091. var updateSourceCaches = function updateSourceCaches2(src) {
  94092. return _this7.updateSourceCaches_(src);
  94093. };
  94094. var playerSrc = this.currentSource().src;
  94095. var eventSrc = event2.src;
  94096. if (playerSrc && !/^blob:/.test(playerSrc) && /^blob:/.test(eventSrc)) {
  94097. if (!this.lastSource_ || this.lastSource_.tech !== eventSrc && this.lastSource_.player !== playerSrc) {
  94098. updateSourceCaches = function updateSourceCaches2() {
  94099. };
  94100. }
  94101. }
  94102. updateSourceCaches(eventSrc);
  94103. if (!event2.src) {
  94104. this.tech_.any(["sourceset", "loadstart"], function(e) {
  94105. if (e.type === "sourceset") {
  94106. return;
  94107. }
  94108. var techSrc = _this7.techGet("currentSrc");
  94109. _this7.lastSource_.tech = techSrc;
  94110. _this7.updateSourceCaches_(techSrc);
  94111. });
  94112. }
  94113. }
  94114. this.lastSource_ = {
  94115. player: this.currentSource().src,
  94116. tech: event2.src
  94117. };
  94118. this.trigger({
  94119. src: event2.src,
  94120. type: "sourceset"
  94121. });
  94122. };
  94123. _proto.hasStarted = function hasStarted(request) {
  94124. if (request === void 0) {
  94125. return this.hasStarted_;
  94126. }
  94127. if (request === this.hasStarted_) {
  94128. return;
  94129. }
  94130. this.hasStarted_ = request;
  94131. if (this.hasStarted_) {
  94132. this.addClass("vjs-has-started");
  94133. this.trigger("firstplay");
  94134. } else {
  94135. this.removeClass("vjs-has-started");
  94136. }
  94137. };
  94138. _proto.handleTechPlay_ = function handleTechPlay_() {
  94139. this.removeClass("vjs-ended");
  94140. this.removeClass("vjs-paused");
  94141. this.addClass("vjs-playing");
  94142. this.hasStarted(true);
  94143. this.trigger("play");
  94144. };
  94145. _proto.handleTechRateChange_ = function handleTechRateChange_() {
  94146. if (this.tech_.playbackRate() > 0 && this.cache_.lastPlaybackRate === 0) {
  94147. this.queuedCallbacks_.forEach(function(queued) {
  94148. return queued.callback(queued.event);
  94149. });
  94150. this.queuedCallbacks_ = [];
  94151. }
  94152. this.cache_.lastPlaybackRate = this.tech_.playbackRate();
  94153. this.trigger("ratechange");
  94154. };
  94155. _proto.handleTechWaiting_ = function handleTechWaiting_() {
  94156. var _this8 = this;
  94157. this.addClass("vjs-waiting");
  94158. this.trigger("waiting");
  94159. var timeWhenWaiting = this.currentTime();
  94160. var timeUpdateListener = function timeUpdateListener2() {
  94161. if (timeWhenWaiting !== _this8.currentTime()) {
  94162. _this8.removeClass("vjs-waiting");
  94163. _this8.off("timeupdate", timeUpdateListener2);
  94164. }
  94165. };
  94166. this.on("timeupdate", timeUpdateListener);
  94167. };
  94168. _proto.handleTechCanPlay_ = function handleTechCanPlay_() {
  94169. this.removeClass("vjs-waiting");
  94170. this.trigger("canplay");
  94171. };
  94172. _proto.handleTechCanPlayThrough_ = function handleTechCanPlayThrough_() {
  94173. this.removeClass("vjs-waiting");
  94174. this.trigger("canplaythrough");
  94175. };
  94176. _proto.handleTechPlaying_ = function handleTechPlaying_() {
  94177. this.removeClass("vjs-waiting");
  94178. this.trigger("playing");
  94179. };
  94180. _proto.handleTechSeeking_ = function handleTechSeeking_() {
  94181. this.addClass("vjs-seeking");
  94182. this.trigger("seeking");
  94183. };
  94184. _proto.handleTechSeeked_ = function handleTechSeeked_() {
  94185. this.removeClass("vjs-seeking");
  94186. this.removeClass("vjs-ended");
  94187. this.trigger("seeked");
  94188. };
  94189. _proto.handleTechFirstPlay_ = function handleTechFirstPlay_() {
  94190. if (this.options_.starttime) {
  94191. log$1.warn("Passing the `starttime` option to the player will be deprecated in 6.0");
  94192. this.currentTime(this.options_.starttime);
  94193. }
  94194. this.addClass("vjs-has-started");
  94195. this.trigger("firstplay");
  94196. };
  94197. _proto.handleTechPause_ = function handleTechPause_() {
  94198. this.removeClass("vjs-playing");
  94199. this.addClass("vjs-paused");
  94200. this.trigger("pause");
  94201. };
  94202. _proto.handleTechEnded_ = function handleTechEnded_() {
  94203. this.addClass("vjs-ended");
  94204. this.removeClass("vjs-waiting");
  94205. if (this.options_.loop) {
  94206. this.currentTime(0);
  94207. this.play();
  94208. } else if (!this.paused()) {
  94209. this.pause();
  94210. }
  94211. this.trigger("ended");
  94212. };
  94213. _proto.handleTechDurationChange_ = function handleTechDurationChange_() {
  94214. this.duration(this.techGet_("duration"));
  94215. };
  94216. _proto.handleTechClick_ = function handleTechClick_(event2) {
  94217. if (!this.controls_) {
  94218. return;
  94219. }
  94220. if (this.options_ === void 0 || this.options_.userActions === void 0 || this.options_.userActions.click === void 0 || this.options_.userActions.click !== false) {
  94221. if (this.options_ !== void 0 && this.options_.userActions !== void 0 && typeof this.options_.userActions.click === "function") {
  94222. this.options_.userActions.click.call(this, event2);
  94223. } else if (this.paused()) {
  94224. silencePromise(this.play());
  94225. } else {
  94226. this.pause();
  94227. }
  94228. }
  94229. };
  94230. _proto.handleTechDoubleClick_ = function handleTechDoubleClick_(event2) {
  94231. if (!this.controls_) {
  94232. return;
  94233. }
  94234. var inAllowedEls = Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"), function(el) {
  94235. return el.contains(event2.target);
  94236. });
  94237. if (!inAllowedEls) {
  94238. if (this.options_ === void 0 || this.options_.userActions === void 0 || this.options_.userActions.doubleClick === void 0 || this.options_.userActions.doubleClick !== false) {
  94239. if (this.options_ !== void 0 && this.options_.userActions !== void 0 && typeof this.options_.userActions.doubleClick === "function") {
  94240. this.options_.userActions.doubleClick.call(this, event2);
  94241. } else if (this.isFullscreen()) {
  94242. this.exitFullscreen();
  94243. } else {
  94244. this.requestFullscreen();
  94245. }
  94246. }
  94247. }
  94248. };
  94249. _proto.handleTechTap_ = function handleTechTap_() {
  94250. this.userActive(!this.userActive());
  94251. };
  94252. _proto.handleTechTouchStart_ = function handleTechTouchStart_() {
  94253. this.userWasActive = this.userActive();
  94254. };
  94255. _proto.handleTechTouchMove_ = function handleTechTouchMove_() {
  94256. if (this.userWasActive) {
  94257. this.reportUserActivity();
  94258. }
  94259. };
  94260. _proto.handleTechTouchEnd_ = function handleTechTouchEnd_(event2) {
  94261. if (event2.cancelable) {
  94262. event2.preventDefault();
  94263. }
  94264. };
  94265. _proto.handleStageClick_ = function handleStageClick_() {
  94266. this.reportUserActivity();
  94267. };
  94268. _proto.toggleFullscreenClass_ = function toggleFullscreenClass_() {
  94269. if (this.isFullscreen()) {
  94270. this.addClass("vjs-fullscreen");
  94271. } else {
  94272. this.removeClass("vjs-fullscreen");
  94273. }
  94274. };
  94275. _proto.documentFullscreenChange_ = function documentFullscreenChange_(e) {
  94276. var targetPlayer = e.target.player;
  94277. if (targetPlayer && targetPlayer !== this) {
  94278. return;
  94279. }
  94280. var el = this.el();
  94281. var isFs = document_1[this.fsApi_.fullscreenElement] === el;
  94282. if (!isFs && el.matches) {
  94283. isFs = el.matches(":" + this.fsApi_.fullscreen);
  94284. } else if (!isFs && el.msMatchesSelector) {
  94285. isFs = el.msMatchesSelector(":" + this.fsApi_.fullscreen);
  94286. }
  94287. this.isFullscreen(isFs);
  94288. };
  94289. _proto.handleTechFullscreenChange_ = function handleTechFullscreenChange_(event2, data) {
  94290. var _this9 = this;
  94291. if (data) {
  94292. if (data.nativeIOSFullscreen) {
  94293. this.addClass("vjs-ios-native-fs");
  94294. this.tech_.one("webkitendfullscreen", function() {
  94295. _this9.removeClass("vjs-ios-native-fs");
  94296. });
  94297. }
  94298. this.isFullscreen(data.isFullscreen);
  94299. }
  94300. };
  94301. _proto.handleTechFullscreenError_ = function handleTechFullscreenError_(event2, err) {
  94302. this.trigger("fullscreenerror", err);
  94303. };
  94304. _proto.togglePictureInPictureClass_ = function togglePictureInPictureClass_() {
  94305. if (this.isInPictureInPicture()) {
  94306. this.addClass("vjs-picture-in-picture");
  94307. } else {
  94308. this.removeClass("vjs-picture-in-picture");
  94309. }
  94310. };
  94311. _proto.handleTechEnterPictureInPicture_ = function handleTechEnterPictureInPicture_(event2) {
  94312. this.isInPictureInPicture(true);
  94313. };
  94314. _proto.handleTechLeavePictureInPicture_ = function handleTechLeavePictureInPicture_(event2) {
  94315. this.isInPictureInPicture(false);
  94316. };
  94317. _proto.handleTechError_ = function handleTechError_() {
  94318. var error = this.tech_.error();
  94319. this.error(error);
  94320. };
  94321. _proto.handleTechTextData_ = function handleTechTextData_() {
  94322. var data = null;
  94323. if (arguments.length > 1) {
  94324. data = arguments[1];
  94325. }
  94326. this.trigger("textdata", data);
  94327. };
  94328. _proto.getCache = function getCache() {
  94329. return this.cache_;
  94330. };
  94331. _proto.resetCache_ = function resetCache_() {
  94332. this.cache_ = {
  94333. currentTime: 0,
  94334. initTime: 0,
  94335. inactivityTimeout: this.options_.inactivityTimeout,
  94336. duration: NaN,
  94337. lastVolume: 1,
  94338. lastPlaybackRate: this.defaultPlaybackRate(),
  94339. media: null,
  94340. src: "",
  94341. source: {},
  94342. sources: [],
  94343. playbackRates: [],
  94344. volume: 1
  94345. };
  94346. };
  94347. _proto.techCall_ = function techCall_(method, arg) {
  94348. this.ready(function() {
  94349. if (method in allowedSetters) {
  94350. return set(this.middleware_, this.tech_, method, arg);
  94351. } else if (method in allowedMediators) {
  94352. return mediate(this.middleware_, this.tech_, method, arg);
  94353. }
  94354. try {
  94355. if (this.tech_) {
  94356. this.tech_[method](arg);
  94357. }
  94358. } catch (e) {
  94359. log$1(e);
  94360. throw e;
  94361. }
  94362. }, true);
  94363. };
  94364. _proto.techGet_ = function techGet_(method) {
  94365. if (!this.tech_ || !this.tech_.isReady_) {
  94366. return;
  94367. }
  94368. if (method in allowedGetters) {
  94369. return get(this.middleware_, this.tech_, method);
  94370. } else if (method in allowedMediators) {
  94371. return mediate(this.middleware_, this.tech_, method);
  94372. }
  94373. try {
  94374. return this.tech_[method]();
  94375. } catch (e) {
  94376. if (this.tech_[method] === void 0) {
  94377. log$1("Video.js: " + method + " method not defined for " + this.techName_ + " playback technology.", e);
  94378. throw e;
  94379. }
  94380. if (e.name === "TypeError") {
  94381. log$1("Video.js: " + method + " unavailable on " + this.techName_ + " playback technology element.", e);
  94382. this.tech_.isReady_ = false;
  94383. throw e;
  94384. }
  94385. log$1(e);
  94386. throw e;
  94387. }
  94388. };
  94389. _proto.play = function play() {
  94390. var _this10 = this;
  94391. var PromiseClass = this.options_.Promise || window_1.Promise;
  94392. if (PromiseClass) {
  94393. return new PromiseClass(function(resolve2) {
  94394. _this10.play_(resolve2);
  94395. });
  94396. }
  94397. return this.play_();
  94398. };
  94399. _proto.play_ = function play_(callback2) {
  94400. var _this11 = this;
  94401. if (callback2 === void 0) {
  94402. callback2 = silencePromise;
  94403. }
  94404. this.playCallbacks_.push(callback2);
  94405. var isSrcReady = Boolean(!this.changingSrc_ && (this.src() || this.currentSrc()));
  94406. var isSafariOrIOS = Boolean(IS_ANY_SAFARI || IS_IOS);
  94407. if (this.waitToPlay_) {
  94408. this.off(["ready", "loadstart"], this.waitToPlay_);
  94409. this.waitToPlay_ = null;
  94410. }
  94411. if (!this.isReady_ || !isSrcReady) {
  94412. this.waitToPlay_ = function(e) {
  94413. _this11.play_();
  94414. };
  94415. this.one(["ready", "loadstart"], this.waitToPlay_);
  94416. if (!isSrcReady && isSafariOrIOS) {
  94417. this.load();
  94418. }
  94419. return;
  94420. }
  94421. var val = this.techGet_("play");
  94422. var isNativeReplay = isSafariOrIOS && this.hasClass("vjs-ended");
  94423. if (isNativeReplay) {
  94424. this.resetProgressBar_();
  94425. }
  94426. if (val === null) {
  94427. this.runPlayTerminatedQueue_();
  94428. } else {
  94429. this.runPlayCallbacks_(val);
  94430. }
  94431. };
  94432. _proto.runPlayTerminatedQueue_ = function runPlayTerminatedQueue_() {
  94433. var queue = this.playTerminatedQueue_.slice(0);
  94434. this.playTerminatedQueue_ = [];
  94435. queue.forEach(function(q2) {
  94436. q2();
  94437. });
  94438. };
  94439. _proto.runPlayCallbacks_ = function runPlayCallbacks_(val) {
  94440. var callbacks = this.playCallbacks_.slice(0);
  94441. this.playCallbacks_ = [];
  94442. this.playTerminatedQueue_ = [];
  94443. callbacks.forEach(function(cb) {
  94444. cb(val);
  94445. });
  94446. };
  94447. _proto.pause = function pause() {
  94448. this.techCall_("pause");
  94449. };
  94450. _proto.paused = function paused() {
  94451. return this.techGet_("paused") === false ? false : true;
  94452. };
  94453. _proto.played = function played() {
  94454. return this.techGet_("played") || createTimeRanges(0, 0);
  94455. };
  94456. _proto.scrubbing = function scrubbing(isScrubbing) {
  94457. if (typeof isScrubbing === "undefined") {
  94458. return this.scrubbing_;
  94459. }
  94460. this.scrubbing_ = !!isScrubbing;
  94461. this.techCall_("setScrubbing", this.scrubbing_);
  94462. if (isScrubbing) {
  94463. this.addClass("vjs-scrubbing");
  94464. } else {
  94465. this.removeClass("vjs-scrubbing");
  94466. }
  94467. };
  94468. _proto.currentTime = function currentTime(seconds) {
  94469. if (typeof seconds !== "undefined") {
  94470. if (seconds < 0) {
  94471. seconds = 0;
  94472. }
  94473. if (!this.isReady_ || this.changingSrc_ || !this.tech_ || !this.tech_.isReady_) {
  94474. this.cache_.initTime = seconds;
  94475. this.off("canplay", this.boundApplyInitTime_);
  94476. this.one("canplay", this.boundApplyInitTime_);
  94477. return;
  94478. }
  94479. this.techCall_("setCurrentTime", seconds);
  94480. this.cache_.initTime = 0;
  94481. return;
  94482. }
  94483. this.cache_.currentTime = this.techGet_("currentTime") || 0;
  94484. return this.cache_.currentTime;
  94485. };
  94486. _proto.applyInitTime_ = function applyInitTime_() {
  94487. this.currentTime(this.cache_.initTime);
  94488. };
  94489. _proto.duration = function duration5(seconds) {
  94490. if (seconds === void 0) {
  94491. return this.cache_.duration !== void 0 ? this.cache_.duration : NaN;
  94492. }
  94493. seconds = parseFloat(seconds);
  94494. if (seconds < 0) {
  94495. seconds = Infinity;
  94496. }
  94497. if (seconds !== this.cache_.duration) {
  94498. this.cache_.duration = seconds;
  94499. if (seconds === Infinity) {
  94500. this.addClass("vjs-live");
  94501. } else {
  94502. this.removeClass("vjs-live");
  94503. }
  94504. if (!isNaN(seconds)) {
  94505. this.trigger("durationchange");
  94506. }
  94507. }
  94508. };
  94509. _proto.remainingTime = function remainingTime() {
  94510. return this.duration() - this.currentTime();
  94511. };
  94512. _proto.remainingTimeDisplay = function remainingTimeDisplay() {
  94513. return Math.floor(this.duration()) - Math.floor(this.currentTime());
  94514. };
  94515. _proto.buffered = function buffered() {
  94516. var buffered2 = this.techGet_("buffered");
  94517. if (!buffered2 || !buffered2.length) {
  94518. buffered2 = createTimeRanges(0, 0);
  94519. }
  94520. return buffered2;
  94521. };
  94522. _proto.bufferedPercent = function bufferedPercent$12() {
  94523. return bufferedPercent(this.buffered(), this.duration());
  94524. };
  94525. _proto.bufferedEnd = function bufferedEnd() {
  94526. var buffered = this.buffered();
  94527. var duration5 = this.duration();
  94528. var end = buffered.end(buffered.length - 1);
  94529. if (end > duration5) {
  94530. end = duration5;
  94531. }
  94532. return end;
  94533. };
  94534. _proto.volume = function volume(percentAsDecimal) {
  94535. var vol;
  94536. if (percentAsDecimal !== void 0) {
  94537. vol = Math.max(0, Math.min(1, parseFloat(percentAsDecimal)));
  94538. this.cache_.volume = vol;
  94539. this.techCall_("setVolume", vol);
  94540. if (vol > 0) {
  94541. this.lastVolume_(vol);
  94542. }
  94543. return;
  94544. }
  94545. vol = parseFloat(this.techGet_("volume"));
  94546. return isNaN(vol) ? 1 : vol;
  94547. };
  94548. _proto.muted = function muted(_muted) {
  94549. if (_muted !== void 0) {
  94550. this.techCall_("setMuted", _muted);
  94551. return;
  94552. }
  94553. return this.techGet_("muted") || false;
  94554. };
  94555. _proto.defaultMuted = function defaultMuted(_defaultMuted) {
  94556. if (_defaultMuted !== void 0) {
  94557. return this.techCall_("setDefaultMuted", _defaultMuted);
  94558. }
  94559. return this.techGet_("defaultMuted") || false;
  94560. };
  94561. _proto.lastVolume_ = function lastVolume_(percentAsDecimal) {
  94562. if (percentAsDecimal !== void 0 && percentAsDecimal !== 0) {
  94563. this.cache_.lastVolume = percentAsDecimal;
  94564. return;
  94565. }
  94566. return this.cache_.lastVolume;
  94567. };
  94568. _proto.supportsFullScreen = function supportsFullScreen() {
  94569. return this.techGet_("supportsFullScreen") || false;
  94570. };
  94571. _proto.isFullscreen = function isFullscreen(isFS) {
  94572. if (isFS !== void 0) {
  94573. var oldValue = this.isFullscreen_;
  94574. this.isFullscreen_ = Boolean(isFS);
  94575. if (this.isFullscreen_ !== oldValue && this.fsApi_.prefixed) {
  94576. this.trigger("fullscreenchange");
  94577. }
  94578. this.toggleFullscreenClass_();
  94579. return;
  94580. }
  94581. return this.isFullscreen_;
  94582. };
  94583. _proto.requestFullscreen = function requestFullscreen(fullscreenOptions) {
  94584. var PromiseClass = this.options_.Promise || window_1.Promise;
  94585. if (PromiseClass) {
  94586. var self2 = this;
  94587. return new PromiseClass(function(resolve2, reject2) {
  94588. function offHandler() {
  94589. self2.off("fullscreenerror", errorHandler);
  94590. self2.off("fullscreenchange", changeHandler);
  94591. }
  94592. function changeHandler() {
  94593. offHandler();
  94594. resolve2();
  94595. }
  94596. function errorHandler(e, err) {
  94597. offHandler();
  94598. reject2(err);
  94599. }
  94600. self2.one("fullscreenchange", changeHandler);
  94601. self2.one("fullscreenerror", errorHandler);
  94602. var promise = self2.requestFullscreenHelper_(fullscreenOptions);
  94603. if (promise) {
  94604. promise.then(offHandler, offHandler);
  94605. promise.then(resolve2, reject2);
  94606. }
  94607. });
  94608. }
  94609. return this.requestFullscreenHelper_();
  94610. };
  94611. _proto.requestFullscreenHelper_ = function requestFullscreenHelper_(fullscreenOptions) {
  94612. var _this12 = this;
  94613. var fsOptions;
  94614. if (!this.fsApi_.prefixed) {
  94615. fsOptions = this.options_.fullscreen && this.options_.fullscreen.options || {};
  94616. if (fullscreenOptions !== void 0) {
  94617. fsOptions = fullscreenOptions;
  94618. }
  94619. }
  94620. if (this.fsApi_.requestFullscreen) {
  94621. var promise = this.el_[this.fsApi_.requestFullscreen](fsOptions);
  94622. if (promise) {
  94623. promise.then(function() {
  94624. return _this12.isFullscreen(true);
  94625. }, function() {
  94626. return _this12.isFullscreen(false);
  94627. });
  94628. }
  94629. return promise;
  94630. } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {
  94631. this.techCall_("enterFullScreen");
  94632. } else {
  94633. this.enterFullWindow();
  94634. }
  94635. };
  94636. _proto.exitFullscreen = function exitFullscreen() {
  94637. var PromiseClass = this.options_.Promise || window_1.Promise;
  94638. if (PromiseClass) {
  94639. var self2 = this;
  94640. return new PromiseClass(function(resolve2, reject2) {
  94641. function offHandler() {
  94642. self2.off("fullscreenerror", errorHandler);
  94643. self2.off("fullscreenchange", changeHandler);
  94644. }
  94645. function changeHandler() {
  94646. offHandler();
  94647. resolve2();
  94648. }
  94649. function errorHandler(e, err) {
  94650. offHandler();
  94651. reject2(err);
  94652. }
  94653. self2.one("fullscreenchange", changeHandler);
  94654. self2.one("fullscreenerror", errorHandler);
  94655. var promise = self2.exitFullscreenHelper_();
  94656. if (promise) {
  94657. promise.then(offHandler, offHandler);
  94658. promise.then(resolve2, reject2);
  94659. }
  94660. });
  94661. }
  94662. return this.exitFullscreenHelper_();
  94663. };
  94664. _proto.exitFullscreenHelper_ = function exitFullscreenHelper_() {
  94665. var _this13 = this;
  94666. if (this.fsApi_.requestFullscreen) {
  94667. var promise = document_1[this.fsApi_.exitFullscreen]();
  94668. if (promise) {
  94669. silencePromise(promise.then(function() {
  94670. return _this13.isFullscreen(false);
  94671. }));
  94672. }
  94673. return promise;
  94674. } else if (this.tech_.supportsFullScreen() && !this.options_.preferFullWindow === true) {
  94675. this.techCall_("exitFullScreen");
  94676. } else {
  94677. this.exitFullWindow();
  94678. }
  94679. };
  94680. _proto.enterFullWindow = function enterFullWindow() {
  94681. this.isFullscreen(true);
  94682. this.isFullWindow = true;
  94683. this.docOrigOverflow = document_1.documentElement.style.overflow;
  94684. on(document_1, "keydown", this.boundFullWindowOnEscKey_);
  94685. document_1.documentElement.style.overflow = "hidden";
  94686. addClass(document_1.body, "vjs-full-window");
  94687. this.trigger("enterFullWindow");
  94688. };
  94689. _proto.fullWindowOnEscKey = function fullWindowOnEscKey(event2) {
  94690. if (keycode.isEventKey(event2, "Esc")) {
  94691. if (this.isFullscreen() === true) {
  94692. if (!this.isFullWindow) {
  94693. this.exitFullscreen();
  94694. } else {
  94695. this.exitFullWindow();
  94696. }
  94697. }
  94698. }
  94699. };
  94700. _proto.exitFullWindow = function exitFullWindow() {
  94701. this.isFullscreen(false);
  94702. this.isFullWindow = false;
  94703. off(document_1, "keydown", this.boundFullWindowOnEscKey_);
  94704. document_1.documentElement.style.overflow = this.docOrigOverflow;
  94705. removeClass(document_1.body, "vjs-full-window");
  94706. this.trigger("exitFullWindow");
  94707. };
  94708. _proto.disablePictureInPicture = function disablePictureInPicture(value) {
  94709. if (value === void 0) {
  94710. return this.techGet_("disablePictureInPicture");
  94711. }
  94712. this.techCall_("setDisablePictureInPicture", value);
  94713. this.options_.disablePictureInPicture = value;
  94714. this.trigger("disablepictureinpicturechanged");
  94715. };
  94716. _proto.isInPictureInPicture = function isInPictureInPicture(isPiP) {
  94717. if (isPiP !== void 0) {
  94718. this.isInPictureInPicture_ = !!isPiP;
  94719. this.togglePictureInPictureClass_();
  94720. return;
  94721. }
  94722. return !!this.isInPictureInPicture_;
  94723. };
  94724. _proto.requestPictureInPicture = function requestPictureInPicture() {
  94725. if ("pictureInPictureEnabled" in document_1 && this.disablePictureInPicture() === false) {
  94726. return this.techGet_("requestPictureInPicture");
  94727. }
  94728. };
  94729. _proto.exitPictureInPicture = function exitPictureInPicture() {
  94730. if ("pictureInPictureEnabled" in document_1) {
  94731. return document_1.exitPictureInPicture();
  94732. }
  94733. };
  94734. _proto.handleKeyDown = function handleKeyDown(event2) {
  94735. var userActions = this.options_.userActions;
  94736. if (!userActions || !userActions.hotkeys) {
  94737. return;
  94738. }
  94739. var excludeElement = function excludeElement2(el) {
  94740. var tagName = el.tagName.toLowerCase();
  94741. if (el.isContentEditable) {
  94742. return true;
  94743. }
  94744. var allowedInputTypes = ["button", "checkbox", "hidden", "radio", "reset", "submit"];
  94745. if (tagName === "input") {
  94746. return allowedInputTypes.indexOf(el.type) === -1;
  94747. }
  94748. var excludedTags = ["textarea"];
  94749. return excludedTags.indexOf(tagName) !== -1;
  94750. };
  94751. if (excludeElement(this.el_.ownerDocument.activeElement)) {
  94752. return;
  94753. }
  94754. if (typeof userActions.hotkeys === "function") {
  94755. userActions.hotkeys.call(this, event2);
  94756. } else {
  94757. this.handleHotkeys(event2);
  94758. }
  94759. };
  94760. _proto.handleHotkeys = function handleHotkeys(event2) {
  94761. var hotkeys = this.options_.userActions ? this.options_.userActions.hotkeys : {};
  94762. var _hotkeys$fullscreenKe = hotkeys.fullscreenKey, fullscreenKey = _hotkeys$fullscreenKe === void 0 ? function(keydownEvent) {
  94763. return keycode.isEventKey(keydownEvent, "f");
  94764. } : _hotkeys$fullscreenKe, _hotkeys$muteKey = hotkeys.muteKey, muteKey = _hotkeys$muteKey === void 0 ? function(keydownEvent) {
  94765. return keycode.isEventKey(keydownEvent, "m");
  94766. } : _hotkeys$muteKey, _hotkeys$playPauseKey = hotkeys.playPauseKey, playPauseKey = _hotkeys$playPauseKey === void 0 ? function(keydownEvent) {
  94767. return keycode.isEventKey(keydownEvent, "k") || keycode.isEventKey(keydownEvent, "Space");
  94768. } : _hotkeys$playPauseKey;
  94769. if (fullscreenKey.call(this, event2)) {
  94770. event2.preventDefault();
  94771. event2.stopPropagation();
  94772. var FSToggle = Component$1.getComponent("FullscreenToggle");
  94773. if (document_1[this.fsApi_.fullscreenEnabled] !== false) {
  94774. FSToggle.prototype.handleClick.call(this, event2);
  94775. }
  94776. } else if (muteKey.call(this, event2)) {
  94777. event2.preventDefault();
  94778. event2.stopPropagation();
  94779. var MuteToggle2 = Component$1.getComponent("MuteToggle");
  94780. MuteToggle2.prototype.handleClick.call(this, event2);
  94781. } else if (playPauseKey.call(this, event2)) {
  94782. event2.preventDefault();
  94783. event2.stopPropagation();
  94784. var PlayToggle2 = Component$1.getComponent("PlayToggle");
  94785. PlayToggle2.prototype.handleClick.call(this, event2);
  94786. }
  94787. };
  94788. _proto.canPlayType = function canPlayType3(type2) {
  94789. var can;
  94790. for (var i2 = 0, j = this.options_.techOrder; i2 < j.length; i2++) {
  94791. var techName = j[i2];
  94792. var tech = Tech$1.getTech(techName);
  94793. if (!tech) {
  94794. tech = Component$1.getComponent(techName);
  94795. }
  94796. if (!tech) {
  94797. log$1.error('The "' + techName + '" tech is undefined. Skipped browser support check for that tech.');
  94798. continue;
  94799. }
  94800. if (tech.isSupported()) {
  94801. can = tech.canPlayType(type2);
  94802. if (can) {
  94803. return can;
  94804. }
  94805. }
  94806. }
  94807. return "";
  94808. };
  94809. _proto.selectSource = function selectSource(sources) {
  94810. var _this14 = this;
  94811. var techs = this.options_.techOrder.map(function(techName) {
  94812. return [techName, Tech$1.getTech(techName)];
  94813. }).filter(function(_ref) {
  94814. var techName = _ref[0], tech = _ref[1];
  94815. if (tech) {
  94816. return tech.isSupported();
  94817. }
  94818. log$1.error('The "' + techName + '" tech is undefined. Skipped browser support check for that tech.');
  94819. return false;
  94820. });
  94821. var findFirstPassingTechSourcePair = function findFirstPassingTechSourcePair2(outerArray, innerArray, tester) {
  94822. var found;
  94823. outerArray.some(function(outerChoice) {
  94824. return innerArray.some(function(innerChoice) {
  94825. found = tester(outerChoice, innerChoice);
  94826. if (found) {
  94827. return true;
  94828. }
  94829. });
  94830. });
  94831. return found;
  94832. };
  94833. var foundSourceAndTech;
  94834. var flip = function flip2(fn2) {
  94835. return function(a, b) {
  94836. return fn2(b, a);
  94837. };
  94838. };
  94839. var finder = function finder2(_ref2, source) {
  94840. var techName = _ref2[0], tech = _ref2[1];
  94841. if (tech.canPlaySource(source, _this14.options_[techName.toLowerCase()])) {
  94842. return {
  94843. source,
  94844. tech: techName
  94845. };
  94846. }
  94847. };
  94848. if (this.options_.sourceOrder) {
  94849. foundSourceAndTech = findFirstPassingTechSourcePair(sources, techs, flip(finder));
  94850. } else {
  94851. foundSourceAndTech = findFirstPassingTechSourcePair(techs, sources, finder);
  94852. }
  94853. return foundSourceAndTech || false;
  94854. };
  94855. _proto.handleSrc_ = function handleSrc_(source, isRetry) {
  94856. var _this15 = this;
  94857. if (typeof source === "undefined") {
  94858. return this.cache_.src || "";
  94859. }
  94860. if (this.resetRetryOnError_) {
  94861. this.resetRetryOnError_();
  94862. }
  94863. var sources = filterSource(source);
  94864. if (!sources.length) {
  94865. this.setTimeout(function() {
  94866. this.error({
  94867. code: 4,
  94868. message: this.options_.notSupportedMessage
  94869. });
  94870. }, 0);
  94871. return;
  94872. }
  94873. this.changingSrc_ = true;
  94874. if (!isRetry) {
  94875. this.cache_.sources = sources;
  94876. }
  94877. this.updateSourceCaches_(sources[0]);
  94878. setSource(this, sources[0], function(middlewareSource, mws) {
  94879. _this15.middleware_ = mws;
  94880. if (!isRetry) {
  94881. _this15.cache_.sources = sources;
  94882. }
  94883. _this15.updateSourceCaches_(middlewareSource);
  94884. var err = _this15.src_(middlewareSource);
  94885. if (err) {
  94886. if (sources.length > 1) {
  94887. return _this15.handleSrc_(sources.slice(1));
  94888. }
  94889. _this15.changingSrc_ = false;
  94890. _this15.setTimeout(function() {
  94891. this.error({
  94892. code: 4,
  94893. message: this.options_.notSupportedMessage
  94894. });
  94895. }, 0);
  94896. _this15.triggerReady();
  94897. return;
  94898. }
  94899. setTech(mws, _this15.tech_);
  94900. });
  94901. if (this.options_.retryOnError && sources.length > 1) {
  94902. var retry = function retry2() {
  94903. _this15.error(null);
  94904. _this15.handleSrc_(sources.slice(1), true);
  94905. };
  94906. var stopListeningForErrors = function stopListeningForErrors2() {
  94907. _this15.off("error", retry);
  94908. };
  94909. this.one("error", retry);
  94910. this.one("playing", stopListeningForErrors);
  94911. this.resetRetryOnError_ = function() {
  94912. _this15.off("error", retry);
  94913. _this15.off("playing", stopListeningForErrors);
  94914. };
  94915. }
  94916. };
  94917. _proto.src = function src(source) {
  94918. return this.handleSrc_(source, false);
  94919. };
  94920. _proto.src_ = function src_(source) {
  94921. var _this16 = this;
  94922. var sourceTech = this.selectSource([source]);
  94923. if (!sourceTech) {
  94924. return true;
  94925. }
  94926. if (!titleCaseEquals(sourceTech.tech, this.techName_)) {
  94927. this.changingSrc_ = true;
  94928. this.loadTech_(sourceTech.tech, sourceTech.source);
  94929. this.tech_.ready(function() {
  94930. _this16.changingSrc_ = false;
  94931. });
  94932. return false;
  94933. }
  94934. this.ready(function() {
  94935. if (this.tech_.constructor.prototype.hasOwnProperty("setSource")) {
  94936. this.techCall_("setSource", source);
  94937. } else {
  94938. this.techCall_("src", source.src);
  94939. }
  94940. this.changingSrc_ = false;
  94941. }, true);
  94942. return false;
  94943. };
  94944. _proto.load = function load() {
  94945. this.techCall_("load");
  94946. };
  94947. _proto.reset = function reset3() {
  94948. var _this17 = this;
  94949. var PromiseClass = this.options_.Promise || window_1.Promise;
  94950. if (this.paused() || !PromiseClass) {
  94951. this.doReset_();
  94952. } else {
  94953. var playPromise = this.play();
  94954. silencePromise(playPromise.then(function() {
  94955. return _this17.doReset_();
  94956. }));
  94957. }
  94958. };
  94959. _proto.doReset_ = function doReset_() {
  94960. if (this.tech_) {
  94961. this.tech_.clearTracks("text");
  94962. }
  94963. this.resetCache_();
  94964. this.poster("");
  94965. this.loadTech_(this.options_.techOrder[0], null);
  94966. this.techCall_("reset");
  94967. this.resetControlBarUI_();
  94968. if (isEvented(this)) {
  94969. this.trigger("playerreset");
  94970. }
  94971. };
  94972. _proto.resetControlBarUI_ = function resetControlBarUI_() {
  94973. this.resetProgressBar_();
  94974. this.resetPlaybackRate_();
  94975. this.resetVolumeBar_();
  94976. };
  94977. _proto.resetProgressBar_ = function resetProgressBar_() {
  94978. this.currentTime(0);
  94979. var _ref3 = this.controlBar || {}, durationDisplay = _ref3.durationDisplay, remainingTimeDisplay = _ref3.remainingTimeDisplay;
  94980. if (durationDisplay) {
  94981. durationDisplay.updateContent();
  94982. }
  94983. if (remainingTimeDisplay) {
  94984. remainingTimeDisplay.updateContent();
  94985. }
  94986. };
  94987. _proto.resetPlaybackRate_ = function resetPlaybackRate_() {
  94988. this.playbackRate(this.defaultPlaybackRate());
  94989. this.handleTechRateChange_();
  94990. };
  94991. _proto.resetVolumeBar_ = function resetVolumeBar_() {
  94992. this.volume(1);
  94993. this.trigger("volumechange");
  94994. };
  94995. _proto.currentSources = function currentSources() {
  94996. var source = this.currentSource();
  94997. var sources = [];
  94998. if (Object.keys(source).length !== 0) {
  94999. sources.push(source);
  95000. }
  95001. return this.cache_.sources || sources;
  95002. };
  95003. _proto.currentSource = function currentSource() {
  95004. return this.cache_.source || {};
  95005. };
  95006. _proto.currentSrc = function currentSrc() {
  95007. return this.currentSource() && this.currentSource().src || "";
  95008. };
  95009. _proto.currentType = function currentType() {
  95010. return this.currentSource() && this.currentSource().type || "";
  95011. };
  95012. _proto.preload = function preload(value) {
  95013. if (value !== void 0) {
  95014. this.techCall_("setPreload", value);
  95015. this.options_.preload = value;
  95016. return;
  95017. }
  95018. return this.techGet_("preload");
  95019. };
  95020. _proto.autoplay = function autoplay(value) {
  95021. if (value === void 0) {
  95022. return this.options_.autoplay || false;
  95023. }
  95024. var techAutoplay;
  95025. if (typeof value === "string" && /(any|play|muted)/.test(value) || value === true && this.options_.normalizeAutoplay) {
  95026. this.options_.autoplay = value;
  95027. this.manualAutoplay_(typeof value === "string" ? value : "play");
  95028. techAutoplay = false;
  95029. } else if (!value) {
  95030. this.options_.autoplay = false;
  95031. } else {
  95032. this.options_.autoplay = true;
  95033. }
  95034. techAutoplay = typeof techAutoplay === "undefined" ? this.options_.autoplay : techAutoplay;
  95035. if (this.tech_) {
  95036. this.techCall_("setAutoplay", techAutoplay);
  95037. }
  95038. };
  95039. _proto.playsinline = function playsinline(value) {
  95040. if (value !== void 0) {
  95041. this.techCall_("setPlaysinline", value);
  95042. this.options_.playsinline = value;
  95043. return this;
  95044. }
  95045. return this.techGet_("playsinline");
  95046. };
  95047. _proto.loop = function loop(value) {
  95048. if (value !== void 0) {
  95049. this.techCall_("setLoop", value);
  95050. this.options_.loop = value;
  95051. return;
  95052. }
  95053. return this.techGet_("loop");
  95054. };
  95055. _proto.poster = function poster(src) {
  95056. if (src === void 0) {
  95057. return this.poster_;
  95058. }
  95059. if (!src) {
  95060. src = "";
  95061. }
  95062. if (src === this.poster_) {
  95063. return;
  95064. }
  95065. this.poster_ = src;
  95066. this.techCall_("setPoster", src);
  95067. this.isPosterFromTech_ = false;
  95068. this.trigger("posterchange");
  95069. };
  95070. _proto.handleTechPosterChange_ = function handleTechPosterChange_() {
  95071. if ((!this.poster_ || this.options_.techCanOverridePoster) && this.tech_ && this.tech_.poster) {
  95072. var newPoster = this.tech_.poster() || "";
  95073. if (newPoster !== this.poster_) {
  95074. this.poster_ = newPoster;
  95075. this.isPosterFromTech_ = true;
  95076. this.trigger("posterchange");
  95077. }
  95078. }
  95079. };
  95080. _proto.controls = function controls(bool) {
  95081. if (bool === void 0) {
  95082. return !!this.controls_;
  95083. }
  95084. bool = !!bool;
  95085. if (this.controls_ === bool) {
  95086. return;
  95087. }
  95088. this.controls_ = bool;
  95089. if (this.usingNativeControls()) {
  95090. this.techCall_("setControls", bool);
  95091. }
  95092. if (this.controls_) {
  95093. this.removeClass("vjs-controls-disabled");
  95094. this.addClass("vjs-controls-enabled");
  95095. this.trigger("controlsenabled");
  95096. if (!this.usingNativeControls()) {
  95097. this.addTechControlsListeners_();
  95098. }
  95099. } else {
  95100. this.removeClass("vjs-controls-enabled");
  95101. this.addClass("vjs-controls-disabled");
  95102. this.trigger("controlsdisabled");
  95103. if (!this.usingNativeControls()) {
  95104. this.removeTechControlsListeners_();
  95105. }
  95106. }
  95107. };
  95108. _proto.usingNativeControls = function usingNativeControls(bool) {
  95109. if (bool === void 0) {
  95110. return !!this.usingNativeControls_;
  95111. }
  95112. bool = !!bool;
  95113. if (this.usingNativeControls_ === bool) {
  95114. return;
  95115. }
  95116. this.usingNativeControls_ = bool;
  95117. if (this.usingNativeControls_) {
  95118. this.addClass("vjs-using-native-controls");
  95119. this.trigger("usingnativecontrols");
  95120. } else {
  95121. this.removeClass("vjs-using-native-controls");
  95122. this.trigger("usingcustomcontrols");
  95123. }
  95124. };
  95125. _proto.error = function error(err) {
  95126. var _this18 = this;
  95127. if (err === void 0) {
  95128. return this.error_ || null;
  95129. }
  95130. hooks("beforeerror").forEach(function(hookFunction) {
  95131. var newErr = hookFunction(_this18, err);
  95132. if (!(isObject2(newErr) && !Array.isArray(newErr) || typeof newErr === "string" || typeof newErr === "number" || newErr === null)) {
  95133. _this18.log.error("please return a value that MediaError expects in beforeerror hooks");
  95134. return;
  95135. }
  95136. err = newErr;
  95137. });
  95138. if (this.options_.suppressNotSupportedError && err && err.code === 4) {
  95139. var triggerSuppressedError = function triggerSuppressedError2() {
  95140. this.error(err);
  95141. };
  95142. this.options_.suppressNotSupportedError = false;
  95143. this.any(["click", "touchstart"], triggerSuppressedError);
  95144. this.one("loadstart", function() {
  95145. this.off(["click", "touchstart"], triggerSuppressedError);
  95146. });
  95147. return;
  95148. }
  95149. if (err === null) {
  95150. this.error_ = err;
  95151. this.removeClass("vjs-error");
  95152. if (this.errorDisplay) {
  95153. this.errorDisplay.close();
  95154. }
  95155. return;
  95156. }
  95157. this.error_ = new MediaError(err);
  95158. this.addClass("vjs-error");
  95159. log$1.error("(CODE:" + this.error_.code + " " + MediaError.errorTypes[this.error_.code] + ")", this.error_.message, this.error_);
  95160. this.trigger("error");
  95161. hooks("error").forEach(function(hookFunction) {
  95162. return hookFunction(_this18, _this18.error_);
  95163. });
  95164. return;
  95165. };
  95166. _proto.reportUserActivity = function reportUserActivity(event2) {
  95167. this.userActivity_ = true;
  95168. };
  95169. _proto.userActive = function userActive(bool) {
  95170. if (bool === void 0) {
  95171. return this.userActive_;
  95172. }
  95173. bool = !!bool;
  95174. if (bool === this.userActive_) {
  95175. return;
  95176. }
  95177. this.userActive_ = bool;
  95178. if (this.userActive_) {
  95179. this.userActivity_ = true;
  95180. this.removeClass("vjs-user-inactive");
  95181. this.addClass("vjs-user-active");
  95182. this.trigger("useractive");
  95183. return;
  95184. }
  95185. if (this.tech_) {
  95186. this.tech_.one("mousemove", function(e) {
  95187. e.stopPropagation();
  95188. e.preventDefault();
  95189. });
  95190. }
  95191. this.userActivity_ = false;
  95192. this.removeClass("vjs-user-active");
  95193. this.addClass("vjs-user-inactive");
  95194. this.trigger("userinactive");
  95195. };
  95196. _proto.listenForUserActivity_ = function listenForUserActivity_() {
  95197. var mouseInProgress;
  95198. var lastMoveX;
  95199. var lastMoveY;
  95200. var handleActivity = bind(this, this.reportUserActivity);
  95201. var handleMouseMove = function handleMouseMove2(e) {
  95202. if (e.screenX !== lastMoveX || e.screenY !== lastMoveY) {
  95203. lastMoveX = e.screenX;
  95204. lastMoveY = e.screenY;
  95205. handleActivity();
  95206. }
  95207. };
  95208. var handleMouseDown = function handleMouseDown2() {
  95209. handleActivity();
  95210. this.clearInterval(mouseInProgress);
  95211. mouseInProgress = this.setInterval(handleActivity, 250);
  95212. };
  95213. var handleMouseUpAndMouseLeave = function handleMouseUpAndMouseLeave2(event2) {
  95214. handleActivity();
  95215. this.clearInterval(mouseInProgress);
  95216. };
  95217. this.on("mousedown", handleMouseDown);
  95218. this.on("mousemove", handleMouseMove);
  95219. this.on("mouseup", handleMouseUpAndMouseLeave);
  95220. this.on("mouseleave", handleMouseUpAndMouseLeave);
  95221. var controlBar = this.getChild("controlBar");
  95222. if (controlBar && !IS_IOS && !IS_ANDROID) {
  95223. controlBar.on("mouseenter", function(event2) {
  95224. if (this.player().options_.inactivityTimeout !== 0) {
  95225. this.player().cache_.inactivityTimeout = this.player().options_.inactivityTimeout;
  95226. }
  95227. this.player().options_.inactivityTimeout = 0;
  95228. });
  95229. controlBar.on("mouseleave", function(event2) {
  95230. this.player().options_.inactivityTimeout = this.player().cache_.inactivityTimeout;
  95231. });
  95232. }
  95233. this.on("keydown", handleActivity);
  95234. this.on("keyup", handleActivity);
  95235. var inactivityTimeout;
  95236. this.setInterval(function() {
  95237. if (!this.userActivity_) {
  95238. return;
  95239. }
  95240. this.userActivity_ = false;
  95241. this.userActive(true);
  95242. this.clearTimeout(inactivityTimeout);
  95243. var timeout = this.options_.inactivityTimeout;
  95244. if (timeout <= 0) {
  95245. return;
  95246. }
  95247. inactivityTimeout = this.setTimeout(function() {
  95248. if (!this.userActivity_) {
  95249. this.userActive(false);
  95250. }
  95251. }, timeout);
  95252. }, 250);
  95253. };
  95254. _proto.playbackRate = function playbackRate(rate) {
  95255. if (rate !== void 0) {
  95256. this.techCall_("setPlaybackRate", rate);
  95257. return;
  95258. }
  95259. if (this.tech_ && this.tech_.featuresPlaybackRate) {
  95260. return this.cache_.lastPlaybackRate || this.techGet_("playbackRate");
  95261. }
  95262. return 1;
  95263. };
  95264. _proto.defaultPlaybackRate = function defaultPlaybackRate(rate) {
  95265. if (rate !== void 0) {
  95266. return this.techCall_("setDefaultPlaybackRate", rate);
  95267. }
  95268. if (this.tech_ && this.tech_.featuresPlaybackRate) {
  95269. return this.techGet_("defaultPlaybackRate");
  95270. }
  95271. return 1;
  95272. };
  95273. _proto.isAudio = function isAudio(bool) {
  95274. if (bool !== void 0) {
  95275. this.isAudio_ = !!bool;
  95276. return;
  95277. }
  95278. return !!this.isAudio_;
  95279. };
  95280. _proto.enableAudioOnlyUI_ = function enableAudioOnlyUI_() {
  95281. var _this19 = this;
  95282. this.addClass("vjs-audio-only-mode");
  95283. var playerChildren = this.children();
  95284. var controlBar = this.getChild("ControlBar");
  95285. var controlBarHeight = controlBar && controlBar.currentHeight();
  95286. playerChildren.forEach(function(child) {
  95287. if (child === controlBar) {
  95288. return;
  95289. }
  95290. if (child.el_ && !child.hasClass("vjs-hidden")) {
  95291. child.hide();
  95292. _this19.audioOnlyCache_.hiddenChildren.push(child);
  95293. }
  95294. });
  95295. this.audioOnlyCache_.playerHeight = this.currentHeight();
  95296. this.height(controlBarHeight);
  95297. this.trigger("audioonlymodechange");
  95298. };
  95299. _proto.disableAudioOnlyUI_ = function disableAudioOnlyUI_() {
  95300. this.removeClass("vjs-audio-only-mode");
  95301. this.audioOnlyCache_.hiddenChildren.forEach(function(child) {
  95302. return child.show();
  95303. });
  95304. this.height(this.audioOnlyCache_.playerHeight);
  95305. this.trigger("audioonlymodechange");
  95306. };
  95307. _proto.audioOnlyMode = function audioOnlyMode(value) {
  95308. var _this20 = this;
  95309. if (typeof value !== "boolean" || value === this.audioOnlyMode_) {
  95310. return this.audioOnlyMode_;
  95311. }
  95312. this.audioOnlyMode_ = value;
  95313. var PromiseClass = this.options_.Promise || window_1.Promise;
  95314. if (PromiseClass) {
  95315. if (value) {
  95316. var exitPromises = [];
  95317. if (this.isInPictureInPicture()) {
  95318. exitPromises.push(this.exitPictureInPicture());
  95319. }
  95320. if (this.isFullscreen()) {
  95321. exitPromises.push(this.exitFullscreen());
  95322. }
  95323. if (this.audioPosterMode()) {
  95324. exitPromises.push(this.audioPosterMode(false));
  95325. }
  95326. return PromiseClass.all(exitPromises).then(function() {
  95327. return _this20.enableAudioOnlyUI_();
  95328. });
  95329. }
  95330. return PromiseClass.resolve().then(function() {
  95331. return _this20.disableAudioOnlyUI_();
  95332. });
  95333. }
  95334. if (value) {
  95335. if (this.isInPictureInPicture()) {
  95336. this.exitPictureInPicture();
  95337. }
  95338. if (this.isFullscreen()) {
  95339. this.exitFullscreen();
  95340. }
  95341. this.enableAudioOnlyUI_();
  95342. } else {
  95343. this.disableAudioOnlyUI_();
  95344. }
  95345. };
  95346. _proto.enablePosterModeUI_ = function enablePosterModeUI_() {
  95347. var tech = this.tech_ && this.tech_;
  95348. tech.hide();
  95349. this.addClass("vjs-audio-poster-mode");
  95350. this.trigger("audiopostermodechange");
  95351. };
  95352. _proto.disablePosterModeUI_ = function disablePosterModeUI_() {
  95353. var tech = this.tech_ && this.tech_;
  95354. tech.show();
  95355. this.removeClass("vjs-audio-poster-mode");
  95356. this.trigger("audiopostermodechange");
  95357. };
  95358. _proto.audioPosterMode = function audioPosterMode(value) {
  95359. var _this21 = this;
  95360. if (typeof value !== "boolean" || value === this.audioPosterMode_) {
  95361. return this.audioPosterMode_;
  95362. }
  95363. this.audioPosterMode_ = value;
  95364. var PromiseClass = this.options_.Promise || window_1.Promise;
  95365. if (PromiseClass) {
  95366. if (value) {
  95367. if (this.audioOnlyMode()) {
  95368. var audioOnlyModePromise = this.audioOnlyMode(false);
  95369. return audioOnlyModePromise.then(function() {
  95370. _this21.enablePosterModeUI_();
  95371. });
  95372. }
  95373. return PromiseClass.resolve().then(function() {
  95374. _this21.enablePosterModeUI_();
  95375. });
  95376. }
  95377. return PromiseClass.resolve().then(function() {
  95378. _this21.disablePosterModeUI_();
  95379. });
  95380. }
  95381. if (value) {
  95382. if (this.audioOnlyMode()) {
  95383. this.audioOnlyMode(false);
  95384. }
  95385. this.enablePosterModeUI_();
  95386. return;
  95387. }
  95388. this.disablePosterModeUI_();
  95389. };
  95390. _proto.addTextTrack = function addTextTrack(kind, label, language) {
  95391. if (this.tech_) {
  95392. return this.tech_.addTextTrack(kind, label, language);
  95393. }
  95394. };
  95395. _proto.addRemoteTextTrack = function addRemoteTextTrack(options2, manualCleanup) {
  95396. if (this.tech_) {
  95397. return this.tech_.addRemoteTextTrack(options2, manualCleanup);
  95398. }
  95399. };
  95400. _proto.removeRemoteTextTrack = function removeRemoteTextTrack(obj) {
  95401. if (obj === void 0) {
  95402. obj = {};
  95403. }
  95404. var _obj = obj, track = _obj.track;
  95405. if (!track) {
  95406. track = obj;
  95407. }
  95408. if (this.tech_) {
  95409. return this.tech_.removeRemoteTextTrack(track);
  95410. }
  95411. };
  95412. _proto.getVideoPlaybackQuality = function getVideoPlaybackQuality() {
  95413. return this.techGet_("getVideoPlaybackQuality");
  95414. };
  95415. _proto.videoWidth = function videoWidth() {
  95416. return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0;
  95417. };
  95418. _proto.videoHeight = function videoHeight() {
  95419. return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0;
  95420. };
  95421. _proto.language = function language(code) {
  95422. if (code === void 0) {
  95423. return this.language_;
  95424. }
  95425. if (this.language_ !== String(code).toLowerCase()) {
  95426. this.language_ = String(code).toLowerCase();
  95427. if (isEvented(this)) {
  95428. this.trigger("languagechange");
  95429. }
  95430. }
  95431. };
  95432. _proto.languages = function languages() {
  95433. return mergeOptions$3(Player2.prototype.options_.languages, this.languages_);
  95434. };
  95435. _proto.toJSON = function toJSON() {
  95436. var options2 = mergeOptions$3(this.options_);
  95437. var tracks = options2.tracks;
  95438. options2.tracks = [];
  95439. for (var i2 = 0; i2 < tracks.length; i2++) {
  95440. var track = tracks[i2];
  95441. track = mergeOptions$3(track);
  95442. track.player = void 0;
  95443. options2.tracks[i2] = track;
  95444. }
  95445. return options2;
  95446. };
  95447. _proto.createModal = function createModal(content, options2) {
  95448. var _this22 = this;
  95449. options2 = options2 || {};
  95450. options2.content = content || "";
  95451. var modal = new ModalDialog(this, options2);
  95452. this.addChild(modal);
  95453. modal.on("dispose", function() {
  95454. _this22.removeChild(modal);
  95455. });
  95456. modal.open();
  95457. return modal;
  95458. };
  95459. _proto.updateCurrentBreakpoint_ = function updateCurrentBreakpoint_() {
  95460. if (!this.responsive()) {
  95461. return;
  95462. }
  95463. var currentBreakpoint = this.currentBreakpoint();
  95464. var currentWidth = this.currentWidth();
  95465. for (var i2 = 0; i2 < BREAKPOINT_ORDER.length; i2++) {
  95466. var candidateBreakpoint = BREAKPOINT_ORDER[i2];
  95467. var maxWidth = this.breakpoints_[candidateBreakpoint];
  95468. if (currentWidth <= maxWidth) {
  95469. if (currentBreakpoint === candidateBreakpoint) {
  95470. return;
  95471. }
  95472. if (currentBreakpoint) {
  95473. this.removeClass(BREAKPOINT_CLASSES[currentBreakpoint]);
  95474. }
  95475. this.addClass(BREAKPOINT_CLASSES[candidateBreakpoint]);
  95476. this.breakpoint_ = candidateBreakpoint;
  95477. break;
  95478. }
  95479. }
  95480. };
  95481. _proto.removeCurrentBreakpoint_ = function removeCurrentBreakpoint_() {
  95482. var className = this.currentBreakpointClass();
  95483. this.breakpoint_ = "";
  95484. if (className) {
  95485. this.removeClass(className);
  95486. }
  95487. };
  95488. _proto.breakpoints = function breakpoints(_breakpoints) {
  95489. if (_breakpoints === void 0) {
  95490. return assign(this.breakpoints_);
  95491. }
  95492. this.breakpoint_ = "";
  95493. this.breakpoints_ = assign({}, DEFAULT_BREAKPOINTS, _breakpoints);
  95494. this.updateCurrentBreakpoint_();
  95495. return assign(this.breakpoints_);
  95496. };
  95497. _proto.responsive = function responsive(value) {
  95498. if (value === void 0) {
  95499. return this.responsive_;
  95500. }
  95501. value = Boolean(value);
  95502. var current = this.responsive_;
  95503. if (value === current) {
  95504. return;
  95505. }
  95506. this.responsive_ = value;
  95507. if (value) {
  95508. this.on("playerresize", this.boundUpdateCurrentBreakpoint_);
  95509. this.updateCurrentBreakpoint_();
  95510. } else {
  95511. this.off("playerresize", this.boundUpdateCurrentBreakpoint_);
  95512. this.removeCurrentBreakpoint_();
  95513. }
  95514. return value;
  95515. };
  95516. _proto.currentBreakpoint = function currentBreakpoint() {
  95517. return this.breakpoint_;
  95518. };
  95519. _proto.currentBreakpointClass = function currentBreakpointClass() {
  95520. return BREAKPOINT_CLASSES[this.breakpoint_] || "";
  95521. };
  95522. _proto.loadMedia = function loadMedia(media, ready) {
  95523. var _this23 = this;
  95524. if (!media || typeof media !== "object") {
  95525. return;
  95526. }
  95527. this.reset();
  95528. this.cache_.media = mergeOptions$3(media);
  95529. var _this$cache_$media = this.cache_.media, artwork = _this$cache_$media.artwork, poster = _this$cache_$media.poster, src = _this$cache_$media.src, textTracks = _this$cache_$media.textTracks;
  95530. if (!artwork && poster) {
  95531. this.cache_.media.artwork = [{
  95532. src: poster,
  95533. type: getMimetype(poster)
  95534. }];
  95535. }
  95536. if (src) {
  95537. this.src(src);
  95538. }
  95539. if (poster) {
  95540. this.poster(poster);
  95541. }
  95542. if (Array.isArray(textTracks)) {
  95543. textTracks.forEach(function(tt2) {
  95544. return _this23.addRemoteTextTrack(tt2, false);
  95545. });
  95546. }
  95547. this.ready(ready);
  95548. };
  95549. _proto.getMedia = function getMedia() {
  95550. if (!this.cache_.media) {
  95551. var poster = this.poster();
  95552. var src = this.currentSources();
  95553. var textTracks = Array.prototype.map.call(this.remoteTextTracks(), function(tt2) {
  95554. return {
  95555. kind: tt2.kind,
  95556. label: tt2.label,
  95557. language: tt2.language,
  95558. src: tt2.src
  95559. };
  95560. });
  95561. var media = {
  95562. src,
  95563. textTracks
  95564. };
  95565. if (poster) {
  95566. media.poster = poster;
  95567. media.artwork = [{
  95568. src: media.poster,
  95569. type: getMimetype(media.poster)
  95570. }];
  95571. }
  95572. return media;
  95573. }
  95574. return mergeOptions$3(this.cache_.media);
  95575. };
  95576. Player2.getTagSettings = function getTagSettings(tag) {
  95577. var baseOptions = {
  95578. sources: [],
  95579. tracks: []
  95580. };
  95581. var tagOptions = getAttributes(tag);
  95582. var dataSetup = tagOptions["data-setup"];
  95583. if (hasClass(tag, "vjs-fill")) {
  95584. tagOptions.fill = true;
  95585. }
  95586. if (hasClass(tag, "vjs-fluid")) {
  95587. tagOptions.fluid = true;
  95588. }
  95589. if (dataSetup !== null) {
  95590. var _safeParseTuple = tuple(dataSetup || "{}"), err = _safeParseTuple[0], data = _safeParseTuple[1];
  95591. if (err) {
  95592. log$1.error(err);
  95593. }
  95594. assign(tagOptions, data);
  95595. }
  95596. assign(baseOptions, tagOptions);
  95597. if (tag.hasChildNodes()) {
  95598. var children = tag.childNodes;
  95599. for (var i2 = 0, j = children.length; i2 < j; i2++) {
  95600. var child = children[i2];
  95601. var childName = child.nodeName.toLowerCase();
  95602. if (childName === "source") {
  95603. baseOptions.sources.push(getAttributes(child));
  95604. } else if (childName === "track") {
  95605. baseOptions.tracks.push(getAttributes(child));
  95606. }
  95607. }
  95608. }
  95609. return baseOptions;
  95610. };
  95611. _proto.flexNotSupported_ = function flexNotSupported_() {
  95612. var elem = document_1.createElement("i");
  95613. return !("flexBasis" in elem.style || "webkitFlexBasis" in elem.style || "mozFlexBasis" in elem.style || "msFlexBasis" in elem.style || "msFlexOrder" in elem.style);
  95614. };
  95615. _proto.debug = function debug(enabled) {
  95616. if (enabled === void 0) {
  95617. return this.debugEnabled_;
  95618. }
  95619. if (enabled) {
  95620. this.trigger("debugon");
  95621. this.previousLogLevel_ = this.log.level;
  95622. this.log.level("debug");
  95623. this.debugEnabled_ = true;
  95624. } else {
  95625. this.trigger("debugoff");
  95626. this.log.level(this.previousLogLevel_);
  95627. this.previousLogLevel_ = void 0;
  95628. this.debugEnabled_ = false;
  95629. }
  95630. };
  95631. _proto.playbackRates = function playbackRates(newRates) {
  95632. if (newRates === void 0) {
  95633. return this.cache_.playbackRates;
  95634. }
  95635. if (!Array.isArray(newRates)) {
  95636. return;
  95637. }
  95638. if (!newRates.every(function(rate) {
  95639. return typeof rate === "number";
  95640. })) {
  95641. return;
  95642. }
  95643. this.cache_.playbackRates = newRates;
  95644. this.trigger("playbackrateschange");
  95645. };
  95646. return Player2;
  95647. }(Component$1);
  95648. ALL.names.forEach(function(name) {
  95649. var props = ALL[name];
  95650. Player.prototype[props.getterName] = function() {
  95651. if (this.tech_) {
  95652. return this.tech_[props.getterName]();
  95653. }
  95654. this[props.privateName] = this[props.privateName] || new props.ListClass();
  95655. return this[props.privateName];
  95656. };
  95657. });
  95658. Player.prototype.crossorigin = Player.prototype.crossOrigin;
  95659. Player.players = {};
  95660. var navigator$2 = window_1.navigator;
  95661. Player.prototype.options_ = {
  95662. techOrder: Tech$1.defaultTechOrder_,
  95663. html5: {},
  95664. inactivityTimeout: 2e3,
  95665. playbackRates: [],
  95666. liveui: false,
  95667. children: ["mediaLoader", "posterImage", "textTrackDisplay", "loadingSpinner", "bigPlayButton", "liveTracker", "controlBar", "errorDisplay", "textTrackSettings", "resizeManager"],
  95668. language: navigator$2 && (navigator$2.languages && navigator$2.languages[0] || navigator$2.userLanguage || navigator$2.language) || "en",
  95669. languages: {},
  95670. notSupportedMessage: "No compatible source was found for this media.",
  95671. normalizeAutoplay: false,
  95672. fullscreen: {
  95673. options: {
  95674. navigationUI: "hide"
  95675. }
  95676. },
  95677. breakpoints: {},
  95678. responsive: false,
  95679. audioOnlyMode: false,
  95680. audioPosterMode: false
  95681. };
  95682. [
  95683. "ended",
  95684. "seeking",
  95685. "seekable",
  95686. "networkState",
  95687. "readyState"
  95688. ].forEach(function(fn2) {
  95689. Player.prototype[fn2] = function() {
  95690. return this.techGet_(fn2);
  95691. };
  95692. });
  95693. TECH_EVENTS_RETRIGGER.forEach(function(event2) {
  95694. Player.prototype["handleTech" + toTitleCase$1(event2) + "_"] = function() {
  95695. return this.trigger(event2);
  95696. };
  95697. });
  95698. Component$1.registerComponent("Player", Player);
  95699. var BASE_PLUGIN_NAME = "plugin";
  95700. var PLUGIN_CACHE_KEY = "activePlugins_";
  95701. var pluginStorage = {};
  95702. var pluginExists = function pluginExists2(name) {
  95703. return pluginStorage.hasOwnProperty(name);
  95704. };
  95705. var getPlugin = function getPlugin2(name) {
  95706. return pluginExists(name) ? pluginStorage[name] : void 0;
  95707. };
  95708. var markPluginAsActive = function markPluginAsActive2(player, name) {
  95709. player[PLUGIN_CACHE_KEY] = player[PLUGIN_CACHE_KEY] || {};
  95710. player[PLUGIN_CACHE_KEY][name] = true;
  95711. };
  95712. var triggerSetupEvent = function triggerSetupEvent2(player, hash, before) {
  95713. var eventName = (before ? "before" : "") + "pluginsetup";
  95714. player.trigger(eventName, hash);
  95715. player.trigger(eventName + ":" + hash.name, hash);
  95716. };
  95717. var createBasicPlugin = function createBasicPlugin2(name, plugin) {
  95718. var basicPluginWrapper = function basicPluginWrapper2() {
  95719. triggerSetupEvent(this, {
  95720. name,
  95721. plugin,
  95722. instance: null
  95723. }, true);
  95724. var instance = plugin.apply(this, arguments);
  95725. markPluginAsActive(this, name);
  95726. triggerSetupEvent(this, {
  95727. name,
  95728. plugin,
  95729. instance
  95730. });
  95731. return instance;
  95732. };
  95733. Object.keys(plugin).forEach(function(prop) {
  95734. basicPluginWrapper[prop] = plugin[prop];
  95735. });
  95736. return basicPluginWrapper;
  95737. };
  95738. var createPluginFactory = function createPluginFactory2(name, PluginSubClass) {
  95739. PluginSubClass.prototype.name = name;
  95740. return function() {
  95741. triggerSetupEvent(this, {
  95742. name,
  95743. plugin: PluginSubClass,
  95744. instance: null
  95745. }, true);
  95746. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  95747. args[_key] = arguments[_key];
  95748. }
  95749. var instance = _construct(PluginSubClass, [this].concat(args));
  95750. this[name] = function() {
  95751. return instance;
  95752. };
  95753. triggerSetupEvent(this, instance.getEventHash());
  95754. return instance;
  95755. };
  95756. };
  95757. var Plugin = /* @__PURE__ */ function() {
  95758. function Plugin2(player) {
  95759. if (this.constructor === Plugin2) {
  95760. throw new Error("Plugin must be sub-classed; not directly instantiated.");
  95761. }
  95762. this.player = player;
  95763. if (!this.log) {
  95764. this.log = this.player.log.createLogger(this.name);
  95765. }
  95766. evented(this);
  95767. delete this.trigger;
  95768. stateful(this, this.constructor.defaultState);
  95769. markPluginAsActive(player, this.name);
  95770. this.dispose = this.dispose.bind(this);
  95771. player.on("dispose", this.dispose);
  95772. }
  95773. var _proto = Plugin2.prototype;
  95774. _proto.version = function version2() {
  95775. return this.constructor.VERSION;
  95776. };
  95777. _proto.getEventHash = function getEventHash(hash) {
  95778. if (hash === void 0) {
  95779. hash = {};
  95780. }
  95781. hash.name = this.name;
  95782. hash.plugin = this.constructor;
  95783. hash.instance = this;
  95784. return hash;
  95785. };
  95786. _proto.trigger = function trigger$13(event2, hash) {
  95787. if (hash === void 0) {
  95788. hash = {};
  95789. }
  95790. return trigger(this.eventBusEl_, event2, this.getEventHash(hash));
  95791. };
  95792. _proto.handleStateChanged = function handleStateChanged(e) {
  95793. };
  95794. _proto.dispose = function dispose() {
  95795. var name = this.name, player = this.player;
  95796. this.trigger("dispose");
  95797. this.off();
  95798. player.off("dispose", this.dispose);
  95799. player[PLUGIN_CACHE_KEY][name] = false;
  95800. this.player = this.state = null;
  95801. player[name] = createPluginFactory(name, pluginStorage[name]);
  95802. };
  95803. Plugin2.isBasic = function isBasic(plugin) {
  95804. var p = typeof plugin === "string" ? getPlugin(plugin) : plugin;
  95805. return typeof p === "function" && !Plugin2.prototype.isPrototypeOf(p.prototype);
  95806. };
  95807. Plugin2.registerPlugin = function registerPlugin(name, plugin) {
  95808. if (typeof name !== "string") {
  95809. throw new Error('Illegal plugin name, "' + name + '", must be a string, was ' + typeof name + ".");
  95810. }
  95811. if (pluginExists(name)) {
  95812. log$1.warn('A plugin named "' + name + '" already exists. You may want to avoid re-registering plugins!');
  95813. } else if (Player.prototype.hasOwnProperty(name)) {
  95814. throw new Error('Illegal plugin name, "' + name + '", cannot share a name with an existing player method!');
  95815. }
  95816. if (typeof plugin !== "function") {
  95817. throw new Error('Illegal plugin for "' + name + '", must be a function, was ' + typeof plugin + ".");
  95818. }
  95819. pluginStorage[name] = plugin;
  95820. if (name !== BASE_PLUGIN_NAME) {
  95821. if (Plugin2.isBasic(plugin)) {
  95822. Player.prototype[name] = createBasicPlugin(name, plugin);
  95823. } else {
  95824. Player.prototype[name] = createPluginFactory(name, plugin);
  95825. }
  95826. }
  95827. return plugin;
  95828. };
  95829. Plugin2.deregisterPlugin = function deregisterPlugin(name) {
  95830. if (name === BASE_PLUGIN_NAME) {
  95831. throw new Error("Cannot de-register base plugin.");
  95832. }
  95833. if (pluginExists(name)) {
  95834. delete pluginStorage[name];
  95835. delete Player.prototype[name];
  95836. }
  95837. };
  95838. Plugin2.getPlugins = function getPlugins(names2) {
  95839. if (names2 === void 0) {
  95840. names2 = Object.keys(pluginStorage);
  95841. }
  95842. var result;
  95843. names2.forEach(function(name) {
  95844. var plugin = getPlugin(name);
  95845. if (plugin) {
  95846. result = result || {};
  95847. result[name] = plugin;
  95848. }
  95849. });
  95850. return result;
  95851. };
  95852. Plugin2.getPluginVersion = function getPluginVersion(name) {
  95853. var plugin = getPlugin(name);
  95854. return plugin && plugin.VERSION || "";
  95855. };
  95856. return Plugin2;
  95857. }();
  95858. Plugin.getPlugin = getPlugin;
  95859. Plugin.BASE_PLUGIN_NAME = BASE_PLUGIN_NAME;
  95860. Plugin.registerPlugin(BASE_PLUGIN_NAME, Plugin);
  95861. Player.prototype.usingPlugin = function(name) {
  95862. return !!this[PLUGIN_CACHE_KEY] && this[PLUGIN_CACHE_KEY][name] === true;
  95863. };
  95864. Player.prototype.hasPlugin = function(name) {
  95865. return !!pluginExists(name);
  95866. };
  95867. var hasLogged = false;
  95868. var extend = function extend2(superClass, subClassMethods) {
  95869. if (subClassMethods === void 0) {
  95870. subClassMethods = {};
  95871. }
  95872. if (!hasLogged) {
  95873. log$1.warn("videojs.extend is deprecated as of Video.js 7.22.0 and will be removed in Video.js 8.0.0");
  95874. hasLogged = true;
  95875. }
  95876. var subClass = function subClass2() {
  95877. superClass.apply(this, arguments);
  95878. };
  95879. var methods = {};
  95880. if (typeof subClassMethods === "object") {
  95881. if (subClassMethods.constructor !== Object.prototype.constructor) {
  95882. subClass = subClassMethods.constructor;
  95883. }
  95884. methods = subClassMethods;
  95885. } else if (typeof subClassMethods === "function") {
  95886. subClass = subClassMethods;
  95887. }
  95888. _inherits(subClass, superClass);
  95889. if (superClass) {
  95890. subClass.super_ = superClass;
  95891. }
  95892. for (var name in methods) {
  95893. if (methods.hasOwnProperty(name)) {
  95894. subClass.prototype[name] = methods[name];
  95895. }
  95896. }
  95897. return subClass;
  95898. };
  95899. var normalizeId = function normalizeId2(id) {
  95900. return id.indexOf("#") === 0 ? id.slice(1) : id;
  95901. };
  95902. function videojs(id, options2, ready) {
  95903. var player = videojs.getPlayer(id);
  95904. if (player) {
  95905. if (options2) {
  95906. log$1.warn('Player "' + id + '" is already initialised. Options will not be applied.');
  95907. }
  95908. if (ready) {
  95909. player.ready(ready);
  95910. }
  95911. return player;
  95912. }
  95913. var el = typeof id === "string" ? $("#" + normalizeId(id)) : id;
  95914. if (!isEl(el)) {
  95915. throw new TypeError("The element or ID supplied is not valid. (videojs)");
  95916. }
  95917. if (!el.ownerDocument.defaultView || !el.ownerDocument.body.contains(el)) {
  95918. log$1.warn("The element supplied is not included in the DOM");
  95919. }
  95920. options2 = options2 || {};
  95921. if (options2.restoreEl === true) {
  95922. options2.restoreEl = (el.parentNode && el.parentNode.hasAttribute("data-vjs-player") ? el.parentNode : el).cloneNode(true);
  95923. }
  95924. hooks("beforesetup").forEach(function(hookFunction) {
  95925. var opts = hookFunction(el, mergeOptions$3(options2));
  95926. if (!isObject2(opts) || Array.isArray(opts)) {
  95927. log$1.error("please return an object in beforesetup hooks");
  95928. return;
  95929. }
  95930. options2 = mergeOptions$3(options2, opts);
  95931. });
  95932. var PlayerComponent = Component$1.getComponent("Player");
  95933. player = new PlayerComponent(el, options2, ready);
  95934. hooks("setup").forEach(function(hookFunction) {
  95935. return hookFunction(player);
  95936. });
  95937. return player;
  95938. }
  95939. videojs.hooks_ = hooks_;
  95940. videojs.hooks = hooks;
  95941. videojs.hook = hook;
  95942. videojs.hookOnce = hookOnce;
  95943. videojs.removeHook = removeHook;
  95944. if (window_1.VIDEOJS_NO_DYNAMIC_STYLE !== true && isReal()) {
  95945. var style = $(".vjs-styles-defaults");
  95946. if (!style) {
  95947. style = createStyleElement("vjs-styles-defaults");
  95948. var head = $("head");
  95949. if (head) {
  95950. head.insertBefore(style, head.firstChild);
  95951. }
  95952. setTextContent(style, "\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ");
  95953. }
  95954. }
  95955. autoSetupTimeout(1, videojs);
  95956. videojs.VERSION = version$5;
  95957. videojs.options = Player.prototype.options_;
  95958. videojs.getPlayers = function() {
  95959. return Player.players;
  95960. };
  95961. videojs.getPlayer = function(id) {
  95962. var players = Player.players;
  95963. var tag;
  95964. if (typeof id === "string") {
  95965. var nId = normalizeId(id);
  95966. var player = players[nId];
  95967. if (player) {
  95968. return player;
  95969. }
  95970. tag = $("#" + nId);
  95971. } else {
  95972. tag = id;
  95973. }
  95974. if (isEl(tag)) {
  95975. var _tag = tag, _player = _tag.player, playerId = _tag.playerId;
  95976. if (_player || players[playerId]) {
  95977. return _player || players[playerId];
  95978. }
  95979. }
  95980. };
  95981. videojs.getAllPlayers = function() {
  95982. return Object.keys(Player.players).map(function(k) {
  95983. return Player.players[k];
  95984. }).filter(Boolean);
  95985. };
  95986. videojs.players = Player.players;
  95987. videojs.getComponent = Component$1.getComponent;
  95988. videojs.registerComponent = function(name, comp) {
  95989. if (Tech$1.isTech(comp)) {
  95990. log$1.warn("The " + name + " tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)");
  95991. }
  95992. Component$1.registerComponent.call(Component$1, name, comp);
  95993. };
  95994. videojs.getTech = Tech$1.getTech;
  95995. videojs.registerTech = Tech$1.registerTech;
  95996. videojs.use = use;
  95997. Object.defineProperty(videojs, "middleware", {
  95998. value: {},
  95999. writeable: false,
  96000. enumerable: true
  96001. });
  96002. Object.defineProperty(videojs.middleware, "TERMINATOR", {
  96003. value: TERMINATOR,
  96004. writeable: false,
  96005. enumerable: true
  96006. });
  96007. videojs.browser = browser;
  96008. videojs.TOUCH_ENABLED = TOUCH_ENABLED;
  96009. videojs.extend = extend;
  96010. videojs.mergeOptions = mergeOptions$3;
  96011. videojs.bind = bind;
  96012. videojs.registerPlugin = Plugin.registerPlugin;
  96013. videojs.deregisterPlugin = Plugin.deregisterPlugin;
  96014. videojs.plugin = function(name, plugin) {
  96015. log$1.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");
  96016. return Plugin.registerPlugin(name, plugin);
  96017. };
  96018. videojs.getPlugins = Plugin.getPlugins;
  96019. videojs.getPlugin = Plugin.getPlugin;
  96020. videojs.getPluginVersion = Plugin.getPluginVersion;
  96021. videojs.addLanguage = function(code, data) {
  96022. var _mergeOptions;
  96023. code = ("" + code).toLowerCase();
  96024. videojs.options.languages = mergeOptions$3(videojs.options.languages, (_mergeOptions = {}, _mergeOptions[code] = data, _mergeOptions));
  96025. return videojs.options.languages[code];
  96026. };
  96027. videojs.log = log$1;
  96028. videojs.createLogger = createLogger;
  96029. videojs.createTimeRange = videojs.createTimeRanges = createTimeRanges;
  96030. videojs.formatTime = formatTime;
  96031. videojs.setFormatTime = setFormatTime;
  96032. videojs.resetFormatTime = resetFormatTime;
  96033. videojs.parseUrl = parseUrl;
  96034. videojs.isCrossOrigin = isCrossOrigin;
  96035. videojs.EventTarget = EventTarget$2;
  96036. videojs.on = on;
  96037. videojs.one = one;
  96038. videojs.off = off;
  96039. videojs.trigger = trigger;
  96040. videojs.xhr = XHR;
  96041. videojs.TextTrack = TextTrack;
  96042. videojs.AudioTrack = AudioTrack;
  96043. videojs.VideoTrack = VideoTrack;
  96044. ["isEl", "isTextNode", "createEl", "hasClass", "addClass", "removeClass", "toggleClass", "setAttributes", "getAttributes", "emptyEl", "appendContent", "insertContent"].forEach(function(k) {
  96045. videojs[k] = function() {
  96046. log$1.warn("videojs." + k + "() is deprecated; use videojs.dom." + k + "() instead");
  96047. return Dom$1[k].apply(null, arguments);
  96048. };
  96049. });
  96050. videojs.computedStyle = computedStyle;
  96051. videojs.dom = Dom$1;
  96052. videojs.url = Url$1;
  96053. videojs.defineLazyProperty = defineLazyProperty;
  96054. videojs.addLanguage("en", {
  96055. "Non-Fullscreen": "Exit Fullscreen"
  96056. });
  96057. /*! @name @videojs/http-streaming @version 2.16.2 @license Apache-2.0 */
  96058. var resolveUrl4 = resolveUrl$1;
  96059. var resolveManifestRedirect = function resolveManifestRedirect2(handleManifestRedirect, url, req) {
  96060. if (handleManifestRedirect && req && req.responseURL && url !== req.responseURL) {
  96061. return req.responseURL;
  96062. }
  96063. return url;
  96064. };
  96065. var logger = function logger2(source) {
  96066. if (videojs.log.debug) {
  96067. return videojs.log.debug.bind(videojs, "VHS:", source + " >");
  96068. }
  96069. return function() {
  96070. };
  96071. };
  96072. var TIME_FUDGE_FACTOR = 1 / 30;
  96073. var SAFE_TIME_DELTA = TIME_FUDGE_FACTOR * 3;
  96074. var filterRanges = function filterRanges2(timeRanges, predicate) {
  96075. var results = [];
  96076. var i2;
  96077. if (timeRanges && timeRanges.length) {
  96078. for (i2 = 0; i2 < timeRanges.length; i2++) {
  96079. if (predicate(timeRanges.start(i2), timeRanges.end(i2))) {
  96080. results.push([timeRanges.start(i2), timeRanges.end(i2)]);
  96081. }
  96082. }
  96083. }
  96084. return videojs.createTimeRanges(results);
  96085. };
  96086. var findRange = function findRange2(buffered, time) {
  96087. return filterRanges(buffered, function(start2, end) {
  96088. return start2 - SAFE_TIME_DELTA <= time && end + SAFE_TIME_DELTA >= time;
  96089. });
  96090. };
  96091. var findNextRange = function findNextRange2(timeRanges, time) {
  96092. return filterRanges(timeRanges, function(start2) {
  96093. return start2 - TIME_FUDGE_FACTOR >= time;
  96094. });
  96095. };
  96096. var findGaps = function findGaps2(buffered) {
  96097. if (buffered.length < 2) {
  96098. return videojs.createTimeRanges();
  96099. }
  96100. var ranges = [];
  96101. for (var i2 = 1; i2 < buffered.length; i2++) {
  96102. var start2 = buffered.end(i2 - 1);
  96103. var end = buffered.start(i2);
  96104. ranges.push([start2, end]);
  96105. }
  96106. return videojs.createTimeRanges(ranges);
  96107. };
  96108. var bufferIntersection = function bufferIntersection2(bufferA, bufferB) {
  96109. var start2 = null;
  96110. var end = null;
  96111. var arity = 0;
  96112. var extents = [];
  96113. var ranges = [];
  96114. if (!bufferA || !bufferA.length || !bufferB || !bufferB.length) {
  96115. return videojs.createTimeRange();
  96116. }
  96117. var count = bufferA.length;
  96118. while (count--) {
  96119. extents.push({
  96120. time: bufferA.start(count),
  96121. type: "start"
  96122. });
  96123. extents.push({
  96124. time: bufferA.end(count),
  96125. type: "end"
  96126. });
  96127. }
  96128. count = bufferB.length;
  96129. while (count--) {
  96130. extents.push({
  96131. time: bufferB.start(count),
  96132. type: "start"
  96133. });
  96134. extents.push({
  96135. time: bufferB.end(count),
  96136. type: "end"
  96137. });
  96138. }
  96139. extents.sort(function(a, b) {
  96140. return a.time - b.time;
  96141. });
  96142. for (count = 0; count < extents.length; count++) {
  96143. if (extents[count].type === "start") {
  96144. arity++;
  96145. if (arity === 2) {
  96146. start2 = extents[count].time;
  96147. }
  96148. } else if (extents[count].type === "end") {
  96149. arity--;
  96150. if (arity === 1) {
  96151. end = extents[count].time;
  96152. }
  96153. }
  96154. if (start2 !== null && end !== null) {
  96155. ranges.push([start2, end]);
  96156. start2 = null;
  96157. end = null;
  96158. }
  96159. }
  96160. return videojs.createTimeRanges(ranges);
  96161. };
  96162. var printableRange = function printableRange2(range3) {
  96163. var strArr = [];
  96164. if (!range3 || !range3.length) {
  96165. return "";
  96166. }
  96167. for (var i2 = 0; i2 < range3.length; i2++) {
  96168. strArr.push(range3.start(i2) + " => " + range3.end(i2));
  96169. }
  96170. return strArr.join(", ");
  96171. };
  96172. var timeUntilRebuffer = function timeUntilRebuffer2(buffered, currentTime, playbackRate) {
  96173. if (playbackRate === void 0) {
  96174. playbackRate = 1;
  96175. }
  96176. var bufferedEnd = buffered.length ? buffered.end(buffered.length - 1) : 0;
  96177. return (bufferedEnd - currentTime) / playbackRate;
  96178. };
  96179. var timeRangesToArray = function timeRangesToArray2(timeRanges) {
  96180. var timeRangesList = [];
  96181. for (var i2 = 0; i2 < timeRanges.length; i2++) {
  96182. timeRangesList.push({
  96183. start: timeRanges.start(i2),
  96184. end: timeRanges.end(i2)
  96185. });
  96186. }
  96187. return timeRangesList;
  96188. };
  96189. var isRangeDifferent = function isRangeDifferent2(a, b) {
  96190. if (a === b) {
  96191. return false;
  96192. }
  96193. if (!a && b || !b && a) {
  96194. return true;
  96195. }
  96196. if (a.length !== b.length) {
  96197. return true;
  96198. }
  96199. for (var i2 = 0; i2 < a.length; i2++) {
  96200. if (a.start(i2) !== b.start(i2) || a.end(i2) !== b.end(i2)) {
  96201. return true;
  96202. }
  96203. }
  96204. return false;
  96205. };
  96206. var lastBufferedEnd = function lastBufferedEnd2(a) {
  96207. if (!a || !a.length || !a.end) {
  96208. return;
  96209. }
  96210. return a.end(a.length - 1);
  96211. };
  96212. var timeAheadOf = function timeAheadOf2(range3, startTime) {
  96213. var time = 0;
  96214. if (!range3 || !range3.length) {
  96215. return time;
  96216. }
  96217. for (var i2 = 0; i2 < range3.length; i2++) {
  96218. var start2 = range3.start(i2);
  96219. var end = range3.end(i2);
  96220. if (startTime > end) {
  96221. continue;
  96222. }
  96223. if (startTime > start2 && startTime <= end) {
  96224. time += end - startTime;
  96225. continue;
  96226. }
  96227. time += end - start2;
  96228. }
  96229. return time;
  96230. };
  96231. var createTimeRange$1 = videojs.createTimeRange;
  96232. var segmentDurationWithParts = function segmentDurationWithParts2(playlist, segment) {
  96233. if (!segment.preload) {
  96234. return segment.duration;
  96235. }
  96236. var result = 0;
  96237. (segment.parts || []).forEach(function(p) {
  96238. result += p.duration;
  96239. });
  96240. (segment.preloadHints || []).forEach(function(p) {
  96241. if (p.type === "PART") {
  96242. result += playlist.partTargetDuration;
  96243. }
  96244. });
  96245. return result;
  96246. };
  96247. var getPartsAndSegments = function getPartsAndSegments2(playlist) {
  96248. return (playlist.segments || []).reduce(function(acc, segment, si) {
  96249. if (segment.parts) {
  96250. segment.parts.forEach(function(part, pi) {
  96251. acc.push({
  96252. duration: part.duration,
  96253. segmentIndex: si,
  96254. partIndex: pi,
  96255. part,
  96256. segment
  96257. });
  96258. });
  96259. } else {
  96260. acc.push({
  96261. duration: segment.duration,
  96262. segmentIndex: si,
  96263. partIndex: null,
  96264. segment,
  96265. part: null
  96266. });
  96267. }
  96268. return acc;
  96269. }, []);
  96270. };
  96271. var getLastParts = function getLastParts2(media) {
  96272. var lastSegment = media.segments && media.segments.length && media.segments[media.segments.length - 1];
  96273. return lastSegment && lastSegment.parts || [];
  96274. };
  96275. var getKnownPartCount = function getKnownPartCount2(_ref) {
  96276. var preloadSegment = _ref.preloadSegment;
  96277. if (!preloadSegment) {
  96278. return;
  96279. }
  96280. var parts = preloadSegment.parts, preloadHints = preloadSegment.preloadHints;
  96281. var partCount = (preloadHints || []).reduce(function(count, hint) {
  96282. return count + (hint.type === "PART" ? 1 : 0);
  96283. }, 0);
  96284. partCount += parts && parts.length ? parts.length : 0;
  96285. return partCount;
  96286. };
  96287. var liveEdgeDelay = function liveEdgeDelay2(master, media) {
  96288. if (media.endList) {
  96289. return 0;
  96290. }
  96291. if (master && master.suggestedPresentationDelay) {
  96292. return master.suggestedPresentationDelay;
  96293. }
  96294. var hasParts = getLastParts(media).length > 0;
  96295. if (hasParts && media.serverControl && media.serverControl.partHoldBack) {
  96296. return media.serverControl.partHoldBack;
  96297. } else if (hasParts && media.partTargetDuration) {
  96298. return media.partTargetDuration * 3;
  96299. } else if (media.serverControl && media.serverControl.holdBack) {
  96300. return media.serverControl.holdBack;
  96301. } else if (media.targetDuration) {
  96302. return media.targetDuration * 3;
  96303. }
  96304. return 0;
  96305. };
  96306. var backwardDuration = function backwardDuration2(playlist, endSequence) {
  96307. var result = 0;
  96308. var i2 = endSequence - playlist.mediaSequence;
  96309. var segment = playlist.segments[i2];
  96310. if (segment) {
  96311. if (typeof segment.start !== "undefined") {
  96312. return {
  96313. result: segment.start,
  96314. precise: true
  96315. };
  96316. }
  96317. if (typeof segment.end !== "undefined") {
  96318. return {
  96319. result: segment.end - segment.duration,
  96320. precise: true
  96321. };
  96322. }
  96323. }
  96324. while (i2--) {
  96325. segment = playlist.segments[i2];
  96326. if (typeof segment.end !== "undefined") {
  96327. return {
  96328. result: result + segment.end,
  96329. precise: true
  96330. };
  96331. }
  96332. result += segmentDurationWithParts(playlist, segment);
  96333. if (typeof segment.start !== "undefined") {
  96334. return {
  96335. result: result + segment.start,
  96336. precise: true
  96337. };
  96338. }
  96339. }
  96340. return {
  96341. result,
  96342. precise: false
  96343. };
  96344. };
  96345. var forwardDuration = function forwardDuration2(playlist, endSequence) {
  96346. var result = 0;
  96347. var segment;
  96348. var i2 = endSequence - playlist.mediaSequence;
  96349. for (; i2 < playlist.segments.length; i2++) {
  96350. segment = playlist.segments[i2];
  96351. if (typeof segment.start !== "undefined") {
  96352. return {
  96353. result: segment.start - result,
  96354. precise: true
  96355. };
  96356. }
  96357. result += segmentDurationWithParts(playlist, segment);
  96358. if (typeof segment.end !== "undefined") {
  96359. return {
  96360. result: segment.end - result,
  96361. precise: true
  96362. };
  96363. }
  96364. }
  96365. return {
  96366. result: -1,
  96367. precise: false
  96368. };
  96369. };
  96370. var intervalDuration = function intervalDuration2(playlist, endSequence, expired) {
  96371. if (typeof endSequence === "undefined") {
  96372. endSequence = playlist.mediaSequence + playlist.segments.length;
  96373. }
  96374. if (endSequence < playlist.mediaSequence) {
  96375. return 0;
  96376. }
  96377. var backward = backwardDuration(playlist, endSequence);
  96378. if (backward.precise) {
  96379. return backward.result;
  96380. }
  96381. var forward = forwardDuration(playlist, endSequence);
  96382. if (forward.precise) {
  96383. return forward.result;
  96384. }
  96385. return backward.result + expired;
  96386. };
  96387. var duration2 = function duration3(playlist, endSequence, expired) {
  96388. if (!playlist) {
  96389. return 0;
  96390. }
  96391. if (typeof expired !== "number") {
  96392. expired = 0;
  96393. }
  96394. if (typeof endSequence === "undefined") {
  96395. if (playlist.totalDuration) {
  96396. return playlist.totalDuration;
  96397. }
  96398. if (!playlist.endList) {
  96399. return window_1.Infinity;
  96400. }
  96401. }
  96402. return intervalDuration(playlist, endSequence, expired);
  96403. };
  96404. var sumDurations = function sumDurations2(_ref2) {
  96405. var defaultDuration = _ref2.defaultDuration, durationList = _ref2.durationList, startIndex = _ref2.startIndex, endIndex = _ref2.endIndex;
  96406. var durations = 0;
  96407. if (startIndex > endIndex) {
  96408. var _ref3 = [endIndex, startIndex];
  96409. startIndex = _ref3[0];
  96410. endIndex = _ref3[1];
  96411. }
  96412. if (startIndex < 0) {
  96413. for (var i2 = startIndex; i2 < Math.min(0, endIndex); i2++) {
  96414. durations += defaultDuration;
  96415. }
  96416. startIndex = 0;
  96417. }
  96418. for (var _i = startIndex; _i < endIndex; _i++) {
  96419. durations += durationList[_i].duration;
  96420. }
  96421. return durations;
  96422. };
  96423. var playlistEnd = function playlistEnd2(playlist, expired, useSafeLiveEnd, liveEdgePadding) {
  96424. if (!playlist || !playlist.segments) {
  96425. return null;
  96426. }
  96427. if (playlist.endList) {
  96428. return duration2(playlist);
  96429. }
  96430. if (expired === null) {
  96431. return null;
  96432. }
  96433. expired = expired || 0;
  96434. var lastSegmentEndTime = intervalDuration(playlist, playlist.mediaSequence + playlist.segments.length, expired);
  96435. if (useSafeLiveEnd) {
  96436. liveEdgePadding = typeof liveEdgePadding === "number" ? liveEdgePadding : liveEdgeDelay(null, playlist);
  96437. lastSegmentEndTime -= liveEdgePadding;
  96438. }
  96439. return Math.max(0, lastSegmentEndTime);
  96440. };
  96441. var seekable = function seekable2(playlist, expired, liveEdgePadding) {
  96442. var useSafeLiveEnd = true;
  96443. var seekableStart = expired || 0;
  96444. var seekableEnd = playlistEnd(playlist, expired, useSafeLiveEnd, liveEdgePadding);
  96445. if (seekableEnd === null) {
  96446. return createTimeRange$1();
  96447. }
  96448. return createTimeRange$1(seekableStart, seekableEnd);
  96449. };
  96450. var getMediaInfoForTime = function getMediaInfoForTime2(_ref4) {
  96451. var playlist = _ref4.playlist, currentTime = _ref4.currentTime, startingSegmentIndex = _ref4.startingSegmentIndex, startingPartIndex = _ref4.startingPartIndex, startTime = _ref4.startTime, experimentalExactManifestTimings = _ref4.experimentalExactManifestTimings;
  96452. var time = currentTime - startTime;
  96453. var partsAndSegments = getPartsAndSegments(playlist);
  96454. var startIndex = 0;
  96455. for (var i2 = 0; i2 < partsAndSegments.length; i2++) {
  96456. var partAndSegment = partsAndSegments[i2];
  96457. if (startingSegmentIndex !== partAndSegment.segmentIndex) {
  96458. continue;
  96459. }
  96460. if (typeof startingPartIndex === "number" && typeof partAndSegment.partIndex === "number" && startingPartIndex !== partAndSegment.partIndex) {
  96461. continue;
  96462. }
  96463. startIndex = i2;
  96464. break;
  96465. }
  96466. if (time < 0) {
  96467. if (startIndex > 0) {
  96468. for (var _i2 = startIndex - 1; _i2 >= 0; _i2--) {
  96469. var _partAndSegment = partsAndSegments[_i2];
  96470. time += _partAndSegment.duration;
  96471. if (experimentalExactManifestTimings) {
  96472. if (time < 0) {
  96473. continue;
  96474. }
  96475. } else if (time + TIME_FUDGE_FACTOR <= 0) {
  96476. continue;
  96477. }
  96478. return {
  96479. partIndex: _partAndSegment.partIndex,
  96480. segmentIndex: _partAndSegment.segmentIndex,
  96481. startTime: startTime - sumDurations({
  96482. defaultDuration: playlist.targetDuration,
  96483. durationList: partsAndSegments,
  96484. startIndex,
  96485. endIndex: _i2
  96486. })
  96487. };
  96488. }
  96489. }
  96490. return {
  96491. partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,
  96492. segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,
  96493. startTime: currentTime
  96494. };
  96495. }
  96496. if (startIndex < 0) {
  96497. for (var _i3 = startIndex; _i3 < 0; _i3++) {
  96498. time -= playlist.targetDuration;
  96499. if (time < 0) {
  96500. return {
  96501. partIndex: partsAndSegments[0] && partsAndSegments[0].partIndex || null,
  96502. segmentIndex: partsAndSegments[0] && partsAndSegments[0].segmentIndex || 0,
  96503. startTime: currentTime
  96504. };
  96505. }
  96506. }
  96507. startIndex = 0;
  96508. }
  96509. for (var _i4 = startIndex; _i4 < partsAndSegments.length; _i4++) {
  96510. var _partAndSegment2 = partsAndSegments[_i4];
  96511. time -= _partAndSegment2.duration;
  96512. if (experimentalExactManifestTimings) {
  96513. if (time > 0) {
  96514. continue;
  96515. }
  96516. } else if (time - TIME_FUDGE_FACTOR >= 0) {
  96517. continue;
  96518. }
  96519. return {
  96520. partIndex: _partAndSegment2.partIndex,
  96521. segmentIndex: _partAndSegment2.segmentIndex,
  96522. startTime: startTime + sumDurations({
  96523. defaultDuration: playlist.targetDuration,
  96524. durationList: partsAndSegments,
  96525. startIndex,
  96526. endIndex: _i4
  96527. })
  96528. };
  96529. }
  96530. return {
  96531. segmentIndex: partsAndSegments[partsAndSegments.length - 1].segmentIndex,
  96532. partIndex: partsAndSegments[partsAndSegments.length - 1].partIndex,
  96533. startTime: currentTime
  96534. };
  96535. };
  96536. var isBlacklisted = function isBlacklisted2(playlist) {
  96537. return playlist.excludeUntil && playlist.excludeUntil > Date.now();
  96538. };
  96539. var isIncompatible = function isIncompatible2(playlist) {
  96540. return playlist.excludeUntil && playlist.excludeUntil === Infinity;
  96541. };
  96542. var isEnabled = function isEnabled2(playlist) {
  96543. var blacklisted = isBlacklisted(playlist);
  96544. return !playlist.disabled && !blacklisted;
  96545. };
  96546. var isDisabled = function isDisabled2(playlist) {
  96547. return playlist.disabled;
  96548. };
  96549. var isAes = function isAes2(media) {
  96550. for (var i2 = 0; i2 < media.segments.length; i2++) {
  96551. if (media.segments[i2].key) {
  96552. return true;
  96553. }
  96554. }
  96555. return false;
  96556. };
  96557. var hasAttribute = function hasAttribute2(attr, playlist) {
  96558. return playlist.attributes && playlist.attributes[attr];
  96559. };
  96560. var estimateSegmentRequestTime = function estimateSegmentRequestTime2(segmentDuration, bandwidth2, playlist, bytesReceived) {
  96561. if (bytesReceived === void 0) {
  96562. bytesReceived = 0;
  96563. }
  96564. if (!hasAttribute("BANDWIDTH", playlist)) {
  96565. return NaN;
  96566. }
  96567. var size = segmentDuration * playlist.attributes.BANDWIDTH;
  96568. return (size - bytesReceived * 8) / bandwidth2;
  96569. };
  96570. var isLowestEnabledRendition = function isLowestEnabledRendition2(master, media) {
  96571. if (master.playlists.length === 1) {
  96572. return true;
  96573. }
  96574. var currentBandwidth = media.attributes.BANDWIDTH || Number.MAX_VALUE;
  96575. return master.playlists.filter(function(playlist) {
  96576. if (!isEnabled(playlist)) {
  96577. return false;
  96578. }
  96579. return (playlist.attributes.BANDWIDTH || 0) < currentBandwidth;
  96580. }).length === 0;
  96581. };
  96582. var playlistMatch = function playlistMatch2(a, b) {
  96583. if (!a && !b || !a && b || a && !b) {
  96584. return false;
  96585. }
  96586. if (a === b) {
  96587. return true;
  96588. }
  96589. if (a.id && b.id && a.id === b.id) {
  96590. return true;
  96591. }
  96592. if (a.resolvedUri && b.resolvedUri && a.resolvedUri === b.resolvedUri) {
  96593. return true;
  96594. }
  96595. if (a.uri && b.uri && a.uri === b.uri) {
  96596. return true;
  96597. }
  96598. return false;
  96599. };
  96600. var someAudioVariant = function someAudioVariant2(master, callback2) {
  96601. var AUDIO5 = master && master.mediaGroups && master.mediaGroups.AUDIO || {};
  96602. var found = false;
  96603. for (var groupName in AUDIO5) {
  96604. for (var label in AUDIO5[groupName]) {
  96605. found = callback2(AUDIO5[groupName][label]);
  96606. if (found) {
  96607. break;
  96608. }
  96609. }
  96610. if (found) {
  96611. break;
  96612. }
  96613. }
  96614. return !!found;
  96615. };
  96616. var isAudioOnly = function isAudioOnly2(master) {
  96617. if (!master || !master.playlists || !master.playlists.length) {
  96618. var found = someAudioVariant(master, function(variant) {
  96619. return variant.playlists && variant.playlists.length || variant.uri;
  96620. });
  96621. return found;
  96622. }
  96623. var _loop = function _loop2(i3) {
  96624. var playlist = master.playlists[i3];
  96625. var CODECS = playlist.attributes && playlist.attributes.CODECS;
  96626. if (CODECS && CODECS.split(",").every(function(c) {
  96627. return isAudioCodec2(c);
  96628. })) {
  96629. return "continue";
  96630. }
  96631. var found2 = someAudioVariant(master, function(variant) {
  96632. return playlistMatch(playlist, variant);
  96633. });
  96634. if (found2) {
  96635. return "continue";
  96636. }
  96637. return {
  96638. v: false
  96639. };
  96640. };
  96641. for (var i2 = 0; i2 < master.playlists.length; i2++) {
  96642. var _ret = _loop(i2);
  96643. if (_ret === "continue")
  96644. continue;
  96645. if (typeof _ret === "object")
  96646. return _ret.v;
  96647. }
  96648. return true;
  96649. };
  96650. var Playlist = {
  96651. liveEdgeDelay,
  96652. duration: duration2,
  96653. seekable,
  96654. getMediaInfoForTime,
  96655. isEnabled,
  96656. isDisabled,
  96657. isBlacklisted,
  96658. isIncompatible,
  96659. playlistEnd,
  96660. isAes,
  96661. hasAttribute,
  96662. estimateSegmentRequestTime,
  96663. isLowestEnabledRendition,
  96664. isAudioOnly,
  96665. playlistMatch,
  96666. segmentDurationWithParts
  96667. };
  96668. var log = videojs.log;
  96669. var createPlaylistID = function createPlaylistID2(index2, uri) {
  96670. return index2 + "-" + uri;
  96671. };
  96672. var groupID = function groupID2(type2, group, label) {
  96673. return "placeholder-uri-" + type2 + "-" + group + "-" + label;
  96674. };
  96675. var parseManifest = function parseManifest2(_ref) {
  96676. var onwarn = _ref.onwarn, oninfo = _ref.oninfo, manifestString = _ref.manifestString, _ref$customTagParsers = _ref.customTagParsers, customTagParsers = _ref$customTagParsers === void 0 ? [] : _ref$customTagParsers, _ref$customTagMappers = _ref.customTagMappers, customTagMappers = _ref$customTagMappers === void 0 ? [] : _ref$customTagMappers, experimentalLLHLS = _ref.experimentalLLHLS;
  96677. var parser2 = new Parser();
  96678. if (onwarn) {
  96679. parser2.on("warn", onwarn);
  96680. }
  96681. if (oninfo) {
  96682. parser2.on("info", oninfo);
  96683. }
  96684. customTagParsers.forEach(function(customParser) {
  96685. return parser2.addParser(customParser);
  96686. });
  96687. customTagMappers.forEach(function(mapper) {
  96688. return parser2.addTagMapper(mapper);
  96689. });
  96690. parser2.push(manifestString);
  96691. parser2.end();
  96692. var manifest = parser2.manifest;
  96693. if (!experimentalLLHLS) {
  96694. ["preloadSegment", "skip", "serverControl", "renditionReports", "partInf", "partTargetDuration"].forEach(function(k) {
  96695. if (manifest.hasOwnProperty(k)) {
  96696. delete manifest[k];
  96697. }
  96698. });
  96699. if (manifest.segments) {
  96700. manifest.segments.forEach(function(segment) {
  96701. ["parts", "preloadHints"].forEach(function(k) {
  96702. if (segment.hasOwnProperty(k)) {
  96703. delete segment[k];
  96704. }
  96705. });
  96706. });
  96707. }
  96708. }
  96709. if (!manifest.targetDuration) {
  96710. var targetDuration = 10;
  96711. if (manifest.segments && manifest.segments.length) {
  96712. targetDuration = manifest.segments.reduce(function(acc, s) {
  96713. return Math.max(acc, s.duration);
  96714. }, 0);
  96715. }
  96716. if (onwarn) {
  96717. onwarn("manifest has no targetDuration defaulting to " + targetDuration);
  96718. }
  96719. manifest.targetDuration = targetDuration;
  96720. }
  96721. var parts = getLastParts(manifest);
  96722. if (parts.length && !manifest.partTargetDuration) {
  96723. var partTargetDuration = parts.reduce(function(acc, p) {
  96724. return Math.max(acc, p.duration);
  96725. }, 0);
  96726. if (onwarn) {
  96727. onwarn("manifest has no partTargetDuration defaulting to " + partTargetDuration);
  96728. log.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.");
  96729. }
  96730. manifest.partTargetDuration = partTargetDuration;
  96731. }
  96732. return manifest;
  96733. };
  96734. var forEachMediaGroup3 = function forEachMediaGroup4(master, callback2) {
  96735. if (!master.mediaGroups) {
  96736. return;
  96737. }
  96738. ["AUDIO", "SUBTITLES"].forEach(function(mediaType) {
  96739. if (!master.mediaGroups[mediaType]) {
  96740. return;
  96741. }
  96742. for (var groupKey in master.mediaGroups[mediaType]) {
  96743. for (var labelKey in master.mediaGroups[mediaType][groupKey]) {
  96744. var mediaProperties = master.mediaGroups[mediaType][groupKey][labelKey];
  96745. callback2(mediaProperties, mediaType, groupKey, labelKey);
  96746. }
  96747. }
  96748. });
  96749. };
  96750. var setupMediaPlaylist = function setupMediaPlaylist2(_ref2) {
  96751. var playlist = _ref2.playlist, uri = _ref2.uri, id = _ref2.id;
  96752. playlist.id = id;
  96753. playlist.playlistErrors_ = 0;
  96754. if (uri) {
  96755. playlist.uri = uri;
  96756. }
  96757. playlist.attributes = playlist.attributes || {};
  96758. };
  96759. var setupMediaPlaylists = function setupMediaPlaylists2(master) {
  96760. var i2 = master.playlists.length;
  96761. while (i2--) {
  96762. var playlist = master.playlists[i2];
  96763. setupMediaPlaylist({
  96764. playlist,
  96765. id: createPlaylistID(i2, playlist.uri)
  96766. });
  96767. playlist.resolvedUri = resolveUrl4(master.uri, playlist.uri);
  96768. master.playlists[playlist.id] = playlist;
  96769. master.playlists[playlist.uri] = playlist;
  96770. if (!playlist.attributes.BANDWIDTH) {
  96771. log.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.");
  96772. }
  96773. }
  96774. };
  96775. var resolveMediaGroupUris = function resolveMediaGroupUris2(master) {
  96776. forEachMediaGroup3(master, function(properties) {
  96777. if (properties.uri) {
  96778. properties.resolvedUri = resolveUrl4(master.uri, properties.uri);
  96779. }
  96780. });
  96781. };
  96782. var masterForMedia = function masterForMedia2(media, uri) {
  96783. var id = createPlaylistID(0, uri);
  96784. var master = {
  96785. mediaGroups: {
  96786. "AUDIO": {},
  96787. "VIDEO": {},
  96788. "CLOSED-CAPTIONS": {},
  96789. "SUBTITLES": {}
  96790. },
  96791. uri: window_1.location.href,
  96792. resolvedUri: window_1.location.href,
  96793. playlists: [{
  96794. uri,
  96795. id,
  96796. resolvedUri: uri,
  96797. attributes: {}
  96798. }]
  96799. };
  96800. master.playlists[id] = master.playlists[0];
  96801. master.playlists[uri] = master.playlists[0];
  96802. return master;
  96803. };
  96804. var addPropertiesToMaster = function addPropertiesToMaster2(master, uri, createGroupID) {
  96805. if (createGroupID === void 0) {
  96806. createGroupID = groupID;
  96807. }
  96808. master.uri = uri;
  96809. for (var i2 = 0; i2 < master.playlists.length; i2++) {
  96810. if (!master.playlists[i2].uri) {
  96811. var phonyUri = "placeholder-uri-" + i2;
  96812. master.playlists[i2].uri = phonyUri;
  96813. }
  96814. }
  96815. var audioOnlyMaster = isAudioOnly(master);
  96816. forEachMediaGroup3(master, function(properties, mediaType, groupKey, labelKey) {
  96817. if (!properties.playlists || !properties.playlists.length) {
  96818. if (audioOnlyMaster && mediaType === "AUDIO" && !properties.uri) {
  96819. for (var _i = 0; _i < master.playlists.length; _i++) {
  96820. var p = master.playlists[_i];
  96821. if (p.attributes && p.attributes.AUDIO && p.attributes.AUDIO === groupKey) {
  96822. return;
  96823. }
  96824. }
  96825. }
  96826. properties.playlists = [_extends$2({}, properties)];
  96827. }
  96828. properties.playlists.forEach(function(p2, i3) {
  96829. var groupId = createGroupID(mediaType, groupKey, labelKey, p2);
  96830. var id = createPlaylistID(i3, groupId);
  96831. if (p2.uri) {
  96832. p2.resolvedUri = p2.resolvedUri || resolveUrl4(master.uri, p2.uri);
  96833. } else {
  96834. p2.uri = i3 === 0 ? groupId : id;
  96835. p2.resolvedUri = p2.uri;
  96836. }
  96837. p2.id = p2.id || id;
  96838. p2.attributes = p2.attributes || {};
  96839. master.playlists[p2.id] = p2;
  96840. master.playlists[p2.uri] = p2;
  96841. });
  96842. });
  96843. setupMediaPlaylists(master);
  96844. resolveMediaGroupUris(master);
  96845. };
  96846. var mergeOptions$2 = videojs.mergeOptions, EventTarget$1 = videojs.EventTarget;
  96847. var addLLHLSQueryDirectives = function addLLHLSQueryDirectives2(uri, media) {
  96848. if (media.endList || !media.serverControl) {
  96849. return uri;
  96850. }
  96851. var parameters = {};
  96852. if (media.serverControl.canBlockReload) {
  96853. var preloadSegment = media.preloadSegment;
  96854. var nextMSN = media.mediaSequence + media.segments.length;
  96855. if (preloadSegment) {
  96856. var parts = preloadSegment.parts || [];
  96857. var nextPart = getKnownPartCount(media) - 1;
  96858. if (nextPart > -1 && nextPart !== parts.length - 1) {
  96859. parameters._HLS_part = nextPart;
  96860. }
  96861. if (nextPart > -1 || parts.length) {
  96862. nextMSN--;
  96863. }
  96864. }
  96865. parameters._HLS_msn = nextMSN;
  96866. }
  96867. if (media.serverControl && media.serverControl.canSkipUntil) {
  96868. parameters._HLS_skip = media.serverControl.canSkipDateranges ? "v2" : "YES";
  96869. }
  96870. if (Object.keys(parameters).length) {
  96871. var parsedUri = new window_1.URL(uri);
  96872. ["_HLS_skip", "_HLS_msn", "_HLS_part"].forEach(function(name) {
  96873. if (!parameters.hasOwnProperty(name)) {
  96874. return;
  96875. }
  96876. parsedUri.searchParams.set(name, parameters[name]);
  96877. });
  96878. uri = parsedUri.toString();
  96879. }
  96880. return uri;
  96881. };
  96882. var updateSegment = function updateSegment2(a, b) {
  96883. if (!a) {
  96884. return b;
  96885. }
  96886. var result = mergeOptions$2(a, b);
  96887. if (a.preloadHints && !b.preloadHints) {
  96888. delete result.preloadHints;
  96889. }
  96890. if (a.parts && !b.parts) {
  96891. delete result.parts;
  96892. } else if (a.parts && b.parts) {
  96893. for (var i2 = 0; i2 < b.parts.length; i2++) {
  96894. if (a.parts && a.parts[i2]) {
  96895. result.parts[i2] = mergeOptions$2(a.parts[i2], b.parts[i2]);
  96896. }
  96897. }
  96898. }
  96899. if (!a.skipped && b.skipped) {
  96900. result.skipped = false;
  96901. }
  96902. if (a.preload && !b.preload) {
  96903. result.preload = false;
  96904. }
  96905. return result;
  96906. };
  96907. var updateSegments = function updateSegments2(original, update, offset) {
  96908. var oldSegments = original.slice();
  96909. var newSegments = update.slice();
  96910. offset = offset || 0;
  96911. var result = [];
  96912. var currentMap;
  96913. for (var newIndex = 0; newIndex < newSegments.length; newIndex++) {
  96914. var oldSegment = oldSegments[newIndex + offset];
  96915. var newSegment = newSegments[newIndex];
  96916. if (oldSegment) {
  96917. currentMap = oldSegment.map || currentMap;
  96918. result.push(updateSegment(oldSegment, newSegment));
  96919. } else {
  96920. if (currentMap && !newSegment.map) {
  96921. newSegment.map = currentMap;
  96922. }
  96923. result.push(newSegment);
  96924. }
  96925. }
  96926. return result;
  96927. };
  96928. var resolveSegmentUris = function resolveSegmentUris2(segment, baseUri) {
  96929. if (!segment.resolvedUri && segment.uri) {
  96930. segment.resolvedUri = resolveUrl4(baseUri, segment.uri);
  96931. }
  96932. if (segment.key && !segment.key.resolvedUri) {
  96933. segment.key.resolvedUri = resolveUrl4(baseUri, segment.key.uri);
  96934. }
  96935. if (segment.map && !segment.map.resolvedUri) {
  96936. segment.map.resolvedUri = resolveUrl4(baseUri, segment.map.uri);
  96937. }
  96938. if (segment.map && segment.map.key && !segment.map.key.resolvedUri) {
  96939. segment.map.key.resolvedUri = resolveUrl4(baseUri, segment.map.key.uri);
  96940. }
  96941. if (segment.parts && segment.parts.length) {
  96942. segment.parts.forEach(function(p) {
  96943. if (p.resolvedUri) {
  96944. return;
  96945. }
  96946. p.resolvedUri = resolveUrl4(baseUri, p.uri);
  96947. });
  96948. }
  96949. if (segment.preloadHints && segment.preloadHints.length) {
  96950. segment.preloadHints.forEach(function(p) {
  96951. if (p.resolvedUri) {
  96952. return;
  96953. }
  96954. p.resolvedUri = resolveUrl4(baseUri, p.uri);
  96955. });
  96956. }
  96957. };
  96958. var getAllSegments = function getAllSegments2(media) {
  96959. var segments = media.segments || [];
  96960. var preloadSegment = media.preloadSegment;
  96961. if (preloadSegment && preloadSegment.parts && preloadSegment.parts.length) {
  96962. if (preloadSegment.preloadHints) {
  96963. for (var i2 = 0; i2 < preloadSegment.preloadHints.length; i2++) {
  96964. if (preloadSegment.preloadHints[i2].type === "MAP") {
  96965. return segments;
  96966. }
  96967. }
  96968. }
  96969. preloadSegment.duration = media.targetDuration;
  96970. preloadSegment.preload = true;
  96971. segments.push(preloadSegment);
  96972. }
  96973. return segments;
  96974. };
  96975. var isPlaylistUnchanged = function isPlaylistUnchanged2(a, b) {
  96976. return a === b || a.segments && b.segments && a.segments.length === b.segments.length && a.endList === b.endList && a.mediaSequence === b.mediaSequence && a.preloadSegment === b.preloadSegment;
  96977. };
  96978. var updateMaster$1 = function updateMaster(master, newMedia, unchangedCheck) {
  96979. if (unchangedCheck === void 0) {
  96980. unchangedCheck = isPlaylistUnchanged;
  96981. }
  96982. var result = mergeOptions$2(master, {});
  96983. var oldMedia = result.playlists[newMedia.id];
  96984. if (!oldMedia) {
  96985. return null;
  96986. }
  96987. if (unchangedCheck(oldMedia, newMedia)) {
  96988. return null;
  96989. }
  96990. newMedia.segments = getAllSegments(newMedia);
  96991. var mergedPlaylist = mergeOptions$2(oldMedia, newMedia);
  96992. if (mergedPlaylist.preloadSegment && !newMedia.preloadSegment) {
  96993. delete mergedPlaylist.preloadSegment;
  96994. }
  96995. if (oldMedia.segments) {
  96996. if (newMedia.skip) {
  96997. newMedia.segments = newMedia.segments || [];
  96998. for (var i2 = 0; i2 < newMedia.skip.skippedSegments; i2++) {
  96999. newMedia.segments.unshift({
  97000. skipped: true
  97001. });
  97002. }
  97003. }
  97004. mergedPlaylist.segments = updateSegments(oldMedia.segments, newMedia.segments, newMedia.mediaSequence - oldMedia.mediaSequence);
  97005. }
  97006. mergedPlaylist.segments.forEach(function(segment) {
  97007. resolveSegmentUris(segment, mergedPlaylist.resolvedUri);
  97008. });
  97009. for (var _i = 0; _i < result.playlists.length; _i++) {
  97010. if (result.playlists[_i].id === newMedia.id) {
  97011. result.playlists[_i] = mergedPlaylist;
  97012. }
  97013. }
  97014. result.playlists[newMedia.id] = mergedPlaylist;
  97015. result.playlists[newMedia.uri] = mergedPlaylist;
  97016. forEachMediaGroup3(master, function(properties, mediaType, groupKey, labelKey) {
  97017. if (!properties.playlists) {
  97018. return;
  97019. }
  97020. for (var _i2 = 0; _i2 < properties.playlists.length; _i2++) {
  97021. if (newMedia.id === properties.playlists[_i2].id) {
  97022. properties.playlists[_i2] = mergedPlaylist;
  97023. }
  97024. }
  97025. });
  97026. return result;
  97027. };
  97028. var refreshDelay = function refreshDelay2(media, update) {
  97029. var segments = media.segments || [];
  97030. var lastSegment = segments[segments.length - 1];
  97031. var lastPart = lastSegment && lastSegment.parts && lastSegment.parts[lastSegment.parts.length - 1];
  97032. var lastDuration = lastPart && lastPart.duration || lastSegment && lastSegment.duration;
  97033. if (update && lastDuration) {
  97034. return lastDuration * 1e3;
  97035. }
  97036. return (media.partTargetDuration || media.targetDuration || 10) * 500;
  97037. };
  97038. var PlaylistLoader = /* @__PURE__ */ function(_EventTarget) {
  97039. _inheritsLoose(PlaylistLoader2, _EventTarget);
  97040. function PlaylistLoader2(src, vhs, options2) {
  97041. var _this;
  97042. if (options2 === void 0) {
  97043. options2 = {};
  97044. }
  97045. _this = _EventTarget.call(this) || this;
  97046. if (!src) {
  97047. throw new Error("A non-empty playlist URL or object is required");
  97048. }
  97049. _this.logger_ = logger("PlaylistLoader");
  97050. var _options = options2, _options$withCredenti = _options.withCredentials, withCredentials = _options$withCredenti === void 0 ? false : _options$withCredenti, _options$handleManife = _options.handleManifestRedirects, handleManifestRedirects = _options$handleManife === void 0 ? false : _options$handleManife;
  97051. _this.src = src;
  97052. _this.vhs_ = vhs;
  97053. _this.withCredentials = withCredentials;
  97054. _this.handleManifestRedirects = handleManifestRedirects;
  97055. var vhsOptions = vhs.options_;
  97056. _this.customTagParsers = vhsOptions && vhsOptions.customTagParsers || [];
  97057. _this.customTagMappers = vhsOptions && vhsOptions.customTagMappers || [];
  97058. _this.experimentalLLHLS = vhsOptions && vhsOptions.experimentalLLHLS || false;
  97059. if (videojs.browser.IE_VERSION) {
  97060. _this.experimentalLLHLS = false;
  97061. }
  97062. _this.state = "HAVE_NOTHING";
  97063. _this.handleMediaupdatetimeout_ = _this.handleMediaupdatetimeout_.bind(_assertThisInitialized(_this));
  97064. _this.on("mediaupdatetimeout", _this.handleMediaupdatetimeout_);
  97065. return _this;
  97066. }
  97067. var _proto = PlaylistLoader2.prototype;
  97068. _proto.handleMediaupdatetimeout_ = function handleMediaupdatetimeout_() {
  97069. var _this2 = this;
  97070. if (this.state !== "HAVE_METADATA") {
  97071. return;
  97072. }
  97073. var media = this.media();
  97074. var uri = resolveUrl4(this.master.uri, media.uri);
  97075. if (this.experimentalLLHLS) {
  97076. uri = addLLHLSQueryDirectives(uri, media);
  97077. }
  97078. this.state = "HAVE_CURRENT_METADATA";
  97079. this.request = this.vhs_.xhr({
  97080. uri,
  97081. withCredentials: this.withCredentials
  97082. }, function(error, req) {
  97083. if (!_this2.request) {
  97084. return;
  97085. }
  97086. if (error) {
  97087. return _this2.playlistRequestError(_this2.request, _this2.media(), "HAVE_METADATA");
  97088. }
  97089. _this2.haveMetadata({
  97090. playlistString: _this2.request.responseText,
  97091. url: _this2.media().uri,
  97092. id: _this2.media().id
  97093. });
  97094. });
  97095. };
  97096. _proto.playlistRequestError = function playlistRequestError(xhr, playlist, startingState) {
  97097. var uri = playlist.uri, id = playlist.id;
  97098. this.request = null;
  97099. if (startingState) {
  97100. this.state = startingState;
  97101. }
  97102. this.error = {
  97103. playlist: this.master.playlists[id],
  97104. status: xhr.status,
  97105. message: "HLS playlist request error at URL: " + uri + ".",
  97106. responseText: xhr.responseText,
  97107. code: xhr.status >= 500 ? 4 : 2
  97108. };
  97109. this.trigger("error");
  97110. };
  97111. _proto.parseManifest_ = function parseManifest_(_ref) {
  97112. var _this3 = this;
  97113. var url = _ref.url, manifestString = _ref.manifestString;
  97114. return parseManifest({
  97115. onwarn: function onwarn(_ref2) {
  97116. var message = _ref2.message;
  97117. return _this3.logger_("m3u8-parser warn for " + url + ": " + message);
  97118. },
  97119. oninfo: function oninfo(_ref3) {
  97120. var message = _ref3.message;
  97121. return _this3.logger_("m3u8-parser info for " + url + ": " + message);
  97122. },
  97123. manifestString,
  97124. customTagParsers: this.customTagParsers,
  97125. customTagMappers: this.customTagMappers,
  97126. experimentalLLHLS: this.experimentalLLHLS
  97127. });
  97128. };
  97129. _proto.haveMetadata = function haveMetadata(_ref4) {
  97130. var playlistString = _ref4.playlistString, playlistObject = _ref4.playlistObject, url = _ref4.url, id = _ref4.id;
  97131. this.request = null;
  97132. this.state = "HAVE_METADATA";
  97133. var playlist = playlistObject || this.parseManifest_({
  97134. url,
  97135. manifestString: playlistString
  97136. });
  97137. playlist.lastRequest = Date.now();
  97138. setupMediaPlaylist({
  97139. playlist,
  97140. uri: url,
  97141. id
  97142. });
  97143. var update = updateMaster$1(this.master, playlist);
  97144. this.targetDuration = playlist.partTargetDuration || playlist.targetDuration;
  97145. this.pendingMedia_ = null;
  97146. if (update) {
  97147. this.master = update;
  97148. this.media_ = this.master.playlists[id];
  97149. } else {
  97150. this.trigger("playlistunchanged");
  97151. }
  97152. this.updateMediaUpdateTimeout_(refreshDelay(this.media(), !!update));
  97153. this.trigger("loadedplaylist");
  97154. };
  97155. _proto.dispose = function dispose() {
  97156. this.trigger("dispose");
  97157. this.stopRequest();
  97158. window_1.clearTimeout(this.mediaUpdateTimeout);
  97159. window_1.clearTimeout(this.finalRenditionTimeout);
  97160. this.off();
  97161. };
  97162. _proto.stopRequest = function stopRequest() {
  97163. if (this.request) {
  97164. var oldRequest = this.request;
  97165. this.request = null;
  97166. oldRequest.onreadystatechange = null;
  97167. oldRequest.abort();
  97168. }
  97169. };
  97170. _proto.media = function media(playlist, shouldDelay) {
  97171. var _this4 = this;
  97172. if (!playlist) {
  97173. return this.media_;
  97174. }
  97175. if (this.state === "HAVE_NOTHING") {
  97176. throw new Error("Cannot switch media playlist from " + this.state);
  97177. }
  97178. if (typeof playlist === "string") {
  97179. if (!this.master.playlists[playlist]) {
  97180. throw new Error("Unknown playlist URI: " + playlist);
  97181. }
  97182. playlist = this.master.playlists[playlist];
  97183. }
  97184. window_1.clearTimeout(this.finalRenditionTimeout);
  97185. if (shouldDelay) {
  97186. var delay = (playlist.partTargetDuration || playlist.targetDuration) / 2 * 1e3 || 5 * 1e3;
  97187. this.finalRenditionTimeout = window_1.setTimeout(this.media.bind(this, playlist, false), delay);
  97188. return;
  97189. }
  97190. var startingState = this.state;
  97191. var mediaChange = !this.media_ || playlist.id !== this.media_.id;
  97192. var masterPlaylistRef = this.master.playlists[playlist.id];
  97193. if (masterPlaylistRef && masterPlaylistRef.endList || playlist.endList && playlist.segments.length) {
  97194. if (this.request) {
  97195. this.request.onreadystatechange = null;
  97196. this.request.abort();
  97197. this.request = null;
  97198. }
  97199. this.state = "HAVE_METADATA";
  97200. this.media_ = playlist;
  97201. if (mediaChange) {
  97202. this.trigger("mediachanging");
  97203. if (startingState === "HAVE_MASTER") {
  97204. this.trigger("loadedmetadata");
  97205. } else {
  97206. this.trigger("mediachange");
  97207. }
  97208. }
  97209. return;
  97210. }
  97211. this.updateMediaUpdateTimeout_(refreshDelay(playlist, true));
  97212. if (!mediaChange) {
  97213. return;
  97214. }
  97215. this.state = "SWITCHING_MEDIA";
  97216. if (this.request) {
  97217. if (playlist.resolvedUri === this.request.url) {
  97218. return;
  97219. }
  97220. this.request.onreadystatechange = null;
  97221. this.request.abort();
  97222. this.request = null;
  97223. }
  97224. if (this.media_) {
  97225. this.trigger("mediachanging");
  97226. }
  97227. this.pendingMedia_ = playlist;
  97228. this.request = this.vhs_.xhr({
  97229. uri: playlist.resolvedUri,
  97230. withCredentials: this.withCredentials
  97231. }, function(error, req) {
  97232. if (!_this4.request) {
  97233. return;
  97234. }
  97235. playlist.lastRequest = Date.now();
  97236. playlist.resolvedUri = resolveManifestRedirect(_this4.handleManifestRedirects, playlist.resolvedUri, req);
  97237. if (error) {
  97238. return _this4.playlistRequestError(_this4.request, playlist, startingState);
  97239. }
  97240. _this4.haveMetadata({
  97241. playlistString: req.responseText,
  97242. url: playlist.uri,
  97243. id: playlist.id
  97244. });
  97245. if (startingState === "HAVE_MASTER") {
  97246. _this4.trigger("loadedmetadata");
  97247. } else {
  97248. _this4.trigger("mediachange");
  97249. }
  97250. });
  97251. };
  97252. _proto.pause = function pause() {
  97253. if (this.mediaUpdateTimeout) {
  97254. window_1.clearTimeout(this.mediaUpdateTimeout);
  97255. this.mediaUpdateTimeout = null;
  97256. }
  97257. this.stopRequest();
  97258. if (this.state === "HAVE_NOTHING") {
  97259. this.started = false;
  97260. }
  97261. if (this.state === "SWITCHING_MEDIA") {
  97262. if (this.media_) {
  97263. this.state = "HAVE_METADATA";
  97264. } else {
  97265. this.state = "HAVE_MASTER";
  97266. }
  97267. } else if (this.state === "HAVE_CURRENT_METADATA") {
  97268. this.state = "HAVE_METADATA";
  97269. }
  97270. };
  97271. _proto.load = function load(shouldDelay) {
  97272. var _this5 = this;
  97273. if (this.mediaUpdateTimeout) {
  97274. window_1.clearTimeout(this.mediaUpdateTimeout);
  97275. this.mediaUpdateTimeout = null;
  97276. }
  97277. var media = this.media();
  97278. if (shouldDelay) {
  97279. var delay = media ? (media.partTargetDuration || media.targetDuration) / 2 * 1e3 : 5 * 1e3;
  97280. this.mediaUpdateTimeout = window_1.setTimeout(function() {
  97281. _this5.mediaUpdateTimeout = null;
  97282. _this5.load();
  97283. }, delay);
  97284. return;
  97285. }
  97286. if (!this.started) {
  97287. this.start();
  97288. return;
  97289. }
  97290. if (media && !media.endList) {
  97291. this.trigger("mediaupdatetimeout");
  97292. } else {
  97293. this.trigger("loadedplaylist");
  97294. }
  97295. };
  97296. _proto.updateMediaUpdateTimeout_ = function updateMediaUpdateTimeout_(delay) {
  97297. var _this6 = this;
  97298. if (this.mediaUpdateTimeout) {
  97299. window_1.clearTimeout(this.mediaUpdateTimeout);
  97300. this.mediaUpdateTimeout = null;
  97301. }
  97302. if (!this.media() || this.media().endList) {
  97303. return;
  97304. }
  97305. this.mediaUpdateTimeout = window_1.setTimeout(function() {
  97306. _this6.mediaUpdateTimeout = null;
  97307. _this6.trigger("mediaupdatetimeout");
  97308. _this6.updateMediaUpdateTimeout_(delay);
  97309. }, delay);
  97310. };
  97311. _proto.start = function start2() {
  97312. var _this7 = this;
  97313. this.started = true;
  97314. if (typeof this.src === "object") {
  97315. if (!this.src.uri) {
  97316. this.src.uri = window_1.location.href;
  97317. }
  97318. this.src.resolvedUri = this.src.uri;
  97319. setTimeout(function() {
  97320. _this7.setupInitialPlaylist(_this7.src);
  97321. }, 0);
  97322. return;
  97323. }
  97324. this.request = this.vhs_.xhr({
  97325. uri: this.src,
  97326. withCredentials: this.withCredentials
  97327. }, function(error, req) {
  97328. if (!_this7.request) {
  97329. return;
  97330. }
  97331. _this7.request = null;
  97332. if (error) {
  97333. _this7.error = {
  97334. status: req.status,
  97335. message: "HLS playlist request error at URL: " + _this7.src + ".",
  97336. responseText: req.responseText,
  97337. code: 2
  97338. };
  97339. if (_this7.state === "HAVE_NOTHING") {
  97340. _this7.started = false;
  97341. }
  97342. return _this7.trigger("error");
  97343. }
  97344. _this7.src = resolveManifestRedirect(_this7.handleManifestRedirects, _this7.src, req);
  97345. var manifest = _this7.parseManifest_({
  97346. manifestString: req.responseText,
  97347. url: _this7.src
  97348. });
  97349. _this7.setupInitialPlaylist(manifest);
  97350. });
  97351. };
  97352. _proto.srcUri = function srcUri() {
  97353. return typeof this.src === "string" ? this.src : this.src.uri;
  97354. };
  97355. _proto.setupInitialPlaylist = function setupInitialPlaylist(manifest) {
  97356. this.state = "HAVE_MASTER";
  97357. if (manifest.playlists) {
  97358. this.master = manifest;
  97359. addPropertiesToMaster(this.master, this.srcUri());
  97360. manifest.playlists.forEach(function(playlist) {
  97361. playlist.segments = getAllSegments(playlist);
  97362. playlist.segments.forEach(function(segment) {
  97363. resolveSegmentUris(segment, playlist.resolvedUri);
  97364. });
  97365. });
  97366. this.trigger("loadedplaylist");
  97367. if (!this.request) {
  97368. this.media(this.master.playlists[0]);
  97369. }
  97370. return;
  97371. }
  97372. var uri = this.srcUri() || window_1.location.href;
  97373. this.master = masterForMedia(manifest, uri);
  97374. this.haveMetadata({
  97375. playlistObject: manifest,
  97376. url: uri,
  97377. id: this.master.playlists[0].id
  97378. });
  97379. this.trigger("loadedmetadata");
  97380. };
  97381. return PlaylistLoader2;
  97382. }(EventTarget$1);
  97383. var videojsXHR = videojs.xhr, mergeOptions$1$1 = videojs.mergeOptions;
  97384. var callbackWrapper = function callbackWrapper2(request, error, response, callback2) {
  97385. var reqResponse = request.responseType === "arraybuffer" ? request.response : request.responseText;
  97386. if (!error && reqResponse) {
  97387. request.responseTime = Date.now();
  97388. request.roundTripTime = request.responseTime - request.requestTime;
  97389. request.bytesReceived = reqResponse.byteLength || reqResponse.length;
  97390. if (!request.bandwidth) {
  97391. request.bandwidth = Math.floor(request.bytesReceived / request.roundTripTime * 8 * 1e3);
  97392. }
  97393. }
  97394. if (response.headers) {
  97395. request.responseHeaders = response.headers;
  97396. }
  97397. if (error && error.code === "ETIMEDOUT") {
  97398. request.timedout = true;
  97399. }
  97400. if (!error && !request.aborted && response.statusCode !== 200 && response.statusCode !== 206 && response.statusCode !== 0) {
  97401. error = new Error("XHR Failed with a response of: " + (request && (reqResponse || request.responseText)));
  97402. }
  97403. callback2(error, request);
  97404. };
  97405. var xhrFactory = function xhrFactory2() {
  97406. var xhr = function XhrFunction(options2, callback2) {
  97407. options2 = mergeOptions$1$1({
  97408. timeout: 45e3
  97409. }, options2);
  97410. var beforeRequest = XhrFunction.beforeRequest || videojs.Vhs.xhr.beforeRequest;
  97411. if (beforeRequest && typeof beforeRequest === "function") {
  97412. var newOptions = beforeRequest(options2);
  97413. if (newOptions) {
  97414. options2 = newOptions;
  97415. }
  97416. }
  97417. var xhrMethod = videojs.Vhs.xhr.original === true ? videojsXHR : videojs.Vhs.xhr;
  97418. var request = xhrMethod(options2, function(error, response) {
  97419. return callbackWrapper(request, error, response, callback2);
  97420. });
  97421. var originalAbort = request.abort;
  97422. request.abort = function() {
  97423. request.aborted = true;
  97424. return originalAbort.apply(request, arguments);
  97425. };
  97426. request.uri = options2.uri;
  97427. request.requestTime = Date.now();
  97428. return request;
  97429. };
  97430. xhr.original = true;
  97431. return xhr;
  97432. };
  97433. var byterangeStr = function byterangeStr2(byterange) {
  97434. var byterangeEnd;
  97435. var byterangeStart = byterange.offset;
  97436. if (typeof byterange.offset === "bigint" || typeof byterange.length === "bigint") {
  97437. byterangeEnd = window_1.BigInt(byterange.offset) + window_1.BigInt(byterange.length) - window_1.BigInt(1);
  97438. } else {
  97439. byterangeEnd = byterange.offset + byterange.length - 1;
  97440. }
  97441. return "bytes=" + byterangeStart + "-" + byterangeEnd;
  97442. };
  97443. var segmentXhrHeaders = function segmentXhrHeaders2(segment) {
  97444. var headers = {};
  97445. if (segment.byterange) {
  97446. headers.Range = byterangeStr(segment.byterange);
  97447. }
  97448. return headers;
  97449. };
  97450. var textRange = function textRange2(range3, i2) {
  97451. return range3.start(i2) + "-" + range3.end(i2);
  97452. };
  97453. var formatHexString = function formatHexString2(e, i2) {
  97454. var value = e.toString(16);
  97455. return "00".substring(0, 2 - value.length) + value + (i2 % 2 ? " " : "");
  97456. };
  97457. var formatAsciiString = function formatAsciiString2(e) {
  97458. if (e >= 32 && e < 126) {
  97459. return String.fromCharCode(e);
  97460. }
  97461. return ".";
  97462. };
  97463. var createTransferableMessage = function createTransferableMessage2(message) {
  97464. var transferable = {};
  97465. Object.keys(message).forEach(function(key) {
  97466. var value = message[key];
  97467. if (isArrayBufferView2(value)) {
  97468. transferable[key] = {
  97469. bytes: value.buffer,
  97470. byteOffset: value.byteOffset,
  97471. byteLength: value.byteLength
  97472. };
  97473. } else {
  97474. transferable[key] = value;
  97475. }
  97476. });
  97477. return transferable;
  97478. };
  97479. var initSegmentId = function initSegmentId2(initSegment) {
  97480. var byterange = initSegment.byterange || {
  97481. length: Infinity,
  97482. offset: 0
  97483. };
  97484. return [byterange.length, byterange.offset, initSegment.resolvedUri].join(",");
  97485. };
  97486. var segmentKeyId = function segmentKeyId2(key) {
  97487. return key.resolvedUri;
  97488. };
  97489. var hexDump = function hexDump2(data) {
  97490. var bytes = Array.prototype.slice.call(data);
  97491. var step = 16;
  97492. var result = "";
  97493. var hex;
  97494. var ascii;
  97495. for (var j = 0; j < bytes.length / step; j++) {
  97496. hex = bytes.slice(j * step, j * step + step).map(formatHexString).join("");
  97497. ascii = bytes.slice(j * step, j * step + step).map(formatAsciiString).join("");
  97498. result += hex + " " + ascii + "\n";
  97499. }
  97500. return result;
  97501. };
  97502. var tagDump = function tagDump2(_ref) {
  97503. var bytes = _ref.bytes;
  97504. return hexDump(bytes);
  97505. };
  97506. var textRanges = function textRanges2(ranges) {
  97507. var result = "";
  97508. var i2;
  97509. for (i2 = 0; i2 < ranges.length; i2++) {
  97510. result += textRange(ranges, i2) + " ";
  97511. }
  97512. return result;
  97513. };
  97514. var utils = /* @__PURE__ */ Object.freeze({
  97515. __proto__: null,
  97516. createTransferableMessage,
  97517. initSegmentId,
  97518. segmentKeyId,
  97519. hexDump,
  97520. tagDump,
  97521. textRanges
  97522. });
  97523. var SEGMENT_END_FUDGE_PERCENT = 0.25;
  97524. var playerTimeToProgramTime = function playerTimeToProgramTime2(playerTime, segment) {
  97525. if (!segment.dateTimeObject) {
  97526. return null;
  97527. }
  97528. var transmuxerPrependedSeconds = segment.videoTimingInfo.transmuxerPrependedSeconds;
  97529. var transmuxedStart = segment.videoTimingInfo.transmuxedPresentationStart;
  97530. var startOfSegment = transmuxedStart + transmuxerPrependedSeconds;
  97531. var offsetFromSegmentStart = playerTime - startOfSegment;
  97532. return new Date(segment.dateTimeObject.getTime() + offsetFromSegmentStart * 1e3);
  97533. };
  97534. var originalSegmentVideoDuration = function originalSegmentVideoDuration2(videoTimingInfo) {
  97535. return videoTimingInfo.transmuxedPresentationEnd - videoTimingInfo.transmuxedPresentationStart - videoTimingInfo.transmuxerPrependedSeconds;
  97536. };
  97537. var findSegmentForProgramTime = function findSegmentForProgramTime2(programTime, playlist) {
  97538. var dateTimeObject;
  97539. try {
  97540. dateTimeObject = new Date(programTime);
  97541. } catch (e) {
  97542. return null;
  97543. }
  97544. if (!playlist || !playlist.segments || playlist.segments.length === 0) {
  97545. return null;
  97546. }
  97547. var segment = playlist.segments[0];
  97548. if (dateTimeObject < segment.dateTimeObject) {
  97549. return null;
  97550. }
  97551. for (var i2 = 0; i2 < playlist.segments.length - 1; i2++) {
  97552. segment = playlist.segments[i2];
  97553. var nextSegmentStart = playlist.segments[i2 + 1].dateTimeObject;
  97554. if (dateTimeObject < nextSegmentStart) {
  97555. break;
  97556. }
  97557. }
  97558. var lastSegment = playlist.segments[playlist.segments.length - 1];
  97559. var lastSegmentStart = lastSegment.dateTimeObject;
  97560. var lastSegmentDuration = lastSegment.videoTimingInfo ? originalSegmentVideoDuration(lastSegment.videoTimingInfo) : lastSegment.duration + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT;
  97561. var lastSegmentEnd = new Date(lastSegmentStart.getTime() + lastSegmentDuration * 1e3);
  97562. if (dateTimeObject > lastSegmentEnd) {
  97563. return null;
  97564. }
  97565. if (dateTimeObject > lastSegmentStart) {
  97566. segment = lastSegment;
  97567. }
  97568. return {
  97569. segment,
  97570. estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : Playlist.duration(playlist, playlist.mediaSequence + playlist.segments.indexOf(segment)),
  97571. type: segment.videoTimingInfo ? "accurate" : "estimate"
  97572. };
  97573. };
  97574. var findSegmentForPlayerTime = function findSegmentForPlayerTime2(time, playlist) {
  97575. if (!playlist || !playlist.segments || playlist.segments.length === 0) {
  97576. return null;
  97577. }
  97578. var segmentEnd = 0;
  97579. var segment;
  97580. for (var i2 = 0; i2 < playlist.segments.length; i2++) {
  97581. segment = playlist.segments[i2];
  97582. segmentEnd = segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationEnd : segmentEnd + segment.duration;
  97583. if (time <= segmentEnd) {
  97584. break;
  97585. }
  97586. }
  97587. var lastSegment = playlist.segments[playlist.segments.length - 1];
  97588. if (lastSegment.videoTimingInfo && lastSegment.videoTimingInfo.transmuxedPresentationEnd < time) {
  97589. return null;
  97590. }
  97591. if (time > segmentEnd) {
  97592. if (time > segmentEnd + lastSegment.duration * SEGMENT_END_FUDGE_PERCENT) {
  97593. return null;
  97594. }
  97595. segment = lastSegment;
  97596. }
  97597. return {
  97598. segment,
  97599. estimatedStart: segment.videoTimingInfo ? segment.videoTimingInfo.transmuxedPresentationStart : segmentEnd - segment.duration,
  97600. type: segment.videoTimingInfo ? "accurate" : "estimate"
  97601. };
  97602. };
  97603. var getOffsetFromTimestamp = function getOffsetFromTimestamp2(comparisonTimeStamp, programTime) {
  97604. var segmentDateTime;
  97605. var programDateTime;
  97606. try {
  97607. segmentDateTime = new Date(comparisonTimeStamp);
  97608. programDateTime = new Date(programTime);
  97609. } catch (e) {
  97610. }
  97611. var segmentTimeEpoch = segmentDateTime.getTime();
  97612. var programTimeEpoch = programDateTime.getTime();
  97613. return (programTimeEpoch - segmentTimeEpoch) / 1e3;
  97614. };
  97615. var verifyProgramDateTimeTags = function verifyProgramDateTimeTags2(playlist) {
  97616. if (!playlist.segments || playlist.segments.length === 0) {
  97617. return false;
  97618. }
  97619. for (var i2 = 0; i2 < playlist.segments.length; i2++) {
  97620. var segment = playlist.segments[i2];
  97621. if (!segment.dateTimeObject) {
  97622. return false;
  97623. }
  97624. }
  97625. return true;
  97626. };
  97627. var getProgramTime = function getProgramTime2(_ref) {
  97628. var playlist = _ref.playlist, _ref$time = _ref.time, time = _ref$time === void 0 ? void 0 : _ref$time, callback2 = _ref.callback;
  97629. if (!callback2) {
  97630. throw new Error("getProgramTime: callback must be provided");
  97631. }
  97632. if (!playlist || time === void 0) {
  97633. return callback2({
  97634. message: "getProgramTime: playlist and time must be provided"
  97635. });
  97636. }
  97637. var matchedSegment = findSegmentForPlayerTime(time, playlist);
  97638. if (!matchedSegment) {
  97639. return callback2({
  97640. message: "valid programTime was not found"
  97641. });
  97642. }
  97643. if (matchedSegment.type === "estimate") {
  97644. return callback2({
  97645. message: "Accurate programTime could not be determined. Please seek to e.seekTime and try again",
  97646. seekTime: matchedSegment.estimatedStart
  97647. });
  97648. }
  97649. var programTimeObject = {
  97650. mediaSeconds: time
  97651. };
  97652. var programTime = playerTimeToProgramTime(time, matchedSegment.segment);
  97653. if (programTime) {
  97654. programTimeObject.programDateTime = programTime.toISOString();
  97655. }
  97656. return callback2(null, programTimeObject);
  97657. };
  97658. var seekToProgramTime = function seekToProgramTime2(_ref2) {
  97659. var programTime = _ref2.programTime, playlist = _ref2.playlist, _ref2$retryCount = _ref2.retryCount, retryCount = _ref2$retryCount === void 0 ? 2 : _ref2$retryCount, seekTo = _ref2.seekTo, _ref2$pauseAfterSeek = _ref2.pauseAfterSeek, pauseAfterSeek = _ref2$pauseAfterSeek === void 0 ? true : _ref2$pauseAfterSeek, tech = _ref2.tech, callback2 = _ref2.callback;
  97660. if (!callback2) {
  97661. throw new Error("seekToProgramTime: callback must be provided");
  97662. }
  97663. if (typeof programTime === "undefined" || !playlist || !seekTo) {
  97664. return callback2({
  97665. message: "seekToProgramTime: programTime, seekTo and playlist must be provided"
  97666. });
  97667. }
  97668. if (!playlist.endList && !tech.hasStarted_) {
  97669. return callback2({
  97670. message: "player must be playing a live stream to start buffering"
  97671. });
  97672. }
  97673. if (!verifyProgramDateTimeTags(playlist)) {
  97674. return callback2({
  97675. message: "programDateTime tags must be provided in the manifest " + playlist.resolvedUri
  97676. });
  97677. }
  97678. var matchedSegment = findSegmentForProgramTime(programTime, playlist);
  97679. if (!matchedSegment) {
  97680. return callback2({
  97681. message: programTime + " was not found in the stream"
  97682. });
  97683. }
  97684. var segment = matchedSegment.segment;
  97685. var mediaOffset = getOffsetFromTimestamp(segment.dateTimeObject, programTime);
  97686. if (matchedSegment.type === "estimate") {
  97687. if (retryCount === 0) {
  97688. return callback2({
  97689. message: programTime + " is not buffered yet. Try again"
  97690. });
  97691. }
  97692. seekTo(matchedSegment.estimatedStart + mediaOffset);
  97693. tech.one("seeked", function() {
  97694. seekToProgramTime2({
  97695. programTime,
  97696. playlist,
  97697. retryCount: retryCount - 1,
  97698. seekTo,
  97699. pauseAfterSeek,
  97700. tech,
  97701. callback: callback2
  97702. });
  97703. });
  97704. return;
  97705. }
  97706. var seekToTime = segment.start + mediaOffset;
  97707. var seekedCallback = function seekedCallback2() {
  97708. return callback2(null, tech.currentTime());
  97709. };
  97710. tech.one("seeked", seekedCallback);
  97711. if (pauseAfterSeek) {
  97712. tech.pause();
  97713. }
  97714. seekTo(seekToTime);
  97715. };
  97716. var callbackOnCompleted = function callbackOnCompleted2(request, cb) {
  97717. if (request.readyState === 4) {
  97718. return cb();
  97719. }
  97720. return;
  97721. };
  97722. var containerRequest = function containerRequest2(uri, xhr, cb) {
  97723. var bytes = [];
  97724. var id3Offset;
  97725. var finished = false;
  97726. var endRequestAndCallback = function endRequestAndCallback2(err, req, type2, _bytes) {
  97727. req.abort();
  97728. finished = true;
  97729. return cb(err, req, type2, _bytes);
  97730. };
  97731. var progressListener = function progressListener2(error, request2) {
  97732. if (finished) {
  97733. return;
  97734. }
  97735. if (error) {
  97736. return endRequestAndCallback(error, request2, "", bytes);
  97737. }
  97738. var newPart = request2.responseText.substring(bytes && bytes.byteLength || 0, request2.responseText.length);
  97739. bytes = concatTypedArrays2(bytes, stringToBytes2(newPart, true));
  97740. id3Offset = id3Offset || getId3Offset2(bytes);
  97741. if (bytes.length < 10 || id3Offset && bytes.length < id3Offset + 2) {
  97742. return callbackOnCompleted(request2, function() {
  97743. return endRequestAndCallback(error, request2, "", bytes);
  97744. });
  97745. }
  97746. var type2 = detectContainerForBytes2(bytes);
  97747. if (type2 === "ts" && bytes.length < 188) {
  97748. return callbackOnCompleted(request2, function() {
  97749. return endRequestAndCallback(error, request2, "", bytes);
  97750. });
  97751. }
  97752. if (!type2 && bytes.length < 376) {
  97753. return callbackOnCompleted(request2, function() {
  97754. return endRequestAndCallback(error, request2, "", bytes);
  97755. });
  97756. }
  97757. return endRequestAndCallback(null, request2, type2, bytes);
  97758. };
  97759. var options2 = {
  97760. uri,
  97761. beforeSend: function beforeSend(request2) {
  97762. request2.overrideMimeType("text/plain; charset=x-user-defined");
  97763. request2.addEventListener("progress", function(_ref) {
  97764. _ref.total;
  97765. _ref.loaded;
  97766. return callbackWrapper(request2, null, {
  97767. statusCode: request2.status
  97768. }, progressListener);
  97769. });
  97770. }
  97771. };
  97772. var request = xhr(options2, function(error, response) {
  97773. return callbackWrapper(request, error, response, progressListener);
  97774. });
  97775. return request;
  97776. };
  97777. var EventTarget2 = videojs.EventTarget, mergeOptions$4 = videojs.mergeOptions;
  97778. var dashPlaylistUnchanged = function dashPlaylistUnchanged2(a, b) {
  97779. if (!isPlaylistUnchanged(a, b)) {
  97780. return false;
  97781. }
  97782. if (a.sidx && b.sidx && (a.sidx.offset !== b.sidx.offset || a.sidx.length !== b.sidx.length)) {
  97783. return false;
  97784. } else if (!a.sidx && b.sidx || a.sidx && !b.sidx) {
  97785. return false;
  97786. }
  97787. if (a.segments && !b.segments || !a.segments && b.segments) {
  97788. return false;
  97789. }
  97790. if (!a.segments && !b.segments) {
  97791. return true;
  97792. }
  97793. for (var i2 = 0; i2 < a.segments.length; i2++) {
  97794. var aSegment = a.segments[i2];
  97795. var bSegment = b.segments[i2];
  97796. if (aSegment.uri !== bSegment.uri) {
  97797. return false;
  97798. }
  97799. if (!aSegment.byterange && !bSegment.byterange) {
  97800. continue;
  97801. }
  97802. var aByterange = aSegment.byterange;
  97803. var bByterange = bSegment.byterange;
  97804. if (aByterange && !bByterange || !aByterange && bByterange) {
  97805. return false;
  97806. }
  97807. if (aByterange.offset !== bByterange.offset || aByterange.length !== bByterange.length) {
  97808. return false;
  97809. }
  97810. }
  97811. return true;
  97812. };
  97813. var dashGroupId = function dashGroupId2(type2, group, label, playlist) {
  97814. var playlistId = playlist.attributes.NAME || label;
  97815. return "placeholder-uri-" + type2 + "-" + group + "-" + playlistId;
  97816. };
  97817. var parseMasterXml = function parseMasterXml2(_ref) {
  97818. var masterXml = _ref.masterXml, srcUrl = _ref.srcUrl, clientOffset = _ref.clientOffset, sidxMapping = _ref.sidxMapping, previousManifest = _ref.previousManifest;
  97819. var manifest = parse(masterXml, {
  97820. manifestUri: srcUrl,
  97821. clientOffset,
  97822. sidxMapping,
  97823. previousManifest
  97824. });
  97825. addPropertiesToMaster(manifest, srcUrl, dashGroupId);
  97826. return manifest;
  97827. };
  97828. var removeOldMediaGroupLabels = function removeOldMediaGroupLabels2(update, newMaster) {
  97829. forEachMediaGroup3(update, function(properties, type2, group, label) {
  97830. if (!(label in newMaster.mediaGroups[type2][group])) {
  97831. delete update.mediaGroups[type2][group][label];
  97832. }
  97833. });
  97834. };
  97835. var updateMaster2 = function updateMaster3(oldMaster, newMaster, sidxMapping) {
  97836. var noChanges = true;
  97837. var update = mergeOptions$4(oldMaster, {
  97838. duration: newMaster.duration,
  97839. minimumUpdatePeriod: newMaster.minimumUpdatePeriod,
  97840. timelineStarts: newMaster.timelineStarts
  97841. });
  97842. for (var i2 = 0; i2 < newMaster.playlists.length; i2++) {
  97843. var playlist = newMaster.playlists[i2];
  97844. if (playlist.sidx) {
  97845. var sidxKey = generateSidxKey(playlist.sidx);
  97846. if (sidxMapping && sidxMapping[sidxKey] && sidxMapping[sidxKey].sidx) {
  97847. addSidxSegmentsToPlaylist$1(playlist, sidxMapping[sidxKey].sidx, playlist.sidx.resolvedUri);
  97848. }
  97849. }
  97850. var playlistUpdate = updateMaster$1(update, playlist, dashPlaylistUnchanged);
  97851. if (playlistUpdate) {
  97852. update = playlistUpdate;
  97853. noChanges = false;
  97854. }
  97855. }
  97856. forEachMediaGroup3(newMaster, function(properties, type2, group, label) {
  97857. if (properties.playlists && properties.playlists.length) {
  97858. var id = properties.playlists[0].id;
  97859. var _playlistUpdate = updateMaster$1(update, properties.playlists[0], dashPlaylistUnchanged);
  97860. if (_playlistUpdate) {
  97861. update = _playlistUpdate;
  97862. if (!(label in update.mediaGroups[type2][group])) {
  97863. update.mediaGroups[type2][group][label] = properties;
  97864. }
  97865. update.mediaGroups[type2][group][label].playlists[0] = update.playlists[id];
  97866. noChanges = false;
  97867. }
  97868. }
  97869. });
  97870. removeOldMediaGroupLabels(update, newMaster);
  97871. if (newMaster.minimumUpdatePeriod !== oldMaster.minimumUpdatePeriod) {
  97872. noChanges = false;
  97873. }
  97874. if (noChanges) {
  97875. return null;
  97876. }
  97877. return update;
  97878. };
  97879. var equivalentSidx = function equivalentSidx2(a, b) {
  97880. var neitherMap = Boolean(!a.map && !b.map);
  97881. var equivalentMap = neitherMap || Boolean(a.map && b.map && a.map.byterange.offset === b.map.byterange.offset && a.map.byterange.length === b.map.byterange.length);
  97882. return equivalentMap && a.uri === b.uri && a.byterange.offset === b.byterange.offset && a.byterange.length === b.byterange.length;
  97883. };
  97884. var compareSidxEntry = function compareSidxEntry2(playlists, oldSidxMapping) {
  97885. var newSidxMapping = {};
  97886. for (var id in playlists) {
  97887. var playlist = playlists[id];
  97888. var currentSidxInfo = playlist.sidx;
  97889. if (currentSidxInfo) {
  97890. var key = generateSidxKey(currentSidxInfo);
  97891. if (!oldSidxMapping[key]) {
  97892. break;
  97893. }
  97894. var savedSidxInfo = oldSidxMapping[key].sidxInfo;
  97895. if (equivalentSidx(savedSidxInfo, currentSidxInfo)) {
  97896. newSidxMapping[key] = oldSidxMapping[key];
  97897. }
  97898. }
  97899. }
  97900. return newSidxMapping;
  97901. };
  97902. var filterChangedSidxMappings = function filterChangedSidxMappings2(master, oldSidxMapping) {
  97903. var videoSidx = compareSidxEntry(master.playlists, oldSidxMapping);
  97904. var mediaGroupSidx = videoSidx;
  97905. forEachMediaGroup3(master, function(properties, mediaType, groupKey, labelKey) {
  97906. if (properties.playlists && properties.playlists.length) {
  97907. var playlists = properties.playlists;
  97908. mediaGroupSidx = mergeOptions$4(mediaGroupSidx, compareSidxEntry(playlists, oldSidxMapping));
  97909. }
  97910. });
  97911. return mediaGroupSidx;
  97912. };
  97913. var DashPlaylistLoader = /* @__PURE__ */ function(_EventTarget) {
  97914. _inheritsLoose(DashPlaylistLoader2, _EventTarget);
  97915. function DashPlaylistLoader2(srcUrlOrPlaylist, vhs, options2, masterPlaylistLoader) {
  97916. var _this;
  97917. if (options2 === void 0) {
  97918. options2 = {};
  97919. }
  97920. _this = _EventTarget.call(this) || this;
  97921. _this.masterPlaylistLoader_ = masterPlaylistLoader || _assertThisInitialized(_this);
  97922. if (!masterPlaylistLoader) {
  97923. _this.isMaster_ = true;
  97924. }
  97925. var _options = options2, _options$withCredenti = _options.withCredentials, withCredentials = _options$withCredenti === void 0 ? false : _options$withCredenti, _options$handleManife = _options.handleManifestRedirects, handleManifestRedirects = _options$handleManife === void 0 ? false : _options$handleManife;
  97926. _this.vhs_ = vhs;
  97927. _this.withCredentials = withCredentials;
  97928. _this.handleManifestRedirects = handleManifestRedirects;
  97929. if (!srcUrlOrPlaylist) {
  97930. throw new Error("A non-empty playlist URL or object is required");
  97931. }
  97932. _this.on("minimumUpdatePeriod", function() {
  97933. _this.refreshXml_();
  97934. });
  97935. _this.on("mediaupdatetimeout", function() {
  97936. _this.refreshMedia_(_this.media().id);
  97937. });
  97938. _this.state = "HAVE_NOTHING";
  97939. _this.loadedPlaylists_ = {};
  97940. _this.logger_ = logger("DashPlaylistLoader");
  97941. if (_this.isMaster_) {
  97942. _this.masterPlaylistLoader_.srcUrl = srcUrlOrPlaylist;
  97943. _this.masterPlaylistLoader_.sidxMapping_ = {};
  97944. } else {
  97945. _this.childPlaylist_ = srcUrlOrPlaylist;
  97946. }
  97947. return _this;
  97948. }
  97949. var _proto = DashPlaylistLoader2.prototype;
  97950. _proto.requestErrored_ = function requestErrored_(err, request, startingState) {
  97951. if (!this.request) {
  97952. return true;
  97953. }
  97954. this.request = null;
  97955. if (err) {
  97956. this.error = typeof err === "object" && !(err instanceof Error) ? err : {
  97957. status: request.status,
  97958. message: "DASH request error at URL: " + request.uri,
  97959. response: request.response,
  97960. code: 2
  97961. };
  97962. if (startingState) {
  97963. this.state = startingState;
  97964. }
  97965. this.trigger("error");
  97966. return true;
  97967. }
  97968. };
  97969. _proto.addSidxSegments_ = function addSidxSegments_(playlist, startingState, cb) {
  97970. var _this2 = this;
  97971. var sidxKey = playlist.sidx && generateSidxKey(playlist.sidx);
  97972. if (!playlist.sidx || !sidxKey || this.masterPlaylistLoader_.sidxMapping_[sidxKey]) {
  97973. this.mediaRequest_ = window_1.setTimeout(function() {
  97974. return cb(false);
  97975. }, 0);
  97976. return;
  97977. }
  97978. var uri = resolveManifestRedirect(this.handleManifestRedirects, playlist.sidx.resolvedUri);
  97979. var fin = function fin2(err, request) {
  97980. if (_this2.requestErrored_(err, request, startingState)) {
  97981. return;
  97982. }
  97983. var sidxMapping = _this2.masterPlaylistLoader_.sidxMapping_;
  97984. var sidx;
  97985. try {
  97986. sidx = parseSidx_1(toUint82(request.response).subarray(8));
  97987. } catch (e) {
  97988. _this2.requestErrored_(e, request, startingState);
  97989. return;
  97990. }
  97991. sidxMapping[sidxKey] = {
  97992. sidxInfo: playlist.sidx,
  97993. sidx
  97994. };
  97995. addSidxSegmentsToPlaylist$1(playlist, sidx, playlist.sidx.resolvedUri);
  97996. return cb(true);
  97997. };
  97998. this.request = containerRequest(uri, this.vhs_.xhr, function(err, request, container, bytes) {
  97999. if (err) {
  98000. return fin(err, request);
  98001. }
  98002. if (!container || container !== "mp4") {
  98003. return fin({
  98004. status: request.status,
  98005. message: "Unsupported " + (container || "unknown") + " container type for sidx segment at URL: " + uri,
  98006. response: "",
  98007. playlist,
  98008. internal: true,
  98009. blacklistDuration: Infinity,
  98010. code: 2
  98011. }, request);
  98012. }
  98013. var _playlist$sidx$bytera = playlist.sidx.byterange, offset = _playlist$sidx$bytera.offset, length = _playlist$sidx$bytera.length;
  98014. if (bytes.length >= length + offset) {
  98015. return fin(err, {
  98016. response: bytes.subarray(offset, offset + length),
  98017. status: request.status,
  98018. uri: request.uri
  98019. });
  98020. }
  98021. _this2.request = _this2.vhs_.xhr({
  98022. uri,
  98023. responseType: "arraybuffer",
  98024. headers: segmentXhrHeaders({
  98025. byterange: playlist.sidx.byterange
  98026. })
  98027. }, fin);
  98028. });
  98029. };
  98030. _proto.dispose = function dispose() {
  98031. this.trigger("dispose");
  98032. this.stopRequest();
  98033. this.loadedPlaylists_ = {};
  98034. window_1.clearTimeout(this.minimumUpdatePeriodTimeout_);
  98035. window_1.clearTimeout(this.mediaRequest_);
  98036. window_1.clearTimeout(this.mediaUpdateTimeout);
  98037. this.mediaUpdateTimeout = null;
  98038. this.mediaRequest_ = null;
  98039. this.minimumUpdatePeriodTimeout_ = null;
  98040. if (this.masterPlaylistLoader_.createMupOnMedia_) {
  98041. this.off("loadedmetadata", this.masterPlaylistLoader_.createMupOnMedia_);
  98042. this.masterPlaylistLoader_.createMupOnMedia_ = null;
  98043. }
  98044. this.off();
  98045. };
  98046. _proto.hasPendingRequest = function hasPendingRequest() {
  98047. return this.request || this.mediaRequest_;
  98048. };
  98049. _proto.stopRequest = function stopRequest() {
  98050. if (this.request) {
  98051. var oldRequest = this.request;
  98052. this.request = null;
  98053. oldRequest.onreadystatechange = null;
  98054. oldRequest.abort();
  98055. }
  98056. };
  98057. _proto.media = function media(playlist) {
  98058. var _this3 = this;
  98059. if (!playlist) {
  98060. return this.media_;
  98061. }
  98062. if (this.state === "HAVE_NOTHING") {
  98063. throw new Error("Cannot switch media playlist from " + this.state);
  98064. }
  98065. var startingState = this.state;
  98066. if (typeof playlist === "string") {
  98067. if (!this.masterPlaylistLoader_.master.playlists[playlist]) {
  98068. throw new Error("Unknown playlist URI: " + playlist);
  98069. }
  98070. playlist = this.masterPlaylistLoader_.master.playlists[playlist];
  98071. }
  98072. var mediaChange = !this.media_ || playlist.id !== this.media_.id;
  98073. if (mediaChange && this.loadedPlaylists_[playlist.id] && this.loadedPlaylists_[playlist.id].endList) {
  98074. this.state = "HAVE_METADATA";
  98075. this.media_ = playlist;
  98076. if (mediaChange) {
  98077. this.trigger("mediachanging");
  98078. this.trigger("mediachange");
  98079. }
  98080. return;
  98081. }
  98082. if (!mediaChange) {
  98083. return;
  98084. }
  98085. if (this.media_) {
  98086. this.trigger("mediachanging");
  98087. }
  98088. this.addSidxSegments_(playlist, startingState, function(sidxChanged) {
  98089. _this3.haveMetadata({
  98090. startingState,
  98091. playlist
  98092. });
  98093. });
  98094. };
  98095. _proto.haveMetadata = function haveMetadata(_ref2) {
  98096. var startingState = _ref2.startingState, playlist = _ref2.playlist;
  98097. this.state = "HAVE_METADATA";
  98098. this.loadedPlaylists_[playlist.id] = playlist;
  98099. this.mediaRequest_ = null;
  98100. this.refreshMedia_(playlist.id);
  98101. if (startingState === "HAVE_MASTER") {
  98102. this.trigger("loadedmetadata");
  98103. } else {
  98104. this.trigger("mediachange");
  98105. }
  98106. };
  98107. _proto.pause = function pause() {
  98108. if (this.masterPlaylistLoader_.createMupOnMedia_) {
  98109. this.off("loadedmetadata", this.masterPlaylistLoader_.createMupOnMedia_);
  98110. this.masterPlaylistLoader_.createMupOnMedia_ = null;
  98111. }
  98112. this.stopRequest();
  98113. window_1.clearTimeout(this.mediaUpdateTimeout);
  98114. this.mediaUpdateTimeout = null;
  98115. if (this.isMaster_) {
  98116. window_1.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_);
  98117. this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_ = null;
  98118. }
  98119. if (this.state === "HAVE_NOTHING") {
  98120. this.started = false;
  98121. }
  98122. };
  98123. _proto.load = function load(isFinalRendition) {
  98124. var _this4 = this;
  98125. window_1.clearTimeout(this.mediaUpdateTimeout);
  98126. this.mediaUpdateTimeout = null;
  98127. var media = this.media();
  98128. if (isFinalRendition) {
  98129. var delay = media ? media.targetDuration / 2 * 1e3 : 5 * 1e3;
  98130. this.mediaUpdateTimeout = window_1.setTimeout(function() {
  98131. return _this4.load();
  98132. }, delay);
  98133. return;
  98134. }
  98135. if (!this.started) {
  98136. this.start();
  98137. return;
  98138. }
  98139. if (media && !media.endList) {
  98140. if (this.isMaster_ && !this.minimumUpdatePeriodTimeout_) {
  98141. this.trigger("minimumUpdatePeriod");
  98142. this.updateMinimumUpdatePeriodTimeout_();
  98143. }
  98144. this.trigger("mediaupdatetimeout");
  98145. } else {
  98146. this.trigger("loadedplaylist");
  98147. }
  98148. };
  98149. _proto.start = function start2() {
  98150. var _this5 = this;
  98151. this.started = true;
  98152. if (!this.isMaster_) {
  98153. this.mediaRequest_ = window_1.setTimeout(function() {
  98154. return _this5.haveMaster_();
  98155. }, 0);
  98156. return;
  98157. }
  98158. this.requestMaster_(function(req, masterChanged) {
  98159. _this5.haveMaster_();
  98160. if (!_this5.hasPendingRequest() && !_this5.media_) {
  98161. _this5.media(_this5.masterPlaylistLoader_.master.playlists[0]);
  98162. }
  98163. });
  98164. };
  98165. _proto.requestMaster_ = function requestMaster_(cb) {
  98166. var _this6 = this;
  98167. this.request = this.vhs_.xhr({
  98168. uri: this.masterPlaylistLoader_.srcUrl,
  98169. withCredentials: this.withCredentials
  98170. }, function(error, req) {
  98171. if (_this6.requestErrored_(error, req)) {
  98172. if (_this6.state === "HAVE_NOTHING") {
  98173. _this6.started = false;
  98174. }
  98175. return;
  98176. }
  98177. var masterChanged = req.responseText !== _this6.masterPlaylistLoader_.masterXml_;
  98178. _this6.masterPlaylistLoader_.masterXml_ = req.responseText;
  98179. if (req.responseHeaders && req.responseHeaders.date) {
  98180. _this6.masterLoaded_ = Date.parse(req.responseHeaders.date);
  98181. } else {
  98182. _this6.masterLoaded_ = Date.now();
  98183. }
  98184. _this6.masterPlaylistLoader_.srcUrl = resolveManifestRedirect(_this6.handleManifestRedirects, _this6.masterPlaylistLoader_.srcUrl, req);
  98185. if (masterChanged) {
  98186. _this6.handleMaster_();
  98187. _this6.syncClientServerClock_(function() {
  98188. return cb(req, masterChanged);
  98189. });
  98190. return;
  98191. }
  98192. return cb(req, masterChanged);
  98193. });
  98194. };
  98195. _proto.syncClientServerClock_ = function syncClientServerClock_(done) {
  98196. var _this7 = this;
  98197. var utcTiming = parseUTCTiming(this.masterPlaylistLoader_.masterXml_);
  98198. if (utcTiming === null) {
  98199. this.masterPlaylistLoader_.clientOffset_ = this.masterLoaded_ - Date.now();
  98200. return done();
  98201. }
  98202. if (utcTiming.method === "DIRECT") {
  98203. this.masterPlaylistLoader_.clientOffset_ = utcTiming.value - Date.now();
  98204. return done();
  98205. }
  98206. this.request = this.vhs_.xhr({
  98207. uri: resolveUrl4(this.masterPlaylistLoader_.srcUrl, utcTiming.value),
  98208. method: utcTiming.method,
  98209. withCredentials: this.withCredentials
  98210. }, function(error, req) {
  98211. if (!_this7.request) {
  98212. return;
  98213. }
  98214. if (error) {
  98215. _this7.masterPlaylistLoader_.clientOffset_ = _this7.masterLoaded_ - Date.now();
  98216. return done();
  98217. }
  98218. var serverTime;
  98219. if (utcTiming.method === "HEAD") {
  98220. if (!req.responseHeaders || !req.responseHeaders.date) {
  98221. serverTime = _this7.masterLoaded_;
  98222. } else {
  98223. serverTime = Date.parse(req.responseHeaders.date);
  98224. }
  98225. } else {
  98226. serverTime = Date.parse(req.responseText);
  98227. }
  98228. _this7.masterPlaylistLoader_.clientOffset_ = serverTime - Date.now();
  98229. done();
  98230. });
  98231. };
  98232. _proto.haveMaster_ = function haveMaster_() {
  98233. this.state = "HAVE_MASTER";
  98234. if (this.isMaster_) {
  98235. this.trigger("loadedplaylist");
  98236. } else if (!this.media_) {
  98237. this.media(this.childPlaylist_);
  98238. }
  98239. };
  98240. _proto.handleMaster_ = function handleMaster_() {
  98241. this.mediaRequest_ = null;
  98242. var oldMaster = this.masterPlaylistLoader_.master;
  98243. var newMaster = parseMasterXml({
  98244. masterXml: this.masterPlaylistLoader_.masterXml_,
  98245. srcUrl: this.masterPlaylistLoader_.srcUrl,
  98246. clientOffset: this.masterPlaylistLoader_.clientOffset_,
  98247. sidxMapping: this.masterPlaylistLoader_.sidxMapping_,
  98248. previousManifest: oldMaster
  98249. });
  98250. if (oldMaster) {
  98251. newMaster = updateMaster2(oldMaster, newMaster, this.masterPlaylistLoader_.sidxMapping_);
  98252. }
  98253. this.masterPlaylistLoader_.master = newMaster ? newMaster : oldMaster;
  98254. var location = this.masterPlaylistLoader_.master.locations && this.masterPlaylistLoader_.master.locations[0];
  98255. if (location && location !== this.masterPlaylistLoader_.srcUrl) {
  98256. this.masterPlaylistLoader_.srcUrl = location;
  98257. }
  98258. if (!oldMaster || newMaster && newMaster.minimumUpdatePeriod !== oldMaster.minimumUpdatePeriod) {
  98259. this.updateMinimumUpdatePeriodTimeout_();
  98260. }
  98261. return Boolean(newMaster);
  98262. };
  98263. _proto.updateMinimumUpdatePeriodTimeout_ = function updateMinimumUpdatePeriodTimeout_() {
  98264. var mpl = this.masterPlaylistLoader_;
  98265. if (mpl.createMupOnMedia_) {
  98266. mpl.off("loadedmetadata", mpl.createMupOnMedia_);
  98267. mpl.createMupOnMedia_ = null;
  98268. }
  98269. if (mpl.minimumUpdatePeriodTimeout_) {
  98270. window_1.clearTimeout(mpl.minimumUpdatePeriodTimeout_);
  98271. mpl.minimumUpdatePeriodTimeout_ = null;
  98272. }
  98273. var mup = mpl.master && mpl.master.minimumUpdatePeriod;
  98274. if (mup === 0) {
  98275. if (mpl.media()) {
  98276. mup = mpl.media().targetDuration * 1e3;
  98277. } else {
  98278. mpl.createMupOnMedia_ = mpl.updateMinimumUpdatePeriodTimeout_;
  98279. mpl.one("loadedmetadata", mpl.createMupOnMedia_);
  98280. }
  98281. }
  98282. if (typeof mup !== "number" || mup <= 0) {
  98283. if (mup < 0) {
  98284. this.logger_("found invalid minimumUpdatePeriod of " + mup + ", not setting a timeout");
  98285. }
  98286. return;
  98287. }
  98288. this.createMUPTimeout_(mup);
  98289. };
  98290. _proto.createMUPTimeout_ = function createMUPTimeout_(mup) {
  98291. var mpl = this.masterPlaylistLoader_;
  98292. mpl.minimumUpdatePeriodTimeout_ = window_1.setTimeout(function() {
  98293. mpl.minimumUpdatePeriodTimeout_ = null;
  98294. mpl.trigger("minimumUpdatePeriod");
  98295. mpl.createMUPTimeout_(mup);
  98296. }, mup);
  98297. };
  98298. _proto.refreshXml_ = function refreshXml_() {
  98299. var _this8 = this;
  98300. this.requestMaster_(function(req, masterChanged) {
  98301. if (!masterChanged) {
  98302. return;
  98303. }
  98304. if (_this8.media_) {
  98305. _this8.media_ = _this8.masterPlaylistLoader_.master.playlists[_this8.media_.id];
  98306. }
  98307. _this8.masterPlaylistLoader_.sidxMapping_ = filterChangedSidxMappings(_this8.masterPlaylistLoader_.master, _this8.masterPlaylistLoader_.sidxMapping_);
  98308. _this8.addSidxSegments_(_this8.media(), _this8.state, function(sidxChanged) {
  98309. _this8.refreshMedia_(_this8.media().id);
  98310. });
  98311. });
  98312. };
  98313. _proto.refreshMedia_ = function refreshMedia_(mediaID) {
  98314. var _this9 = this;
  98315. if (!mediaID) {
  98316. throw new Error("refreshMedia_ must take a media id");
  98317. }
  98318. if (this.media_ && this.isMaster_) {
  98319. this.handleMaster_();
  98320. }
  98321. var playlists = this.masterPlaylistLoader_.master.playlists;
  98322. var mediaChanged = !this.media_ || this.media_ !== playlists[mediaID];
  98323. if (mediaChanged) {
  98324. this.media_ = playlists[mediaID];
  98325. } else {
  98326. this.trigger("playlistunchanged");
  98327. }
  98328. if (!this.mediaUpdateTimeout) {
  98329. var createMediaUpdateTimeout = function createMediaUpdateTimeout2() {
  98330. if (_this9.media().endList) {
  98331. return;
  98332. }
  98333. _this9.mediaUpdateTimeout = window_1.setTimeout(function() {
  98334. _this9.trigger("mediaupdatetimeout");
  98335. createMediaUpdateTimeout2();
  98336. }, refreshDelay(_this9.media(), Boolean(mediaChanged)));
  98337. };
  98338. createMediaUpdateTimeout();
  98339. }
  98340. this.trigger("loadedplaylist");
  98341. };
  98342. return DashPlaylistLoader2;
  98343. }(EventTarget2);
  98344. var Config = {
  98345. GOAL_BUFFER_LENGTH: 30,
  98346. MAX_GOAL_BUFFER_LENGTH: 60,
  98347. BACK_BUFFER_LENGTH: 30,
  98348. GOAL_BUFFER_LENGTH_RATE: 1,
  98349. INITIAL_BANDWIDTH: 4194304,
  98350. BANDWIDTH_VARIANCE: 1.2,
  98351. BUFFER_LOW_WATER_LINE: 0,
  98352. MAX_BUFFER_LOW_WATER_LINE: 30,
  98353. EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE: 16,
  98354. BUFFER_LOW_WATER_LINE_RATE: 1,
  98355. BUFFER_HIGH_WATER_LINE: 30
  98356. };
  98357. var stringToArrayBuffer = function stringToArrayBuffer2(string) {
  98358. var view = new Uint8Array(new ArrayBuffer(string.length));
  98359. for (var i2 = 0; i2 < string.length; i2++) {
  98360. view[i2] = string.charCodeAt(i2);
  98361. }
  98362. return view.buffer;
  98363. };
  98364. var browserWorkerPolyFill = function browserWorkerPolyFill2(workerObj) {
  98365. workerObj.on = workerObj.addEventListener;
  98366. workerObj.off = workerObj.removeEventListener;
  98367. return workerObj;
  98368. };
  98369. var createObjectURL = function createObjectURL2(str) {
  98370. try {
  98371. return URL.createObjectURL(new Blob([str], {
  98372. type: "application/javascript"
  98373. }));
  98374. } catch (e) {
  98375. var blob = new BlobBuilder();
  98376. blob.append(str);
  98377. return URL.createObjectURL(blob.getBlob());
  98378. }
  98379. };
  98380. var factory = function factory2(code) {
  98381. return function() {
  98382. var objectUrl = createObjectURL(code);
  98383. var worker = browserWorkerPolyFill(new Worker(objectUrl));
  98384. worker.objURL = objectUrl;
  98385. var terminate = worker.terminate;
  98386. worker.on = worker.addEventListener;
  98387. worker.off = worker.removeEventListener;
  98388. worker.terminate = function() {
  98389. URL.revokeObjectURL(objectUrl);
  98390. return terminate.call(this);
  98391. };
  98392. return worker;
  98393. };
  98394. };
  98395. var transform = function transform2(code) {
  98396. return "var browserWorkerPolyFill = " + browserWorkerPolyFill.toString() + ";\nbrowserWorkerPolyFill(self);\n" + code;
  98397. };
  98398. var getWorkerString = function getWorkerString2(fn2) {
  98399. return fn2.toString().replace(/^function.+?{/, "").slice(0, -1);
  98400. };
  98401. var workerCode$1 = transform(getWorkerString(function() {
  98402. var Stream2 = function Stream3() {
  98403. this.init = function() {
  98404. var listeners = {};
  98405. this.on = function(type3, listener) {
  98406. if (!listeners[type3]) {
  98407. listeners[type3] = [];
  98408. }
  98409. listeners[type3] = listeners[type3].concat(listener);
  98410. };
  98411. this.off = function(type3, listener) {
  98412. var index2;
  98413. if (!listeners[type3]) {
  98414. return false;
  98415. }
  98416. index2 = listeners[type3].indexOf(listener);
  98417. listeners[type3] = listeners[type3].slice();
  98418. listeners[type3].splice(index2, 1);
  98419. return index2 > -1;
  98420. };
  98421. this.trigger = function(type3) {
  98422. var callbacks, i2, length, args;
  98423. callbacks = listeners[type3];
  98424. if (!callbacks) {
  98425. return;
  98426. }
  98427. if (arguments.length === 2) {
  98428. length = callbacks.length;
  98429. for (i2 = 0; i2 < length; ++i2) {
  98430. callbacks[i2].call(this, arguments[1]);
  98431. }
  98432. } else {
  98433. args = [];
  98434. i2 = arguments.length;
  98435. for (i2 = 1; i2 < arguments.length; ++i2) {
  98436. args.push(arguments[i2]);
  98437. }
  98438. length = callbacks.length;
  98439. for (i2 = 0; i2 < length; ++i2) {
  98440. callbacks[i2].apply(this, args);
  98441. }
  98442. }
  98443. };
  98444. this.dispose = function() {
  98445. listeners = {};
  98446. };
  98447. };
  98448. };
  98449. Stream2.prototype.pipe = function(destination2) {
  98450. this.on("data", function(data) {
  98451. destination2.push(data);
  98452. });
  98453. this.on("done", function(flushSource) {
  98454. destination2.flush(flushSource);
  98455. });
  98456. this.on("partialdone", function(flushSource) {
  98457. destination2.partialFlush(flushSource);
  98458. });
  98459. this.on("endedtimeline", function(flushSource) {
  98460. destination2.endTimeline(flushSource);
  98461. });
  98462. this.on("reset", function(flushSource) {
  98463. destination2.reset(flushSource);
  98464. });
  98465. return destination2;
  98466. };
  98467. Stream2.prototype.push = function(data) {
  98468. this.trigger("data", data);
  98469. };
  98470. Stream2.prototype.flush = function(flushSource) {
  98471. this.trigger("done", flushSource);
  98472. };
  98473. Stream2.prototype.partialFlush = function(flushSource) {
  98474. this.trigger("partialdone", flushSource);
  98475. };
  98476. Stream2.prototype.endTimeline = function(flushSource) {
  98477. this.trigger("endedtimeline", flushSource);
  98478. };
  98479. Stream2.prototype.reset = function(flushSource) {
  98480. this.trigger("reset", flushSource);
  98481. };
  98482. var stream = Stream2;
  98483. var MAX_UINT32$12 = Math.pow(2, 32);
  98484. var getUint64$22 = function getUint643(uint8) {
  98485. var dv = new DataView(uint8.buffer, uint8.byteOffset, uint8.byteLength);
  98486. var value;
  98487. if (dv.getBigUint64) {
  98488. value = dv.getBigUint64(0);
  98489. if (value < Number.MAX_SAFE_INTEGER) {
  98490. return Number(value);
  98491. }
  98492. return value;
  98493. }
  98494. return dv.getUint32(0) * MAX_UINT32$12 + dv.getUint32(4);
  98495. };
  98496. var numbers2 = {
  98497. getUint64: getUint64$22,
  98498. MAX_UINT32: MAX_UINT32$12
  98499. };
  98500. var MAX_UINT322 = numbers2.MAX_UINT32;
  98501. var box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex, trun$1, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR, AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS;
  98502. (function() {
  98503. var i2;
  98504. types = {
  98505. avc1: [],
  98506. avcC: [],
  98507. btrt: [],
  98508. dinf: [],
  98509. dref: [],
  98510. esds: [],
  98511. ftyp: [],
  98512. hdlr: [],
  98513. mdat: [],
  98514. mdhd: [],
  98515. mdia: [],
  98516. mfhd: [],
  98517. minf: [],
  98518. moof: [],
  98519. moov: [],
  98520. mp4a: [],
  98521. mvex: [],
  98522. mvhd: [],
  98523. pasp: [],
  98524. sdtp: [],
  98525. smhd: [],
  98526. stbl: [],
  98527. stco: [],
  98528. stsc: [],
  98529. stsd: [],
  98530. stsz: [],
  98531. stts: [],
  98532. styp: [],
  98533. tfdt: [],
  98534. tfhd: [],
  98535. traf: [],
  98536. trak: [],
  98537. trun: [],
  98538. trex: [],
  98539. tkhd: [],
  98540. vmhd: []
  98541. };
  98542. if (typeof Uint8Array === "undefined") {
  98543. return;
  98544. }
  98545. for (i2 in types) {
  98546. if (types.hasOwnProperty(i2)) {
  98547. types[i2] = [i2.charCodeAt(0), i2.charCodeAt(1), i2.charCodeAt(2), i2.charCodeAt(3)];
  98548. }
  98549. }
  98550. MAJOR_BRAND = new Uint8Array(["i".charCodeAt(0), "s".charCodeAt(0), "o".charCodeAt(0), "m".charCodeAt(0)]);
  98551. AVC1_BRAND = new Uint8Array(["a".charCodeAt(0), "v".charCodeAt(0), "c".charCodeAt(0), "1".charCodeAt(0)]);
  98552. MINOR_VERSION = new Uint8Array([0, 0, 0, 1]);
  98553. VIDEO_HDLR = new Uint8Array([
  98554. 0,
  98555. 0,
  98556. 0,
  98557. 0,
  98558. 0,
  98559. 0,
  98560. 0,
  98561. 0,
  98562. 118,
  98563. 105,
  98564. 100,
  98565. 101,
  98566. 0,
  98567. 0,
  98568. 0,
  98569. 0,
  98570. 0,
  98571. 0,
  98572. 0,
  98573. 0,
  98574. 0,
  98575. 0,
  98576. 0,
  98577. 0,
  98578. 86,
  98579. 105,
  98580. 100,
  98581. 101,
  98582. 111,
  98583. 72,
  98584. 97,
  98585. 110,
  98586. 100,
  98587. 108,
  98588. 101,
  98589. 114,
  98590. 0
  98591. ]);
  98592. AUDIO_HDLR = new Uint8Array([
  98593. 0,
  98594. 0,
  98595. 0,
  98596. 0,
  98597. 0,
  98598. 0,
  98599. 0,
  98600. 0,
  98601. 115,
  98602. 111,
  98603. 117,
  98604. 110,
  98605. 0,
  98606. 0,
  98607. 0,
  98608. 0,
  98609. 0,
  98610. 0,
  98611. 0,
  98612. 0,
  98613. 0,
  98614. 0,
  98615. 0,
  98616. 0,
  98617. 83,
  98618. 111,
  98619. 117,
  98620. 110,
  98621. 100,
  98622. 72,
  98623. 97,
  98624. 110,
  98625. 100,
  98626. 108,
  98627. 101,
  98628. 114,
  98629. 0
  98630. ]);
  98631. HDLR_TYPES = {
  98632. video: VIDEO_HDLR,
  98633. audio: AUDIO_HDLR
  98634. };
  98635. DREF = new Uint8Array([
  98636. 0,
  98637. 0,
  98638. 0,
  98639. 0,
  98640. 0,
  98641. 0,
  98642. 0,
  98643. 1,
  98644. 0,
  98645. 0,
  98646. 0,
  98647. 12,
  98648. 117,
  98649. 114,
  98650. 108,
  98651. 32,
  98652. 0,
  98653. 0,
  98654. 0,
  98655. 1
  98656. ]);
  98657. SMHD = new Uint8Array([
  98658. 0,
  98659. 0,
  98660. 0,
  98661. 0,
  98662. 0,
  98663. 0,
  98664. 0,
  98665. 0
  98666. ]);
  98667. STCO = new Uint8Array([
  98668. 0,
  98669. 0,
  98670. 0,
  98671. 0,
  98672. 0,
  98673. 0,
  98674. 0,
  98675. 0
  98676. ]);
  98677. STSC = STCO;
  98678. STSZ = new Uint8Array([
  98679. 0,
  98680. 0,
  98681. 0,
  98682. 0,
  98683. 0,
  98684. 0,
  98685. 0,
  98686. 0,
  98687. 0,
  98688. 0,
  98689. 0,
  98690. 0
  98691. ]);
  98692. STTS = STCO;
  98693. VMHD = new Uint8Array([
  98694. 0,
  98695. 0,
  98696. 0,
  98697. 1,
  98698. 0,
  98699. 0,
  98700. 0,
  98701. 0,
  98702. 0,
  98703. 0,
  98704. 0,
  98705. 0
  98706. ]);
  98707. })();
  98708. box = function box2(type3) {
  98709. var payload = [], size = 0, i2, result, view;
  98710. for (i2 = 1; i2 < arguments.length; i2++) {
  98711. payload.push(arguments[i2]);
  98712. }
  98713. i2 = payload.length;
  98714. while (i2--) {
  98715. size += payload[i2].byteLength;
  98716. }
  98717. result = new Uint8Array(size + 8);
  98718. view = new DataView(result.buffer, result.byteOffset, result.byteLength);
  98719. view.setUint32(0, result.byteLength);
  98720. result.set(type3, 4);
  98721. for (i2 = 0, size = 8; i2 < payload.length; i2++) {
  98722. result.set(payload[i2], size);
  98723. size += payload[i2].byteLength;
  98724. }
  98725. return result;
  98726. };
  98727. dinf = function dinf2() {
  98728. return box(types.dinf, box(types.dref, DREF));
  98729. };
  98730. esds = function esds2(track) {
  98731. return box(types.esds, new Uint8Array([
  98732. 0,
  98733. 0,
  98734. 0,
  98735. 0,
  98736. 3,
  98737. 25,
  98738. 0,
  98739. 0,
  98740. 0,
  98741. 4,
  98742. 17,
  98743. 64,
  98744. 21,
  98745. 0,
  98746. 6,
  98747. 0,
  98748. 0,
  98749. 0,
  98750. 218,
  98751. 192,
  98752. 0,
  98753. 0,
  98754. 218,
  98755. 192,
  98756. 5,
  98757. 2,
  98758. track.audioobjecttype << 3 | track.samplingfrequencyindex >>> 1,
  98759. track.samplingfrequencyindex << 7 | track.channelcount << 3,
  98760. 6,
  98761. 1,
  98762. 2
  98763. ]));
  98764. };
  98765. ftyp = function ftyp2() {
  98766. return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND);
  98767. };
  98768. hdlr = function hdlr2(type3) {
  98769. return box(types.hdlr, HDLR_TYPES[type3]);
  98770. };
  98771. mdat = function mdat2(data) {
  98772. return box(types.mdat, data);
  98773. };
  98774. mdhd = function mdhd2(track) {
  98775. var result = new Uint8Array([
  98776. 0,
  98777. 0,
  98778. 0,
  98779. 0,
  98780. 0,
  98781. 0,
  98782. 0,
  98783. 2,
  98784. 0,
  98785. 0,
  98786. 0,
  98787. 3,
  98788. 0,
  98789. 1,
  98790. 95,
  98791. 144,
  98792. track.duration >>> 24 & 255,
  98793. track.duration >>> 16 & 255,
  98794. track.duration >>> 8 & 255,
  98795. track.duration & 255,
  98796. 85,
  98797. 196,
  98798. 0,
  98799. 0
  98800. ]);
  98801. if (track.samplerate) {
  98802. result[12] = track.samplerate >>> 24 & 255;
  98803. result[13] = track.samplerate >>> 16 & 255;
  98804. result[14] = track.samplerate >>> 8 & 255;
  98805. result[15] = track.samplerate & 255;
  98806. }
  98807. return box(types.mdhd, result);
  98808. };
  98809. mdia = function mdia2(track) {
  98810. return box(types.mdia, mdhd(track), hdlr(track.type), minf(track));
  98811. };
  98812. mfhd = function mfhd2(sequenceNumber) {
  98813. return box(types.mfhd, new Uint8Array([
  98814. 0,
  98815. 0,
  98816. 0,
  98817. 0,
  98818. (sequenceNumber & 4278190080) >> 24,
  98819. (sequenceNumber & 16711680) >> 16,
  98820. (sequenceNumber & 65280) >> 8,
  98821. sequenceNumber & 255
  98822. ]));
  98823. };
  98824. minf = function minf2(track) {
  98825. return box(types.minf, track.type === "video" ? box(types.vmhd, VMHD) : box(types.smhd, SMHD), dinf(), stbl(track));
  98826. };
  98827. moof = function moof2(sequenceNumber, tracks) {
  98828. var trackFragments = [], i2 = tracks.length;
  98829. while (i2--) {
  98830. trackFragments[i2] = traf(tracks[i2]);
  98831. }
  98832. return box.apply(null, [types.moof, mfhd(sequenceNumber)].concat(trackFragments));
  98833. };
  98834. moov = function moov2(tracks) {
  98835. var i2 = tracks.length, boxes = [];
  98836. while (i2--) {
  98837. boxes[i2] = trak(tracks[i2]);
  98838. }
  98839. return box.apply(null, [types.moov, mvhd(4294967295)].concat(boxes).concat(mvex(tracks)));
  98840. };
  98841. mvex = function mvex2(tracks) {
  98842. var i2 = tracks.length, boxes = [];
  98843. while (i2--) {
  98844. boxes[i2] = trex(tracks[i2]);
  98845. }
  98846. return box.apply(null, [types.mvex].concat(boxes));
  98847. };
  98848. mvhd = function mvhd2(duration5) {
  98849. var bytes = new Uint8Array([
  98850. 0,
  98851. 0,
  98852. 0,
  98853. 0,
  98854. 0,
  98855. 0,
  98856. 0,
  98857. 1,
  98858. 0,
  98859. 0,
  98860. 0,
  98861. 2,
  98862. 0,
  98863. 1,
  98864. 95,
  98865. 144,
  98866. (duration5 & 4278190080) >> 24,
  98867. (duration5 & 16711680) >> 16,
  98868. (duration5 & 65280) >> 8,
  98869. duration5 & 255,
  98870. 0,
  98871. 1,
  98872. 0,
  98873. 0,
  98874. 1,
  98875. 0,
  98876. 0,
  98877. 0,
  98878. 0,
  98879. 0,
  98880. 0,
  98881. 0,
  98882. 0,
  98883. 0,
  98884. 0,
  98885. 0,
  98886. 0,
  98887. 1,
  98888. 0,
  98889. 0,
  98890. 0,
  98891. 0,
  98892. 0,
  98893. 0,
  98894. 0,
  98895. 0,
  98896. 0,
  98897. 0,
  98898. 0,
  98899. 0,
  98900. 0,
  98901. 0,
  98902. 0,
  98903. 1,
  98904. 0,
  98905. 0,
  98906. 0,
  98907. 0,
  98908. 0,
  98909. 0,
  98910. 0,
  98911. 0,
  98912. 0,
  98913. 0,
  98914. 0,
  98915. 0,
  98916. 0,
  98917. 0,
  98918. 64,
  98919. 0,
  98920. 0,
  98921. 0,
  98922. 0,
  98923. 0,
  98924. 0,
  98925. 0,
  98926. 0,
  98927. 0,
  98928. 0,
  98929. 0,
  98930. 0,
  98931. 0,
  98932. 0,
  98933. 0,
  98934. 0,
  98935. 0,
  98936. 0,
  98937. 0,
  98938. 0,
  98939. 0,
  98940. 0,
  98941. 0,
  98942. 0,
  98943. 0,
  98944. 0,
  98945. 0,
  98946. 255,
  98947. 255,
  98948. 255,
  98949. 255
  98950. ]);
  98951. return box(types.mvhd, bytes);
  98952. };
  98953. sdtp = function sdtp2(track) {
  98954. var samples = track.samples || [], bytes = new Uint8Array(4 + samples.length), flags, i2;
  98955. for (i2 = 0; i2 < samples.length; i2++) {
  98956. flags = samples[i2].flags;
  98957. bytes[i2 + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;
  98958. }
  98959. return box(types.sdtp, bytes);
  98960. };
  98961. stbl = function stbl2(track) {
  98962. return box(types.stbl, stsd(track), box(types.stts, STTS), box(types.stsc, STSC), box(types.stsz, STSZ), box(types.stco, STCO));
  98963. };
  98964. (function() {
  98965. var videoSample, audioSample;
  98966. stsd = function stsd2(track) {
  98967. return box(types.stsd, new Uint8Array([
  98968. 0,
  98969. 0,
  98970. 0,
  98971. 0,
  98972. 0,
  98973. 0,
  98974. 0,
  98975. 1
  98976. ]), track.type === "video" ? videoSample(track) : audioSample(track));
  98977. };
  98978. videoSample = function videoSample2(track) {
  98979. var sps = track.sps || [], pps = track.pps || [], sequenceParameterSets = [], pictureParameterSets = [], i2, avc1Box;
  98980. for (i2 = 0; i2 < sps.length; i2++) {
  98981. sequenceParameterSets.push((sps[i2].byteLength & 65280) >>> 8);
  98982. sequenceParameterSets.push(sps[i2].byteLength & 255);
  98983. sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i2]));
  98984. }
  98985. for (i2 = 0; i2 < pps.length; i2++) {
  98986. pictureParameterSets.push((pps[i2].byteLength & 65280) >>> 8);
  98987. pictureParameterSets.push(pps[i2].byteLength & 255);
  98988. pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i2]));
  98989. }
  98990. avc1Box = [types.avc1, new Uint8Array([
  98991. 0,
  98992. 0,
  98993. 0,
  98994. 0,
  98995. 0,
  98996. 0,
  98997. 0,
  98998. 1,
  98999. 0,
  99000. 0,
  99001. 0,
  99002. 0,
  99003. 0,
  99004. 0,
  99005. 0,
  99006. 0,
  99007. 0,
  99008. 0,
  99009. 0,
  99010. 0,
  99011. 0,
  99012. 0,
  99013. 0,
  99014. 0,
  99015. (track.width & 65280) >> 8,
  99016. track.width & 255,
  99017. (track.height & 65280) >> 8,
  99018. track.height & 255,
  99019. 0,
  99020. 72,
  99021. 0,
  99022. 0,
  99023. 0,
  99024. 72,
  99025. 0,
  99026. 0,
  99027. 0,
  99028. 0,
  99029. 0,
  99030. 0,
  99031. 0,
  99032. 1,
  99033. 19,
  99034. 118,
  99035. 105,
  99036. 100,
  99037. 101,
  99038. 111,
  99039. 106,
  99040. 115,
  99041. 45,
  99042. 99,
  99043. 111,
  99044. 110,
  99045. 116,
  99046. 114,
  99047. 105,
  99048. 98,
  99049. 45,
  99050. 104,
  99051. 108,
  99052. 115,
  99053. 0,
  99054. 0,
  99055. 0,
  99056. 0,
  99057. 0,
  99058. 0,
  99059. 0,
  99060. 0,
  99061. 0,
  99062. 0,
  99063. 0,
  99064. 0,
  99065. 0,
  99066. 24,
  99067. 17,
  99068. 17
  99069. ]), box(types.avcC, new Uint8Array([
  99070. 1,
  99071. track.profileIdc,
  99072. track.profileCompatibility,
  99073. track.levelIdc,
  99074. 255
  99075. ].concat(
  99076. [sps.length],
  99077. sequenceParameterSets,
  99078. [pps.length],
  99079. pictureParameterSets
  99080. ))), box(types.btrt, new Uint8Array([
  99081. 0,
  99082. 28,
  99083. 156,
  99084. 128,
  99085. 0,
  99086. 45,
  99087. 198,
  99088. 192,
  99089. 0,
  99090. 45,
  99091. 198,
  99092. 192
  99093. ]))];
  99094. if (track.sarRatio) {
  99095. var hSpacing = track.sarRatio[0], vSpacing = track.sarRatio[1];
  99096. avc1Box.push(box(types.pasp, new Uint8Array([(hSpacing & 4278190080) >> 24, (hSpacing & 16711680) >> 16, (hSpacing & 65280) >> 8, hSpacing & 255, (vSpacing & 4278190080) >> 24, (vSpacing & 16711680) >> 16, (vSpacing & 65280) >> 8, vSpacing & 255])));
  99097. }
  99098. return box.apply(null, avc1Box);
  99099. };
  99100. audioSample = function audioSample2(track) {
  99101. return box(types.mp4a, new Uint8Array([
  99102. 0,
  99103. 0,
  99104. 0,
  99105. 0,
  99106. 0,
  99107. 0,
  99108. 0,
  99109. 1,
  99110. 0,
  99111. 0,
  99112. 0,
  99113. 0,
  99114. 0,
  99115. 0,
  99116. 0,
  99117. 0,
  99118. (track.channelcount & 65280) >> 8,
  99119. track.channelcount & 255,
  99120. (track.samplesize & 65280) >> 8,
  99121. track.samplesize & 255,
  99122. 0,
  99123. 0,
  99124. 0,
  99125. 0,
  99126. (track.samplerate & 65280) >> 8,
  99127. track.samplerate & 255,
  99128. 0,
  99129. 0
  99130. ]), esds(track));
  99131. };
  99132. })();
  99133. tkhd = function tkhd2(track) {
  99134. var result = new Uint8Array([
  99135. 0,
  99136. 0,
  99137. 0,
  99138. 7,
  99139. 0,
  99140. 0,
  99141. 0,
  99142. 0,
  99143. 0,
  99144. 0,
  99145. 0,
  99146. 0,
  99147. (track.id & 4278190080) >> 24,
  99148. (track.id & 16711680) >> 16,
  99149. (track.id & 65280) >> 8,
  99150. track.id & 255,
  99151. 0,
  99152. 0,
  99153. 0,
  99154. 0,
  99155. (track.duration & 4278190080) >> 24,
  99156. (track.duration & 16711680) >> 16,
  99157. (track.duration & 65280) >> 8,
  99158. track.duration & 255,
  99159. 0,
  99160. 0,
  99161. 0,
  99162. 0,
  99163. 0,
  99164. 0,
  99165. 0,
  99166. 0,
  99167. 0,
  99168. 0,
  99169. 0,
  99170. 0,
  99171. 1,
  99172. 0,
  99173. 0,
  99174. 0,
  99175. 0,
  99176. 1,
  99177. 0,
  99178. 0,
  99179. 0,
  99180. 0,
  99181. 0,
  99182. 0,
  99183. 0,
  99184. 0,
  99185. 0,
  99186. 0,
  99187. 0,
  99188. 0,
  99189. 0,
  99190. 0,
  99191. 0,
  99192. 1,
  99193. 0,
  99194. 0,
  99195. 0,
  99196. 0,
  99197. 0,
  99198. 0,
  99199. 0,
  99200. 0,
  99201. 0,
  99202. 0,
  99203. 0,
  99204. 0,
  99205. 0,
  99206. 0,
  99207. 64,
  99208. 0,
  99209. 0,
  99210. 0,
  99211. (track.width & 65280) >> 8,
  99212. track.width & 255,
  99213. 0,
  99214. 0,
  99215. (track.height & 65280) >> 8,
  99216. track.height & 255,
  99217. 0,
  99218. 0
  99219. ]);
  99220. return box(types.tkhd, result);
  99221. };
  99222. traf = function traf2(track) {
  99223. var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable, dataOffset, upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime;
  99224. trackFragmentHeader = box(types.tfhd, new Uint8Array([
  99225. 0,
  99226. 0,
  99227. 0,
  99228. 58,
  99229. (track.id & 4278190080) >> 24,
  99230. (track.id & 16711680) >> 16,
  99231. (track.id & 65280) >> 8,
  99232. track.id & 255,
  99233. 0,
  99234. 0,
  99235. 0,
  99236. 1,
  99237. 0,
  99238. 0,
  99239. 0,
  99240. 0,
  99241. 0,
  99242. 0,
  99243. 0,
  99244. 0,
  99245. 0,
  99246. 0,
  99247. 0,
  99248. 0
  99249. ]));
  99250. upperWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime / MAX_UINT322);
  99251. lowerWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime % MAX_UINT322);
  99252. trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([
  99253. 1,
  99254. 0,
  99255. 0,
  99256. 0,
  99257. upperWordBaseMediaDecodeTime >>> 24 & 255,
  99258. upperWordBaseMediaDecodeTime >>> 16 & 255,
  99259. upperWordBaseMediaDecodeTime >>> 8 & 255,
  99260. upperWordBaseMediaDecodeTime & 255,
  99261. lowerWordBaseMediaDecodeTime >>> 24 & 255,
  99262. lowerWordBaseMediaDecodeTime >>> 16 & 255,
  99263. lowerWordBaseMediaDecodeTime >>> 8 & 255,
  99264. lowerWordBaseMediaDecodeTime & 255
  99265. ]));
  99266. dataOffset = 32 + 20 + 8 + 16 + 8 + 8;
  99267. if (track.type === "audio") {
  99268. trackFragmentRun = trun$1(track, dataOffset);
  99269. return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun);
  99270. }
  99271. sampleDependencyTable = sdtp(track);
  99272. trackFragmentRun = trun$1(track, sampleDependencyTable.length + dataOffset);
  99273. return box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable);
  99274. };
  99275. trak = function trak2(track) {
  99276. track.duration = track.duration || 4294967295;
  99277. return box(types.trak, tkhd(track), mdia(track));
  99278. };
  99279. trex = function trex2(track) {
  99280. var result = new Uint8Array([
  99281. 0,
  99282. 0,
  99283. 0,
  99284. 0,
  99285. (track.id & 4278190080) >> 24,
  99286. (track.id & 16711680) >> 16,
  99287. (track.id & 65280) >> 8,
  99288. track.id & 255,
  99289. 0,
  99290. 0,
  99291. 0,
  99292. 1,
  99293. 0,
  99294. 0,
  99295. 0,
  99296. 0,
  99297. 0,
  99298. 0,
  99299. 0,
  99300. 0,
  99301. 0,
  99302. 1,
  99303. 0,
  99304. 1
  99305. ]);
  99306. if (track.type !== "video") {
  99307. result[result.length - 1] = 0;
  99308. }
  99309. return box(types.trex, result);
  99310. };
  99311. (function() {
  99312. var audioTrun, videoTrun, trunHeader;
  99313. trunHeader = function trunHeader2(samples, offset) {
  99314. var durationPresent = 0, sizePresent = 0, flagsPresent = 0, compositionTimeOffset = 0;
  99315. if (samples.length) {
  99316. if (samples[0].duration !== void 0) {
  99317. durationPresent = 1;
  99318. }
  99319. if (samples[0].size !== void 0) {
  99320. sizePresent = 2;
  99321. }
  99322. if (samples[0].flags !== void 0) {
  99323. flagsPresent = 4;
  99324. }
  99325. if (samples[0].compositionTimeOffset !== void 0) {
  99326. compositionTimeOffset = 8;
  99327. }
  99328. }
  99329. return [
  99330. 0,
  99331. 0,
  99332. durationPresent | sizePresent | flagsPresent | compositionTimeOffset,
  99333. 1,
  99334. (samples.length & 4278190080) >>> 24,
  99335. (samples.length & 16711680) >>> 16,
  99336. (samples.length & 65280) >>> 8,
  99337. samples.length & 255,
  99338. (offset & 4278190080) >>> 24,
  99339. (offset & 16711680) >>> 16,
  99340. (offset & 65280) >>> 8,
  99341. offset & 255
  99342. ];
  99343. };
  99344. videoTrun = function videoTrun2(track, offset) {
  99345. var bytesOffest, bytes, header, samples, sample, i2;
  99346. samples = track.samples || [];
  99347. offset += 8 + 12 + 16 * samples.length;
  99348. header = trunHeader(samples, offset);
  99349. bytes = new Uint8Array(header.length + samples.length * 16);
  99350. bytes.set(header);
  99351. bytesOffest = header.length;
  99352. for (i2 = 0; i2 < samples.length; i2++) {
  99353. sample = samples[i2];
  99354. bytes[bytesOffest++] = (sample.duration & 4278190080) >>> 24;
  99355. bytes[bytesOffest++] = (sample.duration & 16711680) >>> 16;
  99356. bytes[bytesOffest++] = (sample.duration & 65280) >>> 8;
  99357. bytes[bytesOffest++] = sample.duration & 255;
  99358. bytes[bytesOffest++] = (sample.size & 4278190080) >>> 24;
  99359. bytes[bytesOffest++] = (sample.size & 16711680) >>> 16;
  99360. bytes[bytesOffest++] = (sample.size & 65280) >>> 8;
  99361. bytes[bytesOffest++] = sample.size & 255;
  99362. bytes[bytesOffest++] = sample.flags.isLeading << 2 | sample.flags.dependsOn;
  99363. bytes[bytesOffest++] = sample.flags.isDependedOn << 6 | sample.flags.hasRedundancy << 4 | sample.flags.paddingValue << 1 | sample.flags.isNonSyncSample;
  99364. bytes[bytesOffest++] = sample.flags.degradationPriority & 240 << 8;
  99365. bytes[bytesOffest++] = sample.flags.degradationPriority & 15;
  99366. bytes[bytesOffest++] = (sample.compositionTimeOffset & 4278190080) >>> 24;
  99367. bytes[bytesOffest++] = (sample.compositionTimeOffset & 16711680) >>> 16;
  99368. bytes[bytesOffest++] = (sample.compositionTimeOffset & 65280) >>> 8;
  99369. bytes[bytesOffest++] = sample.compositionTimeOffset & 255;
  99370. }
  99371. return box(types.trun, bytes);
  99372. };
  99373. audioTrun = function audioTrun2(track, offset) {
  99374. var bytes, bytesOffest, header, samples, sample, i2;
  99375. samples = track.samples || [];
  99376. offset += 8 + 12 + 8 * samples.length;
  99377. header = trunHeader(samples, offset);
  99378. bytes = new Uint8Array(header.length + samples.length * 8);
  99379. bytes.set(header);
  99380. bytesOffest = header.length;
  99381. for (i2 = 0; i2 < samples.length; i2++) {
  99382. sample = samples[i2];
  99383. bytes[bytesOffest++] = (sample.duration & 4278190080) >>> 24;
  99384. bytes[bytesOffest++] = (sample.duration & 16711680) >>> 16;
  99385. bytes[bytesOffest++] = (sample.duration & 65280) >>> 8;
  99386. bytes[bytesOffest++] = sample.duration & 255;
  99387. bytes[bytesOffest++] = (sample.size & 4278190080) >>> 24;
  99388. bytes[bytesOffest++] = (sample.size & 16711680) >>> 16;
  99389. bytes[bytesOffest++] = (sample.size & 65280) >>> 8;
  99390. bytes[bytesOffest++] = sample.size & 255;
  99391. }
  99392. return box(types.trun, bytes);
  99393. };
  99394. trun$1 = function trun2(track, offset) {
  99395. if (track.type === "audio") {
  99396. return audioTrun(track, offset);
  99397. }
  99398. return videoTrun(track, offset);
  99399. };
  99400. })();
  99401. var mp4Generator = {
  99402. ftyp,
  99403. mdat,
  99404. moof,
  99405. moov,
  99406. initSegment: function initSegment(tracks) {
  99407. var fileType = ftyp(), movie = moov(tracks), result;
  99408. result = new Uint8Array(fileType.byteLength + movie.byteLength);
  99409. result.set(fileType);
  99410. result.set(movie, fileType.byteLength);
  99411. return result;
  99412. }
  99413. };
  99414. var groupNalsIntoFrames = function groupNalsIntoFrames2(nalUnits) {
  99415. var i2, currentNal, currentFrame = [], frames = [];
  99416. frames.byteLength = 0;
  99417. frames.nalCount = 0;
  99418. frames.duration = 0;
  99419. currentFrame.byteLength = 0;
  99420. for (i2 = 0; i2 < nalUnits.length; i2++) {
  99421. currentNal = nalUnits[i2];
  99422. if (currentNal.nalUnitType === "access_unit_delimiter_rbsp") {
  99423. if (currentFrame.length) {
  99424. currentFrame.duration = currentNal.dts - currentFrame.dts;
  99425. frames.byteLength += currentFrame.byteLength;
  99426. frames.nalCount += currentFrame.length;
  99427. frames.duration += currentFrame.duration;
  99428. frames.push(currentFrame);
  99429. }
  99430. currentFrame = [currentNal];
  99431. currentFrame.byteLength = currentNal.data.byteLength;
  99432. currentFrame.pts = currentNal.pts;
  99433. currentFrame.dts = currentNal.dts;
  99434. } else {
  99435. if (currentNal.nalUnitType === "slice_layer_without_partitioning_rbsp_idr") {
  99436. currentFrame.keyFrame = true;
  99437. }
  99438. currentFrame.duration = currentNal.dts - currentFrame.dts;
  99439. currentFrame.byteLength += currentNal.data.byteLength;
  99440. currentFrame.push(currentNal);
  99441. }
  99442. }
  99443. if (frames.length && (!currentFrame.duration || currentFrame.duration <= 0)) {
  99444. currentFrame.duration = frames[frames.length - 1].duration;
  99445. }
  99446. frames.byteLength += currentFrame.byteLength;
  99447. frames.nalCount += currentFrame.length;
  99448. frames.duration += currentFrame.duration;
  99449. frames.push(currentFrame);
  99450. return frames;
  99451. };
  99452. var groupFramesIntoGops = function groupFramesIntoGops2(frames) {
  99453. var i2, currentFrame, currentGop = [], gops = [];
  99454. currentGop.byteLength = 0;
  99455. currentGop.nalCount = 0;
  99456. currentGop.duration = 0;
  99457. currentGop.pts = frames[0].pts;
  99458. currentGop.dts = frames[0].dts;
  99459. gops.byteLength = 0;
  99460. gops.nalCount = 0;
  99461. gops.duration = 0;
  99462. gops.pts = frames[0].pts;
  99463. gops.dts = frames[0].dts;
  99464. for (i2 = 0; i2 < frames.length; i2++) {
  99465. currentFrame = frames[i2];
  99466. if (currentFrame.keyFrame) {
  99467. if (currentGop.length) {
  99468. gops.push(currentGop);
  99469. gops.byteLength += currentGop.byteLength;
  99470. gops.nalCount += currentGop.nalCount;
  99471. gops.duration += currentGop.duration;
  99472. }
  99473. currentGop = [currentFrame];
  99474. currentGop.nalCount = currentFrame.length;
  99475. currentGop.byteLength = currentFrame.byteLength;
  99476. currentGop.pts = currentFrame.pts;
  99477. currentGop.dts = currentFrame.dts;
  99478. currentGop.duration = currentFrame.duration;
  99479. } else {
  99480. currentGop.duration += currentFrame.duration;
  99481. currentGop.nalCount += currentFrame.length;
  99482. currentGop.byteLength += currentFrame.byteLength;
  99483. currentGop.push(currentFrame);
  99484. }
  99485. }
  99486. if (gops.length && currentGop.duration <= 0) {
  99487. currentGop.duration = gops[gops.length - 1].duration;
  99488. }
  99489. gops.byteLength += currentGop.byteLength;
  99490. gops.nalCount += currentGop.nalCount;
  99491. gops.duration += currentGop.duration;
  99492. gops.push(currentGop);
  99493. return gops;
  99494. };
  99495. var extendFirstKeyFrame = function extendFirstKeyFrame2(gops) {
  99496. var currentGop;
  99497. if (!gops[0][0].keyFrame && gops.length > 1) {
  99498. currentGop = gops.shift();
  99499. gops.byteLength -= currentGop.byteLength;
  99500. gops.nalCount -= currentGop.nalCount;
  99501. gops[0][0].dts = currentGop.dts;
  99502. gops[0][0].pts = currentGop.pts;
  99503. gops[0][0].duration += currentGop.duration;
  99504. }
  99505. return gops;
  99506. };
  99507. var createDefaultSample = function createDefaultSample2() {
  99508. return {
  99509. size: 0,
  99510. flags: {
  99511. isLeading: 0,
  99512. dependsOn: 1,
  99513. isDependedOn: 0,
  99514. hasRedundancy: 0,
  99515. degradationPriority: 0,
  99516. isNonSyncSample: 1
  99517. }
  99518. };
  99519. };
  99520. var sampleForFrame = function sampleForFrame2(frame, dataOffset) {
  99521. var sample = createDefaultSample();
  99522. sample.dataOffset = dataOffset;
  99523. sample.compositionTimeOffset = frame.pts - frame.dts;
  99524. sample.duration = frame.duration;
  99525. sample.size = 4 * frame.length;
  99526. sample.size += frame.byteLength;
  99527. if (frame.keyFrame) {
  99528. sample.flags.dependsOn = 2;
  99529. sample.flags.isNonSyncSample = 0;
  99530. }
  99531. return sample;
  99532. };
  99533. var generateSampleTable$1 = function generateSampleTable2(gops, baseDataOffset) {
  99534. var h2, i2, sample, currentGop, currentFrame, dataOffset = baseDataOffset || 0, samples = [];
  99535. for (h2 = 0; h2 < gops.length; h2++) {
  99536. currentGop = gops[h2];
  99537. for (i2 = 0; i2 < currentGop.length; i2++) {
  99538. currentFrame = currentGop[i2];
  99539. sample = sampleForFrame(currentFrame, dataOffset);
  99540. dataOffset += sample.size;
  99541. samples.push(sample);
  99542. }
  99543. }
  99544. return samples;
  99545. };
  99546. var concatenateNalData = function concatenateNalData2(gops) {
  99547. var h2, i2, j, currentGop, currentFrame, currentNal, dataOffset = 0, nalsByteLength = gops.byteLength, numberOfNals = gops.nalCount, totalByteLength = nalsByteLength + 4 * numberOfNals, data = new Uint8Array(totalByteLength), view = new DataView(data.buffer);
  99548. for (h2 = 0; h2 < gops.length; h2++) {
  99549. currentGop = gops[h2];
  99550. for (i2 = 0; i2 < currentGop.length; i2++) {
  99551. currentFrame = currentGop[i2];
  99552. for (j = 0; j < currentFrame.length; j++) {
  99553. currentNal = currentFrame[j];
  99554. view.setUint32(dataOffset, currentNal.data.byteLength);
  99555. dataOffset += 4;
  99556. data.set(currentNal.data, dataOffset);
  99557. dataOffset += currentNal.data.byteLength;
  99558. }
  99559. }
  99560. }
  99561. return data;
  99562. };
  99563. var generateSampleTableForFrame = function generateSampleTableForFrame2(frame, baseDataOffset) {
  99564. var sample, dataOffset = baseDataOffset || 0, samples = [];
  99565. sample = sampleForFrame(frame, dataOffset);
  99566. samples.push(sample);
  99567. return samples;
  99568. };
  99569. var concatenateNalDataForFrame = function concatenateNalDataForFrame2(frame) {
  99570. var i2, currentNal, dataOffset = 0, nalsByteLength = frame.byteLength, numberOfNals = frame.length, totalByteLength = nalsByteLength + 4 * numberOfNals, data = new Uint8Array(totalByteLength), view = new DataView(data.buffer);
  99571. for (i2 = 0; i2 < frame.length; i2++) {
  99572. currentNal = frame[i2];
  99573. view.setUint32(dataOffset, currentNal.data.byteLength);
  99574. dataOffset += 4;
  99575. data.set(currentNal.data, dataOffset);
  99576. dataOffset += currentNal.data.byteLength;
  99577. }
  99578. return data;
  99579. };
  99580. var frameUtils = {
  99581. groupNalsIntoFrames,
  99582. groupFramesIntoGops,
  99583. extendFirstKeyFrame,
  99584. generateSampleTable: generateSampleTable$1,
  99585. concatenateNalData,
  99586. generateSampleTableForFrame,
  99587. concatenateNalDataForFrame
  99588. };
  99589. var highPrefix = [33, 16, 5, 32, 164, 27];
  99590. var lowPrefix = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252];
  99591. var zeroFill = function zeroFill2(count) {
  99592. var a = [];
  99593. while (count--) {
  99594. a.push(0);
  99595. }
  99596. return a;
  99597. };
  99598. var makeTable = function makeTable2(metaTable) {
  99599. return Object.keys(metaTable).reduce(function(obj, key) {
  99600. obj[key] = new Uint8Array(metaTable[key].reduce(function(arr, part) {
  99601. return arr.concat(part);
  99602. }, []));
  99603. return obj;
  99604. }, {});
  99605. };
  99606. var silence;
  99607. var silence_1 = function silence_12() {
  99608. if (!silence) {
  99609. var coneOfSilence = {
  99610. 96e3: [highPrefix, [227, 64], zeroFill(154), [56]],
  99611. 88200: [highPrefix, [231], zeroFill(170), [56]],
  99612. 64e3: [highPrefix, [248, 192], zeroFill(240), [56]],
  99613. 48e3: [highPrefix, [255, 192], zeroFill(268), [55, 148, 128], zeroFill(54), [112]],
  99614. 44100: [highPrefix, [255, 192], zeroFill(268), [55, 163, 128], zeroFill(84), [112]],
  99615. 32e3: [highPrefix, [255, 192], zeroFill(268), [55, 234], zeroFill(226), [112]],
  99616. 24e3: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 112], zeroFill(126), [224]],
  99617. 16e3: [highPrefix, [255, 192], zeroFill(268), [55, 255, 128], zeroFill(268), [111, 255], zeroFill(269), [223, 108], zeroFill(195), [1, 192]],
  99618. 12e3: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 253, 128], zeroFill(259), [56]],
  99619. 11025: [lowPrefix, zeroFill(268), [3, 127, 248], zeroFill(268), [6, 255, 240], zeroFill(268), [13, 255, 224], zeroFill(268), [27, 255, 192], zeroFill(268), [55, 175, 128], zeroFill(108), [112]],
  99620. 8e3: [lowPrefix, zeroFill(268), [3, 121, 16], zeroFill(47), [7]]
  99621. };
  99622. silence = makeTable(coneOfSilence);
  99623. }
  99624. return silence;
  99625. };
  99626. var ONE_SECOND_IN_TS$4 = 9e4, secondsToVideoTs2, secondsToAudioTs2, videoTsToSeconds2, audioTsToSeconds2, audioTsToVideoTs2, videoTsToAudioTs2, metadataTsToSeconds2;
  99627. secondsToVideoTs2 = function secondsToVideoTs3(seconds) {
  99628. return seconds * ONE_SECOND_IN_TS$4;
  99629. };
  99630. secondsToAudioTs2 = function secondsToAudioTs3(seconds, sampleRate) {
  99631. return seconds * sampleRate;
  99632. };
  99633. videoTsToSeconds2 = function videoTsToSeconds3(timestamp) {
  99634. return timestamp / ONE_SECOND_IN_TS$4;
  99635. };
  99636. audioTsToSeconds2 = function audioTsToSeconds3(timestamp, sampleRate) {
  99637. return timestamp / sampleRate;
  99638. };
  99639. audioTsToVideoTs2 = function audioTsToVideoTs3(timestamp, sampleRate) {
  99640. return secondsToVideoTs2(audioTsToSeconds2(timestamp, sampleRate));
  99641. };
  99642. videoTsToAudioTs2 = function videoTsToAudioTs3(timestamp, sampleRate) {
  99643. return secondsToAudioTs2(videoTsToSeconds2(timestamp), sampleRate);
  99644. };
  99645. metadataTsToSeconds2 = function metadataTsToSeconds3(timestamp, timelineStartPts, keepOriginalTimestamps) {
  99646. return videoTsToSeconds2(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts);
  99647. };
  99648. var clock2 = {
  99649. ONE_SECOND_IN_TS: ONE_SECOND_IN_TS$4,
  99650. secondsToVideoTs: secondsToVideoTs2,
  99651. secondsToAudioTs: secondsToAudioTs2,
  99652. videoTsToSeconds: videoTsToSeconds2,
  99653. audioTsToSeconds: audioTsToSeconds2,
  99654. audioTsToVideoTs: audioTsToVideoTs2,
  99655. videoTsToAudioTs: videoTsToAudioTs2,
  99656. metadataTsToSeconds: metadataTsToSeconds2
  99657. };
  99658. var sumFrameByteLengths = function sumFrameByteLengths2(array) {
  99659. var i2, currentObj, sum = 0;
  99660. for (i2 = 0; i2 < array.length; i2++) {
  99661. currentObj = array[i2];
  99662. sum += currentObj.data.byteLength;
  99663. }
  99664. return sum;
  99665. };
  99666. var prefixWithSilence = function prefixWithSilence2(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime) {
  99667. var baseMediaDecodeTimeTs, frameDuration = 0, audioGapDuration = 0, audioFillFrameCount = 0, audioFillDuration = 0, silentFrame, i2, firstFrame;
  99668. if (!frames.length) {
  99669. return;
  99670. }
  99671. baseMediaDecodeTimeTs = clock2.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate);
  99672. frameDuration = Math.ceil(clock2.ONE_SECOND_IN_TS / (track.samplerate / 1024));
  99673. if (audioAppendStartTs && videoBaseMediaDecodeTime) {
  99674. audioGapDuration = baseMediaDecodeTimeTs - Math.max(audioAppendStartTs, videoBaseMediaDecodeTime);
  99675. audioFillFrameCount = Math.floor(audioGapDuration / frameDuration);
  99676. audioFillDuration = audioFillFrameCount * frameDuration;
  99677. }
  99678. if (audioFillFrameCount < 1 || audioFillDuration > clock2.ONE_SECOND_IN_TS / 2) {
  99679. return;
  99680. }
  99681. silentFrame = silence_1()[track.samplerate];
  99682. if (!silentFrame) {
  99683. silentFrame = frames[0].data;
  99684. }
  99685. for (i2 = 0; i2 < audioFillFrameCount; i2++) {
  99686. firstFrame = frames[0];
  99687. frames.splice(0, 0, {
  99688. data: silentFrame,
  99689. dts: firstFrame.dts - frameDuration,
  99690. pts: firstFrame.pts - frameDuration
  99691. });
  99692. }
  99693. track.baseMediaDecodeTime -= Math.floor(clock2.videoTsToAudioTs(audioFillDuration, track.samplerate));
  99694. return audioFillDuration;
  99695. };
  99696. var trimAdtsFramesByEarliestDts = function trimAdtsFramesByEarliestDts2(adtsFrames, track, earliestAllowedDts) {
  99697. if (track.minSegmentDts >= earliestAllowedDts) {
  99698. return adtsFrames;
  99699. }
  99700. track.minSegmentDts = Infinity;
  99701. return adtsFrames.filter(function(currentFrame) {
  99702. if (currentFrame.dts >= earliestAllowedDts) {
  99703. track.minSegmentDts = Math.min(track.minSegmentDts, currentFrame.dts);
  99704. track.minSegmentPts = track.minSegmentDts;
  99705. return true;
  99706. }
  99707. return false;
  99708. });
  99709. };
  99710. var generateSampleTable = function generateSampleTable2(frames) {
  99711. var i2, currentFrame, samples = [];
  99712. for (i2 = 0; i2 < frames.length; i2++) {
  99713. currentFrame = frames[i2];
  99714. samples.push({
  99715. size: currentFrame.data.byteLength,
  99716. duration: 1024
  99717. });
  99718. }
  99719. return samples;
  99720. };
  99721. var concatenateFrameData = function concatenateFrameData2(frames) {
  99722. var i2, currentFrame, dataOffset = 0, data = new Uint8Array(sumFrameByteLengths(frames));
  99723. for (i2 = 0; i2 < frames.length; i2++) {
  99724. currentFrame = frames[i2];
  99725. data.set(currentFrame.data, dataOffset);
  99726. dataOffset += currentFrame.data.byteLength;
  99727. }
  99728. return data;
  99729. };
  99730. var audioFrameUtils = {
  99731. prefixWithSilence,
  99732. trimAdtsFramesByEarliestDts,
  99733. generateSampleTable,
  99734. concatenateFrameData
  99735. };
  99736. var ONE_SECOND_IN_TS$3 = clock2.ONE_SECOND_IN_TS;
  99737. var collectDtsInfo = function collectDtsInfo2(track, data) {
  99738. if (typeof data.pts === "number") {
  99739. if (track.timelineStartInfo.pts === void 0) {
  99740. track.timelineStartInfo.pts = data.pts;
  99741. }
  99742. if (track.minSegmentPts === void 0) {
  99743. track.minSegmentPts = data.pts;
  99744. } else {
  99745. track.minSegmentPts = Math.min(track.minSegmentPts, data.pts);
  99746. }
  99747. if (track.maxSegmentPts === void 0) {
  99748. track.maxSegmentPts = data.pts;
  99749. } else {
  99750. track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts);
  99751. }
  99752. }
  99753. if (typeof data.dts === "number") {
  99754. if (track.timelineStartInfo.dts === void 0) {
  99755. track.timelineStartInfo.dts = data.dts;
  99756. }
  99757. if (track.minSegmentDts === void 0) {
  99758. track.minSegmentDts = data.dts;
  99759. } else {
  99760. track.minSegmentDts = Math.min(track.minSegmentDts, data.dts);
  99761. }
  99762. if (track.maxSegmentDts === void 0) {
  99763. track.maxSegmentDts = data.dts;
  99764. } else {
  99765. track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts);
  99766. }
  99767. }
  99768. };
  99769. var clearDtsInfo = function clearDtsInfo2(track) {
  99770. delete track.minSegmentDts;
  99771. delete track.maxSegmentDts;
  99772. delete track.minSegmentPts;
  99773. delete track.maxSegmentPts;
  99774. };
  99775. var calculateTrackBaseMediaDecodeTime = function calculateTrackBaseMediaDecodeTime2(track, keepOriginalTimestamps) {
  99776. var baseMediaDecodeTime, scale, minSegmentDts = track.minSegmentDts;
  99777. if (!keepOriginalTimestamps) {
  99778. minSegmentDts -= track.timelineStartInfo.dts;
  99779. }
  99780. baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime;
  99781. baseMediaDecodeTime += minSegmentDts;
  99782. baseMediaDecodeTime = Math.max(0, baseMediaDecodeTime);
  99783. if (track.type === "audio") {
  99784. scale = track.samplerate / ONE_SECOND_IN_TS$3;
  99785. baseMediaDecodeTime *= scale;
  99786. baseMediaDecodeTime = Math.floor(baseMediaDecodeTime);
  99787. }
  99788. return baseMediaDecodeTime;
  99789. };
  99790. var trackDecodeInfo = {
  99791. clearDtsInfo,
  99792. calculateTrackBaseMediaDecodeTime,
  99793. collectDtsInfo
  99794. };
  99795. var USER_DATA_REGISTERED_ITU_T_T35 = 4, RBSP_TRAILING_BITS = 128;
  99796. var parseSei = function parseSei2(bytes) {
  99797. var i2 = 0, result = {
  99798. payloadType: -1,
  99799. payloadSize: 0
  99800. }, payloadType = 0, payloadSize = 0;
  99801. while (i2 < bytes.byteLength) {
  99802. if (bytes[i2] === RBSP_TRAILING_BITS) {
  99803. break;
  99804. }
  99805. while (bytes[i2] === 255) {
  99806. payloadType += 255;
  99807. i2++;
  99808. }
  99809. payloadType += bytes[i2++];
  99810. while (bytes[i2] === 255) {
  99811. payloadSize += 255;
  99812. i2++;
  99813. }
  99814. payloadSize += bytes[i2++];
  99815. if (!result.payload && payloadType === USER_DATA_REGISTERED_ITU_T_T35) {
  99816. var userIdentifier = String.fromCharCode(bytes[i2 + 3], bytes[i2 + 4], bytes[i2 + 5], bytes[i2 + 6]);
  99817. if (userIdentifier === "GA94") {
  99818. result.payloadType = payloadType;
  99819. result.payloadSize = payloadSize;
  99820. result.payload = bytes.subarray(i2, i2 + payloadSize);
  99821. break;
  99822. } else {
  99823. result.payload = void 0;
  99824. }
  99825. }
  99826. i2 += payloadSize;
  99827. payloadType = 0;
  99828. payloadSize = 0;
  99829. }
  99830. return result;
  99831. };
  99832. var parseUserData = function parseUserData2(sei) {
  99833. if (sei.payload[0] !== 181) {
  99834. return null;
  99835. }
  99836. if ((sei.payload[1] << 8 | sei.payload[2]) !== 49) {
  99837. return null;
  99838. }
  99839. if (String.fromCharCode(sei.payload[3], sei.payload[4], sei.payload[5], sei.payload[6]) !== "GA94") {
  99840. return null;
  99841. }
  99842. if (sei.payload[7] !== 3) {
  99843. return null;
  99844. }
  99845. return sei.payload.subarray(8, sei.payload.length - 1);
  99846. };
  99847. var parseCaptionPackets = function parseCaptionPackets2(pts, userData) {
  99848. var results = [], i2, count, offset, data;
  99849. if (!(userData[0] & 64)) {
  99850. return results;
  99851. }
  99852. count = userData[0] & 31;
  99853. for (i2 = 0; i2 < count; i2++) {
  99854. offset = i2 * 3;
  99855. data = {
  99856. type: userData[offset + 2] & 3,
  99857. pts
  99858. };
  99859. if (userData[offset + 2] & 4) {
  99860. data.ccData = userData[offset + 3] << 8 | userData[offset + 4];
  99861. results.push(data);
  99862. }
  99863. }
  99864. return results;
  99865. };
  99866. var discardEmulationPreventionBytes$12 = function discardEmulationPreventionBytes5(data) {
  99867. var length = data.byteLength, emulationPreventionBytesPositions = [], i2 = 1, newLength, newData;
  99868. while (i2 < length - 2) {
  99869. if (data[i2] === 0 && data[i2 + 1] === 0 && data[i2 + 2] === 3) {
  99870. emulationPreventionBytesPositions.push(i2 + 2);
  99871. i2 += 2;
  99872. } else {
  99873. i2++;
  99874. }
  99875. }
  99876. if (emulationPreventionBytesPositions.length === 0) {
  99877. return data;
  99878. }
  99879. newLength = length - emulationPreventionBytesPositions.length;
  99880. newData = new Uint8Array(newLength);
  99881. var sourceIndex = 0;
  99882. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  99883. if (sourceIndex === emulationPreventionBytesPositions[0]) {
  99884. sourceIndex++;
  99885. emulationPreventionBytesPositions.shift();
  99886. }
  99887. newData[i2] = data[sourceIndex];
  99888. }
  99889. return newData;
  99890. };
  99891. var captionPacketParser = {
  99892. parseSei,
  99893. parseUserData,
  99894. parseCaptionPackets,
  99895. discardEmulationPreventionBytes: discardEmulationPreventionBytes$12,
  99896. USER_DATA_REGISTERED_ITU_T_T35
  99897. };
  99898. var CaptionStream$1 = function CaptionStream2(options2) {
  99899. options2 = options2 || {};
  99900. CaptionStream2.prototype.init.call(this);
  99901. this.parse708captions_ = typeof options2.parse708captions === "boolean" ? options2.parse708captions : true;
  99902. this.captionPackets_ = [];
  99903. this.ccStreams_ = [
  99904. new Cea608Stream(0, 0),
  99905. new Cea608Stream(0, 1),
  99906. new Cea608Stream(1, 0),
  99907. new Cea608Stream(1, 1)
  99908. ];
  99909. if (this.parse708captions_) {
  99910. this.cc708Stream_ = new Cea708Stream({
  99911. captionServices: options2.captionServices
  99912. });
  99913. }
  99914. this.reset();
  99915. this.ccStreams_.forEach(function(cc) {
  99916. cc.on("data", this.trigger.bind(this, "data"));
  99917. cc.on("partialdone", this.trigger.bind(this, "partialdone"));
  99918. cc.on("done", this.trigger.bind(this, "done"));
  99919. }, this);
  99920. if (this.parse708captions_) {
  99921. this.cc708Stream_.on("data", this.trigger.bind(this, "data"));
  99922. this.cc708Stream_.on("partialdone", this.trigger.bind(this, "partialdone"));
  99923. this.cc708Stream_.on("done", this.trigger.bind(this, "done"));
  99924. }
  99925. };
  99926. CaptionStream$1.prototype = new stream();
  99927. CaptionStream$1.prototype.push = function(event2) {
  99928. var sei, userData, newCaptionPackets;
  99929. if (event2.nalUnitType !== "sei_rbsp") {
  99930. return;
  99931. }
  99932. sei = captionPacketParser.parseSei(event2.escapedRBSP);
  99933. if (!sei.payload) {
  99934. return;
  99935. }
  99936. if (sei.payloadType !== captionPacketParser.USER_DATA_REGISTERED_ITU_T_T35) {
  99937. return;
  99938. }
  99939. userData = captionPacketParser.parseUserData(sei);
  99940. if (!userData) {
  99941. return;
  99942. }
  99943. if (event2.dts < this.latestDts_) {
  99944. this.ignoreNextEqualDts_ = true;
  99945. return;
  99946. } else if (event2.dts === this.latestDts_ && this.ignoreNextEqualDts_) {
  99947. this.numSameDts_--;
  99948. if (!this.numSameDts_) {
  99949. this.ignoreNextEqualDts_ = false;
  99950. }
  99951. return;
  99952. }
  99953. newCaptionPackets = captionPacketParser.parseCaptionPackets(event2.pts, userData);
  99954. this.captionPackets_ = this.captionPackets_.concat(newCaptionPackets);
  99955. if (this.latestDts_ !== event2.dts) {
  99956. this.numSameDts_ = 0;
  99957. }
  99958. this.numSameDts_++;
  99959. this.latestDts_ = event2.dts;
  99960. };
  99961. CaptionStream$1.prototype.flushCCStreams = function(flushType) {
  99962. this.ccStreams_.forEach(function(cc) {
  99963. return flushType === "flush" ? cc.flush() : cc.partialFlush();
  99964. }, this);
  99965. };
  99966. CaptionStream$1.prototype.flushStream = function(flushType) {
  99967. if (!this.captionPackets_.length) {
  99968. this.flushCCStreams(flushType);
  99969. return;
  99970. }
  99971. this.captionPackets_.forEach(function(elem, idx) {
  99972. elem.presortIndex = idx;
  99973. });
  99974. this.captionPackets_.sort(function(a, b) {
  99975. if (a.pts === b.pts) {
  99976. return a.presortIndex - b.presortIndex;
  99977. }
  99978. return a.pts - b.pts;
  99979. });
  99980. this.captionPackets_.forEach(function(packet) {
  99981. if (packet.type < 2) {
  99982. this.dispatchCea608Packet(packet);
  99983. } else {
  99984. this.dispatchCea708Packet(packet);
  99985. }
  99986. }, this);
  99987. this.captionPackets_.length = 0;
  99988. this.flushCCStreams(flushType);
  99989. };
  99990. CaptionStream$1.prototype.flush = function() {
  99991. return this.flushStream("flush");
  99992. };
  99993. CaptionStream$1.prototype.partialFlush = function() {
  99994. return this.flushStream("partialFlush");
  99995. };
  99996. CaptionStream$1.prototype.reset = function() {
  99997. this.latestDts_ = null;
  99998. this.ignoreNextEqualDts_ = false;
  99999. this.numSameDts_ = 0;
  100000. this.activeCea608Channel_ = [null, null];
  100001. this.ccStreams_.forEach(function(ccStream) {
  100002. ccStream.reset();
  100003. });
  100004. };
  100005. CaptionStream$1.prototype.dispatchCea608Packet = function(packet) {
  100006. if (this.setsTextOrXDSActive(packet)) {
  100007. this.activeCea608Channel_[packet.type] = null;
  100008. } else if (this.setsChannel1Active(packet)) {
  100009. this.activeCea608Channel_[packet.type] = 0;
  100010. } else if (this.setsChannel2Active(packet)) {
  100011. this.activeCea608Channel_[packet.type] = 1;
  100012. }
  100013. if (this.activeCea608Channel_[packet.type] === null) {
  100014. return;
  100015. }
  100016. this.ccStreams_[(packet.type << 1) + this.activeCea608Channel_[packet.type]].push(packet);
  100017. };
  100018. CaptionStream$1.prototype.setsChannel1Active = function(packet) {
  100019. return (packet.ccData & 30720) === 4096;
  100020. };
  100021. CaptionStream$1.prototype.setsChannel2Active = function(packet) {
  100022. return (packet.ccData & 30720) === 6144;
  100023. };
  100024. CaptionStream$1.prototype.setsTextOrXDSActive = function(packet) {
  100025. return (packet.ccData & 28928) === 256 || (packet.ccData & 30974) === 4138 || (packet.ccData & 30974) === 6186;
  100026. };
  100027. CaptionStream$1.prototype.dispatchCea708Packet = function(packet) {
  100028. if (this.parse708captions_) {
  100029. this.cc708Stream_.push(packet);
  100030. }
  100031. };
  100032. var CHARACTER_TRANSLATION_708 = {
  100033. 127: 9834,
  100034. 4128: 32,
  100035. 4129: 160,
  100036. 4133: 8230,
  100037. 4138: 352,
  100038. 4140: 338,
  100039. 4144: 9608,
  100040. 4145: 8216,
  100041. 4146: 8217,
  100042. 4147: 8220,
  100043. 4148: 8221,
  100044. 4149: 8226,
  100045. 4153: 8482,
  100046. 4154: 353,
  100047. 4156: 339,
  100048. 4157: 8480,
  100049. 4159: 376,
  100050. 4214: 8539,
  100051. 4215: 8540,
  100052. 4216: 8541,
  100053. 4217: 8542,
  100054. 4218: 9168,
  100055. 4219: 9124,
  100056. 4220: 9123,
  100057. 4221: 9135,
  100058. 4222: 9126,
  100059. 4223: 9121,
  100060. 4256: 12600
  100061. };
  100062. var get708CharFromCode = function get708CharFromCode2(code) {
  100063. var newCode = CHARACTER_TRANSLATION_708[code] || code;
  100064. if (code & 4096 && code === newCode) {
  100065. return "";
  100066. }
  100067. return String.fromCharCode(newCode);
  100068. };
  100069. var within708TextBlock = function within708TextBlock2(b) {
  100070. return 32 <= b && b <= 127 || 160 <= b && b <= 255;
  100071. };
  100072. var Cea708Window = function Cea708Window2(windowNum) {
  100073. this.windowNum = windowNum;
  100074. this.reset();
  100075. };
  100076. Cea708Window.prototype.reset = function() {
  100077. this.clearText();
  100078. this.pendingNewLine = false;
  100079. this.winAttr = {};
  100080. this.penAttr = {};
  100081. this.penLoc = {};
  100082. this.penColor = {};
  100083. this.visible = 0;
  100084. this.rowLock = 0;
  100085. this.columnLock = 0;
  100086. this.priority = 0;
  100087. this.relativePositioning = 0;
  100088. this.anchorVertical = 0;
  100089. this.anchorHorizontal = 0;
  100090. this.anchorPoint = 0;
  100091. this.rowCount = 1;
  100092. this.virtualRowCount = this.rowCount + 1;
  100093. this.columnCount = 41;
  100094. this.windowStyle = 0;
  100095. this.penStyle = 0;
  100096. };
  100097. Cea708Window.prototype.getText = function() {
  100098. return this.rows.join("\n");
  100099. };
  100100. Cea708Window.prototype.clearText = function() {
  100101. this.rows = [""];
  100102. this.rowIdx = 0;
  100103. };
  100104. Cea708Window.prototype.newLine = function(pts) {
  100105. if (this.rows.length >= this.virtualRowCount && typeof this.beforeRowOverflow === "function") {
  100106. this.beforeRowOverflow(pts);
  100107. }
  100108. if (this.rows.length > 0) {
  100109. this.rows.push("");
  100110. this.rowIdx++;
  100111. }
  100112. while (this.rows.length > this.virtualRowCount) {
  100113. this.rows.shift();
  100114. this.rowIdx--;
  100115. }
  100116. };
  100117. Cea708Window.prototype.isEmpty = function() {
  100118. if (this.rows.length === 0) {
  100119. return true;
  100120. } else if (this.rows.length === 1) {
  100121. return this.rows[0] === "";
  100122. }
  100123. return false;
  100124. };
  100125. Cea708Window.prototype.addText = function(text) {
  100126. this.rows[this.rowIdx] += text;
  100127. };
  100128. Cea708Window.prototype.backspace = function() {
  100129. if (!this.isEmpty()) {
  100130. var row = this.rows[this.rowIdx];
  100131. this.rows[this.rowIdx] = row.substr(0, row.length - 1);
  100132. }
  100133. };
  100134. var Cea708Service = function Cea708Service2(serviceNum, encoding, stream2) {
  100135. this.serviceNum = serviceNum;
  100136. this.text = "";
  100137. this.currentWindow = new Cea708Window(-1);
  100138. this.windows = [];
  100139. this.stream = stream2;
  100140. if (typeof encoding === "string") {
  100141. this.createTextDecoder(encoding);
  100142. }
  100143. };
  100144. Cea708Service.prototype.init = function(pts, beforeRowOverflow) {
  100145. this.startPts = pts;
  100146. for (var win3 = 0; win3 < 8; win3++) {
  100147. this.windows[win3] = new Cea708Window(win3);
  100148. if (typeof beforeRowOverflow === "function") {
  100149. this.windows[win3].beforeRowOverflow = beforeRowOverflow;
  100150. }
  100151. }
  100152. };
  100153. Cea708Service.prototype.setCurrentWindow = function(windowNum) {
  100154. this.currentWindow = this.windows[windowNum];
  100155. };
  100156. Cea708Service.prototype.createTextDecoder = function(encoding) {
  100157. if (typeof TextDecoder === "undefined") {
  100158. this.stream.trigger("log", {
  100159. level: "warn",
  100160. message: "The `encoding` option is unsupported without TextDecoder support"
  100161. });
  100162. } else {
  100163. try {
  100164. this.textDecoder_ = new TextDecoder(encoding);
  100165. } catch (error) {
  100166. this.stream.trigger("log", {
  100167. level: "warn",
  100168. message: "TextDecoder could not be created with " + encoding + " encoding. " + error
  100169. });
  100170. }
  100171. }
  100172. };
  100173. var Cea708Stream = function Cea708Stream2(options2) {
  100174. options2 = options2 || {};
  100175. Cea708Stream2.prototype.init.call(this);
  100176. var self2 = this;
  100177. var captionServices = options2.captionServices || {};
  100178. var captionServiceEncodings = {};
  100179. var serviceProps;
  100180. Object.keys(captionServices).forEach(function(serviceName) {
  100181. serviceProps = captionServices[serviceName];
  100182. if (/^SERVICE/.test(serviceName)) {
  100183. captionServiceEncodings[serviceName] = serviceProps.encoding;
  100184. }
  100185. });
  100186. this.serviceEncodings = captionServiceEncodings;
  100187. this.current708Packet = null;
  100188. this.services = {};
  100189. this.push = function(packet) {
  100190. if (packet.type === 3) {
  100191. self2.new708Packet();
  100192. self2.add708Bytes(packet);
  100193. } else {
  100194. if (self2.current708Packet === null) {
  100195. self2.new708Packet();
  100196. }
  100197. self2.add708Bytes(packet);
  100198. }
  100199. };
  100200. };
  100201. Cea708Stream.prototype = new stream();
  100202. Cea708Stream.prototype.new708Packet = function() {
  100203. if (this.current708Packet !== null) {
  100204. this.push708Packet();
  100205. }
  100206. this.current708Packet = {
  100207. data: [],
  100208. ptsVals: []
  100209. };
  100210. };
  100211. Cea708Stream.prototype.add708Bytes = function(packet) {
  100212. var data = packet.ccData;
  100213. var byte0 = data >>> 8;
  100214. var byte1 = data & 255;
  100215. this.current708Packet.ptsVals.push(packet.pts);
  100216. this.current708Packet.data.push(byte0);
  100217. this.current708Packet.data.push(byte1);
  100218. };
  100219. Cea708Stream.prototype.push708Packet = function() {
  100220. var packet708 = this.current708Packet;
  100221. var packetData = packet708.data;
  100222. var serviceNum = null;
  100223. var blockSize = null;
  100224. var i2 = 0;
  100225. var b = packetData[i2++];
  100226. packet708.seq = b >> 6;
  100227. packet708.sizeCode = b & 63;
  100228. for (; i2 < packetData.length; i2++) {
  100229. b = packetData[i2++];
  100230. serviceNum = b >> 5;
  100231. blockSize = b & 31;
  100232. if (serviceNum === 7 && blockSize > 0) {
  100233. b = packetData[i2++];
  100234. serviceNum = b;
  100235. }
  100236. this.pushServiceBlock(serviceNum, i2, blockSize);
  100237. if (blockSize > 0) {
  100238. i2 += blockSize - 1;
  100239. }
  100240. }
  100241. };
  100242. Cea708Stream.prototype.pushServiceBlock = function(serviceNum, start2, size) {
  100243. var b;
  100244. var i2 = start2;
  100245. var packetData = this.current708Packet.data;
  100246. var service = this.services[serviceNum];
  100247. if (!service) {
  100248. service = this.initService(serviceNum, i2);
  100249. }
  100250. for (; i2 < start2 + size && i2 < packetData.length; i2++) {
  100251. b = packetData[i2];
  100252. if (within708TextBlock(b)) {
  100253. i2 = this.handleText(i2, service);
  100254. } else if (b === 24) {
  100255. i2 = this.multiByteCharacter(i2, service);
  100256. } else if (b === 16) {
  100257. i2 = this.extendedCommands(i2, service);
  100258. } else if (128 <= b && b <= 135) {
  100259. i2 = this.setCurrentWindow(i2, service);
  100260. } else if (152 <= b && b <= 159) {
  100261. i2 = this.defineWindow(i2, service);
  100262. } else if (b === 136) {
  100263. i2 = this.clearWindows(i2, service);
  100264. } else if (b === 140) {
  100265. i2 = this.deleteWindows(i2, service);
  100266. } else if (b === 137) {
  100267. i2 = this.displayWindows(i2, service);
  100268. } else if (b === 138) {
  100269. i2 = this.hideWindows(i2, service);
  100270. } else if (b === 139) {
  100271. i2 = this.toggleWindows(i2, service);
  100272. } else if (b === 151) {
  100273. i2 = this.setWindowAttributes(i2, service);
  100274. } else if (b === 144) {
  100275. i2 = this.setPenAttributes(i2, service);
  100276. } else if (b === 145) {
  100277. i2 = this.setPenColor(i2, service);
  100278. } else if (b === 146) {
  100279. i2 = this.setPenLocation(i2, service);
  100280. } else if (b === 143) {
  100281. service = this.reset(i2, service);
  100282. } else if (b === 8) {
  100283. service.currentWindow.backspace();
  100284. } else if (b === 12) {
  100285. service.currentWindow.clearText();
  100286. } else if (b === 13) {
  100287. service.currentWindow.pendingNewLine = true;
  100288. } else if (b === 14) {
  100289. service.currentWindow.clearText();
  100290. } else if (b === 141) {
  100291. i2++;
  100292. } else
  100293. ;
  100294. }
  100295. };
  100296. Cea708Stream.prototype.extendedCommands = function(i2, service) {
  100297. var packetData = this.current708Packet.data;
  100298. var b = packetData[++i2];
  100299. if (within708TextBlock(b)) {
  100300. i2 = this.handleText(i2, service, {
  100301. isExtended: true
  100302. });
  100303. }
  100304. return i2;
  100305. };
  100306. Cea708Stream.prototype.getPts = function(byteIndex) {
  100307. return this.current708Packet.ptsVals[Math.floor(byteIndex / 2)];
  100308. };
  100309. Cea708Stream.prototype.initService = function(serviceNum, i2) {
  100310. var serviceName = "SERVICE" + serviceNum;
  100311. var self2 = this;
  100312. var serviceName;
  100313. var encoding;
  100314. if (serviceName in this.serviceEncodings) {
  100315. encoding = this.serviceEncodings[serviceName];
  100316. }
  100317. this.services[serviceNum] = new Cea708Service(serviceNum, encoding, self2);
  100318. this.services[serviceNum].init(this.getPts(i2), function(pts) {
  100319. self2.flushDisplayed(pts, self2.services[serviceNum]);
  100320. });
  100321. return this.services[serviceNum];
  100322. };
  100323. Cea708Stream.prototype.handleText = function(i2, service, options2) {
  100324. var isExtended = options2 && options2.isExtended;
  100325. var isMultiByte = options2 && options2.isMultiByte;
  100326. var packetData = this.current708Packet.data;
  100327. var extended = isExtended ? 4096 : 0;
  100328. var currentByte = packetData[i2];
  100329. var nextByte = packetData[i2 + 1];
  100330. var win3 = service.currentWindow;
  100331. var _char;
  100332. var charCodeArray;
  100333. if (service.textDecoder_ && !isExtended) {
  100334. if (isMultiByte) {
  100335. charCodeArray = [currentByte, nextByte];
  100336. i2++;
  100337. } else {
  100338. charCodeArray = [currentByte];
  100339. }
  100340. _char = service.textDecoder_.decode(new Uint8Array(charCodeArray));
  100341. } else {
  100342. _char = get708CharFromCode(extended | currentByte);
  100343. }
  100344. if (win3.pendingNewLine && !win3.isEmpty()) {
  100345. win3.newLine(this.getPts(i2));
  100346. }
  100347. win3.pendingNewLine = false;
  100348. win3.addText(_char);
  100349. return i2;
  100350. };
  100351. Cea708Stream.prototype.multiByteCharacter = function(i2, service) {
  100352. var packetData = this.current708Packet.data;
  100353. var firstByte = packetData[i2 + 1];
  100354. var secondByte = packetData[i2 + 2];
  100355. if (within708TextBlock(firstByte) && within708TextBlock(secondByte)) {
  100356. i2 = this.handleText(++i2, service, {
  100357. isMultiByte: true
  100358. });
  100359. }
  100360. return i2;
  100361. };
  100362. Cea708Stream.prototype.setCurrentWindow = function(i2, service) {
  100363. var packetData = this.current708Packet.data;
  100364. var b = packetData[i2];
  100365. var windowNum = b & 7;
  100366. service.setCurrentWindow(windowNum);
  100367. return i2;
  100368. };
  100369. Cea708Stream.prototype.defineWindow = function(i2, service) {
  100370. var packetData = this.current708Packet.data;
  100371. var b = packetData[i2];
  100372. var windowNum = b & 7;
  100373. service.setCurrentWindow(windowNum);
  100374. var win3 = service.currentWindow;
  100375. b = packetData[++i2];
  100376. win3.visible = (b & 32) >> 5;
  100377. win3.rowLock = (b & 16) >> 4;
  100378. win3.columnLock = (b & 8) >> 3;
  100379. win3.priority = b & 7;
  100380. b = packetData[++i2];
  100381. win3.relativePositioning = (b & 128) >> 7;
  100382. win3.anchorVertical = b & 127;
  100383. b = packetData[++i2];
  100384. win3.anchorHorizontal = b;
  100385. b = packetData[++i2];
  100386. win3.anchorPoint = (b & 240) >> 4;
  100387. win3.rowCount = b & 15;
  100388. b = packetData[++i2];
  100389. win3.columnCount = b & 63;
  100390. b = packetData[++i2];
  100391. win3.windowStyle = (b & 56) >> 3;
  100392. win3.penStyle = b & 7;
  100393. win3.virtualRowCount = win3.rowCount + 1;
  100394. return i2;
  100395. };
  100396. Cea708Stream.prototype.setWindowAttributes = function(i2, service) {
  100397. var packetData = this.current708Packet.data;
  100398. var b = packetData[i2];
  100399. var winAttr = service.currentWindow.winAttr;
  100400. b = packetData[++i2];
  100401. winAttr.fillOpacity = (b & 192) >> 6;
  100402. winAttr.fillRed = (b & 48) >> 4;
  100403. winAttr.fillGreen = (b & 12) >> 2;
  100404. winAttr.fillBlue = b & 3;
  100405. b = packetData[++i2];
  100406. winAttr.borderType = (b & 192) >> 6;
  100407. winAttr.borderRed = (b & 48) >> 4;
  100408. winAttr.borderGreen = (b & 12) >> 2;
  100409. winAttr.borderBlue = b & 3;
  100410. b = packetData[++i2];
  100411. winAttr.borderType += (b & 128) >> 5;
  100412. winAttr.wordWrap = (b & 64) >> 6;
  100413. winAttr.printDirection = (b & 48) >> 4;
  100414. winAttr.scrollDirection = (b & 12) >> 2;
  100415. winAttr.justify = b & 3;
  100416. b = packetData[++i2];
  100417. winAttr.effectSpeed = (b & 240) >> 4;
  100418. winAttr.effectDirection = (b & 12) >> 2;
  100419. winAttr.displayEffect = b & 3;
  100420. return i2;
  100421. };
  100422. Cea708Stream.prototype.flushDisplayed = function(pts, service) {
  100423. var displayedText = [];
  100424. for (var winId = 0; winId < 8; winId++) {
  100425. if (service.windows[winId].visible && !service.windows[winId].isEmpty()) {
  100426. displayedText.push(service.windows[winId].getText());
  100427. }
  100428. }
  100429. service.endPts = pts;
  100430. service.text = displayedText.join("\n\n");
  100431. this.pushCaption(service);
  100432. service.startPts = pts;
  100433. };
  100434. Cea708Stream.prototype.pushCaption = function(service) {
  100435. if (service.text !== "") {
  100436. this.trigger("data", {
  100437. startPts: service.startPts,
  100438. endPts: service.endPts,
  100439. text: service.text,
  100440. stream: "cc708_" + service.serviceNum
  100441. });
  100442. service.text = "";
  100443. service.startPts = service.endPts;
  100444. }
  100445. };
  100446. Cea708Stream.prototype.displayWindows = function(i2, service) {
  100447. var packetData = this.current708Packet.data;
  100448. var b = packetData[++i2];
  100449. var pts = this.getPts(i2);
  100450. this.flushDisplayed(pts, service);
  100451. for (var winId = 0; winId < 8; winId++) {
  100452. if (b & 1 << winId) {
  100453. service.windows[winId].visible = 1;
  100454. }
  100455. }
  100456. return i2;
  100457. };
  100458. Cea708Stream.prototype.hideWindows = function(i2, service) {
  100459. var packetData = this.current708Packet.data;
  100460. var b = packetData[++i2];
  100461. var pts = this.getPts(i2);
  100462. this.flushDisplayed(pts, service);
  100463. for (var winId = 0; winId < 8; winId++) {
  100464. if (b & 1 << winId) {
  100465. service.windows[winId].visible = 0;
  100466. }
  100467. }
  100468. return i2;
  100469. };
  100470. Cea708Stream.prototype.toggleWindows = function(i2, service) {
  100471. var packetData = this.current708Packet.data;
  100472. var b = packetData[++i2];
  100473. var pts = this.getPts(i2);
  100474. this.flushDisplayed(pts, service);
  100475. for (var winId = 0; winId < 8; winId++) {
  100476. if (b & 1 << winId) {
  100477. service.windows[winId].visible ^= 1;
  100478. }
  100479. }
  100480. return i2;
  100481. };
  100482. Cea708Stream.prototype.clearWindows = function(i2, service) {
  100483. var packetData = this.current708Packet.data;
  100484. var b = packetData[++i2];
  100485. var pts = this.getPts(i2);
  100486. this.flushDisplayed(pts, service);
  100487. for (var winId = 0; winId < 8; winId++) {
  100488. if (b & 1 << winId) {
  100489. service.windows[winId].clearText();
  100490. }
  100491. }
  100492. return i2;
  100493. };
  100494. Cea708Stream.prototype.deleteWindows = function(i2, service) {
  100495. var packetData = this.current708Packet.data;
  100496. var b = packetData[++i2];
  100497. var pts = this.getPts(i2);
  100498. this.flushDisplayed(pts, service);
  100499. for (var winId = 0; winId < 8; winId++) {
  100500. if (b & 1 << winId) {
  100501. service.windows[winId].reset();
  100502. }
  100503. }
  100504. return i2;
  100505. };
  100506. Cea708Stream.prototype.setPenAttributes = function(i2, service) {
  100507. var packetData = this.current708Packet.data;
  100508. var b = packetData[i2];
  100509. var penAttr = service.currentWindow.penAttr;
  100510. b = packetData[++i2];
  100511. penAttr.textTag = (b & 240) >> 4;
  100512. penAttr.offset = (b & 12) >> 2;
  100513. penAttr.penSize = b & 3;
  100514. b = packetData[++i2];
  100515. penAttr.italics = (b & 128) >> 7;
  100516. penAttr.underline = (b & 64) >> 6;
  100517. penAttr.edgeType = (b & 56) >> 3;
  100518. penAttr.fontStyle = b & 7;
  100519. return i2;
  100520. };
  100521. Cea708Stream.prototype.setPenColor = function(i2, service) {
  100522. var packetData = this.current708Packet.data;
  100523. var b = packetData[i2];
  100524. var penColor = service.currentWindow.penColor;
  100525. b = packetData[++i2];
  100526. penColor.fgOpacity = (b & 192) >> 6;
  100527. penColor.fgRed = (b & 48) >> 4;
  100528. penColor.fgGreen = (b & 12) >> 2;
  100529. penColor.fgBlue = b & 3;
  100530. b = packetData[++i2];
  100531. penColor.bgOpacity = (b & 192) >> 6;
  100532. penColor.bgRed = (b & 48) >> 4;
  100533. penColor.bgGreen = (b & 12) >> 2;
  100534. penColor.bgBlue = b & 3;
  100535. b = packetData[++i2];
  100536. penColor.edgeRed = (b & 48) >> 4;
  100537. penColor.edgeGreen = (b & 12) >> 2;
  100538. penColor.edgeBlue = b & 3;
  100539. return i2;
  100540. };
  100541. Cea708Stream.prototype.setPenLocation = function(i2, service) {
  100542. var packetData = this.current708Packet.data;
  100543. var b = packetData[i2];
  100544. var penLoc = service.currentWindow.penLoc;
  100545. service.currentWindow.pendingNewLine = true;
  100546. b = packetData[++i2];
  100547. penLoc.row = b & 15;
  100548. b = packetData[++i2];
  100549. penLoc.column = b & 63;
  100550. return i2;
  100551. };
  100552. Cea708Stream.prototype.reset = function(i2, service) {
  100553. var pts = this.getPts(i2);
  100554. this.flushDisplayed(pts, service);
  100555. return this.initService(service.serviceNum, i2);
  100556. };
  100557. var CHARACTER_TRANSLATION = {
  100558. 42: 225,
  100559. 92: 233,
  100560. 94: 237,
  100561. 95: 243,
  100562. 96: 250,
  100563. 123: 231,
  100564. 124: 247,
  100565. 125: 209,
  100566. 126: 241,
  100567. 127: 9608,
  100568. 304: 174,
  100569. 305: 176,
  100570. 306: 189,
  100571. 307: 191,
  100572. 308: 8482,
  100573. 309: 162,
  100574. 310: 163,
  100575. 311: 9834,
  100576. 312: 224,
  100577. 313: 160,
  100578. 314: 232,
  100579. 315: 226,
  100580. 316: 234,
  100581. 317: 238,
  100582. 318: 244,
  100583. 319: 251,
  100584. 544: 193,
  100585. 545: 201,
  100586. 546: 211,
  100587. 547: 218,
  100588. 548: 220,
  100589. 549: 252,
  100590. 550: 8216,
  100591. 551: 161,
  100592. 552: 42,
  100593. 553: 39,
  100594. 554: 8212,
  100595. 555: 169,
  100596. 556: 8480,
  100597. 557: 8226,
  100598. 558: 8220,
  100599. 559: 8221,
  100600. 560: 192,
  100601. 561: 194,
  100602. 562: 199,
  100603. 563: 200,
  100604. 564: 202,
  100605. 565: 203,
  100606. 566: 235,
  100607. 567: 206,
  100608. 568: 207,
  100609. 569: 239,
  100610. 570: 212,
  100611. 571: 217,
  100612. 572: 249,
  100613. 573: 219,
  100614. 574: 171,
  100615. 575: 187,
  100616. 800: 195,
  100617. 801: 227,
  100618. 802: 205,
  100619. 803: 204,
  100620. 804: 236,
  100621. 805: 210,
  100622. 806: 242,
  100623. 807: 213,
  100624. 808: 245,
  100625. 809: 123,
  100626. 810: 125,
  100627. 811: 92,
  100628. 812: 94,
  100629. 813: 95,
  100630. 814: 124,
  100631. 815: 126,
  100632. 816: 196,
  100633. 817: 228,
  100634. 818: 214,
  100635. 819: 246,
  100636. 820: 223,
  100637. 821: 165,
  100638. 822: 164,
  100639. 823: 9474,
  100640. 824: 197,
  100641. 825: 229,
  100642. 826: 216,
  100643. 827: 248,
  100644. 828: 9484,
  100645. 829: 9488,
  100646. 830: 9492,
  100647. 831: 9496
  100648. };
  100649. var getCharFromCode = function getCharFromCode2(code) {
  100650. if (code === null) {
  100651. return "";
  100652. }
  100653. code = CHARACTER_TRANSLATION[code] || code;
  100654. return String.fromCharCode(code);
  100655. };
  100656. var BOTTOM_ROW = 14;
  100657. var ROWS = [4352, 4384, 4608, 4640, 5376, 5408, 5632, 5664, 5888, 5920, 4096, 4864, 4896, 5120, 5152];
  100658. var createDisplayBuffer = function createDisplayBuffer2() {
  100659. var result = [], i2 = BOTTOM_ROW + 1;
  100660. while (i2--) {
  100661. result.push("");
  100662. }
  100663. return result;
  100664. };
  100665. var Cea608Stream = function Cea608Stream2(field, dataChannel) {
  100666. Cea608Stream2.prototype.init.call(this);
  100667. this.field_ = field || 0;
  100668. this.dataChannel_ = dataChannel || 0;
  100669. this.name_ = "CC" + ((this.field_ << 1 | this.dataChannel_) + 1);
  100670. this.setConstants();
  100671. this.reset();
  100672. this.push = function(packet) {
  100673. var data, swap, char0, char1, text;
  100674. data = packet.ccData & 32639;
  100675. if (data === this.lastControlCode_) {
  100676. this.lastControlCode_ = null;
  100677. return;
  100678. }
  100679. if ((data & 61440) === 4096) {
  100680. this.lastControlCode_ = data;
  100681. } else if (data !== this.PADDING_) {
  100682. this.lastControlCode_ = null;
  100683. }
  100684. char0 = data >>> 8;
  100685. char1 = data & 255;
  100686. if (data === this.PADDING_) {
  100687. return;
  100688. } else if (data === this.RESUME_CAPTION_LOADING_) {
  100689. this.mode_ = "popOn";
  100690. } else if (data === this.END_OF_CAPTION_) {
  100691. this.mode_ = "popOn";
  100692. this.clearFormatting(packet.pts);
  100693. this.flushDisplayed(packet.pts);
  100694. swap = this.displayed_;
  100695. this.displayed_ = this.nonDisplayed_;
  100696. this.nonDisplayed_ = swap;
  100697. this.startPts_ = packet.pts;
  100698. } else if (data === this.ROLL_UP_2_ROWS_) {
  100699. this.rollUpRows_ = 2;
  100700. this.setRollUp(packet.pts);
  100701. } else if (data === this.ROLL_UP_3_ROWS_) {
  100702. this.rollUpRows_ = 3;
  100703. this.setRollUp(packet.pts);
  100704. } else if (data === this.ROLL_UP_4_ROWS_) {
  100705. this.rollUpRows_ = 4;
  100706. this.setRollUp(packet.pts);
  100707. } else if (data === this.CARRIAGE_RETURN_) {
  100708. this.clearFormatting(packet.pts);
  100709. this.flushDisplayed(packet.pts);
  100710. this.shiftRowsUp_();
  100711. this.startPts_ = packet.pts;
  100712. } else if (data === this.BACKSPACE_) {
  100713. if (this.mode_ === "popOn") {
  100714. this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);
  100715. } else {
  100716. this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);
  100717. }
  100718. } else if (data === this.ERASE_DISPLAYED_MEMORY_) {
  100719. this.flushDisplayed(packet.pts);
  100720. this.displayed_ = createDisplayBuffer();
  100721. } else if (data === this.ERASE_NON_DISPLAYED_MEMORY_) {
  100722. this.nonDisplayed_ = createDisplayBuffer();
  100723. } else if (data === this.RESUME_DIRECT_CAPTIONING_) {
  100724. if (this.mode_ !== "paintOn") {
  100725. this.flushDisplayed(packet.pts);
  100726. this.displayed_ = createDisplayBuffer();
  100727. }
  100728. this.mode_ = "paintOn";
  100729. this.startPts_ = packet.pts;
  100730. } else if (this.isSpecialCharacter(char0, char1)) {
  100731. char0 = (char0 & 3) << 8;
  100732. text = getCharFromCode(char0 | char1);
  100733. this[this.mode_](packet.pts, text);
  100734. this.column_++;
  100735. } else if (this.isExtCharacter(char0, char1)) {
  100736. if (this.mode_ === "popOn") {
  100737. this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1);
  100738. } else {
  100739. this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1);
  100740. }
  100741. char0 = (char0 & 3) << 8;
  100742. text = getCharFromCode(char0 | char1);
  100743. this[this.mode_](packet.pts, text);
  100744. this.column_++;
  100745. } else if (this.isMidRowCode(char0, char1)) {
  100746. this.clearFormatting(packet.pts);
  100747. this[this.mode_](packet.pts, " ");
  100748. this.column_++;
  100749. if ((char1 & 14) === 14) {
  100750. this.addFormatting(packet.pts, ["i"]);
  100751. }
  100752. if ((char1 & 1) === 1) {
  100753. this.addFormatting(packet.pts, ["u"]);
  100754. }
  100755. } else if (this.isOffsetControlCode(char0, char1)) {
  100756. this.column_ += char1 & 3;
  100757. } else if (this.isPAC(char0, char1)) {
  100758. var row = ROWS.indexOf(data & 7968);
  100759. if (this.mode_ === "rollUp") {
  100760. if (row - this.rollUpRows_ + 1 < 0) {
  100761. row = this.rollUpRows_ - 1;
  100762. }
  100763. this.setRollUp(packet.pts, row);
  100764. }
  100765. if (row !== this.row_) {
  100766. this.clearFormatting(packet.pts);
  100767. this.row_ = row;
  100768. }
  100769. if (char1 & 1 && this.formatting_.indexOf("u") === -1) {
  100770. this.addFormatting(packet.pts, ["u"]);
  100771. }
  100772. if ((data & 16) === 16) {
  100773. this.column_ = ((data & 14) >> 1) * 4;
  100774. }
  100775. if (this.isColorPAC(char1)) {
  100776. if ((char1 & 14) === 14) {
  100777. this.addFormatting(packet.pts, ["i"]);
  100778. }
  100779. }
  100780. } else if (this.isNormalChar(char0)) {
  100781. if (char1 === 0) {
  100782. char1 = null;
  100783. }
  100784. text = getCharFromCode(char0);
  100785. text += getCharFromCode(char1);
  100786. this[this.mode_](packet.pts, text);
  100787. this.column_ += text.length;
  100788. }
  100789. };
  100790. };
  100791. Cea608Stream.prototype = new stream();
  100792. Cea608Stream.prototype.flushDisplayed = function(pts) {
  100793. var content = this.displayed_.map(function(row, index2) {
  100794. try {
  100795. return row.trim();
  100796. } catch (e) {
  100797. this.trigger("log", {
  100798. level: "warn",
  100799. message: "Skipping a malformed 608 caption at index " + index2 + "."
  100800. });
  100801. return "";
  100802. }
  100803. }, this).join("\n").replace(/^\n+|\n+$/g, "");
  100804. if (content.length) {
  100805. this.trigger("data", {
  100806. startPts: this.startPts_,
  100807. endPts: pts,
  100808. text: content,
  100809. stream: this.name_
  100810. });
  100811. }
  100812. };
  100813. Cea608Stream.prototype.reset = function() {
  100814. this.mode_ = "popOn";
  100815. this.topRow_ = 0;
  100816. this.startPts_ = 0;
  100817. this.displayed_ = createDisplayBuffer();
  100818. this.nonDisplayed_ = createDisplayBuffer();
  100819. this.lastControlCode_ = null;
  100820. this.column_ = 0;
  100821. this.row_ = BOTTOM_ROW;
  100822. this.rollUpRows_ = 2;
  100823. this.formatting_ = [];
  100824. };
  100825. Cea608Stream.prototype.setConstants = function() {
  100826. if (this.dataChannel_ === 0) {
  100827. this.BASE_ = 16;
  100828. this.EXT_ = 17;
  100829. this.CONTROL_ = (20 | this.field_) << 8;
  100830. this.OFFSET_ = 23;
  100831. } else if (this.dataChannel_ === 1) {
  100832. this.BASE_ = 24;
  100833. this.EXT_ = 25;
  100834. this.CONTROL_ = (28 | this.field_) << 8;
  100835. this.OFFSET_ = 31;
  100836. }
  100837. this.PADDING_ = 0;
  100838. this.RESUME_CAPTION_LOADING_ = this.CONTROL_ | 32;
  100839. this.END_OF_CAPTION_ = this.CONTROL_ | 47;
  100840. this.ROLL_UP_2_ROWS_ = this.CONTROL_ | 37;
  100841. this.ROLL_UP_3_ROWS_ = this.CONTROL_ | 38;
  100842. this.ROLL_UP_4_ROWS_ = this.CONTROL_ | 39;
  100843. this.CARRIAGE_RETURN_ = this.CONTROL_ | 45;
  100844. this.RESUME_DIRECT_CAPTIONING_ = this.CONTROL_ | 41;
  100845. this.BACKSPACE_ = this.CONTROL_ | 33;
  100846. this.ERASE_DISPLAYED_MEMORY_ = this.CONTROL_ | 44;
  100847. this.ERASE_NON_DISPLAYED_MEMORY_ = this.CONTROL_ | 46;
  100848. };
  100849. Cea608Stream.prototype.isSpecialCharacter = function(char0, char1) {
  100850. return char0 === this.EXT_ && char1 >= 48 && char1 <= 63;
  100851. };
  100852. Cea608Stream.prototype.isExtCharacter = function(char0, char1) {
  100853. return (char0 === this.EXT_ + 1 || char0 === this.EXT_ + 2) && char1 >= 32 && char1 <= 63;
  100854. };
  100855. Cea608Stream.prototype.isMidRowCode = function(char0, char1) {
  100856. return char0 === this.EXT_ && char1 >= 32 && char1 <= 47;
  100857. };
  100858. Cea608Stream.prototype.isOffsetControlCode = function(char0, char1) {
  100859. return char0 === this.OFFSET_ && char1 >= 33 && char1 <= 35;
  100860. };
  100861. Cea608Stream.prototype.isPAC = function(char0, char1) {
  100862. return char0 >= this.BASE_ && char0 < this.BASE_ + 8 && char1 >= 64 && char1 <= 127;
  100863. };
  100864. Cea608Stream.prototype.isColorPAC = function(char1) {
  100865. return char1 >= 64 && char1 <= 79 || char1 >= 96 && char1 <= 127;
  100866. };
  100867. Cea608Stream.prototype.isNormalChar = function(_char2) {
  100868. return _char2 >= 32 && _char2 <= 127;
  100869. };
  100870. Cea608Stream.prototype.setRollUp = function(pts, newBaseRow) {
  100871. if (this.mode_ !== "rollUp") {
  100872. this.row_ = BOTTOM_ROW;
  100873. this.mode_ = "rollUp";
  100874. this.flushDisplayed(pts);
  100875. this.nonDisplayed_ = createDisplayBuffer();
  100876. this.displayed_ = createDisplayBuffer();
  100877. }
  100878. if (newBaseRow !== void 0 && newBaseRow !== this.row_) {
  100879. for (var i2 = 0; i2 < this.rollUpRows_; i2++) {
  100880. this.displayed_[newBaseRow - i2] = this.displayed_[this.row_ - i2];
  100881. this.displayed_[this.row_ - i2] = "";
  100882. }
  100883. }
  100884. if (newBaseRow === void 0) {
  100885. newBaseRow = this.row_;
  100886. }
  100887. this.topRow_ = newBaseRow - this.rollUpRows_ + 1;
  100888. };
  100889. Cea608Stream.prototype.addFormatting = function(pts, format) {
  100890. this.formatting_ = this.formatting_.concat(format);
  100891. var text = format.reduce(function(text2, format2) {
  100892. return text2 + "<" + format2 + ">";
  100893. }, "");
  100894. this[this.mode_](pts, text);
  100895. };
  100896. Cea608Stream.prototype.clearFormatting = function(pts) {
  100897. if (!this.formatting_.length) {
  100898. return;
  100899. }
  100900. var text = this.formatting_.reverse().reduce(function(text2, format) {
  100901. return text2 + "</" + format + ">";
  100902. }, "");
  100903. this.formatting_ = [];
  100904. this[this.mode_](pts, text);
  100905. };
  100906. Cea608Stream.prototype.popOn = function(pts, text) {
  100907. var baseRow = this.nonDisplayed_[this.row_];
  100908. baseRow += text;
  100909. this.nonDisplayed_[this.row_] = baseRow;
  100910. };
  100911. Cea608Stream.prototype.rollUp = function(pts, text) {
  100912. var baseRow = this.displayed_[this.row_];
  100913. baseRow += text;
  100914. this.displayed_[this.row_] = baseRow;
  100915. };
  100916. Cea608Stream.prototype.shiftRowsUp_ = function() {
  100917. var i2;
  100918. for (i2 = 0; i2 < this.topRow_; i2++) {
  100919. this.displayed_[i2] = "";
  100920. }
  100921. for (i2 = this.row_ + 1; i2 < BOTTOM_ROW + 1; i2++) {
  100922. this.displayed_[i2] = "";
  100923. }
  100924. for (i2 = this.topRow_; i2 < this.row_; i2++) {
  100925. this.displayed_[i2] = this.displayed_[i2 + 1];
  100926. }
  100927. this.displayed_[this.row_] = "";
  100928. };
  100929. Cea608Stream.prototype.paintOn = function(pts, text) {
  100930. var baseRow = this.displayed_[this.row_];
  100931. baseRow += text;
  100932. this.displayed_[this.row_] = baseRow;
  100933. };
  100934. var captionStream = {
  100935. CaptionStream: CaptionStream$1,
  100936. Cea608Stream,
  100937. Cea708Stream
  100938. };
  100939. var streamTypes = {
  100940. H264_STREAM_TYPE: 27,
  100941. ADTS_STREAM_TYPE: 15,
  100942. METADATA_STREAM_TYPE: 21
  100943. };
  100944. var MAX_TS = 8589934592;
  100945. var RO_THRESH = 4294967296;
  100946. var TYPE_SHARED = "shared";
  100947. var handleRollover$1 = function handleRollover2(value, reference) {
  100948. var direction = 1;
  100949. if (value > reference) {
  100950. direction = -1;
  100951. }
  100952. while (Math.abs(reference - value) > RO_THRESH) {
  100953. value += direction * MAX_TS;
  100954. }
  100955. return value;
  100956. };
  100957. var TimestampRolloverStream$1 = function TimestampRolloverStream2(type3) {
  100958. var lastDTS, referenceDTS;
  100959. TimestampRolloverStream2.prototype.init.call(this);
  100960. this.type_ = type3 || TYPE_SHARED;
  100961. this.push = function(data) {
  100962. if (this.type_ !== TYPE_SHARED && data.type !== this.type_) {
  100963. return;
  100964. }
  100965. if (referenceDTS === void 0) {
  100966. referenceDTS = data.dts;
  100967. }
  100968. data.dts = handleRollover$1(data.dts, referenceDTS);
  100969. data.pts = handleRollover$1(data.pts, referenceDTS);
  100970. lastDTS = data.dts;
  100971. this.trigger("data", data);
  100972. };
  100973. this.flush = function() {
  100974. referenceDTS = lastDTS;
  100975. this.trigger("done");
  100976. };
  100977. this.endTimeline = function() {
  100978. this.flush();
  100979. this.trigger("endedtimeline");
  100980. };
  100981. this.discontinuity = function() {
  100982. referenceDTS = void 0;
  100983. lastDTS = void 0;
  100984. };
  100985. this.reset = function() {
  100986. this.discontinuity();
  100987. this.trigger("reset");
  100988. };
  100989. };
  100990. TimestampRolloverStream$1.prototype = new stream();
  100991. var timestampRolloverStream = {
  100992. TimestampRolloverStream: TimestampRolloverStream$1,
  100993. handleRollover: handleRollover$1
  100994. };
  100995. var percentEncode$1 = function percentEncode2(bytes, start2, end) {
  100996. var i2, result = "";
  100997. for (i2 = start2; i2 < end; i2++) {
  100998. result += "%" + ("00" + bytes[i2].toString(16)).slice(-2);
  100999. }
  101000. return result;
  101001. }, parseUtf8 = function parseUtf82(bytes, start2, end) {
  101002. return decodeURIComponent(percentEncode$1(bytes, start2, end));
  101003. }, parseIso88591$1 = function parseIso885912(bytes, start2, end) {
  101004. return unescape(percentEncode$1(bytes, start2, end));
  101005. }, parseSyncSafeInteger$1 = function parseSyncSafeInteger2(data) {
  101006. return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];
  101007. }, tagParsers = {
  101008. TXXX: function TXXX(tag) {
  101009. var i2;
  101010. if (tag.data[0] !== 3) {
  101011. return;
  101012. }
  101013. for (i2 = 1; i2 < tag.data.length; i2++) {
  101014. if (tag.data[i2] === 0) {
  101015. tag.description = parseUtf8(tag.data, 1, i2);
  101016. tag.value = parseUtf8(tag.data, i2 + 1, tag.data.length).replace(/\0*$/, "");
  101017. break;
  101018. }
  101019. }
  101020. tag.data = tag.value;
  101021. },
  101022. WXXX: function WXXX(tag) {
  101023. var i2;
  101024. if (tag.data[0] !== 3) {
  101025. return;
  101026. }
  101027. for (i2 = 1; i2 < tag.data.length; i2++) {
  101028. if (tag.data[i2] === 0) {
  101029. tag.description = parseUtf8(tag.data, 1, i2);
  101030. tag.url = parseUtf8(tag.data, i2 + 1, tag.data.length);
  101031. break;
  101032. }
  101033. }
  101034. },
  101035. PRIV: function PRIV(tag) {
  101036. var i2;
  101037. for (i2 = 0; i2 < tag.data.length; i2++) {
  101038. if (tag.data[i2] === 0) {
  101039. tag.owner = parseIso88591$1(tag.data, 0, i2);
  101040. break;
  101041. }
  101042. }
  101043. tag.privateData = tag.data.subarray(i2 + 1);
  101044. tag.data = tag.privateData;
  101045. }
  101046. }, _MetadataStream;
  101047. _MetadataStream = function MetadataStream(options2) {
  101048. var settings = {
  101049. descriptor: options2 && options2.descriptor
  101050. }, tagSize = 0, buffer = [], bufferSize = 0, i2;
  101051. _MetadataStream.prototype.init.call(this);
  101052. this.dispatchType = streamTypes.METADATA_STREAM_TYPE.toString(16);
  101053. if (settings.descriptor) {
  101054. for (i2 = 0; i2 < settings.descriptor.length; i2++) {
  101055. this.dispatchType += ("00" + settings.descriptor[i2].toString(16)).slice(-2);
  101056. }
  101057. }
  101058. this.push = function(chunk) {
  101059. var tag, frameStart, frameSize, frame, i3, frameHeader;
  101060. if (chunk.type !== "timed-metadata") {
  101061. return;
  101062. }
  101063. if (chunk.dataAlignmentIndicator) {
  101064. bufferSize = 0;
  101065. buffer.length = 0;
  101066. }
  101067. if (buffer.length === 0 && (chunk.data.length < 10 || chunk.data[0] !== "I".charCodeAt(0) || chunk.data[1] !== "D".charCodeAt(0) || chunk.data[2] !== "3".charCodeAt(0))) {
  101068. this.trigger("log", {
  101069. level: "warn",
  101070. message: "Skipping unrecognized metadata packet"
  101071. });
  101072. return;
  101073. }
  101074. buffer.push(chunk);
  101075. bufferSize += chunk.data.byteLength;
  101076. if (buffer.length === 1) {
  101077. tagSize = parseSyncSafeInteger$1(chunk.data.subarray(6, 10));
  101078. tagSize += 10;
  101079. }
  101080. if (bufferSize < tagSize) {
  101081. return;
  101082. }
  101083. tag = {
  101084. data: new Uint8Array(tagSize),
  101085. frames: [],
  101086. pts: buffer[0].pts,
  101087. dts: buffer[0].dts
  101088. };
  101089. for (i3 = 0; i3 < tagSize; ) {
  101090. tag.data.set(buffer[0].data.subarray(0, tagSize - i3), i3);
  101091. i3 += buffer[0].data.byteLength;
  101092. bufferSize -= buffer[0].data.byteLength;
  101093. buffer.shift();
  101094. }
  101095. frameStart = 10;
  101096. if (tag.data[5] & 64) {
  101097. frameStart += 4;
  101098. frameStart += parseSyncSafeInteger$1(tag.data.subarray(10, 14));
  101099. tagSize -= parseSyncSafeInteger$1(tag.data.subarray(16, 20));
  101100. }
  101101. do {
  101102. frameSize = parseSyncSafeInteger$1(tag.data.subarray(frameStart + 4, frameStart + 8));
  101103. if (frameSize < 1) {
  101104. this.trigger("log", {
  101105. level: "warn",
  101106. message: "Malformed ID3 frame encountered. Skipping metadata parsing."
  101107. });
  101108. return;
  101109. }
  101110. frameHeader = String.fromCharCode(tag.data[frameStart], tag.data[frameStart + 1], tag.data[frameStart + 2], tag.data[frameStart + 3]);
  101111. frame = {
  101112. id: frameHeader,
  101113. data: tag.data.subarray(frameStart + 10, frameStart + frameSize + 10)
  101114. };
  101115. frame.key = frame.id;
  101116. if (tagParsers[frame.id]) {
  101117. tagParsers[frame.id](frame);
  101118. if (frame.owner === "com.apple.streaming.transportStreamTimestamp") {
  101119. var d2 = frame.data, size = (d2[3] & 1) << 30 | d2[4] << 22 | d2[5] << 14 | d2[6] << 6 | d2[7] >>> 2;
  101120. size *= 4;
  101121. size += d2[7] & 3;
  101122. frame.timeStamp = size;
  101123. if (tag.pts === void 0 && tag.dts === void 0) {
  101124. tag.pts = frame.timeStamp;
  101125. tag.dts = frame.timeStamp;
  101126. }
  101127. this.trigger("timestamp", frame);
  101128. }
  101129. }
  101130. tag.frames.push(frame);
  101131. frameStart += 10;
  101132. frameStart += frameSize;
  101133. } while (frameStart < tagSize);
  101134. this.trigger("data", tag);
  101135. };
  101136. };
  101137. _MetadataStream.prototype = new stream();
  101138. var metadataStream = _MetadataStream;
  101139. var TimestampRolloverStream = timestampRolloverStream.TimestampRolloverStream;
  101140. var _TransportPacketStream, _TransportParseStream, _ElementaryStream;
  101141. var MP2T_PACKET_LENGTH$1 = 188, SYNC_BYTE$1 = 71;
  101142. _TransportPacketStream = function TransportPacketStream() {
  101143. var buffer = new Uint8Array(MP2T_PACKET_LENGTH$1), bytesInBuffer = 0;
  101144. _TransportPacketStream.prototype.init.call(this);
  101145. this.push = function(bytes) {
  101146. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH$1, everything;
  101147. if (bytesInBuffer) {
  101148. everything = new Uint8Array(bytes.byteLength + bytesInBuffer);
  101149. everything.set(buffer.subarray(0, bytesInBuffer));
  101150. everything.set(bytes, bytesInBuffer);
  101151. bytesInBuffer = 0;
  101152. } else {
  101153. everything = bytes;
  101154. }
  101155. while (endIndex < everything.byteLength) {
  101156. if (everything[startIndex] === SYNC_BYTE$1 && everything[endIndex] === SYNC_BYTE$1) {
  101157. this.trigger("data", everything.subarray(startIndex, endIndex));
  101158. startIndex += MP2T_PACKET_LENGTH$1;
  101159. endIndex += MP2T_PACKET_LENGTH$1;
  101160. continue;
  101161. }
  101162. startIndex++;
  101163. endIndex++;
  101164. }
  101165. if (startIndex < everything.byteLength) {
  101166. buffer.set(everything.subarray(startIndex), 0);
  101167. bytesInBuffer = everything.byteLength - startIndex;
  101168. }
  101169. };
  101170. this.flush = function() {
  101171. if (bytesInBuffer === MP2T_PACKET_LENGTH$1 && buffer[0] === SYNC_BYTE$1) {
  101172. this.trigger("data", buffer);
  101173. bytesInBuffer = 0;
  101174. }
  101175. this.trigger("done");
  101176. };
  101177. this.endTimeline = function() {
  101178. this.flush();
  101179. this.trigger("endedtimeline");
  101180. };
  101181. this.reset = function() {
  101182. bytesInBuffer = 0;
  101183. this.trigger("reset");
  101184. };
  101185. };
  101186. _TransportPacketStream.prototype = new stream();
  101187. _TransportParseStream = function TransportParseStream() {
  101188. var parsePsi, parsePat2, parsePmt2, self2;
  101189. _TransportParseStream.prototype.init.call(this);
  101190. self2 = this;
  101191. this.packetsWaitingForPmt = [];
  101192. this.programMapTable = void 0;
  101193. parsePsi = function parsePsi2(payload, psi) {
  101194. var offset = 0;
  101195. if (psi.payloadUnitStartIndicator) {
  101196. offset += payload[offset] + 1;
  101197. }
  101198. if (psi.type === "pat") {
  101199. parsePat2(payload.subarray(offset), psi);
  101200. } else {
  101201. parsePmt2(payload.subarray(offset), psi);
  101202. }
  101203. };
  101204. parsePat2 = function parsePat3(payload, pat) {
  101205. pat.section_number = payload[7];
  101206. pat.last_section_number = payload[8];
  101207. self2.pmtPid = (payload[10] & 31) << 8 | payload[11];
  101208. pat.pmtPid = self2.pmtPid;
  101209. };
  101210. parsePmt2 = function parsePmt3(payload, pmt) {
  101211. var sectionLength, tableEnd, programInfoLength, offset;
  101212. if (!(payload[5] & 1)) {
  101213. return;
  101214. }
  101215. self2.programMapTable = {
  101216. video: null,
  101217. audio: null,
  101218. "timed-metadata": {}
  101219. };
  101220. sectionLength = (payload[1] & 15) << 8 | payload[2];
  101221. tableEnd = 3 + sectionLength - 4;
  101222. programInfoLength = (payload[10] & 15) << 8 | payload[11];
  101223. offset = 12 + programInfoLength;
  101224. while (offset < tableEnd) {
  101225. var streamType = payload[offset];
  101226. var pid = (payload[offset + 1] & 31) << 8 | payload[offset + 2];
  101227. if (streamType === streamTypes.H264_STREAM_TYPE && self2.programMapTable.video === null) {
  101228. self2.programMapTable.video = pid;
  101229. } else if (streamType === streamTypes.ADTS_STREAM_TYPE && self2.programMapTable.audio === null) {
  101230. self2.programMapTable.audio = pid;
  101231. } else if (streamType === streamTypes.METADATA_STREAM_TYPE) {
  101232. self2.programMapTable["timed-metadata"][pid] = streamType;
  101233. }
  101234. offset += ((payload[offset + 3] & 15) << 8 | payload[offset + 4]) + 5;
  101235. }
  101236. pmt.programMapTable = self2.programMapTable;
  101237. };
  101238. this.push = function(packet) {
  101239. var result = {}, offset = 4;
  101240. result.payloadUnitStartIndicator = !!(packet[1] & 64);
  101241. result.pid = packet[1] & 31;
  101242. result.pid <<= 8;
  101243. result.pid |= packet[2];
  101244. if ((packet[3] & 48) >>> 4 > 1) {
  101245. offset += packet[offset] + 1;
  101246. }
  101247. if (result.pid === 0) {
  101248. result.type = "pat";
  101249. parsePsi(packet.subarray(offset), result);
  101250. this.trigger("data", result);
  101251. } else if (result.pid === this.pmtPid) {
  101252. result.type = "pmt";
  101253. parsePsi(packet.subarray(offset), result);
  101254. this.trigger("data", result);
  101255. while (this.packetsWaitingForPmt.length) {
  101256. this.processPes_.apply(this, this.packetsWaitingForPmt.shift());
  101257. }
  101258. } else if (this.programMapTable === void 0) {
  101259. this.packetsWaitingForPmt.push([packet, offset, result]);
  101260. } else {
  101261. this.processPes_(packet, offset, result);
  101262. }
  101263. };
  101264. this.processPes_ = function(packet, offset, result) {
  101265. if (result.pid === this.programMapTable.video) {
  101266. result.streamType = streamTypes.H264_STREAM_TYPE;
  101267. } else if (result.pid === this.programMapTable.audio) {
  101268. result.streamType = streamTypes.ADTS_STREAM_TYPE;
  101269. } else {
  101270. result.streamType = this.programMapTable["timed-metadata"][result.pid];
  101271. }
  101272. result.type = "pes";
  101273. result.data = packet.subarray(offset);
  101274. this.trigger("data", result);
  101275. };
  101276. };
  101277. _TransportParseStream.prototype = new stream();
  101278. _TransportParseStream.STREAM_TYPES = {
  101279. h264: 27,
  101280. adts: 15
  101281. };
  101282. _ElementaryStream = function ElementaryStream() {
  101283. var self2 = this, segmentHadPmt = false, video = {
  101284. data: [],
  101285. size: 0
  101286. }, audio = {
  101287. data: [],
  101288. size: 0
  101289. }, timedMetadata = {
  101290. data: [],
  101291. size: 0
  101292. }, programMapTable, parsePes = function parsePes2(payload, pes) {
  101293. var ptsDtsFlags;
  101294. var startPrefix = payload[0] << 16 | payload[1] << 8 | payload[2];
  101295. pes.data = new Uint8Array();
  101296. if (startPrefix !== 1) {
  101297. return;
  101298. }
  101299. pes.packetLength = 6 + (payload[4] << 8 | payload[5]);
  101300. pes.dataAlignmentIndicator = (payload[6] & 4) !== 0;
  101301. ptsDtsFlags = payload[7];
  101302. if (ptsDtsFlags & 192) {
  101303. pes.pts = (payload[9] & 14) << 27 | (payload[10] & 255) << 20 | (payload[11] & 254) << 12 | (payload[12] & 255) << 5 | (payload[13] & 254) >>> 3;
  101304. pes.pts *= 4;
  101305. pes.pts += (payload[13] & 6) >>> 1;
  101306. pes.dts = pes.pts;
  101307. if (ptsDtsFlags & 64) {
  101308. pes.dts = (payload[14] & 14) << 27 | (payload[15] & 255) << 20 | (payload[16] & 254) << 12 | (payload[17] & 255) << 5 | (payload[18] & 254) >>> 3;
  101309. pes.dts *= 4;
  101310. pes.dts += (payload[18] & 6) >>> 1;
  101311. }
  101312. }
  101313. pes.data = payload.subarray(9 + payload[8]);
  101314. }, flushStream = function flushStream2(stream2, type3, forceFlush) {
  101315. var packetData = new Uint8Array(stream2.size), event2 = {
  101316. type: type3
  101317. }, i2 = 0, offset = 0, packetFlushable = false, fragment;
  101318. if (!stream2.data.length || stream2.size < 9) {
  101319. return;
  101320. }
  101321. event2.trackId = stream2.data[0].pid;
  101322. for (i2 = 0; i2 < stream2.data.length; i2++) {
  101323. fragment = stream2.data[i2];
  101324. packetData.set(fragment.data, offset);
  101325. offset += fragment.data.byteLength;
  101326. }
  101327. parsePes(packetData, event2);
  101328. packetFlushable = type3 === "video" || event2.packetLength <= stream2.size;
  101329. if (forceFlush || packetFlushable) {
  101330. stream2.size = 0;
  101331. stream2.data.length = 0;
  101332. }
  101333. if (packetFlushable) {
  101334. self2.trigger("data", event2);
  101335. }
  101336. };
  101337. _ElementaryStream.prototype.init.call(this);
  101338. this.push = function(data) {
  101339. ({
  101340. pat: function pat() {
  101341. },
  101342. pes: function pes() {
  101343. var stream2, streamType;
  101344. switch (data.streamType) {
  101345. case streamTypes.H264_STREAM_TYPE:
  101346. stream2 = video;
  101347. streamType = "video";
  101348. break;
  101349. case streamTypes.ADTS_STREAM_TYPE:
  101350. stream2 = audio;
  101351. streamType = "audio";
  101352. break;
  101353. case streamTypes.METADATA_STREAM_TYPE:
  101354. stream2 = timedMetadata;
  101355. streamType = "timed-metadata";
  101356. break;
  101357. default:
  101358. return;
  101359. }
  101360. if (data.payloadUnitStartIndicator) {
  101361. flushStream(stream2, streamType, true);
  101362. }
  101363. stream2.data.push(data);
  101364. stream2.size += data.data.byteLength;
  101365. },
  101366. pmt: function pmt() {
  101367. var event2 = {
  101368. type: "metadata",
  101369. tracks: []
  101370. };
  101371. programMapTable = data.programMapTable;
  101372. if (programMapTable.video !== null) {
  101373. event2.tracks.push({
  101374. timelineStartInfo: {
  101375. baseMediaDecodeTime: 0
  101376. },
  101377. id: +programMapTable.video,
  101378. codec: "avc",
  101379. type: "video"
  101380. });
  101381. }
  101382. if (programMapTable.audio !== null) {
  101383. event2.tracks.push({
  101384. timelineStartInfo: {
  101385. baseMediaDecodeTime: 0
  101386. },
  101387. id: +programMapTable.audio,
  101388. codec: "adts",
  101389. type: "audio"
  101390. });
  101391. }
  101392. segmentHadPmt = true;
  101393. self2.trigger("data", event2);
  101394. }
  101395. })[data.type]();
  101396. };
  101397. this.reset = function() {
  101398. video.size = 0;
  101399. video.data.length = 0;
  101400. audio.size = 0;
  101401. audio.data.length = 0;
  101402. this.trigger("reset");
  101403. };
  101404. this.flushStreams_ = function() {
  101405. flushStream(video, "video");
  101406. flushStream(audio, "audio");
  101407. flushStream(timedMetadata, "timed-metadata");
  101408. };
  101409. this.flush = function() {
  101410. if (!segmentHadPmt && programMapTable) {
  101411. var pmt = {
  101412. type: "metadata",
  101413. tracks: []
  101414. };
  101415. if (programMapTable.video !== null) {
  101416. pmt.tracks.push({
  101417. timelineStartInfo: {
  101418. baseMediaDecodeTime: 0
  101419. },
  101420. id: +programMapTable.video,
  101421. codec: "avc",
  101422. type: "video"
  101423. });
  101424. }
  101425. if (programMapTable.audio !== null) {
  101426. pmt.tracks.push({
  101427. timelineStartInfo: {
  101428. baseMediaDecodeTime: 0
  101429. },
  101430. id: +programMapTable.audio,
  101431. codec: "adts",
  101432. type: "audio"
  101433. });
  101434. }
  101435. self2.trigger("data", pmt);
  101436. }
  101437. segmentHadPmt = false;
  101438. this.flushStreams_();
  101439. this.trigger("done");
  101440. };
  101441. };
  101442. _ElementaryStream.prototype = new stream();
  101443. var m2ts = {
  101444. PAT_PID: 0,
  101445. MP2T_PACKET_LENGTH: MP2T_PACKET_LENGTH$1,
  101446. TransportPacketStream: _TransportPacketStream,
  101447. TransportParseStream: _TransportParseStream,
  101448. ElementaryStream: _ElementaryStream,
  101449. TimestampRolloverStream,
  101450. CaptionStream: captionStream.CaptionStream,
  101451. Cea608Stream: captionStream.Cea608Stream,
  101452. Cea708Stream: captionStream.Cea708Stream,
  101453. MetadataStream: metadataStream
  101454. };
  101455. for (var type2 in streamTypes) {
  101456. if (streamTypes.hasOwnProperty(type2)) {
  101457. m2ts[type2] = streamTypes[type2];
  101458. }
  101459. }
  101460. var m2ts_1 = m2ts;
  101461. var ONE_SECOND_IN_TS$2 = clock2.ONE_SECOND_IN_TS;
  101462. var _AdtsStream;
  101463. var ADTS_SAMPLING_FREQUENCIES$1 = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350];
  101464. _AdtsStream = function AdtsStream(handlePartialSegments) {
  101465. var buffer, frameNum = 0;
  101466. _AdtsStream.prototype.init.call(this);
  101467. this.skipWarn_ = function(start2, end) {
  101468. this.trigger("log", {
  101469. level: "warn",
  101470. message: "adts skiping bytes " + start2 + " to " + end + " in frame " + frameNum + " outside syncword"
  101471. });
  101472. };
  101473. this.push = function(packet) {
  101474. var i2 = 0, frameLength, protectionSkipBytes, oldBuffer, sampleCount, adtsFrameDuration;
  101475. if (!handlePartialSegments) {
  101476. frameNum = 0;
  101477. }
  101478. if (packet.type !== "audio") {
  101479. return;
  101480. }
  101481. if (buffer && buffer.length) {
  101482. oldBuffer = buffer;
  101483. buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength);
  101484. buffer.set(oldBuffer);
  101485. buffer.set(packet.data, oldBuffer.byteLength);
  101486. } else {
  101487. buffer = packet.data;
  101488. }
  101489. var skip;
  101490. while (i2 + 7 < buffer.length) {
  101491. if (buffer[i2] !== 255 || (buffer[i2 + 1] & 246) !== 240) {
  101492. if (typeof skip !== "number") {
  101493. skip = i2;
  101494. }
  101495. i2++;
  101496. continue;
  101497. }
  101498. if (typeof skip === "number") {
  101499. this.skipWarn_(skip, i2);
  101500. skip = null;
  101501. }
  101502. protectionSkipBytes = (~buffer[i2 + 1] & 1) * 2;
  101503. frameLength = (buffer[i2 + 3] & 3) << 11 | buffer[i2 + 4] << 3 | (buffer[i2 + 5] & 224) >> 5;
  101504. sampleCount = ((buffer[i2 + 6] & 3) + 1) * 1024;
  101505. adtsFrameDuration = sampleCount * ONE_SECOND_IN_TS$2 / ADTS_SAMPLING_FREQUENCIES$1[(buffer[i2 + 2] & 60) >>> 2];
  101506. if (buffer.byteLength - i2 < frameLength) {
  101507. break;
  101508. }
  101509. this.trigger("data", {
  101510. pts: packet.pts + frameNum * adtsFrameDuration,
  101511. dts: packet.dts + frameNum * adtsFrameDuration,
  101512. sampleCount,
  101513. audioobjecttype: (buffer[i2 + 2] >>> 6 & 3) + 1,
  101514. channelcount: (buffer[i2 + 2] & 1) << 2 | (buffer[i2 + 3] & 192) >>> 6,
  101515. samplerate: ADTS_SAMPLING_FREQUENCIES$1[(buffer[i2 + 2] & 60) >>> 2],
  101516. samplingfrequencyindex: (buffer[i2 + 2] & 60) >>> 2,
  101517. samplesize: 16,
  101518. data: buffer.subarray(i2 + 7 + protectionSkipBytes, i2 + frameLength)
  101519. });
  101520. frameNum++;
  101521. i2 += frameLength;
  101522. }
  101523. if (typeof skip === "number") {
  101524. this.skipWarn_(skip, i2);
  101525. skip = null;
  101526. }
  101527. buffer = buffer.subarray(i2);
  101528. };
  101529. this.flush = function() {
  101530. frameNum = 0;
  101531. this.trigger("done");
  101532. };
  101533. this.reset = function() {
  101534. buffer = void 0;
  101535. this.trigger("reset");
  101536. };
  101537. this.endTimeline = function() {
  101538. buffer = void 0;
  101539. this.trigger("endedtimeline");
  101540. };
  101541. };
  101542. _AdtsStream.prototype = new stream();
  101543. var adts = _AdtsStream;
  101544. var ExpGolomb;
  101545. ExpGolomb = function ExpGolomb2(workingData) {
  101546. var workingBytesAvailable = workingData.byteLength, workingWord = 0, workingBitsAvailable = 0;
  101547. this.length = function() {
  101548. return 8 * workingBytesAvailable;
  101549. };
  101550. this.bitsAvailable = function() {
  101551. return 8 * workingBytesAvailable + workingBitsAvailable;
  101552. };
  101553. this.loadWord = function() {
  101554. var position2 = workingData.byteLength - workingBytesAvailable, workingBytes = new Uint8Array(4), availableBytes = Math.min(4, workingBytesAvailable);
  101555. if (availableBytes === 0) {
  101556. throw new Error("no bytes available");
  101557. }
  101558. workingBytes.set(workingData.subarray(position2, position2 + availableBytes));
  101559. workingWord = new DataView(workingBytes.buffer).getUint32(0);
  101560. workingBitsAvailable = availableBytes * 8;
  101561. workingBytesAvailable -= availableBytes;
  101562. };
  101563. this.skipBits = function(count) {
  101564. var skipBytes;
  101565. if (workingBitsAvailable > count) {
  101566. workingWord <<= count;
  101567. workingBitsAvailable -= count;
  101568. } else {
  101569. count -= workingBitsAvailable;
  101570. skipBytes = Math.floor(count / 8);
  101571. count -= skipBytes * 8;
  101572. workingBytesAvailable -= skipBytes;
  101573. this.loadWord();
  101574. workingWord <<= count;
  101575. workingBitsAvailable -= count;
  101576. }
  101577. };
  101578. this.readBits = function(size) {
  101579. var bits = Math.min(workingBitsAvailable, size), valu = workingWord >>> 32 - bits;
  101580. workingBitsAvailable -= bits;
  101581. if (workingBitsAvailable > 0) {
  101582. workingWord <<= bits;
  101583. } else if (workingBytesAvailable > 0) {
  101584. this.loadWord();
  101585. }
  101586. bits = size - bits;
  101587. if (bits > 0) {
  101588. return valu << bits | this.readBits(bits);
  101589. }
  101590. return valu;
  101591. };
  101592. this.skipLeadingZeros = function() {
  101593. var leadingZeroCount;
  101594. for (leadingZeroCount = 0; leadingZeroCount < workingBitsAvailable; ++leadingZeroCount) {
  101595. if ((workingWord & 2147483648 >>> leadingZeroCount) !== 0) {
  101596. workingWord <<= leadingZeroCount;
  101597. workingBitsAvailable -= leadingZeroCount;
  101598. return leadingZeroCount;
  101599. }
  101600. }
  101601. this.loadWord();
  101602. return leadingZeroCount + this.skipLeadingZeros();
  101603. };
  101604. this.skipUnsignedExpGolomb = function() {
  101605. this.skipBits(1 + this.skipLeadingZeros());
  101606. };
  101607. this.skipExpGolomb = function() {
  101608. this.skipBits(1 + this.skipLeadingZeros());
  101609. };
  101610. this.readUnsignedExpGolomb = function() {
  101611. var clz = this.skipLeadingZeros();
  101612. return this.readBits(clz + 1) - 1;
  101613. };
  101614. this.readExpGolomb = function() {
  101615. var valu = this.readUnsignedExpGolomb();
  101616. if (1 & valu) {
  101617. return 1 + valu >>> 1;
  101618. }
  101619. return -1 * (valu >>> 1);
  101620. };
  101621. this.readBoolean = function() {
  101622. return this.readBits(1) === 1;
  101623. };
  101624. this.readUnsignedByte = function() {
  101625. return this.readBits(8);
  101626. };
  101627. this.loadWord();
  101628. };
  101629. var expGolomb = ExpGolomb;
  101630. var _H264Stream, _NalByteStream;
  101631. var PROFILES_WITH_OPTIONAL_SPS_DATA;
  101632. _NalByteStream = function NalByteStream() {
  101633. var syncPoint = 0, i2, buffer;
  101634. _NalByteStream.prototype.init.call(this);
  101635. this.push = function(data) {
  101636. var swapBuffer;
  101637. if (!buffer) {
  101638. buffer = data.data;
  101639. } else {
  101640. swapBuffer = new Uint8Array(buffer.byteLength + data.data.byteLength);
  101641. swapBuffer.set(buffer);
  101642. swapBuffer.set(data.data, buffer.byteLength);
  101643. buffer = swapBuffer;
  101644. }
  101645. var len = buffer.byteLength;
  101646. for (; syncPoint < len - 3; syncPoint++) {
  101647. if (buffer[syncPoint + 2] === 1) {
  101648. i2 = syncPoint + 5;
  101649. break;
  101650. }
  101651. }
  101652. while (i2 < len) {
  101653. switch (buffer[i2]) {
  101654. case 0:
  101655. if (buffer[i2 - 1] !== 0) {
  101656. i2 += 2;
  101657. break;
  101658. } else if (buffer[i2 - 2] !== 0) {
  101659. i2++;
  101660. break;
  101661. }
  101662. if (syncPoint + 3 !== i2 - 2) {
  101663. this.trigger("data", buffer.subarray(syncPoint + 3, i2 - 2));
  101664. }
  101665. do {
  101666. i2++;
  101667. } while (buffer[i2] !== 1 && i2 < len);
  101668. syncPoint = i2 - 2;
  101669. i2 += 3;
  101670. break;
  101671. case 1:
  101672. if (buffer[i2 - 1] !== 0 || buffer[i2 - 2] !== 0) {
  101673. i2 += 3;
  101674. break;
  101675. }
  101676. this.trigger("data", buffer.subarray(syncPoint + 3, i2 - 2));
  101677. syncPoint = i2 - 2;
  101678. i2 += 3;
  101679. break;
  101680. default:
  101681. i2 += 3;
  101682. break;
  101683. }
  101684. }
  101685. buffer = buffer.subarray(syncPoint);
  101686. i2 -= syncPoint;
  101687. syncPoint = 0;
  101688. };
  101689. this.reset = function() {
  101690. buffer = null;
  101691. syncPoint = 0;
  101692. this.trigger("reset");
  101693. };
  101694. this.flush = function() {
  101695. if (buffer && buffer.byteLength > 3) {
  101696. this.trigger("data", buffer.subarray(syncPoint + 3));
  101697. }
  101698. buffer = null;
  101699. syncPoint = 0;
  101700. this.trigger("done");
  101701. };
  101702. this.endTimeline = function() {
  101703. this.flush();
  101704. this.trigger("endedtimeline");
  101705. };
  101706. };
  101707. _NalByteStream.prototype = new stream();
  101708. PROFILES_WITH_OPTIONAL_SPS_DATA = {
  101709. 100: true,
  101710. 110: true,
  101711. 122: true,
  101712. 244: true,
  101713. 44: true,
  101714. 83: true,
  101715. 86: true,
  101716. 118: true,
  101717. 128: true,
  101718. 138: true,
  101719. 139: true,
  101720. 134: true
  101721. };
  101722. _H264Stream = function H264Stream2() {
  101723. var nalByteStream = new _NalByteStream(), self2, trackId, currentPts, currentDts, discardEmulationPreventionBytes5, readSequenceParameterSet, skipScalingList;
  101724. _H264Stream.prototype.init.call(this);
  101725. self2 = this;
  101726. this.push = function(packet) {
  101727. if (packet.type !== "video") {
  101728. return;
  101729. }
  101730. trackId = packet.trackId;
  101731. currentPts = packet.pts;
  101732. currentDts = packet.dts;
  101733. nalByteStream.push(packet);
  101734. };
  101735. nalByteStream.on("data", function(data) {
  101736. var event2 = {
  101737. trackId,
  101738. pts: currentPts,
  101739. dts: currentDts,
  101740. data,
  101741. nalUnitTypeCode: data[0] & 31
  101742. };
  101743. switch (event2.nalUnitTypeCode) {
  101744. case 5:
  101745. event2.nalUnitType = "slice_layer_without_partitioning_rbsp_idr";
  101746. break;
  101747. case 6:
  101748. event2.nalUnitType = "sei_rbsp";
  101749. event2.escapedRBSP = discardEmulationPreventionBytes5(data.subarray(1));
  101750. break;
  101751. case 7:
  101752. event2.nalUnitType = "seq_parameter_set_rbsp";
  101753. event2.escapedRBSP = discardEmulationPreventionBytes5(data.subarray(1));
  101754. event2.config = readSequenceParameterSet(event2.escapedRBSP);
  101755. break;
  101756. case 8:
  101757. event2.nalUnitType = "pic_parameter_set_rbsp";
  101758. break;
  101759. case 9:
  101760. event2.nalUnitType = "access_unit_delimiter_rbsp";
  101761. break;
  101762. }
  101763. self2.trigger("data", event2);
  101764. });
  101765. nalByteStream.on("done", function() {
  101766. self2.trigger("done");
  101767. });
  101768. nalByteStream.on("partialdone", function() {
  101769. self2.trigger("partialdone");
  101770. });
  101771. nalByteStream.on("reset", function() {
  101772. self2.trigger("reset");
  101773. });
  101774. nalByteStream.on("endedtimeline", function() {
  101775. self2.trigger("endedtimeline");
  101776. });
  101777. this.flush = function() {
  101778. nalByteStream.flush();
  101779. };
  101780. this.partialFlush = function() {
  101781. nalByteStream.partialFlush();
  101782. };
  101783. this.reset = function() {
  101784. nalByteStream.reset();
  101785. };
  101786. this.endTimeline = function() {
  101787. nalByteStream.endTimeline();
  101788. };
  101789. skipScalingList = function skipScalingList2(count, expGolombDecoder) {
  101790. var lastScale = 8, nextScale = 8, j, deltaScale;
  101791. for (j = 0; j < count; j++) {
  101792. if (nextScale !== 0) {
  101793. deltaScale = expGolombDecoder.readExpGolomb();
  101794. nextScale = (lastScale + deltaScale + 256) % 256;
  101795. }
  101796. lastScale = nextScale === 0 ? lastScale : nextScale;
  101797. }
  101798. };
  101799. discardEmulationPreventionBytes5 = function discardEmulationPreventionBytes6(data) {
  101800. var length = data.byteLength, emulationPreventionBytesPositions = [], i2 = 1, newLength, newData;
  101801. while (i2 < length - 2) {
  101802. if (data[i2] === 0 && data[i2 + 1] === 0 && data[i2 + 2] === 3) {
  101803. emulationPreventionBytesPositions.push(i2 + 2);
  101804. i2 += 2;
  101805. } else {
  101806. i2++;
  101807. }
  101808. }
  101809. if (emulationPreventionBytesPositions.length === 0) {
  101810. return data;
  101811. }
  101812. newLength = length - emulationPreventionBytesPositions.length;
  101813. newData = new Uint8Array(newLength);
  101814. var sourceIndex = 0;
  101815. for (i2 = 0; i2 < newLength; sourceIndex++, i2++) {
  101816. if (sourceIndex === emulationPreventionBytesPositions[0]) {
  101817. sourceIndex++;
  101818. emulationPreventionBytesPositions.shift();
  101819. }
  101820. newData[i2] = data[sourceIndex];
  101821. }
  101822. return newData;
  101823. };
  101824. readSequenceParameterSet = function readSequenceParameterSet2(data) {
  101825. var frameCropLeftOffset = 0, frameCropRightOffset = 0, frameCropTopOffset = 0, frameCropBottomOffset = 0, expGolombDecoder, profileIdc, levelIdc, profileCompatibility, chromaFormatIdc, picOrderCntType, numRefFramesInPicOrderCntCycle, picWidthInMbsMinus1, picHeightInMapUnitsMinus1, frameMbsOnlyFlag, scalingListCount, sarRatio = [1, 1], aspectRatioIdc, i2;
  101826. expGolombDecoder = new expGolomb(data);
  101827. profileIdc = expGolombDecoder.readUnsignedByte();
  101828. profileCompatibility = expGolombDecoder.readUnsignedByte();
  101829. levelIdc = expGolombDecoder.readUnsignedByte();
  101830. expGolombDecoder.skipUnsignedExpGolomb();
  101831. if (PROFILES_WITH_OPTIONAL_SPS_DATA[profileIdc]) {
  101832. chromaFormatIdc = expGolombDecoder.readUnsignedExpGolomb();
  101833. if (chromaFormatIdc === 3) {
  101834. expGolombDecoder.skipBits(1);
  101835. }
  101836. expGolombDecoder.skipUnsignedExpGolomb();
  101837. expGolombDecoder.skipUnsignedExpGolomb();
  101838. expGolombDecoder.skipBits(1);
  101839. if (expGolombDecoder.readBoolean()) {
  101840. scalingListCount = chromaFormatIdc !== 3 ? 8 : 12;
  101841. for (i2 = 0; i2 < scalingListCount; i2++) {
  101842. if (expGolombDecoder.readBoolean()) {
  101843. if (i2 < 6) {
  101844. skipScalingList(16, expGolombDecoder);
  101845. } else {
  101846. skipScalingList(64, expGolombDecoder);
  101847. }
  101848. }
  101849. }
  101850. }
  101851. }
  101852. expGolombDecoder.skipUnsignedExpGolomb();
  101853. picOrderCntType = expGolombDecoder.readUnsignedExpGolomb();
  101854. if (picOrderCntType === 0) {
  101855. expGolombDecoder.readUnsignedExpGolomb();
  101856. } else if (picOrderCntType === 1) {
  101857. expGolombDecoder.skipBits(1);
  101858. expGolombDecoder.skipExpGolomb();
  101859. expGolombDecoder.skipExpGolomb();
  101860. numRefFramesInPicOrderCntCycle = expGolombDecoder.readUnsignedExpGolomb();
  101861. for (i2 = 0; i2 < numRefFramesInPicOrderCntCycle; i2++) {
  101862. expGolombDecoder.skipExpGolomb();
  101863. }
  101864. }
  101865. expGolombDecoder.skipUnsignedExpGolomb();
  101866. expGolombDecoder.skipBits(1);
  101867. picWidthInMbsMinus1 = expGolombDecoder.readUnsignedExpGolomb();
  101868. picHeightInMapUnitsMinus1 = expGolombDecoder.readUnsignedExpGolomb();
  101869. frameMbsOnlyFlag = expGolombDecoder.readBits(1);
  101870. if (frameMbsOnlyFlag === 0) {
  101871. expGolombDecoder.skipBits(1);
  101872. }
  101873. expGolombDecoder.skipBits(1);
  101874. if (expGolombDecoder.readBoolean()) {
  101875. frameCropLeftOffset = expGolombDecoder.readUnsignedExpGolomb();
  101876. frameCropRightOffset = expGolombDecoder.readUnsignedExpGolomb();
  101877. frameCropTopOffset = expGolombDecoder.readUnsignedExpGolomb();
  101878. frameCropBottomOffset = expGolombDecoder.readUnsignedExpGolomb();
  101879. }
  101880. if (expGolombDecoder.readBoolean()) {
  101881. if (expGolombDecoder.readBoolean()) {
  101882. aspectRatioIdc = expGolombDecoder.readUnsignedByte();
  101883. switch (aspectRatioIdc) {
  101884. case 1:
  101885. sarRatio = [1, 1];
  101886. break;
  101887. case 2:
  101888. sarRatio = [12, 11];
  101889. break;
  101890. case 3:
  101891. sarRatio = [10, 11];
  101892. break;
  101893. case 4:
  101894. sarRatio = [16, 11];
  101895. break;
  101896. case 5:
  101897. sarRatio = [40, 33];
  101898. break;
  101899. case 6:
  101900. sarRatio = [24, 11];
  101901. break;
  101902. case 7:
  101903. sarRatio = [20, 11];
  101904. break;
  101905. case 8:
  101906. sarRatio = [32, 11];
  101907. break;
  101908. case 9:
  101909. sarRatio = [80, 33];
  101910. break;
  101911. case 10:
  101912. sarRatio = [18, 11];
  101913. break;
  101914. case 11:
  101915. sarRatio = [15, 11];
  101916. break;
  101917. case 12:
  101918. sarRatio = [64, 33];
  101919. break;
  101920. case 13:
  101921. sarRatio = [160, 99];
  101922. break;
  101923. case 14:
  101924. sarRatio = [4, 3];
  101925. break;
  101926. case 15:
  101927. sarRatio = [3, 2];
  101928. break;
  101929. case 16:
  101930. sarRatio = [2, 1];
  101931. break;
  101932. case 255: {
  101933. sarRatio = [expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte(), expGolombDecoder.readUnsignedByte() << 8 | expGolombDecoder.readUnsignedByte()];
  101934. break;
  101935. }
  101936. }
  101937. if (sarRatio) {
  101938. sarRatio[0] / sarRatio[1];
  101939. }
  101940. }
  101941. }
  101942. return {
  101943. profileIdc,
  101944. levelIdc,
  101945. profileCompatibility,
  101946. width: (picWidthInMbsMinus1 + 1) * 16 - frameCropLeftOffset * 2 - frameCropRightOffset * 2,
  101947. height: (2 - frameMbsOnlyFlag) * (picHeightInMapUnitsMinus1 + 1) * 16 - frameCropTopOffset * 2 - frameCropBottomOffset * 2,
  101948. sarRatio
  101949. };
  101950. };
  101951. };
  101952. _H264Stream.prototype = new stream();
  101953. var h2643 = {
  101954. H264Stream: _H264Stream,
  101955. NalByteStream: _NalByteStream
  101956. };
  101957. var ADTS_SAMPLING_FREQUENCIES = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350];
  101958. var parseId3TagSize = function parseId3TagSize2(header, byteIndex) {
  101959. var returnSize = header[byteIndex + 6] << 21 | header[byteIndex + 7] << 14 | header[byteIndex + 8] << 7 | header[byteIndex + 9], flags = header[byteIndex + 5], footerPresent = (flags & 16) >> 4;
  101960. returnSize = returnSize >= 0 ? returnSize : 0;
  101961. if (footerPresent) {
  101962. return returnSize + 20;
  101963. }
  101964. return returnSize + 10;
  101965. };
  101966. var getId3Offset4 = function getId3Offset5(data, offset) {
  101967. if (data.length - offset < 10 || data[offset] !== "I".charCodeAt(0) || data[offset + 1] !== "D".charCodeAt(0) || data[offset + 2] !== "3".charCodeAt(0)) {
  101968. return offset;
  101969. }
  101970. offset += parseId3TagSize(data, offset);
  101971. return getId3Offset5(data, offset);
  101972. };
  101973. var isLikelyAacData$1 = function isLikelyAacData2(data) {
  101974. var offset = getId3Offset4(data, 0);
  101975. return data.length >= offset + 2 && (data[offset] & 255) === 255 && (data[offset + 1] & 240) === 240 && (data[offset + 1] & 22) === 16;
  101976. };
  101977. var parseSyncSafeInteger = function parseSyncSafeInteger2(data) {
  101978. return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3];
  101979. };
  101980. var percentEncode = function percentEncode2(bytes, start2, end) {
  101981. var i2, result = "";
  101982. for (i2 = start2; i2 < end; i2++) {
  101983. result += "%" + ("00" + bytes[i2].toString(16)).slice(-2);
  101984. }
  101985. return result;
  101986. };
  101987. var parseIso88591 = function parseIso885912(bytes, start2, end) {
  101988. return unescape(percentEncode(bytes, start2, end));
  101989. };
  101990. var parseAdtsSize = function parseAdtsSize2(header, byteIndex) {
  101991. var lowThree = (header[byteIndex + 5] & 224) >> 5, middle = header[byteIndex + 4] << 3, highTwo = header[byteIndex + 3] & 3 << 11;
  101992. return highTwo | middle | lowThree;
  101993. };
  101994. var parseType$2 = function parseType2(header, byteIndex) {
  101995. if (header[byteIndex] === "I".charCodeAt(0) && header[byteIndex + 1] === "D".charCodeAt(0) && header[byteIndex + 2] === "3".charCodeAt(0)) {
  101996. return "timed-metadata";
  101997. } else if (header[byteIndex] & true && (header[byteIndex + 1] & 240) === 240) {
  101998. return "audio";
  101999. }
  102000. return null;
  102001. };
  102002. var parseSampleRate = function parseSampleRate2(packet) {
  102003. var i2 = 0;
  102004. while (i2 + 5 < packet.length) {
  102005. if (packet[i2] !== 255 || (packet[i2 + 1] & 246) !== 240) {
  102006. i2++;
  102007. continue;
  102008. }
  102009. return ADTS_SAMPLING_FREQUENCIES[(packet[i2 + 2] & 60) >>> 2];
  102010. }
  102011. return null;
  102012. };
  102013. var parseAacTimestamp = function parseAacTimestamp2(packet) {
  102014. var frameStart, frameSize, frame, frameHeader;
  102015. frameStart = 10;
  102016. if (packet[5] & 64) {
  102017. frameStart += 4;
  102018. frameStart += parseSyncSafeInteger(packet.subarray(10, 14));
  102019. }
  102020. do {
  102021. frameSize = parseSyncSafeInteger(packet.subarray(frameStart + 4, frameStart + 8));
  102022. if (frameSize < 1) {
  102023. return null;
  102024. }
  102025. frameHeader = String.fromCharCode(packet[frameStart], packet[frameStart + 1], packet[frameStart + 2], packet[frameStart + 3]);
  102026. if (frameHeader === "PRIV") {
  102027. frame = packet.subarray(frameStart + 10, frameStart + frameSize + 10);
  102028. for (var i2 = 0; i2 < frame.byteLength; i2++) {
  102029. if (frame[i2] === 0) {
  102030. var owner = parseIso88591(frame, 0, i2);
  102031. if (owner === "com.apple.streaming.transportStreamTimestamp") {
  102032. var d2 = frame.subarray(i2 + 1);
  102033. var size = (d2[3] & 1) << 30 | d2[4] << 22 | d2[5] << 14 | d2[6] << 6 | d2[7] >>> 2;
  102034. size *= 4;
  102035. size += d2[7] & 3;
  102036. return size;
  102037. }
  102038. break;
  102039. }
  102040. }
  102041. }
  102042. frameStart += 10;
  102043. frameStart += frameSize;
  102044. } while (frameStart < packet.byteLength);
  102045. return null;
  102046. };
  102047. var utils2 = {
  102048. isLikelyAacData: isLikelyAacData$1,
  102049. parseId3TagSize,
  102050. parseAdtsSize,
  102051. parseType: parseType$2,
  102052. parseSampleRate,
  102053. parseAacTimestamp
  102054. };
  102055. var _AacStream;
  102056. _AacStream = function AacStream() {
  102057. var everything = new Uint8Array(), timeStamp = 0;
  102058. _AacStream.prototype.init.call(this);
  102059. this.setTimestamp = function(timestamp) {
  102060. timeStamp = timestamp;
  102061. };
  102062. this.push = function(bytes) {
  102063. var frameSize = 0, byteIndex = 0, bytesLeft, chunk, packet, tempLength;
  102064. if (everything.length) {
  102065. tempLength = everything.length;
  102066. everything = new Uint8Array(bytes.byteLength + tempLength);
  102067. everything.set(everything.subarray(0, tempLength));
  102068. everything.set(bytes, tempLength);
  102069. } else {
  102070. everything = bytes;
  102071. }
  102072. while (everything.length - byteIndex >= 3) {
  102073. if (everything[byteIndex] === "I".charCodeAt(0) && everything[byteIndex + 1] === "D".charCodeAt(0) && everything[byteIndex + 2] === "3".charCodeAt(0)) {
  102074. if (everything.length - byteIndex < 10) {
  102075. break;
  102076. }
  102077. frameSize = utils2.parseId3TagSize(everything, byteIndex);
  102078. if (byteIndex + frameSize > everything.length) {
  102079. break;
  102080. }
  102081. chunk = {
  102082. type: "timed-metadata",
  102083. data: everything.subarray(byteIndex, byteIndex + frameSize)
  102084. };
  102085. this.trigger("data", chunk);
  102086. byteIndex += frameSize;
  102087. continue;
  102088. } else if ((everything[byteIndex] & 255) === 255 && (everything[byteIndex + 1] & 240) === 240) {
  102089. if (everything.length - byteIndex < 7) {
  102090. break;
  102091. }
  102092. frameSize = utils2.parseAdtsSize(everything, byteIndex);
  102093. if (byteIndex + frameSize > everything.length) {
  102094. break;
  102095. }
  102096. packet = {
  102097. type: "audio",
  102098. data: everything.subarray(byteIndex, byteIndex + frameSize),
  102099. pts: timeStamp,
  102100. dts: timeStamp
  102101. };
  102102. this.trigger("data", packet);
  102103. byteIndex += frameSize;
  102104. continue;
  102105. }
  102106. byteIndex++;
  102107. }
  102108. bytesLeft = everything.length - byteIndex;
  102109. if (bytesLeft > 0) {
  102110. everything = everything.subarray(byteIndex);
  102111. } else {
  102112. everything = new Uint8Array();
  102113. }
  102114. };
  102115. this.reset = function() {
  102116. everything = new Uint8Array();
  102117. this.trigger("reset");
  102118. };
  102119. this.endTimeline = function() {
  102120. everything = new Uint8Array();
  102121. this.trigger("endedtimeline");
  102122. };
  102123. };
  102124. _AacStream.prototype = new stream();
  102125. var aac3 = _AacStream;
  102126. var AUDIO_PROPERTIES = ["audioobjecttype", "channelcount", "samplerate", "samplingfrequencyindex", "samplesize"];
  102127. var audioProperties = AUDIO_PROPERTIES;
  102128. var VIDEO_PROPERTIES = ["width", "height", "profileIdc", "levelIdc", "profileCompatibility", "sarRatio"];
  102129. var videoProperties = VIDEO_PROPERTIES;
  102130. var H264Stream = h2643.H264Stream;
  102131. var isLikelyAacData = utils2.isLikelyAacData;
  102132. var ONE_SECOND_IN_TS$12 = clock2.ONE_SECOND_IN_TS;
  102133. var _VideoSegmentStream, _AudioSegmentStream, _Transmuxer, _CoalesceStream;
  102134. var retriggerForStream = function retriggerForStream2(key, event2) {
  102135. event2.stream = key;
  102136. this.trigger("log", event2);
  102137. };
  102138. var addPipelineLogRetriggers = function addPipelineLogRetriggers2(transmuxer2, pipeline) {
  102139. var keys3 = Object.keys(pipeline);
  102140. for (var i2 = 0; i2 < keys3.length; i2++) {
  102141. var key = keys3[i2];
  102142. if (key === "headOfPipeline" || !pipeline[key].on) {
  102143. continue;
  102144. }
  102145. pipeline[key].on("log", retriggerForStream.bind(transmuxer2, key));
  102146. }
  102147. };
  102148. var arrayEquals = function arrayEquals2(a, b) {
  102149. var i2;
  102150. if (a.length !== b.length) {
  102151. return false;
  102152. }
  102153. for (i2 = 0; i2 < a.length; i2++) {
  102154. if (a[i2] !== b[i2]) {
  102155. return false;
  102156. }
  102157. }
  102158. return true;
  102159. };
  102160. var generateSegmentTimingInfo = function generateSegmentTimingInfo2(baseMediaDecodeTime, startDts, startPts, endDts, endPts, prependedContentDuration) {
  102161. var ptsOffsetFromDts = startPts - startDts, decodeDuration = endDts - startDts, presentationDuration = endPts - startPts;
  102162. return {
  102163. start: {
  102164. dts: baseMediaDecodeTime,
  102165. pts: baseMediaDecodeTime + ptsOffsetFromDts
  102166. },
  102167. end: {
  102168. dts: baseMediaDecodeTime + decodeDuration,
  102169. pts: baseMediaDecodeTime + presentationDuration
  102170. },
  102171. prependedContentDuration,
  102172. baseMediaDecodeTime
  102173. };
  102174. };
  102175. _AudioSegmentStream = function AudioSegmentStream(track, options2) {
  102176. var adtsFrames = [], sequenceNumber, earliestAllowedDts = 0, audioAppendStartTs = 0, videoBaseMediaDecodeTime = Infinity;
  102177. options2 = options2 || {};
  102178. sequenceNumber = options2.firstSequenceNumber || 0;
  102179. _AudioSegmentStream.prototype.init.call(this);
  102180. this.push = function(data) {
  102181. trackDecodeInfo.collectDtsInfo(track, data);
  102182. if (track) {
  102183. audioProperties.forEach(function(prop) {
  102184. track[prop] = data[prop];
  102185. });
  102186. }
  102187. adtsFrames.push(data);
  102188. };
  102189. this.setEarliestDts = function(earliestDts) {
  102190. earliestAllowedDts = earliestDts;
  102191. };
  102192. this.setVideoBaseMediaDecodeTime = function(baseMediaDecodeTime) {
  102193. videoBaseMediaDecodeTime = baseMediaDecodeTime;
  102194. };
  102195. this.setAudioAppendStart = function(timestamp) {
  102196. audioAppendStartTs = timestamp;
  102197. };
  102198. this.flush = function() {
  102199. var frames, moof2, mdat2, boxes, frameDuration, segmentDuration, videoClockCyclesOfSilencePrefixed;
  102200. if (adtsFrames.length === 0) {
  102201. this.trigger("done", "AudioSegmentStream");
  102202. return;
  102203. }
  102204. frames = audioFrameUtils.trimAdtsFramesByEarliestDts(adtsFrames, track, earliestAllowedDts);
  102205. track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options2.keepOriginalTimestamps);
  102206. videoClockCyclesOfSilencePrefixed = audioFrameUtils.prefixWithSilence(track, frames, audioAppendStartTs, videoBaseMediaDecodeTime);
  102207. track.samples = audioFrameUtils.generateSampleTable(frames);
  102208. mdat2 = mp4Generator.mdat(audioFrameUtils.concatenateFrameData(frames));
  102209. adtsFrames = [];
  102210. moof2 = mp4Generator.moof(sequenceNumber, [track]);
  102211. boxes = new Uint8Array(moof2.byteLength + mdat2.byteLength);
  102212. sequenceNumber++;
  102213. boxes.set(moof2);
  102214. boxes.set(mdat2, moof2.byteLength);
  102215. trackDecodeInfo.clearDtsInfo(track);
  102216. frameDuration = Math.ceil(ONE_SECOND_IN_TS$12 * 1024 / track.samplerate);
  102217. if (frames.length) {
  102218. segmentDuration = frames.length * frameDuration;
  102219. this.trigger("segmentTimingInfo", generateSegmentTimingInfo(
  102220. clock2.audioTsToVideoTs(track.baseMediaDecodeTime, track.samplerate),
  102221. frames[0].dts,
  102222. frames[0].pts,
  102223. frames[0].dts + segmentDuration,
  102224. frames[0].pts + segmentDuration,
  102225. videoClockCyclesOfSilencePrefixed || 0
  102226. ));
  102227. this.trigger("timingInfo", {
  102228. start: frames[0].pts,
  102229. end: frames[0].pts + segmentDuration
  102230. });
  102231. }
  102232. this.trigger("data", {
  102233. track,
  102234. boxes
  102235. });
  102236. this.trigger("done", "AudioSegmentStream");
  102237. };
  102238. this.reset = function() {
  102239. trackDecodeInfo.clearDtsInfo(track);
  102240. adtsFrames = [];
  102241. this.trigger("reset");
  102242. };
  102243. };
  102244. _AudioSegmentStream.prototype = new stream();
  102245. _VideoSegmentStream = function VideoSegmentStream(track, options2) {
  102246. var sequenceNumber, nalUnits = [], gopsToAlignWith = [], config, pps;
  102247. options2 = options2 || {};
  102248. sequenceNumber = options2.firstSequenceNumber || 0;
  102249. _VideoSegmentStream.prototype.init.call(this);
  102250. delete track.minPTS;
  102251. this.gopCache_ = [];
  102252. this.push = function(nalUnit) {
  102253. trackDecodeInfo.collectDtsInfo(track, nalUnit);
  102254. if (nalUnit.nalUnitType === "seq_parameter_set_rbsp" && !config) {
  102255. config = nalUnit.config;
  102256. track.sps = [nalUnit.data];
  102257. videoProperties.forEach(function(prop) {
  102258. track[prop] = config[prop];
  102259. }, this);
  102260. }
  102261. if (nalUnit.nalUnitType === "pic_parameter_set_rbsp" && !pps) {
  102262. pps = nalUnit.data;
  102263. track.pps = [nalUnit.data];
  102264. }
  102265. nalUnits.push(nalUnit);
  102266. };
  102267. this.flush = function() {
  102268. var frames, gopForFusion, gops, moof2, mdat2, boxes, prependedContentDuration = 0, firstGop, lastGop;
  102269. while (nalUnits.length) {
  102270. if (nalUnits[0].nalUnitType === "access_unit_delimiter_rbsp") {
  102271. break;
  102272. }
  102273. nalUnits.shift();
  102274. }
  102275. if (nalUnits.length === 0) {
  102276. this.resetStream_();
  102277. this.trigger("done", "VideoSegmentStream");
  102278. return;
  102279. }
  102280. frames = frameUtils.groupNalsIntoFrames(nalUnits);
  102281. gops = frameUtils.groupFramesIntoGops(frames);
  102282. if (!gops[0][0].keyFrame) {
  102283. gopForFusion = this.getGopForFusion_(nalUnits[0], track);
  102284. if (gopForFusion) {
  102285. prependedContentDuration = gopForFusion.duration;
  102286. gops.unshift(gopForFusion);
  102287. gops.byteLength += gopForFusion.byteLength;
  102288. gops.nalCount += gopForFusion.nalCount;
  102289. gops.pts = gopForFusion.pts;
  102290. gops.dts = gopForFusion.dts;
  102291. gops.duration += gopForFusion.duration;
  102292. } else {
  102293. gops = frameUtils.extendFirstKeyFrame(gops);
  102294. }
  102295. }
  102296. if (gopsToAlignWith.length) {
  102297. var alignedGops;
  102298. if (options2.alignGopsAtEnd) {
  102299. alignedGops = this.alignGopsAtEnd_(gops);
  102300. } else {
  102301. alignedGops = this.alignGopsAtStart_(gops);
  102302. }
  102303. if (!alignedGops) {
  102304. this.gopCache_.unshift({
  102305. gop: gops.pop(),
  102306. pps: track.pps,
  102307. sps: track.sps
  102308. });
  102309. this.gopCache_.length = Math.min(6, this.gopCache_.length);
  102310. nalUnits = [];
  102311. this.resetStream_();
  102312. this.trigger("done", "VideoSegmentStream");
  102313. return;
  102314. }
  102315. trackDecodeInfo.clearDtsInfo(track);
  102316. gops = alignedGops;
  102317. }
  102318. trackDecodeInfo.collectDtsInfo(track, gops);
  102319. track.samples = frameUtils.generateSampleTable(gops);
  102320. mdat2 = mp4Generator.mdat(frameUtils.concatenateNalData(gops));
  102321. track.baseMediaDecodeTime = trackDecodeInfo.calculateTrackBaseMediaDecodeTime(track, options2.keepOriginalTimestamps);
  102322. this.trigger("processedGopsInfo", gops.map(function(gop) {
  102323. return {
  102324. pts: gop.pts,
  102325. dts: gop.dts,
  102326. byteLength: gop.byteLength
  102327. };
  102328. }));
  102329. firstGop = gops[0];
  102330. lastGop = gops[gops.length - 1];
  102331. this.trigger("segmentTimingInfo", generateSegmentTimingInfo(track.baseMediaDecodeTime, firstGop.dts, firstGop.pts, lastGop.dts + lastGop.duration, lastGop.pts + lastGop.duration, prependedContentDuration));
  102332. this.trigger("timingInfo", {
  102333. start: gops[0].pts,
  102334. end: gops[gops.length - 1].pts + gops[gops.length - 1].duration
  102335. });
  102336. this.gopCache_.unshift({
  102337. gop: gops.pop(),
  102338. pps: track.pps,
  102339. sps: track.sps
  102340. });
  102341. this.gopCache_.length = Math.min(6, this.gopCache_.length);
  102342. nalUnits = [];
  102343. this.trigger("baseMediaDecodeTime", track.baseMediaDecodeTime);
  102344. this.trigger("timelineStartInfo", track.timelineStartInfo);
  102345. moof2 = mp4Generator.moof(sequenceNumber, [track]);
  102346. boxes = new Uint8Array(moof2.byteLength + mdat2.byteLength);
  102347. sequenceNumber++;
  102348. boxes.set(moof2);
  102349. boxes.set(mdat2, moof2.byteLength);
  102350. this.trigger("data", {
  102351. track,
  102352. boxes
  102353. });
  102354. this.resetStream_();
  102355. this.trigger("done", "VideoSegmentStream");
  102356. };
  102357. this.reset = function() {
  102358. this.resetStream_();
  102359. nalUnits = [];
  102360. this.gopCache_.length = 0;
  102361. gopsToAlignWith.length = 0;
  102362. this.trigger("reset");
  102363. };
  102364. this.resetStream_ = function() {
  102365. trackDecodeInfo.clearDtsInfo(track);
  102366. config = void 0;
  102367. pps = void 0;
  102368. };
  102369. this.getGopForFusion_ = function(nalUnit) {
  102370. var halfSecond = 45e3, allowableOverlap = 1e4, nearestDistance = Infinity, dtsDistance, nearestGopObj, currentGop, currentGopObj, i2;
  102371. for (i2 = 0; i2 < this.gopCache_.length; i2++) {
  102372. currentGopObj = this.gopCache_[i2];
  102373. currentGop = currentGopObj.gop;
  102374. if (!(track.pps && arrayEquals(track.pps[0], currentGopObj.pps[0])) || !(track.sps && arrayEquals(track.sps[0], currentGopObj.sps[0]))) {
  102375. continue;
  102376. }
  102377. if (currentGop.dts < track.timelineStartInfo.dts) {
  102378. continue;
  102379. }
  102380. dtsDistance = nalUnit.dts - currentGop.dts - currentGop.duration;
  102381. if (dtsDistance >= -allowableOverlap && dtsDistance <= halfSecond) {
  102382. if (!nearestGopObj || nearestDistance > dtsDistance) {
  102383. nearestGopObj = currentGopObj;
  102384. nearestDistance = dtsDistance;
  102385. }
  102386. }
  102387. }
  102388. if (nearestGopObj) {
  102389. return nearestGopObj.gop;
  102390. }
  102391. return null;
  102392. };
  102393. this.alignGopsAtStart_ = function(gops) {
  102394. var alignIndex, gopIndex, align, gop, byteLength, nalCount, duration5, alignedGops;
  102395. byteLength = gops.byteLength;
  102396. nalCount = gops.nalCount;
  102397. duration5 = gops.duration;
  102398. alignIndex = gopIndex = 0;
  102399. while (alignIndex < gopsToAlignWith.length && gopIndex < gops.length) {
  102400. align = gopsToAlignWith[alignIndex];
  102401. gop = gops[gopIndex];
  102402. if (align.pts === gop.pts) {
  102403. break;
  102404. }
  102405. if (gop.pts > align.pts) {
  102406. alignIndex++;
  102407. continue;
  102408. }
  102409. gopIndex++;
  102410. byteLength -= gop.byteLength;
  102411. nalCount -= gop.nalCount;
  102412. duration5 -= gop.duration;
  102413. }
  102414. if (gopIndex === 0) {
  102415. return gops;
  102416. }
  102417. if (gopIndex === gops.length) {
  102418. return null;
  102419. }
  102420. alignedGops = gops.slice(gopIndex);
  102421. alignedGops.byteLength = byteLength;
  102422. alignedGops.duration = duration5;
  102423. alignedGops.nalCount = nalCount;
  102424. alignedGops.pts = alignedGops[0].pts;
  102425. alignedGops.dts = alignedGops[0].dts;
  102426. return alignedGops;
  102427. };
  102428. this.alignGopsAtEnd_ = function(gops) {
  102429. var alignIndex, gopIndex, align, gop, alignEndIndex, matchFound;
  102430. alignIndex = gopsToAlignWith.length - 1;
  102431. gopIndex = gops.length - 1;
  102432. alignEndIndex = null;
  102433. matchFound = false;
  102434. while (alignIndex >= 0 && gopIndex >= 0) {
  102435. align = gopsToAlignWith[alignIndex];
  102436. gop = gops[gopIndex];
  102437. if (align.pts === gop.pts) {
  102438. matchFound = true;
  102439. break;
  102440. }
  102441. if (align.pts > gop.pts) {
  102442. alignIndex--;
  102443. continue;
  102444. }
  102445. if (alignIndex === gopsToAlignWith.length - 1) {
  102446. alignEndIndex = gopIndex;
  102447. }
  102448. gopIndex--;
  102449. }
  102450. if (!matchFound && alignEndIndex === null) {
  102451. return null;
  102452. }
  102453. var trimIndex;
  102454. if (matchFound) {
  102455. trimIndex = gopIndex;
  102456. } else {
  102457. trimIndex = alignEndIndex;
  102458. }
  102459. if (trimIndex === 0) {
  102460. return gops;
  102461. }
  102462. var alignedGops = gops.slice(trimIndex);
  102463. var metadata = alignedGops.reduce(function(total, gop2) {
  102464. total.byteLength += gop2.byteLength;
  102465. total.duration += gop2.duration;
  102466. total.nalCount += gop2.nalCount;
  102467. return total;
  102468. }, {
  102469. byteLength: 0,
  102470. duration: 0,
  102471. nalCount: 0
  102472. });
  102473. alignedGops.byteLength = metadata.byteLength;
  102474. alignedGops.duration = metadata.duration;
  102475. alignedGops.nalCount = metadata.nalCount;
  102476. alignedGops.pts = alignedGops[0].pts;
  102477. alignedGops.dts = alignedGops[0].dts;
  102478. return alignedGops;
  102479. };
  102480. this.alignGopsWith = function(newGopsToAlignWith) {
  102481. gopsToAlignWith = newGopsToAlignWith;
  102482. };
  102483. };
  102484. _VideoSegmentStream.prototype = new stream();
  102485. _CoalesceStream = function CoalesceStream(options2, metadataStream2) {
  102486. this.numberOfTracks = 0;
  102487. this.metadataStream = metadataStream2;
  102488. options2 = options2 || {};
  102489. if (typeof options2.remux !== "undefined") {
  102490. this.remuxTracks = !!options2.remux;
  102491. } else {
  102492. this.remuxTracks = true;
  102493. }
  102494. if (typeof options2.keepOriginalTimestamps === "boolean") {
  102495. this.keepOriginalTimestamps = options2.keepOriginalTimestamps;
  102496. } else {
  102497. this.keepOriginalTimestamps = false;
  102498. }
  102499. this.pendingTracks = [];
  102500. this.videoTrack = null;
  102501. this.pendingBoxes = [];
  102502. this.pendingCaptions = [];
  102503. this.pendingMetadata = [];
  102504. this.pendingBytes = 0;
  102505. this.emittedTracks = 0;
  102506. _CoalesceStream.prototype.init.call(this);
  102507. this.push = function(output) {
  102508. if (output.text) {
  102509. return this.pendingCaptions.push(output);
  102510. }
  102511. if (output.frames) {
  102512. return this.pendingMetadata.push(output);
  102513. }
  102514. this.pendingTracks.push(output.track);
  102515. this.pendingBytes += output.boxes.byteLength;
  102516. if (output.track.type === "video") {
  102517. this.videoTrack = output.track;
  102518. this.pendingBoxes.push(output.boxes);
  102519. }
  102520. if (output.track.type === "audio") {
  102521. this.audioTrack = output.track;
  102522. this.pendingBoxes.unshift(output.boxes);
  102523. }
  102524. };
  102525. };
  102526. _CoalesceStream.prototype = new stream();
  102527. _CoalesceStream.prototype.flush = function(flushSource) {
  102528. var offset = 0, event2 = {
  102529. captions: [],
  102530. captionStreams: {},
  102531. metadata: [],
  102532. info: {}
  102533. }, caption, id3, initSegment, timelineStartPts = 0, i2;
  102534. if (this.pendingTracks.length < this.numberOfTracks) {
  102535. if (flushSource !== "VideoSegmentStream" && flushSource !== "AudioSegmentStream") {
  102536. return;
  102537. } else if (this.remuxTracks) {
  102538. return;
  102539. } else if (this.pendingTracks.length === 0) {
  102540. this.emittedTracks++;
  102541. if (this.emittedTracks >= this.numberOfTracks) {
  102542. this.trigger("done");
  102543. this.emittedTracks = 0;
  102544. }
  102545. return;
  102546. }
  102547. }
  102548. if (this.videoTrack) {
  102549. timelineStartPts = this.videoTrack.timelineStartInfo.pts;
  102550. videoProperties.forEach(function(prop) {
  102551. event2.info[prop] = this.videoTrack[prop];
  102552. }, this);
  102553. } else if (this.audioTrack) {
  102554. timelineStartPts = this.audioTrack.timelineStartInfo.pts;
  102555. audioProperties.forEach(function(prop) {
  102556. event2.info[prop] = this.audioTrack[prop];
  102557. }, this);
  102558. }
  102559. if (this.videoTrack || this.audioTrack) {
  102560. if (this.pendingTracks.length === 1) {
  102561. event2.type = this.pendingTracks[0].type;
  102562. } else {
  102563. event2.type = "combined";
  102564. }
  102565. this.emittedTracks += this.pendingTracks.length;
  102566. initSegment = mp4Generator.initSegment(this.pendingTracks);
  102567. event2.initSegment = new Uint8Array(initSegment.byteLength);
  102568. event2.initSegment.set(initSegment);
  102569. event2.data = new Uint8Array(this.pendingBytes);
  102570. for (i2 = 0; i2 < this.pendingBoxes.length; i2++) {
  102571. event2.data.set(this.pendingBoxes[i2], offset);
  102572. offset += this.pendingBoxes[i2].byteLength;
  102573. }
  102574. for (i2 = 0; i2 < this.pendingCaptions.length; i2++) {
  102575. caption = this.pendingCaptions[i2];
  102576. caption.startTime = clock2.metadataTsToSeconds(caption.startPts, timelineStartPts, this.keepOriginalTimestamps);
  102577. caption.endTime = clock2.metadataTsToSeconds(caption.endPts, timelineStartPts, this.keepOriginalTimestamps);
  102578. event2.captionStreams[caption.stream] = true;
  102579. event2.captions.push(caption);
  102580. }
  102581. for (i2 = 0; i2 < this.pendingMetadata.length; i2++) {
  102582. id3 = this.pendingMetadata[i2];
  102583. id3.cueTime = clock2.metadataTsToSeconds(id3.pts, timelineStartPts, this.keepOriginalTimestamps);
  102584. event2.metadata.push(id3);
  102585. }
  102586. event2.metadata.dispatchType = this.metadataStream.dispatchType;
  102587. this.pendingTracks.length = 0;
  102588. this.videoTrack = null;
  102589. this.pendingBoxes.length = 0;
  102590. this.pendingCaptions.length = 0;
  102591. this.pendingBytes = 0;
  102592. this.pendingMetadata.length = 0;
  102593. this.trigger("data", event2);
  102594. for (i2 = 0; i2 < event2.captions.length; i2++) {
  102595. caption = event2.captions[i2];
  102596. this.trigger("caption", caption);
  102597. }
  102598. for (i2 = 0; i2 < event2.metadata.length; i2++) {
  102599. id3 = event2.metadata[i2];
  102600. this.trigger("id3Frame", id3);
  102601. }
  102602. }
  102603. if (this.emittedTracks >= this.numberOfTracks) {
  102604. this.trigger("done");
  102605. this.emittedTracks = 0;
  102606. }
  102607. };
  102608. _CoalesceStream.prototype.setRemux = function(val) {
  102609. this.remuxTracks = val;
  102610. };
  102611. _Transmuxer = function Transmuxer(options2) {
  102612. var self2 = this, hasFlushed = true, videoTrack, audioTrack;
  102613. _Transmuxer.prototype.init.call(this);
  102614. options2 = options2 || {};
  102615. this.baseMediaDecodeTime = options2.baseMediaDecodeTime || 0;
  102616. this.transmuxPipeline_ = {};
  102617. this.setupAacPipeline = function() {
  102618. var pipeline = {};
  102619. this.transmuxPipeline_ = pipeline;
  102620. pipeline.type = "aac";
  102621. pipeline.metadataStream = new m2ts_1.MetadataStream();
  102622. pipeline.aacStream = new aac3();
  102623. pipeline.audioTimestampRolloverStream = new m2ts_1.TimestampRolloverStream("audio");
  102624. pipeline.timedMetadataTimestampRolloverStream = new m2ts_1.TimestampRolloverStream("timed-metadata");
  102625. pipeline.adtsStream = new adts();
  102626. pipeline.coalesceStream = new _CoalesceStream(options2, pipeline.metadataStream);
  102627. pipeline.headOfPipeline = pipeline.aacStream;
  102628. pipeline.aacStream.pipe(pipeline.audioTimestampRolloverStream).pipe(pipeline.adtsStream);
  102629. pipeline.aacStream.pipe(pipeline.timedMetadataTimestampRolloverStream).pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);
  102630. pipeline.metadataStream.on("timestamp", function(frame) {
  102631. pipeline.aacStream.setTimestamp(frame.timeStamp);
  102632. });
  102633. pipeline.aacStream.on("data", function(data) {
  102634. if (data.type !== "timed-metadata" && data.type !== "audio" || pipeline.audioSegmentStream) {
  102635. return;
  102636. }
  102637. audioTrack = audioTrack || {
  102638. timelineStartInfo: {
  102639. baseMediaDecodeTime: self2.baseMediaDecodeTime
  102640. },
  102641. codec: "adts",
  102642. type: "audio"
  102643. };
  102644. pipeline.coalesceStream.numberOfTracks++;
  102645. pipeline.audioSegmentStream = new _AudioSegmentStream(audioTrack, options2);
  102646. pipeline.audioSegmentStream.on("log", self2.getLogTrigger_("audioSegmentStream"));
  102647. pipeline.audioSegmentStream.on("timingInfo", self2.trigger.bind(self2, "audioTimingInfo"));
  102648. pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);
  102649. self2.trigger("trackinfo", {
  102650. hasAudio: !!audioTrack,
  102651. hasVideo: !!videoTrack
  102652. });
  102653. });
  102654. pipeline.coalesceStream.on("data", this.trigger.bind(this, "data"));
  102655. pipeline.coalesceStream.on("done", this.trigger.bind(this, "done"));
  102656. addPipelineLogRetriggers(this, pipeline);
  102657. };
  102658. this.setupTsPipeline = function() {
  102659. var pipeline = {};
  102660. this.transmuxPipeline_ = pipeline;
  102661. pipeline.type = "ts";
  102662. pipeline.metadataStream = new m2ts_1.MetadataStream();
  102663. pipeline.packetStream = new m2ts_1.TransportPacketStream();
  102664. pipeline.parseStream = new m2ts_1.TransportParseStream();
  102665. pipeline.elementaryStream = new m2ts_1.ElementaryStream();
  102666. pipeline.timestampRolloverStream = new m2ts_1.TimestampRolloverStream();
  102667. pipeline.adtsStream = new adts();
  102668. pipeline.h264Stream = new H264Stream();
  102669. pipeline.captionStream = new m2ts_1.CaptionStream(options2);
  102670. pipeline.coalesceStream = new _CoalesceStream(options2, pipeline.metadataStream);
  102671. pipeline.headOfPipeline = pipeline.packetStream;
  102672. pipeline.packetStream.pipe(pipeline.parseStream).pipe(pipeline.elementaryStream).pipe(pipeline.timestampRolloverStream);
  102673. pipeline.timestampRolloverStream.pipe(pipeline.h264Stream);
  102674. pipeline.timestampRolloverStream.pipe(pipeline.adtsStream);
  102675. pipeline.timestampRolloverStream.pipe(pipeline.metadataStream).pipe(pipeline.coalesceStream);
  102676. pipeline.h264Stream.pipe(pipeline.captionStream).pipe(pipeline.coalesceStream);
  102677. pipeline.elementaryStream.on("data", function(data) {
  102678. var i2;
  102679. if (data.type === "metadata") {
  102680. i2 = data.tracks.length;
  102681. while (i2--) {
  102682. if (!videoTrack && data.tracks[i2].type === "video") {
  102683. videoTrack = data.tracks[i2];
  102684. videoTrack.timelineStartInfo.baseMediaDecodeTime = self2.baseMediaDecodeTime;
  102685. } else if (!audioTrack && data.tracks[i2].type === "audio") {
  102686. audioTrack = data.tracks[i2];
  102687. audioTrack.timelineStartInfo.baseMediaDecodeTime = self2.baseMediaDecodeTime;
  102688. }
  102689. }
  102690. if (videoTrack && !pipeline.videoSegmentStream) {
  102691. pipeline.coalesceStream.numberOfTracks++;
  102692. pipeline.videoSegmentStream = new _VideoSegmentStream(videoTrack, options2);
  102693. pipeline.videoSegmentStream.on("log", self2.getLogTrigger_("videoSegmentStream"));
  102694. pipeline.videoSegmentStream.on("timelineStartInfo", function(timelineStartInfo) {
  102695. if (audioTrack && !options2.keepOriginalTimestamps) {
  102696. audioTrack.timelineStartInfo = timelineStartInfo;
  102697. pipeline.audioSegmentStream.setEarliestDts(timelineStartInfo.dts - self2.baseMediaDecodeTime);
  102698. }
  102699. });
  102700. pipeline.videoSegmentStream.on("processedGopsInfo", self2.trigger.bind(self2, "gopInfo"));
  102701. pipeline.videoSegmentStream.on("segmentTimingInfo", self2.trigger.bind(self2, "videoSegmentTimingInfo"));
  102702. pipeline.videoSegmentStream.on("baseMediaDecodeTime", function(baseMediaDecodeTime) {
  102703. if (audioTrack) {
  102704. pipeline.audioSegmentStream.setVideoBaseMediaDecodeTime(baseMediaDecodeTime);
  102705. }
  102706. });
  102707. pipeline.videoSegmentStream.on("timingInfo", self2.trigger.bind(self2, "videoTimingInfo"));
  102708. pipeline.h264Stream.pipe(pipeline.videoSegmentStream).pipe(pipeline.coalesceStream);
  102709. }
  102710. if (audioTrack && !pipeline.audioSegmentStream) {
  102711. pipeline.coalesceStream.numberOfTracks++;
  102712. pipeline.audioSegmentStream = new _AudioSegmentStream(audioTrack, options2);
  102713. pipeline.audioSegmentStream.on("log", self2.getLogTrigger_("audioSegmentStream"));
  102714. pipeline.audioSegmentStream.on("timingInfo", self2.trigger.bind(self2, "audioTimingInfo"));
  102715. pipeline.audioSegmentStream.on("segmentTimingInfo", self2.trigger.bind(self2, "audioSegmentTimingInfo"));
  102716. pipeline.adtsStream.pipe(pipeline.audioSegmentStream).pipe(pipeline.coalesceStream);
  102717. }
  102718. self2.trigger("trackinfo", {
  102719. hasAudio: !!audioTrack,
  102720. hasVideo: !!videoTrack
  102721. });
  102722. }
  102723. });
  102724. pipeline.coalesceStream.on("data", this.trigger.bind(this, "data"));
  102725. pipeline.coalesceStream.on("id3Frame", function(id3Frame) {
  102726. id3Frame.dispatchType = pipeline.metadataStream.dispatchType;
  102727. self2.trigger("id3Frame", id3Frame);
  102728. });
  102729. pipeline.coalesceStream.on("caption", this.trigger.bind(this, "caption"));
  102730. pipeline.coalesceStream.on("done", this.trigger.bind(this, "done"));
  102731. addPipelineLogRetriggers(this, pipeline);
  102732. };
  102733. this.setBaseMediaDecodeTime = function(baseMediaDecodeTime) {
  102734. var pipeline = this.transmuxPipeline_;
  102735. if (!options2.keepOriginalTimestamps) {
  102736. this.baseMediaDecodeTime = baseMediaDecodeTime;
  102737. }
  102738. if (audioTrack) {
  102739. audioTrack.timelineStartInfo.dts = void 0;
  102740. audioTrack.timelineStartInfo.pts = void 0;
  102741. trackDecodeInfo.clearDtsInfo(audioTrack);
  102742. if (pipeline.audioTimestampRolloverStream) {
  102743. pipeline.audioTimestampRolloverStream.discontinuity();
  102744. }
  102745. }
  102746. if (videoTrack) {
  102747. if (pipeline.videoSegmentStream) {
  102748. pipeline.videoSegmentStream.gopCache_ = [];
  102749. }
  102750. videoTrack.timelineStartInfo.dts = void 0;
  102751. videoTrack.timelineStartInfo.pts = void 0;
  102752. trackDecodeInfo.clearDtsInfo(videoTrack);
  102753. pipeline.captionStream.reset();
  102754. }
  102755. if (pipeline.timestampRolloverStream) {
  102756. pipeline.timestampRolloverStream.discontinuity();
  102757. }
  102758. };
  102759. this.setAudioAppendStart = function(timestamp) {
  102760. if (audioTrack) {
  102761. this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(timestamp);
  102762. }
  102763. };
  102764. this.setRemux = function(val) {
  102765. var pipeline = this.transmuxPipeline_;
  102766. options2.remux = val;
  102767. if (pipeline && pipeline.coalesceStream) {
  102768. pipeline.coalesceStream.setRemux(val);
  102769. }
  102770. };
  102771. this.alignGopsWith = function(gopsToAlignWith) {
  102772. if (videoTrack && this.transmuxPipeline_.videoSegmentStream) {
  102773. this.transmuxPipeline_.videoSegmentStream.alignGopsWith(gopsToAlignWith);
  102774. }
  102775. };
  102776. this.getLogTrigger_ = function(key) {
  102777. var self3 = this;
  102778. return function(event2) {
  102779. event2.stream = key;
  102780. self3.trigger("log", event2);
  102781. };
  102782. };
  102783. this.push = function(data) {
  102784. if (hasFlushed) {
  102785. var isAac = isLikelyAacData(data);
  102786. if (isAac && this.transmuxPipeline_.type !== "aac") {
  102787. this.setupAacPipeline();
  102788. } else if (!isAac && this.transmuxPipeline_.type !== "ts") {
  102789. this.setupTsPipeline();
  102790. }
  102791. hasFlushed = false;
  102792. }
  102793. this.transmuxPipeline_.headOfPipeline.push(data);
  102794. };
  102795. this.flush = function() {
  102796. hasFlushed = true;
  102797. this.transmuxPipeline_.headOfPipeline.flush();
  102798. };
  102799. this.endTimeline = function() {
  102800. this.transmuxPipeline_.headOfPipeline.endTimeline();
  102801. };
  102802. this.reset = function() {
  102803. if (this.transmuxPipeline_.headOfPipeline) {
  102804. this.transmuxPipeline_.headOfPipeline.reset();
  102805. }
  102806. };
  102807. this.resetCaptions = function() {
  102808. if (this.transmuxPipeline_.captionStream) {
  102809. this.transmuxPipeline_.captionStream.reset();
  102810. }
  102811. };
  102812. };
  102813. _Transmuxer.prototype = new stream();
  102814. var transmuxer = {
  102815. Transmuxer: _Transmuxer,
  102816. VideoSegmentStream: _VideoSegmentStream,
  102817. AudioSegmentStream: _AudioSegmentStream,
  102818. AUDIO_PROPERTIES: audioProperties,
  102819. VIDEO_PROPERTIES: videoProperties,
  102820. generateSegmentTimingInfo
  102821. };
  102822. var toUnsigned$3 = function toUnsigned2(value) {
  102823. return value >>> 0;
  102824. };
  102825. var toHexString$1 = function toHexString2(value) {
  102826. return ("00" + value.toString(16)).slice(-2);
  102827. };
  102828. var bin = {
  102829. toUnsigned: toUnsigned$3,
  102830. toHexString: toHexString$1
  102831. };
  102832. var parseType$1 = function parseType2(buffer) {
  102833. var result = "";
  102834. result += String.fromCharCode(buffer[0]);
  102835. result += String.fromCharCode(buffer[1]);
  102836. result += String.fromCharCode(buffer[2]);
  102837. result += String.fromCharCode(buffer[3]);
  102838. return result;
  102839. };
  102840. var parseType_1 = parseType$1;
  102841. var toUnsigned$2 = bin.toUnsigned;
  102842. var findBox4 = function findBox5(data, path) {
  102843. var results = [], i2, size, type3, end, subresults;
  102844. if (!path.length) {
  102845. return null;
  102846. }
  102847. for (i2 = 0; i2 < data.byteLength; ) {
  102848. size = toUnsigned$2(data[i2] << 24 | data[i2 + 1] << 16 | data[i2 + 2] << 8 | data[i2 + 3]);
  102849. type3 = parseType_1(data.subarray(i2 + 4, i2 + 8));
  102850. end = size > 1 ? i2 + size : data.byteLength;
  102851. if (type3 === path[0]) {
  102852. if (path.length === 1) {
  102853. results.push(data.subarray(i2 + 8, end));
  102854. } else {
  102855. subresults = findBox5(data.subarray(i2 + 8, end), path.slice(1));
  102856. if (subresults.length) {
  102857. results = results.concat(subresults);
  102858. }
  102859. }
  102860. }
  102861. i2 = end;
  102862. }
  102863. return results;
  102864. };
  102865. var findBox_1 = findBox4;
  102866. var toUnsigned$1 = bin.toUnsigned;
  102867. var getUint64$12 = numbers2.getUint64;
  102868. var tfdt = function tfdt2(data) {
  102869. var result = {
  102870. version: data[0],
  102871. flags: new Uint8Array(data.subarray(1, 4))
  102872. };
  102873. if (result.version === 1) {
  102874. result.baseMediaDecodeTime = getUint64$12(data.subarray(4));
  102875. } else {
  102876. result.baseMediaDecodeTime = toUnsigned$1(data[4] << 24 | data[5] << 16 | data[6] << 8 | data[7]);
  102877. }
  102878. return result;
  102879. };
  102880. var parseTfdt = tfdt;
  102881. var parseSampleFlags = function parseSampleFlags2(flags) {
  102882. return {
  102883. isLeading: (flags[0] & 12) >>> 2,
  102884. dependsOn: flags[0] & 3,
  102885. isDependedOn: (flags[1] & 192) >>> 6,
  102886. hasRedundancy: (flags[1] & 48) >>> 4,
  102887. paddingValue: (flags[1] & 14) >>> 1,
  102888. isNonSyncSample: flags[1] & 1,
  102889. degradationPriority: flags[2] << 8 | flags[3]
  102890. };
  102891. };
  102892. var parseSampleFlags_1 = parseSampleFlags;
  102893. var trun = function trun2(data) {
  102894. var result = {
  102895. version: data[0],
  102896. flags: new Uint8Array(data.subarray(1, 4)),
  102897. samples: []
  102898. }, view = new DataView(data.buffer, data.byteOffset, data.byteLength), dataOffsetPresent = result.flags[2] & 1, firstSampleFlagsPresent = result.flags[2] & 4, sampleDurationPresent = result.flags[1] & 1, sampleSizePresent = result.flags[1] & 2, sampleFlagsPresent = result.flags[1] & 4, sampleCompositionTimeOffsetPresent = result.flags[1] & 8, sampleCount = view.getUint32(4), offset = 8, sample;
  102899. if (dataOffsetPresent) {
  102900. result.dataOffset = view.getInt32(offset);
  102901. offset += 4;
  102902. }
  102903. if (firstSampleFlagsPresent && sampleCount) {
  102904. sample = {
  102905. flags: parseSampleFlags_1(data.subarray(offset, offset + 4))
  102906. };
  102907. offset += 4;
  102908. if (sampleDurationPresent) {
  102909. sample.duration = view.getUint32(offset);
  102910. offset += 4;
  102911. }
  102912. if (sampleSizePresent) {
  102913. sample.size = view.getUint32(offset);
  102914. offset += 4;
  102915. }
  102916. if (sampleCompositionTimeOffsetPresent) {
  102917. if (result.version === 1) {
  102918. sample.compositionTimeOffset = view.getInt32(offset);
  102919. } else {
  102920. sample.compositionTimeOffset = view.getUint32(offset);
  102921. }
  102922. offset += 4;
  102923. }
  102924. result.samples.push(sample);
  102925. sampleCount--;
  102926. }
  102927. while (sampleCount--) {
  102928. sample = {};
  102929. if (sampleDurationPresent) {
  102930. sample.duration = view.getUint32(offset);
  102931. offset += 4;
  102932. }
  102933. if (sampleSizePresent) {
  102934. sample.size = view.getUint32(offset);
  102935. offset += 4;
  102936. }
  102937. if (sampleFlagsPresent) {
  102938. sample.flags = parseSampleFlags_1(data.subarray(offset, offset + 4));
  102939. offset += 4;
  102940. }
  102941. if (sampleCompositionTimeOffsetPresent) {
  102942. if (result.version === 1) {
  102943. sample.compositionTimeOffset = view.getInt32(offset);
  102944. } else {
  102945. sample.compositionTimeOffset = view.getUint32(offset);
  102946. }
  102947. offset += 4;
  102948. }
  102949. result.samples.push(sample);
  102950. }
  102951. return result;
  102952. };
  102953. var parseTrun = trun;
  102954. var tfhd = function tfhd2(data) {
  102955. var view = new DataView(data.buffer, data.byteOffset, data.byteLength), result = {
  102956. version: data[0],
  102957. flags: new Uint8Array(data.subarray(1, 4)),
  102958. trackId: view.getUint32(4)
  102959. }, baseDataOffsetPresent = result.flags[2] & 1, sampleDescriptionIndexPresent = result.flags[2] & 2, defaultSampleDurationPresent = result.flags[2] & 8, defaultSampleSizePresent = result.flags[2] & 16, defaultSampleFlagsPresent = result.flags[2] & 32, durationIsEmpty = result.flags[0] & 65536, defaultBaseIsMoof = result.flags[0] & 131072, i2;
  102960. i2 = 8;
  102961. if (baseDataOffsetPresent) {
  102962. i2 += 4;
  102963. result.baseDataOffset = view.getUint32(12);
  102964. i2 += 4;
  102965. }
  102966. if (sampleDescriptionIndexPresent) {
  102967. result.sampleDescriptionIndex = view.getUint32(i2);
  102968. i2 += 4;
  102969. }
  102970. if (defaultSampleDurationPresent) {
  102971. result.defaultSampleDuration = view.getUint32(i2);
  102972. i2 += 4;
  102973. }
  102974. if (defaultSampleSizePresent) {
  102975. result.defaultSampleSize = view.getUint32(i2);
  102976. i2 += 4;
  102977. }
  102978. if (defaultSampleFlagsPresent) {
  102979. result.defaultSampleFlags = view.getUint32(i2);
  102980. }
  102981. if (durationIsEmpty) {
  102982. result.durationIsEmpty = true;
  102983. }
  102984. if (!baseDataOffsetPresent && defaultBaseIsMoof) {
  102985. result.baseDataOffsetIsMoof = true;
  102986. }
  102987. return result;
  102988. };
  102989. var parseTfhd = tfhd;
  102990. var commonjsGlobal2 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  102991. var win2;
  102992. if (typeof window !== "undefined") {
  102993. win2 = window;
  102994. } else if (typeof commonjsGlobal2 !== "undefined") {
  102995. win2 = commonjsGlobal2;
  102996. } else if (typeof self !== "undefined") {
  102997. win2 = self;
  102998. } else {
  102999. win2 = {};
  103000. }
  103001. var window_12 = win2;
  103002. var discardEmulationPreventionBytes4 = captionPacketParser.discardEmulationPreventionBytes;
  103003. var CaptionStream = captionStream.CaptionStream;
  103004. var mapToSample = function mapToSample2(offset, samples) {
  103005. var approximateOffset = offset;
  103006. for (var i2 = 0; i2 < samples.length; i2++) {
  103007. var sample = samples[i2];
  103008. if (approximateOffset < sample.size) {
  103009. return sample;
  103010. }
  103011. approximateOffset -= sample.size;
  103012. }
  103013. return null;
  103014. };
  103015. var findSeiNals = function findSeiNals2(avcStream, samples, trackId) {
  103016. var avcView = new DataView(avcStream.buffer, avcStream.byteOffset, avcStream.byteLength), result = {
  103017. logs: [],
  103018. seiNals: []
  103019. }, seiNal, i2, length, lastMatchedSample;
  103020. for (i2 = 0; i2 + 4 < avcStream.length; i2 += length) {
  103021. length = avcView.getUint32(i2);
  103022. i2 += 4;
  103023. if (length <= 0) {
  103024. continue;
  103025. }
  103026. switch (avcStream[i2] & 31) {
  103027. case 6:
  103028. var data = avcStream.subarray(i2 + 1, i2 + 1 + length);
  103029. var matchingSample = mapToSample(i2, samples);
  103030. seiNal = {
  103031. nalUnitType: "sei_rbsp",
  103032. size: length,
  103033. data,
  103034. escapedRBSP: discardEmulationPreventionBytes4(data),
  103035. trackId
  103036. };
  103037. if (matchingSample) {
  103038. seiNal.pts = matchingSample.pts;
  103039. seiNal.dts = matchingSample.dts;
  103040. lastMatchedSample = matchingSample;
  103041. } else if (lastMatchedSample) {
  103042. seiNal.pts = lastMatchedSample.pts;
  103043. seiNal.dts = lastMatchedSample.dts;
  103044. } else {
  103045. result.logs.push({
  103046. level: "warn",
  103047. message: "We've encountered a nal unit without data at " + i2 + " for trackId " + trackId + ". See mux.js#223."
  103048. });
  103049. break;
  103050. }
  103051. result.seiNals.push(seiNal);
  103052. break;
  103053. }
  103054. }
  103055. return result;
  103056. };
  103057. var parseSamples = function parseSamples2(truns, baseMediaDecodeTime, tfhd2) {
  103058. var currentDts = baseMediaDecodeTime;
  103059. var defaultSampleDuration = tfhd2.defaultSampleDuration || 0;
  103060. var defaultSampleSize = tfhd2.defaultSampleSize || 0;
  103061. var trackId = tfhd2.trackId;
  103062. var allSamples = [];
  103063. truns.forEach(function(trun2) {
  103064. var trackRun = parseTrun(trun2);
  103065. var samples = trackRun.samples;
  103066. samples.forEach(function(sample) {
  103067. if (sample.duration === void 0) {
  103068. sample.duration = defaultSampleDuration;
  103069. }
  103070. if (sample.size === void 0) {
  103071. sample.size = defaultSampleSize;
  103072. }
  103073. sample.trackId = trackId;
  103074. sample.dts = currentDts;
  103075. if (sample.compositionTimeOffset === void 0) {
  103076. sample.compositionTimeOffset = 0;
  103077. }
  103078. if (typeof currentDts === "bigint") {
  103079. sample.pts = currentDts + window_12.BigInt(sample.compositionTimeOffset);
  103080. currentDts += window_12.BigInt(sample.duration);
  103081. } else {
  103082. sample.pts = currentDts + sample.compositionTimeOffset;
  103083. currentDts += sample.duration;
  103084. }
  103085. });
  103086. allSamples = allSamples.concat(samples);
  103087. });
  103088. return allSamples;
  103089. };
  103090. var parseCaptionNals = function parseCaptionNals2(segment, videoTrackId) {
  103091. var trafs = findBox_1(segment, ["moof", "traf"]);
  103092. var mdats = findBox_1(segment, ["mdat"]);
  103093. var captionNals = {};
  103094. var mdatTrafPairs = [];
  103095. mdats.forEach(function(mdat2, index2) {
  103096. var matchingTraf = trafs[index2];
  103097. mdatTrafPairs.push({
  103098. mdat: mdat2,
  103099. traf: matchingTraf
  103100. });
  103101. });
  103102. mdatTrafPairs.forEach(function(pair) {
  103103. var mdat2 = pair.mdat;
  103104. var traf2 = pair.traf;
  103105. var tfhd2 = findBox_1(traf2, ["tfhd"]);
  103106. var headerInfo = parseTfhd(tfhd2[0]);
  103107. var trackId = headerInfo.trackId;
  103108. var tfdt2 = findBox_1(traf2, ["tfdt"]);
  103109. var baseMediaDecodeTime = tfdt2.length > 0 ? parseTfdt(tfdt2[0]).baseMediaDecodeTime : 0;
  103110. var truns = findBox_1(traf2, ["trun"]);
  103111. var samples;
  103112. var result;
  103113. if (videoTrackId === trackId && truns.length > 0) {
  103114. samples = parseSamples(truns, baseMediaDecodeTime, headerInfo);
  103115. result = findSeiNals(mdat2, samples, trackId);
  103116. if (!captionNals[trackId]) {
  103117. captionNals[trackId] = {
  103118. seiNals: [],
  103119. logs: []
  103120. };
  103121. }
  103122. captionNals[trackId].seiNals = captionNals[trackId].seiNals.concat(result.seiNals);
  103123. captionNals[trackId].logs = captionNals[trackId].logs.concat(result.logs);
  103124. }
  103125. });
  103126. return captionNals;
  103127. };
  103128. var parseEmbeddedCaptions = function parseEmbeddedCaptions2(segment, trackId, timescale3) {
  103129. var captionNals;
  103130. if (trackId === null) {
  103131. return null;
  103132. }
  103133. captionNals = parseCaptionNals(segment, trackId);
  103134. var trackNals = captionNals[trackId] || {};
  103135. return {
  103136. seiNals: trackNals.seiNals,
  103137. logs: trackNals.logs,
  103138. timescale: timescale3
  103139. };
  103140. };
  103141. var CaptionParser = function CaptionParser2() {
  103142. var isInitialized = false;
  103143. var captionStream2;
  103144. var segmentCache;
  103145. var trackId;
  103146. var timescale3;
  103147. var parsedCaptions;
  103148. var parsingPartial;
  103149. this.isInitialized = function() {
  103150. return isInitialized;
  103151. };
  103152. this.init = function(options2) {
  103153. captionStream2 = new CaptionStream();
  103154. isInitialized = true;
  103155. parsingPartial = options2 ? options2.isPartial : false;
  103156. captionStream2.on("data", function(event2) {
  103157. event2.startTime = event2.startPts / timescale3;
  103158. event2.endTime = event2.endPts / timescale3;
  103159. parsedCaptions.captions.push(event2);
  103160. parsedCaptions.captionStreams[event2.stream] = true;
  103161. });
  103162. captionStream2.on("log", function(log2) {
  103163. parsedCaptions.logs.push(log2);
  103164. });
  103165. };
  103166. this.isNewInit = function(videoTrackIds, timescales) {
  103167. if (videoTrackIds && videoTrackIds.length === 0 || timescales && typeof timescales === "object" && Object.keys(timescales).length === 0) {
  103168. return false;
  103169. }
  103170. return trackId !== videoTrackIds[0] || timescale3 !== timescales[trackId];
  103171. };
  103172. this.parse = function(segment, videoTrackIds, timescales) {
  103173. var parsedData;
  103174. if (!this.isInitialized()) {
  103175. return null;
  103176. } else if (!videoTrackIds || !timescales) {
  103177. return null;
  103178. } else if (this.isNewInit(videoTrackIds, timescales)) {
  103179. trackId = videoTrackIds[0];
  103180. timescale3 = timescales[trackId];
  103181. } else if (trackId === null || !timescale3) {
  103182. segmentCache.push(segment);
  103183. return null;
  103184. }
  103185. while (segmentCache.length > 0) {
  103186. var cachedSegment = segmentCache.shift();
  103187. this.parse(cachedSegment, videoTrackIds, timescales);
  103188. }
  103189. parsedData = parseEmbeddedCaptions(segment, trackId, timescale3);
  103190. if (parsedData && parsedData.logs) {
  103191. parsedCaptions.logs = parsedCaptions.logs.concat(parsedData.logs);
  103192. }
  103193. if (parsedData === null || !parsedData.seiNals) {
  103194. if (parsedCaptions.logs.length) {
  103195. return {
  103196. logs: parsedCaptions.logs,
  103197. captions: [],
  103198. captionStreams: []
  103199. };
  103200. }
  103201. return null;
  103202. }
  103203. this.pushNals(parsedData.seiNals);
  103204. this.flushStream();
  103205. return parsedCaptions;
  103206. };
  103207. this.pushNals = function(nals) {
  103208. if (!this.isInitialized() || !nals || nals.length === 0) {
  103209. return null;
  103210. }
  103211. nals.forEach(function(nal) {
  103212. captionStream2.push(nal);
  103213. });
  103214. };
  103215. this.flushStream = function() {
  103216. if (!this.isInitialized()) {
  103217. return null;
  103218. }
  103219. if (!parsingPartial) {
  103220. captionStream2.flush();
  103221. } else {
  103222. captionStream2.partialFlush();
  103223. }
  103224. };
  103225. this.clearParsedCaptions = function() {
  103226. parsedCaptions.captions = [];
  103227. parsedCaptions.captionStreams = {};
  103228. parsedCaptions.logs = [];
  103229. };
  103230. this.resetCaptionStream = function() {
  103231. if (!this.isInitialized()) {
  103232. return null;
  103233. }
  103234. captionStream2.reset();
  103235. };
  103236. this.clearAllCaptions = function() {
  103237. this.clearParsedCaptions();
  103238. this.resetCaptionStream();
  103239. };
  103240. this.reset = function() {
  103241. segmentCache = [];
  103242. trackId = null;
  103243. timescale3 = null;
  103244. if (!parsedCaptions) {
  103245. parsedCaptions = {
  103246. captions: [],
  103247. captionStreams: {},
  103248. logs: []
  103249. };
  103250. } else {
  103251. this.clearParsedCaptions();
  103252. }
  103253. this.resetCaptionStream();
  103254. };
  103255. this.reset();
  103256. };
  103257. var captionParser = CaptionParser;
  103258. var toUnsigned = bin.toUnsigned;
  103259. var toHexString = bin.toHexString;
  103260. var getUint642 = numbers2.getUint64;
  103261. var timescale2, startTime, compositionStartTime, getVideoTrackIds, getTracks, getTimescaleFromMediaHeader;
  103262. timescale2 = function timescale3(init) {
  103263. var result = {}, traks = findBox_1(init, ["moov", "trak"]);
  103264. return traks.reduce(function(result2, trak2) {
  103265. var tkhd2, version2, index2, id, mdhd2;
  103266. tkhd2 = findBox_1(trak2, ["tkhd"])[0];
  103267. if (!tkhd2) {
  103268. return null;
  103269. }
  103270. version2 = tkhd2[0];
  103271. index2 = version2 === 0 ? 12 : 20;
  103272. id = toUnsigned(tkhd2[index2] << 24 | tkhd2[index2 + 1] << 16 | tkhd2[index2 + 2] << 8 | tkhd2[index2 + 3]);
  103273. mdhd2 = findBox_1(trak2, ["mdia", "mdhd"])[0];
  103274. if (!mdhd2) {
  103275. return null;
  103276. }
  103277. version2 = mdhd2[0];
  103278. index2 = version2 === 0 ? 12 : 20;
  103279. result2[id] = toUnsigned(mdhd2[index2] << 24 | mdhd2[index2 + 1] << 16 | mdhd2[index2 + 2] << 8 | mdhd2[index2 + 3]);
  103280. return result2;
  103281. }, result);
  103282. };
  103283. startTime = function startTime2(timescale3, fragment) {
  103284. var trafs;
  103285. trafs = findBox_1(fragment, ["moof", "traf"]);
  103286. var lowestTime = trafs.reduce(function(acc, traf2) {
  103287. var tfhd2 = findBox_1(traf2, ["tfhd"])[0];
  103288. var id = toUnsigned(tfhd2[4] << 24 | tfhd2[5] << 16 | tfhd2[6] << 8 | tfhd2[7]);
  103289. var scale = timescale3[id] || 9e4;
  103290. var tfdt2 = findBox_1(traf2, ["tfdt"])[0];
  103291. var dv = new DataView(tfdt2.buffer, tfdt2.byteOffset, tfdt2.byteLength);
  103292. var baseTime;
  103293. if (tfdt2[0] === 1) {
  103294. baseTime = getUint642(tfdt2.subarray(4, 12));
  103295. } else {
  103296. baseTime = dv.getUint32(4);
  103297. }
  103298. var seconds;
  103299. if (typeof baseTime === "bigint") {
  103300. seconds = baseTime / window_12.BigInt(scale);
  103301. } else if (typeof baseTime === "number" && !isNaN(baseTime)) {
  103302. seconds = baseTime / scale;
  103303. }
  103304. if (seconds < Number.MAX_SAFE_INTEGER) {
  103305. seconds = Number(seconds);
  103306. }
  103307. if (seconds < acc) {
  103308. acc = seconds;
  103309. }
  103310. return acc;
  103311. }, Infinity);
  103312. return typeof lowestTime === "bigint" || isFinite(lowestTime) ? lowestTime : 0;
  103313. };
  103314. compositionStartTime = function compositionStartTime2(timescales, fragment) {
  103315. var trafBoxes = findBox_1(fragment, ["moof", "traf"]);
  103316. var baseMediaDecodeTime = 0;
  103317. var compositionTimeOffset = 0;
  103318. var trackId;
  103319. if (trafBoxes && trafBoxes.length) {
  103320. var tfhd2 = findBox_1(trafBoxes[0], ["tfhd"])[0];
  103321. var trun2 = findBox_1(trafBoxes[0], ["trun"])[0];
  103322. var tfdt2 = findBox_1(trafBoxes[0], ["tfdt"])[0];
  103323. if (tfhd2) {
  103324. var parsedTfhd = parseTfhd(tfhd2);
  103325. trackId = parsedTfhd.trackId;
  103326. }
  103327. if (tfdt2) {
  103328. var parsedTfdt = parseTfdt(tfdt2);
  103329. baseMediaDecodeTime = parsedTfdt.baseMediaDecodeTime;
  103330. }
  103331. if (trun2) {
  103332. var parsedTrun = parseTrun(trun2);
  103333. if (parsedTrun.samples && parsedTrun.samples.length) {
  103334. compositionTimeOffset = parsedTrun.samples[0].compositionTimeOffset || 0;
  103335. }
  103336. }
  103337. }
  103338. var timescale3 = timescales[trackId] || 9e4;
  103339. if (typeof baseMediaDecodeTime === "bigint") {
  103340. compositionTimeOffset = window_12.BigInt(compositionTimeOffset);
  103341. timescale3 = window_12.BigInt(timescale3);
  103342. }
  103343. var result = (baseMediaDecodeTime + compositionTimeOffset) / timescale3;
  103344. if (typeof result === "bigint" && result < Number.MAX_SAFE_INTEGER) {
  103345. result = Number(result);
  103346. }
  103347. return result;
  103348. };
  103349. getVideoTrackIds = function getVideoTrackIds2(init) {
  103350. var traks = findBox_1(init, ["moov", "trak"]);
  103351. var videoTrackIds = [];
  103352. traks.forEach(function(trak2) {
  103353. var hdlrs = findBox_1(trak2, ["mdia", "hdlr"]);
  103354. var tkhds = findBox_1(trak2, ["tkhd"]);
  103355. hdlrs.forEach(function(hdlr2, index2) {
  103356. var handlerType = parseType_1(hdlr2.subarray(8, 12));
  103357. var tkhd2 = tkhds[index2];
  103358. var view;
  103359. var version2;
  103360. var trackId;
  103361. if (handlerType === "vide") {
  103362. view = new DataView(tkhd2.buffer, tkhd2.byteOffset, tkhd2.byteLength);
  103363. version2 = view.getUint8(0);
  103364. trackId = version2 === 0 ? view.getUint32(12) : view.getUint32(20);
  103365. videoTrackIds.push(trackId);
  103366. }
  103367. });
  103368. });
  103369. return videoTrackIds;
  103370. };
  103371. getTimescaleFromMediaHeader = function getTimescaleFromMediaHeader2(mdhd2) {
  103372. var version2 = mdhd2[0];
  103373. var index2 = version2 === 0 ? 12 : 20;
  103374. return toUnsigned(mdhd2[index2] << 24 | mdhd2[index2 + 1] << 16 | mdhd2[index2 + 2] << 8 | mdhd2[index2 + 3]);
  103375. };
  103376. getTracks = function getTracks2(init) {
  103377. var traks = findBox_1(init, ["moov", "trak"]);
  103378. var tracks = [];
  103379. traks.forEach(function(trak2) {
  103380. var track = {};
  103381. var tkhd2 = findBox_1(trak2, ["tkhd"])[0];
  103382. var view, tkhdVersion;
  103383. if (tkhd2) {
  103384. view = new DataView(tkhd2.buffer, tkhd2.byteOffset, tkhd2.byteLength);
  103385. tkhdVersion = view.getUint8(0);
  103386. track.id = tkhdVersion === 0 ? view.getUint32(12) : view.getUint32(20);
  103387. }
  103388. var hdlr2 = findBox_1(trak2, ["mdia", "hdlr"])[0];
  103389. if (hdlr2) {
  103390. var type3 = parseType_1(hdlr2.subarray(8, 12));
  103391. if (type3 === "vide") {
  103392. track.type = "video";
  103393. } else if (type3 === "soun") {
  103394. track.type = "audio";
  103395. } else {
  103396. track.type = type3;
  103397. }
  103398. }
  103399. var stsd2 = findBox_1(trak2, ["mdia", "minf", "stbl", "stsd"])[0];
  103400. if (stsd2) {
  103401. var sampleDescriptions = stsd2.subarray(8);
  103402. track.codec = parseType_1(sampleDescriptions.subarray(4, 8));
  103403. var codecBox = findBox_1(sampleDescriptions, [track.codec])[0];
  103404. var codecConfig, codecConfigType;
  103405. if (codecBox) {
  103406. if (/^[asm]vc[1-9]$/i.test(track.codec)) {
  103407. codecConfig = codecBox.subarray(78);
  103408. codecConfigType = parseType_1(codecConfig.subarray(4, 8));
  103409. if (codecConfigType === "avcC" && codecConfig.length > 11) {
  103410. track.codec += ".";
  103411. track.codec += toHexString(codecConfig[9]);
  103412. track.codec += toHexString(codecConfig[10]);
  103413. track.codec += toHexString(codecConfig[11]);
  103414. } else {
  103415. track.codec = "avc1.4d400d";
  103416. }
  103417. } else if (/^mp4[a,v]$/i.test(track.codec)) {
  103418. codecConfig = codecBox.subarray(28);
  103419. codecConfigType = parseType_1(codecConfig.subarray(4, 8));
  103420. if (codecConfigType === "esds" && codecConfig.length > 20 && codecConfig[19] !== 0) {
  103421. track.codec += "." + toHexString(codecConfig[19]);
  103422. track.codec += "." + toHexString(codecConfig[20] >>> 2 & 63).replace(/^0/, "");
  103423. } else {
  103424. track.codec = "mp4a.40.2";
  103425. }
  103426. } else {
  103427. track.codec = track.codec.toLowerCase();
  103428. }
  103429. }
  103430. }
  103431. var mdhd2 = findBox_1(trak2, ["mdia", "mdhd"])[0];
  103432. if (mdhd2) {
  103433. track.timescale = getTimescaleFromMediaHeader(mdhd2);
  103434. }
  103435. tracks.push(track);
  103436. });
  103437. return tracks;
  103438. };
  103439. var probe$2 = {
  103440. findBox: findBox_1,
  103441. parseType: parseType_1,
  103442. timescale: timescale2,
  103443. startTime,
  103444. compositionStartTime,
  103445. videoTrackIds: getVideoTrackIds,
  103446. tracks: getTracks,
  103447. getTimescaleFromMediaHeader
  103448. };
  103449. var parsePid = function parsePid2(packet) {
  103450. var pid = packet[1] & 31;
  103451. pid <<= 8;
  103452. pid |= packet[2];
  103453. return pid;
  103454. };
  103455. var parsePayloadUnitStartIndicator = function parsePayloadUnitStartIndicator2(packet) {
  103456. return !!(packet[1] & 64);
  103457. };
  103458. var parseAdaptionField = function parseAdaptionField2(packet) {
  103459. var offset = 0;
  103460. if ((packet[3] & 48) >>> 4 > 1) {
  103461. offset += packet[4] + 1;
  103462. }
  103463. return offset;
  103464. };
  103465. var parseType = function parseType2(packet, pmtPid) {
  103466. var pid = parsePid(packet);
  103467. if (pid === 0) {
  103468. return "pat";
  103469. } else if (pid === pmtPid) {
  103470. return "pmt";
  103471. } else if (pmtPid) {
  103472. return "pes";
  103473. }
  103474. return null;
  103475. };
  103476. var parsePat = function parsePat2(packet) {
  103477. var pusi = parsePayloadUnitStartIndicator(packet);
  103478. var offset = 4 + parseAdaptionField(packet);
  103479. if (pusi) {
  103480. offset += packet[offset] + 1;
  103481. }
  103482. return (packet[offset + 10] & 31) << 8 | packet[offset + 11];
  103483. };
  103484. var parsePmt = function parsePmt2(packet) {
  103485. var programMapTable = {};
  103486. var pusi = parsePayloadUnitStartIndicator(packet);
  103487. var payloadOffset = 4 + parseAdaptionField(packet);
  103488. if (pusi) {
  103489. payloadOffset += packet[payloadOffset] + 1;
  103490. }
  103491. if (!(packet[payloadOffset + 5] & 1)) {
  103492. return;
  103493. }
  103494. var sectionLength, tableEnd, programInfoLength;
  103495. sectionLength = (packet[payloadOffset + 1] & 15) << 8 | packet[payloadOffset + 2];
  103496. tableEnd = 3 + sectionLength - 4;
  103497. programInfoLength = (packet[payloadOffset + 10] & 15) << 8 | packet[payloadOffset + 11];
  103498. var offset = 12 + programInfoLength;
  103499. while (offset < tableEnd) {
  103500. var i2 = payloadOffset + offset;
  103501. programMapTable[(packet[i2 + 1] & 31) << 8 | packet[i2 + 2]] = packet[i2];
  103502. offset += ((packet[i2 + 3] & 15) << 8 | packet[i2 + 4]) + 5;
  103503. }
  103504. return programMapTable;
  103505. };
  103506. var parsePesType = function parsePesType2(packet, programMapTable) {
  103507. var pid = parsePid(packet);
  103508. var type3 = programMapTable[pid];
  103509. switch (type3) {
  103510. case streamTypes.H264_STREAM_TYPE:
  103511. return "video";
  103512. case streamTypes.ADTS_STREAM_TYPE:
  103513. return "audio";
  103514. case streamTypes.METADATA_STREAM_TYPE:
  103515. return "timed-metadata";
  103516. default:
  103517. return null;
  103518. }
  103519. };
  103520. var parsePesTime = function parsePesTime2(packet) {
  103521. var pusi = parsePayloadUnitStartIndicator(packet);
  103522. if (!pusi) {
  103523. return null;
  103524. }
  103525. var offset = 4 + parseAdaptionField(packet);
  103526. if (offset >= packet.byteLength) {
  103527. return null;
  103528. }
  103529. var pes = null;
  103530. var ptsDtsFlags;
  103531. ptsDtsFlags = packet[offset + 7];
  103532. if (ptsDtsFlags & 192) {
  103533. pes = {};
  103534. pes.pts = (packet[offset + 9] & 14) << 27 | (packet[offset + 10] & 255) << 20 | (packet[offset + 11] & 254) << 12 | (packet[offset + 12] & 255) << 5 | (packet[offset + 13] & 254) >>> 3;
  103535. pes.pts *= 4;
  103536. pes.pts += (packet[offset + 13] & 6) >>> 1;
  103537. pes.dts = pes.pts;
  103538. if (ptsDtsFlags & 64) {
  103539. pes.dts = (packet[offset + 14] & 14) << 27 | (packet[offset + 15] & 255) << 20 | (packet[offset + 16] & 254) << 12 | (packet[offset + 17] & 255) << 5 | (packet[offset + 18] & 254) >>> 3;
  103540. pes.dts *= 4;
  103541. pes.dts += (packet[offset + 18] & 6) >>> 1;
  103542. }
  103543. }
  103544. return pes;
  103545. };
  103546. var parseNalUnitType = function parseNalUnitType2(type3) {
  103547. switch (type3) {
  103548. case 5:
  103549. return "slice_layer_without_partitioning_rbsp_idr";
  103550. case 6:
  103551. return "sei_rbsp";
  103552. case 7:
  103553. return "seq_parameter_set_rbsp";
  103554. case 8:
  103555. return "pic_parameter_set_rbsp";
  103556. case 9:
  103557. return "access_unit_delimiter_rbsp";
  103558. default:
  103559. return null;
  103560. }
  103561. };
  103562. var videoPacketContainsKeyFrame = function videoPacketContainsKeyFrame2(packet) {
  103563. var offset = 4 + parseAdaptionField(packet);
  103564. var frameBuffer = packet.subarray(offset);
  103565. var frameI = 0;
  103566. var frameSyncPoint = 0;
  103567. var foundKeyFrame = false;
  103568. var nalType;
  103569. for (; frameSyncPoint < frameBuffer.byteLength - 3; frameSyncPoint++) {
  103570. if (frameBuffer[frameSyncPoint + 2] === 1) {
  103571. frameI = frameSyncPoint + 5;
  103572. break;
  103573. }
  103574. }
  103575. while (frameI < frameBuffer.byteLength) {
  103576. switch (frameBuffer[frameI]) {
  103577. case 0:
  103578. if (frameBuffer[frameI - 1] !== 0) {
  103579. frameI += 2;
  103580. break;
  103581. } else if (frameBuffer[frameI - 2] !== 0) {
  103582. frameI++;
  103583. break;
  103584. }
  103585. if (frameSyncPoint + 3 !== frameI - 2) {
  103586. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  103587. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  103588. foundKeyFrame = true;
  103589. }
  103590. }
  103591. do {
  103592. frameI++;
  103593. } while (frameBuffer[frameI] !== 1 && frameI < frameBuffer.length);
  103594. frameSyncPoint = frameI - 2;
  103595. frameI += 3;
  103596. break;
  103597. case 1:
  103598. if (frameBuffer[frameI - 1] !== 0 || frameBuffer[frameI - 2] !== 0) {
  103599. frameI += 3;
  103600. break;
  103601. }
  103602. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  103603. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  103604. foundKeyFrame = true;
  103605. }
  103606. frameSyncPoint = frameI - 2;
  103607. frameI += 3;
  103608. break;
  103609. default:
  103610. frameI += 3;
  103611. break;
  103612. }
  103613. }
  103614. frameBuffer = frameBuffer.subarray(frameSyncPoint);
  103615. frameI -= frameSyncPoint;
  103616. frameSyncPoint = 0;
  103617. if (frameBuffer && frameBuffer.byteLength > 3) {
  103618. nalType = parseNalUnitType(frameBuffer[frameSyncPoint + 3] & 31);
  103619. if (nalType === "slice_layer_without_partitioning_rbsp_idr") {
  103620. foundKeyFrame = true;
  103621. }
  103622. }
  103623. return foundKeyFrame;
  103624. };
  103625. var probe$1 = {
  103626. parseType,
  103627. parsePat,
  103628. parsePmt,
  103629. parsePayloadUnitStartIndicator,
  103630. parsePesType,
  103631. parsePesTime,
  103632. videoPacketContainsKeyFrame
  103633. };
  103634. var handleRollover = timestampRolloverStream.handleRollover;
  103635. var probe = {};
  103636. probe.ts = probe$1;
  103637. probe.aac = utils2;
  103638. var ONE_SECOND_IN_TS2 = clock2.ONE_SECOND_IN_TS;
  103639. var MP2T_PACKET_LENGTH = 188, SYNC_BYTE = 71;
  103640. var parsePsi_ = function parsePsi_2(bytes, pmt) {
  103641. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3;
  103642. while (endIndex < bytes.byteLength) {
  103643. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  103644. packet = bytes.subarray(startIndex, endIndex);
  103645. type3 = probe.ts.parseType(packet, pmt.pid);
  103646. switch (type3) {
  103647. case "pat":
  103648. pmt.pid = probe.ts.parsePat(packet);
  103649. break;
  103650. case "pmt":
  103651. var table = probe.ts.parsePmt(packet);
  103652. pmt.table = pmt.table || {};
  103653. Object.keys(table).forEach(function(key) {
  103654. pmt.table[key] = table[key];
  103655. });
  103656. break;
  103657. }
  103658. startIndex += MP2T_PACKET_LENGTH;
  103659. endIndex += MP2T_PACKET_LENGTH;
  103660. continue;
  103661. }
  103662. startIndex++;
  103663. endIndex++;
  103664. }
  103665. };
  103666. var parseAudioPes_ = function parseAudioPes_2(bytes, pmt, result) {
  103667. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3, pesType, pusi, parsed;
  103668. var endLoop = false;
  103669. while (endIndex <= bytes.byteLength) {
  103670. if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {
  103671. packet = bytes.subarray(startIndex, endIndex);
  103672. type3 = probe.ts.parseType(packet, pmt.pid);
  103673. switch (type3) {
  103674. case "pes":
  103675. pesType = probe.ts.parsePesType(packet, pmt.table);
  103676. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  103677. if (pesType === "audio" && pusi) {
  103678. parsed = probe.ts.parsePesTime(packet);
  103679. if (parsed) {
  103680. parsed.type = "audio";
  103681. result.audio.push(parsed);
  103682. endLoop = true;
  103683. }
  103684. }
  103685. break;
  103686. }
  103687. if (endLoop) {
  103688. break;
  103689. }
  103690. startIndex += MP2T_PACKET_LENGTH;
  103691. endIndex += MP2T_PACKET_LENGTH;
  103692. continue;
  103693. }
  103694. startIndex++;
  103695. endIndex++;
  103696. }
  103697. endIndex = bytes.byteLength;
  103698. startIndex = endIndex - MP2T_PACKET_LENGTH;
  103699. endLoop = false;
  103700. while (startIndex >= 0) {
  103701. if (bytes[startIndex] === SYNC_BYTE && (bytes[endIndex] === SYNC_BYTE || endIndex === bytes.byteLength)) {
  103702. packet = bytes.subarray(startIndex, endIndex);
  103703. type3 = probe.ts.parseType(packet, pmt.pid);
  103704. switch (type3) {
  103705. case "pes":
  103706. pesType = probe.ts.parsePesType(packet, pmt.table);
  103707. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  103708. if (pesType === "audio" && pusi) {
  103709. parsed = probe.ts.parsePesTime(packet);
  103710. if (parsed) {
  103711. parsed.type = "audio";
  103712. result.audio.push(parsed);
  103713. endLoop = true;
  103714. }
  103715. }
  103716. break;
  103717. }
  103718. if (endLoop) {
  103719. break;
  103720. }
  103721. startIndex -= MP2T_PACKET_LENGTH;
  103722. endIndex -= MP2T_PACKET_LENGTH;
  103723. continue;
  103724. }
  103725. startIndex--;
  103726. endIndex--;
  103727. }
  103728. };
  103729. var parseVideoPes_ = function parseVideoPes_2(bytes, pmt, result) {
  103730. var startIndex = 0, endIndex = MP2T_PACKET_LENGTH, packet, type3, pesType, pusi, parsed, frame, i2, pes;
  103731. var endLoop = false;
  103732. var currentFrame = {
  103733. data: [],
  103734. size: 0
  103735. };
  103736. while (endIndex < bytes.byteLength) {
  103737. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  103738. packet = bytes.subarray(startIndex, endIndex);
  103739. type3 = probe.ts.parseType(packet, pmt.pid);
  103740. switch (type3) {
  103741. case "pes":
  103742. pesType = probe.ts.parsePesType(packet, pmt.table);
  103743. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  103744. if (pesType === "video") {
  103745. if (pusi && !endLoop) {
  103746. parsed = probe.ts.parsePesTime(packet);
  103747. if (parsed) {
  103748. parsed.type = "video";
  103749. result.video.push(parsed);
  103750. endLoop = true;
  103751. }
  103752. }
  103753. if (!result.firstKeyFrame) {
  103754. if (pusi) {
  103755. if (currentFrame.size !== 0) {
  103756. frame = new Uint8Array(currentFrame.size);
  103757. i2 = 0;
  103758. while (currentFrame.data.length) {
  103759. pes = currentFrame.data.shift();
  103760. frame.set(pes, i2);
  103761. i2 += pes.byteLength;
  103762. }
  103763. if (probe.ts.videoPacketContainsKeyFrame(frame)) {
  103764. var firstKeyFrame = probe.ts.parsePesTime(frame);
  103765. if (firstKeyFrame) {
  103766. result.firstKeyFrame = firstKeyFrame;
  103767. result.firstKeyFrame.type = "video";
  103768. } else {
  103769. console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.");
  103770. }
  103771. }
  103772. currentFrame.size = 0;
  103773. }
  103774. }
  103775. currentFrame.data.push(packet);
  103776. currentFrame.size += packet.byteLength;
  103777. }
  103778. }
  103779. break;
  103780. }
  103781. if (endLoop && result.firstKeyFrame) {
  103782. break;
  103783. }
  103784. startIndex += MP2T_PACKET_LENGTH;
  103785. endIndex += MP2T_PACKET_LENGTH;
  103786. continue;
  103787. }
  103788. startIndex++;
  103789. endIndex++;
  103790. }
  103791. endIndex = bytes.byteLength;
  103792. startIndex = endIndex - MP2T_PACKET_LENGTH;
  103793. endLoop = false;
  103794. while (startIndex >= 0) {
  103795. if (bytes[startIndex] === SYNC_BYTE && bytes[endIndex] === SYNC_BYTE) {
  103796. packet = bytes.subarray(startIndex, endIndex);
  103797. type3 = probe.ts.parseType(packet, pmt.pid);
  103798. switch (type3) {
  103799. case "pes":
  103800. pesType = probe.ts.parsePesType(packet, pmt.table);
  103801. pusi = probe.ts.parsePayloadUnitStartIndicator(packet);
  103802. if (pesType === "video" && pusi) {
  103803. parsed = probe.ts.parsePesTime(packet);
  103804. if (parsed) {
  103805. parsed.type = "video";
  103806. result.video.push(parsed);
  103807. endLoop = true;
  103808. }
  103809. }
  103810. break;
  103811. }
  103812. if (endLoop) {
  103813. break;
  103814. }
  103815. startIndex -= MP2T_PACKET_LENGTH;
  103816. endIndex -= MP2T_PACKET_LENGTH;
  103817. continue;
  103818. }
  103819. startIndex--;
  103820. endIndex--;
  103821. }
  103822. };
  103823. var adjustTimestamp_ = function adjustTimestamp_2(segmentInfo, baseTimestamp) {
  103824. if (segmentInfo.audio && segmentInfo.audio.length) {
  103825. var audioBaseTimestamp = baseTimestamp;
  103826. if (typeof audioBaseTimestamp === "undefined" || isNaN(audioBaseTimestamp)) {
  103827. audioBaseTimestamp = segmentInfo.audio[0].dts;
  103828. }
  103829. segmentInfo.audio.forEach(function(info) {
  103830. info.dts = handleRollover(info.dts, audioBaseTimestamp);
  103831. info.pts = handleRollover(info.pts, audioBaseTimestamp);
  103832. info.dtsTime = info.dts / ONE_SECOND_IN_TS2;
  103833. info.ptsTime = info.pts / ONE_SECOND_IN_TS2;
  103834. });
  103835. }
  103836. if (segmentInfo.video && segmentInfo.video.length) {
  103837. var videoBaseTimestamp = baseTimestamp;
  103838. if (typeof videoBaseTimestamp === "undefined" || isNaN(videoBaseTimestamp)) {
  103839. videoBaseTimestamp = segmentInfo.video[0].dts;
  103840. }
  103841. segmentInfo.video.forEach(function(info) {
  103842. info.dts = handleRollover(info.dts, videoBaseTimestamp);
  103843. info.pts = handleRollover(info.pts, videoBaseTimestamp);
  103844. info.dtsTime = info.dts / ONE_SECOND_IN_TS2;
  103845. info.ptsTime = info.pts / ONE_SECOND_IN_TS2;
  103846. });
  103847. if (segmentInfo.firstKeyFrame) {
  103848. var frame = segmentInfo.firstKeyFrame;
  103849. frame.dts = handleRollover(frame.dts, videoBaseTimestamp);
  103850. frame.pts = handleRollover(frame.pts, videoBaseTimestamp);
  103851. frame.dtsTime = frame.dts / ONE_SECOND_IN_TS2;
  103852. frame.ptsTime = frame.pts / ONE_SECOND_IN_TS2;
  103853. }
  103854. }
  103855. };
  103856. var inspectAac_ = function inspectAac_2(bytes) {
  103857. var endLoop = false, audioCount = 0, sampleRate = null, timestamp = null, frameSize = 0, byteIndex = 0, packet;
  103858. while (bytes.length - byteIndex >= 3) {
  103859. var type3 = probe.aac.parseType(bytes, byteIndex);
  103860. switch (type3) {
  103861. case "timed-metadata":
  103862. if (bytes.length - byteIndex < 10) {
  103863. endLoop = true;
  103864. break;
  103865. }
  103866. frameSize = probe.aac.parseId3TagSize(bytes, byteIndex);
  103867. if (frameSize > bytes.length) {
  103868. endLoop = true;
  103869. break;
  103870. }
  103871. if (timestamp === null) {
  103872. packet = bytes.subarray(byteIndex, byteIndex + frameSize);
  103873. timestamp = probe.aac.parseAacTimestamp(packet);
  103874. }
  103875. byteIndex += frameSize;
  103876. break;
  103877. case "audio":
  103878. if (bytes.length - byteIndex < 7) {
  103879. endLoop = true;
  103880. break;
  103881. }
  103882. frameSize = probe.aac.parseAdtsSize(bytes, byteIndex);
  103883. if (frameSize > bytes.length) {
  103884. endLoop = true;
  103885. break;
  103886. }
  103887. if (sampleRate === null) {
  103888. packet = bytes.subarray(byteIndex, byteIndex + frameSize);
  103889. sampleRate = probe.aac.parseSampleRate(packet);
  103890. }
  103891. audioCount++;
  103892. byteIndex += frameSize;
  103893. break;
  103894. default:
  103895. byteIndex++;
  103896. break;
  103897. }
  103898. if (endLoop) {
  103899. return null;
  103900. }
  103901. }
  103902. if (sampleRate === null || timestamp === null) {
  103903. return null;
  103904. }
  103905. var audioTimescale = ONE_SECOND_IN_TS2 / sampleRate;
  103906. var result = {
  103907. audio: [{
  103908. type: "audio",
  103909. dts: timestamp,
  103910. pts: timestamp
  103911. }, {
  103912. type: "audio",
  103913. dts: timestamp + audioCount * 1024 * audioTimescale,
  103914. pts: timestamp + audioCount * 1024 * audioTimescale
  103915. }]
  103916. };
  103917. return result;
  103918. };
  103919. var inspectTs_ = function inspectTs_2(bytes) {
  103920. var pmt = {
  103921. pid: null,
  103922. table: null
  103923. };
  103924. var result = {};
  103925. parsePsi_(bytes, pmt);
  103926. for (var pid in pmt.table) {
  103927. if (pmt.table.hasOwnProperty(pid)) {
  103928. var type3 = pmt.table[pid];
  103929. switch (type3) {
  103930. case streamTypes.H264_STREAM_TYPE:
  103931. result.video = [];
  103932. parseVideoPes_(bytes, pmt, result);
  103933. if (result.video.length === 0) {
  103934. delete result.video;
  103935. }
  103936. break;
  103937. case streamTypes.ADTS_STREAM_TYPE:
  103938. result.audio = [];
  103939. parseAudioPes_(bytes, pmt, result);
  103940. if (result.audio.length === 0) {
  103941. delete result.audio;
  103942. }
  103943. break;
  103944. }
  103945. }
  103946. }
  103947. return result;
  103948. };
  103949. var inspect = function inspect2(bytes, baseTimestamp) {
  103950. var isAacData = probe.aac.isLikelyAacData(bytes);
  103951. var result;
  103952. if (isAacData) {
  103953. result = inspectAac_(bytes);
  103954. } else {
  103955. result = inspectTs_(bytes);
  103956. }
  103957. if (!result || !result.audio && !result.video) {
  103958. return null;
  103959. }
  103960. adjustTimestamp_(result, baseTimestamp);
  103961. return result;
  103962. };
  103963. var tsInspector = {
  103964. inspect,
  103965. parseAudioPes_
  103966. };
  103967. var wireTransmuxerEvents = function wireTransmuxerEvents2(self2, transmuxer2) {
  103968. transmuxer2.on("data", function(segment) {
  103969. var initArray = segment.initSegment;
  103970. segment.initSegment = {
  103971. data: initArray.buffer,
  103972. byteOffset: initArray.byteOffset,
  103973. byteLength: initArray.byteLength
  103974. };
  103975. var typedArray = segment.data;
  103976. segment.data = typedArray.buffer;
  103977. self2.postMessage({
  103978. action: "data",
  103979. segment,
  103980. byteOffset: typedArray.byteOffset,
  103981. byteLength: typedArray.byteLength
  103982. }, [segment.data]);
  103983. });
  103984. transmuxer2.on("done", function(data) {
  103985. self2.postMessage({
  103986. action: "done"
  103987. });
  103988. });
  103989. transmuxer2.on("gopInfo", function(gopInfo) {
  103990. self2.postMessage({
  103991. action: "gopInfo",
  103992. gopInfo
  103993. });
  103994. });
  103995. transmuxer2.on("videoSegmentTimingInfo", function(timingInfo) {
  103996. var videoSegmentTimingInfo = {
  103997. start: {
  103998. decode: clock2.videoTsToSeconds(timingInfo.start.dts),
  103999. presentation: clock2.videoTsToSeconds(timingInfo.start.pts)
  104000. },
  104001. end: {
  104002. decode: clock2.videoTsToSeconds(timingInfo.end.dts),
  104003. presentation: clock2.videoTsToSeconds(timingInfo.end.pts)
  104004. },
  104005. baseMediaDecodeTime: clock2.videoTsToSeconds(timingInfo.baseMediaDecodeTime)
  104006. };
  104007. if (timingInfo.prependedContentDuration) {
  104008. videoSegmentTimingInfo.prependedContentDuration = clock2.videoTsToSeconds(timingInfo.prependedContentDuration);
  104009. }
  104010. self2.postMessage({
  104011. action: "videoSegmentTimingInfo",
  104012. videoSegmentTimingInfo
  104013. });
  104014. });
  104015. transmuxer2.on("audioSegmentTimingInfo", function(timingInfo) {
  104016. var audioSegmentTimingInfo = {
  104017. start: {
  104018. decode: clock2.videoTsToSeconds(timingInfo.start.dts),
  104019. presentation: clock2.videoTsToSeconds(timingInfo.start.pts)
  104020. },
  104021. end: {
  104022. decode: clock2.videoTsToSeconds(timingInfo.end.dts),
  104023. presentation: clock2.videoTsToSeconds(timingInfo.end.pts)
  104024. },
  104025. baseMediaDecodeTime: clock2.videoTsToSeconds(timingInfo.baseMediaDecodeTime)
  104026. };
  104027. if (timingInfo.prependedContentDuration) {
  104028. audioSegmentTimingInfo.prependedContentDuration = clock2.videoTsToSeconds(timingInfo.prependedContentDuration);
  104029. }
  104030. self2.postMessage({
  104031. action: "audioSegmentTimingInfo",
  104032. audioSegmentTimingInfo
  104033. });
  104034. });
  104035. transmuxer2.on("id3Frame", function(id3Frame) {
  104036. self2.postMessage({
  104037. action: "id3Frame",
  104038. id3Frame
  104039. });
  104040. });
  104041. transmuxer2.on("caption", function(caption) {
  104042. self2.postMessage({
  104043. action: "caption",
  104044. caption
  104045. });
  104046. });
  104047. transmuxer2.on("trackinfo", function(trackInfo) {
  104048. self2.postMessage({
  104049. action: "trackinfo",
  104050. trackInfo
  104051. });
  104052. });
  104053. transmuxer2.on("audioTimingInfo", function(audioTimingInfo) {
  104054. self2.postMessage({
  104055. action: "audioTimingInfo",
  104056. audioTimingInfo: {
  104057. start: clock2.videoTsToSeconds(audioTimingInfo.start),
  104058. end: clock2.videoTsToSeconds(audioTimingInfo.end)
  104059. }
  104060. });
  104061. });
  104062. transmuxer2.on("videoTimingInfo", function(videoTimingInfo) {
  104063. self2.postMessage({
  104064. action: "videoTimingInfo",
  104065. videoTimingInfo: {
  104066. start: clock2.videoTsToSeconds(videoTimingInfo.start),
  104067. end: clock2.videoTsToSeconds(videoTimingInfo.end)
  104068. }
  104069. });
  104070. });
  104071. transmuxer2.on("log", function(log2) {
  104072. self2.postMessage({
  104073. action: "log",
  104074. log: log2
  104075. });
  104076. });
  104077. };
  104078. var MessageHandlers = /* @__PURE__ */ function() {
  104079. function MessageHandlers2(self2, options2) {
  104080. this.options = options2 || {};
  104081. this.self = self2;
  104082. this.init();
  104083. }
  104084. var _proto = MessageHandlers2.prototype;
  104085. _proto.init = function init() {
  104086. if (this.transmuxer) {
  104087. this.transmuxer.dispose();
  104088. }
  104089. this.transmuxer = new transmuxer.Transmuxer(this.options);
  104090. wireTransmuxerEvents(this.self, this.transmuxer);
  104091. };
  104092. _proto.pushMp4Captions = function pushMp4Captions(data) {
  104093. if (!this.captionParser) {
  104094. this.captionParser = new captionParser();
  104095. this.captionParser.init();
  104096. }
  104097. var segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);
  104098. var parsed = this.captionParser.parse(segment, data.trackIds, data.timescales);
  104099. this.self.postMessage({
  104100. action: "mp4Captions",
  104101. captions: parsed && parsed.captions || [],
  104102. logs: parsed && parsed.logs || [],
  104103. data: segment.buffer
  104104. }, [segment.buffer]);
  104105. };
  104106. _proto.probeMp4StartTime = function probeMp4StartTime(_ref) {
  104107. var timescales = _ref.timescales, data = _ref.data;
  104108. var startTime2 = probe$2.startTime(timescales, data);
  104109. this.self.postMessage({
  104110. action: "probeMp4StartTime",
  104111. startTime: startTime2,
  104112. data
  104113. }, [data.buffer]);
  104114. };
  104115. _proto.probeMp4Tracks = function probeMp4Tracks(_ref2) {
  104116. var data = _ref2.data;
  104117. var tracks = probe$2.tracks(data);
  104118. this.self.postMessage({
  104119. action: "probeMp4Tracks",
  104120. tracks,
  104121. data
  104122. }, [data.buffer]);
  104123. };
  104124. _proto.probeTs = function probeTs(_ref3) {
  104125. var data = _ref3.data, baseStartTime = _ref3.baseStartTime;
  104126. var tsStartTime = typeof baseStartTime === "number" && !isNaN(baseStartTime) ? baseStartTime * clock2.ONE_SECOND_IN_TS : void 0;
  104127. var timeInfo = tsInspector.inspect(data, tsStartTime);
  104128. var result = null;
  104129. if (timeInfo) {
  104130. result = {
  104131. hasVideo: timeInfo.video && timeInfo.video.length === 2 || false,
  104132. hasAudio: timeInfo.audio && timeInfo.audio.length === 2 || false
  104133. };
  104134. if (result.hasVideo) {
  104135. result.videoStart = timeInfo.video[0].ptsTime;
  104136. }
  104137. if (result.hasAudio) {
  104138. result.audioStart = timeInfo.audio[0].ptsTime;
  104139. }
  104140. }
  104141. this.self.postMessage({
  104142. action: "probeTs",
  104143. result,
  104144. data
  104145. }, [data.buffer]);
  104146. };
  104147. _proto.clearAllMp4Captions = function clearAllMp4Captions() {
  104148. if (this.captionParser) {
  104149. this.captionParser.clearAllCaptions();
  104150. }
  104151. };
  104152. _proto.clearParsedMp4Captions = function clearParsedMp4Captions() {
  104153. if (this.captionParser) {
  104154. this.captionParser.clearParsedCaptions();
  104155. }
  104156. };
  104157. _proto.push = function push(data) {
  104158. var segment = new Uint8Array(data.data, data.byteOffset, data.byteLength);
  104159. this.transmuxer.push(segment);
  104160. };
  104161. _proto.reset = function reset3() {
  104162. this.transmuxer.reset();
  104163. };
  104164. _proto.setTimestampOffset = function setTimestampOffset(data) {
  104165. var timestampOffset2 = data.timestampOffset || 0;
  104166. this.transmuxer.setBaseMediaDecodeTime(Math.round(clock2.secondsToVideoTs(timestampOffset2)));
  104167. };
  104168. _proto.setAudioAppendStart = function setAudioAppendStart(data) {
  104169. this.transmuxer.setAudioAppendStart(Math.ceil(clock2.secondsToVideoTs(data.appendStart)));
  104170. };
  104171. _proto.setRemux = function setRemux(data) {
  104172. this.transmuxer.setRemux(data.remux);
  104173. };
  104174. _proto.flush = function flush(data) {
  104175. this.transmuxer.flush();
  104176. self.postMessage({
  104177. action: "done",
  104178. type: "transmuxed"
  104179. });
  104180. };
  104181. _proto.endTimeline = function endTimeline3() {
  104182. this.transmuxer.endTimeline();
  104183. self.postMessage({
  104184. action: "endedtimeline",
  104185. type: "transmuxed"
  104186. });
  104187. };
  104188. _proto.alignGopsWith = function alignGopsWith(data) {
  104189. this.transmuxer.alignGopsWith(data.gopsToAlignWith.slice());
  104190. };
  104191. return MessageHandlers2;
  104192. }();
  104193. self.onmessage = function(event2) {
  104194. if (event2.data.action === "init" && event2.data.options) {
  104195. this.messageHandlers = new MessageHandlers(self, event2.data.options);
  104196. return;
  104197. }
  104198. if (!this.messageHandlers) {
  104199. this.messageHandlers = new MessageHandlers(self);
  104200. }
  104201. if (event2.data && event2.data.action && event2.data.action !== "init") {
  104202. if (this.messageHandlers[event2.data.action]) {
  104203. this.messageHandlers[event2.data.action](event2.data);
  104204. }
  104205. }
  104206. };
  104207. }));
  104208. var TransmuxWorker = factory(workerCode$1);
  104209. var handleData_ = function handleData_2(event2, transmuxedData, callback2) {
  104210. var _event$data$segment = event2.data.segment, type2 = _event$data$segment.type, initSegment = _event$data$segment.initSegment, captions = _event$data$segment.captions, captionStreams = _event$data$segment.captionStreams, metadata = _event$data$segment.metadata, videoFrameDtsTime = _event$data$segment.videoFrameDtsTime, videoFramePtsTime = _event$data$segment.videoFramePtsTime;
  104211. transmuxedData.buffer.push({
  104212. captions,
  104213. captionStreams,
  104214. metadata
  104215. });
  104216. var boxes = event2.data.segment.boxes || {
  104217. data: event2.data.segment.data
  104218. };
  104219. var result = {
  104220. type: type2,
  104221. data: new Uint8Array(boxes.data, boxes.data.byteOffset, boxes.data.byteLength),
  104222. initSegment: new Uint8Array(initSegment.data, initSegment.byteOffset, initSegment.byteLength)
  104223. };
  104224. if (typeof videoFrameDtsTime !== "undefined") {
  104225. result.videoFrameDtsTime = videoFrameDtsTime;
  104226. }
  104227. if (typeof videoFramePtsTime !== "undefined") {
  104228. result.videoFramePtsTime = videoFramePtsTime;
  104229. }
  104230. callback2(result);
  104231. };
  104232. var handleDone_ = function handleDone_2(_ref) {
  104233. var transmuxedData = _ref.transmuxedData, callback2 = _ref.callback;
  104234. transmuxedData.buffer = [];
  104235. callback2(transmuxedData);
  104236. };
  104237. var handleGopInfo_ = function handleGopInfo_2(event2, transmuxedData) {
  104238. transmuxedData.gopInfo = event2.data.gopInfo;
  104239. };
  104240. var processTransmux = function processTransmux2(options2) {
  104241. var transmuxer = options2.transmuxer, bytes = options2.bytes, audioAppendStart = options2.audioAppendStart, gopsToAlignWith = options2.gopsToAlignWith, remux = options2.remux, onData = options2.onData, onTrackInfo = options2.onTrackInfo, onAudioTimingInfo = options2.onAudioTimingInfo, onVideoTimingInfo = options2.onVideoTimingInfo, onVideoSegmentTimingInfo = options2.onVideoSegmentTimingInfo, onAudioSegmentTimingInfo = options2.onAudioSegmentTimingInfo, onId3 = options2.onId3, onCaptions = options2.onCaptions, onDone = options2.onDone, onEndedTimeline = options2.onEndedTimeline, onTransmuxerLog = options2.onTransmuxerLog, isEndOfTimeline = options2.isEndOfTimeline;
  104242. var transmuxedData = {
  104243. buffer: []
  104244. };
  104245. var waitForEndedTimelineEvent = isEndOfTimeline;
  104246. var handleMessage = function handleMessage2(event2) {
  104247. if (transmuxer.currentTransmux !== options2) {
  104248. return;
  104249. }
  104250. if (event2.data.action === "data") {
  104251. handleData_(event2, transmuxedData, onData);
  104252. }
  104253. if (event2.data.action === "trackinfo") {
  104254. onTrackInfo(event2.data.trackInfo);
  104255. }
  104256. if (event2.data.action === "gopInfo") {
  104257. handleGopInfo_(event2, transmuxedData);
  104258. }
  104259. if (event2.data.action === "audioTimingInfo") {
  104260. onAudioTimingInfo(event2.data.audioTimingInfo);
  104261. }
  104262. if (event2.data.action === "videoTimingInfo") {
  104263. onVideoTimingInfo(event2.data.videoTimingInfo);
  104264. }
  104265. if (event2.data.action === "videoSegmentTimingInfo") {
  104266. onVideoSegmentTimingInfo(event2.data.videoSegmentTimingInfo);
  104267. }
  104268. if (event2.data.action === "audioSegmentTimingInfo") {
  104269. onAudioSegmentTimingInfo(event2.data.audioSegmentTimingInfo);
  104270. }
  104271. if (event2.data.action === "id3Frame") {
  104272. onId3([event2.data.id3Frame], event2.data.id3Frame.dispatchType);
  104273. }
  104274. if (event2.data.action === "caption") {
  104275. onCaptions(event2.data.caption);
  104276. }
  104277. if (event2.data.action === "endedtimeline") {
  104278. waitForEndedTimelineEvent = false;
  104279. onEndedTimeline();
  104280. }
  104281. if (event2.data.action === "log") {
  104282. onTransmuxerLog(event2.data.log);
  104283. }
  104284. if (event2.data.type !== "transmuxed") {
  104285. return;
  104286. }
  104287. if (waitForEndedTimelineEvent) {
  104288. return;
  104289. }
  104290. transmuxer.onmessage = null;
  104291. handleDone_({
  104292. transmuxedData,
  104293. callback: onDone
  104294. });
  104295. dequeue(transmuxer);
  104296. };
  104297. transmuxer.onmessage = handleMessage;
  104298. if (audioAppendStart) {
  104299. transmuxer.postMessage({
  104300. action: "setAudioAppendStart",
  104301. appendStart: audioAppendStart
  104302. });
  104303. }
  104304. if (Array.isArray(gopsToAlignWith)) {
  104305. transmuxer.postMessage({
  104306. action: "alignGopsWith",
  104307. gopsToAlignWith
  104308. });
  104309. }
  104310. if (typeof remux !== "undefined") {
  104311. transmuxer.postMessage({
  104312. action: "setRemux",
  104313. remux
  104314. });
  104315. }
  104316. if (bytes.byteLength) {
  104317. var buffer = bytes instanceof ArrayBuffer ? bytes : bytes.buffer;
  104318. var byteOffset = bytes instanceof ArrayBuffer ? 0 : bytes.byteOffset;
  104319. transmuxer.postMessage({
  104320. action: "push",
  104321. data: buffer,
  104322. byteOffset,
  104323. byteLength: bytes.byteLength
  104324. }, [buffer]);
  104325. }
  104326. if (isEndOfTimeline) {
  104327. transmuxer.postMessage({
  104328. action: "endTimeline"
  104329. });
  104330. }
  104331. transmuxer.postMessage({
  104332. action: "flush"
  104333. });
  104334. };
  104335. var dequeue = function dequeue2(transmuxer) {
  104336. transmuxer.currentTransmux = null;
  104337. if (transmuxer.transmuxQueue.length) {
  104338. transmuxer.currentTransmux = transmuxer.transmuxQueue.shift();
  104339. if (typeof transmuxer.currentTransmux === "function") {
  104340. transmuxer.currentTransmux();
  104341. } else {
  104342. processTransmux(transmuxer.currentTransmux);
  104343. }
  104344. }
  104345. };
  104346. var processAction = function processAction2(transmuxer, action) {
  104347. transmuxer.postMessage({
  104348. action
  104349. });
  104350. dequeue(transmuxer);
  104351. };
  104352. var enqueueAction = function enqueueAction2(action, transmuxer) {
  104353. if (!transmuxer.currentTransmux) {
  104354. transmuxer.currentTransmux = action;
  104355. processAction(transmuxer, action);
  104356. return;
  104357. }
  104358. transmuxer.transmuxQueue.push(processAction.bind(null, transmuxer, action));
  104359. };
  104360. var reset = function reset2(transmuxer) {
  104361. enqueueAction("reset", transmuxer);
  104362. };
  104363. var endTimeline = function endTimeline2(transmuxer) {
  104364. enqueueAction("endTimeline", transmuxer);
  104365. };
  104366. var transmux = function transmux2(options2) {
  104367. if (!options2.transmuxer.currentTransmux) {
  104368. options2.transmuxer.currentTransmux = options2;
  104369. processTransmux(options2);
  104370. return;
  104371. }
  104372. options2.transmuxer.transmuxQueue.push(options2);
  104373. };
  104374. var createTransmuxer = function createTransmuxer2(options2) {
  104375. var transmuxer = new TransmuxWorker();
  104376. transmuxer.currentTransmux = null;
  104377. transmuxer.transmuxQueue = [];
  104378. var term = transmuxer.terminate;
  104379. transmuxer.terminate = function() {
  104380. transmuxer.currentTransmux = null;
  104381. transmuxer.transmuxQueue.length = 0;
  104382. return term.call(transmuxer);
  104383. };
  104384. transmuxer.postMessage({
  104385. action: "init",
  104386. options: options2
  104387. });
  104388. return transmuxer;
  104389. };
  104390. var segmentTransmuxer = {
  104391. reset,
  104392. endTimeline,
  104393. transmux,
  104394. createTransmuxer
  104395. };
  104396. var workerCallback = function workerCallback2(options2) {
  104397. var transmuxer = options2.transmuxer;
  104398. var endAction = options2.endAction || options2.action;
  104399. var callback2 = options2.callback;
  104400. var message = _extends$2({}, options2, {
  104401. endAction: null,
  104402. transmuxer: null,
  104403. callback: null
  104404. });
  104405. var listenForEndEvent = function listenForEndEvent2(event2) {
  104406. if (event2.data.action !== endAction) {
  104407. return;
  104408. }
  104409. transmuxer.removeEventListener("message", listenForEndEvent2);
  104410. if (event2.data.data) {
  104411. event2.data.data = new Uint8Array(event2.data.data, options2.byteOffset || 0, options2.byteLength || event2.data.data.byteLength);
  104412. if (options2.data) {
  104413. options2.data = event2.data.data;
  104414. }
  104415. }
  104416. callback2(event2.data);
  104417. };
  104418. transmuxer.addEventListener("message", listenForEndEvent);
  104419. if (options2.data) {
  104420. var isArrayBuffer = options2.data instanceof ArrayBuffer;
  104421. message.byteOffset = isArrayBuffer ? 0 : options2.data.byteOffset;
  104422. message.byteLength = options2.data.byteLength;
  104423. var transfers = [isArrayBuffer ? options2.data : options2.data.buffer];
  104424. transmuxer.postMessage(message, transfers);
  104425. } else {
  104426. transmuxer.postMessage(message);
  104427. }
  104428. };
  104429. var REQUEST_ERRORS = {
  104430. FAILURE: 2,
  104431. TIMEOUT: -101,
  104432. ABORTED: -102
  104433. };
  104434. var abortAll = function abortAll2(activeXhrs) {
  104435. activeXhrs.forEach(function(xhr) {
  104436. xhr.abort();
  104437. });
  104438. };
  104439. var getRequestStats = function getRequestStats2(request) {
  104440. return {
  104441. bandwidth: request.bandwidth,
  104442. bytesReceived: request.bytesReceived || 0,
  104443. roundTripTime: request.roundTripTime || 0
  104444. };
  104445. };
  104446. var getProgressStats = function getProgressStats2(progressEvent) {
  104447. var request = progressEvent.target;
  104448. var roundTripTime = Date.now() - request.requestTime;
  104449. var stats = {
  104450. bandwidth: Infinity,
  104451. bytesReceived: 0,
  104452. roundTripTime: roundTripTime || 0
  104453. };
  104454. stats.bytesReceived = progressEvent.loaded;
  104455. stats.bandwidth = Math.floor(stats.bytesReceived / stats.roundTripTime * 8 * 1e3);
  104456. return stats;
  104457. };
  104458. var handleErrors = function handleErrors2(error, request) {
  104459. if (request.timedout) {
  104460. return {
  104461. status: request.status,
  104462. message: "HLS request timed-out at URL: " + request.uri,
  104463. code: REQUEST_ERRORS.TIMEOUT,
  104464. xhr: request
  104465. };
  104466. }
  104467. if (request.aborted) {
  104468. return {
  104469. status: request.status,
  104470. message: "HLS request aborted at URL: " + request.uri,
  104471. code: REQUEST_ERRORS.ABORTED,
  104472. xhr: request
  104473. };
  104474. }
  104475. if (error) {
  104476. return {
  104477. status: request.status,
  104478. message: "HLS request errored at URL: " + request.uri,
  104479. code: REQUEST_ERRORS.FAILURE,
  104480. xhr: request
  104481. };
  104482. }
  104483. if (request.responseType === "arraybuffer" && request.response.byteLength === 0) {
  104484. return {
  104485. status: request.status,
  104486. message: "Empty HLS response at URL: " + request.uri,
  104487. code: REQUEST_ERRORS.FAILURE,
  104488. xhr: request
  104489. };
  104490. }
  104491. return null;
  104492. };
  104493. var handleKeyResponse = function handleKeyResponse2(segment, objects, finishProcessingFn) {
  104494. return function(error, request) {
  104495. var response = request.response;
  104496. var errorObj = handleErrors(error, request);
  104497. if (errorObj) {
  104498. return finishProcessingFn(errorObj, segment);
  104499. }
  104500. if (response.byteLength !== 16) {
  104501. return finishProcessingFn({
  104502. status: request.status,
  104503. message: "Invalid HLS key at URL: " + request.uri,
  104504. code: REQUEST_ERRORS.FAILURE,
  104505. xhr: request
  104506. }, segment);
  104507. }
  104508. var view = new DataView(response);
  104509. var bytes = new Uint32Array([view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12)]);
  104510. for (var i2 = 0; i2 < objects.length; i2++) {
  104511. objects[i2].bytes = bytes;
  104512. }
  104513. return finishProcessingFn(null, segment);
  104514. };
  104515. };
  104516. var parseInitSegment = function parseInitSegment2(segment, _callback) {
  104517. var type2 = detectContainerForBytes2(segment.map.bytes);
  104518. if (type2 !== "mp4") {
  104519. var uri = segment.map.resolvedUri || segment.map.uri;
  104520. return _callback({
  104521. internal: true,
  104522. message: "Found unsupported " + (type2 || "unknown") + " container for initialization segment at URL: " + uri,
  104523. code: REQUEST_ERRORS.FAILURE
  104524. });
  104525. }
  104526. workerCallback({
  104527. action: "probeMp4Tracks",
  104528. data: segment.map.bytes,
  104529. transmuxer: segment.transmuxer,
  104530. callback: function callback2(_ref) {
  104531. var tracks = _ref.tracks, data = _ref.data;
  104532. segment.map.bytes = data;
  104533. tracks.forEach(function(track) {
  104534. segment.map.tracks = segment.map.tracks || {};
  104535. if (segment.map.tracks[track.type]) {
  104536. return;
  104537. }
  104538. segment.map.tracks[track.type] = track;
  104539. if (typeof track.id === "number" && track.timescale) {
  104540. segment.map.timescales = segment.map.timescales || {};
  104541. segment.map.timescales[track.id] = track.timescale;
  104542. }
  104543. });
  104544. return _callback(null);
  104545. }
  104546. });
  104547. };
  104548. var handleInitSegmentResponse = function handleInitSegmentResponse2(_ref2) {
  104549. var segment = _ref2.segment, finishProcessingFn = _ref2.finishProcessingFn;
  104550. return function(error, request) {
  104551. var errorObj = handleErrors(error, request);
  104552. if (errorObj) {
  104553. return finishProcessingFn(errorObj, segment);
  104554. }
  104555. var bytes = new Uint8Array(request.response);
  104556. if (segment.map.key) {
  104557. segment.map.encryptedBytes = bytes;
  104558. return finishProcessingFn(null, segment);
  104559. }
  104560. segment.map.bytes = bytes;
  104561. parseInitSegment(segment, function(parseError) {
  104562. if (parseError) {
  104563. parseError.xhr = request;
  104564. parseError.status = request.status;
  104565. return finishProcessingFn(parseError, segment);
  104566. }
  104567. finishProcessingFn(null, segment);
  104568. });
  104569. };
  104570. };
  104571. var handleSegmentResponse = function handleSegmentResponse2(_ref3) {
  104572. var segment = _ref3.segment, finishProcessingFn = _ref3.finishProcessingFn, responseType = _ref3.responseType;
  104573. return function(error, request) {
  104574. var errorObj = handleErrors(error, request);
  104575. if (errorObj) {
  104576. return finishProcessingFn(errorObj, segment);
  104577. }
  104578. var newBytes = responseType === "arraybuffer" || !request.responseText ? request.response : stringToArrayBuffer(request.responseText.substring(segment.lastReachedChar || 0));
  104579. segment.stats = getRequestStats(request);
  104580. if (segment.key) {
  104581. segment.encryptedBytes = new Uint8Array(newBytes);
  104582. } else {
  104583. segment.bytes = new Uint8Array(newBytes);
  104584. }
  104585. return finishProcessingFn(null, segment);
  104586. };
  104587. };
  104588. var transmuxAndNotify = function transmuxAndNotify2(_ref4) {
  104589. var segment = _ref4.segment, bytes = _ref4.bytes, trackInfoFn = _ref4.trackInfoFn, timingInfoFn = _ref4.timingInfoFn, videoSegmentTimingInfoFn = _ref4.videoSegmentTimingInfoFn, audioSegmentTimingInfoFn = _ref4.audioSegmentTimingInfoFn, id3Fn = _ref4.id3Fn, captionsFn = _ref4.captionsFn, isEndOfTimeline = _ref4.isEndOfTimeline, endedTimelineFn = _ref4.endedTimelineFn, dataFn = _ref4.dataFn, doneFn = _ref4.doneFn, onTransmuxerLog = _ref4.onTransmuxerLog;
  104590. var fmp4Tracks = segment.map && segment.map.tracks || {};
  104591. var isMuxed3 = Boolean(fmp4Tracks.audio && fmp4Tracks.video);
  104592. var audioStartFn = timingInfoFn.bind(null, segment, "audio", "start");
  104593. var audioEndFn = timingInfoFn.bind(null, segment, "audio", "end");
  104594. var videoStartFn = timingInfoFn.bind(null, segment, "video", "start");
  104595. var videoEndFn = timingInfoFn.bind(null, segment, "video", "end");
  104596. var finish = function finish2() {
  104597. return transmux({
  104598. bytes,
  104599. transmuxer: segment.transmuxer,
  104600. audioAppendStart: segment.audioAppendStart,
  104601. gopsToAlignWith: segment.gopsToAlignWith,
  104602. remux: isMuxed3,
  104603. onData: function onData(result) {
  104604. result.type = result.type === "combined" ? "video" : result.type;
  104605. dataFn(segment, result);
  104606. },
  104607. onTrackInfo: function onTrackInfo(trackInfo) {
  104608. if (trackInfoFn) {
  104609. if (isMuxed3) {
  104610. trackInfo.isMuxed = true;
  104611. }
  104612. trackInfoFn(segment, trackInfo);
  104613. }
  104614. },
  104615. onAudioTimingInfo: function onAudioTimingInfo(audioTimingInfo) {
  104616. if (audioStartFn && typeof audioTimingInfo.start !== "undefined") {
  104617. audioStartFn(audioTimingInfo.start);
  104618. audioStartFn = null;
  104619. }
  104620. if (audioEndFn && typeof audioTimingInfo.end !== "undefined") {
  104621. audioEndFn(audioTimingInfo.end);
  104622. }
  104623. },
  104624. onVideoTimingInfo: function onVideoTimingInfo(videoTimingInfo) {
  104625. if (videoStartFn && typeof videoTimingInfo.start !== "undefined") {
  104626. videoStartFn(videoTimingInfo.start);
  104627. videoStartFn = null;
  104628. }
  104629. if (videoEndFn && typeof videoTimingInfo.end !== "undefined") {
  104630. videoEndFn(videoTimingInfo.end);
  104631. }
  104632. },
  104633. onVideoSegmentTimingInfo: function onVideoSegmentTimingInfo(videoSegmentTimingInfo) {
  104634. videoSegmentTimingInfoFn(videoSegmentTimingInfo);
  104635. },
  104636. onAudioSegmentTimingInfo: function onAudioSegmentTimingInfo(audioSegmentTimingInfo) {
  104637. audioSegmentTimingInfoFn(audioSegmentTimingInfo);
  104638. },
  104639. onId3: function onId3(id3Frames, dispatchType) {
  104640. id3Fn(segment, id3Frames, dispatchType);
  104641. },
  104642. onCaptions: function onCaptions(captions) {
  104643. captionsFn(segment, [captions]);
  104644. },
  104645. isEndOfTimeline,
  104646. onEndedTimeline: function onEndedTimeline() {
  104647. endedTimelineFn();
  104648. },
  104649. onTransmuxerLog,
  104650. onDone: function onDone(result) {
  104651. if (!doneFn) {
  104652. return;
  104653. }
  104654. result.type = result.type === "combined" ? "video" : result.type;
  104655. doneFn(null, segment, result);
  104656. }
  104657. });
  104658. };
  104659. workerCallback({
  104660. action: "probeTs",
  104661. transmuxer: segment.transmuxer,
  104662. data: bytes,
  104663. baseStartTime: segment.baseStartTime,
  104664. callback: function callback2(data) {
  104665. segment.bytes = bytes = data.data;
  104666. var probeResult = data.result;
  104667. if (probeResult) {
  104668. trackInfoFn(segment, {
  104669. hasAudio: probeResult.hasAudio,
  104670. hasVideo: probeResult.hasVideo,
  104671. isMuxed: isMuxed3
  104672. });
  104673. trackInfoFn = null;
  104674. if (probeResult.hasAudio && !isMuxed3) {
  104675. audioStartFn(probeResult.audioStart);
  104676. }
  104677. if (probeResult.hasVideo) {
  104678. videoStartFn(probeResult.videoStart);
  104679. }
  104680. audioStartFn = null;
  104681. videoStartFn = null;
  104682. }
  104683. finish();
  104684. }
  104685. });
  104686. };
  104687. var handleSegmentBytes = function handleSegmentBytes2(_ref5) {
  104688. var segment = _ref5.segment, bytes = _ref5.bytes, trackInfoFn = _ref5.trackInfoFn, timingInfoFn = _ref5.timingInfoFn, videoSegmentTimingInfoFn = _ref5.videoSegmentTimingInfoFn, audioSegmentTimingInfoFn = _ref5.audioSegmentTimingInfoFn, id3Fn = _ref5.id3Fn, captionsFn = _ref5.captionsFn, isEndOfTimeline = _ref5.isEndOfTimeline, endedTimelineFn = _ref5.endedTimelineFn, dataFn = _ref5.dataFn, doneFn = _ref5.doneFn, onTransmuxerLog = _ref5.onTransmuxerLog;
  104689. var bytesAsUint8Array = new Uint8Array(bytes);
  104690. if (isLikelyFmp4MediaSegment2(bytesAsUint8Array)) {
  104691. segment.isFmp4 = true;
  104692. var tracks = segment.map.tracks;
  104693. var trackInfo = {
  104694. isFmp4: true,
  104695. hasVideo: !!tracks.video,
  104696. hasAudio: !!tracks.audio
  104697. };
  104698. if (tracks.audio && tracks.audio.codec && tracks.audio.codec !== "enca") {
  104699. trackInfo.audioCodec = tracks.audio.codec;
  104700. }
  104701. if (tracks.video && tracks.video.codec && tracks.video.codec !== "encv") {
  104702. trackInfo.videoCodec = tracks.video.codec;
  104703. }
  104704. if (tracks.video && tracks.audio) {
  104705. trackInfo.isMuxed = true;
  104706. }
  104707. trackInfoFn(segment, trackInfo);
  104708. var finishLoading = function finishLoading2(captions) {
  104709. dataFn(segment, {
  104710. data: bytesAsUint8Array,
  104711. type: trackInfo.hasAudio && !trackInfo.isMuxed ? "audio" : "video"
  104712. });
  104713. if (captions && captions.length) {
  104714. captionsFn(segment, captions);
  104715. }
  104716. doneFn(null, segment, {});
  104717. };
  104718. workerCallback({
  104719. action: "probeMp4StartTime",
  104720. timescales: segment.map.timescales,
  104721. data: bytesAsUint8Array,
  104722. transmuxer: segment.transmuxer,
  104723. callback: function callback2(_ref6) {
  104724. var data = _ref6.data, startTime = _ref6.startTime;
  104725. bytes = data.buffer;
  104726. segment.bytes = bytesAsUint8Array = data;
  104727. if (trackInfo.hasAudio && !trackInfo.isMuxed) {
  104728. timingInfoFn(segment, "audio", "start", startTime);
  104729. }
  104730. if (trackInfo.hasVideo) {
  104731. timingInfoFn(segment, "video", "start", startTime);
  104732. }
  104733. if (!tracks.video || !data.byteLength || !segment.transmuxer) {
  104734. finishLoading();
  104735. return;
  104736. }
  104737. workerCallback({
  104738. action: "pushMp4Captions",
  104739. endAction: "mp4Captions",
  104740. transmuxer: segment.transmuxer,
  104741. data: bytesAsUint8Array,
  104742. timescales: segment.map.timescales,
  104743. trackIds: [tracks.video.id],
  104744. callback: function callback3(message) {
  104745. bytes = message.data.buffer;
  104746. segment.bytes = bytesAsUint8Array = message.data;
  104747. message.logs.forEach(function(log2) {
  104748. onTransmuxerLog(videojs.mergeOptions(log2, {
  104749. stream: "mp4CaptionParser"
  104750. }));
  104751. });
  104752. finishLoading(message.captions);
  104753. }
  104754. });
  104755. }
  104756. });
  104757. return;
  104758. }
  104759. if (!segment.transmuxer) {
  104760. doneFn(null, segment, {});
  104761. return;
  104762. }
  104763. if (typeof segment.container === "undefined") {
  104764. segment.container = detectContainerForBytes2(bytesAsUint8Array);
  104765. }
  104766. if (segment.container !== "ts" && segment.container !== "aac") {
  104767. trackInfoFn(segment, {
  104768. hasAudio: false,
  104769. hasVideo: false
  104770. });
  104771. doneFn(null, segment, {});
  104772. return;
  104773. }
  104774. transmuxAndNotify({
  104775. segment,
  104776. bytes,
  104777. trackInfoFn,
  104778. timingInfoFn,
  104779. videoSegmentTimingInfoFn,
  104780. audioSegmentTimingInfoFn,
  104781. id3Fn,
  104782. captionsFn,
  104783. isEndOfTimeline,
  104784. endedTimelineFn,
  104785. dataFn,
  104786. doneFn,
  104787. onTransmuxerLog
  104788. });
  104789. };
  104790. var decrypt = function decrypt2(_ref7, callback2) {
  104791. var id = _ref7.id, key = _ref7.key, encryptedBytes = _ref7.encryptedBytes, decryptionWorker = _ref7.decryptionWorker;
  104792. var decryptionHandler = function decryptionHandler2(event2) {
  104793. if (event2.data.source === id) {
  104794. decryptionWorker.removeEventListener("message", decryptionHandler2);
  104795. var decrypted = event2.data.decrypted;
  104796. callback2(new Uint8Array(decrypted.bytes, decrypted.byteOffset, decrypted.byteLength));
  104797. }
  104798. };
  104799. decryptionWorker.addEventListener("message", decryptionHandler);
  104800. var keyBytes;
  104801. if (key.bytes.slice) {
  104802. keyBytes = key.bytes.slice();
  104803. } else {
  104804. keyBytes = new Uint32Array(Array.prototype.slice.call(key.bytes));
  104805. }
  104806. decryptionWorker.postMessage(createTransferableMessage({
  104807. source: id,
  104808. encrypted: encryptedBytes,
  104809. key: keyBytes,
  104810. iv: key.iv
  104811. }), [encryptedBytes.buffer, keyBytes.buffer]);
  104812. };
  104813. var decryptSegment = function decryptSegment2(_ref8) {
  104814. var decryptionWorker = _ref8.decryptionWorker, segment = _ref8.segment, trackInfoFn = _ref8.trackInfoFn, timingInfoFn = _ref8.timingInfoFn, videoSegmentTimingInfoFn = _ref8.videoSegmentTimingInfoFn, audioSegmentTimingInfoFn = _ref8.audioSegmentTimingInfoFn, id3Fn = _ref8.id3Fn, captionsFn = _ref8.captionsFn, isEndOfTimeline = _ref8.isEndOfTimeline, endedTimelineFn = _ref8.endedTimelineFn, dataFn = _ref8.dataFn, doneFn = _ref8.doneFn, onTransmuxerLog = _ref8.onTransmuxerLog;
  104815. decrypt({
  104816. id: segment.requestId,
  104817. key: segment.key,
  104818. encryptedBytes: segment.encryptedBytes,
  104819. decryptionWorker
  104820. }, function(decryptedBytes) {
  104821. segment.bytes = decryptedBytes;
  104822. handleSegmentBytes({
  104823. segment,
  104824. bytes: segment.bytes,
  104825. trackInfoFn,
  104826. timingInfoFn,
  104827. videoSegmentTimingInfoFn,
  104828. audioSegmentTimingInfoFn,
  104829. id3Fn,
  104830. captionsFn,
  104831. isEndOfTimeline,
  104832. endedTimelineFn,
  104833. dataFn,
  104834. doneFn,
  104835. onTransmuxerLog
  104836. });
  104837. });
  104838. };
  104839. var waitForCompletion = function waitForCompletion2(_ref9) {
  104840. var activeXhrs = _ref9.activeXhrs, decryptionWorker = _ref9.decryptionWorker, trackInfoFn = _ref9.trackInfoFn, timingInfoFn = _ref9.timingInfoFn, videoSegmentTimingInfoFn = _ref9.videoSegmentTimingInfoFn, audioSegmentTimingInfoFn = _ref9.audioSegmentTimingInfoFn, id3Fn = _ref9.id3Fn, captionsFn = _ref9.captionsFn, isEndOfTimeline = _ref9.isEndOfTimeline, endedTimelineFn = _ref9.endedTimelineFn, dataFn = _ref9.dataFn, doneFn = _ref9.doneFn, onTransmuxerLog = _ref9.onTransmuxerLog;
  104841. var count = 0;
  104842. var didError = false;
  104843. return function(error, segment) {
  104844. if (didError) {
  104845. return;
  104846. }
  104847. if (error) {
  104848. didError = true;
  104849. abortAll(activeXhrs);
  104850. return doneFn(error, segment);
  104851. }
  104852. count += 1;
  104853. if (count === activeXhrs.length) {
  104854. var segmentFinish = function segmentFinish2() {
  104855. if (segment.encryptedBytes) {
  104856. return decryptSegment({
  104857. decryptionWorker,
  104858. segment,
  104859. trackInfoFn,
  104860. timingInfoFn,
  104861. videoSegmentTimingInfoFn,
  104862. audioSegmentTimingInfoFn,
  104863. id3Fn,
  104864. captionsFn,
  104865. isEndOfTimeline,
  104866. endedTimelineFn,
  104867. dataFn,
  104868. doneFn,
  104869. onTransmuxerLog
  104870. });
  104871. }
  104872. handleSegmentBytes({
  104873. segment,
  104874. bytes: segment.bytes,
  104875. trackInfoFn,
  104876. timingInfoFn,
  104877. videoSegmentTimingInfoFn,
  104878. audioSegmentTimingInfoFn,
  104879. id3Fn,
  104880. captionsFn,
  104881. isEndOfTimeline,
  104882. endedTimelineFn,
  104883. dataFn,
  104884. doneFn,
  104885. onTransmuxerLog
  104886. });
  104887. };
  104888. segment.endOfAllRequests = Date.now();
  104889. if (segment.map && segment.map.encryptedBytes && !segment.map.bytes) {
  104890. return decrypt({
  104891. decryptionWorker,
  104892. id: segment.requestId + "-init",
  104893. encryptedBytes: segment.map.encryptedBytes,
  104894. key: segment.map.key
  104895. }, function(decryptedBytes) {
  104896. segment.map.bytes = decryptedBytes;
  104897. parseInitSegment(segment, function(parseError) {
  104898. if (parseError) {
  104899. abortAll(activeXhrs);
  104900. return doneFn(parseError, segment);
  104901. }
  104902. segmentFinish();
  104903. });
  104904. });
  104905. }
  104906. segmentFinish();
  104907. }
  104908. };
  104909. };
  104910. var handleLoadEnd = function handleLoadEnd2(_ref10) {
  104911. var loadendState = _ref10.loadendState, abortFn = _ref10.abortFn;
  104912. return function(event2) {
  104913. var request = event2.target;
  104914. if (request.aborted && abortFn && !loadendState.calledAbortFn) {
  104915. abortFn();
  104916. loadendState.calledAbortFn = true;
  104917. }
  104918. };
  104919. };
  104920. var handleProgress = function handleProgress2(_ref11) {
  104921. var segment = _ref11.segment, progressFn = _ref11.progressFn;
  104922. _ref11.trackInfoFn;
  104923. _ref11.timingInfoFn;
  104924. _ref11.videoSegmentTimingInfoFn;
  104925. _ref11.audioSegmentTimingInfoFn;
  104926. _ref11.id3Fn;
  104927. _ref11.captionsFn;
  104928. _ref11.isEndOfTimeline;
  104929. _ref11.endedTimelineFn;
  104930. _ref11.dataFn;
  104931. return function(event2) {
  104932. var request = event2.target;
  104933. if (request.aborted) {
  104934. return;
  104935. }
  104936. segment.stats = videojs.mergeOptions(segment.stats, getProgressStats(event2));
  104937. if (!segment.stats.firstBytesReceivedAt && segment.stats.bytesReceived) {
  104938. segment.stats.firstBytesReceivedAt = Date.now();
  104939. }
  104940. return progressFn(event2, segment);
  104941. };
  104942. };
  104943. var mediaSegmentRequest = function mediaSegmentRequest2(_ref12) {
  104944. var xhr = _ref12.xhr, xhrOptions = _ref12.xhrOptions, decryptionWorker = _ref12.decryptionWorker, segment = _ref12.segment, abortFn = _ref12.abortFn, progressFn = _ref12.progressFn, trackInfoFn = _ref12.trackInfoFn, timingInfoFn = _ref12.timingInfoFn, videoSegmentTimingInfoFn = _ref12.videoSegmentTimingInfoFn, audioSegmentTimingInfoFn = _ref12.audioSegmentTimingInfoFn, id3Fn = _ref12.id3Fn, captionsFn = _ref12.captionsFn, isEndOfTimeline = _ref12.isEndOfTimeline, endedTimelineFn = _ref12.endedTimelineFn, dataFn = _ref12.dataFn, doneFn = _ref12.doneFn, onTransmuxerLog = _ref12.onTransmuxerLog;
  104945. var activeXhrs = [];
  104946. var finishProcessingFn = waitForCompletion({
  104947. activeXhrs,
  104948. decryptionWorker,
  104949. trackInfoFn,
  104950. timingInfoFn,
  104951. videoSegmentTimingInfoFn,
  104952. audioSegmentTimingInfoFn,
  104953. id3Fn,
  104954. captionsFn,
  104955. isEndOfTimeline,
  104956. endedTimelineFn,
  104957. dataFn,
  104958. doneFn,
  104959. onTransmuxerLog
  104960. });
  104961. if (segment.key && !segment.key.bytes) {
  104962. var objects = [segment.key];
  104963. if (segment.map && !segment.map.bytes && segment.map.key && segment.map.key.resolvedUri === segment.key.resolvedUri) {
  104964. objects.push(segment.map.key);
  104965. }
  104966. var keyRequestOptions = videojs.mergeOptions(xhrOptions, {
  104967. uri: segment.key.resolvedUri,
  104968. responseType: "arraybuffer"
  104969. });
  104970. var keyRequestCallback = handleKeyResponse(segment, objects, finishProcessingFn);
  104971. var keyXhr = xhr(keyRequestOptions, keyRequestCallback);
  104972. activeXhrs.push(keyXhr);
  104973. }
  104974. if (segment.map && !segment.map.bytes) {
  104975. var differentMapKey = segment.map.key && (!segment.key || segment.key.resolvedUri !== segment.map.key.resolvedUri);
  104976. if (differentMapKey) {
  104977. var mapKeyRequestOptions = videojs.mergeOptions(xhrOptions, {
  104978. uri: segment.map.key.resolvedUri,
  104979. responseType: "arraybuffer"
  104980. });
  104981. var mapKeyRequestCallback = handleKeyResponse(segment, [segment.map.key], finishProcessingFn);
  104982. var mapKeyXhr = xhr(mapKeyRequestOptions, mapKeyRequestCallback);
  104983. activeXhrs.push(mapKeyXhr);
  104984. }
  104985. var initSegmentOptions = videojs.mergeOptions(xhrOptions, {
  104986. uri: segment.map.resolvedUri,
  104987. responseType: "arraybuffer",
  104988. headers: segmentXhrHeaders(segment.map)
  104989. });
  104990. var initSegmentRequestCallback = handleInitSegmentResponse({
  104991. segment,
  104992. finishProcessingFn
  104993. });
  104994. var initSegmentXhr = xhr(initSegmentOptions, initSegmentRequestCallback);
  104995. activeXhrs.push(initSegmentXhr);
  104996. }
  104997. var segmentRequestOptions = videojs.mergeOptions(xhrOptions, {
  104998. uri: segment.part && segment.part.resolvedUri || segment.resolvedUri,
  104999. responseType: "arraybuffer",
  105000. headers: segmentXhrHeaders(segment)
  105001. });
  105002. var segmentRequestCallback = handleSegmentResponse({
  105003. segment,
  105004. finishProcessingFn,
  105005. responseType: segmentRequestOptions.responseType
  105006. });
  105007. var segmentXhr = xhr(segmentRequestOptions, segmentRequestCallback);
  105008. segmentXhr.addEventListener("progress", handleProgress({
  105009. segment,
  105010. progressFn,
  105011. trackInfoFn,
  105012. timingInfoFn,
  105013. videoSegmentTimingInfoFn,
  105014. audioSegmentTimingInfoFn,
  105015. id3Fn,
  105016. captionsFn,
  105017. isEndOfTimeline,
  105018. endedTimelineFn,
  105019. dataFn
  105020. }));
  105021. activeXhrs.push(segmentXhr);
  105022. var loadendState = {};
  105023. activeXhrs.forEach(function(activeXhr) {
  105024. activeXhr.addEventListener("loadend", handleLoadEnd({
  105025. loadendState,
  105026. abortFn
  105027. }));
  105028. });
  105029. return function() {
  105030. return abortAll(activeXhrs);
  105031. };
  105032. };
  105033. var logFn$1 = logger("CodecUtils");
  105034. var getCodecs = function getCodecs2(media) {
  105035. var mediaAttributes = media.attributes || {};
  105036. if (mediaAttributes.CODECS) {
  105037. return parseCodecs2(mediaAttributes.CODECS);
  105038. }
  105039. };
  105040. var isMaat = function isMaat2(master, media) {
  105041. var mediaAttributes = media.attributes || {};
  105042. return master && master.mediaGroups && master.mediaGroups.AUDIO && mediaAttributes.AUDIO && master.mediaGroups.AUDIO[mediaAttributes.AUDIO];
  105043. };
  105044. var isMuxed = function isMuxed2(master, media) {
  105045. if (!isMaat(master, media)) {
  105046. return true;
  105047. }
  105048. var mediaAttributes = media.attributes || {};
  105049. var audioGroup = master.mediaGroups.AUDIO[mediaAttributes.AUDIO];
  105050. for (var groupId in audioGroup) {
  105051. if (!audioGroup[groupId].uri && !audioGroup[groupId].playlists) {
  105052. return true;
  105053. }
  105054. }
  105055. return false;
  105056. };
  105057. var unwrapCodecList = function unwrapCodecList2(codecList) {
  105058. var codecs = {};
  105059. codecList.forEach(function(_ref) {
  105060. var mediaType = _ref.mediaType, type2 = _ref.type, details = _ref.details;
  105061. codecs[mediaType] = codecs[mediaType] || [];
  105062. codecs[mediaType].push(translateLegacyCodec2("" + type2 + details));
  105063. });
  105064. Object.keys(codecs).forEach(function(mediaType) {
  105065. if (codecs[mediaType].length > 1) {
  105066. logFn$1("multiple " + mediaType + " codecs found as attributes: " + codecs[mediaType].join(", ") + ". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.");
  105067. codecs[mediaType] = null;
  105068. return;
  105069. }
  105070. codecs[mediaType] = codecs[mediaType][0];
  105071. });
  105072. return codecs;
  105073. };
  105074. var codecCount = function codecCount2(codecObj) {
  105075. var count = 0;
  105076. if (codecObj.audio) {
  105077. count++;
  105078. }
  105079. if (codecObj.video) {
  105080. count++;
  105081. }
  105082. return count;
  105083. };
  105084. var codecsForPlaylist = function codecsForPlaylist2(master, media) {
  105085. var mediaAttributes = media.attributes || {};
  105086. var codecInfo = unwrapCodecList(getCodecs(media) || []);
  105087. if (isMaat(master, media) && !codecInfo.audio) {
  105088. if (!isMuxed(master, media)) {
  105089. var defaultCodecs = unwrapCodecList(codecsFromDefault2(master, mediaAttributes.AUDIO) || []);
  105090. if (defaultCodecs.audio) {
  105091. codecInfo.audio = defaultCodecs.audio;
  105092. }
  105093. }
  105094. }
  105095. return codecInfo;
  105096. };
  105097. var logFn = logger("PlaylistSelector");
  105098. var representationToString = function representationToString2(representation) {
  105099. if (!representation || !representation.playlist) {
  105100. return;
  105101. }
  105102. var playlist = representation.playlist;
  105103. return JSON.stringify({
  105104. id: playlist.id,
  105105. bandwidth: representation.bandwidth,
  105106. width: representation.width,
  105107. height: representation.height,
  105108. codecs: playlist.attributes && playlist.attributes.CODECS || ""
  105109. });
  105110. };
  105111. var safeGetComputedStyle = function safeGetComputedStyle2(el, property) {
  105112. if (!el) {
  105113. return "";
  105114. }
  105115. var result = window_1.getComputedStyle(el);
  105116. if (!result) {
  105117. return "";
  105118. }
  105119. return result[property];
  105120. };
  105121. var stableSort = function stableSort2(array, sortFn) {
  105122. var newArray = array.slice();
  105123. array.sort(function(left, right) {
  105124. var cmp = sortFn(left, right);
  105125. if (cmp === 0) {
  105126. return newArray.indexOf(left) - newArray.indexOf(right);
  105127. }
  105128. return cmp;
  105129. });
  105130. };
  105131. var comparePlaylistBandwidth = function comparePlaylistBandwidth2(left, right) {
  105132. var leftBandwidth;
  105133. var rightBandwidth;
  105134. if (left.attributes.BANDWIDTH) {
  105135. leftBandwidth = left.attributes.BANDWIDTH;
  105136. }
  105137. leftBandwidth = leftBandwidth || window_1.Number.MAX_VALUE;
  105138. if (right.attributes.BANDWIDTH) {
  105139. rightBandwidth = right.attributes.BANDWIDTH;
  105140. }
  105141. rightBandwidth = rightBandwidth || window_1.Number.MAX_VALUE;
  105142. return leftBandwidth - rightBandwidth;
  105143. };
  105144. var comparePlaylistResolution = function comparePlaylistResolution2(left, right) {
  105145. var leftWidth;
  105146. var rightWidth;
  105147. if (left.attributes.RESOLUTION && left.attributes.RESOLUTION.width) {
  105148. leftWidth = left.attributes.RESOLUTION.width;
  105149. }
  105150. leftWidth = leftWidth || window_1.Number.MAX_VALUE;
  105151. if (right.attributes.RESOLUTION && right.attributes.RESOLUTION.width) {
  105152. rightWidth = right.attributes.RESOLUTION.width;
  105153. }
  105154. rightWidth = rightWidth || window_1.Number.MAX_VALUE;
  105155. if (leftWidth === rightWidth && left.attributes.BANDWIDTH && right.attributes.BANDWIDTH) {
  105156. return left.attributes.BANDWIDTH - right.attributes.BANDWIDTH;
  105157. }
  105158. return leftWidth - rightWidth;
  105159. };
  105160. var simpleSelector = function simpleSelector2(master, playerBandwidth, playerWidth, playerHeight, limitRenditionByPlayerDimensions, masterPlaylistController) {
  105161. if (!master) {
  105162. return;
  105163. }
  105164. var options2 = {
  105165. bandwidth: playerBandwidth,
  105166. width: playerWidth,
  105167. height: playerHeight,
  105168. limitRenditionByPlayerDimensions
  105169. };
  105170. var playlists = master.playlists;
  105171. if (Playlist.isAudioOnly(master)) {
  105172. playlists = masterPlaylistController.getAudioTrackPlaylists_();
  105173. options2.audioOnly = true;
  105174. }
  105175. var sortedPlaylistReps = playlists.map(function(playlist) {
  105176. var bandwidth2;
  105177. var width2 = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.width;
  105178. var height2 = playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height;
  105179. bandwidth2 = playlist.attributes && playlist.attributes.BANDWIDTH;
  105180. bandwidth2 = bandwidth2 || window_1.Number.MAX_VALUE;
  105181. return {
  105182. bandwidth: bandwidth2,
  105183. width: width2,
  105184. height: height2,
  105185. playlist
  105186. };
  105187. });
  105188. stableSort(sortedPlaylistReps, function(left, right) {
  105189. return left.bandwidth - right.bandwidth;
  105190. });
  105191. sortedPlaylistReps = sortedPlaylistReps.filter(function(rep2) {
  105192. return !Playlist.isIncompatible(rep2.playlist);
  105193. });
  105194. var enabledPlaylistReps = sortedPlaylistReps.filter(function(rep2) {
  105195. return Playlist.isEnabled(rep2.playlist);
  105196. });
  105197. if (!enabledPlaylistReps.length) {
  105198. enabledPlaylistReps = sortedPlaylistReps.filter(function(rep2) {
  105199. return !Playlist.isDisabled(rep2.playlist);
  105200. });
  105201. }
  105202. var bandwidthPlaylistReps = enabledPlaylistReps.filter(function(rep2) {
  105203. return rep2.bandwidth * Config.BANDWIDTH_VARIANCE < playerBandwidth;
  105204. });
  105205. var highestRemainingBandwidthRep = bandwidthPlaylistReps[bandwidthPlaylistReps.length - 1];
  105206. var bandwidthBestRep = bandwidthPlaylistReps.filter(function(rep2) {
  105207. return rep2.bandwidth === highestRemainingBandwidthRep.bandwidth;
  105208. })[0];
  105209. if (limitRenditionByPlayerDimensions === false) {
  105210. var _chosenRep = bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];
  105211. if (_chosenRep && _chosenRep.playlist) {
  105212. var type2 = "sortedPlaylistReps";
  105213. if (bandwidthBestRep) {
  105214. type2 = "bandwidthBestRep";
  105215. }
  105216. if (enabledPlaylistReps[0]) {
  105217. type2 = "enabledPlaylistReps";
  105218. }
  105219. logFn("choosing " + representationToString(_chosenRep) + " using " + type2 + " with options", options2);
  105220. return _chosenRep.playlist;
  105221. }
  105222. logFn("could not choose a playlist with options", options2);
  105223. return null;
  105224. }
  105225. var haveResolution = bandwidthPlaylistReps.filter(function(rep2) {
  105226. return rep2.width && rep2.height;
  105227. });
  105228. stableSort(haveResolution, function(left, right) {
  105229. return left.width - right.width;
  105230. });
  105231. var resolutionBestRepList = haveResolution.filter(function(rep2) {
  105232. return rep2.width === playerWidth && rep2.height === playerHeight;
  105233. });
  105234. highestRemainingBandwidthRep = resolutionBestRepList[resolutionBestRepList.length - 1];
  105235. var resolutionBestRep = resolutionBestRepList.filter(function(rep2) {
  105236. return rep2.bandwidth === highestRemainingBandwidthRep.bandwidth;
  105237. })[0];
  105238. var resolutionPlusOneList;
  105239. var resolutionPlusOneSmallest;
  105240. var resolutionPlusOneRep;
  105241. if (!resolutionBestRep) {
  105242. resolutionPlusOneList = haveResolution.filter(function(rep2) {
  105243. return rep2.width > playerWidth || rep2.height > playerHeight;
  105244. });
  105245. resolutionPlusOneSmallest = resolutionPlusOneList.filter(function(rep2) {
  105246. return rep2.width === resolutionPlusOneList[0].width && rep2.height === resolutionPlusOneList[0].height;
  105247. });
  105248. highestRemainingBandwidthRep = resolutionPlusOneSmallest[resolutionPlusOneSmallest.length - 1];
  105249. resolutionPlusOneRep = resolutionPlusOneSmallest.filter(function(rep2) {
  105250. return rep2.bandwidth === highestRemainingBandwidthRep.bandwidth;
  105251. })[0];
  105252. }
  105253. var leastPixelDiffRep;
  105254. if (masterPlaylistController.experimentalLeastPixelDiffSelector) {
  105255. var leastPixelDiffList = haveResolution.map(function(rep2) {
  105256. rep2.pixelDiff = Math.abs(rep2.width - playerWidth) + Math.abs(rep2.height - playerHeight);
  105257. return rep2;
  105258. });
  105259. stableSort(leastPixelDiffList, function(left, right) {
  105260. if (left.pixelDiff === right.pixelDiff) {
  105261. return right.bandwidth - left.bandwidth;
  105262. }
  105263. return left.pixelDiff - right.pixelDiff;
  105264. });
  105265. leastPixelDiffRep = leastPixelDiffList[0];
  105266. }
  105267. var chosenRep = leastPixelDiffRep || resolutionPlusOneRep || resolutionBestRep || bandwidthBestRep || enabledPlaylistReps[0] || sortedPlaylistReps[0];
  105268. if (chosenRep && chosenRep.playlist) {
  105269. var _type = "sortedPlaylistReps";
  105270. if (leastPixelDiffRep) {
  105271. _type = "leastPixelDiffRep";
  105272. } else if (resolutionPlusOneRep) {
  105273. _type = "resolutionPlusOneRep";
  105274. } else if (resolutionBestRep) {
  105275. _type = "resolutionBestRep";
  105276. } else if (bandwidthBestRep) {
  105277. _type = "bandwidthBestRep";
  105278. } else if (enabledPlaylistReps[0]) {
  105279. _type = "enabledPlaylistReps";
  105280. }
  105281. logFn("choosing " + representationToString(chosenRep) + " using " + _type + " with options", options2);
  105282. return chosenRep.playlist;
  105283. }
  105284. logFn("could not choose a playlist with options", options2);
  105285. return null;
  105286. };
  105287. var lastBandwidthSelector = function lastBandwidthSelector2() {
  105288. var pixelRatio = this.useDevicePixelRatio ? window_1.devicePixelRatio || 1 : 1;
  105289. return simpleSelector(this.playlists.master, this.systemBandwidth, parseInt(safeGetComputedStyle(this.tech_.el(), "width"), 10) * pixelRatio, parseInt(safeGetComputedStyle(this.tech_.el(), "height"), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.masterPlaylistController_);
  105290. };
  105291. var movingAverageBandwidthSelector = function movingAverageBandwidthSelector2(decay) {
  105292. var average = -1;
  105293. var lastSystemBandwidth = -1;
  105294. if (decay < 0 || decay > 1) {
  105295. throw new Error("Moving average bandwidth decay must be between 0 and 1.");
  105296. }
  105297. return function() {
  105298. var pixelRatio = this.useDevicePixelRatio ? window_1.devicePixelRatio || 1 : 1;
  105299. if (average < 0) {
  105300. average = this.systemBandwidth;
  105301. lastSystemBandwidth = this.systemBandwidth;
  105302. }
  105303. if (this.systemBandwidth > 0 && this.systemBandwidth !== lastSystemBandwidth) {
  105304. average = decay * this.systemBandwidth + (1 - decay) * average;
  105305. lastSystemBandwidth = this.systemBandwidth;
  105306. }
  105307. return simpleSelector(this.playlists.master, average, parseInt(safeGetComputedStyle(this.tech_.el(), "width"), 10) * pixelRatio, parseInt(safeGetComputedStyle(this.tech_.el(), "height"), 10) * pixelRatio, this.limitRenditionByPlayerDimensions, this.masterPlaylistController_);
  105308. };
  105309. };
  105310. var minRebufferMaxBandwidthSelector = function minRebufferMaxBandwidthSelector2(settings) {
  105311. var master = settings.master, currentTime = settings.currentTime, bandwidth2 = settings.bandwidth, duration5 = settings.duration, segmentDuration = settings.segmentDuration, timeUntilRebuffer3 = settings.timeUntilRebuffer, currentTimeline = settings.currentTimeline, syncController = settings.syncController;
  105312. var compatiblePlaylists = master.playlists.filter(function(playlist) {
  105313. return !Playlist.isIncompatible(playlist);
  105314. });
  105315. var enabledPlaylists = compatiblePlaylists.filter(Playlist.isEnabled);
  105316. if (!enabledPlaylists.length) {
  105317. enabledPlaylists = compatiblePlaylists.filter(function(playlist) {
  105318. return !Playlist.isDisabled(playlist);
  105319. });
  105320. }
  105321. var bandwidthPlaylists = enabledPlaylists.filter(Playlist.hasAttribute.bind(null, "BANDWIDTH"));
  105322. var rebufferingEstimates = bandwidthPlaylists.map(function(playlist) {
  105323. var syncPoint = syncController.getSyncPoint(playlist, duration5, currentTimeline, currentTime);
  105324. var numRequests = syncPoint ? 1 : 2;
  105325. var requestTimeEstimate = Playlist.estimateSegmentRequestTime(segmentDuration, bandwidth2, playlist);
  105326. var rebufferingImpact = requestTimeEstimate * numRequests - timeUntilRebuffer3;
  105327. return {
  105328. playlist,
  105329. rebufferingImpact
  105330. };
  105331. });
  105332. var noRebufferingPlaylists = rebufferingEstimates.filter(function(estimate) {
  105333. return estimate.rebufferingImpact <= 0;
  105334. });
  105335. stableSort(noRebufferingPlaylists, function(a, b) {
  105336. return comparePlaylistBandwidth(b.playlist, a.playlist);
  105337. });
  105338. if (noRebufferingPlaylists.length) {
  105339. return noRebufferingPlaylists[0];
  105340. }
  105341. stableSort(rebufferingEstimates, function(a, b) {
  105342. return a.rebufferingImpact - b.rebufferingImpact;
  105343. });
  105344. return rebufferingEstimates[0] || null;
  105345. };
  105346. var lowestBitrateCompatibleVariantSelector = function lowestBitrateCompatibleVariantSelector2() {
  105347. var _this = this;
  105348. var playlists = this.playlists.master.playlists.filter(Playlist.isEnabled);
  105349. stableSort(playlists, function(a, b) {
  105350. return comparePlaylistBandwidth(a, b);
  105351. });
  105352. var playlistsWithVideo = playlists.filter(function(playlist) {
  105353. return !!codecsForPlaylist(_this.playlists.master, playlist).video;
  105354. });
  105355. return playlistsWithVideo[0] || null;
  105356. };
  105357. var concatSegments = function concatSegments2(segmentObj) {
  105358. var offset = 0;
  105359. var tempBuffer;
  105360. if (segmentObj.bytes) {
  105361. tempBuffer = new Uint8Array(segmentObj.bytes);
  105362. segmentObj.segments.forEach(function(segment) {
  105363. tempBuffer.set(segment, offset);
  105364. offset += segment.byteLength;
  105365. });
  105366. }
  105367. return tempBuffer;
  105368. };
  105369. var createCaptionsTrackIfNotExists = function createCaptionsTrackIfNotExists2(inbandTextTracks, tech, captionStream) {
  105370. if (!inbandTextTracks[captionStream]) {
  105371. tech.trigger({
  105372. type: "usage",
  105373. name: "vhs-608"
  105374. });
  105375. tech.trigger({
  105376. type: "usage",
  105377. name: "hls-608"
  105378. });
  105379. var instreamId = captionStream;
  105380. if (/^cc708_/.test(captionStream)) {
  105381. instreamId = "SERVICE" + captionStream.split("_")[1];
  105382. }
  105383. var track = tech.textTracks().getTrackById(instreamId);
  105384. if (track) {
  105385. inbandTextTracks[captionStream] = track;
  105386. } else {
  105387. var captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};
  105388. var label = captionStream;
  105389. var language = captionStream;
  105390. var def = false;
  105391. var captionService = captionServices[instreamId];
  105392. if (captionService) {
  105393. label = captionService.label;
  105394. language = captionService.language;
  105395. def = captionService["default"];
  105396. }
  105397. inbandTextTracks[captionStream] = tech.addRemoteTextTrack({
  105398. kind: "captions",
  105399. id: instreamId,
  105400. "default": def,
  105401. label,
  105402. language
  105403. }, false).track;
  105404. }
  105405. }
  105406. };
  105407. var addCaptionData = function addCaptionData2(_ref) {
  105408. var inbandTextTracks = _ref.inbandTextTracks, captionArray = _ref.captionArray, timestampOffset2 = _ref.timestampOffset;
  105409. if (!captionArray) {
  105410. return;
  105411. }
  105412. var Cue = window_1.WebKitDataCue || window_1.VTTCue;
  105413. captionArray.forEach(function(caption) {
  105414. var track = caption.stream;
  105415. inbandTextTracks[track].addCue(new Cue(caption.startTime + timestampOffset2, caption.endTime + timestampOffset2, caption.text));
  105416. });
  105417. };
  105418. var deprecateOldCue = function deprecateOldCue2(cue) {
  105419. Object.defineProperties(cue.frame, {
  105420. id: {
  105421. get: function get7() {
  105422. videojs.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");
  105423. return cue.value.key;
  105424. }
  105425. },
  105426. value: {
  105427. get: function get7() {
  105428. videojs.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");
  105429. return cue.value.data;
  105430. }
  105431. },
  105432. privateData: {
  105433. get: function get7() {
  105434. videojs.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");
  105435. return cue.value.data;
  105436. }
  105437. }
  105438. });
  105439. };
  105440. var addMetadata = function addMetadata2(_ref2) {
  105441. var inbandTextTracks = _ref2.inbandTextTracks, metadataArray = _ref2.metadataArray, timestampOffset2 = _ref2.timestampOffset, videoDuration = _ref2.videoDuration;
  105442. if (!metadataArray) {
  105443. return;
  105444. }
  105445. var Cue = window_1.WebKitDataCue || window_1.VTTCue;
  105446. var metadataTrack = inbandTextTracks.metadataTrack_;
  105447. if (!metadataTrack) {
  105448. return;
  105449. }
  105450. metadataArray.forEach(function(metadata) {
  105451. var time = metadata.cueTime + timestampOffset2;
  105452. if (typeof time !== "number" || window_1.isNaN(time) || time < 0 || !(time < Infinity)) {
  105453. return;
  105454. }
  105455. metadata.frames.forEach(function(frame) {
  105456. var cue = new Cue(time, time, frame.value || frame.url || frame.data || "");
  105457. cue.frame = frame;
  105458. cue.value = frame;
  105459. deprecateOldCue(cue);
  105460. metadataTrack.addCue(cue);
  105461. });
  105462. });
  105463. if (!metadataTrack.cues || !metadataTrack.cues.length) {
  105464. return;
  105465. }
  105466. var cues = metadataTrack.cues;
  105467. var cuesArray = [];
  105468. for (var i2 = 0; i2 < cues.length; i2++) {
  105469. if (cues[i2]) {
  105470. cuesArray.push(cues[i2]);
  105471. }
  105472. }
  105473. var cuesGroupedByStartTime = cuesArray.reduce(function(obj, cue) {
  105474. var timeSlot = obj[cue.startTime] || [];
  105475. timeSlot.push(cue);
  105476. obj[cue.startTime] = timeSlot;
  105477. return obj;
  105478. }, {});
  105479. var sortedStartTimes = Object.keys(cuesGroupedByStartTime).sort(function(a, b) {
  105480. return Number(a) - Number(b);
  105481. });
  105482. sortedStartTimes.forEach(function(startTime, idx) {
  105483. var cueGroup = cuesGroupedByStartTime[startTime];
  105484. var nextTime = Number(sortedStartTimes[idx + 1]) || videoDuration;
  105485. cueGroup.forEach(function(cue) {
  105486. cue.endTime = nextTime;
  105487. });
  105488. });
  105489. };
  105490. var createMetadataTrackIfNotExists = function createMetadataTrackIfNotExists2(inbandTextTracks, dispatchType, tech) {
  105491. if (inbandTextTracks.metadataTrack_) {
  105492. return;
  105493. }
  105494. inbandTextTracks.metadataTrack_ = tech.addRemoteTextTrack({
  105495. kind: "metadata",
  105496. label: "Timed Metadata"
  105497. }, false).track;
  105498. inbandTextTracks.metadataTrack_.inBandMetadataTrackDispatchType = dispatchType;
  105499. };
  105500. var removeCuesFromTrack = function removeCuesFromTrack2(start2, end, track) {
  105501. var i2;
  105502. var cue;
  105503. if (!track) {
  105504. return;
  105505. }
  105506. if (!track.cues) {
  105507. return;
  105508. }
  105509. i2 = track.cues.length;
  105510. while (i2--) {
  105511. cue = track.cues[i2];
  105512. if (cue.startTime >= start2 && cue.endTime <= end) {
  105513. track.removeCue(cue);
  105514. }
  105515. }
  105516. };
  105517. var removeDuplicateCuesFromTrack = function removeDuplicateCuesFromTrack2(track) {
  105518. var cues = track.cues;
  105519. if (!cues) {
  105520. return;
  105521. }
  105522. for (var i2 = 0; i2 < cues.length; i2++) {
  105523. var duplicates = [];
  105524. var occurrences = 0;
  105525. for (var j = 0; j < cues.length; j++) {
  105526. if (cues[i2].startTime === cues[j].startTime && cues[i2].endTime === cues[j].endTime && cues[i2].text === cues[j].text) {
  105527. occurrences++;
  105528. if (occurrences > 1) {
  105529. duplicates.push(cues[j]);
  105530. }
  105531. }
  105532. }
  105533. if (duplicates.length) {
  105534. duplicates.forEach(function(dupe) {
  105535. return track.removeCue(dupe);
  105536. });
  105537. }
  105538. }
  105539. };
  105540. var gopsSafeToAlignWith = function gopsSafeToAlignWith2(buffer, currentTime, mapping) {
  105541. if (typeof currentTime === "undefined" || currentTime === null || !buffer.length) {
  105542. return [];
  105543. }
  105544. var currentTimePts = Math.ceil((currentTime - mapping + 3) * clock.ONE_SECOND_IN_TS);
  105545. var i2;
  105546. for (i2 = 0; i2 < buffer.length; i2++) {
  105547. if (buffer[i2].pts > currentTimePts) {
  105548. break;
  105549. }
  105550. }
  105551. return buffer.slice(i2);
  105552. };
  105553. var updateGopBuffer = function updateGopBuffer2(buffer, gops, replace) {
  105554. if (!gops.length) {
  105555. return buffer;
  105556. }
  105557. if (replace) {
  105558. return gops.slice();
  105559. }
  105560. var start2 = gops[0].pts;
  105561. var i2 = 0;
  105562. for (i2; i2 < buffer.length; i2++) {
  105563. if (buffer[i2].pts >= start2) {
  105564. break;
  105565. }
  105566. }
  105567. return buffer.slice(0, i2).concat(gops);
  105568. };
  105569. var removeGopBuffer = function removeGopBuffer2(buffer, start2, end, mapping) {
  105570. var startPts = Math.ceil((start2 - mapping) * clock.ONE_SECOND_IN_TS);
  105571. var endPts = Math.ceil((end - mapping) * clock.ONE_SECOND_IN_TS);
  105572. var updatedBuffer = buffer.slice();
  105573. var i2 = buffer.length;
  105574. while (i2--) {
  105575. if (buffer[i2].pts <= endPts) {
  105576. break;
  105577. }
  105578. }
  105579. if (i2 === -1) {
  105580. return updatedBuffer;
  105581. }
  105582. var j = i2 + 1;
  105583. while (j--) {
  105584. if (buffer[j].pts <= startPts) {
  105585. break;
  105586. }
  105587. }
  105588. j = Math.max(j, 0);
  105589. updatedBuffer.splice(j, i2 - j + 1);
  105590. return updatedBuffer;
  105591. };
  105592. var shallowEqual = function shallowEqual2(a, b) {
  105593. if (!a && !b || !a && b || a && !b) {
  105594. return false;
  105595. }
  105596. if (a === b) {
  105597. return true;
  105598. }
  105599. var akeys = Object.keys(a).sort();
  105600. var bkeys = Object.keys(b).sort();
  105601. if (akeys.length !== bkeys.length) {
  105602. return false;
  105603. }
  105604. for (var i2 = 0; i2 < akeys.length; i2++) {
  105605. var key = akeys[i2];
  105606. if (key !== bkeys[i2]) {
  105607. return false;
  105608. }
  105609. if (a[key] !== b[key]) {
  105610. return false;
  105611. }
  105612. }
  105613. return true;
  105614. };
  105615. var QUOTA_EXCEEDED_ERR = 22;
  105616. var getSyncSegmentCandidate = function getSyncSegmentCandidate2(currentTimeline, segments, targetTime) {
  105617. segments = segments || [];
  105618. var timelineSegments = [];
  105619. var time = 0;
  105620. for (var i2 = 0; i2 < segments.length; i2++) {
  105621. var segment = segments[i2];
  105622. if (currentTimeline === segment.timeline) {
  105623. timelineSegments.push(i2);
  105624. time += segment.duration;
  105625. if (time > targetTime) {
  105626. return i2;
  105627. }
  105628. }
  105629. }
  105630. if (timelineSegments.length === 0) {
  105631. return 0;
  105632. }
  105633. return timelineSegments[timelineSegments.length - 1];
  105634. };
  105635. var MIN_BACK_BUFFER = 1;
  105636. var CHECK_BUFFER_DELAY = 500;
  105637. var finite = function finite2(num) {
  105638. return typeof num === "number" && isFinite(num);
  105639. };
  105640. var MIN_SEGMENT_DURATION_TO_SAVE_STATS = 1 / 60;
  105641. var illegalMediaSwitch = function illegalMediaSwitch2(loaderType, startingMedia, trackInfo) {
  105642. if (loaderType !== "main" || !startingMedia || !trackInfo) {
  105643. return null;
  105644. }
  105645. if (!trackInfo.hasAudio && !trackInfo.hasVideo) {
  105646. return "Neither audio nor video found in segment.";
  105647. }
  105648. if (startingMedia.hasVideo && !trackInfo.hasVideo) {
  105649. return "Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.";
  105650. }
  105651. if (!startingMedia.hasVideo && trackInfo.hasVideo) {
  105652. return "Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.";
  105653. }
  105654. return null;
  105655. };
  105656. var safeBackBufferTrimTime = function safeBackBufferTrimTime2(seekable3, currentTime, targetDuration) {
  105657. var trimTime = currentTime - Config.BACK_BUFFER_LENGTH;
  105658. if (seekable3.length) {
  105659. trimTime = Math.max(trimTime, seekable3.start(0));
  105660. }
  105661. var maxTrimTime = currentTime - targetDuration;
  105662. return Math.min(maxTrimTime, trimTime);
  105663. };
  105664. var segmentInfoString = function segmentInfoString2(segmentInfo) {
  105665. var startOfSegment = segmentInfo.startOfSegment, duration5 = segmentInfo.duration, segment = segmentInfo.segment, part = segmentInfo.part, _segmentInfo$playlist = segmentInfo.playlist, seq = _segmentInfo$playlist.mediaSequence, id = _segmentInfo$playlist.id, _segmentInfo$playlist2 = _segmentInfo$playlist.segments, segments = _segmentInfo$playlist2 === void 0 ? [] : _segmentInfo$playlist2, index2 = segmentInfo.mediaIndex, partIndex = segmentInfo.partIndex, timeline = segmentInfo.timeline;
  105666. var segmentLen = segments.length - 1;
  105667. var selection = "mediaIndex/partIndex increment";
  105668. if (segmentInfo.getMediaInfoForTime) {
  105669. selection = "getMediaInfoForTime (" + segmentInfo.getMediaInfoForTime + ")";
  105670. } else if (segmentInfo.isSyncRequest) {
  105671. selection = "getSyncSegmentCandidate (isSyncRequest)";
  105672. }
  105673. if (segmentInfo.independent) {
  105674. selection += " with independent " + segmentInfo.independent;
  105675. }
  105676. var hasPartIndex = typeof partIndex === "number";
  105677. var name = segmentInfo.segment.uri ? "segment" : "pre-segment";
  105678. var zeroBasedPartCount = hasPartIndex ? getKnownPartCount({
  105679. preloadSegment: segment
  105680. }) - 1 : 0;
  105681. return name + " [" + (seq + index2) + "/" + (seq + segmentLen) + "]" + (hasPartIndex ? " part [" + partIndex + "/" + zeroBasedPartCount + "]" : "") + (" segment start/end [" + segment.start + " => " + segment.end + "]") + (hasPartIndex ? " part start/end [" + part.start + " => " + part.end + "]" : "") + (" startOfSegment [" + startOfSegment + "]") + (" duration [" + duration5 + "]") + (" timeline [" + timeline + "]") + (" selected by [" + selection + "]") + (" playlist [" + id + "]");
  105682. };
  105683. var timingInfoPropertyForMedia = function timingInfoPropertyForMedia2(mediaType) {
  105684. return mediaType + "TimingInfo";
  105685. };
  105686. var timestampOffsetForSegment = function timestampOffsetForSegment2(_ref) {
  105687. var segmentTimeline = _ref.segmentTimeline, currentTimeline = _ref.currentTimeline, startOfSegment = _ref.startOfSegment, buffered = _ref.buffered, overrideCheck = _ref.overrideCheck;
  105688. if (!overrideCheck && segmentTimeline === currentTimeline) {
  105689. return null;
  105690. }
  105691. if (segmentTimeline < currentTimeline) {
  105692. return startOfSegment;
  105693. }
  105694. return buffered.length ? buffered.end(buffered.length - 1) : startOfSegment;
  105695. };
  105696. var shouldWaitForTimelineChange = function shouldWaitForTimelineChange2(_ref2) {
  105697. var timelineChangeController = _ref2.timelineChangeController, currentTimeline = _ref2.currentTimeline, segmentTimeline = _ref2.segmentTimeline, loaderType = _ref2.loaderType, audioDisabled = _ref2.audioDisabled;
  105698. if (currentTimeline === segmentTimeline) {
  105699. return false;
  105700. }
  105701. if (loaderType === "audio") {
  105702. var lastMainTimelineChange = timelineChangeController.lastTimelineChange({
  105703. type: "main"
  105704. });
  105705. return !lastMainTimelineChange || lastMainTimelineChange.to !== segmentTimeline;
  105706. }
  105707. if (loaderType === "main" && audioDisabled) {
  105708. var pendingAudioTimelineChange = timelineChangeController.pendingTimelineChange({
  105709. type: "audio"
  105710. });
  105711. if (pendingAudioTimelineChange && pendingAudioTimelineChange.to === segmentTimeline) {
  105712. return false;
  105713. }
  105714. return true;
  105715. }
  105716. return false;
  105717. };
  105718. var mediaDuration = function mediaDuration2(timingInfos) {
  105719. var maxDuration = 0;
  105720. ["video", "audio"].forEach(function(type2) {
  105721. var typeTimingInfo = timingInfos[type2 + "TimingInfo"];
  105722. if (!typeTimingInfo) {
  105723. return;
  105724. }
  105725. var start2 = typeTimingInfo.start, end = typeTimingInfo.end;
  105726. var duration5;
  105727. if (typeof start2 === "bigint" || typeof end === "bigint") {
  105728. duration5 = window_1.BigInt(end) - window_1.BigInt(start2);
  105729. } else if (typeof start2 === "number" && typeof end === "number") {
  105730. duration5 = end - start2;
  105731. }
  105732. if (typeof duration5 !== "undefined" && duration5 > maxDuration) {
  105733. maxDuration = duration5;
  105734. }
  105735. });
  105736. if (typeof maxDuration === "bigint" && maxDuration < Number.MAX_SAFE_INTEGER) {
  105737. maxDuration = Number(maxDuration);
  105738. }
  105739. return maxDuration;
  105740. };
  105741. var segmentTooLong = function segmentTooLong2(_ref3) {
  105742. var segmentDuration = _ref3.segmentDuration, maxDuration = _ref3.maxDuration;
  105743. if (!segmentDuration) {
  105744. return false;
  105745. }
  105746. return Math.round(segmentDuration) > maxDuration + TIME_FUDGE_FACTOR;
  105747. };
  105748. var getTroublesomeSegmentDurationMessage = function getTroublesomeSegmentDurationMessage2(segmentInfo, sourceType) {
  105749. if (sourceType !== "hls") {
  105750. return null;
  105751. }
  105752. var segmentDuration = mediaDuration({
  105753. audioTimingInfo: segmentInfo.audioTimingInfo,
  105754. videoTimingInfo: segmentInfo.videoTimingInfo
  105755. });
  105756. if (!segmentDuration) {
  105757. return null;
  105758. }
  105759. var targetDuration = segmentInfo.playlist.targetDuration;
  105760. var isSegmentWayTooLong = segmentTooLong({
  105761. segmentDuration,
  105762. maxDuration: targetDuration * 2
  105763. });
  105764. var isSegmentSlightlyTooLong = segmentTooLong({
  105765. segmentDuration,
  105766. maxDuration: targetDuration
  105767. });
  105768. var segmentTooLongMessage = "Segment with index " + segmentInfo.mediaIndex + " " + ("from playlist " + segmentInfo.playlist.id + " ") + ("has a duration of " + segmentDuration + " ") + ("when the reported duration is " + segmentInfo.duration + " ") + ("and the target duration is " + targetDuration + ". ") + "For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";
  105769. if (isSegmentWayTooLong || isSegmentSlightlyTooLong) {
  105770. return {
  105771. severity: isSegmentWayTooLong ? "warn" : "info",
  105772. message: segmentTooLongMessage
  105773. };
  105774. }
  105775. return null;
  105776. };
  105777. var SegmentLoader = /* @__PURE__ */ function(_videojs$EventTarget) {
  105778. _inheritsLoose(SegmentLoader2, _videojs$EventTarget);
  105779. function SegmentLoader2(settings, options2) {
  105780. var _this;
  105781. _this = _videojs$EventTarget.call(this) || this;
  105782. if (!settings) {
  105783. throw new TypeError("Initialization settings are required");
  105784. }
  105785. if (typeof settings.currentTime !== "function") {
  105786. throw new TypeError("No currentTime getter specified");
  105787. }
  105788. if (!settings.mediaSource) {
  105789. throw new TypeError("No MediaSource specified");
  105790. }
  105791. _this.bandwidth = settings.bandwidth;
  105792. _this.throughput = {
  105793. rate: 0,
  105794. count: 0
  105795. };
  105796. _this.roundTrip = NaN;
  105797. _this.resetStats_();
  105798. _this.mediaIndex = null;
  105799. _this.partIndex = null;
  105800. _this.hasPlayed_ = settings.hasPlayed;
  105801. _this.currentTime_ = settings.currentTime;
  105802. _this.seekable_ = settings.seekable;
  105803. _this.seeking_ = settings.seeking;
  105804. _this.duration_ = settings.duration;
  105805. _this.mediaSource_ = settings.mediaSource;
  105806. _this.vhs_ = settings.vhs;
  105807. _this.loaderType_ = settings.loaderType;
  105808. _this.currentMediaInfo_ = void 0;
  105809. _this.startingMediaInfo_ = void 0;
  105810. _this.segmentMetadataTrack_ = settings.segmentMetadataTrack;
  105811. _this.goalBufferLength_ = settings.goalBufferLength;
  105812. _this.sourceType_ = settings.sourceType;
  105813. _this.sourceUpdater_ = settings.sourceUpdater;
  105814. _this.inbandTextTracks_ = settings.inbandTextTracks;
  105815. _this.state_ = "INIT";
  105816. _this.timelineChangeController_ = settings.timelineChangeController;
  105817. _this.shouldSaveSegmentTimingInfo_ = true;
  105818. _this.parse708captions_ = settings.parse708captions;
  105819. _this.useDtsForTimestampOffset_ = settings.useDtsForTimestampOffset;
  105820. _this.captionServices_ = settings.captionServices;
  105821. _this.experimentalExactManifestTimings = settings.experimentalExactManifestTimings;
  105822. _this.checkBufferTimeout_ = null;
  105823. _this.error_ = void 0;
  105824. _this.currentTimeline_ = -1;
  105825. _this.pendingSegment_ = null;
  105826. _this.xhrOptions_ = null;
  105827. _this.pendingSegments_ = [];
  105828. _this.audioDisabled_ = false;
  105829. _this.isPendingTimestampOffset_ = false;
  105830. _this.gopBuffer_ = [];
  105831. _this.timeMapping_ = 0;
  105832. _this.safeAppend_ = videojs.browser.IE_VERSION >= 11;
  105833. _this.appendInitSegment_ = {
  105834. audio: true,
  105835. video: true
  105836. };
  105837. _this.playlistOfLastInitSegment_ = {
  105838. audio: null,
  105839. video: null
  105840. };
  105841. _this.callQueue_ = [];
  105842. _this.loadQueue_ = [];
  105843. _this.metadataQueue_ = {
  105844. id3: [],
  105845. caption: []
  105846. };
  105847. _this.waitingOnRemove_ = false;
  105848. _this.quotaExceededErrorRetryTimeout_ = null;
  105849. _this.activeInitSegmentId_ = null;
  105850. _this.initSegments_ = {};
  105851. _this.cacheEncryptionKeys_ = settings.cacheEncryptionKeys;
  105852. _this.keyCache_ = {};
  105853. _this.decrypter_ = settings.decrypter;
  105854. _this.syncController_ = settings.syncController;
  105855. _this.syncPoint_ = {
  105856. segmentIndex: 0,
  105857. time: 0
  105858. };
  105859. _this.transmuxer_ = _this.createTransmuxer_();
  105860. _this.triggerSyncInfoUpdate_ = function() {
  105861. return _this.trigger("syncinfoupdate");
  105862. };
  105863. _this.syncController_.on("syncinfoupdate", _this.triggerSyncInfoUpdate_);
  105864. _this.mediaSource_.addEventListener("sourceopen", function() {
  105865. if (!_this.isEndOfStream_()) {
  105866. _this.ended_ = false;
  105867. }
  105868. });
  105869. _this.fetchAtBuffer_ = false;
  105870. _this.logger_ = logger("SegmentLoader[" + _this.loaderType_ + "]");
  105871. Object.defineProperty(_assertThisInitialized(_this), "state", {
  105872. get: function get7() {
  105873. return this.state_;
  105874. },
  105875. set: function set4(newState) {
  105876. if (newState !== this.state_) {
  105877. this.logger_(this.state_ + " -> " + newState);
  105878. this.state_ = newState;
  105879. this.trigger("statechange");
  105880. }
  105881. }
  105882. });
  105883. _this.sourceUpdater_.on("ready", function() {
  105884. if (_this.hasEnoughInfoToAppend_()) {
  105885. _this.processCallQueue_();
  105886. }
  105887. });
  105888. if (_this.loaderType_ === "main") {
  105889. _this.timelineChangeController_.on("pendingtimelinechange", function() {
  105890. if (_this.hasEnoughInfoToAppend_()) {
  105891. _this.processCallQueue_();
  105892. }
  105893. });
  105894. }
  105895. if (_this.loaderType_ === "audio") {
  105896. _this.timelineChangeController_.on("timelinechange", function() {
  105897. if (_this.hasEnoughInfoToLoad_()) {
  105898. _this.processLoadQueue_();
  105899. }
  105900. if (_this.hasEnoughInfoToAppend_()) {
  105901. _this.processCallQueue_();
  105902. }
  105903. });
  105904. }
  105905. return _this;
  105906. }
  105907. var _proto = SegmentLoader2.prototype;
  105908. _proto.createTransmuxer_ = function createTransmuxer_() {
  105909. return segmentTransmuxer.createTransmuxer({
  105910. remux: false,
  105911. alignGopsAtEnd: this.safeAppend_,
  105912. keepOriginalTimestamps: true,
  105913. parse708captions: this.parse708captions_,
  105914. captionServices: this.captionServices_
  105915. });
  105916. };
  105917. _proto.resetStats_ = function resetStats_() {
  105918. this.mediaBytesTransferred = 0;
  105919. this.mediaRequests = 0;
  105920. this.mediaRequestsAborted = 0;
  105921. this.mediaRequestsTimedout = 0;
  105922. this.mediaRequestsErrored = 0;
  105923. this.mediaTransferDuration = 0;
  105924. this.mediaSecondsLoaded = 0;
  105925. this.mediaAppends = 0;
  105926. };
  105927. _proto.dispose = function dispose() {
  105928. this.trigger("dispose");
  105929. this.state = "DISPOSED";
  105930. this.pause();
  105931. this.abort_();
  105932. if (this.transmuxer_) {
  105933. this.transmuxer_.terminate();
  105934. }
  105935. this.resetStats_();
  105936. if (this.checkBufferTimeout_) {
  105937. window_1.clearTimeout(this.checkBufferTimeout_);
  105938. }
  105939. if (this.syncController_ && this.triggerSyncInfoUpdate_) {
  105940. this.syncController_.off("syncinfoupdate", this.triggerSyncInfoUpdate_);
  105941. }
  105942. this.off();
  105943. };
  105944. _proto.setAudio = function setAudio(enable) {
  105945. this.audioDisabled_ = !enable;
  105946. if (enable) {
  105947. this.appendInitSegment_.audio = true;
  105948. } else {
  105949. this.sourceUpdater_.removeAudio(0, this.duration_());
  105950. }
  105951. };
  105952. _proto.abort = function abort2() {
  105953. if (this.state !== "WAITING") {
  105954. if (this.pendingSegment_) {
  105955. this.pendingSegment_ = null;
  105956. }
  105957. return;
  105958. }
  105959. this.abort_();
  105960. this.state = "READY";
  105961. if (!this.paused()) {
  105962. this.monitorBuffer_();
  105963. }
  105964. };
  105965. _proto.abort_ = function abort_() {
  105966. if (this.pendingSegment_ && this.pendingSegment_.abortRequests) {
  105967. this.pendingSegment_.abortRequests();
  105968. }
  105969. this.pendingSegment_ = null;
  105970. this.callQueue_ = [];
  105971. this.loadQueue_ = [];
  105972. this.metadataQueue_.id3 = [];
  105973. this.metadataQueue_.caption = [];
  105974. this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);
  105975. this.waitingOnRemove_ = false;
  105976. window_1.clearTimeout(this.quotaExceededErrorRetryTimeout_);
  105977. this.quotaExceededErrorRetryTimeout_ = null;
  105978. };
  105979. _proto.checkForAbort_ = function checkForAbort_(requestId) {
  105980. if (this.state === "APPENDING" && !this.pendingSegment_) {
  105981. this.state = "READY";
  105982. return true;
  105983. }
  105984. if (!this.pendingSegment_ || this.pendingSegment_.requestId !== requestId) {
  105985. return true;
  105986. }
  105987. return false;
  105988. };
  105989. _proto.error = function error(_error) {
  105990. if (typeof _error !== "undefined") {
  105991. this.logger_("error occurred:", _error);
  105992. this.error_ = _error;
  105993. }
  105994. this.pendingSegment_ = null;
  105995. return this.error_;
  105996. };
  105997. _proto.endOfStream = function endOfStream2() {
  105998. this.ended_ = true;
  105999. if (this.transmuxer_) {
  106000. segmentTransmuxer.reset(this.transmuxer_);
  106001. }
  106002. this.gopBuffer_.length = 0;
  106003. this.pause();
  106004. this.trigger("ended");
  106005. };
  106006. _proto.buffered_ = function buffered_() {
  106007. var trackInfo = this.getMediaInfo_();
  106008. if (!this.sourceUpdater_ || !trackInfo) {
  106009. return videojs.createTimeRanges();
  106010. }
  106011. if (this.loaderType_ === "main") {
  106012. var hasAudio = trackInfo.hasAudio, hasVideo = trackInfo.hasVideo, isMuxed3 = trackInfo.isMuxed;
  106013. if (hasVideo && hasAudio && !this.audioDisabled_ && !isMuxed3) {
  106014. return this.sourceUpdater_.buffered();
  106015. }
  106016. if (hasVideo) {
  106017. return this.sourceUpdater_.videoBuffered();
  106018. }
  106019. }
  106020. return this.sourceUpdater_.audioBuffered();
  106021. };
  106022. _proto.initSegmentForMap = function initSegmentForMap(map, set4) {
  106023. if (set4 === void 0) {
  106024. set4 = false;
  106025. }
  106026. if (!map) {
  106027. return null;
  106028. }
  106029. var id = initSegmentId(map);
  106030. var storedMap = this.initSegments_[id];
  106031. if (set4 && !storedMap && map.bytes) {
  106032. this.initSegments_[id] = storedMap = {
  106033. resolvedUri: map.resolvedUri,
  106034. byterange: map.byterange,
  106035. bytes: map.bytes,
  106036. tracks: map.tracks,
  106037. timescales: map.timescales
  106038. };
  106039. }
  106040. return storedMap || map;
  106041. };
  106042. _proto.segmentKey = function segmentKey(key, set4) {
  106043. if (set4 === void 0) {
  106044. set4 = false;
  106045. }
  106046. if (!key) {
  106047. return null;
  106048. }
  106049. var id = segmentKeyId(key);
  106050. var storedKey = this.keyCache_[id];
  106051. if (this.cacheEncryptionKeys_ && set4 && !storedKey && key.bytes) {
  106052. this.keyCache_[id] = storedKey = {
  106053. resolvedUri: key.resolvedUri,
  106054. bytes: key.bytes
  106055. };
  106056. }
  106057. var result = {
  106058. resolvedUri: (storedKey || key).resolvedUri
  106059. };
  106060. if (storedKey) {
  106061. result.bytes = storedKey.bytes;
  106062. }
  106063. return result;
  106064. };
  106065. _proto.couldBeginLoading_ = function couldBeginLoading_() {
  106066. return this.playlist_ && !this.paused();
  106067. };
  106068. _proto.load = function load() {
  106069. this.monitorBuffer_();
  106070. if (!this.playlist_) {
  106071. return;
  106072. }
  106073. if (this.state === "INIT" && this.couldBeginLoading_()) {
  106074. return this.init_();
  106075. }
  106076. if (!this.couldBeginLoading_() || this.state !== "READY" && this.state !== "INIT") {
  106077. return;
  106078. }
  106079. this.state = "READY";
  106080. };
  106081. _proto.init_ = function init_() {
  106082. this.state = "READY";
  106083. this.resetEverything();
  106084. return this.monitorBuffer_();
  106085. };
  106086. _proto.playlist = function playlist(newPlaylist, options2) {
  106087. if (options2 === void 0) {
  106088. options2 = {};
  106089. }
  106090. if (!newPlaylist) {
  106091. return;
  106092. }
  106093. var oldPlaylist = this.playlist_;
  106094. var segmentInfo = this.pendingSegment_;
  106095. this.playlist_ = newPlaylist;
  106096. this.xhrOptions_ = options2;
  106097. if (this.state === "INIT") {
  106098. newPlaylist.syncInfo = {
  106099. mediaSequence: newPlaylist.mediaSequence,
  106100. time: 0
  106101. };
  106102. if (this.loaderType_ === "main") {
  106103. this.syncController_.setDateTimeMappingForStart(newPlaylist);
  106104. }
  106105. }
  106106. var oldId = null;
  106107. if (oldPlaylist) {
  106108. if (oldPlaylist.id) {
  106109. oldId = oldPlaylist.id;
  106110. } else if (oldPlaylist.uri) {
  106111. oldId = oldPlaylist.uri;
  106112. }
  106113. }
  106114. this.logger_("playlist update [" + oldId + " => " + (newPlaylist.id || newPlaylist.uri) + "]");
  106115. this.trigger("syncinfoupdate");
  106116. if (this.state === "INIT" && this.couldBeginLoading_()) {
  106117. return this.init_();
  106118. }
  106119. if (!oldPlaylist || oldPlaylist.uri !== newPlaylist.uri) {
  106120. if (this.mediaIndex !== null) {
  106121. if (!newPlaylist.endList) {
  106122. this.resetLoader();
  106123. } else {
  106124. this.resyncLoader();
  106125. }
  106126. }
  106127. this.currentMediaInfo_ = void 0;
  106128. this.trigger("playlistupdate");
  106129. return;
  106130. }
  106131. var mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;
  106132. this.logger_("live window shift [" + mediaSequenceDiff + "]");
  106133. if (this.mediaIndex !== null) {
  106134. this.mediaIndex -= mediaSequenceDiff;
  106135. if (this.mediaIndex < 0) {
  106136. this.mediaIndex = null;
  106137. this.partIndex = null;
  106138. } else {
  106139. var segment = this.playlist_.segments[this.mediaIndex];
  106140. if (this.partIndex && (!segment.parts || !segment.parts.length || !segment.parts[this.partIndex])) {
  106141. var mediaIndex = this.mediaIndex;
  106142. this.logger_("currently processing part (index " + this.partIndex + ") no longer exists.");
  106143. this.resetLoader();
  106144. this.mediaIndex = mediaIndex;
  106145. }
  106146. }
  106147. }
  106148. if (segmentInfo) {
  106149. segmentInfo.mediaIndex -= mediaSequenceDiff;
  106150. if (segmentInfo.mediaIndex < 0) {
  106151. segmentInfo.mediaIndex = null;
  106152. segmentInfo.partIndex = null;
  106153. } else {
  106154. if (segmentInfo.mediaIndex >= 0) {
  106155. segmentInfo.segment = newPlaylist.segments[segmentInfo.mediaIndex];
  106156. }
  106157. if (segmentInfo.partIndex >= 0 && segmentInfo.segment.parts) {
  106158. segmentInfo.part = segmentInfo.segment.parts[segmentInfo.partIndex];
  106159. }
  106160. }
  106161. }
  106162. this.syncController_.saveExpiredSegmentInfo(oldPlaylist, newPlaylist);
  106163. };
  106164. _proto.pause = function pause() {
  106165. if (this.checkBufferTimeout_) {
  106166. window_1.clearTimeout(this.checkBufferTimeout_);
  106167. this.checkBufferTimeout_ = null;
  106168. }
  106169. };
  106170. _proto.paused = function paused() {
  106171. return this.checkBufferTimeout_ === null;
  106172. };
  106173. _proto.resetEverything = function resetEverything(done) {
  106174. this.ended_ = false;
  106175. this.activeInitSegmentId_ = null;
  106176. this.appendInitSegment_ = {
  106177. audio: true,
  106178. video: true
  106179. };
  106180. this.resetLoader();
  106181. this.remove(0, Infinity, done);
  106182. if (this.transmuxer_) {
  106183. this.transmuxer_.postMessage({
  106184. action: "clearAllMp4Captions"
  106185. });
  106186. this.transmuxer_.postMessage({
  106187. action: "reset"
  106188. });
  106189. }
  106190. };
  106191. _proto.resetLoader = function resetLoader() {
  106192. this.fetchAtBuffer_ = false;
  106193. this.resyncLoader();
  106194. };
  106195. _proto.resyncLoader = function resyncLoader() {
  106196. if (this.transmuxer_) {
  106197. segmentTransmuxer.reset(this.transmuxer_);
  106198. }
  106199. this.mediaIndex = null;
  106200. this.partIndex = null;
  106201. this.syncPoint_ = null;
  106202. this.isPendingTimestampOffset_ = false;
  106203. this.callQueue_ = [];
  106204. this.loadQueue_ = [];
  106205. this.metadataQueue_.id3 = [];
  106206. this.metadataQueue_.caption = [];
  106207. this.abort();
  106208. if (this.transmuxer_) {
  106209. this.transmuxer_.postMessage({
  106210. action: "clearParsedMp4Captions"
  106211. });
  106212. }
  106213. };
  106214. _proto.remove = function remove2(start2, end, done, force) {
  106215. if (done === void 0) {
  106216. done = function done2() {
  106217. };
  106218. }
  106219. if (force === void 0) {
  106220. force = false;
  106221. }
  106222. if (end === Infinity) {
  106223. end = this.duration_();
  106224. }
  106225. if (end <= start2) {
  106226. this.logger_("skipping remove because end ${end} is <= start ${start}");
  106227. return;
  106228. }
  106229. if (!this.sourceUpdater_ || !this.getMediaInfo_()) {
  106230. this.logger_("skipping remove because no source updater or starting media info");
  106231. return;
  106232. }
  106233. var removesRemaining = 1;
  106234. var removeFinished = function removeFinished2() {
  106235. removesRemaining--;
  106236. if (removesRemaining === 0) {
  106237. done();
  106238. }
  106239. };
  106240. if (force || !this.audioDisabled_) {
  106241. removesRemaining++;
  106242. this.sourceUpdater_.removeAudio(start2, end, removeFinished);
  106243. }
  106244. if (force || this.loaderType_ === "main") {
  106245. this.gopBuffer_ = removeGopBuffer(this.gopBuffer_, start2, end, this.timeMapping_);
  106246. removesRemaining++;
  106247. this.sourceUpdater_.removeVideo(start2, end, removeFinished);
  106248. }
  106249. for (var track in this.inbandTextTracks_) {
  106250. removeCuesFromTrack(start2, end, this.inbandTextTracks_[track]);
  106251. }
  106252. removeCuesFromTrack(start2, end, this.segmentMetadataTrack_);
  106253. removeFinished();
  106254. };
  106255. _proto.monitorBuffer_ = function monitorBuffer_() {
  106256. if (this.checkBufferTimeout_) {
  106257. window_1.clearTimeout(this.checkBufferTimeout_);
  106258. }
  106259. this.checkBufferTimeout_ = window_1.setTimeout(this.monitorBufferTick_.bind(this), 1);
  106260. };
  106261. _proto.monitorBufferTick_ = function monitorBufferTick_() {
  106262. if (this.state === "READY") {
  106263. this.fillBuffer_();
  106264. }
  106265. if (this.checkBufferTimeout_) {
  106266. window_1.clearTimeout(this.checkBufferTimeout_);
  106267. }
  106268. this.checkBufferTimeout_ = window_1.setTimeout(this.monitorBufferTick_.bind(this), CHECK_BUFFER_DELAY);
  106269. };
  106270. _proto.fillBuffer_ = function fillBuffer_() {
  106271. if (this.sourceUpdater_.updating()) {
  106272. return;
  106273. }
  106274. var segmentInfo = this.chooseNextRequest_();
  106275. if (!segmentInfo) {
  106276. return;
  106277. }
  106278. if (typeof segmentInfo.timestampOffset === "number") {
  106279. this.isPendingTimestampOffset_ = false;
  106280. this.timelineChangeController_.pendingTimelineChange({
  106281. type: this.loaderType_,
  106282. from: this.currentTimeline_,
  106283. to: segmentInfo.timeline
  106284. });
  106285. }
  106286. this.loadSegment_(segmentInfo);
  106287. };
  106288. _proto.isEndOfStream_ = function isEndOfStream_(mediaIndex, playlist, partIndex) {
  106289. if (mediaIndex === void 0) {
  106290. mediaIndex = this.mediaIndex;
  106291. }
  106292. if (playlist === void 0) {
  106293. playlist = this.playlist_;
  106294. }
  106295. if (partIndex === void 0) {
  106296. partIndex = this.partIndex;
  106297. }
  106298. if (!playlist || !this.mediaSource_) {
  106299. return false;
  106300. }
  106301. var segment = typeof mediaIndex === "number" && playlist.segments[mediaIndex];
  106302. var appendedLastSegment = mediaIndex + 1 === playlist.segments.length;
  106303. var appendedLastPart = !segment || !segment.parts || partIndex + 1 === segment.parts.length;
  106304. return playlist.endList && this.mediaSource_.readyState === "open" && appendedLastSegment && appendedLastPart;
  106305. };
  106306. _proto.chooseNextRequest_ = function chooseNextRequest_() {
  106307. var buffered = this.buffered_();
  106308. var bufferedEnd = lastBufferedEnd(buffered) || 0;
  106309. var bufferedTime = timeAheadOf(buffered, this.currentTime_());
  106310. var preloaded = !this.hasPlayed_() && bufferedTime >= 1;
  106311. var haveEnoughBuffer = bufferedTime >= this.goalBufferLength_();
  106312. var segments = this.playlist_.segments;
  106313. if (!segments.length || preloaded || haveEnoughBuffer) {
  106314. return null;
  106315. }
  106316. this.syncPoint_ = this.syncPoint_ || this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_());
  106317. var next = {
  106318. partIndex: null,
  106319. mediaIndex: null,
  106320. startOfSegment: null,
  106321. playlist: this.playlist_,
  106322. isSyncRequest: Boolean(!this.syncPoint_)
  106323. };
  106324. if (next.isSyncRequest) {
  106325. next.mediaIndex = getSyncSegmentCandidate(this.currentTimeline_, segments, bufferedEnd);
  106326. } else if (this.mediaIndex !== null) {
  106327. var segment = segments[this.mediaIndex];
  106328. var partIndex = typeof this.partIndex === "number" ? this.partIndex : -1;
  106329. next.startOfSegment = segment.end ? segment.end : bufferedEnd;
  106330. if (segment.parts && segment.parts[partIndex + 1]) {
  106331. next.mediaIndex = this.mediaIndex;
  106332. next.partIndex = partIndex + 1;
  106333. } else {
  106334. next.mediaIndex = this.mediaIndex + 1;
  106335. }
  106336. } else {
  106337. var _Playlist$getMediaInf = Playlist.getMediaInfoForTime({
  106338. experimentalExactManifestTimings: this.experimentalExactManifestTimings,
  106339. playlist: this.playlist_,
  106340. currentTime: this.fetchAtBuffer_ ? bufferedEnd : this.currentTime_(),
  106341. startingPartIndex: this.syncPoint_.partIndex,
  106342. startingSegmentIndex: this.syncPoint_.segmentIndex,
  106343. startTime: this.syncPoint_.time
  106344. }), segmentIndex = _Playlist$getMediaInf.segmentIndex, startTime = _Playlist$getMediaInf.startTime, _partIndex = _Playlist$getMediaInf.partIndex;
  106345. next.getMediaInfoForTime = this.fetchAtBuffer_ ? "bufferedEnd " + bufferedEnd : "currentTime " + this.currentTime_();
  106346. next.mediaIndex = segmentIndex;
  106347. next.startOfSegment = startTime;
  106348. next.partIndex = _partIndex;
  106349. }
  106350. var nextSegment = segments[next.mediaIndex];
  106351. var nextPart = nextSegment && typeof next.partIndex === "number" && nextSegment.parts && nextSegment.parts[next.partIndex];
  106352. if (!nextSegment || typeof next.partIndex === "number" && !nextPart) {
  106353. return null;
  106354. }
  106355. if (typeof next.partIndex !== "number" && nextSegment.parts) {
  106356. next.partIndex = 0;
  106357. nextPart = nextSegment.parts[0];
  106358. }
  106359. if (!bufferedTime && nextPart && !nextPart.independent) {
  106360. if (next.partIndex === 0) {
  106361. var lastSegment = segments[next.mediaIndex - 1];
  106362. var lastSegmentLastPart = lastSegment.parts && lastSegment.parts.length && lastSegment.parts[lastSegment.parts.length - 1];
  106363. if (lastSegmentLastPart && lastSegmentLastPart.independent) {
  106364. next.mediaIndex -= 1;
  106365. next.partIndex = lastSegment.parts.length - 1;
  106366. next.independent = "previous segment";
  106367. }
  106368. } else if (nextSegment.parts[next.partIndex - 1].independent) {
  106369. next.partIndex -= 1;
  106370. next.independent = "previous part";
  106371. }
  106372. }
  106373. var ended = this.mediaSource_ && this.mediaSource_.readyState === "ended";
  106374. if (next.mediaIndex >= segments.length - 1 && ended && !this.seeking_()) {
  106375. return null;
  106376. }
  106377. return this.generateSegmentInfo_(next);
  106378. };
  106379. _proto.generateSegmentInfo_ = function generateSegmentInfo_(options2) {
  106380. var independent = options2.independent, playlist = options2.playlist, mediaIndex = options2.mediaIndex, startOfSegment = options2.startOfSegment, isSyncRequest = options2.isSyncRequest, partIndex = options2.partIndex, forceTimestampOffset = options2.forceTimestampOffset, getMediaInfoForTime3 = options2.getMediaInfoForTime;
  106381. var segment = playlist.segments[mediaIndex];
  106382. var part = typeof partIndex === "number" && segment.parts[partIndex];
  106383. var segmentInfo = {
  106384. requestId: "segment-loader-" + Math.random(),
  106385. uri: part && part.resolvedUri || segment.resolvedUri,
  106386. mediaIndex,
  106387. partIndex: part ? partIndex : null,
  106388. isSyncRequest,
  106389. startOfSegment,
  106390. playlist,
  106391. bytes: null,
  106392. encryptedBytes: null,
  106393. timestampOffset: null,
  106394. timeline: segment.timeline,
  106395. duration: part && part.duration || segment.duration,
  106396. segment,
  106397. part,
  106398. byteLength: 0,
  106399. transmuxer: this.transmuxer_,
  106400. getMediaInfoForTime: getMediaInfoForTime3,
  106401. independent
  106402. };
  106403. var overrideCheck = typeof forceTimestampOffset !== "undefined" ? forceTimestampOffset : this.isPendingTimestampOffset_;
  106404. segmentInfo.timestampOffset = this.timestampOffsetForSegment_({
  106405. segmentTimeline: segment.timeline,
  106406. currentTimeline: this.currentTimeline_,
  106407. startOfSegment,
  106408. buffered: this.buffered_(),
  106409. overrideCheck
  106410. });
  106411. var audioBufferedEnd = lastBufferedEnd(this.sourceUpdater_.audioBuffered());
  106412. if (typeof audioBufferedEnd === "number") {
  106413. segmentInfo.audioAppendStart = audioBufferedEnd - this.sourceUpdater_.audioTimestampOffset();
  106414. }
  106415. if (this.sourceUpdater_.videoBuffered().length) {
  106416. segmentInfo.gopsToAlignWith = gopsSafeToAlignWith(
  106417. this.gopBuffer_,
  106418. this.currentTime_() - this.sourceUpdater_.videoTimestampOffset(),
  106419. this.timeMapping_
  106420. );
  106421. }
  106422. return segmentInfo;
  106423. };
  106424. _proto.timestampOffsetForSegment_ = function timestampOffsetForSegment_(options2) {
  106425. return timestampOffsetForSegment(options2);
  106426. };
  106427. _proto.earlyAbortWhenNeeded_ = function earlyAbortWhenNeeded_(stats) {
  106428. if (this.vhs_.tech_.paused() || !this.xhrOptions_.timeout || !this.playlist_.attributes.BANDWIDTH) {
  106429. return;
  106430. }
  106431. if (Date.now() - (stats.firstBytesReceivedAt || Date.now()) < 1e3) {
  106432. return;
  106433. }
  106434. var currentTime = this.currentTime_();
  106435. var measuredBandwidth = stats.bandwidth;
  106436. var segmentDuration = this.pendingSegment_.duration;
  106437. var requestTimeRemaining = Playlist.estimateSegmentRequestTime(segmentDuration, measuredBandwidth, this.playlist_, stats.bytesReceived);
  106438. var timeUntilRebuffer$12 = timeUntilRebuffer(this.buffered_(), currentTime, this.vhs_.tech_.playbackRate()) - 1;
  106439. if (requestTimeRemaining <= timeUntilRebuffer$12) {
  106440. return;
  106441. }
  106442. var switchCandidate = minRebufferMaxBandwidthSelector({
  106443. master: this.vhs_.playlists.master,
  106444. currentTime,
  106445. bandwidth: measuredBandwidth,
  106446. duration: this.duration_(),
  106447. segmentDuration,
  106448. timeUntilRebuffer: timeUntilRebuffer$12,
  106449. currentTimeline: this.currentTimeline_,
  106450. syncController: this.syncController_
  106451. });
  106452. if (!switchCandidate) {
  106453. return;
  106454. }
  106455. var rebufferingImpact = requestTimeRemaining - timeUntilRebuffer$12;
  106456. var timeSavedBySwitching = rebufferingImpact - switchCandidate.rebufferingImpact;
  106457. var minimumTimeSaving = 0.5;
  106458. if (timeUntilRebuffer$12 <= TIME_FUDGE_FACTOR) {
  106459. minimumTimeSaving = 1;
  106460. }
  106461. if (!switchCandidate.playlist || switchCandidate.playlist.uri === this.playlist_.uri || timeSavedBySwitching < minimumTimeSaving) {
  106462. return;
  106463. }
  106464. this.bandwidth = switchCandidate.playlist.attributes.BANDWIDTH * Config.BANDWIDTH_VARIANCE + 1;
  106465. this.trigger("earlyabort");
  106466. };
  106467. _proto.handleAbort_ = function handleAbort_(segmentInfo) {
  106468. this.logger_("Aborting " + segmentInfoString(segmentInfo));
  106469. this.mediaRequestsAborted += 1;
  106470. };
  106471. _proto.handleProgress_ = function handleProgress_(event2, simpleSegment) {
  106472. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106473. if (this.checkForAbort_(simpleSegment.requestId)) {
  106474. return;
  106475. }
  106476. this.trigger("progress");
  106477. };
  106478. _proto.handleTrackInfo_ = function handleTrackInfo_(simpleSegment, trackInfo) {
  106479. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106480. if (this.checkForAbort_(simpleSegment.requestId)) {
  106481. return;
  106482. }
  106483. if (this.checkForIllegalMediaSwitch(trackInfo)) {
  106484. return;
  106485. }
  106486. trackInfo = trackInfo || {};
  106487. if (!shallowEqual(this.currentMediaInfo_, trackInfo)) {
  106488. this.appendInitSegment_ = {
  106489. audio: true,
  106490. video: true
  106491. };
  106492. this.startingMediaInfo_ = trackInfo;
  106493. this.currentMediaInfo_ = trackInfo;
  106494. this.logger_("trackinfo update", trackInfo);
  106495. this.trigger("trackinfo");
  106496. }
  106497. if (this.checkForAbort_(simpleSegment.requestId)) {
  106498. return;
  106499. }
  106500. this.pendingSegment_.trackInfo = trackInfo;
  106501. if (this.hasEnoughInfoToAppend_()) {
  106502. this.processCallQueue_();
  106503. }
  106504. };
  106505. _proto.handleTimingInfo_ = function handleTimingInfo_(simpleSegment, mediaType, timeType, time) {
  106506. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106507. if (this.checkForAbort_(simpleSegment.requestId)) {
  106508. return;
  106509. }
  106510. var segmentInfo = this.pendingSegment_;
  106511. var timingInfoProperty = timingInfoPropertyForMedia(mediaType);
  106512. segmentInfo[timingInfoProperty] = segmentInfo[timingInfoProperty] || {};
  106513. segmentInfo[timingInfoProperty][timeType] = time;
  106514. this.logger_("timinginfo: " + mediaType + " - " + timeType + " - " + time);
  106515. if (this.hasEnoughInfoToAppend_()) {
  106516. this.processCallQueue_();
  106517. }
  106518. };
  106519. _proto.handleCaptions_ = function handleCaptions_(simpleSegment, captionData) {
  106520. var _this2 = this;
  106521. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106522. if (this.checkForAbort_(simpleSegment.requestId)) {
  106523. return;
  106524. }
  106525. if (captionData.length === 0) {
  106526. this.logger_("SegmentLoader received no captions from a caption event");
  106527. return;
  106528. }
  106529. var segmentInfo = this.pendingSegment_;
  106530. if (!segmentInfo.hasAppendedData_) {
  106531. this.metadataQueue_.caption.push(this.handleCaptions_.bind(this, simpleSegment, captionData));
  106532. return;
  106533. }
  106534. var timestampOffset2 = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset();
  106535. var captionTracks = {};
  106536. captionData.forEach(function(caption) {
  106537. captionTracks[caption.stream] = captionTracks[caption.stream] || {
  106538. startTime: Infinity,
  106539. captions: [],
  106540. endTime: 0
  106541. };
  106542. var captionTrack = captionTracks[caption.stream];
  106543. captionTrack.startTime = Math.min(captionTrack.startTime, caption.startTime + timestampOffset2);
  106544. captionTrack.endTime = Math.max(captionTrack.endTime, caption.endTime + timestampOffset2);
  106545. captionTrack.captions.push(caption);
  106546. });
  106547. Object.keys(captionTracks).forEach(function(trackName) {
  106548. var _captionTracks$trackN = captionTracks[trackName], startTime = _captionTracks$trackN.startTime, endTime = _captionTracks$trackN.endTime, captions = _captionTracks$trackN.captions;
  106549. var inbandTextTracks = _this2.inbandTextTracks_;
  106550. _this2.logger_("adding cues from " + startTime + " -> " + endTime + " for " + trackName);
  106551. createCaptionsTrackIfNotExists(inbandTextTracks, _this2.vhs_.tech_, trackName);
  106552. removeCuesFromTrack(startTime, endTime, inbandTextTracks[trackName]);
  106553. addCaptionData({
  106554. captionArray: captions,
  106555. inbandTextTracks,
  106556. timestampOffset: timestampOffset2
  106557. });
  106558. });
  106559. if (this.transmuxer_) {
  106560. this.transmuxer_.postMessage({
  106561. action: "clearParsedMp4Captions"
  106562. });
  106563. }
  106564. };
  106565. _proto.handleId3_ = function handleId3_(simpleSegment, id3Frames, dispatchType) {
  106566. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106567. if (this.checkForAbort_(simpleSegment.requestId)) {
  106568. return;
  106569. }
  106570. var segmentInfo = this.pendingSegment_;
  106571. if (!segmentInfo.hasAppendedData_) {
  106572. this.metadataQueue_.id3.push(this.handleId3_.bind(this, simpleSegment, id3Frames, dispatchType));
  106573. return;
  106574. }
  106575. var timestampOffset2 = this.sourceUpdater_.videoTimestampOffset() === null ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset();
  106576. createMetadataTrackIfNotExists(this.inbandTextTracks_, dispatchType, this.vhs_.tech_);
  106577. addMetadata({
  106578. inbandTextTracks: this.inbandTextTracks_,
  106579. metadataArray: id3Frames,
  106580. timestampOffset: timestampOffset2,
  106581. videoDuration: this.duration_()
  106582. });
  106583. };
  106584. _proto.processMetadataQueue_ = function processMetadataQueue_() {
  106585. this.metadataQueue_.id3.forEach(function(fn2) {
  106586. return fn2();
  106587. });
  106588. this.metadataQueue_.caption.forEach(function(fn2) {
  106589. return fn2();
  106590. });
  106591. this.metadataQueue_.id3 = [];
  106592. this.metadataQueue_.caption = [];
  106593. };
  106594. _proto.processCallQueue_ = function processCallQueue_() {
  106595. var callQueue = this.callQueue_;
  106596. this.callQueue_ = [];
  106597. callQueue.forEach(function(fun) {
  106598. return fun();
  106599. });
  106600. };
  106601. _proto.processLoadQueue_ = function processLoadQueue_() {
  106602. var loadQueue = this.loadQueue_;
  106603. this.loadQueue_ = [];
  106604. loadQueue.forEach(function(fun) {
  106605. return fun();
  106606. });
  106607. };
  106608. _proto.hasEnoughInfoToLoad_ = function hasEnoughInfoToLoad_() {
  106609. if (this.loaderType_ !== "audio") {
  106610. return true;
  106611. }
  106612. var segmentInfo = this.pendingSegment_;
  106613. if (!segmentInfo) {
  106614. return false;
  106615. }
  106616. if (!this.getCurrentMediaInfo_()) {
  106617. return true;
  106618. }
  106619. if (shouldWaitForTimelineChange({
  106620. timelineChangeController: this.timelineChangeController_,
  106621. currentTimeline: this.currentTimeline_,
  106622. segmentTimeline: segmentInfo.timeline,
  106623. loaderType: this.loaderType_,
  106624. audioDisabled: this.audioDisabled_
  106625. })) {
  106626. return false;
  106627. }
  106628. return true;
  106629. };
  106630. _proto.getCurrentMediaInfo_ = function getCurrentMediaInfo_(segmentInfo) {
  106631. if (segmentInfo === void 0) {
  106632. segmentInfo = this.pendingSegment_;
  106633. }
  106634. return segmentInfo && segmentInfo.trackInfo || this.currentMediaInfo_;
  106635. };
  106636. _proto.getMediaInfo_ = function getMediaInfo_(segmentInfo) {
  106637. if (segmentInfo === void 0) {
  106638. segmentInfo = this.pendingSegment_;
  106639. }
  106640. return this.getCurrentMediaInfo_(segmentInfo) || this.startingMediaInfo_;
  106641. };
  106642. _proto.getPendingSegmentPlaylist = function getPendingSegmentPlaylist() {
  106643. return this.pendingSegment_ ? this.pendingSegment_.playlist : null;
  106644. };
  106645. _proto.hasEnoughInfoToAppend_ = function hasEnoughInfoToAppend_() {
  106646. if (!this.sourceUpdater_.ready()) {
  106647. return false;
  106648. }
  106649. if (this.waitingOnRemove_ || this.quotaExceededErrorRetryTimeout_) {
  106650. return false;
  106651. }
  106652. var segmentInfo = this.pendingSegment_;
  106653. var trackInfo = this.getCurrentMediaInfo_();
  106654. if (!segmentInfo || !trackInfo) {
  106655. return false;
  106656. }
  106657. var hasAudio = trackInfo.hasAudio, hasVideo = trackInfo.hasVideo, isMuxed3 = trackInfo.isMuxed;
  106658. if (hasVideo && !segmentInfo.videoTimingInfo) {
  106659. return false;
  106660. }
  106661. if (hasAudio && !this.audioDisabled_ && !isMuxed3 && !segmentInfo.audioTimingInfo) {
  106662. return false;
  106663. }
  106664. if (shouldWaitForTimelineChange({
  106665. timelineChangeController: this.timelineChangeController_,
  106666. currentTimeline: this.currentTimeline_,
  106667. segmentTimeline: segmentInfo.timeline,
  106668. loaderType: this.loaderType_,
  106669. audioDisabled: this.audioDisabled_
  106670. })) {
  106671. return false;
  106672. }
  106673. return true;
  106674. };
  106675. _proto.handleData_ = function handleData_3(simpleSegment, result) {
  106676. this.earlyAbortWhenNeeded_(simpleSegment.stats);
  106677. if (this.checkForAbort_(simpleSegment.requestId)) {
  106678. return;
  106679. }
  106680. if (this.callQueue_.length || !this.hasEnoughInfoToAppend_()) {
  106681. this.callQueue_.push(this.handleData_.bind(this, simpleSegment, result));
  106682. return;
  106683. }
  106684. var segmentInfo = this.pendingSegment_;
  106685. this.setTimeMapping_(segmentInfo.timeline);
  106686. this.updateMediaSecondsLoaded_(segmentInfo.part || segmentInfo.segment);
  106687. if (this.mediaSource_.readyState === "closed") {
  106688. return;
  106689. }
  106690. if (simpleSegment.map) {
  106691. simpleSegment.map = this.initSegmentForMap(simpleSegment.map, true);
  106692. segmentInfo.segment.map = simpleSegment.map;
  106693. }
  106694. if (simpleSegment.key) {
  106695. this.segmentKey(simpleSegment.key, true);
  106696. }
  106697. segmentInfo.isFmp4 = simpleSegment.isFmp4;
  106698. segmentInfo.timingInfo = segmentInfo.timingInfo || {};
  106699. if (segmentInfo.isFmp4) {
  106700. this.trigger("fmp4");
  106701. segmentInfo.timingInfo.start = segmentInfo[timingInfoPropertyForMedia(result.type)].start;
  106702. } else {
  106703. var trackInfo = this.getCurrentMediaInfo_();
  106704. var useVideoTimingInfo = this.loaderType_ === "main" && trackInfo && trackInfo.hasVideo;
  106705. var firstVideoFrameTimeForData;
  106706. if (useVideoTimingInfo) {
  106707. firstVideoFrameTimeForData = segmentInfo.videoTimingInfo.start;
  106708. }
  106709. segmentInfo.timingInfo.start = this.trueSegmentStart_({
  106710. currentStart: segmentInfo.timingInfo.start,
  106711. playlist: segmentInfo.playlist,
  106712. mediaIndex: segmentInfo.mediaIndex,
  106713. currentVideoTimestampOffset: this.sourceUpdater_.videoTimestampOffset(),
  106714. useVideoTimingInfo,
  106715. firstVideoFrameTimeForData,
  106716. videoTimingInfo: segmentInfo.videoTimingInfo,
  106717. audioTimingInfo: segmentInfo.audioTimingInfo
  106718. });
  106719. }
  106720. this.updateAppendInitSegmentStatus(segmentInfo, result.type);
  106721. this.updateSourceBufferTimestampOffset_(segmentInfo);
  106722. if (segmentInfo.isSyncRequest) {
  106723. this.updateTimingInfoEnd_(segmentInfo);
  106724. this.syncController_.saveSegmentTimingInfo({
  106725. segmentInfo,
  106726. shouldSaveTimelineMapping: this.loaderType_ === "main"
  106727. });
  106728. var next = this.chooseNextRequest_();
  106729. if (next.mediaIndex !== segmentInfo.mediaIndex || next.partIndex !== segmentInfo.partIndex) {
  106730. this.logger_("sync segment was incorrect, not appending");
  106731. return;
  106732. }
  106733. this.logger_("sync segment was correct, appending");
  106734. }
  106735. segmentInfo.hasAppendedData_ = true;
  106736. this.processMetadataQueue_();
  106737. this.appendData_(segmentInfo, result);
  106738. };
  106739. _proto.updateAppendInitSegmentStatus = function updateAppendInitSegmentStatus(segmentInfo, type2) {
  106740. if (this.loaderType_ === "main" && typeof segmentInfo.timestampOffset === "number" && !segmentInfo.changedTimestampOffset) {
  106741. this.appendInitSegment_ = {
  106742. audio: true,
  106743. video: true
  106744. };
  106745. }
  106746. if (this.playlistOfLastInitSegment_[type2] !== segmentInfo.playlist) {
  106747. this.appendInitSegment_[type2] = true;
  106748. }
  106749. };
  106750. _proto.getInitSegmentAndUpdateState_ = function getInitSegmentAndUpdateState_(_ref4) {
  106751. var type2 = _ref4.type, initSegment = _ref4.initSegment, map = _ref4.map, playlist = _ref4.playlist;
  106752. if (map) {
  106753. var id = initSegmentId(map);
  106754. if (this.activeInitSegmentId_ === id) {
  106755. return null;
  106756. }
  106757. initSegment = this.initSegmentForMap(map, true).bytes;
  106758. this.activeInitSegmentId_ = id;
  106759. }
  106760. if (initSegment && this.appendInitSegment_[type2]) {
  106761. this.playlistOfLastInitSegment_[type2] = playlist;
  106762. this.appendInitSegment_[type2] = false;
  106763. this.activeInitSegmentId_ = null;
  106764. return initSegment;
  106765. }
  106766. return null;
  106767. };
  106768. _proto.handleQuotaExceededError_ = function handleQuotaExceededError_(_ref5, error) {
  106769. var _this3 = this;
  106770. var segmentInfo = _ref5.segmentInfo, type2 = _ref5.type, bytes = _ref5.bytes;
  106771. var audioBuffered = this.sourceUpdater_.audioBuffered();
  106772. var videoBuffered = this.sourceUpdater_.videoBuffered();
  106773. if (audioBuffered.length > 1) {
  106774. this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: " + timeRangesToArray(audioBuffered).join(", "));
  106775. }
  106776. if (videoBuffered.length > 1) {
  106777. this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: " + timeRangesToArray(videoBuffered).join(", "));
  106778. }
  106779. var audioBufferStart = audioBuffered.length ? audioBuffered.start(0) : 0;
  106780. var audioBufferEnd = audioBuffered.length ? audioBuffered.end(audioBuffered.length - 1) : 0;
  106781. var videoBufferStart = videoBuffered.length ? videoBuffered.start(0) : 0;
  106782. var videoBufferEnd = videoBuffered.length ? videoBuffered.end(videoBuffered.length - 1) : 0;
  106783. if (audioBufferEnd - audioBufferStart <= MIN_BACK_BUFFER && videoBufferEnd - videoBufferStart <= MIN_BACK_BUFFER) {
  106784. this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. " + ("Appended byte length: " + bytes.byteLength + ", ") + ("audio buffer: " + timeRangesToArray(audioBuffered).join(", ") + ", ") + ("video buffer: " + timeRangesToArray(videoBuffered).join(", ") + ", "));
  106785. this.error({
  106786. message: "Quota exceeded error with append of a single segment of content",
  106787. excludeUntil: Infinity
  106788. });
  106789. this.trigger("error");
  106790. return;
  106791. }
  106792. this.waitingOnRemove_ = true;
  106793. this.callQueue_.push(this.appendToSourceBuffer_.bind(this, {
  106794. segmentInfo,
  106795. type: type2,
  106796. bytes
  106797. }));
  106798. var currentTime = this.currentTime_();
  106799. var timeToRemoveUntil = currentTime - MIN_BACK_BUFFER;
  106800. this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to " + timeToRemoveUntil);
  106801. this.remove(0, timeToRemoveUntil, function() {
  106802. _this3.logger_("On QUOTA_EXCEEDED_ERR, retrying append in " + MIN_BACK_BUFFER + "s");
  106803. _this3.waitingOnRemove_ = false;
  106804. _this3.quotaExceededErrorRetryTimeout_ = window_1.setTimeout(function() {
  106805. _this3.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue");
  106806. _this3.quotaExceededErrorRetryTimeout_ = null;
  106807. _this3.processCallQueue_();
  106808. }, MIN_BACK_BUFFER * 1e3);
  106809. }, true);
  106810. };
  106811. _proto.handleAppendError_ = function handleAppendError_(_ref6, error) {
  106812. var segmentInfo = _ref6.segmentInfo, type2 = _ref6.type, bytes = _ref6.bytes;
  106813. if (!error) {
  106814. return;
  106815. }
  106816. if (error.code === QUOTA_EXCEEDED_ERR) {
  106817. this.handleQuotaExceededError_({
  106818. segmentInfo,
  106819. type: type2,
  106820. bytes
  106821. });
  106822. return;
  106823. }
  106824. this.logger_("Received non QUOTA_EXCEEDED_ERR on append", error);
  106825. this.error(type2 + " append of " + bytes.length + "b failed for segment " + ("#" + segmentInfo.mediaIndex + " in playlist " + segmentInfo.playlist.id));
  106826. this.trigger("appenderror");
  106827. };
  106828. _proto.appendToSourceBuffer_ = function appendToSourceBuffer_(_ref7) {
  106829. var segmentInfo = _ref7.segmentInfo, type2 = _ref7.type, initSegment = _ref7.initSegment, data = _ref7.data, bytes = _ref7.bytes;
  106830. if (!bytes) {
  106831. var segments = [data];
  106832. var byteLength = data.byteLength;
  106833. if (initSegment) {
  106834. segments.unshift(initSegment);
  106835. byteLength += initSegment.byteLength;
  106836. }
  106837. bytes = concatSegments({
  106838. bytes: byteLength,
  106839. segments
  106840. });
  106841. }
  106842. this.sourceUpdater_.appendBuffer({
  106843. segmentInfo,
  106844. type: type2,
  106845. bytes
  106846. }, this.handleAppendError_.bind(this, {
  106847. segmentInfo,
  106848. type: type2,
  106849. bytes
  106850. }));
  106851. };
  106852. _proto.handleSegmentTimingInfo_ = function handleSegmentTimingInfo_(type2, requestId, segmentTimingInfo) {
  106853. if (!this.pendingSegment_ || requestId !== this.pendingSegment_.requestId) {
  106854. return;
  106855. }
  106856. var segment = this.pendingSegment_.segment;
  106857. var timingInfoProperty = type2 + "TimingInfo";
  106858. if (!segment[timingInfoProperty]) {
  106859. segment[timingInfoProperty] = {};
  106860. }
  106861. segment[timingInfoProperty].transmuxerPrependedSeconds = segmentTimingInfo.prependedContentDuration || 0;
  106862. segment[timingInfoProperty].transmuxedPresentationStart = segmentTimingInfo.start.presentation;
  106863. segment[timingInfoProperty].transmuxedDecodeStart = segmentTimingInfo.start.decode;
  106864. segment[timingInfoProperty].transmuxedPresentationEnd = segmentTimingInfo.end.presentation;
  106865. segment[timingInfoProperty].transmuxedDecodeEnd = segmentTimingInfo.end.decode;
  106866. segment[timingInfoProperty].baseMediaDecodeTime = segmentTimingInfo.baseMediaDecodeTime;
  106867. };
  106868. _proto.appendData_ = function appendData_(segmentInfo, result) {
  106869. var type2 = result.type, data = result.data;
  106870. if (!data || !data.byteLength) {
  106871. return;
  106872. }
  106873. if (type2 === "audio" && this.audioDisabled_) {
  106874. return;
  106875. }
  106876. var initSegment = this.getInitSegmentAndUpdateState_({
  106877. type: type2,
  106878. initSegment: result.initSegment,
  106879. playlist: segmentInfo.playlist,
  106880. map: segmentInfo.isFmp4 ? segmentInfo.segment.map : null
  106881. });
  106882. this.appendToSourceBuffer_({
  106883. segmentInfo,
  106884. type: type2,
  106885. initSegment,
  106886. data
  106887. });
  106888. };
  106889. _proto.loadSegment_ = function loadSegment_(segmentInfo) {
  106890. var _this4 = this;
  106891. this.state = "WAITING";
  106892. this.pendingSegment_ = segmentInfo;
  106893. this.trimBackBuffer_(segmentInfo);
  106894. if (typeof segmentInfo.timestampOffset === "number") {
  106895. if (this.transmuxer_) {
  106896. this.transmuxer_.postMessage({
  106897. action: "clearAllMp4Captions"
  106898. });
  106899. }
  106900. }
  106901. if (!this.hasEnoughInfoToLoad_()) {
  106902. this.loadQueue_.push(function() {
  106903. var options2 = _extends$2({}, segmentInfo, {
  106904. forceTimestampOffset: true
  106905. });
  106906. _extends$2(segmentInfo, _this4.generateSegmentInfo_(options2));
  106907. _this4.isPendingTimestampOffset_ = false;
  106908. _this4.updateTransmuxerAndRequestSegment_(segmentInfo);
  106909. });
  106910. return;
  106911. }
  106912. this.updateTransmuxerAndRequestSegment_(segmentInfo);
  106913. };
  106914. _proto.updateTransmuxerAndRequestSegment_ = function updateTransmuxerAndRequestSegment_(segmentInfo) {
  106915. var _this5 = this;
  106916. if (this.shouldUpdateTransmuxerTimestampOffset_(segmentInfo.timestampOffset)) {
  106917. this.gopBuffer_.length = 0;
  106918. segmentInfo.gopsToAlignWith = [];
  106919. this.timeMapping_ = 0;
  106920. this.transmuxer_.postMessage({
  106921. action: "reset"
  106922. });
  106923. this.transmuxer_.postMessage({
  106924. action: "setTimestampOffset",
  106925. timestampOffset: segmentInfo.timestampOffset
  106926. });
  106927. }
  106928. var simpleSegment = this.createSimplifiedSegmentObj_(segmentInfo);
  106929. var isEndOfStream = this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex);
  106930. var isWalkingForward = this.mediaIndex !== null;
  106931. var isDiscontinuity = segmentInfo.timeline !== this.currentTimeline_ && segmentInfo.timeline > 0;
  106932. var isEndOfTimeline = isEndOfStream || isWalkingForward && isDiscontinuity;
  106933. this.logger_("Requesting " + segmentInfoString(segmentInfo));
  106934. if (simpleSegment.map && !simpleSegment.map.bytes) {
  106935. this.logger_("going to request init segment.");
  106936. this.appendInitSegment_ = {
  106937. video: true,
  106938. audio: true
  106939. };
  106940. }
  106941. segmentInfo.abortRequests = mediaSegmentRequest({
  106942. xhr: this.vhs_.xhr,
  106943. xhrOptions: this.xhrOptions_,
  106944. decryptionWorker: this.decrypter_,
  106945. segment: simpleSegment,
  106946. abortFn: this.handleAbort_.bind(this, segmentInfo),
  106947. progressFn: this.handleProgress_.bind(this),
  106948. trackInfoFn: this.handleTrackInfo_.bind(this),
  106949. timingInfoFn: this.handleTimingInfo_.bind(this),
  106950. videoSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, "video", segmentInfo.requestId),
  106951. audioSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, "audio", segmentInfo.requestId),
  106952. captionsFn: this.handleCaptions_.bind(this),
  106953. isEndOfTimeline,
  106954. endedTimelineFn: function endedTimelineFn() {
  106955. _this5.logger_("received endedtimeline callback");
  106956. },
  106957. id3Fn: this.handleId3_.bind(this),
  106958. dataFn: this.handleData_.bind(this),
  106959. doneFn: this.segmentRequestFinished_.bind(this),
  106960. onTransmuxerLog: function onTransmuxerLog(_ref8) {
  106961. var message = _ref8.message, level = _ref8.level, stream = _ref8.stream;
  106962. _this5.logger_(segmentInfoString(segmentInfo) + " logged from transmuxer stream " + stream + " as a " + level + ": " + message);
  106963. }
  106964. });
  106965. };
  106966. _proto.trimBackBuffer_ = function trimBackBuffer_(segmentInfo) {
  106967. var removeToTime = safeBackBufferTrimTime(this.seekable_(), this.currentTime_(), this.playlist_.targetDuration || 10);
  106968. if (removeToTime > 0) {
  106969. this.remove(0, removeToTime);
  106970. }
  106971. };
  106972. _proto.createSimplifiedSegmentObj_ = function createSimplifiedSegmentObj_(segmentInfo) {
  106973. var segment = segmentInfo.segment;
  106974. var part = segmentInfo.part;
  106975. var simpleSegment = {
  106976. resolvedUri: part ? part.resolvedUri : segment.resolvedUri,
  106977. byterange: part ? part.byterange : segment.byterange,
  106978. requestId: segmentInfo.requestId,
  106979. transmuxer: segmentInfo.transmuxer,
  106980. audioAppendStart: segmentInfo.audioAppendStart,
  106981. gopsToAlignWith: segmentInfo.gopsToAlignWith,
  106982. part: segmentInfo.part
  106983. };
  106984. var previousSegment = segmentInfo.playlist.segments[segmentInfo.mediaIndex - 1];
  106985. if (previousSegment && previousSegment.timeline === segment.timeline) {
  106986. if (previousSegment.videoTimingInfo) {
  106987. simpleSegment.baseStartTime = previousSegment.videoTimingInfo.transmuxedDecodeEnd;
  106988. } else if (previousSegment.audioTimingInfo) {
  106989. simpleSegment.baseStartTime = previousSegment.audioTimingInfo.transmuxedDecodeEnd;
  106990. }
  106991. }
  106992. if (segment.key) {
  106993. var iv = segment.key.iv || new Uint32Array([0, 0, 0, segmentInfo.mediaIndex + segmentInfo.playlist.mediaSequence]);
  106994. simpleSegment.key = this.segmentKey(segment.key);
  106995. simpleSegment.key.iv = iv;
  106996. }
  106997. if (segment.map) {
  106998. simpleSegment.map = this.initSegmentForMap(segment.map);
  106999. }
  107000. return simpleSegment;
  107001. };
  107002. _proto.saveTransferStats_ = function saveTransferStats_(stats) {
  107003. this.mediaRequests += 1;
  107004. if (stats) {
  107005. this.mediaBytesTransferred += stats.bytesReceived;
  107006. this.mediaTransferDuration += stats.roundTripTime;
  107007. }
  107008. };
  107009. _proto.saveBandwidthRelatedStats_ = function saveBandwidthRelatedStats_(duration5, stats) {
  107010. this.pendingSegment_.byteLength = stats.bytesReceived;
  107011. if (duration5 < MIN_SEGMENT_DURATION_TO_SAVE_STATS) {
  107012. this.logger_("Ignoring segment's bandwidth because its duration of " + duration5 + (" is less than the min to record " + MIN_SEGMENT_DURATION_TO_SAVE_STATS));
  107013. return;
  107014. }
  107015. this.bandwidth = stats.bandwidth;
  107016. this.roundTrip = stats.roundTripTime;
  107017. };
  107018. _proto.handleTimeout_ = function handleTimeout_() {
  107019. this.mediaRequestsTimedout += 1;
  107020. this.bandwidth = 1;
  107021. this.roundTrip = NaN;
  107022. this.trigger("bandwidthupdate");
  107023. this.trigger("timeout");
  107024. };
  107025. _proto.segmentRequestFinished_ = function segmentRequestFinished_(error, simpleSegment, result) {
  107026. if (this.callQueue_.length) {
  107027. this.callQueue_.push(this.segmentRequestFinished_.bind(this, error, simpleSegment, result));
  107028. return;
  107029. }
  107030. this.saveTransferStats_(simpleSegment.stats);
  107031. if (!this.pendingSegment_) {
  107032. return;
  107033. }
  107034. if (simpleSegment.requestId !== this.pendingSegment_.requestId) {
  107035. return;
  107036. }
  107037. if (error) {
  107038. this.pendingSegment_ = null;
  107039. this.state = "READY";
  107040. if (error.code === REQUEST_ERRORS.ABORTED) {
  107041. return;
  107042. }
  107043. this.pause();
  107044. if (error.code === REQUEST_ERRORS.TIMEOUT) {
  107045. this.handleTimeout_();
  107046. return;
  107047. }
  107048. this.mediaRequestsErrored += 1;
  107049. this.error(error);
  107050. this.trigger("error");
  107051. return;
  107052. }
  107053. var segmentInfo = this.pendingSegment_;
  107054. this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);
  107055. segmentInfo.endOfAllRequests = simpleSegment.endOfAllRequests;
  107056. if (result.gopInfo) {
  107057. this.gopBuffer_ = updateGopBuffer(this.gopBuffer_, result.gopInfo, this.safeAppend_);
  107058. }
  107059. this.state = "APPENDING";
  107060. this.trigger("appending");
  107061. this.waitForAppendsToComplete_(segmentInfo);
  107062. };
  107063. _proto.setTimeMapping_ = function setTimeMapping_(timeline) {
  107064. var timelineMapping = this.syncController_.mappingForTimeline(timeline);
  107065. if (timelineMapping !== null) {
  107066. this.timeMapping_ = timelineMapping;
  107067. }
  107068. };
  107069. _proto.updateMediaSecondsLoaded_ = function updateMediaSecondsLoaded_(segment) {
  107070. if (typeof segment.start === "number" && typeof segment.end === "number") {
  107071. this.mediaSecondsLoaded += segment.end - segment.start;
  107072. } else {
  107073. this.mediaSecondsLoaded += segment.duration;
  107074. }
  107075. };
  107076. _proto.shouldUpdateTransmuxerTimestampOffset_ = function shouldUpdateTransmuxerTimestampOffset_(timestampOffset2) {
  107077. if (timestampOffset2 === null) {
  107078. return false;
  107079. }
  107080. if (this.loaderType_ === "main" && timestampOffset2 !== this.sourceUpdater_.videoTimestampOffset()) {
  107081. return true;
  107082. }
  107083. if (!this.audioDisabled_ && timestampOffset2 !== this.sourceUpdater_.audioTimestampOffset()) {
  107084. return true;
  107085. }
  107086. return false;
  107087. };
  107088. _proto.trueSegmentStart_ = function trueSegmentStart_(_ref9) {
  107089. var currentStart = _ref9.currentStart, playlist = _ref9.playlist, mediaIndex = _ref9.mediaIndex, firstVideoFrameTimeForData = _ref9.firstVideoFrameTimeForData, currentVideoTimestampOffset = _ref9.currentVideoTimestampOffset, useVideoTimingInfo = _ref9.useVideoTimingInfo, videoTimingInfo = _ref9.videoTimingInfo, audioTimingInfo = _ref9.audioTimingInfo;
  107090. if (typeof currentStart !== "undefined") {
  107091. return currentStart;
  107092. }
  107093. if (!useVideoTimingInfo) {
  107094. return audioTimingInfo.start;
  107095. }
  107096. var previousSegment = playlist.segments[mediaIndex - 1];
  107097. if (mediaIndex === 0 || !previousSegment || typeof previousSegment.start === "undefined" || previousSegment.end !== firstVideoFrameTimeForData + currentVideoTimestampOffset) {
  107098. return firstVideoFrameTimeForData;
  107099. }
  107100. return videoTimingInfo.start;
  107101. };
  107102. _proto.waitForAppendsToComplete_ = function waitForAppendsToComplete_(segmentInfo) {
  107103. var trackInfo = this.getCurrentMediaInfo_(segmentInfo);
  107104. if (!trackInfo) {
  107105. this.error({
  107106. message: "No starting media returned, likely due to an unsupported media format.",
  107107. blacklistDuration: Infinity
  107108. });
  107109. this.trigger("error");
  107110. return;
  107111. }
  107112. var hasAudio = trackInfo.hasAudio, hasVideo = trackInfo.hasVideo, isMuxed3 = trackInfo.isMuxed;
  107113. var waitForVideo = this.loaderType_ === "main" && hasVideo;
  107114. var waitForAudio = !this.audioDisabled_ && hasAudio && !isMuxed3;
  107115. segmentInfo.waitingOnAppends = 0;
  107116. if (!segmentInfo.hasAppendedData_) {
  107117. if (!segmentInfo.timingInfo && typeof segmentInfo.timestampOffset === "number") {
  107118. this.isPendingTimestampOffset_ = true;
  107119. }
  107120. segmentInfo.timingInfo = {
  107121. start: 0
  107122. };
  107123. segmentInfo.waitingOnAppends++;
  107124. if (!this.isPendingTimestampOffset_) {
  107125. this.updateSourceBufferTimestampOffset_(segmentInfo);
  107126. this.processMetadataQueue_();
  107127. }
  107128. this.checkAppendsDone_(segmentInfo);
  107129. return;
  107130. }
  107131. if (waitForVideo) {
  107132. segmentInfo.waitingOnAppends++;
  107133. }
  107134. if (waitForAudio) {
  107135. segmentInfo.waitingOnAppends++;
  107136. }
  107137. if (waitForVideo) {
  107138. this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));
  107139. }
  107140. if (waitForAudio) {
  107141. this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this, segmentInfo));
  107142. }
  107143. };
  107144. _proto.checkAppendsDone_ = function checkAppendsDone_(segmentInfo) {
  107145. if (this.checkForAbort_(segmentInfo.requestId)) {
  107146. return;
  107147. }
  107148. segmentInfo.waitingOnAppends--;
  107149. if (segmentInfo.waitingOnAppends === 0) {
  107150. this.handleAppendsDone_();
  107151. }
  107152. };
  107153. _proto.checkForIllegalMediaSwitch = function checkForIllegalMediaSwitch(trackInfo) {
  107154. var illegalMediaSwitchError = illegalMediaSwitch(this.loaderType_, this.getCurrentMediaInfo_(), trackInfo);
  107155. if (illegalMediaSwitchError) {
  107156. this.error({
  107157. message: illegalMediaSwitchError,
  107158. blacklistDuration: Infinity
  107159. });
  107160. this.trigger("error");
  107161. return true;
  107162. }
  107163. return false;
  107164. };
  107165. _proto.updateSourceBufferTimestampOffset_ = function updateSourceBufferTimestampOffset_(segmentInfo) {
  107166. if (segmentInfo.timestampOffset === null || typeof segmentInfo.timingInfo.start !== "number" || segmentInfo.changedTimestampOffset || this.loaderType_ !== "main") {
  107167. return;
  107168. }
  107169. var didChange = false;
  107170. segmentInfo.timestampOffset -= this.getSegmentStartTimeForTimestampOffsetCalculation_({
  107171. videoTimingInfo: segmentInfo.segment.videoTimingInfo,
  107172. audioTimingInfo: segmentInfo.segment.audioTimingInfo,
  107173. timingInfo: segmentInfo.timingInfo
  107174. });
  107175. segmentInfo.changedTimestampOffset = true;
  107176. if (segmentInfo.timestampOffset !== this.sourceUpdater_.videoTimestampOffset()) {
  107177. this.sourceUpdater_.videoTimestampOffset(segmentInfo.timestampOffset);
  107178. didChange = true;
  107179. }
  107180. if (segmentInfo.timestampOffset !== this.sourceUpdater_.audioTimestampOffset()) {
  107181. this.sourceUpdater_.audioTimestampOffset(segmentInfo.timestampOffset);
  107182. didChange = true;
  107183. }
  107184. if (didChange) {
  107185. this.trigger("timestampoffset");
  107186. }
  107187. };
  107188. _proto.getSegmentStartTimeForTimestampOffsetCalculation_ = function getSegmentStartTimeForTimestampOffsetCalculation_(_ref10) {
  107189. var videoTimingInfo = _ref10.videoTimingInfo, audioTimingInfo = _ref10.audioTimingInfo, timingInfo = _ref10.timingInfo;
  107190. if (!this.useDtsForTimestampOffset_) {
  107191. return timingInfo.start;
  107192. }
  107193. if (videoTimingInfo && typeof videoTimingInfo.transmuxedDecodeStart === "number") {
  107194. return videoTimingInfo.transmuxedDecodeStart;
  107195. }
  107196. if (audioTimingInfo && typeof audioTimingInfo.transmuxedDecodeStart === "number") {
  107197. return audioTimingInfo.transmuxedDecodeStart;
  107198. }
  107199. return timingInfo.start;
  107200. };
  107201. _proto.updateTimingInfoEnd_ = function updateTimingInfoEnd_(segmentInfo) {
  107202. segmentInfo.timingInfo = segmentInfo.timingInfo || {};
  107203. var trackInfo = this.getMediaInfo_();
  107204. var useVideoTimingInfo = this.loaderType_ === "main" && trackInfo && trackInfo.hasVideo;
  107205. var prioritizedTimingInfo = useVideoTimingInfo && segmentInfo.videoTimingInfo ? segmentInfo.videoTimingInfo : segmentInfo.audioTimingInfo;
  107206. if (!prioritizedTimingInfo) {
  107207. return;
  107208. }
  107209. segmentInfo.timingInfo.end = typeof prioritizedTimingInfo.end === "number" ? prioritizedTimingInfo.end : prioritizedTimingInfo.start + segmentInfo.duration;
  107210. };
  107211. _proto.handleAppendsDone_ = function handleAppendsDone_() {
  107212. if (this.pendingSegment_) {
  107213. this.trigger("appendsdone");
  107214. }
  107215. if (!this.pendingSegment_) {
  107216. this.state = "READY";
  107217. if (!this.paused()) {
  107218. this.monitorBuffer_();
  107219. }
  107220. return;
  107221. }
  107222. var segmentInfo = this.pendingSegment_;
  107223. this.updateTimingInfoEnd_(segmentInfo);
  107224. if (this.shouldSaveSegmentTimingInfo_) {
  107225. this.syncController_.saveSegmentTimingInfo({
  107226. segmentInfo,
  107227. shouldSaveTimelineMapping: this.loaderType_ === "main"
  107228. });
  107229. }
  107230. var segmentDurationMessage = getTroublesomeSegmentDurationMessage(segmentInfo, this.sourceType_);
  107231. if (segmentDurationMessage) {
  107232. if (segmentDurationMessage.severity === "warn") {
  107233. videojs.log.warn(segmentDurationMessage.message);
  107234. } else {
  107235. this.logger_(segmentDurationMessage.message);
  107236. }
  107237. }
  107238. this.recordThroughput_(segmentInfo);
  107239. this.pendingSegment_ = null;
  107240. this.state = "READY";
  107241. if (segmentInfo.isSyncRequest) {
  107242. this.trigger("syncinfoupdate");
  107243. if (!segmentInfo.hasAppendedData_) {
  107244. this.logger_("Throwing away un-appended sync request " + segmentInfoString(segmentInfo));
  107245. return;
  107246. }
  107247. }
  107248. this.logger_("Appended " + segmentInfoString(segmentInfo));
  107249. this.addSegmentMetadataCue_(segmentInfo);
  107250. this.fetchAtBuffer_ = true;
  107251. if (this.currentTimeline_ !== segmentInfo.timeline) {
  107252. this.timelineChangeController_.lastTimelineChange({
  107253. type: this.loaderType_,
  107254. from: this.currentTimeline_,
  107255. to: segmentInfo.timeline
  107256. });
  107257. if (this.loaderType_ === "main" && !this.audioDisabled_) {
  107258. this.timelineChangeController_.lastTimelineChange({
  107259. type: "audio",
  107260. from: this.currentTimeline_,
  107261. to: segmentInfo.timeline
  107262. });
  107263. }
  107264. }
  107265. this.currentTimeline_ = segmentInfo.timeline;
  107266. this.trigger("syncinfoupdate");
  107267. var segment = segmentInfo.segment;
  107268. var part = segmentInfo.part;
  107269. var badSegmentGuess = segment.end && this.currentTime_() - segment.end > segmentInfo.playlist.targetDuration * 3;
  107270. var badPartGuess = part && part.end && this.currentTime_() - part.end > segmentInfo.playlist.partTargetDuration * 3;
  107271. if (badSegmentGuess || badPartGuess) {
  107272. this.logger_("bad " + (badSegmentGuess ? "segment" : "part") + " " + segmentInfoString(segmentInfo));
  107273. this.resetEverything();
  107274. return;
  107275. }
  107276. var isWalkingForward = this.mediaIndex !== null;
  107277. if (isWalkingForward) {
  107278. this.trigger("bandwidthupdate");
  107279. }
  107280. this.trigger("progress");
  107281. this.mediaIndex = segmentInfo.mediaIndex;
  107282. this.partIndex = segmentInfo.partIndex;
  107283. if (this.isEndOfStream_(segmentInfo.mediaIndex, segmentInfo.playlist, segmentInfo.partIndex)) {
  107284. this.endOfStream();
  107285. }
  107286. this.trigger("appended");
  107287. if (segmentInfo.hasAppendedData_) {
  107288. this.mediaAppends++;
  107289. }
  107290. if (!this.paused()) {
  107291. this.monitorBuffer_();
  107292. }
  107293. };
  107294. _proto.recordThroughput_ = function recordThroughput_(segmentInfo) {
  107295. if (segmentInfo.duration < MIN_SEGMENT_DURATION_TO_SAVE_STATS) {
  107296. this.logger_("Ignoring segment's throughput because its duration of " + segmentInfo.duration + (" is less than the min to record " + MIN_SEGMENT_DURATION_TO_SAVE_STATS));
  107297. return;
  107298. }
  107299. var rate = this.throughput.rate;
  107300. var segmentProcessingTime = Date.now() - segmentInfo.endOfAllRequests + 1;
  107301. var segmentProcessingThroughput = Math.floor(segmentInfo.byteLength / segmentProcessingTime * 8 * 1e3);
  107302. this.throughput.rate += (segmentProcessingThroughput - rate) / ++this.throughput.count;
  107303. };
  107304. _proto.addSegmentMetadataCue_ = function addSegmentMetadataCue_(segmentInfo) {
  107305. if (!this.segmentMetadataTrack_) {
  107306. return;
  107307. }
  107308. var segment = segmentInfo.segment;
  107309. var start2 = segment.start;
  107310. var end = segment.end;
  107311. if (!finite(start2) || !finite(end)) {
  107312. return;
  107313. }
  107314. removeCuesFromTrack(start2, end, this.segmentMetadataTrack_);
  107315. var Cue = window_1.WebKitDataCue || window_1.VTTCue;
  107316. var value = {
  107317. custom: segment.custom,
  107318. dateTimeObject: segment.dateTimeObject,
  107319. dateTimeString: segment.dateTimeString,
  107320. bandwidth: segmentInfo.playlist.attributes.BANDWIDTH,
  107321. resolution: segmentInfo.playlist.attributes.RESOLUTION,
  107322. codecs: segmentInfo.playlist.attributes.CODECS,
  107323. byteLength: segmentInfo.byteLength,
  107324. uri: segmentInfo.uri,
  107325. timeline: segmentInfo.timeline,
  107326. playlist: segmentInfo.playlist.id,
  107327. start: start2,
  107328. end
  107329. };
  107330. var data = JSON.stringify(value);
  107331. var cue = new Cue(start2, end, data);
  107332. cue.value = value;
  107333. this.segmentMetadataTrack_.addCue(cue);
  107334. };
  107335. return SegmentLoader2;
  107336. }(videojs.EventTarget);
  107337. function noop() {
  107338. }
  107339. var toTitleCase2 = function toTitleCase3(string) {
  107340. if (typeof string !== "string") {
  107341. return string;
  107342. }
  107343. return string.replace(/./, function(w) {
  107344. return w.toUpperCase();
  107345. });
  107346. };
  107347. var bufferTypes = ["video", "audio"];
  107348. var _updating = function updating2(type2, sourceUpdater) {
  107349. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107350. return sourceBuffer && sourceBuffer.updating || sourceUpdater.queuePending[type2];
  107351. };
  107352. var nextQueueIndexOfType = function nextQueueIndexOfType2(type2, queue) {
  107353. for (var i2 = 0; i2 < queue.length; i2++) {
  107354. var queueEntry = queue[i2];
  107355. if (queueEntry.type === "mediaSource") {
  107356. return null;
  107357. }
  107358. if (queueEntry.type === type2) {
  107359. return i2;
  107360. }
  107361. }
  107362. return null;
  107363. };
  107364. var shiftQueue = function shiftQueue2(type2, sourceUpdater) {
  107365. if (sourceUpdater.queue.length === 0) {
  107366. return;
  107367. }
  107368. var queueIndex = 0;
  107369. var queueEntry = sourceUpdater.queue[queueIndex];
  107370. if (queueEntry.type === "mediaSource") {
  107371. if (!sourceUpdater.updating() && sourceUpdater.mediaSource.readyState !== "closed") {
  107372. sourceUpdater.queue.shift();
  107373. queueEntry.action(sourceUpdater);
  107374. if (queueEntry.doneFn) {
  107375. queueEntry.doneFn();
  107376. }
  107377. shiftQueue2("audio", sourceUpdater);
  107378. shiftQueue2("video", sourceUpdater);
  107379. }
  107380. return;
  107381. }
  107382. if (type2 === "mediaSource") {
  107383. return;
  107384. }
  107385. if (!sourceUpdater.ready() || sourceUpdater.mediaSource.readyState === "closed" || _updating(type2, sourceUpdater)) {
  107386. return;
  107387. }
  107388. if (queueEntry.type !== type2) {
  107389. queueIndex = nextQueueIndexOfType(type2, sourceUpdater.queue);
  107390. if (queueIndex === null) {
  107391. return;
  107392. }
  107393. queueEntry = sourceUpdater.queue[queueIndex];
  107394. }
  107395. sourceUpdater.queue.splice(queueIndex, 1);
  107396. sourceUpdater.queuePending[type2] = queueEntry;
  107397. queueEntry.action(type2, sourceUpdater);
  107398. if (!queueEntry.doneFn) {
  107399. sourceUpdater.queuePending[type2] = null;
  107400. shiftQueue2(type2, sourceUpdater);
  107401. return;
  107402. }
  107403. };
  107404. var cleanupBuffer = function cleanupBuffer2(type2, sourceUpdater) {
  107405. var buffer = sourceUpdater[type2 + "Buffer"];
  107406. var titleType = toTitleCase2(type2);
  107407. if (!buffer) {
  107408. return;
  107409. }
  107410. buffer.removeEventListener("updateend", sourceUpdater["on" + titleType + "UpdateEnd_"]);
  107411. buffer.removeEventListener("error", sourceUpdater["on" + titleType + "Error_"]);
  107412. sourceUpdater.codecs[type2] = null;
  107413. sourceUpdater[type2 + "Buffer"] = null;
  107414. };
  107415. var inSourceBuffers = function inSourceBuffers2(mediaSource, sourceBuffer) {
  107416. return mediaSource && sourceBuffer && Array.prototype.indexOf.call(mediaSource.sourceBuffers, sourceBuffer) !== -1;
  107417. };
  107418. var actions = {
  107419. appendBuffer: function appendBuffer(bytes, segmentInfo, onError2) {
  107420. return function(type2, sourceUpdater) {
  107421. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107422. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107423. return;
  107424. }
  107425. sourceUpdater.logger_("Appending segment " + segmentInfo.mediaIndex + "'s " + bytes.length + " bytes to " + type2 + "Buffer");
  107426. try {
  107427. sourceBuffer.appendBuffer(bytes);
  107428. } catch (e) {
  107429. sourceUpdater.logger_("Error with code " + e.code + " " + (e.code === QUOTA_EXCEEDED_ERR ? "(QUOTA_EXCEEDED_ERR) " : "") + ("when appending segment " + segmentInfo.mediaIndex + " to " + type2 + "Buffer"));
  107430. sourceUpdater.queuePending[type2] = null;
  107431. onError2(e);
  107432. }
  107433. };
  107434. },
  107435. remove: function remove(start2, end) {
  107436. return function(type2, sourceUpdater) {
  107437. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107438. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107439. return;
  107440. }
  107441. sourceUpdater.logger_("Removing " + start2 + " to " + end + " from " + type2 + "Buffer");
  107442. try {
  107443. sourceBuffer.remove(start2, end);
  107444. } catch (e) {
  107445. sourceUpdater.logger_("Remove " + start2 + " to " + end + " from " + type2 + "Buffer failed");
  107446. }
  107447. };
  107448. },
  107449. timestampOffset: function timestampOffset(offset) {
  107450. return function(type2, sourceUpdater) {
  107451. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107452. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107453. return;
  107454. }
  107455. sourceUpdater.logger_("Setting " + type2 + "timestampOffset to " + offset);
  107456. sourceBuffer.timestampOffset = offset;
  107457. };
  107458. },
  107459. callback: function callback(_callback) {
  107460. return function(type2, sourceUpdater) {
  107461. _callback();
  107462. };
  107463. },
  107464. endOfStream: function endOfStream(error) {
  107465. return function(sourceUpdater) {
  107466. if (sourceUpdater.mediaSource.readyState !== "open") {
  107467. return;
  107468. }
  107469. sourceUpdater.logger_("Calling mediaSource endOfStream(" + (error || "") + ")");
  107470. try {
  107471. sourceUpdater.mediaSource.endOfStream(error);
  107472. } catch (e) {
  107473. videojs.log.warn("Failed to call media source endOfStream", e);
  107474. }
  107475. };
  107476. },
  107477. duration: function duration4(_duration) {
  107478. return function(sourceUpdater) {
  107479. sourceUpdater.logger_("Setting mediaSource duration to " + _duration);
  107480. try {
  107481. sourceUpdater.mediaSource.duration = _duration;
  107482. } catch (e) {
  107483. videojs.log.warn("Failed to set media source duration", e);
  107484. }
  107485. };
  107486. },
  107487. abort: function abort() {
  107488. return function(type2, sourceUpdater) {
  107489. if (sourceUpdater.mediaSource.readyState !== "open") {
  107490. return;
  107491. }
  107492. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107493. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107494. return;
  107495. }
  107496. sourceUpdater.logger_("calling abort on " + type2 + "Buffer");
  107497. try {
  107498. sourceBuffer.abort();
  107499. } catch (e) {
  107500. videojs.log.warn("Failed to abort on " + type2 + "Buffer", e);
  107501. }
  107502. };
  107503. },
  107504. addSourceBuffer: function addSourceBuffer(type2, codec) {
  107505. return function(sourceUpdater) {
  107506. var titleType = toTitleCase2(type2);
  107507. var mime = getMimeForCodec2(codec);
  107508. sourceUpdater.logger_("Adding " + type2 + "Buffer with codec " + codec + " to mediaSource");
  107509. var sourceBuffer = sourceUpdater.mediaSource.addSourceBuffer(mime);
  107510. sourceBuffer.addEventListener("updateend", sourceUpdater["on" + titleType + "UpdateEnd_"]);
  107511. sourceBuffer.addEventListener("error", sourceUpdater["on" + titleType + "Error_"]);
  107512. sourceUpdater.codecs[type2] = codec;
  107513. sourceUpdater[type2 + "Buffer"] = sourceBuffer;
  107514. };
  107515. },
  107516. removeSourceBuffer: function removeSourceBuffer(type2) {
  107517. return function(sourceUpdater) {
  107518. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107519. cleanupBuffer(type2, sourceUpdater);
  107520. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107521. return;
  107522. }
  107523. sourceUpdater.logger_("Removing " + type2 + "Buffer with codec " + sourceUpdater.codecs[type2] + " from mediaSource");
  107524. try {
  107525. sourceUpdater.mediaSource.removeSourceBuffer(sourceBuffer);
  107526. } catch (e) {
  107527. videojs.log.warn("Failed to removeSourceBuffer " + type2 + "Buffer", e);
  107528. }
  107529. };
  107530. },
  107531. changeType: function changeType(codec) {
  107532. return function(type2, sourceUpdater) {
  107533. var sourceBuffer = sourceUpdater[type2 + "Buffer"];
  107534. var mime = getMimeForCodec2(codec);
  107535. if (!inSourceBuffers(sourceUpdater.mediaSource, sourceBuffer)) {
  107536. return;
  107537. }
  107538. if (sourceUpdater.codecs[type2] === codec) {
  107539. return;
  107540. }
  107541. sourceUpdater.logger_("changing " + type2 + "Buffer codec from " + sourceUpdater.codecs[type2] + " to " + codec);
  107542. sourceBuffer.changeType(mime);
  107543. sourceUpdater.codecs[type2] = codec;
  107544. };
  107545. }
  107546. };
  107547. var pushQueue = function pushQueue2(_ref) {
  107548. var type2 = _ref.type, sourceUpdater = _ref.sourceUpdater, action = _ref.action, doneFn = _ref.doneFn, name = _ref.name;
  107549. sourceUpdater.queue.push({
  107550. type: type2,
  107551. action,
  107552. doneFn,
  107553. name
  107554. });
  107555. shiftQueue(type2, sourceUpdater);
  107556. };
  107557. var onUpdateend = function onUpdateend2(type2, sourceUpdater) {
  107558. return function(e) {
  107559. if (sourceUpdater.queuePending[type2]) {
  107560. var doneFn = sourceUpdater.queuePending[type2].doneFn;
  107561. sourceUpdater.queuePending[type2] = null;
  107562. if (doneFn) {
  107563. doneFn(sourceUpdater[type2 + "Error_"]);
  107564. }
  107565. }
  107566. shiftQueue(type2, sourceUpdater);
  107567. };
  107568. };
  107569. var SourceUpdater = /* @__PURE__ */ function(_videojs$EventTarget) {
  107570. _inheritsLoose(SourceUpdater2, _videojs$EventTarget);
  107571. function SourceUpdater2(mediaSource) {
  107572. var _this;
  107573. _this = _videojs$EventTarget.call(this) || this;
  107574. _this.mediaSource = mediaSource;
  107575. _this.sourceopenListener_ = function() {
  107576. return shiftQueue("mediaSource", _assertThisInitialized(_this));
  107577. };
  107578. _this.mediaSource.addEventListener("sourceopen", _this.sourceopenListener_);
  107579. _this.logger_ = logger("SourceUpdater");
  107580. _this.audioTimestampOffset_ = 0;
  107581. _this.videoTimestampOffset_ = 0;
  107582. _this.queue = [];
  107583. _this.queuePending = {
  107584. audio: null,
  107585. video: null
  107586. };
  107587. _this.delayedAudioAppendQueue_ = [];
  107588. _this.videoAppendQueued_ = false;
  107589. _this.codecs = {};
  107590. _this.onVideoUpdateEnd_ = onUpdateend("video", _assertThisInitialized(_this));
  107591. _this.onAudioUpdateEnd_ = onUpdateend("audio", _assertThisInitialized(_this));
  107592. _this.onVideoError_ = function(e) {
  107593. _this.videoError_ = e;
  107594. };
  107595. _this.onAudioError_ = function(e) {
  107596. _this.audioError_ = e;
  107597. };
  107598. _this.createdSourceBuffers_ = false;
  107599. _this.initializedEme_ = false;
  107600. _this.triggeredReady_ = false;
  107601. return _this;
  107602. }
  107603. var _proto = SourceUpdater2.prototype;
  107604. _proto.initializedEme = function initializedEme() {
  107605. this.initializedEme_ = true;
  107606. this.triggerReady();
  107607. };
  107608. _proto.hasCreatedSourceBuffers = function hasCreatedSourceBuffers() {
  107609. return this.createdSourceBuffers_;
  107610. };
  107611. _proto.hasInitializedAnyEme = function hasInitializedAnyEme() {
  107612. return this.initializedEme_;
  107613. };
  107614. _proto.ready = function ready() {
  107615. return this.hasCreatedSourceBuffers() && this.hasInitializedAnyEme();
  107616. };
  107617. _proto.createSourceBuffers = function createSourceBuffers(codecs) {
  107618. if (this.hasCreatedSourceBuffers()) {
  107619. return;
  107620. }
  107621. this.addOrChangeSourceBuffers(codecs);
  107622. this.createdSourceBuffers_ = true;
  107623. this.trigger("createdsourcebuffers");
  107624. this.triggerReady();
  107625. };
  107626. _proto.triggerReady = function triggerReady() {
  107627. if (this.ready() && !this.triggeredReady_) {
  107628. this.triggeredReady_ = true;
  107629. this.trigger("ready");
  107630. }
  107631. };
  107632. _proto.addSourceBuffer = function addSourceBuffer2(type2, codec) {
  107633. pushQueue({
  107634. type: "mediaSource",
  107635. sourceUpdater: this,
  107636. action: actions.addSourceBuffer(type2, codec),
  107637. name: "addSourceBuffer"
  107638. });
  107639. };
  107640. _proto.abort = function abort2(type2) {
  107641. pushQueue({
  107642. type: type2,
  107643. sourceUpdater: this,
  107644. action: actions.abort(type2),
  107645. name: "abort"
  107646. });
  107647. };
  107648. _proto.removeSourceBuffer = function removeSourceBuffer2(type2) {
  107649. if (!this.canRemoveSourceBuffer()) {
  107650. videojs.log.error("removeSourceBuffer is not supported!");
  107651. return;
  107652. }
  107653. pushQueue({
  107654. type: "mediaSource",
  107655. sourceUpdater: this,
  107656. action: actions.removeSourceBuffer(type2),
  107657. name: "removeSourceBuffer"
  107658. });
  107659. };
  107660. _proto.canRemoveSourceBuffer = function canRemoveSourceBuffer() {
  107661. return !videojs.browser.IE_VERSION && !videojs.browser.IS_FIREFOX && window_1.MediaSource && window_1.MediaSource.prototype && typeof window_1.MediaSource.prototype.removeSourceBuffer === "function";
  107662. };
  107663. SourceUpdater2.canChangeType = function canChangeType() {
  107664. return window_1.SourceBuffer && window_1.SourceBuffer.prototype && typeof window_1.SourceBuffer.prototype.changeType === "function";
  107665. };
  107666. _proto.canChangeType = function canChangeType() {
  107667. return this.constructor.canChangeType();
  107668. };
  107669. _proto.changeType = function changeType2(type2, codec) {
  107670. if (!this.canChangeType()) {
  107671. videojs.log.error("changeType is not supported!");
  107672. return;
  107673. }
  107674. pushQueue({
  107675. type: type2,
  107676. sourceUpdater: this,
  107677. action: actions.changeType(codec),
  107678. name: "changeType"
  107679. });
  107680. };
  107681. _proto.addOrChangeSourceBuffers = function addOrChangeSourceBuffers(codecs) {
  107682. var _this2 = this;
  107683. if (!codecs || typeof codecs !== "object" || Object.keys(codecs).length === 0) {
  107684. throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");
  107685. }
  107686. Object.keys(codecs).forEach(function(type2) {
  107687. var codec = codecs[type2];
  107688. if (!_this2.hasCreatedSourceBuffers()) {
  107689. return _this2.addSourceBuffer(type2, codec);
  107690. }
  107691. if (_this2.canChangeType()) {
  107692. _this2.changeType(type2, codec);
  107693. }
  107694. });
  107695. };
  107696. _proto.appendBuffer = function appendBuffer2(options2, doneFn) {
  107697. var _this3 = this;
  107698. var segmentInfo = options2.segmentInfo, type2 = options2.type, bytes = options2.bytes;
  107699. this.processedAppend_ = true;
  107700. if (type2 === "audio" && this.videoBuffer && !this.videoAppendQueued_) {
  107701. this.delayedAudioAppendQueue_.push([options2, doneFn]);
  107702. this.logger_("delayed audio append of " + bytes.length + " until video append");
  107703. return;
  107704. }
  107705. var onError2 = doneFn;
  107706. pushQueue({
  107707. type: type2,
  107708. sourceUpdater: this,
  107709. action: actions.appendBuffer(bytes, segmentInfo || {
  107710. mediaIndex: -1
  107711. }, onError2),
  107712. doneFn,
  107713. name: "appendBuffer"
  107714. });
  107715. if (type2 === "video") {
  107716. this.videoAppendQueued_ = true;
  107717. if (!this.delayedAudioAppendQueue_.length) {
  107718. return;
  107719. }
  107720. var queue = this.delayedAudioAppendQueue_.slice();
  107721. this.logger_("queuing delayed audio " + queue.length + " appendBuffers");
  107722. this.delayedAudioAppendQueue_.length = 0;
  107723. queue.forEach(function(que) {
  107724. _this3.appendBuffer.apply(_this3, que);
  107725. });
  107726. }
  107727. };
  107728. _proto.audioBuffered = function audioBuffered() {
  107729. if (!inSourceBuffers(this.mediaSource, this.audioBuffer)) {
  107730. return videojs.createTimeRange();
  107731. }
  107732. return this.audioBuffer.buffered ? this.audioBuffer.buffered : videojs.createTimeRange();
  107733. };
  107734. _proto.videoBuffered = function videoBuffered() {
  107735. if (!inSourceBuffers(this.mediaSource, this.videoBuffer)) {
  107736. return videojs.createTimeRange();
  107737. }
  107738. return this.videoBuffer.buffered ? this.videoBuffer.buffered : videojs.createTimeRange();
  107739. };
  107740. _proto.buffered = function buffered() {
  107741. var video = inSourceBuffers(this.mediaSource, this.videoBuffer) ? this.videoBuffer : null;
  107742. var audio = inSourceBuffers(this.mediaSource, this.audioBuffer) ? this.audioBuffer : null;
  107743. if (audio && !video) {
  107744. return this.audioBuffered();
  107745. }
  107746. if (video && !audio) {
  107747. return this.videoBuffered();
  107748. }
  107749. return bufferIntersection(this.audioBuffered(), this.videoBuffered());
  107750. };
  107751. _proto.setDuration = function setDuration(duration5, doneFn) {
  107752. if (doneFn === void 0) {
  107753. doneFn = noop;
  107754. }
  107755. pushQueue({
  107756. type: "mediaSource",
  107757. sourceUpdater: this,
  107758. action: actions.duration(duration5),
  107759. name: "duration",
  107760. doneFn
  107761. });
  107762. };
  107763. _proto.endOfStream = function endOfStream2(error, doneFn) {
  107764. if (error === void 0) {
  107765. error = null;
  107766. }
  107767. if (doneFn === void 0) {
  107768. doneFn = noop;
  107769. }
  107770. if (typeof error !== "string") {
  107771. error = void 0;
  107772. }
  107773. pushQueue({
  107774. type: "mediaSource",
  107775. sourceUpdater: this,
  107776. action: actions.endOfStream(error),
  107777. name: "endOfStream",
  107778. doneFn
  107779. });
  107780. };
  107781. _proto.removeAudio = function removeAudio(start2, end, done) {
  107782. if (done === void 0) {
  107783. done = noop;
  107784. }
  107785. if (!this.audioBuffered().length || this.audioBuffered().end(0) === 0) {
  107786. done();
  107787. return;
  107788. }
  107789. pushQueue({
  107790. type: "audio",
  107791. sourceUpdater: this,
  107792. action: actions.remove(start2, end),
  107793. doneFn: done,
  107794. name: "remove"
  107795. });
  107796. };
  107797. _proto.removeVideo = function removeVideo(start2, end, done) {
  107798. if (done === void 0) {
  107799. done = noop;
  107800. }
  107801. if (!this.videoBuffered().length || this.videoBuffered().end(0) === 0) {
  107802. done();
  107803. return;
  107804. }
  107805. pushQueue({
  107806. type: "video",
  107807. sourceUpdater: this,
  107808. action: actions.remove(start2, end),
  107809. doneFn: done,
  107810. name: "remove"
  107811. });
  107812. };
  107813. _proto.updating = function updating3() {
  107814. if (_updating("audio", this) || _updating("video", this)) {
  107815. return true;
  107816. }
  107817. return false;
  107818. };
  107819. _proto.audioTimestampOffset = function audioTimestampOffset(offset) {
  107820. if (typeof offset !== "undefined" && this.audioBuffer && this.audioTimestampOffset_ !== offset) {
  107821. pushQueue({
  107822. type: "audio",
  107823. sourceUpdater: this,
  107824. action: actions.timestampOffset(offset),
  107825. name: "timestampOffset"
  107826. });
  107827. this.audioTimestampOffset_ = offset;
  107828. }
  107829. return this.audioTimestampOffset_;
  107830. };
  107831. _proto.videoTimestampOffset = function videoTimestampOffset(offset) {
  107832. if (typeof offset !== "undefined" && this.videoBuffer && this.videoTimestampOffset !== offset) {
  107833. pushQueue({
  107834. type: "video",
  107835. sourceUpdater: this,
  107836. action: actions.timestampOffset(offset),
  107837. name: "timestampOffset"
  107838. });
  107839. this.videoTimestampOffset_ = offset;
  107840. }
  107841. return this.videoTimestampOffset_;
  107842. };
  107843. _proto.audioQueueCallback = function audioQueueCallback(callback2) {
  107844. if (!this.audioBuffer) {
  107845. return;
  107846. }
  107847. pushQueue({
  107848. type: "audio",
  107849. sourceUpdater: this,
  107850. action: actions.callback(callback2),
  107851. name: "callback"
  107852. });
  107853. };
  107854. _proto.videoQueueCallback = function videoQueueCallback(callback2) {
  107855. if (!this.videoBuffer) {
  107856. return;
  107857. }
  107858. pushQueue({
  107859. type: "video",
  107860. sourceUpdater: this,
  107861. action: actions.callback(callback2),
  107862. name: "callback"
  107863. });
  107864. };
  107865. _proto.dispose = function dispose() {
  107866. var _this4 = this;
  107867. this.trigger("dispose");
  107868. bufferTypes.forEach(function(type2) {
  107869. _this4.abort(type2);
  107870. if (_this4.canRemoveSourceBuffer()) {
  107871. _this4.removeSourceBuffer(type2);
  107872. } else {
  107873. _this4[type2 + "QueueCallback"](function() {
  107874. return cleanupBuffer(type2, _this4);
  107875. });
  107876. }
  107877. });
  107878. this.videoAppendQueued_ = false;
  107879. this.delayedAudioAppendQueue_.length = 0;
  107880. if (this.sourceopenListener_) {
  107881. this.mediaSource.removeEventListener("sourceopen", this.sourceopenListener_);
  107882. }
  107883. this.off();
  107884. };
  107885. return SourceUpdater2;
  107886. }(videojs.EventTarget);
  107887. var uint8ToUtf8 = function uint8ToUtf82(uintArray) {
  107888. return decodeURIComponent(escape(String.fromCharCode.apply(null, uintArray)));
  107889. };
  107890. var VTT_LINE_TERMINATORS = new Uint8Array("\n\n".split("").map(function(_char3) {
  107891. return _char3.charCodeAt(0);
  107892. }));
  107893. var NoVttJsError = /* @__PURE__ */ function(_Error) {
  107894. _inheritsLoose(NoVttJsError2, _Error);
  107895. function NoVttJsError2() {
  107896. return _Error.call(this, "Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.") || this;
  107897. }
  107898. return NoVttJsError2;
  107899. }(/* @__PURE__ */ _wrapNativeSuper(Error));
  107900. var VTTSegmentLoader = /* @__PURE__ */ function(_SegmentLoader) {
  107901. _inheritsLoose(VTTSegmentLoader2, _SegmentLoader);
  107902. function VTTSegmentLoader2(settings, options2) {
  107903. var _this;
  107904. if (options2 === void 0) {
  107905. options2 = {};
  107906. }
  107907. _this = _SegmentLoader.call(this, settings, options2) || this;
  107908. _this.mediaSource_ = null;
  107909. _this.subtitlesTrack_ = null;
  107910. _this.loaderType_ = "subtitle";
  107911. _this.featuresNativeTextTracks_ = settings.featuresNativeTextTracks;
  107912. _this.loadVttJs = settings.loadVttJs;
  107913. _this.shouldSaveSegmentTimingInfo_ = false;
  107914. return _this;
  107915. }
  107916. var _proto = VTTSegmentLoader2.prototype;
  107917. _proto.createTransmuxer_ = function createTransmuxer_() {
  107918. return null;
  107919. };
  107920. _proto.buffered_ = function buffered_() {
  107921. if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues || !this.subtitlesTrack_.cues.length) {
  107922. return videojs.createTimeRanges();
  107923. }
  107924. var cues = this.subtitlesTrack_.cues;
  107925. var start2 = cues[0].startTime;
  107926. var end = cues[cues.length - 1].startTime;
  107927. return videojs.createTimeRanges([[start2, end]]);
  107928. };
  107929. _proto.initSegmentForMap = function initSegmentForMap(map, set4) {
  107930. if (set4 === void 0) {
  107931. set4 = false;
  107932. }
  107933. if (!map) {
  107934. return null;
  107935. }
  107936. var id = initSegmentId(map);
  107937. var storedMap = this.initSegments_[id];
  107938. if (set4 && !storedMap && map.bytes) {
  107939. var combinedByteLength = VTT_LINE_TERMINATORS.byteLength + map.bytes.byteLength;
  107940. var combinedSegment = new Uint8Array(combinedByteLength);
  107941. combinedSegment.set(map.bytes);
  107942. combinedSegment.set(VTT_LINE_TERMINATORS, map.bytes.byteLength);
  107943. this.initSegments_[id] = storedMap = {
  107944. resolvedUri: map.resolvedUri,
  107945. byterange: map.byterange,
  107946. bytes: combinedSegment
  107947. };
  107948. }
  107949. return storedMap || map;
  107950. };
  107951. _proto.couldBeginLoading_ = function couldBeginLoading_() {
  107952. return this.playlist_ && this.subtitlesTrack_ && !this.paused();
  107953. };
  107954. _proto.init_ = function init_() {
  107955. this.state = "READY";
  107956. this.resetEverything();
  107957. return this.monitorBuffer_();
  107958. };
  107959. _proto.track = function track(_track) {
  107960. if (typeof _track === "undefined") {
  107961. return this.subtitlesTrack_;
  107962. }
  107963. this.subtitlesTrack_ = _track;
  107964. if (this.state === "INIT" && this.couldBeginLoading_()) {
  107965. this.init_();
  107966. }
  107967. return this.subtitlesTrack_;
  107968. };
  107969. _proto.remove = function remove2(start2, end) {
  107970. removeCuesFromTrack(start2, end, this.subtitlesTrack_);
  107971. };
  107972. _proto.fillBuffer_ = function fillBuffer_() {
  107973. var _this2 = this;
  107974. var segmentInfo = this.chooseNextRequest_();
  107975. if (!segmentInfo) {
  107976. return;
  107977. }
  107978. if (this.syncController_.timestampOffsetForTimeline(segmentInfo.timeline) === null) {
  107979. var checkTimestampOffset = function checkTimestampOffset2() {
  107980. _this2.state = "READY";
  107981. if (!_this2.paused()) {
  107982. _this2.monitorBuffer_();
  107983. }
  107984. };
  107985. this.syncController_.one("timestampoffset", checkTimestampOffset);
  107986. this.state = "WAITING_ON_TIMELINE";
  107987. return;
  107988. }
  107989. this.loadSegment_(segmentInfo);
  107990. };
  107991. _proto.timestampOffsetForSegment_ = function timestampOffsetForSegment_() {
  107992. return null;
  107993. };
  107994. _proto.chooseNextRequest_ = function chooseNextRequest_() {
  107995. return this.skipEmptySegments_(_SegmentLoader.prototype.chooseNextRequest_.call(this));
  107996. };
  107997. _proto.skipEmptySegments_ = function skipEmptySegments_(segmentInfo) {
  107998. while (segmentInfo && segmentInfo.segment.empty) {
  107999. if (segmentInfo.mediaIndex + 1 >= segmentInfo.playlist.segments.length) {
  108000. segmentInfo = null;
  108001. break;
  108002. }
  108003. segmentInfo = this.generateSegmentInfo_({
  108004. playlist: segmentInfo.playlist,
  108005. mediaIndex: segmentInfo.mediaIndex + 1,
  108006. startOfSegment: segmentInfo.startOfSegment + segmentInfo.duration,
  108007. isSyncRequest: segmentInfo.isSyncRequest
  108008. });
  108009. }
  108010. return segmentInfo;
  108011. };
  108012. _proto.stopForError = function stopForError(error) {
  108013. this.error(error);
  108014. this.state = "READY";
  108015. this.pause();
  108016. this.trigger("error");
  108017. };
  108018. _proto.segmentRequestFinished_ = function segmentRequestFinished_(error, simpleSegment, result) {
  108019. var _this3 = this;
  108020. if (!this.subtitlesTrack_) {
  108021. this.state = "READY";
  108022. return;
  108023. }
  108024. this.saveTransferStats_(simpleSegment.stats);
  108025. if (!this.pendingSegment_) {
  108026. this.state = "READY";
  108027. this.mediaRequestsAborted += 1;
  108028. return;
  108029. }
  108030. if (error) {
  108031. if (error.code === REQUEST_ERRORS.TIMEOUT) {
  108032. this.handleTimeout_();
  108033. }
  108034. if (error.code === REQUEST_ERRORS.ABORTED) {
  108035. this.mediaRequestsAborted += 1;
  108036. } else {
  108037. this.mediaRequestsErrored += 1;
  108038. }
  108039. this.stopForError(error);
  108040. return;
  108041. }
  108042. var segmentInfo = this.pendingSegment_;
  108043. this.saveBandwidthRelatedStats_(segmentInfo.duration, simpleSegment.stats);
  108044. if (simpleSegment.key) {
  108045. this.segmentKey(simpleSegment.key, true);
  108046. }
  108047. this.state = "APPENDING";
  108048. this.trigger("appending");
  108049. var segment = segmentInfo.segment;
  108050. if (segment.map) {
  108051. segment.map.bytes = simpleSegment.map.bytes;
  108052. }
  108053. segmentInfo.bytes = simpleSegment.bytes;
  108054. if (typeof window_1.WebVTT !== "function" && typeof this.loadVttJs === "function") {
  108055. this.state = "WAITING_ON_VTTJS";
  108056. this.loadVttJs().then(function() {
  108057. return _this3.segmentRequestFinished_(error, simpleSegment, result);
  108058. }, function() {
  108059. return _this3.stopForError({
  108060. message: "Error loading vtt.js"
  108061. });
  108062. });
  108063. return;
  108064. }
  108065. segment.requested = true;
  108066. try {
  108067. this.parseVTTCues_(segmentInfo);
  108068. } catch (e) {
  108069. this.stopForError({
  108070. message: e.message
  108071. });
  108072. return;
  108073. }
  108074. this.updateTimeMapping_(segmentInfo, this.syncController_.timelines[segmentInfo.timeline], this.playlist_);
  108075. if (segmentInfo.cues.length) {
  108076. segmentInfo.timingInfo = {
  108077. start: segmentInfo.cues[0].startTime,
  108078. end: segmentInfo.cues[segmentInfo.cues.length - 1].endTime
  108079. };
  108080. } else {
  108081. segmentInfo.timingInfo = {
  108082. start: segmentInfo.startOfSegment,
  108083. end: segmentInfo.startOfSegment + segmentInfo.duration
  108084. };
  108085. }
  108086. if (segmentInfo.isSyncRequest) {
  108087. this.trigger("syncinfoupdate");
  108088. this.pendingSegment_ = null;
  108089. this.state = "READY";
  108090. return;
  108091. }
  108092. segmentInfo.byteLength = segmentInfo.bytes.byteLength;
  108093. this.mediaSecondsLoaded += segment.duration;
  108094. segmentInfo.cues.forEach(function(cue) {
  108095. _this3.subtitlesTrack_.addCue(_this3.featuresNativeTextTracks_ ? new window_1.VTTCue(cue.startTime, cue.endTime, cue.text) : cue);
  108096. });
  108097. removeDuplicateCuesFromTrack(this.subtitlesTrack_);
  108098. this.handleAppendsDone_();
  108099. };
  108100. _proto.handleData_ = function handleData_3() {
  108101. };
  108102. _proto.updateTimingInfoEnd_ = function updateTimingInfoEnd_() {
  108103. };
  108104. _proto.parseVTTCues_ = function parseVTTCues_(segmentInfo) {
  108105. var decoder;
  108106. var decodeBytesToString = false;
  108107. if (typeof window_1.WebVTT !== "function") {
  108108. throw new NoVttJsError();
  108109. }
  108110. if (typeof window_1.TextDecoder === "function") {
  108111. decoder = new window_1.TextDecoder("utf8");
  108112. } else {
  108113. decoder = window_1.WebVTT.StringDecoder();
  108114. decodeBytesToString = true;
  108115. }
  108116. var parser2 = new window_1.WebVTT.Parser(window_1, window_1.vttjs, decoder);
  108117. segmentInfo.cues = [];
  108118. segmentInfo.timestampmap = {
  108119. MPEGTS: 0,
  108120. LOCAL: 0
  108121. };
  108122. parser2.oncue = segmentInfo.cues.push.bind(segmentInfo.cues);
  108123. parser2.ontimestampmap = function(map) {
  108124. segmentInfo.timestampmap = map;
  108125. };
  108126. parser2.onparsingerror = function(error) {
  108127. videojs.log.warn("Error encountered when parsing cues: " + error.message);
  108128. };
  108129. if (segmentInfo.segment.map) {
  108130. var mapData = segmentInfo.segment.map.bytes;
  108131. if (decodeBytesToString) {
  108132. mapData = uint8ToUtf8(mapData);
  108133. }
  108134. parser2.parse(mapData);
  108135. }
  108136. var segmentData = segmentInfo.bytes;
  108137. if (decodeBytesToString) {
  108138. segmentData = uint8ToUtf8(segmentData);
  108139. }
  108140. parser2.parse(segmentData);
  108141. parser2.flush();
  108142. };
  108143. _proto.updateTimeMapping_ = function updateTimeMapping_(segmentInfo, mappingObj, playlist) {
  108144. var segment = segmentInfo.segment;
  108145. if (!mappingObj) {
  108146. return;
  108147. }
  108148. if (!segmentInfo.cues.length) {
  108149. segment.empty = true;
  108150. return;
  108151. }
  108152. var timestampmap = segmentInfo.timestampmap;
  108153. var diff = timestampmap.MPEGTS / clock.ONE_SECOND_IN_TS - timestampmap.LOCAL + mappingObj.mapping;
  108154. segmentInfo.cues.forEach(function(cue) {
  108155. cue.startTime += diff;
  108156. cue.endTime += diff;
  108157. });
  108158. if (!playlist.syncInfo) {
  108159. var firstStart = segmentInfo.cues[0].startTime;
  108160. var lastStart = segmentInfo.cues[segmentInfo.cues.length - 1].startTime;
  108161. playlist.syncInfo = {
  108162. mediaSequence: playlist.mediaSequence + segmentInfo.mediaIndex,
  108163. time: Math.min(firstStart, lastStart - segment.duration)
  108164. };
  108165. }
  108166. };
  108167. return VTTSegmentLoader2;
  108168. }(SegmentLoader);
  108169. var findAdCue = function findAdCue2(track, mediaTime) {
  108170. var cues = track.cues;
  108171. for (var i2 = 0; i2 < cues.length; i2++) {
  108172. var cue = cues[i2];
  108173. if (mediaTime >= cue.adStartTime && mediaTime <= cue.adEndTime) {
  108174. return cue;
  108175. }
  108176. }
  108177. return null;
  108178. };
  108179. var updateAdCues = function updateAdCues2(media, track, offset) {
  108180. if (offset === void 0) {
  108181. offset = 0;
  108182. }
  108183. if (!media.segments) {
  108184. return;
  108185. }
  108186. var mediaTime = offset;
  108187. var cue;
  108188. for (var i2 = 0; i2 < media.segments.length; i2++) {
  108189. var segment = media.segments[i2];
  108190. if (!cue) {
  108191. cue = findAdCue(track, mediaTime + segment.duration / 2);
  108192. }
  108193. if (cue) {
  108194. if ("cueIn" in segment) {
  108195. cue.endTime = mediaTime;
  108196. cue.adEndTime = mediaTime;
  108197. mediaTime += segment.duration;
  108198. cue = null;
  108199. continue;
  108200. }
  108201. if (mediaTime < cue.endTime) {
  108202. mediaTime += segment.duration;
  108203. continue;
  108204. }
  108205. cue.endTime += segment.duration;
  108206. } else {
  108207. if ("cueOut" in segment) {
  108208. cue = new window_1.VTTCue(mediaTime, mediaTime + segment.duration, segment.cueOut);
  108209. cue.adStartTime = mediaTime;
  108210. cue.adEndTime = mediaTime + parseFloat(segment.cueOut);
  108211. track.addCue(cue);
  108212. }
  108213. if ("cueOutCont" in segment) {
  108214. var _segment$cueOutCont$s = segment.cueOutCont.split("/").map(parseFloat), adOffset = _segment$cueOutCont$s[0], adTotal = _segment$cueOutCont$s[1];
  108215. cue = new window_1.VTTCue(mediaTime, mediaTime + segment.duration, "");
  108216. cue.adStartTime = mediaTime - adOffset;
  108217. cue.adEndTime = cue.adStartTime + adTotal;
  108218. track.addCue(cue);
  108219. }
  108220. }
  108221. mediaTime += segment.duration;
  108222. }
  108223. };
  108224. var MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC = 86400;
  108225. var syncPointStrategies = [
  108226. {
  108227. name: "VOD",
  108228. run: function run(syncController, playlist, duration5, currentTimeline, currentTime) {
  108229. if (duration5 !== Infinity) {
  108230. var syncPoint = {
  108231. time: 0,
  108232. segmentIndex: 0,
  108233. partIndex: null
  108234. };
  108235. return syncPoint;
  108236. }
  108237. return null;
  108238. }
  108239. },
  108240. {
  108241. name: "ProgramDateTime",
  108242. run: function run2(syncController, playlist, duration5, currentTimeline, currentTime) {
  108243. if (!Object.keys(syncController.timelineToDatetimeMappings).length) {
  108244. return null;
  108245. }
  108246. var syncPoint = null;
  108247. var lastDistance = null;
  108248. var partsAndSegments = getPartsAndSegments(playlist);
  108249. currentTime = currentTime || 0;
  108250. for (var i2 = 0; i2 < partsAndSegments.length; i2++) {
  108251. var index2 = playlist.endList || currentTime === 0 ? i2 : partsAndSegments.length - (i2 + 1);
  108252. var partAndSegment = partsAndSegments[index2];
  108253. var segment = partAndSegment.segment;
  108254. var datetimeMapping = syncController.timelineToDatetimeMappings[segment.timeline];
  108255. if (!datetimeMapping || !segment.dateTimeObject) {
  108256. continue;
  108257. }
  108258. var segmentTime = segment.dateTimeObject.getTime() / 1e3;
  108259. var start2 = segmentTime + datetimeMapping;
  108260. if (segment.parts && typeof partAndSegment.partIndex === "number") {
  108261. for (var z = 0; z < partAndSegment.partIndex; z++) {
  108262. start2 += segment.parts[z].duration;
  108263. }
  108264. }
  108265. var distance2 = Math.abs(currentTime - start2);
  108266. if (lastDistance !== null && (distance2 === 0 || lastDistance < distance2)) {
  108267. break;
  108268. }
  108269. lastDistance = distance2;
  108270. syncPoint = {
  108271. time: start2,
  108272. segmentIndex: partAndSegment.segmentIndex,
  108273. partIndex: partAndSegment.partIndex
  108274. };
  108275. }
  108276. return syncPoint;
  108277. }
  108278. },
  108279. {
  108280. name: "Segment",
  108281. run: function run3(syncController, playlist, duration5, currentTimeline, currentTime) {
  108282. var syncPoint = null;
  108283. var lastDistance = null;
  108284. currentTime = currentTime || 0;
  108285. var partsAndSegments = getPartsAndSegments(playlist);
  108286. for (var i2 = 0; i2 < partsAndSegments.length; i2++) {
  108287. var index2 = playlist.endList || currentTime === 0 ? i2 : partsAndSegments.length - (i2 + 1);
  108288. var partAndSegment = partsAndSegments[index2];
  108289. var segment = partAndSegment.segment;
  108290. var start2 = partAndSegment.part && partAndSegment.part.start || segment && segment.start;
  108291. if (segment.timeline === currentTimeline && typeof start2 !== "undefined") {
  108292. var distance2 = Math.abs(currentTime - start2);
  108293. if (lastDistance !== null && lastDistance < distance2) {
  108294. break;
  108295. }
  108296. if (!syncPoint || lastDistance === null || lastDistance >= distance2) {
  108297. lastDistance = distance2;
  108298. syncPoint = {
  108299. time: start2,
  108300. segmentIndex: partAndSegment.segmentIndex,
  108301. partIndex: partAndSegment.partIndex
  108302. };
  108303. }
  108304. }
  108305. }
  108306. return syncPoint;
  108307. }
  108308. },
  108309. {
  108310. name: "Discontinuity",
  108311. run: function run4(syncController, playlist, duration5, currentTimeline, currentTime) {
  108312. var syncPoint = null;
  108313. currentTime = currentTime || 0;
  108314. if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {
  108315. var lastDistance = null;
  108316. for (var i2 = 0; i2 < playlist.discontinuityStarts.length; i2++) {
  108317. var segmentIndex = playlist.discontinuityStarts[i2];
  108318. var discontinuity = playlist.discontinuitySequence + i2 + 1;
  108319. var discontinuitySync = syncController.discontinuities[discontinuity];
  108320. if (discontinuitySync) {
  108321. var distance2 = Math.abs(currentTime - discontinuitySync.time);
  108322. if (lastDistance !== null && lastDistance < distance2) {
  108323. break;
  108324. }
  108325. if (!syncPoint || lastDistance === null || lastDistance >= distance2) {
  108326. lastDistance = distance2;
  108327. syncPoint = {
  108328. time: discontinuitySync.time,
  108329. segmentIndex,
  108330. partIndex: null
  108331. };
  108332. }
  108333. }
  108334. }
  108335. }
  108336. return syncPoint;
  108337. }
  108338. },
  108339. {
  108340. name: "Playlist",
  108341. run: function run5(syncController, playlist, duration5, currentTimeline, currentTime) {
  108342. if (playlist.syncInfo) {
  108343. var syncPoint = {
  108344. time: playlist.syncInfo.time,
  108345. segmentIndex: playlist.syncInfo.mediaSequence - playlist.mediaSequence,
  108346. partIndex: null
  108347. };
  108348. return syncPoint;
  108349. }
  108350. return null;
  108351. }
  108352. }
  108353. ];
  108354. var SyncController = /* @__PURE__ */ function(_videojs$EventTarget) {
  108355. _inheritsLoose(SyncController2, _videojs$EventTarget);
  108356. function SyncController2(options2) {
  108357. var _this;
  108358. _this = _videojs$EventTarget.call(this) || this;
  108359. _this.timelines = [];
  108360. _this.discontinuities = [];
  108361. _this.timelineToDatetimeMappings = {};
  108362. _this.logger_ = logger("SyncController");
  108363. return _this;
  108364. }
  108365. var _proto = SyncController2.prototype;
  108366. _proto.getSyncPoint = function getSyncPoint(playlist, duration5, currentTimeline, currentTime) {
  108367. var syncPoints = this.runStrategies_(playlist, duration5, currentTimeline, currentTime);
  108368. if (!syncPoints.length) {
  108369. return null;
  108370. }
  108371. return this.selectSyncPoint_(syncPoints, {
  108372. key: "time",
  108373. value: currentTime
  108374. });
  108375. };
  108376. _proto.getExpiredTime = function getExpiredTime(playlist, duration5) {
  108377. if (!playlist || !playlist.segments) {
  108378. return null;
  108379. }
  108380. var syncPoints = this.runStrategies_(playlist, duration5, playlist.discontinuitySequence, 0);
  108381. if (!syncPoints.length) {
  108382. return null;
  108383. }
  108384. var syncPoint = this.selectSyncPoint_(syncPoints, {
  108385. key: "segmentIndex",
  108386. value: 0
  108387. });
  108388. if (syncPoint.segmentIndex > 0) {
  108389. syncPoint.time *= -1;
  108390. }
  108391. return Math.abs(syncPoint.time + sumDurations({
  108392. defaultDuration: playlist.targetDuration,
  108393. durationList: playlist.segments,
  108394. startIndex: syncPoint.segmentIndex,
  108395. endIndex: 0
  108396. }));
  108397. };
  108398. _proto.runStrategies_ = function runStrategies_(playlist, duration5, currentTimeline, currentTime) {
  108399. var syncPoints = [];
  108400. for (var i2 = 0; i2 < syncPointStrategies.length; i2++) {
  108401. var strategy = syncPointStrategies[i2];
  108402. var syncPoint = strategy.run(this, playlist, duration5, currentTimeline, currentTime);
  108403. if (syncPoint) {
  108404. syncPoint.strategy = strategy.name;
  108405. syncPoints.push({
  108406. strategy: strategy.name,
  108407. syncPoint
  108408. });
  108409. }
  108410. }
  108411. return syncPoints;
  108412. };
  108413. _proto.selectSyncPoint_ = function selectSyncPoint_(syncPoints, target) {
  108414. var bestSyncPoint = syncPoints[0].syncPoint;
  108415. var bestDistance = Math.abs(syncPoints[0].syncPoint[target.key] - target.value);
  108416. var bestStrategy = syncPoints[0].strategy;
  108417. for (var i2 = 1; i2 < syncPoints.length; i2++) {
  108418. var newDistance = Math.abs(syncPoints[i2].syncPoint[target.key] - target.value);
  108419. if (newDistance < bestDistance) {
  108420. bestDistance = newDistance;
  108421. bestSyncPoint = syncPoints[i2].syncPoint;
  108422. bestStrategy = syncPoints[i2].strategy;
  108423. }
  108424. }
  108425. this.logger_("syncPoint for [" + target.key + ": " + target.value + "] chosen with strategy" + (" [" + bestStrategy + "]: [time:" + bestSyncPoint.time + ",") + (" segmentIndex:" + bestSyncPoint.segmentIndex) + (typeof bestSyncPoint.partIndex === "number" ? ",partIndex:" + bestSyncPoint.partIndex : "") + "]");
  108426. return bestSyncPoint;
  108427. };
  108428. _proto.saveExpiredSegmentInfo = function saveExpiredSegmentInfo(oldPlaylist, newPlaylist) {
  108429. var mediaSequenceDiff = newPlaylist.mediaSequence - oldPlaylist.mediaSequence;
  108430. if (mediaSequenceDiff > MAX_MEDIA_SEQUENCE_DIFF_FOR_SYNC) {
  108431. videojs.log.warn("Not saving expired segment info. Media sequence gap " + mediaSequenceDiff + " is too large.");
  108432. return;
  108433. }
  108434. for (var i2 = mediaSequenceDiff - 1; i2 >= 0; i2--) {
  108435. var lastRemovedSegment = oldPlaylist.segments[i2];
  108436. if (lastRemovedSegment && typeof lastRemovedSegment.start !== "undefined") {
  108437. newPlaylist.syncInfo = {
  108438. mediaSequence: oldPlaylist.mediaSequence + i2,
  108439. time: lastRemovedSegment.start
  108440. };
  108441. this.logger_("playlist refresh sync: [time:" + newPlaylist.syncInfo.time + "," + (" mediaSequence: " + newPlaylist.syncInfo.mediaSequence + "]"));
  108442. this.trigger("syncinfoupdate");
  108443. break;
  108444. }
  108445. }
  108446. };
  108447. _proto.setDateTimeMappingForStart = function setDateTimeMappingForStart(playlist) {
  108448. this.timelineToDatetimeMappings = {};
  108449. if (playlist.segments && playlist.segments.length && playlist.segments[0].dateTimeObject) {
  108450. var firstSegment = playlist.segments[0];
  108451. var playlistTimestamp = firstSegment.dateTimeObject.getTime() / 1e3;
  108452. this.timelineToDatetimeMappings[firstSegment.timeline] = -playlistTimestamp;
  108453. }
  108454. };
  108455. _proto.saveSegmentTimingInfo = function saveSegmentTimingInfo(_ref) {
  108456. var segmentInfo = _ref.segmentInfo, shouldSaveTimelineMapping = _ref.shouldSaveTimelineMapping;
  108457. var didCalculateSegmentTimeMapping = this.calculateSegmentTimeMapping_(segmentInfo, segmentInfo.timingInfo, shouldSaveTimelineMapping);
  108458. var segment = segmentInfo.segment;
  108459. if (didCalculateSegmentTimeMapping) {
  108460. this.saveDiscontinuitySyncInfo_(segmentInfo);
  108461. if (!segmentInfo.playlist.syncInfo) {
  108462. segmentInfo.playlist.syncInfo = {
  108463. mediaSequence: segmentInfo.playlist.mediaSequence + segmentInfo.mediaIndex,
  108464. time: segment.start
  108465. };
  108466. }
  108467. }
  108468. var dateTime = segment.dateTimeObject;
  108469. if (segment.discontinuity && shouldSaveTimelineMapping && dateTime) {
  108470. this.timelineToDatetimeMappings[segment.timeline] = -(dateTime.getTime() / 1e3);
  108471. }
  108472. };
  108473. _proto.timestampOffsetForTimeline = function timestampOffsetForTimeline(timeline) {
  108474. if (typeof this.timelines[timeline] === "undefined") {
  108475. return null;
  108476. }
  108477. return this.timelines[timeline].time;
  108478. };
  108479. _proto.mappingForTimeline = function mappingForTimeline(timeline) {
  108480. if (typeof this.timelines[timeline] === "undefined") {
  108481. return null;
  108482. }
  108483. return this.timelines[timeline].mapping;
  108484. };
  108485. _proto.calculateSegmentTimeMapping_ = function calculateSegmentTimeMapping_(segmentInfo, timingInfo, shouldSaveTimelineMapping) {
  108486. var segment = segmentInfo.segment;
  108487. var part = segmentInfo.part;
  108488. var mappingObj = this.timelines[segmentInfo.timeline];
  108489. var start2;
  108490. var end;
  108491. if (typeof segmentInfo.timestampOffset === "number") {
  108492. mappingObj = {
  108493. time: segmentInfo.startOfSegment,
  108494. mapping: segmentInfo.startOfSegment - timingInfo.start
  108495. };
  108496. if (shouldSaveTimelineMapping) {
  108497. this.timelines[segmentInfo.timeline] = mappingObj;
  108498. this.trigger("timestampoffset");
  108499. this.logger_("time mapping for timeline " + segmentInfo.timeline + ": " + ("[time: " + mappingObj.time + "] [mapping: " + mappingObj.mapping + "]"));
  108500. }
  108501. start2 = segmentInfo.startOfSegment;
  108502. end = timingInfo.end + mappingObj.mapping;
  108503. } else if (mappingObj) {
  108504. start2 = timingInfo.start + mappingObj.mapping;
  108505. end = timingInfo.end + mappingObj.mapping;
  108506. } else {
  108507. return false;
  108508. }
  108509. if (part) {
  108510. part.start = start2;
  108511. part.end = end;
  108512. }
  108513. if (!segment.start || start2 < segment.start) {
  108514. segment.start = start2;
  108515. }
  108516. segment.end = end;
  108517. return true;
  108518. };
  108519. _proto.saveDiscontinuitySyncInfo_ = function saveDiscontinuitySyncInfo_(segmentInfo) {
  108520. var playlist = segmentInfo.playlist;
  108521. var segment = segmentInfo.segment;
  108522. if (segment.discontinuity) {
  108523. this.discontinuities[segment.timeline] = {
  108524. time: segment.start,
  108525. accuracy: 0
  108526. };
  108527. } else if (playlist.discontinuityStarts && playlist.discontinuityStarts.length) {
  108528. for (var i2 = 0; i2 < playlist.discontinuityStarts.length; i2++) {
  108529. var segmentIndex = playlist.discontinuityStarts[i2];
  108530. var discontinuity = playlist.discontinuitySequence + i2 + 1;
  108531. var mediaIndexDiff = segmentIndex - segmentInfo.mediaIndex;
  108532. var accuracy = Math.abs(mediaIndexDiff);
  108533. if (!this.discontinuities[discontinuity] || this.discontinuities[discontinuity].accuracy > accuracy) {
  108534. var time = void 0;
  108535. if (mediaIndexDiff < 0) {
  108536. time = segment.start - sumDurations({
  108537. defaultDuration: playlist.targetDuration,
  108538. durationList: playlist.segments,
  108539. startIndex: segmentInfo.mediaIndex,
  108540. endIndex: segmentIndex
  108541. });
  108542. } else {
  108543. time = segment.end + sumDurations({
  108544. defaultDuration: playlist.targetDuration,
  108545. durationList: playlist.segments,
  108546. startIndex: segmentInfo.mediaIndex + 1,
  108547. endIndex: segmentIndex
  108548. });
  108549. }
  108550. this.discontinuities[discontinuity] = {
  108551. time,
  108552. accuracy
  108553. };
  108554. }
  108555. }
  108556. }
  108557. };
  108558. _proto.dispose = function dispose() {
  108559. this.trigger("dispose");
  108560. this.off();
  108561. };
  108562. return SyncController2;
  108563. }(videojs.EventTarget);
  108564. var TimelineChangeController = /* @__PURE__ */ function(_videojs$EventTarget) {
  108565. _inheritsLoose(TimelineChangeController2, _videojs$EventTarget);
  108566. function TimelineChangeController2() {
  108567. var _this;
  108568. _this = _videojs$EventTarget.call(this) || this;
  108569. _this.pendingTimelineChanges_ = {};
  108570. _this.lastTimelineChanges_ = {};
  108571. return _this;
  108572. }
  108573. var _proto = TimelineChangeController2.prototype;
  108574. _proto.clearPendingTimelineChange = function clearPendingTimelineChange(type2) {
  108575. this.pendingTimelineChanges_[type2] = null;
  108576. this.trigger("pendingtimelinechange");
  108577. };
  108578. _proto.pendingTimelineChange = function pendingTimelineChange(_ref) {
  108579. var type2 = _ref.type, from3 = _ref.from, to = _ref.to;
  108580. if (typeof from3 === "number" && typeof to === "number") {
  108581. this.pendingTimelineChanges_[type2] = {
  108582. type: type2,
  108583. from: from3,
  108584. to
  108585. };
  108586. this.trigger("pendingtimelinechange");
  108587. }
  108588. return this.pendingTimelineChanges_[type2];
  108589. };
  108590. _proto.lastTimelineChange = function lastTimelineChange(_ref2) {
  108591. var type2 = _ref2.type, from3 = _ref2.from, to = _ref2.to;
  108592. if (typeof from3 === "number" && typeof to === "number") {
  108593. this.lastTimelineChanges_[type2] = {
  108594. type: type2,
  108595. from: from3,
  108596. to
  108597. };
  108598. delete this.pendingTimelineChanges_[type2];
  108599. this.trigger("timelinechange");
  108600. }
  108601. return this.lastTimelineChanges_[type2];
  108602. };
  108603. _proto.dispose = function dispose() {
  108604. this.trigger("dispose");
  108605. this.pendingTimelineChanges_ = {};
  108606. this.lastTimelineChanges_ = {};
  108607. this.off();
  108608. };
  108609. return TimelineChangeController2;
  108610. }(videojs.EventTarget);
  108611. var workerCode = transform(getWorkerString(function() {
  108612. var commonjsGlobal2 = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  108613. function createCommonjsModule(fn2, basedir, module2) {
  108614. return module2 = {
  108615. path: basedir,
  108616. exports: {},
  108617. require: function require2(path, base2) {
  108618. return commonjsRequire(path, base2 === void 0 || base2 === null ? module2.path : base2);
  108619. }
  108620. }, fn2(module2, module2.exports), module2.exports;
  108621. }
  108622. function commonjsRequire() {
  108623. throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
  108624. }
  108625. var createClass = createCommonjsModule(function(module2) {
  108626. function _defineProperties(target, props) {
  108627. for (var i2 = 0; i2 < props.length; i2++) {
  108628. var descriptor = props[i2];
  108629. descriptor.enumerable = descriptor.enumerable || false;
  108630. descriptor.configurable = true;
  108631. if ("value" in descriptor)
  108632. descriptor.writable = true;
  108633. Object.defineProperty(target, descriptor.key, descriptor);
  108634. }
  108635. }
  108636. function _createClass(Constructor, protoProps, staticProps) {
  108637. if (protoProps)
  108638. _defineProperties(Constructor.prototype, protoProps);
  108639. if (staticProps)
  108640. _defineProperties(Constructor, staticProps);
  108641. return Constructor;
  108642. }
  108643. module2.exports = _createClass;
  108644. module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
  108645. });
  108646. var setPrototypeOf = createCommonjsModule(function(module2) {
  108647. function _setPrototypeOf2(o, p) {
  108648. module2.exports = _setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf3(o2, p2) {
  108649. o2.__proto__ = p2;
  108650. return o2;
  108651. };
  108652. module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
  108653. return _setPrototypeOf2(o, p);
  108654. }
  108655. module2.exports = _setPrototypeOf2;
  108656. module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
  108657. });
  108658. var inheritsLoose = createCommonjsModule(function(module2) {
  108659. function _inheritsLoose2(subClass, superClass) {
  108660. subClass.prototype = Object.create(superClass.prototype);
  108661. subClass.prototype.constructor = subClass;
  108662. setPrototypeOf(subClass, superClass);
  108663. }
  108664. module2.exports = _inheritsLoose2;
  108665. module2.exports["default"] = module2.exports, module2.exports.__esModule = true;
  108666. });
  108667. var Stream2 = /* @__PURE__ */ function() {
  108668. function Stream3() {
  108669. this.listeners = {};
  108670. }
  108671. var _proto = Stream3.prototype;
  108672. _proto.on = function on3(type2, listener) {
  108673. if (!this.listeners[type2]) {
  108674. this.listeners[type2] = [];
  108675. }
  108676. this.listeners[type2].push(listener);
  108677. };
  108678. _proto.off = function off2(type2, listener) {
  108679. if (!this.listeners[type2]) {
  108680. return false;
  108681. }
  108682. var index2 = this.listeners[type2].indexOf(listener);
  108683. this.listeners[type2] = this.listeners[type2].slice(0);
  108684. this.listeners[type2].splice(index2, 1);
  108685. return index2 > -1;
  108686. };
  108687. _proto.trigger = function trigger2(type2) {
  108688. var callbacks = this.listeners[type2];
  108689. if (!callbacks) {
  108690. return;
  108691. }
  108692. if (arguments.length === 2) {
  108693. var length = callbacks.length;
  108694. for (var i2 = 0; i2 < length; ++i2) {
  108695. callbacks[i2].call(this, arguments[1]);
  108696. }
  108697. } else {
  108698. var args = Array.prototype.slice.call(arguments, 1);
  108699. var _length = callbacks.length;
  108700. for (var _i = 0; _i < _length; ++_i) {
  108701. callbacks[_i].apply(this, args);
  108702. }
  108703. }
  108704. };
  108705. _proto.dispose = function dispose() {
  108706. this.listeners = {};
  108707. };
  108708. _proto.pipe = function pipe(destination2) {
  108709. this.on("data", function(data) {
  108710. destination2.push(data);
  108711. });
  108712. };
  108713. return Stream3;
  108714. }();
  108715. /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
  108716. function unpad(padded) {
  108717. return padded.subarray(0, padded.byteLength - padded[padded.byteLength - 1]);
  108718. }
  108719. /*! @name aes-decrypter @version 3.1.3 @license Apache-2.0 */
  108720. var precompute = function precompute2() {
  108721. var tables = [[[], [], [], [], []], [[], [], [], [], []]];
  108722. var encTable = tables[0];
  108723. var decTable = tables[1];
  108724. var sbox = encTable[4];
  108725. var sboxInv = decTable[4];
  108726. var i2;
  108727. var x;
  108728. var xInv;
  108729. var d2 = [];
  108730. var th = [];
  108731. var x2;
  108732. var x4;
  108733. var x8;
  108734. var s;
  108735. var tEnc;
  108736. var tDec;
  108737. for (i2 = 0; i2 < 256; i2++) {
  108738. th[(d2[i2] = i2 << 1 ^ (i2 >> 7) * 283) ^ i2] = i2;
  108739. }
  108740. for (x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {
  108741. s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;
  108742. s = s >> 8 ^ s & 255 ^ 99;
  108743. sbox[x] = s;
  108744. sboxInv[s] = x;
  108745. x8 = d2[x4 = d2[x2 = d2[x]]];
  108746. tDec = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008;
  108747. tEnc = d2[s] * 257 ^ s * 16843008;
  108748. for (i2 = 0; i2 < 4; i2++) {
  108749. encTable[i2][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;
  108750. decTable[i2][s] = tDec = tDec << 24 ^ tDec >>> 8;
  108751. }
  108752. }
  108753. for (i2 = 0; i2 < 5; i2++) {
  108754. encTable[i2] = encTable[i2].slice(0);
  108755. decTable[i2] = decTable[i2].slice(0);
  108756. }
  108757. return tables;
  108758. };
  108759. var aesTables = null;
  108760. var AES = /* @__PURE__ */ function() {
  108761. function AES2(key) {
  108762. if (!aesTables) {
  108763. aesTables = precompute();
  108764. }
  108765. this._tables = [[aesTables[0][0].slice(), aesTables[0][1].slice(), aesTables[0][2].slice(), aesTables[0][3].slice(), aesTables[0][4].slice()], [aesTables[1][0].slice(), aesTables[1][1].slice(), aesTables[1][2].slice(), aesTables[1][3].slice(), aesTables[1][4].slice()]];
  108766. var i2;
  108767. var j;
  108768. var tmp;
  108769. var sbox = this._tables[0][4];
  108770. var decTable = this._tables[1];
  108771. var keyLen = key.length;
  108772. var rcon = 1;
  108773. if (keyLen !== 4 && keyLen !== 6 && keyLen !== 8) {
  108774. throw new Error("Invalid aes key size");
  108775. }
  108776. var encKey = key.slice(0);
  108777. var decKey = [];
  108778. this._key = [encKey, decKey];
  108779. for (i2 = keyLen; i2 < 4 * keyLen + 28; i2++) {
  108780. tmp = encKey[i2 - 1];
  108781. if (i2 % keyLen === 0 || keyLen === 8 && i2 % keyLen === 4) {
  108782. tmp = sbox[tmp >>> 24] << 24 ^ sbox[tmp >> 16 & 255] << 16 ^ sbox[tmp >> 8 & 255] << 8 ^ sbox[tmp & 255];
  108783. if (i2 % keyLen === 0) {
  108784. tmp = tmp << 8 ^ tmp >>> 24 ^ rcon << 24;
  108785. rcon = rcon << 1 ^ (rcon >> 7) * 283;
  108786. }
  108787. }
  108788. encKey[i2] = encKey[i2 - keyLen] ^ tmp;
  108789. }
  108790. for (j = 0; i2; j++, i2--) {
  108791. tmp = encKey[j & 3 ? i2 : i2 - 4];
  108792. if (i2 <= 4 || j < 4) {
  108793. decKey[j] = tmp;
  108794. } else {
  108795. decKey[j] = decTable[0][sbox[tmp >>> 24]] ^ decTable[1][sbox[tmp >> 16 & 255]] ^ decTable[2][sbox[tmp >> 8 & 255]] ^ decTable[3][sbox[tmp & 255]];
  108796. }
  108797. }
  108798. }
  108799. var _proto = AES2.prototype;
  108800. _proto.decrypt = function decrypt4(encrypted0, encrypted1, encrypted2, encrypted3, out, offset) {
  108801. var key = this._key[1];
  108802. var a = encrypted0 ^ key[0];
  108803. var b = encrypted3 ^ key[1];
  108804. var c = encrypted2 ^ key[2];
  108805. var d2 = encrypted1 ^ key[3];
  108806. var a2;
  108807. var b2;
  108808. var c2;
  108809. var nInnerRounds = key.length / 4 - 2;
  108810. var i2;
  108811. var kIndex = 4;
  108812. var table = this._tables[1];
  108813. var table0 = table[0];
  108814. var table1 = table[1];
  108815. var table2 = table[2];
  108816. var table3 = table[3];
  108817. var sbox = table[4];
  108818. for (i2 = 0; i2 < nInnerRounds; i2++) {
  108819. a2 = table0[a >>> 24] ^ table1[b >> 16 & 255] ^ table2[c >> 8 & 255] ^ table3[d2 & 255] ^ key[kIndex];
  108820. b2 = table0[b >>> 24] ^ table1[c >> 16 & 255] ^ table2[d2 >> 8 & 255] ^ table3[a & 255] ^ key[kIndex + 1];
  108821. c2 = table0[c >>> 24] ^ table1[d2 >> 16 & 255] ^ table2[a >> 8 & 255] ^ table3[b & 255] ^ key[kIndex + 2];
  108822. d2 = table0[d2 >>> 24] ^ table1[a >> 16 & 255] ^ table2[b >> 8 & 255] ^ table3[c & 255] ^ key[kIndex + 3];
  108823. kIndex += 4;
  108824. a = a2;
  108825. b = b2;
  108826. c = c2;
  108827. }
  108828. for (i2 = 0; i2 < 4; i2++) {
  108829. out[(3 & -i2) + offset] = sbox[a >>> 24] << 24 ^ sbox[b >> 16 & 255] << 16 ^ sbox[c >> 8 & 255] << 8 ^ sbox[d2 & 255] ^ key[kIndex++];
  108830. a2 = a;
  108831. a = b;
  108832. b = c;
  108833. c = d2;
  108834. d2 = a2;
  108835. }
  108836. };
  108837. return AES2;
  108838. }();
  108839. var AsyncStream = /* @__PURE__ */ function(_Stream) {
  108840. inheritsLoose(AsyncStream2, _Stream);
  108841. function AsyncStream2() {
  108842. var _this;
  108843. _this = _Stream.call(this, Stream2) || this;
  108844. _this.jobs = [];
  108845. _this.delay = 1;
  108846. _this.timeout_ = null;
  108847. return _this;
  108848. }
  108849. var _proto = AsyncStream2.prototype;
  108850. _proto.processJob_ = function processJob_() {
  108851. this.jobs.shift()();
  108852. if (this.jobs.length) {
  108853. this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);
  108854. } else {
  108855. this.timeout_ = null;
  108856. }
  108857. };
  108858. _proto.push = function push(job) {
  108859. this.jobs.push(job);
  108860. if (!this.timeout_) {
  108861. this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay);
  108862. }
  108863. };
  108864. return AsyncStream2;
  108865. }(Stream2);
  108866. var ntoh = function ntoh2(word) {
  108867. return word << 24 | (word & 65280) << 8 | (word & 16711680) >> 8 | word >>> 24;
  108868. };
  108869. var decrypt3 = function decrypt4(encrypted, key, initVector) {
  108870. var encrypted32 = new Int32Array(encrypted.buffer, encrypted.byteOffset, encrypted.byteLength >> 2);
  108871. var decipher = new AES(Array.prototype.slice.call(key));
  108872. var decrypted = new Uint8Array(encrypted.byteLength);
  108873. var decrypted32 = new Int32Array(decrypted.buffer);
  108874. var init0;
  108875. var init1;
  108876. var init2;
  108877. var init3;
  108878. var encrypted0;
  108879. var encrypted1;
  108880. var encrypted2;
  108881. var encrypted3;
  108882. var wordIx;
  108883. init0 = initVector[0];
  108884. init1 = initVector[1];
  108885. init2 = initVector[2];
  108886. init3 = initVector[3];
  108887. for (wordIx = 0; wordIx < encrypted32.length; wordIx += 4) {
  108888. encrypted0 = ntoh(encrypted32[wordIx]);
  108889. encrypted1 = ntoh(encrypted32[wordIx + 1]);
  108890. encrypted2 = ntoh(encrypted32[wordIx + 2]);
  108891. encrypted3 = ntoh(encrypted32[wordIx + 3]);
  108892. decipher.decrypt(encrypted0, encrypted1, encrypted2, encrypted3, decrypted32, wordIx);
  108893. decrypted32[wordIx] = ntoh(decrypted32[wordIx] ^ init0);
  108894. decrypted32[wordIx + 1] = ntoh(decrypted32[wordIx + 1] ^ init1);
  108895. decrypted32[wordIx + 2] = ntoh(decrypted32[wordIx + 2] ^ init2);
  108896. decrypted32[wordIx + 3] = ntoh(decrypted32[wordIx + 3] ^ init3);
  108897. init0 = encrypted0;
  108898. init1 = encrypted1;
  108899. init2 = encrypted2;
  108900. init3 = encrypted3;
  108901. }
  108902. return decrypted;
  108903. };
  108904. var Decrypter2 = /* @__PURE__ */ function() {
  108905. function Decrypter3(encrypted, key, initVector, done) {
  108906. var step = Decrypter3.STEP;
  108907. var encrypted32 = new Int32Array(encrypted.buffer);
  108908. var decrypted = new Uint8Array(encrypted.byteLength);
  108909. var i2 = 0;
  108910. this.asyncStream_ = new AsyncStream();
  108911. this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i2, i2 + step), key, initVector, decrypted));
  108912. for (i2 = step; i2 < encrypted32.length; i2 += step) {
  108913. initVector = new Uint32Array([ntoh(encrypted32[i2 - 4]), ntoh(encrypted32[i2 - 3]), ntoh(encrypted32[i2 - 2]), ntoh(encrypted32[i2 - 1])]);
  108914. this.asyncStream_.push(this.decryptChunk_(encrypted32.subarray(i2, i2 + step), key, initVector, decrypted));
  108915. }
  108916. this.asyncStream_.push(function() {
  108917. done(null, unpad(decrypted));
  108918. });
  108919. }
  108920. var _proto = Decrypter3.prototype;
  108921. _proto.decryptChunk_ = function decryptChunk_(encrypted, key, initVector, decrypted) {
  108922. return function() {
  108923. var bytes = decrypt3(encrypted, key, initVector);
  108924. decrypted.set(bytes, encrypted.byteOffset);
  108925. };
  108926. };
  108927. createClass(Decrypter3, null, [{
  108928. key: "STEP",
  108929. get: function get7() {
  108930. return 32e3;
  108931. }
  108932. }]);
  108933. return Decrypter3;
  108934. }();
  108935. var win2;
  108936. if (typeof window !== "undefined") {
  108937. win2 = window;
  108938. } else if (typeof commonjsGlobal2 !== "undefined") {
  108939. win2 = commonjsGlobal2;
  108940. } else if (typeof self !== "undefined") {
  108941. win2 = self;
  108942. } else {
  108943. win2 = {};
  108944. }
  108945. var window_12 = win2;
  108946. var isArrayBufferView4 = function isArrayBufferView5(obj) {
  108947. if (ArrayBuffer.isView === "function") {
  108948. return ArrayBuffer.isView(obj);
  108949. }
  108950. return obj && obj.buffer instanceof ArrayBuffer;
  108951. };
  108952. var BigInt2 = window_12.BigInt || Number;
  108953. [BigInt2("0x1"), BigInt2("0x100"), BigInt2("0x10000"), BigInt2("0x1000000"), BigInt2("0x100000000"), BigInt2("0x10000000000"), BigInt2("0x1000000000000"), BigInt2("0x100000000000000"), BigInt2("0x10000000000000000")];
  108954. var createTransferableMessage3 = function createTransferableMessage4(message) {
  108955. var transferable = {};
  108956. Object.keys(message).forEach(function(key) {
  108957. var value = message[key];
  108958. if (isArrayBufferView4(value)) {
  108959. transferable[key] = {
  108960. bytes: value.buffer,
  108961. byteOffset: value.byteOffset,
  108962. byteLength: value.byteLength
  108963. };
  108964. } else {
  108965. transferable[key] = value;
  108966. }
  108967. });
  108968. return transferable;
  108969. };
  108970. self.onmessage = function(event2) {
  108971. var data = event2.data;
  108972. var encrypted = new Uint8Array(data.encrypted.bytes, data.encrypted.byteOffset, data.encrypted.byteLength);
  108973. var key = new Uint32Array(data.key.bytes, data.key.byteOffset, data.key.byteLength / 4);
  108974. var iv = new Uint32Array(data.iv.bytes, data.iv.byteOffset, data.iv.byteLength / 4);
  108975. new Decrypter2(encrypted, key, iv, function(err, bytes) {
  108976. self.postMessage(createTransferableMessage3({
  108977. source: data.source,
  108978. decrypted: bytes
  108979. }), [bytes.buffer]);
  108980. });
  108981. };
  108982. }));
  108983. var Decrypter = factory(workerCode);
  108984. var audioTrackKind_ = function audioTrackKind_2(properties) {
  108985. var kind = properties["default"] ? "main" : "alternative";
  108986. if (properties.characteristics && properties.characteristics.indexOf("public.accessibility.describes-video") >= 0) {
  108987. kind = "main-desc";
  108988. }
  108989. return kind;
  108990. };
  108991. var stopLoaders = function stopLoaders2(segmentLoader, mediaType) {
  108992. segmentLoader.abort();
  108993. segmentLoader.pause();
  108994. if (mediaType && mediaType.activePlaylistLoader) {
  108995. mediaType.activePlaylistLoader.pause();
  108996. mediaType.activePlaylistLoader = null;
  108997. }
  108998. };
  108999. var startLoaders = function startLoaders2(playlistLoader, mediaType) {
  109000. mediaType.activePlaylistLoader = playlistLoader;
  109001. playlistLoader.load();
  109002. };
  109003. var onGroupChanged = function onGroupChanged2(type2, settings) {
  109004. return function() {
  109005. var _settings$segmentLoad = settings.segmentLoaders, segmentLoader = _settings$segmentLoad[type2], mainSegmentLoader = _settings$segmentLoad.main, mediaType = settings.mediaTypes[type2];
  109006. var activeTrack2 = mediaType.activeTrack();
  109007. var activeGroup3 = mediaType.getActiveGroup();
  109008. var previousActiveLoader = mediaType.activePlaylistLoader;
  109009. var lastGroup = mediaType.lastGroup_;
  109010. if (activeGroup3 && lastGroup && activeGroup3.id === lastGroup.id) {
  109011. return;
  109012. }
  109013. mediaType.lastGroup_ = activeGroup3;
  109014. mediaType.lastTrack_ = activeTrack2;
  109015. stopLoaders(segmentLoader, mediaType);
  109016. if (!activeGroup3 || activeGroup3.isMasterPlaylist) {
  109017. return;
  109018. }
  109019. if (!activeGroup3.playlistLoader) {
  109020. if (previousActiveLoader) {
  109021. mainSegmentLoader.resetEverything();
  109022. }
  109023. return;
  109024. }
  109025. segmentLoader.resyncLoader();
  109026. startLoaders(activeGroup3.playlistLoader, mediaType);
  109027. };
  109028. };
  109029. var onGroupChanging = function onGroupChanging2(type2, settings) {
  109030. return function() {
  109031. var segmentLoader = settings.segmentLoaders[type2], mediaType = settings.mediaTypes[type2];
  109032. mediaType.lastGroup_ = null;
  109033. segmentLoader.abort();
  109034. segmentLoader.pause();
  109035. };
  109036. };
  109037. var onTrackChanged = function onTrackChanged2(type2, settings) {
  109038. return function() {
  109039. var masterPlaylistLoader = settings.masterPlaylistLoader, _settings$segmentLoad2 = settings.segmentLoaders, segmentLoader = _settings$segmentLoad2[type2], mainSegmentLoader = _settings$segmentLoad2.main, mediaType = settings.mediaTypes[type2];
  109040. var activeTrack2 = mediaType.activeTrack();
  109041. var activeGroup3 = mediaType.getActiveGroup();
  109042. var previousActiveLoader = mediaType.activePlaylistLoader;
  109043. var lastTrack = mediaType.lastTrack_;
  109044. if (lastTrack && activeTrack2 && lastTrack.id === activeTrack2.id) {
  109045. return;
  109046. }
  109047. mediaType.lastGroup_ = activeGroup3;
  109048. mediaType.lastTrack_ = activeTrack2;
  109049. stopLoaders(segmentLoader, mediaType);
  109050. if (!activeGroup3) {
  109051. return;
  109052. }
  109053. if (activeGroup3.isMasterPlaylist) {
  109054. if (!activeTrack2 || !lastTrack || activeTrack2.id === lastTrack.id) {
  109055. return;
  109056. }
  109057. var mpc = settings.vhs.masterPlaylistController_;
  109058. var newPlaylist = mpc.selectPlaylist();
  109059. if (mpc.media() === newPlaylist) {
  109060. return;
  109061. }
  109062. mediaType.logger_("track change. Switching master audio from " + lastTrack.id + " to " + activeTrack2.id);
  109063. masterPlaylistLoader.pause();
  109064. mainSegmentLoader.resetEverything();
  109065. mpc.fastQualityChange_(newPlaylist);
  109066. return;
  109067. }
  109068. if (type2 === "AUDIO") {
  109069. if (!activeGroup3.playlistLoader) {
  109070. mainSegmentLoader.setAudio(true);
  109071. mainSegmentLoader.resetEverything();
  109072. return;
  109073. }
  109074. segmentLoader.setAudio(true);
  109075. mainSegmentLoader.setAudio(false);
  109076. }
  109077. if (previousActiveLoader === activeGroup3.playlistLoader) {
  109078. startLoaders(activeGroup3.playlistLoader, mediaType);
  109079. return;
  109080. }
  109081. if (segmentLoader.track) {
  109082. segmentLoader.track(activeTrack2);
  109083. }
  109084. segmentLoader.resetEverything();
  109085. startLoaders(activeGroup3.playlistLoader, mediaType);
  109086. };
  109087. };
  109088. var onError = {
  109089. AUDIO: function AUDIO(type2, settings) {
  109090. return function() {
  109091. var segmentLoader = settings.segmentLoaders[type2], mediaType = settings.mediaTypes[type2], blacklistCurrentPlaylist = settings.blacklistCurrentPlaylist;
  109092. stopLoaders(segmentLoader, mediaType);
  109093. var activeTrack2 = mediaType.activeTrack();
  109094. var activeGroup3 = mediaType.activeGroup();
  109095. var id = (activeGroup3.filter(function(group) {
  109096. return group["default"];
  109097. })[0] || activeGroup3[0]).id;
  109098. var defaultTrack = mediaType.tracks[id];
  109099. if (activeTrack2 === defaultTrack) {
  109100. blacklistCurrentPlaylist({
  109101. message: "Problem encountered loading the default audio track."
  109102. });
  109103. return;
  109104. }
  109105. videojs.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");
  109106. for (var trackId in mediaType.tracks) {
  109107. mediaType.tracks[trackId].enabled = mediaType.tracks[trackId] === defaultTrack;
  109108. }
  109109. mediaType.onTrackChanged();
  109110. };
  109111. },
  109112. SUBTITLES: function SUBTITLES(type2, settings) {
  109113. return function() {
  109114. var segmentLoader = settings.segmentLoaders[type2], mediaType = settings.mediaTypes[type2];
  109115. videojs.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");
  109116. stopLoaders(segmentLoader, mediaType);
  109117. var track = mediaType.activeTrack();
  109118. if (track) {
  109119. track.mode = "disabled";
  109120. }
  109121. mediaType.onTrackChanged();
  109122. };
  109123. }
  109124. };
  109125. var setupListeners = {
  109126. AUDIO: function AUDIO2(type2, playlistLoader, settings) {
  109127. if (!playlistLoader) {
  109128. return;
  109129. }
  109130. var tech = settings.tech, requestOptions = settings.requestOptions, segmentLoader = settings.segmentLoaders[type2];
  109131. playlistLoader.on("loadedmetadata", function() {
  109132. var media = playlistLoader.media();
  109133. segmentLoader.playlist(media, requestOptions);
  109134. if (!tech.paused() || media.endList && tech.preload() !== "none") {
  109135. segmentLoader.load();
  109136. }
  109137. });
  109138. playlistLoader.on("loadedplaylist", function() {
  109139. segmentLoader.playlist(playlistLoader.media(), requestOptions);
  109140. if (!tech.paused()) {
  109141. segmentLoader.load();
  109142. }
  109143. });
  109144. playlistLoader.on("error", onError[type2](type2, settings));
  109145. },
  109146. SUBTITLES: function SUBTITLES2(type2, playlistLoader, settings) {
  109147. var tech = settings.tech, requestOptions = settings.requestOptions, segmentLoader = settings.segmentLoaders[type2], mediaType = settings.mediaTypes[type2];
  109148. playlistLoader.on("loadedmetadata", function() {
  109149. var media = playlistLoader.media();
  109150. segmentLoader.playlist(media, requestOptions);
  109151. segmentLoader.track(mediaType.activeTrack());
  109152. if (!tech.paused() || media.endList && tech.preload() !== "none") {
  109153. segmentLoader.load();
  109154. }
  109155. });
  109156. playlistLoader.on("loadedplaylist", function() {
  109157. segmentLoader.playlist(playlistLoader.media(), requestOptions);
  109158. if (!tech.paused()) {
  109159. segmentLoader.load();
  109160. }
  109161. });
  109162. playlistLoader.on("error", onError[type2](type2, settings));
  109163. }
  109164. };
  109165. var initialize = {
  109166. "AUDIO": function AUDIO3(type2, settings) {
  109167. var vhs = settings.vhs, sourceType = settings.sourceType, segmentLoader = settings.segmentLoaders[type2], requestOptions = settings.requestOptions, mediaGroups = settings.master.mediaGroups, _settings$mediaTypes$ = settings.mediaTypes[type2], groups = _settings$mediaTypes$.groups, tracks = _settings$mediaTypes$.tracks, logger_ = _settings$mediaTypes$.logger_, masterPlaylistLoader = settings.masterPlaylistLoader;
  109168. var audioOnlyMaster = isAudioOnly(masterPlaylistLoader.master);
  109169. if (!mediaGroups[type2] || Object.keys(mediaGroups[type2]).length === 0) {
  109170. mediaGroups[type2] = {
  109171. main: {
  109172. "default": {
  109173. "default": true
  109174. }
  109175. }
  109176. };
  109177. if (audioOnlyMaster) {
  109178. mediaGroups[type2].main["default"].playlists = masterPlaylistLoader.master.playlists;
  109179. }
  109180. }
  109181. for (var groupId in mediaGroups[type2]) {
  109182. if (!groups[groupId]) {
  109183. groups[groupId] = [];
  109184. }
  109185. for (var variantLabel in mediaGroups[type2][groupId]) {
  109186. var properties = mediaGroups[type2][groupId][variantLabel];
  109187. var playlistLoader = void 0;
  109188. if (audioOnlyMaster) {
  109189. logger_("AUDIO group '" + groupId + "' label '" + variantLabel + "' is a master playlist");
  109190. properties.isMasterPlaylist = true;
  109191. playlistLoader = null;
  109192. } else if (sourceType === "vhs-json" && properties.playlists) {
  109193. playlistLoader = new PlaylistLoader(properties.playlists[0], vhs, requestOptions);
  109194. } else if (properties.resolvedUri) {
  109195. playlistLoader = new PlaylistLoader(properties.resolvedUri, vhs, requestOptions);
  109196. } else if (properties.playlists && sourceType === "dash") {
  109197. playlistLoader = new DashPlaylistLoader(properties.playlists[0], vhs, requestOptions, masterPlaylistLoader);
  109198. } else {
  109199. playlistLoader = null;
  109200. }
  109201. properties = videojs.mergeOptions({
  109202. id: variantLabel,
  109203. playlistLoader
  109204. }, properties);
  109205. setupListeners[type2](type2, properties.playlistLoader, settings);
  109206. groups[groupId].push(properties);
  109207. if (typeof tracks[variantLabel] === "undefined") {
  109208. var track = new videojs.AudioTrack({
  109209. id: variantLabel,
  109210. kind: audioTrackKind_(properties),
  109211. enabled: false,
  109212. language: properties.language,
  109213. "default": properties["default"],
  109214. label: variantLabel
  109215. });
  109216. tracks[variantLabel] = track;
  109217. }
  109218. }
  109219. }
  109220. segmentLoader.on("error", onError[type2](type2, settings));
  109221. },
  109222. "SUBTITLES": function SUBTITLES3(type2, settings) {
  109223. var tech = settings.tech, vhs = settings.vhs, sourceType = settings.sourceType, segmentLoader = settings.segmentLoaders[type2], requestOptions = settings.requestOptions, mediaGroups = settings.master.mediaGroups, _settings$mediaTypes$2 = settings.mediaTypes[type2], groups = _settings$mediaTypes$2.groups, tracks = _settings$mediaTypes$2.tracks, masterPlaylistLoader = settings.masterPlaylistLoader;
  109224. for (var groupId in mediaGroups[type2]) {
  109225. if (!groups[groupId]) {
  109226. groups[groupId] = [];
  109227. }
  109228. for (var variantLabel in mediaGroups[type2][groupId]) {
  109229. if (mediaGroups[type2][groupId][variantLabel].forced) {
  109230. continue;
  109231. }
  109232. var properties = mediaGroups[type2][groupId][variantLabel];
  109233. var playlistLoader = void 0;
  109234. if (sourceType === "hls") {
  109235. playlistLoader = new PlaylistLoader(properties.resolvedUri, vhs, requestOptions);
  109236. } else if (sourceType === "dash") {
  109237. var playlists = properties.playlists.filter(function(p) {
  109238. return p.excludeUntil !== Infinity;
  109239. });
  109240. if (!playlists.length) {
  109241. return;
  109242. }
  109243. playlistLoader = new DashPlaylistLoader(properties.playlists[0], vhs, requestOptions, masterPlaylistLoader);
  109244. } else if (sourceType === "vhs-json") {
  109245. playlistLoader = new PlaylistLoader(
  109246. properties.playlists ? properties.playlists[0] : properties.resolvedUri,
  109247. vhs,
  109248. requestOptions
  109249. );
  109250. }
  109251. properties = videojs.mergeOptions({
  109252. id: variantLabel,
  109253. playlistLoader
  109254. }, properties);
  109255. setupListeners[type2](type2, properties.playlistLoader, settings);
  109256. groups[groupId].push(properties);
  109257. if (typeof tracks[variantLabel] === "undefined") {
  109258. var track = tech.addRemoteTextTrack({
  109259. id: variantLabel,
  109260. kind: "subtitles",
  109261. "default": properties["default"] && properties.autoselect,
  109262. language: properties.language,
  109263. label: variantLabel
  109264. }, false).track;
  109265. tracks[variantLabel] = track;
  109266. }
  109267. }
  109268. }
  109269. segmentLoader.on("error", onError[type2](type2, settings));
  109270. },
  109271. "CLOSED-CAPTIONS": function CLOSEDCAPTIONS(type2, settings) {
  109272. var tech = settings.tech, mediaGroups = settings.master.mediaGroups, _settings$mediaTypes$3 = settings.mediaTypes[type2], groups = _settings$mediaTypes$3.groups, tracks = _settings$mediaTypes$3.tracks;
  109273. for (var groupId in mediaGroups[type2]) {
  109274. if (!groups[groupId]) {
  109275. groups[groupId] = [];
  109276. }
  109277. for (var variantLabel in mediaGroups[type2][groupId]) {
  109278. var properties = mediaGroups[type2][groupId][variantLabel];
  109279. if (!/^(?:CC|SERVICE)/.test(properties.instreamId)) {
  109280. continue;
  109281. }
  109282. var captionServices = tech.options_.vhs && tech.options_.vhs.captionServices || {};
  109283. var newProps = {
  109284. label: variantLabel,
  109285. language: properties.language,
  109286. instreamId: properties.instreamId,
  109287. "default": properties["default"] && properties.autoselect
  109288. };
  109289. if (captionServices[newProps.instreamId]) {
  109290. newProps = videojs.mergeOptions(newProps, captionServices[newProps.instreamId]);
  109291. }
  109292. if (newProps["default"] === void 0) {
  109293. delete newProps["default"];
  109294. }
  109295. groups[groupId].push(videojs.mergeOptions({
  109296. id: variantLabel
  109297. }, properties));
  109298. if (typeof tracks[variantLabel] === "undefined") {
  109299. var track = tech.addRemoteTextTrack({
  109300. id: newProps.instreamId,
  109301. kind: "captions",
  109302. "default": newProps["default"],
  109303. language: newProps.language,
  109304. label: newProps.label
  109305. }, false).track;
  109306. tracks[variantLabel] = track;
  109307. }
  109308. }
  109309. }
  109310. }
  109311. };
  109312. var groupMatch = function groupMatch2(list, media) {
  109313. for (var i2 = 0; i2 < list.length; i2++) {
  109314. if (playlistMatch(media, list[i2])) {
  109315. return true;
  109316. }
  109317. if (list[i2].playlists && groupMatch2(list[i2].playlists, media)) {
  109318. return true;
  109319. }
  109320. }
  109321. return false;
  109322. };
  109323. var activeGroup = function activeGroup2(type2, settings) {
  109324. return function(track) {
  109325. var masterPlaylistLoader = settings.masterPlaylistLoader, groups = settings.mediaTypes[type2].groups;
  109326. var media = masterPlaylistLoader.media();
  109327. if (!media) {
  109328. return null;
  109329. }
  109330. var variants = null;
  109331. if (media.attributes[type2]) {
  109332. variants = groups[media.attributes[type2]];
  109333. }
  109334. var groupKeys = Object.keys(groups);
  109335. if (!variants) {
  109336. if (type2 === "AUDIO" && groupKeys.length > 1 && isAudioOnly(settings.master)) {
  109337. for (var i2 = 0; i2 < groupKeys.length; i2++) {
  109338. var groupPropertyList = groups[groupKeys[i2]];
  109339. if (groupMatch(groupPropertyList, media)) {
  109340. variants = groupPropertyList;
  109341. break;
  109342. }
  109343. }
  109344. } else if (groups.main) {
  109345. variants = groups.main;
  109346. } else if (groupKeys.length === 1) {
  109347. variants = groups[groupKeys[0]];
  109348. }
  109349. }
  109350. if (typeof track === "undefined") {
  109351. return variants;
  109352. }
  109353. if (track === null || !variants) {
  109354. return null;
  109355. }
  109356. return variants.filter(function(props) {
  109357. return props.id === track.id;
  109358. })[0] || null;
  109359. };
  109360. };
  109361. var activeTrack = {
  109362. AUDIO: function AUDIO4(type2, settings) {
  109363. return function() {
  109364. var tracks = settings.mediaTypes[type2].tracks;
  109365. for (var id in tracks) {
  109366. if (tracks[id].enabled) {
  109367. return tracks[id];
  109368. }
  109369. }
  109370. return null;
  109371. };
  109372. },
  109373. SUBTITLES: function SUBTITLES4(type2, settings) {
  109374. return function() {
  109375. var tracks = settings.mediaTypes[type2].tracks;
  109376. for (var id in tracks) {
  109377. if (tracks[id].mode === "showing" || tracks[id].mode === "hidden") {
  109378. return tracks[id];
  109379. }
  109380. }
  109381. return null;
  109382. };
  109383. }
  109384. };
  109385. var getActiveGroup = function getActiveGroup2(type2, _ref) {
  109386. var mediaTypes2 = _ref.mediaTypes;
  109387. return function() {
  109388. var activeTrack_ = mediaTypes2[type2].activeTrack();
  109389. if (!activeTrack_) {
  109390. return null;
  109391. }
  109392. return mediaTypes2[type2].activeGroup(activeTrack_);
  109393. };
  109394. };
  109395. var setupMediaGroups = function setupMediaGroups2(settings) {
  109396. ["AUDIO", "SUBTITLES", "CLOSED-CAPTIONS"].forEach(function(type2) {
  109397. initialize[type2](type2, settings);
  109398. });
  109399. var mediaTypes2 = settings.mediaTypes, masterPlaylistLoader = settings.masterPlaylistLoader, tech = settings.tech, vhs = settings.vhs, _settings$segmentLoad3 = settings.segmentLoaders, audioSegmentLoader = _settings$segmentLoad3["AUDIO"], mainSegmentLoader = _settings$segmentLoad3.main;
  109400. ["AUDIO", "SUBTITLES"].forEach(function(type2) {
  109401. mediaTypes2[type2].activeGroup = activeGroup(type2, settings);
  109402. mediaTypes2[type2].activeTrack = activeTrack[type2](type2, settings);
  109403. mediaTypes2[type2].onGroupChanged = onGroupChanged(type2, settings);
  109404. mediaTypes2[type2].onGroupChanging = onGroupChanging(type2, settings);
  109405. mediaTypes2[type2].onTrackChanged = onTrackChanged(type2, settings);
  109406. mediaTypes2[type2].getActiveGroup = getActiveGroup(type2, settings);
  109407. });
  109408. var audioGroup = mediaTypes2.AUDIO.activeGroup();
  109409. if (audioGroup) {
  109410. var groupId = (audioGroup.filter(function(group) {
  109411. return group["default"];
  109412. })[0] || audioGroup[0]).id;
  109413. mediaTypes2.AUDIO.tracks[groupId].enabled = true;
  109414. mediaTypes2.AUDIO.onGroupChanged();
  109415. mediaTypes2.AUDIO.onTrackChanged();
  109416. var activeAudioGroup = mediaTypes2.AUDIO.getActiveGroup();
  109417. if (!activeAudioGroup.playlistLoader) {
  109418. mainSegmentLoader.setAudio(true);
  109419. } else {
  109420. mainSegmentLoader.setAudio(false);
  109421. audioSegmentLoader.setAudio(true);
  109422. }
  109423. }
  109424. masterPlaylistLoader.on("mediachange", function() {
  109425. ["AUDIO", "SUBTITLES"].forEach(function(type2) {
  109426. return mediaTypes2[type2].onGroupChanged();
  109427. });
  109428. });
  109429. masterPlaylistLoader.on("mediachanging", function() {
  109430. ["AUDIO", "SUBTITLES"].forEach(function(type2) {
  109431. return mediaTypes2[type2].onGroupChanging();
  109432. });
  109433. });
  109434. var onAudioTrackChanged = function onAudioTrackChanged2() {
  109435. mediaTypes2.AUDIO.onTrackChanged();
  109436. tech.trigger({
  109437. type: "usage",
  109438. name: "vhs-audio-change"
  109439. });
  109440. tech.trigger({
  109441. type: "usage",
  109442. name: "hls-audio-change"
  109443. });
  109444. };
  109445. tech.audioTracks().addEventListener("change", onAudioTrackChanged);
  109446. tech.remoteTextTracks().addEventListener("change", mediaTypes2.SUBTITLES.onTrackChanged);
  109447. vhs.on("dispose", function() {
  109448. tech.audioTracks().removeEventListener("change", onAudioTrackChanged);
  109449. tech.remoteTextTracks().removeEventListener("change", mediaTypes2.SUBTITLES.onTrackChanged);
  109450. });
  109451. tech.clearTracks("audio");
  109452. for (var id in mediaTypes2.AUDIO.tracks) {
  109453. tech.audioTracks().addTrack(mediaTypes2.AUDIO.tracks[id]);
  109454. }
  109455. };
  109456. var createMediaTypes = function createMediaTypes2() {
  109457. var mediaTypes2 = {};
  109458. ["AUDIO", "SUBTITLES", "CLOSED-CAPTIONS"].forEach(function(type2) {
  109459. mediaTypes2[type2] = {
  109460. groups: {},
  109461. tracks: {},
  109462. activePlaylistLoader: null,
  109463. activeGroup: noop,
  109464. activeTrack: noop,
  109465. getActiveGroup: noop,
  109466. onGroupChanged: noop,
  109467. onTrackChanged: noop,
  109468. lastTrack_: null,
  109469. logger_: logger("MediaGroups[" + type2 + "]")
  109470. };
  109471. });
  109472. return mediaTypes2;
  109473. };
  109474. var ABORT_EARLY_BLACKLIST_SECONDS = 60 * 2;
  109475. var Vhs$1;
  109476. var loaderStats = ["mediaRequests", "mediaRequestsAborted", "mediaRequestsTimedout", "mediaRequestsErrored", "mediaTransferDuration", "mediaBytesTransferred", "mediaAppends"];
  109477. var sumLoaderStat = function sumLoaderStat2(stat) {
  109478. return this.audioSegmentLoader_[stat] + this.mainSegmentLoader_[stat];
  109479. };
  109480. var shouldSwitchToMedia = function shouldSwitchToMedia2(_ref) {
  109481. var currentPlaylist = _ref.currentPlaylist, buffered = _ref.buffered, currentTime = _ref.currentTime, nextPlaylist = _ref.nextPlaylist, bufferLowWaterLine = _ref.bufferLowWaterLine, bufferHighWaterLine = _ref.bufferHighWaterLine, duration5 = _ref.duration, experimentalBufferBasedABR = _ref.experimentalBufferBasedABR, log2 = _ref.log;
  109482. if (!nextPlaylist) {
  109483. videojs.log.warn("We received no playlist to switch to. Please check your stream.");
  109484. return false;
  109485. }
  109486. var sharedLogLine = "allowing switch " + (currentPlaylist && currentPlaylist.id || "null") + " -> " + nextPlaylist.id;
  109487. if (!currentPlaylist) {
  109488. log2(sharedLogLine + " as current playlist is not set");
  109489. return true;
  109490. }
  109491. if (nextPlaylist.id === currentPlaylist.id) {
  109492. return false;
  109493. }
  109494. var isBuffered = Boolean(findRange(buffered, currentTime).length);
  109495. if (!currentPlaylist.endList) {
  109496. if (!isBuffered && typeof currentPlaylist.partTargetDuration === "number") {
  109497. log2("not " + sharedLogLine + " as current playlist is live llhls, but currentTime isn't in buffered.");
  109498. return false;
  109499. }
  109500. log2(sharedLogLine + " as current playlist is live");
  109501. return true;
  109502. }
  109503. var forwardBuffer = timeAheadOf(buffered, currentTime);
  109504. var maxBufferLowWaterLine = experimentalBufferBasedABR ? Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE : Config.MAX_BUFFER_LOW_WATER_LINE;
  109505. if (duration5 < maxBufferLowWaterLine) {
  109506. log2(sharedLogLine + " as duration < max low water line (" + duration5 + " < " + maxBufferLowWaterLine + ")");
  109507. return true;
  109508. }
  109509. var nextBandwidth = nextPlaylist.attributes.BANDWIDTH;
  109510. var currBandwidth = currentPlaylist.attributes.BANDWIDTH;
  109511. if (nextBandwidth < currBandwidth && (!experimentalBufferBasedABR || forwardBuffer < bufferHighWaterLine)) {
  109512. var logLine = sharedLogLine + " as next bandwidth < current bandwidth (" + nextBandwidth + " < " + currBandwidth + ")";
  109513. if (experimentalBufferBasedABR) {
  109514. logLine += " and forwardBuffer < bufferHighWaterLine (" + forwardBuffer + " < " + bufferHighWaterLine + ")";
  109515. }
  109516. log2(logLine);
  109517. return true;
  109518. }
  109519. if ((!experimentalBufferBasedABR || nextBandwidth > currBandwidth) && forwardBuffer >= bufferLowWaterLine) {
  109520. var _logLine = sharedLogLine + " as forwardBuffer >= bufferLowWaterLine (" + forwardBuffer + " >= " + bufferLowWaterLine + ")";
  109521. if (experimentalBufferBasedABR) {
  109522. _logLine += " and next bandwidth > current bandwidth (" + nextBandwidth + " > " + currBandwidth + ")";
  109523. }
  109524. log2(_logLine);
  109525. return true;
  109526. }
  109527. log2("not " + sharedLogLine + " as no switching criteria met");
  109528. return false;
  109529. };
  109530. var MasterPlaylistController = /* @__PURE__ */ function(_videojs$EventTarget) {
  109531. _inheritsLoose(MasterPlaylistController2, _videojs$EventTarget);
  109532. function MasterPlaylistController2(options2) {
  109533. var _this;
  109534. _this = _videojs$EventTarget.call(this) || this;
  109535. var src = options2.src, handleManifestRedirects = options2.handleManifestRedirects, withCredentials = options2.withCredentials, tech = options2.tech, bandwidth2 = options2.bandwidth, externVhs = options2.externVhs, useCueTags = options2.useCueTags, blacklistDuration = options2.blacklistDuration, enableLowInitialPlaylist = options2.enableLowInitialPlaylist, sourceType = options2.sourceType, cacheEncryptionKeys = options2.cacheEncryptionKeys, experimentalBufferBasedABR = options2.experimentalBufferBasedABR, experimentalLeastPixelDiffSelector = options2.experimentalLeastPixelDiffSelector, captionServices = options2.captionServices;
  109536. if (!src) {
  109537. throw new Error("A non-empty playlist URL or JSON manifest string is required");
  109538. }
  109539. var maxPlaylistRetries = options2.maxPlaylistRetries;
  109540. if (maxPlaylistRetries === null || typeof maxPlaylistRetries === "undefined") {
  109541. maxPlaylistRetries = Infinity;
  109542. }
  109543. Vhs$1 = externVhs;
  109544. _this.experimentalBufferBasedABR = Boolean(experimentalBufferBasedABR);
  109545. _this.experimentalLeastPixelDiffSelector = Boolean(experimentalLeastPixelDiffSelector);
  109546. _this.withCredentials = withCredentials;
  109547. _this.tech_ = tech;
  109548. _this.vhs_ = tech.vhs;
  109549. _this.sourceType_ = sourceType;
  109550. _this.useCueTags_ = useCueTags;
  109551. _this.blacklistDuration = blacklistDuration;
  109552. _this.maxPlaylistRetries = maxPlaylistRetries;
  109553. _this.enableLowInitialPlaylist = enableLowInitialPlaylist;
  109554. if (_this.useCueTags_) {
  109555. _this.cueTagsTrack_ = _this.tech_.addTextTrack("metadata", "ad-cues");
  109556. _this.cueTagsTrack_.inBandMetadataTrackDispatchType = "";
  109557. }
  109558. _this.requestOptions_ = {
  109559. withCredentials,
  109560. handleManifestRedirects,
  109561. maxPlaylistRetries,
  109562. timeout: null
  109563. };
  109564. _this.on("error", _this.pauseLoading);
  109565. _this.mediaTypes_ = createMediaTypes();
  109566. _this.mediaSource = new window_1.MediaSource();
  109567. _this.handleDurationChange_ = _this.handleDurationChange_.bind(_assertThisInitialized(_this));
  109568. _this.handleSourceOpen_ = _this.handleSourceOpen_.bind(_assertThisInitialized(_this));
  109569. _this.handleSourceEnded_ = _this.handleSourceEnded_.bind(_assertThisInitialized(_this));
  109570. _this.mediaSource.addEventListener("durationchange", _this.handleDurationChange_);
  109571. _this.mediaSource.addEventListener("sourceopen", _this.handleSourceOpen_);
  109572. _this.mediaSource.addEventListener("sourceended", _this.handleSourceEnded_);
  109573. _this.seekable_ = videojs.createTimeRanges();
  109574. _this.hasPlayed_ = false;
  109575. _this.syncController_ = new SyncController(options2);
  109576. _this.segmentMetadataTrack_ = tech.addRemoteTextTrack({
  109577. kind: "metadata",
  109578. label: "segment-metadata"
  109579. }, false).track;
  109580. _this.decrypter_ = new Decrypter();
  109581. _this.sourceUpdater_ = new SourceUpdater(_this.mediaSource);
  109582. _this.inbandTextTracks_ = {};
  109583. _this.timelineChangeController_ = new TimelineChangeController();
  109584. var segmentLoaderSettings = {
  109585. vhs: _this.vhs_,
  109586. parse708captions: options2.parse708captions,
  109587. useDtsForTimestampOffset: options2.useDtsForTimestampOffset,
  109588. captionServices,
  109589. mediaSource: _this.mediaSource,
  109590. currentTime: _this.tech_.currentTime.bind(_this.tech_),
  109591. seekable: function seekable3() {
  109592. return _this.seekable();
  109593. },
  109594. seeking: function seeking() {
  109595. return _this.tech_.seeking();
  109596. },
  109597. duration: function duration5() {
  109598. return _this.duration();
  109599. },
  109600. hasPlayed: function hasPlayed() {
  109601. return _this.hasPlayed_;
  109602. },
  109603. goalBufferLength: function goalBufferLength() {
  109604. return _this.goalBufferLength();
  109605. },
  109606. bandwidth: bandwidth2,
  109607. syncController: _this.syncController_,
  109608. decrypter: _this.decrypter_,
  109609. sourceType: _this.sourceType_,
  109610. inbandTextTracks: _this.inbandTextTracks_,
  109611. cacheEncryptionKeys,
  109612. sourceUpdater: _this.sourceUpdater_,
  109613. timelineChangeController: _this.timelineChangeController_,
  109614. experimentalExactManifestTimings: options2.experimentalExactManifestTimings
  109615. };
  109616. _this.masterPlaylistLoader_ = _this.sourceType_ === "dash" ? new DashPlaylistLoader(src, _this.vhs_, _this.requestOptions_) : new PlaylistLoader(src, _this.vhs_, _this.requestOptions_);
  109617. _this.setupMasterPlaylistLoaderListeners_();
  109618. _this.mainSegmentLoader_ = new SegmentLoader(videojs.mergeOptions(segmentLoaderSettings, {
  109619. segmentMetadataTrack: _this.segmentMetadataTrack_,
  109620. loaderType: "main"
  109621. }), options2);
  109622. _this.audioSegmentLoader_ = new SegmentLoader(videojs.mergeOptions(segmentLoaderSettings, {
  109623. loaderType: "audio"
  109624. }), options2);
  109625. _this.subtitleSegmentLoader_ = new VTTSegmentLoader(videojs.mergeOptions(segmentLoaderSettings, {
  109626. loaderType: "vtt",
  109627. featuresNativeTextTracks: _this.tech_.featuresNativeTextTracks,
  109628. loadVttJs: function loadVttJs() {
  109629. return new Promise(function(resolve2, reject2) {
  109630. function onLoad() {
  109631. tech.off("vttjserror", onError2);
  109632. resolve2();
  109633. }
  109634. function onError2() {
  109635. tech.off("vttjsloaded", onLoad);
  109636. reject2();
  109637. }
  109638. tech.one("vttjsloaded", onLoad);
  109639. tech.one("vttjserror", onError2);
  109640. tech.addWebVttScript_();
  109641. });
  109642. }
  109643. }), options2);
  109644. _this.setupSegmentLoaderListeners_();
  109645. if (_this.experimentalBufferBasedABR) {
  109646. _this.masterPlaylistLoader_.one("loadedplaylist", function() {
  109647. return _this.startABRTimer_();
  109648. });
  109649. _this.tech_.on("pause", function() {
  109650. return _this.stopABRTimer_();
  109651. });
  109652. _this.tech_.on("play", function() {
  109653. return _this.startABRTimer_();
  109654. });
  109655. }
  109656. loaderStats.forEach(function(stat) {
  109657. _this[stat + "_"] = sumLoaderStat.bind(_assertThisInitialized(_this), stat);
  109658. });
  109659. _this.logger_ = logger("MPC");
  109660. _this.triggeredFmp4Usage = false;
  109661. if (_this.tech_.preload() === "none") {
  109662. _this.loadOnPlay_ = function() {
  109663. _this.loadOnPlay_ = null;
  109664. _this.masterPlaylistLoader_.load();
  109665. };
  109666. _this.tech_.one("play", _this.loadOnPlay_);
  109667. } else {
  109668. _this.masterPlaylistLoader_.load();
  109669. }
  109670. _this.timeToLoadedData__ = -1;
  109671. _this.mainAppendsToLoadedData__ = -1;
  109672. _this.audioAppendsToLoadedData__ = -1;
  109673. var event2 = _this.tech_.preload() === "none" ? "play" : "loadstart";
  109674. _this.tech_.one(event2, function() {
  109675. var timeToLoadedDataStart = Date.now();
  109676. _this.tech_.one("loadeddata", function() {
  109677. _this.timeToLoadedData__ = Date.now() - timeToLoadedDataStart;
  109678. _this.mainAppendsToLoadedData__ = _this.mainSegmentLoader_.mediaAppends;
  109679. _this.audioAppendsToLoadedData__ = _this.audioSegmentLoader_.mediaAppends;
  109680. });
  109681. });
  109682. return _this;
  109683. }
  109684. var _proto = MasterPlaylistController2.prototype;
  109685. _proto.mainAppendsToLoadedData_ = function mainAppendsToLoadedData_() {
  109686. return this.mainAppendsToLoadedData__;
  109687. };
  109688. _proto.audioAppendsToLoadedData_ = function audioAppendsToLoadedData_() {
  109689. return this.audioAppendsToLoadedData__;
  109690. };
  109691. _proto.appendsToLoadedData_ = function appendsToLoadedData_() {
  109692. var main = this.mainAppendsToLoadedData_();
  109693. var audio = this.audioAppendsToLoadedData_();
  109694. if (main === -1 || audio === -1) {
  109695. return -1;
  109696. }
  109697. return main + audio;
  109698. };
  109699. _proto.timeToLoadedData_ = function timeToLoadedData_() {
  109700. return this.timeToLoadedData__;
  109701. };
  109702. _proto.checkABR_ = function checkABR_(reason) {
  109703. if (reason === void 0) {
  109704. reason = "abr";
  109705. }
  109706. var nextPlaylist = this.selectPlaylist();
  109707. if (nextPlaylist && this.shouldSwitchToMedia_(nextPlaylist)) {
  109708. this.switchMedia_(nextPlaylist, reason);
  109709. }
  109710. };
  109711. _proto.switchMedia_ = function switchMedia_(playlist, cause, delay) {
  109712. var oldMedia = this.media();
  109713. var oldId = oldMedia && (oldMedia.id || oldMedia.uri);
  109714. var newId = playlist.id || playlist.uri;
  109715. if (oldId && oldId !== newId) {
  109716. this.logger_("switch media " + oldId + " -> " + newId + " from " + cause);
  109717. this.tech_.trigger({
  109718. type: "usage",
  109719. name: "vhs-rendition-change-" + cause
  109720. });
  109721. }
  109722. this.masterPlaylistLoader_.media(playlist, delay);
  109723. };
  109724. _proto.startABRTimer_ = function startABRTimer_() {
  109725. var _this2 = this;
  109726. this.stopABRTimer_();
  109727. this.abrTimer_ = window_1.setInterval(function() {
  109728. return _this2.checkABR_();
  109729. }, 250);
  109730. };
  109731. _proto.stopABRTimer_ = function stopABRTimer_() {
  109732. if (this.tech_.scrubbing && this.tech_.scrubbing()) {
  109733. return;
  109734. }
  109735. window_1.clearInterval(this.abrTimer_);
  109736. this.abrTimer_ = null;
  109737. };
  109738. _proto.getAudioTrackPlaylists_ = function getAudioTrackPlaylists_() {
  109739. var master = this.master();
  109740. var defaultPlaylists = master && master.playlists || [];
  109741. if (!master || !master.mediaGroups || !master.mediaGroups.AUDIO) {
  109742. return defaultPlaylists;
  109743. }
  109744. var AUDIO5 = master.mediaGroups.AUDIO;
  109745. var groupKeys = Object.keys(AUDIO5);
  109746. var track;
  109747. if (Object.keys(this.mediaTypes_.AUDIO.groups).length) {
  109748. track = this.mediaTypes_.AUDIO.activeTrack();
  109749. } else {
  109750. var defaultGroup = AUDIO5.main || groupKeys.length && AUDIO5[groupKeys[0]];
  109751. for (var label in defaultGroup) {
  109752. if (defaultGroup[label]["default"]) {
  109753. track = {
  109754. label
  109755. };
  109756. break;
  109757. }
  109758. }
  109759. }
  109760. if (!track) {
  109761. return defaultPlaylists;
  109762. }
  109763. var playlists = [];
  109764. for (var group in AUDIO5) {
  109765. if (AUDIO5[group][track.label]) {
  109766. var properties = AUDIO5[group][track.label];
  109767. if (properties.playlists && properties.playlists.length) {
  109768. playlists.push.apply(playlists, properties.playlists);
  109769. } else if (properties.uri) {
  109770. playlists.push(properties);
  109771. } else if (master.playlists.length) {
  109772. for (var i2 = 0; i2 < master.playlists.length; i2++) {
  109773. var playlist = master.playlists[i2];
  109774. if (playlist.attributes && playlist.attributes.AUDIO && playlist.attributes.AUDIO === group) {
  109775. playlists.push(playlist);
  109776. }
  109777. }
  109778. }
  109779. }
  109780. }
  109781. if (!playlists.length) {
  109782. return defaultPlaylists;
  109783. }
  109784. return playlists;
  109785. };
  109786. _proto.setupMasterPlaylistLoaderListeners_ = function setupMasterPlaylistLoaderListeners_() {
  109787. var _this3 = this;
  109788. this.masterPlaylistLoader_.on("loadedmetadata", function() {
  109789. var media = _this3.masterPlaylistLoader_.media();
  109790. var requestTimeout = media.targetDuration * 1.5 * 1e3;
  109791. if (isLowestEnabledRendition(_this3.masterPlaylistLoader_.master, _this3.masterPlaylistLoader_.media())) {
  109792. _this3.requestOptions_.timeout = 0;
  109793. } else {
  109794. _this3.requestOptions_.timeout = requestTimeout;
  109795. }
  109796. if (media.endList && _this3.tech_.preload() !== "none") {
  109797. _this3.mainSegmentLoader_.playlist(media, _this3.requestOptions_);
  109798. _this3.mainSegmentLoader_.load();
  109799. }
  109800. setupMediaGroups({
  109801. sourceType: _this3.sourceType_,
  109802. segmentLoaders: {
  109803. AUDIO: _this3.audioSegmentLoader_,
  109804. SUBTITLES: _this3.subtitleSegmentLoader_,
  109805. main: _this3.mainSegmentLoader_
  109806. },
  109807. tech: _this3.tech_,
  109808. requestOptions: _this3.requestOptions_,
  109809. masterPlaylistLoader: _this3.masterPlaylistLoader_,
  109810. vhs: _this3.vhs_,
  109811. master: _this3.master(),
  109812. mediaTypes: _this3.mediaTypes_,
  109813. blacklistCurrentPlaylist: _this3.blacklistCurrentPlaylist.bind(_this3)
  109814. });
  109815. _this3.triggerPresenceUsage_(_this3.master(), media);
  109816. _this3.setupFirstPlay();
  109817. if (!_this3.mediaTypes_.AUDIO.activePlaylistLoader || _this3.mediaTypes_.AUDIO.activePlaylistLoader.media()) {
  109818. _this3.trigger("selectedinitialmedia");
  109819. } else {
  109820. _this3.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata", function() {
  109821. _this3.trigger("selectedinitialmedia");
  109822. });
  109823. }
  109824. });
  109825. this.masterPlaylistLoader_.on("loadedplaylist", function() {
  109826. if (_this3.loadOnPlay_) {
  109827. _this3.tech_.off("play", _this3.loadOnPlay_);
  109828. }
  109829. var updatedPlaylist = _this3.masterPlaylistLoader_.media();
  109830. if (!updatedPlaylist) {
  109831. _this3.excludeUnsupportedVariants_();
  109832. var selectedMedia;
  109833. if (_this3.enableLowInitialPlaylist) {
  109834. selectedMedia = _this3.selectInitialPlaylist();
  109835. }
  109836. if (!selectedMedia) {
  109837. selectedMedia = _this3.selectPlaylist();
  109838. }
  109839. if (!selectedMedia || !_this3.shouldSwitchToMedia_(selectedMedia)) {
  109840. return;
  109841. }
  109842. _this3.initialMedia_ = selectedMedia;
  109843. _this3.switchMedia_(_this3.initialMedia_, "initial");
  109844. var haveJsonSource = _this3.sourceType_ === "vhs-json" && _this3.initialMedia_.segments;
  109845. if (!haveJsonSource) {
  109846. return;
  109847. }
  109848. updatedPlaylist = _this3.initialMedia_;
  109849. }
  109850. _this3.handleUpdatedMediaPlaylist(updatedPlaylist);
  109851. });
  109852. this.masterPlaylistLoader_.on("error", function() {
  109853. _this3.blacklistCurrentPlaylist(_this3.masterPlaylistLoader_.error);
  109854. });
  109855. this.masterPlaylistLoader_.on("mediachanging", function() {
  109856. _this3.mainSegmentLoader_.abort();
  109857. _this3.mainSegmentLoader_.pause();
  109858. });
  109859. this.masterPlaylistLoader_.on("mediachange", function() {
  109860. var media = _this3.masterPlaylistLoader_.media();
  109861. var requestTimeout = media.targetDuration * 1.5 * 1e3;
  109862. if (isLowestEnabledRendition(_this3.masterPlaylistLoader_.master, _this3.masterPlaylistLoader_.media())) {
  109863. _this3.requestOptions_.timeout = 0;
  109864. } else {
  109865. _this3.requestOptions_.timeout = requestTimeout;
  109866. }
  109867. _this3.masterPlaylistLoader_.load();
  109868. _this3.mainSegmentLoader_.playlist(media, _this3.requestOptions_);
  109869. _this3.mainSegmentLoader_.load();
  109870. _this3.tech_.trigger({
  109871. type: "mediachange",
  109872. bubbles: true
  109873. });
  109874. });
  109875. this.masterPlaylistLoader_.on("playlistunchanged", function() {
  109876. var updatedPlaylist = _this3.masterPlaylistLoader_.media();
  109877. if (updatedPlaylist.lastExcludeReason_ === "playlist-unchanged") {
  109878. return;
  109879. }
  109880. var playlistOutdated = _this3.stuckAtPlaylistEnd_(updatedPlaylist);
  109881. if (playlistOutdated) {
  109882. _this3.blacklistCurrentPlaylist({
  109883. message: "Playlist no longer updating.",
  109884. reason: "playlist-unchanged"
  109885. });
  109886. _this3.tech_.trigger("playliststuck");
  109887. }
  109888. });
  109889. this.masterPlaylistLoader_.on("renditiondisabled", function() {
  109890. _this3.tech_.trigger({
  109891. type: "usage",
  109892. name: "vhs-rendition-disabled"
  109893. });
  109894. _this3.tech_.trigger({
  109895. type: "usage",
  109896. name: "hls-rendition-disabled"
  109897. });
  109898. });
  109899. this.masterPlaylistLoader_.on("renditionenabled", function() {
  109900. _this3.tech_.trigger({
  109901. type: "usage",
  109902. name: "vhs-rendition-enabled"
  109903. });
  109904. _this3.tech_.trigger({
  109905. type: "usage",
  109906. name: "hls-rendition-enabled"
  109907. });
  109908. });
  109909. };
  109910. _proto.handleUpdatedMediaPlaylist = function handleUpdatedMediaPlaylist(updatedPlaylist) {
  109911. if (this.useCueTags_) {
  109912. this.updateAdCues_(updatedPlaylist);
  109913. }
  109914. this.mainSegmentLoader_.playlist(updatedPlaylist, this.requestOptions_);
  109915. this.updateDuration(!updatedPlaylist.endList);
  109916. if (!this.tech_.paused()) {
  109917. this.mainSegmentLoader_.load();
  109918. if (this.audioSegmentLoader_) {
  109919. this.audioSegmentLoader_.load();
  109920. }
  109921. }
  109922. };
  109923. _proto.triggerPresenceUsage_ = function triggerPresenceUsage_(master, media) {
  109924. var mediaGroups = master.mediaGroups || {};
  109925. var defaultDemuxed = true;
  109926. var audioGroupKeys = Object.keys(mediaGroups.AUDIO);
  109927. for (var mediaGroup in mediaGroups.AUDIO) {
  109928. for (var label in mediaGroups.AUDIO[mediaGroup]) {
  109929. var properties = mediaGroups.AUDIO[mediaGroup][label];
  109930. if (!properties.uri) {
  109931. defaultDemuxed = false;
  109932. }
  109933. }
  109934. }
  109935. if (defaultDemuxed) {
  109936. this.tech_.trigger({
  109937. type: "usage",
  109938. name: "vhs-demuxed"
  109939. });
  109940. this.tech_.trigger({
  109941. type: "usage",
  109942. name: "hls-demuxed"
  109943. });
  109944. }
  109945. if (Object.keys(mediaGroups.SUBTITLES).length) {
  109946. this.tech_.trigger({
  109947. type: "usage",
  109948. name: "vhs-webvtt"
  109949. });
  109950. this.tech_.trigger({
  109951. type: "usage",
  109952. name: "hls-webvtt"
  109953. });
  109954. }
  109955. if (Vhs$1.Playlist.isAes(media)) {
  109956. this.tech_.trigger({
  109957. type: "usage",
  109958. name: "vhs-aes"
  109959. });
  109960. this.tech_.trigger({
  109961. type: "usage",
  109962. name: "hls-aes"
  109963. });
  109964. }
  109965. if (audioGroupKeys.length && Object.keys(mediaGroups.AUDIO[audioGroupKeys[0]]).length > 1) {
  109966. this.tech_.trigger({
  109967. type: "usage",
  109968. name: "vhs-alternate-audio"
  109969. });
  109970. this.tech_.trigger({
  109971. type: "usage",
  109972. name: "hls-alternate-audio"
  109973. });
  109974. }
  109975. if (this.useCueTags_) {
  109976. this.tech_.trigger({
  109977. type: "usage",
  109978. name: "vhs-playlist-cue-tags"
  109979. });
  109980. this.tech_.trigger({
  109981. type: "usage",
  109982. name: "hls-playlist-cue-tags"
  109983. });
  109984. }
  109985. };
  109986. _proto.shouldSwitchToMedia_ = function shouldSwitchToMedia_(nextPlaylist) {
  109987. var currentPlaylist = this.masterPlaylistLoader_.media() || this.masterPlaylistLoader_.pendingMedia_;
  109988. var currentTime = this.tech_.currentTime();
  109989. var bufferLowWaterLine = this.bufferLowWaterLine();
  109990. var bufferHighWaterLine = this.bufferHighWaterLine();
  109991. var buffered = this.tech_.buffered();
  109992. return shouldSwitchToMedia({
  109993. buffered,
  109994. currentTime,
  109995. currentPlaylist,
  109996. nextPlaylist,
  109997. bufferLowWaterLine,
  109998. bufferHighWaterLine,
  109999. duration: this.duration(),
  110000. experimentalBufferBasedABR: this.experimentalBufferBasedABR,
  110001. log: this.logger_
  110002. });
  110003. };
  110004. _proto.setupSegmentLoaderListeners_ = function setupSegmentLoaderListeners_() {
  110005. var _this4 = this;
  110006. this.mainSegmentLoader_.on("bandwidthupdate", function() {
  110007. _this4.checkABR_("bandwidthupdate");
  110008. _this4.tech_.trigger("bandwidthupdate");
  110009. });
  110010. this.mainSegmentLoader_.on("timeout", function() {
  110011. if (_this4.experimentalBufferBasedABR) {
  110012. _this4.mainSegmentLoader_.load();
  110013. }
  110014. });
  110015. if (!this.experimentalBufferBasedABR) {
  110016. this.mainSegmentLoader_.on("progress", function() {
  110017. _this4.trigger("progress");
  110018. });
  110019. }
  110020. this.mainSegmentLoader_.on("error", function() {
  110021. _this4.blacklistCurrentPlaylist(_this4.mainSegmentLoader_.error());
  110022. });
  110023. this.mainSegmentLoader_.on("appenderror", function() {
  110024. _this4.error = _this4.mainSegmentLoader_.error_;
  110025. _this4.trigger("error");
  110026. });
  110027. this.mainSegmentLoader_.on("syncinfoupdate", function() {
  110028. _this4.onSyncInfoUpdate_();
  110029. });
  110030. this.mainSegmentLoader_.on("timestampoffset", function() {
  110031. _this4.tech_.trigger({
  110032. type: "usage",
  110033. name: "vhs-timestamp-offset"
  110034. });
  110035. _this4.tech_.trigger({
  110036. type: "usage",
  110037. name: "hls-timestamp-offset"
  110038. });
  110039. });
  110040. this.audioSegmentLoader_.on("syncinfoupdate", function() {
  110041. _this4.onSyncInfoUpdate_();
  110042. });
  110043. this.audioSegmentLoader_.on("appenderror", function() {
  110044. _this4.error = _this4.audioSegmentLoader_.error_;
  110045. _this4.trigger("error");
  110046. });
  110047. this.mainSegmentLoader_.on("ended", function() {
  110048. _this4.logger_("main segment loader ended");
  110049. _this4.onEndOfStream();
  110050. });
  110051. this.mainSegmentLoader_.on("earlyabort", function(event2) {
  110052. if (_this4.experimentalBufferBasedABR) {
  110053. return;
  110054. }
  110055. _this4.delegateLoaders_("all", ["abort"]);
  110056. _this4.blacklistCurrentPlaylist({
  110057. message: "Aborted early because there isn't enough bandwidth to complete the request without rebuffering."
  110058. }, ABORT_EARLY_BLACKLIST_SECONDS);
  110059. });
  110060. var updateCodecs = function updateCodecs2() {
  110061. if (!_this4.sourceUpdater_.hasCreatedSourceBuffers()) {
  110062. return _this4.tryToCreateSourceBuffers_();
  110063. }
  110064. var codecs = _this4.getCodecsOrExclude_();
  110065. if (!codecs) {
  110066. return;
  110067. }
  110068. _this4.sourceUpdater_.addOrChangeSourceBuffers(codecs);
  110069. };
  110070. this.mainSegmentLoader_.on("trackinfo", updateCodecs);
  110071. this.audioSegmentLoader_.on("trackinfo", updateCodecs);
  110072. this.mainSegmentLoader_.on("fmp4", function() {
  110073. if (!_this4.triggeredFmp4Usage) {
  110074. _this4.tech_.trigger({
  110075. type: "usage",
  110076. name: "vhs-fmp4"
  110077. });
  110078. _this4.tech_.trigger({
  110079. type: "usage",
  110080. name: "hls-fmp4"
  110081. });
  110082. _this4.triggeredFmp4Usage = true;
  110083. }
  110084. });
  110085. this.audioSegmentLoader_.on("fmp4", function() {
  110086. if (!_this4.triggeredFmp4Usage) {
  110087. _this4.tech_.trigger({
  110088. type: "usage",
  110089. name: "vhs-fmp4"
  110090. });
  110091. _this4.tech_.trigger({
  110092. type: "usage",
  110093. name: "hls-fmp4"
  110094. });
  110095. _this4.triggeredFmp4Usage = true;
  110096. }
  110097. });
  110098. this.audioSegmentLoader_.on("ended", function() {
  110099. _this4.logger_("audioSegmentLoader ended");
  110100. _this4.onEndOfStream();
  110101. });
  110102. };
  110103. _proto.mediaSecondsLoaded_ = function mediaSecondsLoaded_() {
  110104. return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded + this.mainSegmentLoader_.mediaSecondsLoaded);
  110105. };
  110106. _proto.load = function load() {
  110107. this.mainSegmentLoader_.load();
  110108. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  110109. this.audioSegmentLoader_.load();
  110110. }
  110111. if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {
  110112. this.subtitleSegmentLoader_.load();
  110113. }
  110114. };
  110115. _proto.smoothQualityChange_ = function smoothQualityChange_(media) {
  110116. if (media === void 0) {
  110117. media = this.selectPlaylist();
  110118. }
  110119. this.fastQualityChange_(media);
  110120. };
  110121. _proto.fastQualityChange_ = function fastQualityChange_(media) {
  110122. var _this5 = this;
  110123. if (media === void 0) {
  110124. media = this.selectPlaylist();
  110125. }
  110126. if (media === this.masterPlaylistLoader_.media()) {
  110127. this.logger_("skipping fastQualityChange because new media is same as old");
  110128. return;
  110129. }
  110130. this.switchMedia_(media, "fast-quality");
  110131. this.mainSegmentLoader_.resetEverything(function() {
  110132. if (videojs.browser.IE_VERSION || videojs.browser.IS_EDGE) {
  110133. _this5.tech_.setCurrentTime(_this5.tech_.currentTime() + 0.04);
  110134. } else {
  110135. _this5.tech_.setCurrentTime(_this5.tech_.currentTime());
  110136. }
  110137. });
  110138. };
  110139. _proto.play = function play() {
  110140. if (this.setupFirstPlay()) {
  110141. return;
  110142. }
  110143. if (this.tech_.ended()) {
  110144. this.tech_.setCurrentTime(0);
  110145. }
  110146. if (this.hasPlayed_) {
  110147. this.load();
  110148. }
  110149. var seekable3 = this.tech_.seekable();
  110150. if (this.tech_.duration() === Infinity) {
  110151. if (this.tech_.currentTime() < seekable3.start(0)) {
  110152. return this.tech_.setCurrentTime(seekable3.end(seekable3.length - 1));
  110153. }
  110154. }
  110155. };
  110156. _proto.setupFirstPlay = function setupFirstPlay() {
  110157. var _this6 = this;
  110158. var media = this.masterPlaylistLoader_.media();
  110159. if (!media || this.tech_.paused() || this.hasPlayed_) {
  110160. return false;
  110161. }
  110162. if (!media.endList) {
  110163. var seekable3 = this.seekable();
  110164. if (!seekable3.length) {
  110165. return false;
  110166. }
  110167. if (videojs.browser.IE_VERSION && this.tech_.readyState() === 0) {
  110168. this.tech_.one("loadedmetadata", function() {
  110169. _this6.trigger("firstplay");
  110170. _this6.tech_.setCurrentTime(seekable3.end(0));
  110171. _this6.hasPlayed_ = true;
  110172. });
  110173. return false;
  110174. }
  110175. this.trigger("firstplay");
  110176. this.tech_.setCurrentTime(seekable3.end(0));
  110177. }
  110178. this.hasPlayed_ = true;
  110179. this.load();
  110180. return true;
  110181. };
  110182. _proto.handleSourceOpen_ = function handleSourceOpen_() {
  110183. this.tryToCreateSourceBuffers_();
  110184. if (this.tech_.autoplay()) {
  110185. var playPromise = this.tech_.play();
  110186. if (typeof playPromise !== "undefined" && typeof playPromise.then === "function") {
  110187. playPromise.then(null, function(e) {
  110188. });
  110189. }
  110190. }
  110191. this.trigger("sourceopen");
  110192. };
  110193. _proto.handleSourceEnded_ = function handleSourceEnded_() {
  110194. if (!this.inbandTextTracks_.metadataTrack_) {
  110195. return;
  110196. }
  110197. var cues = this.inbandTextTracks_.metadataTrack_.cues;
  110198. if (!cues || !cues.length) {
  110199. return;
  110200. }
  110201. var duration5 = this.duration();
  110202. cues[cues.length - 1].endTime = isNaN(duration5) || Math.abs(duration5) === Infinity ? Number.MAX_VALUE : duration5;
  110203. };
  110204. _proto.handleDurationChange_ = function handleDurationChange_() {
  110205. this.tech_.trigger("durationchange");
  110206. };
  110207. _proto.onEndOfStream = function onEndOfStream() {
  110208. var isEndOfStream = this.mainSegmentLoader_.ended_;
  110209. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  110210. var mainMediaInfo = this.mainSegmentLoader_.getCurrentMediaInfo_();
  110211. if (!mainMediaInfo || mainMediaInfo.hasVideo) {
  110212. isEndOfStream = isEndOfStream && this.audioSegmentLoader_.ended_;
  110213. } else {
  110214. isEndOfStream = this.audioSegmentLoader_.ended_;
  110215. }
  110216. }
  110217. if (!isEndOfStream) {
  110218. return;
  110219. }
  110220. this.stopABRTimer_();
  110221. this.sourceUpdater_.endOfStream();
  110222. };
  110223. _proto.stuckAtPlaylistEnd_ = function stuckAtPlaylistEnd_(playlist) {
  110224. var seekable3 = this.seekable();
  110225. if (!seekable3.length) {
  110226. return false;
  110227. }
  110228. var expired = this.syncController_.getExpiredTime(playlist, this.duration());
  110229. if (expired === null) {
  110230. return false;
  110231. }
  110232. var absolutePlaylistEnd = Vhs$1.Playlist.playlistEnd(playlist, expired);
  110233. var currentTime = this.tech_.currentTime();
  110234. var buffered = this.tech_.buffered();
  110235. if (!buffered.length) {
  110236. return absolutePlaylistEnd - currentTime <= SAFE_TIME_DELTA;
  110237. }
  110238. var bufferedEnd = buffered.end(buffered.length - 1);
  110239. return bufferedEnd - currentTime <= SAFE_TIME_DELTA && absolutePlaylistEnd - bufferedEnd <= SAFE_TIME_DELTA;
  110240. };
  110241. _proto.blacklistCurrentPlaylist = function blacklistCurrentPlaylist(error, blacklistDuration) {
  110242. if (error === void 0) {
  110243. error = {};
  110244. }
  110245. var currentPlaylist = error.playlist || this.masterPlaylistLoader_.media();
  110246. blacklistDuration = blacklistDuration || error.blacklistDuration || this.blacklistDuration;
  110247. if (!currentPlaylist) {
  110248. this.error = error;
  110249. if (this.mediaSource.readyState !== "open") {
  110250. this.trigger("error");
  110251. } else {
  110252. this.sourceUpdater_.endOfStream("network");
  110253. }
  110254. return;
  110255. }
  110256. currentPlaylist.playlistErrors_++;
  110257. var playlists = this.masterPlaylistLoader_.master.playlists;
  110258. var enabledPlaylists = playlists.filter(isEnabled);
  110259. var isFinalRendition = enabledPlaylists.length === 1 && enabledPlaylists[0] === currentPlaylist;
  110260. if (playlists.length === 1 && blacklistDuration !== Infinity) {
  110261. videojs.log.warn("Problem encountered with playlist " + currentPlaylist.id + ". Trying again since it is the only playlist.");
  110262. this.tech_.trigger("retryplaylist");
  110263. return this.masterPlaylistLoader_.load(isFinalRendition);
  110264. }
  110265. if (isFinalRendition) {
  110266. var reincluded = false;
  110267. playlists.forEach(function(playlist) {
  110268. if (playlist === currentPlaylist) {
  110269. return;
  110270. }
  110271. var excludeUntil2 = playlist.excludeUntil;
  110272. if (typeof excludeUntil2 !== "undefined" && excludeUntil2 !== Infinity) {
  110273. reincluded = true;
  110274. delete playlist.excludeUntil;
  110275. }
  110276. });
  110277. if (reincluded) {
  110278. videojs.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded.");
  110279. this.tech_.trigger("retryplaylist");
  110280. }
  110281. }
  110282. var excludeUntil;
  110283. if (currentPlaylist.playlistErrors_ > this.maxPlaylistRetries) {
  110284. excludeUntil = Infinity;
  110285. } else {
  110286. excludeUntil = Date.now() + blacklistDuration * 1e3;
  110287. }
  110288. currentPlaylist.excludeUntil = excludeUntil;
  110289. if (error.reason) {
  110290. currentPlaylist.lastExcludeReason_ = error.reason;
  110291. }
  110292. this.tech_.trigger("blacklistplaylist");
  110293. this.tech_.trigger({
  110294. type: "usage",
  110295. name: "vhs-rendition-blacklisted"
  110296. });
  110297. this.tech_.trigger({
  110298. type: "usage",
  110299. name: "hls-rendition-blacklisted"
  110300. });
  110301. var nextPlaylist = this.selectPlaylist();
  110302. if (!nextPlaylist) {
  110303. this.error = "Playback cannot continue. No available working or supported playlists.";
  110304. this.trigger("error");
  110305. return;
  110306. }
  110307. var logFn2 = error.internal ? this.logger_ : videojs.log.warn;
  110308. var errorMessage = error.message ? " " + error.message : "";
  110309. logFn2((error.internal ? "Internal problem" : "Problem") + " encountered with playlist " + currentPlaylist.id + "." + (errorMessage + " Switching to playlist " + nextPlaylist.id + "."));
  110310. if (nextPlaylist.attributes.AUDIO !== currentPlaylist.attributes.AUDIO) {
  110311. this.delegateLoaders_("audio", ["abort", "pause"]);
  110312. }
  110313. if (nextPlaylist.attributes.SUBTITLES !== currentPlaylist.attributes.SUBTITLES) {
  110314. this.delegateLoaders_("subtitle", ["abort", "pause"]);
  110315. }
  110316. this.delegateLoaders_("main", ["abort", "pause"]);
  110317. var delayDuration = nextPlaylist.targetDuration / 2 * 1e3 || 5 * 1e3;
  110318. var shouldDelay = typeof nextPlaylist.lastRequest === "number" && Date.now() - nextPlaylist.lastRequest <= delayDuration;
  110319. return this.switchMedia_(nextPlaylist, "exclude", isFinalRendition || shouldDelay);
  110320. };
  110321. _proto.pauseLoading = function pauseLoading() {
  110322. this.delegateLoaders_("all", ["abort", "pause"]);
  110323. this.stopABRTimer_();
  110324. };
  110325. _proto.delegateLoaders_ = function delegateLoaders_(filter, fnNames) {
  110326. var _this7 = this;
  110327. var loaders = [];
  110328. var dontFilterPlaylist = filter === "all";
  110329. if (dontFilterPlaylist || filter === "main") {
  110330. loaders.push(this.masterPlaylistLoader_);
  110331. }
  110332. var mediaTypes2 = [];
  110333. if (dontFilterPlaylist || filter === "audio") {
  110334. mediaTypes2.push("AUDIO");
  110335. }
  110336. if (dontFilterPlaylist || filter === "subtitle") {
  110337. mediaTypes2.push("CLOSED-CAPTIONS");
  110338. mediaTypes2.push("SUBTITLES");
  110339. }
  110340. mediaTypes2.forEach(function(mediaType) {
  110341. var loader = _this7.mediaTypes_[mediaType] && _this7.mediaTypes_[mediaType].activePlaylistLoader;
  110342. if (loader) {
  110343. loaders.push(loader);
  110344. }
  110345. });
  110346. ["main", "audio", "subtitle"].forEach(function(name) {
  110347. var loader = _this7[name + "SegmentLoader_"];
  110348. if (loader && (filter === name || filter === "all")) {
  110349. loaders.push(loader);
  110350. }
  110351. });
  110352. loaders.forEach(function(loader) {
  110353. return fnNames.forEach(function(fnName) {
  110354. if (typeof loader[fnName] === "function") {
  110355. loader[fnName]();
  110356. }
  110357. });
  110358. });
  110359. };
  110360. _proto.setCurrentTime = function setCurrentTime(currentTime) {
  110361. var buffered = findRange(this.tech_.buffered(), currentTime);
  110362. if (!(this.masterPlaylistLoader_ && this.masterPlaylistLoader_.media())) {
  110363. return 0;
  110364. }
  110365. if (!this.masterPlaylistLoader_.media().segments) {
  110366. return 0;
  110367. }
  110368. if (buffered && buffered.length) {
  110369. return currentTime;
  110370. }
  110371. this.mainSegmentLoader_.resetEverything();
  110372. this.mainSegmentLoader_.abort();
  110373. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  110374. this.audioSegmentLoader_.resetEverything();
  110375. this.audioSegmentLoader_.abort();
  110376. }
  110377. if (this.mediaTypes_.SUBTITLES.activePlaylistLoader) {
  110378. this.subtitleSegmentLoader_.resetEverything();
  110379. this.subtitleSegmentLoader_.abort();
  110380. }
  110381. this.load();
  110382. };
  110383. _proto.duration = function duration5() {
  110384. if (!this.masterPlaylistLoader_) {
  110385. return 0;
  110386. }
  110387. var media = this.masterPlaylistLoader_.media();
  110388. if (!media) {
  110389. return 0;
  110390. }
  110391. if (!media.endList) {
  110392. return Infinity;
  110393. }
  110394. if (this.mediaSource) {
  110395. return this.mediaSource.duration;
  110396. }
  110397. return Vhs$1.Playlist.duration(media);
  110398. };
  110399. _proto.seekable = function seekable3() {
  110400. return this.seekable_;
  110401. };
  110402. _proto.onSyncInfoUpdate_ = function onSyncInfoUpdate_() {
  110403. var audioSeekable;
  110404. if (!this.masterPlaylistLoader_) {
  110405. return;
  110406. }
  110407. var media = this.masterPlaylistLoader_.media();
  110408. if (!media) {
  110409. return;
  110410. }
  110411. var expired = this.syncController_.getExpiredTime(media, this.duration());
  110412. if (expired === null) {
  110413. return;
  110414. }
  110415. var master = this.masterPlaylistLoader_.master;
  110416. var mainSeekable = Vhs$1.Playlist.seekable(media, expired, Vhs$1.Playlist.liveEdgeDelay(master, media));
  110417. if (mainSeekable.length === 0) {
  110418. return;
  110419. }
  110420. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  110421. media = this.mediaTypes_.AUDIO.activePlaylistLoader.media();
  110422. expired = this.syncController_.getExpiredTime(media, this.duration());
  110423. if (expired === null) {
  110424. return;
  110425. }
  110426. audioSeekable = Vhs$1.Playlist.seekable(media, expired, Vhs$1.Playlist.liveEdgeDelay(master, media));
  110427. if (audioSeekable.length === 0) {
  110428. return;
  110429. }
  110430. }
  110431. var oldEnd;
  110432. var oldStart;
  110433. if (this.seekable_ && this.seekable_.length) {
  110434. oldEnd = this.seekable_.end(0);
  110435. oldStart = this.seekable_.start(0);
  110436. }
  110437. if (!audioSeekable) {
  110438. this.seekable_ = mainSeekable;
  110439. } else if (audioSeekable.start(0) > mainSeekable.end(0) || mainSeekable.start(0) > audioSeekable.end(0)) {
  110440. this.seekable_ = mainSeekable;
  110441. } else {
  110442. this.seekable_ = videojs.createTimeRanges([[audioSeekable.start(0) > mainSeekable.start(0) ? audioSeekable.start(0) : mainSeekable.start(0), audioSeekable.end(0) < mainSeekable.end(0) ? audioSeekable.end(0) : mainSeekable.end(0)]]);
  110443. }
  110444. if (this.seekable_ && this.seekable_.length) {
  110445. if (this.seekable_.end(0) === oldEnd && this.seekable_.start(0) === oldStart) {
  110446. return;
  110447. }
  110448. }
  110449. this.logger_("seekable updated [" + printableRange(this.seekable_) + "]");
  110450. this.tech_.trigger("seekablechanged");
  110451. };
  110452. _proto.updateDuration = function updateDuration(isLive) {
  110453. if (this.updateDuration_) {
  110454. this.mediaSource.removeEventListener("sourceopen", this.updateDuration_);
  110455. this.updateDuration_ = null;
  110456. }
  110457. if (this.mediaSource.readyState !== "open") {
  110458. this.updateDuration_ = this.updateDuration.bind(this, isLive);
  110459. this.mediaSource.addEventListener("sourceopen", this.updateDuration_);
  110460. return;
  110461. }
  110462. if (isLive) {
  110463. var seekable3 = this.seekable();
  110464. if (!seekable3.length) {
  110465. return;
  110466. }
  110467. if (isNaN(this.mediaSource.duration) || this.mediaSource.duration < seekable3.end(seekable3.length - 1)) {
  110468. this.sourceUpdater_.setDuration(seekable3.end(seekable3.length - 1));
  110469. }
  110470. return;
  110471. }
  110472. var buffered = this.tech_.buffered();
  110473. var duration5 = Vhs$1.Playlist.duration(this.masterPlaylistLoader_.media());
  110474. if (buffered.length > 0) {
  110475. duration5 = Math.max(duration5, buffered.end(buffered.length - 1));
  110476. }
  110477. if (this.mediaSource.duration !== duration5) {
  110478. this.sourceUpdater_.setDuration(duration5);
  110479. }
  110480. };
  110481. _proto.dispose = function dispose() {
  110482. var _this8 = this;
  110483. this.trigger("dispose");
  110484. this.decrypter_.terminate();
  110485. this.masterPlaylistLoader_.dispose();
  110486. this.mainSegmentLoader_.dispose();
  110487. if (this.loadOnPlay_) {
  110488. this.tech_.off("play", this.loadOnPlay_);
  110489. }
  110490. ["AUDIO", "SUBTITLES"].forEach(function(type2) {
  110491. var groups = _this8.mediaTypes_[type2].groups;
  110492. for (var id in groups) {
  110493. groups[id].forEach(function(group) {
  110494. if (group.playlistLoader) {
  110495. group.playlistLoader.dispose();
  110496. }
  110497. });
  110498. }
  110499. });
  110500. this.audioSegmentLoader_.dispose();
  110501. this.subtitleSegmentLoader_.dispose();
  110502. this.sourceUpdater_.dispose();
  110503. this.timelineChangeController_.dispose();
  110504. this.stopABRTimer_();
  110505. if (this.updateDuration_) {
  110506. this.mediaSource.removeEventListener("sourceopen", this.updateDuration_);
  110507. }
  110508. this.mediaSource.removeEventListener("durationchange", this.handleDurationChange_);
  110509. this.mediaSource.removeEventListener("sourceopen", this.handleSourceOpen_);
  110510. this.mediaSource.removeEventListener("sourceended", this.handleSourceEnded_);
  110511. this.off();
  110512. };
  110513. _proto.master = function master() {
  110514. return this.masterPlaylistLoader_.master;
  110515. };
  110516. _proto.media = function media() {
  110517. return this.masterPlaylistLoader_.media() || this.initialMedia_;
  110518. };
  110519. _proto.areMediaTypesKnown_ = function areMediaTypesKnown_() {
  110520. var usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;
  110521. var hasMainMediaInfo = !!this.mainSegmentLoader_.getCurrentMediaInfo_();
  110522. var hasAudioMediaInfo = !usingAudioLoader ? true : !!this.audioSegmentLoader_.getCurrentMediaInfo_();
  110523. if (!hasMainMediaInfo || !hasAudioMediaInfo) {
  110524. return false;
  110525. }
  110526. return true;
  110527. };
  110528. _proto.getCodecsOrExclude_ = function getCodecsOrExclude_() {
  110529. var _this9 = this;
  110530. var media = {
  110531. main: this.mainSegmentLoader_.getCurrentMediaInfo_() || {},
  110532. audio: this.audioSegmentLoader_.getCurrentMediaInfo_() || {}
  110533. };
  110534. var playlist = this.mainSegmentLoader_.getPendingSegmentPlaylist() || this.media();
  110535. media.video = media.main;
  110536. var playlistCodecs = codecsForPlaylist(this.master(), playlist);
  110537. var codecs = {};
  110538. var usingAudioLoader = !!this.mediaTypes_.AUDIO.activePlaylistLoader;
  110539. if (media.main.hasVideo) {
  110540. codecs.video = playlistCodecs.video || media.main.videoCodec || DEFAULT_VIDEO_CODEC;
  110541. }
  110542. if (media.main.isMuxed) {
  110543. codecs.video += "," + (playlistCodecs.audio || media.main.audioCodec || DEFAULT_AUDIO_CODEC);
  110544. }
  110545. if (media.main.hasAudio && !media.main.isMuxed || media.audio.hasAudio || usingAudioLoader) {
  110546. codecs.audio = playlistCodecs.audio || media.main.audioCodec || media.audio.audioCodec || DEFAULT_AUDIO_CODEC;
  110547. media.audio.isFmp4 = media.main.hasAudio && !media.main.isMuxed ? media.main.isFmp4 : media.audio.isFmp4;
  110548. }
  110549. if (!codecs.audio && !codecs.video) {
  110550. this.blacklistCurrentPlaylist({
  110551. playlist,
  110552. message: "Could not determine codecs for playlist.",
  110553. blacklistDuration: Infinity
  110554. });
  110555. return;
  110556. }
  110557. var supportFunction = function supportFunction2(isFmp4, codec) {
  110558. return isFmp4 ? browserSupportsCodec2(codec) : muxerSupportsCodec2(codec);
  110559. };
  110560. var unsupportedCodecs = {};
  110561. var unsupportedAudio;
  110562. ["video", "audio"].forEach(function(type2) {
  110563. if (codecs.hasOwnProperty(type2) && !supportFunction(media[type2].isFmp4, codecs[type2])) {
  110564. var supporter = media[type2].isFmp4 ? "browser" : "muxer";
  110565. unsupportedCodecs[supporter] = unsupportedCodecs[supporter] || [];
  110566. unsupportedCodecs[supporter].push(codecs[type2]);
  110567. if (type2 === "audio") {
  110568. unsupportedAudio = supporter;
  110569. }
  110570. }
  110571. });
  110572. if (usingAudioLoader && unsupportedAudio && playlist.attributes.AUDIO) {
  110573. var audioGroup = playlist.attributes.AUDIO;
  110574. this.master().playlists.forEach(function(variant) {
  110575. var variantAudioGroup = variant.attributes && variant.attributes.AUDIO;
  110576. if (variantAudioGroup === audioGroup && variant !== playlist) {
  110577. variant.excludeUntil = Infinity;
  110578. }
  110579. });
  110580. this.logger_("excluding audio group " + audioGroup + " as " + unsupportedAudio + ' does not support codec(s): "' + codecs.audio + '"');
  110581. }
  110582. if (Object.keys(unsupportedCodecs).length) {
  110583. var message = Object.keys(unsupportedCodecs).reduce(function(acc, supporter) {
  110584. if (acc) {
  110585. acc += ", ";
  110586. }
  110587. acc += supporter + ' does not support codec(s): "' + unsupportedCodecs[supporter].join(",") + '"';
  110588. return acc;
  110589. }, "") + ".";
  110590. this.blacklistCurrentPlaylist({
  110591. playlist,
  110592. internal: true,
  110593. message,
  110594. blacklistDuration: Infinity
  110595. });
  110596. return;
  110597. }
  110598. if (this.sourceUpdater_.hasCreatedSourceBuffers() && !this.sourceUpdater_.canChangeType()) {
  110599. var switchMessages = [];
  110600. ["video", "audio"].forEach(function(type2) {
  110601. var newCodec = (parseCodecs2(_this9.sourceUpdater_.codecs[type2] || "")[0] || {}).type;
  110602. var oldCodec = (parseCodecs2(codecs[type2] || "")[0] || {}).type;
  110603. if (newCodec && oldCodec && newCodec.toLowerCase() !== oldCodec.toLowerCase()) {
  110604. switchMessages.push('"' + _this9.sourceUpdater_.codecs[type2] + '" -> "' + codecs[type2] + '"');
  110605. }
  110606. });
  110607. if (switchMessages.length) {
  110608. this.blacklistCurrentPlaylist({
  110609. playlist,
  110610. message: "Codec switching not supported: " + switchMessages.join(", ") + ".",
  110611. blacklistDuration: Infinity,
  110612. internal: true
  110613. });
  110614. return;
  110615. }
  110616. }
  110617. return codecs;
  110618. };
  110619. _proto.tryToCreateSourceBuffers_ = function tryToCreateSourceBuffers_() {
  110620. if (this.mediaSource.readyState !== "open" || this.sourceUpdater_.hasCreatedSourceBuffers()) {
  110621. return;
  110622. }
  110623. if (!this.areMediaTypesKnown_()) {
  110624. return;
  110625. }
  110626. var codecs = this.getCodecsOrExclude_();
  110627. if (!codecs) {
  110628. return;
  110629. }
  110630. this.sourceUpdater_.createSourceBuffers(codecs);
  110631. var codecString = [codecs.video, codecs.audio].filter(Boolean).join(",");
  110632. this.excludeIncompatibleVariants_(codecString);
  110633. };
  110634. _proto.excludeUnsupportedVariants_ = function excludeUnsupportedVariants_() {
  110635. var _this10 = this;
  110636. var playlists = this.master().playlists;
  110637. var ids = [];
  110638. Object.keys(playlists).forEach(function(key) {
  110639. var variant = playlists[key];
  110640. if (ids.indexOf(variant.id) !== -1) {
  110641. return;
  110642. }
  110643. ids.push(variant.id);
  110644. var codecs = codecsForPlaylist(_this10.master, variant);
  110645. var unsupported = [];
  110646. if (codecs.audio && !muxerSupportsCodec2(codecs.audio) && !browserSupportsCodec2(codecs.audio)) {
  110647. unsupported.push("audio codec " + codecs.audio);
  110648. }
  110649. if (codecs.video && !muxerSupportsCodec2(codecs.video) && !browserSupportsCodec2(codecs.video)) {
  110650. unsupported.push("video codec " + codecs.video);
  110651. }
  110652. if (codecs.text && codecs.text === "stpp.ttml.im1t") {
  110653. unsupported.push("text codec " + codecs.text);
  110654. }
  110655. if (unsupported.length) {
  110656. variant.excludeUntil = Infinity;
  110657. _this10.logger_("excluding " + variant.id + " for unsupported: " + unsupported.join(", "));
  110658. }
  110659. });
  110660. };
  110661. _proto.excludeIncompatibleVariants_ = function excludeIncompatibleVariants_(codecString) {
  110662. var _this11 = this;
  110663. var ids = [];
  110664. var playlists = this.master().playlists;
  110665. var codecs = unwrapCodecList(parseCodecs2(codecString));
  110666. var codecCount_ = codecCount(codecs);
  110667. var videoDetails = codecs.video && parseCodecs2(codecs.video)[0] || null;
  110668. var audioDetails = codecs.audio && parseCodecs2(codecs.audio)[0] || null;
  110669. Object.keys(playlists).forEach(function(key) {
  110670. var variant = playlists[key];
  110671. if (ids.indexOf(variant.id) !== -1 || variant.excludeUntil === Infinity) {
  110672. return;
  110673. }
  110674. ids.push(variant.id);
  110675. var blacklistReasons = [];
  110676. var variantCodecs = codecsForPlaylist(_this11.masterPlaylistLoader_.master, variant);
  110677. var variantCodecCount = codecCount(variantCodecs);
  110678. if (!variantCodecs.audio && !variantCodecs.video) {
  110679. return;
  110680. }
  110681. if (variantCodecCount !== codecCount_) {
  110682. blacklistReasons.push('codec count "' + variantCodecCount + '" !== "' + codecCount_ + '"');
  110683. }
  110684. if (!_this11.sourceUpdater_.canChangeType()) {
  110685. var variantVideoDetails = variantCodecs.video && parseCodecs2(variantCodecs.video)[0] || null;
  110686. var variantAudioDetails = variantCodecs.audio && parseCodecs2(variantCodecs.audio)[0] || null;
  110687. if (variantVideoDetails && videoDetails && variantVideoDetails.type.toLowerCase() !== videoDetails.type.toLowerCase()) {
  110688. blacklistReasons.push('video codec "' + variantVideoDetails.type + '" !== "' + videoDetails.type + '"');
  110689. }
  110690. if (variantAudioDetails && audioDetails && variantAudioDetails.type.toLowerCase() !== audioDetails.type.toLowerCase()) {
  110691. blacklistReasons.push('audio codec "' + variantAudioDetails.type + '" !== "' + audioDetails.type + '"');
  110692. }
  110693. }
  110694. if (blacklistReasons.length) {
  110695. variant.excludeUntil = Infinity;
  110696. _this11.logger_("blacklisting " + variant.id + ": " + blacklistReasons.join(" && "));
  110697. }
  110698. });
  110699. };
  110700. _proto.updateAdCues_ = function updateAdCues_(media) {
  110701. var offset = 0;
  110702. var seekable3 = this.seekable();
  110703. if (seekable3.length) {
  110704. offset = seekable3.start(0);
  110705. }
  110706. updateAdCues(media, this.cueTagsTrack_, offset);
  110707. };
  110708. _proto.goalBufferLength = function goalBufferLength() {
  110709. var currentTime = this.tech_.currentTime();
  110710. var initial = Config.GOAL_BUFFER_LENGTH;
  110711. var rate = Config.GOAL_BUFFER_LENGTH_RATE;
  110712. var max2 = Math.max(initial, Config.MAX_GOAL_BUFFER_LENGTH);
  110713. return Math.min(initial + currentTime * rate, max2);
  110714. };
  110715. _proto.bufferLowWaterLine = function bufferLowWaterLine() {
  110716. var currentTime = this.tech_.currentTime();
  110717. var initial = Config.BUFFER_LOW_WATER_LINE;
  110718. var rate = Config.BUFFER_LOW_WATER_LINE_RATE;
  110719. var max2 = Math.max(initial, Config.MAX_BUFFER_LOW_WATER_LINE);
  110720. var newMax = Math.max(initial, Config.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);
  110721. return Math.min(initial + currentTime * rate, this.experimentalBufferBasedABR ? newMax : max2);
  110722. };
  110723. _proto.bufferHighWaterLine = function bufferHighWaterLine() {
  110724. return Config.BUFFER_HIGH_WATER_LINE;
  110725. };
  110726. return MasterPlaylistController2;
  110727. }(videojs.EventTarget);
  110728. var enableFunction = function enableFunction2(loader, playlistID, changePlaylistFn) {
  110729. return function(enable) {
  110730. var playlist = loader.master.playlists[playlistID];
  110731. var incompatible = isIncompatible(playlist);
  110732. var currentlyEnabled = isEnabled(playlist);
  110733. if (typeof enable === "undefined") {
  110734. return currentlyEnabled;
  110735. }
  110736. if (enable) {
  110737. delete playlist.disabled;
  110738. } else {
  110739. playlist.disabled = true;
  110740. }
  110741. if (enable !== currentlyEnabled && !incompatible) {
  110742. changePlaylistFn();
  110743. if (enable) {
  110744. loader.trigger("renditionenabled");
  110745. } else {
  110746. loader.trigger("renditiondisabled");
  110747. }
  110748. }
  110749. return enable;
  110750. };
  110751. };
  110752. var Representation = function Representation2(vhsHandler, playlist, id) {
  110753. var mpc = vhsHandler.masterPlaylistController_, smoothQualityChange = vhsHandler.options_.smoothQualityChange;
  110754. var changeType2 = smoothQualityChange ? "smooth" : "fast";
  110755. var qualityChangeFunction = mpc[changeType2 + "QualityChange_"].bind(mpc);
  110756. if (playlist.attributes) {
  110757. var resolution = playlist.attributes.RESOLUTION;
  110758. this.width = resolution && resolution.width;
  110759. this.height = resolution && resolution.height;
  110760. this.bandwidth = playlist.attributes.BANDWIDTH;
  110761. this.frameRate = playlist.attributes["FRAME-RATE"];
  110762. }
  110763. this.codecs = codecsForPlaylist(mpc.master(), playlist);
  110764. this.playlist = playlist;
  110765. this.id = id;
  110766. this.enabled = enableFunction(vhsHandler.playlists, playlist.id, qualityChangeFunction);
  110767. };
  110768. var renditionSelectionMixin = function renditionSelectionMixin2(vhsHandler) {
  110769. vhsHandler.representations = function() {
  110770. var master = vhsHandler.masterPlaylistController_.master();
  110771. var playlists = isAudioOnly(master) ? vhsHandler.masterPlaylistController_.getAudioTrackPlaylists_() : master.playlists;
  110772. if (!playlists) {
  110773. return [];
  110774. }
  110775. return playlists.filter(function(media) {
  110776. return !isIncompatible(media);
  110777. }).map(function(e, i2) {
  110778. return new Representation(vhsHandler, e, e.id);
  110779. });
  110780. };
  110781. };
  110782. var timerCancelEvents = ["seeking", "seeked", "pause", "playing", "error"];
  110783. var PlaybackWatcher = /* @__PURE__ */ function() {
  110784. function PlaybackWatcher2(options2) {
  110785. var _this = this;
  110786. this.masterPlaylistController_ = options2.masterPlaylistController;
  110787. this.tech_ = options2.tech;
  110788. this.seekable = options2.seekable;
  110789. this.allowSeeksWithinUnsafeLiveWindow = options2.allowSeeksWithinUnsafeLiveWindow;
  110790. this.liveRangeSafeTimeDelta = options2.liveRangeSafeTimeDelta;
  110791. this.media = options2.media;
  110792. this.consecutiveUpdates = 0;
  110793. this.lastRecordedTime = null;
  110794. this.timer_ = null;
  110795. this.checkCurrentTimeTimeout_ = null;
  110796. this.logger_ = logger("PlaybackWatcher");
  110797. this.logger_("initialize");
  110798. var playHandler = function playHandler2() {
  110799. return _this.monitorCurrentTime_();
  110800. };
  110801. var canPlayHandler = function canPlayHandler2() {
  110802. return _this.monitorCurrentTime_();
  110803. };
  110804. var waitingHandler = function waitingHandler2() {
  110805. return _this.techWaiting_();
  110806. };
  110807. var cancelTimerHandler = function cancelTimerHandler2() {
  110808. return _this.cancelTimer_();
  110809. };
  110810. var mpc = this.masterPlaylistController_;
  110811. var loaderTypes = ["main", "subtitle", "audio"];
  110812. var loaderChecks = {};
  110813. loaderTypes.forEach(function(type2) {
  110814. loaderChecks[type2] = {
  110815. reset: function reset3() {
  110816. return _this.resetSegmentDownloads_(type2);
  110817. },
  110818. updateend: function updateend() {
  110819. return _this.checkSegmentDownloads_(type2);
  110820. }
  110821. };
  110822. mpc[type2 + "SegmentLoader_"].on("appendsdone", loaderChecks[type2].updateend);
  110823. mpc[type2 + "SegmentLoader_"].on("playlistupdate", loaderChecks[type2].reset);
  110824. _this.tech_.on(["seeked", "seeking"], loaderChecks[type2].reset);
  110825. });
  110826. var setSeekingHandlers = function setSeekingHandlers2(fn2) {
  110827. ["main", "audio"].forEach(function(type2) {
  110828. mpc[type2 + "SegmentLoader_"][fn2]("appended", _this.seekingAppendCheck_);
  110829. });
  110830. };
  110831. this.seekingAppendCheck_ = function() {
  110832. if (_this.fixesBadSeeks_()) {
  110833. _this.consecutiveUpdates = 0;
  110834. _this.lastRecordedTime = _this.tech_.currentTime();
  110835. setSeekingHandlers("off");
  110836. }
  110837. };
  110838. this.clearSeekingAppendCheck_ = function() {
  110839. return setSeekingHandlers("off");
  110840. };
  110841. this.watchForBadSeeking_ = function() {
  110842. _this.clearSeekingAppendCheck_();
  110843. setSeekingHandlers("on");
  110844. };
  110845. this.tech_.on("seeked", this.clearSeekingAppendCheck_);
  110846. this.tech_.on("seeking", this.watchForBadSeeking_);
  110847. this.tech_.on("waiting", waitingHandler);
  110848. this.tech_.on(timerCancelEvents, cancelTimerHandler);
  110849. this.tech_.on("canplay", canPlayHandler);
  110850. this.tech_.one("play", playHandler);
  110851. this.dispose = function() {
  110852. _this.clearSeekingAppendCheck_();
  110853. _this.logger_("dispose");
  110854. _this.tech_.off("waiting", waitingHandler);
  110855. _this.tech_.off(timerCancelEvents, cancelTimerHandler);
  110856. _this.tech_.off("canplay", canPlayHandler);
  110857. _this.tech_.off("play", playHandler);
  110858. _this.tech_.off("seeking", _this.watchForBadSeeking_);
  110859. _this.tech_.off("seeked", _this.clearSeekingAppendCheck_);
  110860. loaderTypes.forEach(function(type2) {
  110861. mpc[type2 + "SegmentLoader_"].off("appendsdone", loaderChecks[type2].updateend);
  110862. mpc[type2 + "SegmentLoader_"].off("playlistupdate", loaderChecks[type2].reset);
  110863. _this.tech_.off(["seeked", "seeking"], loaderChecks[type2].reset);
  110864. });
  110865. if (_this.checkCurrentTimeTimeout_) {
  110866. window_1.clearTimeout(_this.checkCurrentTimeTimeout_);
  110867. }
  110868. _this.cancelTimer_();
  110869. };
  110870. }
  110871. var _proto = PlaybackWatcher2.prototype;
  110872. _proto.monitorCurrentTime_ = function monitorCurrentTime_() {
  110873. this.checkCurrentTime_();
  110874. if (this.checkCurrentTimeTimeout_) {
  110875. window_1.clearTimeout(this.checkCurrentTimeTimeout_);
  110876. }
  110877. this.checkCurrentTimeTimeout_ = window_1.setTimeout(this.monitorCurrentTime_.bind(this), 250);
  110878. };
  110879. _proto.resetSegmentDownloads_ = function resetSegmentDownloads_(type2) {
  110880. var loader = this.masterPlaylistController_[type2 + "SegmentLoader_"];
  110881. if (this[type2 + "StalledDownloads_"] > 0) {
  110882. this.logger_("resetting possible stalled download count for " + type2 + " loader");
  110883. }
  110884. this[type2 + "StalledDownloads_"] = 0;
  110885. this[type2 + "Buffered_"] = loader.buffered_();
  110886. };
  110887. _proto.checkSegmentDownloads_ = function checkSegmentDownloads_(type2) {
  110888. var mpc = this.masterPlaylistController_;
  110889. var loader = mpc[type2 + "SegmentLoader_"];
  110890. var buffered = loader.buffered_();
  110891. var isBufferedDifferent = isRangeDifferent(this[type2 + "Buffered_"], buffered);
  110892. this[type2 + "Buffered_"] = buffered;
  110893. if (isBufferedDifferent) {
  110894. this.resetSegmentDownloads_(type2);
  110895. return;
  110896. }
  110897. this[type2 + "StalledDownloads_"]++;
  110898. this.logger_("found #" + this[type2 + "StalledDownloads_"] + " " + type2 + " appends that did not increase buffer (possible stalled download)", {
  110899. playlistId: loader.playlist_ && loader.playlist_.id,
  110900. buffered: timeRangesToArray(buffered)
  110901. });
  110902. if (this[type2 + "StalledDownloads_"] < 10) {
  110903. return;
  110904. }
  110905. this.logger_(type2 + " loader stalled download exclusion");
  110906. this.resetSegmentDownloads_(type2);
  110907. this.tech_.trigger({
  110908. type: "usage",
  110909. name: "vhs-" + type2 + "-download-exclusion"
  110910. });
  110911. if (type2 === "subtitle") {
  110912. return;
  110913. }
  110914. mpc.blacklistCurrentPlaylist({
  110915. message: "Excessive " + type2 + " segment downloading detected."
  110916. }, Infinity);
  110917. };
  110918. _proto.checkCurrentTime_ = function checkCurrentTime_() {
  110919. if (this.tech_.paused() || this.tech_.seeking()) {
  110920. return;
  110921. }
  110922. var currentTime = this.tech_.currentTime();
  110923. var buffered = this.tech_.buffered();
  110924. if (this.lastRecordedTime === currentTime && (!buffered.length || currentTime + SAFE_TIME_DELTA >= buffered.end(buffered.length - 1))) {
  110925. return this.techWaiting_();
  110926. }
  110927. if (this.consecutiveUpdates >= 5 && currentTime === this.lastRecordedTime) {
  110928. this.consecutiveUpdates++;
  110929. this.waiting_();
  110930. } else if (currentTime === this.lastRecordedTime) {
  110931. this.consecutiveUpdates++;
  110932. } else {
  110933. this.consecutiveUpdates = 0;
  110934. this.lastRecordedTime = currentTime;
  110935. }
  110936. };
  110937. _proto.cancelTimer_ = function cancelTimer_() {
  110938. this.consecutiveUpdates = 0;
  110939. if (this.timer_) {
  110940. this.logger_("cancelTimer_");
  110941. clearTimeout(this.timer_);
  110942. }
  110943. this.timer_ = null;
  110944. };
  110945. _proto.fixesBadSeeks_ = function fixesBadSeeks_() {
  110946. var seeking = this.tech_.seeking();
  110947. if (!seeking) {
  110948. return false;
  110949. }
  110950. var seekable3 = this.seekable();
  110951. var currentTime = this.tech_.currentTime();
  110952. var isAfterSeekableRange = this.afterSeekableWindow_(seekable3, currentTime, this.media(), this.allowSeeksWithinUnsafeLiveWindow);
  110953. var seekTo;
  110954. if (isAfterSeekableRange) {
  110955. var seekableEnd = seekable3.end(seekable3.length - 1);
  110956. seekTo = seekableEnd;
  110957. }
  110958. if (this.beforeSeekableWindow_(seekable3, currentTime)) {
  110959. var seekableStart = seekable3.start(0);
  110960. seekTo = seekableStart + (seekableStart === seekable3.end(0) ? 0 : SAFE_TIME_DELTA);
  110961. }
  110962. if (typeof seekTo !== "undefined") {
  110963. this.logger_("Trying to seek outside of seekable at time " + currentTime + " with " + ("seekable range " + printableRange(seekable3) + ". Seeking to ") + (seekTo + "."));
  110964. this.tech_.setCurrentTime(seekTo);
  110965. return true;
  110966. }
  110967. var sourceUpdater = this.masterPlaylistController_.sourceUpdater_;
  110968. var buffered = this.tech_.buffered();
  110969. var audioBuffered = sourceUpdater.audioBuffer ? sourceUpdater.audioBuffered() : null;
  110970. var videoBuffered = sourceUpdater.videoBuffer ? sourceUpdater.videoBuffered() : null;
  110971. var media = this.media();
  110972. var minAppendedDuration = media.partTargetDuration ? media.partTargetDuration : (media.targetDuration - TIME_FUDGE_FACTOR) * 2;
  110973. var bufferedToCheck = [audioBuffered, videoBuffered];
  110974. for (var i2 = 0; i2 < bufferedToCheck.length; i2++) {
  110975. if (!bufferedToCheck[i2]) {
  110976. continue;
  110977. }
  110978. var timeAhead = timeAheadOf(bufferedToCheck[i2], currentTime);
  110979. if (timeAhead < minAppendedDuration) {
  110980. return false;
  110981. }
  110982. }
  110983. var nextRange = findNextRange(buffered, currentTime);
  110984. if (nextRange.length === 0) {
  110985. return false;
  110986. }
  110987. seekTo = nextRange.start(0) + SAFE_TIME_DELTA;
  110988. this.logger_("Buffered region starts (" + nextRange.start(0) + ") " + (" just beyond seek point (" + currentTime + "). Seeking to " + seekTo + "."));
  110989. this.tech_.setCurrentTime(seekTo);
  110990. return true;
  110991. };
  110992. _proto.waiting_ = function waiting_() {
  110993. if (this.techWaiting_()) {
  110994. return;
  110995. }
  110996. var currentTime = this.tech_.currentTime();
  110997. var buffered = this.tech_.buffered();
  110998. var currentRange = findRange(buffered, currentTime);
  110999. if (currentRange.length && currentTime + 3 <= currentRange.end(0)) {
  111000. this.cancelTimer_();
  111001. this.tech_.setCurrentTime(currentTime);
  111002. this.logger_("Stopped at " + currentTime + " while inside a buffered region " + ("[" + currentRange.start(0) + " -> " + currentRange.end(0) + "]. Attempting to resume ") + "playback by seeking to the current time.");
  111003. this.tech_.trigger({
  111004. type: "usage",
  111005. name: "vhs-unknown-waiting"
  111006. });
  111007. this.tech_.trigger({
  111008. type: "usage",
  111009. name: "hls-unknown-waiting"
  111010. });
  111011. return;
  111012. }
  111013. };
  111014. _proto.techWaiting_ = function techWaiting_() {
  111015. var seekable3 = this.seekable();
  111016. var currentTime = this.tech_.currentTime();
  111017. if (this.tech_.seeking() || this.timer_ !== null) {
  111018. return true;
  111019. }
  111020. if (this.beforeSeekableWindow_(seekable3, currentTime)) {
  111021. var livePoint = seekable3.end(seekable3.length - 1);
  111022. this.logger_("Fell out of live window at time " + currentTime + ". Seeking to " + ("live point (seekable end) " + livePoint));
  111023. this.cancelTimer_();
  111024. this.tech_.setCurrentTime(livePoint);
  111025. this.tech_.trigger({
  111026. type: "usage",
  111027. name: "vhs-live-resync"
  111028. });
  111029. this.tech_.trigger({
  111030. type: "usage",
  111031. name: "hls-live-resync"
  111032. });
  111033. return true;
  111034. }
  111035. var sourceUpdater = this.tech_.vhs.masterPlaylistController_.sourceUpdater_;
  111036. var buffered = this.tech_.buffered();
  111037. var videoUnderflow = this.videoUnderflow_({
  111038. audioBuffered: sourceUpdater.audioBuffered(),
  111039. videoBuffered: sourceUpdater.videoBuffered(),
  111040. currentTime
  111041. });
  111042. if (videoUnderflow) {
  111043. this.cancelTimer_();
  111044. this.tech_.setCurrentTime(currentTime);
  111045. this.tech_.trigger({
  111046. type: "usage",
  111047. name: "vhs-video-underflow"
  111048. });
  111049. this.tech_.trigger({
  111050. type: "usage",
  111051. name: "hls-video-underflow"
  111052. });
  111053. return true;
  111054. }
  111055. var nextRange = findNextRange(buffered, currentTime);
  111056. if (nextRange.length > 0) {
  111057. var difference = nextRange.start(0) - currentTime;
  111058. this.logger_("Stopped at " + currentTime + ", setting timer for " + difference + ", seeking " + ("to " + nextRange.start(0)));
  111059. this.cancelTimer_();
  111060. this.timer_ = setTimeout(this.skipTheGap_.bind(this), difference * 1e3, currentTime);
  111061. return true;
  111062. }
  111063. return false;
  111064. };
  111065. _proto.afterSeekableWindow_ = function afterSeekableWindow_(seekable3, currentTime, playlist, allowSeeksWithinUnsafeLiveWindow) {
  111066. if (allowSeeksWithinUnsafeLiveWindow === void 0) {
  111067. allowSeeksWithinUnsafeLiveWindow = false;
  111068. }
  111069. if (!seekable3.length) {
  111070. return false;
  111071. }
  111072. var allowedEnd = seekable3.end(seekable3.length - 1) + SAFE_TIME_DELTA;
  111073. var isLive = !playlist.endList;
  111074. if (isLive && allowSeeksWithinUnsafeLiveWindow) {
  111075. allowedEnd = seekable3.end(seekable3.length - 1) + playlist.targetDuration * 3;
  111076. }
  111077. if (currentTime > allowedEnd) {
  111078. return true;
  111079. }
  111080. return false;
  111081. };
  111082. _proto.beforeSeekableWindow_ = function beforeSeekableWindow_(seekable3, currentTime) {
  111083. if (seekable3.length && seekable3.start(0) > 0 && currentTime < seekable3.start(0) - this.liveRangeSafeTimeDelta) {
  111084. return true;
  111085. }
  111086. return false;
  111087. };
  111088. _proto.videoUnderflow_ = function videoUnderflow_(_ref) {
  111089. var videoBuffered = _ref.videoBuffered, audioBuffered = _ref.audioBuffered, currentTime = _ref.currentTime;
  111090. if (!videoBuffered) {
  111091. return;
  111092. }
  111093. var gap;
  111094. if (videoBuffered.length && audioBuffered.length) {
  111095. var lastVideoRange = findRange(videoBuffered, currentTime - 3);
  111096. var videoRange = findRange(videoBuffered, currentTime);
  111097. var audioRange = findRange(audioBuffered, currentTime);
  111098. if (audioRange.length && !videoRange.length && lastVideoRange.length) {
  111099. gap = {
  111100. start: lastVideoRange.end(0),
  111101. end: audioRange.end(0)
  111102. };
  111103. }
  111104. } else {
  111105. var nextRange = findNextRange(videoBuffered, currentTime);
  111106. if (!nextRange.length) {
  111107. gap = this.gapFromVideoUnderflow_(videoBuffered, currentTime);
  111108. }
  111109. }
  111110. if (gap) {
  111111. this.logger_("Encountered a gap in video from " + gap.start + " to " + gap.end + ". " + ("Seeking to current time " + currentTime));
  111112. return true;
  111113. }
  111114. return false;
  111115. };
  111116. _proto.skipTheGap_ = function skipTheGap_(scheduledCurrentTime) {
  111117. var buffered = this.tech_.buffered();
  111118. var currentTime = this.tech_.currentTime();
  111119. var nextRange = findNextRange(buffered, currentTime);
  111120. this.cancelTimer_();
  111121. if (nextRange.length === 0 || currentTime !== scheduledCurrentTime) {
  111122. return;
  111123. }
  111124. this.logger_("skipTheGap_:", "currentTime:", currentTime, "scheduled currentTime:", scheduledCurrentTime, "nextRange start:", nextRange.start(0));
  111125. this.tech_.setCurrentTime(nextRange.start(0) + TIME_FUDGE_FACTOR);
  111126. this.tech_.trigger({
  111127. type: "usage",
  111128. name: "vhs-gap-skip"
  111129. });
  111130. this.tech_.trigger({
  111131. type: "usage",
  111132. name: "hls-gap-skip"
  111133. });
  111134. };
  111135. _proto.gapFromVideoUnderflow_ = function gapFromVideoUnderflow_(buffered, currentTime) {
  111136. var gaps = findGaps(buffered);
  111137. for (var i2 = 0; i2 < gaps.length; i2++) {
  111138. var start2 = gaps.start(i2);
  111139. var end = gaps.end(i2);
  111140. if (currentTime - start2 < 4 && currentTime - start2 > 2) {
  111141. return {
  111142. start: start2,
  111143. end
  111144. };
  111145. }
  111146. }
  111147. return null;
  111148. };
  111149. return PlaybackWatcher2;
  111150. }();
  111151. var defaultOptions = {
  111152. errorInterval: 30,
  111153. getSource: function getSource(next) {
  111154. var tech = this.tech({
  111155. IWillNotUseThisInPlugins: true
  111156. });
  111157. var sourceObj = tech.currentSource_ || this.currentSource();
  111158. return next(sourceObj);
  111159. }
  111160. };
  111161. var initPlugin = function initPlugin2(player, options2) {
  111162. var lastCalled = 0;
  111163. var seekTo = 0;
  111164. var localOptions = videojs.mergeOptions(defaultOptions, options2);
  111165. player.ready(function() {
  111166. player.trigger({
  111167. type: "usage",
  111168. name: "vhs-error-reload-initialized"
  111169. });
  111170. player.trigger({
  111171. type: "usage",
  111172. name: "hls-error-reload-initialized"
  111173. });
  111174. });
  111175. var loadedMetadataHandler = function loadedMetadataHandler2() {
  111176. if (seekTo) {
  111177. player.currentTime(seekTo);
  111178. }
  111179. };
  111180. var setSource2 = function setSource3(sourceObj) {
  111181. if (sourceObj === null || sourceObj === void 0) {
  111182. return;
  111183. }
  111184. seekTo = player.duration() !== Infinity && player.currentTime() || 0;
  111185. player.one("loadedmetadata", loadedMetadataHandler);
  111186. player.src(sourceObj);
  111187. player.trigger({
  111188. type: "usage",
  111189. name: "vhs-error-reload"
  111190. });
  111191. player.trigger({
  111192. type: "usage",
  111193. name: "hls-error-reload"
  111194. });
  111195. player.play();
  111196. };
  111197. var errorHandler = function errorHandler2() {
  111198. if (Date.now() - lastCalled < localOptions.errorInterval * 1e3) {
  111199. player.trigger({
  111200. type: "usage",
  111201. name: "vhs-error-reload-canceled"
  111202. });
  111203. player.trigger({
  111204. type: "usage",
  111205. name: "hls-error-reload-canceled"
  111206. });
  111207. return;
  111208. }
  111209. if (!localOptions.getSource || typeof localOptions.getSource !== "function") {
  111210. videojs.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");
  111211. return;
  111212. }
  111213. lastCalled = Date.now();
  111214. return localOptions.getSource.call(player, setSource2);
  111215. };
  111216. var cleanupEvents = function cleanupEvents2() {
  111217. player.off("loadedmetadata", loadedMetadataHandler);
  111218. player.off("error", errorHandler);
  111219. player.off("dispose", cleanupEvents2);
  111220. };
  111221. var reinitPlugin = function reinitPlugin2(newOptions) {
  111222. cleanupEvents();
  111223. initPlugin2(player, newOptions);
  111224. };
  111225. player.on("error", errorHandler);
  111226. player.on("dispose", cleanupEvents);
  111227. player.reloadSourceOnError = reinitPlugin;
  111228. };
  111229. var reloadSourceOnError = function reloadSourceOnError2(options2) {
  111230. initPlugin(this, options2);
  111231. };
  111232. var version$4 = "2.16.2";
  111233. var version$3 = "6.0.1";
  111234. var version$2 = "0.22.1";
  111235. var version$1$1 = "4.8.0";
  111236. var version$6 = "3.1.3";
  111237. var Vhs = {
  111238. PlaylistLoader,
  111239. Playlist,
  111240. utils,
  111241. STANDARD_PLAYLIST_SELECTOR: lastBandwidthSelector,
  111242. INITIAL_PLAYLIST_SELECTOR: lowestBitrateCompatibleVariantSelector,
  111243. lastBandwidthSelector,
  111244. movingAverageBandwidthSelector,
  111245. comparePlaylistBandwidth,
  111246. comparePlaylistResolution,
  111247. xhr: xhrFactory()
  111248. };
  111249. Object.keys(Config).forEach(function(prop) {
  111250. Object.defineProperty(Vhs, prop, {
  111251. get: function get7() {
  111252. videojs.log.warn("using Vhs." + prop + " is UNSAFE be sure you know what you are doing");
  111253. return Config[prop];
  111254. },
  111255. set: function set4(value) {
  111256. videojs.log.warn("using Vhs." + prop + " is UNSAFE be sure you know what you are doing");
  111257. if (typeof value !== "number" || value < 0) {
  111258. videojs.log.warn("value of Vhs." + prop + " must be greater than or equal to 0");
  111259. return;
  111260. }
  111261. Config[prop] = value;
  111262. }
  111263. });
  111264. });
  111265. var LOCAL_STORAGE_KEY = "videojs-vhs";
  111266. var handleVhsMediaChange = function handleVhsMediaChange2(qualityLevels2, playlistLoader) {
  111267. var newPlaylist = playlistLoader.media();
  111268. var selectedIndex = -1;
  111269. for (var i2 = 0; i2 < qualityLevels2.length; i2++) {
  111270. if (qualityLevels2[i2].id === newPlaylist.id) {
  111271. selectedIndex = i2;
  111272. break;
  111273. }
  111274. }
  111275. qualityLevels2.selectedIndex_ = selectedIndex;
  111276. qualityLevels2.trigger({
  111277. selectedIndex,
  111278. type: "change"
  111279. });
  111280. };
  111281. var handleVhsLoadedMetadata = function handleVhsLoadedMetadata2(qualityLevels2, vhs) {
  111282. vhs.representations().forEach(function(rep2) {
  111283. qualityLevels2.addQualityLevel(rep2);
  111284. });
  111285. handleVhsMediaChange(qualityLevels2, vhs.playlists);
  111286. };
  111287. Vhs.canPlaySource = function() {
  111288. return videojs.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.");
  111289. };
  111290. var emeKeySystems = function emeKeySystems2(keySystemOptions, mainPlaylist, audioPlaylist) {
  111291. if (!keySystemOptions) {
  111292. return keySystemOptions;
  111293. }
  111294. var codecs = {};
  111295. if (mainPlaylist && mainPlaylist.attributes && mainPlaylist.attributes.CODECS) {
  111296. codecs = unwrapCodecList(parseCodecs2(mainPlaylist.attributes.CODECS));
  111297. }
  111298. if (audioPlaylist && audioPlaylist.attributes && audioPlaylist.attributes.CODECS) {
  111299. codecs.audio = audioPlaylist.attributes.CODECS;
  111300. }
  111301. var videoContentType = getMimeForCodec2(codecs.video);
  111302. var audioContentType = getMimeForCodec2(codecs.audio);
  111303. var keySystemContentTypes = {};
  111304. for (var keySystem in keySystemOptions) {
  111305. keySystemContentTypes[keySystem] = {};
  111306. if (audioContentType) {
  111307. keySystemContentTypes[keySystem].audioContentType = audioContentType;
  111308. }
  111309. if (videoContentType) {
  111310. keySystemContentTypes[keySystem].videoContentType = videoContentType;
  111311. }
  111312. if (mainPlaylist.contentProtection && mainPlaylist.contentProtection[keySystem] && mainPlaylist.contentProtection[keySystem].pssh) {
  111313. keySystemContentTypes[keySystem].pssh = mainPlaylist.contentProtection[keySystem].pssh;
  111314. }
  111315. if (typeof keySystemOptions[keySystem] === "string") {
  111316. keySystemContentTypes[keySystem].url = keySystemOptions[keySystem];
  111317. }
  111318. }
  111319. return videojs.mergeOptions(keySystemOptions, keySystemContentTypes);
  111320. };
  111321. var getAllPsshKeySystemsOptions = function getAllPsshKeySystemsOptions2(playlists, keySystems) {
  111322. return playlists.reduce(function(keySystemsArr, playlist) {
  111323. if (!playlist.contentProtection) {
  111324. return keySystemsArr;
  111325. }
  111326. var keySystemsOptions = keySystems.reduce(function(keySystemsObj, keySystem) {
  111327. var keySystemOptions = playlist.contentProtection[keySystem];
  111328. if (keySystemOptions && keySystemOptions.pssh) {
  111329. keySystemsObj[keySystem] = {
  111330. pssh: keySystemOptions.pssh
  111331. };
  111332. }
  111333. return keySystemsObj;
  111334. }, {});
  111335. if (Object.keys(keySystemsOptions).length) {
  111336. keySystemsArr.push(keySystemsOptions);
  111337. }
  111338. return keySystemsArr;
  111339. }, []);
  111340. };
  111341. var waitForKeySessionCreation = function waitForKeySessionCreation2(_ref) {
  111342. var player = _ref.player, sourceKeySystems = _ref.sourceKeySystems, audioMedia = _ref.audioMedia, mainPlaylists = _ref.mainPlaylists;
  111343. if (!player.eme.initializeMediaKeys) {
  111344. return Promise.resolve();
  111345. }
  111346. var playlists = audioMedia ? mainPlaylists.concat([audioMedia]) : mainPlaylists;
  111347. var keySystemsOptionsArr = getAllPsshKeySystemsOptions(playlists, Object.keys(sourceKeySystems));
  111348. var initializationFinishedPromises = [];
  111349. var keySessionCreatedPromises = [];
  111350. keySystemsOptionsArr.forEach(function(keySystemsOptions) {
  111351. keySessionCreatedPromises.push(new Promise(function(resolve2, reject2) {
  111352. player.tech_.one("keysessioncreated", resolve2);
  111353. }));
  111354. initializationFinishedPromises.push(new Promise(function(resolve2, reject2) {
  111355. player.eme.initializeMediaKeys({
  111356. keySystems: keySystemsOptions
  111357. }, function(err) {
  111358. if (err) {
  111359. reject2(err);
  111360. return;
  111361. }
  111362. resolve2();
  111363. });
  111364. }));
  111365. });
  111366. return Promise.race([
  111367. Promise.all(initializationFinishedPromises),
  111368. Promise.race(keySessionCreatedPromises)
  111369. ]);
  111370. };
  111371. var setupEmeOptions = function setupEmeOptions2(_ref2) {
  111372. var player = _ref2.player, sourceKeySystems = _ref2.sourceKeySystems, media = _ref2.media, audioMedia = _ref2.audioMedia;
  111373. var sourceOptions = emeKeySystems(sourceKeySystems, media, audioMedia);
  111374. if (!sourceOptions) {
  111375. return false;
  111376. }
  111377. player.currentSource().keySystems = sourceOptions;
  111378. if (sourceOptions && !player.eme) {
  111379. videojs.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin");
  111380. return false;
  111381. }
  111382. return true;
  111383. };
  111384. var getVhsLocalStorage = function getVhsLocalStorage2() {
  111385. if (!window_1.localStorage) {
  111386. return null;
  111387. }
  111388. var storedObject = window_1.localStorage.getItem(LOCAL_STORAGE_KEY);
  111389. if (!storedObject) {
  111390. return null;
  111391. }
  111392. try {
  111393. return JSON.parse(storedObject);
  111394. } catch (e) {
  111395. return null;
  111396. }
  111397. };
  111398. var updateVhsLocalStorage = function updateVhsLocalStorage2(options2) {
  111399. if (!window_1.localStorage) {
  111400. return false;
  111401. }
  111402. var objectToStore = getVhsLocalStorage();
  111403. objectToStore = objectToStore ? videojs.mergeOptions(objectToStore, options2) : options2;
  111404. try {
  111405. window_1.localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(objectToStore));
  111406. } catch (e) {
  111407. return false;
  111408. }
  111409. return objectToStore;
  111410. };
  111411. var expandDataUri = function expandDataUri2(dataUri) {
  111412. if (dataUri.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,") === 0) {
  111413. return JSON.parse(dataUri.substring(dataUri.indexOf(",") + 1));
  111414. }
  111415. return dataUri;
  111416. };
  111417. Vhs.supportsNativeHls = function() {
  111418. if (!document_1 || !document_1.createElement) {
  111419. return false;
  111420. }
  111421. var video = document_1.createElement("video");
  111422. if (!videojs.getTech("Html5").isSupported()) {
  111423. return false;
  111424. }
  111425. var canPlay = [
  111426. "application/vnd.apple.mpegurl",
  111427. "audio/mpegurl",
  111428. "audio/x-mpegurl",
  111429. "application/x-mpegurl",
  111430. "video/x-mpegurl",
  111431. "video/mpegurl",
  111432. "application/mpegurl"
  111433. ];
  111434. return canPlay.some(function(canItPlay) {
  111435. return /maybe|probably/i.test(video.canPlayType(canItPlay));
  111436. });
  111437. }();
  111438. Vhs.supportsNativeDash = function() {
  111439. if (!document_1 || !document_1.createElement || !videojs.getTech("Html5").isSupported()) {
  111440. return false;
  111441. }
  111442. return /maybe|probably/i.test(document_1.createElement("video").canPlayType("application/dash+xml"));
  111443. }();
  111444. Vhs.supportsTypeNatively = function(type2) {
  111445. if (type2 === "hls") {
  111446. return Vhs.supportsNativeHls;
  111447. }
  111448. if (type2 === "dash") {
  111449. return Vhs.supportsNativeDash;
  111450. }
  111451. return false;
  111452. };
  111453. Vhs.isSupported = function() {
  111454. return videojs.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.");
  111455. };
  111456. var Component = videojs.getComponent("Component");
  111457. var VhsHandler = /* @__PURE__ */ function(_Component) {
  111458. _inheritsLoose(VhsHandler2, _Component);
  111459. function VhsHandler2(source, tech, options2) {
  111460. var _this;
  111461. _this = _Component.call(this, tech, videojs.mergeOptions(options2.hls, options2.vhs)) || this;
  111462. if (options2.hls && Object.keys(options2.hls).length) {
  111463. videojs.log.warn("Using hls options is deprecated. Please rename `hls` to `vhs` in your options object.");
  111464. }
  111465. if (typeof options2.initialBandwidth === "number") {
  111466. _this.options_.bandwidth = options2.initialBandwidth;
  111467. }
  111468. _this.logger_ = logger("VhsHandler");
  111469. if (tech.options_ && tech.options_.playerId) {
  111470. var _player = videojs(tech.options_.playerId);
  111471. if (!_player.hasOwnProperty("hls")) {
  111472. Object.defineProperty(_player, "hls", {
  111473. get: function get7() {
  111474. videojs.log.warn("player.hls is deprecated. Use player.tech().vhs instead.");
  111475. tech.trigger({
  111476. type: "usage",
  111477. name: "hls-player-access"
  111478. });
  111479. return _assertThisInitialized(_this);
  111480. },
  111481. configurable: true
  111482. });
  111483. }
  111484. if (!_player.hasOwnProperty("vhs")) {
  111485. Object.defineProperty(_player, "vhs", {
  111486. get: function get7() {
  111487. videojs.log.warn("player.vhs is deprecated. Use player.tech().vhs instead.");
  111488. tech.trigger({
  111489. type: "usage",
  111490. name: "vhs-player-access"
  111491. });
  111492. return _assertThisInitialized(_this);
  111493. },
  111494. configurable: true
  111495. });
  111496. }
  111497. if (!_player.hasOwnProperty("dash")) {
  111498. Object.defineProperty(_player, "dash", {
  111499. get: function get7() {
  111500. videojs.log.warn("player.dash is deprecated. Use player.tech().vhs instead.");
  111501. return _assertThisInitialized(_this);
  111502. },
  111503. configurable: true
  111504. });
  111505. }
  111506. _this.player_ = _player;
  111507. }
  111508. _this.tech_ = tech;
  111509. _this.source_ = source;
  111510. _this.stats = {};
  111511. _this.ignoreNextSeekingEvent_ = false;
  111512. _this.setOptions_();
  111513. if (_this.options_.overrideNative && tech.overrideNativeAudioTracks && tech.overrideNativeVideoTracks) {
  111514. tech.overrideNativeAudioTracks(true);
  111515. tech.overrideNativeVideoTracks(true);
  111516. } else if (_this.options_.overrideNative && (tech.featuresNativeVideoTracks || tech.featuresNativeAudioTracks)) {
  111517. throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");
  111518. }
  111519. _this.on(document_1, ["fullscreenchange", "webkitfullscreenchange", "mozfullscreenchange", "MSFullscreenChange"], function(event2) {
  111520. var fullscreenElement = document_1.fullscreenElement || document_1.webkitFullscreenElement || document_1.mozFullScreenElement || document_1.msFullscreenElement;
  111521. if (fullscreenElement && fullscreenElement.contains(_this.tech_.el())) {
  111522. _this.masterPlaylistController_.fastQualityChange_();
  111523. } else {
  111524. _this.masterPlaylistController_.checkABR_();
  111525. }
  111526. });
  111527. _this.on(_this.tech_, "seeking", function() {
  111528. if (this.ignoreNextSeekingEvent_) {
  111529. this.ignoreNextSeekingEvent_ = false;
  111530. return;
  111531. }
  111532. this.setCurrentTime(this.tech_.currentTime());
  111533. });
  111534. _this.on(_this.tech_, "error", function() {
  111535. if (this.tech_.error() && this.masterPlaylistController_) {
  111536. this.masterPlaylistController_.pauseLoading();
  111537. }
  111538. });
  111539. _this.on(_this.tech_, "play", _this.play);
  111540. return _this;
  111541. }
  111542. var _proto = VhsHandler2.prototype;
  111543. _proto.setOptions_ = function setOptions_() {
  111544. var _this2 = this;
  111545. this.options_.withCredentials = this.options_.withCredentials || false;
  111546. this.options_.handleManifestRedirects = this.options_.handleManifestRedirects === false ? false : true;
  111547. this.options_.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions === false ? false : true;
  111548. this.options_.useDevicePixelRatio = this.options_.useDevicePixelRatio || false;
  111549. this.options_.smoothQualityChange = this.options_.smoothQualityChange || false;
  111550. this.options_.useBandwidthFromLocalStorage = typeof this.source_.useBandwidthFromLocalStorage !== "undefined" ? this.source_.useBandwidthFromLocalStorage : this.options_.useBandwidthFromLocalStorage || false;
  111551. this.options_.useNetworkInformationApi = this.options_.useNetworkInformationApi || false;
  111552. this.options_.useDtsForTimestampOffset = this.options_.useDtsForTimestampOffset || false;
  111553. this.options_.customTagParsers = this.options_.customTagParsers || [];
  111554. this.options_.customTagMappers = this.options_.customTagMappers || [];
  111555. this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || false;
  111556. if (typeof this.options_.blacklistDuration !== "number") {
  111557. this.options_.blacklistDuration = 5 * 60;
  111558. }
  111559. if (typeof this.options_.bandwidth !== "number") {
  111560. if (this.options_.useBandwidthFromLocalStorage) {
  111561. var storedObject = getVhsLocalStorage();
  111562. if (storedObject && storedObject.bandwidth) {
  111563. this.options_.bandwidth = storedObject.bandwidth;
  111564. this.tech_.trigger({
  111565. type: "usage",
  111566. name: "vhs-bandwidth-from-local-storage"
  111567. });
  111568. this.tech_.trigger({
  111569. type: "usage",
  111570. name: "hls-bandwidth-from-local-storage"
  111571. });
  111572. }
  111573. if (storedObject && storedObject.throughput) {
  111574. this.options_.throughput = storedObject.throughput;
  111575. this.tech_.trigger({
  111576. type: "usage",
  111577. name: "vhs-throughput-from-local-storage"
  111578. });
  111579. this.tech_.trigger({
  111580. type: "usage",
  111581. name: "hls-throughput-from-local-storage"
  111582. });
  111583. }
  111584. }
  111585. }
  111586. if (typeof this.options_.bandwidth !== "number") {
  111587. this.options_.bandwidth = Config.INITIAL_BANDWIDTH;
  111588. }
  111589. this.options_.enableLowInitialPlaylist = this.options_.enableLowInitialPlaylist && this.options_.bandwidth === Config.INITIAL_BANDWIDTH;
  111590. ["withCredentials", "useDevicePixelRatio", "limitRenditionByPlayerDimensions", "bandwidth", "smoothQualityChange", "customTagParsers", "customTagMappers", "handleManifestRedirects", "cacheEncryptionKeys", "playlistSelector", "initialPlaylistSelector", "experimentalBufferBasedABR", "liveRangeSafeTimeDelta", "experimentalLLHLS", "useNetworkInformationApi", "useDtsForTimestampOffset", "experimentalExactManifestTimings", "experimentalLeastPixelDiffSelector"].forEach(function(option) {
  111591. if (typeof _this2.source_[option] !== "undefined") {
  111592. _this2.options_[option] = _this2.source_[option];
  111593. }
  111594. });
  111595. this.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions;
  111596. this.useDevicePixelRatio = this.options_.useDevicePixelRatio;
  111597. };
  111598. _proto.src = function src(_src, type2) {
  111599. var _this3 = this;
  111600. if (!_src) {
  111601. return;
  111602. }
  111603. this.setOptions_();
  111604. this.options_.src = expandDataUri(this.source_.src);
  111605. this.options_.tech = this.tech_;
  111606. this.options_.externVhs = Vhs;
  111607. this.options_.sourceType = simpleTypeFromSourceType2(type2);
  111608. this.options_.seekTo = function(time) {
  111609. _this3.tech_.setCurrentTime(time);
  111610. };
  111611. if (this.options_.smoothQualityChange) {
  111612. videojs.log.warn("smoothQualityChange is deprecated and will be removed in the next major version");
  111613. }
  111614. this.masterPlaylistController_ = new MasterPlaylistController(this.options_);
  111615. var playbackWatcherOptions = videojs.mergeOptions({
  111616. liveRangeSafeTimeDelta: SAFE_TIME_DELTA
  111617. }, this.options_, {
  111618. seekable: function seekable3() {
  111619. return _this3.seekable();
  111620. },
  111621. media: function media() {
  111622. return _this3.masterPlaylistController_.media();
  111623. },
  111624. masterPlaylistController: this.masterPlaylistController_
  111625. });
  111626. this.playbackWatcher_ = new PlaybackWatcher(playbackWatcherOptions);
  111627. this.masterPlaylistController_.on("error", function() {
  111628. var player = videojs.players[_this3.tech_.options_.playerId];
  111629. var error = _this3.masterPlaylistController_.error;
  111630. if (typeof error === "object" && !error.code) {
  111631. error.code = 3;
  111632. } else if (typeof error === "string") {
  111633. error = {
  111634. message: error,
  111635. code: 3
  111636. };
  111637. }
  111638. player.error(error);
  111639. });
  111640. var defaultSelector = this.options_.experimentalBufferBasedABR ? Vhs.movingAverageBandwidthSelector(0.55) : Vhs.STANDARD_PLAYLIST_SELECTOR;
  111641. this.masterPlaylistController_.selectPlaylist = this.selectPlaylist ? this.selectPlaylist.bind(this) : defaultSelector.bind(this);
  111642. this.masterPlaylistController_.selectInitialPlaylist = Vhs.INITIAL_PLAYLIST_SELECTOR.bind(this);
  111643. this.playlists = this.masterPlaylistController_.masterPlaylistLoader_;
  111644. this.mediaSource = this.masterPlaylistController_.mediaSource;
  111645. Object.defineProperties(this, {
  111646. selectPlaylist: {
  111647. get: function get7() {
  111648. return this.masterPlaylistController_.selectPlaylist;
  111649. },
  111650. set: function set4(selectPlaylist) {
  111651. this.masterPlaylistController_.selectPlaylist = selectPlaylist.bind(this);
  111652. }
  111653. },
  111654. throughput: {
  111655. get: function get7() {
  111656. return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate;
  111657. },
  111658. set: function set4(throughput) {
  111659. this.masterPlaylistController_.mainSegmentLoader_.throughput.rate = throughput;
  111660. this.masterPlaylistController_.mainSegmentLoader_.throughput.count = 1;
  111661. }
  111662. },
  111663. bandwidth: {
  111664. get: function get7() {
  111665. var playerBandwidthEst = this.masterPlaylistController_.mainSegmentLoader_.bandwidth;
  111666. var networkInformation = window_1.navigator.connection || window_1.navigator.mozConnection || window_1.navigator.webkitConnection;
  111667. var tenMbpsAsBitsPerSecond = 1e7;
  111668. if (this.options_.useNetworkInformationApi && networkInformation) {
  111669. var networkInfoBandwidthEstBitsPerSec = networkInformation.downlink * 1e3 * 1e3;
  111670. if (networkInfoBandwidthEstBitsPerSec >= tenMbpsAsBitsPerSecond && playerBandwidthEst >= tenMbpsAsBitsPerSecond) {
  111671. playerBandwidthEst = Math.max(playerBandwidthEst, networkInfoBandwidthEstBitsPerSec);
  111672. } else {
  111673. playerBandwidthEst = networkInfoBandwidthEstBitsPerSec;
  111674. }
  111675. }
  111676. return playerBandwidthEst;
  111677. },
  111678. set: function set4(bandwidth2) {
  111679. this.masterPlaylistController_.mainSegmentLoader_.bandwidth = bandwidth2;
  111680. this.masterPlaylistController_.mainSegmentLoader_.throughput = {
  111681. rate: 0,
  111682. count: 0
  111683. };
  111684. }
  111685. },
  111686. systemBandwidth: {
  111687. get: function get7() {
  111688. var invBandwidth = 1 / (this.bandwidth || 1);
  111689. var invThroughput;
  111690. if (this.throughput > 0) {
  111691. invThroughput = 1 / this.throughput;
  111692. } else {
  111693. invThroughput = 0;
  111694. }
  111695. var systemBitrate = Math.floor(1 / (invBandwidth + invThroughput));
  111696. return systemBitrate;
  111697. },
  111698. set: function set4() {
  111699. videojs.log.error('The "systemBandwidth" property is read-only');
  111700. }
  111701. }
  111702. });
  111703. if (this.options_.bandwidth) {
  111704. this.bandwidth = this.options_.bandwidth;
  111705. }
  111706. if (this.options_.throughput) {
  111707. this.throughput = this.options_.throughput;
  111708. }
  111709. Object.defineProperties(this.stats, {
  111710. bandwidth: {
  111711. get: function get7() {
  111712. return _this3.bandwidth || 0;
  111713. },
  111714. enumerable: true
  111715. },
  111716. mediaRequests: {
  111717. get: function get7() {
  111718. return _this3.masterPlaylistController_.mediaRequests_() || 0;
  111719. },
  111720. enumerable: true
  111721. },
  111722. mediaRequestsAborted: {
  111723. get: function get7() {
  111724. return _this3.masterPlaylistController_.mediaRequestsAborted_() || 0;
  111725. },
  111726. enumerable: true
  111727. },
  111728. mediaRequestsTimedout: {
  111729. get: function get7() {
  111730. return _this3.masterPlaylistController_.mediaRequestsTimedout_() || 0;
  111731. },
  111732. enumerable: true
  111733. },
  111734. mediaRequestsErrored: {
  111735. get: function get7() {
  111736. return _this3.masterPlaylistController_.mediaRequestsErrored_() || 0;
  111737. },
  111738. enumerable: true
  111739. },
  111740. mediaTransferDuration: {
  111741. get: function get7() {
  111742. return _this3.masterPlaylistController_.mediaTransferDuration_() || 0;
  111743. },
  111744. enumerable: true
  111745. },
  111746. mediaBytesTransferred: {
  111747. get: function get7() {
  111748. return _this3.masterPlaylistController_.mediaBytesTransferred_() || 0;
  111749. },
  111750. enumerable: true
  111751. },
  111752. mediaSecondsLoaded: {
  111753. get: function get7() {
  111754. return _this3.masterPlaylistController_.mediaSecondsLoaded_() || 0;
  111755. },
  111756. enumerable: true
  111757. },
  111758. mediaAppends: {
  111759. get: function get7() {
  111760. return _this3.masterPlaylistController_.mediaAppends_() || 0;
  111761. },
  111762. enumerable: true
  111763. },
  111764. mainAppendsToLoadedData: {
  111765. get: function get7() {
  111766. return _this3.masterPlaylistController_.mainAppendsToLoadedData_() || 0;
  111767. },
  111768. enumerable: true
  111769. },
  111770. audioAppendsToLoadedData: {
  111771. get: function get7() {
  111772. return _this3.masterPlaylistController_.audioAppendsToLoadedData_() || 0;
  111773. },
  111774. enumerable: true
  111775. },
  111776. appendsToLoadedData: {
  111777. get: function get7() {
  111778. return _this3.masterPlaylistController_.appendsToLoadedData_() || 0;
  111779. },
  111780. enumerable: true
  111781. },
  111782. timeToLoadedData: {
  111783. get: function get7() {
  111784. return _this3.masterPlaylistController_.timeToLoadedData_() || 0;
  111785. },
  111786. enumerable: true
  111787. },
  111788. buffered: {
  111789. get: function get7() {
  111790. return timeRangesToArray(_this3.tech_.buffered());
  111791. },
  111792. enumerable: true
  111793. },
  111794. currentTime: {
  111795. get: function get7() {
  111796. return _this3.tech_.currentTime();
  111797. },
  111798. enumerable: true
  111799. },
  111800. currentSource: {
  111801. get: function get7() {
  111802. return _this3.tech_.currentSource_;
  111803. },
  111804. enumerable: true
  111805. },
  111806. currentTech: {
  111807. get: function get7() {
  111808. return _this3.tech_.name_;
  111809. },
  111810. enumerable: true
  111811. },
  111812. duration: {
  111813. get: function get7() {
  111814. return _this3.tech_.duration();
  111815. },
  111816. enumerable: true
  111817. },
  111818. master: {
  111819. get: function get7() {
  111820. return _this3.playlists.master;
  111821. },
  111822. enumerable: true
  111823. },
  111824. playerDimensions: {
  111825. get: function get7() {
  111826. return _this3.tech_.currentDimensions();
  111827. },
  111828. enumerable: true
  111829. },
  111830. seekable: {
  111831. get: function get7() {
  111832. return timeRangesToArray(_this3.tech_.seekable());
  111833. },
  111834. enumerable: true
  111835. },
  111836. timestamp: {
  111837. get: function get7() {
  111838. return Date.now();
  111839. },
  111840. enumerable: true
  111841. },
  111842. videoPlaybackQuality: {
  111843. get: function get7() {
  111844. return _this3.tech_.getVideoPlaybackQuality();
  111845. },
  111846. enumerable: true
  111847. }
  111848. });
  111849. this.tech_.one("canplay", this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_));
  111850. this.tech_.on("bandwidthupdate", function() {
  111851. if (_this3.options_.useBandwidthFromLocalStorage) {
  111852. updateVhsLocalStorage({
  111853. bandwidth: _this3.bandwidth,
  111854. throughput: Math.round(_this3.throughput)
  111855. });
  111856. }
  111857. });
  111858. this.masterPlaylistController_.on("selectedinitialmedia", function() {
  111859. renditionSelectionMixin(_this3);
  111860. });
  111861. this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers", function() {
  111862. _this3.setupEme_();
  111863. });
  111864. this.on(this.masterPlaylistController_, "progress", function() {
  111865. this.tech_.trigger("progress");
  111866. });
  111867. this.on(this.masterPlaylistController_, "firstplay", function() {
  111868. this.ignoreNextSeekingEvent_ = true;
  111869. });
  111870. this.setupQualityLevels_();
  111871. if (!this.tech_.el()) {
  111872. return;
  111873. }
  111874. this.mediaSourceUrl_ = window_1.URL.createObjectURL(this.masterPlaylistController_.mediaSource);
  111875. this.tech_.src(this.mediaSourceUrl_);
  111876. };
  111877. _proto.createKeySessions_ = function createKeySessions_() {
  111878. var _this4 = this;
  111879. var audioPlaylistLoader = this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;
  111880. this.logger_("waiting for EME key session creation");
  111881. waitForKeySessionCreation({
  111882. player: this.player_,
  111883. sourceKeySystems: this.source_.keySystems,
  111884. audioMedia: audioPlaylistLoader && audioPlaylistLoader.media(),
  111885. mainPlaylists: this.playlists.master.playlists
  111886. }).then(function() {
  111887. _this4.logger_("created EME key session");
  111888. _this4.masterPlaylistController_.sourceUpdater_.initializedEme();
  111889. })["catch"](function(err) {
  111890. _this4.logger_("error while creating EME key session", err);
  111891. _this4.player_.error({
  111892. message: "Failed to initialize media keys for EME",
  111893. code: 3
  111894. });
  111895. });
  111896. };
  111897. _proto.handleWaitingForKey_ = function handleWaitingForKey_() {
  111898. this.logger_("waitingforkey fired, attempting to create any new key sessions");
  111899. this.createKeySessions_();
  111900. };
  111901. _proto.setupEme_ = function setupEme_() {
  111902. var _this5 = this;
  111903. var audioPlaylistLoader = this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;
  111904. var didSetupEmeOptions = setupEmeOptions({
  111905. player: this.player_,
  111906. sourceKeySystems: this.source_.keySystems,
  111907. media: this.playlists.media(),
  111908. audioMedia: audioPlaylistLoader && audioPlaylistLoader.media()
  111909. });
  111910. this.player_.tech_.on("keystatuschange", function(e) {
  111911. if (e.status !== "output-restricted") {
  111912. return;
  111913. }
  111914. var masterPlaylist = _this5.masterPlaylistController_.master();
  111915. if (!masterPlaylist || !masterPlaylist.playlists) {
  111916. return;
  111917. }
  111918. var excludedHDPlaylists = [];
  111919. masterPlaylist.playlists.forEach(function(playlist) {
  111920. if (playlist && playlist.attributes && playlist.attributes.RESOLUTION && playlist.attributes.RESOLUTION.height >= 720) {
  111921. if (!playlist.excludeUntil || playlist.excludeUntil < Infinity) {
  111922. playlist.excludeUntil = Infinity;
  111923. excludedHDPlaylists.push(playlist);
  111924. }
  111925. }
  111926. });
  111927. if (excludedHDPlaylists.length) {
  111928. var _videojs$log;
  111929. (_videojs$log = videojs.log).warn.apply(_videojs$log, ['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(excludedHDPlaylists));
  111930. _this5.masterPlaylistController_.fastQualityChange_();
  111931. }
  111932. });
  111933. this.handleWaitingForKey_ = this.handleWaitingForKey_.bind(this);
  111934. this.player_.tech_.on("waitingforkey", this.handleWaitingForKey_);
  111935. if (videojs.browser.IE_VERSION === 11 || !didSetupEmeOptions) {
  111936. this.masterPlaylistController_.sourceUpdater_.initializedEme();
  111937. return;
  111938. }
  111939. this.createKeySessions_();
  111940. };
  111941. _proto.setupQualityLevels_ = function setupQualityLevels_() {
  111942. var _this6 = this;
  111943. var player = videojs.players[this.tech_.options_.playerId];
  111944. if (!player || !player.qualityLevels || this.qualityLevels_) {
  111945. return;
  111946. }
  111947. this.qualityLevels_ = player.qualityLevels();
  111948. this.masterPlaylistController_.on("selectedinitialmedia", function() {
  111949. handleVhsLoadedMetadata(_this6.qualityLevels_, _this6);
  111950. });
  111951. this.playlists.on("mediachange", function() {
  111952. handleVhsMediaChange(_this6.qualityLevels_, _this6.playlists);
  111953. });
  111954. };
  111955. VhsHandler2.version = function version$52() {
  111956. return {
  111957. "@videojs/http-streaming": version$4,
  111958. "mux.js": version$3,
  111959. "mpd-parser": version$2,
  111960. "m3u8-parser": version$1$1,
  111961. "aes-decrypter": version$6
  111962. };
  111963. };
  111964. _proto.version = function version2() {
  111965. return this.constructor.version();
  111966. };
  111967. _proto.canChangeType = function canChangeType() {
  111968. return SourceUpdater.canChangeType();
  111969. };
  111970. _proto.play = function play() {
  111971. this.masterPlaylistController_.play();
  111972. };
  111973. _proto.setCurrentTime = function setCurrentTime(currentTime) {
  111974. this.masterPlaylistController_.setCurrentTime(currentTime);
  111975. };
  111976. _proto.duration = function duration5() {
  111977. return this.masterPlaylistController_.duration();
  111978. };
  111979. _proto.seekable = function seekable3() {
  111980. return this.masterPlaylistController_.seekable();
  111981. };
  111982. _proto.dispose = function dispose() {
  111983. if (this.playbackWatcher_) {
  111984. this.playbackWatcher_.dispose();
  111985. }
  111986. if (this.masterPlaylistController_) {
  111987. this.masterPlaylistController_.dispose();
  111988. }
  111989. if (this.qualityLevels_) {
  111990. this.qualityLevels_.dispose();
  111991. }
  111992. if (this.player_) {
  111993. delete this.player_.vhs;
  111994. delete this.player_.dash;
  111995. delete this.player_.hls;
  111996. }
  111997. if (this.tech_ && this.tech_.vhs) {
  111998. delete this.tech_.vhs;
  111999. }
  112000. if (this.tech_) {
  112001. delete this.tech_.hls;
  112002. }
  112003. if (this.mediaSourceUrl_ && window_1.URL.revokeObjectURL) {
  112004. window_1.URL.revokeObjectURL(this.mediaSourceUrl_);
  112005. this.mediaSourceUrl_ = null;
  112006. }
  112007. if (this.tech_) {
  112008. this.tech_.off("waitingforkey", this.handleWaitingForKey_);
  112009. }
  112010. _Component.prototype.dispose.call(this);
  112011. };
  112012. _proto.convertToProgramTime = function convertToProgramTime(time, callback2) {
  112013. return getProgramTime({
  112014. playlist: this.masterPlaylistController_.media(),
  112015. time,
  112016. callback: callback2
  112017. });
  112018. };
  112019. _proto.seekToProgramTime = function seekToProgramTime$12(programTime, callback2, pauseAfterSeek, retryCount) {
  112020. if (pauseAfterSeek === void 0) {
  112021. pauseAfterSeek = true;
  112022. }
  112023. if (retryCount === void 0) {
  112024. retryCount = 2;
  112025. }
  112026. return seekToProgramTime({
  112027. programTime,
  112028. playlist: this.masterPlaylistController_.media(),
  112029. retryCount,
  112030. pauseAfterSeek,
  112031. seekTo: this.options_.seekTo,
  112032. tech: this.options_.tech,
  112033. callback: callback2
  112034. });
  112035. };
  112036. return VhsHandler2;
  112037. }(Component);
  112038. var VhsSourceHandler = {
  112039. name: "videojs-http-streaming",
  112040. VERSION: version$4,
  112041. canHandleSource: function canHandleSource(srcObj, options2) {
  112042. if (options2 === void 0) {
  112043. options2 = {};
  112044. }
  112045. var localOptions = videojs.mergeOptions(videojs.options, options2);
  112046. return VhsSourceHandler.canPlayType(srcObj.type, localOptions);
  112047. },
  112048. handleSource: function handleSource(source, tech, options2) {
  112049. if (options2 === void 0) {
  112050. options2 = {};
  112051. }
  112052. var localOptions = videojs.mergeOptions(videojs.options, options2);
  112053. tech.vhs = new VhsHandler(source, tech, localOptions);
  112054. if (!videojs.hasOwnProperty("hls")) {
  112055. Object.defineProperty(tech, "hls", {
  112056. get: function get7() {
  112057. videojs.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead.");
  112058. return tech.vhs;
  112059. },
  112060. configurable: true
  112061. });
  112062. }
  112063. tech.vhs.xhr = xhrFactory();
  112064. tech.vhs.src(source.src, source.type);
  112065. return tech.vhs;
  112066. },
  112067. canPlayType: function canPlayType2(type2, options2) {
  112068. var simpleType = simpleTypeFromSourceType2(type2);
  112069. if (!simpleType) {
  112070. return "";
  112071. }
  112072. var overrideNative = VhsSourceHandler.getOverrideNative(options2);
  112073. var supportsTypeNatively = Vhs.supportsTypeNatively(simpleType);
  112074. var canUseMsePlayback = !supportsTypeNatively || overrideNative;
  112075. return canUseMsePlayback ? "maybe" : "";
  112076. },
  112077. getOverrideNative: function getOverrideNative(options2) {
  112078. if (options2 === void 0) {
  112079. options2 = {};
  112080. }
  112081. var _options = options2, _options$vhs = _options.vhs, vhs = _options$vhs === void 0 ? {} : _options$vhs, _options$hls = _options.hls, hls = _options$hls === void 0 ? {} : _options$hls;
  112082. var defaultOverrideNative = !(videojs.browser.IS_ANY_SAFARI || videojs.browser.IS_IOS);
  112083. var _vhs$overrideNative = vhs.overrideNative, overrideNative = _vhs$overrideNative === void 0 ? defaultOverrideNative : _vhs$overrideNative;
  112084. var _hls$overrideNative = hls.overrideNative, legacyOverrideNative = _hls$overrideNative === void 0 ? false : _hls$overrideNative;
  112085. return legacyOverrideNative || overrideNative;
  112086. }
  112087. };
  112088. var supportsNativeMediaSources = function supportsNativeMediaSources2() {
  112089. return browserSupportsCodec2("avc1.4d400d,mp4a.40.2");
  112090. };
  112091. if (supportsNativeMediaSources()) {
  112092. videojs.getTech("Html5").registerSourceHandler(VhsSourceHandler, 0);
  112093. }
  112094. videojs.VhsHandler = VhsHandler;
  112095. Object.defineProperty(videojs, "HlsHandler", {
  112096. get: function get4() {
  112097. videojs.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead.");
  112098. return VhsHandler;
  112099. },
  112100. configurable: true
  112101. });
  112102. videojs.VhsSourceHandler = VhsSourceHandler;
  112103. Object.defineProperty(videojs, "HlsSourceHandler", {
  112104. get: function get5() {
  112105. videojs.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead.");
  112106. return VhsSourceHandler;
  112107. },
  112108. configurable: true
  112109. });
  112110. videojs.Vhs = Vhs;
  112111. Object.defineProperty(videojs, "Hls", {
  112112. get: function get6() {
  112113. videojs.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead.");
  112114. return Vhs;
  112115. },
  112116. configurable: true
  112117. });
  112118. if (!videojs.use) {
  112119. videojs.registerComponent("Hls", Vhs);
  112120. videojs.registerComponent("Vhs", Vhs);
  112121. }
  112122. videojs.options.vhs = videojs.options.vhs || {};
  112123. videojs.options.hls = videojs.options.hls || {};
  112124. if (!videojs.getPlugin || !videojs.getPlugin("reloadSourceOnError")) {
  112125. var registerPlugin = videojs.registerPlugin || videojs.plugin;
  112126. registerPlugin("reloadSourceOnError", reloadSourceOnError);
  112127. }
  112128. const version = "5.4.2";
  112129. var version$1 = "2.2.1";
  112130. function FlashRtmpDecorator(Flash2) {
  112131. Flash2.streamingFormats = {
  112132. "rtmp/mp4": "MP4",
  112133. "rtmp/flv": "FLV"
  112134. };
  112135. Flash2.streamFromParts = function(connection, stream) {
  112136. return connection + "&" + stream;
  112137. };
  112138. Flash2.streamToParts = function(src) {
  112139. var parts = {
  112140. connection: "",
  112141. stream: ""
  112142. };
  112143. if (!src) {
  112144. return parts;
  112145. }
  112146. var connEnd = src.search(/&(?![\w-]+=)/);
  112147. var streamBegin = void 0;
  112148. if (connEnd !== -1) {
  112149. streamBegin = connEnd + 1;
  112150. } else {
  112151. connEnd = streamBegin = src.lastIndexOf("/") + 1;
  112152. if (connEnd === 0) {
  112153. connEnd = streamBegin = src.length;
  112154. }
  112155. }
  112156. parts.connection = src.substring(0, connEnd);
  112157. parts.stream = src.substring(streamBegin, src.length);
  112158. return parts;
  112159. };
  112160. Flash2.isStreamingType = function(srcType) {
  112161. return srcType in Flash2.streamingFormats;
  112162. };
  112163. Flash2.RTMP_RE = /^rtmp[set]?:\/\//i;
  112164. Flash2.isStreamingSrc = function(src) {
  112165. return Flash2.RTMP_RE.test(src);
  112166. };
  112167. Flash2.rtmpSourceHandler = {};
  112168. Flash2.rtmpSourceHandler.canPlayType = function(type2) {
  112169. if (Flash2.isStreamingType(type2)) {
  112170. return "maybe";
  112171. }
  112172. return "";
  112173. };
  112174. Flash2.rtmpSourceHandler.canHandleSource = function(source, options2) {
  112175. var can = Flash2.rtmpSourceHandler.canPlayType(source.type);
  112176. if (can) {
  112177. return can;
  112178. }
  112179. if (Flash2.isStreamingSrc(source.src)) {
  112180. return "maybe";
  112181. }
  112182. return "";
  112183. };
  112184. Flash2.rtmpSourceHandler.handleSource = function(source, tech, options2) {
  112185. var srcParts = Flash2.streamToParts(source.src);
  112186. tech.setRtmpConnection(srcParts.connection);
  112187. tech.setRtmpStream(srcParts.stream);
  112188. };
  112189. Flash2.registerSourceHandler(Flash2.rtmpSourceHandler);
  112190. return Flash2;
  112191. }
  112192. var classCallCheck = function(instance, Constructor) {
  112193. if (!(instance instanceof Constructor)) {
  112194. throw new TypeError("Cannot call a class as a function");
  112195. }
  112196. };
  112197. var inherits = function(subClass, superClass) {
  112198. if (typeof superClass !== "function" && superClass !== null) {
  112199. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  112200. }
  112201. subClass.prototype = Object.create(superClass && superClass.prototype, {
  112202. constructor: {
  112203. value: subClass,
  112204. enumerable: false,
  112205. writable: true,
  112206. configurable: true
  112207. }
  112208. });
  112209. if (superClass)
  112210. Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  112211. };
  112212. var possibleConstructorReturn = function(self2, call) {
  112213. if (!self2) {
  112214. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  112215. }
  112216. return call && (typeof call === "object" || typeof call === "function") ? call : self2;
  112217. };
  112218. var Tech = videojs.getComponent("Tech");
  112219. var Dom = videojs.dom;
  112220. var Url = videojs.url;
  112221. var createTimeRange = videojs.createTimeRange;
  112222. var mergeOptions$1 = videojs.mergeOptions;
  112223. var navigator$1 = window_1 && window_1.navigator || {};
  112224. var Flash = function(_Tech) {
  112225. inherits(Flash2, _Tech);
  112226. function Flash2(options2, ready) {
  112227. classCallCheck(this, Flash2);
  112228. var _this = possibleConstructorReturn(this, _Tech.call(this, options2, ready));
  112229. if (options2.source) {
  112230. _this.ready(function() {
  112231. this.setSource(options2.source);
  112232. }, true);
  112233. }
  112234. if (options2.startTime) {
  112235. _this.ready(function() {
  112236. this.load();
  112237. this.play();
  112238. this.currentTime(options2.startTime);
  112239. }, true);
  112240. }
  112241. window_1.videojs = window_1.videojs || {};
  112242. window_1.videojs.Flash = window_1.videojs.Flash || {};
  112243. window_1.videojs.Flash.onReady = Flash2.onReady;
  112244. window_1.videojs.Flash.onEvent = Flash2.onEvent;
  112245. window_1.videojs.Flash.onError = Flash2.onError;
  112246. _this.on("seeked", function() {
  112247. this.lastSeekTarget_ = void 0;
  112248. });
  112249. return _this;
  112250. }
  112251. Flash2.prototype.createEl = function createEl2() {
  112252. var options2 = this.options_;
  112253. if (!options2.swf) {
  112254. options2.swf = "https://vjs.zencdn.net/swf/" + version + "/video-js.swf";
  112255. }
  112256. var objId = options2.techId;
  112257. var flashVars = mergeOptions$1({
  112258. readyFunction: "videojs.Flash.onReady",
  112259. eventProxyFunction: "videojs.Flash.onEvent",
  112260. errorEventProxyFunction: "videojs.Flash.onError",
  112261. autoplay: options2.autoplay,
  112262. preload: options2.preload,
  112263. loop: options2.loop,
  112264. muted: options2.muted
  112265. }, options2.flashVars);
  112266. var params = mergeOptions$1({
  112267. wmode: "opaque",
  112268. bgcolor: "#000000"
  112269. }, options2.params);
  112270. var attributes = mergeOptions$1({
  112271. id: objId,
  112272. name: objId,
  112273. "class": "vjs-tech"
  112274. }, options2.attributes);
  112275. this.el_ = Flash2.embed(options2.swf, flashVars, params, attributes);
  112276. this.el_.tech = this;
  112277. return this.el_;
  112278. };
  112279. Flash2.prototype.play = function play() {
  112280. if (this.ended()) {
  112281. this.setCurrentTime(0);
  112282. }
  112283. this.el_.vjs_play();
  112284. };
  112285. Flash2.prototype.pause = function pause() {
  112286. this.el_.vjs_pause();
  112287. };
  112288. Flash2.prototype.src = function src(_src) {
  112289. if (_src === void 0) {
  112290. return this.currentSrc();
  112291. }
  112292. return this.setSrc(_src);
  112293. };
  112294. Flash2.prototype.setSrc = function setSrc(src) {
  112295. var _this2 = this;
  112296. src = Url.getAbsoluteURL(src);
  112297. this.el_.vjs_src(src);
  112298. if (this.autoplay()) {
  112299. this.setTimeout(function() {
  112300. return _this2.play();
  112301. }, 0);
  112302. }
  112303. };
  112304. Flash2.prototype.seeking = function seeking() {
  112305. return this.lastSeekTarget_ !== void 0;
  112306. };
  112307. Flash2.prototype.setCurrentTime = function setCurrentTime(time) {
  112308. var seekable3 = this.seekable();
  112309. if (seekable3.length) {
  112310. time = time > seekable3.start(0) ? time : seekable3.start(0);
  112311. time = time < seekable3.end(seekable3.length - 1) ? time : seekable3.end(seekable3.length - 1);
  112312. this.lastSeekTarget_ = time;
  112313. this.trigger("seeking");
  112314. this.el_.vjs_setProperty("currentTime", time);
  112315. _Tech.prototype.setCurrentTime.call(this);
  112316. }
  112317. };
  112318. Flash2.prototype.currentTime = function currentTime() {
  112319. if (this.seeking()) {
  112320. return this.lastSeekTarget_ || 0;
  112321. }
  112322. return this.el_.vjs_getProperty("currentTime");
  112323. };
  112324. Flash2.prototype.currentSrc = function currentSrc() {
  112325. if (this.currentSource_) {
  112326. return this.currentSource_.src;
  112327. }
  112328. return this.el_.vjs_getProperty("currentSrc");
  112329. };
  112330. Flash2.prototype.duration = function duration5() {
  112331. if (this.readyState() === 0) {
  112332. return NaN;
  112333. }
  112334. var duration6 = this.el_.vjs_getProperty("duration");
  112335. return duration6 >= 0 ? duration6 : Infinity;
  112336. };
  112337. Flash2.prototype.load = function load() {
  112338. this.el_.vjs_load();
  112339. };
  112340. Flash2.prototype.poster = function poster() {
  112341. this.el_.vjs_getProperty("poster");
  112342. };
  112343. Flash2.prototype.setPoster = function setPoster() {
  112344. };
  112345. Flash2.prototype.seekable = function seekable3() {
  112346. var duration5 = this.duration();
  112347. if (duration5 === 0) {
  112348. return createTimeRange();
  112349. }
  112350. return createTimeRange(0, duration5);
  112351. };
  112352. Flash2.prototype.buffered = function buffered() {
  112353. var ranges = this.el_.vjs_getProperty("buffered");
  112354. if (ranges.length === 0) {
  112355. return createTimeRange();
  112356. }
  112357. return createTimeRange(ranges[0][0], ranges[0][1]);
  112358. };
  112359. Flash2.prototype.supportsFullScreen = function supportsFullScreen() {
  112360. return false;
  112361. };
  112362. Flash2.prototype.enterFullScreen = function enterFullScreen() {
  112363. return false;
  112364. };
  112365. Flash2.prototype.getVideoPlaybackQuality = function getVideoPlaybackQuality() {
  112366. var videoPlaybackQuality = this.el_.vjs_getProperty("getVideoPlaybackQuality");
  112367. if (window_1.performance && typeof window_1.performance.now === "function") {
  112368. videoPlaybackQuality.creationTime = window_1.performance.now();
  112369. } else if (window_1.performance && window_1.performance.timing && typeof window_1.performance.timing.navigationStart === "number") {
  112370. videoPlaybackQuality.creationTime = window_1.Date.now() - window_1.performance.timing.navigationStart;
  112371. }
  112372. return videoPlaybackQuality;
  112373. };
  112374. return Flash2;
  112375. }(Tech);
  112376. var _readWrite = ["rtmpConnection", "rtmpStream", "preload", "defaultPlaybackRate", "playbackRate", "autoplay", "loop", "controls", "volume", "muted", "defaultMuted"];
  112377. var _readOnly = ["networkState", "readyState", "initialTime", "startOffsetTime", "paused", "ended", "videoWidth", "videoHeight"];
  112378. var _api = Flash.prototype;
  112379. function _createSetter(attr) {
  112380. var attrUpper = attr.charAt(0).toUpperCase() + attr.slice(1);
  112381. _api["set" + attrUpper] = function(val) {
  112382. return this.el_.vjs_setProperty(attr, val);
  112383. };
  112384. }
  112385. function _createGetter(attr) {
  112386. _api[attr] = function() {
  112387. return this.el_.vjs_getProperty(attr);
  112388. };
  112389. }
  112390. for (var i$1 = 0; i$1 < _readWrite.length; i$1++) {
  112391. _createGetter(_readWrite[i$1]);
  112392. _createSetter(_readWrite[i$1]);
  112393. }
  112394. for (var _i = 0; _i < _readOnly.length; _i++) {
  112395. _createGetter(_readOnly[_i]);
  112396. }
  112397. Flash.isSupported = function() {
  112398. if (videojs.browser.IS_CHROME && (!videojs.browser.IS_ANDROID || !videojs.browser.IS_IOS) || videojs.browser.IS_SAFARI && !videojs.browser.IS_IOS || videojs.browser.IS_EDGE) {
  112399. return true;
  112400. }
  112401. return Flash.version()[0] >= 10;
  112402. };
  112403. Tech.withSourceHandlers(Flash);
  112404. Flash.nativeSourceHandler = {};
  112405. Flash.nativeSourceHandler.canPlayType = function(type2) {
  112406. if (type2 in Flash.formats) {
  112407. return "maybe";
  112408. }
  112409. return "";
  112410. };
  112411. Flash.nativeSourceHandler.canHandleSource = function(source, options2) {
  112412. var type2 = void 0;
  112413. function guessMimeType(src) {
  112414. var ext = Url.getFileExtension(src);
  112415. if (ext) {
  112416. return "video/" + ext;
  112417. }
  112418. return "";
  112419. }
  112420. if (!source.type) {
  112421. type2 = guessMimeType(source.src);
  112422. } else {
  112423. type2 = source.type.replace(/;.*/, "").toLowerCase();
  112424. }
  112425. return Flash.nativeSourceHandler.canPlayType(type2);
  112426. };
  112427. Flash.nativeSourceHandler.handleSource = function(source, tech, options2) {
  112428. tech.setSrc(source.src);
  112429. };
  112430. Flash.nativeSourceHandler.dispose = function() {
  112431. };
  112432. Flash.registerSourceHandler(Flash.nativeSourceHandler);
  112433. Flash.formats = {
  112434. "video/flv": "FLV",
  112435. "video/x-flv": "FLV",
  112436. "video/mp4": "MP4",
  112437. "video/m4v": "MP4"
  112438. };
  112439. Flash.onReady = function(currSwf) {
  112440. var el = Dom.$("#" + currSwf);
  112441. var tech = el && el.tech;
  112442. if (tech && tech.el()) {
  112443. Flash.checkReady(tech);
  112444. }
  112445. };
  112446. Flash.checkReady = function(tech) {
  112447. if (!tech.el()) {
  112448. return;
  112449. }
  112450. if (tech.el().vjs_getProperty) {
  112451. tech.triggerReady();
  112452. } else {
  112453. this.setTimeout(function() {
  112454. Flash.checkReady(tech);
  112455. }, 50);
  112456. }
  112457. };
  112458. Flash.onEvent = function(swfID, eventName) {
  112459. var tech = Dom.$("#" + swfID).tech;
  112460. var args = Array.prototype.slice.call(arguments, 2);
  112461. tech.setTimeout(function() {
  112462. tech.trigger(eventName, args);
  112463. }, 1);
  112464. };
  112465. Flash.onError = function(swfID, err) {
  112466. var tech = Dom.$("#" + swfID).tech;
  112467. if (err === "srcnotfound") {
  112468. return tech.error(4);
  112469. }
  112470. if (typeof err === "string") {
  112471. tech.error("FLASH: " + err);
  112472. } else {
  112473. err.origin = "flash";
  112474. tech.error(err);
  112475. }
  112476. };
  112477. Flash.version = function() {
  112478. var version$$1 = "0,0,0";
  112479. try {
  112480. version$$1 = new window_1.ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version").replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
  112481. } catch (e) {
  112482. try {
  112483. if (navigator$1.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
  112484. version$$1 = (navigator$1.plugins["Shockwave Flash 2.0"] || navigator$1.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
  112485. }
  112486. } catch (err) {
  112487. }
  112488. }
  112489. return version$$1.split(",");
  112490. };
  112491. Flash.embed = function(swf, flashVars, params, attributes) {
  112492. var code = Flash.getEmbedCode(swf, flashVars, params, attributes);
  112493. var obj = Dom.createEl("div", { innerHTML: code }).childNodes[0];
  112494. return obj;
  112495. };
  112496. Flash.getEmbedCode = function(swf, flashVars, params, attributes) {
  112497. var objTag = '<object type="application/x-shockwave-flash" ';
  112498. var flashVarsString = "";
  112499. var paramsString = "";
  112500. var attrsString = "";
  112501. if (flashVars) {
  112502. Object.getOwnPropertyNames(flashVars).forEach(function(key) {
  112503. flashVarsString += key + "=" + flashVars[key] + "&amp;";
  112504. });
  112505. }
  112506. params = mergeOptions$1({
  112507. movie: swf,
  112508. flashvars: flashVarsString,
  112509. allowScriptAccess: "always",
  112510. allowNetworking: "all"
  112511. }, params);
  112512. Object.getOwnPropertyNames(params).forEach(function(key) {
  112513. paramsString += '<param name="' + key + '" value="' + params[key] + '" />';
  112514. });
  112515. attributes = mergeOptions$1({
  112516. data: swf,
  112517. width: "100%",
  112518. height: "100%"
  112519. }, attributes);
  112520. Object.getOwnPropertyNames(attributes).forEach(function(key) {
  112521. attrsString += key + '="' + attributes[key] + '" ';
  112522. });
  112523. return "" + objTag + attrsString + ">" + paramsString + "</object>";
  112524. };
  112525. FlashRtmpDecorator(Flash);
  112526. if (Tech.getTech("Flash")) {
  112527. videojs.log.warn("Not using videojs-flash as it appears to already be registered");
  112528. videojs.log.warn("videojs-flash should only be used with video.js@6 and above");
  112529. } else {
  112530. videojs.registerTech("Flash", Flash);
  112531. }
  112532. Flash.VERSION = version$1;
  112533. var flv = { exports: {} };
  112534. (function(module2, exports2) {
  112535. (function webpackUniversalModuleDefinition(root2, factory3) {
  112536. module2.exports = factory3();
  112537. })(self, function() {
  112538. return function() {
  112539. var __webpack_modules__ = {
  112540. "./node_modules/es6-promise/dist/es6-promise.js": function(module3, __unused_webpack_exports, __webpack_require__2) {
  112541. /*!
  112542. * @overview es6-promise - a tiny implementation of Promises/A+.
  112543. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
  112544. * @license Licensed under MIT license
  112545. * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
  112546. * @version v4.2.8+1e68dce6
  112547. */
  112548. (function(global2, factory3) {
  112549. module3.exports = factory3();
  112550. })(this, function() {
  112551. function objectOrFunction(x) {
  112552. var type2 = typeof x;
  112553. return x !== null && (type2 === "object" || type2 === "function");
  112554. }
  112555. function isFunction2(x) {
  112556. return typeof x === "function";
  112557. }
  112558. var _isArray = void 0;
  112559. if (Array.isArray) {
  112560. _isArray = Array.isArray;
  112561. } else {
  112562. _isArray = function(x) {
  112563. return Object.prototype.toString.call(x) === "[object Array]";
  112564. };
  112565. }
  112566. var isArray2 = _isArray;
  112567. var len = 0;
  112568. var vertxNext = void 0;
  112569. var customSchedulerFn = void 0;
  112570. var asap = function asap2(callback2, arg) {
  112571. queue[len] = callback2;
  112572. queue[len + 1] = arg;
  112573. len += 2;
  112574. if (len === 2) {
  112575. if (customSchedulerFn) {
  112576. customSchedulerFn(flush);
  112577. } else {
  112578. scheduleFlush();
  112579. }
  112580. }
  112581. };
  112582. function setScheduler(scheduleFn) {
  112583. customSchedulerFn = scheduleFn;
  112584. }
  112585. function setAsap(asapFn) {
  112586. asap = asapFn;
  112587. }
  112588. var browserWindow = typeof window !== "undefined" ? window : void 0;
  112589. var browserGlobal = browserWindow || {};
  112590. var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
  112591. var isNode = typeof self === "undefined" && typeof process !== "undefined" && {}.toString.call(process) === "[object process]";
  112592. var isWorker = typeof Uint8ClampedArray !== "undefined" && typeof importScripts !== "undefined" && typeof MessageChannel !== "undefined";
  112593. function useNextTick() {
  112594. return function() {
  112595. return process.nextTick(flush);
  112596. };
  112597. }
  112598. function useVertxTimer() {
  112599. if (typeof vertxNext !== "undefined") {
  112600. return function() {
  112601. vertxNext(flush);
  112602. };
  112603. }
  112604. return useSetTimeout();
  112605. }
  112606. function useMutationObserver() {
  112607. var iterations = 0;
  112608. var observer = new BrowserMutationObserver(flush);
  112609. var node = document.createTextNode("");
  112610. observer.observe(node, { characterData: true });
  112611. return function() {
  112612. node.data = iterations = ++iterations % 2;
  112613. };
  112614. }
  112615. function useMessageChannel() {
  112616. var channel = new MessageChannel();
  112617. channel.port1.onmessage = flush;
  112618. return function() {
  112619. return channel.port2.postMessage(0);
  112620. };
  112621. }
  112622. function useSetTimeout() {
  112623. var globalSetTimeout = setTimeout;
  112624. return function() {
  112625. return globalSetTimeout(flush, 1);
  112626. };
  112627. }
  112628. var queue = new Array(1e3);
  112629. function flush() {
  112630. for (var i2 = 0; i2 < len; i2 += 2) {
  112631. var callback2 = queue[i2];
  112632. var arg = queue[i2 + 1];
  112633. callback2(arg);
  112634. queue[i2] = void 0;
  112635. queue[i2 + 1] = void 0;
  112636. }
  112637. len = 0;
  112638. }
  112639. function attemptVertx() {
  112640. try {
  112641. var vertx = Function("return this")().require("vertx");
  112642. vertxNext = vertx.runOnLoop || vertx.runOnContext;
  112643. return useVertxTimer();
  112644. } catch (e) {
  112645. return useSetTimeout();
  112646. }
  112647. }
  112648. var scheduleFlush = void 0;
  112649. if (isNode) {
  112650. scheduleFlush = useNextTick();
  112651. } else if (BrowserMutationObserver) {
  112652. scheduleFlush = useMutationObserver();
  112653. } else if (isWorker) {
  112654. scheduleFlush = useMessageChannel();
  112655. } else if (browserWindow === void 0 && true) {
  112656. scheduleFlush = attemptVertx();
  112657. } else {
  112658. scheduleFlush = useSetTimeout();
  112659. }
  112660. function then(onFulfillment, onRejection) {
  112661. var parent = this;
  112662. var child = new this.constructor(noop2);
  112663. if (child[PROMISE_ID] === void 0) {
  112664. makePromise(child);
  112665. }
  112666. var _state = parent._state;
  112667. if (_state) {
  112668. var callback2 = arguments[_state - 1];
  112669. asap(function() {
  112670. return invokeCallback(_state, child, callback2, parent._result);
  112671. });
  112672. } else {
  112673. subscribe(parent, child, onFulfillment, onRejection);
  112674. }
  112675. return child;
  112676. }
  112677. function resolve$1(object) {
  112678. var Constructor = this;
  112679. if (object && typeof object === "object" && object.constructor === Constructor) {
  112680. return object;
  112681. }
  112682. var promise = new Constructor(noop2);
  112683. resolve2(promise, object);
  112684. return promise;
  112685. }
  112686. var PROMISE_ID = Math.random().toString(36).substring(2);
  112687. function noop2() {
  112688. }
  112689. var PENDING = void 0;
  112690. var FULFILLED = 1;
  112691. var REJECTED = 2;
  112692. function selfFulfillment() {
  112693. return new TypeError("You cannot resolve a promise with itself");
  112694. }
  112695. function cannotReturnOwn() {
  112696. return new TypeError("A promises callback cannot return that same promise.");
  112697. }
  112698. function tryThen(then$$1, value, fulfillmentHandler, rejectionHandler) {
  112699. try {
  112700. then$$1.call(value, fulfillmentHandler, rejectionHandler);
  112701. } catch (e) {
  112702. return e;
  112703. }
  112704. }
  112705. function handleForeignThenable(promise, thenable, then$$1) {
  112706. asap(function(promise2) {
  112707. var sealed = false;
  112708. var error = tryThen(then$$1, thenable, function(value) {
  112709. if (sealed) {
  112710. return;
  112711. }
  112712. sealed = true;
  112713. if (thenable !== value) {
  112714. resolve2(promise2, value);
  112715. } else {
  112716. fulfill(promise2, value);
  112717. }
  112718. }, function(reason) {
  112719. if (sealed) {
  112720. return;
  112721. }
  112722. sealed = true;
  112723. reject2(promise2, reason);
  112724. }, "Settle: " + (promise2._label || " unknown promise"));
  112725. if (!sealed && error) {
  112726. sealed = true;
  112727. reject2(promise2, error);
  112728. }
  112729. }, promise);
  112730. }
  112731. function handleOwnThenable(promise, thenable) {
  112732. if (thenable._state === FULFILLED) {
  112733. fulfill(promise, thenable._result);
  112734. } else if (thenable._state === REJECTED) {
  112735. reject2(promise, thenable._result);
  112736. } else {
  112737. subscribe(thenable, void 0, function(value) {
  112738. return resolve2(promise, value);
  112739. }, function(reason) {
  112740. return reject2(promise, reason);
  112741. });
  112742. }
  112743. }
  112744. function handleMaybeThenable(promise, maybeThenable, then$$1) {
  112745. if (maybeThenable.constructor === promise.constructor && then$$1 === then && maybeThenable.constructor.resolve === resolve$1) {
  112746. handleOwnThenable(promise, maybeThenable);
  112747. } else {
  112748. if (then$$1 === void 0) {
  112749. fulfill(promise, maybeThenable);
  112750. } else if (isFunction2(then$$1)) {
  112751. handleForeignThenable(promise, maybeThenable, then$$1);
  112752. } else {
  112753. fulfill(promise, maybeThenable);
  112754. }
  112755. }
  112756. }
  112757. function resolve2(promise, value) {
  112758. if (promise === value) {
  112759. reject2(promise, selfFulfillment());
  112760. } else if (objectOrFunction(value)) {
  112761. var then$$1 = void 0;
  112762. try {
  112763. then$$1 = value.then;
  112764. } catch (error) {
  112765. reject2(promise, error);
  112766. return;
  112767. }
  112768. handleMaybeThenable(promise, value, then$$1);
  112769. } else {
  112770. fulfill(promise, value);
  112771. }
  112772. }
  112773. function publishRejection(promise) {
  112774. if (promise._onerror) {
  112775. promise._onerror(promise._result);
  112776. }
  112777. publish(promise);
  112778. }
  112779. function fulfill(promise, value) {
  112780. if (promise._state !== PENDING) {
  112781. return;
  112782. }
  112783. promise._result = value;
  112784. promise._state = FULFILLED;
  112785. if (promise._subscribers.length !== 0) {
  112786. asap(publish, promise);
  112787. }
  112788. }
  112789. function reject2(promise, reason) {
  112790. if (promise._state !== PENDING) {
  112791. return;
  112792. }
  112793. promise._state = REJECTED;
  112794. promise._result = reason;
  112795. asap(publishRejection, promise);
  112796. }
  112797. function subscribe(parent, child, onFulfillment, onRejection) {
  112798. var _subscribers = parent._subscribers;
  112799. var length = _subscribers.length;
  112800. parent._onerror = null;
  112801. _subscribers[length] = child;
  112802. _subscribers[length + FULFILLED] = onFulfillment;
  112803. _subscribers[length + REJECTED] = onRejection;
  112804. if (length === 0 && parent._state) {
  112805. asap(publish, parent);
  112806. }
  112807. }
  112808. function publish(promise) {
  112809. var subscribers = promise._subscribers;
  112810. var settled = promise._state;
  112811. if (subscribers.length === 0) {
  112812. return;
  112813. }
  112814. var child = void 0, callback2 = void 0, detail = promise._result;
  112815. for (var i2 = 0; i2 < subscribers.length; i2 += 3) {
  112816. child = subscribers[i2];
  112817. callback2 = subscribers[i2 + settled];
  112818. if (child) {
  112819. invokeCallback(settled, child, callback2, detail);
  112820. } else {
  112821. callback2(detail);
  112822. }
  112823. }
  112824. promise._subscribers.length = 0;
  112825. }
  112826. function invokeCallback(settled, promise, callback2, detail) {
  112827. var hasCallback = isFunction2(callback2), value = void 0, error = void 0, succeeded = true;
  112828. if (hasCallback) {
  112829. try {
  112830. value = callback2(detail);
  112831. } catch (e) {
  112832. succeeded = false;
  112833. error = e;
  112834. }
  112835. if (promise === value) {
  112836. reject2(promise, cannotReturnOwn());
  112837. return;
  112838. }
  112839. } else {
  112840. value = detail;
  112841. }
  112842. if (promise._state !== PENDING)
  112843. ;
  112844. else if (hasCallback && succeeded) {
  112845. resolve2(promise, value);
  112846. } else if (succeeded === false) {
  112847. reject2(promise, error);
  112848. } else if (settled === FULFILLED) {
  112849. fulfill(promise, value);
  112850. } else if (settled === REJECTED) {
  112851. reject2(promise, value);
  112852. }
  112853. }
  112854. function initializePromise(promise, resolver) {
  112855. try {
  112856. resolver(function resolvePromise(value) {
  112857. resolve2(promise, value);
  112858. }, function rejectPromise(reason) {
  112859. reject2(promise, reason);
  112860. });
  112861. } catch (e) {
  112862. reject2(promise, e);
  112863. }
  112864. }
  112865. var id = 0;
  112866. function nextId() {
  112867. return id++;
  112868. }
  112869. function makePromise(promise) {
  112870. promise[PROMISE_ID] = id++;
  112871. promise._state = void 0;
  112872. promise._result = void 0;
  112873. promise._subscribers = [];
  112874. }
  112875. function validationError() {
  112876. return new Error("Array Methods must be provided an Array");
  112877. }
  112878. var Enumerator = function() {
  112879. function Enumerator2(Constructor, input) {
  112880. this._instanceConstructor = Constructor;
  112881. this.promise = new Constructor(noop2);
  112882. if (!this.promise[PROMISE_ID]) {
  112883. makePromise(this.promise);
  112884. }
  112885. if (isArray2(input)) {
  112886. this.length = input.length;
  112887. this._remaining = input.length;
  112888. this._result = new Array(this.length);
  112889. if (this.length === 0) {
  112890. fulfill(this.promise, this._result);
  112891. } else {
  112892. this.length = this.length || 0;
  112893. this._enumerate(input);
  112894. if (this._remaining === 0) {
  112895. fulfill(this.promise, this._result);
  112896. }
  112897. }
  112898. } else {
  112899. reject2(this.promise, validationError());
  112900. }
  112901. }
  112902. Enumerator2.prototype._enumerate = function _enumerate(input) {
  112903. for (var i2 = 0; this._state === PENDING && i2 < input.length; i2++) {
  112904. this._eachEntry(input[i2], i2);
  112905. }
  112906. };
  112907. Enumerator2.prototype._eachEntry = function _eachEntry(entry, i2) {
  112908. var c = this._instanceConstructor;
  112909. var resolve$$1 = c.resolve;
  112910. if (resolve$$1 === resolve$1) {
  112911. var _then = void 0;
  112912. var error = void 0;
  112913. var didError = false;
  112914. try {
  112915. _then = entry.then;
  112916. } catch (e) {
  112917. didError = true;
  112918. error = e;
  112919. }
  112920. if (_then === then && entry._state !== PENDING) {
  112921. this._settledAt(entry._state, i2, entry._result);
  112922. } else if (typeof _then !== "function") {
  112923. this._remaining--;
  112924. this._result[i2] = entry;
  112925. } else if (c === Promise$12) {
  112926. var promise = new c(noop2);
  112927. if (didError) {
  112928. reject2(promise, error);
  112929. } else {
  112930. handleMaybeThenable(promise, entry, _then);
  112931. }
  112932. this._willSettleAt(promise, i2);
  112933. } else {
  112934. this._willSettleAt(new c(function(resolve$$12) {
  112935. return resolve$$12(entry);
  112936. }), i2);
  112937. }
  112938. } else {
  112939. this._willSettleAt(resolve$$1(entry), i2);
  112940. }
  112941. };
  112942. Enumerator2.prototype._settledAt = function _settledAt(state, i2, value) {
  112943. var promise = this.promise;
  112944. if (promise._state === PENDING) {
  112945. this._remaining--;
  112946. if (state === REJECTED) {
  112947. reject2(promise, value);
  112948. } else {
  112949. this._result[i2] = value;
  112950. }
  112951. }
  112952. if (this._remaining === 0) {
  112953. fulfill(promise, this._result);
  112954. }
  112955. };
  112956. Enumerator2.prototype._willSettleAt = function _willSettleAt(promise, i2) {
  112957. var enumerator = this;
  112958. subscribe(promise, void 0, function(value) {
  112959. return enumerator._settledAt(FULFILLED, i2, value);
  112960. }, function(reason) {
  112961. return enumerator._settledAt(REJECTED, i2, reason);
  112962. });
  112963. };
  112964. return Enumerator2;
  112965. }();
  112966. function all(entries) {
  112967. return new Enumerator(this, entries).promise;
  112968. }
  112969. function race(entries) {
  112970. var Constructor = this;
  112971. if (!isArray2(entries)) {
  112972. return new Constructor(function(_, reject3) {
  112973. return reject3(new TypeError("You must pass an array to race."));
  112974. });
  112975. } else {
  112976. return new Constructor(function(resolve3, reject3) {
  112977. var length = entries.length;
  112978. for (var i2 = 0; i2 < length; i2++) {
  112979. Constructor.resolve(entries[i2]).then(resolve3, reject3);
  112980. }
  112981. });
  112982. }
  112983. }
  112984. function reject$1(reason) {
  112985. var Constructor = this;
  112986. var promise = new Constructor(noop2);
  112987. reject2(promise, reason);
  112988. return promise;
  112989. }
  112990. function needsResolver() {
  112991. throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");
  112992. }
  112993. function needsNew() {
  112994. throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");
  112995. }
  112996. var Promise$12 = function() {
  112997. function Promise2(resolver) {
  112998. this[PROMISE_ID] = nextId();
  112999. this._result = this._state = void 0;
  113000. this._subscribers = [];
  113001. if (noop2 !== resolver) {
  113002. typeof resolver !== "function" && needsResolver();
  113003. this instanceof Promise2 ? initializePromise(this, resolver) : needsNew();
  113004. }
  113005. }
  113006. Promise2.prototype.catch = function _catch(onRejection) {
  113007. return this.then(null, onRejection);
  113008. };
  113009. Promise2.prototype.finally = function _finally(callback2) {
  113010. var promise = this;
  113011. var constructor = promise.constructor;
  113012. if (isFunction2(callback2)) {
  113013. return promise.then(function(value) {
  113014. return constructor.resolve(callback2()).then(function() {
  113015. return value;
  113016. });
  113017. }, function(reason) {
  113018. return constructor.resolve(callback2()).then(function() {
  113019. throw reason;
  113020. });
  113021. });
  113022. }
  113023. return promise.then(callback2, callback2);
  113024. };
  113025. return Promise2;
  113026. }();
  113027. Promise$12.prototype.then = then;
  113028. Promise$12.all = all;
  113029. Promise$12.race = race;
  113030. Promise$12.resolve = resolve$1;
  113031. Promise$12.reject = reject$1;
  113032. Promise$12._setScheduler = setScheduler;
  113033. Promise$12._setAsap = setAsap;
  113034. Promise$12._asap = asap;
  113035. function polyfill() {
  113036. var local = void 0;
  113037. if (typeof __webpack_require__2.g !== "undefined") {
  113038. local = __webpack_require__2.g;
  113039. } else if (typeof self !== "undefined") {
  113040. local = self;
  113041. } else {
  113042. try {
  113043. local = Function("return this")();
  113044. } catch (e) {
  113045. throw new Error("polyfill failed because global object is unavailable in this environment");
  113046. }
  113047. }
  113048. var P2 = local.Promise;
  113049. if (P2) {
  113050. var promiseToString = null;
  113051. try {
  113052. promiseToString = Object.prototype.toString.call(P2.resolve());
  113053. } catch (e) {
  113054. }
  113055. if (promiseToString === "[object Promise]" && !P2.cast) {
  113056. return;
  113057. }
  113058. }
  113059. local.Promise = Promise$12;
  113060. }
  113061. Promise$12.polyfill = polyfill;
  113062. Promise$12.Promise = Promise$12;
  113063. return Promise$12;
  113064. });
  113065. },
  113066. "./node_modules/events/events.js": function(module3) {
  113067. var R2 = typeof Reflect === "object" ? Reflect : null;
  113068. var ReflectApply = R2 && typeof R2.apply === "function" ? R2.apply : function ReflectApply2(target, receiver, args) {
  113069. return Function.prototype.apply.call(target, receiver, args);
  113070. };
  113071. var ReflectOwnKeys;
  113072. if (R2 && typeof R2.ownKeys === "function") {
  113073. ReflectOwnKeys = R2.ownKeys;
  113074. } else if (Object.getOwnPropertySymbols) {
  113075. ReflectOwnKeys = function ReflectOwnKeys2(target) {
  113076. return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
  113077. };
  113078. } else {
  113079. ReflectOwnKeys = function ReflectOwnKeys2(target) {
  113080. return Object.getOwnPropertyNames(target);
  113081. };
  113082. }
  113083. function ProcessEmitWarning(warning) {
  113084. if (console && console.warn)
  113085. console.warn(warning);
  113086. }
  113087. var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
  113088. return value !== value;
  113089. };
  113090. function EventEmitter() {
  113091. EventEmitter.init.call(this);
  113092. }
  113093. module3.exports = EventEmitter;
  113094. module3.exports.once = once;
  113095. EventEmitter.EventEmitter = EventEmitter;
  113096. EventEmitter.prototype._events = void 0;
  113097. EventEmitter.prototype._eventsCount = 0;
  113098. EventEmitter.prototype._maxListeners = void 0;
  113099. var defaultMaxListeners = 10;
  113100. function checkListener(listener) {
  113101. if (typeof listener !== "function") {
  113102. throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
  113103. }
  113104. }
  113105. Object.defineProperty(EventEmitter, "defaultMaxListeners", {
  113106. enumerable: true,
  113107. get: function() {
  113108. return defaultMaxListeners;
  113109. },
  113110. set: function(arg) {
  113111. if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
  113112. throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
  113113. }
  113114. defaultMaxListeners = arg;
  113115. }
  113116. });
  113117. EventEmitter.init = function() {
  113118. if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
  113119. this._events = /* @__PURE__ */ Object.create(null);
  113120. this._eventsCount = 0;
  113121. }
  113122. this._maxListeners = this._maxListeners || void 0;
  113123. };
  113124. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  113125. if (typeof n !== "number" || n < 0 || NumberIsNaN(n)) {
  113126. throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + ".");
  113127. }
  113128. this._maxListeners = n;
  113129. return this;
  113130. };
  113131. function _getMaxListeners(that) {
  113132. if (that._maxListeners === void 0)
  113133. return EventEmitter.defaultMaxListeners;
  113134. return that._maxListeners;
  113135. }
  113136. EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  113137. return _getMaxListeners(this);
  113138. };
  113139. EventEmitter.prototype.emit = function emit(type2) {
  113140. var args = [];
  113141. for (var i2 = 1; i2 < arguments.length; i2++)
  113142. args.push(arguments[i2]);
  113143. var doError = type2 === "error";
  113144. var events = this._events;
  113145. if (events !== void 0)
  113146. doError = doError && events.error === void 0;
  113147. else if (!doError)
  113148. return false;
  113149. if (doError) {
  113150. var er;
  113151. if (args.length > 0)
  113152. er = args[0];
  113153. if (er instanceof Error) {
  113154. throw er;
  113155. }
  113156. var err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
  113157. err.context = er;
  113158. throw err;
  113159. }
  113160. var handler = events[type2];
  113161. if (handler === void 0)
  113162. return false;
  113163. if (typeof handler === "function") {
  113164. ReflectApply(handler, this, args);
  113165. } else {
  113166. var len = handler.length;
  113167. var listeners = arrayClone(handler, len);
  113168. for (var i2 = 0; i2 < len; ++i2)
  113169. ReflectApply(listeners[i2], this, args);
  113170. }
  113171. return true;
  113172. };
  113173. function _addListener(target, type2, listener, prepend) {
  113174. var m;
  113175. var events;
  113176. var existing;
  113177. checkListener(listener);
  113178. events = target._events;
  113179. if (events === void 0) {
  113180. events = target._events = /* @__PURE__ */ Object.create(null);
  113181. target._eventsCount = 0;
  113182. } else {
  113183. if (events.newListener !== void 0) {
  113184. target.emit("newListener", type2, listener.listener ? listener.listener : listener);
  113185. events = target._events;
  113186. }
  113187. existing = events[type2];
  113188. }
  113189. if (existing === void 0) {
  113190. existing = events[type2] = listener;
  113191. ++target._eventsCount;
  113192. } else {
  113193. if (typeof existing === "function") {
  113194. existing = events[type2] = prepend ? [listener, existing] : [existing, listener];
  113195. } else if (prepend) {
  113196. existing.unshift(listener);
  113197. } else {
  113198. existing.push(listener);
  113199. }
  113200. m = _getMaxListeners(target);
  113201. if (m > 0 && existing.length > m && !existing.warned) {
  113202. existing.warned = true;
  113203. var w = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type2) + " listeners added. Use emitter.setMaxListeners() to increase limit");
  113204. w.name = "MaxListenersExceededWarning";
  113205. w.emitter = target;
  113206. w.type = type2;
  113207. w.count = existing.length;
  113208. ProcessEmitWarning(w);
  113209. }
  113210. }
  113211. return target;
  113212. }
  113213. EventEmitter.prototype.addListener = function addListener(type2, listener) {
  113214. return _addListener(this, type2, listener, false);
  113215. };
  113216. EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  113217. EventEmitter.prototype.prependListener = function prependListener(type2, listener) {
  113218. return _addListener(this, type2, listener, true);
  113219. };
  113220. function onceWrapper() {
  113221. if (!this.fired) {
  113222. this.target.removeListener(this.type, this.wrapFn);
  113223. this.fired = true;
  113224. if (arguments.length === 0)
  113225. return this.listener.call(this.target);
  113226. return this.listener.apply(this.target, arguments);
  113227. }
  113228. }
  113229. function _onceWrap(target, type2, listener) {
  113230. var state = { fired: false, wrapFn: void 0, target, type: type2, listener };
  113231. var wrapped = onceWrapper.bind(state);
  113232. wrapped.listener = listener;
  113233. state.wrapFn = wrapped;
  113234. return wrapped;
  113235. }
  113236. EventEmitter.prototype.once = function once2(type2, listener) {
  113237. checkListener(listener);
  113238. this.on(type2, _onceWrap(this, type2, listener));
  113239. return this;
  113240. };
  113241. EventEmitter.prototype.prependOnceListener = function prependOnceListener(type2, listener) {
  113242. checkListener(listener);
  113243. this.prependListener(type2, _onceWrap(this, type2, listener));
  113244. return this;
  113245. };
  113246. EventEmitter.prototype.removeListener = function removeListener(type2, listener) {
  113247. var list, events, position2, i2, originalListener;
  113248. checkListener(listener);
  113249. events = this._events;
  113250. if (events === void 0)
  113251. return this;
  113252. list = events[type2];
  113253. if (list === void 0)
  113254. return this;
  113255. if (list === listener || list.listener === listener) {
  113256. if (--this._eventsCount === 0)
  113257. this._events = /* @__PURE__ */ Object.create(null);
  113258. else {
  113259. delete events[type2];
  113260. if (events.removeListener)
  113261. this.emit("removeListener", type2, list.listener || listener);
  113262. }
  113263. } else if (typeof list !== "function") {
  113264. position2 = -1;
  113265. for (i2 = list.length - 1; i2 >= 0; i2--) {
  113266. if (list[i2] === listener || list[i2].listener === listener) {
  113267. originalListener = list[i2].listener;
  113268. position2 = i2;
  113269. break;
  113270. }
  113271. }
  113272. if (position2 < 0)
  113273. return this;
  113274. if (position2 === 0)
  113275. list.shift();
  113276. else {
  113277. spliceOne(list, position2);
  113278. }
  113279. if (list.length === 1)
  113280. events[type2] = list[0];
  113281. if (events.removeListener !== void 0)
  113282. this.emit("removeListener", type2, originalListener || listener);
  113283. }
  113284. return this;
  113285. };
  113286. EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
  113287. EventEmitter.prototype.removeAllListeners = function removeAllListeners(type2) {
  113288. var listeners, events, i2;
  113289. events = this._events;
  113290. if (events === void 0)
  113291. return this;
  113292. if (events.removeListener === void 0) {
  113293. if (arguments.length === 0) {
  113294. this._events = /* @__PURE__ */ Object.create(null);
  113295. this._eventsCount = 0;
  113296. } else if (events[type2] !== void 0) {
  113297. if (--this._eventsCount === 0)
  113298. this._events = /* @__PURE__ */ Object.create(null);
  113299. else
  113300. delete events[type2];
  113301. }
  113302. return this;
  113303. }
  113304. if (arguments.length === 0) {
  113305. var keys3 = Object.keys(events);
  113306. var key;
  113307. for (i2 = 0; i2 < keys3.length; ++i2) {
  113308. key = keys3[i2];
  113309. if (key === "removeListener")
  113310. continue;
  113311. this.removeAllListeners(key);
  113312. }
  113313. this.removeAllListeners("removeListener");
  113314. this._events = /* @__PURE__ */ Object.create(null);
  113315. this._eventsCount = 0;
  113316. return this;
  113317. }
  113318. listeners = events[type2];
  113319. if (typeof listeners === "function") {
  113320. this.removeListener(type2, listeners);
  113321. } else if (listeners !== void 0) {
  113322. for (i2 = listeners.length - 1; i2 >= 0; i2--) {
  113323. this.removeListener(type2, listeners[i2]);
  113324. }
  113325. }
  113326. return this;
  113327. };
  113328. function _listeners(target, type2, unwrap) {
  113329. var events = target._events;
  113330. if (events === void 0)
  113331. return [];
  113332. var evlistener = events[type2];
  113333. if (evlistener === void 0)
  113334. return [];
  113335. if (typeof evlistener === "function")
  113336. return unwrap ? [evlistener.listener || evlistener] : [evlistener];
  113337. return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
  113338. }
  113339. EventEmitter.prototype.listeners = function listeners(type2) {
  113340. return _listeners(this, type2, true);
  113341. };
  113342. EventEmitter.prototype.rawListeners = function rawListeners(type2) {
  113343. return _listeners(this, type2, false);
  113344. };
  113345. EventEmitter.listenerCount = function(emitter, type2) {
  113346. if (typeof emitter.listenerCount === "function") {
  113347. return emitter.listenerCount(type2);
  113348. } else {
  113349. return listenerCount.call(emitter, type2);
  113350. }
  113351. };
  113352. EventEmitter.prototype.listenerCount = listenerCount;
  113353. function listenerCount(type2) {
  113354. var events = this._events;
  113355. if (events !== void 0) {
  113356. var evlistener = events[type2];
  113357. if (typeof evlistener === "function") {
  113358. return 1;
  113359. } else if (evlistener !== void 0) {
  113360. return evlistener.length;
  113361. }
  113362. }
  113363. return 0;
  113364. }
  113365. EventEmitter.prototype.eventNames = function eventNames() {
  113366. return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
  113367. };
  113368. function arrayClone(arr, n) {
  113369. var copy2 = new Array(n);
  113370. for (var i2 = 0; i2 < n; ++i2)
  113371. copy2[i2] = arr[i2];
  113372. return copy2;
  113373. }
  113374. function spliceOne(list, index2) {
  113375. for (; index2 + 1 < list.length; index2++)
  113376. list[index2] = list[index2 + 1];
  113377. list.pop();
  113378. }
  113379. function unwrapListeners(arr) {
  113380. var ret = new Array(arr.length);
  113381. for (var i2 = 0; i2 < ret.length; ++i2) {
  113382. ret[i2] = arr[i2].listener || arr[i2];
  113383. }
  113384. return ret;
  113385. }
  113386. function once(emitter, name) {
  113387. return new Promise(function(resolve2, reject2) {
  113388. function errorListener(err) {
  113389. emitter.removeListener(name, resolver);
  113390. reject2(err);
  113391. }
  113392. function resolver() {
  113393. if (typeof emitter.removeListener === "function") {
  113394. emitter.removeListener("error", errorListener);
  113395. }
  113396. resolve2([].slice.call(arguments));
  113397. }
  113398. eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
  113399. if (name !== "error") {
  113400. addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
  113401. }
  113402. });
  113403. }
  113404. function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
  113405. if (typeof emitter.on === "function") {
  113406. eventTargetAgnosticAddListener(emitter, "error", handler, flags);
  113407. }
  113408. }
  113409. function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
  113410. if (typeof emitter.on === "function") {
  113411. if (flags.once) {
  113412. emitter.once(name, listener);
  113413. } else {
  113414. emitter.on(name, listener);
  113415. }
  113416. } else if (typeof emitter.addEventListener === "function") {
  113417. emitter.addEventListener(name, function wrapListener(arg) {
  113418. if (flags.once) {
  113419. emitter.removeEventListener(name, wrapListener);
  113420. }
  113421. listener(arg);
  113422. });
  113423. } else {
  113424. throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
  113425. }
  113426. }
  113427. },
  113428. "./node_modules/webworkify-webpack/index.js": function(module3, __unused_webpack_exports, __webpack_require__2) {
  113429. function webpackBootstrapFunc(modules) {
  113430. var installedModules = {};
  113431. function __nested_webpack_require_164__(moduleId) {
  113432. if (installedModules[moduleId])
  113433. return installedModules[moduleId].exports;
  113434. var module4 = installedModules[moduleId] = {
  113435. i: moduleId,
  113436. l: false,
  113437. exports: {}
  113438. };
  113439. modules[moduleId].call(module4.exports, module4, module4.exports, __nested_webpack_require_164__);
  113440. module4.l = true;
  113441. return module4.exports;
  113442. }
  113443. __nested_webpack_require_164__.m = modules;
  113444. __nested_webpack_require_164__.c = installedModules;
  113445. __nested_webpack_require_164__.i = function(value) {
  113446. return value;
  113447. };
  113448. __nested_webpack_require_164__.d = function(exports3, name, getter) {
  113449. if (!__nested_webpack_require_164__.o(exports3, name)) {
  113450. Object.defineProperty(exports3, name, {
  113451. configurable: false,
  113452. enumerable: true,
  113453. get: getter
  113454. });
  113455. }
  113456. };
  113457. __nested_webpack_require_164__.r = function(exports3) {
  113458. Object.defineProperty(exports3, "__esModule", { value: true });
  113459. };
  113460. __nested_webpack_require_164__.n = function(module4) {
  113461. var getter = module4 && module4.__esModule ? function getDefault() {
  113462. return module4["default"];
  113463. } : function getModuleExports() {
  113464. return module4;
  113465. };
  113466. __nested_webpack_require_164__.d(getter, "a", getter);
  113467. return getter;
  113468. };
  113469. __nested_webpack_require_164__.o = function(object, property) {
  113470. return Object.prototype.hasOwnProperty.call(object, property);
  113471. };
  113472. __nested_webpack_require_164__.p = "/";
  113473. __nested_webpack_require_164__.oe = function(err) {
  113474. console.error(err);
  113475. throw err;
  113476. };
  113477. var f = __nested_webpack_require_164__(__nested_webpack_require_164__.s = ENTRY_MODULE);
  113478. return f.default || f;
  113479. }
  113480. var moduleNameReqExp = "[\\.|\\-|\\+|\\w|/|@]+";
  113481. var dependencyRegExp = "\\(\\s*(/\\*.*?\\*/)?\\s*.*?(" + moduleNameReqExp + ").*?\\)";
  113482. function quoteRegExp(str) {
  113483. return (str + "").replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
  113484. }
  113485. function isNumeric(n) {
  113486. return !isNaN(1 * n);
  113487. }
  113488. function getModuleDependencies(sources, module4, queueName) {
  113489. var retval = {};
  113490. retval[queueName] = [];
  113491. var fnString = module4.toString();
  113492. var wrapperSignature = fnString.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);
  113493. if (!wrapperSignature)
  113494. return retval;
  113495. var webpackRequireName = wrapperSignature[1];
  113496. var re = new RegExp("(\\\\n|\\W)" + quoteRegExp(webpackRequireName) + dependencyRegExp, "g");
  113497. var match;
  113498. while (match = re.exec(fnString)) {
  113499. if (match[3] === "dll-reference")
  113500. continue;
  113501. retval[queueName].push(match[3]);
  113502. }
  113503. re = new RegExp("\\(" + quoteRegExp(webpackRequireName) + '\\("(dll-reference\\s(' + moduleNameReqExp + '))"\\)\\)' + dependencyRegExp, "g");
  113504. while (match = re.exec(fnString)) {
  113505. if (!sources[match[2]]) {
  113506. retval[queueName].push(match[1]);
  113507. sources[match[2]] = __webpack_require__2(match[1]).m;
  113508. }
  113509. retval[match[2]] = retval[match[2]] || [];
  113510. retval[match[2]].push(match[4]);
  113511. }
  113512. var keys3 = Object.keys(retval);
  113513. for (var i2 = 0; i2 < keys3.length; i2++) {
  113514. for (var j = 0; j < retval[keys3[i2]].length; j++) {
  113515. if (isNumeric(retval[keys3[i2]][j])) {
  113516. retval[keys3[i2]][j] = 1 * retval[keys3[i2]][j];
  113517. }
  113518. }
  113519. }
  113520. return retval;
  113521. }
  113522. function hasValuesInQueues(queues) {
  113523. var keys3 = Object.keys(queues);
  113524. return keys3.reduce(function(hasValues, key) {
  113525. return hasValues || queues[key].length > 0;
  113526. }, false);
  113527. }
  113528. function getRequiredModules(sources, moduleId) {
  113529. var modulesQueue = {
  113530. main: [moduleId]
  113531. };
  113532. var requiredModules = {
  113533. main: []
  113534. };
  113535. var seenModules = {
  113536. main: {}
  113537. };
  113538. while (hasValuesInQueues(modulesQueue)) {
  113539. var queues = Object.keys(modulesQueue);
  113540. for (var i2 = 0; i2 < queues.length; i2++) {
  113541. var queueName = queues[i2];
  113542. var queue = modulesQueue[queueName];
  113543. var moduleToCheck = queue.pop();
  113544. seenModules[queueName] = seenModules[queueName] || {};
  113545. if (seenModules[queueName][moduleToCheck] || !sources[queueName][moduleToCheck])
  113546. continue;
  113547. seenModules[queueName][moduleToCheck] = true;
  113548. requiredModules[queueName] = requiredModules[queueName] || [];
  113549. requiredModules[queueName].push(moduleToCheck);
  113550. var newModules = getModuleDependencies(sources, sources[queueName][moduleToCheck], queueName);
  113551. var newModulesKeys = Object.keys(newModules);
  113552. for (var j = 0; j < newModulesKeys.length; j++) {
  113553. modulesQueue[newModulesKeys[j]] = modulesQueue[newModulesKeys[j]] || [];
  113554. modulesQueue[newModulesKeys[j]] = modulesQueue[newModulesKeys[j]].concat(newModules[newModulesKeys[j]]);
  113555. }
  113556. }
  113557. }
  113558. return requiredModules;
  113559. }
  113560. module3.exports = function(moduleId, options2) {
  113561. options2 = options2 || {};
  113562. var sources = {
  113563. main: __webpack_require__2.m
  113564. };
  113565. var requiredModules = options2.all ? { main: Object.keys(sources.main) } : getRequiredModules(sources, moduleId);
  113566. var src = "";
  113567. Object.keys(requiredModules).filter(function(m) {
  113568. return m !== "main";
  113569. }).forEach(function(module4) {
  113570. var entryModule = 0;
  113571. while (requiredModules[module4][entryModule]) {
  113572. entryModule++;
  113573. }
  113574. requiredModules[module4].push(entryModule);
  113575. sources[module4][entryModule] = "(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })";
  113576. src = src + "var " + module4 + " = (" + webpackBootstrapFunc.toString().replace("ENTRY_MODULE", JSON.stringify(entryModule)) + ")({" + requiredModules[module4].map(function(id) {
  113577. return "" + JSON.stringify(id) + ": " + sources[module4][id].toString();
  113578. }).join(",") + "});\n";
  113579. });
  113580. src = src + "new ((" + webpackBootstrapFunc.toString().replace("ENTRY_MODULE", JSON.stringify(moduleId)) + ")({" + requiredModules.main.map(function(id) {
  113581. return "" + JSON.stringify(id) + ": " + sources.main[id].toString();
  113582. }).join(",") + "}))(self);";
  113583. var blob = new window.Blob([src], { type: "text/javascript" });
  113584. if (options2.bare) {
  113585. return blob;
  113586. }
  113587. var URL2 = window.URL || window.webkitURL || window.mozURL || window.msURL;
  113588. var workerUrl = URL2.createObjectURL(blob);
  113589. var worker = new window.Worker(workerUrl);
  113590. worker.objectURL = workerUrl;
  113591. return worker;
  113592. };
  113593. },
  113594. "./src/config.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  113595. __webpack_require__2.r(__webpack_exports__2);
  113596. __webpack_require__2.d(__webpack_exports__2, {
  113597. "defaultConfig": function() {
  113598. return defaultConfig;
  113599. },
  113600. "createDefaultConfig": function() {
  113601. return createDefaultConfig;
  113602. }
  113603. });
  113604. var defaultConfig = {
  113605. enableWorker: false,
  113606. enableStashBuffer: true,
  113607. stashInitialSize: void 0,
  113608. isLive: false,
  113609. lazyLoad: true,
  113610. lazyLoadMaxDuration: 3 * 60,
  113611. lazyLoadRecoverDuration: 30,
  113612. deferLoadAfterSourceOpen: true,
  113613. autoCleanupMaxBackwardDuration: 3 * 60,
  113614. autoCleanupMinBackwardDuration: 2 * 60,
  113615. statisticsInfoReportInterval: 600,
  113616. fixAudioTimestampGap: true,
  113617. accurateSeek: false,
  113618. seekType: "range",
  113619. seekParamStart: "bstart",
  113620. seekParamEnd: "bend",
  113621. rangeLoadZeroStart: false,
  113622. customSeekHandler: void 0,
  113623. reuseRedirectedURL: false,
  113624. headers: void 0,
  113625. customLoader: void 0
  113626. };
  113627. function createDefaultConfig() {
  113628. return Object.assign({}, defaultConfig);
  113629. }
  113630. },
  113631. "./src/core/features.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  113632. __webpack_require__2.r(__webpack_exports__2);
  113633. var _io_io_controller_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/io/io-controller.js");
  113634. var _config_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/config.js");
  113635. var Features = function() {
  113636. function Features2() {
  113637. }
  113638. Features2.supportMSEH264Playback = function() {
  113639. return window.MediaSource && window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"');
  113640. };
  113641. Features2.supportNetworkStreamIO = function() {
  113642. var ioctl = new _io_io_controller_js__WEBPACK_IMPORTED_MODULE_0__.default({}, (0, _config_js__WEBPACK_IMPORTED_MODULE_1__.createDefaultConfig)());
  113643. var loaderType = ioctl.loaderType;
  113644. ioctl.destroy();
  113645. return loaderType == "fetch-stream-loader" || loaderType == "xhr-moz-chunked-loader";
  113646. };
  113647. Features2.getNetworkLoaderTypeName = function() {
  113648. var ioctl = new _io_io_controller_js__WEBPACK_IMPORTED_MODULE_0__.default({}, (0, _config_js__WEBPACK_IMPORTED_MODULE_1__.createDefaultConfig)());
  113649. var loaderType = ioctl.loaderType;
  113650. ioctl.destroy();
  113651. return loaderType;
  113652. };
  113653. Features2.supportNativeMediaPlayback = function(mimeType) {
  113654. if (Features2.videoElement == void 0) {
  113655. Features2.videoElement = window.document.createElement("video");
  113656. }
  113657. var canPlay = Features2.videoElement.canPlayType(mimeType);
  113658. return canPlay === "probably" || canPlay == "maybe";
  113659. };
  113660. Features2.getFeatureList = function() {
  113661. var features = {
  113662. mseFlvPlayback: false,
  113663. mseLiveFlvPlayback: false,
  113664. networkStreamIO: false,
  113665. networkLoaderName: "",
  113666. nativeMP4H264Playback: false,
  113667. nativeWebmVP8Playback: false,
  113668. nativeWebmVP9Playback: false
  113669. };
  113670. features.mseFlvPlayback = Features2.supportMSEH264Playback();
  113671. features.networkStreamIO = Features2.supportNetworkStreamIO();
  113672. features.networkLoaderName = Features2.getNetworkLoaderTypeName();
  113673. features.mseLiveFlvPlayback = features.mseFlvPlayback && features.networkStreamIO;
  113674. features.nativeMP4H264Playback = Features2.supportNativeMediaPlayback('video/mp4; codecs="avc1.42001E, mp4a.40.2"');
  113675. features.nativeWebmVP8Playback = Features2.supportNativeMediaPlayback('video/webm; codecs="vp8.0, vorbis"');
  113676. features.nativeWebmVP9Playback = Features2.supportNativeMediaPlayback('video/webm; codecs="vp9"');
  113677. return features;
  113678. };
  113679. return Features2;
  113680. }();
  113681. __webpack_exports__2["default"] = Features;
  113682. },
  113683. "./src/core/media-info.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  113684. __webpack_require__2.r(__webpack_exports__2);
  113685. var MediaInfo = function() {
  113686. function MediaInfo2() {
  113687. this.mimeType = null;
  113688. this.duration = null;
  113689. this.hasAudio = null;
  113690. this.hasVideo = null;
  113691. this.audioCodec = null;
  113692. this.videoCodec = null;
  113693. this.audioDataRate = null;
  113694. this.videoDataRate = null;
  113695. this.audioSampleRate = null;
  113696. this.audioChannelCount = null;
  113697. this.width = null;
  113698. this.height = null;
  113699. this.fps = null;
  113700. this.profile = null;
  113701. this.level = null;
  113702. this.refFrames = null;
  113703. this.chromaFormat = null;
  113704. this.sarNum = null;
  113705. this.sarDen = null;
  113706. this.metadata = null;
  113707. this.segments = null;
  113708. this.segmentCount = null;
  113709. this.hasKeyframesIndex = null;
  113710. this.keyframesIndex = null;
  113711. }
  113712. MediaInfo2.prototype.isComplete = function() {
  113713. var audioInfoComplete = this.hasAudio === false || this.hasAudio === true && this.audioCodec != null && this.audioSampleRate != null && this.audioChannelCount != null;
  113714. var videoInfoComplete = this.hasVideo === false || this.hasVideo === true && this.videoCodec != null && this.width != null && this.height != null && this.fps != null && this.profile != null && this.level != null && this.refFrames != null && this.chromaFormat != null && this.sarNum != null && this.sarDen != null;
  113715. return this.mimeType != null && this.duration != null && this.metadata != null && this.hasKeyframesIndex != null && audioInfoComplete && videoInfoComplete;
  113716. };
  113717. MediaInfo2.prototype.isSeekable = function() {
  113718. return this.hasKeyframesIndex === true;
  113719. };
  113720. MediaInfo2.prototype.getNearestKeyframe = function(milliseconds) {
  113721. if (this.keyframesIndex == null) {
  113722. return null;
  113723. }
  113724. var table = this.keyframesIndex;
  113725. var keyframeIdx = this._search(table.times, milliseconds);
  113726. return {
  113727. index: keyframeIdx,
  113728. milliseconds: table.times[keyframeIdx],
  113729. fileposition: table.filepositions[keyframeIdx]
  113730. };
  113731. };
  113732. MediaInfo2.prototype._search = function(list, value) {
  113733. var idx = 0;
  113734. var last = list.length - 1;
  113735. var mid = 0;
  113736. var lbound = 0;
  113737. var ubound = last;
  113738. if (value < list[0]) {
  113739. idx = 0;
  113740. lbound = ubound + 1;
  113741. }
  113742. while (lbound <= ubound) {
  113743. mid = lbound + Math.floor((ubound - lbound) / 2);
  113744. if (mid === last || value >= list[mid] && value < list[mid + 1]) {
  113745. idx = mid;
  113746. break;
  113747. } else if (list[mid] < value) {
  113748. lbound = mid + 1;
  113749. } else {
  113750. ubound = mid - 1;
  113751. }
  113752. }
  113753. return idx;
  113754. };
  113755. return MediaInfo2;
  113756. }();
  113757. __webpack_exports__2["default"] = MediaInfo;
  113758. },
  113759. "./src/core/media-segment-info.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  113760. __webpack_require__2.r(__webpack_exports__2);
  113761. __webpack_require__2.d(__webpack_exports__2, {
  113762. "SampleInfo": function() {
  113763. return SampleInfo;
  113764. },
  113765. "MediaSegmentInfo": function() {
  113766. return MediaSegmentInfo;
  113767. },
  113768. "IDRSampleList": function() {
  113769. return IDRSampleList;
  113770. },
  113771. "MediaSegmentInfoList": function() {
  113772. return MediaSegmentInfoList;
  113773. }
  113774. });
  113775. var SampleInfo = function() {
  113776. function SampleInfo2(dts, pts, duration5, originalDts, isSync) {
  113777. this.dts = dts;
  113778. this.pts = pts;
  113779. this.duration = duration5;
  113780. this.originalDts = originalDts;
  113781. this.isSyncPoint = isSync;
  113782. this.fileposition = null;
  113783. }
  113784. return SampleInfo2;
  113785. }();
  113786. var MediaSegmentInfo = function() {
  113787. function MediaSegmentInfo2() {
  113788. this.beginDts = 0;
  113789. this.endDts = 0;
  113790. this.beginPts = 0;
  113791. this.endPts = 0;
  113792. this.originalBeginDts = 0;
  113793. this.originalEndDts = 0;
  113794. this.syncPoints = [];
  113795. this.firstSample = null;
  113796. this.lastSample = null;
  113797. }
  113798. MediaSegmentInfo2.prototype.appendSyncPoint = function(sampleInfo) {
  113799. sampleInfo.isSyncPoint = true;
  113800. this.syncPoints.push(sampleInfo);
  113801. };
  113802. return MediaSegmentInfo2;
  113803. }();
  113804. var IDRSampleList = function() {
  113805. function IDRSampleList2() {
  113806. this._list = [];
  113807. }
  113808. IDRSampleList2.prototype.clear = function() {
  113809. this._list = [];
  113810. };
  113811. IDRSampleList2.prototype.appendArray = function(syncPoints) {
  113812. var list = this._list;
  113813. if (syncPoints.length === 0) {
  113814. return;
  113815. }
  113816. if (list.length > 0 && syncPoints[0].originalDts < list[list.length - 1].originalDts) {
  113817. this.clear();
  113818. }
  113819. Array.prototype.push.apply(list, syncPoints);
  113820. };
  113821. IDRSampleList2.prototype.getLastSyncPointBeforeDts = function(dts) {
  113822. if (this._list.length == 0) {
  113823. return null;
  113824. }
  113825. var list = this._list;
  113826. var idx = 0;
  113827. var last = list.length - 1;
  113828. var mid = 0;
  113829. var lbound = 0;
  113830. var ubound = last;
  113831. if (dts < list[0].dts) {
  113832. idx = 0;
  113833. lbound = ubound + 1;
  113834. }
  113835. while (lbound <= ubound) {
  113836. mid = lbound + Math.floor((ubound - lbound) / 2);
  113837. if (mid === last || dts >= list[mid].dts && dts < list[mid + 1].dts) {
  113838. idx = mid;
  113839. break;
  113840. } else if (list[mid].dts < dts) {
  113841. lbound = mid + 1;
  113842. } else {
  113843. ubound = mid - 1;
  113844. }
  113845. }
  113846. return this._list[idx];
  113847. };
  113848. return IDRSampleList2;
  113849. }();
  113850. var MediaSegmentInfoList = function() {
  113851. function MediaSegmentInfoList2(type2) {
  113852. this._type = type2;
  113853. this._list = [];
  113854. this._lastAppendLocation = -1;
  113855. }
  113856. Object.defineProperty(MediaSegmentInfoList2.prototype, "type", {
  113857. get: function() {
  113858. return this._type;
  113859. },
  113860. enumerable: false,
  113861. configurable: true
  113862. });
  113863. Object.defineProperty(MediaSegmentInfoList2.prototype, "length", {
  113864. get: function() {
  113865. return this._list.length;
  113866. },
  113867. enumerable: false,
  113868. configurable: true
  113869. });
  113870. MediaSegmentInfoList2.prototype.isEmpty = function() {
  113871. return this._list.length === 0;
  113872. };
  113873. MediaSegmentInfoList2.prototype.clear = function() {
  113874. this._list = [];
  113875. this._lastAppendLocation = -1;
  113876. };
  113877. MediaSegmentInfoList2.prototype._searchNearestSegmentBefore = function(originalBeginDts) {
  113878. var list = this._list;
  113879. if (list.length === 0) {
  113880. return -2;
  113881. }
  113882. var last = list.length - 1;
  113883. var mid = 0;
  113884. var lbound = 0;
  113885. var ubound = last;
  113886. var idx = 0;
  113887. if (originalBeginDts < list[0].originalBeginDts) {
  113888. idx = -1;
  113889. return idx;
  113890. }
  113891. while (lbound <= ubound) {
  113892. mid = lbound + Math.floor((ubound - lbound) / 2);
  113893. if (mid === last || originalBeginDts > list[mid].lastSample.originalDts && originalBeginDts < list[mid + 1].originalBeginDts) {
  113894. idx = mid;
  113895. break;
  113896. } else if (list[mid].originalBeginDts < originalBeginDts) {
  113897. lbound = mid + 1;
  113898. } else {
  113899. ubound = mid - 1;
  113900. }
  113901. }
  113902. return idx;
  113903. };
  113904. MediaSegmentInfoList2.prototype._searchNearestSegmentAfter = function(originalBeginDts) {
  113905. return this._searchNearestSegmentBefore(originalBeginDts) + 1;
  113906. };
  113907. MediaSegmentInfoList2.prototype.append = function(mediaSegmentInfo) {
  113908. var list = this._list;
  113909. var msi = mediaSegmentInfo;
  113910. var lastAppendIdx = this._lastAppendLocation;
  113911. var insertIdx = 0;
  113912. if (lastAppendIdx !== -1 && lastAppendIdx < list.length && msi.originalBeginDts >= list[lastAppendIdx].lastSample.originalDts && (lastAppendIdx === list.length - 1 || lastAppendIdx < list.length - 1 && msi.originalBeginDts < list[lastAppendIdx + 1].originalBeginDts)) {
  113913. insertIdx = lastAppendIdx + 1;
  113914. } else {
  113915. if (list.length > 0) {
  113916. insertIdx = this._searchNearestSegmentBefore(msi.originalBeginDts) + 1;
  113917. }
  113918. }
  113919. this._lastAppendLocation = insertIdx;
  113920. this._list.splice(insertIdx, 0, msi);
  113921. };
  113922. MediaSegmentInfoList2.prototype.getLastSegmentBefore = function(originalBeginDts) {
  113923. var idx = this._searchNearestSegmentBefore(originalBeginDts);
  113924. if (idx >= 0) {
  113925. return this._list[idx];
  113926. } else {
  113927. return null;
  113928. }
  113929. };
  113930. MediaSegmentInfoList2.prototype.getLastSampleBefore = function(originalBeginDts) {
  113931. var segment = this.getLastSegmentBefore(originalBeginDts);
  113932. if (segment != null) {
  113933. return segment.lastSample;
  113934. } else {
  113935. return null;
  113936. }
  113937. };
  113938. MediaSegmentInfoList2.prototype.getLastSyncPointBefore = function(originalBeginDts) {
  113939. var segmentIdx = this._searchNearestSegmentBefore(originalBeginDts);
  113940. var syncPoints = this._list[segmentIdx].syncPoints;
  113941. while (syncPoints.length === 0 && segmentIdx > 0) {
  113942. segmentIdx--;
  113943. syncPoints = this._list[segmentIdx].syncPoints;
  113944. }
  113945. if (syncPoints.length > 0) {
  113946. return syncPoints[syncPoints.length - 1];
  113947. } else {
  113948. return null;
  113949. }
  113950. };
  113951. return MediaSegmentInfoList2;
  113952. }();
  113953. },
  113954. "./src/core/mse-controller.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  113955. __webpack_require__2.r(__webpack_exports__2);
  113956. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  113957. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  113958. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/logger.js");
  113959. var _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/browser.js");
  113960. var _mse_events_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/core/mse-events.js");
  113961. var _media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/core/media-segment-info.js");
  113962. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/utils/exception.js");
  113963. var MSEController = function() {
  113964. function MSEController2(config) {
  113965. this.TAG = "MSEController";
  113966. this._config = config;
  113967. this._emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  113968. if (this._config.isLive && this._config.autoCleanupSourceBuffer == void 0) {
  113969. this._config.autoCleanupSourceBuffer = true;
  113970. }
  113971. this.e = {
  113972. onSourceOpen: this._onSourceOpen.bind(this),
  113973. onSourceEnded: this._onSourceEnded.bind(this),
  113974. onSourceClose: this._onSourceClose.bind(this),
  113975. onSourceBufferError: this._onSourceBufferError.bind(this),
  113976. onSourceBufferUpdateEnd: this._onSourceBufferUpdateEnd.bind(this)
  113977. };
  113978. this._mediaSource = null;
  113979. this._mediaSourceObjectURL = null;
  113980. this._mediaElement = null;
  113981. this._isBufferFull = false;
  113982. this._hasPendingEos = false;
  113983. this._requireSetMediaDuration = false;
  113984. this._pendingMediaDuration = 0;
  113985. this._pendingSourceBufferInit = [];
  113986. this._mimeTypes = {
  113987. video: null,
  113988. audio: null
  113989. };
  113990. this._sourceBuffers = {
  113991. video: null,
  113992. audio: null
  113993. };
  113994. this._lastInitSegments = {
  113995. video: null,
  113996. audio: null
  113997. };
  113998. this._pendingSegments = {
  113999. video: [],
  114000. audio: []
  114001. };
  114002. this._pendingRemoveRanges = {
  114003. video: [],
  114004. audio: []
  114005. };
  114006. this._idrList = new _media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.IDRSampleList();
  114007. }
  114008. MSEController2.prototype.destroy = function() {
  114009. if (this._mediaElement || this._mediaSource) {
  114010. this.detachMediaElement();
  114011. }
  114012. this.e = null;
  114013. this._emitter.removeAllListeners();
  114014. this._emitter = null;
  114015. };
  114016. MSEController2.prototype.on = function(event2, listener) {
  114017. this._emitter.addListener(event2, listener);
  114018. };
  114019. MSEController2.prototype.off = function(event2, listener) {
  114020. this._emitter.removeListener(event2, listener);
  114021. };
  114022. MSEController2.prototype.attachMediaElement = function(mediaElement) {
  114023. if (this._mediaSource) {
  114024. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__.IllegalStateException("MediaSource has been attached to an HTMLMediaElement!");
  114025. }
  114026. var ms = this._mediaSource = new window.MediaSource();
  114027. ms.addEventListener("sourceopen", this.e.onSourceOpen);
  114028. ms.addEventListener("sourceended", this.e.onSourceEnded);
  114029. ms.addEventListener("sourceclose", this.e.onSourceClose);
  114030. this._mediaElement = mediaElement;
  114031. this._mediaSourceObjectURL = window.URL.createObjectURL(this._mediaSource);
  114032. mediaElement.src = this._mediaSourceObjectURL;
  114033. };
  114034. MSEController2.prototype.detachMediaElement = function() {
  114035. if (this._mediaSource) {
  114036. var ms = this._mediaSource;
  114037. for (var type2 in this._sourceBuffers) {
  114038. var ps = this._pendingSegments[type2];
  114039. ps.splice(0, ps.length);
  114040. this._pendingSegments[type2] = null;
  114041. this._pendingRemoveRanges[type2] = null;
  114042. this._lastInitSegments[type2] = null;
  114043. var sb = this._sourceBuffers[type2];
  114044. if (sb) {
  114045. if (ms.readyState !== "closed") {
  114046. try {
  114047. ms.removeSourceBuffer(sb);
  114048. } catch (error) {
  114049. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, error.message);
  114050. }
  114051. sb.removeEventListener("error", this.e.onSourceBufferError);
  114052. sb.removeEventListener("updateend", this.e.onSourceBufferUpdateEnd);
  114053. }
  114054. this._mimeTypes[type2] = null;
  114055. this._sourceBuffers[type2] = null;
  114056. }
  114057. }
  114058. if (ms.readyState === "open") {
  114059. try {
  114060. ms.endOfStream();
  114061. } catch (error) {
  114062. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, error.message);
  114063. }
  114064. }
  114065. ms.removeEventListener("sourceopen", this.e.onSourceOpen);
  114066. ms.removeEventListener("sourceended", this.e.onSourceEnded);
  114067. ms.removeEventListener("sourceclose", this.e.onSourceClose);
  114068. this._pendingSourceBufferInit = [];
  114069. this._isBufferFull = false;
  114070. this._idrList.clear();
  114071. this._mediaSource = null;
  114072. }
  114073. if (this._mediaElement) {
  114074. this._mediaElement.src = "";
  114075. this._mediaElement.removeAttribute("src");
  114076. this._mediaElement = null;
  114077. }
  114078. if (this._mediaSourceObjectURL) {
  114079. window.URL.revokeObjectURL(this._mediaSourceObjectURL);
  114080. this._mediaSourceObjectURL = null;
  114081. }
  114082. };
  114083. MSEController2.prototype.appendInitSegment = function(initSegment, deferred) {
  114084. if (!this._mediaSource || this._mediaSource.readyState !== "open") {
  114085. this._pendingSourceBufferInit.push(initSegment);
  114086. this._pendingSegments[initSegment.type].push(initSegment);
  114087. return;
  114088. }
  114089. var is = initSegment;
  114090. var mimeType = "" + is.container;
  114091. if (is.codec && is.codec.length > 0) {
  114092. mimeType += ";codecs=" + is.codec;
  114093. }
  114094. var firstInitSegment = false;
  114095. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Received Initialization Segment, mimeType: " + mimeType);
  114096. this._lastInitSegments[is.type] = is;
  114097. if (mimeType !== this._mimeTypes[is.type]) {
  114098. if (!this._mimeTypes[is.type]) {
  114099. firstInitSegment = true;
  114100. try {
  114101. var sb = this._sourceBuffers[is.type] = this._mediaSource.addSourceBuffer(mimeType);
  114102. sb.addEventListener("error", this.e.onSourceBufferError);
  114103. sb.addEventListener("updateend", this.e.onSourceBufferUpdateEnd);
  114104. } catch (error) {
  114105. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, error.message);
  114106. this._emitter.emit(_mse_events_js__WEBPACK_IMPORTED_MODULE_3__.default.ERROR, { code: error.code, msg: error.message });
  114107. return;
  114108. }
  114109. } else {
  114110. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Notice: " + is.type + " mimeType changed, origin: " + this._mimeTypes[is.type] + ", target: " + mimeType);
  114111. }
  114112. this._mimeTypes[is.type] = mimeType;
  114113. }
  114114. if (!deferred) {
  114115. this._pendingSegments[is.type].push(is);
  114116. }
  114117. if (!firstInitSegment) {
  114118. if (this._sourceBuffers[is.type] && !this._sourceBuffers[is.type].updating) {
  114119. this._doAppendSegments();
  114120. }
  114121. }
  114122. if (_utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari && is.container === "audio/mpeg" && is.mediaDuration > 0) {
  114123. this._requireSetMediaDuration = true;
  114124. this._pendingMediaDuration = is.mediaDuration / 1e3;
  114125. this._updateMediaSourceDuration();
  114126. }
  114127. };
  114128. MSEController2.prototype.appendMediaSegment = function(mediaSegment) {
  114129. var ms = mediaSegment;
  114130. this._pendingSegments[ms.type].push(ms);
  114131. if (this._config.autoCleanupSourceBuffer && this._needCleanupSourceBuffer()) {
  114132. this._doCleanupSourceBuffer();
  114133. }
  114134. var sb = this._sourceBuffers[ms.type];
  114135. if (sb && !sb.updating && !this._hasPendingRemoveRanges()) {
  114136. this._doAppendSegments();
  114137. }
  114138. };
  114139. MSEController2.prototype.seek = function(seconds) {
  114140. for (var type2 in this._sourceBuffers) {
  114141. if (!this._sourceBuffers[type2]) {
  114142. continue;
  114143. }
  114144. var sb = this._sourceBuffers[type2];
  114145. if (this._mediaSource.readyState === "open") {
  114146. try {
  114147. sb.abort();
  114148. } catch (error) {
  114149. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, error.message);
  114150. }
  114151. }
  114152. this._idrList.clear();
  114153. var ps = this._pendingSegments[type2];
  114154. ps.splice(0, ps.length);
  114155. if (this._mediaSource.readyState === "closed") {
  114156. continue;
  114157. }
  114158. for (var i2 = 0; i2 < sb.buffered.length; i2++) {
  114159. var start2 = sb.buffered.start(i2);
  114160. var end = sb.buffered.end(i2);
  114161. this._pendingRemoveRanges[type2].push({ start: start2, end });
  114162. }
  114163. if (!sb.updating) {
  114164. this._doRemoveRanges();
  114165. }
  114166. if (_utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari) {
  114167. var lastInitSegment = this._lastInitSegments[type2];
  114168. if (lastInitSegment) {
  114169. this._pendingSegments[type2].push(lastInitSegment);
  114170. if (!sb.updating) {
  114171. this._doAppendSegments();
  114172. }
  114173. }
  114174. }
  114175. }
  114176. };
  114177. MSEController2.prototype.endOfStream = function() {
  114178. var ms = this._mediaSource;
  114179. var sb = this._sourceBuffers;
  114180. if (!ms || ms.readyState !== "open") {
  114181. if (ms && ms.readyState === "closed" && this._hasPendingSegments()) {
  114182. this._hasPendingEos = true;
  114183. }
  114184. return;
  114185. }
  114186. if (sb.video && sb.video.updating || sb.audio && sb.audio.updating) {
  114187. this._hasPendingEos = true;
  114188. } else {
  114189. this._hasPendingEos = false;
  114190. ms.endOfStream();
  114191. }
  114192. };
  114193. MSEController2.prototype.getNearestKeyframe = function(dts) {
  114194. return this._idrList.getLastSyncPointBeforeDts(dts);
  114195. };
  114196. MSEController2.prototype._needCleanupSourceBuffer = function() {
  114197. if (!this._config.autoCleanupSourceBuffer) {
  114198. return false;
  114199. }
  114200. var currentTime = this._mediaElement.currentTime;
  114201. for (var type2 in this._sourceBuffers) {
  114202. var sb = this._sourceBuffers[type2];
  114203. if (sb) {
  114204. var buffered = sb.buffered;
  114205. if (buffered.length >= 1) {
  114206. if (currentTime - buffered.start(0) >= this._config.autoCleanupMaxBackwardDuration) {
  114207. return true;
  114208. }
  114209. }
  114210. }
  114211. }
  114212. return false;
  114213. };
  114214. MSEController2.prototype._doCleanupSourceBuffer = function() {
  114215. var currentTime = this._mediaElement.currentTime;
  114216. for (var type2 in this._sourceBuffers) {
  114217. var sb = this._sourceBuffers[type2];
  114218. if (sb) {
  114219. var buffered = sb.buffered;
  114220. var doRemove = false;
  114221. for (var i2 = 0; i2 < buffered.length; i2++) {
  114222. var start2 = buffered.start(i2);
  114223. var end = buffered.end(i2);
  114224. if (start2 <= currentTime && currentTime < end + 3) {
  114225. if (currentTime - start2 >= this._config.autoCleanupMaxBackwardDuration) {
  114226. doRemove = true;
  114227. var removeEnd = currentTime - this._config.autoCleanupMinBackwardDuration;
  114228. this._pendingRemoveRanges[type2].push({ start: start2, end: removeEnd });
  114229. }
  114230. } else if (end < currentTime) {
  114231. doRemove = true;
  114232. this._pendingRemoveRanges[type2].push({ start: start2, end });
  114233. }
  114234. }
  114235. if (doRemove && !sb.updating) {
  114236. this._doRemoveRanges();
  114237. }
  114238. }
  114239. }
  114240. };
  114241. MSEController2.prototype._updateMediaSourceDuration = function() {
  114242. var sb = this._sourceBuffers;
  114243. if (this._mediaElement.readyState === 0 || this._mediaSource.readyState !== "open") {
  114244. return;
  114245. }
  114246. if (sb.video && sb.video.updating || sb.audio && sb.audio.updating) {
  114247. return;
  114248. }
  114249. var current = this._mediaSource.duration;
  114250. var target = this._pendingMediaDuration;
  114251. if (target > 0 && (isNaN(current) || target > current)) {
  114252. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Update MediaSource duration from " + current + " to " + target);
  114253. this._mediaSource.duration = target;
  114254. }
  114255. this._requireSetMediaDuration = false;
  114256. this._pendingMediaDuration = 0;
  114257. };
  114258. MSEController2.prototype._doRemoveRanges = function() {
  114259. for (var type2 in this._pendingRemoveRanges) {
  114260. if (!this._sourceBuffers[type2] || this._sourceBuffers[type2].updating) {
  114261. continue;
  114262. }
  114263. var sb = this._sourceBuffers[type2];
  114264. var ranges = this._pendingRemoveRanges[type2];
  114265. while (ranges.length && !sb.updating) {
  114266. var range3 = ranges.shift();
  114267. sb.remove(range3.start, range3.end);
  114268. }
  114269. }
  114270. };
  114271. MSEController2.prototype._doAppendSegments = function() {
  114272. var pendingSegments = this._pendingSegments;
  114273. for (var type2 in pendingSegments) {
  114274. if (!this._sourceBuffers[type2] || this._sourceBuffers[type2].updating) {
  114275. continue;
  114276. }
  114277. if (pendingSegments[type2].length > 0) {
  114278. var segment = pendingSegments[type2].shift();
  114279. if (segment.timestampOffset) {
  114280. var currentOffset = this._sourceBuffers[type2].timestampOffset;
  114281. var targetOffset = segment.timestampOffset / 1e3;
  114282. var delta = Math.abs(currentOffset - targetOffset);
  114283. if (delta > 0.1) {
  114284. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Update MPEG audio timestampOffset from " + currentOffset + " to " + targetOffset);
  114285. this._sourceBuffers[type2].timestampOffset = targetOffset;
  114286. }
  114287. delete segment.timestampOffset;
  114288. }
  114289. if (!segment.data || segment.data.byteLength === 0) {
  114290. continue;
  114291. }
  114292. try {
  114293. this._sourceBuffers[type2].appendBuffer(segment.data);
  114294. this._isBufferFull = false;
  114295. if (type2 === "video" && segment.hasOwnProperty("info")) {
  114296. this._idrList.appendArray(segment.info.syncPoints);
  114297. }
  114298. } catch (error) {
  114299. this._pendingSegments[type2].unshift(segment);
  114300. if (error.code === 22) {
  114301. if (!this._isBufferFull) {
  114302. this._emitter.emit(_mse_events_js__WEBPACK_IMPORTED_MODULE_3__.default.BUFFER_FULL);
  114303. }
  114304. this._isBufferFull = true;
  114305. } else {
  114306. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, error.message);
  114307. this._emitter.emit(_mse_events_js__WEBPACK_IMPORTED_MODULE_3__.default.ERROR, { code: error.code, msg: error.message });
  114308. }
  114309. }
  114310. }
  114311. }
  114312. };
  114313. MSEController2.prototype._onSourceOpen = function() {
  114314. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "MediaSource onSourceOpen");
  114315. this._mediaSource.removeEventListener("sourceopen", this.e.onSourceOpen);
  114316. if (this._pendingSourceBufferInit.length > 0) {
  114317. var pendings = this._pendingSourceBufferInit;
  114318. while (pendings.length) {
  114319. var segment = pendings.shift();
  114320. this.appendInitSegment(segment, true);
  114321. }
  114322. }
  114323. if (this._hasPendingSegments()) {
  114324. this._doAppendSegments();
  114325. }
  114326. this._emitter.emit(_mse_events_js__WEBPACK_IMPORTED_MODULE_3__.default.SOURCE_OPEN);
  114327. };
  114328. MSEController2.prototype._onSourceEnded = function() {
  114329. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "MediaSource onSourceEnded");
  114330. };
  114331. MSEController2.prototype._onSourceClose = function() {
  114332. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "MediaSource onSourceClose");
  114333. if (this._mediaSource && this.e != null) {
  114334. this._mediaSource.removeEventListener("sourceopen", this.e.onSourceOpen);
  114335. this._mediaSource.removeEventListener("sourceended", this.e.onSourceEnded);
  114336. this._mediaSource.removeEventListener("sourceclose", this.e.onSourceClose);
  114337. }
  114338. };
  114339. MSEController2.prototype._hasPendingSegments = function() {
  114340. var ps = this._pendingSegments;
  114341. return ps.video.length > 0 || ps.audio.length > 0;
  114342. };
  114343. MSEController2.prototype._hasPendingRemoveRanges = function() {
  114344. var prr = this._pendingRemoveRanges;
  114345. return prr.video.length > 0 || prr.audio.length > 0;
  114346. };
  114347. MSEController2.prototype._onSourceBufferUpdateEnd = function() {
  114348. if (this._requireSetMediaDuration) {
  114349. this._updateMediaSourceDuration();
  114350. } else if (this._hasPendingRemoveRanges()) {
  114351. this._doRemoveRanges();
  114352. } else if (this._hasPendingSegments()) {
  114353. this._doAppendSegments();
  114354. } else if (this._hasPendingEos) {
  114355. this.endOfStream();
  114356. }
  114357. this._emitter.emit(_mse_events_js__WEBPACK_IMPORTED_MODULE_3__.default.UPDATE_END);
  114358. };
  114359. MSEController2.prototype._onSourceBufferError = function(e) {
  114360. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, "SourceBuffer Error: " + e);
  114361. };
  114362. return MSEController2;
  114363. }();
  114364. __webpack_exports__2["default"] = MSEController;
  114365. },
  114366. "./src/core/mse-events.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  114367. __webpack_require__2.r(__webpack_exports__2);
  114368. var MSEEvents = {
  114369. ERROR: "error",
  114370. SOURCE_OPEN: "source_open",
  114371. UPDATE_END: "update_end",
  114372. BUFFER_FULL: "buffer_full"
  114373. };
  114374. __webpack_exports__2["default"] = MSEEvents;
  114375. },
  114376. "./src/core/transmuxer.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  114377. __webpack_require__2.r(__webpack_exports__2);
  114378. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  114379. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  114380. var webworkify_webpack__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./node_modules/webworkify-webpack/index.js");
  114381. var webworkify_webpack__WEBPACK_IMPORTED_MODULE_1___default = /* @__PURE__ */ __webpack_require__2.n(webworkify_webpack__WEBPACK_IMPORTED_MODULE_1__);
  114382. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/logger.js");
  114383. var _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/utils/logging-control.js");
  114384. var _transmuxing_controller_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/core/transmuxing-controller.js");
  114385. var _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/core/transmuxing-events.js");
  114386. var _media_info_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__2("./src/core/media-info.js");
  114387. var Transmuxer = function() {
  114388. function Transmuxer2(mediaDataSource, config) {
  114389. this.TAG = "Transmuxer";
  114390. this._emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  114391. if (config.enableWorker && typeof Worker !== "undefined") {
  114392. try {
  114393. this._worker = webworkify_webpack__WEBPACK_IMPORTED_MODULE_1___default()("./src/core/transmuxing-worker.js");
  114394. this._workerDestroying = false;
  114395. this._worker.addEventListener("message", this._onWorkerMessage.bind(this));
  114396. this._worker.postMessage({ cmd: "init", param: [mediaDataSource, config] });
  114397. this.e = {
  114398. onLoggingConfigChanged: this._onLoggingConfigChanged.bind(this)
  114399. };
  114400. _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_3__.default.registerListener(this.e.onLoggingConfigChanged);
  114401. this._worker.postMessage({ cmd: "logging_config", param: _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_3__.default.getConfig() });
  114402. } catch (error) {
  114403. _utils_logger_js__WEBPACK_IMPORTED_MODULE_2__.default.e(this.TAG, "Error while initialize transmuxing worker, fallback to inline transmuxing");
  114404. this._worker = null;
  114405. this._controller = new _transmuxing_controller_js__WEBPACK_IMPORTED_MODULE_4__.default(mediaDataSource, config);
  114406. }
  114407. } else {
  114408. this._controller = new _transmuxing_controller_js__WEBPACK_IMPORTED_MODULE_4__.default(mediaDataSource, config);
  114409. }
  114410. if (this._controller) {
  114411. var ctl = this._controller;
  114412. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.IO_ERROR, this._onIOError.bind(this));
  114413. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.DEMUX_ERROR, this._onDemuxError.bind(this));
  114414. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.INIT_SEGMENT, this._onInitSegment.bind(this));
  114415. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_SEGMENT, this._onMediaSegment.bind(this));
  114416. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.LOADING_COMPLETE, this._onLoadingComplete.bind(this));
  114417. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOVERED_EARLY_EOF, this._onRecoveredEarlyEof.bind(this));
  114418. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_INFO, this._onMediaInfo.bind(this));
  114419. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.METADATA_ARRIVED, this._onMetaDataArrived.bind(this));
  114420. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.SCRIPTDATA_ARRIVED, this._onScriptDataArrived.bind(this));
  114421. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.STATISTICS_INFO, this._onStatisticsInfo.bind(this));
  114422. ctl.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOMMEND_SEEKPOINT, this._onRecommendSeekpoint.bind(this));
  114423. }
  114424. }
  114425. Transmuxer2.prototype.destroy = function() {
  114426. if (this._worker) {
  114427. if (!this._workerDestroying) {
  114428. this._workerDestroying = true;
  114429. this._worker.postMessage({ cmd: "destroy" });
  114430. _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_3__.default.removeListener(this.e.onLoggingConfigChanged);
  114431. this.e = null;
  114432. }
  114433. } else {
  114434. this._controller.destroy();
  114435. this._controller = null;
  114436. }
  114437. this._emitter.removeAllListeners();
  114438. this._emitter = null;
  114439. };
  114440. Transmuxer2.prototype.on = function(event2, listener) {
  114441. this._emitter.addListener(event2, listener);
  114442. };
  114443. Transmuxer2.prototype.off = function(event2, listener) {
  114444. this._emitter.removeListener(event2, listener);
  114445. };
  114446. Transmuxer2.prototype.hasWorker = function() {
  114447. return this._worker != null;
  114448. };
  114449. Transmuxer2.prototype.open = function() {
  114450. if (this._worker) {
  114451. this._worker.postMessage({ cmd: "start" });
  114452. } else {
  114453. this._controller.start();
  114454. }
  114455. };
  114456. Transmuxer2.prototype.close = function() {
  114457. if (this._worker) {
  114458. this._worker.postMessage({ cmd: "stop" });
  114459. } else {
  114460. this._controller.stop();
  114461. }
  114462. };
  114463. Transmuxer2.prototype.seek = function(milliseconds) {
  114464. if (this._worker) {
  114465. this._worker.postMessage({ cmd: "seek", param: milliseconds });
  114466. } else {
  114467. this._controller.seek(milliseconds);
  114468. }
  114469. };
  114470. Transmuxer2.prototype.pause = function() {
  114471. if (this._worker) {
  114472. this._worker.postMessage({ cmd: "pause" });
  114473. } else {
  114474. this._controller.pause();
  114475. }
  114476. };
  114477. Transmuxer2.prototype.resume = function() {
  114478. if (this._worker) {
  114479. this._worker.postMessage({ cmd: "resume" });
  114480. } else {
  114481. this._controller.resume();
  114482. }
  114483. };
  114484. Transmuxer2.prototype._onInitSegment = function(type2, initSegment) {
  114485. var _this = this;
  114486. Promise.resolve().then(function() {
  114487. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.INIT_SEGMENT, type2, initSegment);
  114488. });
  114489. };
  114490. Transmuxer2.prototype._onMediaSegment = function(type2, mediaSegment) {
  114491. var _this = this;
  114492. Promise.resolve().then(function() {
  114493. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_SEGMENT, type2, mediaSegment);
  114494. });
  114495. };
  114496. Transmuxer2.prototype._onLoadingComplete = function() {
  114497. var _this = this;
  114498. Promise.resolve().then(function() {
  114499. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.LOADING_COMPLETE);
  114500. });
  114501. };
  114502. Transmuxer2.prototype._onRecoveredEarlyEof = function() {
  114503. var _this = this;
  114504. Promise.resolve().then(function() {
  114505. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOVERED_EARLY_EOF);
  114506. });
  114507. };
  114508. Transmuxer2.prototype._onMediaInfo = function(mediaInfo) {
  114509. var _this = this;
  114510. Promise.resolve().then(function() {
  114511. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_INFO, mediaInfo);
  114512. });
  114513. };
  114514. Transmuxer2.prototype._onMetaDataArrived = function(metadata) {
  114515. var _this = this;
  114516. Promise.resolve().then(function() {
  114517. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.METADATA_ARRIVED, metadata);
  114518. });
  114519. };
  114520. Transmuxer2.prototype._onScriptDataArrived = function(data) {
  114521. var _this = this;
  114522. Promise.resolve().then(function() {
  114523. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.SCRIPTDATA_ARRIVED, data);
  114524. });
  114525. };
  114526. Transmuxer2.prototype._onStatisticsInfo = function(statisticsInfo) {
  114527. var _this = this;
  114528. Promise.resolve().then(function() {
  114529. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.STATISTICS_INFO, statisticsInfo);
  114530. });
  114531. };
  114532. Transmuxer2.prototype._onIOError = function(type2, info) {
  114533. var _this = this;
  114534. Promise.resolve().then(function() {
  114535. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.IO_ERROR, type2, info);
  114536. });
  114537. };
  114538. Transmuxer2.prototype._onDemuxError = function(type2, info) {
  114539. var _this = this;
  114540. Promise.resolve().then(function() {
  114541. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.DEMUX_ERROR, type2, info);
  114542. });
  114543. };
  114544. Transmuxer2.prototype._onRecommendSeekpoint = function(milliseconds) {
  114545. var _this = this;
  114546. Promise.resolve().then(function() {
  114547. _this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOMMEND_SEEKPOINT, milliseconds);
  114548. });
  114549. };
  114550. Transmuxer2.prototype._onLoggingConfigChanged = function(config) {
  114551. if (this._worker) {
  114552. this._worker.postMessage({ cmd: "logging_config", param: config });
  114553. }
  114554. };
  114555. Transmuxer2.prototype._onWorkerMessage = function(e) {
  114556. var message = e.data;
  114557. var data = message.data;
  114558. if (message.msg === "destroyed" || this._workerDestroying) {
  114559. this._workerDestroying = false;
  114560. this._worker.terminate();
  114561. this._worker = null;
  114562. return;
  114563. }
  114564. switch (message.msg) {
  114565. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.INIT_SEGMENT:
  114566. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_SEGMENT:
  114567. this._emitter.emit(message.msg, data.type, data.data);
  114568. break;
  114569. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.LOADING_COMPLETE:
  114570. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOVERED_EARLY_EOF:
  114571. this._emitter.emit(message.msg);
  114572. break;
  114573. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_INFO:
  114574. Object.setPrototypeOf(data, _media_info_js__WEBPACK_IMPORTED_MODULE_6__.default.prototype);
  114575. this._emitter.emit(message.msg, data);
  114576. break;
  114577. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.METADATA_ARRIVED:
  114578. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.SCRIPTDATA_ARRIVED:
  114579. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.STATISTICS_INFO:
  114580. this._emitter.emit(message.msg, data);
  114581. break;
  114582. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.IO_ERROR:
  114583. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.DEMUX_ERROR:
  114584. this._emitter.emit(message.msg, data.type, data.info);
  114585. break;
  114586. case _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOMMEND_SEEKPOINT:
  114587. this._emitter.emit(message.msg, data);
  114588. break;
  114589. case "logcat_callback":
  114590. _utils_logger_js__WEBPACK_IMPORTED_MODULE_2__.default.emitter.emit("log", data.type, data.logcat);
  114591. break;
  114592. }
  114593. };
  114594. return Transmuxer2;
  114595. }();
  114596. __webpack_exports__2["default"] = Transmuxer;
  114597. },
  114598. "./src/core/transmuxing-controller.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  114599. __webpack_require__2.r(__webpack_exports__2);
  114600. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  114601. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  114602. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/logger.js");
  114603. var _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/browser.js");
  114604. var _media_info_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/core/media-info.js");
  114605. var _demux_flv_demuxer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/demux/flv-demuxer.js");
  114606. var _remux_mp4_remuxer_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/remux/mp4-remuxer.js");
  114607. var _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__2("./src/demux/demux-errors.js");
  114608. var _io_io_controller_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__2("./src/io/io-controller.js");
  114609. var _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__2("./src/core/transmuxing-events.js");
  114610. var TransmuxingController = function() {
  114611. function TransmuxingController2(mediaDataSource, config) {
  114612. this.TAG = "TransmuxingController";
  114613. this._emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  114614. this._config = config;
  114615. if (!mediaDataSource.segments) {
  114616. mediaDataSource.segments = [{
  114617. duration: mediaDataSource.duration,
  114618. filesize: mediaDataSource.filesize,
  114619. url: mediaDataSource.url
  114620. }];
  114621. }
  114622. if (typeof mediaDataSource.cors !== "boolean") {
  114623. mediaDataSource.cors = true;
  114624. }
  114625. if (typeof mediaDataSource.withCredentials !== "boolean") {
  114626. mediaDataSource.withCredentials = false;
  114627. }
  114628. this._mediaDataSource = mediaDataSource;
  114629. this._currentSegmentIndex = 0;
  114630. var totalDuration = 0;
  114631. this._mediaDataSource.segments.forEach(function(segment) {
  114632. segment.timestampBase = totalDuration;
  114633. totalDuration += segment.duration;
  114634. segment.cors = mediaDataSource.cors;
  114635. segment.withCredentials = mediaDataSource.withCredentials;
  114636. if (config.referrerPolicy) {
  114637. segment.referrerPolicy = config.referrerPolicy;
  114638. }
  114639. });
  114640. if (!isNaN(totalDuration) && this._mediaDataSource.duration !== totalDuration) {
  114641. this._mediaDataSource.duration = totalDuration;
  114642. }
  114643. this._mediaInfo = null;
  114644. this._demuxer = null;
  114645. this._remuxer = null;
  114646. this._ioctl = null;
  114647. this._pendingSeekTime = null;
  114648. this._pendingResolveSeekPoint = null;
  114649. this._statisticsReporter = null;
  114650. }
  114651. TransmuxingController2.prototype.destroy = function() {
  114652. this._mediaInfo = null;
  114653. this._mediaDataSource = null;
  114654. if (this._statisticsReporter) {
  114655. this._disableStatisticsReporter();
  114656. }
  114657. if (this._ioctl) {
  114658. this._ioctl.destroy();
  114659. this._ioctl = null;
  114660. }
  114661. if (this._demuxer) {
  114662. this._demuxer.destroy();
  114663. this._demuxer = null;
  114664. }
  114665. if (this._remuxer) {
  114666. this._remuxer.destroy();
  114667. this._remuxer = null;
  114668. }
  114669. this._emitter.removeAllListeners();
  114670. this._emitter = null;
  114671. };
  114672. TransmuxingController2.prototype.on = function(event2, listener) {
  114673. this._emitter.addListener(event2, listener);
  114674. };
  114675. TransmuxingController2.prototype.off = function(event2, listener) {
  114676. this._emitter.removeListener(event2, listener);
  114677. };
  114678. TransmuxingController2.prototype.start = function() {
  114679. this._loadSegment(0);
  114680. this._enableStatisticsReporter();
  114681. };
  114682. TransmuxingController2.prototype._loadSegment = function(segmentIndex, optionalFrom) {
  114683. this._currentSegmentIndex = segmentIndex;
  114684. var dataSource = this._mediaDataSource.segments[segmentIndex];
  114685. var ioctl = this._ioctl = new _io_io_controller_js__WEBPACK_IMPORTED_MODULE_7__.default(dataSource, this._config, segmentIndex);
  114686. ioctl.onError = this._onIOException.bind(this);
  114687. ioctl.onSeeked = this._onIOSeeked.bind(this);
  114688. ioctl.onComplete = this._onIOComplete.bind(this);
  114689. ioctl.onRedirect = this._onIORedirect.bind(this);
  114690. ioctl.onRecoveredEarlyEof = this._onIORecoveredEarlyEof.bind(this);
  114691. if (optionalFrom) {
  114692. this._demuxer.bindDataSource(this._ioctl);
  114693. } else {
  114694. ioctl.onDataArrival = this._onInitChunkArrival.bind(this);
  114695. }
  114696. ioctl.open(optionalFrom);
  114697. };
  114698. TransmuxingController2.prototype.stop = function() {
  114699. this._internalAbort();
  114700. this._disableStatisticsReporter();
  114701. };
  114702. TransmuxingController2.prototype._internalAbort = function() {
  114703. if (this._ioctl) {
  114704. this._ioctl.destroy();
  114705. this._ioctl = null;
  114706. }
  114707. };
  114708. TransmuxingController2.prototype.pause = function() {
  114709. if (this._ioctl && this._ioctl.isWorking()) {
  114710. this._ioctl.pause();
  114711. this._disableStatisticsReporter();
  114712. }
  114713. };
  114714. TransmuxingController2.prototype.resume = function() {
  114715. if (this._ioctl && this._ioctl.isPaused()) {
  114716. this._ioctl.resume();
  114717. this._enableStatisticsReporter();
  114718. }
  114719. };
  114720. TransmuxingController2.prototype.seek = function(milliseconds) {
  114721. if (this._mediaInfo == null || !this._mediaInfo.isSeekable()) {
  114722. return;
  114723. }
  114724. var targetSegmentIndex = this._searchSegmentIndexContains(milliseconds);
  114725. if (targetSegmentIndex === this._currentSegmentIndex) {
  114726. var segmentInfo = this._mediaInfo.segments[targetSegmentIndex];
  114727. if (segmentInfo == void 0) {
  114728. this._pendingSeekTime = milliseconds;
  114729. } else {
  114730. var keyframe = segmentInfo.getNearestKeyframe(milliseconds);
  114731. this._remuxer.seek(keyframe.milliseconds);
  114732. this._ioctl.seek(keyframe.fileposition);
  114733. this._pendingResolveSeekPoint = keyframe.milliseconds;
  114734. }
  114735. } else {
  114736. var targetSegmentInfo = this._mediaInfo.segments[targetSegmentIndex];
  114737. if (targetSegmentInfo == void 0) {
  114738. this._pendingSeekTime = milliseconds;
  114739. this._internalAbort();
  114740. this._remuxer.seek();
  114741. this._remuxer.insertDiscontinuity();
  114742. this._loadSegment(targetSegmentIndex);
  114743. } else {
  114744. var keyframe = targetSegmentInfo.getNearestKeyframe(milliseconds);
  114745. this._internalAbort();
  114746. this._remuxer.seek(milliseconds);
  114747. this._remuxer.insertDiscontinuity();
  114748. this._demuxer.resetMediaInfo();
  114749. this._demuxer.timestampBase = this._mediaDataSource.segments[targetSegmentIndex].timestampBase;
  114750. this._loadSegment(targetSegmentIndex, keyframe.fileposition);
  114751. this._pendingResolveSeekPoint = keyframe.milliseconds;
  114752. this._reportSegmentMediaInfo(targetSegmentIndex);
  114753. }
  114754. }
  114755. this._enableStatisticsReporter();
  114756. };
  114757. TransmuxingController2.prototype._searchSegmentIndexContains = function(milliseconds) {
  114758. var segments = this._mediaDataSource.segments;
  114759. var idx = segments.length - 1;
  114760. for (var i2 = 0; i2 < segments.length; i2++) {
  114761. if (milliseconds < segments[i2].timestampBase) {
  114762. idx = i2 - 1;
  114763. break;
  114764. }
  114765. }
  114766. return idx;
  114767. };
  114768. TransmuxingController2.prototype._onInitChunkArrival = function(data, byteStart) {
  114769. var _this = this;
  114770. var probeData = null;
  114771. var consumed = 0;
  114772. if (byteStart > 0) {
  114773. this._demuxer.bindDataSource(this._ioctl);
  114774. this._demuxer.timestampBase = this._mediaDataSource.segments[this._currentSegmentIndex].timestampBase;
  114775. consumed = this._demuxer.parseChunks(data, byteStart);
  114776. } else if ((probeData = _demux_flv_demuxer_js__WEBPACK_IMPORTED_MODULE_4__.default.probe(data)).match) {
  114777. this._demuxer = new _demux_flv_demuxer_js__WEBPACK_IMPORTED_MODULE_4__.default(probeData, this._config);
  114778. if (!this._remuxer) {
  114779. this._remuxer = new _remux_mp4_remuxer_js__WEBPACK_IMPORTED_MODULE_5__.default(this._config);
  114780. }
  114781. var mds = this._mediaDataSource;
  114782. if (mds.duration != void 0 && !isNaN(mds.duration)) {
  114783. this._demuxer.overridedDuration = mds.duration;
  114784. }
  114785. if (typeof mds.hasAudio === "boolean") {
  114786. this._demuxer.overridedHasAudio = mds.hasAudio;
  114787. }
  114788. if (typeof mds.hasVideo === "boolean") {
  114789. this._demuxer.overridedHasVideo = mds.hasVideo;
  114790. }
  114791. this._demuxer.timestampBase = mds.segments[this._currentSegmentIndex].timestampBase;
  114792. this._demuxer.onError = this._onDemuxException.bind(this);
  114793. this._demuxer.onMediaInfo = this._onMediaInfo.bind(this);
  114794. this._demuxer.onMetaDataArrived = this._onMetaDataArrived.bind(this);
  114795. this._demuxer.onScriptDataArrived = this._onScriptDataArrived.bind(this);
  114796. this._remuxer.bindDataSource(this._demuxer.bindDataSource(this._ioctl));
  114797. this._remuxer.onInitSegment = this._onRemuxerInitSegmentArrival.bind(this);
  114798. this._remuxer.onMediaSegment = this._onRemuxerMediaSegmentArrival.bind(this);
  114799. consumed = this._demuxer.parseChunks(data, byteStart);
  114800. } else {
  114801. probeData = null;
  114802. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, "Non-FLV, Unsupported media type!");
  114803. Promise.resolve().then(function() {
  114804. _this._internalAbort();
  114805. });
  114806. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.DEMUX_ERROR, _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_6__.default.FORMAT_UNSUPPORTED, "Non-FLV, Unsupported media type");
  114807. consumed = 0;
  114808. }
  114809. return consumed;
  114810. };
  114811. TransmuxingController2.prototype._onMediaInfo = function(mediaInfo) {
  114812. var _this = this;
  114813. if (this._mediaInfo == null) {
  114814. this._mediaInfo = Object.assign({}, mediaInfo);
  114815. this._mediaInfo.keyframesIndex = null;
  114816. this._mediaInfo.segments = [];
  114817. this._mediaInfo.segmentCount = this._mediaDataSource.segments.length;
  114818. Object.setPrototypeOf(this._mediaInfo, _media_info_js__WEBPACK_IMPORTED_MODULE_3__.default.prototype);
  114819. }
  114820. var segmentInfo = Object.assign({}, mediaInfo);
  114821. Object.setPrototypeOf(segmentInfo, _media_info_js__WEBPACK_IMPORTED_MODULE_3__.default.prototype);
  114822. this._mediaInfo.segments[this._currentSegmentIndex] = segmentInfo;
  114823. this._reportSegmentMediaInfo(this._currentSegmentIndex);
  114824. if (this._pendingSeekTime != null) {
  114825. Promise.resolve().then(function() {
  114826. var target = _this._pendingSeekTime;
  114827. _this._pendingSeekTime = null;
  114828. _this.seek(target);
  114829. });
  114830. }
  114831. };
  114832. TransmuxingController2.prototype._onMetaDataArrived = function(metadata) {
  114833. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.METADATA_ARRIVED, metadata);
  114834. };
  114835. TransmuxingController2.prototype._onScriptDataArrived = function(data) {
  114836. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.SCRIPTDATA_ARRIVED, data);
  114837. };
  114838. TransmuxingController2.prototype._onIOSeeked = function() {
  114839. this._remuxer.insertDiscontinuity();
  114840. };
  114841. TransmuxingController2.prototype._onIOComplete = function(extraData) {
  114842. var segmentIndex = extraData;
  114843. var nextSegmentIndex = segmentIndex + 1;
  114844. if (nextSegmentIndex < this._mediaDataSource.segments.length) {
  114845. this._internalAbort();
  114846. this._remuxer.flushStashedSamples();
  114847. this._loadSegment(nextSegmentIndex);
  114848. } else {
  114849. this._remuxer.flushStashedSamples();
  114850. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.LOADING_COMPLETE);
  114851. this._disableStatisticsReporter();
  114852. }
  114853. };
  114854. TransmuxingController2.prototype._onIORedirect = function(redirectedURL) {
  114855. var segmentIndex = this._ioctl.extraData;
  114856. this._mediaDataSource.segments[segmentIndex].redirectedURL = redirectedURL;
  114857. };
  114858. TransmuxingController2.prototype._onIORecoveredEarlyEof = function() {
  114859. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.RECOVERED_EARLY_EOF);
  114860. };
  114861. TransmuxingController2.prototype._onIOException = function(type2, info) {
  114862. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, "IOException: type = " + type2 + ", code = " + info.code + ", msg = " + info.msg);
  114863. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.IO_ERROR, type2, info);
  114864. this._disableStatisticsReporter();
  114865. };
  114866. TransmuxingController2.prototype._onDemuxException = function(type2, info) {
  114867. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.e(this.TAG, "DemuxException: type = " + type2 + ", info = " + info);
  114868. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.DEMUX_ERROR, type2, info);
  114869. };
  114870. TransmuxingController2.prototype._onRemuxerInitSegmentArrival = function(type2, initSegment) {
  114871. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.INIT_SEGMENT, type2, initSegment);
  114872. };
  114873. TransmuxingController2.prototype._onRemuxerMediaSegmentArrival = function(type2, mediaSegment) {
  114874. if (this._pendingSeekTime != null) {
  114875. return;
  114876. }
  114877. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.MEDIA_SEGMENT, type2, mediaSegment);
  114878. if (this._pendingResolveSeekPoint != null && type2 === "video") {
  114879. var syncPoints = mediaSegment.info.syncPoints;
  114880. var seekpoint = this._pendingResolveSeekPoint;
  114881. this._pendingResolveSeekPoint = null;
  114882. if (_utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari && syncPoints.length > 0 && syncPoints[0].originalDts === seekpoint) {
  114883. seekpoint = syncPoints[0].pts;
  114884. }
  114885. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.RECOMMEND_SEEKPOINT, seekpoint);
  114886. }
  114887. };
  114888. TransmuxingController2.prototype._enableStatisticsReporter = function() {
  114889. if (this._statisticsReporter == null) {
  114890. this._statisticsReporter = self.setInterval(this._reportStatisticsInfo.bind(this), this._config.statisticsInfoReportInterval);
  114891. }
  114892. };
  114893. TransmuxingController2.prototype._disableStatisticsReporter = function() {
  114894. if (this._statisticsReporter) {
  114895. self.clearInterval(this._statisticsReporter);
  114896. this._statisticsReporter = null;
  114897. }
  114898. };
  114899. TransmuxingController2.prototype._reportSegmentMediaInfo = function(segmentIndex) {
  114900. var segmentInfo = this._mediaInfo.segments[segmentIndex];
  114901. var exportInfo = Object.assign({}, segmentInfo);
  114902. exportInfo.duration = this._mediaInfo.duration;
  114903. exportInfo.segmentCount = this._mediaInfo.segmentCount;
  114904. delete exportInfo.segments;
  114905. delete exportInfo.keyframesIndex;
  114906. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.MEDIA_INFO, exportInfo);
  114907. };
  114908. TransmuxingController2.prototype._reportStatisticsInfo = function() {
  114909. var info = {};
  114910. info.url = this._ioctl.currentURL;
  114911. info.hasRedirect = this._ioctl.hasRedirect;
  114912. if (info.hasRedirect) {
  114913. info.redirectedURL = this._ioctl.currentRedirectedURL;
  114914. }
  114915. info.speed = this._ioctl.currentSpeed;
  114916. info.loaderType = this._ioctl.loaderType;
  114917. info.currentSegmentIndex = this._currentSegmentIndex;
  114918. info.totalSegmentCount = this._mediaDataSource.segments.length;
  114919. this._emitter.emit(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_8__.default.STATISTICS_INFO, info);
  114920. };
  114921. return TransmuxingController2;
  114922. }();
  114923. __webpack_exports__2["default"] = TransmuxingController;
  114924. },
  114925. "./src/core/transmuxing-events.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  114926. __webpack_require__2.r(__webpack_exports__2);
  114927. var TransmuxingEvents = {
  114928. IO_ERROR: "io_error",
  114929. DEMUX_ERROR: "demux_error",
  114930. INIT_SEGMENT: "init_segment",
  114931. MEDIA_SEGMENT: "media_segment",
  114932. LOADING_COMPLETE: "loading_complete",
  114933. RECOVERED_EARLY_EOF: "recovered_early_eof",
  114934. MEDIA_INFO: "media_info",
  114935. METADATA_ARRIVED: "metadata_arrived",
  114936. SCRIPTDATA_ARRIVED: "scriptdata_arrived",
  114937. STATISTICS_INFO: "statistics_info",
  114938. RECOMMEND_SEEKPOINT: "recommend_seekpoint"
  114939. };
  114940. __webpack_exports__2["default"] = TransmuxingEvents;
  114941. },
  114942. "./src/core/transmuxing-worker.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  114943. __webpack_require__2.r(__webpack_exports__2);
  114944. var _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logging-control.js");
  114945. var _utils_polyfill_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/polyfill.js");
  114946. var _transmuxing_controller_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/core/transmuxing-controller.js");
  114947. var _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/core/transmuxing-events.js");
  114948. var TransmuxingWorker = function(self2) {
  114949. var controller = null;
  114950. var logcatListener = onLogcatCallback.bind(this);
  114951. _utils_polyfill_js__WEBPACK_IMPORTED_MODULE_1__.default.install();
  114952. self2.addEventListener("message", function(e) {
  114953. switch (e.data.cmd) {
  114954. case "init":
  114955. controller = new _transmuxing_controller_js__WEBPACK_IMPORTED_MODULE_2__.default(e.data.param[0], e.data.param[1]);
  114956. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.IO_ERROR, onIOError.bind(this));
  114957. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.DEMUX_ERROR, onDemuxError.bind(this));
  114958. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.INIT_SEGMENT, onInitSegment.bind(this));
  114959. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_SEGMENT, onMediaSegment.bind(this));
  114960. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.LOADING_COMPLETE, onLoadingComplete.bind(this));
  114961. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.RECOVERED_EARLY_EOF, onRecoveredEarlyEof.bind(this));
  114962. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_INFO, onMediaInfo.bind(this));
  114963. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.METADATA_ARRIVED, onMetaDataArrived.bind(this));
  114964. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.SCRIPTDATA_ARRIVED, onScriptDataArrived.bind(this));
  114965. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.STATISTICS_INFO, onStatisticsInfo.bind(this));
  114966. controller.on(_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.RECOMMEND_SEEKPOINT, onRecommendSeekpoint.bind(this));
  114967. break;
  114968. case "destroy":
  114969. if (controller) {
  114970. controller.destroy();
  114971. controller = null;
  114972. }
  114973. self2.postMessage({ msg: "destroyed" });
  114974. break;
  114975. case "start":
  114976. controller.start();
  114977. break;
  114978. case "stop":
  114979. controller.stop();
  114980. break;
  114981. case "seek":
  114982. controller.seek(e.data.param);
  114983. break;
  114984. case "pause":
  114985. controller.pause();
  114986. break;
  114987. case "resume":
  114988. controller.resume();
  114989. break;
  114990. case "logging_config": {
  114991. var config = e.data.param;
  114992. _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_0__.default.applyConfig(config);
  114993. if (config.enableCallback === true) {
  114994. _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_0__.default.addLogListener(logcatListener);
  114995. } else {
  114996. _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_0__.default.removeLogListener(logcatListener);
  114997. }
  114998. break;
  114999. }
  115000. }
  115001. });
  115002. function onInitSegment(type2, initSegment) {
  115003. var obj = {
  115004. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.INIT_SEGMENT,
  115005. data: {
  115006. type: type2,
  115007. data: initSegment
  115008. }
  115009. };
  115010. self2.postMessage(obj, [initSegment.data]);
  115011. }
  115012. function onMediaSegment(type2, mediaSegment) {
  115013. var obj = {
  115014. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_SEGMENT,
  115015. data: {
  115016. type: type2,
  115017. data: mediaSegment
  115018. }
  115019. };
  115020. self2.postMessage(obj, [mediaSegment.data]);
  115021. }
  115022. function onLoadingComplete() {
  115023. var obj = {
  115024. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.LOADING_COMPLETE
  115025. };
  115026. self2.postMessage(obj);
  115027. }
  115028. function onRecoveredEarlyEof() {
  115029. var obj = {
  115030. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.RECOVERED_EARLY_EOF
  115031. };
  115032. self2.postMessage(obj);
  115033. }
  115034. function onMediaInfo(mediaInfo) {
  115035. var obj = {
  115036. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_INFO,
  115037. data: mediaInfo
  115038. };
  115039. self2.postMessage(obj);
  115040. }
  115041. function onMetaDataArrived(metadata) {
  115042. var obj = {
  115043. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.METADATA_ARRIVED,
  115044. data: metadata
  115045. };
  115046. self2.postMessage(obj);
  115047. }
  115048. function onScriptDataArrived(data) {
  115049. var obj = {
  115050. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.SCRIPTDATA_ARRIVED,
  115051. data
  115052. };
  115053. self2.postMessage(obj);
  115054. }
  115055. function onStatisticsInfo(statInfo) {
  115056. var obj = {
  115057. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.STATISTICS_INFO,
  115058. data: statInfo
  115059. };
  115060. self2.postMessage(obj);
  115061. }
  115062. function onIOError(type2, info) {
  115063. self2.postMessage({
  115064. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.IO_ERROR,
  115065. data: {
  115066. type: type2,
  115067. info
  115068. }
  115069. });
  115070. }
  115071. function onDemuxError(type2, info) {
  115072. self2.postMessage({
  115073. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.DEMUX_ERROR,
  115074. data: {
  115075. type: type2,
  115076. info
  115077. }
  115078. });
  115079. }
  115080. function onRecommendSeekpoint(milliseconds) {
  115081. self2.postMessage({
  115082. msg: _transmuxing_events_js__WEBPACK_IMPORTED_MODULE_3__.default.RECOMMEND_SEEKPOINT,
  115083. data: milliseconds
  115084. });
  115085. }
  115086. function onLogcatCallback(type2, str) {
  115087. self2.postMessage({
  115088. msg: "logcat_callback",
  115089. data: {
  115090. type: type2,
  115091. logcat: str
  115092. }
  115093. });
  115094. }
  115095. };
  115096. __webpack_exports__2["default"] = TransmuxingWorker;
  115097. },
  115098. "./src/demux/amf-parser.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  115099. __webpack_require__2.r(__webpack_exports__2);
  115100. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  115101. var _utils_utf8_conv_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/utf8-conv.js");
  115102. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/exception.js");
  115103. var le = function() {
  115104. var buf = new ArrayBuffer(2);
  115105. new DataView(buf).setInt16(0, 256, true);
  115106. return new Int16Array(buf)[0] === 256;
  115107. }();
  115108. var AMF = function() {
  115109. function AMF2() {
  115110. }
  115111. AMF2.parseScriptData = function(arrayBuffer, dataOffset, dataSize) {
  115112. var data = {};
  115113. try {
  115114. var name_1 = AMF2.parseValue(arrayBuffer, dataOffset, dataSize);
  115115. var value = AMF2.parseValue(arrayBuffer, dataOffset + name_1.size, dataSize - name_1.size);
  115116. data[name_1.data] = value.data;
  115117. } catch (e) {
  115118. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.e("AMF", e.toString());
  115119. }
  115120. return data;
  115121. };
  115122. AMF2.parseObject = function(arrayBuffer, dataOffset, dataSize) {
  115123. if (dataSize < 3) {
  115124. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.IllegalStateException("Data not enough when parse ScriptDataObject");
  115125. }
  115126. var name = AMF2.parseString(arrayBuffer, dataOffset, dataSize);
  115127. var value = AMF2.parseValue(arrayBuffer, dataOffset + name.size, dataSize - name.size);
  115128. var isObjectEnd = value.objectEnd;
  115129. return {
  115130. data: {
  115131. name: name.data,
  115132. value: value.data
  115133. },
  115134. size: name.size + value.size,
  115135. objectEnd: isObjectEnd
  115136. };
  115137. };
  115138. AMF2.parseVariable = function(arrayBuffer, dataOffset, dataSize) {
  115139. return AMF2.parseObject(arrayBuffer, dataOffset, dataSize);
  115140. };
  115141. AMF2.parseString = function(arrayBuffer, dataOffset, dataSize) {
  115142. if (dataSize < 2) {
  115143. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.IllegalStateException("Data not enough when parse String");
  115144. }
  115145. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  115146. var length = v.getUint16(0, !le);
  115147. var str;
  115148. if (length > 0) {
  115149. str = (0, _utils_utf8_conv_js__WEBPACK_IMPORTED_MODULE_1__.default)(new Uint8Array(arrayBuffer, dataOffset + 2, length));
  115150. } else {
  115151. str = "";
  115152. }
  115153. return {
  115154. data: str,
  115155. size: 2 + length
  115156. };
  115157. };
  115158. AMF2.parseLongString = function(arrayBuffer, dataOffset, dataSize) {
  115159. if (dataSize < 4) {
  115160. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.IllegalStateException("Data not enough when parse LongString");
  115161. }
  115162. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  115163. var length = v.getUint32(0, !le);
  115164. var str;
  115165. if (length > 0) {
  115166. str = (0, _utils_utf8_conv_js__WEBPACK_IMPORTED_MODULE_1__.default)(new Uint8Array(arrayBuffer, dataOffset + 4, length));
  115167. } else {
  115168. str = "";
  115169. }
  115170. return {
  115171. data: str,
  115172. size: 4 + length
  115173. };
  115174. };
  115175. AMF2.parseDate = function(arrayBuffer, dataOffset, dataSize) {
  115176. if (dataSize < 10) {
  115177. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.IllegalStateException("Data size invalid when parse Date");
  115178. }
  115179. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  115180. var timestamp = v.getFloat64(0, !le);
  115181. var localTimeOffset = v.getInt16(8, !le);
  115182. timestamp += localTimeOffset * 60 * 1e3;
  115183. return {
  115184. data: new Date(timestamp),
  115185. size: 8 + 2
  115186. };
  115187. };
  115188. AMF2.parseValue = function(arrayBuffer, dataOffset, dataSize) {
  115189. if (dataSize < 1) {
  115190. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.IllegalStateException("Data not enough when parse Value");
  115191. }
  115192. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  115193. var offset = 1;
  115194. var type2 = v.getUint8(0);
  115195. var value;
  115196. var objectEnd = false;
  115197. try {
  115198. switch (type2) {
  115199. case 0:
  115200. value = v.getFloat64(1, !le);
  115201. offset += 8;
  115202. break;
  115203. case 1: {
  115204. var b = v.getUint8(1);
  115205. value = b ? true : false;
  115206. offset += 1;
  115207. break;
  115208. }
  115209. case 2: {
  115210. var amfstr = AMF2.parseString(arrayBuffer, dataOffset + 1, dataSize - 1);
  115211. value = amfstr.data;
  115212. offset += amfstr.size;
  115213. break;
  115214. }
  115215. case 3: {
  115216. value = {};
  115217. var terminal = 0;
  115218. if ((v.getUint32(dataSize - 4, !le) & 16777215) === 9) {
  115219. terminal = 3;
  115220. }
  115221. while (offset < dataSize - 4) {
  115222. var amfobj = AMF2.parseObject(arrayBuffer, dataOffset + offset, dataSize - offset - terminal);
  115223. if (amfobj.objectEnd)
  115224. break;
  115225. value[amfobj.data.name] = amfobj.data.value;
  115226. offset += amfobj.size;
  115227. }
  115228. if (offset <= dataSize - 3) {
  115229. var marker = v.getUint32(offset - 1, !le) & 16777215;
  115230. if (marker === 9) {
  115231. offset += 3;
  115232. }
  115233. }
  115234. break;
  115235. }
  115236. case 8: {
  115237. value = {};
  115238. offset += 4;
  115239. var terminal = 0;
  115240. if ((v.getUint32(dataSize - 4, !le) & 16777215) === 9) {
  115241. terminal = 3;
  115242. }
  115243. while (offset < dataSize - 8) {
  115244. var amfvar = AMF2.parseVariable(arrayBuffer, dataOffset + offset, dataSize - offset - terminal);
  115245. if (amfvar.objectEnd)
  115246. break;
  115247. value[amfvar.data.name] = amfvar.data.value;
  115248. offset += amfvar.size;
  115249. }
  115250. if (offset <= dataSize - 3) {
  115251. var marker = v.getUint32(offset - 1, !le) & 16777215;
  115252. if (marker === 9) {
  115253. offset += 3;
  115254. }
  115255. }
  115256. break;
  115257. }
  115258. case 9:
  115259. value = void 0;
  115260. offset = 1;
  115261. objectEnd = true;
  115262. break;
  115263. case 10: {
  115264. value = [];
  115265. var strictArrayLength = v.getUint32(1, !le);
  115266. offset += 4;
  115267. for (var i2 = 0; i2 < strictArrayLength; i2++) {
  115268. var val = AMF2.parseValue(arrayBuffer, dataOffset + offset, dataSize - offset);
  115269. value.push(val.data);
  115270. offset += val.size;
  115271. }
  115272. break;
  115273. }
  115274. case 11: {
  115275. var date = AMF2.parseDate(arrayBuffer, dataOffset + 1, dataSize - 1);
  115276. value = date.data;
  115277. offset += date.size;
  115278. break;
  115279. }
  115280. case 12: {
  115281. var amfLongStr = AMF2.parseString(arrayBuffer, dataOffset + 1, dataSize - 1);
  115282. value = amfLongStr.data;
  115283. offset += amfLongStr.size;
  115284. break;
  115285. }
  115286. default:
  115287. offset = dataSize;
  115288. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w("AMF", "Unsupported AMF value type " + type2);
  115289. }
  115290. } catch (e) {
  115291. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.e("AMF", e.toString());
  115292. }
  115293. return {
  115294. data: value,
  115295. size: offset,
  115296. objectEnd
  115297. };
  115298. };
  115299. return AMF2;
  115300. }();
  115301. __webpack_exports__2["default"] = AMF;
  115302. },
  115303. "./src/demux/demux-errors.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  115304. __webpack_require__2.r(__webpack_exports__2);
  115305. var DemuxErrors = {
  115306. OK: "OK",
  115307. FORMAT_ERROR: "FormatError",
  115308. FORMAT_UNSUPPORTED: "FormatUnsupported",
  115309. CODEC_UNSUPPORTED: "CodecUnsupported"
  115310. };
  115311. __webpack_exports__2["default"] = DemuxErrors;
  115312. },
  115313. "./src/demux/exp-golomb.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  115314. __webpack_require__2.r(__webpack_exports__2);
  115315. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/exception.js");
  115316. var ExpGolomb = function() {
  115317. function ExpGolomb2(uint8array) {
  115318. this.TAG = "ExpGolomb";
  115319. this._buffer = uint8array;
  115320. this._buffer_index = 0;
  115321. this._total_bytes = uint8array.byteLength;
  115322. this._total_bits = uint8array.byteLength * 8;
  115323. this._current_word = 0;
  115324. this._current_word_bits_left = 0;
  115325. }
  115326. ExpGolomb2.prototype.destroy = function() {
  115327. this._buffer = null;
  115328. };
  115329. ExpGolomb2.prototype._fillCurrentWord = function() {
  115330. var buffer_bytes_left = this._total_bytes - this._buffer_index;
  115331. if (buffer_bytes_left <= 0)
  115332. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__.IllegalStateException("ExpGolomb: _fillCurrentWord() but no bytes available");
  115333. var bytes_read = Math.min(4, buffer_bytes_left);
  115334. var word = new Uint8Array(4);
  115335. word.set(this._buffer.subarray(this._buffer_index, this._buffer_index + bytes_read));
  115336. this._current_word = new DataView(word.buffer).getUint32(0, false);
  115337. this._buffer_index += bytes_read;
  115338. this._current_word_bits_left = bytes_read * 8;
  115339. };
  115340. ExpGolomb2.prototype.readBits = function(bits) {
  115341. if (bits > 32)
  115342. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__.InvalidArgumentException("ExpGolomb: readBits() bits exceeded max 32bits!");
  115343. if (bits <= this._current_word_bits_left) {
  115344. var result_1 = this._current_word >>> 32 - bits;
  115345. this._current_word <<= bits;
  115346. this._current_word_bits_left -= bits;
  115347. return result_1;
  115348. }
  115349. var result = this._current_word_bits_left ? this._current_word : 0;
  115350. result = result >>> 32 - this._current_word_bits_left;
  115351. var bits_need_left = bits - this._current_word_bits_left;
  115352. this._fillCurrentWord();
  115353. var bits_read_next = Math.min(bits_need_left, this._current_word_bits_left);
  115354. var result2 = this._current_word >>> 32 - bits_read_next;
  115355. this._current_word <<= bits_read_next;
  115356. this._current_word_bits_left -= bits_read_next;
  115357. result = result << bits_read_next | result2;
  115358. return result;
  115359. };
  115360. ExpGolomb2.prototype.readBool = function() {
  115361. return this.readBits(1) === 1;
  115362. };
  115363. ExpGolomb2.prototype.readByte = function() {
  115364. return this.readBits(8);
  115365. };
  115366. ExpGolomb2.prototype._skipLeadingZero = function() {
  115367. var zero_count;
  115368. for (zero_count = 0; zero_count < this._current_word_bits_left; zero_count++) {
  115369. if (0 !== (this._current_word & 2147483648 >>> zero_count)) {
  115370. this._current_word <<= zero_count;
  115371. this._current_word_bits_left -= zero_count;
  115372. return zero_count;
  115373. }
  115374. }
  115375. this._fillCurrentWord();
  115376. return zero_count + this._skipLeadingZero();
  115377. };
  115378. ExpGolomb2.prototype.readUEG = function() {
  115379. var leading_zeros = this._skipLeadingZero();
  115380. return this.readBits(leading_zeros + 1) - 1;
  115381. };
  115382. ExpGolomb2.prototype.readSEG = function() {
  115383. var value = this.readUEG();
  115384. if (value & 1) {
  115385. return value + 1 >>> 1;
  115386. } else {
  115387. return -1 * (value >>> 1);
  115388. }
  115389. };
  115390. return ExpGolomb2;
  115391. }();
  115392. __webpack_exports__2["default"] = ExpGolomb;
  115393. },
  115394. "./src/demux/flv-demuxer.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  115395. __webpack_require__2.r(__webpack_exports__2);
  115396. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  115397. var _amf_parser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/demux/amf-parser.js");
  115398. var _sps_parser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/demux/sps-parser.js");
  115399. var _demux_errors_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/demux/demux-errors.js");
  115400. var _core_media_info_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/core/media-info.js");
  115401. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/utils/exception.js");
  115402. function ReadBig32(array, index2) {
  115403. return array[index2] << 24 | array[index2 + 1] << 16 | array[index2 + 2] << 8 | array[index2 + 3];
  115404. }
  115405. var FLVDemuxer = function() {
  115406. function FLVDemuxer2(probeData, config) {
  115407. this.TAG = "FLVDemuxer";
  115408. this._config = config;
  115409. this._onError = null;
  115410. this._onMediaInfo = null;
  115411. this._onMetaDataArrived = null;
  115412. this._onScriptDataArrived = null;
  115413. this._onTrackMetadata = null;
  115414. this._onDataAvailable = null;
  115415. this._dataOffset = probeData.dataOffset;
  115416. this._firstParse = true;
  115417. this._dispatch = false;
  115418. this._hasAudio = probeData.hasAudioTrack;
  115419. this._hasVideo = probeData.hasVideoTrack;
  115420. this._hasAudioFlagOverrided = false;
  115421. this._hasVideoFlagOverrided = false;
  115422. this._audioInitialMetadataDispatched = false;
  115423. this._videoInitialMetadataDispatched = false;
  115424. this._mediaInfo = new _core_media_info_js__WEBPACK_IMPORTED_MODULE_4__.default();
  115425. this._mediaInfo.hasAudio = this._hasAudio;
  115426. this._mediaInfo.hasVideo = this._hasVideo;
  115427. this._metadata = null;
  115428. this._audioMetadata = null;
  115429. this._videoMetadata = null;
  115430. this._naluLengthSize = 4;
  115431. this._timestampBase = 0;
  115432. this._timescale = 1e3;
  115433. this._duration = 0;
  115434. this._durationOverrided = false;
  115435. this._referenceFrameRate = {
  115436. fixed: true,
  115437. fps: 23.976,
  115438. fps_num: 23976,
  115439. fps_den: 1e3
  115440. };
  115441. this._flvSoundRateTable = [5500, 11025, 22050, 44100, 48e3];
  115442. this._mpegSamplingRates = [
  115443. 96e3,
  115444. 88200,
  115445. 64e3,
  115446. 48e3,
  115447. 44100,
  115448. 32e3,
  115449. 24e3,
  115450. 22050,
  115451. 16e3,
  115452. 12e3,
  115453. 11025,
  115454. 8e3,
  115455. 7350
  115456. ];
  115457. this._mpegAudioV10SampleRateTable = [44100, 48e3, 32e3, 0];
  115458. this._mpegAudioV20SampleRateTable = [22050, 24e3, 16e3, 0];
  115459. this._mpegAudioV25SampleRateTable = [11025, 12e3, 8e3, 0];
  115460. this._mpegAudioL1BitRateTable = [0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, -1];
  115461. this._mpegAudioL2BitRateTable = [0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, -1];
  115462. this._mpegAudioL3BitRateTable = [0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, -1];
  115463. this._videoTrack = { type: "video", id: 1, sequenceNumber: 0, samples: [], length: 0 };
  115464. this._audioTrack = { type: "audio", id: 2, sequenceNumber: 0, samples: [], length: 0 };
  115465. this._littleEndian = function() {
  115466. var buf = new ArrayBuffer(2);
  115467. new DataView(buf).setInt16(0, 256, true);
  115468. return new Int16Array(buf)[0] === 256;
  115469. }();
  115470. }
  115471. FLVDemuxer2.prototype.destroy = function() {
  115472. this._mediaInfo = null;
  115473. this._metadata = null;
  115474. this._audioMetadata = null;
  115475. this._videoMetadata = null;
  115476. this._videoTrack = null;
  115477. this._audioTrack = null;
  115478. this._onError = null;
  115479. this._onMediaInfo = null;
  115480. this._onMetaDataArrived = null;
  115481. this._onScriptDataArrived = null;
  115482. this._onTrackMetadata = null;
  115483. this._onDataAvailable = null;
  115484. };
  115485. FLVDemuxer2.probe = function(buffer) {
  115486. var data = new Uint8Array(buffer);
  115487. var mismatch = { match: false };
  115488. if (data[0] !== 70 || data[1] !== 76 || data[2] !== 86 || data[3] !== 1) {
  115489. return mismatch;
  115490. }
  115491. var hasAudio = (data[4] & 4) >>> 2 !== 0;
  115492. var hasVideo = (data[4] & 1) !== 0;
  115493. var offset = ReadBig32(data, 5);
  115494. if (offset < 9) {
  115495. return mismatch;
  115496. }
  115497. return {
  115498. match: true,
  115499. consumed: offset,
  115500. dataOffset: offset,
  115501. hasAudioTrack: hasAudio,
  115502. hasVideoTrack: hasVideo
  115503. };
  115504. };
  115505. FLVDemuxer2.prototype.bindDataSource = function(loader) {
  115506. loader.onDataArrival = this.parseChunks.bind(this);
  115507. return this;
  115508. };
  115509. Object.defineProperty(FLVDemuxer2.prototype, "onTrackMetadata", {
  115510. get: function() {
  115511. return this._onTrackMetadata;
  115512. },
  115513. set: function(callback2) {
  115514. this._onTrackMetadata = callback2;
  115515. },
  115516. enumerable: false,
  115517. configurable: true
  115518. });
  115519. Object.defineProperty(FLVDemuxer2.prototype, "onMediaInfo", {
  115520. get: function() {
  115521. return this._onMediaInfo;
  115522. },
  115523. set: function(callback2) {
  115524. this._onMediaInfo = callback2;
  115525. },
  115526. enumerable: false,
  115527. configurable: true
  115528. });
  115529. Object.defineProperty(FLVDemuxer2.prototype, "onMetaDataArrived", {
  115530. get: function() {
  115531. return this._onMetaDataArrived;
  115532. },
  115533. set: function(callback2) {
  115534. this._onMetaDataArrived = callback2;
  115535. },
  115536. enumerable: false,
  115537. configurable: true
  115538. });
  115539. Object.defineProperty(FLVDemuxer2.prototype, "onScriptDataArrived", {
  115540. get: function() {
  115541. return this._onScriptDataArrived;
  115542. },
  115543. set: function(callback2) {
  115544. this._onScriptDataArrived = callback2;
  115545. },
  115546. enumerable: false,
  115547. configurable: true
  115548. });
  115549. Object.defineProperty(FLVDemuxer2.prototype, "onError", {
  115550. get: function() {
  115551. return this._onError;
  115552. },
  115553. set: function(callback2) {
  115554. this._onError = callback2;
  115555. },
  115556. enumerable: false,
  115557. configurable: true
  115558. });
  115559. Object.defineProperty(FLVDemuxer2.prototype, "onDataAvailable", {
  115560. get: function() {
  115561. return this._onDataAvailable;
  115562. },
  115563. set: function(callback2) {
  115564. this._onDataAvailable = callback2;
  115565. },
  115566. enumerable: false,
  115567. configurable: true
  115568. });
  115569. Object.defineProperty(FLVDemuxer2.prototype, "timestampBase", {
  115570. get: function() {
  115571. return this._timestampBase;
  115572. },
  115573. set: function(base2) {
  115574. this._timestampBase = base2;
  115575. },
  115576. enumerable: false,
  115577. configurable: true
  115578. });
  115579. Object.defineProperty(FLVDemuxer2.prototype, "overridedDuration", {
  115580. get: function() {
  115581. return this._duration;
  115582. },
  115583. set: function(duration5) {
  115584. this._durationOverrided = true;
  115585. this._duration = duration5;
  115586. this._mediaInfo.duration = duration5;
  115587. },
  115588. enumerable: false,
  115589. configurable: true
  115590. });
  115591. Object.defineProperty(FLVDemuxer2.prototype, "overridedHasAudio", {
  115592. set: function(hasAudio) {
  115593. this._hasAudioFlagOverrided = true;
  115594. this._hasAudio = hasAudio;
  115595. this._mediaInfo.hasAudio = hasAudio;
  115596. },
  115597. enumerable: false,
  115598. configurable: true
  115599. });
  115600. Object.defineProperty(FLVDemuxer2.prototype, "overridedHasVideo", {
  115601. set: function(hasVideo) {
  115602. this._hasVideoFlagOverrided = true;
  115603. this._hasVideo = hasVideo;
  115604. this._mediaInfo.hasVideo = hasVideo;
  115605. },
  115606. enumerable: false,
  115607. configurable: true
  115608. });
  115609. FLVDemuxer2.prototype.resetMediaInfo = function() {
  115610. this._mediaInfo = new _core_media_info_js__WEBPACK_IMPORTED_MODULE_4__.default();
  115611. };
  115612. FLVDemuxer2.prototype._isInitialMetadataDispatched = function() {
  115613. if (this._hasAudio && this._hasVideo) {
  115614. return this._audioInitialMetadataDispatched && this._videoInitialMetadataDispatched;
  115615. }
  115616. if (this._hasAudio && !this._hasVideo) {
  115617. return this._audioInitialMetadataDispatched;
  115618. }
  115619. if (!this._hasAudio && this._hasVideo) {
  115620. return this._videoInitialMetadataDispatched;
  115621. }
  115622. return false;
  115623. };
  115624. FLVDemuxer2.prototype.parseChunks = function(chunk, byteStart) {
  115625. if (!this._onError || !this._onMediaInfo || !this._onTrackMetadata || !this._onDataAvailable) {
  115626. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__.IllegalStateException("Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified");
  115627. }
  115628. var offset = 0;
  115629. var le = this._littleEndian;
  115630. if (byteStart === 0) {
  115631. if (chunk.byteLength > 13) {
  115632. var probeData = FLVDemuxer2.probe(chunk);
  115633. offset = probeData.dataOffset;
  115634. } else {
  115635. return 0;
  115636. }
  115637. }
  115638. if (this._firstParse) {
  115639. this._firstParse = false;
  115640. if (byteStart + offset !== this._dataOffset) {
  115641. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "First time parsing but chunk byteStart invalid!");
  115642. }
  115643. var v = new DataView(chunk, offset);
  115644. var prevTagSize0 = v.getUint32(0, !le);
  115645. if (prevTagSize0 !== 0) {
  115646. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "PrevTagSize0 !== 0 !!!");
  115647. }
  115648. offset += 4;
  115649. }
  115650. while (offset < chunk.byteLength) {
  115651. this._dispatch = true;
  115652. var v = new DataView(chunk, offset);
  115653. if (offset + 11 + 4 > chunk.byteLength) {
  115654. break;
  115655. }
  115656. var tagType = v.getUint8(0);
  115657. var dataSize = v.getUint32(0, !le) & 16777215;
  115658. if (offset + 11 + dataSize + 4 > chunk.byteLength) {
  115659. break;
  115660. }
  115661. if (tagType !== 8 && tagType !== 9 && tagType !== 18) {
  115662. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Unsupported tag type " + tagType + ", skipped");
  115663. offset += 11 + dataSize + 4;
  115664. continue;
  115665. }
  115666. var ts22 = v.getUint8(4);
  115667. var ts1 = v.getUint8(5);
  115668. var ts0 = v.getUint8(6);
  115669. var ts3 = v.getUint8(7);
  115670. var timestamp = ts0 | ts1 << 8 | ts22 << 16 | ts3 << 24;
  115671. var streamId = v.getUint32(7, !le) & 16777215;
  115672. if (streamId !== 0) {
  115673. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Meet tag which has StreamID != 0!");
  115674. }
  115675. var dataOffset = offset + 11;
  115676. switch (tagType) {
  115677. case 8:
  115678. this._parseAudioData(chunk, dataOffset, dataSize, timestamp);
  115679. break;
  115680. case 9:
  115681. this._parseVideoData(chunk, dataOffset, dataSize, timestamp, byteStart + offset);
  115682. break;
  115683. case 18:
  115684. this._parseScriptData(chunk, dataOffset, dataSize);
  115685. break;
  115686. }
  115687. var prevTagSize = v.getUint32(11 + dataSize, !le);
  115688. if (prevTagSize !== 11 + dataSize) {
  115689. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Invalid PrevTagSize " + prevTagSize);
  115690. }
  115691. offset += 11 + dataSize + 4;
  115692. }
  115693. if (this._isInitialMetadataDispatched()) {
  115694. if (this._dispatch && (this._audioTrack.length || this._videoTrack.length)) {
  115695. this._onDataAvailable(this._audioTrack, this._videoTrack);
  115696. }
  115697. }
  115698. return offset;
  115699. };
  115700. FLVDemuxer2.prototype._parseScriptData = function(arrayBuffer, dataOffset, dataSize) {
  115701. var scriptData = _amf_parser_js__WEBPACK_IMPORTED_MODULE_1__.default.parseScriptData(arrayBuffer, dataOffset, dataSize);
  115702. if (scriptData.hasOwnProperty("onMetaData")) {
  115703. if (scriptData.onMetaData == null || typeof scriptData.onMetaData !== "object") {
  115704. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Invalid onMetaData structure!");
  115705. return;
  115706. }
  115707. if (this._metadata) {
  115708. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Found another onMetaData tag!");
  115709. }
  115710. this._metadata = scriptData;
  115711. var onMetaData = this._metadata.onMetaData;
  115712. if (this._onMetaDataArrived) {
  115713. this._onMetaDataArrived(Object.assign({}, onMetaData));
  115714. }
  115715. if (typeof onMetaData.hasAudio === "boolean") {
  115716. if (this._hasAudioFlagOverrided === false) {
  115717. this._hasAudio = onMetaData.hasAudio;
  115718. this._mediaInfo.hasAudio = this._hasAudio;
  115719. }
  115720. }
  115721. if (typeof onMetaData.hasVideo === "boolean") {
  115722. if (this._hasVideoFlagOverrided === false) {
  115723. this._hasVideo = onMetaData.hasVideo;
  115724. this._mediaInfo.hasVideo = this._hasVideo;
  115725. }
  115726. }
  115727. if (typeof onMetaData.audiodatarate === "number") {
  115728. this._mediaInfo.audioDataRate = onMetaData.audiodatarate;
  115729. }
  115730. if (typeof onMetaData.videodatarate === "number") {
  115731. this._mediaInfo.videoDataRate = onMetaData.videodatarate;
  115732. }
  115733. if (typeof onMetaData.width === "number") {
  115734. this._mediaInfo.width = onMetaData.width;
  115735. }
  115736. if (typeof onMetaData.height === "number") {
  115737. this._mediaInfo.height = onMetaData.height;
  115738. }
  115739. if (typeof onMetaData.duration === "number") {
  115740. if (!this._durationOverrided) {
  115741. var duration5 = Math.floor(onMetaData.duration * this._timescale);
  115742. this._duration = duration5;
  115743. this._mediaInfo.duration = duration5;
  115744. }
  115745. } else {
  115746. this._mediaInfo.duration = 0;
  115747. }
  115748. if (typeof onMetaData.framerate === "number") {
  115749. var fps_num = Math.floor(onMetaData.framerate * 1e3);
  115750. if (fps_num > 0) {
  115751. var fps = fps_num / 1e3;
  115752. this._referenceFrameRate.fixed = true;
  115753. this._referenceFrameRate.fps = fps;
  115754. this._referenceFrameRate.fps_num = fps_num;
  115755. this._referenceFrameRate.fps_den = 1e3;
  115756. this._mediaInfo.fps = fps;
  115757. }
  115758. }
  115759. if (typeof onMetaData.keyframes === "object") {
  115760. this._mediaInfo.hasKeyframesIndex = true;
  115761. var keyframes = onMetaData.keyframes;
  115762. this._mediaInfo.keyframesIndex = this._parseKeyframesIndex(keyframes);
  115763. onMetaData.keyframes = null;
  115764. } else {
  115765. this._mediaInfo.hasKeyframesIndex = false;
  115766. }
  115767. this._dispatch = false;
  115768. this._mediaInfo.metadata = onMetaData;
  115769. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.v(this.TAG, "Parsed onMetaData");
  115770. if (this._mediaInfo.isComplete()) {
  115771. this._onMediaInfo(this._mediaInfo);
  115772. }
  115773. }
  115774. if (Object.keys(scriptData).length > 0) {
  115775. if (this._onScriptDataArrived) {
  115776. this._onScriptDataArrived(Object.assign({}, scriptData));
  115777. }
  115778. }
  115779. };
  115780. FLVDemuxer2.prototype._parseKeyframesIndex = function(keyframes) {
  115781. var times = [];
  115782. var filepositions = [];
  115783. for (var i2 = 1; i2 < keyframes.times.length; i2++) {
  115784. var time = this._timestampBase + Math.floor(keyframes.times[i2] * 1e3);
  115785. times.push(time);
  115786. filepositions.push(keyframes.filepositions[i2]);
  115787. }
  115788. return {
  115789. times,
  115790. filepositions
  115791. };
  115792. };
  115793. FLVDemuxer2.prototype._parseAudioData = function(arrayBuffer, dataOffset, dataSize, tagTimestamp) {
  115794. if (dataSize <= 1) {
  115795. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid audio packet, missing SoundData payload!");
  115796. return;
  115797. }
  115798. if (this._hasAudioFlagOverrided === true && this._hasAudio === false) {
  115799. return;
  115800. }
  115801. this._littleEndian;
  115802. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  115803. var soundSpec = v.getUint8(0);
  115804. var soundFormat = soundSpec >>> 4;
  115805. if (soundFormat !== 2 && soundFormat !== 10) {
  115806. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.CODEC_UNSUPPORTED, "Flv: Unsupported audio codec idx: " + soundFormat);
  115807. return;
  115808. }
  115809. var soundRate = 0;
  115810. var soundRateIndex = (soundSpec & 12) >>> 2;
  115811. if (soundRateIndex >= 0 && soundRateIndex <= 4) {
  115812. soundRate = this._flvSoundRateTable[soundRateIndex];
  115813. } else {
  115814. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Invalid audio sample rate idx: " + soundRateIndex);
  115815. return;
  115816. }
  115817. var soundType = soundSpec & 1;
  115818. var meta2 = this._audioMetadata;
  115819. var track = this._audioTrack;
  115820. if (!meta2) {
  115821. if (this._hasAudio === false && this._hasAudioFlagOverrided === false) {
  115822. this._hasAudio = true;
  115823. this._mediaInfo.hasAudio = true;
  115824. }
  115825. meta2 = this._audioMetadata = {};
  115826. meta2.type = "audio";
  115827. meta2.id = track.id;
  115828. meta2.timescale = this._timescale;
  115829. meta2.duration = this._duration;
  115830. meta2.audioSampleRate = soundRate;
  115831. meta2.channelCount = soundType === 0 ? 1 : 2;
  115832. }
  115833. if (soundFormat === 10) {
  115834. var aacData = this._parseAACAudioData(arrayBuffer, dataOffset + 1, dataSize - 1);
  115835. if (aacData == void 0) {
  115836. return;
  115837. }
  115838. if (aacData.packetType === 0) {
  115839. if (meta2.config) {
  115840. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Found another AudioSpecificConfig!");
  115841. }
  115842. var misc = aacData.data;
  115843. meta2.audioSampleRate = misc.samplingRate;
  115844. meta2.channelCount = misc.channelCount;
  115845. meta2.codec = misc.codec;
  115846. meta2.originalCodec = misc.originalCodec;
  115847. meta2.config = misc.config;
  115848. meta2.refSampleDuration = 1024 / meta2.audioSampleRate * meta2.timescale;
  115849. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.v(this.TAG, "Parsed AudioSpecificConfig");
  115850. if (this._isInitialMetadataDispatched()) {
  115851. if (this._dispatch && (this._audioTrack.length || this._videoTrack.length)) {
  115852. this._onDataAvailable(this._audioTrack, this._videoTrack);
  115853. }
  115854. } else {
  115855. this._audioInitialMetadataDispatched = true;
  115856. }
  115857. this._dispatch = false;
  115858. this._onTrackMetadata("audio", meta2);
  115859. var mi = this._mediaInfo;
  115860. mi.audioCodec = meta2.originalCodec;
  115861. mi.audioSampleRate = meta2.audioSampleRate;
  115862. mi.audioChannelCount = meta2.channelCount;
  115863. if (mi.hasVideo) {
  115864. if (mi.videoCodec != null) {
  115865. mi.mimeType = 'video/x-flv; codecs="' + mi.videoCodec + "," + mi.audioCodec + '"';
  115866. }
  115867. } else {
  115868. mi.mimeType = 'video/x-flv; codecs="' + mi.audioCodec + '"';
  115869. }
  115870. if (mi.isComplete()) {
  115871. this._onMediaInfo(mi);
  115872. }
  115873. } else if (aacData.packetType === 1) {
  115874. var dts = this._timestampBase + tagTimestamp;
  115875. var aacSample = { unit: aacData.data, length: aacData.data.byteLength, dts, pts: dts };
  115876. track.samples.push(aacSample);
  115877. track.length += aacData.data.length;
  115878. } else {
  115879. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.e(this.TAG, "Flv: Unsupported AAC data type " + aacData.packetType);
  115880. }
  115881. } else if (soundFormat === 2) {
  115882. if (!meta2.codec) {
  115883. var misc = this._parseMP3AudioData(arrayBuffer, dataOffset + 1, dataSize - 1, true);
  115884. if (misc == void 0) {
  115885. return;
  115886. }
  115887. meta2.audioSampleRate = misc.samplingRate;
  115888. meta2.channelCount = misc.channelCount;
  115889. meta2.codec = misc.codec;
  115890. meta2.originalCodec = misc.originalCodec;
  115891. meta2.refSampleDuration = 1152 / meta2.audioSampleRate * meta2.timescale;
  115892. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.v(this.TAG, "Parsed MPEG Audio Frame Header");
  115893. this._audioInitialMetadataDispatched = true;
  115894. this._onTrackMetadata("audio", meta2);
  115895. var mi = this._mediaInfo;
  115896. mi.audioCodec = meta2.codec;
  115897. mi.audioSampleRate = meta2.audioSampleRate;
  115898. mi.audioChannelCount = meta2.channelCount;
  115899. mi.audioDataRate = misc.bitRate;
  115900. if (mi.hasVideo) {
  115901. if (mi.videoCodec != null) {
  115902. mi.mimeType = 'video/x-flv; codecs="' + mi.videoCodec + "," + mi.audioCodec + '"';
  115903. }
  115904. } else {
  115905. mi.mimeType = 'video/x-flv; codecs="' + mi.audioCodec + '"';
  115906. }
  115907. if (mi.isComplete()) {
  115908. this._onMediaInfo(mi);
  115909. }
  115910. }
  115911. var data = this._parseMP3AudioData(arrayBuffer, dataOffset + 1, dataSize - 1, false);
  115912. if (data == void 0) {
  115913. return;
  115914. }
  115915. var dts = this._timestampBase + tagTimestamp;
  115916. var mp3Sample = { unit: data, length: data.byteLength, dts, pts: dts };
  115917. track.samples.push(mp3Sample);
  115918. track.length += data.length;
  115919. }
  115920. };
  115921. FLVDemuxer2.prototype._parseAACAudioData = function(arrayBuffer, dataOffset, dataSize) {
  115922. if (dataSize <= 1) {
  115923. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid AAC packet, missing AACPacketType or/and Data!");
  115924. return;
  115925. }
  115926. var result = {};
  115927. var array = new Uint8Array(arrayBuffer, dataOffset, dataSize);
  115928. result.packetType = array[0];
  115929. if (array[0] === 0) {
  115930. result.data = this._parseAACAudioSpecificConfig(arrayBuffer, dataOffset + 1, dataSize - 1);
  115931. } else {
  115932. result.data = array.subarray(1);
  115933. }
  115934. return result;
  115935. };
  115936. FLVDemuxer2.prototype._parseAACAudioSpecificConfig = function(arrayBuffer, dataOffset, dataSize) {
  115937. var array = new Uint8Array(arrayBuffer, dataOffset, dataSize);
  115938. var config = null;
  115939. var audioObjectType = 0;
  115940. var originalAudioObjectType = 0;
  115941. var samplingIndex = 0;
  115942. var extensionSamplingIndex = null;
  115943. audioObjectType = originalAudioObjectType = array[0] >>> 3;
  115944. samplingIndex = (array[0] & 7) << 1 | array[1] >>> 7;
  115945. if (samplingIndex < 0 || samplingIndex >= this._mpegSamplingRates.length) {
  115946. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: AAC invalid sampling frequency index!");
  115947. return;
  115948. }
  115949. var samplingFrequence = this._mpegSamplingRates[samplingIndex];
  115950. var channelConfig = (array[1] & 120) >>> 3;
  115951. if (channelConfig < 0 || channelConfig >= 8) {
  115952. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: AAC invalid channel configuration");
  115953. return;
  115954. }
  115955. if (audioObjectType === 5) {
  115956. extensionSamplingIndex = (array[1] & 7) << 1 | array[2] >>> 7;
  115957. (array[2] & 124) >>> 2;
  115958. }
  115959. var userAgent = self.navigator.userAgent.toLowerCase();
  115960. if (userAgent.indexOf("firefox") !== -1) {
  115961. if (samplingIndex >= 6) {
  115962. audioObjectType = 5;
  115963. config = new Array(4);
  115964. extensionSamplingIndex = samplingIndex - 3;
  115965. } else {
  115966. audioObjectType = 2;
  115967. config = new Array(2);
  115968. extensionSamplingIndex = samplingIndex;
  115969. }
  115970. } else if (userAgent.indexOf("android") !== -1) {
  115971. audioObjectType = 2;
  115972. config = new Array(2);
  115973. extensionSamplingIndex = samplingIndex;
  115974. } else {
  115975. audioObjectType = 5;
  115976. extensionSamplingIndex = samplingIndex;
  115977. config = new Array(4);
  115978. if (samplingIndex >= 6) {
  115979. extensionSamplingIndex = samplingIndex - 3;
  115980. } else if (channelConfig === 1) {
  115981. audioObjectType = 2;
  115982. config = new Array(2);
  115983. extensionSamplingIndex = samplingIndex;
  115984. }
  115985. }
  115986. config[0] = audioObjectType << 3;
  115987. config[0] |= (samplingIndex & 15) >>> 1;
  115988. config[1] = (samplingIndex & 15) << 7;
  115989. config[1] |= (channelConfig & 15) << 3;
  115990. if (audioObjectType === 5) {
  115991. config[1] |= (extensionSamplingIndex & 15) >>> 1;
  115992. config[2] = (extensionSamplingIndex & 1) << 7;
  115993. config[2] |= 2 << 2;
  115994. config[3] = 0;
  115995. }
  115996. return {
  115997. config,
  115998. samplingRate: samplingFrequence,
  115999. channelCount: channelConfig,
  116000. codec: "mp4a.40." + audioObjectType,
  116001. originalCodec: "mp4a.40." + originalAudioObjectType
  116002. };
  116003. };
  116004. FLVDemuxer2.prototype._parseMP3AudioData = function(arrayBuffer, dataOffset, dataSize, requestHeader) {
  116005. if (dataSize < 4) {
  116006. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid MP3 packet, header missing!");
  116007. return;
  116008. }
  116009. this._littleEndian;
  116010. var array = new Uint8Array(arrayBuffer, dataOffset, dataSize);
  116011. var result = null;
  116012. if (requestHeader) {
  116013. if (array[0] !== 255) {
  116014. return;
  116015. }
  116016. var ver = array[1] >>> 3 & 3;
  116017. var layer = (array[1] & 6) >> 1;
  116018. var bitrate_index = (array[2] & 240) >>> 4;
  116019. var sampling_freq_index = (array[2] & 12) >>> 2;
  116020. var channel_mode = array[3] >>> 6 & 3;
  116021. var channel_count = channel_mode !== 3 ? 2 : 1;
  116022. var sample_rate = 0;
  116023. var bit_rate = 0;
  116024. var codec = "mp3";
  116025. switch (ver) {
  116026. case 0:
  116027. sample_rate = this._mpegAudioV25SampleRateTable[sampling_freq_index];
  116028. break;
  116029. case 2:
  116030. sample_rate = this._mpegAudioV20SampleRateTable[sampling_freq_index];
  116031. break;
  116032. case 3:
  116033. sample_rate = this._mpegAudioV10SampleRateTable[sampling_freq_index];
  116034. break;
  116035. }
  116036. switch (layer) {
  116037. case 1:
  116038. if (bitrate_index < this._mpegAudioL3BitRateTable.length) {
  116039. bit_rate = this._mpegAudioL3BitRateTable[bitrate_index];
  116040. }
  116041. break;
  116042. case 2:
  116043. if (bitrate_index < this._mpegAudioL2BitRateTable.length) {
  116044. bit_rate = this._mpegAudioL2BitRateTable[bitrate_index];
  116045. }
  116046. break;
  116047. case 3:
  116048. if (bitrate_index < this._mpegAudioL1BitRateTable.length) {
  116049. bit_rate = this._mpegAudioL1BitRateTable[bitrate_index];
  116050. }
  116051. break;
  116052. }
  116053. result = {
  116054. bitRate: bit_rate,
  116055. samplingRate: sample_rate,
  116056. channelCount: channel_count,
  116057. codec,
  116058. originalCodec: codec
  116059. };
  116060. } else {
  116061. result = array;
  116062. }
  116063. return result;
  116064. };
  116065. FLVDemuxer2.prototype._parseVideoData = function(arrayBuffer, dataOffset, dataSize, tagTimestamp, tagPosition) {
  116066. if (dataSize <= 1) {
  116067. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid video packet, missing VideoData payload!");
  116068. return;
  116069. }
  116070. if (this._hasVideoFlagOverrided === true && this._hasVideo === false) {
  116071. return;
  116072. }
  116073. var spec = new Uint8Array(arrayBuffer, dataOffset, dataSize)[0];
  116074. var frameType = (spec & 240) >>> 4;
  116075. var codecId = spec & 15;
  116076. if (codecId !== 7) {
  116077. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.CODEC_UNSUPPORTED, "Flv: Unsupported codec in video frame: " + codecId);
  116078. return;
  116079. }
  116080. this._parseAVCVideoPacket(arrayBuffer, dataOffset + 1, dataSize - 1, tagTimestamp, tagPosition, frameType);
  116081. };
  116082. FLVDemuxer2.prototype._parseAVCVideoPacket = function(arrayBuffer, dataOffset, dataSize, tagTimestamp, tagPosition, frameType) {
  116083. if (dataSize < 4) {
  116084. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime");
  116085. return;
  116086. }
  116087. var le = this._littleEndian;
  116088. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  116089. var packetType = v.getUint8(0);
  116090. var cts_unsigned = v.getUint32(0, !le) & 16777215;
  116091. var cts = cts_unsigned << 8 >> 8;
  116092. if (packetType === 0) {
  116093. this._parseAVCDecoderConfigurationRecord(arrayBuffer, dataOffset + 4, dataSize - 4);
  116094. } else if (packetType === 1) {
  116095. this._parseAVCVideoData(arrayBuffer, dataOffset + 4, dataSize - 4, tagTimestamp, tagPosition, frameType, cts);
  116096. } else if (packetType === 2)
  116097. ;
  116098. else {
  116099. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Invalid video packet type " + packetType);
  116100. return;
  116101. }
  116102. };
  116103. FLVDemuxer2.prototype._parseAVCDecoderConfigurationRecord = function(arrayBuffer, dataOffset, dataSize) {
  116104. if (dataSize < 7) {
  116105. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Invalid AVCDecoderConfigurationRecord, lack of data!");
  116106. return;
  116107. }
  116108. var meta2 = this._videoMetadata;
  116109. var track = this._videoTrack;
  116110. var le = this._littleEndian;
  116111. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  116112. if (!meta2) {
  116113. if (this._hasVideo === false && this._hasVideoFlagOverrided === false) {
  116114. this._hasVideo = true;
  116115. this._mediaInfo.hasVideo = true;
  116116. }
  116117. meta2 = this._videoMetadata = {};
  116118. meta2.type = "video";
  116119. meta2.id = track.id;
  116120. meta2.timescale = this._timescale;
  116121. meta2.duration = this._duration;
  116122. } else {
  116123. if (typeof meta2.avcc !== "undefined") {
  116124. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Found another AVCDecoderConfigurationRecord!");
  116125. }
  116126. }
  116127. var version2 = v.getUint8(0);
  116128. var avcProfile = v.getUint8(1);
  116129. v.getUint8(2);
  116130. v.getUint8(3);
  116131. if (version2 !== 1 || avcProfile === 0) {
  116132. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Invalid AVCDecoderConfigurationRecord");
  116133. return;
  116134. }
  116135. this._naluLengthSize = (v.getUint8(4) & 3) + 1;
  116136. if (this._naluLengthSize !== 3 && this._naluLengthSize !== 4) {
  116137. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Strange NaluLengthSizeMinusOne: " + (this._naluLengthSize - 1));
  116138. return;
  116139. }
  116140. var spsCount = v.getUint8(5) & 31;
  116141. if (spsCount === 0) {
  116142. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Invalid AVCDecoderConfigurationRecord: No SPS");
  116143. return;
  116144. } else if (spsCount > 1) {
  116145. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Strange AVCDecoderConfigurationRecord: SPS Count = " + spsCount);
  116146. }
  116147. var offset = 6;
  116148. for (var i2 = 0; i2 < spsCount; i2++) {
  116149. var len = v.getUint16(offset, !le);
  116150. offset += 2;
  116151. if (len === 0) {
  116152. continue;
  116153. }
  116154. var sps = new Uint8Array(arrayBuffer, dataOffset + offset, len);
  116155. offset += len;
  116156. var config = _sps_parser_js__WEBPACK_IMPORTED_MODULE_2__.default.parseSPS(sps);
  116157. if (i2 !== 0) {
  116158. continue;
  116159. }
  116160. meta2.codecWidth = config.codec_size.width;
  116161. meta2.codecHeight = config.codec_size.height;
  116162. meta2.presentWidth = config.present_size.width;
  116163. meta2.presentHeight = config.present_size.height;
  116164. meta2.profile = config.profile_string;
  116165. meta2.level = config.level_string;
  116166. meta2.bitDepth = config.bit_depth;
  116167. meta2.chromaFormat = config.chroma_format;
  116168. meta2.sarRatio = config.sar_ratio;
  116169. meta2.frameRate = config.frame_rate;
  116170. if (config.frame_rate.fixed === false || config.frame_rate.fps_num === 0 || config.frame_rate.fps_den === 0) {
  116171. meta2.frameRate = this._referenceFrameRate;
  116172. }
  116173. var fps_den = meta2.frameRate.fps_den;
  116174. var fps_num = meta2.frameRate.fps_num;
  116175. meta2.refSampleDuration = meta2.timescale * (fps_den / fps_num);
  116176. var codecArray = sps.subarray(1, 4);
  116177. var codecString = "avc1.";
  116178. for (var j = 0; j < 3; j++) {
  116179. var h2 = codecArray[j].toString(16);
  116180. if (h2.length < 2) {
  116181. h2 = "0" + h2;
  116182. }
  116183. codecString += h2;
  116184. }
  116185. meta2.codec = codecString;
  116186. var mi = this._mediaInfo;
  116187. mi.width = meta2.codecWidth;
  116188. mi.height = meta2.codecHeight;
  116189. mi.fps = meta2.frameRate.fps;
  116190. mi.profile = meta2.profile;
  116191. mi.level = meta2.level;
  116192. mi.refFrames = config.ref_frames;
  116193. mi.chromaFormat = config.chroma_format_string;
  116194. mi.sarNum = meta2.sarRatio.width;
  116195. mi.sarDen = meta2.sarRatio.height;
  116196. mi.videoCodec = codecString;
  116197. if (mi.hasAudio) {
  116198. if (mi.audioCodec != null) {
  116199. mi.mimeType = 'video/x-flv; codecs="' + mi.videoCodec + "," + mi.audioCodec + '"';
  116200. }
  116201. } else {
  116202. mi.mimeType = 'video/x-flv; codecs="' + mi.videoCodec + '"';
  116203. }
  116204. if (mi.isComplete()) {
  116205. this._onMediaInfo(mi);
  116206. }
  116207. }
  116208. var ppsCount = v.getUint8(offset);
  116209. if (ppsCount === 0) {
  116210. this._onError(_demux_errors_js__WEBPACK_IMPORTED_MODULE_3__.default.FORMAT_ERROR, "Flv: Invalid AVCDecoderConfigurationRecord: No PPS");
  116211. return;
  116212. } else if (ppsCount > 1) {
  116213. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Flv: Strange AVCDecoderConfigurationRecord: PPS Count = " + ppsCount);
  116214. }
  116215. offset++;
  116216. for (var i2 = 0; i2 < ppsCount; i2++) {
  116217. var len = v.getUint16(offset, !le);
  116218. offset += 2;
  116219. if (len === 0) {
  116220. continue;
  116221. }
  116222. offset += len;
  116223. }
  116224. meta2.avcc = new Uint8Array(dataSize);
  116225. meta2.avcc.set(new Uint8Array(arrayBuffer, dataOffset, dataSize), 0);
  116226. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.v(this.TAG, "Parsed AVCDecoderConfigurationRecord");
  116227. if (this._isInitialMetadataDispatched()) {
  116228. if (this._dispatch && (this._audioTrack.length || this._videoTrack.length)) {
  116229. this._onDataAvailable(this._audioTrack, this._videoTrack);
  116230. }
  116231. } else {
  116232. this._videoInitialMetadataDispatched = true;
  116233. }
  116234. this._dispatch = false;
  116235. this._onTrackMetadata("video", meta2);
  116236. };
  116237. FLVDemuxer2.prototype._parseAVCVideoData = function(arrayBuffer, dataOffset, dataSize, tagTimestamp, tagPosition, frameType, cts) {
  116238. var le = this._littleEndian;
  116239. var v = new DataView(arrayBuffer, dataOffset, dataSize);
  116240. var units = [], length = 0;
  116241. var offset = 0;
  116242. var lengthSize = this._naluLengthSize;
  116243. var dts = this._timestampBase + tagTimestamp;
  116244. var keyframe = frameType === 1;
  116245. while (offset < dataSize) {
  116246. if (offset + 4 >= dataSize) {
  116247. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Malformed Nalu near timestamp " + dts + ", offset = " + offset + ", dataSize = " + dataSize);
  116248. break;
  116249. }
  116250. var naluSize = v.getUint32(offset, !le);
  116251. if (lengthSize === 3) {
  116252. naluSize >>>= 8;
  116253. }
  116254. if (naluSize > dataSize - lengthSize) {
  116255. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Malformed Nalus near timestamp " + dts + ", NaluSize > DataSize!");
  116256. return;
  116257. }
  116258. var unitType = v.getUint8(offset + lengthSize) & 31;
  116259. if (unitType === 5) {
  116260. keyframe = true;
  116261. }
  116262. var data = new Uint8Array(arrayBuffer, dataOffset + offset, lengthSize + naluSize);
  116263. var unit = { type: unitType, data };
  116264. units.push(unit);
  116265. length += data.byteLength;
  116266. offset += lengthSize + naluSize;
  116267. }
  116268. if (units.length) {
  116269. var track = this._videoTrack;
  116270. var avcSample = {
  116271. units,
  116272. length,
  116273. isKeyframe: keyframe,
  116274. dts,
  116275. cts,
  116276. pts: dts + cts
  116277. };
  116278. if (keyframe) {
  116279. avcSample.fileposition = tagPosition;
  116280. }
  116281. track.samples.push(avcSample);
  116282. track.length += length;
  116283. }
  116284. };
  116285. return FLVDemuxer2;
  116286. }();
  116287. __webpack_exports__2["default"] = FLVDemuxer;
  116288. },
  116289. "./src/demux/sps-parser.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  116290. __webpack_require__2.r(__webpack_exports__2);
  116291. var _exp_golomb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/demux/exp-golomb.js");
  116292. var SPSParser = function() {
  116293. function SPSParser2() {
  116294. }
  116295. SPSParser2._ebsp2rbsp = function(uint8array) {
  116296. var src = uint8array;
  116297. var src_length = src.byteLength;
  116298. var dst = new Uint8Array(src_length);
  116299. var dst_idx = 0;
  116300. for (var i2 = 0; i2 < src_length; i2++) {
  116301. if (i2 >= 2) {
  116302. if (src[i2] === 3 && src[i2 - 1] === 0 && src[i2 - 2] === 0) {
  116303. continue;
  116304. }
  116305. }
  116306. dst[dst_idx] = src[i2];
  116307. dst_idx++;
  116308. }
  116309. return new Uint8Array(dst.buffer, 0, dst_idx);
  116310. };
  116311. SPSParser2.parseSPS = function(uint8array) {
  116312. var rbsp = SPSParser2._ebsp2rbsp(uint8array);
  116313. var gb = new _exp_golomb_js__WEBPACK_IMPORTED_MODULE_0__.default(rbsp);
  116314. gb.readByte();
  116315. var profile_idc = gb.readByte();
  116316. gb.readByte();
  116317. var level_idc = gb.readByte();
  116318. gb.readUEG();
  116319. var profile_string = SPSParser2.getProfileString(profile_idc);
  116320. var level_string = SPSParser2.getLevelString(level_idc);
  116321. var chroma_format_idc = 1;
  116322. var chroma_format = 420;
  116323. var chroma_format_table = [0, 420, 422, 444];
  116324. var bit_depth = 8;
  116325. if (profile_idc === 100 || profile_idc === 110 || profile_idc === 122 || profile_idc === 244 || profile_idc === 44 || profile_idc === 83 || profile_idc === 86 || profile_idc === 118 || profile_idc === 128 || profile_idc === 138 || profile_idc === 144) {
  116326. chroma_format_idc = gb.readUEG();
  116327. if (chroma_format_idc === 3) {
  116328. gb.readBits(1);
  116329. }
  116330. if (chroma_format_idc <= 3) {
  116331. chroma_format = chroma_format_table[chroma_format_idc];
  116332. }
  116333. bit_depth = gb.readUEG() + 8;
  116334. gb.readUEG();
  116335. gb.readBits(1);
  116336. if (gb.readBool()) {
  116337. var scaling_list_count = chroma_format_idc !== 3 ? 8 : 12;
  116338. for (var i2 = 0; i2 < scaling_list_count; i2++) {
  116339. if (gb.readBool()) {
  116340. if (i2 < 6) {
  116341. SPSParser2._skipScalingList(gb, 16);
  116342. } else {
  116343. SPSParser2._skipScalingList(gb, 64);
  116344. }
  116345. }
  116346. }
  116347. }
  116348. }
  116349. gb.readUEG();
  116350. var pic_order_cnt_type = gb.readUEG();
  116351. if (pic_order_cnt_type === 0) {
  116352. gb.readUEG();
  116353. } else if (pic_order_cnt_type === 1) {
  116354. gb.readBits(1);
  116355. gb.readSEG();
  116356. gb.readSEG();
  116357. var num_ref_frames_in_pic_order_cnt_cycle = gb.readUEG();
  116358. for (var i2 = 0; i2 < num_ref_frames_in_pic_order_cnt_cycle; i2++) {
  116359. gb.readSEG();
  116360. }
  116361. }
  116362. var ref_frames = gb.readUEG();
  116363. gb.readBits(1);
  116364. var pic_width_in_mbs_minus1 = gb.readUEG();
  116365. var pic_height_in_map_units_minus1 = gb.readUEG();
  116366. var frame_mbs_only_flag = gb.readBits(1);
  116367. if (frame_mbs_only_flag === 0) {
  116368. gb.readBits(1);
  116369. }
  116370. gb.readBits(1);
  116371. var frame_crop_left_offset = 0;
  116372. var frame_crop_right_offset = 0;
  116373. var frame_crop_top_offset = 0;
  116374. var frame_crop_bottom_offset = 0;
  116375. var frame_cropping_flag = gb.readBool();
  116376. if (frame_cropping_flag) {
  116377. frame_crop_left_offset = gb.readUEG();
  116378. frame_crop_right_offset = gb.readUEG();
  116379. frame_crop_top_offset = gb.readUEG();
  116380. frame_crop_bottom_offset = gb.readUEG();
  116381. }
  116382. var sar_width = 1, sar_height = 1;
  116383. var fps = 0, fps_fixed = true, fps_num = 0, fps_den = 0;
  116384. var vui_parameters_present_flag = gb.readBool();
  116385. if (vui_parameters_present_flag) {
  116386. if (gb.readBool()) {
  116387. var aspect_ratio_idc = gb.readByte();
  116388. var sar_w_table = [1, 12, 10, 16, 40, 24, 20, 32, 80, 18, 15, 64, 160, 4, 3, 2];
  116389. var sar_h_table = [1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99, 3, 2, 1];
  116390. if (aspect_ratio_idc > 0 && aspect_ratio_idc < 16) {
  116391. sar_width = sar_w_table[aspect_ratio_idc - 1];
  116392. sar_height = sar_h_table[aspect_ratio_idc - 1];
  116393. } else if (aspect_ratio_idc === 255) {
  116394. sar_width = gb.readByte() << 8 | gb.readByte();
  116395. sar_height = gb.readByte() << 8 | gb.readByte();
  116396. }
  116397. }
  116398. if (gb.readBool()) {
  116399. gb.readBool();
  116400. }
  116401. if (gb.readBool()) {
  116402. gb.readBits(4);
  116403. if (gb.readBool()) {
  116404. gb.readBits(24);
  116405. }
  116406. }
  116407. if (gb.readBool()) {
  116408. gb.readUEG();
  116409. gb.readUEG();
  116410. }
  116411. if (gb.readBool()) {
  116412. var num_units_in_tick = gb.readBits(32);
  116413. var time_scale = gb.readBits(32);
  116414. fps_fixed = gb.readBool();
  116415. fps_num = time_scale;
  116416. fps_den = num_units_in_tick * 2;
  116417. fps = fps_num / fps_den;
  116418. }
  116419. }
  116420. var sarScale = 1;
  116421. if (sar_width !== 1 || sar_height !== 1) {
  116422. sarScale = sar_width / sar_height;
  116423. }
  116424. var crop_unit_x = 0, crop_unit_y = 0;
  116425. if (chroma_format_idc === 0) {
  116426. crop_unit_x = 1;
  116427. crop_unit_y = 2 - frame_mbs_only_flag;
  116428. } else {
  116429. var sub_wc = chroma_format_idc === 3 ? 1 : 2;
  116430. var sub_hc = chroma_format_idc === 1 ? 2 : 1;
  116431. crop_unit_x = sub_wc;
  116432. crop_unit_y = sub_hc * (2 - frame_mbs_only_flag);
  116433. }
  116434. var codec_width = (pic_width_in_mbs_minus1 + 1) * 16;
  116435. var codec_height = (2 - frame_mbs_only_flag) * ((pic_height_in_map_units_minus1 + 1) * 16);
  116436. codec_width -= (frame_crop_left_offset + frame_crop_right_offset) * crop_unit_x;
  116437. codec_height -= (frame_crop_top_offset + frame_crop_bottom_offset) * crop_unit_y;
  116438. var present_width = Math.ceil(codec_width * sarScale);
  116439. gb.destroy();
  116440. gb = null;
  116441. return {
  116442. profile_string,
  116443. level_string,
  116444. bit_depth,
  116445. ref_frames,
  116446. chroma_format,
  116447. chroma_format_string: SPSParser2.getChromaFormatString(chroma_format),
  116448. frame_rate: {
  116449. fixed: fps_fixed,
  116450. fps,
  116451. fps_den,
  116452. fps_num
  116453. },
  116454. sar_ratio: {
  116455. width: sar_width,
  116456. height: sar_height
  116457. },
  116458. codec_size: {
  116459. width: codec_width,
  116460. height: codec_height
  116461. },
  116462. present_size: {
  116463. width: present_width,
  116464. height: codec_height
  116465. }
  116466. };
  116467. };
  116468. SPSParser2._skipScalingList = function(gb, count) {
  116469. var last_scale = 8, next_scale = 8;
  116470. var delta_scale = 0;
  116471. for (var i2 = 0; i2 < count; i2++) {
  116472. if (next_scale !== 0) {
  116473. delta_scale = gb.readSEG();
  116474. next_scale = (last_scale + delta_scale + 256) % 256;
  116475. }
  116476. last_scale = next_scale === 0 ? last_scale : next_scale;
  116477. }
  116478. };
  116479. SPSParser2.getProfileString = function(profile_idc) {
  116480. switch (profile_idc) {
  116481. case 66:
  116482. return "Baseline";
  116483. case 77:
  116484. return "Main";
  116485. case 88:
  116486. return "Extended";
  116487. case 100:
  116488. return "High";
  116489. case 110:
  116490. return "High10";
  116491. case 122:
  116492. return "High422";
  116493. case 244:
  116494. return "High444";
  116495. default:
  116496. return "Unknown";
  116497. }
  116498. };
  116499. SPSParser2.getLevelString = function(level_idc) {
  116500. return (level_idc / 10).toFixed(1);
  116501. };
  116502. SPSParser2.getChromaFormatString = function(chroma) {
  116503. switch (chroma) {
  116504. case 420:
  116505. return "4:2:0";
  116506. case 422:
  116507. return "4:2:2";
  116508. case 444:
  116509. return "4:4:4";
  116510. default:
  116511. return "Unknown";
  116512. }
  116513. };
  116514. return SPSParser2;
  116515. }();
  116516. __webpack_exports__2["default"] = SPSParser;
  116517. },
  116518. "./src/flv.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  116519. __webpack_require__2.r(__webpack_exports__2);
  116520. var _utils_polyfill_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/polyfill.js");
  116521. var _core_features_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/core/features.js");
  116522. var _io_loader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/io/loader.js");
  116523. var _player_flv_player_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/player/flv-player.js");
  116524. var _player_native_player_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/player/native-player.js");
  116525. var _player_player_events_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/player/player-events.js");
  116526. var _player_player_errors_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__2("./src/player/player-errors.js");
  116527. var _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__2("./src/utils/logging-control.js");
  116528. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__2("./src/utils/exception.js");
  116529. _utils_polyfill_js__WEBPACK_IMPORTED_MODULE_0__.default.install();
  116530. function createPlayer(mediaDataSource, optionalConfig) {
  116531. var mds = mediaDataSource;
  116532. if (mds == null || typeof mds !== "object") {
  116533. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_8__.InvalidArgumentException("MediaDataSource must be an javascript object!");
  116534. }
  116535. if (!mds.hasOwnProperty("type")) {
  116536. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_8__.InvalidArgumentException("MediaDataSource must has type field to indicate video file type!");
  116537. }
  116538. switch (mds.type) {
  116539. case "flv":
  116540. return new _player_flv_player_js__WEBPACK_IMPORTED_MODULE_3__.default(mds, optionalConfig);
  116541. default:
  116542. return new _player_native_player_js__WEBPACK_IMPORTED_MODULE_4__.default(mds, optionalConfig);
  116543. }
  116544. }
  116545. function isSupported() {
  116546. return _core_features_js__WEBPACK_IMPORTED_MODULE_1__.default.supportMSEH264Playback();
  116547. }
  116548. function getFeatureList() {
  116549. return _core_features_js__WEBPACK_IMPORTED_MODULE_1__.default.getFeatureList();
  116550. }
  116551. var flvjs2 = {};
  116552. flvjs2.createPlayer = createPlayer;
  116553. flvjs2.isSupported = isSupported;
  116554. flvjs2.getFeatureList = getFeatureList;
  116555. flvjs2.BaseLoader = _io_loader_js__WEBPACK_IMPORTED_MODULE_2__.BaseLoader;
  116556. flvjs2.LoaderStatus = _io_loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus;
  116557. flvjs2.LoaderErrors = _io_loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors;
  116558. flvjs2.Events = _player_player_events_js__WEBPACK_IMPORTED_MODULE_5__.default;
  116559. flvjs2.ErrorTypes = _player_player_errors_js__WEBPACK_IMPORTED_MODULE_6__.ErrorTypes;
  116560. flvjs2.ErrorDetails = _player_player_errors_js__WEBPACK_IMPORTED_MODULE_6__.ErrorDetails;
  116561. flvjs2.FlvPlayer = _player_flv_player_js__WEBPACK_IMPORTED_MODULE_3__.default;
  116562. flvjs2.NativePlayer = _player_native_player_js__WEBPACK_IMPORTED_MODULE_4__.default;
  116563. flvjs2.LoggingControl = _utils_logging_control_js__WEBPACK_IMPORTED_MODULE_7__.default;
  116564. Object.defineProperty(flvjs2, "version", {
  116565. enumerable: true,
  116566. get: function() {
  116567. return "1.6.2";
  116568. }
  116569. });
  116570. __webpack_exports__2["default"] = flvjs2;
  116571. },
  116572. "./src/index.js": function(module3, __unused_webpack_exports, __webpack_require__2) {
  116573. module3.exports = __webpack_require__2("./src/flv.js").default;
  116574. },
  116575. "./src/io/fetch-stream-loader.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  116576. __webpack_require__2.r(__webpack_exports__2);
  116577. var _utils_browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/browser.js");
  116578. var _loader_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/io/loader.js");
  116579. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/exception.js");
  116580. var __extends = function() {
  116581. var extendStatics = function(d2, b) {
  116582. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) {
  116583. d3.__proto__ = b2;
  116584. } || function(d3, b2) {
  116585. for (var p in b2)
  116586. if (Object.prototype.hasOwnProperty.call(b2, p))
  116587. d3[p] = b2[p];
  116588. };
  116589. return extendStatics(d2, b);
  116590. };
  116591. return function(d2, b) {
  116592. if (typeof b !== "function" && b !== null)
  116593. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  116594. extendStatics(d2, b);
  116595. function __() {
  116596. this.constructor = d2;
  116597. }
  116598. d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  116599. };
  116600. }();
  116601. var FetchStreamLoader = function(_super) {
  116602. __extends(FetchStreamLoader2, _super);
  116603. function FetchStreamLoader2(seekHandler, config) {
  116604. var _this = _super.call(this, "fetch-stream-loader") || this;
  116605. _this.TAG = "FetchStreamLoader";
  116606. _this._seekHandler = seekHandler;
  116607. _this._config = config;
  116608. _this._needStash = true;
  116609. _this._requestAbort = false;
  116610. _this._contentLength = null;
  116611. _this._receivedLength = 0;
  116612. return _this;
  116613. }
  116614. FetchStreamLoader2.isSupported = function() {
  116615. try {
  116616. var isWorkWellEdge = _utils_browser_js__WEBPACK_IMPORTED_MODULE_0__.default.msedge && _utils_browser_js__WEBPACK_IMPORTED_MODULE_0__.default.version.minor >= 15048;
  116617. var browserNotBlacklisted = _utils_browser_js__WEBPACK_IMPORTED_MODULE_0__.default.msedge ? isWorkWellEdge : true;
  116618. return self.fetch && self.ReadableStream && browserNotBlacklisted;
  116619. } catch (e) {
  116620. return false;
  116621. }
  116622. };
  116623. FetchStreamLoader2.prototype.destroy = function() {
  116624. if (this.isWorking()) {
  116625. this.abort();
  116626. }
  116627. _super.prototype.destroy.call(this);
  116628. };
  116629. FetchStreamLoader2.prototype.open = function(dataSource, range3) {
  116630. var _this = this;
  116631. this._dataSource = dataSource;
  116632. this._range = range3;
  116633. var sourceURL = dataSource.url;
  116634. if (this._config.reuseRedirectedURL && dataSource.redirectedURL != void 0) {
  116635. sourceURL = dataSource.redirectedURL;
  116636. }
  116637. var seekConfig = this._seekHandler.getConfig(sourceURL, range3);
  116638. var headers = new self.Headers();
  116639. if (typeof seekConfig.headers === "object") {
  116640. var configHeaders = seekConfig.headers;
  116641. for (var key in configHeaders) {
  116642. if (configHeaders.hasOwnProperty(key)) {
  116643. headers.append(key, configHeaders[key]);
  116644. }
  116645. }
  116646. }
  116647. var params = {
  116648. method: "GET",
  116649. headers,
  116650. mode: "cors",
  116651. cache: "default",
  116652. referrerPolicy: "no-referrer-when-downgrade"
  116653. };
  116654. if (typeof this._config.headers === "object") {
  116655. for (var key in this._config.headers) {
  116656. headers.append(key, this._config.headers[key]);
  116657. }
  116658. }
  116659. if (dataSource.cors === false) {
  116660. params.mode = "same-origin";
  116661. }
  116662. if (dataSource.withCredentials) {
  116663. params.credentials = "include";
  116664. }
  116665. if (dataSource.referrerPolicy) {
  116666. params.referrerPolicy = dataSource.referrerPolicy;
  116667. }
  116668. if (self.AbortController) {
  116669. this._abortController = new self.AbortController();
  116670. params.signal = this._abortController.signal;
  116671. }
  116672. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kConnecting;
  116673. self.fetch(seekConfig.url, params).then(function(res) {
  116674. if (_this._requestAbort) {
  116675. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kIdle;
  116676. res.body.cancel();
  116677. return;
  116678. }
  116679. if (res.ok && (res.status >= 200 && res.status <= 299)) {
  116680. if (res.url !== seekConfig.url) {
  116681. if (_this._onURLRedirect) {
  116682. var redirectedURL = _this._seekHandler.removeURLParameters(res.url);
  116683. _this._onURLRedirect(redirectedURL);
  116684. }
  116685. }
  116686. var lengthHeader = res.headers.get("Content-Length");
  116687. if (lengthHeader != null) {
  116688. _this._contentLength = parseInt(lengthHeader);
  116689. if (_this._contentLength !== 0) {
  116690. if (_this._onContentLengthKnown) {
  116691. _this._onContentLengthKnown(_this._contentLength);
  116692. }
  116693. }
  116694. }
  116695. return _this._pump.call(_this, res.body.getReader());
  116696. } else {
  116697. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  116698. if (_this._onError) {
  116699. _this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.HTTP_STATUS_CODE_INVALID, { code: res.status, msg: res.statusText });
  116700. } else {
  116701. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.RuntimeException("FetchStreamLoader: Http code invalid, " + res.status + " " + res.statusText);
  116702. }
  116703. }
  116704. }).catch(function(e) {
  116705. if (_this._abortController && _this._abortController.signal.aborted) {
  116706. return;
  116707. }
  116708. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  116709. if (_this._onError) {
  116710. _this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EXCEPTION, { code: -1, msg: e.message });
  116711. } else {
  116712. throw e;
  116713. }
  116714. });
  116715. };
  116716. FetchStreamLoader2.prototype.abort = function() {
  116717. this._requestAbort = true;
  116718. if (this._status !== _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kBuffering || !_utils_browser_js__WEBPACK_IMPORTED_MODULE_0__.default.chrome) {
  116719. if (this._abortController) {
  116720. try {
  116721. this._abortController.abort();
  116722. } catch (e) {
  116723. }
  116724. }
  116725. }
  116726. };
  116727. FetchStreamLoader2.prototype._pump = function(reader) {
  116728. var _this = this;
  116729. return reader.read().then(function(result) {
  116730. if (result.done) {
  116731. if (_this._contentLength !== null && _this._receivedLength < _this._contentLength) {
  116732. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  116733. var type2 = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EARLY_EOF;
  116734. var info = { code: -1, msg: "Fetch stream meet Early-EOF" };
  116735. if (_this._onError) {
  116736. _this._onError(type2, info);
  116737. } else {
  116738. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.RuntimeException(info.msg);
  116739. }
  116740. } else {
  116741. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  116742. if (_this._onComplete) {
  116743. _this._onComplete(_this._range.from, _this._range.from + _this._receivedLength - 1);
  116744. }
  116745. }
  116746. } else {
  116747. if (_this._abortController && _this._abortController.signal.aborted) {
  116748. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  116749. return;
  116750. } else if (_this._requestAbort === true) {
  116751. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  116752. return reader.cancel();
  116753. }
  116754. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kBuffering;
  116755. var chunk = result.value.buffer;
  116756. var byteStart = _this._range.from + _this._receivedLength;
  116757. _this._receivedLength += chunk.byteLength;
  116758. if (_this._onDataArrival) {
  116759. _this._onDataArrival(chunk, byteStart, _this._receivedLength);
  116760. }
  116761. _this._pump(reader);
  116762. }
  116763. }).catch(function(e) {
  116764. if (_this._abortController && _this._abortController.signal.aborted) {
  116765. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  116766. return;
  116767. }
  116768. if (e.code === 11 && _utils_browser_js__WEBPACK_IMPORTED_MODULE_0__.default.msedge) {
  116769. return;
  116770. }
  116771. _this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  116772. var type2 = 0;
  116773. var info = null;
  116774. if ((e.code === 19 || e.message === "network error") && (_this._contentLength === null || _this._contentLength !== null && _this._receivedLength < _this._contentLength)) {
  116775. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EARLY_EOF;
  116776. info = { code: e.code, msg: "Fetch stream meet Early-EOF" };
  116777. } else {
  116778. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EXCEPTION;
  116779. info = { code: e.code, msg: e.message };
  116780. }
  116781. if (_this._onError) {
  116782. _this._onError(type2, info);
  116783. } else {
  116784. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.RuntimeException(info.msg);
  116785. }
  116786. });
  116787. };
  116788. return FetchStreamLoader2;
  116789. }(_loader_js__WEBPACK_IMPORTED_MODULE_1__.BaseLoader);
  116790. __webpack_exports__2["default"] = FetchStreamLoader;
  116791. },
  116792. "./src/io/io-controller.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  116793. __webpack_require__2.r(__webpack_exports__2);
  116794. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  116795. var _speed_sampler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/io/speed-sampler.js");
  116796. var _loader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/io/loader.js");
  116797. var _fetch_stream_loader_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/io/fetch-stream-loader.js");
  116798. var _xhr_moz_chunked_loader_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/io/xhr-moz-chunked-loader.js");
  116799. var _xhr_range_loader_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/io/xhr-range-loader.js");
  116800. var _websocket_loader_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__2("./src/io/websocket-loader.js");
  116801. var _range_seek_handler_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__2("./src/io/range-seek-handler.js");
  116802. var _param_seek_handler_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__2("./src/io/param-seek-handler.js");
  116803. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__2("./src/utils/exception.js");
  116804. var IOController = function() {
  116805. function IOController2(dataSource, config, extraData) {
  116806. this.TAG = "IOController";
  116807. this._config = config;
  116808. this._extraData = extraData;
  116809. this._stashInitialSize = 1024 * 384;
  116810. if (config.stashInitialSize != void 0 && config.stashInitialSize > 0) {
  116811. this._stashInitialSize = config.stashInitialSize;
  116812. }
  116813. this._stashUsed = 0;
  116814. this._stashSize = this._stashInitialSize;
  116815. this._bufferSize = 1024 * 1024 * 3;
  116816. this._stashBuffer = new ArrayBuffer(this._bufferSize);
  116817. this._stashByteStart = 0;
  116818. this._enableStash = true;
  116819. if (config.enableStashBuffer === false) {
  116820. this._enableStash = false;
  116821. }
  116822. this._loader = null;
  116823. this._loaderClass = null;
  116824. this._seekHandler = null;
  116825. this._dataSource = dataSource;
  116826. this._isWebSocketURL = /wss?:\/\/(.+?)/.test(dataSource.url);
  116827. this._refTotalLength = dataSource.filesize ? dataSource.filesize : null;
  116828. this._totalLength = this._refTotalLength;
  116829. this._fullRequestFlag = false;
  116830. this._currentRange = null;
  116831. this._redirectedURL = null;
  116832. this._speedNormalized = 0;
  116833. this._speedSampler = new _speed_sampler_js__WEBPACK_IMPORTED_MODULE_1__.default();
  116834. this._speedNormalizeList = [64, 128, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096];
  116835. this._isEarlyEofReconnecting = false;
  116836. this._paused = false;
  116837. this._resumeFrom = 0;
  116838. this._onDataArrival = null;
  116839. this._onSeeked = null;
  116840. this._onError = null;
  116841. this._onComplete = null;
  116842. this._onRedirect = null;
  116843. this._onRecoveredEarlyEof = null;
  116844. this._selectSeekHandler();
  116845. this._selectLoader();
  116846. this._createLoader();
  116847. }
  116848. IOController2.prototype.destroy = function() {
  116849. if (this._loader.isWorking()) {
  116850. this._loader.abort();
  116851. }
  116852. this._loader.destroy();
  116853. this._loader = null;
  116854. this._loaderClass = null;
  116855. this._dataSource = null;
  116856. this._stashBuffer = null;
  116857. this._stashUsed = this._stashSize = this._bufferSize = this._stashByteStart = 0;
  116858. this._currentRange = null;
  116859. this._speedSampler = null;
  116860. this._isEarlyEofReconnecting = false;
  116861. this._onDataArrival = null;
  116862. this._onSeeked = null;
  116863. this._onError = null;
  116864. this._onComplete = null;
  116865. this._onRedirect = null;
  116866. this._onRecoveredEarlyEof = null;
  116867. this._extraData = null;
  116868. };
  116869. IOController2.prototype.isWorking = function() {
  116870. return this._loader && this._loader.isWorking() && !this._paused;
  116871. };
  116872. IOController2.prototype.isPaused = function() {
  116873. return this._paused;
  116874. };
  116875. Object.defineProperty(IOController2.prototype, "status", {
  116876. get: function() {
  116877. return this._loader.status;
  116878. },
  116879. enumerable: false,
  116880. configurable: true
  116881. });
  116882. Object.defineProperty(IOController2.prototype, "extraData", {
  116883. get: function() {
  116884. return this._extraData;
  116885. },
  116886. set: function(data) {
  116887. this._extraData = data;
  116888. },
  116889. enumerable: false,
  116890. configurable: true
  116891. });
  116892. Object.defineProperty(IOController2.prototype, "onDataArrival", {
  116893. get: function() {
  116894. return this._onDataArrival;
  116895. },
  116896. set: function(callback2) {
  116897. this._onDataArrival = callback2;
  116898. },
  116899. enumerable: false,
  116900. configurable: true
  116901. });
  116902. Object.defineProperty(IOController2.prototype, "onSeeked", {
  116903. get: function() {
  116904. return this._onSeeked;
  116905. },
  116906. set: function(callback2) {
  116907. this._onSeeked = callback2;
  116908. },
  116909. enumerable: false,
  116910. configurable: true
  116911. });
  116912. Object.defineProperty(IOController2.prototype, "onError", {
  116913. get: function() {
  116914. return this._onError;
  116915. },
  116916. set: function(callback2) {
  116917. this._onError = callback2;
  116918. },
  116919. enumerable: false,
  116920. configurable: true
  116921. });
  116922. Object.defineProperty(IOController2.prototype, "onComplete", {
  116923. get: function() {
  116924. return this._onComplete;
  116925. },
  116926. set: function(callback2) {
  116927. this._onComplete = callback2;
  116928. },
  116929. enumerable: false,
  116930. configurable: true
  116931. });
  116932. Object.defineProperty(IOController2.prototype, "onRedirect", {
  116933. get: function() {
  116934. return this._onRedirect;
  116935. },
  116936. set: function(callback2) {
  116937. this._onRedirect = callback2;
  116938. },
  116939. enumerable: false,
  116940. configurable: true
  116941. });
  116942. Object.defineProperty(IOController2.prototype, "onRecoveredEarlyEof", {
  116943. get: function() {
  116944. return this._onRecoveredEarlyEof;
  116945. },
  116946. set: function(callback2) {
  116947. this._onRecoveredEarlyEof = callback2;
  116948. },
  116949. enumerable: false,
  116950. configurable: true
  116951. });
  116952. Object.defineProperty(IOController2.prototype, "currentURL", {
  116953. get: function() {
  116954. return this._dataSource.url;
  116955. },
  116956. enumerable: false,
  116957. configurable: true
  116958. });
  116959. Object.defineProperty(IOController2.prototype, "hasRedirect", {
  116960. get: function() {
  116961. return this._redirectedURL != null || this._dataSource.redirectedURL != void 0;
  116962. },
  116963. enumerable: false,
  116964. configurable: true
  116965. });
  116966. Object.defineProperty(IOController2.prototype, "currentRedirectedURL", {
  116967. get: function() {
  116968. return this._redirectedURL || this._dataSource.redirectedURL;
  116969. },
  116970. enumerable: false,
  116971. configurable: true
  116972. });
  116973. Object.defineProperty(IOController2.prototype, "currentSpeed", {
  116974. get: function() {
  116975. if (this._loaderClass === _xhr_range_loader_js__WEBPACK_IMPORTED_MODULE_5__.default) {
  116976. return this._loader.currentSpeed;
  116977. }
  116978. return this._speedSampler.lastSecondKBps;
  116979. },
  116980. enumerable: false,
  116981. configurable: true
  116982. });
  116983. Object.defineProperty(IOController2.prototype, "loaderType", {
  116984. get: function() {
  116985. return this._loader.type;
  116986. },
  116987. enumerable: false,
  116988. configurable: true
  116989. });
  116990. IOController2.prototype._selectSeekHandler = function() {
  116991. var config = this._config;
  116992. if (config.seekType === "range") {
  116993. this._seekHandler = new _range_seek_handler_js__WEBPACK_IMPORTED_MODULE_7__.default(this._config.rangeLoadZeroStart);
  116994. } else if (config.seekType === "param") {
  116995. var paramStart = config.seekParamStart || "bstart";
  116996. var paramEnd = config.seekParamEnd || "bend";
  116997. this._seekHandler = new _param_seek_handler_js__WEBPACK_IMPORTED_MODULE_8__.default(paramStart, paramEnd);
  116998. } else if (config.seekType === "custom") {
  116999. if (typeof config.customSeekHandler !== "function") {
  117000. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.InvalidArgumentException("Custom seekType specified in config but invalid customSeekHandler!");
  117001. }
  117002. this._seekHandler = new config.customSeekHandler();
  117003. } else {
  117004. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.InvalidArgumentException("Invalid seekType in config: " + config.seekType);
  117005. }
  117006. };
  117007. IOController2.prototype._selectLoader = function() {
  117008. if (this._config.customLoader != null) {
  117009. this._loaderClass = this._config.customLoader;
  117010. } else if (this._isWebSocketURL) {
  117011. this._loaderClass = _websocket_loader_js__WEBPACK_IMPORTED_MODULE_6__.default;
  117012. } else if (_fetch_stream_loader_js__WEBPACK_IMPORTED_MODULE_3__.default.isSupported()) {
  117013. this._loaderClass = _fetch_stream_loader_js__WEBPACK_IMPORTED_MODULE_3__.default;
  117014. } else if (_xhr_moz_chunked_loader_js__WEBPACK_IMPORTED_MODULE_4__.default.isSupported()) {
  117015. this._loaderClass = _xhr_moz_chunked_loader_js__WEBPACK_IMPORTED_MODULE_4__.default;
  117016. } else if (_xhr_range_loader_js__WEBPACK_IMPORTED_MODULE_5__.default.isSupported()) {
  117017. this._loaderClass = _xhr_range_loader_js__WEBPACK_IMPORTED_MODULE_5__.default;
  117018. } else {
  117019. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.RuntimeException("Your browser doesn't support xhr with arraybuffer responseType!");
  117020. }
  117021. };
  117022. IOController2.prototype._createLoader = function() {
  117023. this._loader = new this._loaderClass(this._seekHandler, this._config);
  117024. if (this._loader.needStashBuffer === false) {
  117025. this._enableStash = false;
  117026. }
  117027. this._loader.onContentLengthKnown = this._onContentLengthKnown.bind(this);
  117028. this._loader.onURLRedirect = this._onURLRedirect.bind(this);
  117029. this._loader.onDataArrival = this._onLoaderChunkArrival.bind(this);
  117030. this._loader.onComplete = this._onLoaderComplete.bind(this);
  117031. this._loader.onError = this._onLoaderError.bind(this);
  117032. };
  117033. IOController2.prototype.open = function(optionalFrom) {
  117034. this._currentRange = { from: 0, to: -1 };
  117035. if (optionalFrom) {
  117036. this._currentRange.from = optionalFrom;
  117037. }
  117038. this._speedSampler.reset();
  117039. if (!optionalFrom) {
  117040. this._fullRequestFlag = true;
  117041. }
  117042. this._loader.open(this._dataSource, Object.assign({}, this._currentRange));
  117043. };
  117044. IOController2.prototype.abort = function() {
  117045. this._loader.abort();
  117046. if (this._paused) {
  117047. this._paused = false;
  117048. this._resumeFrom = 0;
  117049. }
  117050. };
  117051. IOController2.prototype.pause = function() {
  117052. if (this.isWorking()) {
  117053. this._loader.abort();
  117054. if (this._stashUsed !== 0) {
  117055. this._resumeFrom = this._stashByteStart;
  117056. this._currentRange.to = this._stashByteStart - 1;
  117057. } else {
  117058. this._resumeFrom = this._currentRange.to + 1;
  117059. }
  117060. this._stashUsed = 0;
  117061. this._stashByteStart = 0;
  117062. this._paused = true;
  117063. }
  117064. };
  117065. IOController2.prototype.resume = function() {
  117066. if (this._paused) {
  117067. this._paused = false;
  117068. var bytes = this._resumeFrom;
  117069. this._resumeFrom = 0;
  117070. this._internalSeek(bytes, true);
  117071. }
  117072. };
  117073. IOController2.prototype.seek = function(bytes) {
  117074. this._paused = false;
  117075. this._stashUsed = 0;
  117076. this._stashByteStart = 0;
  117077. this._internalSeek(bytes, true);
  117078. };
  117079. IOController2.prototype._internalSeek = function(bytes, dropUnconsumed) {
  117080. if (this._loader.isWorking()) {
  117081. this._loader.abort();
  117082. }
  117083. this._flushStashBuffer(dropUnconsumed);
  117084. this._loader.destroy();
  117085. this._loader = null;
  117086. var requestRange = { from: bytes, to: -1 };
  117087. this._currentRange = { from: requestRange.from, to: -1 };
  117088. this._speedSampler.reset();
  117089. this._stashSize = this._stashInitialSize;
  117090. this._createLoader();
  117091. this._loader.open(this._dataSource, requestRange);
  117092. if (this._onSeeked) {
  117093. this._onSeeked();
  117094. }
  117095. };
  117096. IOController2.prototype.updateUrl = function(url) {
  117097. if (!url || typeof url !== "string" || url.length === 0) {
  117098. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.InvalidArgumentException("Url must be a non-empty string!");
  117099. }
  117100. this._dataSource.url = url;
  117101. };
  117102. IOController2.prototype._expandBuffer = function(expectedBytes) {
  117103. var bufferNewSize = this._stashSize;
  117104. while (bufferNewSize + 1024 * 1024 * 1 < expectedBytes) {
  117105. bufferNewSize *= 2;
  117106. }
  117107. bufferNewSize += 1024 * 1024 * 1;
  117108. if (bufferNewSize === this._bufferSize) {
  117109. return;
  117110. }
  117111. var newBuffer = new ArrayBuffer(bufferNewSize);
  117112. if (this._stashUsed > 0) {
  117113. var stashOldArray = new Uint8Array(this._stashBuffer, 0, this._stashUsed);
  117114. var stashNewArray = new Uint8Array(newBuffer, 0, bufferNewSize);
  117115. stashNewArray.set(stashOldArray, 0);
  117116. }
  117117. this._stashBuffer = newBuffer;
  117118. this._bufferSize = bufferNewSize;
  117119. };
  117120. IOController2.prototype._normalizeSpeed = function(input) {
  117121. var list = this._speedNormalizeList;
  117122. var last = list.length - 1;
  117123. var mid = 0;
  117124. var lbound = 0;
  117125. var ubound = last;
  117126. if (input < list[0]) {
  117127. return list[0];
  117128. }
  117129. while (lbound <= ubound) {
  117130. mid = lbound + Math.floor((ubound - lbound) / 2);
  117131. if (mid === last || input >= list[mid] && input < list[mid + 1]) {
  117132. return list[mid];
  117133. } else if (list[mid] < input) {
  117134. lbound = mid + 1;
  117135. } else {
  117136. ubound = mid - 1;
  117137. }
  117138. }
  117139. };
  117140. IOController2.prototype._adjustStashSize = function(normalized) {
  117141. var stashSizeKB = 0;
  117142. if (this._config.isLive) {
  117143. stashSizeKB = normalized;
  117144. } else {
  117145. if (normalized < 512) {
  117146. stashSizeKB = normalized;
  117147. } else if (normalized >= 512 && normalized <= 1024) {
  117148. stashSizeKB = Math.floor(normalized * 1.5);
  117149. } else {
  117150. stashSizeKB = normalized * 2;
  117151. }
  117152. }
  117153. if (stashSizeKB > 8192) {
  117154. stashSizeKB = 8192;
  117155. }
  117156. var bufferSize = stashSizeKB * 1024 + 1024 * 1024 * 1;
  117157. if (this._bufferSize < bufferSize) {
  117158. this._expandBuffer(bufferSize);
  117159. }
  117160. this._stashSize = stashSizeKB * 1024;
  117161. };
  117162. IOController2.prototype._dispatchChunks = function(chunks, byteStart) {
  117163. this._currentRange.to = byteStart + chunks.byteLength - 1;
  117164. return this._onDataArrival(chunks, byteStart);
  117165. };
  117166. IOController2.prototype._onURLRedirect = function(redirectedURL) {
  117167. this._redirectedURL = redirectedURL;
  117168. if (this._onRedirect) {
  117169. this._onRedirect(redirectedURL);
  117170. }
  117171. };
  117172. IOController2.prototype._onContentLengthKnown = function(contentLength) {
  117173. if (contentLength && this._fullRequestFlag) {
  117174. this._totalLength = contentLength;
  117175. this._fullRequestFlag = false;
  117176. }
  117177. };
  117178. IOController2.prototype._onLoaderChunkArrival = function(chunk, byteStart, receivedLength) {
  117179. if (!this._onDataArrival) {
  117180. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.IllegalStateException("IOController: No existing consumer (onDataArrival) callback!");
  117181. }
  117182. if (this._paused) {
  117183. return;
  117184. }
  117185. if (this._isEarlyEofReconnecting) {
  117186. this._isEarlyEofReconnecting = false;
  117187. if (this._onRecoveredEarlyEof) {
  117188. this._onRecoveredEarlyEof();
  117189. }
  117190. }
  117191. this._speedSampler.addBytes(chunk.byteLength);
  117192. var KBps = this._speedSampler.lastSecondKBps;
  117193. if (KBps !== 0) {
  117194. var normalized = this._normalizeSpeed(KBps);
  117195. if (this._speedNormalized !== normalized) {
  117196. this._speedNormalized = normalized;
  117197. this._adjustStashSize(normalized);
  117198. }
  117199. }
  117200. if (!this._enableStash) {
  117201. if (this._stashUsed === 0) {
  117202. var consumed = this._dispatchChunks(chunk, byteStart);
  117203. if (consumed < chunk.byteLength) {
  117204. var remain = chunk.byteLength - consumed;
  117205. if (remain > this._bufferSize) {
  117206. this._expandBuffer(remain);
  117207. }
  117208. var stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117209. stashArray.set(new Uint8Array(chunk, consumed), 0);
  117210. this._stashUsed += remain;
  117211. this._stashByteStart = byteStart + consumed;
  117212. }
  117213. } else {
  117214. if (this._stashUsed + chunk.byteLength > this._bufferSize) {
  117215. this._expandBuffer(this._stashUsed + chunk.byteLength);
  117216. }
  117217. var stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117218. stashArray.set(new Uint8Array(chunk), this._stashUsed);
  117219. this._stashUsed += chunk.byteLength;
  117220. var consumed = this._dispatchChunks(this._stashBuffer.slice(0, this._stashUsed), this._stashByteStart);
  117221. if (consumed < this._stashUsed && consumed > 0) {
  117222. var remainArray = new Uint8Array(this._stashBuffer, consumed);
  117223. stashArray.set(remainArray, 0);
  117224. }
  117225. this._stashUsed -= consumed;
  117226. this._stashByteStart += consumed;
  117227. }
  117228. } else {
  117229. if (this._stashUsed === 0 && this._stashByteStart === 0) {
  117230. this._stashByteStart = byteStart;
  117231. }
  117232. if (this._stashUsed + chunk.byteLength <= this._stashSize) {
  117233. var stashArray = new Uint8Array(this._stashBuffer, 0, this._stashSize);
  117234. stashArray.set(new Uint8Array(chunk), this._stashUsed);
  117235. this._stashUsed += chunk.byteLength;
  117236. } else {
  117237. var stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117238. if (this._stashUsed > 0) {
  117239. var buffer = this._stashBuffer.slice(0, this._stashUsed);
  117240. var consumed = this._dispatchChunks(buffer, this._stashByteStart);
  117241. if (consumed < buffer.byteLength) {
  117242. if (consumed > 0) {
  117243. var remainArray = new Uint8Array(buffer, consumed);
  117244. stashArray.set(remainArray, 0);
  117245. this._stashUsed = remainArray.byteLength;
  117246. this._stashByteStart += consumed;
  117247. }
  117248. } else {
  117249. this._stashUsed = 0;
  117250. this._stashByteStart += consumed;
  117251. }
  117252. if (this._stashUsed + chunk.byteLength > this._bufferSize) {
  117253. this._expandBuffer(this._stashUsed + chunk.byteLength);
  117254. stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117255. }
  117256. stashArray.set(new Uint8Array(chunk), this._stashUsed);
  117257. this._stashUsed += chunk.byteLength;
  117258. } else {
  117259. var consumed = this._dispatchChunks(chunk, byteStart);
  117260. if (consumed < chunk.byteLength) {
  117261. var remain = chunk.byteLength - consumed;
  117262. if (remain > this._bufferSize) {
  117263. this._expandBuffer(remain);
  117264. stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117265. }
  117266. stashArray.set(new Uint8Array(chunk, consumed), 0);
  117267. this._stashUsed += remain;
  117268. this._stashByteStart = byteStart + consumed;
  117269. }
  117270. }
  117271. }
  117272. }
  117273. };
  117274. IOController2.prototype._flushStashBuffer = function(dropUnconsumed) {
  117275. if (this._stashUsed > 0) {
  117276. var buffer = this._stashBuffer.slice(0, this._stashUsed);
  117277. var consumed = this._dispatchChunks(buffer, this._stashByteStart);
  117278. var remain = buffer.byteLength - consumed;
  117279. if (consumed < buffer.byteLength) {
  117280. if (dropUnconsumed) {
  117281. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, remain + " bytes unconsumed data remain when flush buffer, dropped");
  117282. } else {
  117283. if (consumed > 0) {
  117284. var stashArray = new Uint8Array(this._stashBuffer, 0, this._bufferSize);
  117285. var remainArray = new Uint8Array(buffer, consumed);
  117286. stashArray.set(remainArray, 0);
  117287. this._stashUsed = remainArray.byteLength;
  117288. this._stashByteStart += consumed;
  117289. }
  117290. return 0;
  117291. }
  117292. }
  117293. this._stashUsed = 0;
  117294. this._stashByteStart = 0;
  117295. return remain;
  117296. }
  117297. return 0;
  117298. };
  117299. IOController2.prototype._onLoaderComplete = function(from3, to) {
  117300. this._flushStashBuffer(true);
  117301. if (this._onComplete) {
  117302. this._onComplete(this._extraData);
  117303. }
  117304. };
  117305. IOController2.prototype._onLoaderError = function(type2, data) {
  117306. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.e(this.TAG, "Loader error, code = " + data.code + ", msg = " + data.msg);
  117307. this._flushStashBuffer(false);
  117308. if (this._isEarlyEofReconnecting) {
  117309. this._isEarlyEofReconnecting = false;
  117310. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.UNRECOVERABLE_EARLY_EOF;
  117311. }
  117312. switch (type2) {
  117313. case _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.EARLY_EOF: {
  117314. if (!this._config.isLive) {
  117315. if (this._totalLength) {
  117316. var nextFrom = this._currentRange.to + 1;
  117317. if (nextFrom < this._totalLength) {
  117318. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Connection lost, trying reconnect...");
  117319. this._isEarlyEofReconnecting = true;
  117320. this._internalSeek(nextFrom, false);
  117321. }
  117322. return;
  117323. }
  117324. }
  117325. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.UNRECOVERABLE_EARLY_EOF;
  117326. break;
  117327. }
  117328. case _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.UNRECOVERABLE_EARLY_EOF:
  117329. case _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.CONNECTING_TIMEOUT:
  117330. case _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.HTTP_STATUS_CODE_INVALID:
  117331. case _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.EXCEPTION:
  117332. break;
  117333. }
  117334. if (this._onError) {
  117335. this._onError(type2, data);
  117336. } else {
  117337. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_9__.RuntimeException("IOException: " + data.msg);
  117338. }
  117339. };
  117340. return IOController2;
  117341. }();
  117342. __webpack_exports__2["default"] = IOController;
  117343. },
  117344. "./src/io/loader.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117345. __webpack_require__2.r(__webpack_exports__2);
  117346. __webpack_require__2.d(__webpack_exports__2, {
  117347. "LoaderStatus": function() {
  117348. return LoaderStatus;
  117349. },
  117350. "LoaderErrors": function() {
  117351. return LoaderErrors;
  117352. },
  117353. "BaseLoader": function() {
  117354. return BaseLoader;
  117355. }
  117356. });
  117357. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/exception.js");
  117358. var LoaderStatus = {
  117359. kIdle: 0,
  117360. kConnecting: 1,
  117361. kBuffering: 2,
  117362. kError: 3,
  117363. kComplete: 4
  117364. };
  117365. var LoaderErrors = {
  117366. OK: "OK",
  117367. EXCEPTION: "Exception",
  117368. HTTP_STATUS_CODE_INVALID: "HttpStatusCodeInvalid",
  117369. CONNECTING_TIMEOUT: "ConnectingTimeout",
  117370. EARLY_EOF: "EarlyEof",
  117371. UNRECOVERABLE_EARLY_EOF: "UnrecoverableEarlyEof"
  117372. };
  117373. var BaseLoader = function() {
  117374. function BaseLoader2(typeName) {
  117375. this._type = typeName || "undefined";
  117376. this._status = LoaderStatus.kIdle;
  117377. this._needStash = false;
  117378. this._onContentLengthKnown = null;
  117379. this._onURLRedirect = null;
  117380. this._onDataArrival = null;
  117381. this._onError = null;
  117382. this._onComplete = null;
  117383. }
  117384. BaseLoader2.prototype.destroy = function() {
  117385. this._status = LoaderStatus.kIdle;
  117386. this._onContentLengthKnown = null;
  117387. this._onURLRedirect = null;
  117388. this._onDataArrival = null;
  117389. this._onError = null;
  117390. this._onComplete = null;
  117391. };
  117392. BaseLoader2.prototype.isWorking = function() {
  117393. return this._status === LoaderStatus.kConnecting || this._status === LoaderStatus.kBuffering;
  117394. };
  117395. Object.defineProperty(BaseLoader2.prototype, "type", {
  117396. get: function() {
  117397. return this._type;
  117398. },
  117399. enumerable: false,
  117400. configurable: true
  117401. });
  117402. Object.defineProperty(BaseLoader2.prototype, "status", {
  117403. get: function() {
  117404. return this._status;
  117405. },
  117406. enumerable: false,
  117407. configurable: true
  117408. });
  117409. Object.defineProperty(BaseLoader2.prototype, "needStashBuffer", {
  117410. get: function() {
  117411. return this._needStash;
  117412. },
  117413. enumerable: false,
  117414. configurable: true
  117415. });
  117416. Object.defineProperty(BaseLoader2.prototype, "onContentLengthKnown", {
  117417. get: function() {
  117418. return this._onContentLengthKnown;
  117419. },
  117420. set: function(callback2) {
  117421. this._onContentLengthKnown = callback2;
  117422. },
  117423. enumerable: false,
  117424. configurable: true
  117425. });
  117426. Object.defineProperty(BaseLoader2.prototype, "onURLRedirect", {
  117427. get: function() {
  117428. return this._onURLRedirect;
  117429. },
  117430. set: function(callback2) {
  117431. this._onURLRedirect = callback2;
  117432. },
  117433. enumerable: false,
  117434. configurable: true
  117435. });
  117436. Object.defineProperty(BaseLoader2.prototype, "onDataArrival", {
  117437. get: function() {
  117438. return this._onDataArrival;
  117439. },
  117440. set: function(callback2) {
  117441. this._onDataArrival = callback2;
  117442. },
  117443. enumerable: false,
  117444. configurable: true
  117445. });
  117446. Object.defineProperty(BaseLoader2.prototype, "onError", {
  117447. get: function() {
  117448. return this._onError;
  117449. },
  117450. set: function(callback2) {
  117451. this._onError = callback2;
  117452. },
  117453. enumerable: false,
  117454. configurable: true
  117455. });
  117456. Object.defineProperty(BaseLoader2.prototype, "onComplete", {
  117457. get: function() {
  117458. return this._onComplete;
  117459. },
  117460. set: function(callback2) {
  117461. this._onComplete = callback2;
  117462. },
  117463. enumerable: false,
  117464. configurable: true
  117465. });
  117466. BaseLoader2.prototype.open = function(dataSource, range3) {
  117467. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__.NotImplementedException("Unimplemented abstract function!");
  117468. };
  117469. BaseLoader2.prototype.abort = function() {
  117470. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_0__.NotImplementedException("Unimplemented abstract function!");
  117471. };
  117472. return BaseLoader2;
  117473. }();
  117474. },
  117475. "./src/io/param-seek-handler.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117476. __webpack_require__2.r(__webpack_exports__2);
  117477. var ParamSeekHandler = function() {
  117478. function ParamSeekHandler2(paramStart, paramEnd) {
  117479. this._startName = paramStart;
  117480. this._endName = paramEnd;
  117481. }
  117482. ParamSeekHandler2.prototype.getConfig = function(baseUrl, range3) {
  117483. var url = baseUrl;
  117484. if (range3.from !== 0 || range3.to !== -1) {
  117485. var needAnd = true;
  117486. if (url.indexOf("?") === -1) {
  117487. url += "?";
  117488. needAnd = false;
  117489. }
  117490. if (needAnd) {
  117491. url += "&";
  117492. }
  117493. url += this._startName + "=" + range3.from.toString();
  117494. if (range3.to !== -1) {
  117495. url += "&" + this._endName + "=" + range3.to.toString();
  117496. }
  117497. }
  117498. return {
  117499. url,
  117500. headers: {}
  117501. };
  117502. };
  117503. ParamSeekHandler2.prototype.removeURLParameters = function(seekedURL) {
  117504. var baseURL = seekedURL.split("?")[0];
  117505. var params = void 0;
  117506. var queryIndex = seekedURL.indexOf("?");
  117507. if (queryIndex !== -1) {
  117508. params = seekedURL.substring(queryIndex + 1);
  117509. }
  117510. var resultParams = "";
  117511. if (params != void 0 && params.length > 0) {
  117512. var pairs = params.split("&");
  117513. for (var i2 = 0; i2 < pairs.length; i2++) {
  117514. var pair = pairs[i2].split("=");
  117515. var requireAnd = i2 > 0;
  117516. if (pair[0] !== this._startName && pair[0] !== this._endName) {
  117517. if (requireAnd) {
  117518. resultParams += "&";
  117519. }
  117520. resultParams += pairs[i2];
  117521. }
  117522. }
  117523. }
  117524. return resultParams.length === 0 ? baseURL : baseURL + "?" + resultParams;
  117525. };
  117526. return ParamSeekHandler2;
  117527. }();
  117528. __webpack_exports__2["default"] = ParamSeekHandler;
  117529. },
  117530. "./src/io/range-seek-handler.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117531. __webpack_require__2.r(__webpack_exports__2);
  117532. var RangeSeekHandler = function() {
  117533. function RangeSeekHandler2(zeroStart) {
  117534. this._zeroStart = zeroStart || false;
  117535. }
  117536. RangeSeekHandler2.prototype.getConfig = function(url, range3) {
  117537. var headers = {};
  117538. if (range3.from !== 0 || range3.to !== -1) {
  117539. var param = void 0;
  117540. if (range3.to !== -1) {
  117541. param = "bytes=" + range3.from.toString() + "-" + range3.to.toString();
  117542. } else {
  117543. param = "bytes=" + range3.from.toString() + "-";
  117544. }
  117545. headers["Range"] = param;
  117546. } else if (this._zeroStart) {
  117547. headers["Range"] = "bytes=0-";
  117548. }
  117549. return {
  117550. url,
  117551. headers
  117552. };
  117553. };
  117554. RangeSeekHandler2.prototype.removeURLParameters = function(seekedURL) {
  117555. return seekedURL;
  117556. };
  117557. return RangeSeekHandler2;
  117558. }();
  117559. __webpack_exports__2["default"] = RangeSeekHandler;
  117560. },
  117561. "./src/io/speed-sampler.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117562. __webpack_require__2.r(__webpack_exports__2);
  117563. var SpeedSampler = function() {
  117564. function SpeedSampler2() {
  117565. this._firstCheckpoint = 0;
  117566. this._lastCheckpoint = 0;
  117567. this._intervalBytes = 0;
  117568. this._totalBytes = 0;
  117569. this._lastSecondBytes = 0;
  117570. if (self.performance && self.performance.now) {
  117571. this._now = self.performance.now.bind(self.performance);
  117572. } else {
  117573. this._now = Date.now;
  117574. }
  117575. }
  117576. SpeedSampler2.prototype.reset = function() {
  117577. this._firstCheckpoint = this._lastCheckpoint = 0;
  117578. this._totalBytes = this._intervalBytes = 0;
  117579. this._lastSecondBytes = 0;
  117580. };
  117581. SpeedSampler2.prototype.addBytes = function(bytes) {
  117582. if (this._firstCheckpoint === 0) {
  117583. this._firstCheckpoint = this._now();
  117584. this._lastCheckpoint = this._firstCheckpoint;
  117585. this._intervalBytes += bytes;
  117586. this._totalBytes += bytes;
  117587. } else if (this._now() - this._lastCheckpoint < 1e3) {
  117588. this._intervalBytes += bytes;
  117589. this._totalBytes += bytes;
  117590. } else {
  117591. this._lastSecondBytes = this._intervalBytes;
  117592. this._intervalBytes = bytes;
  117593. this._totalBytes += bytes;
  117594. this._lastCheckpoint = this._now();
  117595. }
  117596. };
  117597. Object.defineProperty(SpeedSampler2.prototype, "currentKBps", {
  117598. get: function() {
  117599. this.addBytes(0);
  117600. var durationSeconds = (this._now() - this._lastCheckpoint) / 1e3;
  117601. if (durationSeconds == 0)
  117602. durationSeconds = 1;
  117603. return this._intervalBytes / durationSeconds / 1024;
  117604. },
  117605. enumerable: false,
  117606. configurable: true
  117607. });
  117608. Object.defineProperty(SpeedSampler2.prototype, "lastSecondKBps", {
  117609. get: function() {
  117610. this.addBytes(0);
  117611. if (this._lastSecondBytes !== 0) {
  117612. return this._lastSecondBytes / 1024;
  117613. } else {
  117614. if (this._now() - this._lastCheckpoint >= 500) {
  117615. return this.currentKBps;
  117616. } else {
  117617. return 0;
  117618. }
  117619. }
  117620. },
  117621. enumerable: false,
  117622. configurable: true
  117623. });
  117624. Object.defineProperty(SpeedSampler2.prototype, "averageKBps", {
  117625. get: function() {
  117626. var durationSeconds = (this._now() - this._firstCheckpoint) / 1e3;
  117627. return this._totalBytes / durationSeconds / 1024;
  117628. },
  117629. enumerable: false,
  117630. configurable: true
  117631. });
  117632. return SpeedSampler2;
  117633. }();
  117634. __webpack_exports__2["default"] = SpeedSampler;
  117635. },
  117636. "./src/io/websocket-loader.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117637. __webpack_require__2.r(__webpack_exports__2);
  117638. var _loader_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/io/loader.js");
  117639. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/exception.js");
  117640. var __extends = function() {
  117641. var extendStatics = function(d2, b) {
  117642. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) {
  117643. d3.__proto__ = b2;
  117644. } || function(d3, b2) {
  117645. for (var p in b2)
  117646. if (Object.prototype.hasOwnProperty.call(b2, p))
  117647. d3[p] = b2[p];
  117648. };
  117649. return extendStatics(d2, b);
  117650. };
  117651. return function(d2, b) {
  117652. if (typeof b !== "function" && b !== null)
  117653. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  117654. extendStatics(d2, b);
  117655. function __() {
  117656. this.constructor = d2;
  117657. }
  117658. d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  117659. };
  117660. }();
  117661. var WebSocketLoader = function(_super) {
  117662. __extends(WebSocketLoader2, _super);
  117663. function WebSocketLoader2() {
  117664. var _this = _super.call(this, "websocket-loader") || this;
  117665. _this.TAG = "WebSocketLoader";
  117666. _this._needStash = true;
  117667. _this._ws = null;
  117668. _this._requestAbort = false;
  117669. _this._receivedLength = 0;
  117670. return _this;
  117671. }
  117672. WebSocketLoader2.isSupported = function() {
  117673. try {
  117674. return typeof self.WebSocket !== "undefined";
  117675. } catch (e) {
  117676. return false;
  117677. }
  117678. };
  117679. WebSocketLoader2.prototype.destroy = function() {
  117680. if (this._ws) {
  117681. this.abort();
  117682. }
  117683. _super.prototype.destroy.call(this);
  117684. };
  117685. WebSocketLoader2.prototype.open = function(dataSource) {
  117686. try {
  117687. var ws = this._ws = new self.WebSocket(dataSource.url);
  117688. ws.binaryType = "arraybuffer";
  117689. ws.onopen = this._onWebSocketOpen.bind(this);
  117690. ws.onclose = this._onWebSocketClose.bind(this);
  117691. ws.onmessage = this._onWebSocketMessage.bind(this);
  117692. ws.onerror = this._onWebSocketError.bind(this);
  117693. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kConnecting;
  117694. } catch (e) {
  117695. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kError;
  117696. var info = { code: e.code, msg: e.message };
  117697. if (this._onError) {
  117698. this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.EXCEPTION, info);
  117699. } else {
  117700. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_1__.RuntimeException(info.msg);
  117701. }
  117702. }
  117703. };
  117704. WebSocketLoader2.prototype.abort = function() {
  117705. var ws = this._ws;
  117706. if (ws && (ws.readyState === 0 || ws.readyState === 1)) {
  117707. this._requestAbort = true;
  117708. ws.close();
  117709. }
  117710. this._ws = null;
  117711. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kComplete;
  117712. };
  117713. WebSocketLoader2.prototype._onWebSocketOpen = function(e) {
  117714. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kBuffering;
  117715. };
  117716. WebSocketLoader2.prototype._onWebSocketClose = function(e) {
  117717. if (this._requestAbort === true) {
  117718. this._requestAbort = false;
  117719. return;
  117720. }
  117721. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kComplete;
  117722. if (this._onComplete) {
  117723. this._onComplete(0, this._receivedLength - 1);
  117724. }
  117725. };
  117726. WebSocketLoader2.prototype._onWebSocketMessage = function(e) {
  117727. var _this = this;
  117728. if (e.data instanceof ArrayBuffer) {
  117729. this._dispatchArrayBuffer(e.data);
  117730. } else if (e.data instanceof Blob) {
  117731. var reader_1 = new FileReader();
  117732. reader_1.onload = function() {
  117733. _this._dispatchArrayBuffer(reader_1.result);
  117734. };
  117735. reader_1.readAsArrayBuffer(e.data);
  117736. } else {
  117737. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kError;
  117738. var info = { code: -1, msg: "Unsupported WebSocket message type: " + e.data.constructor.name };
  117739. if (this._onError) {
  117740. this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.EXCEPTION, info);
  117741. } else {
  117742. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_1__.RuntimeException(info.msg);
  117743. }
  117744. }
  117745. };
  117746. WebSocketLoader2.prototype._dispatchArrayBuffer = function(arraybuffer) {
  117747. var chunk = arraybuffer;
  117748. var byteStart = this._receivedLength;
  117749. this._receivedLength += chunk.byteLength;
  117750. if (this._onDataArrival) {
  117751. this._onDataArrival(chunk, byteStart, this._receivedLength);
  117752. }
  117753. };
  117754. WebSocketLoader2.prototype._onWebSocketError = function(e) {
  117755. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderStatus.kError;
  117756. var info = {
  117757. code: e.code,
  117758. msg: e.message
  117759. };
  117760. if (this._onError) {
  117761. this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.EXCEPTION, info);
  117762. } else {
  117763. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_1__.RuntimeException(info.msg);
  117764. }
  117765. };
  117766. return WebSocketLoader2;
  117767. }(_loader_js__WEBPACK_IMPORTED_MODULE_0__.BaseLoader);
  117768. __webpack_exports__2["default"] = WebSocketLoader;
  117769. },
  117770. "./src/io/xhr-moz-chunked-loader.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117771. __webpack_require__2.r(__webpack_exports__2);
  117772. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  117773. var _loader_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/io/loader.js");
  117774. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/exception.js");
  117775. var __extends = function() {
  117776. var extendStatics = function(d2, b) {
  117777. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) {
  117778. d3.__proto__ = b2;
  117779. } || function(d3, b2) {
  117780. for (var p in b2)
  117781. if (Object.prototype.hasOwnProperty.call(b2, p))
  117782. d3[p] = b2[p];
  117783. };
  117784. return extendStatics(d2, b);
  117785. };
  117786. return function(d2, b) {
  117787. if (typeof b !== "function" && b !== null)
  117788. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  117789. extendStatics(d2, b);
  117790. function __() {
  117791. this.constructor = d2;
  117792. }
  117793. d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  117794. };
  117795. }();
  117796. var MozChunkedLoader = function(_super) {
  117797. __extends(MozChunkedLoader2, _super);
  117798. function MozChunkedLoader2(seekHandler, config) {
  117799. var _this = _super.call(this, "xhr-moz-chunked-loader") || this;
  117800. _this.TAG = "MozChunkedLoader";
  117801. _this._seekHandler = seekHandler;
  117802. _this._config = config;
  117803. _this._needStash = true;
  117804. _this._xhr = null;
  117805. _this._requestAbort = false;
  117806. _this._contentLength = null;
  117807. _this._receivedLength = 0;
  117808. return _this;
  117809. }
  117810. MozChunkedLoader2.isSupported = function() {
  117811. try {
  117812. var xhr = new XMLHttpRequest();
  117813. xhr.open("GET", "https://example.com", true);
  117814. xhr.responseType = "moz-chunked-arraybuffer";
  117815. return xhr.responseType === "moz-chunked-arraybuffer";
  117816. } catch (e) {
  117817. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w("MozChunkedLoader", e.message);
  117818. return false;
  117819. }
  117820. };
  117821. MozChunkedLoader2.prototype.destroy = function() {
  117822. if (this.isWorking()) {
  117823. this.abort();
  117824. }
  117825. if (this._xhr) {
  117826. this._xhr.onreadystatechange = null;
  117827. this._xhr.onprogress = null;
  117828. this._xhr.onloadend = null;
  117829. this._xhr.onerror = null;
  117830. this._xhr = null;
  117831. }
  117832. _super.prototype.destroy.call(this);
  117833. };
  117834. MozChunkedLoader2.prototype.open = function(dataSource, range3) {
  117835. this._dataSource = dataSource;
  117836. this._range = range3;
  117837. var sourceURL = dataSource.url;
  117838. if (this._config.reuseRedirectedURL && dataSource.redirectedURL != void 0) {
  117839. sourceURL = dataSource.redirectedURL;
  117840. }
  117841. var seekConfig = this._seekHandler.getConfig(sourceURL, range3);
  117842. this._requestURL = seekConfig.url;
  117843. var xhr = this._xhr = new XMLHttpRequest();
  117844. xhr.open("GET", seekConfig.url, true);
  117845. xhr.responseType = "moz-chunked-arraybuffer";
  117846. xhr.onreadystatechange = this._onReadyStateChange.bind(this);
  117847. xhr.onprogress = this._onProgress.bind(this);
  117848. xhr.onloadend = this._onLoadEnd.bind(this);
  117849. xhr.onerror = this._onXhrError.bind(this);
  117850. if (dataSource.withCredentials) {
  117851. xhr.withCredentials = true;
  117852. }
  117853. if (typeof seekConfig.headers === "object") {
  117854. var headers = seekConfig.headers;
  117855. for (var key in headers) {
  117856. if (headers.hasOwnProperty(key)) {
  117857. xhr.setRequestHeader(key, headers[key]);
  117858. }
  117859. }
  117860. }
  117861. if (typeof this._config.headers === "object") {
  117862. var headers = this._config.headers;
  117863. for (var key in headers) {
  117864. if (headers.hasOwnProperty(key)) {
  117865. xhr.setRequestHeader(key, headers[key]);
  117866. }
  117867. }
  117868. }
  117869. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kConnecting;
  117870. xhr.send();
  117871. };
  117872. MozChunkedLoader2.prototype.abort = function() {
  117873. this._requestAbort = true;
  117874. if (this._xhr) {
  117875. this._xhr.abort();
  117876. }
  117877. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  117878. };
  117879. MozChunkedLoader2.prototype._onReadyStateChange = function(e) {
  117880. var xhr = e.target;
  117881. if (xhr.readyState === 2) {
  117882. if (xhr.responseURL != void 0 && xhr.responseURL !== this._requestURL) {
  117883. if (this._onURLRedirect) {
  117884. var redirectedURL = this._seekHandler.removeURLParameters(xhr.responseURL);
  117885. this._onURLRedirect(redirectedURL);
  117886. }
  117887. }
  117888. if (xhr.status !== 0 && (xhr.status < 200 || xhr.status > 299)) {
  117889. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  117890. if (this._onError) {
  117891. this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.HTTP_STATUS_CODE_INVALID, { code: xhr.status, msg: xhr.statusText });
  117892. } else {
  117893. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.RuntimeException("MozChunkedLoader: Http code invalid, " + xhr.status + " " + xhr.statusText);
  117894. }
  117895. } else {
  117896. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kBuffering;
  117897. }
  117898. }
  117899. };
  117900. MozChunkedLoader2.prototype._onProgress = function(e) {
  117901. if (this._status === _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError) {
  117902. return;
  117903. }
  117904. if (this._contentLength === null) {
  117905. if (e.total !== null && e.total !== 0) {
  117906. this._contentLength = e.total;
  117907. if (this._onContentLengthKnown) {
  117908. this._onContentLengthKnown(this._contentLength);
  117909. }
  117910. }
  117911. }
  117912. var chunk = e.target.response;
  117913. var byteStart = this._range.from + this._receivedLength;
  117914. this._receivedLength += chunk.byteLength;
  117915. if (this._onDataArrival) {
  117916. this._onDataArrival(chunk, byteStart, this._receivedLength);
  117917. }
  117918. };
  117919. MozChunkedLoader2.prototype._onLoadEnd = function(e) {
  117920. if (this._requestAbort === true) {
  117921. this._requestAbort = false;
  117922. return;
  117923. } else if (this._status === _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError) {
  117924. return;
  117925. }
  117926. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kComplete;
  117927. if (this._onComplete) {
  117928. this._onComplete(this._range.from, this._range.from + this._receivedLength - 1);
  117929. }
  117930. };
  117931. MozChunkedLoader2.prototype._onXhrError = function(e) {
  117932. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderStatus.kError;
  117933. var type2 = 0;
  117934. var info = null;
  117935. if (this._contentLength && e.loaded < this._contentLength) {
  117936. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EARLY_EOF;
  117937. info = { code: -1, msg: "Moz-Chunked stream meet Early-Eof" };
  117938. } else {
  117939. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_1__.LoaderErrors.EXCEPTION;
  117940. info = { code: -1, msg: e.constructor.name + " " + e.type };
  117941. }
  117942. if (this._onError) {
  117943. this._onError(type2, info);
  117944. } else {
  117945. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_2__.RuntimeException(info.msg);
  117946. }
  117947. };
  117948. return MozChunkedLoader2;
  117949. }(_loader_js__WEBPACK_IMPORTED_MODULE_1__.BaseLoader);
  117950. __webpack_exports__2["default"] = MozChunkedLoader;
  117951. },
  117952. "./src/io/xhr-range-loader.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  117953. __webpack_require__2.r(__webpack_exports__2);
  117954. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  117955. var _speed_sampler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/io/speed-sampler.js");
  117956. var _loader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/io/loader.js");
  117957. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/utils/exception.js");
  117958. var __extends = function() {
  117959. var extendStatics = function(d2, b) {
  117960. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) {
  117961. d3.__proto__ = b2;
  117962. } || function(d3, b2) {
  117963. for (var p in b2)
  117964. if (Object.prototype.hasOwnProperty.call(b2, p))
  117965. d3[p] = b2[p];
  117966. };
  117967. return extendStatics(d2, b);
  117968. };
  117969. return function(d2, b) {
  117970. if (typeof b !== "function" && b !== null)
  117971. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  117972. extendStatics(d2, b);
  117973. function __() {
  117974. this.constructor = d2;
  117975. }
  117976. d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  117977. };
  117978. }();
  117979. var RangeLoader = function(_super) {
  117980. __extends(RangeLoader2, _super);
  117981. function RangeLoader2(seekHandler, config) {
  117982. var _this = _super.call(this, "xhr-range-loader") || this;
  117983. _this.TAG = "RangeLoader";
  117984. _this._seekHandler = seekHandler;
  117985. _this._config = config;
  117986. _this._needStash = false;
  117987. _this._chunkSizeKBList = [
  117988. 128,
  117989. 256,
  117990. 384,
  117991. 512,
  117992. 768,
  117993. 1024,
  117994. 1536,
  117995. 2048,
  117996. 3072,
  117997. 4096,
  117998. 5120,
  117999. 6144,
  118000. 7168,
  118001. 8192
  118002. ];
  118003. _this._currentChunkSizeKB = 384;
  118004. _this._currentSpeedNormalized = 0;
  118005. _this._zeroSpeedChunkCount = 0;
  118006. _this._xhr = null;
  118007. _this._speedSampler = new _speed_sampler_js__WEBPACK_IMPORTED_MODULE_1__.default();
  118008. _this._requestAbort = false;
  118009. _this._waitForTotalLength = false;
  118010. _this._totalLengthReceived = false;
  118011. _this._currentRequestURL = null;
  118012. _this._currentRedirectedURL = null;
  118013. _this._currentRequestRange = null;
  118014. _this._totalLength = null;
  118015. _this._contentLength = null;
  118016. _this._receivedLength = 0;
  118017. _this._lastTimeLoaded = 0;
  118018. return _this;
  118019. }
  118020. RangeLoader2.isSupported = function() {
  118021. try {
  118022. var xhr = new XMLHttpRequest();
  118023. xhr.open("GET", "https://example.com", true);
  118024. xhr.responseType = "arraybuffer";
  118025. return xhr.responseType === "arraybuffer";
  118026. } catch (e) {
  118027. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w("RangeLoader", e.message);
  118028. return false;
  118029. }
  118030. };
  118031. RangeLoader2.prototype.destroy = function() {
  118032. if (this.isWorking()) {
  118033. this.abort();
  118034. }
  118035. if (this._xhr) {
  118036. this._xhr.onreadystatechange = null;
  118037. this._xhr.onprogress = null;
  118038. this._xhr.onload = null;
  118039. this._xhr.onerror = null;
  118040. this._xhr = null;
  118041. }
  118042. _super.prototype.destroy.call(this);
  118043. };
  118044. Object.defineProperty(RangeLoader2.prototype, "currentSpeed", {
  118045. get: function() {
  118046. return this._speedSampler.lastSecondKBps;
  118047. },
  118048. enumerable: false,
  118049. configurable: true
  118050. });
  118051. RangeLoader2.prototype.open = function(dataSource, range3) {
  118052. this._dataSource = dataSource;
  118053. this._range = range3;
  118054. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kConnecting;
  118055. var useRefTotalLength = false;
  118056. if (this._dataSource.filesize != void 0 && this._dataSource.filesize !== 0) {
  118057. useRefTotalLength = true;
  118058. this._totalLength = this._dataSource.filesize;
  118059. }
  118060. if (!this._totalLengthReceived && !useRefTotalLength) {
  118061. this._waitForTotalLength = true;
  118062. this._internalOpen(this._dataSource, { from: 0, to: -1 });
  118063. } else {
  118064. this._openSubRange();
  118065. }
  118066. };
  118067. RangeLoader2.prototype._openSubRange = function() {
  118068. var chunkSize = this._currentChunkSizeKB * 1024;
  118069. var from3 = this._range.from + this._receivedLength;
  118070. var to = from3 + chunkSize;
  118071. if (this._contentLength != null) {
  118072. if (to - this._range.from >= this._contentLength) {
  118073. to = this._range.from + this._contentLength - 1;
  118074. }
  118075. }
  118076. this._currentRequestRange = { from: from3, to };
  118077. this._internalOpen(this._dataSource, this._currentRequestRange);
  118078. };
  118079. RangeLoader2.prototype._internalOpen = function(dataSource, range3) {
  118080. this._lastTimeLoaded = 0;
  118081. var sourceURL = dataSource.url;
  118082. if (this._config.reuseRedirectedURL) {
  118083. if (this._currentRedirectedURL != void 0) {
  118084. sourceURL = this._currentRedirectedURL;
  118085. } else if (dataSource.redirectedURL != void 0) {
  118086. sourceURL = dataSource.redirectedURL;
  118087. }
  118088. }
  118089. var seekConfig = this._seekHandler.getConfig(sourceURL, range3);
  118090. this._currentRequestURL = seekConfig.url;
  118091. var xhr = this._xhr = new XMLHttpRequest();
  118092. xhr.open("GET", seekConfig.url, true);
  118093. xhr.responseType = "arraybuffer";
  118094. xhr.onreadystatechange = this._onReadyStateChange.bind(this);
  118095. xhr.onprogress = this._onProgress.bind(this);
  118096. xhr.onload = this._onLoad.bind(this);
  118097. xhr.onerror = this._onXhrError.bind(this);
  118098. if (dataSource.withCredentials) {
  118099. xhr.withCredentials = true;
  118100. }
  118101. if (typeof seekConfig.headers === "object") {
  118102. var headers = seekConfig.headers;
  118103. for (var key in headers) {
  118104. if (headers.hasOwnProperty(key)) {
  118105. xhr.setRequestHeader(key, headers[key]);
  118106. }
  118107. }
  118108. }
  118109. if (typeof this._config.headers === "object") {
  118110. var headers = this._config.headers;
  118111. for (var key in headers) {
  118112. if (headers.hasOwnProperty(key)) {
  118113. xhr.setRequestHeader(key, headers[key]);
  118114. }
  118115. }
  118116. }
  118117. xhr.send();
  118118. };
  118119. RangeLoader2.prototype.abort = function() {
  118120. this._requestAbort = true;
  118121. this._internalAbort();
  118122. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kComplete;
  118123. };
  118124. RangeLoader2.prototype._internalAbort = function() {
  118125. if (this._xhr) {
  118126. this._xhr.onreadystatechange = null;
  118127. this._xhr.onprogress = null;
  118128. this._xhr.onload = null;
  118129. this._xhr.onerror = null;
  118130. this._xhr.abort();
  118131. this._xhr = null;
  118132. }
  118133. };
  118134. RangeLoader2.prototype._onReadyStateChange = function(e) {
  118135. var xhr = e.target;
  118136. if (xhr.readyState === 2) {
  118137. if (xhr.responseURL != void 0) {
  118138. var redirectedURL = this._seekHandler.removeURLParameters(xhr.responseURL);
  118139. if (xhr.responseURL !== this._currentRequestURL && redirectedURL !== this._currentRedirectedURL) {
  118140. this._currentRedirectedURL = redirectedURL;
  118141. if (this._onURLRedirect) {
  118142. this._onURLRedirect(redirectedURL);
  118143. }
  118144. }
  118145. }
  118146. if (xhr.status >= 200 && xhr.status <= 299) {
  118147. if (this._waitForTotalLength) {
  118148. return;
  118149. }
  118150. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kBuffering;
  118151. } else {
  118152. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kError;
  118153. if (this._onError) {
  118154. this._onError(_loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.HTTP_STATUS_CODE_INVALID, { code: xhr.status, msg: xhr.statusText });
  118155. } else {
  118156. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__.RuntimeException("RangeLoader: Http code invalid, " + xhr.status + " " + xhr.statusText);
  118157. }
  118158. }
  118159. }
  118160. };
  118161. RangeLoader2.prototype._onProgress = function(e) {
  118162. if (this._status === _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kError) {
  118163. return;
  118164. }
  118165. if (this._contentLength === null) {
  118166. var openNextRange = false;
  118167. if (this._waitForTotalLength) {
  118168. this._waitForTotalLength = false;
  118169. this._totalLengthReceived = true;
  118170. openNextRange = true;
  118171. var total = e.total;
  118172. this._internalAbort();
  118173. if (total != null & total !== 0) {
  118174. this._totalLength = total;
  118175. }
  118176. }
  118177. if (this._range.to === -1) {
  118178. this._contentLength = this._totalLength - this._range.from;
  118179. } else {
  118180. this._contentLength = this._range.to - this._range.from + 1;
  118181. }
  118182. if (openNextRange) {
  118183. this._openSubRange();
  118184. return;
  118185. }
  118186. if (this._onContentLengthKnown) {
  118187. this._onContentLengthKnown(this._contentLength);
  118188. }
  118189. }
  118190. var delta = e.loaded - this._lastTimeLoaded;
  118191. this._lastTimeLoaded = e.loaded;
  118192. this._speedSampler.addBytes(delta);
  118193. };
  118194. RangeLoader2.prototype._normalizeSpeed = function(input) {
  118195. var list = this._chunkSizeKBList;
  118196. var last = list.length - 1;
  118197. var mid = 0;
  118198. var lbound = 0;
  118199. var ubound = last;
  118200. if (input < list[0]) {
  118201. return list[0];
  118202. }
  118203. while (lbound <= ubound) {
  118204. mid = lbound + Math.floor((ubound - lbound) / 2);
  118205. if (mid === last || input >= list[mid] && input < list[mid + 1]) {
  118206. return list[mid];
  118207. } else if (list[mid] < input) {
  118208. lbound = mid + 1;
  118209. } else {
  118210. ubound = mid - 1;
  118211. }
  118212. }
  118213. };
  118214. RangeLoader2.prototype._onLoad = function(e) {
  118215. if (this._status === _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kError) {
  118216. return;
  118217. }
  118218. if (this._waitForTotalLength) {
  118219. this._waitForTotalLength = false;
  118220. return;
  118221. }
  118222. this._lastTimeLoaded = 0;
  118223. var KBps = this._speedSampler.lastSecondKBps;
  118224. if (KBps === 0) {
  118225. this._zeroSpeedChunkCount++;
  118226. if (this._zeroSpeedChunkCount >= 3) {
  118227. KBps = this._speedSampler.currentKBps;
  118228. }
  118229. }
  118230. if (KBps !== 0) {
  118231. var normalized = this._normalizeSpeed(KBps);
  118232. if (this._currentSpeedNormalized !== normalized) {
  118233. this._currentSpeedNormalized = normalized;
  118234. this._currentChunkSizeKB = normalized;
  118235. }
  118236. }
  118237. var chunk = e.target.response;
  118238. var byteStart = this._range.from + this._receivedLength;
  118239. this._receivedLength += chunk.byteLength;
  118240. var reportComplete = false;
  118241. if (this._contentLength != null && this._receivedLength < this._contentLength) {
  118242. this._openSubRange();
  118243. } else {
  118244. reportComplete = true;
  118245. }
  118246. if (this._onDataArrival) {
  118247. this._onDataArrival(chunk, byteStart, this._receivedLength);
  118248. }
  118249. if (reportComplete) {
  118250. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kComplete;
  118251. if (this._onComplete) {
  118252. this._onComplete(this._range.from, this._range.from + this._receivedLength - 1);
  118253. }
  118254. }
  118255. };
  118256. RangeLoader2.prototype._onXhrError = function(e) {
  118257. this._status = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderStatus.kError;
  118258. var type2 = 0;
  118259. var info = null;
  118260. if (this._contentLength && this._receivedLength > 0 && this._receivedLength < this._contentLength) {
  118261. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.EARLY_EOF;
  118262. info = { code: -1, msg: "RangeLoader meet Early-Eof" };
  118263. } else {
  118264. type2 = _loader_js__WEBPACK_IMPORTED_MODULE_2__.LoaderErrors.EXCEPTION;
  118265. info = { code: -1, msg: e.constructor.name + " " + e.type };
  118266. }
  118267. if (this._onError) {
  118268. this._onError(type2, info);
  118269. } else {
  118270. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__.RuntimeException(info.msg);
  118271. }
  118272. };
  118273. return RangeLoader2;
  118274. }(_loader_js__WEBPACK_IMPORTED_MODULE_2__.BaseLoader);
  118275. __webpack_exports__2["default"] = RangeLoader;
  118276. },
  118277. "./src/player/flv-player.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  118278. __webpack_require__2.r(__webpack_exports__2);
  118279. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  118280. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  118281. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/logger.js");
  118282. var _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/utils/browser.js");
  118283. var _player_events_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/player/player-events.js");
  118284. var _core_transmuxer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/core/transmuxer.js");
  118285. var _core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/core/transmuxing-events.js");
  118286. var _core_mse_controller_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__2("./src/core/mse-controller.js");
  118287. var _core_mse_events_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__2("./src/core/mse-events.js");
  118288. var _player_errors_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__2("./src/player/player-errors.js");
  118289. var _config_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__2("./src/config.js");
  118290. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__2("./src/utils/exception.js");
  118291. var FlvPlayer = function() {
  118292. function FlvPlayer2(mediaDataSource, config) {
  118293. this.TAG = "FlvPlayer";
  118294. this._type = "FlvPlayer";
  118295. this._emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  118296. this._config = (0, _config_js__WEBPACK_IMPORTED_MODULE_9__.createDefaultConfig)();
  118297. if (typeof config === "object") {
  118298. Object.assign(this._config, config);
  118299. }
  118300. if (mediaDataSource.type.toLowerCase() !== "flv") {
  118301. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_10__.InvalidArgumentException("FlvPlayer requires an flv MediaDataSource input!");
  118302. }
  118303. if (mediaDataSource.isLive === true) {
  118304. this._config.isLive = true;
  118305. }
  118306. this.e = {
  118307. onvLoadedMetadata: this._onvLoadedMetadata.bind(this),
  118308. onvSeeking: this._onvSeeking.bind(this),
  118309. onvCanPlay: this._onvCanPlay.bind(this),
  118310. onvStalled: this._onvStalled.bind(this),
  118311. onvProgress: this._onvProgress.bind(this)
  118312. };
  118313. if (self.performance && self.performance.now) {
  118314. this._now = self.performance.now.bind(self.performance);
  118315. } else {
  118316. this._now = Date.now;
  118317. }
  118318. this._pendingSeekTime = null;
  118319. this._requestSetTime = false;
  118320. this._seekpointRecord = null;
  118321. this._progressChecker = null;
  118322. this._mediaDataSource = mediaDataSource;
  118323. this._mediaElement = null;
  118324. this._msectl = null;
  118325. this._transmuxer = null;
  118326. this._mseSourceOpened = false;
  118327. this._hasPendingLoad = false;
  118328. this._receivedCanPlay = false;
  118329. this._mediaInfo = null;
  118330. this._statisticsInfo = null;
  118331. var chromeNeedIDRFix = _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.chrome && (_utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.version.major < 50 || _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.version.major === 50 && _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.version.build < 2661);
  118332. this._alwaysSeekKeyframe = chromeNeedIDRFix || _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.msedge || _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.msie ? true : false;
  118333. if (this._alwaysSeekKeyframe) {
  118334. this._config.accurateSeek = false;
  118335. }
  118336. }
  118337. FlvPlayer2.prototype.destroy = function() {
  118338. if (this._progressChecker != null) {
  118339. window.clearInterval(this._progressChecker);
  118340. this._progressChecker = null;
  118341. }
  118342. if (this._transmuxer) {
  118343. this.unload();
  118344. }
  118345. if (this._mediaElement) {
  118346. this.detachMediaElement();
  118347. }
  118348. this.e = null;
  118349. this._mediaDataSource = null;
  118350. this._emitter.removeAllListeners();
  118351. this._emitter = null;
  118352. };
  118353. FlvPlayer2.prototype.on = function(event2, listener) {
  118354. var _this = this;
  118355. if (event2 === _player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_INFO) {
  118356. if (this._mediaInfo != null) {
  118357. Promise.resolve().then(function() {
  118358. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_INFO, _this.mediaInfo);
  118359. });
  118360. }
  118361. } else if (event2 === _player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.STATISTICS_INFO) {
  118362. if (this._statisticsInfo != null) {
  118363. Promise.resolve().then(function() {
  118364. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.STATISTICS_INFO, _this.statisticsInfo);
  118365. });
  118366. }
  118367. }
  118368. this._emitter.addListener(event2, listener);
  118369. };
  118370. FlvPlayer2.prototype.off = function(event2, listener) {
  118371. this._emitter.removeListener(event2, listener);
  118372. };
  118373. FlvPlayer2.prototype.attachMediaElement = function(mediaElement) {
  118374. var _this = this;
  118375. this._mediaElement = mediaElement;
  118376. mediaElement.addEventListener("loadedmetadata", this.e.onvLoadedMetadata);
  118377. mediaElement.addEventListener("seeking", this.e.onvSeeking);
  118378. mediaElement.addEventListener("canplay", this.e.onvCanPlay);
  118379. mediaElement.addEventListener("stalled", this.e.onvStalled);
  118380. mediaElement.addEventListener("progress", this.e.onvProgress);
  118381. this._msectl = new _core_mse_controller_js__WEBPACK_IMPORTED_MODULE_6__.default(this._config);
  118382. this._msectl.on(_core_mse_events_js__WEBPACK_IMPORTED_MODULE_7__.default.UPDATE_END, this._onmseUpdateEnd.bind(this));
  118383. this._msectl.on(_core_mse_events_js__WEBPACK_IMPORTED_MODULE_7__.default.BUFFER_FULL, this._onmseBufferFull.bind(this));
  118384. this._msectl.on(_core_mse_events_js__WEBPACK_IMPORTED_MODULE_7__.default.SOURCE_OPEN, function() {
  118385. _this._mseSourceOpened = true;
  118386. if (_this._hasPendingLoad) {
  118387. _this._hasPendingLoad = false;
  118388. _this.load();
  118389. }
  118390. });
  118391. this._msectl.on(_core_mse_events_js__WEBPACK_IMPORTED_MODULE_7__.default.ERROR, function(info) {
  118392. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.ERROR, _player_errors_js__WEBPACK_IMPORTED_MODULE_8__.ErrorTypes.MEDIA_ERROR, _player_errors_js__WEBPACK_IMPORTED_MODULE_8__.ErrorDetails.MEDIA_MSE_ERROR, info);
  118393. });
  118394. this._msectl.attachMediaElement(mediaElement);
  118395. if (this._pendingSeekTime != null) {
  118396. try {
  118397. mediaElement.currentTime = this._pendingSeekTime;
  118398. this._pendingSeekTime = null;
  118399. } catch (e) {
  118400. }
  118401. }
  118402. };
  118403. FlvPlayer2.prototype.detachMediaElement = function() {
  118404. if (this._mediaElement) {
  118405. this._msectl.detachMediaElement();
  118406. this._mediaElement.removeEventListener("loadedmetadata", this.e.onvLoadedMetadata);
  118407. this._mediaElement.removeEventListener("seeking", this.e.onvSeeking);
  118408. this._mediaElement.removeEventListener("canplay", this.e.onvCanPlay);
  118409. this._mediaElement.removeEventListener("stalled", this.e.onvStalled);
  118410. this._mediaElement.removeEventListener("progress", this.e.onvProgress);
  118411. this._mediaElement = null;
  118412. }
  118413. if (this._msectl) {
  118414. this._msectl.destroy();
  118415. this._msectl = null;
  118416. }
  118417. };
  118418. FlvPlayer2.prototype.load = function() {
  118419. var _this = this;
  118420. if (!this._mediaElement) {
  118421. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_10__.IllegalStateException("HTMLMediaElement must be attached before load()!");
  118422. }
  118423. if (this._transmuxer) {
  118424. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_10__.IllegalStateException("FlvPlayer.load() has been called, please call unload() first!");
  118425. }
  118426. if (this._hasPendingLoad) {
  118427. return;
  118428. }
  118429. if (this._config.deferLoadAfterSourceOpen && this._mseSourceOpened === false) {
  118430. this._hasPendingLoad = true;
  118431. return;
  118432. }
  118433. if (this._mediaElement.readyState > 0) {
  118434. this._requestSetTime = true;
  118435. this._mediaElement.currentTime = 0;
  118436. }
  118437. this._transmuxer = new _core_transmuxer_js__WEBPACK_IMPORTED_MODULE_4__.default(this._mediaDataSource, this._config);
  118438. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.INIT_SEGMENT, function(type2, is) {
  118439. _this._msectl.appendInitSegment(is);
  118440. });
  118441. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_SEGMENT, function(type2, ms) {
  118442. _this._msectl.appendMediaSegment(ms);
  118443. if (_this._config.lazyLoad && !_this._config.isLive) {
  118444. var currentTime = _this._mediaElement.currentTime;
  118445. if (ms.info.endDts >= (currentTime + _this._config.lazyLoadMaxDuration) * 1e3) {
  118446. if (_this._progressChecker == null) {
  118447. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(_this.TAG, "Maximum buffering duration exceeded, suspend transmuxing task");
  118448. _this._suspendTransmuxer();
  118449. }
  118450. }
  118451. }
  118452. });
  118453. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.LOADING_COMPLETE, function() {
  118454. _this._msectl.endOfStream();
  118455. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.LOADING_COMPLETE);
  118456. });
  118457. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOVERED_EARLY_EOF, function() {
  118458. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.RECOVERED_EARLY_EOF);
  118459. });
  118460. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.IO_ERROR, function(detail, info) {
  118461. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.ERROR, _player_errors_js__WEBPACK_IMPORTED_MODULE_8__.ErrorTypes.NETWORK_ERROR, detail, info);
  118462. });
  118463. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.DEMUX_ERROR, function(detail, info) {
  118464. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.ERROR, _player_errors_js__WEBPACK_IMPORTED_MODULE_8__.ErrorTypes.MEDIA_ERROR, detail, { code: -1, msg: info });
  118465. });
  118466. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.MEDIA_INFO, function(mediaInfo) {
  118467. _this._mediaInfo = mediaInfo;
  118468. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.MEDIA_INFO, Object.assign({}, mediaInfo));
  118469. });
  118470. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.METADATA_ARRIVED, function(metadata) {
  118471. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.METADATA_ARRIVED, metadata);
  118472. });
  118473. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.SCRIPTDATA_ARRIVED, function(data) {
  118474. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.SCRIPTDATA_ARRIVED, data);
  118475. });
  118476. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.STATISTICS_INFO, function(statInfo) {
  118477. _this._statisticsInfo = _this._fillStatisticsInfo(statInfo);
  118478. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_3__.default.STATISTICS_INFO, Object.assign({}, _this._statisticsInfo));
  118479. });
  118480. this._transmuxer.on(_core_transmuxing_events_js__WEBPACK_IMPORTED_MODULE_5__.default.RECOMMEND_SEEKPOINT, function(milliseconds) {
  118481. if (_this._mediaElement && !_this._config.accurateSeek) {
  118482. _this._requestSetTime = true;
  118483. _this._mediaElement.currentTime = milliseconds / 1e3;
  118484. }
  118485. });
  118486. this._transmuxer.open();
  118487. };
  118488. FlvPlayer2.prototype.unload = function() {
  118489. if (this._mediaElement) {
  118490. this._mediaElement.pause();
  118491. }
  118492. if (this._msectl) {
  118493. this._msectl.seek(0);
  118494. }
  118495. if (this._transmuxer) {
  118496. this._transmuxer.close();
  118497. this._transmuxer.destroy();
  118498. this._transmuxer = null;
  118499. }
  118500. };
  118501. FlvPlayer2.prototype.play = function() {
  118502. return this._mediaElement.play();
  118503. };
  118504. FlvPlayer2.prototype.pause = function() {
  118505. this._mediaElement.pause();
  118506. };
  118507. Object.defineProperty(FlvPlayer2.prototype, "type", {
  118508. get: function() {
  118509. return this._type;
  118510. },
  118511. enumerable: false,
  118512. configurable: true
  118513. });
  118514. Object.defineProperty(FlvPlayer2.prototype, "buffered", {
  118515. get: function() {
  118516. return this._mediaElement.buffered;
  118517. },
  118518. enumerable: false,
  118519. configurable: true
  118520. });
  118521. Object.defineProperty(FlvPlayer2.prototype, "duration", {
  118522. get: function() {
  118523. return this._mediaElement.duration;
  118524. },
  118525. enumerable: false,
  118526. configurable: true
  118527. });
  118528. Object.defineProperty(FlvPlayer2.prototype, "volume", {
  118529. get: function() {
  118530. return this._mediaElement.volume;
  118531. },
  118532. set: function(value) {
  118533. this._mediaElement.volume = value;
  118534. },
  118535. enumerable: false,
  118536. configurable: true
  118537. });
  118538. Object.defineProperty(FlvPlayer2.prototype, "muted", {
  118539. get: function() {
  118540. return this._mediaElement.muted;
  118541. },
  118542. set: function(muted) {
  118543. this._mediaElement.muted = muted;
  118544. },
  118545. enumerable: false,
  118546. configurable: true
  118547. });
  118548. Object.defineProperty(FlvPlayer2.prototype, "currentTime", {
  118549. get: function() {
  118550. if (this._mediaElement) {
  118551. return this._mediaElement.currentTime;
  118552. }
  118553. return 0;
  118554. },
  118555. set: function(seconds) {
  118556. if (this._mediaElement) {
  118557. this._internalSeek(seconds);
  118558. } else {
  118559. this._pendingSeekTime = seconds;
  118560. }
  118561. },
  118562. enumerable: false,
  118563. configurable: true
  118564. });
  118565. Object.defineProperty(FlvPlayer2.prototype, "mediaInfo", {
  118566. get: function() {
  118567. return Object.assign({}, this._mediaInfo);
  118568. },
  118569. enumerable: false,
  118570. configurable: true
  118571. });
  118572. Object.defineProperty(FlvPlayer2.prototype, "statisticsInfo", {
  118573. get: function() {
  118574. if (this._statisticsInfo == null) {
  118575. this._statisticsInfo = {};
  118576. }
  118577. this._statisticsInfo = this._fillStatisticsInfo(this._statisticsInfo);
  118578. return Object.assign({}, this._statisticsInfo);
  118579. },
  118580. enumerable: false,
  118581. configurable: true
  118582. });
  118583. FlvPlayer2.prototype._fillStatisticsInfo = function(statInfo) {
  118584. statInfo.playerType = this._type;
  118585. if (!(this._mediaElement instanceof HTMLVideoElement)) {
  118586. return statInfo;
  118587. }
  118588. var hasQualityInfo = true;
  118589. var decoded = 0;
  118590. var dropped = 0;
  118591. if (this._mediaElement.getVideoPlaybackQuality) {
  118592. var quality = this._mediaElement.getVideoPlaybackQuality();
  118593. decoded = quality.totalVideoFrames;
  118594. dropped = quality.droppedVideoFrames;
  118595. } else if (this._mediaElement.webkitDecodedFrameCount != void 0) {
  118596. decoded = this._mediaElement.webkitDecodedFrameCount;
  118597. dropped = this._mediaElement.webkitDroppedFrameCount;
  118598. } else {
  118599. hasQualityInfo = false;
  118600. }
  118601. if (hasQualityInfo) {
  118602. statInfo.decodedFrames = decoded;
  118603. statInfo.droppedFrames = dropped;
  118604. }
  118605. return statInfo;
  118606. };
  118607. FlvPlayer2.prototype._onmseUpdateEnd = function() {
  118608. if (!this._config.lazyLoad || this._config.isLive) {
  118609. return;
  118610. }
  118611. var buffered = this._mediaElement.buffered;
  118612. var currentTime = this._mediaElement.currentTime;
  118613. var currentRangeEnd = 0;
  118614. for (var i2 = 0; i2 < buffered.length; i2++) {
  118615. var start2 = buffered.start(i2);
  118616. var end = buffered.end(i2);
  118617. if (start2 <= currentTime && currentTime < end) {
  118618. currentRangeEnd = end;
  118619. break;
  118620. }
  118621. }
  118622. if (currentRangeEnd >= currentTime + this._config.lazyLoadMaxDuration && this._progressChecker == null) {
  118623. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Maximum buffering duration exceeded, suspend transmuxing task");
  118624. this._suspendTransmuxer();
  118625. }
  118626. };
  118627. FlvPlayer2.prototype._onmseBufferFull = function() {
  118628. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "MSE SourceBuffer is full, suspend transmuxing task");
  118629. if (this._progressChecker == null) {
  118630. this._suspendTransmuxer();
  118631. }
  118632. };
  118633. FlvPlayer2.prototype._suspendTransmuxer = function() {
  118634. if (this._transmuxer) {
  118635. this._transmuxer.pause();
  118636. if (this._progressChecker == null) {
  118637. this._progressChecker = window.setInterval(this._checkProgressAndResume.bind(this), 1e3);
  118638. }
  118639. }
  118640. };
  118641. FlvPlayer2.prototype._checkProgressAndResume = function() {
  118642. var currentTime = this._mediaElement.currentTime;
  118643. var buffered = this._mediaElement.buffered;
  118644. var needResume = false;
  118645. for (var i2 = 0; i2 < buffered.length; i2++) {
  118646. var from3 = buffered.start(i2);
  118647. var to = buffered.end(i2);
  118648. if (currentTime >= from3 && currentTime < to) {
  118649. if (currentTime >= to - this._config.lazyLoadRecoverDuration) {
  118650. needResume = true;
  118651. }
  118652. break;
  118653. }
  118654. }
  118655. if (needResume) {
  118656. window.clearInterval(this._progressChecker);
  118657. this._progressChecker = null;
  118658. if (needResume) {
  118659. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.v(this.TAG, "Continue loading from paused position");
  118660. this._transmuxer.resume();
  118661. }
  118662. }
  118663. };
  118664. FlvPlayer2.prototype._isTimepointBuffered = function(seconds) {
  118665. var buffered = this._mediaElement.buffered;
  118666. for (var i2 = 0; i2 < buffered.length; i2++) {
  118667. var from3 = buffered.start(i2);
  118668. var to = buffered.end(i2);
  118669. if (seconds >= from3 && seconds < to) {
  118670. return true;
  118671. }
  118672. }
  118673. return false;
  118674. };
  118675. FlvPlayer2.prototype._internalSeek = function(seconds) {
  118676. var directSeek = this._isTimepointBuffered(seconds);
  118677. var directSeekBegin = false;
  118678. var directSeekBeginTime = 0;
  118679. if (seconds < 1 && this._mediaElement.buffered.length > 0) {
  118680. var videoBeginTime = this._mediaElement.buffered.start(0);
  118681. if (videoBeginTime < 1 && seconds < videoBeginTime || _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari) {
  118682. directSeekBegin = true;
  118683. directSeekBeginTime = _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari ? 0.1 : videoBeginTime;
  118684. }
  118685. }
  118686. if (directSeekBegin) {
  118687. this._requestSetTime = true;
  118688. this._mediaElement.currentTime = directSeekBeginTime;
  118689. } else if (directSeek) {
  118690. if (!this._alwaysSeekKeyframe) {
  118691. this._requestSetTime = true;
  118692. this._mediaElement.currentTime = seconds;
  118693. } else {
  118694. var idr = this._msectl.getNearestKeyframe(Math.floor(seconds * 1e3));
  118695. this._requestSetTime = true;
  118696. if (idr != null) {
  118697. this._mediaElement.currentTime = idr.dts / 1e3;
  118698. } else {
  118699. this._mediaElement.currentTime = seconds;
  118700. }
  118701. }
  118702. if (this._progressChecker != null) {
  118703. this._checkProgressAndResume();
  118704. }
  118705. } else {
  118706. if (this._progressChecker != null) {
  118707. window.clearInterval(this._progressChecker);
  118708. this._progressChecker = null;
  118709. }
  118710. this._msectl.seek(seconds);
  118711. this._transmuxer.seek(Math.floor(seconds * 1e3));
  118712. if (this._config.accurateSeek) {
  118713. this._requestSetTime = true;
  118714. this._mediaElement.currentTime = seconds;
  118715. }
  118716. }
  118717. };
  118718. FlvPlayer2.prototype._checkAndApplyUnbufferedSeekpoint = function() {
  118719. if (this._seekpointRecord) {
  118720. if (this._seekpointRecord.recordTime <= this._now() - 100) {
  118721. var target = this._mediaElement.currentTime;
  118722. this._seekpointRecord = null;
  118723. if (!this._isTimepointBuffered(target)) {
  118724. if (this._progressChecker != null) {
  118725. window.clearTimeout(this._progressChecker);
  118726. this._progressChecker = null;
  118727. }
  118728. this._msectl.seek(target);
  118729. this._transmuxer.seek(Math.floor(target * 1e3));
  118730. if (this._config.accurateSeek) {
  118731. this._requestSetTime = true;
  118732. this._mediaElement.currentTime = target;
  118733. }
  118734. }
  118735. } else {
  118736. window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this), 50);
  118737. }
  118738. }
  118739. };
  118740. FlvPlayer2.prototype._checkAndResumeStuckPlayback = function(stalled) {
  118741. var media = this._mediaElement;
  118742. if (stalled || !this._receivedCanPlay || media.readyState < 2) {
  118743. var buffered = media.buffered;
  118744. if (buffered.length > 0 && media.currentTime < buffered.start(0)) {
  118745. _utils_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.w(this.TAG, "Playback seems stuck at " + media.currentTime + ", seek to " + buffered.start(0));
  118746. this._requestSetTime = true;
  118747. this._mediaElement.currentTime = buffered.start(0);
  118748. this._mediaElement.removeEventListener("progress", this.e.onvProgress);
  118749. }
  118750. } else {
  118751. this._mediaElement.removeEventListener("progress", this.e.onvProgress);
  118752. }
  118753. };
  118754. FlvPlayer2.prototype._onvLoadedMetadata = function(e) {
  118755. if (this._pendingSeekTime != null) {
  118756. this._mediaElement.currentTime = this._pendingSeekTime;
  118757. this._pendingSeekTime = null;
  118758. }
  118759. };
  118760. FlvPlayer2.prototype._onvSeeking = function(e) {
  118761. var target = this._mediaElement.currentTime;
  118762. var buffered = this._mediaElement.buffered;
  118763. if (this._requestSetTime) {
  118764. this._requestSetTime = false;
  118765. return;
  118766. }
  118767. if (target < 1 && buffered.length > 0) {
  118768. var videoBeginTime = buffered.start(0);
  118769. if (videoBeginTime < 1 && target < videoBeginTime || _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari) {
  118770. this._requestSetTime = true;
  118771. this._mediaElement.currentTime = _utils_browser_js__WEBPACK_IMPORTED_MODULE_2__.default.safari ? 0.1 : videoBeginTime;
  118772. return;
  118773. }
  118774. }
  118775. if (this._isTimepointBuffered(target)) {
  118776. if (this._alwaysSeekKeyframe) {
  118777. var idr = this._msectl.getNearestKeyframe(Math.floor(target * 1e3));
  118778. if (idr != null) {
  118779. this._requestSetTime = true;
  118780. this._mediaElement.currentTime = idr.dts / 1e3;
  118781. }
  118782. }
  118783. if (this._progressChecker != null) {
  118784. this._checkProgressAndResume();
  118785. }
  118786. return;
  118787. }
  118788. this._seekpointRecord = {
  118789. seekPoint: target,
  118790. recordTime: this._now()
  118791. };
  118792. window.setTimeout(this._checkAndApplyUnbufferedSeekpoint.bind(this), 50);
  118793. };
  118794. FlvPlayer2.prototype._onvCanPlay = function(e) {
  118795. this._receivedCanPlay = true;
  118796. this._mediaElement.removeEventListener("canplay", this.e.onvCanPlay);
  118797. };
  118798. FlvPlayer2.prototype._onvStalled = function(e) {
  118799. this._checkAndResumeStuckPlayback(true);
  118800. };
  118801. FlvPlayer2.prototype._onvProgress = function(e) {
  118802. this._checkAndResumeStuckPlayback();
  118803. };
  118804. return FlvPlayer2;
  118805. }();
  118806. __webpack_exports__2["default"] = FlvPlayer;
  118807. },
  118808. "./src/player/native-player.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  118809. __webpack_require__2.r(__webpack_exports__2);
  118810. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  118811. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  118812. var _player_events_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/player/player-events.js");
  118813. var _config_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/config.js");
  118814. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/utils/exception.js");
  118815. var NativePlayer = function() {
  118816. function NativePlayer2(mediaDataSource, config) {
  118817. this.TAG = "NativePlayer";
  118818. this._type = "NativePlayer";
  118819. this._emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  118820. this._config = (0, _config_js__WEBPACK_IMPORTED_MODULE_2__.createDefaultConfig)();
  118821. if (typeof config === "object") {
  118822. Object.assign(this._config, config);
  118823. }
  118824. if (mediaDataSource.type.toLowerCase() === "flv") {
  118825. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__.InvalidArgumentException("NativePlayer does't support flv MediaDataSource input!");
  118826. }
  118827. if (mediaDataSource.hasOwnProperty("segments")) {
  118828. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__.InvalidArgumentException("NativePlayer(" + mediaDataSource.type + ") doesn't support multipart playback!");
  118829. }
  118830. this.e = {
  118831. onvLoadedMetadata: this._onvLoadedMetadata.bind(this)
  118832. };
  118833. this._pendingSeekTime = null;
  118834. this._statisticsReporter = null;
  118835. this._mediaDataSource = mediaDataSource;
  118836. this._mediaElement = null;
  118837. }
  118838. NativePlayer2.prototype.destroy = function() {
  118839. if (this._mediaElement) {
  118840. this.unload();
  118841. this.detachMediaElement();
  118842. }
  118843. this.e = null;
  118844. this._mediaDataSource = null;
  118845. this._emitter.removeAllListeners();
  118846. this._emitter = null;
  118847. };
  118848. NativePlayer2.prototype.on = function(event2, listener) {
  118849. var _this = this;
  118850. if (event2 === _player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.MEDIA_INFO) {
  118851. if (this._mediaElement != null && this._mediaElement.readyState !== 0) {
  118852. Promise.resolve().then(function() {
  118853. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.MEDIA_INFO, _this.mediaInfo);
  118854. });
  118855. }
  118856. } else if (event2 === _player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.STATISTICS_INFO) {
  118857. if (this._mediaElement != null && this._mediaElement.readyState !== 0) {
  118858. Promise.resolve().then(function() {
  118859. _this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.STATISTICS_INFO, _this.statisticsInfo);
  118860. });
  118861. }
  118862. }
  118863. this._emitter.addListener(event2, listener);
  118864. };
  118865. NativePlayer2.prototype.off = function(event2, listener) {
  118866. this._emitter.removeListener(event2, listener);
  118867. };
  118868. NativePlayer2.prototype.attachMediaElement = function(mediaElement) {
  118869. this._mediaElement = mediaElement;
  118870. mediaElement.addEventListener("loadedmetadata", this.e.onvLoadedMetadata);
  118871. if (this._pendingSeekTime != null) {
  118872. try {
  118873. mediaElement.currentTime = this._pendingSeekTime;
  118874. this._pendingSeekTime = null;
  118875. } catch (e) {
  118876. }
  118877. }
  118878. };
  118879. NativePlayer2.prototype.detachMediaElement = function() {
  118880. if (this._mediaElement) {
  118881. this._mediaElement.src = "";
  118882. this._mediaElement.removeAttribute("src");
  118883. this._mediaElement.removeEventListener("loadedmetadata", this.e.onvLoadedMetadata);
  118884. this._mediaElement = null;
  118885. }
  118886. if (this._statisticsReporter != null) {
  118887. window.clearInterval(this._statisticsReporter);
  118888. this._statisticsReporter = null;
  118889. }
  118890. };
  118891. NativePlayer2.prototype.load = function() {
  118892. if (!this._mediaElement) {
  118893. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_3__.IllegalStateException("HTMLMediaElement must be attached before load()!");
  118894. }
  118895. this._mediaElement.src = this._mediaDataSource.url;
  118896. if (this._mediaElement.readyState > 0) {
  118897. this._mediaElement.currentTime = 0;
  118898. }
  118899. this._mediaElement.preload = "auto";
  118900. this._mediaElement.load();
  118901. this._statisticsReporter = window.setInterval(this._reportStatisticsInfo.bind(this), this._config.statisticsInfoReportInterval);
  118902. };
  118903. NativePlayer2.prototype.unload = function() {
  118904. if (this._mediaElement) {
  118905. this._mediaElement.src = "";
  118906. this._mediaElement.removeAttribute("src");
  118907. }
  118908. if (this._statisticsReporter != null) {
  118909. window.clearInterval(this._statisticsReporter);
  118910. this._statisticsReporter = null;
  118911. }
  118912. };
  118913. NativePlayer2.prototype.play = function() {
  118914. return this._mediaElement.play();
  118915. };
  118916. NativePlayer2.prototype.pause = function() {
  118917. this._mediaElement.pause();
  118918. };
  118919. Object.defineProperty(NativePlayer2.prototype, "type", {
  118920. get: function() {
  118921. return this._type;
  118922. },
  118923. enumerable: false,
  118924. configurable: true
  118925. });
  118926. Object.defineProperty(NativePlayer2.prototype, "buffered", {
  118927. get: function() {
  118928. return this._mediaElement.buffered;
  118929. },
  118930. enumerable: false,
  118931. configurable: true
  118932. });
  118933. Object.defineProperty(NativePlayer2.prototype, "duration", {
  118934. get: function() {
  118935. return this._mediaElement.duration;
  118936. },
  118937. enumerable: false,
  118938. configurable: true
  118939. });
  118940. Object.defineProperty(NativePlayer2.prototype, "volume", {
  118941. get: function() {
  118942. return this._mediaElement.volume;
  118943. },
  118944. set: function(value) {
  118945. this._mediaElement.volume = value;
  118946. },
  118947. enumerable: false,
  118948. configurable: true
  118949. });
  118950. Object.defineProperty(NativePlayer2.prototype, "muted", {
  118951. get: function() {
  118952. return this._mediaElement.muted;
  118953. },
  118954. set: function(muted) {
  118955. this._mediaElement.muted = muted;
  118956. },
  118957. enumerable: false,
  118958. configurable: true
  118959. });
  118960. Object.defineProperty(NativePlayer2.prototype, "currentTime", {
  118961. get: function() {
  118962. if (this._mediaElement) {
  118963. return this._mediaElement.currentTime;
  118964. }
  118965. return 0;
  118966. },
  118967. set: function(seconds) {
  118968. if (this._mediaElement) {
  118969. this._mediaElement.currentTime = seconds;
  118970. } else {
  118971. this._pendingSeekTime = seconds;
  118972. }
  118973. },
  118974. enumerable: false,
  118975. configurable: true
  118976. });
  118977. Object.defineProperty(NativePlayer2.prototype, "mediaInfo", {
  118978. get: function() {
  118979. var mediaPrefix = this._mediaElement instanceof HTMLAudioElement ? "audio/" : "video/";
  118980. var info = {
  118981. mimeType: mediaPrefix + this._mediaDataSource.type
  118982. };
  118983. if (this._mediaElement) {
  118984. info.duration = Math.floor(this._mediaElement.duration * 1e3);
  118985. if (this._mediaElement instanceof HTMLVideoElement) {
  118986. info.width = this._mediaElement.videoWidth;
  118987. info.height = this._mediaElement.videoHeight;
  118988. }
  118989. }
  118990. return info;
  118991. },
  118992. enumerable: false,
  118993. configurable: true
  118994. });
  118995. Object.defineProperty(NativePlayer2.prototype, "statisticsInfo", {
  118996. get: function() {
  118997. var info = {
  118998. playerType: this._type,
  118999. url: this._mediaDataSource.url
  119000. };
  119001. if (!(this._mediaElement instanceof HTMLVideoElement)) {
  119002. return info;
  119003. }
  119004. var hasQualityInfo = true;
  119005. var decoded = 0;
  119006. var dropped = 0;
  119007. if (this._mediaElement.getVideoPlaybackQuality) {
  119008. var quality = this._mediaElement.getVideoPlaybackQuality();
  119009. decoded = quality.totalVideoFrames;
  119010. dropped = quality.droppedVideoFrames;
  119011. } else if (this._mediaElement.webkitDecodedFrameCount != void 0) {
  119012. decoded = this._mediaElement.webkitDecodedFrameCount;
  119013. dropped = this._mediaElement.webkitDroppedFrameCount;
  119014. } else {
  119015. hasQualityInfo = false;
  119016. }
  119017. if (hasQualityInfo) {
  119018. info.decodedFrames = decoded;
  119019. info.droppedFrames = dropped;
  119020. }
  119021. return info;
  119022. },
  119023. enumerable: false,
  119024. configurable: true
  119025. });
  119026. NativePlayer2.prototype._onvLoadedMetadata = function(e) {
  119027. if (this._pendingSeekTime != null) {
  119028. this._mediaElement.currentTime = this._pendingSeekTime;
  119029. this._pendingSeekTime = null;
  119030. }
  119031. this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.MEDIA_INFO, this.mediaInfo);
  119032. };
  119033. NativePlayer2.prototype._reportStatisticsInfo = function() {
  119034. this._emitter.emit(_player_events_js__WEBPACK_IMPORTED_MODULE_1__.default.STATISTICS_INFO, this.statisticsInfo);
  119035. };
  119036. return NativePlayer2;
  119037. }();
  119038. __webpack_exports__2["default"] = NativePlayer;
  119039. },
  119040. "./src/player/player-errors.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  119041. __webpack_require__2.r(__webpack_exports__2);
  119042. __webpack_require__2.d(__webpack_exports__2, {
  119043. "ErrorTypes": function() {
  119044. return ErrorTypes;
  119045. },
  119046. "ErrorDetails": function() {
  119047. return ErrorDetails;
  119048. }
  119049. });
  119050. var _io_loader_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/io/loader.js");
  119051. var _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/demux/demux-errors.js");
  119052. var ErrorTypes = {
  119053. NETWORK_ERROR: "NetworkError",
  119054. MEDIA_ERROR: "MediaError",
  119055. OTHER_ERROR: "OtherError"
  119056. };
  119057. var ErrorDetails = {
  119058. NETWORK_EXCEPTION: _io_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.EXCEPTION,
  119059. NETWORK_STATUS_CODE_INVALID: _io_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.HTTP_STATUS_CODE_INVALID,
  119060. NETWORK_TIMEOUT: _io_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.CONNECTING_TIMEOUT,
  119061. NETWORK_UNRECOVERABLE_EARLY_EOF: _io_loader_js__WEBPACK_IMPORTED_MODULE_0__.LoaderErrors.UNRECOVERABLE_EARLY_EOF,
  119062. MEDIA_MSE_ERROR: "MediaMSEError",
  119063. MEDIA_FORMAT_ERROR: _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_1__.default.FORMAT_ERROR,
  119064. MEDIA_FORMAT_UNSUPPORTED: _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_1__.default.FORMAT_UNSUPPORTED,
  119065. MEDIA_CODEC_UNSUPPORTED: _demux_demux_errors_js__WEBPACK_IMPORTED_MODULE_1__.default.CODEC_UNSUPPORTED
  119066. };
  119067. },
  119068. "./src/player/player-events.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  119069. __webpack_require__2.r(__webpack_exports__2);
  119070. var PlayerEvents = {
  119071. ERROR: "error",
  119072. LOADING_COMPLETE: "loading_complete",
  119073. RECOVERED_EARLY_EOF: "recovered_early_eof",
  119074. MEDIA_INFO: "media_info",
  119075. METADATA_ARRIVED: "metadata_arrived",
  119076. SCRIPTDATA_ARRIVED: "scriptdata_arrived",
  119077. STATISTICS_INFO: "statistics_info"
  119078. };
  119079. __webpack_exports__2["default"] = PlayerEvents;
  119080. },
  119081. "./src/remux/aac-silent.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  119082. __webpack_require__2.r(__webpack_exports__2);
  119083. var AAC = function() {
  119084. function AAC2() {
  119085. }
  119086. AAC2.getSilentFrame = function(codec, channelCount) {
  119087. if (codec === "mp4a.40.2") {
  119088. if (channelCount === 1) {
  119089. return new Uint8Array([0, 200, 0, 128, 35, 128]);
  119090. } else if (channelCount === 2) {
  119091. return new Uint8Array([33, 0, 73, 144, 2, 25, 0, 35, 128]);
  119092. } else if (channelCount === 3) {
  119093. return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 142]);
  119094. } else if (channelCount === 4) {
  119095. return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 128, 44, 128, 8, 2, 56]);
  119096. } else if (channelCount === 5) {
  119097. return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 130, 48, 4, 153, 0, 33, 144, 2, 56]);
  119098. } else if (channelCount === 6) {
  119099. return new Uint8Array([0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 130, 48, 4, 153, 0, 33, 144, 2, 0, 178, 0, 32, 8, 224]);
  119100. }
  119101. } else {
  119102. if (channelCount === 1) {
  119103. return new Uint8Array([1, 64, 34, 128, 163, 78, 230, 128, 186, 8, 0, 0, 0, 28, 6, 241, 193, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94]);
  119104. } else if (channelCount === 2) {
  119105. return new Uint8Array([1, 64, 34, 128, 163, 94, 230, 128, 186, 8, 0, 0, 0, 0, 149, 0, 6, 241, 161, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94]);
  119106. } else if (channelCount === 3) {
  119107. return new Uint8Array([1, 64, 34, 128, 163, 94, 230, 128, 186, 8, 0, 0, 0, 0, 149, 0, 6, 241, 161, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 94]);
  119108. }
  119109. }
  119110. return null;
  119111. };
  119112. return AAC2;
  119113. }();
  119114. __webpack_exports__2["default"] = AAC;
  119115. },
  119116. "./src/remux/mp4-generator.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  119117. __webpack_require__2.r(__webpack_exports__2);
  119118. var MP4 = function() {
  119119. function MP42() {
  119120. }
  119121. MP42.init = function() {
  119122. MP42.types = {
  119123. avc1: [],
  119124. avcC: [],
  119125. btrt: [],
  119126. dinf: [],
  119127. dref: [],
  119128. esds: [],
  119129. ftyp: [],
  119130. hdlr: [],
  119131. mdat: [],
  119132. mdhd: [],
  119133. mdia: [],
  119134. mfhd: [],
  119135. minf: [],
  119136. moof: [],
  119137. moov: [],
  119138. mp4a: [],
  119139. mvex: [],
  119140. mvhd: [],
  119141. sdtp: [],
  119142. stbl: [],
  119143. stco: [],
  119144. stsc: [],
  119145. stsd: [],
  119146. stsz: [],
  119147. stts: [],
  119148. tfdt: [],
  119149. tfhd: [],
  119150. traf: [],
  119151. trak: [],
  119152. trun: [],
  119153. trex: [],
  119154. tkhd: [],
  119155. vmhd: [],
  119156. smhd: [],
  119157. ".mp3": []
  119158. };
  119159. for (var name_1 in MP42.types) {
  119160. if (MP42.types.hasOwnProperty(name_1)) {
  119161. MP42.types[name_1] = [
  119162. name_1.charCodeAt(0),
  119163. name_1.charCodeAt(1),
  119164. name_1.charCodeAt(2),
  119165. name_1.charCodeAt(3)
  119166. ];
  119167. }
  119168. }
  119169. var constants = MP42.constants = {};
  119170. constants.FTYP = new Uint8Array([
  119171. 105,
  119172. 115,
  119173. 111,
  119174. 109,
  119175. 0,
  119176. 0,
  119177. 0,
  119178. 1,
  119179. 105,
  119180. 115,
  119181. 111,
  119182. 109,
  119183. 97,
  119184. 118,
  119185. 99,
  119186. 49
  119187. ]);
  119188. constants.STSD_PREFIX = new Uint8Array([
  119189. 0,
  119190. 0,
  119191. 0,
  119192. 0,
  119193. 0,
  119194. 0,
  119195. 0,
  119196. 1
  119197. ]);
  119198. constants.STTS = new Uint8Array([
  119199. 0,
  119200. 0,
  119201. 0,
  119202. 0,
  119203. 0,
  119204. 0,
  119205. 0,
  119206. 0
  119207. ]);
  119208. constants.STSC = constants.STCO = constants.STTS;
  119209. constants.STSZ = new Uint8Array([
  119210. 0,
  119211. 0,
  119212. 0,
  119213. 0,
  119214. 0,
  119215. 0,
  119216. 0,
  119217. 0,
  119218. 0,
  119219. 0,
  119220. 0,
  119221. 0
  119222. ]);
  119223. constants.HDLR_VIDEO = new Uint8Array([
  119224. 0,
  119225. 0,
  119226. 0,
  119227. 0,
  119228. 0,
  119229. 0,
  119230. 0,
  119231. 0,
  119232. 118,
  119233. 105,
  119234. 100,
  119235. 101,
  119236. 0,
  119237. 0,
  119238. 0,
  119239. 0,
  119240. 0,
  119241. 0,
  119242. 0,
  119243. 0,
  119244. 0,
  119245. 0,
  119246. 0,
  119247. 0,
  119248. 86,
  119249. 105,
  119250. 100,
  119251. 101,
  119252. 111,
  119253. 72,
  119254. 97,
  119255. 110,
  119256. 100,
  119257. 108,
  119258. 101,
  119259. 114,
  119260. 0
  119261. ]);
  119262. constants.HDLR_AUDIO = new Uint8Array([
  119263. 0,
  119264. 0,
  119265. 0,
  119266. 0,
  119267. 0,
  119268. 0,
  119269. 0,
  119270. 0,
  119271. 115,
  119272. 111,
  119273. 117,
  119274. 110,
  119275. 0,
  119276. 0,
  119277. 0,
  119278. 0,
  119279. 0,
  119280. 0,
  119281. 0,
  119282. 0,
  119283. 0,
  119284. 0,
  119285. 0,
  119286. 0,
  119287. 83,
  119288. 111,
  119289. 117,
  119290. 110,
  119291. 100,
  119292. 72,
  119293. 97,
  119294. 110,
  119295. 100,
  119296. 108,
  119297. 101,
  119298. 114,
  119299. 0
  119300. ]);
  119301. constants.DREF = new Uint8Array([
  119302. 0,
  119303. 0,
  119304. 0,
  119305. 0,
  119306. 0,
  119307. 0,
  119308. 0,
  119309. 1,
  119310. 0,
  119311. 0,
  119312. 0,
  119313. 12,
  119314. 117,
  119315. 114,
  119316. 108,
  119317. 32,
  119318. 0,
  119319. 0,
  119320. 0,
  119321. 1
  119322. ]);
  119323. constants.SMHD = new Uint8Array([
  119324. 0,
  119325. 0,
  119326. 0,
  119327. 0,
  119328. 0,
  119329. 0,
  119330. 0,
  119331. 0
  119332. ]);
  119333. constants.VMHD = new Uint8Array([
  119334. 0,
  119335. 0,
  119336. 0,
  119337. 1,
  119338. 0,
  119339. 0,
  119340. 0,
  119341. 0,
  119342. 0,
  119343. 0,
  119344. 0,
  119345. 0
  119346. ]);
  119347. };
  119348. MP42.box = function(type2) {
  119349. var size = 8;
  119350. var result = null;
  119351. var datas = Array.prototype.slice.call(arguments, 1);
  119352. var arrayCount = datas.length;
  119353. for (var i2 = 0; i2 < arrayCount; i2++) {
  119354. size += datas[i2].byteLength;
  119355. }
  119356. result = new Uint8Array(size);
  119357. result[0] = size >>> 24 & 255;
  119358. result[1] = size >>> 16 & 255;
  119359. result[2] = size >>> 8 & 255;
  119360. result[3] = size & 255;
  119361. result.set(type2, 4);
  119362. var offset = 8;
  119363. for (var i2 = 0; i2 < arrayCount; i2++) {
  119364. result.set(datas[i2], offset);
  119365. offset += datas[i2].byteLength;
  119366. }
  119367. return result;
  119368. };
  119369. MP42.generateInitSegment = function(meta2) {
  119370. var ftyp = MP42.box(MP42.types.ftyp, MP42.constants.FTYP);
  119371. var moov = MP42.moov(meta2);
  119372. var result = new Uint8Array(ftyp.byteLength + moov.byteLength);
  119373. result.set(ftyp, 0);
  119374. result.set(moov, ftyp.byteLength);
  119375. return result;
  119376. };
  119377. MP42.moov = function(meta2) {
  119378. var mvhd = MP42.mvhd(meta2.timescale, meta2.duration);
  119379. var trak = MP42.trak(meta2);
  119380. var mvex = MP42.mvex(meta2);
  119381. return MP42.box(MP42.types.moov, mvhd, trak, mvex);
  119382. };
  119383. MP42.mvhd = function(timescale2, duration5) {
  119384. return MP42.box(MP42.types.mvhd, new Uint8Array([
  119385. 0,
  119386. 0,
  119387. 0,
  119388. 0,
  119389. 0,
  119390. 0,
  119391. 0,
  119392. 0,
  119393. 0,
  119394. 0,
  119395. 0,
  119396. 0,
  119397. timescale2 >>> 24 & 255,
  119398. timescale2 >>> 16 & 255,
  119399. timescale2 >>> 8 & 255,
  119400. timescale2 & 255,
  119401. duration5 >>> 24 & 255,
  119402. duration5 >>> 16 & 255,
  119403. duration5 >>> 8 & 255,
  119404. duration5 & 255,
  119405. 0,
  119406. 1,
  119407. 0,
  119408. 0,
  119409. 1,
  119410. 0,
  119411. 0,
  119412. 0,
  119413. 0,
  119414. 0,
  119415. 0,
  119416. 0,
  119417. 0,
  119418. 0,
  119419. 0,
  119420. 0,
  119421. 0,
  119422. 1,
  119423. 0,
  119424. 0,
  119425. 0,
  119426. 0,
  119427. 0,
  119428. 0,
  119429. 0,
  119430. 0,
  119431. 0,
  119432. 0,
  119433. 0,
  119434. 0,
  119435. 0,
  119436. 0,
  119437. 0,
  119438. 1,
  119439. 0,
  119440. 0,
  119441. 0,
  119442. 0,
  119443. 0,
  119444. 0,
  119445. 0,
  119446. 0,
  119447. 0,
  119448. 0,
  119449. 0,
  119450. 0,
  119451. 0,
  119452. 0,
  119453. 64,
  119454. 0,
  119455. 0,
  119456. 0,
  119457. 0,
  119458. 0,
  119459. 0,
  119460. 0,
  119461. 0,
  119462. 0,
  119463. 0,
  119464. 0,
  119465. 0,
  119466. 0,
  119467. 0,
  119468. 0,
  119469. 0,
  119470. 0,
  119471. 0,
  119472. 0,
  119473. 0,
  119474. 0,
  119475. 0,
  119476. 0,
  119477. 0,
  119478. 0,
  119479. 0,
  119480. 0,
  119481. 255,
  119482. 255,
  119483. 255,
  119484. 255
  119485. ]));
  119486. };
  119487. MP42.trak = function(meta2) {
  119488. return MP42.box(MP42.types.trak, MP42.tkhd(meta2), MP42.mdia(meta2));
  119489. };
  119490. MP42.tkhd = function(meta2) {
  119491. var trackId = meta2.id, duration5 = meta2.duration;
  119492. var width2 = meta2.presentWidth, height2 = meta2.presentHeight;
  119493. return MP42.box(MP42.types.tkhd, new Uint8Array([
  119494. 0,
  119495. 0,
  119496. 0,
  119497. 7,
  119498. 0,
  119499. 0,
  119500. 0,
  119501. 0,
  119502. 0,
  119503. 0,
  119504. 0,
  119505. 0,
  119506. trackId >>> 24 & 255,
  119507. trackId >>> 16 & 255,
  119508. trackId >>> 8 & 255,
  119509. trackId & 255,
  119510. 0,
  119511. 0,
  119512. 0,
  119513. 0,
  119514. duration5 >>> 24 & 255,
  119515. duration5 >>> 16 & 255,
  119516. duration5 >>> 8 & 255,
  119517. duration5 & 255,
  119518. 0,
  119519. 0,
  119520. 0,
  119521. 0,
  119522. 0,
  119523. 0,
  119524. 0,
  119525. 0,
  119526. 0,
  119527. 0,
  119528. 0,
  119529. 0,
  119530. 0,
  119531. 0,
  119532. 0,
  119533. 0,
  119534. 0,
  119535. 1,
  119536. 0,
  119537. 0,
  119538. 0,
  119539. 0,
  119540. 0,
  119541. 0,
  119542. 0,
  119543. 0,
  119544. 0,
  119545. 0,
  119546. 0,
  119547. 0,
  119548. 0,
  119549. 0,
  119550. 0,
  119551. 1,
  119552. 0,
  119553. 0,
  119554. 0,
  119555. 0,
  119556. 0,
  119557. 0,
  119558. 0,
  119559. 0,
  119560. 0,
  119561. 0,
  119562. 0,
  119563. 0,
  119564. 0,
  119565. 0,
  119566. 64,
  119567. 0,
  119568. 0,
  119569. 0,
  119570. width2 >>> 8 & 255,
  119571. width2 & 255,
  119572. 0,
  119573. 0,
  119574. height2 >>> 8 & 255,
  119575. height2 & 255,
  119576. 0,
  119577. 0
  119578. ]));
  119579. };
  119580. MP42.mdia = function(meta2) {
  119581. return MP42.box(MP42.types.mdia, MP42.mdhd(meta2), MP42.hdlr(meta2), MP42.minf(meta2));
  119582. };
  119583. MP42.mdhd = function(meta2) {
  119584. var timescale2 = meta2.timescale;
  119585. var duration5 = meta2.duration;
  119586. return MP42.box(MP42.types.mdhd, new Uint8Array([
  119587. 0,
  119588. 0,
  119589. 0,
  119590. 0,
  119591. 0,
  119592. 0,
  119593. 0,
  119594. 0,
  119595. 0,
  119596. 0,
  119597. 0,
  119598. 0,
  119599. timescale2 >>> 24 & 255,
  119600. timescale2 >>> 16 & 255,
  119601. timescale2 >>> 8 & 255,
  119602. timescale2 & 255,
  119603. duration5 >>> 24 & 255,
  119604. duration5 >>> 16 & 255,
  119605. duration5 >>> 8 & 255,
  119606. duration5 & 255,
  119607. 85,
  119608. 196,
  119609. 0,
  119610. 0
  119611. ]));
  119612. };
  119613. MP42.hdlr = function(meta2) {
  119614. var data = null;
  119615. if (meta2.type === "audio") {
  119616. data = MP42.constants.HDLR_AUDIO;
  119617. } else {
  119618. data = MP42.constants.HDLR_VIDEO;
  119619. }
  119620. return MP42.box(MP42.types.hdlr, data);
  119621. };
  119622. MP42.minf = function(meta2) {
  119623. var xmhd = null;
  119624. if (meta2.type === "audio") {
  119625. xmhd = MP42.box(MP42.types.smhd, MP42.constants.SMHD);
  119626. } else {
  119627. xmhd = MP42.box(MP42.types.vmhd, MP42.constants.VMHD);
  119628. }
  119629. return MP42.box(MP42.types.minf, xmhd, MP42.dinf(), MP42.stbl(meta2));
  119630. };
  119631. MP42.dinf = function() {
  119632. var result = MP42.box(MP42.types.dinf, MP42.box(MP42.types.dref, MP42.constants.DREF));
  119633. return result;
  119634. };
  119635. MP42.stbl = function(meta2) {
  119636. var result = MP42.box(
  119637. MP42.types.stbl,
  119638. MP42.stsd(meta2),
  119639. MP42.box(MP42.types.stts, MP42.constants.STTS),
  119640. MP42.box(MP42.types.stsc, MP42.constants.STSC),
  119641. MP42.box(MP42.types.stsz, MP42.constants.STSZ),
  119642. MP42.box(MP42.types.stco, MP42.constants.STCO)
  119643. );
  119644. return result;
  119645. };
  119646. MP42.stsd = function(meta2) {
  119647. if (meta2.type === "audio") {
  119648. if (meta2.codec === "mp3") {
  119649. return MP42.box(MP42.types.stsd, MP42.constants.STSD_PREFIX, MP42.mp3(meta2));
  119650. }
  119651. return MP42.box(MP42.types.stsd, MP42.constants.STSD_PREFIX, MP42.mp4a(meta2));
  119652. } else {
  119653. return MP42.box(MP42.types.stsd, MP42.constants.STSD_PREFIX, MP42.avc1(meta2));
  119654. }
  119655. };
  119656. MP42.mp3 = function(meta2) {
  119657. var channelCount = meta2.channelCount;
  119658. var sampleRate = meta2.audioSampleRate;
  119659. var data = new Uint8Array([
  119660. 0,
  119661. 0,
  119662. 0,
  119663. 0,
  119664. 0,
  119665. 0,
  119666. 0,
  119667. 1,
  119668. 0,
  119669. 0,
  119670. 0,
  119671. 0,
  119672. 0,
  119673. 0,
  119674. 0,
  119675. 0,
  119676. 0,
  119677. channelCount,
  119678. 0,
  119679. 16,
  119680. 0,
  119681. 0,
  119682. 0,
  119683. 0,
  119684. sampleRate >>> 8 & 255,
  119685. sampleRate & 255,
  119686. 0,
  119687. 0
  119688. ]);
  119689. return MP42.box(MP42.types[".mp3"], data);
  119690. };
  119691. MP42.mp4a = function(meta2) {
  119692. var channelCount = meta2.channelCount;
  119693. var sampleRate = meta2.audioSampleRate;
  119694. var data = new Uint8Array([
  119695. 0,
  119696. 0,
  119697. 0,
  119698. 0,
  119699. 0,
  119700. 0,
  119701. 0,
  119702. 1,
  119703. 0,
  119704. 0,
  119705. 0,
  119706. 0,
  119707. 0,
  119708. 0,
  119709. 0,
  119710. 0,
  119711. 0,
  119712. channelCount,
  119713. 0,
  119714. 16,
  119715. 0,
  119716. 0,
  119717. 0,
  119718. 0,
  119719. sampleRate >>> 8 & 255,
  119720. sampleRate & 255,
  119721. 0,
  119722. 0
  119723. ]);
  119724. return MP42.box(MP42.types.mp4a, data, MP42.esds(meta2));
  119725. };
  119726. MP42.esds = function(meta2) {
  119727. var config = meta2.config || [];
  119728. var configSize = config.length;
  119729. var data = new Uint8Array([
  119730. 0,
  119731. 0,
  119732. 0,
  119733. 0,
  119734. 3,
  119735. 23 + configSize,
  119736. 0,
  119737. 1,
  119738. 0,
  119739. 4,
  119740. 15 + configSize,
  119741. 64,
  119742. 21,
  119743. 0,
  119744. 0,
  119745. 0,
  119746. 0,
  119747. 0,
  119748. 0,
  119749. 0,
  119750. 0,
  119751. 0,
  119752. 0,
  119753. 0,
  119754. 5
  119755. ].concat([
  119756. configSize
  119757. ]).concat(config).concat([
  119758. 6,
  119759. 1,
  119760. 2
  119761. ]));
  119762. return MP42.box(MP42.types.esds, data);
  119763. };
  119764. MP42.avc1 = function(meta2) {
  119765. var avcc = meta2.avcc;
  119766. var width2 = meta2.codecWidth, height2 = meta2.codecHeight;
  119767. var data = new Uint8Array([
  119768. 0,
  119769. 0,
  119770. 0,
  119771. 0,
  119772. 0,
  119773. 0,
  119774. 0,
  119775. 1,
  119776. 0,
  119777. 0,
  119778. 0,
  119779. 0,
  119780. 0,
  119781. 0,
  119782. 0,
  119783. 0,
  119784. 0,
  119785. 0,
  119786. 0,
  119787. 0,
  119788. 0,
  119789. 0,
  119790. 0,
  119791. 0,
  119792. width2 >>> 8 & 255,
  119793. width2 & 255,
  119794. height2 >>> 8 & 255,
  119795. height2 & 255,
  119796. 0,
  119797. 72,
  119798. 0,
  119799. 0,
  119800. 0,
  119801. 72,
  119802. 0,
  119803. 0,
  119804. 0,
  119805. 0,
  119806. 0,
  119807. 0,
  119808. 0,
  119809. 1,
  119810. 10,
  119811. 120,
  119812. 113,
  119813. 113,
  119814. 47,
  119815. 102,
  119816. 108,
  119817. 118,
  119818. 46,
  119819. 106,
  119820. 115,
  119821. 0,
  119822. 0,
  119823. 0,
  119824. 0,
  119825. 0,
  119826. 0,
  119827. 0,
  119828. 0,
  119829. 0,
  119830. 0,
  119831. 0,
  119832. 0,
  119833. 0,
  119834. 0,
  119835. 0,
  119836. 0,
  119837. 0,
  119838. 0,
  119839. 0,
  119840. 0,
  119841. 0,
  119842. 0,
  119843. 24,
  119844. 255,
  119845. 255
  119846. ]);
  119847. return MP42.box(MP42.types.avc1, data, MP42.box(MP42.types.avcC, avcc));
  119848. };
  119849. MP42.mvex = function(meta2) {
  119850. return MP42.box(MP42.types.mvex, MP42.trex(meta2));
  119851. };
  119852. MP42.trex = function(meta2) {
  119853. var trackId = meta2.id;
  119854. var data = new Uint8Array([
  119855. 0,
  119856. 0,
  119857. 0,
  119858. 0,
  119859. trackId >>> 24 & 255,
  119860. trackId >>> 16 & 255,
  119861. trackId >>> 8 & 255,
  119862. trackId & 255,
  119863. 0,
  119864. 0,
  119865. 0,
  119866. 1,
  119867. 0,
  119868. 0,
  119869. 0,
  119870. 0,
  119871. 0,
  119872. 0,
  119873. 0,
  119874. 0,
  119875. 0,
  119876. 1,
  119877. 0,
  119878. 1
  119879. ]);
  119880. return MP42.box(MP42.types.trex, data);
  119881. };
  119882. MP42.moof = function(track, baseMediaDecodeTime) {
  119883. return MP42.box(MP42.types.moof, MP42.mfhd(track.sequenceNumber), MP42.traf(track, baseMediaDecodeTime));
  119884. };
  119885. MP42.mfhd = function(sequenceNumber) {
  119886. var data = new Uint8Array([
  119887. 0,
  119888. 0,
  119889. 0,
  119890. 0,
  119891. sequenceNumber >>> 24 & 255,
  119892. sequenceNumber >>> 16 & 255,
  119893. sequenceNumber >>> 8 & 255,
  119894. sequenceNumber & 255
  119895. ]);
  119896. return MP42.box(MP42.types.mfhd, data);
  119897. };
  119898. MP42.traf = function(track, baseMediaDecodeTime) {
  119899. var trackId = track.id;
  119900. var tfhd = MP42.box(MP42.types.tfhd, new Uint8Array([
  119901. 0,
  119902. 0,
  119903. 0,
  119904. 0,
  119905. trackId >>> 24 & 255,
  119906. trackId >>> 16 & 255,
  119907. trackId >>> 8 & 255,
  119908. trackId & 255
  119909. ]));
  119910. var tfdt = MP42.box(MP42.types.tfdt, new Uint8Array([
  119911. 0,
  119912. 0,
  119913. 0,
  119914. 0,
  119915. baseMediaDecodeTime >>> 24 & 255,
  119916. baseMediaDecodeTime >>> 16 & 255,
  119917. baseMediaDecodeTime >>> 8 & 255,
  119918. baseMediaDecodeTime & 255
  119919. ]));
  119920. var sdtp = MP42.sdtp(track);
  119921. var trun = MP42.trun(track, sdtp.byteLength + 16 + 16 + 8 + 16 + 8 + 8);
  119922. return MP42.box(MP42.types.traf, tfhd, tfdt, trun, sdtp);
  119923. };
  119924. MP42.sdtp = function(track) {
  119925. var samples = track.samples || [];
  119926. var sampleCount = samples.length;
  119927. var data = new Uint8Array(4 + sampleCount);
  119928. for (var i2 = 0; i2 < sampleCount; i2++) {
  119929. var flags = samples[i2].flags;
  119930. data[i2 + 4] = flags.isLeading << 6 | flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy;
  119931. }
  119932. return MP42.box(MP42.types.sdtp, data);
  119933. };
  119934. MP42.trun = function(track, offset) {
  119935. var samples = track.samples || [];
  119936. var sampleCount = samples.length;
  119937. var dataSize = 12 + 16 * sampleCount;
  119938. var data = new Uint8Array(dataSize);
  119939. offset += 8 + dataSize;
  119940. data.set([
  119941. 0,
  119942. 0,
  119943. 15,
  119944. 1,
  119945. sampleCount >>> 24 & 255,
  119946. sampleCount >>> 16 & 255,
  119947. sampleCount >>> 8 & 255,
  119948. sampleCount & 255,
  119949. offset >>> 24 & 255,
  119950. offset >>> 16 & 255,
  119951. offset >>> 8 & 255,
  119952. offset & 255
  119953. ], 0);
  119954. for (var i2 = 0; i2 < sampleCount; i2++) {
  119955. var duration5 = samples[i2].duration;
  119956. var size = samples[i2].size;
  119957. var flags = samples[i2].flags;
  119958. var cts = samples[i2].cts;
  119959. data.set([
  119960. duration5 >>> 24 & 255,
  119961. duration5 >>> 16 & 255,
  119962. duration5 >>> 8 & 255,
  119963. duration5 & 255,
  119964. size >>> 24 & 255,
  119965. size >>> 16 & 255,
  119966. size >>> 8 & 255,
  119967. size & 255,
  119968. flags.isLeading << 2 | flags.dependsOn,
  119969. flags.isDependedOn << 6 | flags.hasRedundancy << 4 | flags.isNonSync,
  119970. 0,
  119971. 0,
  119972. cts >>> 24 & 255,
  119973. cts >>> 16 & 255,
  119974. cts >>> 8 & 255,
  119975. cts & 255
  119976. ], 12 + 16 * i2);
  119977. }
  119978. return MP42.box(MP42.types.trun, data);
  119979. };
  119980. MP42.mdat = function(data) {
  119981. return MP42.box(MP42.types.mdat, data);
  119982. };
  119983. return MP42;
  119984. }();
  119985. MP4.init();
  119986. __webpack_exports__2["default"] = MP4;
  119987. },
  119988. "./src/remux/mp4-remuxer.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  119989. __webpack_require__2.r(__webpack_exports__2);
  119990. var _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./src/utils/logger.js");
  119991. var _mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/remux/mp4-generator.js");
  119992. var _aac_silent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__2("./src/remux/aac-silent.js");
  119993. var _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__2("./src/utils/browser.js");
  119994. var _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__2("./src/core/media-segment-info.js");
  119995. var _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__2("./src/utils/exception.js");
  119996. var MP4Remuxer = function() {
  119997. function MP4Remuxer2(config) {
  119998. this.TAG = "MP4Remuxer";
  119999. this._config = config;
  120000. this._isLive = config.isLive === true ? true : false;
  120001. this._dtsBase = -1;
  120002. this._dtsBaseInited = false;
  120003. this._audioDtsBase = Infinity;
  120004. this._videoDtsBase = Infinity;
  120005. this._audioNextDts = void 0;
  120006. this._videoNextDts = void 0;
  120007. this._audioStashedLastSample = null;
  120008. this._videoStashedLastSample = null;
  120009. this._audioMeta = null;
  120010. this._videoMeta = null;
  120011. this._audioSegmentInfoList = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.MediaSegmentInfoList("audio");
  120012. this._videoSegmentInfoList = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.MediaSegmentInfoList("video");
  120013. this._onInitSegment = null;
  120014. this._onMediaSegment = null;
  120015. this._forceFirstIDR = _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.chrome && (_utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.version.major < 50 || _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.version.major === 50 && _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.version.build < 2661) ? true : false;
  120016. this._fillSilentAfterSeek = _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.msedge || _utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.msie;
  120017. this._mp3UseMpegAudio = !_utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.firefox;
  120018. this._fillAudioTimestampGap = this._config.fixAudioTimestampGap;
  120019. }
  120020. MP4Remuxer2.prototype.destroy = function() {
  120021. this._dtsBase = -1;
  120022. this._dtsBaseInited = false;
  120023. this._audioMeta = null;
  120024. this._videoMeta = null;
  120025. this._audioSegmentInfoList.clear();
  120026. this._audioSegmentInfoList = null;
  120027. this._videoSegmentInfoList.clear();
  120028. this._videoSegmentInfoList = null;
  120029. this._onInitSegment = null;
  120030. this._onMediaSegment = null;
  120031. };
  120032. MP4Remuxer2.prototype.bindDataSource = function(producer) {
  120033. producer.onDataAvailable = this.remux.bind(this);
  120034. producer.onTrackMetadata = this._onTrackMetadataReceived.bind(this);
  120035. return this;
  120036. };
  120037. Object.defineProperty(MP4Remuxer2.prototype, "onInitSegment", {
  120038. get: function() {
  120039. return this._onInitSegment;
  120040. },
  120041. set: function(callback2) {
  120042. this._onInitSegment = callback2;
  120043. },
  120044. enumerable: false,
  120045. configurable: true
  120046. });
  120047. Object.defineProperty(MP4Remuxer2.prototype, "onMediaSegment", {
  120048. get: function() {
  120049. return this._onMediaSegment;
  120050. },
  120051. set: function(callback2) {
  120052. this._onMediaSegment = callback2;
  120053. },
  120054. enumerable: false,
  120055. configurable: true
  120056. });
  120057. MP4Remuxer2.prototype.insertDiscontinuity = function() {
  120058. this._audioNextDts = this._videoNextDts = void 0;
  120059. };
  120060. MP4Remuxer2.prototype.seek = function(originalDts) {
  120061. this._audioStashedLastSample = null;
  120062. this._videoStashedLastSample = null;
  120063. this._videoSegmentInfoList.clear();
  120064. this._audioSegmentInfoList.clear();
  120065. };
  120066. MP4Remuxer2.prototype.remux = function(audioTrack, videoTrack) {
  120067. if (!this._onMediaSegment) {
  120068. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__.IllegalStateException("MP4Remuxer: onMediaSegment callback must be specificed!");
  120069. }
  120070. if (!this._dtsBaseInited) {
  120071. this._calculateDtsBase(audioTrack, videoTrack);
  120072. }
  120073. this._remuxVideo(videoTrack);
  120074. this._remuxAudio(audioTrack);
  120075. };
  120076. MP4Remuxer2.prototype._onTrackMetadataReceived = function(type2, metadata) {
  120077. var metabox = null;
  120078. var container = "mp4";
  120079. var codec = metadata.codec;
  120080. if (type2 === "audio") {
  120081. this._audioMeta = metadata;
  120082. if (metadata.codec === "mp3" && this._mp3UseMpegAudio) {
  120083. container = "mpeg";
  120084. codec = "";
  120085. metabox = new Uint8Array();
  120086. } else {
  120087. metabox = _mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.generateInitSegment(metadata);
  120088. }
  120089. } else if (type2 === "video") {
  120090. this._videoMeta = metadata;
  120091. metabox = _mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.generateInitSegment(metadata);
  120092. } else {
  120093. return;
  120094. }
  120095. if (!this._onInitSegment) {
  120096. throw new _utils_exception_js__WEBPACK_IMPORTED_MODULE_5__.IllegalStateException("MP4Remuxer: onInitSegment callback must be specified!");
  120097. }
  120098. this._onInitSegment(type2, {
  120099. type: type2,
  120100. data: metabox.buffer,
  120101. codec,
  120102. container: type2 + "/" + container,
  120103. mediaDuration: metadata.duration
  120104. });
  120105. };
  120106. MP4Remuxer2.prototype._calculateDtsBase = function(audioTrack, videoTrack) {
  120107. if (this._dtsBaseInited) {
  120108. return;
  120109. }
  120110. if (audioTrack.samples && audioTrack.samples.length) {
  120111. this._audioDtsBase = audioTrack.samples[0].dts;
  120112. }
  120113. if (videoTrack.samples && videoTrack.samples.length) {
  120114. this._videoDtsBase = videoTrack.samples[0].dts;
  120115. }
  120116. this._dtsBase = Math.min(this._audioDtsBase, this._videoDtsBase);
  120117. this._dtsBaseInited = true;
  120118. };
  120119. MP4Remuxer2.prototype.flushStashedSamples = function() {
  120120. var videoSample = this._videoStashedLastSample;
  120121. var audioSample = this._audioStashedLastSample;
  120122. var videoTrack = {
  120123. type: "video",
  120124. id: 1,
  120125. sequenceNumber: 0,
  120126. samples: [],
  120127. length: 0
  120128. };
  120129. if (videoSample != null) {
  120130. videoTrack.samples.push(videoSample);
  120131. videoTrack.length = videoSample.length;
  120132. }
  120133. var audioTrack = {
  120134. type: "audio",
  120135. id: 2,
  120136. sequenceNumber: 0,
  120137. samples: [],
  120138. length: 0
  120139. };
  120140. if (audioSample != null) {
  120141. audioTrack.samples.push(audioSample);
  120142. audioTrack.length = audioSample.length;
  120143. }
  120144. this._videoStashedLastSample = null;
  120145. this._audioStashedLastSample = null;
  120146. this._remuxVideo(videoTrack, true);
  120147. this._remuxAudio(audioTrack, true);
  120148. };
  120149. MP4Remuxer2.prototype._remuxAudio = function(audioTrack, force) {
  120150. if (this._audioMeta == null) {
  120151. return;
  120152. }
  120153. var track = audioTrack;
  120154. var samples = track.samples;
  120155. var dtsCorrection = void 0;
  120156. var firstDts = -1, lastDts = -1;
  120157. var refSampleDuration = this._audioMeta.refSampleDuration;
  120158. var mpegRawTrack = this._audioMeta.codec === "mp3" && this._mp3UseMpegAudio;
  120159. var firstSegmentAfterSeek = this._dtsBaseInited && this._audioNextDts === void 0;
  120160. var insertPrefixSilentFrame = false;
  120161. if (!samples || samples.length === 0) {
  120162. return;
  120163. }
  120164. if (samples.length === 1 && !force) {
  120165. return;
  120166. }
  120167. var offset = 0;
  120168. var mdatbox = null;
  120169. var mdatBytes = 0;
  120170. if (mpegRawTrack) {
  120171. offset = 0;
  120172. mdatBytes = track.length;
  120173. } else {
  120174. offset = 8;
  120175. mdatBytes = 8 + track.length;
  120176. }
  120177. var lastSample = null;
  120178. if (samples.length > 1) {
  120179. lastSample = samples.pop();
  120180. mdatBytes -= lastSample.length;
  120181. }
  120182. if (this._audioStashedLastSample != null) {
  120183. var sample = this._audioStashedLastSample;
  120184. this._audioStashedLastSample = null;
  120185. samples.unshift(sample);
  120186. mdatBytes += sample.length;
  120187. }
  120188. if (lastSample != null) {
  120189. this._audioStashedLastSample = lastSample;
  120190. }
  120191. var firstSampleOriginalDts = samples[0].dts - this._dtsBase;
  120192. if (this._audioNextDts) {
  120193. dtsCorrection = firstSampleOriginalDts - this._audioNextDts;
  120194. } else {
  120195. if (this._audioSegmentInfoList.isEmpty()) {
  120196. dtsCorrection = 0;
  120197. if (this._fillSilentAfterSeek && !this._videoSegmentInfoList.isEmpty()) {
  120198. if (this._audioMeta.originalCodec !== "mp3") {
  120199. insertPrefixSilentFrame = true;
  120200. }
  120201. }
  120202. } else {
  120203. var lastSample_1 = this._audioSegmentInfoList.getLastSampleBefore(firstSampleOriginalDts);
  120204. if (lastSample_1 != null) {
  120205. var distance2 = firstSampleOriginalDts - (lastSample_1.originalDts + lastSample_1.duration);
  120206. if (distance2 <= 3) {
  120207. distance2 = 0;
  120208. }
  120209. var expectedDts = lastSample_1.dts + lastSample_1.duration + distance2;
  120210. dtsCorrection = firstSampleOriginalDts - expectedDts;
  120211. } else {
  120212. dtsCorrection = 0;
  120213. }
  120214. }
  120215. }
  120216. if (insertPrefixSilentFrame) {
  120217. var firstSampleDts = firstSampleOriginalDts - dtsCorrection;
  120218. var videoSegment = this._videoSegmentInfoList.getLastSegmentBefore(firstSampleOriginalDts);
  120219. if (videoSegment != null && videoSegment.beginDts < firstSampleDts) {
  120220. var silentUnit = _aac_silent_js__WEBPACK_IMPORTED_MODULE_2__.default.getSilentFrame(this._audioMeta.originalCodec, this._audioMeta.channelCount);
  120221. if (silentUnit) {
  120222. var dts = videoSegment.beginDts;
  120223. var silentFrameDuration = firstSampleDts - videoSegment.beginDts;
  120224. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.v(this.TAG, "InsertPrefixSilentAudio: dts: " + dts + ", duration: " + silentFrameDuration);
  120225. samples.unshift({ unit: silentUnit, dts, pts: dts });
  120226. mdatBytes += silentUnit.byteLength;
  120227. }
  120228. } else {
  120229. insertPrefixSilentFrame = false;
  120230. }
  120231. }
  120232. var mp4Samples = [];
  120233. for (var i2 = 0; i2 < samples.length; i2++) {
  120234. var sample = samples[i2];
  120235. var unit = sample.unit;
  120236. var originalDts = sample.dts - this._dtsBase;
  120237. var dts = originalDts;
  120238. var needFillSilentFrames = false;
  120239. var silentFrames = null;
  120240. var sampleDuration = 0;
  120241. if (originalDts < -1e-3) {
  120242. continue;
  120243. }
  120244. if (this._audioMeta.codec !== "mp3") {
  120245. var curRefDts = originalDts;
  120246. var maxAudioFramesDrift = 3;
  120247. if (this._audioNextDts) {
  120248. curRefDts = this._audioNextDts;
  120249. }
  120250. dtsCorrection = originalDts - curRefDts;
  120251. if (dtsCorrection <= -maxAudioFramesDrift * refSampleDuration) {
  120252. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Dropping 1 audio frame (originalDts: " + originalDts + " ms ,curRefDts: " + curRefDts + " ms) due to dtsCorrection: " + dtsCorrection + " ms overlap.");
  120253. continue;
  120254. } else if (dtsCorrection >= maxAudioFramesDrift * refSampleDuration && this._fillAudioTimestampGap && !_utils_browser_js__WEBPACK_IMPORTED_MODULE_3__.default.safari) {
  120255. needFillSilentFrames = true;
  120256. var frameCount = Math.floor(dtsCorrection / refSampleDuration);
  120257. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\n" + ("originalDts: " + originalDts + " ms, curRefDts: " + curRefDts + " ms, ") + ("dtsCorrection: " + Math.round(dtsCorrection) + " ms, generate: " + frameCount + " frames"));
  120258. dts = Math.floor(curRefDts);
  120259. sampleDuration = Math.floor(curRefDts + refSampleDuration) - dts;
  120260. var silentUnit = _aac_silent_js__WEBPACK_IMPORTED_MODULE_2__.default.getSilentFrame(this._audioMeta.originalCodec, this._audioMeta.channelCount);
  120261. if (silentUnit == null) {
  120262. _utils_logger_js__WEBPACK_IMPORTED_MODULE_0__.default.w(this.TAG, "Unable to generate silent frame for " + (this._audioMeta.originalCodec + " with " + this._audioMeta.channelCount + " channels, repeat last frame"));
  120263. silentUnit = unit;
  120264. }
  120265. silentFrames = [];
  120266. for (var j = 0; j < frameCount; j++) {
  120267. curRefDts = curRefDts + refSampleDuration;
  120268. var intDts = Math.floor(curRefDts);
  120269. var intDuration = Math.floor(curRefDts + refSampleDuration) - intDts;
  120270. var frame = {
  120271. dts: intDts,
  120272. pts: intDts,
  120273. cts: 0,
  120274. unit: silentUnit,
  120275. size: silentUnit.byteLength,
  120276. duration: intDuration,
  120277. originalDts,
  120278. flags: {
  120279. isLeading: 0,
  120280. dependsOn: 1,
  120281. isDependedOn: 0,
  120282. hasRedundancy: 0
  120283. }
  120284. };
  120285. silentFrames.push(frame);
  120286. mdatBytes += frame.size;
  120287. }
  120288. this._audioNextDts = curRefDts + refSampleDuration;
  120289. } else {
  120290. dts = Math.floor(curRefDts);
  120291. sampleDuration = Math.floor(curRefDts + refSampleDuration) - dts;
  120292. this._audioNextDts = curRefDts + refSampleDuration;
  120293. }
  120294. } else {
  120295. dts = originalDts - dtsCorrection;
  120296. if (i2 !== samples.length - 1) {
  120297. var nextDts = samples[i2 + 1].dts - this._dtsBase - dtsCorrection;
  120298. sampleDuration = nextDts - dts;
  120299. } else {
  120300. if (lastSample != null) {
  120301. var nextDts = lastSample.dts - this._dtsBase - dtsCorrection;
  120302. sampleDuration = nextDts - dts;
  120303. } else if (mp4Samples.length >= 1) {
  120304. sampleDuration = mp4Samples[mp4Samples.length - 1].duration;
  120305. } else {
  120306. sampleDuration = Math.floor(refSampleDuration);
  120307. }
  120308. }
  120309. this._audioNextDts = dts + sampleDuration;
  120310. }
  120311. if (firstDts === -1) {
  120312. firstDts = dts;
  120313. }
  120314. mp4Samples.push({
  120315. dts,
  120316. pts: dts,
  120317. cts: 0,
  120318. unit: sample.unit,
  120319. size: sample.unit.byteLength,
  120320. duration: sampleDuration,
  120321. originalDts,
  120322. flags: {
  120323. isLeading: 0,
  120324. dependsOn: 1,
  120325. isDependedOn: 0,
  120326. hasRedundancy: 0
  120327. }
  120328. });
  120329. if (needFillSilentFrames) {
  120330. mp4Samples.push.apply(mp4Samples, silentFrames);
  120331. }
  120332. }
  120333. if (mp4Samples.length === 0) {
  120334. track.samples = [];
  120335. track.length = 0;
  120336. return;
  120337. }
  120338. if (mpegRawTrack) {
  120339. mdatbox = new Uint8Array(mdatBytes);
  120340. } else {
  120341. mdatbox = new Uint8Array(mdatBytes);
  120342. mdatbox[0] = mdatBytes >>> 24 & 255;
  120343. mdatbox[1] = mdatBytes >>> 16 & 255;
  120344. mdatbox[2] = mdatBytes >>> 8 & 255;
  120345. mdatbox[3] = mdatBytes & 255;
  120346. mdatbox.set(_mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.types.mdat, 4);
  120347. }
  120348. for (var i2 = 0; i2 < mp4Samples.length; i2++) {
  120349. var unit = mp4Samples[i2].unit;
  120350. mdatbox.set(unit, offset);
  120351. offset += unit.byteLength;
  120352. }
  120353. var latest = mp4Samples[mp4Samples.length - 1];
  120354. lastDts = latest.dts + latest.duration;
  120355. var info = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.MediaSegmentInfo();
  120356. info.beginDts = firstDts;
  120357. info.endDts = lastDts;
  120358. info.beginPts = firstDts;
  120359. info.endPts = lastDts;
  120360. info.originalBeginDts = mp4Samples[0].originalDts;
  120361. info.originalEndDts = latest.originalDts + latest.duration;
  120362. info.firstSample = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.SampleInfo(mp4Samples[0].dts, mp4Samples[0].pts, mp4Samples[0].duration, mp4Samples[0].originalDts, false);
  120363. info.lastSample = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.SampleInfo(latest.dts, latest.pts, latest.duration, latest.originalDts, false);
  120364. if (!this._isLive) {
  120365. this._audioSegmentInfoList.append(info);
  120366. }
  120367. track.samples = mp4Samples;
  120368. track.sequenceNumber++;
  120369. var moofbox = null;
  120370. if (mpegRawTrack) {
  120371. moofbox = new Uint8Array();
  120372. } else {
  120373. moofbox = _mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.moof(track, firstDts);
  120374. }
  120375. track.samples = [];
  120376. track.length = 0;
  120377. var segment = {
  120378. type: "audio",
  120379. data: this._mergeBoxes(moofbox, mdatbox).buffer,
  120380. sampleCount: mp4Samples.length,
  120381. info
  120382. };
  120383. if (mpegRawTrack && firstSegmentAfterSeek) {
  120384. segment.timestampOffset = firstDts;
  120385. }
  120386. this._onMediaSegment("audio", segment);
  120387. };
  120388. MP4Remuxer2.prototype._remuxVideo = function(videoTrack, force) {
  120389. if (this._videoMeta == null) {
  120390. return;
  120391. }
  120392. var track = videoTrack;
  120393. var samples = track.samples;
  120394. var dtsCorrection = void 0;
  120395. var firstDts = -1, lastDts = -1;
  120396. var firstPts = -1, lastPts = -1;
  120397. if (!samples || samples.length === 0) {
  120398. return;
  120399. }
  120400. if (samples.length === 1 && !force) {
  120401. return;
  120402. }
  120403. var offset = 8;
  120404. var mdatbox = null;
  120405. var mdatBytes = 8 + videoTrack.length;
  120406. var lastSample = null;
  120407. if (samples.length > 1) {
  120408. lastSample = samples.pop();
  120409. mdatBytes -= lastSample.length;
  120410. }
  120411. if (this._videoStashedLastSample != null) {
  120412. var sample = this._videoStashedLastSample;
  120413. this._videoStashedLastSample = null;
  120414. samples.unshift(sample);
  120415. mdatBytes += sample.length;
  120416. }
  120417. if (lastSample != null) {
  120418. this._videoStashedLastSample = lastSample;
  120419. }
  120420. var firstSampleOriginalDts = samples[0].dts - this._dtsBase;
  120421. if (this._videoNextDts) {
  120422. dtsCorrection = firstSampleOriginalDts - this._videoNextDts;
  120423. } else {
  120424. if (this._videoSegmentInfoList.isEmpty()) {
  120425. dtsCorrection = 0;
  120426. } else {
  120427. var lastSample_2 = this._videoSegmentInfoList.getLastSampleBefore(firstSampleOriginalDts);
  120428. if (lastSample_2 != null) {
  120429. var distance2 = firstSampleOriginalDts - (lastSample_2.originalDts + lastSample_2.duration);
  120430. if (distance2 <= 3) {
  120431. distance2 = 0;
  120432. }
  120433. var expectedDts = lastSample_2.dts + lastSample_2.duration + distance2;
  120434. dtsCorrection = firstSampleOriginalDts - expectedDts;
  120435. } else {
  120436. dtsCorrection = 0;
  120437. }
  120438. }
  120439. }
  120440. var info = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.MediaSegmentInfo();
  120441. var mp4Samples = [];
  120442. for (var i2 = 0; i2 < samples.length; i2++) {
  120443. var sample = samples[i2];
  120444. var originalDts = sample.dts - this._dtsBase;
  120445. var isKeyframe = sample.isKeyframe;
  120446. var dts = originalDts - dtsCorrection;
  120447. var cts = sample.cts;
  120448. var pts = dts + cts;
  120449. if (firstDts === -1) {
  120450. firstDts = dts;
  120451. firstPts = pts;
  120452. }
  120453. var sampleDuration = 0;
  120454. if (i2 !== samples.length - 1) {
  120455. var nextDts = samples[i2 + 1].dts - this._dtsBase - dtsCorrection;
  120456. sampleDuration = nextDts - dts;
  120457. } else {
  120458. if (lastSample != null) {
  120459. var nextDts = lastSample.dts - this._dtsBase - dtsCorrection;
  120460. sampleDuration = nextDts - dts;
  120461. } else if (mp4Samples.length >= 1) {
  120462. sampleDuration = mp4Samples[mp4Samples.length - 1].duration;
  120463. } else {
  120464. sampleDuration = Math.floor(this._videoMeta.refSampleDuration);
  120465. }
  120466. }
  120467. if (isKeyframe) {
  120468. var syncPoint = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.SampleInfo(dts, pts, sampleDuration, sample.dts, true);
  120469. syncPoint.fileposition = sample.fileposition;
  120470. info.appendSyncPoint(syncPoint);
  120471. }
  120472. mp4Samples.push({
  120473. dts,
  120474. pts,
  120475. cts,
  120476. units: sample.units,
  120477. size: sample.length,
  120478. isKeyframe,
  120479. duration: sampleDuration,
  120480. originalDts,
  120481. flags: {
  120482. isLeading: 0,
  120483. dependsOn: isKeyframe ? 2 : 1,
  120484. isDependedOn: isKeyframe ? 1 : 0,
  120485. hasRedundancy: 0,
  120486. isNonSync: isKeyframe ? 0 : 1
  120487. }
  120488. });
  120489. }
  120490. mdatbox = new Uint8Array(mdatBytes);
  120491. mdatbox[0] = mdatBytes >>> 24 & 255;
  120492. mdatbox[1] = mdatBytes >>> 16 & 255;
  120493. mdatbox[2] = mdatBytes >>> 8 & 255;
  120494. mdatbox[3] = mdatBytes & 255;
  120495. mdatbox.set(_mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.types.mdat, 4);
  120496. for (var i2 = 0; i2 < mp4Samples.length; i2++) {
  120497. var units = mp4Samples[i2].units;
  120498. while (units.length) {
  120499. var unit = units.shift();
  120500. var data = unit.data;
  120501. mdatbox.set(data, offset);
  120502. offset += data.byteLength;
  120503. }
  120504. }
  120505. var latest = mp4Samples[mp4Samples.length - 1];
  120506. lastDts = latest.dts + latest.duration;
  120507. lastPts = latest.pts + latest.duration;
  120508. this._videoNextDts = lastDts;
  120509. info.beginDts = firstDts;
  120510. info.endDts = lastDts;
  120511. info.beginPts = firstPts;
  120512. info.endPts = lastPts;
  120513. info.originalBeginDts = mp4Samples[0].originalDts;
  120514. info.originalEndDts = latest.originalDts + latest.duration;
  120515. info.firstSample = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.SampleInfo(mp4Samples[0].dts, mp4Samples[0].pts, mp4Samples[0].duration, mp4Samples[0].originalDts, mp4Samples[0].isKeyframe);
  120516. info.lastSample = new _core_media_segment_info_js__WEBPACK_IMPORTED_MODULE_4__.SampleInfo(latest.dts, latest.pts, latest.duration, latest.originalDts, latest.isKeyframe);
  120517. if (!this._isLive) {
  120518. this._videoSegmentInfoList.append(info);
  120519. }
  120520. track.samples = mp4Samples;
  120521. track.sequenceNumber++;
  120522. if (this._forceFirstIDR) {
  120523. var flags = mp4Samples[0].flags;
  120524. flags.dependsOn = 2;
  120525. flags.isNonSync = 0;
  120526. }
  120527. var moofbox = _mp4_generator_js__WEBPACK_IMPORTED_MODULE_1__.default.moof(track, firstDts);
  120528. track.samples = [];
  120529. track.length = 0;
  120530. this._onMediaSegment("video", {
  120531. type: "video",
  120532. data: this._mergeBoxes(moofbox, mdatbox).buffer,
  120533. sampleCount: mp4Samples.length,
  120534. info
  120535. });
  120536. };
  120537. MP4Remuxer2.prototype._mergeBoxes = function(moof, mdat) {
  120538. var result = new Uint8Array(moof.byteLength + mdat.byteLength);
  120539. result.set(moof, 0);
  120540. result.set(mdat, moof.byteLength);
  120541. return result;
  120542. };
  120543. return MP4Remuxer2;
  120544. }();
  120545. __webpack_exports__2["default"] = MP4Remuxer;
  120546. },
  120547. "./src/utils/browser.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  120548. __webpack_require__2.r(__webpack_exports__2);
  120549. var Browser = {};
  120550. function detect() {
  120551. var ua = self.navigator.userAgent.toLowerCase();
  120552. var match = /(edge)\/([\w.]+)/.exec(ua) || /(opr)[\/]([\w.]+)/.exec(ua) || /(chrome)[ \/]([\w.]+)/.exec(ua) || /(iemobile)[\/]([\w.]+)/.exec(ua) || /(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ua) || /(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(ua) || /(webkit)[ \/]([\w.]+)/.exec(ua) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || /(msie) ([\w.]+)/.exec(ua) || ua.indexOf("trident") >= 0 && /(rv)(?::| )([\w.]+)/.exec(ua) || ua.indexOf("compatible") < 0 && /(firefox)[ \/]([\w.]+)/.exec(ua) || [];
  120553. var platform_match = /(ipad)/.exec(ua) || /(ipod)/.exec(ua) || /(windows phone)/.exec(ua) || /(iphone)/.exec(ua) || /(kindle)/.exec(ua) || /(android)/.exec(ua) || /(windows)/.exec(ua) || /(mac)/.exec(ua) || /(linux)/.exec(ua) || /(cros)/.exec(ua) || [];
  120554. var matched = {
  120555. browser: match[5] || match[3] || match[1] || "",
  120556. version: match[2] || match[4] || "0",
  120557. majorVersion: match[4] || match[2] || "0",
  120558. platform: platform_match[0] || ""
  120559. };
  120560. var browser2 = {};
  120561. if (matched.browser) {
  120562. browser2[matched.browser] = true;
  120563. var versionArray = matched.majorVersion.split(".");
  120564. browser2.version = {
  120565. major: parseInt(matched.majorVersion, 10),
  120566. string: matched.version
  120567. };
  120568. if (versionArray.length > 1) {
  120569. browser2.version.minor = parseInt(versionArray[1], 10);
  120570. }
  120571. if (versionArray.length > 2) {
  120572. browser2.version.build = parseInt(versionArray[2], 10);
  120573. }
  120574. }
  120575. if (matched.platform) {
  120576. browser2[matched.platform] = true;
  120577. }
  120578. if (browser2.chrome || browser2.opr || browser2.safari) {
  120579. browser2.webkit = true;
  120580. }
  120581. if (browser2.rv || browser2.iemobile) {
  120582. if (browser2.rv) {
  120583. delete browser2.rv;
  120584. }
  120585. var msie = "msie";
  120586. matched.browser = msie;
  120587. browser2[msie] = true;
  120588. }
  120589. if (browser2.edge) {
  120590. delete browser2.edge;
  120591. var msedge = "msedge";
  120592. matched.browser = msedge;
  120593. browser2[msedge] = true;
  120594. }
  120595. if (browser2.opr) {
  120596. var opera = "opera";
  120597. matched.browser = opera;
  120598. browser2[opera] = true;
  120599. }
  120600. if (browser2.safari && browser2.android) {
  120601. var android = "android";
  120602. matched.browser = android;
  120603. browser2[android] = true;
  120604. }
  120605. browser2.name = matched.browser;
  120606. browser2.platform = matched.platform;
  120607. for (var key in Browser) {
  120608. if (Browser.hasOwnProperty(key)) {
  120609. delete Browser[key];
  120610. }
  120611. }
  120612. Object.assign(Browser, browser2);
  120613. }
  120614. detect();
  120615. __webpack_exports__2["default"] = Browser;
  120616. },
  120617. "./src/utils/exception.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  120618. __webpack_require__2.r(__webpack_exports__2);
  120619. __webpack_require__2.d(__webpack_exports__2, {
  120620. "RuntimeException": function() {
  120621. return RuntimeException;
  120622. },
  120623. "IllegalStateException": function() {
  120624. return IllegalStateException;
  120625. },
  120626. "InvalidArgumentException": function() {
  120627. return InvalidArgumentException;
  120628. },
  120629. "NotImplementedException": function() {
  120630. return NotImplementedException;
  120631. }
  120632. });
  120633. var __extends = function() {
  120634. var extendStatics = function(d2, b) {
  120635. extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b2) {
  120636. d3.__proto__ = b2;
  120637. } || function(d3, b2) {
  120638. for (var p in b2)
  120639. if (Object.prototype.hasOwnProperty.call(b2, p))
  120640. d3[p] = b2[p];
  120641. };
  120642. return extendStatics(d2, b);
  120643. };
  120644. return function(d2, b) {
  120645. if (typeof b !== "function" && b !== null)
  120646. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  120647. extendStatics(d2, b);
  120648. function __() {
  120649. this.constructor = d2;
  120650. }
  120651. d2.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  120652. };
  120653. }();
  120654. var RuntimeException = function() {
  120655. function RuntimeException2(message) {
  120656. this._message = message;
  120657. }
  120658. Object.defineProperty(RuntimeException2.prototype, "name", {
  120659. get: function() {
  120660. return "RuntimeException";
  120661. },
  120662. enumerable: false,
  120663. configurable: true
  120664. });
  120665. Object.defineProperty(RuntimeException2.prototype, "message", {
  120666. get: function() {
  120667. return this._message;
  120668. },
  120669. enumerable: false,
  120670. configurable: true
  120671. });
  120672. RuntimeException2.prototype.toString = function() {
  120673. return this.name + ": " + this.message;
  120674. };
  120675. return RuntimeException2;
  120676. }();
  120677. var IllegalStateException = function(_super) {
  120678. __extends(IllegalStateException2, _super);
  120679. function IllegalStateException2(message) {
  120680. return _super.call(this, message) || this;
  120681. }
  120682. Object.defineProperty(IllegalStateException2.prototype, "name", {
  120683. get: function() {
  120684. return "IllegalStateException";
  120685. },
  120686. enumerable: false,
  120687. configurable: true
  120688. });
  120689. return IllegalStateException2;
  120690. }(RuntimeException);
  120691. var InvalidArgumentException = function(_super) {
  120692. __extends(InvalidArgumentException2, _super);
  120693. function InvalidArgumentException2(message) {
  120694. return _super.call(this, message) || this;
  120695. }
  120696. Object.defineProperty(InvalidArgumentException2.prototype, "name", {
  120697. get: function() {
  120698. return "InvalidArgumentException";
  120699. },
  120700. enumerable: false,
  120701. configurable: true
  120702. });
  120703. return InvalidArgumentException2;
  120704. }(RuntimeException);
  120705. var NotImplementedException = function(_super) {
  120706. __extends(NotImplementedException2, _super);
  120707. function NotImplementedException2(message) {
  120708. return _super.call(this, message) || this;
  120709. }
  120710. Object.defineProperty(NotImplementedException2.prototype, "name", {
  120711. get: function() {
  120712. return "NotImplementedException";
  120713. },
  120714. enumerable: false,
  120715. configurable: true
  120716. });
  120717. return NotImplementedException2;
  120718. }(RuntimeException);
  120719. },
  120720. "./src/utils/logger.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  120721. __webpack_require__2.r(__webpack_exports__2);
  120722. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  120723. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  120724. var Log = function() {
  120725. function Log2() {
  120726. }
  120727. Log2.e = function(tag, msg) {
  120728. if (!tag || Log2.FORCE_GLOBAL_TAG)
  120729. tag = Log2.GLOBAL_TAG;
  120730. var str = "[" + tag + "] > " + msg;
  120731. if (Log2.ENABLE_CALLBACK) {
  120732. Log2.emitter.emit("log", "error", str);
  120733. }
  120734. if (!Log2.ENABLE_ERROR) {
  120735. return;
  120736. }
  120737. if (console.error) {
  120738. console.error(str);
  120739. } else if (console.warn) {
  120740. console.warn(str);
  120741. } else {
  120742. console.log(str);
  120743. }
  120744. };
  120745. Log2.i = function(tag, msg) {
  120746. if (!tag || Log2.FORCE_GLOBAL_TAG)
  120747. tag = Log2.GLOBAL_TAG;
  120748. var str = "[" + tag + "] > " + msg;
  120749. if (Log2.ENABLE_CALLBACK) {
  120750. Log2.emitter.emit("log", "info", str);
  120751. }
  120752. if (!Log2.ENABLE_INFO) {
  120753. return;
  120754. }
  120755. if (console.info) {
  120756. console.info(str);
  120757. } else {
  120758. console.log(str);
  120759. }
  120760. };
  120761. Log2.w = function(tag, msg) {
  120762. if (!tag || Log2.FORCE_GLOBAL_TAG)
  120763. tag = Log2.GLOBAL_TAG;
  120764. var str = "[" + tag + "] > " + msg;
  120765. if (Log2.ENABLE_CALLBACK) {
  120766. Log2.emitter.emit("log", "warn", str);
  120767. }
  120768. if (!Log2.ENABLE_WARN) {
  120769. return;
  120770. }
  120771. if (console.warn) {
  120772. console.warn(str);
  120773. } else {
  120774. console.log(str);
  120775. }
  120776. };
  120777. Log2.d = function(tag, msg) {
  120778. if (!tag || Log2.FORCE_GLOBAL_TAG)
  120779. tag = Log2.GLOBAL_TAG;
  120780. var str = "[" + tag + "] > " + msg;
  120781. if (Log2.ENABLE_CALLBACK) {
  120782. Log2.emitter.emit("log", "debug", str);
  120783. }
  120784. if (!Log2.ENABLE_DEBUG) {
  120785. return;
  120786. }
  120787. if (console.debug) {
  120788. console.debug(str);
  120789. } else {
  120790. console.log(str);
  120791. }
  120792. };
  120793. Log2.v = function(tag, msg) {
  120794. if (!tag || Log2.FORCE_GLOBAL_TAG)
  120795. tag = Log2.GLOBAL_TAG;
  120796. var str = "[" + tag + "] > " + msg;
  120797. if (Log2.ENABLE_CALLBACK) {
  120798. Log2.emitter.emit("log", "verbose", str);
  120799. }
  120800. if (!Log2.ENABLE_VERBOSE) {
  120801. return;
  120802. }
  120803. console.log(str);
  120804. };
  120805. return Log2;
  120806. }();
  120807. Log.GLOBAL_TAG = "flv.js";
  120808. Log.FORCE_GLOBAL_TAG = false;
  120809. Log.ENABLE_ERROR = true;
  120810. Log.ENABLE_INFO = true;
  120811. Log.ENABLE_WARN = true;
  120812. Log.ENABLE_DEBUG = true;
  120813. Log.ENABLE_VERBOSE = true;
  120814. Log.ENABLE_CALLBACK = false;
  120815. Log.emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  120816. __webpack_exports__2["default"] = Log;
  120817. },
  120818. "./src/utils/logging-control.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  120819. __webpack_require__2.r(__webpack_exports__2);
  120820. var events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__2("./node_modules/events/events.js");
  120821. var events__WEBPACK_IMPORTED_MODULE_0___default = /* @__PURE__ */ __webpack_require__2.n(events__WEBPACK_IMPORTED_MODULE_0__);
  120822. var _logger_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__2("./src/utils/logger.js");
  120823. var LoggingControl = function() {
  120824. function LoggingControl2() {
  120825. }
  120826. Object.defineProperty(LoggingControl2, "forceGlobalTag", {
  120827. get: function() {
  120828. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.FORCE_GLOBAL_TAG;
  120829. },
  120830. set: function(enable) {
  120831. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.FORCE_GLOBAL_TAG = enable;
  120832. LoggingControl2._notifyChange();
  120833. },
  120834. enumerable: false,
  120835. configurable: true
  120836. });
  120837. Object.defineProperty(LoggingControl2, "globalTag", {
  120838. get: function() {
  120839. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.GLOBAL_TAG;
  120840. },
  120841. set: function(tag) {
  120842. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.GLOBAL_TAG = tag;
  120843. LoggingControl2._notifyChange();
  120844. },
  120845. enumerable: false,
  120846. configurable: true
  120847. });
  120848. Object.defineProperty(LoggingControl2, "enableAll", {
  120849. get: function() {
  120850. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE && _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG && _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO && _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN && _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR;
  120851. },
  120852. set: function(enable) {
  120853. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE = enable;
  120854. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG = enable;
  120855. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO = enable;
  120856. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN = enable;
  120857. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR = enable;
  120858. LoggingControl2._notifyChange();
  120859. },
  120860. enumerable: false,
  120861. configurable: true
  120862. });
  120863. Object.defineProperty(LoggingControl2, "enableDebug", {
  120864. get: function() {
  120865. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG;
  120866. },
  120867. set: function(enable) {
  120868. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG = enable;
  120869. LoggingControl2._notifyChange();
  120870. },
  120871. enumerable: false,
  120872. configurable: true
  120873. });
  120874. Object.defineProperty(LoggingControl2, "enableVerbose", {
  120875. get: function() {
  120876. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE;
  120877. },
  120878. set: function(enable) {
  120879. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE = enable;
  120880. LoggingControl2._notifyChange();
  120881. },
  120882. enumerable: false,
  120883. configurable: true
  120884. });
  120885. Object.defineProperty(LoggingControl2, "enableInfo", {
  120886. get: function() {
  120887. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO;
  120888. },
  120889. set: function(enable) {
  120890. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO = enable;
  120891. LoggingControl2._notifyChange();
  120892. },
  120893. enumerable: false,
  120894. configurable: true
  120895. });
  120896. Object.defineProperty(LoggingControl2, "enableWarn", {
  120897. get: function() {
  120898. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN;
  120899. },
  120900. set: function(enable) {
  120901. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN = enable;
  120902. LoggingControl2._notifyChange();
  120903. },
  120904. enumerable: false,
  120905. configurable: true
  120906. });
  120907. Object.defineProperty(LoggingControl2, "enableError", {
  120908. get: function() {
  120909. return _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR;
  120910. },
  120911. set: function(enable) {
  120912. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR = enable;
  120913. LoggingControl2._notifyChange();
  120914. },
  120915. enumerable: false,
  120916. configurable: true
  120917. });
  120918. LoggingControl2.getConfig = function() {
  120919. return {
  120920. globalTag: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.GLOBAL_TAG,
  120921. forceGlobalTag: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.FORCE_GLOBAL_TAG,
  120922. enableVerbose: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE,
  120923. enableDebug: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG,
  120924. enableInfo: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO,
  120925. enableWarn: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN,
  120926. enableError: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR,
  120927. enableCallback: _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_CALLBACK
  120928. };
  120929. };
  120930. LoggingControl2.applyConfig = function(config) {
  120931. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.GLOBAL_TAG = config.globalTag;
  120932. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.FORCE_GLOBAL_TAG = config.forceGlobalTag;
  120933. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_VERBOSE = config.enableVerbose;
  120934. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_DEBUG = config.enableDebug;
  120935. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_INFO = config.enableInfo;
  120936. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_WARN = config.enableWarn;
  120937. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_ERROR = config.enableError;
  120938. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_CALLBACK = config.enableCallback;
  120939. };
  120940. LoggingControl2._notifyChange = function() {
  120941. var emitter = LoggingControl2.emitter;
  120942. if (emitter.listenerCount("change") > 0) {
  120943. var config = LoggingControl2.getConfig();
  120944. emitter.emit("change", config);
  120945. }
  120946. };
  120947. LoggingControl2.registerListener = function(listener) {
  120948. LoggingControl2.emitter.addListener("change", listener);
  120949. };
  120950. LoggingControl2.removeListener = function(listener) {
  120951. LoggingControl2.emitter.removeListener("change", listener);
  120952. };
  120953. LoggingControl2.addLogListener = function(listener) {
  120954. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.emitter.addListener("log", listener);
  120955. if (_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.emitter.listenerCount("log") > 0) {
  120956. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_CALLBACK = true;
  120957. LoggingControl2._notifyChange();
  120958. }
  120959. };
  120960. LoggingControl2.removeLogListener = function(listener) {
  120961. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.emitter.removeListener("log", listener);
  120962. if (_logger_js__WEBPACK_IMPORTED_MODULE_1__.default.emitter.listenerCount("log") === 0) {
  120963. _logger_js__WEBPACK_IMPORTED_MODULE_1__.default.ENABLE_CALLBACK = false;
  120964. LoggingControl2._notifyChange();
  120965. }
  120966. };
  120967. return LoggingControl2;
  120968. }();
  120969. LoggingControl.emitter = new (events__WEBPACK_IMPORTED_MODULE_0___default())();
  120970. __webpack_exports__2["default"] = LoggingControl;
  120971. },
  120972. "./src/utils/polyfill.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  120973. __webpack_require__2.r(__webpack_exports__2);
  120974. var Polyfill = function() {
  120975. function Polyfill2() {
  120976. }
  120977. Polyfill2.install = function() {
  120978. Object.setPrototypeOf = Object.setPrototypeOf || function(obj, proto) {
  120979. obj.__proto__ = proto;
  120980. return obj;
  120981. };
  120982. Object.assign = Object.assign || function(target) {
  120983. if (target === void 0 || target === null) {
  120984. throw new TypeError("Cannot convert undefined or null to object");
  120985. }
  120986. var output = Object(target);
  120987. for (var i2 = 1; i2 < arguments.length; i2++) {
  120988. var source = arguments[i2];
  120989. if (source !== void 0 && source !== null) {
  120990. for (var key in source) {
  120991. if (source.hasOwnProperty(key)) {
  120992. output[key] = source[key];
  120993. }
  120994. }
  120995. }
  120996. }
  120997. return output;
  120998. };
  120999. if (typeof self.Promise !== "function") {
  121000. __webpack_require__2("./node_modules/es6-promise/dist/es6-promise.js").polyfill();
  121001. }
  121002. };
  121003. return Polyfill2;
  121004. }();
  121005. Polyfill.install();
  121006. __webpack_exports__2["default"] = Polyfill;
  121007. },
  121008. "./src/utils/utf8-conv.js": function(__unused_webpack_module, __webpack_exports__2, __webpack_require__2) {
  121009. __webpack_require__2.r(__webpack_exports__2);
  121010. function checkContinuation(uint8array, start2, checkLength) {
  121011. var array = uint8array;
  121012. if (start2 + checkLength < array.length) {
  121013. while (checkLength--) {
  121014. if ((array[++start2] & 192) !== 128)
  121015. return false;
  121016. }
  121017. return true;
  121018. } else {
  121019. return false;
  121020. }
  121021. }
  121022. function decodeUTF8(uint8array) {
  121023. var out = [];
  121024. var input = uint8array;
  121025. var i2 = 0;
  121026. var length = uint8array.length;
  121027. while (i2 < length) {
  121028. if (input[i2] < 128) {
  121029. out.push(String.fromCharCode(input[i2]));
  121030. ++i2;
  121031. continue;
  121032. } else if (input[i2] < 192)
  121033. ;
  121034. else if (input[i2] < 224) {
  121035. if (checkContinuation(input, i2, 1)) {
  121036. var ucs4 = (input[i2] & 31) << 6 | input[i2 + 1] & 63;
  121037. if (ucs4 >= 128) {
  121038. out.push(String.fromCharCode(ucs4 & 65535));
  121039. i2 += 2;
  121040. continue;
  121041. }
  121042. }
  121043. } else if (input[i2] < 240) {
  121044. if (checkContinuation(input, i2, 2)) {
  121045. var ucs4 = (input[i2] & 15) << 12 | (input[i2 + 1] & 63) << 6 | input[i2 + 2] & 63;
  121046. if (ucs4 >= 2048 && (ucs4 & 63488) !== 55296) {
  121047. out.push(String.fromCharCode(ucs4 & 65535));
  121048. i2 += 3;
  121049. continue;
  121050. }
  121051. }
  121052. } else if (input[i2] < 248) {
  121053. if (checkContinuation(input, i2, 3)) {
  121054. var ucs4 = (input[i2] & 7) << 18 | (input[i2 + 1] & 63) << 12 | (input[i2 + 2] & 63) << 6 | input[i2 + 3] & 63;
  121055. if (ucs4 > 65536 && ucs4 < 1114112) {
  121056. ucs4 -= 65536;
  121057. out.push(String.fromCharCode(ucs4 >>> 10 | 55296));
  121058. out.push(String.fromCharCode(ucs4 & 1023 | 56320));
  121059. i2 += 4;
  121060. continue;
  121061. }
  121062. }
  121063. }
  121064. out.push(String.fromCharCode(65533));
  121065. ++i2;
  121066. }
  121067. return out.join("");
  121068. }
  121069. __webpack_exports__2["default"] = decodeUTF8;
  121070. }
  121071. };
  121072. var __webpack_module_cache__ = {};
  121073. function __webpack_require__(moduleId) {
  121074. var cachedModule = __webpack_module_cache__[moduleId];
  121075. if (cachedModule !== void 0) {
  121076. return cachedModule.exports;
  121077. }
  121078. var module3 = __webpack_module_cache__[moduleId] = {
  121079. exports: {}
  121080. };
  121081. __webpack_modules__[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__);
  121082. return module3.exports;
  121083. }
  121084. __webpack_require__.m = __webpack_modules__;
  121085. !function() {
  121086. __webpack_require__.n = function(module3) {
  121087. var getter = module3 && module3.__esModule ? function() {
  121088. return module3["default"];
  121089. } : function() {
  121090. return module3;
  121091. };
  121092. __webpack_require__.d(getter, { a: getter });
  121093. return getter;
  121094. };
  121095. }();
  121096. !function() {
  121097. __webpack_require__.d = function(exports3, definition) {
  121098. for (var key in definition) {
  121099. if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports3, key)) {
  121100. Object.defineProperty(exports3, key, { enumerable: true, get: definition[key] });
  121101. }
  121102. }
  121103. };
  121104. }();
  121105. !function() {
  121106. __webpack_require__.g = function() {
  121107. if (typeof globalThis === "object")
  121108. return globalThis;
  121109. try {
  121110. return this || new Function("return this")();
  121111. } catch (e) {
  121112. if (typeof window === "object")
  121113. return window;
  121114. }
  121115. }();
  121116. }();
  121117. !function() {
  121118. __webpack_require__.o = function(obj, prop) {
  121119. return Object.prototype.hasOwnProperty.call(obj, prop);
  121120. };
  121121. }();
  121122. !function() {
  121123. __webpack_require__.r = function(exports3) {
  121124. if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
  121125. Object.defineProperty(exports3, Symbol.toStringTag, { value: "Module" });
  121126. }
  121127. Object.defineProperty(exports3, "__esModule", { value: true });
  121128. };
  121129. }();
  121130. var __webpack_exports__ = __webpack_require__("./src/index.js");
  121131. return __webpack_exports__;
  121132. }();
  121133. });
  121134. })(flv);
  121135. var flvjs = /* @__PURE__ */ getDefaultExportFromCjs(flv.exports);
  121136. const Html5 = videojs$2.getTech("Html5");
  121137. const mergeOptions = videojs$2.mergeOptions || videojs$2.util.mergeOptions;
  121138. const defaults = {
  121139. mediaDataSource: {},
  121140. config: {}
  121141. };
  121142. class Flvjs extends Html5 {
  121143. constructor(options2, ready) {
  121144. options2 = mergeOptions(defaults, options2);
  121145. super(options2, ready);
  121146. }
  121147. setSrc(src) {
  121148. if (this.flvPlayer) {
  121149. this.flvPlayer.detachMediaElement();
  121150. this.flvPlayer.destroy();
  121151. }
  121152. const mediaDataSource = this.options_.mediaDataSource;
  121153. const config = this.options_.config;
  121154. mediaDataSource.type = mediaDataSource.type === void 0 ? "flv" : mediaDataSource.type;
  121155. mediaDataSource.url = src;
  121156. this.flvPlayer = flvjs.createPlayer(mediaDataSource, config);
  121157. this.flvPlayer.attachMediaElement(this.el_);
  121158. this.flvPlayer.load();
  121159. }
  121160. dispose() {
  121161. if (this.flvPlayer) {
  121162. this.flvPlayer.detachMediaElement();
  121163. this.flvPlayer.destroy();
  121164. }
  121165. super.dispose();
  121166. }
  121167. }
  121168. Flvjs.isSupported = function() {
  121169. return flvjs && flvjs.isSupported();
  121170. };
  121171. Flvjs.formats = {
  121172. "video/flv": "FLV",
  121173. "video/x-flv": "FLV"
  121174. };
  121175. Flvjs.canPlayType = function(type2) {
  121176. if (Flvjs.isSupported() && type2 in Flvjs.formats) {
  121177. return "maybe";
  121178. }
  121179. return "";
  121180. };
  121181. Flvjs.canPlaySource = function(srcObj, options2) {
  121182. return Flvjs.canPlayType(srcObj.type);
  121183. };
  121184. Flvjs.VERSION = "__VERSION__";
  121185. videojs$2.registerTech("Flvjs", Flvjs);
  121186. var VideoWindow$1 = "";
  121187. class VideoWindow {
  121188. constructor(viewer2, position2, videoInfo, offsetHeight) {
  121189. if (!viewer2)
  121190. throw new Cesium.DeveloperError("no viewer object!");
  121191. if (!position2)
  121192. throw new Cesium.DeveloperError("no position object!");
  121193. this.viewer = viewer2;
  121194. this.position = position2;
  121195. this.offsetHeight = offsetHeight;
  121196. if (position2 instanceof Cesium.Cartesian3) {
  121197. this.position = position2;
  121198. } else {
  121199. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121200. }
  121201. if (document.getElementsByClassName("popup-video").length > 0) {
  121202. document.getElementsByClassName("popup-video")[0].remove();
  121203. viewer2.entities.remove(viewer2.entities.getById("videoPopupPoint"));
  121204. }
  121205. this.id = "popup_video_" + getGuid();
  121206. this.popupDiv = document.createElement("div");
  121207. this.popupDiv.classList.add("popup-video");
  121208. this.popupDiv.id = this.id;
  121209. this.viewer.container.append(this.popupDiv);
  121210. this.popupDiv.innerHTML = this._createHtml(videoInfo);
  121211. switch (videoInfo.type) {
  121212. case "hls":
  121213. this.videotype = "application/x-mpegURL";
  121214. break;
  121215. case "rtmp":
  121216. this.videotype = "rtmp/flv";
  121217. break;
  121218. case "flv":
  121219. this.videotype = "video/x-flv";
  121220. break;
  121221. case "mp4":
  121222. this.videotype = "video/mp4";
  121223. break;
  121224. }
  121225. this.videoPlayer = videojs$2(document.querySelector("#myvideo"), {
  121226. controls: true,
  121227. autoplay: "muted",
  121228. loop: true,
  121229. muted: false,
  121230. fluid: true,
  121231. aspectRatio: "16:9",
  121232. reload: "auto",
  121233. fullscreen: {
  121234. options: {
  121235. navigationUI: "hide"
  121236. }
  121237. },
  121238. sources: [{
  121239. src: videoInfo.url,
  121240. type: this.videotype
  121241. }]
  121242. }, function onPlayerReady() {
  121243. console.log("onPlayerReady", this);
  121244. });
  121245. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121246. this.initPoint();
  121247. document.getElementsByClassName("popup-video1-close-button")[0].onclick = () => {
  121248. this.close();
  121249. };
  121250. }
  121251. postRender() {
  121252. this.viewer.scene.canvas.height;
  121253. const windowPosition = new Cesium.Cartesian2();
  121254. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121255. this.viewer.scene,
  121256. this.position,
  121257. windowPosition
  121258. );
  121259. let elWidth = this.popupDiv.offsetWidth;
  121260. let elHeight = this.popupDiv.offsetHeight;
  121261. if (!!this.offsetHeight) {
  121262. elHeight += this.offsetHeight;
  121263. }
  121264. this.popupDiv.style.left = windowPosition.x - elWidth / 2 + "px";
  121265. this.popupDiv.style.top = windowPosition.y - elHeight + "px";
  121266. const camerPosition = this.viewer.camera.position;
  121267. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121268. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121269. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121270. this.popupDiv.style.display = "block";
  121271. } else {
  121272. this.popupDiv.style.display = "none";
  121273. }
  121274. }
  121275. _createHtml(videoInfo) {
  121276. let html = `
  121277. <div class="popup-video-header">
  121278. ${videoInfo.name}
  121279. <span class="popup-video1-close-button">\xD7</span>
  121280. </div>
  121281. <div class="popup-video-content">
  121282. <video id="myvideo" class="video-js vjs-big-play-centered vjs-fluid" controls preload="auto" width="100%" height="100%"></video>
  121283. </div>
  121284. <div class="popup-video-tip">
  121285. </div>
  121286. `;
  121287. return html;
  121288. }
  121289. initPoint() {
  121290. this.billboard = new Cesium.Entity({
  121291. id: "videoPopupPoint",
  121292. name: "popupPoint",
  121293. position: this.position,
  121294. billboard: {
  121295. image: "jt3dSDK/imgs/point/point.png",
  121296. horizontalOrigin: Cesium.HorizontalOrigin.center,
  121297. verticalOrigin: Cesium.VerticalOrigin.bottom,
  121298. scale: 1,
  121299. pixelOffset: new Cesium.Cartesian2(0, 0),
  121300. disableDepthTestDistance: Number.POSITIVE_INFINITY
  121301. }
  121302. });
  121303. this.viewer.entities.add(this.billboard);
  121304. }
  121305. }
  121306. Object.assign(VideoWindow.prototype, {
  121307. close() {
  121308. this.popupDiv.remove();
  121309. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121310. this.viewer.entities.remove(this.billboard);
  121311. videojs$2("myvideo").dispose();
  121312. this.videoPlayer.dispose();
  121313. }
  121314. });
  121315. var VideoWindow2$1 = "";
  121316. class VideoWindow2 {
  121317. constructor(viewer2, position2, videoInfo) {
  121318. if (!viewer2)
  121319. throw new Cesium.DeveloperError("no viewer object!");
  121320. if (!position2)
  121321. throw new Cesium.DeveloperError("no position object!");
  121322. this.viewer = viewer2;
  121323. this.position = position2;
  121324. if (position2 instanceof Cesium.Cartesian3) {
  121325. this.position = position2;
  121326. } else {
  121327. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121328. }
  121329. if (document.getElementsByClassName("popup-video2").length > 0) {
  121330. document.getElementsByClassName("popup-video2")[0].remove();
  121331. }
  121332. this.id = "popup_video_" + getGuid();
  121333. this.popupDiv = document.createElement("div");
  121334. this.popupDiv.classList.add("popup-video2");
  121335. this.popupDiv.id = this.id;
  121336. this.viewer.container.append(this.popupDiv);
  121337. this.popupDiv.innerHTML = this._createHtml(videoInfo);
  121338. switch (videoInfo.type) {
  121339. case "hls":
  121340. this.videotype = "application/x-mpegURL";
  121341. break;
  121342. case "rtmp":
  121343. this.videotype = "rtmp/flv";
  121344. break;
  121345. case "flv":
  121346. this.videotype = "video/x-flv";
  121347. break;
  121348. case "mp4":
  121349. this.videotype = "video/mp4";
  121350. break;
  121351. }
  121352. this.videoPlayer = videojs$2(document.querySelector("#myvideo"), {
  121353. controls: true,
  121354. autoplay: "muted",
  121355. loop: true,
  121356. muted: false,
  121357. fluid: true,
  121358. aspectRatio: "16:9",
  121359. reload: "auto",
  121360. fullscreen: {
  121361. options: {
  121362. navigationUI: "hide"
  121363. }
  121364. },
  121365. sources: [{
  121366. src: videoInfo.url,
  121367. type: this.videotype
  121368. }]
  121369. }, function onPlayerReady() {
  121370. console.log("onPlayerReady", this);
  121371. });
  121372. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121373. document.getElementsByClassName("popup-video2-close-button")[0].onclick = () => {
  121374. this.close();
  121375. };
  121376. }
  121377. postRender() {
  121378. this.viewer.scene.canvas.height;
  121379. const windowPosition = new Cesium.Cartesian2();
  121380. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121381. this.viewer.scene,
  121382. this.position,
  121383. windowPosition
  121384. );
  121385. this.popupDiv.style.left = windowPosition.x - this.popupDiv.offsetWidth - 120 + "px";
  121386. this.popupDiv.style.top = windowPosition.y + "px";
  121387. const camerPosition = this.viewer.camera.position;
  121388. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121389. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121390. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121391. this.popupDiv.style.display = "block";
  121392. } else {
  121393. this.popupDiv.style.display = "none";
  121394. }
  121395. }
  121396. _createHtml(videoInfo) {
  121397. let html = `
  121398. <div class="rightLine-1"></div>
  121399. <div class="rightLine-2"></div>
  121400. <div class="rightLine-3"></div>
  121401. <div class="popup-header">
  121402. <span class="popup-title" >${videoInfo.name}</span>
  121403. <span class="popup-video2-close-button" title="\u5173\u95ED" >\xD7</span>
  121404. </div>
  121405. <div class="popup-content">
  121406. <video id="myvideo" class="video-js vjs-big-play-centered vjs-fluid" controls preload="auto" width="100%" height="100%"></video>
  121407. </div>
  121408. `;
  121409. return html;
  121410. }
  121411. }
  121412. Object.assign(VideoWindow2.prototype, {
  121413. close() {
  121414. this.popupDiv.remove();
  121415. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121416. }
  121417. });
  121418. var VideoWindow3$1 = "";
  121419. class VideoWindow3 {
  121420. constructor(viewer2, position2, videoInfo) {
  121421. if (!viewer2)
  121422. throw new Cesium.DeveloperError("no viewer object!");
  121423. if (!position2)
  121424. throw new Cesium.DeveloperError("no position object!");
  121425. this.viewer = viewer2;
  121426. this.position = position2;
  121427. if (position2 instanceof Cesium.Cartesian3) {
  121428. this.position = position2;
  121429. } else {
  121430. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121431. }
  121432. if (document.getElementsByClassName("popup-video3").length > 0) {
  121433. document.getElementsByClassName("popup-video3")[0].remove();
  121434. }
  121435. this.id = "popup_video_" + getGuid();
  121436. this.popupDiv = document.createElement("div");
  121437. this.popupDiv.classList.add("popup-video3");
  121438. this.popupDiv.id = this.id;
  121439. this.viewer.container.append(this.popupDiv);
  121440. this.popupDiv.innerHTML = this._createHtml(videoInfo);
  121441. switch (videoInfo.type) {
  121442. case "hls":
  121443. this.videotype = "application/x-mpegURL";
  121444. break;
  121445. case "rtmp":
  121446. this.videotype = "rtmp/flv";
  121447. break;
  121448. case "flv":
  121449. this.videotype = "video/x-flv";
  121450. break;
  121451. case "mp4":
  121452. this.videotype = "video/mp4";
  121453. break;
  121454. }
  121455. this.videoPlayer = videojs$2(document.querySelector("#myvideo"), {
  121456. controls: true,
  121457. autoplay: "muted",
  121458. loop: true,
  121459. muted: false,
  121460. fluid: true,
  121461. aspectRatio: "16:9",
  121462. reload: "auto",
  121463. fullscreen: {
  121464. options: {
  121465. navigationUI: "hide"
  121466. }
  121467. },
  121468. sources: [{
  121469. src: videoInfo.url,
  121470. type: this.videotype
  121471. }]
  121472. }, function onPlayerReady() {
  121473. console.log("onPlayerReady", this);
  121474. });
  121475. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121476. document.getElementsByClassName("popup-video3-close-button")[0].onclick = () => {
  121477. this.close();
  121478. };
  121479. }
  121480. postRender() {
  121481. this.viewer.scene.canvas.height;
  121482. const windowPosition = new Cesium.Cartesian2();
  121483. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121484. this.viewer.scene,
  121485. this.position,
  121486. windowPosition
  121487. );
  121488. this.popupDiv.style.left = windowPosition.x + 70 + "px";
  121489. this.popupDiv.style.top = windowPosition.y - this.popupDiv.offsetHeight - 20 + "px";
  121490. const camerPosition = this.viewer.camera.position;
  121491. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121492. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121493. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121494. this.popupDiv.style.display = "block";
  121495. } else {
  121496. this.popupDiv.style.display = "none";
  121497. }
  121498. }
  121499. _createHtml(videoInfo) {
  121500. let html = `
  121501. <div class="leftLine-1"></div>
  121502. <div class="leftLine-2"></div>
  121503. <div class="popup-header">
  121504. <span class="popup-title" >${videoInfo.name}</span>
  121505. <span class="popup-video3-close-button" title="\u5173\u95ED" >\xD7</span>
  121506. </div>
  121507. <div class="popup-content">
  121508. <video id="myvideo" class="video-js vjs-big-play-centered vjs-fluid" controls preload="auto" width="100%" height="100%"></video>
  121509. </div>
  121510. `;
  121511. return html;
  121512. }
  121513. }
  121514. Object.assign(VideoWindow3.prototype, {
  121515. close() {
  121516. this.popupDiv.remove();
  121517. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121518. }
  121519. });
  121520. var HtmlWindow1 = "";
  121521. class HtmlWindow {
  121522. constructor(viewer2, position2, title, html, offsetHeight) {
  121523. if (!viewer2)
  121524. throw new Cesium.DeveloperError("no viewer object!");
  121525. if (!position2)
  121526. throw new Cesium.DeveloperError("no position object!");
  121527. this.viewer = viewer2;
  121528. this.offsetHeight = offsetHeight;
  121529. if (position2 instanceof Cesium.Cartesian3) {
  121530. this.position = position2;
  121531. } else {
  121532. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121533. }
  121534. if (document.getElementsByClassName("popup1").length > 0) {
  121535. document.getElementsByClassName("popup1")[0].remove();
  121536. viewer2.entities.remove(viewer2.entities.getById("popupPoint"));
  121537. }
  121538. this.id = "popup_" + getGuid();
  121539. this.popupDiv = document.createElement("div");
  121540. this.popupDiv.classList.add("popup1");
  121541. this.popupDiv.id = this.id;
  121542. this.viewer.container.append(this.popupDiv);
  121543. this.popupDiv.innerHTML = this._createHtml(title, html);
  121544. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121545. this.initPoint();
  121546. document.getElementsByClassName("popup1-close-button")[0].onclick = () => {
  121547. this.close();
  121548. };
  121549. }
  121550. postRender() {
  121551. this.viewer.scene.canvas.height;
  121552. const windowPosition = new Cesium.Cartesian2();
  121553. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121554. this.viewer.scene,
  121555. this.position,
  121556. windowPosition
  121557. );
  121558. let elWidth = this.popupDiv.offsetWidth;
  121559. let elHeight = this.popupDiv.offsetHeight;
  121560. if (!!this.offsetHeight) {
  121561. elHeight += this.offsetHeight;
  121562. }
  121563. this.popupDiv.style.left = windowPosition.x - elWidth / 2 + "px";
  121564. this.popupDiv.style.top = windowPosition.y - elHeight + "px";
  121565. const camerPosition = this.viewer.camera.position;
  121566. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121567. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121568. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121569. this.popupDiv.style.display = "block";
  121570. } else {
  121571. this.popupDiv.style.display = "none";
  121572. }
  121573. }
  121574. _createHtml(header, content) {
  121575. let html = `
  121576. <div class="popup-header">
  121577. ${header}
  121578. <span class="popup1-close-button">\xD7</span>
  121579. </div>
  121580. <div class="popup-content">
  121581. ${content}
  121582. </div>
  121583. <div class="popup-tip">
  121584. </div>
  121585. `;
  121586. return html;
  121587. }
  121588. initPoint() {
  121589. this.billboard = this.viewer.entities.add({
  121590. id: "popupPoint",
  121591. name: "popupPoint",
  121592. position: this.position,
  121593. billboard: {
  121594. image: "jt3dSDK/imgs/point/point.png",
  121595. horizontalOrigin: Cesium.HorizontalOrigin.center,
  121596. verticalOrigin: Cesium.VerticalOrigin.bottom,
  121597. scale: 1,
  121598. pixelOffset: new Cesium.Cartesian2(0, 0),
  121599. disableDepthTestDistance: Number.POSITIVE_INFINITY
  121600. }
  121601. });
  121602. }
  121603. }
  121604. Object.assign(HtmlWindow.prototype, {
  121605. close() {
  121606. this.popupDiv.remove();
  121607. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121608. this.viewer.entities.remove(this.billboard);
  121609. }
  121610. });
  121611. var HtmlWindow2$1 = "";
  121612. class HtmlWindow2 {
  121613. constructor(viewer2, position2, title, html) {
  121614. if (!viewer2)
  121615. throw new Cesium.DeveloperError("no viewer object!");
  121616. if (!position2)
  121617. throw new Cesium.DeveloperError("no position object!");
  121618. this.viewer = viewer2;
  121619. this.position = position2;
  121620. if (position2 instanceof Cesium.Cartesian3) {
  121621. this.position = position2;
  121622. } else {
  121623. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121624. }
  121625. if (document.getElementsByClassName("popup2").length > 0) {
  121626. document.getElementsByClassName("popup2")[0].remove();
  121627. }
  121628. this.id = "popup_" + getGuid();
  121629. this.popupDiv = document.createElement("div");
  121630. this.popupDiv.classList.add("popup2");
  121631. this.popupDiv.id = this.id;
  121632. this.viewer.container.append(this.popupDiv);
  121633. this.popupDiv.innerHTML = this._createHtml(title, html);
  121634. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121635. document.getElementsByClassName("popup2-close-button")[0].onclick = () => {
  121636. this.close();
  121637. };
  121638. }
  121639. postRender() {
  121640. this.viewer.scene.canvas.height;
  121641. const windowPosition = new Cesium.Cartesian2();
  121642. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121643. this.viewer.scene,
  121644. this.position,
  121645. windowPosition
  121646. );
  121647. this.popupDiv.style.left = windowPosition.x - this.popupDiv.offsetWidth - 120 + "px";
  121648. this.popupDiv.style.top = windowPosition.y + "px";
  121649. const camerPosition = this.viewer.camera.position;
  121650. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121651. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121652. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121653. this.popupDiv.style.display = "block";
  121654. } else {
  121655. this.popupDiv.style.display = "none";
  121656. }
  121657. }
  121658. _createHtml(title, content) {
  121659. let html = `
  121660. <div class="rightLine-1"></div>
  121661. <div class="rightLine-2"></div>
  121662. <div class="rightLine-3"></div>
  121663. <div class="popup-header">
  121664. <span class="popup-title" >${title}</span>
  121665. <span class="popup2-close-button" title="\u5173\u95ED" >\xD7</span>
  121666. </div>
  121667. <div class="popup-content">
  121668. ${content}
  121669. </div>
  121670. `;
  121671. return html;
  121672. }
  121673. }
  121674. Object.assign(HtmlWindow2.prototype, {
  121675. close() {
  121676. this.popupDiv.remove();
  121677. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121678. }
  121679. });
  121680. var HtmlWindow3$1 = "";
  121681. class HtmlWindow3 {
  121682. constructor(viewer2, position2, title, html) {
  121683. if (!viewer2)
  121684. throw new Cesium.DeveloperError("no viewer object!");
  121685. if (!position2)
  121686. throw new Cesium.DeveloperError("no position object!");
  121687. this.viewer = viewer2;
  121688. this.position = position2;
  121689. if (position2 instanceof Cesium.Cartesian3) {
  121690. this.position = position2;
  121691. } else {
  121692. this.position = Cesium.Cartesian3.fromDegrees(position2[0], position2[1], position2[2] || 0);
  121693. }
  121694. if (document.getElementsByClassName("popup3").length > 0) {
  121695. document.getElementsByClassName("popup3")[0].remove();
  121696. }
  121697. this.id = "popup_" + getGuid();
  121698. this.popupDiv = document.createElement("div");
  121699. this.popupDiv.classList.add("popup3");
  121700. this.popupDiv.id = this.id;
  121701. this.viewer.container.append(this.popupDiv);
  121702. this.popupDiv.innerHTML = this._createHtml(title, html);
  121703. this.viewer.scene.postRender.addEventListener(this.postRender, this);
  121704. document.getElementsByClassName("popup3-close-button")[0].onclick = () => {
  121705. this.close();
  121706. };
  121707. }
  121708. postRender() {
  121709. this.viewer.scene.canvas.height;
  121710. const windowPosition = new Cesium.Cartesian2();
  121711. Cesium.SceneTransforms.wgs84ToWindowCoordinates(
  121712. this.viewer.scene,
  121713. this.position,
  121714. windowPosition
  121715. );
  121716. this.popupDiv.style.left = windowPosition.x + 70 + "px";
  121717. this.popupDiv.style.top = windowPosition.y - this.popupDiv.offsetHeight - 20 + "px";
  121718. const camerPosition = this.viewer.camera.position;
  121719. let height2 = this.viewer.scene.globe.ellipsoid.cartesianToCartographic(camerPosition).height;
  121720. height2 += this.viewer.scene.globe.ellipsoid.maximumRadius;
  121721. if (!(Cesium.Cartesian3.distance(camerPosition, this.position) > height2) && this.viewer.camera.positionCartographic.height < 5e7) {
  121722. this.popupDiv.style.display = "block";
  121723. } else {
  121724. this.popupDiv.style.display = "none";
  121725. }
  121726. }
  121727. _createHtml(title, content) {
  121728. let html = `
  121729. <div class="leftLine-1"></div>
  121730. <div class="leftLine-2"></div>
  121731. <div class="popup-header">
  121732. <span class="popup-title" >${title}</span>
  121733. <span class="popup3-close-button" title="\u5173\u95ED" >\xD7</span>
  121734. </div>
  121735. <div class="popup-content">
  121736. ${content}
  121737. </div>
  121738. `;
  121739. return html;
  121740. }
  121741. }
  121742. Object.assign(HtmlWindow3.prototype, {
  121743. close() {
  121744. this.popupDiv.remove();
  121745. this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  121746. }
  121747. });
  121748. let PopupWindow = {
  121749. MultiFieldAdaptWindow,
  121750. VideoWindow,
  121751. VideoWindow2,
  121752. VideoWindow3,
  121753. HtmlWindow,
  121754. HtmlWindow2,
  121755. HtmlWindow3
  121756. };
  121757. class AroundPoint {
  121758. constructor(viewer2, amount, position2) {
  121759. this._viewer = viewer2;
  121760. this._amount = amount;
  121761. this._position = position2;
  121762. this._range = this._viewer.camera.positionCartographic.height;
  121763. }
  121764. _bindEvent() {
  121765. let _self = this;
  121766. this._viewer.clock.onTick.addEventListener(this._aroundPoint, this);
  121767. var handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  121768. handler.setInputAction(function(click) {
  121769. _self.stop();
  121770. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  121771. }
  121772. _unbindEvent() {
  121773. this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
  121774. this._viewer.clock.onTick.removeEventListener(this._aroundPoint, this);
  121775. }
  121776. start() {
  121777. this._viewer.clock.shouldAnimate = true;
  121778. this._unbindEvent();
  121779. this._bindEvent();
  121780. return this;
  121781. }
  121782. stop() {
  121783. this._unbindEvent();
  121784. return this;
  121785. }
  121786. _aroundPoint() {
  121787. let heading = this._viewer.camera.heading;
  121788. let pitch = this._viewer.camera.pitch;
  121789. let range3 = this._range;
  121790. heading += Cesium.Math.toRadians(this._amount);
  121791. if (heading >= Math.PI * 2 || heading <= -Math.PI * 2) {
  121792. heading = 0;
  121793. }
  121794. this._viewer.camera.lookAt(
  121795. this._position,
  121796. new Cesium.HeadingPitchRange(
  121797. heading,
  121798. pitch,
  121799. range3
  121800. )
  121801. );
  121802. }
  121803. }
  121804. class AroundView {
  121805. constructor(viewer2, amount) {
  121806. this._viewer = viewer2;
  121807. this._amount = amount;
  121808. }
  121809. _bindEvent() {
  121810. let _self = this;
  121811. this._viewer.clock.onTick.addEventListener(this._aroundView, this);
  121812. var handler = new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);
  121813. handler.setInputAction(function(click) {
  121814. _self.stop();
  121815. }, Cesium.ScreenSpaceEventType.LEFT_DOWN);
  121816. }
  121817. _unbindEvent() {
  121818. this._viewer.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
  121819. this._viewer.clock.onTick.removeEventListener(this._aroundView, this);
  121820. }
  121821. start() {
  121822. this._viewer.clock.shouldAnimate = true;
  121823. this._unbindEvent();
  121824. this._bindEvent();
  121825. return this;
  121826. }
  121827. stop() {
  121828. this._unbindEvent();
  121829. return this;
  121830. }
  121831. _aroundView() {
  121832. let heading = this._viewer.camera.heading;
  121833. let pitch = this._viewer.camera.pitch;
  121834. let roll = this._viewer.camera.roll;
  121835. heading += Cesium.Math.toRadians(this._amount);
  121836. if (heading >= Math.PI * 2 || heading <= -Math.PI * 2) {
  121837. heading = 0;
  121838. }
  121839. this._viewer.camera.setView({
  121840. orientation: {
  121841. heading,
  121842. pitch,
  121843. roll
  121844. }
  121845. });
  121846. }
  121847. }
  121848. export { AroundPoint, AroundView, CircleObject, CommonTools, CoordTransform, CrImageServerLayer, DrawMilitaryPlot, DrawPoint, DrawTools, LocateUtil, PointObject, PolygonObject, PolylineObject, PopupWindow, CreateRemindertip as ReminderTip, Roaming, RuntimeEnvironment, SceneControl, SceneEffects, SketchViewModel, SpatialAnalysis, StatusBar, TerrainAnalysis, TrackRoam, WallObject, common, jtMap3d, LoadMapData as layer };