| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092 |
- !(function (t, e) {
- 'object' == typeof exports && 'undefined' != typeof module
- ? (module.exports = e())
- : 'function' == typeof define && define.amd
- ? define(e)
- : ((t =
- 'undefined' != typeof globalThis
- ? globalThis
- : t || self).TXLivePusher = e());
- })(this, function () {
- 'use strict';
- function t(t, e) {
- return (
- e.forEach(function (e) {
- e &&
- 'string' != typeof e &&
- !Array.isArray(e) &&
- Object.keys(e).forEach(function (r) {
- if ('default' !== r && !(r in t)) {
- var n = Object.getOwnPropertyDescriptor(e, r);
- Object.defineProperty(
- t,
- r,
- n.get
- ? n
- : {
- enumerable: !0,
- get: function () {
- return e[r];
- },
- }
- );
- }
- });
- }),
- Object.freeze(t)
- );
- }
- var e =
- 'undefined' != typeof globalThis
- ? globalThis
- : 'undefined' != typeof window
- ? window
- : 'undefined' != typeof global
- ? global
- : 'undefined' != typeof self
- ? self
- : {};
- function r(t) {
- return t &&
- t.__esModule &&
- Object.prototype.hasOwnProperty.call(t, 'default')
- ? t.default
- : t;
- }
- function n(t) {
- if (t.__esModule) return t;
- var e = Object.defineProperty({}, '__esModule', { value: !0 });
- return (
- Object.keys(t).forEach(function (r) {
- var n = Object.getOwnPropertyDescriptor(t, r);
- Object.defineProperty(
- e,
- r,
- n.get
- ? n
- : {
- enumerable: !0,
- get: function () {
- return t[r];
- },
- }
- );
- }),
- e
- );
- }
- var i = function (t) {
- return t && t.Math == Math && t;
- },
- o =
- i('object' == typeof globalThis && globalThis) ||
- i('object' == typeof window && window) ||
- i('object' == typeof self && self) ||
- i('object' == typeof e && e) ||
- (function () {
- return this;
- })() ||
- Function('return this')(),
- s = function (t) {
- try {
- return !!t();
- } catch (t) {
- return !0;
- }
- },
- a = !s(function () {
- var t = function () {}.bind();
- return 'function' != typeof t || t.hasOwnProperty('prototype');
- }),
- u = a,
- c = Function.prototype,
- h = c.apply,
- l = c.call,
- d =
- ('object' == typeof Reflect && Reflect.apply) ||
- (u
- ? l.bind(h)
- : function () {
- return l.apply(h, arguments);
- }),
- f = a,
- p = Function.prototype,
- v = p.call,
- m = f && p.bind.bind(v, v),
- y = f
- ? m
- : function (t) {
- return function () {
- return v.apply(t, arguments);
- };
- },
- g = y,
- _ = g({}.toString),
- b = g(''.slice),
- T = function (t) {
- return b(_(t), 8, -1);
- },
- x = T,
- E = y,
- S = function (t) {
- if ('Function' === x(t)) return E(t);
- },
- w = 'object' == typeof document && document.all,
- R = { all: w, IS_HTMLDDA: void 0 === w && void 0 !== w },
- C = R.all,
- P = R.IS_HTMLDDA
- ? function (t) {
- return 'function' == typeof t || t === C;
- }
- : function (t) {
- return 'function' == typeof t;
- },
- A = {},
- O = !s(function () {
- return (
- 7 !=
- Object.defineProperty({}, 1, {
- get: function () {
- return 7;
- },
- })[1]
- );
- }),
- I = a,
- M = Function.prototype.call,
- D = I
- ? M.bind(M)
- : function () {
- return M.apply(M, arguments);
- },
- L = {},
- F = {}.propertyIsEnumerable,
- N = Object.getOwnPropertyDescriptor,
- k = N && !F.call({ 1: 2 }, 1);
- L.f = k
- ? function (t) {
- var e = N(this, t);
- return !!e && e.enumerable;
- }
- : F;
- var B,
- G,
- U = function (t, e) {
- return {
- enumerable: !(1 & t),
- configurable: !(2 & t),
- writable: !(4 & t),
- value: e,
- };
- },
- j = s,
- X = T,
- V = Object,
- H = S(''.split),
- W = j(function () {
- return !V('z').propertyIsEnumerable(0);
- })
- ? function (t) {
- return 'String' == X(t) ? H(t, '') : V(t);
- }
- : V,
- Y = function (t) {
- return null == t;
- },
- z = Y,
- Z = TypeError,
- J = function (t) {
- if (z(t)) throw Z("Can't call method on " + t);
- return t;
- },
- K = W,
- q = J,
- Q = function (t) {
- return K(q(t));
- },
- $ = P,
- tt = R.all,
- et = R.IS_HTMLDDA
- ? function (t) {
- return 'object' == typeof t ? null !== t : $(t) || t === tt;
- }
- : function (t) {
- return 'object' == typeof t ? null !== t : $(t);
- },
- rt = {},
- nt = rt,
- it = o,
- ot = P,
- st = function (t) {
- return ot(t) ? t : void 0;
- },
- at = function (t, e) {
- return arguments.length < 2
- ? st(nt[t]) || st(it[t])
- : (nt[t] && nt[t][e]) || (it[t] && it[t][e]);
- },
- ut = S({}.isPrototypeOf),
- ct = at('navigator', 'userAgent') || '',
- ht = o,
- lt = ct,
- dt = ht.process,
- ft = ht.Deno,
- pt = (dt && dt.versions) || (ft && ft.version),
- vt = pt && pt.v8;
- vt && (G = (B = vt.split('.'))[0] > 0 && B[0] < 4 ? 1 : +(B[0] + B[1])),
- !G &&
- lt &&
- (!(B = lt.match(/Edge\/(\d+)/)) || B[1] >= 74) &&
- (B = lt.match(/Chrome\/(\d+)/)) &&
- (G = +B[1]);
- var mt = G,
- yt = mt,
- gt = s,
- _t =
- !!Object.getOwnPropertySymbols &&
- !gt(function () {
- var t = Symbol();
- return (
- !String(t) ||
- !(Object(t) instanceof Symbol) ||
- (!Symbol.sham && yt && yt < 41)
- );
- }),
- bt = _t && !Symbol.sham && 'symbol' == typeof Symbol.iterator,
- Tt = at,
- xt = P,
- Et = ut,
- St = Object,
- wt = bt
- ? function (t) {
- return 'symbol' == typeof t;
- }
- : function (t) {
- var e = Tt('Symbol');
- return xt(e) && Et(e.prototype, St(t));
- },
- Rt = String,
- Ct = function (t) {
- try {
- return Rt(t);
- } catch (t) {
- return 'Object';
- }
- },
- Pt = P,
- At = Ct,
- Ot = TypeError,
- It = function (t) {
- if (Pt(t)) return t;
- throw Ot(At(t) + ' is not a function');
- },
- Mt = It,
- Dt = Y,
- Lt = function (t, e) {
- var r = t[e];
- return Dt(r) ? void 0 : Mt(r);
- },
- Ft = D,
- Nt = P,
- kt = et,
- Bt = TypeError,
- Gt = { exports: {} },
- Ut = o,
- jt = Object.defineProperty,
- Xt = function (t, e) {
- try {
- jt(Ut, t, { value: e, configurable: !0, writable: !0 });
- } catch (r) {
- Ut[t] = e;
- }
- return e;
- },
- Vt = '__core-js_shared__',
- Ht = o[Vt] || Xt(Vt, {}),
- Wt = Ht;
- (Gt.exports = function (t, e) {
- return Wt[t] || (Wt[t] = void 0 !== e ? e : {});
- })('versions', []).push({
- version: '3.26.0',
- mode: 'pure',
- copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
- license: 'https://github.com/zloirock/core-js/blob/v3.26.0/LICENSE',
- source: 'https://github.com/zloirock/core-js',
- });
- var Yt = J,
- zt = Object,
- Zt = function (t) {
- return zt(Yt(t));
- },
- Jt = Zt,
- Kt = S({}.hasOwnProperty),
- qt =
- Object.hasOwn ||
- function (t, e) {
- return Kt(Jt(t), e);
- },
- Qt = S,
- $t = 0,
- te = Math.random(),
- ee = Qt((1).toString),
- re = function (t) {
- return 'Symbol(' + (void 0 === t ? '' : t) + ')_' + ee(++$t + te, 36);
- },
- ne = o,
- ie = Gt.exports,
- oe = qt,
- se = re,
- ae = _t,
- ue = bt,
- ce = ie('wks'),
- he = ne.Symbol,
- le = he && he.for,
- de = ue ? he : (he && he.withoutSetter) || se,
- fe = function (t) {
- if (!oe(ce, t) || (!ae && 'string' != typeof ce[t])) {
- var e = 'Symbol.' + t;
- ae && oe(he, t) ? (ce[t] = he[t]) : (ce[t] = ue && le ? le(e) : de(e));
- }
- return ce[t];
- },
- pe = D,
- ve = et,
- me = wt,
- ye = Lt,
- ge = function (t, e) {
- var r, n;
- if ('string' === e && Nt((r = t.toString)) && !kt((n = Ft(r, t))))
- return n;
- if (Nt((r = t.valueOf)) && !kt((n = Ft(r, t)))) return n;
- if ('string' !== e && Nt((r = t.toString)) && !kt((n = Ft(r, t))))
- return n;
- throw Bt("Can't convert object to primitive value");
- },
- _e = TypeError,
- be = fe('toPrimitive'),
- Te = function (t, e) {
- if (!ve(t) || me(t)) return t;
- var r,
- n = ye(t, be);
- if (n) {
- if (
- (void 0 === e && (e = 'default'), (r = pe(n, t, e)), !ve(r) || me(r))
- )
- return r;
- throw _e("Can't convert object to primitive value");
- }
- return void 0 === e && (e = 'number'), ge(t, e);
- },
- xe = wt,
- Ee = function (t) {
- var e = Te(t, 'string');
- return xe(e) ? e : e + '';
- },
- Se = et,
- we = o.document,
- Re = Se(we) && Se(we.createElement),
- Ce = function (t) {
- return Re ? we.createElement(t) : {};
- },
- Pe = Ce,
- Ae =
- !O &&
- !s(function () {
- return (
- 7 !=
- Object.defineProperty(Pe('div'), 'a', {
- get: function () {
- return 7;
- },
- }).a
- );
- }),
- Oe = O,
- Ie = D,
- Me = L,
- De = U,
- Le = Q,
- Fe = Ee,
- Ne = qt,
- ke = Ae,
- Be = Object.getOwnPropertyDescriptor;
- A.f = Oe
- ? Be
- : function (t, e) {
- if (((t = Le(t)), (e = Fe(e)), ke))
- try {
- return Be(t, e);
- } catch (t) {}
- if (Ne(t, e)) return De(!Ie(Me.f, t, e), t[e]);
- };
- var Ge = s,
- Ue = P,
- je = /#|\.prototype\./,
- Xe = function (t, e) {
- var r = He[Ve(t)];
- return r == Ye || (r != We && (Ue(e) ? Ge(e) : !!e));
- },
- Ve = (Xe.normalize = function (t) {
- return String(t).replace(je, '.').toLowerCase();
- }),
- He = (Xe.data = {}),
- We = (Xe.NATIVE = 'N'),
- Ye = (Xe.POLYFILL = 'P'),
- ze = Xe,
- Ze = It,
- Je = a,
- Ke = S(S.bind),
- qe = function (t, e) {
- return (
- Ze(t),
- void 0 === e
- ? t
- : Je
- ? Ke(t, e)
- : function () {
- return t.apply(e, arguments);
- }
- );
- },
- Qe = {},
- $e =
- O &&
- s(function () {
- return (
- 42 !=
- Object.defineProperty(function () {}, 'prototype', {
- value: 42,
- writable: !1,
- }).prototype
- );
- }),
- tr = et,
- er = String,
- rr = TypeError,
- nr = function (t) {
- if (tr(t)) return t;
- throw rr(er(t) + ' is not an object');
- },
- ir = O,
- or = Ae,
- sr = $e,
- ar = nr,
- ur = Ee,
- cr = TypeError,
- hr = Object.defineProperty,
- lr = Object.getOwnPropertyDescriptor,
- dr = 'enumerable',
- fr = 'configurable',
- pr = 'writable';
- Qe.f = ir
- ? sr
- ? function (t, e, r) {
- if (
- (ar(t),
- (e = ur(e)),
- ar(r),
- 'function' == typeof t &&
- 'prototype' === e &&
- 'value' in r &&
- pr in r &&
- !r.writable)
- ) {
- var n = lr(t, e);
- n &&
- n.writable &&
- ((t[e] = r.value),
- (r = {
- configurable: fr in r ? r.configurable : n.configurable,
- enumerable: dr in r ? r.enumerable : n.enumerable,
- writable: !1,
- }));
- }
- return hr(t, e, r);
- }
- : hr
- : function (t, e, r) {
- if ((ar(t), (e = ur(e)), ar(r), or))
- try {
- return hr(t, e, r);
- } catch (t) {}
- if ('get' in r || 'set' in r) throw cr('Accessors not supported');
- return 'value' in r && (t[e] = r.value), t;
- };
- var vr = Qe,
- mr = U,
- yr = O
- ? function (t, e, r) {
- return vr.f(t, e, mr(1, r));
- }
- : function (t, e, r) {
- return (t[e] = r), t;
- },
- gr = o,
- _r = d,
- br = S,
- Tr = P,
- xr = A.f,
- Er = ze,
- Sr = rt,
- wr = qe,
- Rr = yr,
- Cr = qt,
- Pr = function (t) {
- var e = function (r, n, i) {
- if (this instanceof e) {
- switch (arguments.length) {
- case 0:
- return new t();
- case 1:
- return new t(r);
- case 2:
- return new t(r, n);
- }
- return new t(r, n, i);
- }
- return _r(t, this, arguments);
- };
- return (e.prototype = t.prototype), e;
- },
- Ar = function (t, e) {
- var r,
- n,
- i,
- o,
- s,
- a,
- u,
- c,
- h = t.target,
- l = t.global,
- d = t.stat,
- f = t.proto,
- p = l ? gr : d ? gr[h] : (gr[h] || {}).prototype,
- v = l ? Sr : Sr[h] || Rr(Sr, h, {})[h],
- m = v.prototype;
- for (i in e)
- (r = !Er(l ? i : h + (d ? '.' : '#') + i, t.forced) && p && Cr(p, i)),
- (s = v[i]),
- r && (a = t.dontCallGetSet ? (c = xr(p, i)) && c.value : p[i]),
- (o = r && a ? a : e[i]),
- (r && typeof s == typeof o) ||
- ((u =
- t.bind && r
- ? wr(o, gr)
- : t.wrap && r
- ? Pr(o)
- : f && Tr(o)
- ? br(o)
- : o),
- (t.sham || (o && o.sham) || (s && s.sham)) && Rr(u, 'sham', !0),
- Rr(v, i, u),
- f &&
- (Cr(Sr, (n = h + 'Prototype')) || Rr(Sr, n, {}),
- Rr(Sr[n], i, o),
- t.real && m && !m[i] && Rr(m, i, o)));
- },
- Or = T,
- Ir =
- Array.isArray ||
- function (t) {
- return 'Array' == Or(t);
- },
- Mr = Math.ceil,
- Dr = Math.floor,
- Lr =
- Math.trunc ||
- function (t) {
- var e = +t;
- return (e > 0 ? Dr : Mr)(e);
- },
- Fr = Lr,
- Nr = function (t) {
- var e = +t;
- return e != e || 0 === e ? 0 : Fr(e);
- },
- kr = Nr,
- Br = Math.min,
- Gr = function (t) {
- return t > 0 ? Br(kr(t), 9007199254740991) : 0;
- },
- Ur = Gr,
- jr = function (t) {
- return Ur(t.length);
- },
- Xr = TypeError,
- Vr = function (t) {
- if (t > 9007199254740991) throw Xr('Maximum allowed index exceeded');
- return t;
- },
- Hr = Ee,
- Wr = Qe,
- Yr = U,
- zr = function (t, e, r) {
- var n = Hr(e);
- n in t ? Wr.f(t, n, Yr(0, r)) : (t[n] = r);
- },
- Zr = {};
- Zr[fe('toStringTag')] = 'z';
- var Jr = '[object z]' === String(Zr),
- Kr = Jr,
- qr = P,
- Qr = T,
- $r = fe('toStringTag'),
- tn = Object,
- en =
- 'Arguments' ==
- Qr(
- (function () {
- return arguments;
- })()
- ),
- rn = Kr
- ? Qr
- : function (t) {
- var e, r, n;
- return void 0 === t
- ? 'Undefined'
- : null === t
- ? 'Null'
- : 'string' ==
- typeof (r = (function (t, e) {
- try {
- return t[e];
- } catch (t) {}
- })((e = tn(t)), $r))
- ? r
- : en
- ? Qr(e)
- : 'Object' == (n = Qr(e)) && qr(e.callee)
- ? 'Arguments'
- : n;
- },
- nn = P,
- on = Ht,
- sn = S(Function.toString);
- nn(on.inspectSource) ||
- (on.inspectSource = function (t) {
- return sn(t);
- });
- var an = on.inspectSource,
- un = S,
- cn = s,
- hn = P,
- ln = rn,
- dn = an,
- fn = function () {},
- pn = [],
- vn = at('Reflect', 'construct'),
- mn = /^\s*(?:class|function)\b/,
- yn = un(mn.exec),
- gn = !mn.exec(fn),
- _n = function (t) {
- if (!hn(t)) return !1;
- try {
- return vn(fn, pn, t), !0;
- } catch (t) {
- return !1;
- }
- },
- bn = function (t) {
- if (!hn(t)) return !1;
- switch (ln(t)) {
- case 'AsyncFunction':
- case 'GeneratorFunction':
- case 'AsyncGeneratorFunction':
- return !1;
- }
- try {
- return gn || !!yn(mn, dn(t));
- } catch (t) {
- return !0;
- }
- };
- bn.sham = !0;
- var Tn =
- !vn ||
- cn(function () {
- var t;
- return (
- _n(_n.call) ||
- !_n(Object) ||
- !_n(function () {
- t = !0;
- }) ||
- t
- );
- })
- ? bn
- : _n,
- xn = Ir,
- En = Tn,
- Sn = et,
- wn = fe('species'),
- Rn = Array,
- Cn = function (t) {
- var e;
- return (
- xn(t) &&
- ((e = t.constructor),
- ((En(e) && (e === Rn || xn(e.prototype))) ||
- (Sn(e) && null === (e = e[wn]))) &&
- (e = void 0)),
- void 0 === e ? Rn : e
- );
- },
- Pn = function (t, e) {
- return new (Cn(t))(0 === e ? 0 : e);
- },
- An = s,
- On = mt,
- In = fe('species'),
- Mn = function (t) {
- return (
- On >= 51 ||
- !An(function () {
- var e = [];
- return (
- ((e.constructor = {})[In] = function () {
- return { foo: 1 };
- }),
- 1 !== e[t](Boolean).foo
- );
- })
- );
- },
- Dn = Ar,
- Ln = s,
- Fn = Ir,
- Nn = et,
- kn = Zt,
- Bn = jr,
- Gn = Vr,
- Un = zr,
- jn = Pn,
- Xn = Mn,
- Vn = mt,
- Hn = fe('isConcatSpreadable'),
- Wn =
- Vn >= 51 ||
- !Ln(function () {
- var t = [];
- return (t[Hn] = !1), t.concat()[0] !== t;
- }),
- Yn = Xn('concat'),
- zn = function (t) {
- if (!Nn(t)) return !1;
- var e = t[Hn];
- return void 0 !== e ? !!e : Fn(t);
- };
- Dn(
- { target: 'Array', proto: !0, arity: 1, forced: !Wn || !Yn },
- {
- concat: function (t) {
- var e,
- r,
- n,
- i,
- o,
- s = kn(this),
- a = jn(s, 0),
- u = 0;
- for (e = -1, n = arguments.length; e < n; e++)
- if (zn((o = -1 === e ? s : arguments[e])))
- for (i = Bn(o), Gn(u + i), r = 0; r < i; r++, u++)
- r in o && Un(a, u, o[r]);
- else Gn(u + 1), Un(a, u++, o);
- return (a.length = u), a;
- },
- }
- );
- var Zn = rn,
- Jn = String,
- Kn = function (t) {
- if ('Symbol' === Zn(t))
- throw TypeError('Cannot convert a Symbol value to a string');
- return Jn(t);
- },
- qn = {},
- Qn = Nr,
- $n = Math.max,
- ti = Math.min,
- ei = function (t, e) {
- var r = Qn(t);
- return r < 0 ? $n(r + e, 0) : ti(r, e);
- },
- ri = Q,
- ni = ei,
- ii = jr,
- oi = function (t) {
- return function (e, r, n) {
- var i,
- o = ri(e),
- s = ii(o),
- a = ni(n, s);
- if (t && r != r) {
- for (; s > a; ) if ((i = o[a++]) != i) return !0;
- } else
- for (; s > a; a++)
- if ((t || a in o) && o[a] === r) return t || a || 0;
- return !t && -1;
- };
- },
- si = { includes: oi(!0), indexOf: oi(!1) },
- ai = {},
- ui = qt,
- ci = Q,
- hi = si.indexOf,
- li = ai,
- di = S([].push),
- fi = function (t, e) {
- var r,
- n = ci(t),
- i = 0,
- o = [];
- for (r in n) !ui(li, r) && ui(n, r) && di(o, r);
- for (; e.length > i; ) ui(n, (r = e[i++])) && (~hi(o, r) || di(o, r));
- return o;
- },
- pi = [
- 'constructor',
- 'hasOwnProperty',
- 'isPrototypeOf',
- 'propertyIsEnumerable',
- 'toLocaleString',
- 'toString',
- 'valueOf',
- ],
- vi = fi,
- mi = pi,
- yi =
- Object.keys ||
- function (t) {
- return vi(t, mi);
- },
- gi = O,
- _i = $e,
- bi = Qe,
- Ti = nr,
- xi = Q,
- Ei = yi;
- qn.f =
- gi && !_i
- ? Object.defineProperties
- : function (t, e) {
- Ti(t);
- for (var r, n = xi(e), i = Ei(e), o = i.length, s = 0; o > s; )
- bi.f(t, (r = i[s++]), n[r]);
- return t;
- };
- var Si,
- wi = at('document', 'documentElement'),
- Ri = Gt.exports,
- Ci = re,
- Pi = Ri('keys'),
- Ai = function (t) {
- return Pi[t] || (Pi[t] = Ci(t));
- },
- Oi = nr,
- Ii = qn,
- Mi = pi,
- Di = ai,
- Li = wi,
- Fi = Ce,
- Ni = Ai('IE_PROTO'),
- ki = function () {},
- Bi = function (t) {
- return '<script>' + t + '</' + 'script>';
- },
- Gi = function (t) {
- t.write(Bi('')), t.close();
- var e = t.parentWindow.Object;
- return (t = null), e;
- },
- Ui = function () {
- try {
- Si = new ActiveXObject('htmlfile');
- } catch (t) {}
- var t, e;
- Ui =
- 'undefined' != typeof document
- ? document.domain && Si
- ? Gi(Si)
- : (((e = Fi('iframe')).style.display = 'none'),
- Li.appendChild(e),
- (e.src = String('javascript:')),
- (t = e.contentWindow.document).open(),
- t.write(Bi('document.F=Object')),
- t.close(),
- t.F)
- : Gi(Si);
- for (var r = Mi.length; r--; ) delete Ui.prototype[Mi[r]];
- return Ui();
- };
- Di[Ni] = !0;
- var ji =
- Object.create ||
- function (t, e) {
- var r;
- return (
- null !== t
- ? ((ki.prototype = Oi(t)),
- (r = new ki()),
- (ki.prototype = null),
- (r[Ni] = t))
- : (r = Ui()),
- void 0 === e ? r : Ii.f(r, e)
- );
- },
- Xi = {},
- Vi = fi,
- Hi = pi.concat('length', 'prototype');
- Xi.f =
- Object.getOwnPropertyNames ||
- function (t) {
- return Vi(t, Hi);
- };
- var Wi = {},
- Yi = ei,
- zi = jr,
- Zi = zr,
- Ji = Array,
- Ki = Math.max,
- qi = function (t, e, r) {
- for (
- var n = zi(t),
- i = Yi(e, n),
- o = Yi(void 0 === r ? n : r, n),
- s = Ji(Ki(o - i, 0)),
- a = 0;
- i < o;
- i++, a++
- )
- Zi(s, a, t[i]);
- return (s.length = a), s;
- },
- Qi = T,
- $i = Q,
- to = Xi.f,
- eo = qi,
- ro =
- 'object' == typeof window && window && Object.getOwnPropertyNames
- ? Object.getOwnPropertyNames(window)
- : [];
- Wi.f = function (t) {
- return ro && 'Window' == Qi(t)
- ? (function (t) {
- try {
- return to(t);
- } catch (t) {
- return eo(ro);
- }
- })(t)
- : to($i(t));
- };
- var no = {};
- no.f = Object.getOwnPropertySymbols;
- var io = yr,
- oo = function (t, e, r, n) {
- return n && n.enumerable ? (t[e] = r) : io(t, e, r), t;
- },
- so = {},
- ao = fe;
- so.f = ao;
- var uo,
- co,
- ho,
- lo = rt,
- fo = qt,
- po = so,
- vo = Qe.f,
- mo = function (t) {
- var e = lo.Symbol || (lo.Symbol = {});
- fo(e, t) || vo(e, t, { value: po.f(t) });
- },
- yo = D,
- go = at,
- _o = fe,
- bo = oo,
- To = function () {
- var t = go('Symbol'),
- e = t && t.prototype,
- r = e && e.valueOf,
- n = _o('toPrimitive');
- e &&
- !e[n] &&
- bo(
- e,
- n,
- function (t) {
- return yo(r, this);
- },
- { arity: 1 }
- );
- },
- xo = rn,
- Eo = Jr
- ? {}.toString
- : function () {
- return '[object ' + xo(this) + ']';
- },
- So = Jr,
- wo = Qe.f,
- Ro = yr,
- Co = qt,
- Po = Eo,
- Ao = fe('toStringTag'),
- Oo = function (t, e, r, n) {
- if (t) {
- var i = r ? t : t.prototype;
- Co(i, Ao) || wo(i, Ao, { configurable: !0, value: e }),
- n && !So && Ro(i, 'toString', Po);
- }
- },
- Io = P,
- Mo = o.WeakMap,
- Do = Io(Mo) && /native code/.test(String(Mo)),
- Lo = o,
- Fo = et,
- No = yr,
- ko = qt,
- Bo = Ht,
- Go = Ai,
- Uo = ai,
- jo = 'Object already initialized',
- Xo = Lo.TypeError,
- Vo = Lo.WeakMap;
- if (Do || Bo.state) {
- var Ho = Bo.state || (Bo.state = new Vo());
- (Ho.get = Ho.get),
- (Ho.has = Ho.has),
- (Ho.set = Ho.set),
- (uo = function (t, e) {
- if (Ho.has(t)) throw Xo(jo);
- return (e.facade = t), Ho.set(t, e), e;
- }),
- (co = function (t) {
- return Ho.get(t) || {};
- }),
- (ho = function (t) {
- return Ho.has(t);
- });
- } else {
- var Wo = Go('state');
- (Uo[Wo] = !0),
- (uo = function (t, e) {
- if (ko(t, Wo)) throw Xo(jo);
- return (e.facade = t), No(t, Wo, e), e;
- }),
- (co = function (t) {
- return ko(t, Wo) ? t[Wo] : {};
- }),
- (ho = function (t) {
- return ko(t, Wo);
- });
- }
- var Yo = {
- set: uo,
- get: co,
- has: ho,
- enforce: function (t) {
- return ho(t) ? co(t) : uo(t, {});
- },
- getterFor: function (t) {
- return function (e) {
- var r;
- if (!Fo(e) || (r = co(e)).type !== t)
- throw Xo('Incompatible receiver, ' + t + ' required');
- return r;
- };
- },
- },
- zo = qe,
- Zo = W,
- Jo = Zt,
- Ko = jr,
- qo = Pn,
- Qo = S([].push),
- $o = function (t) {
- var e = 1 == t,
- r = 2 == t,
- n = 3 == t,
- i = 4 == t,
- o = 6 == t,
- s = 7 == t,
- a = 5 == t || o;
- return function (u, c, h, l) {
- for (
- var d,
- f,
- p = Jo(u),
- v = Zo(p),
- m = zo(c, h),
- y = Ko(v),
- g = 0,
- _ = l || qo,
- b = e ? _(u, y) : r || s ? _(u, 0) : void 0;
- y > g;
- g++
- )
- if ((a || g in v) && ((f = m((d = v[g]), g, p)), t))
- if (e) b[g] = f;
- else if (f)
- switch (t) {
- case 3:
- return !0;
- case 5:
- return d;
- case 6:
- return g;
- case 2:
- Qo(b, d);
- }
- else
- switch (t) {
- case 4:
- return !1;
- case 7:
- Qo(b, d);
- }
- return o ? -1 : n || i ? i : b;
- };
- },
- ts = {
- forEach: $o(0),
- map: $o(1),
- filter: $o(2),
- some: $o(3),
- every: $o(4),
- find: $o(5),
- findIndex: $o(6),
- filterReject: $o(7),
- },
- es = Ar,
- rs = o,
- ns = D,
- is = S,
- os = O,
- ss = _t,
- as = s,
- us = qt,
- cs = ut,
- hs = nr,
- ls = Q,
- ds = Ee,
- fs = Kn,
- ps = U,
- vs = ji,
- ms = yi,
- ys = Xi,
- gs = Wi,
- _s = no,
- bs = A,
- Ts = Qe,
- xs = qn,
- Es = L,
- Ss = oo,
- ws = Gt.exports,
- Rs = ai,
- Cs = re,
- Ps = fe,
- As = so,
- Os = mo,
- Is = To,
- Ms = Oo,
- Ds = Yo,
- Ls = ts.forEach,
- Fs = Ai('hidden'),
- Ns = 'Symbol',
- ks = Ds.set,
- Bs = Ds.getterFor(Ns),
- Gs = Object.prototype,
- Us = rs.Symbol,
- js = Us && Us.prototype,
- Xs = rs.TypeError,
- Vs = rs.QObject,
- Hs = bs.f,
- Ws = Ts.f,
- Ys = gs.f,
- zs = Es.f,
- Zs = is([].push),
- Js = ws('symbols'),
- Ks = ws('op-symbols'),
- qs = ws('wks'),
- Qs = !Vs || !Vs.prototype || !Vs.prototype.findChild,
- $s =
- os &&
- as(function () {
- return (
- 7 !=
- vs(
- Ws({}, 'a', {
- get: function () {
- return Ws(this, 'a', { value: 7 }).a;
- },
- })
- ).a
- );
- })
- ? function (t, e, r) {
- var n = Hs(Gs, e);
- n && delete Gs[e], Ws(t, e, r), n && t !== Gs && Ws(Gs, e, n);
- }
- : Ws,
- ta = function (t, e) {
- var r = (Js[t] = vs(js));
- return (
- ks(r, { type: Ns, tag: t, description: e }),
- os || (r.description = e),
- r
- );
- },
- ea = function (t, e, r) {
- t === Gs && ea(Ks, e, r), hs(t);
- var n = ds(e);
- return (
- hs(r),
- us(Js, n)
- ? (r.enumerable
- ? (us(t, Fs) && t[Fs][n] && (t[Fs][n] = !1),
- (r = vs(r, { enumerable: ps(0, !1) })))
- : (us(t, Fs) || Ws(t, Fs, ps(1, {})), (t[Fs][n] = !0)),
- $s(t, n, r))
- : Ws(t, n, r)
- );
- },
- ra = function (t, e) {
- hs(t);
- var r = ls(e),
- n = ms(r).concat(sa(r));
- return (
- Ls(n, function (e) {
- (os && !ns(na, r, e)) || ea(t, e, r[e]);
- }),
- t
- );
- },
- na = function (t) {
- var e = ds(t),
- r = ns(zs, this, e);
- return (
- !(this === Gs && us(Js, e) && !us(Ks, e)) &&
- (!(r || !us(this, e) || !us(Js, e) || (us(this, Fs) && this[Fs][e])) ||
- r)
- );
- },
- ia = function (t, e) {
- var r = ls(t),
- n = ds(e);
- if (r !== Gs || !us(Js, n) || us(Ks, n)) {
- var i = Hs(r, n);
- return (
- !i || !us(Js, n) || (us(r, Fs) && r[Fs][n]) || (i.enumerable = !0), i
- );
- }
- },
- oa = function (t) {
- var e = Ys(ls(t)),
- r = [];
- return (
- Ls(e, function (t) {
- us(Js, t) || us(Rs, t) || Zs(r, t);
- }),
- r
- );
- },
- sa = function (t) {
- var e = t === Gs,
- r = Ys(e ? Ks : ls(t)),
- n = [];
- return (
- Ls(r, function (t) {
- !us(Js, t) || (e && !us(Gs, t)) || Zs(n, Js[t]);
- }),
- n
- );
- };
- ss ||
- ((Us = function () {
- if (cs(js, this)) throw Xs('Symbol is not a constructor');
- var t =
- arguments.length && void 0 !== arguments[0]
- ? fs(arguments[0])
- : void 0,
- e = Cs(t),
- r = function (t) {
- this === Gs && ns(r, Ks, t),
- us(this, Fs) && us(this[Fs], e) && (this[Fs][e] = !1),
- $s(this, e, ps(1, t));
- };
- return os && Qs && $s(Gs, e, { configurable: !0, set: r }), ta(e, t);
- }),
- Ss((js = Us.prototype), 'toString', function () {
- return Bs(this).tag;
- }),
- Ss(Us, 'withoutSetter', function (t) {
- return ta(Cs(t), t);
- }),
- (Es.f = na),
- (Ts.f = ea),
- (xs.f = ra),
- (bs.f = ia),
- (ys.f = gs.f = oa),
- (_s.f = sa),
- (As.f = function (t) {
- return ta(Ps(t), t);
- }),
- os &&
- Ws(js, 'description', {
- configurable: !0,
- get: function () {
- return Bs(this).description;
- },
- })),
- es(
- { global: !0, constructor: !0, wrap: !0, forced: !ss, sham: !ss },
- { Symbol: Us }
- ),
- Ls(ms(qs), function (t) {
- Os(t);
- }),
- es(
- { target: Ns, stat: !0, forced: !ss },
- {
- useSetter: function () {
- Qs = !0;
- },
- useSimple: function () {
- Qs = !1;
- },
- }
- ),
- es(
- { target: 'Object', stat: !0, forced: !ss, sham: !os },
- {
- create: function (t, e) {
- return void 0 === e ? vs(t) : ra(vs(t), e);
- },
- defineProperty: ea,
- defineProperties: ra,
- getOwnPropertyDescriptor: ia,
- }
- ),
- es(
- { target: 'Object', stat: !0, forced: !ss },
- { getOwnPropertyNames: oa }
- ),
- Is(),
- Ms(Us, Ns),
- (Rs[Fs] = !0);
- var aa = _t && !!Symbol.for && !!Symbol.keyFor,
- ua = Ar,
- ca = at,
- ha = qt,
- la = Kn,
- da = Gt.exports,
- fa = aa,
- pa = da('string-to-symbol-registry'),
- va = da('symbol-to-string-registry');
- ua(
- { target: 'Symbol', stat: !0, forced: !fa },
- {
- for: function (t) {
- var e = la(t);
- if (ha(pa, e)) return pa[e];
- var r = ca('Symbol')(e);
- return (pa[e] = r), (va[r] = e), r;
- },
- }
- );
- var ma = Ar,
- ya = qt,
- ga = wt,
- _a = Ct,
- ba = aa,
- Ta = (0, Gt.exports)('symbol-to-string-registry');
- ma(
- { target: 'Symbol', stat: !0, forced: !ba },
- {
- keyFor: function (t) {
- if (!ga(t)) throw TypeError(_a(t) + ' is not a symbol');
- if (ya(Ta, t)) return Ta[t];
- },
- }
- );
- var xa = S([].slice),
- Ea = Ar,
- Sa = at,
- wa = d,
- Ra = D,
- Ca = S,
- Pa = s,
- Aa = Ir,
- Oa = P,
- Ia = et,
- Ma = wt,
- Da = xa,
- La = _t,
- Fa = Sa('JSON', 'stringify'),
- Na = Ca(/./.exec),
- ka = Ca(''.charAt),
- Ba = Ca(''.charCodeAt),
- Ga = Ca(''.replace),
- Ua = Ca((1).toString),
- ja = /[\uD800-\uDFFF]/g,
- Xa = /^[\uD800-\uDBFF]$/,
- Va = /^[\uDC00-\uDFFF]$/,
- Ha =
- !La ||
- Pa(function () {
- var t = Sa('Symbol')();
- return (
- '[null]' != Fa([t]) || '{}' != Fa({ a: t }) || '{}' != Fa(Object(t))
- );
- }),
- Wa = Pa(function () {
- return (
- '"\\udf06\\ud834"' !== Fa('\udf06\ud834') ||
- '"\\udead"' !== Fa('\udead')
- );
- }),
- Ya = function (t, e) {
- var r = Da(arguments),
- n = e;
- if ((Ia(e) || void 0 !== t) && !Ma(t))
- return (
- Aa(e) ||
- (e = function (t, e) {
- if ((Oa(n) && (e = Ra(n, this, t, e)), !Ma(e))) return e;
- }),
- (r[1] = e),
- wa(Fa, null, r)
- );
- },
- za = function (t, e, r) {
- var n = ka(r, e - 1),
- i = ka(r, e + 1);
- return (Na(Xa, t) && !Na(Va, i)) || (Na(Va, t) && !Na(Xa, n))
- ? '\\u' + Ua(Ba(t, 0), 16)
- : t;
- };
- Fa &&
- Ea(
- { target: 'JSON', stat: !0, arity: 3, forced: Ha || Wa },
- {
- stringify: function (t, e, r) {
- var n = Da(arguments),
- i = wa(Ha ? Ya : Fa, null, n);
- return Wa && 'string' == typeof i ? Ga(i, ja, za) : i;
- },
- }
- );
- var Za = no,
- Ja = Zt;
- Ar(
- {
- target: 'Object',
- stat: !0,
- forced:
- !_t ||
- s(function () {
- Za.f(1);
- }),
- },
- {
- getOwnPropertySymbols: function (t) {
- var e = Za.f;
- return e ? e(Ja(t)) : [];
- },
- }
- ),
- mo('asyncIterator'),
- mo('hasInstance'),
- mo('isConcatSpreadable'),
- mo('iterator'),
- mo('match'),
- mo('matchAll'),
- mo('replace'),
- mo('search'),
- mo('species'),
- mo('split');
- var Ka = To;
- mo('toPrimitive'), Ka();
- var qa = at,
- Qa = Oo;
- mo('toStringTag'),
- Qa(qa('Symbol'), 'Symbol'),
- mo('unscopables'),
- Oo(o.JSON, 'JSON', !0);
- var $a,
- tu,
- eu,
- ru = rt.Symbol,
- nu = {},
- iu = O,
- ou = qt,
- su = Function.prototype,
- au = iu && Object.getOwnPropertyDescriptor,
- uu = ou(su, 'name'),
- cu = {
- EXISTS: uu,
- PROPER: uu && 'something' === function () {}.name,
- CONFIGURABLE: uu && (!iu || (iu && au(su, 'name').configurable)),
- },
- hu = !s(function () {
- function t() {}
- return (
- (t.prototype.constructor = null),
- Object.getPrototypeOf(new t()) !== t.prototype
- );
- }),
- lu = qt,
- du = P,
- fu = Zt,
- pu = hu,
- vu = Ai('IE_PROTO'),
- mu = Object,
- yu = mu.prototype,
- gu = pu
- ? mu.getPrototypeOf
- : function (t) {
- var e = fu(t);
- if (lu(e, vu)) return e[vu];
- var r = e.constructor;
- return du(r) && e instanceof r
- ? r.prototype
- : e instanceof mu
- ? yu
- : null;
- },
- _u = s,
- bu = P,
- Tu = et,
- xu = ji,
- Eu = gu,
- Su = oo,
- wu = fe('iterator'),
- Ru = !1;
- [].keys &&
- ('next' in (eu = [].keys())
- ? (tu = Eu(Eu(eu))) !== Object.prototype && ($a = tu)
- : (Ru = !0));
- var Cu =
- !Tu($a) ||
- _u(function () {
- var t = {};
- return $a[wu].call(t) !== t;
- });
- bu(($a = Cu ? {} : xu($a))[wu]) ||
- Su($a, wu, function () {
- return this;
- });
- var Pu = { IteratorPrototype: $a, BUGGY_SAFARI_ITERATORS: Ru },
- Au = Pu.IteratorPrototype,
- Ou = ji,
- Iu = U,
- Mu = Oo,
- Du = nu,
- Lu = function () {
- return this;
- },
- Fu = function (t, e, r, n) {
- var i = e + ' Iterator';
- return (
- (t.prototype = Ou(Au, { next: Iu(+!n, r) })),
- Mu(t, i, !1, !0),
- (Du[i] = Lu),
- t
- );
- },
- Nu = P,
- ku = String,
- Bu = TypeError,
- Gu = S,
- Uu = nr,
- ju = function (t) {
- if ('object' == typeof t || Nu(t)) return t;
- throw Bu("Can't set " + ku(t) + ' as a prototype');
- },
- Xu =
- Object.setPrototypeOf ||
- ('__proto__' in {}
- ? (function () {
- var t,
- e = !1,
- r = {};
- try {
- (t = Gu(
- Object.getOwnPropertyDescriptor(Object.prototype, '__proto__')
- .set
- ))(r, []),
- (e = r instanceof Array);
- } catch (t) {}
- return function (r, n) {
- return Uu(r), ju(n), e ? t(r, n) : (r.__proto__ = n), r;
- };
- })()
- : void 0),
- Vu = Ar,
- Hu = D,
- Wu = cu,
- Yu = Fu,
- zu = gu,
- Zu = Oo,
- Ju = oo,
- Ku = nu,
- qu = Pu,
- Qu = Wu.PROPER,
- $u = qu.BUGGY_SAFARI_ITERATORS,
- tc = fe('iterator'),
- ec = 'keys',
- rc = 'values',
- nc = 'entries',
- ic = function () {
- return this;
- },
- oc = function (t, e, r, n, i, o, s) {
- Yu(r, e, n);
- var a,
- u,
- c,
- h = function (t) {
- if (t === i && v) return v;
- if (!$u && t in f) return f[t];
- switch (t) {
- case ec:
- case rc:
- case nc:
- return function () {
- return new r(this, t);
- };
- }
- return function () {
- return new r(this);
- };
- },
- l = e + ' Iterator',
- d = !1,
- f = t.prototype,
- p = f[tc] || f['@@iterator'] || (i && f[i]),
- v = (!$u && p) || h(i),
- m = ('Array' == e && f.entries) || p;
- if (
- (m &&
- (a = zu(m.call(new t()))) !== Object.prototype &&
- a.next &&
- (Zu(a, l, !0, !0), (Ku[l] = ic)),
- Qu &&
- i == rc &&
- p &&
- p.name !== rc &&
- ((d = !0),
- (v = function () {
- return Hu(p, this);
- })),
- i)
- )
- if (((u = { values: h(rc), keys: o ? v : h(ec), entries: h(nc) }), s))
- for (c in u) ($u || d || !(c in f)) && Ju(f, c, u[c]);
- else Vu({ target: e, proto: !0, forced: $u || d }, u);
- return s && f[tc] !== v && Ju(f, tc, v, { name: i }), (Ku[e] = v), u;
- },
- sc = function (t, e) {
- return { value: t, done: e };
- },
- ac = Q,
- uc = function () {},
- cc = nu,
- hc = Yo,
- lc = (Qe.f, oc),
- dc = sc,
- fc = 'Array Iterator',
- pc = hc.set,
- vc = hc.getterFor(fc);
- lc(
- Array,
- 'Array',
- function (t, e) {
- pc(this, { type: fc, target: ac(t), index: 0, kind: e });
- },
- function () {
- var t = vc(this),
- e = t.target,
- r = t.kind,
- n = t.index++;
- return !e || n >= e.length
- ? ((t.target = void 0), dc(void 0, !0))
- : dc('keys' == r ? n : 'values' == r ? e[n] : [n, e[n]], !1);
- },
- 'values'
- );
- cc.Arguments = cc.Array;
- uc(), uc(), uc();
- var mc = {
- CSSRuleList: 0,
- CSSStyleDeclaration: 0,
- CSSValueList: 0,
- ClientRectList: 0,
- DOMRectList: 0,
- DOMStringList: 0,
- DOMTokenList: 1,
- DataTransferItemList: 0,
- FileList: 0,
- HTMLAllCollection: 0,
- HTMLCollection: 0,
- HTMLFormElement: 0,
- HTMLSelectElement: 0,
- MediaList: 0,
- MimeTypeArray: 0,
- NamedNodeMap: 0,
- NodeList: 1,
- PaintRequestList: 0,
- Plugin: 0,
- PluginArray: 0,
- SVGLengthList: 0,
- SVGNumberList: 0,
- SVGPathSegList: 0,
- SVGPointList: 0,
- SVGStringList: 0,
- SVGTransformList: 0,
- SourceBufferList: 0,
- StyleSheetList: 0,
- TextTrackCueList: 0,
- TextTrackList: 0,
- TouchList: 0,
- },
- yc = o,
- gc = rn,
- _c = yr,
- bc = nu,
- Tc = fe('toStringTag');
- for (var xc in mc) {
- var Ec = yc[xc],
- Sc = Ec && Ec.prototype;
- Sc && gc(Sc) !== Tc && _c(Sc, Tc, xc), (bc[xc] = bc.Array);
- }
- var wc = ru;
- mo('asyncDispose'),
- mo('dispose'),
- mo('matcher'),
- mo('metadataKey'),
- mo('observable'),
- mo('metadata'),
- mo('patternMatch'),
- mo('replaceAll');
- var Rc = wc,
- Cc = S,
- Pc = Nr,
- Ac = Kn,
- Oc = J,
- Ic = Cc(''.charAt),
- Mc = Cc(''.charCodeAt),
- Dc = Cc(''.slice),
- Lc = function (t) {
- return function (e, r) {
- var n,
- i,
- o = Ac(Oc(e)),
- s = Pc(r),
- a = o.length;
- return s < 0 || s >= a
- ? t
- ? ''
- : void 0
- : (n = Mc(o, s)) < 55296 ||
- n > 56319 ||
- s + 1 === a ||
- (i = Mc(o, s + 1)) < 56320 ||
- i > 57343
- ? t
- ? Ic(o, s)
- : n
- : t
- ? Dc(o, s, s + 2)
- : i - 56320 + ((n - 55296) << 10) + 65536;
- };
- },
- Fc = { codeAt: Lc(!1), charAt: Lc(!0) },
- Nc = Fc.charAt,
- kc = Kn,
- Bc = Yo,
- Gc = oc,
- Uc = sc,
- jc = 'String Iterator',
- Xc = Bc.set,
- Vc = Bc.getterFor(jc);
- Gc(
- String,
- 'String',
- function (t) {
- Xc(this, { type: jc, string: kc(t), index: 0 });
- },
- function () {
- var t,
- e = Vc(this),
- r = e.string,
- n = e.index;
- return n >= r.length
- ? Uc(void 0, !0)
- : ((t = Nc(r, n)), (e.index += t.length), Uc(t, !1));
- }
- );
- var Hc = so.f('iterator');
- function Wc(t) {
- return (
- (Wc =
- 'function' == typeof Rc && 'symbol' == typeof Hc
- ? function (t) {
- return typeof t;
- }
- : function (t) {
- return t &&
- 'function' == typeof Rc &&
- t.constructor === Rc &&
- t !== Rc.prototype
- ? 'symbol'
- : typeof t;
- }),
- Wc(t)
- );
- }
- var Yc = S,
- zc = It,
- Zc = et,
- Jc = qt,
- Kc = xa,
- qc = a,
- Qc = Function,
- $c = Yc([].concat),
- th = Yc([].join),
- eh = {},
- rh = function (t, e, r) {
- if (!Jc(eh, e)) {
- for (var n = [], i = 0; i < e; i++) n[i] = 'a[' + i + ']';
- eh[e] = Qc('C,a', 'return new C(' + th(n, ',') + ')');
- }
- return eh[e](t, r);
- },
- nh = qc
- ? Qc.bind
- : function (t) {
- var e = zc(this),
- r = e.prototype,
- n = Kc(arguments, 1),
- i = function () {
- var r = $c(n, Kc(arguments));
- return this instanceof i ? rh(e, r.length, r) : e.apply(t, r);
- };
- return Zc(r) && (i.prototype = r), i;
- },
- ih = nh;
- Ar(
- { target: 'Function', proto: !0, forced: Function.bind !== ih },
- { bind: ih }
- );
- var oh = rt,
- sh = function (t) {
- return oh[t + 'Prototype'];
- },
- ah = sh('Function').bind,
- uh = ut,
- ch = ah,
- hh = Function.prototype,
- lh = function (t) {
- var e = t.bind;
- return t === hh || (uh(hh, t) && e === hh.bind) ? ch : e;
- },
- dh = sh('Array').concat,
- fh = ut,
- ph = dh,
- vh = Array.prototype,
- mh = function (t) {
- var e = t.concat;
- return t === vh || (fh(vh, t) && e === vh.concat) ? ph : e;
- },
- yh = s,
- gh = function (t, e) {
- var r = [][t];
- return (
- !!r &&
- yh(function () {
- r.call(
- null,
- e ||
- function () {
- return 1;
- },
- 1
- );
- })
- );
- },
- _h = ts.forEach,
- bh = gh('forEach')
- ? [].forEach
- : function (t) {
- return _h(this, t, arguments.length > 1 ? arguments[1] : void 0);
- };
- Ar({ target: 'Array', proto: !0, forced: [].forEach != bh }, { forEach: bh });
- var Th = sh('Array').forEach,
- xh = rn,
- Eh = qt,
- Sh = ut,
- wh = Th,
- Rh = Array.prototype,
- Ch = { DOMTokenList: !0, NodeList: !0 },
- Ph = function (t) {
- var e = t.forEach;
- return t === Rh || (Sh(Rh, t) && e === Rh.forEach) || Eh(Ch, xh(t))
- ? wh
- : e;
- },
- Ah = ts.filter;
- Ar(
- { target: 'Array', proto: !0, forced: !Mn('filter') },
- {
- filter: function (t) {
- return Ah(this, t, arguments.length > 1 ? arguments[1] : void 0);
- },
- }
- );
- var Oh = sh('Array').filter,
- Ih = ut,
- Mh = Oh,
- Dh = Array.prototype,
- Lh = function (t) {
- var e = t.filter;
- return t === Dh || (Ih(Dh, t) && e === Dh.filter) ? Mh : e;
- },
- Fh = Ar,
- Nh = ts.findIndex,
- kh = 'findIndex',
- Bh = !0;
- kh in [] &&
- Array(1).findIndex(function () {
- Bh = !1;
- }),
- Fh(
- { target: 'Array', proto: !0, forced: Bh },
- {
- findIndex: function (t) {
- return Nh(this, t, arguments.length > 1 ? arguments[1] : void 0);
- },
- }
- );
- var Gh = sh('Array').findIndex,
- Uh = ut,
- jh = Gh,
- Xh = Array.prototype,
- Vh = function (t) {
- var e = t.findIndex;
- return t === Xh || (Uh(Xh, t) && e === Xh.findIndex) ? jh : e;
- },
- Hh = O,
- Wh = Ir,
- Yh = TypeError,
- zh = Object.getOwnPropertyDescriptor,
- Zh =
- Hh &&
- !(function () {
- if (void 0 !== this) return !0;
- try {
- Object.defineProperty([], 'length', { writable: !1 }).length = 1;
- } catch (t) {
- return t instanceof TypeError;
- }
- })(),
- Jh = Ct,
- Kh = TypeError,
- qh = Ar,
- Qh = Zt,
- $h = ei,
- tl = Nr,
- el = jr,
- rl = Zh
- ? function (t, e) {
- if (Wh(t) && !zh(t, 'length').writable)
- throw Yh('Cannot set read only .length');
- return (t.length = e);
- }
- : function (t, e) {
- return (t.length = e);
- },
- nl = Vr,
- il = Pn,
- ol = zr,
- sl = function (t, e) {
- if (!delete t[e])
- throw Kh('Cannot delete property ' + Jh(e) + ' of ' + Jh(t));
- },
- al = Mn('splice'),
- ul = Math.max,
- cl = Math.min;
- qh(
- { target: 'Array', proto: !0, forced: !al },
- {
- splice: function (t, e) {
- var r,
- n,
- i,
- o,
- s,
- a,
- u = Qh(this),
- c = el(u),
- h = $h(t, c),
- l = arguments.length;
- for (
- 0 === l
- ? (r = n = 0)
- : 1 === l
- ? ((r = 0), (n = c - h))
- : ((r = l - 2), (n = cl(ul(tl(e), 0), c - h))),
- nl(c + r - n),
- i = il(u, n),
- o = 0;
- o < n;
- o++
- )
- (s = h + o) in u && ol(i, o, u[s]);
- if (((i.length = n), r < n)) {
- for (o = h; o < c - n; o++)
- (a = o + r), (s = o + n) in u ? (u[a] = u[s]) : sl(u, a);
- for (o = c; o > c - n + r; o--) sl(u, o - 1);
- } else if (r > n)
- for (o = c - n; o > h; o--)
- (a = o + r - 1), (s = o + n - 1) in u ? (u[a] = u[s]) : sl(u, a);
- for (o = 0; o < r; o++) u[o + h] = arguments[o + 2];
- return rl(u, c - n + r), i;
- },
- }
- );
- var hl = sh('Array').splice,
- ll = ut,
- dl = hl,
- fl = Array.prototype,
- pl = function (t) {
- var e = t.splice;
- return t === fl || (ll(fl, t) && e === fl.splice) ? dl : e;
- },
- vl = Ar,
- ml = ts.find,
- yl = 'find',
- gl = !0;
- yl in [] &&
- Array(1).find(function () {
- gl = !1;
- }),
- vl(
- { target: 'Array', proto: !0, forced: gl },
- {
- find: function (t) {
- return ml(this, t, arguments.length > 1 ? arguments[1] : void 0);
- },
- }
- );
- var _l = sh('Array').find,
- bl = ut,
- Tl = _l,
- xl = Array.prototype,
- El = function (t) {
- var e = t.find;
- return t === xl || (bl(xl, t) && e === xl.find) ? Tl : e;
- },
- Sl = Zt,
- wl = yi;
- Ar(
- {
- target: 'Object',
- stat: !0,
- forced: s(function () {
- wl(1);
- }),
- },
- {
- keys: function (t) {
- return wl(Sl(t));
- },
- }
- );
- var Rl = rt.Object.keys,
- Cl = si.includes;
- Ar(
- {
- target: 'Array',
- proto: !0,
- forced: s(function () {
- return !Array(1).includes();
- }),
- },
- {
- includes: function (t) {
- return Cl(this, t, arguments.length > 1 ? arguments[1] : void 0);
- },
- }
- );
- var Pl = sh('Array').includes,
- Al = et,
- Ol = T,
- Il = fe('match'),
- Ml = function (t) {
- var e;
- return Al(t) && (void 0 !== (e = t[Il]) ? !!e : 'RegExp' == Ol(t));
- },
- Dl = TypeError,
- Ll = function (t) {
- if (Ml(t)) throw Dl("The method doesn't accept regular expressions");
- return t;
- },
- Fl = fe('match'),
- Nl = function (t) {
- var e = /./;
- try {
- '/./'[t](e);
- } catch (r) {
- try {
- return (e[Fl] = !1), '/./'[t](e);
- } catch (t) {}
- }
- return !1;
- },
- kl = Ar,
- Bl = Ll,
- Gl = J,
- Ul = Kn,
- jl = Nl,
- Xl = S(''.indexOf);
- kl(
- { target: 'String', proto: !0, forced: !jl('includes') },
- {
- includes: function (t) {
- return !!~Xl(
- Ul(Gl(this)),
- Ul(Bl(t)),
- arguments.length > 1 ? arguments[1] : void 0
- );
- },
- }
- );
- var Vl = sh('String').includes,
- Hl = ut,
- Wl = Pl,
- Yl = Vl,
- zl = Array.prototype,
- Zl = String.prototype,
- Jl = function (t) {
- var e = t.includes;
- return t === zl || (Hl(zl, t) && e === zl.includes)
- ? Wl
- : 'string' == typeof t || t === Zl || (Hl(Zl, t) && e === Zl.includes)
- ? Yl
- : e;
- },
- Kl = TypeError,
- ql = function (t, e) {
- if (t < e) throw Kl('Not enough arguments');
- return t;
- },
- Ql = o,
- $l = d,
- td = P,
- ed = xa,
- rd = ql,
- nd = /MSIE .\./.test(ct),
- id = Ql.Function,
- od = function (t) {
- return nd
- ? function (e, r) {
- var n = rd(arguments.length, 1) > 2,
- i = td(e) ? e : id(e),
- o = n ? ed(arguments, 2) : void 0;
- return t(
- n
- ? function () {
- $l(i, this, o);
- }
- : i,
- r
- );
- }
- : t;
- },
- sd = { setTimeout: od(Ql.setTimeout), setInterval: od(Ql.setInterval) },
- ad = sd.setInterval;
- Ar(
- { global: !0, bind: !0, forced: o.setInterval !== ad },
- { setInterval: ad }
- );
- var ud = sd.setTimeout;
- Ar({ global: !0, bind: !0, forced: o.setTimeout !== ud }, { setTimeout: ud });
- var cd = rt.setTimeout,
- hd = ts.map;
- Ar(
- { target: 'Array', proto: !0, forced: !Mn('map') },
- {
- map: function (t) {
- return hd(this, t, arguments.length > 1 ? arguments[1] : void 0);
- },
- }
- );
- var ld = sh('Array').map,
- dd = ut,
- fd = ld,
- pd = Array.prototype,
- vd = function (t) {
- var e = t.map;
- return t === pd || (dd(pd, t) && e === pd.map) ? fd : e;
- },
- md = ts.some;
- Ar(
- { target: 'Array', proto: !0, forced: !gh('some') },
- {
- some: function (t) {
- return md(this, t, arguments.length > 1 ? arguments[1] : void 0);
- },
- }
- );
- var yd = sh('Array').some,
- gd = ut,
- _d = yd,
- bd = Array.prototype,
- Td = function (t) {
- var e = t.some;
- return t === bd || (gd(bd, t) && e === bd.some) ? _d : e;
- },
- xd = function () {
- return (
- (xd =
- Object.assign ||
- function (t) {
- for (var e, r = 1, n = arguments.length; r < n; r++)
- for (var i in (e = arguments[r]))
- Object.prototype.hasOwnProperty.call(e, i) && (t[i] = e[i]);
- return t;
- }),
- xd.apply(this, arguments)
- );
- };
- function Ed(t, e, r, n) {
- return new (r || (r = Promise))(function (i, o) {
- function s(t) {
- try {
- u(n.next(t));
- } catch (t) {
- o(t);
- }
- }
- function a(t) {
- try {
- u(n.throw(t));
- } catch (t) {
- o(t);
- }
- }
- function u(t) {
- var e;
- t.done
- ? i(t.value)
- : ((e = t.value),
- e instanceof r
- ? e
- : new r(function (t) {
- t(e);
- })).then(s, a);
- }
- u((n = n.apply(t, e || [])).next());
- });
- }
- function Sd(t, e) {
- var r,
- n,
- i,
- o,
- s = {
- label: 0,
- sent: function () {
- if (1 & i[0]) throw i[1];
- return i[1];
- },
- trys: [],
- ops: [],
- };
- return (
- (o = { next: a(0), throw: a(1), return: a(2) }),
- 'function' == typeof Symbol &&
- (o[Symbol.iterator] = function () {
- return this;
- }),
- o
- );
- function a(o) {
- return function (a) {
- return (function (o) {
- if (r) throw new TypeError('Generator is already executing.');
- for (; s; )
- try {
- if (
- ((r = 1),
- n &&
- (i =
- 2 & o[0]
- ? n.return
- : o[0]
- ? n.throw || ((i = n.return) && i.call(n), 0)
- : n.next) &&
- !(i = i.call(n, o[1])).done)
- )
- return i;
- switch (((n = 0), i && (o = [2 & o[0], i.value]), o[0])) {
- case 0:
- case 1:
- i = o;
- break;
- case 4:
- return s.label++, { value: o[1], done: !1 };
- case 5:
- s.label++, (n = o[1]), (o = [0]);
- continue;
- case 7:
- (o = s.ops.pop()), s.trys.pop();
- continue;
- default:
- if (
- !((i = s.trys),
- (i = i.length > 0 && i[i.length - 1]) ||
- (6 !== o[0] && 2 !== o[0]))
- ) {
- s = 0;
- continue;
- }
- if (3 === o[0] && (!i || (o[1] > i[0] && o[1] < i[3]))) {
- s.label = o[1];
- break;
- }
- if (6 === o[0] && s.label < i[1]) {
- (s.label = i[1]), (i = o);
- break;
- }
- if (i && s.label < i[2]) {
- (s.label = i[2]), s.ops.push(o);
- break;
- }
- i[2] && s.ops.pop(), s.trys.pop();
- continue;
- }
- o = e.call(t, s);
- } catch (t) {
- (o = [6, t]), (n = 0);
- } finally {
- r = i = 0;
- }
- if (5 & o[0]) throw o[1];
- return { value: o[0] ? o[1] : void 0, done: !0 };
- })([o, a]);
- };
- }
- }
- function wd(t) {
- var e = 'function' == typeof Symbol && Symbol.iterator,
- r = e && t[e],
- n = 0;
- if (r) return r.call(t);
- if (t && 'number' == typeof t.length)
- return {
- next: function () {
- return (
- t && n >= t.length && (t = void 0), { value: t && t[n++], done: !t }
- );
- },
- };
- throw new TypeError(
- e ? 'Object is not iterable.' : 'Symbol.iterator is not defined.'
- );
- }
- function Rd(t, e) {
- var r = 'function' == typeof Symbol && t[Symbol.iterator];
- if (!r) return t;
- var n,
- i,
- o = r.call(t),
- s = [];
- try {
- for (; (void 0 === e || e-- > 0) && !(n = o.next()).done; )
- s.push(n.value);
- } catch (t) {
- i = { error: t };
- } finally {
- try {
- n && !n.done && (r = o.return) && r.call(o);
- } finally {
- if (i) throw i.error;
- }
- }
- return s;
- }
- let Cd = !0,
- Pd = !0;
- function Ad(t, e, r) {
- const n = t.match(e);
- return n && n.length >= r && parseInt(n[r], 10);
- }
- function Od(t, e, r) {
- if (!t.RTCPeerConnection) return;
- const n = t.RTCPeerConnection.prototype,
- i = n.addEventListener;
- n.addEventListener = function (t, n) {
- if (t !== e) return i.apply(this, arguments);
- const o = (t) => {
- const e = r(t);
- e && (n.handleEvent ? n.handleEvent(e) : n(e));
- };
- return (
- (this._eventMap = this._eventMap || {}),
- this._eventMap[e] || (this._eventMap[e] = new Map()),
- this._eventMap[e].set(n, o),
- i.apply(this, [t, o])
- );
- };
- const o = n.removeEventListener;
- (n.removeEventListener = function (t, r) {
- if (t !== e || !this._eventMap || !this._eventMap[e])
- return o.apply(this, arguments);
- if (!this._eventMap[e].has(r)) return o.apply(this, arguments);
- const n = this._eventMap[e].get(r);
- return (
- this._eventMap[e].delete(r),
- 0 === this._eventMap[e].size && delete this._eventMap[e],
- 0 === Object.keys(this._eventMap).length && delete this._eventMap,
- o.apply(this, [t, n])
- );
- }),
- Object.defineProperty(n, 'on' + e, {
- get() {
- return this['_on' + e];
- },
- set(t) {
- this['_on' + e] &&
- (this.removeEventListener(e, this['_on' + e]),
- delete this['_on' + e]),
- t && this.addEventListener(e, (this['_on' + e] = t));
- },
- enumerable: !0,
- configurable: !0,
- });
- }
- function Id(t) {
- return 'boolean' != typeof t
- ? new Error('Argument type: ' + typeof t + '. Please use a boolean.')
- : ((Cd = t),
- t ? 'adapter.js logging disabled' : 'adapter.js logging enabled');
- }
- function Md(t) {
- return 'boolean' != typeof t
- ? new Error('Argument type: ' + typeof t + '. Please use a boolean.')
- : ((Pd = !t),
- 'adapter.js deprecation warnings ' + (t ? 'disabled' : 'enabled'));
- }
- function Dd() {
- if ('object' == typeof window) {
- if (Cd) return;
- 'undefined' != typeof console &&
- 'function' == typeof console.log &&
- console.log.apply(console, arguments);
- }
- }
- function Ld(t, e) {
- Pd && console.warn(t + ' is deprecated, please use ' + e + ' instead.');
- }
- function Fd(t) {
- return '[object Object]' === Object.prototype.toString.call(t);
- }
- function Nd(t) {
- return Fd(t)
- ? Object.keys(t).reduce(function (e, r) {
- const n = Fd(t[r]),
- i = n ? Nd(t[r]) : t[r],
- o = n && !Object.keys(i).length;
- return void 0 === i || o ? e : Object.assign(e, { [r]: i });
- }, {})
- : t;
- }
- function kd(t, e, r) {
- e &&
- !r.has(e.id) &&
- (r.set(e.id, e),
- Object.keys(e).forEach((n) => {
- n.endsWith('Id')
- ? kd(t, t.get(e[n]), r)
- : n.endsWith('Ids') &&
- e[n].forEach((e) => {
- kd(t, t.get(e), r);
- });
- }));
- }
- function Bd(t, e, r) {
- const n = r ? 'outbound-rtp' : 'inbound-rtp',
- i = new Map();
- if (null === e) return i;
- const o = [];
- return (
- t.forEach((t) => {
- 'track' === t.type && t.trackIdentifier === e.id && o.push(t);
- }),
- o.forEach((e) => {
- t.forEach((r) => {
- r.type === n && r.trackId === e.id && kd(t, r, i);
- });
- }),
- i
- );
- }
- const Gd = Dd;
- function Ud(t, e) {
- const r = t && t.navigator;
- if (!r.mediaDevices) return;
- const n = function (t) {
- if ('object' != typeof t || t.mandatory || t.optional) return t;
- const e = {};
- return (
- Object.keys(t).forEach((r) => {
- if ('require' === r || 'advanced' === r || 'mediaSource' === r)
- return;
- const n = 'object' == typeof t[r] ? t[r] : { ideal: t[r] };
- void 0 !== n.exact &&
- 'number' == typeof n.exact &&
- (n.min = n.max = n.exact);
- const i = function (t, e) {
- return t
- ? t + e.charAt(0).toUpperCase() + e.slice(1)
- : 'deviceId' === e
- ? 'sourceId'
- : e;
- };
- if (void 0 !== n.ideal) {
- e.optional = e.optional || [];
- let t = {};
- 'number' == typeof n.ideal
- ? ((t[i('min', r)] = n.ideal),
- e.optional.push(t),
- (t = {}),
- (t[i('max', r)] = n.ideal),
- e.optional.push(t))
- : ((t[i('', r)] = n.ideal), e.optional.push(t));
- }
- void 0 !== n.exact && 'number' != typeof n.exact
- ? ((e.mandatory = e.mandatory || {}),
- (e.mandatory[i('', r)] = n.exact))
- : ['min', 'max'].forEach((t) => {
- void 0 !== n[t] &&
- ((e.mandatory = e.mandatory || {}),
- (e.mandatory[i(t, r)] = n[t]));
- });
- }),
- t.advanced && (e.optional = (e.optional || []).concat(t.advanced)),
- e
- );
- },
- i = function (t, i) {
- if (e.version >= 61) return i(t);
- if ((t = JSON.parse(JSON.stringify(t))) && 'object' == typeof t.audio) {
- const e = function (t, e, r) {
- e in t && !(r in t) && ((t[r] = t[e]), delete t[e]);
- };
- e(
- (t = JSON.parse(JSON.stringify(t))).audio,
- 'autoGainControl',
- 'googAutoGainControl'
- ),
- e(t.audio, 'noiseSuppression', 'googNoiseSuppression'),
- (t.audio = n(t.audio));
- }
- if (t && 'object' == typeof t.video) {
- let o = t.video.facingMode;
- o = o && ('object' == typeof o ? o : { ideal: o });
- const s = e.version < 66;
- if (
- o &&
- ('user' === o.exact ||
- 'environment' === o.exact ||
- 'user' === o.ideal ||
- 'environment' === o.ideal) &&
- (!r.mediaDevices.getSupportedConstraints ||
- !r.mediaDevices.getSupportedConstraints().facingMode ||
- s)
- ) {
- let e;
- if (
- (delete t.video.facingMode,
- 'environment' === o.exact || 'environment' === o.ideal
- ? (e = ['back', 'rear'])
- : ('user' !== o.exact && 'user' !== o.ideal) || (e = ['front']),
- e)
- )
- return r.mediaDevices.enumerateDevices().then((r) => {
- r = r.filter((t) => 'videoinput' === t.kind);
- let s = r.find((t) =>
- e.some((e) => t.label.toLowerCase().includes(e))
- );
- return (
- !s && r.length && e.includes('back') && (s = r[r.length - 1]),
- s &&
- (t.video.deviceId = o.exact
- ? { exact: s.deviceId }
- : { ideal: s.deviceId }),
- (t.video = n(t.video)),
- Gd('chrome: ' + JSON.stringify(t)),
- i(t)
- );
- });
- }
- t.video = n(t.video);
- }
- return Gd('chrome: ' + JSON.stringify(t)), i(t);
- },
- o = function (t) {
- return e.version >= 64
- ? t
- : {
- name:
- {
- PermissionDeniedError: 'NotAllowedError',
- PermissionDismissedError: 'NotAllowedError',
- InvalidStateError: 'NotAllowedError',
- DevicesNotFoundError: 'NotFoundError',
- ConstraintNotSatisfiedError: 'OverconstrainedError',
- TrackStartError: 'NotReadableError',
- MediaDeviceFailedDueToShutdown: 'NotAllowedError',
- MediaDeviceKillSwitchOn: 'NotAllowedError',
- TabCaptureError: 'AbortError',
- ScreenCaptureError: 'AbortError',
- DeviceCaptureError: 'AbortError',
- }[t.name] || t.name,
- message: t.message,
- constraint: t.constraint || t.constraintName,
- toString() {
- return this.name + (this.message && ': ') + this.message;
- },
- };
- };
- if (
- ((r.getUserMedia = function (t, e, n) {
- i(t, (t) => {
- r.webkitGetUserMedia(t, e, (t) => {
- n && n(o(t));
- });
- });
- }.bind(r)),
- r.mediaDevices.getUserMedia)
- ) {
- const t = r.mediaDevices.getUserMedia.bind(r.mediaDevices);
- r.mediaDevices.getUserMedia = function (e) {
- return i(e, (e) =>
- t(e).then(
- (t) => {
- if (
- (e.audio && !t.getAudioTracks().length) ||
- (e.video && !t.getVideoTracks().length)
- )
- throw (
- (t.getTracks().forEach((t) => {
- t.stop();
- }),
- new DOMException('', 'NotFoundError'))
- );
- return t;
- },
- (t) => Promise.reject(o(t))
- )
- );
- };
- }
- }
- function jd(t) {
- t.MediaStream = t.MediaStream || t.webkitMediaStream;
- }
- function Xd(t) {
- if (
- 'object' == typeof t &&
- t.RTCPeerConnection &&
- !('ontrack' in t.RTCPeerConnection.prototype)
- ) {
- Object.defineProperty(t.RTCPeerConnection.prototype, 'ontrack', {
- get() {
- return this._ontrack;
- },
- set(t) {
- this._ontrack && this.removeEventListener('track', this._ontrack),
- this.addEventListener('track', (this._ontrack = t));
- },
- enumerable: !0,
- configurable: !0,
- });
- const e = t.RTCPeerConnection.prototype.setRemoteDescription;
- t.RTCPeerConnection.prototype.setRemoteDescription = function () {
- return (
- this._ontrackpoly ||
- ((this._ontrackpoly = (e) => {
- e.stream.addEventListener('addtrack', (r) => {
- let n;
- n = t.RTCPeerConnection.prototype.getReceivers
- ? this.getReceivers().find(
- (t) => t.track && t.track.id === r.track.id
- )
- : { track: r.track };
- const i = new Event('track');
- (i.track = r.track),
- (i.receiver = n),
- (i.transceiver = { receiver: n }),
- (i.streams = [e.stream]),
- this.dispatchEvent(i);
- }),
- e.stream.getTracks().forEach((r) => {
- let n;
- n = t.RTCPeerConnection.prototype.getReceivers
- ? this.getReceivers().find(
- (t) => t.track && t.track.id === r.id
- )
- : { track: r };
- const i = new Event('track');
- (i.track = r),
- (i.receiver = n),
- (i.transceiver = { receiver: n }),
- (i.streams = [e.stream]),
- this.dispatchEvent(i);
- });
- }),
- this.addEventListener('addstream', this._ontrackpoly)),
- e.apply(this, arguments)
- );
- };
- } else
- Od(
- t,
- 'track',
- (t) => (
- t.transceiver ||
- Object.defineProperty(t, 'transceiver', {
- value: { receiver: t.receiver },
- }),
- t
- )
- );
- }
- function Vd(t) {
- if (
- 'object' == typeof t &&
- t.RTCPeerConnection &&
- !('getSenders' in t.RTCPeerConnection.prototype) &&
- 'createDTMFSender' in t.RTCPeerConnection.prototype
- ) {
- const e = function (t, e) {
- return {
- track: e,
- get dtmf() {
- return (
- void 0 === this._dtmf &&
- ('audio' === e.kind
- ? (this._dtmf = t.createDTMFSender(e))
- : (this._dtmf = null)),
- this._dtmf
- );
- },
- _pc: t,
- };
- };
- if (!t.RTCPeerConnection.prototype.getSenders) {
- t.RTCPeerConnection.prototype.getSenders = function () {
- return (this._senders = this._senders || []), this._senders.slice();
- };
- const r = t.RTCPeerConnection.prototype.addTrack;
- t.RTCPeerConnection.prototype.addTrack = function (t, n) {
- let i = r.apply(this, arguments);
- return i || ((i = e(this, t)), this._senders.push(i)), i;
- };
- const n = t.RTCPeerConnection.prototype.removeTrack;
- t.RTCPeerConnection.prototype.removeTrack = function (t) {
- n.apply(this, arguments);
- const e = this._senders.indexOf(t);
- -1 !== e && this._senders.splice(e, 1);
- };
- }
- const r = t.RTCPeerConnection.prototype.addStream;
- t.RTCPeerConnection.prototype.addStream = function (t) {
- (this._senders = this._senders || []),
- r.apply(this, [t]),
- t.getTracks().forEach((t) => {
- this._senders.push(e(this, t));
- });
- };
- const n = t.RTCPeerConnection.prototype.removeStream;
- t.RTCPeerConnection.prototype.removeStream = function (t) {
- (this._senders = this._senders || []),
- n.apply(this, [t]),
- t.getTracks().forEach((t) => {
- const e = this._senders.find((e) => e.track === t);
- e && this._senders.splice(this._senders.indexOf(e), 1);
- });
- };
- } else if (
- 'object' == typeof t &&
- t.RTCPeerConnection &&
- 'getSenders' in t.RTCPeerConnection.prototype &&
- 'createDTMFSender' in t.RTCPeerConnection.prototype &&
- t.RTCRtpSender &&
- !('dtmf' in t.RTCRtpSender.prototype)
- ) {
- const e = t.RTCPeerConnection.prototype.getSenders;
- (t.RTCPeerConnection.prototype.getSenders = function () {
- const t = e.apply(this, []);
- return t.forEach((t) => (t._pc = this)), t;
- }),
- Object.defineProperty(t.RTCRtpSender.prototype, 'dtmf', {
- get() {
- return (
- void 0 === this._dtmf &&
- ('audio' === this.track.kind
- ? (this._dtmf = this._pc.createDTMFSender(this.track))
- : (this._dtmf = null)),
- this._dtmf
- );
- },
- });
- }
- }
- function Hd(t) {
- if (!t.RTCPeerConnection) return;
- const e = t.RTCPeerConnection.prototype.getStats;
- t.RTCPeerConnection.prototype.getStats = function () {
- const [t, r, n] = arguments;
- if (arguments.length > 0 && 'function' == typeof t)
- return e.apply(this, arguments);
- if (0 === e.length && (0 === arguments.length || 'function' != typeof t))
- return e.apply(this, []);
- const i = function (t) {
- const e = {};
- return (
- t.result().forEach((t) => {
- const r = {
- id: t.id,
- timestamp: t.timestamp,
- type:
- {
- localcandidate: 'local-candidate',
- remotecandidate: 'remote-candidate',
- }[t.type] || t.type,
- };
- t.names().forEach((e) => {
- r[e] = t.stat(e);
- }),
- (e[r.id] = r);
- }),
- e
- );
- },
- o = function (t) {
- return new Map(Object.keys(t).map((e) => [e, t[e]]));
- };
- if (arguments.length >= 2) {
- const n = function (t) {
- r(o(i(t)));
- };
- return e.apply(this, [n, t]);
- }
- return new Promise((t, r) => {
- e.apply(this, [
- function (e) {
- t(o(i(e)));
- },
- r,
- ]);
- }).then(r, n);
- };
- }
- function Wd(t) {
- if (
- !(
- 'object' == typeof t &&
- t.RTCPeerConnection &&
- t.RTCRtpSender &&
- t.RTCRtpReceiver
- )
- )
- return;
- if (!('getStats' in t.RTCRtpSender.prototype)) {
- const e = t.RTCPeerConnection.prototype.getSenders;
- e &&
- (t.RTCPeerConnection.prototype.getSenders = function () {
- const t = e.apply(this, []);
- return t.forEach((t) => (t._pc = this)), t;
- });
- const r = t.RTCPeerConnection.prototype.addTrack;
- r &&
- (t.RTCPeerConnection.prototype.addTrack = function () {
- const t = r.apply(this, arguments);
- return (t._pc = this), t;
- }),
- (t.RTCRtpSender.prototype.getStats = function () {
- const t = this;
- return this._pc.getStats().then((e) => Bd(e, t.track, !0));
- });
- }
- if (!('getStats' in t.RTCRtpReceiver.prototype)) {
- const e = t.RTCPeerConnection.prototype.getReceivers;
- e &&
- (t.RTCPeerConnection.prototype.getReceivers = function () {
- const t = e.apply(this, []);
- return t.forEach((t) => (t._pc = this)), t;
- }),
- Od(t, 'track', (t) => ((t.receiver._pc = t.srcElement), t)),
- (t.RTCRtpReceiver.prototype.getStats = function () {
- const t = this;
- return this._pc.getStats().then((e) => Bd(e, t.track, !1));
- });
- }
- if (
- !('getStats' in t.RTCRtpSender.prototype) ||
- !('getStats' in t.RTCRtpReceiver.prototype)
- )
- return;
- const e = t.RTCPeerConnection.prototype.getStats;
- t.RTCPeerConnection.prototype.getStats = function () {
- if (arguments.length > 0 && arguments[0] instanceof t.MediaStreamTrack) {
- const t = arguments[0];
- let e, r, n;
- return (
- this.getSenders().forEach((r) => {
- r.track === t && (e ? (n = !0) : (e = r));
- }),
- this.getReceivers().forEach(
- (e) => (e.track === t && (r ? (n = !0) : (r = e)), e.track === t)
- ),
- n || (e && r)
- ? Promise.reject(
- new DOMException(
- 'There are more than one sender or receiver for the track.',
- 'InvalidAccessError'
- )
- )
- : e
- ? e.getStats()
- : r
- ? r.getStats()
- : Promise.reject(
- new DOMException(
- 'There is no sender or receiver for the track.',
- 'InvalidAccessError'
- )
- )
- );
- }
- return e.apply(this, arguments);
- };
- }
- function Yd(t) {
- t.RTCPeerConnection.prototype.getLocalStreams = function () {
- return (
- (this._shimmedLocalStreams = this._shimmedLocalStreams || {}),
- Object.keys(this._shimmedLocalStreams).map(
- (t) => this._shimmedLocalStreams[t][0]
- )
- );
- };
- const e = t.RTCPeerConnection.prototype.addTrack;
- t.RTCPeerConnection.prototype.addTrack = function (t, r) {
- if (!r) return e.apply(this, arguments);
- this._shimmedLocalStreams = this._shimmedLocalStreams || {};
- const n = e.apply(this, arguments);
- return (
- this._shimmedLocalStreams[r.id]
- ? -1 === this._shimmedLocalStreams[r.id].indexOf(n) &&
- this._shimmedLocalStreams[r.id].push(n)
- : (this._shimmedLocalStreams[r.id] = [r, n]),
- n
- );
- };
- const r = t.RTCPeerConnection.prototype.addStream;
- t.RTCPeerConnection.prototype.addStream = function (t) {
- (this._shimmedLocalStreams = this._shimmedLocalStreams || {}),
- t.getTracks().forEach((t) => {
- const e = this.getSenders().find((e) => e.track === t);
- if (e)
- throw new DOMException(
- 'Track already exists.',
- 'InvalidAccessError'
- );
- });
- const e = this.getSenders();
- r.apply(this, arguments);
- const n = this.getSenders().filter((t) => -1 === e.indexOf(t));
- this._shimmedLocalStreams[t.id] = [t].concat(n);
- };
- const n = t.RTCPeerConnection.prototype.removeStream;
- t.RTCPeerConnection.prototype.removeStream = function (t) {
- return (
- (this._shimmedLocalStreams = this._shimmedLocalStreams || {}),
- delete this._shimmedLocalStreams[t.id],
- n.apply(this, arguments)
- );
- };
- const i = t.RTCPeerConnection.prototype.removeTrack;
- t.RTCPeerConnection.prototype.removeTrack = function (t) {
- return (
- (this._shimmedLocalStreams = this._shimmedLocalStreams || {}),
- t &&
- Object.keys(this._shimmedLocalStreams).forEach((e) => {
- const r = this._shimmedLocalStreams[e].indexOf(t);
- -1 !== r && this._shimmedLocalStreams[e].splice(r, 1),
- 1 === this._shimmedLocalStreams[e].length &&
- delete this._shimmedLocalStreams[e];
- }),
- i.apply(this, arguments)
- );
- };
- }
- function zd(t, e) {
- if (!t.RTCPeerConnection) return;
- if (t.RTCPeerConnection.prototype.addTrack && e.version >= 65) return Yd(t);
- const r = t.RTCPeerConnection.prototype.getLocalStreams;
- t.RTCPeerConnection.prototype.getLocalStreams = function () {
- const t = r.apply(this);
- return (
- (this._reverseStreams = this._reverseStreams || {}),
- t.map((t) => this._reverseStreams[t.id])
- );
- };
- const n = t.RTCPeerConnection.prototype.addStream;
- t.RTCPeerConnection.prototype.addStream = function (e) {
- if (
- ((this._streams = this._streams || {}),
- (this._reverseStreams = this._reverseStreams || {}),
- e.getTracks().forEach((t) => {
- const e = this.getSenders().find((e) => e.track === t);
- if (e)
- throw new DOMException(
- 'Track already exists.',
- 'InvalidAccessError'
- );
- }),
- !this._reverseStreams[e.id])
- ) {
- const r = new t.MediaStream(e.getTracks());
- (this._streams[e.id] = r), (this._reverseStreams[r.id] = e), (e = r);
- }
- n.apply(this, [e]);
- };
- const i = t.RTCPeerConnection.prototype.removeStream;
- function o(t, e) {
- let r = e.sdp;
- return (
- Object.keys(t._reverseStreams || []).forEach((e) => {
- const n = t._reverseStreams[e],
- i = t._streams[n.id];
- r = r.replace(new RegExp(i.id, 'g'), n.id);
- }),
- new RTCSessionDescription({ type: e.type, sdp: r })
- );
- }
- function s(t, e) {
- let r = e.sdp;
- return (
- Object.keys(t._reverseStreams || []).forEach((e) => {
- const n = t._reverseStreams[e],
- i = t._streams[n.id];
- r = r.replace(new RegExp(n.id, 'g'), i.id);
- }),
- new RTCSessionDescription({ type: e.type, sdp: r })
- );
- }
- (t.RTCPeerConnection.prototype.removeStream = function (t) {
- (this._streams = this._streams || {}),
- (this._reverseStreams = this._reverseStreams || {}),
- i.apply(this, [this._streams[t.id] || t]),
- delete this._reverseStreams[
- this._streams[t.id] ? this._streams[t.id].id : t.id
- ],
- delete this._streams[t.id];
- }),
- (t.RTCPeerConnection.prototype.addTrack = function (e, r) {
- if ('closed' === this.signalingState)
- throw new DOMException(
- "The RTCPeerConnection's signalingState is 'closed'.",
- 'InvalidStateError'
- );
- const n = [].slice.call(arguments, 1);
- if (1 !== n.length || !n[0].getTracks().find((t) => t === e))
- throw new DOMException(
- 'The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.',
- 'NotSupportedError'
- );
- const i = this.getSenders().find((t) => t.track === e);
- if (i)
- throw new DOMException('Track already exists.', 'InvalidAccessError');
- (this._streams = this._streams || {}),
- (this._reverseStreams = this._reverseStreams || {});
- const o = this._streams[r.id];
- if (o)
- o.addTrack(e),
- Promise.resolve().then(() => {
- this.dispatchEvent(new Event('negotiationneeded'));
- });
- else {
- const n = new t.MediaStream([e]);
- (this._streams[r.id] = n),
- (this._reverseStreams[n.id] = r),
- this.addStream(n);
- }
- return this.getSenders().find((t) => t.track === e);
- }),
- ['createOffer', 'createAnswer'].forEach(function (e) {
- const r = t.RTCPeerConnection.prototype[e],
- n = {
- [e]() {
- const t = arguments;
- return arguments.length && 'function' == typeof arguments[0]
- ? r.apply(this, [
- (e) => {
- const r = o(this, e);
- t[0].apply(null, [r]);
- },
- (e) => {
- t[1] && t[1].apply(null, e);
- },
- arguments[2],
- ])
- : r.apply(this, arguments).then((t) => o(this, t));
- },
- };
- t.RTCPeerConnection.prototype[e] = n[e];
- });
- const a = t.RTCPeerConnection.prototype.setLocalDescription;
- t.RTCPeerConnection.prototype.setLocalDescription = function () {
- return arguments.length && arguments[0].type
- ? ((arguments[0] = s(this, arguments[0])), a.apply(this, arguments))
- : a.apply(this, arguments);
- };
- const u = Object.getOwnPropertyDescriptor(
- t.RTCPeerConnection.prototype,
- 'localDescription'
- );
- Object.defineProperty(t.RTCPeerConnection.prototype, 'localDescription', {
- get() {
- const t = u.get.apply(this);
- return '' === t.type ? t : o(this, t);
- },
- }),
- (t.RTCPeerConnection.prototype.removeTrack = function (t) {
- if ('closed' === this.signalingState)
- throw new DOMException(
- "The RTCPeerConnection's signalingState is 'closed'.",
- 'InvalidStateError'
- );
- if (!t._pc)
- throw new DOMException(
- 'Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.',
- 'TypeError'
- );
- if (!(t._pc === this))
- throw new DOMException(
- 'Sender was not created by this connection.',
- 'InvalidAccessError'
- );
- let e;
- (this._streams = this._streams || {}),
- Object.keys(this._streams).forEach((r) => {
- this._streams[r].getTracks().find((e) => t.track === e) &&
- (e = this._streams[r]);
- }),
- e &&
- (1 === e.getTracks().length
- ? this.removeStream(this._reverseStreams[e.id])
- : e.removeTrack(t.track),
- this.dispatchEvent(new Event('negotiationneeded')));
- });
- }
- function Zd(t, e) {
- !t.RTCPeerConnection &&
- t.webkitRTCPeerConnection &&
- (t.RTCPeerConnection = t.webkitRTCPeerConnection),
- t.RTCPeerConnection &&
- e.version < 53 &&
- [
- 'setLocalDescription',
- 'setRemoteDescription',
- 'addIceCandidate',
- ].forEach(function (e) {
- const r = t.RTCPeerConnection.prototype[e],
- n = {
- [e]() {
- return (
- (arguments[0] = new (
- 'addIceCandidate' === e
- ? t.RTCIceCandidate
- : t.RTCSessionDescription
- )(arguments[0])),
- r.apply(this, arguments)
- );
- },
- };
- t.RTCPeerConnection.prototype[e] = n[e];
- });
- }
- function Jd(t, e) {
- Od(t, 'negotiationneeded', (t) => {
- const r = t.target;
- if (
- !(
- e.version < 72 ||
- (r.getConfiguration && 'plan-b' === r.getConfiguration().sdpSemantics)
- ) ||
- 'stable' === r.signalingState
- )
- return t;
- });
- }
- var Kd = Object.freeze({
- __proto__: null,
- shimMediaStream: jd,
- shimOnTrack: Xd,
- shimGetSendersWithDtmf: Vd,
- shimGetStats: Hd,
- shimSenderReceiverGetStats: Wd,
- shimAddTrackRemoveTrackWithNative: Yd,
- shimAddTrackRemoveTrack: zd,
- shimPeerConnection: Zd,
- fixNegotiationNeeded: Jd,
- shimGetUserMedia: Ud,
- shimGetDisplayMedia: function (t, e) {
- (t.navigator.mediaDevices &&
- 'getDisplayMedia' in t.navigator.mediaDevices) ||
- (t.navigator.mediaDevices &&
- ('function' == typeof e
- ? (t.navigator.mediaDevices.getDisplayMedia = function (r) {
- return e(r).then((e) => {
- const n = r.video && r.video.width,
- i = r.video && r.video.height,
- o = r.video && r.video.frameRate;
- return (
- (r.video = {
- mandatory: {
- chromeMediaSource: 'desktop',
- chromeMediaSourceId: e,
- maxFrameRate: o || 3,
- },
- }),
- n && (r.video.mandatory.maxWidth = n),
- i && (r.video.mandatory.maxHeight = i),
- t.navigator.mediaDevices.getUserMedia(r)
- );
- });
- })
- : console.error(
- 'shimGetDisplayMedia: getSourceId argument is not a function'
- )));
- },
- });
- function qd(t, e) {
- const r = t && t.navigator,
- n = t && t.MediaStreamTrack;
- if (
- ((r.getUserMedia = function (t, e, n) {
- Ld('navigator.getUserMedia', 'navigator.mediaDevices.getUserMedia'),
- r.mediaDevices.getUserMedia(t).then(e, n);
- }),
- !(
- e.version > 55 &&
- 'autoGainControl' in r.mediaDevices.getSupportedConstraints()
- ))
- ) {
- const t = function (t, e, r) {
- e in t && !(r in t) && ((t[r] = t[e]), delete t[e]);
- },
- e = r.mediaDevices.getUserMedia.bind(r.mediaDevices);
- if (
- ((r.mediaDevices.getUserMedia = function (r) {
- return (
- 'object' == typeof r &&
- 'object' == typeof r.audio &&
- ((r = JSON.parse(JSON.stringify(r))),
- t(r.audio, 'autoGainControl', 'mozAutoGainControl'),
- t(r.audio, 'noiseSuppression', 'mozNoiseSuppression')),
- e(r)
- );
- }),
- n && n.prototype.getSettings)
- ) {
- const e = n.prototype.getSettings;
- n.prototype.getSettings = function () {
- const r = e.apply(this, arguments);
- return (
- t(r, 'mozAutoGainControl', 'autoGainControl'),
- t(r, 'mozNoiseSuppression', 'noiseSuppression'),
- r
- );
- };
- }
- if (n && n.prototype.applyConstraints) {
- const e = n.prototype.applyConstraints;
- n.prototype.applyConstraints = function (r) {
- return (
- 'audio' === this.kind &&
- 'object' == typeof r &&
- ((r = JSON.parse(JSON.stringify(r))),
- t(r, 'autoGainControl', 'mozAutoGainControl'),
- t(r, 'noiseSuppression', 'mozNoiseSuppression')),
- e.apply(this, [r])
- );
- };
- }
- }
- }
- function Qd(t) {
- 'object' == typeof t &&
- t.RTCTrackEvent &&
- 'receiver' in t.RTCTrackEvent.prototype &&
- !('transceiver' in t.RTCTrackEvent.prototype) &&
- Object.defineProperty(t.RTCTrackEvent.prototype, 'transceiver', {
- get() {
- return { receiver: this.receiver };
- },
- });
- }
- function $d(t, e) {
- if (
- 'object' != typeof t ||
- (!t.RTCPeerConnection && !t.mozRTCPeerConnection)
- )
- return;
- !t.RTCPeerConnection &&
- t.mozRTCPeerConnection &&
- (t.RTCPeerConnection = t.mozRTCPeerConnection),
- e.version < 53 &&
- [
- 'setLocalDescription',
- 'setRemoteDescription',
- 'addIceCandidate',
- ].forEach(function (e) {
- const r = t.RTCPeerConnection.prototype[e],
- n = {
- [e]() {
- return (
- (arguments[0] = new (
- 'addIceCandidate' === e
- ? t.RTCIceCandidate
- : t.RTCSessionDescription
- )(arguments[0])),
- r.apply(this, arguments)
- );
- },
- };
- t.RTCPeerConnection.prototype[e] = n[e];
- });
- const r = {
- inboundrtp: 'inbound-rtp',
- outboundrtp: 'outbound-rtp',
- candidatepair: 'candidate-pair',
- localcandidate: 'local-candidate',
- remotecandidate: 'remote-candidate',
- },
- n = t.RTCPeerConnection.prototype.getStats;
- t.RTCPeerConnection.prototype.getStats = function () {
- const [t, i, o] = arguments;
- return n
- .apply(this, [t || null])
- .then((t) => {
- if (e.version < 53 && !i)
- try {
- t.forEach((t) => {
- t.type = r[t.type] || t.type;
- });
- } catch (e) {
- if ('TypeError' !== e.name) throw e;
- t.forEach((e, n) => {
- t.set(n, Object.assign({}, e, { type: r[e.type] || e.type }));
- });
- }
- return t;
- })
- .then(i, o);
- };
- }
- function tf(t) {
- if ('object' != typeof t || !t.RTCPeerConnection || !t.RTCRtpSender) return;
- if (t.RTCRtpSender && 'getStats' in t.RTCRtpSender.prototype) return;
- const e = t.RTCPeerConnection.prototype.getSenders;
- e &&
- (t.RTCPeerConnection.prototype.getSenders = function () {
- const t = e.apply(this, []);
- return t.forEach((t) => (t._pc = this)), t;
- });
- const r = t.RTCPeerConnection.prototype.addTrack;
- r &&
- (t.RTCPeerConnection.prototype.addTrack = function () {
- const t = r.apply(this, arguments);
- return (t._pc = this), t;
- }),
- (t.RTCRtpSender.prototype.getStats = function () {
- return this.track
- ? this._pc.getStats(this.track)
- : Promise.resolve(new Map());
- });
- }
- function ef(t) {
- if ('object' != typeof t || !t.RTCPeerConnection || !t.RTCRtpSender) return;
- if (t.RTCRtpSender && 'getStats' in t.RTCRtpReceiver.prototype) return;
- const e = t.RTCPeerConnection.prototype.getReceivers;
- e &&
- (t.RTCPeerConnection.prototype.getReceivers = function () {
- const t = e.apply(this, []);
- return t.forEach((t) => (t._pc = this)), t;
- }),
- Od(t, 'track', (t) => ((t.receiver._pc = t.srcElement), t)),
- (t.RTCRtpReceiver.prototype.getStats = function () {
- return this._pc.getStats(this.track);
- });
- }
- function rf(t) {
- t.RTCPeerConnection &&
- !('removeStream' in t.RTCPeerConnection.prototype) &&
- (t.RTCPeerConnection.prototype.removeStream = function (t) {
- Ld('removeStream', 'removeTrack'),
- this.getSenders().forEach((e) => {
- e.track && t.getTracks().includes(e.track) && this.removeTrack(e);
- });
- });
- }
- function nf(t) {
- t.DataChannel && !t.RTCDataChannel && (t.RTCDataChannel = t.DataChannel);
- }
- function of(t) {
- if ('object' != typeof t || !t.RTCPeerConnection) return;
- const e = t.RTCPeerConnection.prototype.addTransceiver;
- e &&
- (t.RTCPeerConnection.prototype.addTransceiver = function () {
- this.setParametersPromises = [];
- let t = arguments[1] && arguments[1].sendEncodings;
- void 0 === t && (t = []), (t = [...t]);
- const r = t.length > 0;
- r &&
- t.forEach((t) => {
- if ('rid' in t) {
- if (!/^[a-z0-9]{0,16}$/i.test(t.rid))
- throw new TypeError('Invalid RID value provided.');
- }
- if (
- 'scaleResolutionDownBy' in t &&
- !(parseFloat(t.scaleResolutionDownBy) >= 1)
- )
- throw new RangeError('scale_resolution_down_by must be >= 1.0');
- if ('maxFramerate' in t && !(parseFloat(t.maxFramerate) >= 0))
- throw new RangeError('max_framerate must be >= 0.0');
- });
- const n = e.apply(this, arguments);
- if (r) {
- const { sender: e } = n,
- r = e.getParameters();
- (!('encodings' in r) ||
- (1 === r.encodings.length &&
- 0 === Object.keys(r.encodings[0]).length)) &&
- ((r.encodings = t),
- (e.sendEncodings = t),
- this.setParametersPromises.push(
- e
- .setParameters(r)
- .then(() => {
- delete e.sendEncodings;
- })
- .catch(() => {
- delete e.sendEncodings;
- })
- ));
- }
- return n;
- });
- }
- function sf(t) {
- if ('object' != typeof t || !t.RTCRtpSender) return;
- const e = t.RTCRtpSender.prototype.getParameters;
- e &&
- (t.RTCRtpSender.prototype.getParameters = function () {
- const t = e.apply(this, arguments);
- return (
- 'encodings' in t ||
- (t.encodings = [].concat(this.sendEncodings || [{}])),
- t
- );
- });
- }
- function af(t) {
- if ('object' != typeof t || !t.RTCPeerConnection) return;
- const e = t.RTCPeerConnection.prototype.createOffer;
- t.RTCPeerConnection.prototype.createOffer = function () {
- return this.setParametersPromises && this.setParametersPromises.length
- ? Promise.all(this.setParametersPromises)
- .then(() => e.apply(this, arguments))
- .finally(() => {
- this.setParametersPromises = [];
- })
- : e.apply(this, arguments);
- };
- }
- function uf(t) {
- if ('object' != typeof t || !t.RTCPeerConnection) return;
- const e = t.RTCPeerConnection.prototype.createAnswer;
- t.RTCPeerConnection.prototype.createAnswer = function () {
- return this.setParametersPromises && this.setParametersPromises.length
- ? Promise.all(this.setParametersPromises)
- .then(() => e.apply(this, arguments))
- .finally(() => {
- this.setParametersPromises = [];
- })
- : e.apply(this, arguments);
- };
- }
- var cf = Object.freeze({
- __proto__: null,
- shimOnTrack: Qd,
- shimPeerConnection: $d,
- shimSenderGetStats: tf,
- shimReceiverGetStats: ef,
- shimRemoveStream: rf,
- shimRTCDataChannel: nf,
- shimAddTransceiver: of,
- shimGetParameters: sf,
- shimCreateOffer: af,
- shimCreateAnswer: uf,
- shimGetUserMedia: qd,
- shimGetDisplayMedia: function (t, e) {
- (t.navigator.mediaDevices &&
- 'getDisplayMedia' in t.navigator.mediaDevices) ||
- (t.navigator.mediaDevices &&
- (t.navigator.mediaDevices.getDisplayMedia = function (r) {
- if (!r || !r.video) {
- const t = new DOMException(
- 'getDisplayMedia without video constraints is undefined'
- );
- return (
- (t.name = 'NotFoundError'), (t.code = 8), Promise.reject(t)
- );
- }
- return (
- !0 === r.video
- ? (r.video = { mediaSource: e })
- : (r.video.mediaSource = e),
- t.navigator.mediaDevices.getUserMedia(r)
- );
- }));
- },
- });
- function hf(t) {
- if ('object' == typeof t && t.RTCPeerConnection) {
- if (
- ('getLocalStreams' in t.RTCPeerConnection.prototype ||
- (t.RTCPeerConnection.prototype.getLocalStreams = function () {
- return (
- this._localStreams || (this._localStreams = []),
- this._localStreams
- );
- }),
- !('addStream' in t.RTCPeerConnection.prototype))
- ) {
- const e = t.RTCPeerConnection.prototype.addTrack;
- (t.RTCPeerConnection.prototype.addStream = function (t) {
- this._localStreams || (this._localStreams = []),
- this._localStreams.includes(t) || this._localStreams.push(t),
- t.getAudioTracks().forEach((r) => e.call(this, r, t)),
- t.getVideoTracks().forEach((r) => e.call(this, r, t));
- }),
- (t.RTCPeerConnection.prototype.addTrack = function (t, ...r) {
- return (
- r &&
- r.forEach((t) => {
- this._localStreams
- ? this._localStreams.includes(t) ||
- this._localStreams.push(t)
- : (this._localStreams = [t]);
- }),
- e.apply(this, arguments)
- );
- });
- }
- 'removeStream' in t.RTCPeerConnection.prototype ||
- (t.RTCPeerConnection.prototype.removeStream = function (t) {
- this._localStreams || (this._localStreams = []);
- const e = this._localStreams.indexOf(t);
- if (-1 === e) return;
- this._localStreams.splice(e, 1);
- const r = t.getTracks();
- this.getSenders().forEach((t) => {
- r.includes(t.track) && this.removeTrack(t);
- });
- });
- }
- }
- function lf(t) {
- if (
- 'object' == typeof t &&
- t.RTCPeerConnection &&
- ('getRemoteStreams' in t.RTCPeerConnection.prototype ||
- (t.RTCPeerConnection.prototype.getRemoteStreams = function () {
- return this._remoteStreams ? this._remoteStreams : [];
- }),
- !('onaddstream' in t.RTCPeerConnection.prototype))
- ) {
- Object.defineProperty(t.RTCPeerConnection.prototype, 'onaddstream', {
- get() {
- return this._onaddstream;
- },
- set(t) {
- this._onaddstream &&
- (this.removeEventListener('addstream', this._onaddstream),
- this.removeEventListener('track', this._onaddstreampoly)),
- this.addEventListener('addstream', (this._onaddstream = t)),
- this.addEventListener(
- 'track',
- (this._onaddstreampoly = (t) => {
- t.streams.forEach((t) => {
- if (
- (this._remoteStreams || (this._remoteStreams = []),
- this._remoteStreams.includes(t))
- )
- return;
- this._remoteStreams.push(t);
- const e = new Event('addstream');
- (e.stream = t), this.dispatchEvent(e);
- });
- })
- );
- },
- });
- const e = t.RTCPeerConnection.prototype.setRemoteDescription;
- t.RTCPeerConnection.prototype.setRemoteDescription = function () {
- const t = this;
- return (
- this._onaddstreampoly ||
- this.addEventListener(
- 'track',
- (this._onaddstreampoly = function (e) {
- e.streams.forEach((e) => {
- if (
- (t._remoteStreams || (t._remoteStreams = []),
- t._remoteStreams.indexOf(e) >= 0)
- )
- return;
- t._remoteStreams.push(e);
- const r = new Event('addstream');
- (r.stream = e), t.dispatchEvent(r);
- });
- })
- ),
- e.apply(t, arguments)
- );
- };
- }
- }
- function df(t) {
- if ('object' != typeof t || !t.RTCPeerConnection) return;
- const e = t.RTCPeerConnection.prototype,
- r = e.createOffer,
- n = e.createAnswer,
- i = e.setLocalDescription,
- o = e.setRemoteDescription,
- s = e.addIceCandidate;
- (e.createOffer = function (t, e) {
- const n = arguments.length >= 2 ? arguments[2] : arguments[0],
- i = r.apply(this, [n]);
- return e ? (i.then(t, e), Promise.resolve()) : i;
- }),
- (e.createAnswer = function (t, e) {
- const r = arguments.length >= 2 ? arguments[2] : arguments[0],
- i = n.apply(this, [r]);
- return e ? (i.then(t, e), Promise.resolve()) : i;
- });
- let a = function (t, e, r) {
- const n = i.apply(this, [t]);
- return r ? (n.then(e, r), Promise.resolve()) : n;
- };
- (e.setLocalDescription = a),
- (a = function (t, e, r) {
- const n = o.apply(this, [t]);
- return r ? (n.then(e, r), Promise.resolve()) : n;
- }),
- (e.setRemoteDescription = a),
- (a = function (t, e, r) {
- const n = s.apply(this, [t]);
- return r ? (n.then(e, r), Promise.resolve()) : n;
- }),
- (e.addIceCandidate = a);
- }
- function ff(t) {
- const e = t && t.navigator;
- if (e.mediaDevices && e.mediaDevices.getUserMedia) {
- const t = e.mediaDevices,
- r = t.getUserMedia.bind(t);
- e.mediaDevices.getUserMedia = (t) => r(pf(t));
- }
- !e.getUserMedia &&
- e.mediaDevices &&
- e.mediaDevices.getUserMedia &&
- (e.getUserMedia = function (t, r, n) {
- e.mediaDevices.getUserMedia(t).then(r, n);
- }.bind(e));
- }
- function pf(t) {
- return t && void 0 !== t.video
- ? Object.assign({}, t, { video: Nd(t.video) })
- : t;
- }
- function vf(t) {
- if (!t.RTCPeerConnection) return;
- const e = t.RTCPeerConnection;
- (t.RTCPeerConnection = function (t, r) {
- if (t && t.iceServers) {
- const e = [];
- for (let r = 0; r < t.iceServers.length; r++) {
- let n = t.iceServers[r];
- void 0 === n.urls && n.url
- ? (Ld('RTCIceServer.url', 'RTCIceServer.urls'),
- (n = JSON.parse(JSON.stringify(n))),
- (n.urls = n.url),
- delete n.url,
- e.push(n))
- : e.push(t.iceServers[r]);
- }
- t.iceServers = e;
- }
- return new e(t, r);
- }),
- (t.RTCPeerConnection.prototype = e.prototype),
- 'generateCertificate' in e &&
- Object.defineProperty(t.RTCPeerConnection, 'generateCertificate', {
- get: () => e.generateCertificate,
- });
- }
- function mf(t) {
- 'object' == typeof t &&
- t.RTCTrackEvent &&
- 'receiver' in t.RTCTrackEvent.prototype &&
- !('transceiver' in t.RTCTrackEvent.prototype) &&
- Object.defineProperty(t.RTCTrackEvent.prototype, 'transceiver', {
- get() {
- return { receiver: this.receiver };
- },
- });
- }
- function yf(t) {
- const e = t.RTCPeerConnection.prototype.createOffer;
- t.RTCPeerConnection.prototype.createOffer = function (t) {
- if (t) {
- void 0 !== t.offerToReceiveAudio &&
- (t.offerToReceiveAudio = !!t.offerToReceiveAudio);
- const e = this.getTransceivers().find(
- (t) => 'audio' === t.receiver.track.kind
- );
- !1 === t.offerToReceiveAudio && e
- ? 'sendrecv' === e.direction
- ? e.setDirection
- ? e.setDirection('sendonly')
- : (e.direction = 'sendonly')
- : 'recvonly' === e.direction &&
- (e.setDirection
- ? e.setDirection('inactive')
- : (e.direction = 'inactive'))
- : !0 !== t.offerToReceiveAudio ||
- e ||
- this.addTransceiver('audio', { direction: 'recvonly' }),
- void 0 !== t.offerToReceiveVideo &&
- (t.offerToReceiveVideo = !!t.offerToReceiveVideo);
- const r = this.getTransceivers().find(
- (t) => 'video' === t.receiver.track.kind
- );
- !1 === t.offerToReceiveVideo && r
- ? 'sendrecv' === r.direction
- ? r.setDirection
- ? r.setDirection('sendonly')
- : (r.direction = 'sendonly')
- : 'recvonly' === r.direction &&
- (r.setDirection
- ? r.setDirection('inactive')
- : (r.direction = 'inactive'))
- : !0 !== t.offerToReceiveVideo ||
- r ||
- this.addTransceiver('video', { direction: 'recvonly' });
- }
- return e.apply(this, arguments);
- };
- }
- function gf(t) {
- 'object' != typeof t ||
- t.AudioContext ||
- (t.AudioContext = t.webkitAudioContext);
- }
- var _f = Object.freeze({
- __proto__: null,
- shimLocalStreamsAPI: hf,
- shimRemoteStreamsAPI: lf,
- shimCallbacksAPI: df,
- shimGetUserMedia: ff,
- shimConstraints: pf,
- shimRTCIceServerUrls: vf,
- shimTrackEventTransceiver: mf,
- shimCreateOfferLegacy: yf,
- shimAudioContext: gf,
- }),
- bf = { exports: {} };
- !(function (t) {
- const e = {
- generateIdentifier: function () {
- return Math.random().toString(36).substring(2, 12);
- },
- };
- (e.localCName = e.generateIdentifier()),
- (e.splitLines = function (t) {
- return t
- .trim()
- .split('\n')
- .map((t) => t.trim());
- }),
- (e.splitSections = function (t) {
- return t
- .split('\nm=')
- .map((t, e) => (e > 0 ? 'm=' + t : t).trim() + '\r\n');
- }),
- (e.getDescription = function (t) {
- const r = e.splitSections(t);
- return r && r[0];
- }),
- (e.getMediaSections = function (t) {
- const r = e.splitSections(t);
- return r.shift(), r;
- }),
- (e.matchPrefix = function (t, r) {
- return e.splitLines(t).filter((t) => 0 === t.indexOf(r));
- }),
- (e.parseCandidate = function (t) {
- let e;
- e =
- 0 === t.indexOf('a=candidate:')
- ? t.substring(12).split(' ')
- : t.substring(10).split(' ');
- const r = {
- foundation: e[0],
- component: { 1: 'rtp', 2: 'rtcp' }[e[1]] || e[1],
- protocol: e[2].toLowerCase(),
- priority: parseInt(e[3], 10),
- ip: e[4],
- address: e[4],
- port: parseInt(e[5], 10),
- type: e[7],
- };
- for (let t = 8; t < e.length; t += 2)
- switch (e[t]) {
- case 'raddr':
- r.relatedAddress = e[t + 1];
- break;
- case 'rport':
- r.relatedPort = parseInt(e[t + 1], 10);
- break;
- case 'tcptype':
- r.tcpType = e[t + 1];
- break;
- case 'ufrag':
- (r.ufrag = e[t + 1]), (r.usernameFragment = e[t + 1]);
- break;
- default:
- void 0 === r[e[t]] && (r[e[t]] = e[t + 1]);
- }
- return r;
- }),
- (e.writeCandidate = function (t) {
- const e = [];
- e.push(t.foundation);
- const r = t.component;
- 'rtp' === r ? e.push(1) : 'rtcp' === r ? e.push(2) : e.push(r),
- e.push(t.protocol.toUpperCase()),
- e.push(t.priority),
- e.push(t.address || t.ip),
- e.push(t.port);
- const n = t.type;
- return (
- e.push('typ'),
- e.push(n),
- 'host' !== n &&
- t.relatedAddress &&
- t.relatedPort &&
- (e.push('raddr'),
- e.push(t.relatedAddress),
- e.push('rport'),
- e.push(t.relatedPort)),
- t.tcpType &&
- 'tcp' === t.protocol.toLowerCase() &&
- (e.push('tcptype'), e.push(t.tcpType)),
- (t.usernameFragment || t.ufrag) &&
- (e.push('ufrag'), e.push(t.usernameFragment || t.ufrag)),
- 'candidate:' + e.join(' ')
- );
- }),
- (e.parseIceOptions = function (t) {
- return t.substring(14).split(' ');
- }),
- (e.parseRtpMap = function (t) {
- let e = t.substring(9).split(' ');
- const r = { payloadType: parseInt(e.shift(), 10) };
- return (
- (e = e[0].split('/')),
- (r.name = e[0]),
- (r.clockRate = parseInt(e[1], 10)),
- (r.channels = 3 === e.length ? parseInt(e[2], 10) : 1),
- (r.numChannels = r.channels),
- r
- );
- }),
- (e.writeRtpMap = function (t) {
- let e = t.payloadType;
- void 0 !== t.preferredPayloadType && (e = t.preferredPayloadType);
- const r = t.channels || t.numChannels || 1;
- return (
- 'a=rtpmap:' +
- e +
- ' ' +
- t.name +
- '/' +
- t.clockRate +
- (1 !== r ? '/' + r : '') +
- '\r\n'
- );
- }),
- (e.parseExtmap = function (t) {
- const e = t.substring(9).split(' ');
- return {
- id: parseInt(e[0], 10),
- direction: e[0].indexOf('/') > 0 ? e[0].split('/')[1] : 'sendrecv',
- uri: e[1],
- attributes: e.slice(2).join(' '),
- };
- }),
- (e.writeExtmap = function (t) {
- return (
- 'a=extmap:' +
- (t.id || t.preferredId) +
- (t.direction && 'sendrecv' !== t.direction ? '/' + t.direction : '') +
- ' ' +
- t.uri +
- (t.attributes ? ' ' + t.attributes : '') +
- '\r\n'
- );
- }),
- (e.parseFmtp = function (t) {
- const e = {};
- let r;
- const n = t.substring(t.indexOf(' ') + 1).split(';');
- for (let t = 0; t < n.length; t++)
- (r = n[t].trim().split('=')), (e[r[0].trim()] = r[1]);
- return e;
- }),
- (e.writeFmtp = function (t) {
- let e = '',
- r = t.payloadType;
- if (
- (void 0 !== t.preferredPayloadType && (r = t.preferredPayloadType),
- t.parameters && Object.keys(t.parameters).length)
- ) {
- const n = [];
- Object.keys(t.parameters).forEach((e) => {
- void 0 !== t.parameters[e]
- ? n.push(e + '=' + t.parameters[e])
- : n.push(e);
- }),
- (e += 'a=fmtp:' + r + ' ' + n.join(';') + '\r\n');
- }
- return e;
- }),
- (e.parseRtcpFb = function (t) {
- const e = t.substring(t.indexOf(' ') + 1).split(' ');
- return { type: e.shift(), parameter: e.join(' ') };
- }),
- (e.writeRtcpFb = function (t) {
- let e = '',
- r = t.payloadType;
- return (
- void 0 !== t.preferredPayloadType && (r = t.preferredPayloadType),
- t.rtcpFeedback &&
- t.rtcpFeedback.length &&
- t.rtcpFeedback.forEach((t) => {
- e +=
- 'a=rtcp-fb:' +
- r +
- ' ' +
- t.type +
- (t.parameter && t.parameter.length ? ' ' + t.parameter : '') +
- '\r\n';
- }),
- e
- );
- }),
- (e.parseSsrcMedia = function (t) {
- const e = t.indexOf(' '),
- r = { ssrc: parseInt(t.substring(7, e), 10) },
- n = t.indexOf(':', e);
- return (
- n > -1
- ? ((r.attribute = t.substring(e + 1, n)),
- (r.value = t.substring(n + 1)))
- : (r.attribute = t.substring(e + 1)),
- r
- );
- }),
- (e.parseSsrcGroup = function (t) {
- const e = t.substring(13).split(' ');
- return { semantics: e.shift(), ssrcs: e.map((t) => parseInt(t, 10)) };
- }),
- (e.getMid = function (t) {
- const r = e.matchPrefix(t, 'a=mid:')[0];
- if (r) return r.substring(6);
- }),
- (e.parseFingerprint = function (t) {
- const e = t.substring(14).split(' ');
- return { algorithm: e[0].toLowerCase(), value: e[1].toUpperCase() };
- }),
- (e.getDtlsParameters = function (t, r) {
- return {
- role: 'auto',
- fingerprints: e
- .matchPrefix(t + r, 'a=fingerprint:')
- .map(e.parseFingerprint),
- };
- }),
- (e.writeDtlsParameters = function (t, e) {
- let r = 'a=setup:' + e + '\r\n';
- return (
- t.fingerprints.forEach((t) => {
- r += 'a=fingerprint:' + t.algorithm + ' ' + t.value + '\r\n';
- }),
- r
- );
- }),
- (e.parseCryptoLine = function (t) {
- const e = t.substring(9).split(' ');
- return {
- tag: parseInt(e[0], 10),
- cryptoSuite: e[1],
- keyParams: e[2],
- sessionParams: e.slice(3),
- };
- }),
- (e.writeCryptoLine = function (t) {
- return (
- 'a=crypto:' +
- t.tag +
- ' ' +
- t.cryptoSuite +
- ' ' +
- ('object' == typeof t.keyParams
- ? e.writeCryptoKeyParams(t.keyParams)
- : t.keyParams) +
- (t.sessionParams ? ' ' + t.sessionParams.join(' ') : '') +
- '\r\n'
- );
- }),
- (e.parseCryptoKeyParams = function (t) {
- if (0 !== t.indexOf('inline:')) return null;
- const e = t.substring(7).split('|');
- return {
- keyMethod: 'inline',
- keySalt: e[0],
- lifeTime: e[1],
- mkiValue: e[2] ? e[2].split(':')[0] : void 0,
- mkiLength: e[2] ? e[2].split(':')[1] : void 0,
- };
- }),
- (e.writeCryptoKeyParams = function (t) {
- return (
- t.keyMethod +
- ':' +
- t.keySalt +
- (t.lifeTime ? '|' + t.lifeTime : '') +
- (t.mkiValue && t.mkiLength
- ? '|' + t.mkiValue + ':' + t.mkiLength
- : '')
- );
- }),
- (e.getCryptoParameters = function (t, r) {
- return e.matchPrefix(t + r, 'a=crypto:').map(e.parseCryptoLine);
- }),
- (e.getIceParameters = function (t, r) {
- const n = e.matchPrefix(t + r, 'a=ice-ufrag:')[0],
- i = e.matchPrefix(t + r, 'a=ice-pwd:')[0];
- return n && i
- ? { usernameFragment: n.substring(12), password: i.substring(10) }
- : null;
- }),
- (e.writeIceParameters = function (t) {
- let e =
- 'a=ice-ufrag:' +
- t.usernameFragment +
- '\r\na=ice-pwd:' +
- t.password +
- '\r\n';
- return t.iceLite && (e += 'a=ice-lite\r\n'), e;
- }),
- (e.parseRtpParameters = function (t) {
- const r = {
- codecs: [],
- headerExtensions: [],
- fecMechanisms: [],
- rtcp: [],
- },
- n = e.splitLines(t)[0].split(' ');
- r.profile = n[2];
- for (let i = 3; i < n.length; i++) {
- const o = n[i],
- s = e.matchPrefix(t, 'a=rtpmap:' + o + ' ')[0];
- if (s) {
- const n = e.parseRtpMap(s),
- i = e.matchPrefix(t, 'a=fmtp:' + o + ' ');
- switch (
- ((n.parameters = i.length ? e.parseFmtp(i[0]) : {}),
- (n.rtcpFeedback = e
- .matchPrefix(t, 'a=rtcp-fb:' + o + ' ')
- .map(e.parseRtcpFb)),
- r.codecs.push(n),
- n.name.toUpperCase())
- ) {
- case 'RED':
- case 'ULPFEC':
- r.fecMechanisms.push(n.name.toUpperCase());
- }
- }
- }
- e.matchPrefix(t, 'a=extmap:').forEach((t) => {
- r.headerExtensions.push(e.parseExtmap(t));
- });
- const i = e.matchPrefix(t, 'a=rtcp-fb:* ').map(e.parseRtcpFb);
- return (
- r.codecs.forEach((t) => {
- i.forEach((e) => {
- t.rtcpFeedback.find(
- (t) => t.type === e.type && t.parameter === e.parameter
- ) || t.rtcpFeedback.push(e);
- });
- }),
- r
- );
- }),
- (e.writeRtpDescription = function (t, r) {
- let n = '';
- (n += 'm=' + t + ' '),
- (n += r.codecs.length > 0 ? '9' : '0'),
- (n += ' ' + (r.profile || 'UDP/TLS/RTP/SAVPF') + ' '),
- (n +=
- r.codecs
- .map((t) =>
- void 0 !== t.preferredPayloadType
- ? t.preferredPayloadType
- : t.payloadType
- )
- .join(' ') + '\r\n'),
- (n += 'c=IN IP4 0.0.0.0\r\n'),
- (n += 'a=rtcp:9 IN IP4 0.0.0.0\r\n'),
- r.codecs.forEach((t) => {
- (n += e.writeRtpMap(t)),
- (n += e.writeFmtp(t)),
- (n += e.writeRtcpFb(t));
- });
- let i = 0;
- return (
- r.codecs.forEach((t) => {
- t.maxptime > i && (i = t.maxptime);
- }),
- i > 0 && (n += 'a=maxptime:' + i + '\r\n'),
- r.headerExtensions &&
- r.headerExtensions.forEach((t) => {
- n += e.writeExtmap(t);
- }),
- n
- );
- }),
- (e.parseRtpEncodingParameters = function (t) {
- const r = [],
- n = e.parseRtpParameters(t),
- i = -1 !== n.fecMechanisms.indexOf('RED'),
- o = -1 !== n.fecMechanisms.indexOf('ULPFEC'),
- s = e
- .matchPrefix(t, 'a=ssrc:')
- .map((t) => e.parseSsrcMedia(t))
- .filter((t) => 'cname' === t.attribute),
- a = s.length > 0 && s[0].ssrc;
- let u;
- const c = e.matchPrefix(t, 'a=ssrc-group:FID').map((t) =>
- t
- .substring(17)
- .split(' ')
- .map((t) => parseInt(t, 10))
- );
- c.length > 0 && c[0].length > 1 && c[0][0] === a && (u = c[0][1]),
- n.codecs.forEach((t) => {
- if ('RTX' === t.name.toUpperCase() && t.parameters.apt) {
- let e = {
- ssrc: a,
- codecPayloadType: parseInt(t.parameters.apt, 10),
- };
- a && u && (e.rtx = { ssrc: u }),
- r.push(e),
- i &&
- ((e = JSON.parse(JSON.stringify(e))),
- (e.fec = { ssrc: a, mechanism: o ? 'red+ulpfec' : 'red' }),
- r.push(e));
- }
- }),
- 0 === r.length && a && r.push({ ssrc: a });
- let h = e.matchPrefix(t, 'b=');
- return (
- h.length &&
- ((h =
- 0 === h[0].indexOf('b=TIAS:')
- ? parseInt(h[0].substring(7), 10)
- : 0 === h[0].indexOf('b=AS:')
- ? 1e3 * parseInt(h[0].substring(5), 10) * 0.95 - 16e3
- : void 0),
- r.forEach((t) => {
- t.maxBitrate = h;
- })),
- r
- );
- }),
- (e.parseRtcpParameters = function (t) {
- const r = {},
- n = e
- .matchPrefix(t, 'a=ssrc:')
- .map((t) => e.parseSsrcMedia(t))
- .filter((t) => 'cname' === t.attribute)[0];
- n && ((r.cname = n.value), (r.ssrc = n.ssrc));
- const i = e.matchPrefix(t, 'a=rtcp-rsize');
- (r.reducedSize = i.length > 0), (r.compound = 0 === i.length);
- const o = e.matchPrefix(t, 'a=rtcp-mux');
- return (r.mux = o.length > 0), r;
- }),
- (e.writeRtcpParameters = function (t) {
- let e = '';
- return (
- t.reducedSize && (e += 'a=rtcp-rsize\r\n'),
- t.mux && (e += 'a=rtcp-mux\r\n'),
- void 0 !== t.ssrc &&
- t.cname &&
- (e += 'a=ssrc:' + t.ssrc + ' cname:' + t.cname + '\r\n'),
- e
- );
- }),
- (e.parseMsid = function (t) {
- let r;
- const n = e.matchPrefix(t, 'a=msid:');
- if (1 === n.length)
- return (
- (r = n[0].substring(7).split(' ')), { stream: r[0], track: r[1] }
- );
- const i = e
- .matchPrefix(t, 'a=ssrc:')
- .map((t) => e.parseSsrcMedia(t))
- .filter((t) => 'msid' === t.attribute);
- return i.length > 0
- ? ((r = i[0].value.split(' ')), { stream: r[0], track: r[1] })
- : void 0;
- }),
- (e.parseSctpDescription = function (t) {
- const r = e.parseMLine(t),
- n = e.matchPrefix(t, 'a=max-message-size:');
- let i;
- n.length > 0 && (i = parseInt(n[0].substring(19), 10)),
- isNaN(i) && (i = 65536);
- const o = e.matchPrefix(t, 'a=sctp-port:');
- if (o.length > 0)
- return {
- port: parseInt(o[0].substring(12), 10),
- protocol: r.fmt,
- maxMessageSize: i,
- };
- const s = e.matchPrefix(t, 'a=sctpmap:');
- if (s.length > 0) {
- const t = s[0].substring(10).split(' ');
- return {
- port: parseInt(t[0], 10),
- protocol: t[1],
- maxMessageSize: i,
- };
- }
- }),
- (e.writeSctpDescription = function (t, e) {
- let r = [];
- return (
- (r =
- 'DTLS/SCTP' !== t.protocol
- ? [
- 'm=' +
- t.kind +
- ' 9 ' +
- t.protocol +
- ' ' +
- e.protocol +
- '\r\n',
- 'c=IN IP4 0.0.0.0\r\n',
- 'a=sctp-port:' + e.port + '\r\n',
- ]
- : [
- 'm=' + t.kind + ' 9 ' + t.protocol + ' ' + e.port + '\r\n',
- 'c=IN IP4 0.0.0.0\r\n',
- 'a=sctpmap:' + e.port + ' ' + e.protocol + ' 65535\r\n',
- ]),
- void 0 !== e.maxMessageSize &&
- r.push('a=max-message-size:' + e.maxMessageSize + '\r\n'),
- r.join('')
- );
- }),
- (e.generateSessionId = function () {
- return Math.random().toString().substr(2, 22);
- }),
- (e.writeSessionBoilerplate = function (t, r, n) {
- let i;
- const o = void 0 !== r ? r : 2;
- i = t || e.generateSessionId();
- return (
- 'v=0\r\no=' +
- (n || 'thisisadapterortc') +
- ' ' +
- i +
- ' ' +
- o +
- ' IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\n'
- );
- }),
- (e.getDirection = function (t, r) {
- const n = e.splitLines(t);
- for (let t = 0; t < n.length; t++)
- switch (n[t]) {
- case 'a=sendrecv':
- case 'a=sendonly':
- case 'a=recvonly':
- case 'a=inactive':
- return n[t].substring(2);
- }
- return r ? e.getDirection(r) : 'sendrecv';
- }),
- (e.getKind = function (t) {
- return e.splitLines(t)[0].split(' ')[0].substring(2);
- }),
- (e.isRejected = function (t) {
- return '0' === t.split(' ', 2)[1];
- }),
- (e.parseMLine = function (t) {
- const r = e.splitLines(t)[0].substring(2).split(' ');
- return {
- kind: r[0],
- port: parseInt(r[1], 10),
- protocol: r[2],
- fmt: r.slice(3).join(' '),
- };
- }),
- (e.parseOLine = function (t) {
- const r = e.matchPrefix(t, 'o=')[0].substring(2).split(' ');
- return {
- username: r[0],
- sessionId: r[1],
- sessionVersion: parseInt(r[2], 10),
- netType: r[3],
- addressType: r[4],
- address: r[5],
- };
- }),
- (e.isValidSDP = function (t) {
- if ('string' != typeof t || 0 === t.length) return !1;
- const r = e.splitLines(t);
- for (let t = 0; t < r.length; t++)
- if (r[t].length < 2 || '=' !== r[t].charAt(1)) return !1;
- return !0;
- }),
- (t.exports = e);
- })(bf);
- var Tf = bf.exports,
- xf = t({ __proto__: null, default: Tf }, [bf.exports]);
- function Ef(t) {
- if (
- !t.RTCIceCandidate ||
- (t.RTCIceCandidate && 'foundation' in t.RTCIceCandidate.prototype)
- )
- return;
- const e = t.RTCIceCandidate;
- (t.RTCIceCandidate = function (t) {
- if (
- ('object' == typeof t &&
- t.candidate &&
- 0 === t.candidate.indexOf('a=') &&
- ((t = JSON.parse(JSON.stringify(t))).candidate =
- t.candidate.substring(2)),
- t.candidate && t.candidate.length)
- ) {
- const r = new e(t),
- n = Tf.parseCandidate(t.candidate);
- for (const t in n)
- t in r || Object.defineProperty(r, t, { value: n[t] });
- return (
- (r.toJSON = function () {
- return {
- candidate: r.candidate,
- sdpMid: r.sdpMid,
- sdpMLineIndex: r.sdpMLineIndex,
- usernameFragment: r.usernameFragment,
- };
- }),
- r
- );
- }
- return new e(t);
- }),
- (t.RTCIceCandidate.prototype = e.prototype),
- Od(
- t,
- 'icecandidate',
- (e) => (
- e.candidate &&
- Object.defineProperty(e, 'candidate', {
- value: new t.RTCIceCandidate(e.candidate),
- writable: 'false',
- }),
- e
- )
- );
- }
- function Sf(t) {
- !t.RTCIceCandidate ||
- (t.RTCIceCandidate && 'relayProtocol' in t.RTCIceCandidate.prototype) ||
- Od(t, 'icecandidate', (t) => {
- if (t.candidate) {
- const e = Tf.parseCandidate(t.candidate.candidate);
- 'relay' === e.type &&
- (t.candidate.relayProtocol = { 0: 'tls', 1: 'tcp', 2: 'udp' }[
- e.priority >> 24
- ]);
- }
- return t;
- });
- }
- function wf(t, e) {
- if (!t.RTCPeerConnection) return;
- 'sctp' in t.RTCPeerConnection.prototype ||
- Object.defineProperty(t.RTCPeerConnection.prototype, 'sctp', {
- get() {
- return void 0 === this._sctp ? null : this._sctp;
- },
- });
- const r = function (t) {
- if (!t || !t.sdp) return !1;
- const e = Tf.splitSections(t.sdp);
- return (
- e.shift(),
- e.some((t) => {
- const e = Tf.parseMLine(t);
- return (
- e && 'application' === e.kind && -1 !== e.protocol.indexOf('SCTP')
- );
- })
- );
- },
- n = function (t) {
- const e = t.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);
- if (null === e || e.length < 2) return -1;
- const r = parseInt(e[1], 10);
- return r != r ? -1 : r;
- },
- i = function (t) {
- let r = 65536;
- return (
- 'firefox' === e.browser &&
- (r =
- e.version < 57
- ? -1 === t
- ? 16384
- : 2147483637
- : e.version < 60
- ? 57 === e.version
- ? 65535
- : 65536
- : 2147483637),
- r
- );
- },
- o = function (t, r) {
- let n = 65536;
- 'firefox' === e.browser && 57 === e.version && (n = 65535);
- const i = Tf.matchPrefix(t.sdp, 'a=max-message-size:');
- return (
- i.length > 0
- ? (n = parseInt(i[0].substring(19), 10))
- : 'firefox' === e.browser && -1 !== r && (n = 2147483637),
- n
- );
- },
- s = t.RTCPeerConnection.prototype.setRemoteDescription;
- t.RTCPeerConnection.prototype.setRemoteDescription = function () {
- if (((this._sctp = null), 'chrome' === e.browser && e.version >= 76)) {
- const { sdpSemantics: t } = this.getConfiguration();
- 'plan-b' === t &&
- Object.defineProperty(this, 'sctp', {
- get() {
- return void 0 === this._sctp ? null : this._sctp;
- },
- enumerable: !0,
- configurable: !0,
- });
- }
- if (r(arguments[0])) {
- const t = n(arguments[0]),
- e = i(t),
- r = o(arguments[0], t);
- let s;
- s =
- 0 === e && 0 === r
- ? Number.POSITIVE_INFINITY
- : 0 === e || 0 === r
- ? Math.max(e, r)
- : Math.min(e, r);
- const a = {};
- Object.defineProperty(a, 'maxMessageSize', { get: () => s }),
- (this._sctp = a);
- }
- return s.apply(this, arguments);
- };
- }
- function Rf(t) {
- if (
- !t.RTCPeerConnection ||
- !('createDataChannel' in t.RTCPeerConnection.prototype)
- )
- return;
- function e(t, e) {
- const r = t.send;
- t.send = function () {
- const n = arguments[0],
- i = n.length || n.size || n.byteLength;
- if ('open' === t.readyState && e.sctp && i > e.sctp.maxMessageSize)
- throw new TypeError(
- 'Message too large (can send a maximum of ' +
- e.sctp.maxMessageSize +
- ' bytes)'
- );
- return r.apply(t, arguments);
- };
- }
- const r = t.RTCPeerConnection.prototype.createDataChannel;
- (t.RTCPeerConnection.prototype.createDataChannel = function () {
- const t = r.apply(this, arguments);
- return e(t, this), t;
- }),
- Od(t, 'datachannel', (t) => (e(t.channel, t.target), t));
- }
- function Cf(t) {
- if (
- !t.RTCPeerConnection ||
- 'connectionState' in t.RTCPeerConnection.prototype
- )
- return;
- const e = t.RTCPeerConnection.prototype;
- Object.defineProperty(e, 'connectionState', {
- get() {
- return (
- { completed: 'connected', checking: 'connecting' }[
- this.iceConnectionState
- ] || this.iceConnectionState
- );
- },
- enumerable: !0,
- configurable: !0,
- }),
- Object.defineProperty(e, 'onconnectionstatechange', {
- get() {
- return this._onconnectionstatechange || null;
- },
- set(t) {
- this._onconnectionstatechange &&
- (this.removeEventListener(
- 'connectionstatechange',
- this._onconnectionstatechange
- ),
- delete this._onconnectionstatechange),
- t &&
- this.addEventListener(
- 'connectionstatechange',
- (this._onconnectionstatechange = t)
- );
- },
- enumerable: !0,
- configurable: !0,
- }),
- ['setLocalDescription', 'setRemoteDescription'].forEach((t) => {
- const r = e[t];
- e[t] = function () {
- return (
- this._connectionstatechangepoly ||
- ((this._connectionstatechangepoly = (t) => {
- const e = t.target;
- if (e._lastConnectionState !== e.connectionState) {
- e._lastConnectionState = e.connectionState;
- const r = new Event('connectionstatechange', t);
- e.dispatchEvent(r);
- }
- return t;
- }),
- this.addEventListener(
- 'iceconnectionstatechange',
- this._connectionstatechangepoly
- )),
- r.apply(this, arguments)
- );
- };
- });
- }
- function Pf(t, e) {
- if (!t.RTCPeerConnection) return;
- if ('chrome' === e.browser && e.version >= 71) return;
- if ('safari' === e.browser && e.version >= 605) return;
- const r = t.RTCPeerConnection.prototype.setRemoteDescription;
- t.RTCPeerConnection.prototype.setRemoteDescription = function (e) {
- if (e && e.sdp && -1 !== e.sdp.indexOf('\na=extmap-allow-mixed')) {
- const r = e.sdp
- .split('\n')
- .filter((t) => 'a=extmap-allow-mixed' !== t.trim())
- .join('\n');
- t.RTCSessionDescription && e instanceof t.RTCSessionDescription
- ? (arguments[0] = new t.RTCSessionDescription({
- type: e.type,
- sdp: r,
- }))
- : (e.sdp = r);
- }
- return r.apply(this, arguments);
- };
- }
- function Af(t, e) {
- if (!t.RTCPeerConnection || !t.RTCPeerConnection.prototype) return;
- const r = t.RTCPeerConnection.prototype.addIceCandidate;
- r &&
- 0 !== r.length &&
- (t.RTCPeerConnection.prototype.addIceCandidate = function () {
- return arguments[0]
- ? (('chrome' === e.browser && e.version < 78) ||
- ('firefox' === e.browser && e.version < 68) ||
- 'safari' === e.browser) &&
- arguments[0] &&
- '' === arguments[0].candidate
- ? Promise.resolve()
- : r.apply(this, arguments)
- : (arguments[1] && arguments[1].apply(null), Promise.resolve());
- });
- }
- function Of(t, e) {
- if (!t.RTCPeerConnection || !t.RTCPeerConnection.prototype) return;
- const r = t.RTCPeerConnection.prototype.setLocalDescription;
- r &&
- 0 !== r.length &&
- (t.RTCPeerConnection.prototype.setLocalDescription = function () {
- let t = arguments[0] || {};
- if ('object' != typeof t || (t.type && t.sdp))
- return r.apply(this, arguments);
- if (((t = { type: t.type, sdp: t.sdp }), !t.type))
- switch (this.signalingState) {
- case 'stable':
- case 'have-local-offer':
- case 'have-remote-pranswer':
- t.type = 'offer';
- break;
- default:
- t.type = 'answer';
- }
- if (t.sdp || ('offer' !== t.type && 'answer' !== t.type))
- return r.apply(this, [t]);
- const e = 'offer' === t.type ? this.createOffer : this.createAnswer;
- return e.apply(this).then((t) => r.apply(this, [t]));
- });
- }
- var If = Object.freeze({
- __proto__: null,
- shimRTCIceCandidate: Ef,
- shimRTCIceCandidateRelayProtocol: Sf,
- shimMaxMessageSize: wf,
- shimSendThrowTypeError: Rf,
- shimConnectionState: Cf,
- removeExtmapAllowMixed: Pf,
- shimAddIceCandidateNullOrEmpty: Af,
- shimParameterlessSetLocalDescription: Of,
- });
- const Mf = (function (
- { window: t } = {},
- e = { shimChrome: !0, shimFirefox: !0, shimSafari: !0 }
- ) {
- const r = Dd,
- n = (function (t) {
- const e = { browser: null, version: null };
- if (void 0 === t || !t.navigator || !t.navigator.userAgent)
- return (e.browser = 'Not a browser.'), e;
- const { navigator: r } = t;
- if (r.mozGetUserMedia)
- (e.browser = 'firefox'),
- (e.version = Ad(r.userAgent, /Firefox\/(\d+)\./, 1));
- else if (
- r.webkitGetUserMedia ||
- (!1 === t.isSecureContext && t.webkitRTCPeerConnection)
- )
- (e.browser = 'chrome'),
- (e.version = Ad(r.userAgent, /Chrom(e|ium)\/(\d+)\./, 2));
- else {
- if (
- !t.RTCPeerConnection ||
- !r.userAgent.match(/AppleWebKit\/(\d+)\./)
- )
- return (e.browser = 'Not a supported browser.'), e;
- (e.browser = 'safari'),
- (e.version = Ad(r.userAgent, /AppleWebKit\/(\d+)\./, 1)),
- (e.supportsUnifiedPlan =
- t.RTCRtpTransceiver &&
- 'currentDirection' in t.RTCRtpTransceiver.prototype);
- }
- return e;
- })(t),
- i = {
- browserDetails: n,
- commonShim: If,
- extractVersion: Ad,
- disableLog: Id,
- disableWarnings: Md,
- sdp: xf,
- };
- switch (n.browser) {
- case 'chrome':
- if (!Kd || !Zd || !e.shimChrome)
- return r('Chrome shim is not included in this adapter release.'), i;
- if (null === n.version)
- return r('Chrome shim can not determine version, not shimming.'), i;
- r('adapter.js shimming chrome.'),
- (i.browserShim = Kd),
- Af(t, n),
- Of(t),
- Ud(t, n),
- jd(t),
- Zd(t, n),
- Xd(t),
- zd(t, n),
- Vd(t),
- Hd(t),
- Wd(t),
- Jd(t, n),
- Ef(t),
- Sf(t),
- Cf(t),
- wf(t, n),
- Rf(t),
- Pf(t, n);
- break;
- case 'firefox':
- if (!cf || !$d || !e.shimFirefox)
- return r('Firefox shim is not included in this adapter release.'), i;
- r('adapter.js shimming firefox.'),
- (i.browserShim = cf),
- Af(t, n),
- Of(t),
- qd(t, n),
- $d(t, n),
- Qd(t),
- rf(t),
- tf(t),
- ef(t),
- nf(t),
- of(t),
- sf(t),
- af(t),
- uf(t),
- Ef(t),
- Cf(t),
- wf(t, n),
- Rf(t);
- break;
- case 'safari':
- if (!_f || !e.shimSafari)
- return r('Safari shim is not included in this adapter release.'), i;
- r('adapter.js shimming safari.'),
- (i.browserShim = _f),
- Af(t, n),
- Of(t),
- vf(t),
- yf(t),
- df(t),
- hf(t),
- lf(t),
- mf(t),
- ff(t),
- gf(t),
- Ef(t),
- Sf(t),
- wf(t, n),
- Rf(t),
- Pf(t, n);
- break;
- default:
- r('Unsupported browser!');
- }
- return i;
- })({ window: 'undefined' == typeof window ? void 0 : window });
- let Df = (t = 21) =>
- crypto
- .getRandomValues(new Uint8Array(t))
- .reduce(
- (t, e) =>
- (t +=
- (e &= 63) < 36
- ? e.toString(36)
- : e < 62
- ? (e - 26).toString(36).toUpperCase()
- : e > 62
- ? '-'
- : '_'),
- ''
- );
- var Lf = { exports: {} },
- Ff = 1e3,
- Nf = 60 * Ff,
- kf = 60 * Nf,
- Bf = 24 * kf,
- Gf = 7 * Bf,
- Uf = 365.25 * Bf,
- jf = function (t, e) {
- e = e || {};
- var r = typeof t;
- if ('string' === r && t.length > 0)
- return (function (t) {
- if ((t = String(t)).length > 100) return;
- var e =
- /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
- t
- );
- if (!e) return;
- var r = parseFloat(e[1]);
- switch ((e[2] || 'ms').toLowerCase()) {
- case 'years':
- case 'year':
- case 'yrs':
- case 'yr':
- case 'y':
- return r * Uf;
- case 'weeks':
- case 'week':
- case 'w':
- return r * Gf;
- case 'days':
- case 'day':
- case 'd':
- return r * Bf;
- case 'hours':
- case 'hour':
- case 'hrs':
- case 'hr':
- case 'h':
- return r * kf;
- case 'minutes':
- case 'minute':
- case 'mins':
- case 'min':
- case 'm':
- return r * Nf;
- case 'seconds':
- case 'second':
- case 'secs':
- case 'sec':
- case 's':
- return r * Ff;
- case 'milliseconds':
- case 'millisecond':
- case 'msecs':
- case 'msec':
- case 'ms':
- return r;
- default:
- return;
- }
- })(t);
- if ('number' === r && isFinite(t))
- return e.long
- ? (function (t) {
- var e = Math.abs(t);
- if (e >= Bf) return Xf(t, e, Bf, 'day');
- if (e >= kf) return Xf(t, e, kf, 'hour');
- if (e >= Nf) return Xf(t, e, Nf, 'minute');
- if (e >= Ff) return Xf(t, e, Ff, 'second');
- return t + ' ms';
- })(t)
- : (function (t) {
- var e = Math.abs(t);
- if (e >= Bf) return Math.round(t / Bf) + 'd';
- if (e >= kf) return Math.round(t / kf) + 'h';
- if (e >= Nf) return Math.round(t / Nf) + 'm';
- if (e >= Ff) return Math.round(t / Ff) + 's';
- return t + 'ms';
- })(t);
- throw new Error(
- 'val is not a non-empty string or a valid number. val=' +
- JSON.stringify(t)
- );
- };
- function Xf(t, e, r, n) {
- var i = e >= 1.5 * r;
- return Math.round(t / r) + ' ' + n + (i ? 's' : '');
- }
- var Vf = function (t) {
- function e(t) {
- let n,
- i,
- o,
- s = null;
- function a(...t) {
- if (!a.enabled) return;
- const r = a,
- i = Number(new Date()),
- o = i - (n || i);
- (r.diff = o),
- (r.prev = n),
- (r.curr = i),
- (n = i),
- (t[0] = e.coerce(t[0])),
- 'string' != typeof t[0] && t.unshift('%O');
- let s = 0;
- (t[0] = t[0].replace(/%([a-zA-Z%])/g, (n, i) => {
- if ('%%' === n) return '%';
- s++;
- const o = e.formatters[i];
- if ('function' == typeof o) {
- const e = t[s];
- (n = o.call(r, e)), t.splice(s, 1), s--;
- }
- return n;
- })),
- e.formatArgs.call(r, t);
- (r.log || e.log).apply(r, t);
- }
- return (
- (a.namespace = t),
- (a.useColors = e.useColors()),
- (a.color = e.selectColor(t)),
- (a.extend = r),
- (a.destroy = e.destroy),
- Object.defineProperty(a, 'enabled', {
- enumerable: !0,
- configurable: !1,
- get: () =>
- null !== s
- ? s
- : (i !== e.namespaces && ((i = e.namespaces), (o = e.enabled(t))),
- o),
- set: (t) => {
- s = t;
- },
- }),
- 'function' == typeof e.init && e.init(a),
- a
- );
- }
- function r(t, r) {
- const n = e(this.namespace + (void 0 === r ? ':' : r) + t);
- return (n.log = this.log), n;
- }
- function n(t) {
- return t
- .toString()
- .substring(2, t.toString().length - 2)
- .replace(/\.\*\?$/, '*');
- }
- return (
- (e.debug = e),
- (e.default = e),
- (e.coerce = function (t) {
- if (t instanceof Error) return t.stack || t.message;
- return t;
- }),
- (e.disable = function () {
- const t = [
- ...e.names.map(n),
- ...e.skips.map(n).map((t) => '-' + t),
- ].join(',');
- return e.enable(''), t;
- }),
- (e.enable = function (t) {
- let r;
- e.save(t), (e.namespaces = t), (e.names = []), (e.skips = []);
- const n = ('string' == typeof t ? t : '').split(/[\s,]+/),
- i = n.length;
- for (r = 0; r < i; r++)
- n[r] &&
- ('-' === (t = n[r].replace(/\*/g, '.*?'))[0]
- ? e.skips.push(new RegExp('^' + t.slice(1) + '$'))
- : e.names.push(new RegExp('^' + t + '$')));
- }),
- (e.enabled = function (t) {
- if ('*' === t[t.length - 1]) return !0;
- let r, n;
- for (r = 0, n = e.skips.length; r < n; r++)
- if (e.skips[r].test(t)) return !1;
- for (r = 0, n = e.names.length; r < n; r++)
- if (e.names[r].test(t)) return !0;
- return !1;
- }),
- (e.humanize = jf),
- (e.destroy = function () {
- console.warn(
- 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
- );
- }),
- Object.keys(t).forEach((r) => {
- e[r] = t[r];
- }),
- (e.names = []),
- (e.skips = []),
- (e.formatters = {}),
- (e.selectColor = function (t) {
- let r = 0;
- for (let e = 0; e < t.length; e++)
- (r = (r << 5) - r + t.charCodeAt(e)), (r |= 0);
- return e.colors[Math.abs(r) % e.colors.length];
- }),
- e.enable(e.load()),
- e
- );
- };
- !(function (t, e) {
- (e.formatArgs = function (e) {
- if (
- ((e[0] =
- (this.useColors ? '%c' : '') +
- this.namespace +
- (this.useColors ? ' %c' : ' ') +
- e[0] +
- (this.useColors ? '%c ' : ' ') +
- '+' +
- t.exports.humanize(this.diff)),
- !this.useColors)
- )
- return;
- const r = 'color: ' + this.color;
- e.splice(1, 0, r, 'color: inherit');
- let n = 0,
- i = 0;
- e[0].replace(/%[a-zA-Z%]/g, (t) => {
- '%%' !== t && (n++, '%c' === t && (i = n));
- }),
- e.splice(i, 0, r);
- }),
- (e.save = function (t) {
- try {
- t ? e.storage.setItem('debug', t) : e.storage.removeItem('debug');
- } catch (t) {}
- }),
- (e.load = function () {
- let t;
- try {
- t = e.storage.getItem('debug');
- } catch (t) {}
- !t &&
- 'undefined' != typeof process &&
- 'env' in process &&
- (t = process.env.DEBUG);
- return t;
- }),
- (e.useColors = function () {
- if (
- 'undefined' != typeof window &&
- window.process &&
- ('renderer' === window.process.type || window.process.__nwjs)
- )
- return !0;
- if (
- 'undefined' != typeof navigator &&
- navigator.userAgent &&
- navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)
- )
- return !1;
- return (
- ('undefined' != typeof document &&
- document.documentElement &&
- document.documentElement.style &&
- document.documentElement.style.WebkitAppearance) ||
- ('undefined' != typeof window &&
- window.console &&
- (window.console.firebug ||
- (window.console.exception && window.console.table))) ||
- ('undefined' != typeof navigator &&
- navigator.userAgent &&
- navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) &&
- parseInt(RegExp.$1, 10) >= 31) ||
- ('undefined' != typeof navigator &&
- navigator.userAgent &&
- navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))
- );
- }),
- (e.storage = (function () {
- try {
- return localStorage;
- } catch (t) {}
- })()),
- (e.destroy = (() => {
- let t = !1;
- return () => {
- t ||
- ((t = !0),
- console.warn(
- 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
- ));
- };
- })()),
- (e.colors = [
- '#0000CC',
- '#0000FF',
- '#0033CC',
- '#0033FF',
- '#0066CC',
- '#0066FF',
- '#0099CC',
- '#0099FF',
- '#00CC00',
- '#00CC33',
- '#00CC66',
- '#00CC99',
- '#00CCCC',
- '#00CCFF',
- '#3300CC',
- '#3300FF',
- '#3333CC',
- '#3333FF',
- '#3366CC',
- '#3366FF',
- '#3399CC',
- '#3399FF',
- '#33CC00',
- '#33CC33',
- '#33CC66',
- '#33CC99',
- '#33CCCC',
- '#33CCFF',
- '#6600CC',
- '#6600FF',
- '#6633CC',
- '#6633FF',
- '#66CC00',
- '#66CC33',
- '#9900CC',
- '#9900FF',
- '#9933CC',
- '#9933FF',
- '#99CC00',
- '#99CC33',
- '#CC0000',
- '#CC0033',
- '#CC0066',
- '#CC0099',
- '#CC00CC',
- '#CC00FF',
- '#CC3300',
- '#CC3333',
- '#CC3366',
- '#CC3399',
- '#CC33CC',
- '#CC33FF',
- '#CC6600',
- '#CC6633',
- '#CC9900',
- '#CC9933',
- '#CCCC00',
- '#CCCC33',
- '#FF0000',
- '#FF0033',
- '#FF0066',
- '#FF0099',
- '#FF00CC',
- '#FF00FF',
- '#FF3300',
- '#FF3333',
- '#FF3366',
- '#FF3399',
- '#FF33CC',
- '#FF33FF',
- '#FF6600',
- '#FF6633',
- '#FF9900',
- '#FF9933',
- '#FFCC00',
- '#FFCC33',
- ]),
- (e.log = console.debug || console.log || (() => {})),
- (t.exports = Vf(e));
- const { formatters: r } = t.exports;
- r.j = function (t) {
- try {
- return JSON.stringify(t);
- } catch (t) {
- return '[UnexpectedJSONParseError]: ' + t.message;
- }
- };
- })(Lf, Lf.exports);
- var Hf,
- Wf,
- Yf = Lf.exports,
- zf = '2.1.1',
- Zf =
- 'max-width:100%;max-height:100%;object-fit:contain;display:block;margin:0 auto;',
- Jf = {
- '120p': { width: 160, height: 120, frameRate: 15, bitrate: 200 },
- '180p': { width: 320, height: 180, frameRate: 15, bitrate: 350 },
- '240p': { width: 320, height: 240, frameRate: 15, bitrate: 400 },
- '360p': { width: 640, height: 360, frameRate: 15, bitrate: 800 },
- '480p': { width: 640, height: 480, frameRate: 15, bitrate: 900 },
- '720p': { width: 1280, height: 720, frameRate: 15, bitrate: 1500 },
- '1080p': { width: 1920, height: 1080, frameRate: 15, bitrate: 2e3 },
- '2K': { width: 2560, height: 1440, frameRate: 30, bitrate: 4860 },
- '4K': { width: 3840, height: 2160, frameRate: 30, bitrate: 9e3 },
- },
- Kf = {
- standard: { sampleRate: 48e3, bitrate: 40 },
- high: { sampleRate: 48e3, bitrate: 128 },
- };
- !(function (t) {
- (t[(t.TXLIVE_ERROR_WEBRTC_FAILED = -1)] = 'TXLIVE_ERROR_WEBRTC_FAILED'),
- (t[(t.TXLIVE_ERROR_REQUEST_FAILED = -2)] = 'TXLIVE_ERROR_REQUEST_FAILED'),
- (t[(t.TXLIVE_WARNING_CAMERA_START_FAILED = -1001)] =
- 'TXLIVE_WARNING_CAMERA_START_FAILED'),
- (t[(t.TXLIVE_WARNING_MICROPHONE_START_FAILED = -1002)] =
- 'TXLIVE_WARNING_MICROPHONE_START_FAILED'),
- (t[(t.TXLIVE_WARNING_SCREEN_CAPTURE_START_FAILED = -1003)] =
- 'TXLIVE_WARNING_SCREEN_CAPTURE_START_FAILED'),
- (t[(t.TXLIVE_WARNING_VIRTUAL_CAMERA_START_FAILED = -1004)] =
- 'TXLIVE_WARNING_VIRTUAL_CAMERA_START_FAILED'),
- (t[(t.TXLIVE_WARNING_CAMERA_INTERRUPTED = -1005)] =
- 'TXLIVE_WARNING_CAMERA_INTERRUPTED'),
- (t[(t.TXLIVE_WARNING_MICROPHONE_INTERRUPTED = -1006)] =
- 'TXLIVE_WARNING_MICROPHONE_INTERRUPTED'),
- (t[(t.TXLIVE_WARNING_SCREEN_CAPTURE_INTERRUPTED = -1007)] =
- 'TXLIVE_WARNING_SCREEN_CAPTURE_INTERRUPTED');
- })(Hf || (Hf = {})),
- (function (t) {
- (t[(t.TXLIVE_PUSH_STATUS_DISCONNECTED = 0)] =
- 'TXLIVE_PUSH_STATUS_DISCONNECTED'),
- (t[(t.TXLIVE_PUSH_STATUS_CONNECTING = 1)] =
- 'TXLIVE_PUSH_STATUS_CONNECTING'),
- (t[(t.TXLIVE_PUSH_STATUS_CONNECTED = 2)] =
- 'TXLIVE_PUSH_STATUS_CONNECTED'),
- (t[(t.TXLIVE_PUSH_STATUS_RECONNECTING = 3)] =
- 'TXLIVE_PUSH_STATUS_RECONNECTING');
- })(Wf || (Wf = {}));
- var qf,
- Qf,
- $f = 'disconnected',
- tp = 'connecting',
- ep = 'connected',
- rp = 'request_push_start',
- np = 'request_push_success',
- ip = ['device', 'screen', 'file'],
- op = {
- deviceId: '',
- frameRate: 15,
- resolution: { width: 1280, height: 720 },
- },
- sp = {
- deviceId: '',
- sampleRate: 48e3,
- echoCancellation: !0,
- noiseSuppression: !0,
- autoGainControl: !0,
- },
- ap = ['image/bmp', 'image/jpeg', 'image/png'],
- up = ['.bmp', '.jpeg', '.jpg', '.png'],
- cp = {
- type: mh(
- (qf = [
- 'video/mp4',
- 'video/webm',
- 'video/ogg',
- 'audio/mpeg',
- 'audio/ogg',
- 'audio/wav',
- ])
- ).call(qf, ap),
- extension: mh((Qf = ['.mp4', '.webm', '.ogg', '.mp3', '.wav'])).call(
- Qf,
- up
- ),
- },
- hp = 'track_stop',
- lp = 'stream_stop',
- dp = ['user', 'environment'],
- fp =
- 'object' == typeof global && global && global.Object === Object && global,
- pp = 'object' == typeof self && self && self.Object === Object && self,
- vp = fp || pp || Function('return this')(),
- mp = vp.Symbol,
- yp = Object.prototype,
- gp = yp.hasOwnProperty,
- _p = yp.toString,
- bp = mp ? mp.toStringTag : void 0;
- var Tp = Object.prototype.toString;
- var xp = mp ? mp.toStringTag : void 0;
- function Ep(t) {
- return null == t
- ? void 0 === t
- ? '[object Undefined]'
- : '[object Null]'
- : xp && xp in Object(t)
- ? (function (t) {
- var e = gp.call(t, bp),
- r = t[bp];
- try {
- t[bp] = void 0;
- var n = !0;
- } catch (t) {}
- var i = _p.call(t);
- return n && (e ? (t[bp] = r) : delete t[bp]), i;
- })(t)
- : (function (t) {
- return Tp.call(t);
- })(t);
- }
- function Sp(t) {
- return null != t && 'object' == typeof t;
- }
- var wp = Array.isArray;
- function Rp(t) {
- var e = typeof t;
- return null != t && ('object' == e || 'function' == e);
- }
- function Cp(t) {
- return t;
- }
- function Pp(t) {
- if (!Rp(t)) return !1;
- var e = Ep(t);
- return (
- '[object Function]' == e ||
- '[object GeneratorFunction]' == e ||
- '[object AsyncFunction]' == e ||
- '[object Proxy]' == e
- );
- }
- var Ap = vp['__core-js_shared__'],
- Op = (function () {
- var t = /[^.]+$/.exec((Ap && Ap.keys && Ap.keys.IE_PROTO) || '');
- return t ? 'Symbol(src)_1.' + t : '';
- })();
- var Ip = Function.prototype.toString;
- function Mp(t) {
- if (null != t) {
- try {
- return Ip.call(t);
- } catch (t) {}
- try {
- return t + '';
- } catch (t) {}
- }
- return '';
- }
- var Dp = /^\[object .+?Constructor\]$/,
- Lp = Function.prototype,
- Fp = Object.prototype,
- Np = Lp.toString,
- kp = Fp.hasOwnProperty,
- Bp = RegExp(
- '^' +
- Np.call(kp)
- .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
- .replace(
- /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,
- '$1.*?'
- ) +
- '$'
- );
- function Gp(t) {
- return (
- !(!Rp(t) || ((e = t), Op && Op in e)) && (Pp(t) ? Bp : Dp).test(Mp(t))
- );
- var e;
- }
- function Up(t, e) {
- var r = (function (t, e) {
- return null == t ? void 0 : t[e];
- })(t, e);
- return Gp(r) ? r : void 0;
- }
- var jp = Up(vp, 'WeakMap'),
- Xp = Object.create,
- Vp = (function () {
- function t() {}
- return function (e) {
- if (!Rp(e)) return {};
- if (Xp) return Xp(e);
- t.prototype = e;
- var r = new t();
- return (t.prototype = void 0), r;
- };
- })();
- function Hp(t, e, r) {
- switch (r.length) {
- case 0:
- return t.call(e);
- case 1:
- return t.call(e, r[0]);
- case 2:
- return t.call(e, r[0], r[1]);
- case 3:
- return t.call(e, r[0], r[1], r[2]);
- }
- return t.apply(e, r);
- }
- var Wp = Date.now;
- var Yp,
- zp,
- Zp,
- Jp = (function () {
- try {
- var t = Up(Object, 'defineProperty');
- return t({}, '', {}), t;
- } catch (t) {}
- })(),
- Kp = Jp,
- qp = Kp
- ? function (t, e) {
- return Kp(t, 'toString', {
- configurable: !0,
- enumerable: !1,
- value:
- ((r = e),
- function () {
- return r;
- }),
- writable: !0,
- });
- var r;
- }
- : Cp,
- Qp =
- ((Yp = qp),
- (zp = 0),
- (Zp = 0),
- function () {
- var t = Wp(),
- e = 16 - (t - Zp);
- if (((Zp = t), e > 0)) {
- if (++zp >= 800) return arguments[0];
- } else zp = 0;
- return Yp.apply(void 0, arguments);
- }),
- $p = Qp;
- function tv(t) {
- return t != t;
- }
- function ev(t, e) {
- return (
- !!(null == t ? 0 : t.length) &&
- (function (t, e, r) {
- return e == e
- ? (function (t, e, r) {
- for (var n = r - 1, i = t.length; ++n < i; )
- if (t[n] === e) return n;
- return -1;
- })(t, e, r)
- : (function (t, e, r, n) {
- for (var i = t.length, o = r + (n ? 1 : -1); n ? o-- : ++o < i; )
- if (e(t[o], o, t)) return o;
- return -1;
- })(t, tv, r);
- })(t, e, 0) > -1
- );
- }
- var rv = /^(?:0|[1-9]\d*)$/;
- function nv(t, e) {
- var r = typeof t;
- return (
- !!(e = null == e ? 9007199254740991 : e) &&
- ('number' == r || ('symbol' != r && rv.test(t))) &&
- t > -1 &&
- t % 1 == 0 &&
- t < e
- );
- }
- function iv(t, e, r) {
- '__proto__' == e && Kp
- ? Kp(t, e, { configurable: !0, enumerable: !0, value: r, writable: !0 })
- : (t[e] = r);
- }
- function ov(t, e) {
- return t === e || (t != t && e != e);
- }
- var sv = Object.prototype.hasOwnProperty;
- function av(t, e, r) {
- var n = t[e];
- (sv.call(t, e) && ov(n, r) && (void 0 !== r || e in t)) || iv(t, e, r);
- }
- function uv(t, e, r, n) {
- var i = !r;
- r || (r = {});
- for (var o = -1, s = e.length; ++o < s; ) {
- var a = e[o],
- u = n ? n(r[a], t[a], a, r, t) : void 0;
- void 0 === u && (u = t[a]), i ? iv(r, a, u) : av(r, a, u);
- }
- return r;
- }
- var cv = Math.max;
- function hv(t) {
- return (
- 'number' == typeof t && t > -1 && t % 1 == 0 && t <= 9007199254740991
- );
- }
- function lv(t) {
- return null != t && hv(t.length) && !Pp(t);
- }
- var dv = Object.prototype;
- function fv(t) {
- var e = t && t.constructor;
- return t === (('function' == typeof e && e.prototype) || dv);
- }
- function pv(t) {
- return Sp(t) && '[object Arguments]' == Ep(t);
- }
- var vv = Object.prototype,
- mv = vv.hasOwnProperty,
- yv = vv.propertyIsEnumerable,
- gv = pv(
- (function () {
- return arguments;
- })()
- )
- ? pv
- : function (t) {
- return Sp(t) && mv.call(t, 'callee') && !yv.call(t, 'callee');
- },
- _v = gv;
- var bv =
- 'object' == typeof exports && exports && !exports.nodeType && exports,
- Tv =
- bv && 'object' == typeof module && module && !module.nodeType && module,
- xv = Tv && Tv.exports === bv ? vp.Buffer : void 0,
- Ev =
- (xv ? xv.isBuffer : void 0) ||
- function () {
- return !1;
- },
- Sv = {};
- function wv(t) {
- return function (e) {
- return t(e);
- };
- }
- (Sv['[object Float32Array]'] =
- Sv['[object Float64Array]'] =
- Sv['[object Int8Array]'] =
- Sv['[object Int16Array]'] =
- Sv['[object Int32Array]'] =
- Sv['[object Uint8Array]'] =
- Sv['[object Uint8ClampedArray]'] =
- Sv['[object Uint16Array]'] =
- Sv['[object Uint32Array]'] =
- !0),
- (Sv['[object Arguments]'] =
- Sv['[object Array]'] =
- Sv['[object ArrayBuffer]'] =
- Sv['[object Boolean]'] =
- Sv['[object DataView]'] =
- Sv['[object Date]'] =
- Sv['[object Error]'] =
- Sv['[object Function]'] =
- Sv['[object Map]'] =
- Sv['[object Number]'] =
- Sv['[object Object]'] =
- Sv['[object RegExp]'] =
- Sv['[object Set]'] =
- Sv['[object String]'] =
- Sv['[object WeakMap]'] =
- !1);
- var Rv =
- 'object' == typeof exports && exports && !exports.nodeType && exports,
- Cv =
- Rv && 'object' == typeof module && module && !module.nodeType && module,
- Pv = Cv && Cv.exports === Rv && fp.process,
- Av = (function () {
- try {
- var t = Cv && Cv.require && Cv.require('util').types;
- return t || (Pv && Pv.binding && Pv.binding('util'));
- } catch (t) {}
- })(),
- Ov = Av && Av.isTypedArray,
- Iv = Ov
- ? wv(Ov)
- : function (t) {
- return Sp(t) && hv(t.length) && !!Sv[Ep(t)];
- },
- Mv = Object.prototype.hasOwnProperty;
- function Dv(t, e) {
- var r = wp(t),
- n = !r && _v(t),
- i = !r && !n && Ev(t),
- o = !r && !n && !i && Iv(t),
- s = r || n || i || o,
- a = s
- ? (function (t, e) {
- for (var r = -1, n = Array(t); ++r < t; ) n[r] = e(r);
- return n;
- })(t.length, String)
- : [],
- u = a.length;
- for (var c in t)
- (!e && !Mv.call(t, c)) ||
- (s &&
- ('length' == c ||
- (i && ('offset' == c || 'parent' == c)) ||
- (o && ('buffer' == c || 'byteLength' == c || 'byteOffset' == c)) ||
- nv(c, u))) ||
- a.push(c);
- return a;
- }
- function Lv(t, e) {
- return function (r) {
- return t(e(r));
- };
- }
- var Fv = Lv(Object.keys, Object),
- Nv = Object.prototype.hasOwnProperty;
- function kv(t) {
- return lv(t)
- ? Dv(t)
- : (function (t) {
- if (!fv(t)) return Fv(t);
- var e = [];
- for (var r in Object(t))
- Nv.call(t, r) && 'constructor' != r && e.push(r);
- return e;
- })(t);
- }
- var Bv = Object.prototype.hasOwnProperty;
- function Gv(t) {
- if (!Rp(t))
- return (function (t) {
- var e = [];
- if (null != t) for (var r in Object(t)) e.push(r);
- return e;
- })(t);
- var e = fv(t),
- r = [];
- for (var n in t) ('constructor' != n || (!e && Bv.call(t, n))) && r.push(n);
- return r;
- }
- function Uv(t) {
- return lv(t) ? Dv(t, !0) : Gv(t);
- }
- var jv = Up(Object, 'create');
- var Xv = Object.prototype.hasOwnProperty;
- var Vv = Object.prototype.hasOwnProperty;
- function Hv(t) {
- var e = -1,
- r = null == t ? 0 : t.length;
- for (this.clear(); ++e < r; ) {
- var n = t[e];
- this.set(n[0], n[1]);
- }
- }
- function Wv(t, e) {
- for (var r = t.length; r--; ) if (ov(t[r][0], e)) return r;
- return -1;
- }
- (Hv.prototype.clear = function () {
- (this.__data__ = jv ? jv(null) : {}), (this.size = 0);
- }),
- (Hv.prototype.delete = function (t) {
- var e = this.has(t) && delete this.__data__[t];
- return (this.size -= e ? 1 : 0), e;
- }),
- (Hv.prototype.get = function (t) {
- var e = this.__data__;
- if (jv) {
- var r = e[t];
- return '__lodash_hash_undefined__' === r ? void 0 : r;
- }
- return Xv.call(e, t) ? e[t] : void 0;
- }),
- (Hv.prototype.has = function (t) {
- var e = this.__data__;
- return jv ? void 0 !== e[t] : Vv.call(e, t);
- }),
- (Hv.prototype.set = function (t, e) {
- var r = this.__data__;
- return (
- (this.size += this.has(t) ? 0 : 1),
- (r[t] = jv && void 0 === e ? '__lodash_hash_undefined__' : e),
- this
- );
- });
- var Yv = Array.prototype.splice;
- function zv(t) {
- var e = -1,
- r = null == t ? 0 : t.length;
- for (this.clear(); ++e < r; ) {
- var n = t[e];
- this.set(n[0], n[1]);
- }
- }
- (zv.prototype.clear = function () {
- (this.__data__ = []), (this.size = 0);
- }),
- (zv.prototype.delete = function (t) {
- var e = this.__data__,
- r = Wv(e, t);
- return (
- !(r < 0) &&
- (r == e.length - 1 ? e.pop() : Yv.call(e, r, 1), --this.size, !0)
- );
- }),
- (zv.prototype.get = function (t) {
- var e = this.__data__,
- r = Wv(e, t);
- return r < 0 ? void 0 : e[r][1];
- }),
- (zv.prototype.has = function (t) {
- return Wv(this.__data__, t) > -1;
- }),
- (zv.prototype.set = function (t, e) {
- var r = this.__data__,
- n = Wv(r, t);
- return n < 0 ? (++this.size, r.push([t, e])) : (r[n][1] = e), this;
- });
- var Zv = Up(vp, 'Map');
- function Jv(t, e) {
- var r,
- n,
- i = t.__data__;
- return (
- 'string' == (n = typeof (r = e)) ||
- 'number' == n ||
- 'symbol' == n ||
- 'boolean' == n
- ? '__proto__' !== r
- : null === r
- )
- ? i['string' == typeof e ? 'string' : 'hash']
- : i.map;
- }
- function Kv(t) {
- var e = -1,
- r = null == t ? 0 : t.length;
- for (this.clear(); ++e < r; ) {
- var n = t[e];
- this.set(n[0], n[1]);
- }
- }
- function qv(t, e) {
- for (var r = -1, n = e.length, i = t.length; ++r < n; ) t[i + r] = e[r];
- return t;
- }
- (Kv.prototype.clear = function () {
- (this.size = 0),
- (this.__data__ = {
- hash: new Hv(),
- map: new (Zv || zv)(),
- string: new Hv(),
- });
- }),
- (Kv.prototype.delete = function (t) {
- var e = Jv(this, t).delete(t);
- return (this.size -= e ? 1 : 0), e;
- }),
- (Kv.prototype.get = function (t) {
- return Jv(this, t).get(t);
- }),
- (Kv.prototype.has = function (t) {
- return Jv(this, t).has(t);
- }),
- (Kv.prototype.set = function (t, e) {
- var r = Jv(this, t),
- n = r.size;
- return r.set(t, e), (this.size += r.size == n ? 0 : 1), this;
- });
- var Qv = mp ? mp.isConcatSpreadable : void 0;
- function $v(t) {
- return wp(t) || _v(t) || !!(Qv && t && t[Qv]);
- }
- function tm(t, e, r, n, i) {
- var o = -1,
- s = t.length;
- for (r || (r = $v), i || (i = []); ++o < s; ) {
- var a = t[o];
- e > 0 && r(a)
- ? e > 1
- ? tm(a, e - 1, r, n, i)
- : qv(i, a)
- : n || (i[i.length] = a);
- }
- return i;
- }
- var em = Lv(Object.getPrototypeOf, Object);
- function rm(t) {
- var e = (this.__data__ = new zv(t));
- this.size = e.size;
- }
- (rm.prototype.clear = function () {
- (this.__data__ = new zv()), (this.size = 0);
- }),
- (rm.prototype.delete = function (t) {
- var e = this.__data__,
- r = e.delete(t);
- return (this.size = e.size), r;
- }),
- (rm.prototype.get = function (t) {
- return this.__data__.get(t);
- }),
- (rm.prototype.has = function (t) {
- return this.__data__.has(t);
- }),
- (rm.prototype.set = function (t, e) {
- var r = this.__data__;
- if (r instanceof zv) {
- var n = r.__data__;
- if (!Zv || n.length < 199)
- return n.push([t, e]), (this.size = ++r.size), this;
- r = this.__data__ = new Kv(n);
- }
- return r.set(t, e), (this.size = r.size), this;
- });
- var nm =
- 'object' == typeof exports && exports && !exports.nodeType && exports,
- im =
- nm && 'object' == typeof module && module && !module.nodeType && module,
- om = im && im.exports === nm ? vp.Buffer : void 0,
- sm = om ? om.allocUnsafe : void 0;
- function am() {
- return [];
- }
- var um = Object.prototype.propertyIsEnumerable,
- cm = Object.getOwnPropertySymbols,
- hm = cm
- ? function (t) {
- return null == t
- ? []
- : ((t = Object(t)),
- (function (t, e) {
- for (
- var r = -1, n = null == t ? 0 : t.length, i = 0, o = [];
- ++r < n;
- ) {
- var s = t[r];
- e(s, r, t) && (o[i++] = s);
- }
- return o;
- })(cm(t), function (e) {
- return um.call(t, e);
- }));
- }
- : am,
- lm = hm;
- var dm = Object.getOwnPropertySymbols
- ? function (t) {
- for (var e = []; t; ) qv(e, lm(t)), (t = em(t));
- return e;
- }
- : am;
- function fm(t, e, r) {
- var n = e(t);
- return wp(t) ? n : qv(n, r(t));
- }
- function pm(t) {
- return fm(t, kv, lm);
- }
- function vm(t) {
- return fm(t, Uv, dm);
- }
- var mm = Up(vp, 'DataView'),
- ym = Up(vp, 'Promise'),
- gm = Up(vp, 'Set'),
- _m = '[object Map]',
- bm = '[object Promise]',
- Tm = '[object Set]',
- xm = '[object WeakMap]',
- Em = '[object DataView]',
- Sm = Mp(mm),
- wm = Mp(Zv),
- Rm = Mp(ym),
- Cm = Mp(gm),
- Pm = Mp(jp),
- Am = Ep;
- ((mm && Am(new mm(new ArrayBuffer(1))) != Em) ||
- (Zv && Am(new Zv()) != _m) ||
- (ym && Am(ym.resolve()) != bm) ||
- (gm && Am(new gm()) != Tm) ||
- (jp && Am(new jp()) != xm)) &&
- (Am = function (t) {
- var e = Ep(t),
- r = '[object Object]' == e ? t.constructor : void 0,
- n = r ? Mp(r) : '';
- if (n)
- switch (n) {
- case Sm:
- return Em;
- case wm:
- return _m;
- case Rm:
- return bm;
- case Cm:
- return Tm;
- case Pm:
- return xm;
- }
- return e;
- });
- var Om = Am,
- Im = Object.prototype.hasOwnProperty;
- var Mm = vp.Uint8Array;
- function Dm(t) {
- var e = new t.constructor(t.byteLength);
- return new Mm(e).set(new Mm(t)), e;
- }
- var Lm = /\w*$/;
- var Fm = mp ? mp.prototype : void 0,
- Nm = Fm ? Fm.valueOf : void 0;
- function km(t, e, r) {
- var n,
- i,
- o = t.constructor;
- switch (e) {
- case '[object ArrayBuffer]':
- return Dm(t);
- case '[object Boolean]':
- case '[object Date]':
- return new o(+t);
- case '[object DataView]':
- return (function (t, e) {
- var r = e ? Dm(t.buffer) : t.buffer;
- return new t.constructor(r, t.byteOffset, t.byteLength);
- })(t, r);
- case '[object Float32Array]':
- case '[object Float64Array]':
- case '[object Int8Array]':
- case '[object Int16Array]':
- case '[object Int32Array]':
- case '[object Uint8Array]':
- case '[object Uint8ClampedArray]':
- case '[object Uint16Array]':
- case '[object Uint32Array]':
- return (function (t, e) {
- var r = e ? Dm(t.buffer) : t.buffer;
- return new t.constructor(r, t.byteOffset, t.length);
- })(t, r);
- case '[object Map]':
- case '[object Set]':
- return new o();
- case '[object Number]':
- case '[object String]':
- return new o(t);
- case '[object RegExp]':
- return (
- ((i = new (n = t).constructor(n.source, Lm.exec(n))).lastIndex =
- n.lastIndex),
- i
- );
- case '[object Symbol]':
- return (function (t) {
- return Nm ? Object(Nm.call(t)) : {};
- })(t);
- }
- }
- var Bm = Av && Av.isMap,
- Gm = Bm
- ? wv(Bm)
- : function (t) {
- return Sp(t) && '[object Map]' == Om(t);
- };
- var Um = Av && Av.isSet,
- jm = Um
- ? wv(Um)
- : function (t) {
- return Sp(t) && '[object Set]' == Om(t);
- },
- Xm = '[object Arguments]',
- Vm = '[object Function]',
- Hm = '[object Object]',
- Wm = {};
- function Ym(t, e, r, n, i, o) {
- var s,
- a = 1 & e,
- u = 2 & e,
- c = 4 & e;
- if ((r && (s = i ? r(t, n, i, o) : r(t)), void 0 !== s)) return s;
- if (!Rp(t)) return t;
- var h = wp(t);
- if (h) {
- if (
- ((s = (function (t) {
- var e = t.length,
- r = new t.constructor(e);
- return (
- e &&
- 'string' == typeof t[0] &&
- Im.call(t, 'index') &&
- ((r.index = t.index), (r.input = t.input)),
- r
- );
- })(t)),
- !a)
- )
- return (function (t, e) {
- var r = -1,
- n = t.length;
- for (e || (e = Array(n)); ++r < n; ) e[r] = t[r];
- return e;
- })(t, s);
- } else {
- var l = Om(t),
- d = l == Vm || '[object GeneratorFunction]' == l;
- if (Ev(t))
- return (function (t, e) {
- if (e) return t.slice();
- var r = t.length,
- n = sm ? sm(r) : new t.constructor(r);
- return t.copy(n), n;
- })(t, a);
- if (l == Hm || l == Xm || (d && !i)) {
- if (
- ((s =
- u || d
- ? {}
- : (function (t) {
- return 'function' != typeof t.constructor || fv(t)
- ? {}
- : Vp(em(t));
- })(t)),
- !a)
- )
- return u
- ? (function (t, e) {
- return uv(t, dm(t), e);
- })(
- t,
- (function (t, e) {
- return t && uv(e, Uv(e), t);
- })(s, t)
- )
- : (function (t, e) {
- return uv(t, lm(t), e);
- })(
- t,
- (function (t, e) {
- return t && uv(e, kv(e), t);
- })(s, t)
- );
- } else {
- if (!Wm[l]) return i ? t : {};
- s = km(t, l, a);
- }
- }
- o || (o = new rm());
- var f = o.get(t);
- if (f) return f;
- o.set(t, s),
- jm(t)
- ? t.forEach(function (n) {
- s.add(Ym(n, e, r, n, t, o));
- })
- : Gm(t) &&
- t.forEach(function (n, i) {
- s.set(i, Ym(n, e, r, i, t, o));
- });
- var p = h ? void 0 : (c ? (u ? vm : pm) : u ? Uv : kv)(t);
- return (
- (function (t, e) {
- for (
- var r = -1, n = null == t ? 0 : t.length;
- ++r < n && !1 !== e(t[r], r, t);
- );
- })(p || t, function (n, i) {
- p && (n = t[(i = n)]), av(s, i, Ym(n, e, r, i, t, o));
- }),
- s
- );
- }
- (Wm[Xm] =
- Wm['[object Array]'] =
- Wm['[object ArrayBuffer]'] =
- Wm['[object DataView]'] =
- Wm['[object Boolean]'] =
- Wm['[object Date]'] =
- Wm['[object Float32Array]'] =
- Wm['[object Float64Array]'] =
- Wm['[object Int8Array]'] =
- Wm['[object Int16Array]'] =
- Wm['[object Int32Array]'] =
- Wm['[object Map]'] =
- Wm['[object Number]'] =
- Wm[Hm] =
- Wm['[object RegExp]'] =
- Wm['[object Set]'] =
- Wm['[object String]'] =
- Wm['[object Symbol]'] =
- Wm['[object Uint8Array]'] =
- Wm['[object Uint8ClampedArray]'] =
- Wm['[object Uint16Array]'] =
- Wm['[object Uint32Array]'] =
- !0),
- (Wm['[object Error]'] = Wm[Vm] = Wm['[object WeakMap]'] = !1);
- function zm(t) {
- return Ym(t, 5);
- }
- function Zm(t) {
- var e = -1,
- r = null == t ? 0 : t.length;
- for (this.__data__ = new Kv(); ++e < r; ) this.add(t[e]);
- }
- function Jm(t, e) {
- for (var r = -1, n = null == t ? 0 : t.length; ++r < n; )
- if (e(t[r], r, t)) return !0;
- return !1;
- }
- function Km(t, e) {
- return t.has(e);
- }
- (Zm.prototype.add = Zm.prototype.push =
- function (t) {
- return this.__data__.set(t, '__lodash_hash_undefined__'), this;
- }),
- (Zm.prototype.has = function (t) {
- return this.__data__.has(t);
- });
- function qm(t, e, r, n, i, o) {
- var s = 1 & r,
- a = t.length,
- u = e.length;
- if (a != u && !(s && u > a)) return !1;
- var c = o.get(t),
- h = o.get(e);
- if (c && h) return c == e && h == t;
- var l = -1,
- d = !0,
- f = 2 & r ? new Zm() : void 0;
- for (o.set(t, e), o.set(e, t); ++l < a; ) {
- var p = t[l],
- v = e[l];
- if (n) var m = s ? n(v, p, l, e, t, o) : n(p, v, l, t, e, o);
- if (void 0 !== m) {
- if (m) continue;
- d = !1;
- break;
- }
- if (f) {
- if (
- !Jm(e, function (t, e) {
- if (!Km(f, e) && (p === t || i(p, t, r, n, o))) return f.push(e);
- })
- ) {
- d = !1;
- break;
- }
- } else if (p !== v && !i(p, v, r, n, o)) {
- d = !1;
- break;
- }
- }
- return o.delete(t), o.delete(e), d;
- }
- function Qm(t) {
- var e = -1,
- r = Array(t.size);
- return (
- t.forEach(function (t, n) {
- r[++e] = [n, t];
- }),
- r
- );
- }
- function $m(t) {
- var e = -1,
- r = Array(t.size);
- return (
- t.forEach(function (t) {
- r[++e] = t;
- }),
- r
- );
- }
- var ty = mp ? mp.prototype : void 0,
- ey = ty ? ty.valueOf : void 0;
- var ry = Object.prototype.hasOwnProperty;
- var ny = '[object Arguments]',
- iy = '[object Array]',
- oy = '[object Object]',
- sy = Object.prototype.hasOwnProperty;
- function ay(t, e, r, n, i, o) {
- var s = wp(t),
- a = wp(e),
- u = s ? iy : Om(t),
- c = a ? iy : Om(e),
- h = (u = u == ny ? oy : u) == oy,
- l = (c = c == ny ? oy : c) == oy,
- d = u == c;
- if (d && Ev(t)) {
- if (!Ev(e)) return !1;
- (s = !0), (h = !1);
- }
- if (d && !h)
- return (
- o || (o = new rm()),
- s || Iv(t)
- ? qm(t, e, r, n, i, o)
- : (function (t, e, r, n, i, o, s) {
- switch (r) {
- case '[object DataView]':
- if (
- t.byteLength != e.byteLength ||
- t.byteOffset != e.byteOffset
- )
- return !1;
- (t = t.buffer), (e = e.buffer);
- case '[object ArrayBuffer]':
- return !(
- t.byteLength != e.byteLength || !o(new Mm(t), new Mm(e))
- );
- case '[object Boolean]':
- case '[object Date]':
- case '[object Number]':
- return ov(+t, +e);
- case '[object Error]':
- return t.name == e.name && t.message == e.message;
- case '[object RegExp]':
- case '[object String]':
- return t == e + '';
- case '[object Map]':
- var a = Qm;
- case '[object Set]':
- var u = 1 & n;
- if ((a || (a = $m), t.size != e.size && !u)) return !1;
- var c = s.get(t);
- if (c) return c == e;
- (n |= 2), s.set(t, e);
- var h = qm(a(t), a(e), n, i, o, s);
- return s.delete(t), h;
- case '[object Symbol]':
- if (ey) return ey.call(t) == ey.call(e);
- }
- return !1;
- })(t, e, u, r, n, i, o)
- );
- if (!(1 & r)) {
- var f = h && sy.call(t, '__wrapped__'),
- p = l && sy.call(e, '__wrapped__');
- if (f || p) {
- var v = f ? t.value() : t,
- m = p ? e.value() : e;
- return o || (o = new rm()), i(v, m, r, n, o);
- }
- }
- return (
- !!d &&
- (o || (o = new rm()),
- (function (t, e, r, n, i, o) {
- var s = 1 & r,
- a = pm(t),
- u = a.length;
- if (u != pm(e).length && !s) return !1;
- for (var c = u; c--; ) {
- var h = a[c];
- if (!(s ? h in e : ry.call(e, h))) return !1;
- }
- var l = o.get(t),
- d = o.get(e);
- if (l && d) return l == e && d == t;
- var f = !0;
- o.set(t, e), o.set(e, t);
- for (var p = s; ++c < u; ) {
- var v = t[(h = a[c])],
- m = e[h];
- if (n) var y = s ? n(m, v, h, e, t, o) : n(v, m, h, t, e, o);
- if (!(void 0 === y ? v === m || i(v, m, r, n, o) : y)) {
- f = !1;
- break;
- }
- p || (p = 'constructor' == h);
- }
- if (f && !p) {
- var g = t.constructor,
- _ = e.constructor;
- g == _ ||
- !('constructor' in t) ||
- !('constructor' in e) ||
- ('function' == typeof g &&
- g instanceof g &&
- 'function' == typeof _ &&
- _ instanceof _) ||
- (f = !1);
- }
- return o.delete(t), o.delete(e), f;
- })(t, e, r, n, i, o))
- );
- }
- function uy(t, e, r, n, i) {
- return (
- t === e ||
- (null == t || null == e || (!Sp(t) && !Sp(e))
- ? t != t && e != e
- : ay(t, e, r, n, uy, i))
- );
- }
- function cy(t) {
- return Sp(t) && lv(t);
- }
- function hy(t, e, r) {
- for (var n = -1, i = null == t ? 0 : t.length; ++n < i; )
- if (r(e, t[n])) return !0;
- return !1;
- }
- function ly(t, e, r, n) {
- var i = -1,
- o = ev,
- s = !0,
- a = t.length,
- u = [],
- c = e.length;
- if (!a) return u;
- r &&
- (e = (function (t, e) {
- for (var r = -1, n = null == t ? 0 : t.length, i = Array(n); ++r < n; )
- i[r] = e(t[r], r, t);
- return i;
- })(e, wv(r))),
- n
- ? ((o = hy), (s = !1))
- : e.length >= 200 && ((o = Km), (s = !1), (e = new Zm(e)));
- t: for (; ++i < a; ) {
- var h = t[i],
- l = null == r ? h : r(h);
- if (((h = n || 0 !== h ? h : 0), s && l == l)) {
- for (var d = c; d--; ) if (e[d] === l) continue t;
- u.push(h);
- } else o(e, l, n) || u.push(h);
- }
- return u;
- }
- var dy = (function (t, e) {
- return $p(
- (function (t, e, r) {
- return (
- (e = cv(void 0 === e ? t.length - 1 : e, 0)),
- function () {
- for (
- var n = arguments,
- i = -1,
- o = cv(n.length - e, 0),
- s = Array(o);
- ++i < o;
- )
- s[i] = n[e + i];
- i = -1;
- for (var a = Array(e + 1); ++i < e; ) a[i] = n[i];
- return (a[e] = r(s)), Hp(t, this, a);
- }
- );
- })(t, e, Cp),
- t + ''
- );
- })(function (t, e) {
- var r = (function (t) {
- var e = null == t ? 0 : t.length;
- return e ? t[e - 1] : void 0;
- })(e);
- return (
- cy(r) && (r = void 0), cy(t) ? ly(t, tm(e, 1, cy, !0), void 0, r) : []
- );
- }),
- fy = dy;
- function py(t, e) {
- return uy(t, e);
- }
- var vy =
- 'position:fixed;left:0;top:0;pointer-events:none;opacity:0;z-index:-1;',
- my = function (t) {
- if ('suspended' === t.state || 'interrupted' === t.state) {
- var e = document.body,
- r = ['touchstart', 'touchend', 'mouseup', 'click'];
- Ph(r).call(r, function (t) {
- return e.addEventListener(t, n, !1);
- }),
- n();
- }
- function n() {
- t.resume().then(i).catch(null);
- }
- function i() {
- Ph(r).call(r, function (t) {
- return e.removeEventListener(t, n, !1);
- });
- }
- },
- yy = function () {
- var t = null;
- return (
- window.TXLiveAudioContext
- ? (t = window.TXLiveAudioContext)
- : ((t = new (window.AudioContext || window.webkitAudioContext)()),
- (window.TXLiveAudioContext = t)),
- my(t),
- t
- );
- },
- gy = function (t) {
- void 0 === t && (t = {});
- var e = t.parentEl,
- r = void 0 === e ? document.body : e,
- n = t.style,
- i = void 0 === n ? vy : n,
- o = t.crossOrigin,
- s = void 0 === o || o,
- a = t.loop,
- u = void 0 === a || a,
- c = document.createElement('video');
- return (
- (c.autoplay = !0),
- (c.controls = !1),
- (c.preload = 'auto'),
- (c.playsInline = !0),
- c.setAttribute('webkit-playsinline', ''),
- c.setAttribute('x5-playsinline', ''),
- (c.loop = u),
- s && (c.crossOrigin = 'anonymous'),
- c.setAttribute('style', i),
- r.appendChild(c),
- c
- );
- },
- _y = function (t) {
- return t instanceof HTMLVideoElement
- ? { width: t.videoWidth, height: t.videoHeight }
- : t instanceof HTMLImageElement
- ? { width: t.naturalWidth, height: t.naturalHeight }
- : { width: t.width, height: t.height };
- },
- by = '\t\n\v\f\r \u2028\u2029\ufeff',
- Ty = J,
- xy = Kn,
- Ey = S(''.replace),
- Sy = '[\t\n\v\f\r \u2028\u2029\ufeff]',
- wy = RegExp('^' + Sy + Sy + '*'),
- Ry = RegExp(Sy + Sy + '*$'),
- Cy = function (t) {
- return function (e) {
- var r = xy(Ty(e));
- return 1 & t && (r = Ey(r, wy, '')), 2 & t && (r = Ey(r, Ry, '')), r;
- };
- },
- Py = { start: Cy(1), end: Cy(2), trim: Cy(3) },
- Ay = o,
- Oy = s,
- Iy = S,
- My = Kn,
- Dy = Py.trim,
- Ly = by,
- Fy = Ay.parseInt,
- Ny = Ay.Symbol,
- ky = Ny && Ny.iterator,
- By = /^[+-]?0x/i,
- Gy = Iy(By.exec),
- Uy =
- 8 !== Fy(Ly + '08') ||
- 22 !== Fy(Ly + '0x16') ||
- (ky &&
- !Oy(function () {
- Fy(Object(ky));
- }))
- ? function (t, e) {
- var r = Dy(My(t));
- return Fy(r, e >>> 0 || (Gy(By, r) ? 16 : 10));
- }
- : Fy;
- Ar({ global: !0, forced: parseInt != Uy }, { parseInt: Uy });
- var jy = rt.parseInt,
- Xy = at,
- Vy = Xi,
- Hy = no,
- Wy = nr,
- Yy = S([].concat),
- zy =
- Xy('Reflect', 'ownKeys') ||
- function (t) {
- var e = Vy.f(Wy(t)),
- r = Hy.f;
- return r ? Yy(e, r(t)) : e;
- },
- Zy = qt,
- Jy = zy,
- Ky = A,
- qy = Qe,
- Qy = Error,
- $y = S(''.replace),
- tg = String(Qy('zxcasd').stack),
- eg = /\n\s*at [^:]*:[^\n]*/,
- rg = eg.test(tg),
- ng = et,
- ig = yr,
- og = nu,
- sg = fe('iterator'),
- ag = Array.prototype,
- ug = function (t) {
- return void 0 !== t && (og.Array === t || ag[sg] === t);
- },
- cg = rn,
- hg = Lt,
- lg = Y,
- dg = nu,
- fg = fe('iterator'),
- pg = function (t) {
- if (!lg(t)) return hg(t, fg) || hg(t, '@@iterator') || dg[cg(t)];
- },
- vg = D,
- mg = It,
- yg = nr,
- gg = Ct,
- _g = pg,
- bg = TypeError,
- Tg = function (t, e) {
- var r = arguments.length < 2 ? _g(t) : e;
- if (mg(r)) return yg(vg(r, t));
- throw bg(gg(t) + ' is not iterable');
- },
- xg = D,
- Eg = nr,
- Sg = Lt,
- wg = function (t, e, r) {
- var n, i;
- Eg(t);
- try {
- if (!(n = Sg(t, 'return'))) {
- if ('throw' === e) throw r;
- return r;
- }
- n = xg(n, t);
- } catch (t) {
- (i = !0), (n = t);
- }
- if ('throw' === e) throw r;
- if (i) throw n;
- return Eg(n), r;
- },
- Rg = qe,
- Cg = D,
- Pg = nr,
- Ag = Ct,
- Og = ug,
- Ig = jr,
- Mg = ut,
- Dg = Tg,
- Lg = pg,
- Fg = wg,
- Ng = TypeError,
- kg = function (t, e) {
- (this.stopped = t), (this.result = e);
- },
- Bg = kg.prototype,
- Gg = function (t, e, r) {
- var n,
- i,
- o,
- s,
- a,
- u,
- c,
- h = r && r.that,
- l = !(!r || !r.AS_ENTRIES),
- d = !(!r || !r.IS_RECORD),
- f = !(!r || !r.IS_ITERATOR),
- p = !(!r || !r.INTERRUPTED),
- v = Rg(e, h),
- m = function (t) {
- return n && Fg(n, 'normal', t), new kg(!0, t);
- },
- y = function (t) {
- return l
- ? (Pg(t), p ? v(t[0], t[1], m) : v(t[0], t[1]))
- : p
- ? v(t, m)
- : v(t);
- };
- if (d) n = t.iterator;
- else if (f) n = t;
- else {
- if (!(i = Lg(t))) throw Ng(Ag(t) + ' is not iterable');
- if (Og(i)) {
- for (o = 0, s = Ig(t); s > o; o++)
- if ((a = y(t[o])) && Mg(Bg, a)) return a;
- return new kg(!1);
- }
- n = Dg(t, i);
- }
- for (u = d ? t.next : n.next; !(c = Cg(u, n)).done; ) {
- try {
- a = y(c.value);
- } catch (t) {
- Fg(n, 'throw', t);
- }
- if ('object' == typeof a && a && Mg(Bg, a)) return a;
- }
- return new kg(!1);
- },
- Ug = Kn,
- jg = U,
- Xg = !s(function () {
- var t = Error('a');
- return (
- !('stack' in t) ||
- (Object.defineProperty(t, 'stack', jg(1, 7)), 7 !== t.stack)
- );
- }),
- Vg = Ar,
- Hg = ut,
- Wg = gu,
- Yg = Xu,
- zg = function (t, e, r) {
- for (var n = Jy(e), i = qy.f, o = Ky.f, s = 0; s < n.length; s++) {
- var a = n[s];
- Zy(t, a) || (r && Zy(r, a)) || i(t, a, o(e, a));
- }
- },
- Zg = ji,
- Jg = yr,
- Kg = U,
- qg = function (t, e) {
- if (rg && 'string' == typeof t && !Qy.prepareStackTrace)
- for (; e--; ) t = $y(t, eg, '');
- return t;
- },
- Qg = function (t, e) {
- ng(e) && 'cause' in e && ig(t, 'cause', e.cause);
- },
- $g = Gg,
- t_ = function (t, e) {
- return void 0 === t ? (arguments.length < 2 ? '' : e) : Ug(t);
- },
- e_ = Xg,
- r_ = fe('toStringTag'),
- n_ = Error,
- i_ = [].push,
- o_ = function (t, e) {
- var r,
- n = arguments.length > 2 ? arguments[2] : void 0,
- i = Hg(s_, this);
- Yg
- ? (r = Yg(n_(), i ? Wg(this) : s_))
- : ((r = i ? this : Zg(s_)), Jg(r, r_, 'Error')),
- void 0 !== e && Jg(r, 'message', t_(e)),
- e_ && Jg(r, 'stack', qg(r.stack, 1)),
- Qg(r, n);
- var o = [];
- return $g(t, i_, { that: o }), Jg(r, 'errors', o), r;
- };
- Yg ? Yg(o_, n_) : zg(o_, n_, { name: !0 });
- var s_ = (o_.prototype = Zg(n_.prototype, {
- constructor: Kg(1, o_),
- message: Kg(1, ''),
- name: Kg(1, 'AggregateError'),
- }));
- Vg({ global: !0, constructor: !0, arity: 2 }, { AggregateError: o_ });
- var a_,
- u_,
- c_,
- h_,
- l_ = 'process' == T(o.process),
- d_ = at,
- f_ = Qe,
- p_ = O,
- v_ = fe('species'),
- m_ = ut,
- y_ = TypeError,
- g_ = function (t, e) {
- if (m_(e, t)) return t;
- throw y_('Incorrect invocation');
- },
- __ = Tn,
- b_ = Ct,
- T_ = TypeError,
- x_ = nr,
- E_ = function (t) {
- if (__(t)) return t;
- throw T_(b_(t) + ' is not a constructor');
- },
- S_ = Y,
- w_ = fe('species'),
- R_ = function (t, e) {
- var r,
- n = x_(t).constructor;
- return void 0 === n || S_((r = x_(n)[w_])) ? e : E_(r);
- },
- C_ = /(?:ipad|iphone|ipod).*applewebkit/i.test(ct),
- P_ = o,
- A_ = d,
- O_ = qe,
- I_ = P,
- M_ = qt,
- D_ = s,
- L_ = wi,
- F_ = xa,
- N_ = Ce,
- k_ = ql,
- B_ = C_,
- G_ = l_,
- U_ = P_.setImmediate,
- j_ = P_.clearImmediate,
- X_ = P_.process,
- V_ = P_.Dispatch,
- H_ = P_.Function,
- W_ = P_.MessageChannel,
- Y_ = P_.String,
- z_ = 0,
- Z_ = {},
- J_ = 'onreadystatechange';
- try {
- a_ = P_.location;
- } catch (t) {}
- var K_ = function (t) {
- if (M_(Z_, t)) {
- var e = Z_[t];
- delete Z_[t], e();
- }
- },
- q_ = function (t) {
- return function () {
- K_(t);
- };
- },
- Q_ = function (t) {
- K_(t.data);
- },
- $_ = function (t) {
- P_.postMessage(Y_(t), a_.protocol + '//' + a_.host);
- };
- (U_ && j_) ||
- ((U_ = function (t) {
- k_(arguments.length, 1);
- var e = I_(t) ? t : H_(t),
- r = F_(arguments, 1);
- return (
- (Z_[++z_] = function () {
- A_(e, void 0, r);
- }),
- u_(z_),
- z_
- );
- }),
- (j_ = function (t) {
- delete Z_[t];
- }),
- G_
- ? (u_ = function (t) {
- X_.nextTick(q_(t));
- })
- : V_ && V_.now
- ? (u_ = function (t) {
- V_.now(q_(t));
- })
- : W_ && !B_
- ? ((h_ = (c_ = new W_()).port2),
- (c_.port1.onmessage = Q_),
- (u_ = O_(h_.postMessage, h_)))
- : P_.addEventListener &&
- I_(P_.postMessage) &&
- !P_.importScripts &&
- a_ &&
- 'file:' !== a_.protocol &&
- !D_($_)
- ? ((u_ = $_), P_.addEventListener('message', Q_, !1))
- : (u_ =
- J_ in N_('script')
- ? function (t) {
- L_.appendChild(N_('script')).onreadystatechange = function () {
- L_.removeChild(this), K_(t);
- };
- }
- : function (t) {
- setTimeout(q_(t), 0);
- }));
- var tb,
- eb,
- rb,
- nb,
- ib,
- ob,
- sb,
- ab,
- ub = { set: U_, clear: j_ },
- cb = o,
- hb = /ipad|iphone|ipod/i.test(ct) && void 0 !== cb.Pebble,
- lb = /web0s(?!.*chrome)/i.test(ct),
- db = o,
- fb = qe,
- pb = A.f,
- vb = ub.set,
- mb = C_,
- yb = hb,
- gb = lb,
- _b = l_,
- bb = db.MutationObserver || db.WebKitMutationObserver,
- Tb = db.document,
- xb = db.process,
- Eb = db.Promise,
- Sb = pb(db, 'queueMicrotask'),
- wb = Sb && Sb.value;
- wb ||
- ((tb = function () {
- var t, e;
- for (_b && (t = xb.domain) && t.exit(); eb; ) {
- (e = eb.fn), (eb = eb.next);
- try {
- e();
- } catch (t) {
- throw (eb ? nb() : (rb = void 0), t);
- }
- }
- (rb = void 0), t && t.enter();
- }),
- mb || _b || gb || !bb || !Tb
- ? !yb && Eb && Eb.resolve
- ? (((sb = Eb.resolve(void 0)).constructor = Eb),
- (ab = fb(sb.then, sb)),
- (nb = function () {
- ab(tb);
- }))
- : _b
- ? (nb = function () {
- xb.nextTick(tb);
- })
- : ((vb = fb(vb, db)),
- (nb = function () {
- vb(tb);
- }))
- : ((ib = !0),
- (ob = Tb.createTextNode('')),
- new bb(tb).observe(ob, { characterData: !0 }),
- (nb = function () {
- ob.data = ib = !ib;
- })));
- var Rb =
- wb ||
- function (t) {
- var e = { fn: t, next: void 0 };
- rb && (rb.next = e), eb || ((eb = e), nb()), (rb = e);
- },
- Cb = o,
- Pb = function (t) {
- try {
- return { error: !1, value: t() };
- } catch (t) {
- return { error: !0, value: t };
- }
- },
- Ab = function () {
- (this.head = null), (this.tail = null);
- };
- Ab.prototype = {
- add: function (t) {
- var e = { item: t, next: null };
- this.head ? (this.tail.next = e) : (this.head = e), (this.tail = e);
- },
- get: function () {
- var t = this.head;
- if (t)
- return (
- (this.head = t.next), this.tail === t && (this.tail = null), t.item
- );
- },
- };
- var Ob = Ab,
- Ib = o.Promise,
- Mb = 'object' == typeof Deno && Deno && 'object' == typeof Deno.version,
- Db = !Mb && !l_ && 'object' == typeof window && 'object' == typeof document,
- Lb = o,
- Fb = Ib,
- Nb = P,
- kb = ze,
- Bb = an,
- Gb = fe,
- Ub = Db,
- jb = Mb,
- Xb = mt,
- Vb = Fb && Fb.prototype,
- Hb = Gb('species'),
- Wb = !1,
- Yb = Nb(Lb.PromiseRejectionEvent),
- zb = kb('Promise', function () {
- var t = Bb(Fb),
- e = t !== String(Fb);
- if (!e && 66 === Xb) return !0;
- if (!Vb.catch || !Vb.finally) return !0;
- if (!Xb || Xb < 51 || !/native code/.test(t)) {
- var r = new Fb(function (t) {
- t(1);
- }),
- n = function (t) {
- t(
- function () {},
- function () {}
- );
- };
- if (
- (((r.constructor = {})[Hb] = n),
- !(Wb = r.then(function () {}) instanceof n))
- )
- return !0;
- }
- return !e && (Ub || jb) && !Yb;
- }),
- Zb = { CONSTRUCTOR: zb, REJECTION_EVENT: Yb, SUBCLASSING: Wb },
- Jb = {},
- Kb = It,
- qb = TypeError,
- Qb = function (t) {
- var e, r;
- (this.promise = new t(function (t, n) {
- if (void 0 !== e || void 0 !== r) throw qb('Bad Promise constructor');
- (e = t), (r = n);
- })),
- (this.resolve = Kb(e)),
- (this.reject = Kb(r));
- };
- Jb.f = function (t) {
- return new Qb(t);
- };
- var $b,
- tT,
- eT = Ar,
- rT = l_,
- nT = o,
- iT = D,
- oT = oo,
- sT = Oo,
- aT = function (t) {
- var e = d_(t),
- r = f_.f;
- p_ &&
- e &&
- !e[v_] &&
- r(e, v_, {
- configurable: !0,
- get: function () {
- return this;
- },
- });
- },
- uT = It,
- cT = P,
- hT = et,
- lT = g_,
- dT = R_,
- fT = ub.set,
- pT = Rb,
- vT = function (t, e) {
- var r = Cb.console;
- r && r.error && (1 == arguments.length ? r.error(t) : r.error(t, e));
- },
- mT = Pb,
- yT = Ob,
- gT = Yo,
- _T = Ib,
- bT = Zb,
- TT = Jb,
- xT = 'Promise',
- ET = bT.CONSTRUCTOR,
- ST = bT.REJECTION_EVENT,
- wT = gT.getterFor(xT),
- RT = gT.set,
- CT = _T && _T.prototype,
- PT = _T,
- AT = CT,
- OT = nT.TypeError,
- IT = nT.document,
- MT = nT.process,
- DT = TT.f,
- LT = DT,
- FT = !!(IT && IT.createEvent && nT.dispatchEvent),
- NT = 'unhandledrejection',
- kT = function (t) {
- var e;
- return !(!hT(t) || !cT((e = t.then))) && e;
- },
- BT = function (t, e) {
- var r,
- n,
- i,
- o = e.value,
- s = 1 == e.state,
- a = s ? t.ok : t.fail,
- u = t.resolve,
- c = t.reject,
- h = t.domain;
- try {
- a
- ? (s || (2 === e.rejection && VT(e), (e.rejection = 1)),
- !0 === a
- ? (r = o)
- : (h && h.enter(), (r = a(o)), h && (h.exit(), (i = !0))),
- r === t.promise
- ? c(OT('Promise-chain cycle'))
- : (n = kT(r))
- ? iT(n, r, u, c)
- : u(r))
- : c(o);
- } catch (t) {
- h && !i && h.exit(), c(t);
- }
- },
- GT = function (t, e) {
- t.notified ||
- ((t.notified = !0),
- pT(function () {
- for (var r, n = t.reactions; (r = n.get()); ) BT(r, t);
- (t.notified = !1), e && !t.rejection && jT(t);
- }));
- },
- UT = function (t, e, r) {
- var n, i;
- FT
- ? (((n = IT.createEvent('Event')).promise = e),
- (n.reason = r),
- n.initEvent(t, !1, !0),
- nT.dispatchEvent(n))
- : (n = { promise: e, reason: r }),
- !ST && (i = nT['on' + t])
- ? i(n)
- : t === NT && vT('Unhandled promise rejection', r);
- },
- jT = function (t) {
- iT(fT, nT, function () {
- var e,
- r = t.facade,
- n = t.value;
- if (
- XT(t) &&
- ((e = mT(function () {
- rT ? MT.emit('unhandledRejection', n, r) : UT(NT, r, n);
- })),
- (t.rejection = rT || XT(t) ? 2 : 1),
- e.error)
- )
- throw e.value;
- });
- },
- XT = function (t) {
- return 1 !== t.rejection && !t.parent;
- },
- VT = function (t) {
- iT(fT, nT, function () {
- var e = t.facade;
- rT
- ? MT.emit('rejectionHandled', e)
- : UT('rejectionhandled', e, t.value);
- });
- },
- HT = function (t, e, r) {
- return function (n) {
- t(e, n, r);
- };
- },
- WT = function (t, e, r) {
- t.done ||
- ((t.done = !0), r && (t = r), (t.value = e), (t.state = 2), GT(t, !0));
- },
- YT = function (t, e, r) {
- if (!t.done) {
- (t.done = !0), r && (t = r);
- try {
- if (t.facade === e) throw OT("Promise can't be resolved itself");
- var n = kT(e);
- n
- ? pT(function () {
- var r = { done: !1 };
- try {
- iT(n, e, HT(YT, r, t), HT(WT, r, t));
- } catch (e) {
- WT(r, e, t);
- }
- })
- : ((t.value = e), (t.state = 1), GT(t, !1));
- } catch (e) {
- WT({ done: !1 }, e, t);
- }
- }
- };
- ET &&
- ((AT = (PT = function (t) {
- lT(this, AT), uT(t), iT($b, this);
- var e = wT(this);
- try {
- t(HT(YT, e), HT(WT, e));
- } catch (t) {
- WT(e, t);
- }
- }).prototype),
- (($b = function (t) {
- RT(this, {
- type: xT,
- done: !1,
- notified: !1,
- parent: !1,
- reactions: new yT(),
- rejection: !1,
- state: 0,
- value: void 0,
- });
- }).prototype = oT(AT, 'then', function (t, e) {
- var r = wT(this),
- n = DT(dT(this, PT));
- return (
- (r.parent = !0),
- (n.ok = !cT(t) || t),
- (n.fail = cT(e) && e),
- (n.domain = rT ? MT.domain : void 0),
- 0 == r.state
- ? r.reactions.add(n)
- : pT(function () {
- BT(n, r);
- }),
- n.promise
- );
- })),
- (tT = function () {
- var t = new $b(),
- e = wT(t);
- (this.promise = t), (this.resolve = HT(YT, e)), (this.reject = HT(WT, e));
- }),
- (TT.f = DT =
- function (t) {
- return t === PT || undefined === t ? new tT(t) : LT(t);
- })),
- eT({ global: !0, constructor: !0, wrap: !0, forced: ET }, { Promise: PT }),
- sT(PT, xT, !1, !0),
- aT(xT);
- var zT = fe('iterator'),
- ZT = !1;
- try {
- var JT = 0,
- KT = {
- next: function () {
- return { done: !!JT++ };
- },
- return: function () {
- ZT = !0;
- },
- };
- (KT[zT] = function () {
- return this;
- }),
- Array.from(KT, function () {
- throw 2;
- });
- } catch (t) {}
- var qT = Ib,
- QT = function (t, e) {
- if (!e && !ZT) return !1;
- var r = !1;
- try {
- var n = {};
- (n[zT] = function () {
- return {
- next: function () {
- return { done: (r = !0) };
- },
- };
- }),
- t(n);
- } catch (t) {}
- return r;
- },
- $T =
- Zb.CONSTRUCTOR ||
- !QT(function (t) {
- qT.all(t).then(void 0, function () {});
- }),
- tx = D,
- ex = It,
- rx = Jb,
- nx = Pb,
- ix = Gg;
- Ar(
- { target: 'Promise', stat: !0, forced: $T },
- {
- all: function (t) {
- var e = this,
- r = rx.f(e),
- n = r.resolve,
- i = r.reject,
- o = nx(function () {
- var r = ex(e.resolve),
- o = [],
- s = 0,
- a = 1;
- ix(t, function (t) {
- var u = s++,
- c = !1;
- a++,
- tx(r, e, t).then(function (t) {
- c || ((c = !0), (o[u] = t), --a || n(o));
- }, i);
- }),
- --a || n(o);
- });
- return o.error && i(o.value), r.promise;
- },
- }
- );
- var ox = Ar,
- sx = Zb.CONSTRUCTOR;
- Ib && Ib.prototype,
- ox(
- { target: 'Promise', proto: !0, forced: sx, real: !0 },
- {
- catch: function (t) {
- return this.then(void 0, t);
- },
- }
- );
- var ax = D,
- ux = It,
- cx = Jb,
- hx = Pb,
- lx = Gg;
- Ar(
- { target: 'Promise', stat: !0, forced: $T },
- {
- race: function (t) {
- var e = this,
- r = cx.f(e),
- n = r.reject,
- i = hx(function () {
- var i = ux(e.resolve);
- lx(t, function (t) {
- ax(i, e, t).then(r.resolve, n);
- });
- });
- return i.error && n(i.value), r.promise;
- },
- }
- );
- var dx = D,
- fx = Jb;
- Ar(
- { target: 'Promise', stat: !0, forced: Zb.CONSTRUCTOR },
- {
- reject: function (t) {
- var e = fx.f(this);
- return dx(e.reject, void 0, t), e.promise;
- },
- }
- );
- var px = nr,
- vx = et,
- mx = Jb,
- yx = function (t, e) {
- if ((px(t), vx(e) && e.constructor === t)) return e;
- var r = mx.f(t);
- return (0, r.resolve)(e), r.promise;
- },
- gx = Ar,
- _x = Ib,
- bx = Zb.CONSTRUCTOR,
- Tx = yx,
- xx = at('Promise'),
- Ex = !bx;
- gx(
- { target: 'Promise', stat: !0, forced: true },
- {
- resolve: function (t) {
- return Tx(Ex && this === xx ? _x : this, t);
- },
- }
- );
- var Sx = D,
- wx = It,
- Rx = Jb,
- Cx = Pb,
- Px = Gg;
- Ar(
- { target: 'Promise', stat: !0 },
- {
- allSettled: function (t) {
- var e = this,
- r = Rx.f(e),
- n = r.resolve,
- i = r.reject,
- o = Cx(function () {
- var r = wx(e.resolve),
- i = [],
- o = 0,
- s = 1;
- Px(t, function (t) {
- var a = o++,
- u = !1;
- s++,
- Sx(r, e, t).then(
- function (t) {
- u ||
- ((u = !0),
- (i[a] = { status: 'fulfilled', value: t }),
- --s || n(i));
- },
- function (t) {
- u ||
- ((u = !0),
- (i[a] = { status: 'rejected', reason: t }),
- --s || n(i));
- }
- );
- }),
- --s || n(i);
- });
- return o.error && i(o.value), r.promise;
- },
- }
- );
- var Ax = D,
- Ox = It,
- Ix = at,
- Mx = Jb,
- Dx = Pb,
- Lx = Gg,
- Fx = 'No one promise resolved';
- Ar(
- { target: 'Promise', stat: !0 },
- {
- any: function (t) {
- var e = this,
- r = Ix('AggregateError'),
- n = Mx.f(e),
- i = n.resolve,
- o = n.reject,
- s = Dx(function () {
- var n = Ox(e.resolve),
- s = [],
- a = 0,
- u = 1,
- c = !1;
- Lx(t, function (t) {
- var h = a++,
- l = !1;
- u++,
- Ax(n, e, t).then(
- function (t) {
- l || c || ((c = !0), i(t));
- },
- function (t) {
- l || c || ((l = !0), (s[h] = t), --u || o(new r(s, Fx)));
- }
- );
- }),
- --u || o(new r(s, Fx));
- });
- return s.error && o(s.value), n.promise;
- },
- }
- );
- var Nx = Ar,
- kx = Ib,
- Bx = s,
- Gx = at,
- Ux = P,
- jx = R_,
- Xx = yx,
- Vx = kx && kx.prototype;
- Nx(
- {
- target: 'Promise',
- proto: !0,
- real: !0,
- forced:
- !!kx &&
- Bx(function () {
- Vx.finally.call({ then: function () {} }, function () {});
- }),
- },
- {
- finally: function (t) {
- var e = jx(this, Gx('Promise')),
- r = Ux(t);
- return this.then(
- r
- ? function (r) {
- return Xx(e, t()).then(function () {
- return r;
- });
- }
- : t,
- r
- ? function (r) {
- return Xx(e, t()).then(function () {
- throw r;
- });
- }
- : t
- );
- },
- }
- );
- var Hx = rt.Promise,
- Wx = Jb,
- Yx = Pb;
- Ar(
- { target: 'Promise', stat: !0, forced: !0 },
- {
- try: function (t) {
- var e = Wx.f(this),
- r = Yx(t);
- return (r.error ? e.reject : e.resolve)(r.value), e.promise;
- },
- }
- );
- var zx = Hx,
- Zx = /Version\/(\d+)\.(\d+)/i,
- Jx = /OS (\d+)_(\d+)_?(\d+)?/i;
- /firefox\/(\d+)\./i.test(navigator.userAgent);
- var Kx =
- /safari\/(\d+)\./i.test(navigator.userAgent) &&
- !/chrome\/(\d+)\./i.test(navigator.userAgent),
- qx = /iPhone|iPad|iOS/i.test(navigator.userAgent),
- Qx = (function () {
- var t = navigator.userAgent.match(Zx);
- return t ? [jy(t[1], 10), jy(t[2], 10)] : [];
- })(),
- $x =
- (Kx && 15 === Qx[0]) ||
- (qx &&
- 15 ===
- (function () {
- var t = navigator.userAgent.match(Jx);
- return t ? jy(t[1], 10) : null;
- })()),
- tE = Kx && 16 === Qx[0] && Qx[1] < 4,
- eE = function () {
- var t, e;
- return !(
- !(null === (t = navigator.mediaDevices) || void 0 === t
- ? void 0
- : t.enumerateDevices) ||
- !(null === (e = navigator.mediaDevices) || void 0 === e
- ? void 0
- : e.getUserMedia)
- );
- },
- rE = function () {
- var t;
- return !!(null === (t = navigator.mediaDevices) || void 0 === t
- ? void 0
- : t.getDisplayMedia);
- },
- nE = rt,
- iE = d;
- nE.JSON || (nE.JSON = { stringify: JSON.stringify });
- var oE = function (t, e, r) {
- return iE(nE.JSON.stringify, null, arguments);
- },
- sE = oE,
- aE = function (t, e) {
- return fetch(t, {
- body: sE(e),
- cache: 'no-cache',
- credentials: 'same-origin',
- headers: { 'content-type': 'application/json' },
- method: 'POST',
- mode: 'cors',
- }).then(function (t) {
- if (200 !== t.status) throw new Error('status Code:'.concat(t.status));
- return t.json();
- });
- },
- uE = Ar,
- cE = S,
- hE = Gr,
- lE = Kn,
- dE = Ll,
- fE = J,
- pE = Nl,
- vE = cE(''.endsWith),
- mE = cE(''.slice),
- yE = Math.min;
- uE(
- { target: 'String', proto: !0, forced: !pE('endsWith') },
- {
- endsWith: function (t) {
- var e = lE(fE(this));
- dE(t);
- var r = arguments.length > 1 ? arguments[1] : void 0,
- n = e.length,
- i = void 0 === r ? n : yE(hE(r), n),
- o = lE(t);
- return vE ? vE(e, o, i) : mE(e, i - o.length, i) === o;
- },
- }
- );
- var gE = sh('String').endsWith,
- _E = ut,
- bE = gE,
- TE = String.prototype,
- xE = function (t) {
- var e = t.endsWith;
- return 'string' == typeof t ||
- t === TE ||
- (_E(TE, t) && e === TE.endsWith)
- ? bE
- : e;
- },
- EE = ts.every;
- Ar(
- { target: 'Array', proto: !0, forced: !gh('every') },
- {
- every: function (t) {
- return EE(this, t, arguments.length > 1 ? arguments[1] : void 0);
- },
- }
- );
- var SE = sh('Array').every,
- wE = ut,
- RE = SE,
- CE = Array.prototype,
- PE = function (t) {
- var e = t.every;
- return t === CE || (wE(CE, t) && e === CE.every) ? RE : e;
- },
- AE = Yf('stream:device'),
- OE = (function () {
- function t() {
- this.mediaStream = null;
- }
- return (
- (t.prototype.start = function (t) {
- var e = t.video,
- r = t.audio;
- return Ed(this, void 0, void 0, function () {
- var t, n, i, o, s, a, u, c, h, l, d, f, p;
- return Sd(this, function (v) {
- switch (v.label) {
- case 0:
- if (this.mediaStream)
- return AE('stream is existed'), [2, this.mediaStream];
- (t = {}),
- e &&
- ((s = e.deviceId),
- (n = e.frameRate),
- (i = e.resolution),
- (o = {
- frameRate: { ideal: n },
- width: { ideal: i.width },
- height: { ideal: i.height },
- }),
- s &&
- (Jl(dp).call(dp, s)
- ? (o.facingMode = { exact: s })
- : (o.deviceId = { exact: s })),
- (t.video = o)),
- r &&
- ((s = r.deviceId),
- (a = r.sampleRate),
- (u = r.echoCancellation),
- (c = r.noiseSuppression),
- (h = r.autoGainControl),
- (l = {
- sampleRate: a,
- echoCancellation: u,
- noiseSuppression: c,
- autoGainControl: h,
- }),
- s && (l.deviceId = { exact: s }),
- (t.audio = l)),
- (v.label = 1);
- case 1:
- return (
- v.trys.push([1, 3, , 4]),
- (d = this),
- [4, navigator.mediaDevices.getUserMedia(t)]
- );
- case 2:
- return (d.mediaStream = v.sent()), [2, this.mediaStream];
- case 3:
- switch (
- ((f = v.sent()),
- AE('start error, '.concat(f.toString())),
- (p = ''),
- f.name)
- ) {
- case 'NotFoundError':
- case 'DevicesNotFoundError':
- p = 'NotFoundError';
- break;
- case 'NotAllowedError':
- case 'PermissionDeniedError':
- p = 'NotAllowedError';
- break;
- default:
- p = f.name;
- }
- throw (f.name !== p && (f.name = p), f);
- case 4:
- return [2];
- }
- });
- });
- }),
- (t.prototype.stop = function () {
- var t, e;
- null === (e = this.mediaStream) ||
- void 0 === e ||
- Ph((t = e.getTracks())).call(t, function (t) {
- 'ended' !== t.readyState && t.stop();
- }),
- (this.mediaStream = null);
- }),
- (t.prototype.getResolution = function () {
- if (!this.mediaStream) return null;
- var t = this.mediaStream.getVideoTracks();
- if (0 === t.length) return null;
- var e = t[0].getSettings();
- return { width: e.width, height: e.height };
- }),
- t
- );
- })(),
- IE = Yf('stream:screen'),
- ME = (function () {
- function t() {
- this.mediaStream = null;
- }
- return (
- (t.prototype.start = function (t) {
- var e = t.video,
- r = t.audio;
- return Ed(this, void 0, void 0, function () {
- var t, n, i, o, s, a, u, c, h, l;
- return Sd(this, function (d) {
- var f;
- switch (d.label) {
- case 0:
- if (this.mediaStream)
- return IE('stream is existed'), [2, this.mediaStream];
- (t = {}),
- e &&
- ((n = e.frameRate),
- (i = e.resolution),
- (o = {
- frameRate: { ideal: n },
- width: tE ? { max: i.width } : { ideal: i.width },
- height: tE ? { max: i.height } : { ideal: i.height },
- }),
- (t.video = o)),
- r &&
- ((s = r.echoCancellation),
- (a = r.noiseSuppression),
- (u = r.autoGainControl),
- (c = {
- echoCancellation: s,
- noiseSuppression: a,
- autoGainControl: u,
- }),
- (t.audio = c)),
- (d.label = 1);
- case 1:
- return (
- d.trys.push([1, 3, , 4]),
- (h = this),
- [4, navigator.mediaDevices.getDisplayMedia(t)]
- );
- case 2:
- return (
- (h.mediaStream = d.sent()),
- Ph((f = this.mediaStream.getVideoTracks())).call(
- f,
- function (r) {
- var n;
- null === (n = r.applyConstraints) ||
- void 0 === n ||
- n
- .call(
- r,
- xd(xd({}, t.video), {
- frameRate: {
- min: e.frameRate,
- ideal: e.frameRate,
- },
- })
- )
- .catch(function (t) {
- IE(
- 'video track applyConstraints error, '.concat(
- t.toString()
- )
- );
- }),
- (r.contentHint = 'detail');
- }
- ),
- [2, this.mediaStream]
- );
- case 3:
- throw (
- ((l = d.sent()),
- IE('start error, '.concat(l.toString())),
- l)
- );
- case 4:
- return [2];
- }
- });
- });
- }),
- (t.prototype.stop = function () {
- var t, e;
- null === (e = this.mediaStream) ||
- void 0 === e ||
- Ph((t = e.getTracks())).call(t, function (t) {
- 'ended' !== t.readyState && t.stop();
- }),
- (this.mediaStream = null);
- }),
- (t.prototype.getResolution = function () {
- if (!this.mediaStream) return null;
- var t = this.mediaStream.getVideoTracks();
- if (0 === t.length) return null;
- var e = t[0].getSettings();
- return { width: e.width, height: e.height };
- }),
- t
- );
- })(),
- DE = s,
- LE = fe('iterator'),
- FE = !DE(function () {
- var t = new URL('b?a=1&b=2&c=3', 'http://a'),
- e = t.searchParams,
- r = '';
- return (
- (t.pathname = 'c%20d'),
- e.forEach(function (t, n) {
- e.delete('b'), (r += n + t);
- }),
- !t.toJSON ||
- !e.sort ||
- 'http://a/c%20d?a=1&c=3' !== t.href ||
- '3' !== e.get('c') ||
- 'a=1' !== String(new URLSearchParams('?a=1')) ||
- !e[LE] ||
- 'a' !== new URL('https://a@b').username ||
- 'b' !== new URLSearchParams(new URLSearchParams('a=b')).get('a') ||
- 'xn--e1aybc' !== new URL('http://тест').host ||
- '#%D0%B1' !== new URL('http://a#б').hash ||
- 'a1c3' !== r ||
- 'x' !== new URL('http://x', void 0).host
- );
- }),
- NE = Qe,
- kE = O,
- BE = S,
- GE = D,
- UE = s,
- jE = yi,
- XE = no,
- VE = L,
- HE = Zt,
- WE = W,
- YE = Object.assign,
- zE = Object.defineProperty,
- ZE = BE([].concat),
- JE =
- !YE ||
- UE(function () {
- if (
- kE &&
- 1 !==
- YE(
- { b: 1 },
- YE(
- zE({}, 'a', {
- enumerable: !0,
- get: function () {
- zE(this, 'b', { value: 3, enumerable: !1 });
- },
- }),
- { b: 2 }
- )
- ).b
- )
- return !0;
- var t = {},
- e = {},
- r = Symbol(),
- n = 'abcdefghijklmnopqrst';
- return (
- (t[r] = 7),
- n.split('').forEach(function (t) {
- e[t] = t;
- }),
- 7 != YE({}, t)[r] || jE(YE({}, e)).join('') != n
- );
- })
- ? function (t, e) {
- for (
- var r = HE(t), n = arguments.length, i = 1, o = XE.f, s = VE.f;
- n > i;
- )
- for (
- var a,
- u = WE(arguments[i++]),
- c = o ? ZE(jE(u), o(u)) : jE(u),
- h = c.length,
- l = 0;
- h > l;
- )
- (a = c[l++]), (kE && !GE(s, u, a)) || (r[a] = u[a]);
- return r;
- }
- : YE,
- KE = nr,
- qE = wg,
- QE = qe,
- $E = D,
- tS = Zt,
- eS = function (t, e, r, n) {
- try {
- return n ? e(KE(r)[0], r[1]) : e(r);
- } catch (e) {
- qE(t, 'throw', e);
- }
- },
- rS = ug,
- nS = Tn,
- iS = jr,
- oS = zr,
- sS = Tg,
- aS = pg,
- uS = Array,
- cS = S,
- hS = 2147483647,
- lS = /[^\0-\u007E]/,
- dS = /[.\u3002\uFF0E\uFF61]/g,
- fS = 'Overflow: input needs wider integers to process',
- pS = RangeError,
- vS = cS(dS.exec),
- mS = Math.floor,
- yS = String.fromCharCode,
- gS = cS(''.charCodeAt),
- _S = cS([].join),
- bS = cS([].push),
- TS = cS(''.replace),
- xS = cS(''.split),
- ES = cS(''.toLowerCase),
- SS = function (t) {
- return t + 22 + 75 * (t < 26);
- },
- wS = function (t, e, r) {
- var n = 0;
- for (t = r ? mS(t / 700) : t >> 1, t += mS(t / e); t > 455; )
- (t = mS(t / 35)), (n += 36);
- return mS(n + (36 * t) / (t + 38));
- },
- RS = function (t) {
- var e = [];
- t = (function (t) {
- for (var e = [], r = 0, n = t.length; r < n; ) {
- var i = gS(t, r++);
- if (i >= 55296 && i <= 56319 && r < n) {
- var o = gS(t, r++);
- 56320 == (64512 & o)
- ? bS(e, ((1023 & i) << 10) + (1023 & o) + 65536)
- : (bS(e, i), r--);
- } else bS(e, i);
- }
- return e;
- })(t);
- var r,
- n,
- i = t.length,
- o = 128,
- s = 0,
- a = 72;
- for (r = 0; r < t.length; r++) (n = t[r]) < 128 && bS(e, yS(n));
- var u = e.length,
- c = u;
- for (u && bS(e, '-'); c < i; ) {
- var h = hS;
- for (r = 0; r < t.length; r++) (n = t[r]) >= o && n < h && (h = n);
- var l = c + 1;
- if (h - o > mS((hS - s) / l)) throw pS(fS);
- for (s += (h - o) * l, o = h, r = 0; r < t.length; r++) {
- if ((n = t[r]) < o && ++s > hS) throw pS(fS);
- if (n == o) {
- for (var d = s, f = 36; ; ) {
- var p = f <= a ? 1 : f >= a + 26 ? 26 : f - a;
- if (d < p) break;
- var v = d - p,
- m = 36 - p;
- bS(e, yS(SS(p + (v % m)))), (d = mS(v / m)), (f += 36);
- }
- bS(e, yS(SS(d))), (a = wS(s, l, c == u)), (s = 0), c++;
- }
- }
- s++, o++;
- }
- return _S(e, '');
- },
- CS = oo,
- PS = qi,
- AS = Math.floor,
- OS = function (t, e) {
- var r = t.length,
- n = AS(r / 2);
- return r < 8 ? IS(t, e) : MS(t, OS(PS(t, 0, n), e), OS(PS(t, n), e), e);
- },
- IS = function (t, e) {
- for (var r, n, i = t.length, o = 1; o < i; ) {
- for (n = o, r = t[o]; n && e(t[n - 1], r) > 0; ) t[n] = t[--n];
- n !== o++ && (t[n] = r);
- }
- return t;
- },
- MS = function (t, e, r, n) {
- for (var i = e.length, o = r.length, s = 0, a = 0; s < i || a < o; )
- t[s + a] =
- s < i && a < o
- ? n(e[s], r[a]) <= 0
- ? e[s++]
- : r[a++]
- : s < i
- ? e[s++]
- : r[a++];
- return t;
- },
- DS = Ar,
- LS = o,
- FS = D,
- NS = S,
- kS = O,
- BS = FE,
- GS = oo,
- US = function (t, e, r) {
- for (var n in e)
- r && r.unsafe && t[n] ? (t[n] = e[n]) : CS(t, n, e[n], r);
- return t;
- },
- jS = Oo,
- XS = Fu,
- VS = Yo,
- HS = g_,
- WS = P,
- YS = qt,
- zS = qe,
- ZS = rn,
- JS = nr,
- KS = et,
- qS = Kn,
- QS = ji,
- $S = U,
- tw = Tg,
- ew = pg,
- rw = ql,
- nw = OS,
- iw = fe('iterator'),
- ow = 'URLSearchParams',
- sw = 'URLSearchParamsIterator',
- aw = VS.set,
- uw = VS.getterFor(ow),
- cw = VS.getterFor(sw),
- hw = Object.getOwnPropertyDescriptor,
- lw = function (t) {
- if (!kS) return LS[t];
- var e = hw(LS, t);
- return e && e.value;
- },
- dw = lw('fetch'),
- fw = lw('Request'),
- pw = lw('Headers'),
- vw = fw && fw.prototype,
- mw = pw && pw.prototype,
- yw = LS.RegExp,
- gw = LS.TypeError,
- _w = LS.decodeURIComponent,
- bw = LS.encodeURIComponent,
- Tw = NS(''.charAt),
- xw = NS([].join),
- Ew = NS([].push),
- Sw = NS(''.replace),
- ww = NS([].shift),
- Rw = NS([].splice),
- Cw = NS(''.split),
- Pw = NS(''.slice),
- Aw = /\+/g,
- Ow = Array(4),
- Iw = function (t) {
- return (
- Ow[t - 1] || (Ow[t - 1] = yw('((?:%[\\da-f]{2}){' + t + '})', 'gi'))
- );
- },
- Mw = function (t) {
- try {
- return _w(t);
- } catch (e) {
- return t;
- }
- },
- Dw = function (t) {
- var e = Sw(t, Aw, ' '),
- r = 4;
- try {
- return _w(e);
- } catch (t) {
- for (; r; ) e = Sw(e, Iw(r--), Mw);
- return e;
- }
- },
- Lw = /[!'()~]|%20/g,
- Fw = {
- '!': '%21',
- "'": '%27',
- '(': '%28',
- ')': '%29',
- '~': '%7E',
- '%20': '+',
- },
- Nw = function (t) {
- return Fw[t];
- },
- kw = function (t) {
- return Sw(bw(t), Lw, Nw);
- },
- Bw = XS(
- function (t, e) {
- aw(this, { type: sw, iterator: tw(uw(t).entries), kind: e });
- },
- 'Iterator',
- function () {
- var t = cw(this),
- e = t.kind,
- r = t.iterator.next(),
- n = r.value;
- return (
- r.done ||
- (r.value =
- 'keys' === e
- ? n.key
- : 'values' === e
- ? n.value
- : [n.key, n.value]),
- r
- );
- },
- !0
- ),
- Gw = function (t) {
- (this.entries = []),
- (this.url = null),
- void 0 !== t &&
- (KS(t)
- ? this.parseObject(t)
- : this.parseQuery(
- 'string' == typeof t ? ('?' === Tw(t, 0) ? Pw(t, 1) : t) : qS(t)
- ));
- };
- Gw.prototype = {
- type: ow,
- bindURL: function (t) {
- (this.url = t), this.update();
- },
- parseObject: function (t) {
- var e,
- r,
- n,
- i,
- o,
- s,
- a,
- u = ew(t);
- if (u)
- for (r = (e = tw(t, u)).next; !(n = FS(r, e)).done; ) {
- if (
- ((o = (i = tw(JS(n.value))).next),
- (s = FS(o, i)).done || (a = FS(o, i)).done || !FS(o, i).done)
- )
- throw gw('Expected sequence with length 2');
- Ew(this.entries, { key: qS(s.value), value: qS(a.value) });
- }
- else
- for (var c in t)
- YS(t, c) && Ew(this.entries, { key: c, value: qS(t[c]) });
- },
- parseQuery: function (t) {
- if (t)
- for (var e, r, n = Cw(t, '&'), i = 0; i < n.length; )
- (e = n[i++]).length &&
- ((r = Cw(e, '=')),
- Ew(this.entries, { key: Dw(ww(r)), value: Dw(xw(r, '=')) }));
- },
- serialize: function () {
- for (var t, e = this.entries, r = [], n = 0; n < e.length; )
- (t = e[n++]), Ew(r, kw(t.key) + '=' + kw(t.value));
- return xw(r, '&');
- },
- update: function () {
- (this.entries.length = 0), this.parseQuery(this.url.query);
- },
- updateURL: function () {
- this.url && this.url.update();
- },
- };
- var Uw = function () {
- HS(this, jw);
- var t = arguments.length > 0 ? arguments[0] : void 0;
- aw(this, new Gw(t));
- },
- jw = Uw.prototype;
- if (
- (US(
- jw,
- {
- append: function (t, e) {
- rw(arguments.length, 2);
- var r = uw(this);
- Ew(r.entries, { key: qS(t), value: qS(e) }), r.updateURL();
- },
- delete: function (t) {
- rw(arguments.length, 1);
- for (
- var e = uw(this), r = e.entries, n = qS(t), i = 0;
- i < r.length;
- )
- r[i].key === n ? Rw(r, i, 1) : i++;
- e.updateURL();
- },
- get: function (t) {
- rw(arguments.length, 1);
- for (var e = uw(this).entries, r = qS(t), n = 0; n < e.length; n++)
- if (e[n].key === r) return e[n].value;
- return null;
- },
- getAll: function (t) {
- rw(arguments.length, 1);
- for (
- var e = uw(this).entries, r = qS(t), n = [], i = 0;
- i < e.length;
- i++
- )
- e[i].key === r && Ew(n, e[i].value);
- return n;
- },
- has: function (t) {
- rw(arguments.length, 1);
- for (var e = uw(this).entries, r = qS(t), n = 0; n < e.length; )
- if (e[n++].key === r) return !0;
- return !1;
- },
- set: function (t, e) {
- rw(arguments.length, 1);
- for (
- var r,
- n = uw(this),
- i = n.entries,
- o = !1,
- s = qS(t),
- a = qS(e),
- u = 0;
- u < i.length;
- u++
- )
- (r = i[u]).key === s &&
- (o ? Rw(i, u--, 1) : ((o = !0), (r.value = a)));
- o || Ew(i, { key: s, value: a }), n.updateURL();
- },
- sort: function () {
- var t = uw(this);
- nw(t.entries, function (t, e) {
- return t.key > e.key ? 1 : -1;
- }),
- t.updateURL();
- },
- forEach: function (t) {
- for (
- var e,
- r = uw(this).entries,
- n = zS(t, arguments.length > 1 ? arguments[1] : void 0),
- i = 0;
- i < r.length;
- )
- n((e = r[i++]).value, e.key, this);
- },
- keys: function () {
- return new Bw(this, 'keys');
- },
- values: function () {
- return new Bw(this, 'values');
- },
- entries: function () {
- return new Bw(this, 'entries');
- },
- },
- { enumerable: !0 }
- ),
- GS(jw, iw, jw.entries, { name: 'entries' }),
- GS(
- jw,
- 'toString',
- function () {
- return uw(this).serialize();
- },
- { enumerable: !0 }
- ),
- jS(Uw, ow),
- DS({ global: !0, constructor: !0, forced: !BS }, { URLSearchParams: Uw }),
- !BS && WS(pw))
- ) {
- var Xw = NS(mw.has),
- Vw = NS(mw.set),
- Hw = function (t) {
- if (KS(t)) {
- var e,
- r = t.body;
- if (ZS(r) === ow)
- return (
- (e = t.headers ? new pw(t.headers) : new pw()),
- Xw(e, 'content-type') ||
- Vw(
- e,
- 'content-type',
- 'application/x-www-form-urlencoded;charset=UTF-8'
- ),
- QS(t, { body: $S(0, qS(r)), headers: $S(0, e) })
- );
- }
- return t;
- };
- if (
- (WS(dw) &&
- DS(
- { global: !0, enumerable: !0, dontCallGetSet: !0, forced: !0 },
- {
- fetch: function (t) {
- return dw(t, arguments.length > 1 ? Hw(arguments[1]) : {});
- },
- }
- ),
- WS(fw))
- ) {
- var Ww = function (t) {
- return (
- HS(this, vw), new fw(t, arguments.length > 1 ? Hw(arguments[1]) : {})
- );
- };
- (vw.constructor = Ww),
- (Ww.prototype = vw),
- DS(
- { global: !0, constructor: !0, dontCallGetSet: !0, forced: !0 },
- { Request: Ww }
- );
- }
- }
- var Yw,
- zw = Ar,
- Zw = O,
- Jw = FE,
- Kw = o,
- qw = qe,
- Qw = S,
- $w = oo,
- tR = function (t, e, r) {
- return NE.f(t, e, r);
- },
- eR = g_,
- rR = qt,
- nR = JE,
- iR = function (t) {
- var e = tS(t),
- r = nS(this),
- n = arguments.length,
- i = n > 1 ? arguments[1] : void 0,
- o = void 0 !== i;
- o && (i = QE(i, n > 2 ? arguments[2] : void 0));
- var s,
- a,
- u,
- c,
- h,
- l,
- d = aS(e),
- f = 0;
- if (!d || (this === uS && rS(d)))
- for (s = iS(e), a = r ? new this(s) : uS(s); s > f; f++)
- (l = o ? i(e[f], f) : e[f]), oS(a, f, l);
- else
- for (
- h = (c = sS(e, d)).next, a = r ? new this() : [];
- !(u = $E(h, c)).done;
- f++
- )
- (l = o ? eS(c, i, [u.value, f], !0) : u.value), oS(a, f, l);
- return (a.length = f), a;
- },
- oR = qi,
- sR = Fc.codeAt,
- aR = function (t) {
- var e,
- r,
- n = [],
- i = xS(TS(ES(t), dS, '.'), '.');
- for (e = 0; e < i.length; e++)
- (r = i[e]), bS(n, vS(lS, r) ? 'xn--' + RS(r) : r);
- return _S(n, '.');
- },
- uR = Kn,
- cR = Oo,
- hR = ql,
- lR = { URLSearchParams: Uw, getState: uw },
- dR = Yo,
- fR = dR.set,
- pR = dR.getterFor('URL'),
- vR = lR.URLSearchParams,
- mR = lR.getState,
- yR = Kw.URL,
- gR = Kw.TypeError,
- _R = Kw.parseInt,
- bR = Math.floor,
- TR = Math.pow,
- xR = Qw(''.charAt),
- ER = Qw(/./.exec),
- SR = Qw([].join),
- wR = Qw((1).toString),
- RR = Qw([].pop),
- CR = Qw([].push),
- PR = Qw(''.replace),
- AR = Qw([].shift),
- OR = Qw(''.split),
- IR = Qw(''.slice),
- MR = Qw(''.toLowerCase),
- DR = Qw([].unshift),
- LR = 'Invalid scheme',
- FR = 'Invalid host',
- NR = 'Invalid port',
- kR = /[a-z]/i,
- BR = /[\d+-.a-z]/i,
- GR = /\d/,
- UR = /^0x/i,
- jR = /^[0-7]+$/,
- XR = /^\d+$/,
- VR = /^[\da-f]+$/i,
- HR = /[\0\t\n\r #%/:<>?@[\\\]^|]/,
- WR = /[\0\t\n\r #/:<>?@[\\\]^|]/,
- YR = /^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,
- zR = /[\t\n\r]/g,
- ZR = function (t) {
- var e, r, n, i;
- if ('number' == typeof t) {
- for (e = [], r = 0; r < 4; r++) DR(e, t % 256), (t = bR(t / 256));
- return SR(e, '.');
- }
- if ('object' == typeof t) {
- for (
- e = '',
- n = (function (t) {
- for (var e = null, r = 1, n = null, i = 0, o = 0; o < 8; o++)
- 0 !== t[o]
- ? (i > r && ((e = n), (r = i)), (n = null), (i = 0))
- : (null === n && (n = o), ++i);
- return i > r && ((e = n), (r = i)), e;
- })(t),
- r = 0;
- r < 8;
- r++
- )
- (i && 0 === t[r]) ||
- (i && (i = !1),
- n === r
- ? ((e += r ? ':' : '::'), (i = !0))
- : ((e += wR(t[r], 16)), r < 7 && (e += ':')));
- return '[' + e + ']';
- }
- return t;
- },
- JR = {},
- KR = nR({}, JR, { ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1 }),
- qR = nR({}, KR, { '#': 1, '?': 1, '{': 1, '}': 1 }),
- QR = nR({}, qR, {
- '/': 1,
- ':': 1,
- ';': 1,
- '=': 1,
- '@': 1,
- '[': 1,
- '\\': 1,
- ']': 1,
- '^': 1,
- '|': 1,
- }),
- $R = function (t, e) {
- var r = sR(t, 0);
- return r > 32 && r < 127 && !rR(e, t) ? t : encodeURIComponent(t);
- },
- tC = { ftp: 21, file: null, http: 80, https: 443, ws: 80, wss: 443 },
- eC = function (t, e) {
- var r;
- return (
- 2 == t.length &&
- ER(kR, xR(t, 0)) &&
- (':' == (r = xR(t, 1)) || (!e && '|' == r))
- );
- },
- rC = function (t) {
- var e;
- return (
- t.length > 1 &&
- eC(IR(t, 0, 2)) &&
- (2 == t.length ||
- '/' === (e = xR(t, 2)) ||
- '\\' === e ||
- '?' === e ||
- '#' === e)
- );
- },
- nC = function (t) {
- return '.' === t || '%2e' === MR(t);
- },
- iC = {},
- oC = {},
- sC = {},
- aC = {},
- uC = {},
- cC = {},
- hC = {},
- lC = {},
- dC = {},
- fC = {},
- pC = {},
- vC = {},
- mC = {},
- yC = {},
- gC = {},
- _C = {},
- bC = {},
- TC = {},
- xC = {},
- EC = {},
- SC = {},
- wC = function (t, e, r) {
- var n,
- i,
- o,
- s = uR(t);
- if (e) {
- if ((i = this.parse(s))) throw gR(i);
- this.searchParams = null;
- } else {
- if ((void 0 !== r && (n = new wC(r, !0)), (i = this.parse(s, null, n))))
- throw gR(i);
- (o = mR(new vR())).bindURL(this), (this.searchParams = o);
- }
- };
- wC.prototype = {
- type: 'URL',
- parse: function (t, e, r) {
- var n,
- i,
- o,
- s,
- a,
- u = this,
- c = e || iC,
- h = 0,
- l = '',
- d = !1,
- f = !1,
- p = !1;
- for (
- t = uR(t),
- e ||
- ((u.scheme = ''),
- (u.username = ''),
- (u.password = ''),
- (u.host = null),
- (u.port = null),
- (u.path = []),
- (u.query = null),
- (u.fragment = null),
- (u.cannotBeABaseURL = !1),
- (t = PR(t, YR, ''))),
- t = PR(t, zR, ''),
- n = iR(t);
- h <= n.length;
- ) {
- switch (((i = n[h]), c)) {
- case iC:
- if (!i || !ER(kR, i)) {
- if (e) return LR;
- c = sC;
- continue;
- }
- (l += MR(i)), (c = oC);
- break;
- case oC:
- if (i && (ER(BR, i) || '+' == i || '-' == i || '.' == i))
- l += MR(i);
- else {
- if (':' != i) {
- if (e) return LR;
- (l = ''), (c = sC), (h = 0);
- continue;
- }
- if (
- e &&
- (u.isSpecial() != rR(tC, l) ||
- ('file' == l &&
- (u.includesCredentials() || null !== u.port)) ||
- ('file' == u.scheme && !u.host))
- )
- return;
- if (((u.scheme = l), e))
- return void (
- u.isSpecial() &&
- tC[u.scheme] == u.port &&
- (u.port = null)
- );
- (l = ''),
- 'file' == u.scheme
- ? (c = yC)
- : u.isSpecial() && r && r.scheme == u.scheme
- ? (c = aC)
- : u.isSpecial()
- ? (c = lC)
- : '/' == n[h + 1]
- ? ((c = uC), h++)
- : ((u.cannotBeABaseURL = !0), CR(u.path, ''), (c = xC));
- }
- break;
- case sC:
- if (!r || (r.cannotBeABaseURL && '#' != i)) return LR;
- if (r.cannotBeABaseURL && '#' == i) {
- (u.scheme = r.scheme),
- (u.path = oR(r.path)),
- (u.query = r.query),
- (u.fragment = ''),
- (u.cannotBeABaseURL = !0),
- (c = SC);
- break;
- }
- c = 'file' == r.scheme ? yC : cC;
- continue;
- case aC:
- if ('/' != i || '/' != n[h + 1]) {
- c = cC;
- continue;
- }
- (c = dC), h++;
- break;
- case uC:
- if ('/' == i) {
- c = fC;
- break;
- }
- c = TC;
- continue;
- case cC:
- if (((u.scheme = r.scheme), i == Yw))
- (u.username = r.username),
- (u.password = r.password),
- (u.host = r.host),
- (u.port = r.port),
- (u.path = oR(r.path)),
- (u.query = r.query);
- else if ('/' == i || ('\\' == i && u.isSpecial())) c = hC;
- else if ('?' == i)
- (u.username = r.username),
- (u.password = r.password),
- (u.host = r.host),
- (u.port = r.port),
- (u.path = oR(r.path)),
- (u.query = ''),
- (c = EC);
- else {
- if ('#' != i) {
- (u.username = r.username),
- (u.password = r.password),
- (u.host = r.host),
- (u.port = r.port),
- (u.path = oR(r.path)),
- u.path.length--,
- (c = TC);
- continue;
- }
- (u.username = r.username),
- (u.password = r.password),
- (u.host = r.host),
- (u.port = r.port),
- (u.path = oR(r.path)),
- (u.query = r.query),
- (u.fragment = ''),
- (c = SC);
- }
- break;
- case hC:
- if (!u.isSpecial() || ('/' != i && '\\' != i)) {
- if ('/' != i) {
- (u.username = r.username),
- (u.password = r.password),
- (u.host = r.host),
- (u.port = r.port),
- (c = TC);
- continue;
- }
- c = fC;
- } else c = dC;
- break;
- case lC:
- if (((c = dC), '/' != i || '/' != xR(l, h + 1))) continue;
- h++;
- break;
- case dC:
- if ('/' != i && '\\' != i) {
- c = fC;
- continue;
- }
- break;
- case fC:
- if ('@' == i) {
- d && (l = '%40' + l), (d = !0), (o = iR(l));
- for (var v = 0; v < o.length; v++) {
- var m = o[v];
- if (':' != m || p) {
- var y = $R(m, QR);
- p ? (u.password += y) : (u.username += y);
- } else p = !0;
- }
- l = '';
- } else if (
- i == Yw ||
- '/' == i ||
- '?' == i ||
- '#' == i ||
- ('\\' == i && u.isSpecial())
- ) {
- if (d && '' == l) return 'Invalid authority';
- (h -= iR(l).length + 1), (l = ''), (c = pC);
- } else l += i;
- break;
- case pC:
- case vC:
- if (e && 'file' == u.scheme) {
- c = _C;
- continue;
- }
- if (':' != i || f) {
- if (
- i == Yw ||
- '/' == i ||
- '?' == i ||
- '#' == i ||
- ('\\' == i && u.isSpecial())
- ) {
- if (u.isSpecial() && '' == l) return FR;
- if (
- e &&
- '' == l &&
- (u.includesCredentials() || null !== u.port)
- )
- return;
- if ((s = u.parseHost(l))) return s;
- if (((l = ''), (c = bC), e)) return;
- continue;
- }
- '[' == i ? (f = !0) : ']' == i && (f = !1), (l += i);
- } else {
- if ('' == l) return FR;
- if ((s = u.parseHost(l))) return s;
- if (((l = ''), (c = mC), e == vC)) return;
- }
- break;
- case mC:
- if (!ER(GR, i)) {
- if (
- i == Yw ||
- '/' == i ||
- '?' == i ||
- '#' == i ||
- ('\\' == i && u.isSpecial()) ||
- e
- ) {
- if ('' != l) {
- var g = _R(l, 10);
- if (g > 65535) return NR;
- (u.port = u.isSpecial() && g === tC[u.scheme] ? null : g),
- (l = '');
- }
- if (e) return;
- c = bC;
- continue;
- }
- return NR;
- }
- l += i;
- break;
- case yC:
- if (((u.scheme = 'file'), '/' == i || '\\' == i)) c = gC;
- else {
- if (!r || 'file' != r.scheme) {
- c = TC;
- continue;
- }
- if (i == Yw)
- (u.host = r.host), (u.path = oR(r.path)), (u.query = r.query);
- else if ('?' == i)
- (u.host = r.host),
- (u.path = oR(r.path)),
- (u.query = ''),
- (c = EC);
- else {
- if ('#' != i) {
- rC(SR(oR(n, h), '')) ||
- ((u.host = r.host), (u.path = oR(r.path)), u.shortenPath()),
- (c = TC);
- continue;
- }
- (u.host = r.host),
- (u.path = oR(r.path)),
- (u.query = r.query),
- (u.fragment = ''),
- (c = SC);
- }
- }
- break;
- case gC:
- if ('/' == i || '\\' == i) {
- c = _C;
- break;
- }
- r &&
- 'file' == r.scheme &&
- !rC(SR(oR(n, h), '')) &&
- (eC(r.path[0], !0) ? CR(u.path, r.path[0]) : (u.host = r.host)),
- (c = TC);
- continue;
- case _C:
- if (i == Yw || '/' == i || '\\' == i || '?' == i || '#' == i) {
- if (!e && eC(l)) c = TC;
- else if ('' == l) {
- if (((u.host = ''), e)) return;
- c = bC;
- } else {
- if ((s = u.parseHost(l))) return s;
- if (('localhost' == u.host && (u.host = ''), e)) return;
- (l = ''), (c = bC);
- }
- continue;
- }
- l += i;
- break;
- case bC:
- if (u.isSpecial()) {
- if (((c = TC), '/' != i && '\\' != i)) continue;
- } else if (e || '?' != i)
- if (e || '#' != i) {
- if (i != Yw && ((c = TC), '/' != i)) continue;
- } else (u.fragment = ''), (c = SC);
- else (u.query = ''), (c = EC);
- break;
- case TC:
- if (
- i == Yw ||
- '/' == i ||
- ('\\' == i && u.isSpecial()) ||
- (!e && ('?' == i || '#' == i))
- ) {
- if (
- ('..' === (a = MR((a = l))) ||
- '%2e.' === a ||
- '.%2e' === a ||
- '%2e%2e' === a
- ? (u.shortenPath(),
- '/' == i || ('\\' == i && u.isSpecial()) || CR(u.path, ''))
- : nC(l)
- ? '/' == i || ('\\' == i && u.isSpecial()) || CR(u.path, '')
- : ('file' == u.scheme &&
- !u.path.length &&
- eC(l) &&
- (u.host && (u.host = ''), (l = xR(l, 0) + ':')),
- CR(u.path, l)),
- (l = ''),
- 'file' == u.scheme && (i == Yw || '?' == i || '#' == i))
- )
- for (; u.path.length > 1 && '' === u.path[0]; ) AR(u.path);
- '?' == i
- ? ((u.query = ''), (c = EC))
- : '#' == i && ((u.fragment = ''), (c = SC));
- } else l += $R(i, qR);
- break;
- case xC:
- '?' == i
- ? ((u.query = ''), (c = EC))
- : '#' == i
- ? ((u.fragment = ''), (c = SC))
- : i != Yw && (u.path[0] += $R(i, JR));
- break;
- case EC:
- e || '#' != i
- ? i != Yw &&
- ("'" == i && u.isSpecial()
- ? (u.query += '%27')
- : (u.query += '#' == i ? '%23' : $R(i, JR)))
- : ((u.fragment = ''), (c = SC));
- break;
- case SC:
- i != Yw && (u.fragment += $R(i, KR));
- }
- h++;
- }
- },
- parseHost: function (t) {
- var e, r, n;
- if ('[' == xR(t, 0)) {
- if (']' != xR(t, t.length - 1)) return FR;
- if (
- ((e = (function (t) {
- var e,
- r,
- n,
- i,
- o,
- s,
- a,
- u = [0, 0, 0, 0, 0, 0, 0, 0],
- c = 0,
- h = null,
- l = 0,
- d = function () {
- return xR(t, l);
- };
- if (':' == d()) {
- if (':' != xR(t, 1)) return;
- (l += 2), (h = ++c);
- }
- for (; d(); ) {
- if (8 == c) return;
- if (':' != d()) {
- for (e = r = 0; r < 4 && ER(VR, d()); )
- (e = 16 * e + _R(d(), 16)), l++, r++;
- if ('.' == d()) {
- if (0 == r) return;
- if (((l -= r), c > 6)) return;
- for (n = 0; d(); ) {
- if (((i = null), n > 0)) {
- if (!('.' == d() && n < 4)) return;
- l++;
- }
- if (!ER(GR, d())) return;
- for (; ER(GR, d()); ) {
- if (((o = _R(d(), 10)), null === i)) i = o;
- else {
- if (0 == i) return;
- i = 10 * i + o;
- }
- if (i > 255) return;
- l++;
- }
- (u[c] = 256 * u[c] + i), (2 != ++n && 4 != n) || c++;
- }
- if (4 != n) return;
- break;
- }
- if (':' == d()) {
- if ((l++, !d())) return;
- } else if (d()) return;
- u[c++] = e;
- } else {
- if (null !== h) return;
- l++, (h = ++c);
- }
- }
- if (null !== h)
- for (s = c - h, c = 7; 0 != c && s > 0; )
- (a = u[c]), (u[c--] = u[h + s - 1]), (u[h + --s] = a);
- else if (8 != c) return;
- return u;
- })(IR(t, 1, -1))),
- !e)
- )
- return FR;
- this.host = e;
- } else if (this.isSpecial()) {
- if (((t = aR(t)), ER(HR, t))) return FR;
- if (
- ((e = (function (t) {
- var e,
- r,
- n,
- i,
- o,
- s,
- a,
- u = OR(t, '.');
- if (
- (u.length && '' == u[u.length - 1] && u.length--,
- (e = u.length) > 4)
- )
- return t;
- for (r = [], n = 0; n < e; n++) {
- if ('' == (i = u[n])) return t;
- if (
- ((o = 10),
- i.length > 1 &&
- '0' == xR(i, 0) &&
- ((o = ER(UR, i) ? 16 : 8), (i = IR(i, 8 == o ? 1 : 2))),
- '' === i)
- )
- s = 0;
- else {
- if (!ER(10 == o ? XR : 8 == o ? jR : VR, i)) return t;
- s = _R(i, o);
- }
- CR(r, s);
- }
- for (n = 0; n < e; n++)
- if (((s = r[n]), n == e - 1)) {
- if (s >= TR(256, 5 - e)) return null;
- } else if (s > 255) return null;
- for (a = RR(r), n = 0; n < r.length; n++)
- a += r[n] * TR(256, 3 - n);
- return a;
- })(t)),
- null === e)
- )
- return FR;
- this.host = e;
- } else {
- if (ER(WR, t)) return FR;
- for (e = '', r = iR(t), n = 0; n < r.length; n++) e += $R(r[n], JR);
- this.host = e;
- }
- },
- cannotHaveUsernamePasswordPort: function () {
- return !this.host || this.cannotBeABaseURL || 'file' == this.scheme;
- },
- includesCredentials: function () {
- return '' != this.username || '' != this.password;
- },
- isSpecial: function () {
- return rR(tC, this.scheme);
- },
- shortenPath: function () {
- var t = this.path,
- e = t.length;
- !e || ('file' == this.scheme && 1 == e && eC(t[0], !0)) || t.length--;
- },
- serialize: function () {
- var t = this,
- e = t.scheme,
- r = t.username,
- n = t.password,
- i = t.host,
- o = t.port,
- s = t.path,
- a = t.query,
- u = t.fragment,
- c = e + ':';
- return (
- null !== i
- ? ((c += '//'),
- t.includesCredentials() && (c += r + (n ? ':' + n : '') + '@'),
- (c += ZR(i)),
- null !== o && (c += ':' + o))
- : 'file' == e && (c += '//'),
- (c += t.cannotBeABaseURL ? s[0] : s.length ? '/' + SR(s, '/') : ''),
- null !== a && (c += '?' + a),
- null !== u && (c += '#' + u),
- c
- );
- },
- setHref: function (t) {
- var e = this.parse(t);
- if (e) throw gR(e);
- this.searchParams.update();
- },
- getOrigin: function () {
- var t = this.scheme,
- e = this.port;
- if ('blob' == t)
- try {
- return new RC(t.path[0]).origin;
- } catch (t) {
- return 'null';
- }
- return 'file' != t && this.isSpecial()
- ? t + '://' + ZR(this.host) + (null !== e ? ':' + e : '')
- : 'null';
- },
- getProtocol: function () {
- return this.scheme + ':';
- },
- setProtocol: function (t) {
- this.parse(uR(t) + ':', iC);
- },
- getUsername: function () {
- return this.username;
- },
- setUsername: function (t) {
- var e = iR(uR(t));
- if (!this.cannotHaveUsernamePasswordPort()) {
- this.username = '';
- for (var r = 0; r < e.length; r++) this.username += $R(e[r], QR);
- }
- },
- getPassword: function () {
- return this.password;
- },
- setPassword: function (t) {
- var e = iR(uR(t));
- if (!this.cannotHaveUsernamePasswordPort()) {
- this.password = '';
- for (var r = 0; r < e.length; r++) this.password += $R(e[r], QR);
- }
- },
- getHost: function () {
- var t = this.host,
- e = this.port;
- return null === t ? '' : null === e ? ZR(t) : ZR(t) + ':' + e;
- },
- setHost: function (t) {
- this.cannotBeABaseURL || this.parse(t, pC);
- },
- getHostname: function () {
- var t = this.host;
- return null === t ? '' : ZR(t);
- },
- setHostname: function (t) {
- this.cannotBeABaseURL || this.parse(t, vC);
- },
- getPort: function () {
- var t = this.port;
- return null === t ? '' : uR(t);
- },
- setPort: function (t) {
- this.cannotHaveUsernamePasswordPort() ||
- ('' == (t = uR(t)) ? (this.port = null) : this.parse(t, mC));
- },
- getPathname: function () {
- var t = this.path;
- return this.cannotBeABaseURL ? t[0] : t.length ? '/' + SR(t, '/') : '';
- },
- setPathname: function (t) {
- this.cannotBeABaseURL || ((this.path = []), this.parse(t, bC));
- },
- getSearch: function () {
- var t = this.query;
- return t ? '?' + t : '';
- },
- setSearch: function (t) {
- '' == (t = uR(t))
- ? (this.query = null)
- : ('?' == xR(t, 0) && (t = IR(t, 1)),
- (this.query = ''),
- this.parse(t, EC)),
- this.searchParams.update();
- },
- getSearchParams: function () {
- return this.searchParams.facade;
- },
- getHash: function () {
- var t = this.fragment;
- return t ? '#' + t : '';
- },
- setHash: function (t) {
- '' != (t = uR(t))
- ? ('#' == xR(t, 0) && (t = IR(t, 1)),
- (this.fragment = ''),
- this.parse(t, SC))
- : (this.fragment = null);
- },
- update: function () {
- this.query = this.searchParams.serialize() || null;
- },
- };
- var RC = function (t) {
- var e = eR(this, CC),
- r = hR(arguments.length, 1) > 1 ? arguments[1] : void 0,
- n = fR(e, new wC(t, !1, r));
- Zw ||
- ((e.href = n.serialize()),
- (e.origin = n.getOrigin()),
- (e.protocol = n.getProtocol()),
- (e.username = n.getUsername()),
- (e.password = n.getPassword()),
- (e.host = n.getHost()),
- (e.hostname = n.getHostname()),
- (e.port = n.getPort()),
- (e.pathname = n.getPathname()),
- (e.search = n.getSearch()),
- (e.searchParams = n.getSearchParams()),
- (e.hash = n.getHash()));
- },
- CC = RC.prototype,
- PC = function (t, e) {
- return {
- get: function () {
- return pR(this)[t]();
- },
- set:
- e &&
- function (t) {
- return pR(this)[e](t);
- },
- configurable: !0,
- enumerable: !0,
- };
- };
- if (
- (Zw &&
- (tR(CC, 'href', PC('serialize', 'setHref')),
- tR(CC, 'origin', PC('getOrigin')),
- tR(CC, 'protocol', PC('getProtocol', 'setProtocol')),
- tR(CC, 'username', PC('getUsername', 'setUsername')),
- tR(CC, 'password', PC('getPassword', 'setPassword')),
- tR(CC, 'host', PC('getHost', 'setHost')),
- tR(CC, 'hostname', PC('getHostname', 'setHostname')),
- tR(CC, 'port', PC('getPort', 'setPort')),
- tR(CC, 'pathname', PC('getPathname', 'setPathname')),
- tR(CC, 'search', PC('getSearch', 'setSearch')),
- tR(CC, 'searchParams', PC('getSearchParams')),
- tR(CC, 'hash', PC('getHash', 'setHash'))),
- $w(
- CC,
- 'toJSON',
- function () {
- return pR(this).serialize();
- },
- { enumerable: !0 }
- ),
- $w(
- CC,
- 'toString',
- function () {
- return pR(this).serialize();
- },
- { enumerable: !0 }
- ),
- yR)
- ) {
- var AC = yR.createObjectURL,
- OC = yR.revokeObjectURL;
- AC && $w(RC, 'createObjectURL', qw(AC, yR)),
- OC && $w(RC, 'revokeObjectURL', qw(OC, yR));
- }
- cR(RC, 'URL'),
- zw({ global: !0, constructor: !0, forced: !Jw, sham: !Zw }, { URL: RC });
- var IC = rt.URL;
- function MC(t, e, r) {
- var n = void 0 === e ? null : e,
- i = (function (t, e) {
- var r = atob(t);
- if (e) {
- for (
- var n = new Uint8Array(r.length), i = 0, o = r.length;
- i < o;
- ++i
- )
- n[i] = r.charCodeAt(i);
- return String.fromCharCode.apply(null, new Uint16Array(n.buffer));
- }
- return r;
- })(t, void 0 !== r && r),
- o = i.indexOf('\n', 10) + 1,
- s = i.substring(o) + (n ? '//# sourceMappingURL=' + n : ''),
- a = new Blob([s], { type: 'application/javascript' });
- return URL.createObjectURL(a);
- }
- var DC = (function (t, e, r) {
- var n;
- return function (i) {
- return (n = n || MC(t, e, r)), new Worker(n, i);
- };
- })(
- 'Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwp2YXIgd29ya2VyX2NvZGU9ZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7dmFyIHQ9InVuZGVmaW5lZCIhPXR5cGVvZiBnbG9iYWxUaGlzP2dsb2JhbFRoaXM6InVuZGVmaW5lZCIhPXR5cGVvZiB3aW5kb3c/d2luZG93OiJ1bmRlZmluZWQiIT10eXBlb2YgZ2xvYmFsP2dsb2JhbDoidW5kZWZpbmVkIiE9dHlwZW9mIHNlbGY/c2VsZjp7fSxlPWZ1bmN0aW9uKHQpe3JldHVybiB0JiZ0Lk1hdGg9PU1hdGgmJnR9LG49ZSgib2JqZWN0Ij09dHlwZW9mIGdsb2JhbFRoaXMmJmdsb2JhbFRoaXMpfHxlKCJvYmplY3QiPT10eXBlb2Ygd2luZG93JiZ3aW5kb3cpfHxlKCJvYmplY3QiPT10eXBlb2Ygc2VsZiYmc2VsZil8fGUoIm9iamVjdCI9PXR5cGVvZiB0JiZ0KXx8ZnVuY3Rpb24oKXtyZXR1cm4gdGhpc30oKXx8RnVuY3Rpb24oInJldHVybiB0aGlzIikoKSxyPWZ1bmN0aW9uKHQpe3RyeXtyZXR1cm4hIXQoKX1jYXRjaCh0KXtyZXR1cm4hMH19LG89IXIoKGZ1bmN0aW9uKCl7dmFyIHQ9ZnVuY3Rpb24oKXt9LmJpbmQoKTtyZXR1cm4iZnVuY3Rpb24iIT10eXBlb2YgdHx8dC5oYXNPd25Qcm9wZXJ0eSgicHJvdG90eXBlIil9KSksaT1vLHU9RnVuY3Rpb24ucHJvdG90eXBlLGM9dS5hcHBseSxhPXUuY2FsbCxmPSJvYmplY3QiPT10eXBlb2YgUmVmbGVjdCYmUmVmbGVjdC5hcHBseXx8KGk/YS5iaW5kKGMpOmZ1bmN0aW9uKCl7cmV0dXJuIGEuYXBwbHkoYyxhcmd1bWVudHMpfSksbD1vLHA9RnVuY3Rpb24ucHJvdG90eXBlLHM9cC5jYWxsLGI9bCYmcC5iaW5kLmJpbmQocyxzKSx5PWw/YjpmdW5jdGlvbih0KXtyZXR1cm4gZnVuY3Rpb24oKXtyZXR1cm4gcy5hcHBseSh0LGFyZ3VtZW50cyl9fSx2PXksZD12KHt9LnRvU3RyaW5nKSxoPXYoIiIuc2xpY2UpLG09ZnVuY3Rpb24odCl7cmV0dXJuIGgoZCh0KSw4LC0xKX0sZz1tLHc9eSxqPWZ1bmN0aW9uKHQpe2lmKCJGdW5jdGlvbiI9PT1nKHQpKXJldHVybiB3KHQpfSxTPSJvYmplY3QiPT10eXBlb2YgZG9jdW1lbnQmJmRvY3VtZW50LmFsbCxPPXthbGw6UyxJU19IVE1MRERBOnZvaWQgMD09PVMmJnZvaWQgMCE9PVN9LFQ9Ty5hbGwsRT1PLklTX0hUTUxEREE/ZnVuY3Rpb24odCl7cmV0dXJuImZ1bmN0aW9uIj09dHlwZW9mIHR8fHQ9PT1UfTpmdW5jdGlvbih0KXtyZXR1cm4iZnVuY3Rpb24iPT10eXBlb2YgdH0sUD17fSxJPSFyKChmdW5jdGlvbigpe3JldHVybiA3IT1PYmplY3QuZGVmaW5lUHJvcGVydHkoe30sMSx7Z2V0OmZ1bmN0aW9uKCl7cmV0dXJuIDd9fSlbMV19KSksRD1vLF89RnVuY3Rpb24ucHJvdG90eXBlLmNhbGwsTD1EP18uYmluZChfKTpmdW5jdGlvbigpe3JldHVybiBfLmFwcGx5KF8sYXJndW1lbnRzKX0saz17fSxNPXt9LnByb3BlcnR5SXNFbnVtZXJhYmxlLEM9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcixGPUMmJiFNLmNhbGwoezE6Mn0sMSk7ay5mPUY/ZnVuY3Rpb24odCl7dmFyIGU9Qyh0aGlzLHQpO3JldHVybiEhZSYmZS5lbnVtZXJhYmxlfTpNO3ZhciBBLHosTj1mdW5jdGlvbih0LGUpe3JldHVybntlbnVtZXJhYmxlOiEoMSZ0KSxjb25maWd1cmFibGU6ISgyJnQpLHdyaXRhYmxlOiEoNCZ0KSx2YWx1ZTplfX0seD1yLEg9bSxSPU9iamVjdCxHPWooIiIuc3BsaXQpLFY9eCgoZnVuY3Rpb24oKXtyZXR1cm4hUigieiIpLnByb3BlcnR5SXNFbnVtZXJhYmxlKDApfSkpP2Z1bmN0aW9uKHQpe3JldHVybiJTdHJpbmciPT1IKHQpP0codCwiIik6Uih0KX06UixZPWZ1bmN0aW9uKHQpe3JldHVybiBudWxsPT10fSxxPVksQj1UeXBlRXJyb3IsSj1mdW5jdGlvbih0KXtpZihxKHQpKXRocm93IEIoIkNhbid0IGNhbGwgbWV0aG9kIG9uICIrdCk7cmV0dXJuIHR9LEs9VixRPUosVT1FLFc9Ty5hbGwsWD1PLklTX0hUTUxEREE/ZnVuY3Rpb24odCl7cmV0dXJuIm9iamVjdCI9PXR5cGVvZiB0P251bGwhPT10OlUodCl8fHQ9PT1XfTpmdW5jdGlvbih0KXtyZXR1cm4ib2JqZWN0Ij09dHlwZW9mIHQ/bnVsbCE9PXQ6VSh0KX0sWj17fSwkPVosdHQ9bixldD1FLG50PWZ1bmN0aW9uKHQpe3JldHVybiBldCh0KT90OnZvaWQgMH0scnQ9ZnVuY3Rpb24odCxlKXtyZXR1cm4gYXJndW1lbnRzLmxlbmd0aDwyP250KCRbdF0pfHxudCh0dFt0XSk6JFt0XSYmJFt0XVtlXXx8dHRbdF0mJnR0W3RdW2VdfSxvdD1qKHt9LmlzUHJvdG90eXBlT2YpLGl0PXJ0KCJuYXZpZ2F0b3IiLCJ1c2VyQWdlbnQiKXx8IiIsdXQ9bixjdD1pdCxhdD11dC5wcm9jZXNzLGZ0PXV0LkRlbm8sbHQ9YXQmJmF0LnZlcnNpb25zfHxmdCYmZnQudmVyc2lvbixwdD1sdCYmbHQudjg7cHQmJih6PShBPXB0LnNwbGl0KCIuIikpWzBdPjAmJkFbMF08ND8xOisoQVswXStBWzFdKSksIXomJmN0JiYoIShBPWN0Lm1hdGNoKC9FZGdlXC8oXGQrKS8pKXx8QVsxXT49NzQpJiYoQT1jdC5tYXRjaCgvQ2hyb21lXC8oXGQrKS8pKSYmKHo9K0FbMV0pO3ZhciBzdD16LGJ0PXIseXQ9ISFPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzJiYhYnQoKGZ1bmN0aW9uKCl7dmFyIHQ9U3ltYm9sKCk7cmV0dXJuIVN0cmluZyh0KXx8IShPYmplY3QodClpbnN0YW5jZW9mIFN5bWJvbCl8fCFTeW1ib2wuc2hhbSYmc3QmJnN0PDQxfSkpLHZ0PXl0JiYhU3ltYm9sLnNoYW0mJiJzeW1ib2wiPT10eXBlb2YgU3ltYm9sLml0ZXJhdG9yLGR0PXJ0LGh0PUUsbXQ9b3QsZ3Q9T2JqZWN0LHd0PXZ0P2Z1bmN0aW9uKHQpe3JldHVybiJzeW1ib2wiPT10eXBlb2YgdH06ZnVuY3Rpb24odCl7dmFyIGU9ZHQoIlN5bWJvbCIpO3JldHVybiBodChlKSYmbXQoZS5wcm90b3R5cGUsZ3QodCkpfSxqdD1TdHJpbmcsU3Q9RSxPdD1mdW5jdGlvbih0KXt0cnl7cmV0dXJuIGp0KHQpfWNhdGNoKHQpe3JldHVybiJPYmplY3QifX0sVHQ9VHlwZUVycm9yLEV0PWZ1bmN0aW9uKHQpe2lmKFN0KHQpKXJldHVybiB0O3Rocm93IFR0KE90KHQpKyIgaXMgbm90IGEgZnVuY3Rpb24iKX0sUHQ9RXQsSXQ9WSxEdD1MLF90PUUsTHQ9WCxrdD1UeXBlRXJyb3IsTXQ9e2V4cG9ydHM6e319LEN0PW4sRnQ9T2JqZWN0LmRlZmluZVByb3BlcnR5LEF0PWZ1bmN0aW9uKHQsZSl7dHJ5e0Z0KEN0LHQse3ZhbHVlOmUsY29uZmlndXJhYmxlOiEwLHdyaXRhYmxlOiEwfSl9Y2F0Y2gobil7Q3RbdF09ZX1yZXR1cm4gZX0senQ9Il9fY29yZS1qc19zaGFyZWRfXyIsTnQ9blt6dF18fEF0KHp0LHt9KTsoTXQuZXhwb3J0cz1mdW5jdGlvbih0LGUpe3JldHVybiBOdFt0XXx8KE50W3RdPXZvaWQgMCE9PWU/ZTp7fSl9KSgidmVyc2lvbnMiLFtdKS5wdXNoKHt2ZXJzaW9uOiIzLjI2LjAiLG1vZGU6InB1cmUiLGNvcHlyaWdodDoiwqkgMjAxNC0yMDIyIERlbmlzIFB1c2hrYXJldiAoemxvaXJvY2sucnUpIixsaWNlbnNlOiJodHRwczovL2dpdGh1Yi5jb20vemxvaXJvY2svY29yZS1qcy9ibG9iL3YzLjI2LjAvTElDRU5TRSIsc291cmNlOiJodHRwczovL2dpdGh1Yi5jb20vemxvaXJvY2svY29yZS1qcyJ9KTt2YXIgeHQ9SixIdD1PYmplY3QsUnQ9ZnVuY3Rpb24odCl7cmV0dXJuIEh0KHh0KHQpKX0sR3Q9aih7fS5oYXNPd25Qcm9wZXJ0eSksVnQ9T2JqZWN0Lmhhc093bnx8ZnVuY3Rpb24odCxlKXtyZXR1cm4gR3QoUnQodCksZSl9LFl0PWoscXQ9MCxCdD1NYXRoLnJhbmRvbSgpLEp0PVl0KDEuLnRvU3RyaW5nKSxLdD1uLFF0PU10LmV4cG9ydHMsVXQ9VnQsV3Q9ZnVuY3Rpb24odCl7cmV0dXJuIlN5bWJvbCgiKyh2b2lkIDA9PT10PyIiOnQpKyIpXyIrSnQoKytxdCtCdCwzNil9LFh0PXl0LFp0PXZ0LCR0PVF0KCJ3a3MiKSx0ZT1LdC5TeW1ib2wsZWU9dGUmJnRlLmZvcixuZT1adD90ZTp0ZSYmdGUud2l0aG91dFNldHRlcnx8V3QscmU9TCxvZT1YLGllPXd0LHVlPWZ1bmN0aW9uKHQsZSl7dmFyIG49dFtlXTtyZXR1cm4gSXQobik/dm9pZCAwOlB0KG4pfSxjZT1mdW5jdGlvbih0LGUpe3ZhciBuLHI7aWYoInN0cmluZyI9PT1lJiZfdChuPXQudG9TdHJpbmcpJiYhTHQocj1EdChuLHQpKSlyZXR1cm4gcjtpZihfdChuPXQudmFsdWVPZikmJiFMdChyPUR0KG4sdCkpKXJldHVybiByO2lmKCJzdHJpbmciIT09ZSYmX3Qobj10LnRvU3RyaW5nKSYmIUx0KHI9RHQobix0KSkpcmV0dXJuIHI7dGhyb3cga3QoIkNhbid0IGNvbnZlcnQgb2JqZWN0IHRvIHByaW1pdGl2ZSB2YWx1ZSIpfSxhZT1UeXBlRXJyb3IsZmU9ZnVuY3Rpb24odCl7aWYoIVV0KCR0LHQpfHwhWHQmJiJzdHJpbmciIT10eXBlb2YgJHRbdF0pe3ZhciBlPSJTeW1ib2wuIit0O1h0JiZVdCh0ZSx0KT8kdFt0XT10ZVt0XTokdFt0XT1adCYmZWU/ZWUoZSk6bmUoZSl9cmV0dXJuICR0W3RdfSgidG9QcmltaXRpdmUiKSxsZT1mdW5jdGlvbih0LGUpe2lmKCFvZSh0KXx8aWUodCkpcmV0dXJuIHQ7dmFyIG4scj11ZSh0LGZlKTtpZihyKXtpZih2b2lkIDA9PT1lJiYoZT0iZGVmYXVsdCIpLG49cmUocix0LGUpLCFvZShuKXx8aWUobikpcmV0dXJuIG47dGhyb3cgYWUoIkNhbid0IGNvbnZlcnQgb2JqZWN0IHRvIHByaW1pdGl2ZSB2YWx1ZSIpfXJldHVybiB2b2lkIDA9PT1lJiYoZT0ibnVtYmVyIiksY2UodCxlKX0scGU9d3Qsc2U9ZnVuY3Rpb24odCl7dmFyIGU9bGUodCwic3RyaW5nIik7cmV0dXJuIHBlKGUpP2U6ZSsiIn0sYmU9WCx5ZT1uLmRvY3VtZW50LHZlPWJlKHllKSYmYmUoeWUuY3JlYXRlRWxlbWVudCksZGU9ZnVuY3Rpb24odCl7cmV0dXJuIHZlP3llLmNyZWF0ZUVsZW1lbnQodCk6e319LGhlPSFJJiYhcigoZnVuY3Rpb24oKXtyZXR1cm4gNyE9T2JqZWN0LmRlZmluZVByb3BlcnR5KGRlKCJkaXYiKSwiYSIse2dldDpmdW5jdGlvbigpe3JldHVybiA3fX0pLmF9KSksbWU9SSxnZT1MLHdlPWssamU9TixTZT1mdW5jdGlvbih0KXtyZXR1cm4gSyhRKHQpKX0sT2U9c2UsVGU9VnQsRWU9aGUsUGU9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjtQLmY9bWU/UGU6ZnVuY3Rpb24odCxlKXtpZih0PVNlKHQpLGU9T2UoZSksRWUpdHJ5e3JldHVybiBQZSh0LGUpfWNhdGNoKHQpe31pZihUZSh0LGUpKXJldHVybiBqZSghZ2Uod2UuZix0LGUpLHRbZV0pfTt2YXIgSWU9cixEZT1FLF9lPS8jfFwucHJvdG90eXBlXC4vLExlPWZ1bmN0aW9uKHQsZSl7dmFyIG49TWVba2UodCldO3JldHVybiBuPT1GZXx8biE9Q2UmJihEZShlKT9JZShlKTohIWUpfSxrZT1MZS5ub3JtYWxpemU9ZnVuY3Rpb24odCl7cmV0dXJuIFN0cmluZyh0KS5yZXBsYWNlKF9lLCIuIikudG9Mb3dlckNhc2UoKX0sTWU9TGUuZGF0YT17fSxDZT1MZS5OQVRJVkU9Ik4iLEZlPUxlLlBPTFlGSUxMPSJQIixBZT1MZSx6ZT1FdCxOZT1vLHhlPWooai5iaW5kKSxIZT17fSxSZT1JJiZyKChmdW5jdGlvbigpe3JldHVybiA0MiE9T2JqZWN0LmRlZmluZVByb3BlcnR5KChmdW5jdGlvbigpe30pLCJwcm90b3R5cGUiLHt2YWx1ZTo0Mix3cml0YWJsZTohMX0pLnByb3RvdHlwZX0pKSxHZT1YLFZlPVN0cmluZyxZZT1UeXBlRXJyb3IscWU9SSxCZT1oZSxKZT1SZSxLZT1mdW5jdGlvbih0KXtpZihHZSh0KSlyZXR1cm4gdDt0aHJvdyBZZShWZSh0KSsiIGlzIG5vdCBhbiBvYmplY3QiKX0sUWU9c2UsVWU9VHlwZUVycm9yLFdlPU9iamVjdC5kZWZpbmVQcm9wZXJ0eSxYZT1PYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yLFplPSJlbnVtZXJhYmxlIiwkZT0iY29uZmlndXJhYmxlIix0bj0id3JpdGFibGUiO0hlLmY9cWU/SmU/ZnVuY3Rpb24odCxlLG4pe2lmKEtlKHQpLGU9UWUoZSksS2UobiksImZ1bmN0aW9uIj09dHlwZW9mIHQmJiJwcm90b3R5cGUiPT09ZSYmInZhbHVlImluIG4mJnRuIGluIG4mJiFuLndyaXRhYmxlKXt2YXIgcj1YZSh0LGUpO3ImJnIud3JpdGFibGUmJih0W2VdPW4udmFsdWUsbj17Y29uZmlndXJhYmxlOiRlIGluIG4/bi5jb25maWd1cmFibGU6ci5jb25maWd1cmFibGUsZW51bWVyYWJsZTpaZSBpbiBuP24uZW51bWVyYWJsZTpyLmVudW1lcmFibGUsd3JpdGFibGU6ITF9KX1yZXR1cm4gV2UodCxlLG4pfTpXZTpmdW5jdGlvbih0LGUsbil7aWYoS2UodCksZT1RZShlKSxLZShuKSxCZSl0cnl7cmV0dXJuIFdlKHQsZSxuKX1jYXRjaCh0KXt9aWYoImdldCJpbiBufHwic2V0ImluIG4pdGhyb3cgVWUoIkFjY2Vzc29ycyBub3Qgc3VwcG9ydGVkIik7cmV0dXJuInZhbHVlImluIG4mJih0W2VdPW4udmFsdWUpLHR9O3ZhciBlbj1IZSxubj1OLHJuPUk/ZnVuY3Rpb24odCxlLG4pe3JldHVybiBlbi5mKHQsZSxubigxLG4pKX06ZnVuY3Rpb24odCxlLG4pe3JldHVybiB0W2VdPW4sdH0sb249bix1bj1mLGNuPWosYW49RSxmbj1QLmYsbG49QWUscG49Wixzbj1mdW5jdGlvbih0LGUpe3JldHVybiB6ZSh0KSx2b2lkIDA9PT1lP3Q6TmU/eGUodCxlKTpmdW5jdGlvbigpe3JldHVybiB0LmFwcGx5KGUsYXJndW1lbnRzKX19LGJuPXJuLHluPVZ0LHZuPWZ1bmN0aW9uKHQpe3ZhciBlPWZ1bmN0aW9uKG4scixvKXtpZih0aGlzIGluc3RhbmNlb2YgZSl7c3dpdGNoKGFyZ3VtZW50cy5sZW5ndGgpe2Nhc2UgMDpyZXR1cm4gbmV3IHQ7Y2FzZSAxOnJldHVybiBuZXcgdChuKTtjYXNlIDI6cmV0dXJuIG5ldyB0KG4scil9cmV0dXJuIG5ldyB0KG4scixvKX1yZXR1cm4gdW4odCx0aGlzLGFyZ3VtZW50cyl9O3JldHVybiBlLnByb3RvdHlwZT10LnByb3RvdHlwZSxlfSxkbj1mdW5jdGlvbih0LGUpe3ZhciBuLHIsbyxpLHUsYyxhLGYsbD10LnRhcmdldCxwPXQuZ2xvYmFsLHM9dC5zdGF0LGI9dC5wcm90byx5PXA/b246cz9vbltsXToob25bbF18fHt9KS5wcm90b3R5cGUsdj1wP3BuOnBuW2xdfHxibihwbixsLHt9KVtsXSxkPXYucHJvdG90eXBlO2ZvcihvIGluIGUpbj0hbG4ocD9vOmwrKHM/Ii4iOiIjIikrbyx0LmZvcmNlZCkmJnkmJnluKHksbyksdT12W29dLG4mJihjPXQuZG9udENhbGxHZXRTZXQ/KGY9Zm4oeSxvKSkmJmYudmFsdWU6eVtvXSksaT1uJiZjP2M6ZVtvXSxuJiZ0eXBlb2YgdT09dHlwZW9mIGl8fChhPXQuYmluZCYmbj9zbihpLG9uKTp0LndyYXAmJm4/dm4oaSk6YiYmYW4oaSk/Y24oaSk6aSwodC5zaGFtfHxpJiZpLnNoYW18fHUmJnUuc2hhbSkmJmJuKGEsInNoYW0iLCEwKSxibih2LG8sYSksYiYmKHluKHBuLHI9bCsiUHJvdG90eXBlIil8fGJuKHBuLHIse30pLGJuKHBuW3JdLG8saSksdC5yZWFsJiZkJiYhZFtvXSYmYm4oZCxvLGkpKSl9LGhuPWooW10uc2xpY2UpLG1uPVR5cGVFcnJvcixnbj1uLHduPWYsam49RSxTbj1obixPbj1mdW5jdGlvbih0LGUpe2lmKHQ8ZSl0aHJvdyBtbigiTm90IGVub3VnaCBhcmd1bWVudHMiKTtyZXR1cm4gdH0sVG49L01TSUUgLlwuLy50ZXN0KGl0KSxFbj1nbi5GdW5jdGlvbixQbj1mdW5jdGlvbih0KXtyZXR1cm4gVG4/ZnVuY3Rpb24oZSxuKXt2YXIgcj1Pbihhcmd1bWVudHMubGVuZ3RoLDEpPjIsbz1qbihlKT9lOkVuKGUpLGk9cj9Tbihhcmd1bWVudHMsMik6dm9pZCAwO3JldHVybiB0KHI/ZnVuY3Rpb24oKXt3bihvLHRoaXMsaSl9Om8sbil9OnR9LEluPXtzZXRUaW1lb3V0OlBuKGduLnNldFRpbWVvdXQpLHNldEludGVydmFsOlBuKGduLnNldEludGVydmFsKX0sRG49SW4uc2V0SW50ZXJ2YWw7ZG4oe2dsb2JhbDohMCxiaW5kOiEwLGZvcmNlZDpuLnNldEludGVydmFsIT09RG59LHtzZXRJbnRlcnZhbDpEbn0pO3ZhciBfbj1Jbi5zZXRUaW1lb3V0O2RuKHtnbG9iYWw6ITAsYmluZDohMCxmb3JjZWQ6bi5zZXRUaW1lb3V0IT09X259LHtzZXRUaW1lb3V0Ol9ufSk7dmFyIExuPVouc2V0SW50ZXJ2YWwsa249ITEsTW49bnVsbDtzZWxmLmFkZEV2ZW50TGlzdGVuZXIoIm1lc3NhZ2UiLChmdW5jdGlvbih0KXt2YXIgZT10LmRhdGEsbj1lLnR5cGUscj1lLmRhdGE7c3dpdGNoKG4pe2Nhc2Uic3RhcnQiOmtufHwoa249ITAsTW49TG4oKGZ1bmN0aW9uKCl7a249ITEsc2VsZi5wb3N0TWVzc2FnZSgidGljayIpfSksci50aW1lKSk7YnJlYWs7Y2FzZSJzdG9wIjpjbGVhckludGVydmFsKE1uKSxrbj0hMX19KSwhMSk7cmV0dXJue319KCk7Cgo=',
- null,
- !1
- ),
- LC = function () {
- return new DC();
- },
- FC = Yf('stream:media'),
- NC = (function () {
- function t() {
- var t, e, r, n;
- (this.mediaStream = null),
- (this.videoEl = null),
- (this.canvasEl = null),
- (this.canvasContext = null),
- (this.audioContext = null),
- (this.audioSource = null),
- (this.worker = null),
- (this.config = null),
- (this.promise = null),
- (this.onVideoError = lh((t = this.onVideoError)).call(t, this)),
- (this.onPause = lh((e = this.onPause)).call(e, this)),
- (this.onVideoPlay = lh((r = this.onVideoPlay)).call(r, this)),
- (this.renderCanvas = lh((n = this.renderCanvas)).call(n, this));
- }
- return (
- (t.prototype.start = function (t) {
- var e = this,
- r = t.video,
- n = t.audio,
- i = t.fileSource;
- return (
- (this.config = t),
- new zx(function (t, o) {
- if (((e.promise = { resolve: t, reject: o }), e.mediaStream))
- return FC('stream is existed'), void t(e.mediaStream);
- e.videoEl || (e.videoEl = gy()),
- (e.videoEl.muted = !n),
- r &&
- !e.canvasEl &&
- ((e.canvasEl = document.createElement('canvas')),
- (e.canvasContext = e.canvasEl.getContext('2d', {
- desynchronized: !0,
- willReadFrequently: !0,
- }))),
- r && !e.worker && (e.worker = LC()),
- n && !e.audioContext && (e.audioContext = yy());
- var s = i instanceof File ? IC.createObjectURL(i) : i;
- e.playVideo(s);
- })
- );
- }),
- (t.prototype.stop = function () {
- var t;
- this.mediaStream
- ? (this.destroy(),
- Ph((t = this.mediaStream.getTracks())).call(t, function (t) {
- t.stop();
- }),
- (this.mediaStream = null))
- : FC('stream is not existed');
- }),
- (t.prototype.getResolution = function () {
- if (!this.mediaStream) return null;
- var t = this.mediaStream.getVideoTracks();
- if (0 === t.length) return null;
- var e = t[0].getSettings(),
- r = e.width,
- n = e.height;
- return {
- width: null != r ? r : this.canvasEl.width,
- height: null != n ? n : this.canvasEl.height,
- };
- }),
- (t.prototype.getRenderView = function () {
- return this.canvasEl;
- }),
- (t.prototype.getRenderElement = function () {
- return this.videoEl;
- }),
- (t.prototype.onVideoError = function () {
- this.videoEl.error &&
- (FC('play video error', this.videoEl.error),
- this.promise.reject(this.videoEl.error));
- }),
- (t.prototype.onPause = function () {
- var t = this;
- FC('video is paused, try to resume'),
- cd(function () {
- t.videoEl.play();
- }, 50);
- }),
- (t.prototype.onVideoPlay = function () {
- if (!this.mediaStream) {
- this.videoEl.removeEventListener('timeupdate', this.onVideoPlay);
- var t = this.config,
- e = t.video,
- r = t.audio,
- n = null,
- i = null;
- if (e) {
- var o = e.frameRate;
- this.renderCanvas(), FC('start render canvas');
- try {
- n = this.canvasEl.captureStream(o);
- } catch (t) {
- return (
- FC('get video stream error, '.concat(t.toString())),
- void this.promise.reject(t)
- );
- }
- }
- if (r)
- try {
- this.audioSource ||
- (this.audioSource =
- this.audioContext.createMediaElementSource(this.videoEl));
- var s = this.audioContext.createMediaStreamDestination();
- this.audioSource.connect(s), (i = s.stream);
- } catch (t) {
- return (
- FC('get audio stream error, '.concat(t.toString())),
- void this.promise.reject(t)
- );
- }
- if (n || i) {
- var a,
- u = new MediaStream();
- Ph((a = [n, i])).call(a, function (t) {
- var e,
- r,
- n =
- null ===
- (r =
- null === (e = null == t ? void 0 : t.getTracks) ||
- void 0 === e
- ? void 0
- : e.call(t)) || void 0 === r
- ? void 0
- : r[0];
- n && u.addTrack(n);
- }),
- (this.mediaStream = u),
- this.promise.resolve(u);
- }
- }
- }),
- (t.prototype.renderCanvas = function () {
- if (this.canvasEl) {
- var t = this.config.video.resolution,
- e = this.videoEl,
- r = t.width,
- n = t.height,
- i = e.videoWidth,
- o = e.videoHeight,
- s = null,
- a = null;
- 0 === i || 0 === o
- ? ((s = r), (a = n))
- : r / n < i / o
- ? ((s = r), (a = (r * o) / i))
- : ((s = (n * i) / o), (a = n)),
- (this.canvasEl.width = s),
- (this.canvasEl.height = a);
- var u = this.canvasContext;
- null == u || u.clearRect(0, 0, s, a),
- null == u || u.fillRect(0, 0, s, a),
- null == u || u.drawImage(e, 0, 0, i, o, 0, 0, s, a),
- this.requestAnimationFrameWrapper(this.renderCanvas);
- } else FC('canvas destroy, render canvas stop');
- }),
- (t.prototype.setWorkerInterval = function (t, e) {
- var r,
- n,
- i = this;
- null === (r = this.worker) ||
- void 0 === r ||
- r.addEventListener('message', t),
- null === (n = this.worker) ||
- void 0 === n ||
- n.postMessage({ type: 'start', data: { time: e } });
- return function () {
- var e, r;
- null === (e = i.worker) ||
- void 0 === e ||
- e.postMessage({ type: 'stop' }),
- null === (r = i.worker) ||
- void 0 === r ||
- r.removeEventListener('message', t);
- };
- }),
- (t.prototype.requestAnimationFrameWrapper = function (t) {
- var e = this.config.video.frameRate,
- r = !1,
- n = this.setWorkerInterval(function () {
- !r && document.hidden && ((r = !0), n(), t());
- }, 1e3 / e);
- requestAnimationFrame(function () {
- r || ((r = !0), n(), t());
- });
- }),
- (t.prototype.playVideo = function (t) {
- return Ed(this, void 0, void 0, function () {
- var e, r;
- return Sd(this, function (n) {
- switch (n.label) {
- case 0:
- (e = this.videoEl).addEventListener(
- 'error',
- this.onVideoError
- ),
- e.addEventListener('pause', this.onPause),
- e.addEventListener('timeupdate', this.onVideoPlay),
- (e.src = t),
- (n.label = 1);
- case 1:
- return n.trys.push([1, 3, , 4]), [4, e.play()];
- case 2:
- return n.sent(), FC('play ok'), [3, 4];
- case 3:
- return (
- (r = n.sent()),
- FC('play failed, '.concat(r.toString())),
- this.promise.reject(r),
- this.destroy(),
- [3, 4]
- );
- case 4:
- return [2];
- }
- });
- });
- }),
- (t.prototype.destroy = function () {
- var t,
- e = this.videoEl;
- e.removeEventListener('error', this.onVideoError),
- e.removeEventListener('pause', this.onPause),
- e.removeEventListener('timeupdate', this.onVideoPlay),
- this.canvasEl &&
- ((this.canvasContext = null), (this.canvasEl = null));
- var r = e.src;
- e.pause(),
- (e.src = ''),
- e.removeAttribute('src'),
- e.load(),
- r &&
- this.config.fileSource instanceof File &&
- IC.revokeObjectURL(r),
- (this.config = null),
- (this.promise = null),
- this.audioSource &&
- (this.audioSource.disconnect(), (this.audioSource = null)),
- window.TXLiveAudioContext ||
- (null === (t = this.audioContext) || void 0 === t || t.close(),
- (this.audioContext = null)),
- this.worker && (this.worker.terminate(), (this.worker = null)),
- this.videoEl && (this.videoEl.remove(), (this.videoEl = null));
- }),
- t
- );
- })(),
- kC = Yf('stream:image'),
- BC = (function () {
- function t() {
- var t, e;
- (this.mediaStream = null),
- (this.imageEl = null),
- (this.canvasEl = null),
- (this.canvasContext = null),
- (this.worker = null),
- (this.config = null),
- (this.promise = null),
- (this.onLoad = lh((t = this.onLoad)).call(t, this)),
- (this.renderCanvas = lh((e = this.renderCanvas)).call(e, this));
- }
- return (
- (t.prototype.start = function (t) {
- var e = this,
- r = t.fileSource;
- return (
- (this.config = t),
- new zx(function (t, n) {
- if (((e.promise = { resolve: t, reject: n }), e.mediaStream))
- return kC('stream is existed'), void t(e.mediaStream);
- e.imageEl || (e.imageEl = new Image()),
- e.canvasEl ||
- ((e.canvasEl = document.createElement('canvas')),
- (e.canvasContext = e.canvasEl.getContext('2d', {
- desynchronized: !0,
- }))),
- e.worker || (e.worker = LC());
- var i = r instanceof File ? IC.createObjectURL(r) : r;
- e.loadImage(i);
- })
- );
- }),
- (t.prototype.stop = function () {
- var t;
- if (this.mediaStream) {
- var e = this.imageEl.src;
- this.imageEl.removeEventListener('load', this.onLoad),
- (this.imageEl.src = ''),
- (this.imageEl = null),
- e &&
- this.config.fileSource instanceof File &&
- IC.revokeObjectURL(e),
- (this.canvasContext = null),
- (this.canvasEl = null),
- (this.config = null),
- (this.promise = null),
- this.worker && (this.worker.terminate(), (this.worker = null)),
- Ph((t = this.mediaStream.getTracks())).call(t, function (t) {
- t.stop();
- }),
- (this.mediaStream = null);
- } else kC('stream is not existed');
- }),
- (t.prototype.getResolution = function () {
- if (!this.mediaStream) return null;
- var t = this.mediaStream.getVideoTracks();
- if (0 === t.length) return null;
- var e = t[0].getSettings(),
- r = e.width,
- n = e.height;
- return {
- width: null != r ? r : this.canvasEl.width,
- height: null != n ? n : this.canvasEl.height,
- };
- }),
- (t.prototype.getRenderView = function () {
- return this.canvasEl;
- }),
- (t.prototype.getRenderElement = function () {
- return this.imageEl;
- }),
- (t.prototype.onLoad = function () {
- var t = this.config.video.frameRate;
- this.renderCanvas(), kC('start render canvas');
- try {
- var e = this.canvasEl.captureStream(t),
- r = e.getAudioTracks();
- Ph(r).call(r, function (t) {
- e.removeTrack(t);
- }),
- (this.mediaStream = e),
- this.promise.resolve(e);
- } catch (t) {
- kC('get image stream error, '.concat(t.toString())),
- this.promise.reject(t);
- }
- }),
- (t.prototype.renderCanvas = function () {
- if (this.imageEl && this.canvasEl) {
- var t = this.config.video.resolution,
- e = t.width,
- r = t.height,
- n = this.imageEl.naturalWidth,
- i = this.imageEl.naturalHeight,
- o = null,
- s = null;
- 0 === n || 0 === i
- ? ((o = e), (s = r))
- : e / r < n / i
- ? ((o = e), (s = (e * i) / n))
- : ((o = (r * n) / i), (s = r)),
- (this.canvasEl.width = o),
- (this.canvasEl.height = s);
- var a = this.canvasContext;
- null == a || a.clearRect(0, 0, o, s),
- null == a || a.fillRect(0, 0, o, s),
- null == a || a.drawImage(this.imageEl, 0, 0, n, i, 0, 0, o, s),
- this.requestAnimationFrameWrapper(this.renderCanvas);
- } else kC('render canvas stop');
- }),
- (t.prototype.loadImage = function (t) {
- this.imageEl.addEventListener('load', this.onLoad),
- (this.imageEl.src = t);
- }),
- (t.prototype.setWorkerInterval = function (t, e) {
- var r,
- n,
- i = this;
- null === (r = this.worker) ||
- void 0 === r ||
- r.addEventListener('message', t),
- null === (n = this.worker) ||
- void 0 === n ||
- n.postMessage({ type: 'start', data: { time: e } });
- return function () {
- var e, r;
- null === (e = i.worker) ||
- void 0 === e ||
- e.postMessage({ type: 'stop' }),
- null === (r = i.worker) ||
- void 0 === r ||
- r.removeEventListener('message', t);
- };
- }),
- (t.prototype.requestAnimationFrameWrapper = function (t) {
- var e = this.config.video.frameRate,
- r = !1,
- n = this.setWorkerInterval(function () {
- !r && document.hidden && ((r = !0), n(), t());
- }, 1e3 / e);
- requestAnimationFrame(function () {
- r || ((r = !0), n(), t());
- });
- }),
- t
- );
- })(),
- GC = Yf('stream'),
- UC = (function () {
- function t(t) {
- (this.type = null),
- (this.videoConfig = null),
- (this.audioConfig = null),
- (this.fileSource = null),
- (this.onEvent = null),
- (this.instance = null),
- (this.needStopListener = !1);
- var e = t.type,
- r = t.video,
- n = t.audio,
- i = t.fileSource,
- o = t.onEvent;
- e && Jl(ip).call(ip, e)
- ? ((this.type = e),
- 'file' === e && this.setFileSource(i),
- r || n
- ? ((r || 'screen' === e) && (this.videoConfig = zm(op)),
- n && (this.audioConfig = zm(sp)),
- o && 'function' == typeof o && (this.onEvent = o))
- : GC('video or audio must be existed'))
- : GC('stream type('.concat(e, ') is invalid'));
- }
- return (
- (t.prototype.setFileSource = function (t) {
- var e, r;
- if ('file' === this.type)
- if (t)
- if ('string' == typeof t || t instanceof File) {
- var n =
- 'string' == typeof t
- ? Td((e = cp.extension)).call(e, function (e) {
- var r;
- return xE((r = t.toLowerCase())).call(r, e);
- })
- : Td((r = cp.type)).call(r, function (e) {
- return t.type === e;
- });
- n ? (this.fileSource = t) : GC('File format is not supported');
- } else GC('fileSource must be string or file object');
- else GC('fileSource must be existed');
- else GC('stream type must be file');
- }),
- (t.prototype.setVideoConfig = function (t) {
- if (this.videoConfig) {
- var e = t.deviceId,
- r = t.frameRate,
- n = t.resolution;
- void 0 !== e &&
- ('string' == typeof e
- ? (this.videoConfig.deviceId = e)
- : GC('deviceId must be string')),
- void 0 !== r && 'number' == typeof r && r > 0
- ? (this.videoConfig.frameRate = r)
- : GC('frameRate must be a number greater than 0'),
- void 0 !== n &&
- 'object' === Wc(n) &&
- 'number' == typeof n.width &&
- 'number' == typeof n.height &&
- n.width > 0 &&
- n.height > 0
- ? (this.videoConfig.resolution = n)
- : GC(
- 'resolution width and height must be a number greater than 0'
- );
- }
- }),
- (t.prototype.setAudioConfig = function (t) {
- if (this.audioConfig) {
- var e = t.deviceId,
- r = t.sampleRate,
- n = t.echoCancellation,
- i = t.noiseSuppression,
- o = t.autoGainControl;
- void 0 !== e &&
- ('string' == typeof e
- ? (this.audioConfig.deviceId = e)
- : GC('deviceId must be string')),
- void 0 !== r && 'number' == typeof r && r > 0
- ? (this.audioConfig.sampleRate = r)
- : GC('sampleRate must be a number greater than 0'),
- void 0 !== n && (this.audioConfig.echoCancellation = !!n),
- void 0 !== i && (this.audioConfig.noiseSuppression = !!i),
- void 0 !== o && (this.audioConfig.autoGainControl = !!o);
- }
- }),
- (t.prototype.start = function () {
- return Ed(this, void 0, void 0, function () {
- var t, e, r, n, i, o, s;
- return Sd(this, function (a) {
- switch (a.label) {
- case 0:
- if (!this.type)
- throw (
- (GC('start failed, init param type is invalid'),
- ((n = new Error('init param type is invalid')).name =
- 'InitializedError'),
- n)
- );
- if (!this.videoConfig && !this.audioConfig)
- throw (
- (GC(
- 'start failed, init param video or audio must be existed'
- ),
- ((n = new Error(
- 'init param video or audio must be existed'
- )).name = 'InitializedError'),
- n)
- );
- if ('file' === this.type && !this.fileSource)
- throw (
- (GC('start failed, file source is not existed'),
- ((n = new Error('file source is not existed')).name =
- 'NotFoundError'),
- n)
- );
- var u, c;
- if (((t = 'media'), 'file' === this.type))
- if (
- ((e = this.fileSource),
- (r =
- 'string' == typeof e
- ? Td((u = up)).call(u, function (t) {
- var r;
- return xE((r = e.toLowerCase())).call(r, t);
- })
- : Td((c = ap)).call(c, function (t) {
- return e.type === t;
- })),
- 'image' === (t = r ? 'image' : 'media') &&
- !this.videoConfig)
- )
- throw (
- (GC('start failed, init param video must be existed'),
- ((n = new Error(
- 'init param video must be existed'
- )).name = 'InitializedError'),
- n)
- );
- if (!this.instance) {
- switch (((i = null), this.type)) {
- case 'device':
- i = new OE();
- break;
- case 'screen':
- i = new ME();
- break;
- case 'file':
- i = 'media' === t ? new NC() : new BC();
- }
- this.instance = i;
- }
- if (this.instance.mediaStream)
- return (
- GC('stream is existed'), [2, this.instance.mediaStream]
- );
- (o = void 0),
- 'file' !== this.type
- ? (o = {
- video: this.videoConfig,
- audio: this.audioConfig,
- })
- : 'media' === t
- ? (o = {
- video: this.videoConfig,
- audio: !!this.audioConfig,
- fileSource: this.fileSource,
- })
- : 'image' === t &&
- (o = {
- video: this.videoConfig,
- fileSource: this.fileSource,
- }),
- (a.label = 1);
- case 1:
- return a.trys.push([1, 3, , 4]), [4, this.instance.start(o)];
- case 2:
- return (
- (s = a.sent()),
- (this.needStopListener = !1),
- this.addStopListener(s),
- [2, s]
- );
- case 3:
- throw a.sent();
- case 4:
- return [2];
- }
- });
- });
- }),
- (t.prototype.stop = function () {
- var t, e;
- (this.needStopListener = !0),
- null === (t = this.instance) || void 0 === t || t.stop(),
- null === (e = this.onEvent) ||
- void 0 === e ||
- e.call(this, { type: lp, data: { message: 'manual stop' } });
- }),
- (t.prototype.getMediaStream = function () {
- var t;
- return null === (t = this.instance) || void 0 === t
- ? void 0
- : t.mediaStream;
- }),
- (t.prototype.getVideoTrack = function () {
- var t, e, r, n;
- return null ===
- (n =
- null ===
- (r =
- null ===
- (e =
- null === (t = this.instance) || void 0 === t
- ? void 0
- : t.mediaStream) || void 0 === e
- ? void 0
- : e.getVideoTracks) || void 0 === r
- ? void 0
- : r.call(e)) || void 0 === n
- ? void 0
- : n[0];
- }),
- (t.prototype.getAudioTrack = function () {
- var t, e, r, n;
- return null ===
- (n =
- null ===
- (r =
- null ===
- (e =
- null === (t = this.instance) || void 0 === t
- ? void 0
- : t.mediaStream) || void 0 === e
- ? void 0
- : e.getAudioTracks) || void 0 === r
- ? void 0
- : r.call(e)) || void 0 === n
- ? void 0
- : n[0];
- }),
- (t.prototype.getResolution = function () {
- var t;
- return null === (t = this.instance) || void 0 === t
- ? void 0
- : t.getResolution();
- }),
- (t.prototype.getRenderView = function () {
- return this.instance &&
- (this.instance instanceof BC || this.instance instanceof NC)
- ? this.instance.getRenderView()
- : null;
- }),
- (t.prototype.getRenderElement = function () {
- return this.instance &&
- (this.instance instanceof BC || this.instance instanceof NC)
- ? this.instance.getRenderElement()
- : null;
- }),
- (t.prototype.addStopListener = function (t) {
- var e,
- r = this;
- 'file' !== this.type &&
- Ph((e = t.getTracks())).call(e, function (e) {
- e.addEventListener(
- 'ended',
- function n() {
- var i, o, s, a;
- if (!r.needStopListener) {
- GC(''.concat(e.kind, ' track is ended')),
- e.stop(),
- null === (o = r.onEvent) ||
- void 0 === o ||
- o.call(r, {
- type: hp,
- data: { message: 'track ended', kind: e.kind },
- });
- var u = PE((i = t.getTracks())).call(i, function (t) {
- return 'ended' === t.readyState;
- });
- u &&
- (GC('stream is ended'),
- null === (s = r.instance) || void 0 === s || s.stop(),
- null === (a = r.onEvent) ||
- void 0 === a ||
- a.call(r, {
- type: lp,
- data: { message: 'stream ended' },
- })),
- e.removeEventListener('ended', n, !1);
- }
- },
- !1
- );
- });
- }),
- t
- );
- })(),
- jC = Yf('manager:device'),
- XC = (function () {
- function t(t) {
- this.getCommonData = null;
- var e = t.getCommonData;
- this.getCommonData = e;
- }
- return (
- (t.prototype.getDevicesList = function (t) {
- return Ed(this, void 0, void 0, function () {
- var e, r, n, i;
- return Sd(this, function (o) {
- switch (o.label) {
- case 0:
- return (
- o.trys.push([0, 2, , 3]),
- [4, navigator.mediaDevices.enumerateDevices()]
- );
- case 1:
- var s;
- return (
- (e = o.sent()),
- (r = []),
- (n = []),
- Ph(e).call(e, function (t) {
- var e = t.kind,
- i = t.deviceId,
- o = t.label;
- 'videoinput' === e
- ? r.push({ type: 'video', deviceId: i, deviceName: o })
- : 'audioinput' === e &&
- 'default' !== i &&
- n.push({ type: 'audio', deviceId: i, deviceName: o });
- }),
- t
- ? 'video' === t
- ? [2, r]
- : 'audio' === t
- ? [2, n]
- : [2, []]
- : [2, mh((s = [])).call(s, r, n)]
- );
- case 2:
- throw ((i = o.sent()), jC('enumerateDevices error: ', i), i);
- case 3:
- return [2];
- }
- });
- });
- }),
- (t.prototype.getCurrentDevice = function (t, e) {
- return Ed(this, void 0, void 0, function () {
- var r, n, i, o, s, a, u, c, h, l, d, f, p;
- return Sd(this, function (v) {
- var m;
- switch (v.label) {
- case 0:
- if (
- ((r = this.getCommonData()),
- (n = r.streamList),
- (i = r.videoEffectManager),
- !Jl((m = ['video', 'audio'])).call(m, t))
- )
- throw (jC('type is invalid'), new Error('type is invalid'));
- if (i.enabled && !e)
- throw (
- (jC('streamId is not existed'),
- new Error('streamId is not existed'))
- );
- if (
- ((o = 'video' === t ? 'camera' : 'microphone'),
- !(
- (s = El(n).call(n, function (t) {
- return t.type === o && (!e || t.id === e);
- })) && s.source instanceof UC
- ))
- )
- return [3, 5];
- if (
- !(a =
- 'video' === t
- ? s.source.getVideoTrack()
- : s.source.getAudioTrack())
- )
- return [3, 5];
- (u = a.getSettings().deviceId),
- (c = { type: t, deviceId: u, deviceName: '' }),
- (v.label = 1);
- case 1:
- return (
- v.trys.push([1, 3, , 4]),
- [4, navigator.mediaDevices.enumerateDevices()]
- );
- case 2:
- return (
- (h = v.sent()),
- (l = ''.concat(t, 'input')),
- (d = El(h).call(h, function (t) {
- return t.kind === l && t.deviceId === u;
- })) &&
- ('default' === u
- ? (f = El(h).call(h, function (t) {
- return (
- t.kind === l &&
- 'default' !== t.deviceId &&
- t.groupId === d.groupId
- );
- })) &&
- ((c.deviceId = f.deviceId), (c.deviceName = f.label))
- : (c.deviceName = d.label)),
- [3, 4]
- );
- case 3:
- return (
- (p = v.sent()), jC('enumerateDevices error: ', p), [3, 4]
- );
- case 4:
- return [2, c];
- case 5:
- return [2, null];
- }
- });
- });
- }),
- (t.prototype.switchDevice = function (t, e, r) {
- var n;
- return Ed(this, void 0, void 0, function () {
- var i,
- o,
- s,
- a,
- u,
- c,
- h,
- l,
- d,
- f,
- p,
- v,
- m,
- y,
- g,
- _,
- b,
- T,
- x,
- E,
- S,
- w,
- R,
- C,
- P,
- A,
- O = this;
- return Sd(this, function (I) {
- var M;
- switch (I.label) {
- case 0:
- if (
- ((i = this.getCommonData()),
- (o = i.streamList),
- (s = i.videoEffectManager),
- (a = i.observer),
- (u = i.videoQuality),
- (c = i.audioQuality),
- (h = i.streamOutput),
- (l = i.isStreamPushing),
- (d = i.connection),
- (f = i.setProcessData),
- !Jl((M = ['video', 'audio'])).call(M, t))
- )
- throw (jC('type is invalid'), new Error('type is invalid'));
- if (!e)
- throw (
- (jC('deviceId is not existed'),
- new Error('deviceId is not existed'))
- );
- if (s.enabled && !r)
- throw (
- (jC('streamId is not existed'),
- new Error('streamId is not existed'))
- );
- if (
- ((p = 'video' === t ? 'camera' : 'microphone'),
- !(
- (v = El(o).call(o, function (t) {
- return t.type === p && (!r || t.id === r);
- })) && v.source instanceof UC
- ))
- )
- return [3, 9];
- (m = null),
- 'video' === t
- ? ((m = new UC({
- type: 'device',
- video: !0,
- audio: !1,
- onEvent: function (t) {
- var e, r;
- t.type === lp &&
- 'stream ended' ===
- (null === (e = t.data) || void 0 === e
- ? void 0
- : e.message) &&
- (null === (r = a.onWarning) ||
- void 0 === r ||
- r.call(
- a,
- Hf.TXLIVE_WARNING_CAMERA_INTERRUPTED,
- 'interrupted',
- { streamId: v.id }
- ));
- },
- })),
- (y = u.frameRate),
- (g = u.width),
- (_ = u.height),
- m.setVideoConfig({
- deviceId: e,
- frameRate: y,
- resolution: { width: g, height: _ },
- }))
- : ((m = new UC({
- type: 'device',
- video: !1,
- audio: !0,
- onEvent: function (t) {
- var e, r;
- t.type === lp &&
- 'stream ended' ===
- (null === (e = t.data) || void 0 === e
- ? void 0
- : e.message) &&
- (null === (r = a.onWarning) ||
- void 0 === r ||
- r.call(
- a,
- Hf.TXLIVE_WARNING_MICROPHONE_INTERRUPTED,
- 'interrupted',
- { streamId: v.id }
- ));
- },
- })),
- (b = c.sampleRate),
- (T = c.echoCancellation),
- (x = c.noiseSuppression),
- (E = c.autoGainControl),
- m.setAudioConfig({
- deviceId: e,
- sampleRate: b,
- echoCancellation: T,
- noiseSuppression: x,
- autoGainControl: E,
- })),
- (S = v.source),
- (v.source = m),
- (w = function () {
- return Ed(O, void 0, void 0, function () {
- return Sd(this, function (e) {
- switch (e.label) {
- case 0:
- cd(function () {
- S.getMediaStream() && S.stop();
- }, 1500),
- (e.label = 1);
- case 1:
- return e.trys.push([1, 3, , 5]), [4, m.start()];
- case 2:
- return e.sent(), [3, 5];
- case 3:
- return (
- e.sent(),
- jC(
- 'switch '.concat(
- 'video' === t ? 'camera' : 'microphone',
- ' failed, try to switch again'
- )
- ),
- S.getMediaStream() && S.stop(),
- [4, m.start()]
- );
- case 4:
- return e.sent(), [3, 5];
- case 5:
- return [2];
- }
- });
- });
- }),
- (I.label = 1);
- case 1:
- return I.trys.push([1, 7, , 8]), [4, w()];
- case 2:
- return (
- I.sent(),
- s.enabled || 'video' !== t
- ? [3, 5]
- : ((R = S.getVideoTrack()),
- (C = m.getVideoTrack()),
- h &&
- (R
- ? h.removeTrack(R)
- : ((P = h.getTracks()),
- Ph(P).call(P, function (e) {
- e.kind === t &&
- 'ended' === e.readyState &&
- h.removeTrack(e);
- })),
- h.addTrack(C)),
- l && d ? [4, d.replaceStreamTrack(C)] : [3, 4])
- );
- case 3:
- I.sent(), (I.label = 4);
- case 4:
- return [3, 6];
- case 5:
- v.track.setSource(m), f(), (I.label = 6);
- case 6:
- return (
- S.getMediaStream() && S.stop(),
- jC(
- 'switch '.concat(
- 'video' === t ? 'camera' : 'microphone',
- ' successfully'
- )
- ),
- [3, 8]
- );
- case 7:
- throw (
- ((A = I.sent()),
- null === (n = a.onWarning) ||
- void 0 === n ||
- n.call(
- a,
- 'video' === t
- ? Hf.TXLIVE_WARNING_CAMERA_START_FAILED
- : Hf.TXLIVE_WARNING_MICROPHONE_START_FAILED,
- A.toString(),
- null
- ),
- A)
- );
- case 8:
- return [3, 10];
- case 9:
- jC('stream is not existed'), (I.label = 10);
- case 10:
- return [2];
- }
- });
- });
- }),
- (t.prototype.switchCamera = function (t, e) {
- return this.switchDevice('video', t, e);
- }),
- (t.prototype.switchMicrophone = function (t, e) {
- return this.switchDevice('audio', t, e);
- }),
- t
- );
- })();
- Ar({ target: 'Array', stat: !0 }, { isArray: Ir });
- var VC,
- HC = rt.Array.isArray,
- WC = { width: 1280, height: 720 },
- YC = { video: ['video', 'image'], audio: ['audio'], text: ['text'] };
- !(function (t) {
- (t[(t.NONE = 0)] = 'NONE'),
- (t[(t.LEFT_RIGHT = 1)] = 'LEFT_RIGHT'),
- (t[(t.UP_DOWN = 2)] = 'UP_DOWN'),
- (t[(t.ALL = 3)] = 'ALL');
- })(VC || (VC = {}));
- var zC = {
- font: 'fontFamily',
- font_size: 'fontSize',
- font_color: 'fill',
- bold: 'fontWeight',
- italic: 'fontStyle',
- shadow_color: 'dropShadowColor',
- shadow_alpha: 'dropShadowAlpha',
- stroke_color: 'stroke',
- stroke_thickness: 'strokeThickness',
- },
- ZC = {
- threshold: { value: -24, min: -100, max: 0 },
- ratio: { value: 12, min: 1, max: 20 },
- knee: { value: 30, min: 0, max: 40 },
- attack: { value: 3, min: 0, max: 1e3 },
- release: { value: 250, min: 0, max: 1e3 },
- },
- JC = Yf('process:helper'),
- KC = (function () {
- function t(t, e) {
- (this.data = {}),
- (this.data.id = Df()),
- (this.data.type = t),
- (this.data.order = 0);
- var r = {};
- (r.id = Df(8)),
- (r.type = t),
- e &&
- ((r.source = e),
- e instanceof HTMLImageElement && (r.type = 'image')),
- (this.data.items = [r]);
- }
- return (
- (t.prototype.setSource = function (t) {
- var e = this.data,
- r = e.type,
- n = e.items[0];
- 'video' === r || 'audio' === r
- ? t
- ? 'video' !== r ||
- t instanceof UC ||
- t instanceof MediaStream ||
- t instanceof HTMLVideoElement ||
- t instanceof HTMLImageElement
- ? 'audio' !== r ||
- t instanceof UC ||
- t instanceof MediaStream ||
- t instanceof HTMLVideoElement ||
- t instanceof HTMLAudioElement
- ? ((n.source = t),
- t instanceof HTMLImageElement && (n.type = 'image'),
- (this.data.items[0] = xd({}, n)))
- : JC('audio source is invalid')
- : JC('video source is invalid')
- : JC('source must be existed')
- : JC('type('.concat(r, ') is invalid'));
- }),
- (t.prototype.setOrder = function (t) {
- 'number' == typeof t
- ? (this.data.order = t)
- : JC('order must be a number');
- }),
- (t.prototype.setLayout = function (t) {
- var e;
- if ('video' === this.data.type) {
- var r = t.width,
- n = t.height,
- i = t.x,
- o = t.y,
- s = PE((e = [r, n, i, o])).call(e, function (t) {
- return 'number' == typeof t;
- });
- if (s)
- if (r < 0 || n < 0)
- JC(
- 'width or height must be a number greater than or equal to 0'
- );
- else {
- var a = this.data.items[0];
- this.data.items[0] = xd(xd({}, a), {
- width: r,
- height: n,
- position: { x: i, y: o },
- });
- }
- else JC('layout params must be number');
- } else
- JC('type is '.concat(this.data.type, ', setLayout is not working'));
- }),
- (t.prototype.setPosition = function (t, e) {
- var r;
- if ('video' === this.data.type || 'text' === this.data.type) {
- var n = PE((r = [t, e])).call(r, function (t) {
- return 'number' == typeof t;
- });
- if (n) {
- var i = this.data.items[0];
- this.data.items[0] = xd(xd({}, i), { position: { x: t, y: e } });
- } else JC('position params must be number');
- } else
- JC(
- 'type is '.concat(this.data.type, ', setPosition is not working')
- );
- }),
- (t.prototype.setSize = function (t, e) {
- var r;
- if ('video' === this.data.type) {
- var n = PE((r = [t, e])).call(r, function (t) {
- return 'number' == typeof t;
- });
- if (n)
- if (t < 0 || e < 0)
- JC(
- 'width or height must be a number greater than or equal to 0'
- );
- else {
- var i = this.data.items[0];
- this.data.items[0] = xd(xd({}, i), { width: t, height: e });
- }
- else JC('size params must be number');
- } else
- JC('type is '.concat(this.data.type, ', setSize is not working'));
- }),
- (t.prototype.setMirror = function (t) {
- if ('video' === this.data.type)
- if ('number' != typeof t || t < VC.NONE || t > VC.ALL)
- JC('mirror type must be a number between 0 and 3');
- else {
- var e = this.data.items[0],
- r = e.operations;
- if (void 0 !== r || t !== VC.NONE) {
- var n = Vh((r = r || [])).call(r, function (t) {
- return 'image_mirror' === t.type;
- }),
- i = function (t) {
- -1 !== n ? (r[n] = t) : r.push(t);
- };
- switch (t) {
- case VC.NONE:
- -1 !== n && pl(r).call(r, n, 1);
- break;
- case VC.LEFT_RIGHT:
- i({ type: 'image_mirror', params: { left_right: 1 } });
- break;
- case VC.UP_DOWN:
- i({ type: 'image_mirror', params: { up_down: 1 } });
- break;
- case VC.ALL:
- i({
- type: 'image_mirror',
- params: { left_right: 1, up_down: 1 },
- });
- }
- this.data.items[0] = xd(xd({}, e), { operations: r });
- }
- }
- else
- JC('type is '.concat(this.data.type, ', setMirror is not working'));
- }),
- (t.prototype.setVolume = function (t) {
- if ('video' === this.data.type || 'audio' === this.data.type) {
- var e = this.data.items[0];
- if ('image' !== e.type)
- if ('number' == typeof t) {
- var r = e.operations,
- n = void 0 === r ? [] : r,
- i = Vh(n).call(n, function (t) {
- return 'audio_volumes' === t.type;
- }),
- o = { type: 'audio_volumes', params: { all: t } };
- -1 !== i ? (n[i] = o) : n.push(o),
- (this.data.items[0] = xd(xd({}, e), { operations: n }));
- } else JC('volume must be a number');
- else JC('type is image, setVolume is not working');
- } else
- JC('type is '.concat(this.data.type, ', setVolume is not working'));
- }),
- (t.prototype.setCompressor = function (t) {
- var e;
- if ('video' === this.data.type || 'audio' === this.data.type) {
- var r = this.data.items[0];
- if ('image' !== r.type) {
- var n = r.operations,
- i = void 0 === n ? [] : n,
- o = Vh(i).call(i, function (t) {
- return 'audio_compressor' === t.type;
- });
- if (t) {
- if (
- PE((e = Rl(t))).call(e, function (e) {
- var r = ZC[e];
- if (!r) return JC('param '.concat(e, ' is invalid')), !1;
- var n,
- i,
- o = t[e];
- return (
- !('number' != typeof o || o < r.min || o > r.max) ||
- (JC(
- mh(
- (n = mh(
- (i = 'param '.concat(
- e,
- ' must be a number between '
- ))
- ).call(i, r.min, ' and '))
- ).call(n, r.max)
- ),
- !1)
- );
- })
- ) {
- var s = { type: 'audio_compressor', params: xd({}, t) };
- -1 !== o ? (i[o] = s) : i.push(s),
- (this.data.items[0] = xd(xd({}, r), { operations: i }));
- }
- } else
- -1 !== o &&
- (pl(i).call(i, o, 1),
- (this.data.items[0] = xd(xd({}, r), { operations: i })));
- } else JC('type is image, setCompressor is not working');
- } else
- JC(
- 'type is '.concat(
- this.data.type,
- ', setCompressor is not working'
- )
- );
- }),
- (t.prototype.setNormalFilter = function (t) {
- var e;
- if ('video' === this.data.type) {
- var r = this.data.items[0],
- n = r.operations,
- i = void 0 === n ? [] : n,
- o = Vh(i).call(i, function (t) {
- return 'image_filter_normal' === t.type;
- });
- if (t) {
- if (
- PE((e = Rl(t))).call(e, function (e) {
- var r = t[e];
- return (
- !('number' != typeof r || r < -100 || r > 100) ||
- (JC(
- 'param '.concat(
- e,
- ' must be a number between -100 and 100'
- )
- ),
- !1)
- );
- })
- ) {
- var s = { type: 'image_filter_normal', params: xd({}, t) };
- -1 !== o ? (i[o] = s) : i.push(s),
- (this.data.items[0] = xd(xd({}, r), { operations: i }));
- }
- } else
- -1 !== o &&
- (pl(i).call(i, o, 1),
- (this.data.items[0] = xd(xd({}, r), { operations: i })));
- } else
- JC(
- 'type is '.concat(
- this.data.type,
- ', setNormalFilter is not working'
- )
- );
- }),
- (t.prototype.setText = function (t, e) {
- if ('text' === this.data.type)
- if (t)
- if ('object' !== Wc(e) || HC(e) || null === e)
- JC('style is invalid');
- else {
- var r = this.data.items[0];
- this.data.items[0] = xd(xd({}, r), {
- content: { text: t, text_style: e },
- });
- }
- else JC('text content is not existed');
- else
- JC('type is '.concat(this.data.type, ', setText is not working'));
- }),
- t
- );
- })(),
- qC = function (t, e) {
- var r;
- if (Jl((r = Rl(YC))).call(r, t)) {
- if ('video' === t || 'audio' === t) {
- if (!e) return void JC('source must be existed');
- if (
- !(
- 'video' !== t ||
- e instanceof UC ||
- e instanceof MediaStream ||
- e instanceof HTMLVideoElement ||
- e instanceof HTMLImageElement
- )
- )
- return void JC('video source is invalid');
- if (
- !(
- 'audio' !== t ||
- e instanceof UC ||
- e instanceof MediaStream ||
- e instanceof HTMLVideoElement ||
- e instanceof HTMLAudioElement
- )
- )
- return void JC('audio source is invalid');
- }
- return new KC(t, e);
- }
- JC('type('.concat(t, ') is invalid'));
- },
- QC = Yf('manager:video'),
- $C = (function () {
- function t(t) {
- (this.enabled = !1),
- (this.getCommonData = null),
- (this.config = {
- videoWidth: null,
- videoHeight: null,
- videoFramerate: null,
- backgroundColor: null,
- });
- var e = t.getCommonData;
- this.getCommonData = e;
- }
- return (
- (t.prototype.enableMixing = function (t) {
- var e = this.getCommonData(),
- r = e.streamList,
- n = e.streamOutput;
- r.length > 0 || n
- ? QC('stream is existed, please stop streaming first')
- : (this.enabled = !!t);
- }),
- (t.prototype.setMixingConfig = function (t) {
- if (t) {
- var e = t.videoWidth,
- r = t.videoHeight,
- n = t.videoFramerate,
- i = t.backgroundColor;
- void 0 !== e &&
- ('number' == typeof e && e > 0
- ? (this.config.videoWidth = e)
- : QC('videoWidth must be a number greater than 0')),
- void 0 !== r &&
- ('number' == typeof r && r > 0
- ? (this.config.videoHeight = r)
- : QC('videoHeight must be a number greater than 0')),
- void 0 !== n &&
- ('number' == typeof n && n > 0
- ? (this.config.videoFramerate = n)
- : QC('videoFramerate must be a number greater than 0')),
- void 0 !== i &&
- ('number' == typeof i && i >= 0 && i <= 16777215
- ? (this.config.backgroundColor = i)
- : QC('backgroundColor must be a valid color number'));
- var o = this.getCommonData().effectProcess;
- if (o) {
- var s = this.getMixingConfig(),
- a = s.videoWidth,
- u = s.videoHeight,
- c = s.videoFramerate,
- h = s.backgroundColor;
- o.setResolution({ width: a, height: u }),
- o.setFrameRate(c),
- o.setBackgroundColor(h);
- }
- }
- }),
- (t.prototype.getMixingConfig = function () {
- var t = this.getCommonData().videoQuality,
- e = t.frameRate,
- r = t.width,
- n = t.height,
- i = this.config,
- o = i.videoWidth,
- s = i.videoHeight,
- a = i.videoFramerate,
- u = i.backgroundColor;
- return {
- videoWidth: null != o ? o : r,
- videoHeight: null != s ? s : n,
- videoFramerate: null != a ? a : e,
- backgroundColor: null != u ? u : 0,
- };
- }),
- (t.prototype.setLayout = function (t) {
- var e, r;
- if (t) {
- var n = this.getCommonData(),
- i = n.streamList,
- o = n.setProcessData,
- s = HC(t) ? t : [t],
- a = function (t) {
- var e = t.streamId,
- r = t.x,
- n = t.y,
- o = t.width,
- s = t.height,
- a = t.zOrder,
- u = El(i).call(i, function (t) {
- var r,
- n = t.source,
- i = n instanceof UC ? n.getMediaStream() : n;
- return (
- (null === (r = null == i ? void 0 : i.getVideoTracks()) ||
- void 0 === r
- ? void 0
- : r.length) && t.id === e
- );
- });
- u
- ? (u.track.setOrder(a),
- u.track.setSize(o, s),
- u.track.setPosition(r, n))
- : QC('stream '.concat(e, ' is not existed'));
- };
- try {
- for (var u = wd(s), c = u.next(); !c.done; c = u.next()) {
- a(c.value);
- }
- } catch (t) {
- e = { error: t };
- } finally {
- try {
- c && !c.done && (r = u.return) && r.call(u);
- } finally {
- if (e) throw e.error;
- }
- }
- o();
- }
- }),
- (t.prototype.getLayout = function (t) {
- var e, r;
- if (!t) return QC('streamId is not existed'), null;
- var n = this.getCommonData().streamList,
- i = El(n).call(n, function (e) {
- return e.id === t;
- });
- if (!i) return QC('stream '.concat(t, ' is not existed')), null;
- var o = i.track.data,
- s = o.items[0];
- return {
- streamId: t,
- zOrder: o.order,
- x: null === (e = s.position) || void 0 === e ? void 0 : e.x,
- y: null === (r = s.position) || void 0 === r ? void 0 : r.y,
- width: s.width,
- height: s.height,
- };
- }),
- (t.prototype.setMirror = function (t) {
- var e, r;
- if (t) {
- var n = this.getCommonData(),
- i = n.streamList,
- o = n.setProcessData,
- s = HC(t) ? t : [t],
- a = function (t) {
- var e = t.streamId,
- r = t.mirrorType,
- n = El(i).call(i, function (t) {
- var r,
- n = t.source,
- i = n instanceof UC ? n.getMediaStream() : n;
- return (
- (null === (r = null == i ? void 0 : i.getVideoTracks()) ||
- void 0 === r
- ? void 0
- : r.length) && t.id === e
- );
- });
- n
- ? n.track.setMirror(r)
- : QC('stream '.concat(e, ' is not existed'));
- };
- try {
- for (var u = wd(s), c = u.next(); !c.done; c = u.next()) {
- a(c.value);
- }
- } catch (t) {
- e = { error: t };
- } finally {
- try {
- c && !c.done && (r = u.return) && r.call(u);
- } finally {
- if (e) throw e.error;
- }
- }
- o();
- }
- }),
- (t.prototype.setNormalFilter = function (t) {
- var e, r;
- if (t) {
- var n = this.getCommonData(),
- i = n.streamList,
- o = n.setProcessData,
- s = HC(t) ? t : [t],
- a = function (t) {
- var e = t.streamId,
- r = t.contrast,
- n = void 0 === r ? 0 : r,
- o = t.brightness,
- s = void 0 === o ? 0 : o,
- a = t.saturation,
- u = void 0 === a ? 0 : a,
- c = El(i).call(i, function (t) {
- var r,
- n = t.source,
- i = n instanceof UC ? n.getMediaStream() : n;
- return (
- (null === (r = null == i ? void 0 : i.getVideoTracks()) ||
- void 0 === r
- ? void 0
- : r.length) && t.id === e
- );
- });
- c
- ? c.track.setNormalFilter(
- 0 === n && 0 === s && 0 === u
- ? null
- : { contrast: n, brightness: s, saturation: u }
- )
- : QC('stream '.concat(e, ' is not existed'));
- };
- try {
- for (var u = wd(s), c = u.next(); !c.done; c = u.next()) {
- a(c.value);
- }
- } catch (t) {
- e = { error: t };
- } finally {
- try {
- c && !c.done && (r = u.return) && r.call(u);
- } finally {
- if (e) throw e.error;
- }
- }
- o();
- }
- }),
- (t.prototype.setWatermark = function (t) {
- var e,
- r,
- n,
- i,
- o = this.getCommonData(),
- s = o.effectTrackList,
- a = o.setProcessData,
- u = Lh(s).call(s, function (t) {
- return 'video' === t.data.type;
- }),
- c = function (t) {
- var e = Vh(s).call(s, function (e) {
- return e === t;
- });
- pl(s).call(s, e, 1);
- };
- try {
- for (var h = wd(u), l = h.next(); !l.done; l = h.next()) {
- c(l.value);
- }
- } catch (t) {
- e = { error: t };
- } finally {
- try {
- l && !l.done && (r = h.return) && r.call(h);
- } finally {
- if (e) throw e.error;
- }
- }
- if (t) {
- var d = HC(t) ? t : [t];
- try {
- for (var f = wd(d), p = f.next(); !p.done; p = f.next()) {
- var v = p.value,
- m = v.image,
- y = v.x,
- g = v.y,
- _ = v.width,
- b = v.height,
- T = v.zOrder;
- if (m && m instanceof HTMLImageElement) {
- var x = qC('video', m);
- x.setOrder(T),
- x.setSize(_, b),
- x.setPosition(y, g),
- s.push(x);
- } else QC('image is invalid');
- }
- } catch (t) {
- n = { error: t };
- } finally {
- try {
- p && !p.done && (i = f.return) && i.call(f);
- } finally {
- if (n) throw n.error;
- }
- }
- a();
- } else a();
- }),
- (t.prototype.setText = function (t) {
- var e,
- r,
- n,
- i,
- o = this.getCommonData(),
- s = o.effectTrackList,
- a = o.setProcessData,
- u = Lh(s).call(s, function (t) {
- return 'text' === t.data.type;
- }),
- c = function (t) {
- var e = Vh(s).call(s, function (e) {
- return e === t;
- });
- pl(s).call(s, e, 1);
- };
- try {
- for (var h = wd(u), l = h.next(); !l.done; l = h.next()) {
- c(l.value);
- }
- } catch (t) {
- e = { error: t };
- } finally {
- try {
- l && !l.done && (r = h.return) && r.call(h);
- } finally {
- if (e) throw e.error;
- }
- }
- if (t) {
- var d = HC(t) ? t : [t];
- try {
- for (var f = wd(d), p = f.next(); !p.done; p = f.next()) {
- var v = p.value,
- m = v.text,
- y = v.style,
- g = v.x,
- _ = v.y,
- b = v.zOrder;
- if (m && 'string' == typeof m) {
- var T = qC('text');
- T.setText(m, y),
- T.setOrder(b),
- T.setPosition(g, _),
- s.push(T);
- } else QC('text is invalid');
- }
- } catch (t) {
- n = { error: t };
- } finally {
- try {
- p && !p.done && (i = f.return) && i.call(f);
- } finally {
- if (n) throw n.error;
- }
- }
- a();
- } else a();
- }),
- t
- );
- })(),
- tP = Yf('manager:audio'),
- eP = (function () {
- function t(t) {
- this.getCommonData = null;
- var e = t.getCommonData;
- this.getCommonData = e;
- }
- return (
- (t.prototype.setVolume = function (t, e) {
- var r = this.getCommonData(),
- n = r.videoEffectManager,
- i = r.streamList,
- o = r.setProcessData;
- if ('number' == typeof t)
- if (!n.enabled || e) {
- var s = El(i).call(i, function (t) {
- var r,
- n = t.source,
- i = n instanceof UC ? n.getMediaStream() : n;
- return (
- (null === (r = null == i ? void 0 : i.getAudioTracks()) ||
- void 0 === r
- ? void 0
- : r.length) &&
- (!e || t.id === e)
- );
- });
- s ? (s.track.setVolume(t), o()) : tP('stream is not existed');
- } else tP('streamId is not existed');
- else tP('volume must be a number');
- }),
- t
- );
- })(),
- rP = rt.setInterval,
- nP = { exports: {} };
- !(function (t, e) {
- t.exports = (function (t) {
- var e = {};
- function r(n) {
- if (e[n]) return e[n].exports;
- var i = (e[n] = { i: n, l: !1, exports: {} });
- return t[n].call(i.exports, i, i.exports, r), (i.l = !0), i.exports;
- }
- return (
- (r.m = t),
- (r.c = e),
- (r.d = function (t, e, n) {
- r.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: n });
- }),
- (r.r = function (t) {
- 'undefined' != typeof Symbol &&
- Symbol.toStringTag &&
- Object.defineProperty(t, Symbol.toStringTag, { value: 'Module' }),
- Object.defineProperty(t, '__esModule', { value: !0 });
- }),
- (r.t = function (t, e) {
- if ((1 & e && (t = r(t)), 8 & e)) return t;
- if (4 & e && 'object' == typeof t && t && t.__esModule) return t;
- var n = Object.create(null);
- if (
- (r.r(n),
- Object.defineProperty(n, 'default', { enumerable: !0, value: t }),
- 2 & e && 'string' != typeof t)
- )
- for (var i in t)
- r.d(
- n,
- i,
- function (e) {
- return t[e];
- }.bind(null, i)
- );
- return n;
- }),
- (r.n = function (t) {
- var e =
- t && t.__esModule
- ? function () {
- return t.default;
- }
- : function () {
- return t;
- };
- return r.d(e, 'a', e), e;
- }),
- (r.o = function (t, e) {
- return Object.prototype.hasOwnProperty.call(t, e);
- }),
- (r.p = ''),
- r((r.s = 90))
- );
- })({
- 17: function (t, e, r) {
- (e.__esModule = !0), (e.default = void 0);
- var n = r(18),
- i = (function () {
- function t() {}
- return (
- (t.getFirstMatch = function (t, e) {
- var r = e.match(t);
- return (r && r.length > 0 && r[1]) || '';
- }),
- (t.getSecondMatch = function (t, e) {
- var r = e.match(t);
- return (r && r.length > 1 && r[2]) || '';
- }),
- (t.matchAndReturnConst = function (t, e, r) {
- if (t.test(e)) return r;
- }),
- (t.getWindowsVersionName = function (t) {
- switch (t) {
- case 'NT':
- return 'NT';
- case 'XP':
- case 'NT 5.1':
- return 'XP';
- case 'NT 5.0':
- return '2000';
- case 'NT 5.2':
- return '2003';
- case 'NT 6.0':
- return 'Vista';
- case 'NT 6.1':
- return '7';
- case 'NT 6.2':
- return '8';
- case 'NT 6.3':
- return '8.1';
- case 'NT 10.0':
- return '10';
- default:
- return;
- }
- }),
- (t.getMacOSVersionName = function (t) {
- var e = t
- .split('.')
- .splice(0, 2)
- .map(function (t) {
- return parseInt(t, 10) || 0;
- });
- if ((e.push(0), 10 === e[0]))
- switch (e[1]) {
- case 5:
- return 'Leopard';
- case 6:
- return 'Snow Leopard';
- case 7:
- return 'Lion';
- case 8:
- return 'Mountain Lion';
- case 9:
- return 'Mavericks';
- case 10:
- return 'Yosemite';
- case 11:
- return 'El Capitan';
- case 12:
- return 'Sierra';
- case 13:
- return 'High Sierra';
- case 14:
- return 'Mojave';
- case 15:
- return 'Catalina';
- default:
- return;
- }
- }),
- (t.getAndroidVersionName = function (t) {
- var e = t
- .split('.')
- .splice(0, 2)
- .map(function (t) {
- return parseInt(t, 10) || 0;
- });
- if ((e.push(0), !(1 === e[0] && e[1] < 5)))
- return 1 === e[0] && e[1] < 6
- ? 'Cupcake'
- : 1 === e[0] && e[1] >= 6
- ? 'Donut'
- : 2 === e[0] && e[1] < 2
- ? 'Eclair'
- : 2 === e[0] && 2 === e[1]
- ? 'Froyo'
- : 2 === e[0] && e[1] > 2
- ? 'Gingerbread'
- : 3 === e[0]
- ? 'Honeycomb'
- : 4 === e[0] && e[1] < 1
- ? 'Ice Cream Sandwich'
- : 4 === e[0] && e[1] < 4
- ? 'Jelly Bean'
- : 4 === e[0] && e[1] >= 4
- ? 'KitKat'
- : 5 === e[0]
- ? 'Lollipop'
- : 6 === e[0]
- ? 'Marshmallow'
- : 7 === e[0]
- ? 'Nougat'
- : 8 === e[0]
- ? 'Oreo'
- : 9 === e[0]
- ? 'Pie'
- : void 0;
- }),
- (t.getVersionPrecision = function (t) {
- return t.split('.').length;
- }),
- (t.compareVersions = function (e, r, n) {
- void 0 === n && (n = !1);
- var i = t.getVersionPrecision(e),
- o = t.getVersionPrecision(r),
- s = Math.max(i, o),
- a = 0,
- u = t.map([e, r], function (e) {
- var r = s - t.getVersionPrecision(e),
- n = e + new Array(r + 1).join('.0');
- return t
- .map(n.split('.'), function (t) {
- return new Array(20 - t.length).join('0') + t;
- })
- .reverse();
- });
- for (n && (a = s - Math.min(i, o)), s -= 1; s >= a; ) {
- if (u[0][s] > u[1][s]) return 1;
- if (u[0][s] === u[1][s]) {
- if (s === a) return 0;
- s -= 1;
- } else if (u[0][s] < u[1][s]) return -1;
- }
- }),
- (t.map = function (t, e) {
- var r,
- n = [];
- if (Array.prototype.map) return Array.prototype.map.call(t, e);
- for (r = 0; r < t.length; r += 1) n.push(e(t[r]));
- return n;
- }),
- (t.find = function (t, e) {
- var r, n;
- if (Array.prototype.find)
- return Array.prototype.find.call(t, e);
- for (r = 0, n = t.length; r < n; r += 1) {
- var i = t[r];
- if (e(i, r)) return i;
- }
- }),
- (t.assign = function (t) {
- for (
- var e,
- r,
- n = t,
- i = arguments.length,
- o = new Array(i > 1 ? i - 1 : 0),
- s = 1;
- s < i;
- s++
- )
- o[s - 1] = arguments[s];
- if (Object.assign)
- return Object.assign.apply(Object, [t].concat(o));
- var a = function () {
- var t = o[e];
- 'object' == typeof t &&
- null !== t &&
- Object.keys(t).forEach(function (e) {
- n[e] = t[e];
- });
- };
- for (e = 0, r = o.length; e < r; e += 1) a();
- return t;
- }),
- (t.getBrowserAlias = function (t) {
- return n.BROWSER_ALIASES_MAP[t];
- }),
- (t.getBrowserTypeByAlias = function (t) {
- return n.BROWSER_MAP[t] || '';
- }),
- t
- );
- })();
- (e.default = i), (t.exports = e.default);
- },
- 18: function (t, e, r) {
- (e.__esModule = !0),
- (e.ENGINE_MAP =
- e.OS_MAP =
- e.PLATFORMS_MAP =
- e.BROWSER_MAP =
- e.BROWSER_ALIASES_MAP =
- void 0),
- (e.BROWSER_ALIASES_MAP = {
- 'Amazon Silk': 'amazon_silk',
- 'Android Browser': 'android',
- Bada: 'bada',
- BlackBerry: 'blackberry',
- Chrome: 'chrome',
- Chromium: 'chromium',
- Electron: 'electron',
- Epiphany: 'epiphany',
- Firefox: 'firefox',
- Focus: 'focus',
- Generic: 'generic',
- 'Google Search': 'google_search',
- Googlebot: 'googlebot',
- 'Internet Explorer': 'ie',
- 'K-Meleon': 'k_meleon',
- Maxthon: 'maxthon',
- 'Microsoft Edge': 'edge',
- 'MZ Browser': 'mz',
- 'NAVER Whale Browser': 'naver',
- Opera: 'opera',
- 'Opera Coast': 'opera_coast',
- PhantomJS: 'phantomjs',
- Puffin: 'puffin',
- QupZilla: 'qupzilla',
- QQ: 'qq',
- QQLite: 'qqlite',
- Safari: 'safari',
- Sailfish: 'sailfish',
- 'Samsung Internet for Android': 'samsung_internet',
- SeaMonkey: 'seamonkey',
- Sleipnir: 'sleipnir',
- Swing: 'swing',
- Tizen: 'tizen',
- 'UC Browser': 'uc',
- Vivaldi: 'vivaldi',
- 'WebOS Browser': 'webos',
- WeChat: 'wechat',
- 'Yandex Browser': 'yandex',
- Roku: 'roku',
- }),
- (e.BROWSER_MAP = {
- amazon_silk: 'Amazon Silk',
- android: 'Android Browser',
- bada: 'Bada',
- blackberry: 'BlackBerry',
- chrome: 'Chrome',
- chromium: 'Chromium',
- electron: 'Electron',
- epiphany: 'Epiphany',
- firefox: 'Firefox',
- focus: 'Focus',
- generic: 'Generic',
- googlebot: 'Googlebot',
- google_search: 'Google Search',
- ie: 'Internet Explorer',
- k_meleon: 'K-Meleon',
- maxthon: 'Maxthon',
- edge: 'Microsoft Edge',
- mz: 'MZ Browser',
- naver: 'NAVER Whale Browser',
- opera: 'Opera',
- opera_coast: 'Opera Coast',
- phantomjs: 'PhantomJS',
- puffin: 'Puffin',
- qupzilla: 'QupZilla',
- qq: 'QQ Browser',
- qqlite: 'QQ Browser Lite',
- safari: 'Safari',
- sailfish: 'Sailfish',
- samsung_internet: 'Samsung Internet for Android',
- seamonkey: 'SeaMonkey',
- sleipnir: 'Sleipnir',
- swing: 'Swing',
- tizen: 'Tizen',
- uc: 'UC Browser',
- vivaldi: 'Vivaldi',
- webos: 'WebOS Browser',
- wechat: 'WeChat',
- yandex: 'Yandex Browser',
- }),
- (e.PLATFORMS_MAP = {
- tablet: 'tablet',
- mobile: 'mobile',
- desktop: 'desktop',
- tv: 'tv',
- }),
- (e.OS_MAP = {
- WindowsPhone: 'Windows Phone',
- Windows: 'Windows',
- MacOS: 'macOS',
- iOS: 'iOS',
- Android: 'Android',
- WebOS: 'WebOS',
- BlackBerry: 'BlackBerry',
- Bada: 'Bada',
- Tizen: 'Tizen',
- Linux: 'Linux',
- ChromeOS: 'Chrome OS',
- PlayStation4: 'PlayStation 4',
- Roku: 'Roku',
- }),
- (e.ENGINE_MAP = {
- EdgeHTML: 'EdgeHTML',
- Blink: 'Blink',
- Trident: 'Trident',
- Presto: 'Presto',
- Gecko: 'Gecko',
- WebKit: 'WebKit',
- });
- },
- 90: function (t, e, r) {
- (e.__esModule = !0), (e.default = void 0);
- var n,
- i = (n = r(91)) && n.__esModule ? n : { default: n },
- o = r(18);
- function s(t, e) {
- for (var r = 0; r < e.length; r++) {
- var n = e[r];
- (n.enumerable = n.enumerable || !1),
- (n.configurable = !0),
- 'value' in n && (n.writable = !0),
- Object.defineProperty(t, n.key, n);
- }
- }
- var a = (function () {
- function t() {}
- var e, r, n;
- return (
- (t.getParser = function (t, e) {
- if ((void 0 === e && (e = !1), 'string' != typeof t))
- throw new Error('UserAgent should be a string');
- return new i.default(t, e);
- }),
- (t.parse = function (t) {
- return new i.default(t).getResult();
- }),
- (e = t),
- (n = [
- {
- key: 'BROWSER_MAP',
- get: function () {
- return o.BROWSER_MAP;
- },
- },
- {
- key: 'ENGINE_MAP',
- get: function () {
- return o.ENGINE_MAP;
- },
- },
- {
- key: 'OS_MAP',
- get: function () {
- return o.OS_MAP;
- },
- },
- {
- key: 'PLATFORMS_MAP',
- get: function () {
- return o.PLATFORMS_MAP;
- },
- },
- ]),
- (r = null) && s(e.prototype, r),
- n && s(e, n),
- t
- );
- })();
- (e.default = a), (t.exports = e.default);
- },
- 91: function (t, e, r) {
- (e.__esModule = !0), (e.default = void 0);
- var n = u(r(92)),
- i = u(r(93)),
- o = u(r(94)),
- s = u(r(95)),
- a = u(r(17));
- function u(t) {
- return t && t.__esModule ? t : { default: t };
- }
- var c = (function () {
- function t(t, e) {
- if ((void 0 === e && (e = !1), null == t || '' === t))
- throw new Error("UserAgent parameter can't be empty");
- (this._ua = t), (this.parsedResult = {}), !0 !== e && this.parse();
- }
- var e = t.prototype;
- return (
- (e.getUA = function () {
- return this._ua;
- }),
- (e.test = function (t) {
- return t.test(this._ua);
- }),
- (e.parseBrowser = function () {
- var t = this;
- this.parsedResult.browser = {};
- var e = a.default.find(n.default, function (e) {
- if ('function' == typeof e.test) return e.test(t);
- if (e.test instanceof Array)
- return e.test.some(function (e) {
- return t.test(e);
- });
- throw new Error("Browser's test function is not valid");
- });
- return (
- e && (this.parsedResult.browser = e.describe(this.getUA())),
- this.parsedResult.browser
- );
- }),
- (e.getBrowser = function () {
- return this.parsedResult.browser
- ? this.parsedResult.browser
- : this.parseBrowser();
- }),
- (e.getBrowserName = function (t) {
- return t
- ? String(this.getBrowser().name).toLowerCase() || ''
- : this.getBrowser().name || '';
- }),
- (e.getBrowserVersion = function () {
- return this.getBrowser().version;
- }),
- (e.getOS = function () {
- return this.parsedResult.os
- ? this.parsedResult.os
- : this.parseOS();
- }),
- (e.parseOS = function () {
- var t = this;
- this.parsedResult.os = {};
- var e = a.default.find(i.default, function (e) {
- if ('function' == typeof e.test) return e.test(t);
- if (e.test instanceof Array)
- return e.test.some(function (e) {
- return t.test(e);
- });
- throw new Error("Browser's test function is not valid");
- });
- return (
- e && (this.parsedResult.os = e.describe(this.getUA())),
- this.parsedResult.os
- );
- }),
- (e.getOSName = function (t) {
- var e = this.getOS().name;
- return t ? String(e).toLowerCase() || '' : e || '';
- }),
- (e.getOSVersion = function () {
- return this.getOS().version;
- }),
- (e.getPlatform = function () {
- return this.parsedResult.platform
- ? this.parsedResult.platform
- : this.parsePlatform();
- }),
- (e.getPlatformType = function (t) {
- void 0 === t && (t = !1);
- var e = this.getPlatform().type;
- return t ? String(e).toLowerCase() || '' : e || '';
- }),
- (e.parsePlatform = function () {
- var t = this;
- this.parsedResult.platform = {};
- var e = a.default.find(o.default, function (e) {
- if ('function' == typeof e.test) return e.test(t);
- if (e.test instanceof Array)
- return e.test.some(function (e) {
- return t.test(e);
- });
- throw new Error("Browser's test function is not valid");
- });
- return (
- e && (this.parsedResult.platform = e.describe(this.getUA())),
- this.parsedResult.platform
- );
- }),
- (e.getEngine = function () {
- return this.parsedResult.engine
- ? this.parsedResult.engine
- : this.parseEngine();
- }),
- (e.getEngineName = function (t) {
- return t
- ? String(this.getEngine().name).toLowerCase() || ''
- : this.getEngine().name || '';
- }),
- (e.parseEngine = function () {
- var t = this;
- this.parsedResult.engine = {};
- var e = a.default.find(s.default, function (e) {
- if ('function' == typeof e.test) return e.test(t);
- if (e.test instanceof Array)
- return e.test.some(function (e) {
- return t.test(e);
- });
- throw new Error("Browser's test function is not valid");
- });
- return (
- e && (this.parsedResult.engine = e.describe(this.getUA())),
- this.parsedResult.engine
- );
- }),
- (e.parse = function () {
- return (
- this.parseBrowser(),
- this.parseOS(),
- this.parsePlatform(),
- this.parseEngine(),
- this
- );
- }),
- (e.getResult = function () {
- return a.default.assign({}, this.parsedResult);
- }),
- (e.satisfies = function (t) {
- var e = this,
- r = {},
- n = 0,
- i = {},
- o = 0;
- if (
- (Object.keys(t).forEach(function (e) {
- var s = t[e];
- 'string' == typeof s
- ? ((i[e] = s), (o += 1))
- : 'object' == typeof s && ((r[e] = s), (n += 1));
- }),
- n > 0)
- ) {
- var s = Object.keys(r),
- u = a.default.find(s, function (t) {
- return e.isOS(t);
- });
- if (u) {
- var c = this.satisfies(r[u]);
- if (void 0 !== c) return c;
- }
- var h = a.default.find(s, function (t) {
- return e.isPlatform(t);
- });
- if (h) {
- var l = this.satisfies(r[h]);
- if (void 0 !== l) return l;
- }
- }
- if (o > 0) {
- var d = Object.keys(i),
- f = a.default.find(d, function (t) {
- return e.isBrowser(t, !0);
- });
- if (void 0 !== f) return this.compareVersion(i[f]);
- }
- }),
- (e.isBrowser = function (t, e) {
- void 0 === e && (e = !1);
- var r = this.getBrowserName().toLowerCase(),
- n = t.toLowerCase(),
- i = a.default.getBrowserTypeByAlias(n);
- return e && i && (n = i.toLowerCase()), n === r;
- }),
- (e.compareVersion = function (t) {
- var e = [0],
- r = t,
- n = !1,
- i = this.getBrowserVersion();
- if ('string' == typeof i)
- return (
- '>' === t[0] || '<' === t[0]
- ? ((r = t.substr(1)),
- '=' === t[1] ? ((n = !0), (r = t.substr(2))) : (e = []),
- '>' === t[0] ? e.push(1) : e.push(-1))
- : '=' === t[0]
- ? (r = t.substr(1))
- : '~' === t[0] && ((n = !0), (r = t.substr(1))),
- e.indexOf(a.default.compareVersions(i, r, n)) > -1
- );
- }),
- (e.isOS = function (t) {
- return this.getOSName(!0) === String(t).toLowerCase();
- }),
- (e.isPlatform = function (t) {
- return this.getPlatformType(!0) === String(t).toLowerCase();
- }),
- (e.isEngine = function (t) {
- return this.getEngineName(!0) === String(t).toLowerCase();
- }),
- (e.is = function (t, e) {
- return (
- void 0 === e && (e = !1),
- this.isBrowser(t, e) || this.isOS(t) || this.isPlatform(t)
- );
- }),
- (e.some = function (t) {
- var e = this;
- return (
- void 0 === t && (t = []),
- t.some(function (t) {
- return e.is(t);
- })
- );
- }),
- t
- );
- })();
- (e.default = c), (t.exports = e.default);
- },
- 92: function (t, e, r) {
- (e.__esModule = !0), (e.default = void 0);
- var n,
- i = (n = r(17)) && n.__esModule ? n : { default: n },
- o = /version\/(\d+(\.?_?\d+)+)/i,
- s = [
- {
- test: [/googlebot/i],
- describe: function (t) {
- var e = { name: 'Googlebot' },
- r =
- i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i, t) ||
- i.default.getFirstMatch(o, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/opera/i],
- describe: function (t) {
- var e = { name: 'Opera' },
- r =
- i.default.getFirstMatch(o, t) ||
- i.default.getFirstMatch(
- /(?:opera)[\s/](\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/opr\/|opios/i],
- describe: function (t) {
- var e = { name: 'Opera' },
- r =
- i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i, t) ||
- i.default.getFirstMatch(o, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/SamsungBrowser/i],
- describe: function (t) {
- var e = { name: 'Samsung Internet for Android' },
- r =
- i.default.getFirstMatch(o, t) ||
- i.default.getFirstMatch(
- /(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/Whale/i],
- describe: function (t) {
- var e = { name: 'NAVER Whale Browser' },
- r =
- i.default.getFirstMatch(o, t) ||
- i.default.getFirstMatch(
- /(?:whale)[\s/](\d+(?:\.\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/MZBrowser/i],
- describe: function (t) {
- var e = { name: 'MZ Browser' },
- r =
- i.default.getFirstMatch(
- /(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,
- t
- ) || i.default.getFirstMatch(o, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/focus/i],
- describe: function (t) {
- var e = { name: 'Focus' },
- r =
- i.default.getFirstMatch(
- /(?:focus)[\s/](\d+(?:\.\d+)+)/i,
- t
- ) || i.default.getFirstMatch(o, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/swing/i],
- describe: function (t) {
- var e = { name: 'Swing' },
- r =
- i.default.getFirstMatch(
- /(?:swing)[\s/](\d+(?:\.\d+)+)/i,
- t
- ) || i.default.getFirstMatch(o, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/coast/i],
- describe: function (t) {
- var e = { name: 'Opera Coast' },
- r =
- i.default.getFirstMatch(o, t) ||
- i.default.getFirstMatch(
- /(?:coast)[\s/](\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/opt\/\d+(?:.?_?\d+)+/i],
- describe: function (t) {
- var e = { name: 'Opera Touch' },
- r =
- i.default.getFirstMatch(
- /(?:opt)[\s/](\d+(\.?_?\d+)+)/i,
- t
- ) || i.default.getFirstMatch(o, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/yabrowser/i],
- describe: function (t) {
- var e = { name: 'Yandex Browser' },
- r =
- i.default.getFirstMatch(
- /(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,
- t
- ) || i.default.getFirstMatch(o, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/ucbrowser/i],
- describe: function (t) {
- var e = { name: 'UC Browser' },
- r =
- i.default.getFirstMatch(o, t) ||
- i.default.getFirstMatch(
- /(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/Maxthon|mxios/i],
- describe: function (t) {
- var e = { name: 'Maxthon' },
- r =
- i.default.getFirstMatch(o, t) ||
- i.default.getFirstMatch(
- /(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/epiphany/i],
- describe: function (t) {
- var e = { name: 'Epiphany' },
- r =
- i.default.getFirstMatch(o, t) ||
- i.default.getFirstMatch(
- /(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/puffin/i],
- describe: function (t) {
- var e = { name: 'Puffin' },
- r =
- i.default.getFirstMatch(o, t) ||
- i.default.getFirstMatch(
- /(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/sleipnir/i],
- describe: function (t) {
- var e = { name: 'Sleipnir' },
- r =
- i.default.getFirstMatch(o, t) ||
- i.default.getFirstMatch(
- /(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/k-meleon/i],
- describe: function (t) {
- var e = { name: 'K-Meleon' },
- r =
- i.default.getFirstMatch(o, t) ||
- i.default.getFirstMatch(
- /(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/micromessenger/i],
- describe: function (t) {
- var e = { name: 'WeChat' },
- r =
- i.default.getFirstMatch(
- /(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,
- t
- ) || i.default.getFirstMatch(o, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/qqbrowser/i],
- describe: function (t) {
- var e = {
- name: /qqbrowserlite/i.test(t)
- ? 'QQ Browser Lite'
- : 'QQ Browser',
- },
- r =
- i.default.getFirstMatch(
- /(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,
- t
- ) || i.default.getFirstMatch(o, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/msie|trident/i],
- describe: function (t) {
- var e = { name: 'Internet Explorer' },
- r = i.default.getFirstMatch(
- /(?:msie |rv:)(\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/\sedg\//i],
- describe: function (t) {
- var e = { name: 'Microsoft Edge' },
- r = i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/edg([ea]|ios)/i],
- describe: function (t) {
- var e = { name: 'Microsoft Edge' },
- r = i.default.getSecondMatch(
- /edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/vivaldi/i],
- describe: function (t) {
- var e = { name: 'Vivaldi' },
- r = i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/seamonkey/i],
- describe: function (t) {
- var e = { name: 'SeaMonkey' },
- r = i.default.getFirstMatch(
- /seamonkey\/(\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/sailfish/i],
- describe: function (t) {
- var e = { name: 'Sailfish' },
- r = i.default.getFirstMatch(
- /sailfish\s?browser\/(\d+(\.\d+)?)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/silk/i],
- describe: function (t) {
- var e = { name: 'Amazon Silk' },
- r = i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/phantom/i],
- describe: function (t) {
- var e = { name: 'PhantomJS' },
- r = i.default.getFirstMatch(
- /phantomjs\/(\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/slimerjs/i],
- describe: function (t) {
- var e = { name: 'SlimerJS' },
- r = i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/blackberry|\bbb\d+/i, /rim\stablet/i],
- describe: function (t) {
- var e = { name: 'BlackBerry' },
- r =
- i.default.getFirstMatch(o, t) ||
- i.default.getFirstMatch(
- /blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/(web|hpw)[o0]s/i],
- describe: function (t) {
- var e = { name: 'WebOS Browser' },
- r =
- i.default.getFirstMatch(o, t) ||
- i.default.getFirstMatch(
- /w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/bada/i],
- describe: function (t) {
- var e = { name: 'Bada' },
- r = i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/tizen/i],
- describe: function (t) {
- var e = { name: 'Tizen' },
- r =
- i.default.getFirstMatch(
- /(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,
- t
- ) || i.default.getFirstMatch(o, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/qupzilla/i],
- describe: function (t) {
- var e = { name: 'QupZilla' },
- r =
- i.default.getFirstMatch(
- /(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,
- t
- ) || i.default.getFirstMatch(o, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/firefox|iceweasel|fxios/i],
- describe: function (t) {
- var e = { name: 'Firefox' },
- r = i.default.getFirstMatch(
- /(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/electron/i],
- describe: function (t) {
- var e = { name: 'Electron' },
- r = i.default.getFirstMatch(
- /(?:electron)\/(\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/MiuiBrowser/i],
- describe: function (t) {
- var e = { name: 'Miui' },
- r = i.default.getFirstMatch(
- /(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/chromium/i],
- describe: function (t) {
- var e = { name: 'Chromium' },
- r =
- i.default.getFirstMatch(
- /(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,
- t
- ) || i.default.getFirstMatch(o, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/chrome|crios|crmo/i],
- describe: function (t) {
- var e = { name: 'Chrome' },
- r = i.default.getFirstMatch(
- /(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,
- t
- );
- return r && (e.version = r), e;
- },
- },
- {
- test: [/GSA/i],
- describe: function (t) {
- var e = { name: 'Google Search' },
- r = i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: function (t) {
- var e = !t.test(/like android/i),
- r = t.test(/android/i);
- return e && r;
- },
- describe: function (t) {
- var e = { name: 'Android Browser' },
- r = i.default.getFirstMatch(o, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/playstation 4/i],
- describe: function (t) {
- var e = { name: 'PlayStation 4' },
- r = i.default.getFirstMatch(o, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/safari|applewebkit/i],
- describe: function (t) {
- var e = { name: 'Safari' },
- r = i.default.getFirstMatch(o, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/.*/i],
- describe: function (t) {
- var e =
- -1 !== t.search('\\(')
- ? /^(.*)\/(.*)[ \t]\((.*)/
- : /^(.*)\/(.*) /;
- return {
- name: i.default.getFirstMatch(e, t),
- version: i.default.getSecondMatch(e, t),
- };
- },
- },
- ];
- (e.default = s), (t.exports = e.default);
- },
- 93: function (t, e, r) {
- (e.__esModule = !0), (e.default = void 0);
- var n,
- i = (n = r(17)) && n.__esModule ? n : { default: n },
- o = r(18),
- s = [
- {
- test: [/Roku\/DVP/],
- describe: function (t) {
- var e = i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i, t);
- return { name: o.OS_MAP.Roku, version: e };
- },
- },
- {
- test: [/windows phone/i],
- describe: function (t) {
- var e = i.default.getFirstMatch(
- /windows phone (?:os)?\s?(\d+(\.\d+)*)/i,
- t
- );
- return { name: o.OS_MAP.WindowsPhone, version: e };
- },
- },
- {
- test: [/windows /i],
- describe: function (t) {
- var e = i.default.getFirstMatch(
- /Windows ((NT|XP)( \d\d?.\d)?)/i,
- t
- ),
- r = i.default.getWindowsVersionName(e);
- return { name: o.OS_MAP.Windows, version: e, versionName: r };
- },
- },
- {
- test: [/Macintosh(.*?) FxiOS(.*?)\//],
- describe: function (t) {
- var e = { name: o.OS_MAP.iOS },
- r = i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/macintosh/i],
- describe: function (t) {
- var e = i.default
- .getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i, t)
- .replace(/[_\s]/g, '.'),
- r = i.default.getMacOSVersionName(e),
- n = { name: o.OS_MAP.MacOS, version: e };
- return r && (n.versionName = r), n;
- },
- },
- {
- test: [/(ipod|iphone|ipad)/i],
- describe: function (t) {
- var e = i.default
- .getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i, t)
- .replace(/[_\s]/g, '.');
- return { name: o.OS_MAP.iOS, version: e };
- },
- },
- {
- test: function (t) {
- var e = !t.test(/like android/i),
- r = t.test(/android/i);
- return e && r;
- },
- describe: function (t) {
- var e = i.default.getFirstMatch(
- /android[\s/-](\d+(\.\d+)*)/i,
- t
- ),
- r = i.default.getAndroidVersionName(e),
- n = { name: o.OS_MAP.Android, version: e };
- return r && (n.versionName = r), n;
- },
- },
- {
- test: [/(web|hpw)[o0]s/i],
- describe: function (t) {
- var e = i.default.getFirstMatch(
- /(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,
- t
- ),
- r = { name: o.OS_MAP.WebOS };
- return e && e.length && (r.version = e), r;
- },
- },
- {
- test: [/blackberry|\bbb\d+/i, /rim\stablet/i],
- describe: function (t) {
- var e =
- i.default.getFirstMatch(
- /rim\stablet\sos\s(\d+(\.\d+)*)/i,
- t
- ) ||
- i.default.getFirstMatch(
- /blackberry\d+\/(\d+([_\s]\d+)*)/i,
- t
- ) ||
- i.default.getFirstMatch(/\bbb(\d+)/i, t);
- return { name: o.OS_MAP.BlackBerry, version: e };
- },
- },
- {
- test: [/bada/i],
- describe: function (t) {
- var e = i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i, t);
- return { name: o.OS_MAP.Bada, version: e };
- },
- },
- {
- test: [/tizen/i],
- describe: function (t) {
- var e = i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i, t);
- return { name: o.OS_MAP.Tizen, version: e };
- },
- },
- {
- test: [/linux/i],
- describe: function () {
- return { name: o.OS_MAP.Linux };
- },
- },
- {
- test: [/CrOS/],
- describe: function () {
- return { name: o.OS_MAP.ChromeOS };
- },
- },
- {
- test: [/PlayStation 4/],
- describe: function (t) {
- var e = i.default.getFirstMatch(
- /PlayStation 4[/\s](\d+(\.\d+)*)/i,
- t
- );
- return { name: o.OS_MAP.PlayStation4, version: e };
- },
- },
- ];
- (e.default = s), (t.exports = e.default);
- },
- 94: function (t, e, r) {
- (e.__esModule = !0), (e.default = void 0);
- var n,
- i = (n = r(17)) && n.__esModule ? n : { default: n },
- o = r(18),
- s = [
- {
- test: [/googlebot/i],
- describe: function () {
- return { type: 'bot', vendor: 'Google' };
- },
- },
- {
- test: [/huawei/i],
- describe: function (t) {
- var e = i.default.getFirstMatch(/(can-l01)/i, t) && 'Nova',
- r = { type: o.PLATFORMS_MAP.mobile, vendor: 'Huawei' };
- return e && (r.model = e), r;
- },
- },
- {
- test: [/nexus\s*(?:7|8|9|10).*/i],
- describe: function () {
- return { type: o.PLATFORMS_MAP.tablet, vendor: 'Nexus' };
- },
- },
- {
- test: [/ipad/i],
- describe: function () {
- return {
- type: o.PLATFORMS_MAP.tablet,
- vendor: 'Apple',
- model: 'iPad',
- };
- },
- },
- {
- test: [/Macintosh(.*?) FxiOS(.*?)\//],
- describe: function () {
- return {
- type: o.PLATFORMS_MAP.tablet,
- vendor: 'Apple',
- model: 'iPad',
- };
- },
- },
- {
- test: [/kftt build/i],
- describe: function () {
- return {
- type: o.PLATFORMS_MAP.tablet,
- vendor: 'Amazon',
- model: 'Kindle Fire HD 7',
- };
- },
- },
- {
- test: [/silk/i],
- describe: function () {
- return { type: o.PLATFORMS_MAP.tablet, vendor: 'Amazon' };
- },
- },
- {
- test: [/tablet(?! pc)/i],
- describe: function () {
- return { type: o.PLATFORMS_MAP.tablet };
- },
- },
- {
- test: function (t) {
- var e = t.test(/ipod|iphone/i),
- r = t.test(/like (ipod|iphone)/i);
- return e && !r;
- },
- describe: function (t) {
- var e = i.default.getFirstMatch(/(ipod|iphone)/i, t);
- return {
- type: o.PLATFORMS_MAP.mobile,
- vendor: 'Apple',
- model: e,
- };
- },
- },
- {
- test: [/nexus\s*[0-6].*/i, /galaxy nexus/i],
- describe: function () {
- return { type: o.PLATFORMS_MAP.mobile, vendor: 'Nexus' };
- },
- },
- {
- test: [/[^-]mobi/i],
- describe: function () {
- return { type: o.PLATFORMS_MAP.mobile };
- },
- },
- {
- test: function (t) {
- return 'blackberry' === t.getBrowserName(!0);
- },
- describe: function () {
- return { type: o.PLATFORMS_MAP.mobile, vendor: 'BlackBerry' };
- },
- },
- {
- test: function (t) {
- return 'bada' === t.getBrowserName(!0);
- },
- describe: function () {
- return { type: o.PLATFORMS_MAP.mobile };
- },
- },
- {
- test: function (t) {
- return 'windows phone' === t.getBrowserName();
- },
- describe: function () {
- return { type: o.PLATFORMS_MAP.mobile, vendor: 'Microsoft' };
- },
- },
- {
- test: function (t) {
- var e = Number(String(t.getOSVersion()).split('.')[0]);
- return 'android' === t.getOSName(!0) && e >= 3;
- },
- describe: function () {
- return { type: o.PLATFORMS_MAP.tablet };
- },
- },
- {
- test: function (t) {
- return 'android' === t.getOSName(!0);
- },
- describe: function () {
- return { type: o.PLATFORMS_MAP.mobile };
- },
- },
- {
- test: function (t) {
- return 'macos' === t.getOSName(!0);
- },
- describe: function () {
- return { type: o.PLATFORMS_MAP.desktop, vendor: 'Apple' };
- },
- },
- {
- test: function (t) {
- return 'windows' === t.getOSName(!0);
- },
- describe: function () {
- return { type: o.PLATFORMS_MAP.desktop };
- },
- },
- {
- test: function (t) {
- return 'linux' === t.getOSName(!0);
- },
- describe: function () {
- return { type: o.PLATFORMS_MAP.desktop };
- },
- },
- {
- test: function (t) {
- return 'playstation 4' === t.getOSName(!0);
- },
- describe: function () {
- return { type: o.PLATFORMS_MAP.tv };
- },
- },
- {
- test: function (t) {
- return 'roku' === t.getOSName(!0);
- },
- describe: function () {
- return { type: o.PLATFORMS_MAP.tv };
- },
- },
- ];
- (e.default = s), (t.exports = e.default);
- },
- 95: function (t, e, r) {
- (e.__esModule = !0), (e.default = void 0);
- var n,
- i = (n = r(17)) && n.__esModule ? n : { default: n },
- o = r(18),
- s = [
- {
- test: function (t) {
- return 'microsoft edge' === t.getBrowserName(!0);
- },
- describe: function (t) {
- if (/\sedg\//i.test(t)) return { name: o.ENGINE_MAP.Blink };
- var e = i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i, t);
- return { name: o.ENGINE_MAP.EdgeHTML, version: e };
- },
- },
- {
- test: [/trident/i],
- describe: function (t) {
- var e = { name: o.ENGINE_MAP.Trident },
- r = i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: function (t) {
- return t.test(/presto/i);
- },
- describe: function (t) {
- var e = { name: o.ENGINE_MAP.Presto },
- r = i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: function (t) {
- var e = t.test(/gecko/i),
- r = t.test(/like gecko/i);
- return e && !r;
- },
- describe: function (t) {
- var e = { name: o.ENGINE_MAP.Gecko },
- r = i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i, t);
- return r && (e.version = r), e;
- },
- },
- {
- test: [/(apple)?webkit\/537\.36/i],
- describe: function () {
- return { name: o.ENGINE_MAP.Blink };
- },
- },
- {
- test: [/(apple)?webkit/i],
- describe: function (t) {
- var e = { name: o.ENGINE_MAP.WebKit },
- r = i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i, t);
- return r && (e.version = r), e;
- },
- },
- ];
- (e.default = s), (t.exports = e.default);
- },
- });
- })(nP);
- var iP = r(nP.exports),
- oP = (function () {
- function t() {
- (this.baseUrl = ''), this.setSignalingServer('webrtcpush.myqcloud.com');
- }
- return (
- (t.prototype.setSignalingServer = function (t) {
- this.baseUrl = 'https://'.concat(t);
- }),
- (t.prototype.fetchPushStream = function (t) {
- return Ed(this, void 0, void 0, function () {
- var e, r, n, i, o;
- return Sd(this, function (s) {
- switch (s.label) {
- case 0:
- (e = ''.concat(this.baseUrl, '/webrtc/v1/pushstream')),
- (s.label = 1);
- case 1:
- return s.trys.push([1, 3, , 4]), [4, aE(e, t)];
- case 2:
- var a;
- if (
- ((r = s.sent()),
- (n = r.errcode),
- (i = r.errmsg),
- (o = r.remotesdp),
- 0 !== n)
- )
- throw new Error(
- mh(
- (a = 'push stream failed, errCode:'.concat(
- n,
- ', errMsg:'
- ))
- ).call(a, i)
- );
- return [2, { remoteSdp: o, sessionId: t.sessionid }];
- case 3:
- throw s.sent();
- case 4:
- return [2];
- }
- });
- });
- }),
- (t.prototype.fetchStopStream = function (t) {
- return Ed(this, void 0, void 0, function () {
- var e, r, n, i;
- return Sd(this, function (o) {
- switch (o.label) {
- case 0:
- (e = ''.concat(this.baseUrl, '/webrtc/v1/stopstream')),
- (o.label = 1);
- case 1:
- return o.trys.push([1, 3, , 4]), [4, aE(e, t)];
- case 2:
- var s;
- if (
- ((r = o.sent()), (n = r.errcode), (i = r.errmsg), 0 !== n)
- )
- throw new Error(
- mh(
- (s = 'stop stream failed, errCode:'.concat(
- n,
- ', errmsg:'
- ))
- ).call(s, i)
- );
- return [2, r];
- case 3:
- throw o.sent();
- case 4:
- return [2];
- }
- });
- });
- }),
- t
- );
- })(),
- sP = function (t, e, r) {
- var n,
- i,
- o,
- s = 'AS';
- 'firefox' === Mf.browserDetails.browser && ((e *= 1e3), (s = 'TIAS'));
- var a = new RegExp(
- mh((n = 'm='.concat(t, ' (.*)\r\nc=IN (.*)\r\nb='))).call(
- n,
- s,
- ':(.*)\r\n'
- )
- ),
- u = new RegExp('m='.concat(t, ' (.*)\r\nc=IN (.*)\r\n')),
- c = mh(
- (i = mh((o = 'm='.concat(t, ' $1\r\nc=IN $2\r\nb='))).call(o, s, ':'))
- ).call(i, e, '\r\n');
- return (r = a.test(r) ? r.replace(a, c) : r.replace(u, c));
- },
- aP = function (t) {
- var e = t.split('\r\n'),
- r = [];
- return (
- Ph(e).call(e, function (t) {
- var e = t;
- Jl(t).call(t, 'a=fmtp:111') && (e = ''.concat(t, ';stereo=1'));
- var n,
- i = /a=rtpmap:(\d+) (opus|vp8|vp9|h264|h265|av1)/i.exec(t);
- i &&
- (e = mh((n = ''.concat(t, '\r\na=rtcp-fb:'))).call(
- n,
- i[1],
- ' rrtr'
- ));
- r.push(e);
- }),
- r.join('\r\n')
- );
- },
- uP = Yf('connection'),
- cP = (function () {
- function t(t) {
- var e, r, n;
- void 0 === t && (t = {}),
- (this.status = $f),
- (this.url = null),
- (this.stream = null),
- (this.bitrate = { video: null, audio: null }),
- (this.signaling = null),
- (this.signalingConfig = {}),
- (this.listener = {
- onEvent: null,
- onStatusUpdate: null,
- onStatisticsUpdate: null,
- }),
- (this.promise = null),
- (this.peerConnection = null),
- (this.negotiating = !1),
- (this.intervalId = null),
- (this.lastStatsReport = null),
- (this.sessionId = null);
- var i = t.url,
- o = t.streamSource,
- s = t.videoBitrate,
- a = t.audioBitrate,
- u = t.signalingConfig,
- c = t.onEvent,
- h = t.onStatusUpdate,
- l = t.onStatisticsUpdate;
- i && this.setUrl(i),
- o && this.setStreamSource(o),
- s && this.setVideoBitrate(s),
- a && this.setAudioBitrate(a),
- u && this.setSignalingConfig(u),
- (this.signaling = new oP()),
- c && 'function' == typeof c && (this.listener.onEvent = c),
- h && 'function' == typeof h && (this.listener.onStatusUpdate = h),
- l && 'function' == typeof l && (this.listener.onStatisticsUpdate = l),
- (this.onIceConnectionStateChange = lh(
- (e = this.onIceConnectionStateChange)
- ).call(e, this)),
- (this.onConnectionStateChange = lh(
- (r = this.onConnectionStateChange)
- ).call(r, this)),
- (this.onNegotiationNeeded = lh((n = this.onNegotiationNeeded)).call(
- n,
- this
- ));
- }
- return (
- (t.prototype.setUrl = function (t) {
- if (t) {
- var e = (function (t) {
- var e =
- /^(?:webrtc:\/\/)(?:[0-9.\-A-Za-z_]+)(?:\/)(?:[0-9.\-A-Za-z_]+)(?:\/)([^?#]*)(?:\?*)(?:[^?#]*)/.exec(
- t
- );
- return e ? e[1] : null;
- })(t);
- null !== e ? (this.url = t) : uP('url is invalid');
- } else uP('url is not existed');
- }),
- (t.prototype.setStreamSource = function (t) {
- t
- ? t instanceof MediaStream || t instanceof UC
- ? (this.stream =
- t instanceof MediaStream ? t : t.getMediaStream())
- : uP('streamSource is invalid')
- : uP('streamSource is not existed');
- }),
- (t.prototype.setVideoBitrate = function (t) {
- 'number' == typeof t && t > 0
- ? this.setBitrate('video', t)
- : uP('videoBitrate must be a number greater than 0');
- }),
- (t.prototype.setAudioBitrate = function (t) {
- 'number' == typeof t && t > 0
- ? this.setBitrate('audio', t)
- : uP('audioBitrate must be a number greater than 0');
- }),
- (t.prototype.setSignalingConfig = function (t) {
- if (t) {
- var e = t.domainName,
- r = t.extraParams;
- e &&
- 'string' == typeof e &&
- ((this.signalingConfig.domainName = e),
- this.signaling.setSignalingServer(e)),
- r && 'object' === Wc(r) && (this.signalingConfig.extraParams = r);
- } else uP('signalingConfig is not existed');
- }),
- (t.prototype.start = function () {
- var t = this,
- e = this,
- r = e.status,
- n = e.url,
- i = e.stream;
- return new zx(function (e, o) {
- t.promise = { resolve: e, reject: o };
- var s = function (t) {
- var e = new Error(t);
- return (e.name = 'CheckError'), e;
- };
- return n
- ? i
- ? r !== $f
- ? (uP('stream is pushing'), void o(s('stream is pushing')))
- : void t.startConnect()
- : (uP('stream is invalid'), void o(s('stream is invalid')))
- : (uP('url is invalid'), void o(s('url is invalid')));
- });
- }),
- (t.prototype.stop = function () {
- this.url &&
- this.sessionId &&
- (this.signaling
- .fetchStopStream({
- streamurl: this.url,
- sessionid: this.sessionId,
- })
- .catch(function (t) {
- uP('request stop error, '.concat(t.toString()));
- }),
- (this.sessionId = null)),
- this.stopConnect();
- }),
- (t.prototype.replaceStreamTrack = function (t) {
- return Ed(this, void 0, void 0, function () {
- var e, r;
- return Sd(this, function (n) {
- var i;
- switch (n.label) {
- case 0:
- if (this.status !== ep)
- throw (
- (uP('no stream is pushing'),
- new Error('no stream is pushing'))
- );
- if (!(t instanceof MediaStreamTrack))
- throw (
- (uP('newTrack must be MediaStreamTrack'),
- new Error('newTrack must be MediaStreamTrack'))
- );
- n.label = 1;
- case 1:
- return (
- n.trys.push([1, 4, , 5]),
- (e = El((i = this.peerConnection.getSenders())).call(
- i,
- function (e) {
- return e.track && e.track.kind === t.kind;
- }
- ))
- ? [4, e.replaceTrack(t)]
- : [3, 3]
- );
- case 2:
- n.sent(), (n.label = 3);
- case 3:
- return [3, 5];
- case 4:
- throw ((r = n.sent()), uP('sender replaceTrack failed'), r);
- case 5:
- return [2];
- }
- });
- });
- }),
- (t.prototype.getLocalDescription = function () {
- var t;
- return null === (t = this.peerConnection) || void 0 === t
- ? void 0
- : t.localDescription;
- }),
- (t.prototype.getRemoteDescription = function () {
- var t;
- return null === (t = this.peerConnection) || void 0 === t
- ? void 0
- : t.remoteDescription;
- }),
- (t.prototype.startConnect = function () {
- var t,
- e,
- r,
- n = this;
- try {
- this.peerConnection = new RTCPeerConnection({
- iceServers: [],
- bundlePolicy: 'max-bundle',
- rtcpMuxPolicy: 'require',
- });
- } catch (t) {
- return (
- uP('create connection error, '.concat(t.toString())),
- void this.promise.reject(t)
- );
- }
- (this.status = tp),
- null === (r = (e = this.listener).onStatusUpdate) ||
- void 0 === r ||
- r.call(e, { type: tp, data: { message: 'connecting' } }),
- (this.negotiating = !1),
- this.peerConnection.addEventListener(
- 'iceconnectionstatechange',
- this.onIceConnectionStateChange
- ),
- this.peerConnection.addEventListener(
- 'connectionstatechange',
- this.onConnectionStateChange
- ),
- this.peerConnection.addEventListener(
- 'negotiationneeded',
- this.onNegotiationNeeded
- ),
- Ph((t = this.stream.getTracks())).call(t, function (t) {
- n.peerConnection.addTrack(t, n.stream);
- });
- }),
- (t.prototype.stopConnect = function (t) {
- var e, r;
- void 0 === t && (t = 'manual stop'),
- this.status !== $f &&
- (this.destroyConnect(),
- null === (r = (e = this.listener).onStatusUpdate) ||
- void 0 === r ||
- r.call(e, { type: $f, data: { message: t } }));
- }),
- (t.prototype.destroyConnect = function () {
- (this.status = $f),
- (this.negotiating = !1),
- (this.lastStatsReport = null),
- (this.promise = null),
- this.intervalId &&
- (window.clearInterval(this.intervalId), (this.intervalId = null)),
- this.peerConnection &&
- (this.peerConnection.removeEventListener(
- 'iceconnectionstatechange',
- this.onIceConnectionStateChange
- ),
- this.peerConnection.removeEventListener(
- 'connectionstatechange',
- this.onConnectionStateChange
- ),
- this.peerConnection.removeEventListener(
- 'negotiationneeded',
- this.onNegotiationNeeded
- ),
- this.peerConnection.close(),
- (this.peerConnection = null));
- }),
- (t.prototype.onIceConnectionStateChange = function () {
- switch (
- (uP(
- 'onIceConnectionStateChange: '.concat(
- this.peerConnection.iceConnectionState
- )
- ),
- this.peerConnection.iceConnectionState)
- ) {
- case 'failed':
- case 'disconnected':
- uP('iceConnection disconnected, please try again'),
- this.promise.reject(new Error('connection disconnected')),
- this.stopConnect('connection disconnected');
- }
- }),
- (t.prototype.onConnectionStateChange = function () {
- var t, e;
- switch (
- (uP(
- 'onConnectionStateChange: '.concat(
- this.peerConnection.connectionState
- )
- ),
- this.peerConnection.connectionState)
- ) {
- case 'failed':
- case 'disconnected':
- uP('connection disconnected, please try again'),
- this.promise.reject(new Error('connection disconnected')),
- this.stopConnect('connection disconnected');
- break;
- case 'connected':
- uP('connection connected'),
- (this.status = ep),
- null === (e = (t = this.listener).onStatusUpdate) ||
- void 0 === e ||
- e.call(t, { type: ep, data: { message: 'connected' } });
- var r = this.bitrate,
- n = r.video,
- i = r.audio;
- n && this.setBitrate('video', n),
- i && this.setBitrate('audio', i),
- this.startStatReport(),
- this.promise.resolve();
- }
- }),
- (t.prototype.onNegotiationNeeded = function () {
- uP('onNegotiationNeeded'), this.createOffer();
- }),
- (t.prototype.createOffer = function () {
- return Ed(this, void 0, void 0, function () {
- var t, e;
- return Sd(this, function (r) {
- switch (r.label) {
- case 0:
- if (
- this.negotiating ||
- 'stable' !== this.peerConnection.signalingState
- )
- return [2];
- (this.negotiating = !0), (r.label = 1);
- case 1:
- return (
- r.trys.push([1, 4, 5, 6]),
- [4, this.peerConnection.createOffer()]
- );
- case 2:
- return (
- ((t = r.sent()).sdp = aP(t.sdp)),
- [4, this.peerConnection.setLocalDescription(t)]
- );
- case 3:
- return r.sent(), this.sendOffer(t), [3, 6];
- case 4:
- return (
- (e = r.sent()),
- uP('setLocalDescription error, '.concat(e.toString())),
- this.promise.reject(e),
- this.destroyConnect(),
- [3, 6]
- );
- case 5:
- return (this.negotiating = !1), [7];
- case 6:
- return [2];
- }
- });
- });
- }),
- (t.prototype.sendOffer = function (t) {
- var e, r, n, i, o;
- return Ed(this, void 0, void 0, function () {
- var s, a, u, c, h, l, d, f, p;
- return Sd(this, function (v) {
- var m, y, g;
- switch (v.label) {
- case 0:
- null === (r = (e = this.listener).onEvent) ||
- void 0 === r ||
- r.call(e, {
- type: rp,
- data: { message: 'request push start' },
- }),
- (v.label = 1);
- case 1:
- return (
- v.trys.push([1, 3, , 4]),
- (s = iP.parse(window.navigator.userAgent)),
- (a = s.browser),
- (u = s.os),
- (c = mh(
- (m = mh(
- (y = mh((g = ''.concat(u.name || 'other', ' '))).call(
- g,
- u.version,
- ';'
- ))
- ).call(y, a.name || 'other', ' '))
- ).call(m, a.version)),
- (h =
- null !== (n = this.signalingConfig.extraParams) &&
- void 0 !== n
- ? n
- : {}),
- [
- 4,
- this.signaling.fetchPushStream(
- xd(
- {
- streamurl: this.url,
- sessionid: Df(),
- clientinfo: c,
- clienttype: 'TXLivePusher-'.concat(zf),
- localsdp: t,
- },
- h
- )
- ),
- ]
- );
- case 2:
- return (
- (l = v.sent()),
- (d = l.remoteSdp),
- (f = l.sessionId),
- null === (o = (i = this.listener).onEvent) ||
- void 0 === o ||
- o.call(i, {
- type: np,
- data: { message: 'request push success' },
- }),
- (this.sessionId = f),
- this.handleAnswer(d),
- [3, 4]
- );
- case 3:
- return (
- (p = v.sent()),
- uP('request push error, '.concat(p.toString())),
- (p.name = 'RequestError'),
- this.promise.reject(p),
- this.stopConnect('connection disconnected'),
- [3, 4]
- );
- case 4:
- return [2];
- }
- });
- });
- }),
- (t.prototype.handleAnswer = function (t) {
- return Ed(this, void 0, void 0, function () {
- var e;
- return Sd(this, function (r) {
- switch (r.label) {
- case 0:
- return (
- r.trys.push([0, 2, , 3]),
- [
- 4,
- this.peerConnection.setRemoteDescription(
- new RTCSessionDescription(t)
- ),
- ]
- );
- case 1:
- return r.sent(), [3, 3];
- case 2:
- return (
- (e = r.sent()),
- uP('setRemoteDescription error, '.concat(e.toString())),
- this.promise.reject(e),
- this.destroyConnect(),
- [3, 3]
- );
- case 3:
- return [2];
- }
- });
- });
- }),
- (t.prototype.setBitrate = function (t, e) {
- return Ed(this, void 0, void 0, function () {
- var r, n, i, o, s, a, u, c, h, l;
- return Sd(this, function (d) {
- var f, p;
- switch (d.label) {
- case 0:
- if (((this.bitrate[t] = e), this.status !== ep)) return [2];
- if (
- ((r = Mf.browserDetails),
- (n = r.browser),
- (i = r.version),
- !(
- ('chrome' === n ||
- 'safari' === n ||
- ('firefox' === n && i >= 64)) &&
- 'RTCRtpSender' in window &&
- 'setParameters' in window.RTCRtpSender.prototype
- ))
- )
- return [3, 5];
- if (
- !(o = El((f = this.peerConnection.getSenders())).call(
- f,
- function (e) {
- return e.track && e.track.kind === t;
- }
- ))
- )
- return [3, 4];
- ((s = o.getParameters()).encodings &&
- 0 !== s.encodings.length) ||
- (s.encodings = [{}]),
- (s.encodings[0].maxBitrate = 1e3 * e),
- (d.label = 1);
- case 1:
- return d.trys.push([1, 3, , 4]), [4, o.setParameters(s)];
- case 2:
- return (
- d.sent(),
- uP(
- mh((p = ''.concat(t, ' bandwidth is set to '))).call(
- p,
- e,
- ' kbps'
- )
- ),
- [3, 4]
- );
- case 3:
- return (
- d.sent(),
- uP('failed to set bandwidth by setting maxBitrate'),
- [3, 4]
- );
- case 4:
- return [2];
- case 5:
- return (
- d.trys.push([5, 9, , 10]),
- [4, this.peerConnection.createOffer()]
- );
- case 6:
- return (
- ((a = d.sent()).sdp = aP(a.sdp)),
- [4, this.peerConnection.setLocalDescription(a)]
- );
- case 7:
- return (
- d.sent(),
- (u = this.peerConnection.remoteDescription),
- (c = u.type),
- (h = u.sdp),
- (l = { type: c, sdp: sP(t, e, h) }),
- uP(
- 'applying bandwidth restriction to setRemoteDescription'
- ),
- [4, this.peerConnection.setRemoteDescription(l)]
- );
- case 8:
- return d.sent(), [3, 10];
- case 9:
- return (
- d.sent(),
- uP(
- 'failed to setRemoteDescription with bandwidth restriction'
- ),
- [3, 10]
- );
- case 10:
- return [2];
- }
- });
- });
- }),
- (t.prototype.startStatReport = function () {
- var t = this;
- this.intervalId &&
- (window.clearInterval(this.intervalId), (this.intervalId = null)),
- (this.intervalId = rP(function () {
- return Ed(t, void 0, void 0, function () {
- var t, e, r, n;
- return Sd(this, function (i) {
- switch (i.label) {
- case 0:
- return this.peerConnection
- ? [4, this.peerConnection.getStats(null)]
- : [2];
- case 1:
- return (
- (t = i.sent()),
- (e = (function (t, e) {
- var r, n, i, o;
- if ((void 0 === e && (e = null), e)) {
- var s = null,
- a = null,
- u = null;
- Ph(t).call(t, function (t) {
- 'track' === t.type &&
- ('video' === t.kind || t.frameWidth) &&
- (s = t.id),
- 'outbound-rtp' === t.type &&
- ('video' === t.kind || 'video' === t.mediaType
- ? (a = t.id)
- : ('audio' !== t.kind &&
- 'audio' !== t.mediaType) ||
- (u = t.id));
- });
- var c = t.get(s),
- h = t.get(a),
- l = e.get(s),
- d = e.get(a),
- f = void 0;
- void 0 !== (null == h ? void 0 : h.timestamp) &&
- void 0 !== (null == d ? void 0 : d.timestamp) &&
- (f = (h.timestamp - d.timestamp) / 1e3);
- var p = void 0;
- void 0 !== (null == h ? void 0 : h.framesPerSecond)
- ? (p = h.framesPerSecond)
- : void 0 !==
- (null == h ? void 0 : h.framerateMean)
- ? (p = h.framerateMean)
- : void 0 !==
- (null == h ? void 0 : h.framesSent) &&
- void 0 !==
- (null == d ? void 0 : d.framesSent) &&
- f
- ? (p = (h.framesSent - d.framesSent) / f)
- : void 0 !==
- (null == c ? void 0 : c.framesSent) &&
- void 0 !==
- (null == l ? void 0 : l.framesSent) &&
- f &&
- (p = (c.framesSent - l.framesSent) / f);
- var v = void 0;
- void 0 !== (null == h ? void 0 : h.bytesSent) &&
- void 0 !== (null == d ? void 0 : d.bytesSent) &&
- f &&
- (v = (8 * (h.bytesSent - d.bytesSent)) / f);
- var m = void 0;
- void 0 !==
- (null == h ? void 0 : h.totalEncodeTime) &&
- void 0 !==
- (null == h ? void 0 : h.framesEncoded) &&
- void 0 !==
- (null == d ? void 0 : d.totalEncodeTime) &&
- void 0 !==
- (null == d ? void 0 : d.framesEncoded) &&
- (m =
- h.framesEncoded - d.framesEncoded
- ? ((h.totalEncodeTime - d.totalEncodeTime) /
- (h.framesEncoded - d.framesEncoded)) *
- 1e3
- : (h.totalEncodeTime / h.framesEncoded) *
- 1e3);
- var y = void 0;
- void 0 !==
- (null == h ? void 0 : h.totalPacketSendDelay) &&
- void 0 !== (null == h ? void 0 : h.packetsSent) &&
- void 0 !==
- (null == d ? void 0 : d.totalPacketSendDelay) &&
- void 0 !== (null == d ? void 0 : d.packetsSent) &&
- (y =
- h.packetsSent - d.packetsSent
- ? ((h.totalPacketSendDelay -
- d.totalPacketSendDelay) /
- (h.packetsSent - d.packetsSent)) *
- 1e3
- : (h.totalPacketSendDelay / h.packetsSent) *
- 1e3);
- var g = t.get(u),
- _ = e.get(u);
- void 0 !== (null == g ? void 0 : g.timestamp) &&
- void 0 !== (null == _ ? void 0 : _.timestamp) &&
- (f = (g.timestamp - _.timestamp) / 1e3);
- var b = void 0;
- return (
- void 0 !== (null == g ? void 0 : g.bytesSent) &&
- void 0 !== (null == _ ? void 0 : _.bytesSent) &&
- f &&
- (b = (8 * (g.bytesSent - _.bytesSent)) / f),
- {
- timestamp:
- null !==
- (r = null == h ? void 0 : h.timestamp) &&
- void 0 !== r
- ? r
- : null == g
- ? void 0
- : g.timestamp,
- video: {
- bitrate: v && Number(v.toFixed(2)),
- framesPerSecond: p && jy(p.toString(), 10),
- frameWidth:
- null !==
- (n = null == h ? void 0 : h.frameWidth) &&
- void 0 !== n
- ? n
- : null == c
- ? void 0
- : c.frameWidth,
- frameHeight:
- null !==
- (i =
- null == h ? void 0 : h.frameHeight) &&
- void 0 !== i
- ? i
- : null == c
- ? void 0
- : c.frameHeight,
- framesEncoded:
- null == h ? void 0 : h.framesEncoded,
- framesSent:
- null !==
- (o = null == h ? void 0 : h.framesSent) &&
- void 0 !== o
- ? o
- : null == c
- ? void 0
- : c.framesSent,
- packetsSent:
- null == h ? void 0 : h.packetsSent,
- nackCount: null == h ? void 0 : h.nackCount,
- firCount: null == h ? void 0 : h.firCount,
- pliCount: null == h ? void 0 : h.pliCount,
- frameEncodeAvgTime: m && Number(m.toFixed(2)),
- packetSendDelay: y && Number(y.toFixed(2)),
- },
- audio: {
- bitrate: b && Number(b.toFixed(2)),
- packetsSent:
- null == g ? void 0 : g.packetsSent,
- },
- }
- );
- }
- })(t, this.lastStatsReport)),
- (this.lastStatsReport = t),
- e &&
- (null ===
- (n = (r = this.listener).onStatisticsUpdate) ||
- void 0 === n ||
- n.call(r, e)),
- [2]
- );
- }
- });
- });
- }, 1e3));
- }),
- t
- );
- })();
- function hP(t, e) {
- (this.name = 'AggregateError'), (this.errors = t), (this.message = e || '');
- }
- hP.prototype = Error.prototype;
- var lP = setTimeout;
- function dP(t) {
- return Boolean(t && void 0 !== t.length);
- }
- function fP() {}
- function pP(t) {
- if (!(this instanceof pP))
- throw new TypeError('Promises must be constructed via new');
- if ('function' != typeof t) throw new TypeError('not a function');
- (this._state = 0),
- (this._handled = !1),
- (this._value = void 0),
- (this._deferreds = []),
- bP(t, this);
- }
- function vP(t, e) {
- for (; 3 === t._state; ) t = t._value;
- 0 !== t._state
- ? ((t._handled = !0),
- pP._immediateFn(function () {
- var r = 1 === t._state ? e.onFulfilled : e.onRejected;
- if (null !== r) {
- var n;
- try {
- n = r(t._value);
- } catch (t) {
- return void yP(e.promise, t);
- }
- mP(e.promise, n);
- } else (1 === t._state ? mP : yP)(e.promise, t._value);
- }))
- : t._deferreds.push(e);
- }
- function mP(t, e) {
- try {
- if (e === t)
- throw new TypeError('A promise cannot be resolved with itself.');
- if (e && ('object' == typeof e || 'function' == typeof e)) {
- var r = e.then;
- if (e instanceof pP) return (t._state = 3), (t._value = e), void gP(t);
- if ('function' == typeof r)
- return void bP(
- ((n = r),
- (i = e),
- function () {
- n.apply(i, arguments);
- }),
- t
- );
- }
- (t._state = 1), (t._value = e), gP(t);
- } catch (e) {
- yP(t, e);
- }
- var n, i;
- }
- function yP(t, e) {
- (t._state = 2), (t._value = e), gP(t);
- }
- function gP(t) {
- 2 === t._state &&
- 0 === t._deferreds.length &&
- pP._immediateFn(function () {
- t._handled || pP._unhandledRejectionFn(t._value);
- });
- for (var e = 0, r = t._deferreds.length; e < r; e++) vP(t, t._deferreds[e]);
- t._deferreds = null;
- }
- function _P(t, e, r) {
- (this.onFulfilled = 'function' == typeof t ? t : null),
- (this.onRejected = 'function' == typeof e ? e : null),
- (this.promise = r);
- }
- function bP(t, e) {
- var r = !1;
- try {
- t(
- function (t) {
- r || ((r = !0), mP(e, t));
- },
- function (t) {
- r || ((r = !0), yP(e, t));
- }
- );
- } catch (t) {
- if (r) return;
- (r = !0), yP(e, t);
- }
- }
- (pP.prototype.catch = function (t) {
- return this.then(null, t);
- }),
- (pP.prototype.then = function (t, e) {
- var r = new this.constructor(fP);
- return vP(this, new _P(t, e, r)), r;
- }),
- (pP.prototype.finally = function (t) {
- var e = this.constructor;
- return this.then(
- function (r) {
- return e.resolve(t()).then(function () {
- return r;
- });
- },
- function (r) {
- return e.resolve(t()).then(function () {
- return e.reject(r);
- });
- }
- );
- }),
- (pP.all = function (t) {
- return new pP(function (e, r) {
- if (!dP(t)) return r(new TypeError('Promise.all accepts an array'));
- var n = Array.prototype.slice.call(t);
- if (0 === n.length) return e([]);
- var i = n.length;
- function o(t, s) {
- try {
- if (s && ('object' == typeof s || 'function' == typeof s)) {
- var a = s.then;
- if ('function' == typeof a)
- return void a.call(
- s,
- function (e) {
- o(t, e);
- },
- r
- );
- }
- (n[t] = s), 0 == --i && e(n);
- } catch (t) {
- r(t);
- }
- }
- for (var s = 0; s < n.length; s++) o(s, n[s]);
- });
- }),
- (pP.any = function (t) {
- var e = this;
- return new e(function (r, n) {
- if (!t || void 0 === t.length)
- return n(new TypeError('Promise.any accepts an array'));
- var i = Array.prototype.slice.call(t);
- if (0 === i.length) return n();
- for (var o = [], s = 0; s < i.length; s++)
- try {
- e.resolve(i[s])
- .then(r)
- .catch(function (t) {
- o.push(t),
- o.length === i.length &&
- n(new hP(o, 'All promises were rejected'));
- });
- } catch (t) {
- n(t);
- }
- });
- }),
- (pP.allSettled = function (t) {
- return new this(function (e, r) {
- if (!t || void 0 === t.length)
- return r(
- new TypeError(
- typeof t +
- ' ' +
- t +
- ' is not iterable(cannot read property Symbol(Symbol.iterator))'
- )
- );
- var n = Array.prototype.slice.call(t);
- if (0 === n.length) return e([]);
- var i = n.length;
- function o(t, r) {
- if (r && ('object' == typeof r || 'function' == typeof r)) {
- var s = r.then;
- if ('function' == typeof s)
- return void s.call(
- r,
- function (e) {
- o(t, e);
- },
- function (r) {
- (n[t] = { status: 'rejected', reason: r }), 0 == --i && e(n);
- }
- );
- }
- (n[t] = { status: 'fulfilled', value: r }), 0 == --i && e(n);
- }
- for (var s = 0; s < n.length; s++) o(s, n[s]);
- });
- }),
- (pP.resolve = function (t) {
- return t && 'object' == typeof t && t.constructor === pP
- ? t
- : new pP(function (e) {
- e(t);
- });
- }),
- (pP.reject = function (t) {
- return new pP(function (e, r) {
- r(t);
- });
- }),
- (pP.race = function (t) {
- return new pP(function (e, r) {
- if (!dP(t)) return r(new TypeError('Promise.race accepts an array'));
- for (var n = 0, i = t.length; n < i; n++) pP.resolve(t[n]).then(e, r);
- });
- }),
- (pP._immediateFn =
- ('function' == typeof setImmediate &&
- function (t) {
- setImmediate(t);
- }) ||
- function (t) {
- lP(t, 0);
- }),
- (pP._unhandledRejectionFn = function (t) {
- 'undefined' != typeof console &&
- console &&
- console.warn('Possible Unhandled Promise Rejection:', t);
- });
- var TP = Object.getOwnPropertySymbols,
- xP = Object.prototype.hasOwnProperty,
- EP = Object.prototype.propertyIsEnumerable;
- function SP(t) {
- if (null == t)
- throw new TypeError(
- 'Object.assign cannot be called with null or undefined'
- );
- return Object(t);
- }
- var wP = (function () {
- try {
- if (!Object.assign) return !1;
- var t = new String('abc');
- if (((t[5] = 'de'), '5' === Object.getOwnPropertyNames(t)[0])) return !1;
- for (var e = {}, r = 0; r < 10; r++) e['_' + String.fromCharCode(r)] = r;
- if (
- '0123456789' !==
- Object.getOwnPropertyNames(e)
- .map(function (t) {
- return e[t];
- })
- .join('')
- )
- return !1;
- var n = {};
- return (
- 'abcdefghijklmnopqrst'.split('').forEach(function (t) {
- n[t] = t;
- }),
- 'abcdefghijklmnopqrst' === Object.keys(Object.assign({}, n)).join('')
- );
- } catch (t) {
- return !1;
- }
- })()
- ? Object.assign
- : function (t, e) {
- for (var r, n, i = SP(t), o = 1; o < arguments.length; o++) {
- for (var s in (r = Object(arguments[o])))
- xP.call(r, s) && (i[s] = r[s]);
- if (TP) {
- n = TP(r);
- for (var a = 0; a < n.length; a++)
- EP.call(r, n[a]) && (i[n[a]] = r[n[a]]);
- }
- }
- return i;
- };
- 'undefined' == typeof globalThis &&
- ('undefined' != typeof self
- ? (self.globalThis = self)
- : 'undefined' != typeof global && (global.globalThis = global)),
- globalThis.Promise || (globalThis.Promise = pP),
- Object.assign || (Object.assign = wP);
- if (
- ((Date.now && Date.prototype.getTime) ||
- (Date.now = function () {
- return new Date().getTime();
- }),
- !globalThis.performance || !globalThis.performance.now)
- ) {
- var RP = Date.now();
- globalThis.performance || (globalThis.performance = {}),
- (globalThis.performance.now = function () {
- return Date.now() - RP;
- });
- }
- for (
- var CP,
- PP,
- AP,
- OP,
- IP,
- MP,
- DP,
- LP,
- FP,
- NP,
- kP,
- BP,
- GP,
- UP,
- jP,
- XP,
- VP,
- HP,
- WP,
- YP,
- zP = Date.now(),
- ZP = ['ms', 'moz', 'webkit', 'o'],
- JP = 0;
- JP < ZP.length && !globalThis.requestAnimationFrame;
- ++JP
- ) {
- var KP = ZP[JP];
- (globalThis.requestAnimationFrame =
- globalThis[KP + 'RequestAnimationFrame']),
- (globalThis.cancelAnimationFrame =
- globalThis[KP + 'CancelAnimationFrame'] ||
- globalThis[KP + 'CancelRequestAnimationFrame']);
- }
- globalThis.requestAnimationFrame ||
- (globalThis.requestAnimationFrame = function (t) {
- if ('function' != typeof t) throw new TypeError(t + 'is not a function');
- var e = Date.now(),
- r = 16 + zP - e;
- return (
- r < 0 && (r = 0),
- (zP = e),
- globalThis.self.setTimeout(function () {
- (zP = Date.now()), t(performance.now());
- }, r)
- );
- }),
- globalThis.cancelAnimationFrame ||
- (globalThis.cancelAnimationFrame = function (t) {
- return clearTimeout(t);
- }),
- Math.sign ||
- (Math.sign = function (t) {
- return 0 === (t = Number(t)) || isNaN(t) ? t : t > 0 ? 1 : -1;
- }),
- Number.isInteger ||
- (Number.isInteger = function (t) {
- return 'number' == typeof t && isFinite(t) && Math.floor(t) === t;
- }),
- globalThis.ArrayBuffer || (globalThis.ArrayBuffer = Array),
- globalThis.Float32Array || (globalThis.Float32Array = Array),
- globalThis.Uint32Array || (globalThis.Uint32Array = Array),
- globalThis.Uint16Array || (globalThis.Uint16Array = Array),
- globalThis.Uint8Array || (globalThis.Uint8Array = Array),
- globalThis.Int32Array || (globalThis.Int32Array = Array),
- (function (t) {
- (t[(t.WEBGL_LEGACY = 0)] = 'WEBGL_LEGACY'),
- (t[(t.WEBGL = 1)] = 'WEBGL'),
- (t[(t.WEBGL2 = 2)] = 'WEBGL2');
- })(CP || (CP = {})),
- (function (t) {
- (t[(t.UNKNOWN = 0)] = 'UNKNOWN'),
- (t[(t.WEBGL = 1)] = 'WEBGL'),
- (t[(t.CANVAS = 2)] = 'CANVAS');
- })(PP || (PP = {})),
- (function (t) {
- (t[(t.COLOR = 16384)] = 'COLOR'),
- (t[(t.DEPTH = 256)] = 'DEPTH'),
- (t[(t.STENCIL = 1024)] = 'STENCIL');
- })(AP || (AP = {})),
- (function (t) {
- (t[(t.NORMAL = 0)] = 'NORMAL'),
- (t[(t.ADD = 1)] = 'ADD'),
- (t[(t.MULTIPLY = 2)] = 'MULTIPLY'),
- (t[(t.SCREEN = 3)] = 'SCREEN'),
- (t[(t.OVERLAY = 4)] = 'OVERLAY'),
- (t[(t.DARKEN = 5)] = 'DARKEN'),
- (t[(t.LIGHTEN = 6)] = 'LIGHTEN'),
- (t[(t.COLOR_DODGE = 7)] = 'COLOR_DODGE'),
- (t[(t.COLOR_BURN = 8)] = 'COLOR_BURN'),
- (t[(t.HARD_LIGHT = 9)] = 'HARD_LIGHT'),
- (t[(t.SOFT_LIGHT = 10)] = 'SOFT_LIGHT'),
- (t[(t.DIFFERENCE = 11)] = 'DIFFERENCE'),
- (t[(t.EXCLUSION = 12)] = 'EXCLUSION'),
- (t[(t.HUE = 13)] = 'HUE'),
- (t[(t.SATURATION = 14)] = 'SATURATION'),
- (t[(t.COLOR = 15)] = 'COLOR'),
- (t[(t.LUMINOSITY = 16)] = 'LUMINOSITY'),
- (t[(t.NORMAL_NPM = 17)] = 'NORMAL_NPM'),
- (t[(t.ADD_NPM = 18)] = 'ADD_NPM'),
- (t[(t.SCREEN_NPM = 19)] = 'SCREEN_NPM'),
- (t[(t.NONE = 20)] = 'NONE'),
- (t[(t.SRC_OVER = 0)] = 'SRC_OVER'),
- (t[(t.SRC_IN = 21)] = 'SRC_IN'),
- (t[(t.SRC_OUT = 22)] = 'SRC_OUT'),
- (t[(t.SRC_ATOP = 23)] = 'SRC_ATOP'),
- (t[(t.DST_OVER = 24)] = 'DST_OVER'),
- (t[(t.DST_IN = 25)] = 'DST_IN'),
- (t[(t.DST_OUT = 26)] = 'DST_OUT'),
- (t[(t.DST_ATOP = 27)] = 'DST_ATOP'),
- (t[(t.ERASE = 26)] = 'ERASE'),
- (t[(t.SUBTRACT = 28)] = 'SUBTRACT'),
- (t[(t.XOR = 29)] = 'XOR');
- })(OP || (OP = {})),
- (function (t) {
- (t[(t.POINTS = 0)] = 'POINTS'),
- (t[(t.LINES = 1)] = 'LINES'),
- (t[(t.LINE_LOOP = 2)] = 'LINE_LOOP'),
- (t[(t.LINE_STRIP = 3)] = 'LINE_STRIP'),
- (t[(t.TRIANGLES = 4)] = 'TRIANGLES'),
- (t[(t.TRIANGLE_STRIP = 5)] = 'TRIANGLE_STRIP'),
- (t[(t.TRIANGLE_FAN = 6)] = 'TRIANGLE_FAN');
- })(IP || (IP = {})),
- (function (t) {
- (t[(t.RGBA = 6408)] = 'RGBA'),
- (t[(t.RGB = 6407)] = 'RGB'),
- (t[(t.RG = 33319)] = 'RG'),
- (t[(t.RED = 6403)] = 'RED'),
- (t[(t.RGBA_INTEGER = 36249)] = 'RGBA_INTEGER'),
- (t[(t.RGB_INTEGER = 36248)] = 'RGB_INTEGER'),
- (t[(t.RG_INTEGER = 33320)] = 'RG_INTEGER'),
- (t[(t.RED_INTEGER = 36244)] = 'RED_INTEGER'),
- (t[(t.ALPHA = 6406)] = 'ALPHA'),
- (t[(t.LUMINANCE = 6409)] = 'LUMINANCE'),
- (t[(t.LUMINANCE_ALPHA = 6410)] = 'LUMINANCE_ALPHA'),
- (t[(t.DEPTH_COMPONENT = 6402)] = 'DEPTH_COMPONENT'),
- (t[(t.DEPTH_STENCIL = 34041)] = 'DEPTH_STENCIL');
- })(MP || (MP = {})),
- (function (t) {
- (t[(t.TEXTURE_2D = 3553)] = 'TEXTURE_2D'),
- (t[(t.TEXTURE_CUBE_MAP = 34067)] = 'TEXTURE_CUBE_MAP'),
- (t[(t.TEXTURE_2D_ARRAY = 35866)] = 'TEXTURE_2D_ARRAY'),
- (t[(t.TEXTURE_CUBE_MAP_POSITIVE_X = 34069)] =
- 'TEXTURE_CUBE_MAP_POSITIVE_X'),
- (t[(t.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070)] =
- 'TEXTURE_CUBE_MAP_NEGATIVE_X'),
- (t[(t.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071)] =
- 'TEXTURE_CUBE_MAP_POSITIVE_Y'),
- (t[(t.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072)] =
- 'TEXTURE_CUBE_MAP_NEGATIVE_Y'),
- (t[(t.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073)] =
- 'TEXTURE_CUBE_MAP_POSITIVE_Z'),
- (t[(t.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074)] =
- 'TEXTURE_CUBE_MAP_NEGATIVE_Z');
- })(DP || (DP = {})),
- (function (t) {
- (t[(t.UNSIGNED_BYTE = 5121)] = 'UNSIGNED_BYTE'),
- (t[(t.UNSIGNED_SHORT = 5123)] = 'UNSIGNED_SHORT'),
- (t[(t.UNSIGNED_SHORT_5_6_5 = 33635)] = 'UNSIGNED_SHORT_5_6_5'),
- (t[(t.UNSIGNED_SHORT_4_4_4_4 = 32819)] = 'UNSIGNED_SHORT_4_4_4_4'),
- (t[(t.UNSIGNED_SHORT_5_5_5_1 = 32820)] = 'UNSIGNED_SHORT_5_5_5_1'),
- (t[(t.UNSIGNED_INT = 5125)] = 'UNSIGNED_INT'),
- (t[(t.UNSIGNED_INT_10F_11F_11F_REV = 35899)] =
- 'UNSIGNED_INT_10F_11F_11F_REV'),
- (t[(t.UNSIGNED_INT_2_10_10_10_REV = 33640)] =
- 'UNSIGNED_INT_2_10_10_10_REV'),
- (t[(t.UNSIGNED_INT_24_8 = 34042)] = 'UNSIGNED_INT_24_8'),
- (t[(t.UNSIGNED_INT_5_9_9_9_REV = 35902)] = 'UNSIGNED_INT_5_9_9_9_REV'),
- (t[(t.BYTE = 5120)] = 'BYTE'),
- (t[(t.SHORT = 5122)] = 'SHORT'),
- (t[(t.INT = 5124)] = 'INT'),
- (t[(t.FLOAT = 5126)] = 'FLOAT'),
- (t[(t.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269)] =
- 'FLOAT_32_UNSIGNED_INT_24_8_REV'),
- (t[(t.HALF_FLOAT = 36193)] = 'HALF_FLOAT');
- })(LP || (LP = {})),
- (function (t) {
- (t[(t.FLOAT = 0)] = 'FLOAT'),
- (t[(t.INT = 1)] = 'INT'),
- (t[(t.UINT = 2)] = 'UINT');
- })(FP || (FP = {})),
- (function (t) {
- (t[(t.NEAREST = 0)] = 'NEAREST'), (t[(t.LINEAR = 1)] = 'LINEAR');
- })(NP || (NP = {})),
- (function (t) {
- (t[(t.CLAMP = 33071)] = 'CLAMP'),
- (t[(t.REPEAT = 10497)] = 'REPEAT'),
- (t[(t.MIRRORED_REPEAT = 33648)] = 'MIRRORED_REPEAT');
- })(kP || (kP = {})),
- (function (t) {
- (t[(t.OFF = 0)] = 'OFF'),
- (t[(t.POW2 = 1)] = 'POW2'),
- (t[(t.ON = 2)] = 'ON'),
- (t[(t.ON_MANUAL = 3)] = 'ON_MANUAL');
- })(BP || (BP = {})),
- (function (t) {
- (t[(t.NPM = 0)] = 'NPM'),
- (t[(t.UNPACK = 1)] = 'UNPACK'),
- (t[(t.PMA = 2)] = 'PMA'),
- (t[(t.NO_PREMULTIPLIED_ALPHA = 0)] = 'NO_PREMULTIPLIED_ALPHA'),
- (t[(t.PREMULTIPLY_ON_UPLOAD = 1)] = 'PREMULTIPLY_ON_UPLOAD'),
- (t[(t.PREMULTIPLY_ALPHA = 2)] = 'PREMULTIPLY_ALPHA'),
- (t[(t.PREMULTIPLIED_ALPHA = 2)] = 'PREMULTIPLIED_ALPHA');
- })(GP || (GP = {})),
- (function (t) {
- (t[(t.NO = 0)] = 'NO'),
- (t[(t.YES = 1)] = 'YES'),
- (t[(t.AUTO = 2)] = 'AUTO'),
- (t[(t.BLEND = 0)] = 'BLEND'),
- (t[(t.CLEAR = 1)] = 'CLEAR'),
- (t[(t.BLIT = 2)] = 'BLIT');
- })(UP || (UP = {})),
- (function (t) {
- (t[(t.AUTO = 0)] = 'AUTO'), (t[(t.MANUAL = 1)] = 'MANUAL');
- })(jP || (jP = {})),
- (function (t) {
- (t.LOW = 'lowp'), (t.MEDIUM = 'mediump'), (t.HIGH = 'highp');
- })(XP || (XP = {})),
- (function (t) {
- (t[(t.NONE = 0)] = 'NONE'),
- (t[(t.SCISSOR = 1)] = 'SCISSOR'),
- (t[(t.STENCIL = 2)] = 'STENCIL'),
- (t[(t.SPRITE = 3)] = 'SPRITE'),
- (t[(t.COLOR = 4)] = 'COLOR');
- })(VP || (VP = {})),
- (function (t) {
- (t[(t.RED = 1)] = 'RED'),
- (t[(t.GREEN = 2)] = 'GREEN'),
- (t[(t.BLUE = 4)] = 'BLUE'),
- (t[(t.ALPHA = 8)] = 'ALPHA');
- })(HP || (HP = {})),
- (function (t) {
- (t[(t.NONE = 0)] = 'NONE'),
- (t[(t.LOW = 2)] = 'LOW'),
- (t[(t.MEDIUM = 4)] = 'MEDIUM'),
- (t[(t.HIGH = 8)] = 'HIGH');
- })(WP || (WP = {})),
- (function (t) {
- (t[(t.ELEMENT_ARRAY_BUFFER = 34963)] = 'ELEMENT_ARRAY_BUFFER'),
- (t[(t.ARRAY_BUFFER = 34962)] = 'ARRAY_BUFFER'),
- (t[(t.UNIFORM_BUFFER = 35345)] = 'UNIFORM_BUFFER');
- })(YP || (YP = {}));
- var qP = {
- createCanvas: function (t, e) {
- var r = document.createElement('canvas');
- return (r.width = t), (r.height = e), r;
- },
- getWebGLRenderingContext: function () {
- return WebGLRenderingContext;
- },
- getNavigator: function () {
- return navigator;
- },
- getBaseUrl: function () {
- var t;
- return null !== (t = document.baseURI) && void 0 !== t
- ? t
- : window.location.href;
- },
- fetch: function (t, e) {
- return fetch(t, e);
- },
- },
- QP = /iPhone/i,
- $P = /iPod/i,
- tA = /iPad/i,
- eA = /\biOS-universal(?:.+)Mac\b/i,
- rA = /\bAndroid(?:.+)Mobile\b/i,
- nA = /Android/i,
- iA = /(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,
- oA = /Silk/i,
- sA = /Windows Phone/i,
- aA = /\bWindows(?:.+)ARM\b/i,
- uA = /BlackBerry/i,
- cA = /BB10/i,
- hA = /Opera Mini/i,
- lA = /\b(CriOS|Chrome)(?:.+)Mobile/i,
- dA = /Mobile(?:.+)Firefox\b/i,
- fA = function (t) {
- return (
- void 0 !== t &&
- 'MacIntel' === t.platform &&
- 'number' == typeof t.maxTouchPoints &&
- t.maxTouchPoints > 1 &&
- 'undefined' == typeof MSStream
- );
- };
- var pA = (function (t) {
- var e = { userAgent: '', platform: '', maxTouchPoints: 0 };
- t || 'undefined' == typeof navigator
- ? 'string' == typeof t
- ? (e.userAgent = t)
- : t &&
- t.userAgent &&
- (e = {
- userAgent: t.userAgent,
- platform: t.platform,
- maxTouchPoints: t.maxTouchPoints || 0,
- })
- : (e = {
- userAgent: navigator.userAgent,
- platform: navigator.platform,
- maxTouchPoints: navigator.maxTouchPoints || 0,
- });
- var r = e.userAgent,
- n = r.split('[FBAN');
- void 0 !== n[1] && (r = n[0]),
- void 0 !== (n = r.split('Twitter'))[1] && (r = n[0]);
- var i = (function (t) {
- return function (e) {
- return e.test(t);
- };
- })(r),
- o = {
- apple: {
- phone: i(QP) && !i(sA),
- ipod: i($P),
- tablet: !i(QP) && (i(tA) || fA(e)) && !i(sA),
- universal: i(eA),
- device: (i(QP) || i($P) || i(tA) || i(eA) || fA(e)) && !i(sA),
- },
- amazon: {
- phone: i(iA),
- tablet: !i(iA) && i(oA),
- device: i(iA) || i(oA),
- },
- android: {
- phone: (!i(sA) && i(iA)) || (!i(sA) && i(rA)),
- tablet: !i(sA) && !i(iA) && !i(rA) && (i(oA) || i(nA)),
- device:
- (!i(sA) && (i(iA) || i(oA) || i(rA) || i(nA))) || i(/\bokhttp\b/i),
- },
- windows: { phone: i(sA), tablet: i(aA), device: i(sA) || i(aA) },
- other: {
- blackberry: i(uA),
- blackberry10: i(cA),
- opera: i(hA),
- firefox: i(dA),
- chrome: i(lA),
- device: i(uA) || i(cA) || i(hA) || i(dA) || i(lA),
- },
- any: !1,
- phone: !1,
- tablet: !1,
- };
- return (
- (o.any =
- o.apple.device ||
- o.android.device ||
- o.windows.device ||
- o.other.device),
- (o.phone = o.apple.phone || o.android.phone || o.windows.phone),
- (o.tablet = o.apple.tablet || o.android.tablet || o.windows.tablet),
- o
- );
- })(globalThis.navigator);
- var vA = {
- ADAPTER: qP,
- MIPMAP_TEXTURES: BP.POW2,
- ANISOTROPIC_LEVEL: 0,
- RESOLUTION: 1,
- FILTER_RESOLUTION: 1,
- FILTER_MULTISAMPLE: WP.NONE,
- SPRITE_MAX_TEXTURES: (function (t) {
- var e = !0;
- if (pA.tablet || pA.phone) {
- var r;
- if (pA.apple.device)
- if ((r = navigator.userAgent.match(/OS (\d+)_(\d+)?/)))
- parseInt(r[1], 10) < 11 && (e = !1);
- if (pA.android.device)
- if ((r = navigator.userAgent.match(/Android\s([0-9.]*)/)))
- parseInt(r[1], 10) < 7 && (e = !1);
- }
- return e ? t : 4;
- })(32),
- SPRITE_BATCH_SIZE: 4096,
- RENDER_OPTIONS: {
- view: null,
- width: 800,
- height: 600,
- autoDensity: !1,
- backgroundColor: 0,
- backgroundAlpha: 1,
- useContextAlpha: !0,
- clearBeforeRender: !0,
- antialias: !1,
- preserveDrawingBuffer: !1,
- },
- GC_MODE: jP.AUTO,
- GC_MAX_IDLE: 3600,
- GC_MAX_CHECK_COUNT: 600,
- WRAP_MODE: kP.CLAMP,
- SCALE_MODE: NP.LINEAR,
- PRECISION_VERTEX: XP.HIGH,
- PRECISION_FRAGMENT: pA.apple.device ? XP.HIGH : XP.MEDIUM,
- CAN_UPLOAD_SAME_BUFFER: !pA.apple.device,
- CREATE_IMAGE_BITMAP: !1,
- ROUND_PIXELS: !1,
- },
- mA = { exports: {} };
- !(function (t) {
- var e = Object.prototype.hasOwnProperty,
- r = '~';
- function n() {}
- function i(t, e, r) {
- (this.fn = t), (this.context = e), (this.once = r || !1);
- }
- function o(t, e, n, o, s) {
- if ('function' != typeof n)
- throw new TypeError('The listener must be a function');
- var a = new i(n, o || t, s),
- u = r ? r + e : e;
- return (
- t._events[u]
- ? t._events[u].fn
- ? (t._events[u] = [t._events[u], a])
- : t._events[u].push(a)
- : ((t._events[u] = a), t._eventsCount++),
- t
- );
- }
- function s(t, e) {
- 0 == --t._eventsCount ? (t._events = new n()) : delete t._events[e];
- }
- function a() {
- (this._events = new n()), (this._eventsCount = 0);
- }
- Object.create &&
- ((n.prototype = Object.create(null)), new n().__proto__ || (r = !1)),
- (a.prototype.eventNames = function () {
- var t,
- n,
- i = [];
- if (0 === this._eventsCount) return i;
- for (n in (t = this._events))
- e.call(t, n) && i.push(r ? n.slice(1) : n);
- return Object.getOwnPropertySymbols
- ? i.concat(Object.getOwnPropertySymbols(t))
- : i;
- }),
- (a.prototype.listeners = function (t) {
- var e = r ? r + t : t,
- n = this._events[e];
- if (!n) return [];
- if (n.fn) return [n.fn];
- for (var i = 0, o = n.length, s = new Array(o); i < o; i++)
- s[i] = n[i].fn;
- return s;
- }),
- (a.prototype.listenerCount = function (t) {
- var e = r ? r + t : t,
- n = this._events[e];
- return n ? (n.fn ? 1 : n.length) : 0;
- }),
- (a.prototype.emit = function (t, e, n, i, o, s) {
- var a = r ? r + t : t;
- if (!this._events[a]) return !1;
- var u,
- c,
- h = this._events[a],
- l = arguments.length;
- if (h.fn) {
- switch ((h.once && this.removeListener(t, h.fn, void 0, !0), l)) {
- case 1:
- return h.fn.call(h.context), !0;
- case 2:
- return h.fn.call(h.context, e), !0;
- case 3:
- return h.fn.call(h.context, e, n), !0;
- case 4:
- return h.fn.call(h.context, e, n, i), !0;
- case 5:
- return h.fn.call(h.context, e, n, i, o), !0;
- case 6:
- return h.fn.call(h.context, e, n, i, o, s), !0;
- }
- for (c = 1, u = new Array(l - 1); c < l; c++) u[c - 1] = arguments[c];
- h.fn.apply(h.context, u);
- } else {
- var d,
- f = h.length;
- for (c = 0; c < f; c++)
- switch (
- (h[c].once && this.removeListener(t, h[c].fn, void 0, !0), l)
- ) {
- case 1:
- h[c].fn.call(h[c].context);
- break;
- case 2:
- h[c].fn.call(h[c].context, e);
- break;
- case 3:
- h[c].fn.call(h[c].context, e, n);
- break;
- case 4:
- h[c].fn.call(h[c].context, e, n, i);
- break;
- default:
- if (!u)
- for (d = 1, u = new Array(l - 1); d < l; d++)
- u[d - 1] = arguments[d];
- h[c].fn.apply(h[c].context, u);
- }
- }
- return !0;
- }),
- (a.prototype.on = function (t, e, r) {
- return o(this, t, e, r, !1);
- }),
- (a.prototype.once = function (t, e, r) {
- return o(this, t, e, r, !0);
- }),
- (a.prototype.removeListener = function (t, e, n, i) {
- var o = r ? r + t : t;
- if (!this._events[o]) return this;
- if (!e) return s(this, o), this;
- var a = this._events[o];
- if (a.fn)
- a.fn !== e || (i && !a.once) || (n && a.context !== n) || s(this, o);
- else {
- for (var u = 0, c = [], h = a.length; u < h; u++)
- (a[u].fn !== e || (i && !a[u].once) || (n && a[u].context !== n)) &&
- c.push(a[u]);
- c.length ? (this._events[o] = 1 === c.length ? c[0] : c) : s(this, o);
- }
- return this;
- }),
- (a.prototype.removeAllListeners = function (t) {
- var e;
- return (
- t
- ? ((e = r ? r + t : t), this._events[e] && s(this, e))
- : ((this._events = new n()), (this._eventsCount = 0)),
- this
- );
- }),
- (a.prototype.off = a.prototype.removeListener),
- (a.prototype.addListener = a.prototype.on),
- (a.prefixed = r),
- (a.EventEmitter = a),
- (t.exports = a);
- })(mA);
- var yA = mA.exports,
- gA = { exports: {} };
- function _A(t, e, r) {
- r = r || 2;
- var n,
- i,
- o,
- s,
- a,
- u,
- c,
- h = e && e.length,
- l = h ? e[0] * r : t.length,
- d = bA(t, 0, l, r, !0),
- f = [];
- if (!d || d.next === d.prev) return f;
- if (
- (h &&
- (d = (function (t, e, r, n) {
- var i,
- o,
- s,
- a = [];
- for (i = 0, o = e.length; i < o; i++)
- (s = bA(
- t,
- e[i] * n,
- i < o - 1 ? e[i + 1] * n : t.length,
- n,
- !1
- )) === s.next && (s.steiner = !0),
- a.push(IA(s));
- for (a.sort(CA), i = 0; i < a.length; i++) r = PA(a[i], r);
- return r;
- })(t, e, d, r)),
- t.length > 80 * r)
- ) {
- (n = o = t[0]), (i = s = t[1]);
- for (var p = r; p < l; p += r)
- (a = t[p]) < n && (n = a),
- (u = t[p + 1]) < i && (i = u),
- a > o && (o = a),
- u > s && (s = u);
- c = 0 !== (c = Math.max(o - n, s - i)) ? 32767 / c : 0;
- }
- return xA(d, f, r, n, i, c, 0), f;
- }
- function bA(t, e, r, n, i) {
- var o, s;
- if (i === HA(t, e, r, n) > 0)
- for (o = e; o < r; o += n) s = jA(o, t[o], t[o + 1], s);
- else for (o = r - n; o >= e; o -= n) s = jA(o, t[o], t[o + 1], s);
- return s && FA(s, s.next) && (XA(s), (s = s.next)), s;
- }
- function TA(t, e) {
- if (!t) return t;
- e || (e = t);
- var r,
- n = t;
- do {
- if (
- ((r = !1), n.steiner || (!FA(n, n.next) && 0 !== LA(n.prev, n, n.next)))
- )
- n = n.next;
- else {
- if ((XA(n), (n = e = n.prev) === n.next)) break;
- r = !0;
- }
- } while (r || n !== e);
- return e;
- }
- function xA(t, e, r, n, i, o, s) {
- if (t) {
- !s &&
- o &&
- (function (t, e, r, n) {
- var i = t;
- do {
- 0 === i.z && (i.z = OA(i.x, i.y, e, r, n)),
- (i.prevZ = i.prev),
- (i.nextZ = i.next),
- (i = i.next);
- } while (i !== t);
- (i.prevZ.nextZ = null),
- (i.prevZ = null),
- (function (t) {
- var e,
- r,
- n,
- i,
- o,
- s,
- a,
- u,
- c = 1;
- do {
- for (r = t, t = null, o = null, s = 0; r; ) {
- for (
- s++, n = r, a = 0, e = 0;
- e < c && (a++, (n = n.nextZ));
- e++
- );
- for (u = c; a > 0 || (u > 0 && n); )
- 0 !== a && (0 === u || !n || r.z <= n.z)
- ? ((i = r), (r = r.nextZ), a--)
- : ((i = n), (n = n.nextZ), u--),
- o ? (o.nextZ = i) : (t = i),
- (i.prevZ = o),
- (o = i);
- r = n;
- }
- (o.nextZ = null), (c *= 2);
- } while (s > 1);
- })(i);
- })(t, n, i, o);
- for (var a, u, c = t; t.prev !== t.next; )
- if (((a = t.prev), (u = t.next), o ? SA(t, n, i, o) : EA(t)))
- e.push((a.i / r) | 0),
- e.push((t.i / r) | 0),
- e.push((u.i / r) | 0),
- XA(t),
- (t = u.next),
- (c = u.next);
- else if ((t = u) === c) {
- s
- ? 1 === s
- ? xA((t = wA(TA(t), e, r)), e, r, n, i, o, 2)
- : 2 === s && RA(t, e, r, n, i, o)
- : xA(TA(t), e, r, n, i, o, 1);
- break;
- }
- }
- }
- function EA(t) {
- var e = t.prev,
- r = t,
- n = t.next;
- if (LA(e, r, n) >= 0) return !1;
- for (
- var i = e.x,
- o = r.x,
- s = n.x,
- a = e.y,
- u = r.y,
- c = n.y,
- h = i < o ? (i < s ? i : s) : o < s ? o : s,
- l = a < u ? (a < c ? a : c) : u < c ? u : c,
- d = i > o ? (i > s ? i : s) : o > s ? o : s,
- f = a > u ? (a > c ? a : c) : u > c ? u : c,
- p = n.next;
- p !== e;
- ) {
- if (
- p.x >= h &&
- p.x <= d &&
- p.y >= l &&
- p.y <= f &&
- MA(i, a, o, u, s, c, p.x, p.y) &&
- LA(p.prev, p, p.next) >= 0
- )
- return !1;
- p = p.next;
- }
- return !0;
- }
- function SA(t, e, r, n) {
- var i = t.prev,
- o = t,
- s = t.next;
- if (LA(i, o, s) >= 0) return !1;
- for (
- var a = i.x,
- u = o.x,
- c = s.x,
- h = i.y,
- l = o.y,
- d = s.y,
- f = a < u ? (a < c ? a : c) : u < c ? u : c,
- p = h < l ? (h < d ? h : d) : l < d ? l : d,
- v = a > u ? (a > c ? a : c) : u > c ? u : c,
- m = h > l ? (h > d ? h : d) : l > d ? l : d,
- y = OA(f, p, e, r, n),
- g = OA(v, m, e, r, n),
- _ = t.prevZ,
- b = t.nextZ;
- _ && _.z >= y && b && b.z <= g;
- ) {
- if (
- _.x >= f &&
- _.x <= v &&
- _.y >= p &&
- _.y <= m &&
- _ !== i &&
- _ !== s &&
- MA(a, h, u, l, c, d, _.x, _.y) &&
- LA(_.prev, _, _.next) >= 0
- )
- return !1;
- if (
- ((_ = _.prevZ),
- b.x >= f &&
- b.x <= v &&
- b.y >= p &&
- b.y <= m &&
- b !== i &&
- b !== s &&
- MA(a, h, u, l, c, d, b.x, b.y) &&
- LA(b.prev, b, b.next) >= 0)
- )
- return !1;
- b = b.nextZ;
- }
- for (; _ && _.z >= y; ) {
- if (
- _.x >= f &&
- _.x <= v &&
- _.y >= p &&
- _.y <= m &&
- _ !== i &&
- _ !== s &&
- MA(a, h, u, l, c, d, _.x, _.y) &&
- LA(_.prev, _, _.next) >= 0
- )
- return !1;
- _ = _.prevZ;
- }
- for (; b && b.z <= g; ) {
- if (
- b.x >= f &&
- b.x <= v &&
- b.y >= p &&
- b.y <= m &&
- b !== i &&
- b !== s &&
- MA(a, h, u, l, c, d, b.x, b.y) &&
- LA(b.prev, b, b.next) >= 0
- )
- return !1;
- b = b.nextZ;
- }
- return !0;
- }
- function wA(t, e, r) {
- var n = t;
- do {
- var i = n.prev,
- o = n.next.next;
- !FA(i, o) &&
- NA(i, n, n.next, o) &&
- GA(i, o) &&
- GA(o, i) &&
- (e.push((i.i / r) | 0),
- e.push((n.i / r) | 0),
- e.push((o.i / r) | 0),
- XA(n),
- XA(n.next),
- (n = t = o)),
- (n = n.next);
- } while (n !== t);
- return TA(n);
- }
- function RA(t, e, r, n, i, o) {
- var s = t;
- do {
- for (var a = s.next.next; a !== s.prev; ) {
- if (s.i !== a.i && DA(s, a)) {
- var u = UA(s, a);
- return (
- (s = TA(s, s.next)),
- (u = TA(u, u.next)),
- xA(s, e, r, n, i, o, 0),
- void xA(u, e, r, n, i, o, 0)
- );
- }
- a = a.next;
- }
- s = s.next;
- } while (s !== t);
- }
- function CA(t, e) {
- return t.x - e.x;
- }
- function PA(t, e) {
- var r = (function (t, e) {
- var r,
- n = e,
- i = t.x,
- o = t.y,
- s = -1 / 0;
- do {
- if (o <= n.y && o >= n.next.y && n.next.y !== n.y) {
- var a = n.x + ((o - n.y) * (n.next.x - n.x)) / (n.next.y - n.y);
- if (
- a <= i &&
- a > s &&
- ((s = a), (r = n.x < n.next.x ? n : n.next), a === i)
- )
- return r;
- }
- n = n.next;
- } while (n !== e);
- if (!r) return null;
- var u,
- c = r,
- h = r.x,
- l = r.y,
- d = 1 / 0;
- n = r;
- do {
- i >= n.x &&
- n.x >= h &&
- i !== n.x &&
- MA(o < l ? i : s, o, h, l, o < l ? s : i, o, n.x, n.y) &&
- ((u = Math.abs(o - n.y) / (i - n.x)),
- GA(n, t) &&
- (u < d || (u === d && (n.x > r.x || (n.x === r.x && AA(r, n))))) &&
- ((r = n), (d = u))),
- (n = n.next);
- } while (n !== c);
- return r;
- })(t, e);
- if (!r) return e;
- var n = UA(r, t);
- return TA(n, n.next), TA(r, r.next);
- }
- function AA(t, e) {
- return LA(t.prev, t, e.prev) < 0 && LA(e.next, t, t.next) < 0;
- }
- function OA(t, e, r, n, i) {
- return (
- (t =
- 1431655765 &
- ((t =
- 858993459 &
- ((t =
- 252645135 &
- ((t = 16711935 & ((t = ((t - r) * i) | 0) | (t << 8))) |
- (t << 4))) |
- (t << 2))) |
- (t << 1))) |
- ((e =
- 1431655765 &
- ((e =
- 858993459 &
- ((e =
- 252645135 &
- ((e = 16711935 & ((e = ((e - n) * i) | 0) | (e << 8))) |
- (e << 4))) |
- (e << 2))) |
- (e << 1))) <<
- 1)
- );
- }
- function IA(t) {
- var e = t,
- r = t;
- do {
- (e.x < r.x || (e.x === r.x && e.y < r.y)) && (r = e), (e = e.next);
- } while (e !== t);
- return r;
- }
- function MA(t, e, r, n, i, o, s, a) {
- return (
- (i - s) * (e - a) >= (t - s) * (o - a) &&
- (t - s) * (n - a) >= (r - s) * (e - a) &&
- (r - s) * (o - a) >= (i - s) * (n - a)
- );
- }
- function DA(t, e) {
- return (
- t.next.i !== e.i &&
- t.prev.i !== e.i &&
- !(function (t, e) {
- var r = t;
- do {
- if (
- r.i !== t.i &&
- r.next.i !== t.i &&
- r.i !== e.i &&
- r.next.i !== e.i &&
- NA(r, r.next, t, e)
- )
- return !0;
- r = r.next;
- } while (r !== t);
- return !1;
- })(t, e) &&
- ((GA(t, e) &&
- GA(e, t) &&
- (function (t, e) {
- var r = t,
- n = !1,
- i = (t.x + e.x) / 2,
- o = (t.y + e.y) / 2;
- do {
- r.y > o != r.next.y > o &&
- r.next.y !== r.y &&
- i < ((r.next.x - r.x) * (o - r.y)) / (r.next.y - r.y) + r.x &&
- (n = !n),
- (r = r.next);
- } while (r !== t);
- return n;
- })(t, e) &&
- (LA(t.prev, t, e.prev) || LA(t, e.prev, e))) ||
- (FA(t, e) && LA(t.prev, t, t.next) > 0 && LA(e.prev, e, e.next) > 0))
- );
- }
- function LA(t, e, r) {
- return (e.y - t.y) * (r.x - e.x) - (e.x - t.x) * (r.y - e.y);
- }
- function FA(t, e) {
- return t.x === e.x && t.y === e.y;
- }
- function NA(t, e, r, n) {
- var i = BA(LA(t, e, r)),
- o = BA(LA(t, e, n)),
- s = BA(LA(r, n, t)),
- a = BA(LA(r, n, e));
- return (
- (i !== o && s !== a) ||
- !(0 !== i || !kA(t, r, e)) ||
- !(0 !== o || !kA(t, n, e)) ||
- !(0 !== s || !kA(r, t, n)) ||
- !(0 !== a || !kA(r, e, n))
- );
- }
- function kA(t, e, r) {
- return (
- e.x <= Math.max(t.x, r.x) &&
- e.x >= Math.min(t.x, r.x) &&
- e.y <= Math.max(t.y, r.y) &&
- e.y >= Math.min(t.y, r.y)
- );
- }
- function BA(t) {
- return t > 0 ? 1 : t < 0 ? -1 : 0;
- }
- function GA(t, e) {
- return LA(t.prev, t, t.next) < 0
- ? LA(t, e, t.next) >= 0 && LA(t, t.prev, e) >= 0
- : LA(t, e, t.prev) < 0 || LA(t, t.next, e) < 0;
- }
- function UA(t, e) {
- var r = new VA(t.i, t.x, t.y),
- n = new VA(e.i, e.x, e.y),
- i = t.next,
- o = e.prev;
- return (
- (t.next = e),
- (e.prev = t),
- (r.next = i),
- (i.prev = r),
- (n.next = r),
- (r.prev = n),
- (o.next = n),
- (n.prev = o),
- n
- );
- }
- function jA(t, e, r, n) {
- var i = new VA(t, e, r);
- return (
- n
- ? ((i.next = n.next), (i.prev = n), (n.next.prev = i), (n.next = i))
- : ((i.prev = i), (i.next = i)),
- i
- );
- }
- function XA(t) {
- (t.next.prev = t.prev),
- (t.prev.next = t.next),
- t.prevZ && (t.prevZ.nextZ = t.nextZ),
- t.nextZ && (t.nextZ.prevZ = t.prevZ);
- }
- function VA(t, e, r) {
- (this.i = t),
- (this.x = e),
- (this.y = r),
- (this.prev = null),
- (this.next = null),
- (this.z = 0),
- (this.prevZ = null),
- (this.nextZ = null),
- (this.steiner = !1);
- }
- function HA(t, e, r, n) {
- for (var i = 0, o = e, s = r - n; o < r; o += n)
- (i += (t[s] - t[o]) * (t[o + 1] + t[s + 1])), (s = o);
- return i;
- }
- (gA.exports = _A),
- (gA.exports.default = _A),
- (_A.deviation = function (t, e, r, n) {
- var i = e && e.length,
- o = i ? e[0] * r : t.length,
- s = Math.abs(HA(t, 0, o, r));
- if (i)
- for (var a = 0, u = e.length; a < u; a++) {
- var c = e[a] * r,
- h = a < u - 1 ? e[a + 1] * r : t.length;
- s -= Math.abs(HA(t, c, h, r));
- }
- var l = 0;
- for (a = 0; a < n.length; a += 3) {
- var d = n[a] * r,
- f = n[a + 1] * r,
- p = n[a + 2] * r;
- l += Math.abs(
- (t[d] - t[p]) * (t[f + 1] - t[d + 1]) -
- (t[d] - t[f]) * (t[p + 1] - t[d + 1])
- );
- }
- return 0 === s && 0 === l ? 0 : Math.abs((l - s) / s);
- }),
- (_A.flatten = function (t) {
- for (
- var e = t[0][0].length,
- r = { vertices: [], holes: [], dimensions: e },
- n = 0,
- i = 0;
- i < t.length;
- i++
- ) {
- for (var o = 0; o < t[i].length; o++)
- for (var s = 0; s < e; s++) r.vertices.push(t[i][o][s]);
- i > 0 && ((n += t[i - 1].length), r.holes.push(n));
- }
- return r;
- });
- var WA = gA.exports,
- YA = { exports: {} };
- !(function (t, r) {
- !(function (n) {
- var i = r && !r.nodeType && r,
- o = t && !t.nodeType && t,
- s = 'object' == typeof e && e;
- (s.global !== s && s.window !== s && s.self !== s) || (n = s);
- var a,
- u,
- c = 2147483647,
- h = 36,
- l = /^xn--/,
- d = /[^\x20-\x7E]/,
- f = /[\x2E\u3002\uFF0E\uFF61]/g,
- p = {
- overflow: 'Overflow: input needs wider integers to process',
- 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
- 'invalid-input': 'Invalid input',
- },
- v = Math.floor,
- m = String.fromCharCode;
- function y(t) {
- throw new RangeError(p[t]);
- }
- function g(t, e) {
- for (var r = t.length, n = []; r--; ) n[r] = e(t[r]);
- return n;
- }
- function _(t, e) {
- var r = t.split('@'),
- n = '';
- return (
- r.length > 1 && ((n = r[0] + '@'), (t = r[1])),
- n + g((t = t.replace(f, '.')).split('.'), e).join('.')
- );
- }
- function b(t) {
- for (var e, r, n = [], i = 0, o = t.length; i < o; )
- (e = t.charCodeAt(i++)) >= 55296 && e <= 56319 && i < o
- ? 56320 == (64512 & (r = t.charCodeAt(i++)))
- ? n.push(((1023 & e) << 10) + (1023 & r) + 65536)
- : (n.push(e), i--)
- : n.push(e);
- return n;
- }
- function T(t) {
- return g(t, function (t) {
- var e = '';
- return (
- t > 65535 &&
- ((e += m((((t -= 65536) >>> 10) & 1023) | 55296)),
- (t = 56320 | (1023 & t))),
- (e += m(t))
- );
- }).join('');
- }
- function x(t, e) {
- return t + 22 + 75 * (t < 26) - ((0 != e) << 5);
- }
- function E(t, e, r) {
- var n = 0;
- for (t = r ? v(t / 700) : t >> 1, t += v(t / e); t > 455; n += h)
- t = v(t / 35);
- return v(n + (36 * t) / (t + 38));
- }
- function S(t) {
- var e,
- r,
- n,
- i,
- o,
- s,
- a,
- u,
- l,
- d,
- f,
- p = [],
- m = t.length,
- g = 0,
- _ = 128,
- b = 72;
- for ((r = t.lastIndexOf('-')) < 0 && (r = 0), n = 0; n < r; ++n)
- t.charCodeAt(n) >= 128 && y('not-basic'), p.push(t.charCodeAt(n));
- for (i = r > 0 ? r + 1 : 0; i < m; ) {
- for (
- o = g, s = 1, a = h;
- i >= m && y('invalid-input'),
- ((u =
- (f = t.charCodeAt(i++)) - 48 < 10
- ? f - 22
- : f - 65 < 26
- ? f - 65
- : f - 97 < 26
- ? f - 97
- : h) >= h ||
- u > v((c - g) / s)) &&
- y('overflow'),
- (g += u * s),
- !(u < (l = a <= b ? 1 : a >= b + 26 ? 26 : a - b));
- a += h
- )
- s > v(c / (d = h - l)) && y('overflow'), (s *= d);
- (b = E(g - o, (e = p.length + 1), 0 == o)),
- v(g / e) > c - _ && y('overflow'),
- (_ += v(g / e)),
- (g %= e),
- p.splice(g++, 0, _);
- }
- return T(p);
- }
- function w(t) {
- var e,
- r,
- n,
- i,
- o,
- s,
- a,
- u,
- l,
- d,
- f,
- p,
- g,
- _,
- T,
- S = [];
- for (p = (t = b(t)).length, e = 128, r = 0, o = 72, s = 0; s < p; ++s)
- (f = t[s]) < 128 && S.push(m(f));
- for (n = i = S.length, i && S.push('-'); n < p; ) {
- for (a = c, s = 0; s < p; ++s) (f = t[s]) >= e && f < a && (a = f);
- for (
- a - e > v((c - r) / (g = n + 1)) && y('overflow'),
- r += (a - e) * g,
- e = a,
- s = 0;
- s < p;
- ++s
- )
- if (((f = t[s]) < e && ++r > c && y('overflow'), f == e)) {
- for (
- u = r, l = h;
- !(u < (d = l <= o ? 1 : l >= o + 26 ? 26 : l - o));
- l += h
- )
- (T = u - d),
- (_ = h - d),
- S.push(m(x(d + (T % _), 0))),
- (u = v(T / _));
- S.push(m(x(u, 0))), (o = E(r, g, n == i)), (r = 0), ++n;
- }
- ++r, ++e;
- }
- return S.join('');
- }
- if (
- ((a = {
- version: '1.4.1',
- ucs2: { decode: b, encode: T },
- decode: S,
- encode: w,
- toASCII: function (t) {
- return _(t, function (t) {
- return d.test(t) ? 'xn--' + w(t) : t;
- });
- },
- toUnicode: function (t) {
- return _(t, function (t) {
- return l.test(t) ? S(t.slice(4).toLowerCase()) : t;
- });
- },
- }),
- i && o)
- )
- if (t.exports == i) o.exports = a;
- else for (u in a) a.hasOwnProperty(u) && (i[u] = a[u]);
- else n.punycode = a;
- })(e);
- })(YA, YA.exports);
- var zA,
- ZA = 'undefined' != typeof Symbol && Symbol,
- JA = function () {
- if (
- 'function' != typeof Symbol ||
- 'function' != typeof Object.getOwnPropertySymbols
- )
- return !1;
- if ('symbol' == typeof Symbol.iterator) return !0;
- var t = {},
- e = Symbol('test'),
- r = Object(e);
- if ('string' == typeof e) return !1;
- if ('[object Symbol]' !== Object.prototype.toString.call(e)) return !1;
- if ('[object Symbol]' !== Object.prototype.toString.call(r)) return !1;
- for (e in ((t[e] = 42), t)) return !1;
- if ('function' == typeof Object.keys && 0 !== Object.keys(t).length)
- return !1;
- if (
- 'function' == typeof Object.getOwnPropertyNames &&
- 0 !== Object.getOwnPropertyNames(t).length
- )
- return !1;
- var n = Object.getOwnPropertySymbols(t);
- if (1 !== n.length || n[0] !== e) return !1;
- if (!Object.prototype.propertyIsEnumerable.call(t, e)) return !1;
- if ('function' == typeof Object.getOwnPropertyDescriptor) {
- var i = Object.getOwnPropertyDescriptor(t, e);
- if (42 !== i.value || !0 !== i.enumerable) return !1;
- }
- return !0;
- },
- KA = 'Function.prototype.bind called on incompatible ',
- qA = Array.prototype.slice,
- QA = Object.prototype.toString,
- $A = '[object Function]',
- tO = function (t) {
- var e = this;
- if ('function' != typeof e || QA.call(e) !== $A)
- throw new TypeError(KA + e);
- for (
- var r,
- n = qA.call(arguments, 1),
- i = function () {
- if (this instanceof r) {
- var i = e.apply(this, n.concat(qA.call(arguments)));
- return Object(i) === i ? i : this;
- }
- return e.apply(t, n.concat(qA.call(arguments)));
- },
- o = Math.max(0, e.length - n.length),
- s = [],
- a = 0;
- a < o;
- a++
- )
- s.push('$' + a);
- if (
- ((r = Function(
- 'binder',
- 'return function (' +
- s.join(',') +
- '){ return binder.apply(this,arguments); }'
- )(i)),
- e.prototype)
- ) {
- var u = function () {};
- (u.prototype = e.prototype),
- (r.prototype = new u()),
- (u.prototype = null);
- }
- return r;
- },
- eO = Function.prototype.bind || tO,
- rO = eO.call(Function.call, Object.prototype.hasOwnProperty),
- nO = SyntaxError,
- iO = Function,
- oO = TypeError,
- sO = function (t) {
- try {
- return iO('"use strict"; return (' + t + ').constructor;')();
- } catch (t) {}
- },
- aO = Object.getOwnPropertyDescriptor;
- if (aO)
- try {
- aO({}, '');
- } catch (t) {
- aO = null;
- }
- var uO = function () {
- throw new oO();
- },
- cO = aO
- ? (function () {
- try {
- return uO;
- } catch (t) {
- try {
- return aO(arguments, 'callee').get;
- } catch (t) {
- return uO;
- }
- }
- })()
- : uO,
- hO =
- 'function' == typeof ZA &&
- 'function' == typeof Symbol &&
- 'symbol' == typeof ZA('foo') &&
- 'symbol' == typeof Symbol('bar') &&
- JA(),
- lO =
- Object.getPrototypeOf ||
- function (t) {
- return t.__proto__;
- },
- dO = {},
- fO = 'undefined' == typeof Uint8Array ? zA : lO(Uint8Array),
- pO = {
- '%AggregateError%':
- 'undefined' == typeof AggregateError ? zA : AggregateError,
- '%Array%': Array,
- '%ArrayBuffer%': 'undefined' == typeof ArrayBuffer ? zA : ArrayBuffer,
- '%ArrayIteratorPrototype%': hO ? lO([][Symbol.iterator]()) : zA,
- '%AsyncFromSyncIteratorPrototype%': zA,
- '%AsyncFunction%': dO,
- '%AsyncGenerator%': dO,
- '%AsyncGeneratorFunction%': dO,
- '%AsyncIteratorPrototype%': dO,
- '%Atomics%': 'undefined' == typeof Atomics ? zA : Atomics,
- '%BigInt%': 'undefined' == typeof BigInt ? zA : BigInt,
- '%Boolean%': Boolean,
- '%DataView%': 'undefined' == typeof DataView ? zA : DataView,
- '%Date%': Date,
- '%decodeURI%': decodeURI,
- '%decodeURIComponent%': decodeURIComponent,
- '%encodeURI%': encodeURI,
- '%encodeURIComponent%': encodeURIComponent,
- '%Error%': Error,
- '%eval%': eval,
- '%EvalError%': EvalError,
- '%Float32Array%': 'undefined' == typeof Float32Array ? zA : Float32Array,
- '%Float64Array%': 'undefined' == typeof Float64Array ? zA : Float64Array,
- '%FinalizationRegistry%':
- 'undefined' == typeof FinalizationRegistry ? zA : FinalizationRegistry,
- '%Function%': iO,
- '%GeneratorFunction%': dO,
- '%Int8Array%': 'undefined' == typeof Int8Array ? zA : Int8Array,
- '%Int16Array%': 'undefined' == typeof Int16Array ? zA : Int16Array,
- '%Int32Array%': 'undefined' == typeof Int32Array ? zA : Int32Array,
- '%isFinite%': isFinite,
- '%isNaN%': isNaN,
- '%IteratorPrototype%': hO ? lO(lO([][Symbol.iterator]())) : zA,
- '%JSON%': 'object' == typeof JSON ? JSON : zA,
- '%Map%': 'undefined' == typeof Map ? zA : Map,
- '%MapIteratorPrototype%':
- 'undefined' != typeof Map && hO ? lO(new Map()[Symbol.iterator]()) : zA,
- '%Math%': Math,
- '%Number%': Number,
- '%Object%': Object,
- '%parseFloat%': parseFloat,
- '%parseInt%': parseInt,
- '%Promise%': 'undefined' == typeof Promise ? zA : Promise,
- '%Proxy%': 'undefined' == typeof Proxy ? zA : Proxy,
- '%RangeError%': RangeError,
- '%ReferenceError%': ReferenceError,
- '%Reflect%': 'undefined' == typeof Reflect ? zA : Reflect,
- '%RegExp%': RegExp,
- '%Set%': 'undefined' == typeof Set ? zA : Set,
- '%SetIteratorPrototype%':
- 'undefined' != typeof Set && hO ? lO(new Set()[Symbol.iterator]()) : zA,
- '%SharedArrayBuffer%':
- 'undefined' == typeof SharedArrayBuffer ? zA : SharedArrayBuffer,
- '%String%': String,
- '%StringIteratorPrototype%': hO ? lO(''[Symbol.iterator]()) : zA,
- '%Symbol%': hO ? Symbol : zA,
- '%SyntaxError%': nO,
- '%ThrowTypeError%': cO,
- '%TypedArray%': fO,
- '%TypeError%': oO,
- '%Uint8Array%': 'undefined' == typeof Uint8Array ? zA : Uint8Array,
- '%Uint8ClampedArray%':
- 'undefined' == typeof Uint8ClampedArray ? zA : Uint8ClampedArray,
- '%Uint16Array%': 'undefined' == typeof Uint16Array ? zA : Uint16Array,
- '%Uint32Array%': 'undefined' == typeof Uint32Array ? zA : Uint32Array,
- '%URIError%': URIError,
- '%WeakMap%': 'undefined' == typeof WeakMap ? zA : WeakMap,
- '%WeakRef%': 'undefined' == typeof WeakRef ? zA : WeakRef,
- '%WeakSet%': 'undefined' == typeof WeakSet ? zA : WeakSet,
- },
- vO = function t(e) {
- var r;
- if ('%AsyncFunction%' === e) r = sO('async function () {}');
- else if ('%GeneratorFunction%' === e) r = sO('function* () {}');
- else if ('%AsyncGeneratorFunction%' === e)
- r = sO('async function* () {}');
- else if ('%AsyncGenerator%' === e) {
- var n = t('%AsyncGeneratorFunction%');
- n && (r = n.prototype);
- } else if ('%AsyncIteratorPrototype%' === e) {
- var i = t('%AsyncGenerator%');
- i && (r = lO(i.prototype));
- }
- return (pO[e] = r), r;
- },
- mO = {
- '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
- '%ArrayPrototype%': ['Array', 'prototype'],
- '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
- '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
- '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
- '%ArrayProto_values%': ['Array', 'prototype', 'values'],
- '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
- '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
- '%AsyncGeneratorPrototype%': [
- 'AsyncGeneratorFunction',
- 'prototype',
- 'prototype',
- ],
- '%BooleanPrototype%': ['Boolean', 'prototype'],
- '%DataViewPrototype%': ['DataView', 'prototype'],
- '%DatePrototype%': ['Date', 'prototype'],
- '%ErrorPrototype%': ['Error', 'prototype'],
- '%EvalErrorPrototype%': ['EvalError', 'prototype'],
- '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
- '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
- '%FunctionPrototype%': ['Function', 'prototype'],
- '%Generator%': ['GeneratorFunction', 'prototype'],
- '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
- '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
- '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
- '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
- '%JSONParse%': ['JSON', 'parse'],
- '%JSONStringify%': ['JSON', 'stringify'],
- '%MapPrototype%': ['Map', 'prototype'],
- '%NumberPrototype%': ['Number', 'prototype'],
- '%ObjectPrototype%': ['Object', 'prototype'],
- '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
- '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
- '%PromisePrototype%': ['Promise', 'prototype'],
- '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
- '%Promise_all%': ['Promise', 'all'],
- '%Promise_reject%': ['Promise', 'reject'],
- '%Promise_resolve%': ['Promise', 'resolve'],
- '%RangeErrorPrototype%': ['RangeError', 'prototype'],
- '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
- '%RegExpPrototype%': ['RegExp', 'prototype'],
- '%SetPrototype%': ['Set', 'prototype'],
- '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
- '%StringPrototype%': ['String', 'prototype'],
- '%SymbolPrototype%': ['Symbol', 'prototype'],
- '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
- '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
- '%TypeErrorPrototype%': ['TypeError', 'prototype'],
- '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
- '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
- '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
- '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
- '%URIErrorPrototype%': ['URIError', 'prototype'],
- '%WeakMapPrototype%': ['WeakMap', 'prototype'],
- '%WeakSetPrototype%': ['WeakSet', 'prototype'],
- },
- yO = eO,
- gO = rO,
- _O = yO.call(Function.call, Array.prototype.concat),
- bO = yO.call(Function.apply, Array.prototype.splice),
- TO = yO.call(Function.call, String.prototype.replace),
- xO = yO.call(Function.call, String.prototype.slice),
- EO = yO.call(Function.call, RegExp.prototype.exec),
- SO =
- /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,
- wO = /\\(\\)?/g,
- RO = function (t) {
- var e = xO(t, 0, 1),
- r = xO(t, -1);
- if ('%' === e && '%' !== r)
- throw new nO('invalid intrinsic syntax, expected closing `%`');
- if ('%' === r && '%' !== e)
- throw new nO('invalid intrinsic syntax, expected opening `%`');
- var n = [];
- return (
- TO(t, SO, function (t, e, r, i) {
- n[n.length] = r ? TO(i, wO, '$1') : e || t;
- }),
- n
- );
- },
- CO = function (t, e) {
- var r,
- n = t;
- if ((gO(mO, n) && (n = '%' + (r = mO[n])[0] + '%'), gO(pO, n))) {
- var i = pO[n];
- if ((i === dO && (i = vO(n)), void 0 === i && !e))
- throw new oO(
- 'intrinsic ' +
- t +
- ' exists, but is not available. Please file an issue!'
- );
- return { alias: r, name: n, value: i };
- }
- throw new nO('intrinsic ' + t + ' does not exist!');
- },
- PO = function (t, e) {
- if ('string' != typeof t || 0 === t.length)
- throw new oO('intrinsic name must be a non-empty string');
- if (arguments.length > 1 && 'boolean' != typeof e)
- throw new oO('"allowMissing" argument must be a boolean');
- if (null === EO(/^%?[^%]*%?$/, t))
- throw new nO(
- '`%` may not be present anywhere but at the beginning and end of the intrinsic name'
- );
- var r = RO(t),
- n = r.length > 0 ? r[0] : '',
- i = CO('%' + n + '%', e),
- o = i.name,
- s = i.value,
- a = !1,
- u = i.alias;
- u && ((n = u[0]), bO(r, _O([0, 1], u)));
- for (var c = 1, h = !0; c < r.length; c += 1) {
- var l = r[c],
- d = xO(l, 0, 1),
- f = xO(l, -1);
- if (
- ('"' === d ||
- "'" === d ||
- '`' === d ||
- '"' === f ||
- "'" === f ||
- '`' === f) &&
- d !== f
- )
- throw new nO('property names with quotes must have matching quotes');
- if (
- (('constructor' !== l && h) || (a = !0),
- gO(pO, (o = '%' + (n += '.' + l) + '%')))
- )
- s = pO[o];
- else if (null != s) {
- if (!(l in s)) {
- if (!e)
- throw new oO(
- 'base intrinsic for ' +
- t +
- ' exists, but the property is not available.'
- );
- return;
- }
- if (aO && c + 1 >= r.length) {
- var p = aO(s, l);
- s =
- (h = !!p) && 'get' in p && !('originalValue' in p.get)
- ? p.get
- : s[l];
- } else (h = gO(s, l)), (s = s[l]);
- h && !a && (pO[o] = s);
- }
- }
- return s;
- },
- AO = { exports: {} };
- !(function (t) {
- var e = eO,
- r = PO,
- n = r('%Function.prototype.apply%'),
- i = r('%Function.prototype.call%'),
- o = r('%Reflect.apply%', !0) || e.call(i, n),
- s = r('%Object.getOwnPropertyDescriptor%', !0),
- a = r('%Object.defineProperty%', !0),
- u = r('%Math.max%');
- if (a)
- try {
- a({}, 'a', { value: 1 });
- } catch (t) {
- a = null;
- }
- t.exports = function (t) {
- var r = o(e, i, arguments);
- if (s && a) {
- var n = s(r, 'length');
- n.configurable &&
- a(r, 'length', {
- value: 1 + u(0, t.length - (arguments.length - 1)),
- });
- }
- return r;
- };
- var c = function () {
- return o(e, n, arguments);
- };
- a ? a(t.exports, 'apply', { value: c }) : (t.exports.apply = c);
- })(AO);
- var OO = PO,
- IO = AO.exports,
- MO = IO(OO('String.prototype.indexOf')),
- DO = n(Object.freeze({ __proto__: null, default: {} })),
- LO = 'function' == typeof Map && Map.prototype,
- FO =
- Object.getOwnPropertyDescriptor && LO
- ? Object.getOwnPropertyDescriptor(Map.prototype, 'size')
- : null,
- NO = LO && FO && 'function' == typeof FO.get ? FO.get : null,
- kO = LO && Map.prototype.forEach,
- BO = 'function' == typeof Set && Set.prototype,
- GO =
- Object.getOwnPropertyDescriptor && BO
- ? Object.getOwnPropertyDescriptor(Set.prototype, 'size')
- : null,
- UO = BO && GO && 'function' == typeof GO.get ? GO.get : null,
- jO = BO && Set.prototype.forEach,
- XO =
- 'function' == typeof WeakMap && WeakMap.prototype
- ? WeakMap.prototype.has
- : null,
- VO =
- 'function' == typeof WeakSet && WeakSet.prototype
- ? WeakSet.prototype.has
- : null,
- HO =
- 'function' == typeof WeakRef && WeakRef.prototype
- ? WeakRef.prototype.deref
- : null,
- WO = Boolean.prototype.valueOf,
- YO = Object.prototype.toString,
- zO = Function.prototype.toString,
- ZO = String.prototype.match,
- JO = String.prototype.slice,
- KO = String.prototype.replace,
- qO = String.prototype.toUpperCase,
- QO = String.prototype.toLowerCase,
- $O = RegExp.prototype.test,
- tI = Array.prototype.concat,
- eI = Array.prototype.join,
- rI = Array.prototype.slice,
- nI = Math.floor,
- iI = 'function' == typeof BigInt ? BigInt.prototype.valueOf : null,
- oI = Object.getOwnPropertySymbols,
- sI =
- 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator
- ? Symbol.prototype.toString
- : null,
- aI = 'function' == typeof Symbol && 'object' == typeof Symbol.iterator,
- uI =
- 'function' == typeof Symbol &&
- Symbol.toStringTag &&
- (typeof Symbol.toStringTag === aI || 'symbol')
- ? Symbol.toStringTag
- : null,
- cI = Object.prototype.propertyIsEnumerable,
- hI =
- ('function' == typeof Reflect
- ? Reflect.getPrototypeOf
- : Object.getPrototypeOf) ||
- ([].__proto__ === Array.prototype
- ? function (t) {
- return t.__proto__;
- }
- : null);
- function lI(t, e) {
- if (
- t === 1 / 0 ||
- t === -1 / 0 ||
- t != t ||
- (t && t > -1e3 && t < 1e3) ||
- $O.call(/e/, e)
- )
- return e;
- var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
- if ('number' == typeof t) {
- var n = t < 0 ? -nI(-t) : nI(t);
- if (n !== t) {
- var i = String(n),
- o = JO.call(e, i.length + 1);
- return (
- KO.call(i, r, '$&_') +
- '.' +
- KO.call(KO.call(o, /([0-9]{3})/g, '$&_'), /_$/, '')
- );
- }
- }
- return KO.call(e, r, '$&_');
- }
- var dI = DO,
- fI = dI.custom,
- pI = _I(fI) ? fI : null;
- function vI(t, e, r) {
- var n = 'double' === (r.quoteStyle || e) ? '"' : "'";
- return n + t + n;
- }
- function mI(t) {
- return KO.call(String(t), /"/g, '"');
- }
- function yI(t) {
- return !(
- '[object Array]' !== xI(t) ||
- (uI && 'object' == typeof t && uI in t)
- );
- }
- function gI(t) {
- return !(
- '[object RegExp]' !== xI(t) ||
- (uI && 'object' == typeof t && uI in t)
- );
- }
- function _I(t) {
- if (aI) return t && 'object' == typeof t && t instanceof Symbol;
- if ('symbol' == typeof t) return !0;
- if (!t || 'object' != typeof t || !sI) return !1;
- try {
- return sI.call(t), !0;
- } catch (t) {}
- return !1;
- }
- var bI =
- Object.prototype.hasOwnProperty ||
- function (t) {
- return t in this;
- };
- function TI(t, e) {
- return bI.call(t, e);
- }
- function xI(t) {
- return YO.call(t);
- }
- function EI(t, e) {
- if (t.indexOf) return t.indexOf(e);
- for (var r = 0, n = t.length; r < n; r++) if (t[r] === e) return r;
- return -1;
- }
- function SI(t, e) {
- if (t.length > e.maxStringLength) {
- var r = t.length - e.maxStringLength,
- n = '... ' + r + ' more character' + (r > 1 ? 's' : '');
- return SI(JO.call(t, 0, e.maxStringLength), e) + n;
- }
- return vI(
- KO.call(KO.call(t, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, wI),
- 'single',
- e
- );
- }
- function wI(t) {
- var e = t.charCodeAt(0),
- r = { 8: 'b', 9: 't', 10: 'n', 12: 'f', 13: 'r' }[e];
- return r ? '\\' + r : '\\x' + (e < 16 ? '0' : '') + qO.call(e.toString(16));
- }
- function RI(t) {
- return 'Object(' + t + ')';
- }
- function CI(t) {
- return t + ' { ? }';
- }
- function PI(t, e, r, n) {
- return t + ' (' + e + ') {' + (n ? AI(r, n) : eI.call(r, ', ')) + '}';
- }
- function AI(t, e) {
- if (0 === t.length) return '';
- var r = '\n' + e.prev + e.base;
- return r + eI.call(t, ',' + r) + '\n' + e.prev;
- }
- function OI(t, e) {
- var r = yI(t),
- n = [];
- if (r) {
- n.length = t.length;
- for (var i = 0; i < t.length; i++) n[i] = TI(t, i) ? e(t[i], t) : '';
- }
- var o,
- s = 'function' == typeof oI ? oI(t) : [];
- if (aI) {
- o = {};
- for (var a = 0; a < s.length; a++) o['$' + s[a]] = s[a];
- }
- for (var u in t)
- TI(t, u) &&
- ((r && String(Number(u)) === u && u < t.length) ||
- (aI && o['$' + u] instanceof Symbol) ||
- ($O.call(/[^\w$]/, u)
- ? n.push(e(u, t) + ': ' + e(t[u], t))
- : n.push(u + ': ' + e(t[u], t))));
- if ('function' == typeof oI)
- for (var c = 0; c < s.length; c++)
- cI.call(t, s[c]) && n.push('[' + e(s[c]) + ']: ' + e(t[s[c]], t));
- return n;
- }
- var II = PO,
- MI = function (t, e) {
- var r = OO(t, !!e);
- return 'function' == typeof r && MO(t, '.prototype.') > -1 ? IO(r) : r;
- },
- DI = function t(e, r, n, i) {
- var o = r || {};
- if (
- TI(o, 'quoteStyle') &&
- 'single' !== o.quoteStyle &&
- 'double' !== o.quoteStyle
- )
- throw new TypeError('option "quoteStyle" must be "single" or "double"');
- if (
- TI(o, 'maxStringLength') &&
- ('number' == typeof o.maxStringLength
- ? o.maxStringLength < 0 && o.maxStringLength !== 1 / 0
- : null !== o.maxStringLength)
- )
- throw new TypeError(
- 'option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'
- );
- var s = !TI(o, 'customInspect') || o.customInspect;
- if ('boolean' != typeof s && 'symbol' !== s)
- throw new TypeError(
- 'option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`'
- );
- if (
- TI(o, 'indent') &&
- null !== o.indent &&
- '\t' !== o.indent &&
- !(parseInt(o.indent, 10) === o.indent && o.indent > 0)
- )
- throw new TypeError(
- 'option "indent" must be "\\t", an integer > 0, or `null`'
- );
- if (TI(o, 'numericSeparator') && 'boolean' != typeof o.numericSeparator)
- throw new TypeError(
- 'option "numericSeparator", if provided, must be `true` or `false`'
- );
- var a = o.numericSeparator;
- if (void 0 === e) return 'undefined';
- if (null === e) return 'null';
- if ('boolean' == typeof e) return e ? 'true' : 'false';
- if ('string' == typeof e) return SI(e, o);
- if ('number' == typeof e) {
- if (0 === e) return 1 / 0 / e > 0 ? '0' : '-0';
- var u = String(e);
- return a ? lI(e, u) : u;
- }
- if ('bigint' == typeof e) {
- var c = String(e) + 'n';
- return a ? lI(e, c) : c;
- }
- var h = void 0 === o.depth ? 5 : o.depth;
- if ((void 0 === n && (n = 0), n >= h && h > 0 && 'object' == typeof e))
- return yI(e) ? '[Array]' : '[Object]';
- var l = (function (t, e) {
- var r;
- if ('\t' === t.indent) r = '\t';
- else {
- if (!('number' == typeof t.indent && t.indent > 0)) return null;
- r = eI.call(Array(t.indent + 1), ' ');
- }
- return { base: r, prev: eI.call(Array(e + 1), r) };
- })(o, n);
- if (void 0 === i) i = [];
- else if (EI(i, e) >= 0) return '[Circular]';
- function d(e, r, s) {
- if ((r && (i = rI.call(i)).push(r), s)) {
- var a = { depth: o.depth };
- return (
- TI(o, 'quoteStyle') && (a.quoteStyle = o.quoteStyle),
- t(e, a, n + 1, i)
- );
- }
- return t(e, o, n + 1, i);
- }
- if ('function' == typeof e && !gI(e)) {
- var f = (function (t) {
- if (t.name) return t.name;
- var e = ZO.call(zO.call(t), /^function\s*([\w$]+)/);
- if (e) return e[1];
- return null;
- })(e),
- p = OI(e, d);
- return (
- '[Function' +
- (f ? ': ' + f : ' (anonymous)') +
- ']' +
- (p.length > 0 ? ' { ' + eI.call(p, ', ') + ' }' : '')
- );
- }
- if (_I(e)) {
- var v = aI
- ? KO.call(String(e), /^(Symbol\(.*\))_[^)]*$/, '$1')
- : sI.call(e);
- return 'object' != typeof e || aI ? v : RI(v);
- }
- if (
- (function (t) {
- if (!t || 'object' != typeof t) return !1;
- if ('undefined' != typeof HTMLElement && t instanceof HTMLElement)
- return !0;
- return (
- 'string' == typeof t.nodeName && 'function' == typeof t.getAttribute
- );
- })(e)
- ) {
- for (
- var m = '<' + QO.call(String(e.nodeName)),
- y = e.attributes || [],
- g = 0;
- g < y.length;
- g++
- )
- m += ' ' + y[g].name + '=' + vI(mI(y[g].value), 'double', o);
- return (
- (m += '>'),
- e.childNodes && e.childNodes.length && (m += '...'),
- (m += '</' + QO.call(String(e.nodeName)) + '>')
- );
- }
- if (yI(e)) {
- if (0 === e.length) return '[]';
- var _ = OI(e, d);
- return l &&
- !(function (t) {
- for (var e = 0; e < t.length; e++)
- if (EI(t[e], '\n') >= 0) return !1;
- return !0;
- })(_)
- ? '[' + AI(_, l) + ']'
- : '[ ' + eI.call(_, ', ') + ' ]';
- }
- if (
- (function (t) {
- return !(
- '[object Error]' !== xI(t) ||
- (uI && 'object' == typeof t && uI in t)
- );
- })(e)
- ) {
- var b = OI(e, d);
- return 'cause' in Error.prototype ||
- !('cause' in e) ||
- cI.call(e, 'cause')
- ? 0 === b.length
- ? '[' + String(e) + ']'
- : '{ [' + String(e) + '] ' + eI.call(b, ', ') + ' }'
- : '{ [' +
- String(e) +
- '] ' +
- eI.call(tI.call('[cause]: ' + d(e.cause), b), ', ') +
- ' }';
- }
- if ('object' == typeof e && s) {
- if (pI && 'function' == typeof e[pI] && dI)
- return dI(e, { depth: h - n });
- if ('symbol' !== s && 'function' == typeof e.inspect)
- return e.inspect();
- }
- if (
- (function (t) {
- if (!NO || !t || 'object' != typeof t) return !1;
- try {
- NO.call(t);
- try {
- UO.call(t);
- } catch (t) {
- return !0;
- }
- return t instanceof Map;
- } catch (t) {}
- return !1;
- })(e)
- ) {
- var T = [];
- return (
- kO.call(e, function (t, r) {
- T.push(d(r, e, !0) + ' => ' + d(t, e));
- }),
- PI('Map', NO.call(e), T, l)
- );
- }
- if (
- (function (t) {
- if (!UO || !t || 'object' != typeof t) return !1;
- try {
- UO.call(t);
- try {
- NO.call(t);
- } catch (t) {
- return !0;
- }
- return t instanceof Set;
- } catch (t) {}
- return !1;
- })(e)
- ) {
- var x = [];
- return (
- jO.call(e, function (t) {
- x.push(d(t, e));
- }),
- PI('Set', UO.call(e), x, l)
- );
- }
- if (
- (function (t) {
- if (!XO || !t || 'object' != typeof t) return !1;
- try {
- XO.call(t, XO);
- try {
- VO.call(t, VO);
- } catch (t) {
- return !0;
- }
- return t instanceof WeakMap;
- } catch (t) {}
- return !1;
- })(e)
- )
- return CI('WeakMap');
- if (
- (function (t) {
- if (!VO || !t || 'object' != typeof t) return !1;
- try {
- VO.call(t, VO);
- try {
- XO.call(t, XO);
- } catch (t) {
- return !0;
- }
- return t instanceof WeakSet;
- } catch (t) {}
- return !1;
- })(e)
- )
- return CI('WeakSet');
- if (
- (function (t) {
- if (!HO || !t || 'object' != typeof t) return !1;
- try {
- return HO.call(t), !0;
- } catch (t) {}
- return !1;
- })(e)
- )
- return CI('WeakRef');
- if (
- (function (t) {
- return !(
- '[object Number]' !== xI(t) ||
- (uI && 'object' == typeof t && uI in t)
- );
- })(e)
- )
- return RI(d(Number(e)));
- if (
- (function (t) {
- if (!t || 'object' != typeof t || !iI) return !1;
- try {
- return iI.call(t), !0;
- } catch (t) {}
- return !1;
- })(e)
- )
- return RI(d(iI.call(e)));
- if (
- (function (t) {
- return !(
- '[object Boolean]' !== xI(t) ||
- (uI && 'object' == typeof t && uI in t)
- );
- })(e)
- )
- return RI(WO.call(e));
- if (
- (function (t) {
- return !(
- '[object String]' !== xI(t) ||
- (uI && 'object' == typeof t && uI in t)
- );
- })(e)
- )
- return RI(d(String(e)));
- if (
- !(function (t) {
- return !(
- '[object Date]' !== xI(t) ||
- (uI && 'object' == typeof t && uI in t)
- );
- })(e) &&
- !gI(e)
- ) {
- var E = OI(e, d),
- S = hI
- ? hI(e) === Object.prototype
- : e instanceof Object || e.constructor === Object,
- w = e instanceof Object ? '' : 'null prototype',
- R =
- !S && uI && Object(e) === e && uI in e
- ? JO.call(xI(e), 8, -1)
- : w
- ? 'Object'
- : '',
- C =
- (S || 'function' != typeof e.constructor
- ? ''
- : e.constructor.name
- ? e.constructor.name + ' '
- : '') +
- (R || w
- ? '[' + eI.call(tI.call([], R || [], w || []), ': ') + '] '
- : '');
- return 0 === E.length
- ? C + '{}'
- : l
- ? C + '{' + AI(E, l) + '}'
- : C + '{ ' + eI.call(E, ', ') + ' }';
- }
- return String(e);
- },
- LI = II('%TypeError%'),
- FI = II('%WeakMap%', !0),
- NI = II('%Map%', !0),
- kI = MI('WeakMap.prototype.get', !0),
- BI = MI('WeakMap.prototype.set', !0),
- GI = MI('WeakMap.prototype.has', !0),
- UI = MI('Map.prototype.get', !0),
- jI = MI('Map.prototype.set', !0),
- XI = MI('Map.prototype.has', !0),
- VI = function (t, e) {
- for (var r, n = t; null !== (r = n.next); n = r)
- if (r.key === e)
- return (n.next = r.next), (r.next = t.next), (t.next = r), r;
- },
- HI = String.prototype.replace,
- WI = /%20/g,
- YI = 'RFC3986',
- zI = {
- default: YI,
- formatters: {
- RFC1738: function (t) {
- return HI.call(t, WI, '+');
- },
- RFC3986: function (t) {
- return String(t);
- },
- },
- RFC1738: 'RFC1738',
- RFC3986: YI,
- },
- ZI = zI,
- JI = Object.prototype.hasOwnProperty,
- KI = Array.isArray,
- qI = (function () {
- for (var t = [], e = 0; e < 256; ++e)
- t.push('%' + ((e < 16 ? '0' : '') + e.toString(16)).toUpperCase());
- return t;
- })(),
- QI = function (t, e) {
- for (
- var r = e && e.plainObjects ? Object.create(null) : {}, n = 0;
- n < t.length;
- ++n
- )
- void 0 !== t[n] && (r[n] = t[n]);
- return r;
- },
- $I = {
- arrayToObject: QI,
- assign: function (t, e) {
- return Object.keys(e).reduce(function (t, r) {
- return (t[r] = e[r]), t;
- }, t);
- },
- combine: function (t, e) {
- return [].concat(t, e);
- },
- compact: function (t) {
- for (
- var e = [{ obj: { o: t }, prop: 'o' }], r = [], n = 0;
- n < e.length;
- ++n
- )
- for (
- var i = e[n], o = i.obj[i.prop], s = Object.keys(o), a = 0;
- a < s.length;
- ++a
- ) {
- var u = s[a],
- c = o[u];
- 'object' == typeof c &&
- null !== c &&
- -1 === r.indexOf(c) &&
- (e.push({ obj: o, prop: u }), r.push(c));
- }
- return (
- (function (t) {
- for (; t.length > 1; ) {
- var e = t.pop(),
- r = e.obj[e.prop];
- if (KI(r)) {
- for (var n = [], i = 0; i < r.length; ++i)
- void 0 !== r[i] && n.push(r[i]);
- e.obj[e.prop] = n;
- }
- }
- })(e),
- t
- );
- },
- decode: function (t, e, r) {
- var n = t.replace(/\+/g, ' ');
- if ('iso-8859-1' === r) return n.replace(/%[0-9a-f]{2}/gi, unescape);
- try {
- return decodeURIComponent(n);
- } catch (t) {
- return n;
- }
- },
- encode: function (t, e, r, n, i) {
- if (0 === t.length) return t;
- var o = t;
- if (
- ('symbol' == typeof t
- ? (o = Symbol.prototype.toString.call(t))
- : 'string' != typeof t && (o = String(t)),
- 'iso-8859-1' === r)
- )
- return escape(o).replace(/%u[0-9a-f]{4}/gi, function (t) {
- return '%26%23' + parseInt(t.slice(2), 16) + '%3B';
- });
- for (var s = '', a = 0; a < o.length; ++a) {
- var u = o.charCodeAt(a);
- 45 === u ||
- 46 === u ||
- 95 === u ||
- 126 === u ||
- (u >= 48 && u <= 57) ||
- (u >= 65 && u <= 90) ||
- (u >= 97 && u <= 122) ||
- (i === ZI.RFC1738 && (40 === u || 41 === u))
- ? (s += o.charAt(a))
- : u < 128
- ? (s += qI[u])
- : u < 2048
- ? (s += qI[192 | (u >> 6)] + qI[128 | (63 & u)])
- : u < 55296 || u >= 57344
- ? (s +=
- qI[224 | (u >> 12)] +
- qI[128 | ((u >> 6) & 63)] +
- qI[128 | (63 & u)])
- : ((a += 1),
- (u = 65536 + (((1023 & u) << 10) | (1023 & o.charCodeAt(a)))),
- (s +=
- qI[240 | (u >> 18)] +
- qI[128 | ((u >> 12) & 63)] +
- qI[128 | ((u >> 6) & 63)] +
- qI[128 | (63 & u)]));
- }
- return s;
- },
- isBuffer: function (t) {
- return (
- !(!t || 'object' != typeof t) &&
- !!(
- t.constructor &&
- t.constructor.isBuffer &&
- t.constructor.isBuffer(t)
- )
- );
- },
- isRegExp: function (t) {
- return '[object RegExp]' === Object.prototype.toString.call(t);
- },
- maybeMap: function (t, e) {
- if (KI(t)) {
- for (var r = [], n = 0; n < t.length; n += 1) r.push(e(t[n]));
- return r;
- }
- return e(t);
- },
- merge: function t(e, r, n) {
- if (!r) return e;
- if ('object' != typeof r) {
- if (KI(e)) e.push(r);
- else {
- if (!e || 'object' != typeof e) return [e, r];
- ((n && (n.plainObjects || n.allowPrototypes)) ||
- !JI.call(Object.prototype, r)) &&
- (e[r] = !0);
- }
- return e;
- }
- if (!e || 'object' != typeof e) return [e].concat(r);
- var i = e;
- return (
- KI(e) && !KI(r) && (i = QI(e, n)),
- KI(e) && KI(r)
- ? (r.forEach(function (r, i) {
- if (JI.call(e, i)) {
- var o = e[i];
- o && 'object' == typeof o && r && 'object' == typeof r
- ? (e[i] = t(o, r, n))
- : e.push(r);
- } else e[i] = r;
- }),
- e)
- : Object.keys(r).reduce(function (e, i) {
- var o = r[i];
- return JI.call(e, i) ? (e[i] = t(e[i], o, n)) : (e[i] = o), e;
- }, i)
- );
- },
- },
- tM = function () {
- var t,
- e,
- r,
- n = {
- assert: function (t) {
- if (!n.has(t))
- throw new LI('Side channel does not contain ' + DI(t));
- },
- get: function (n) {
- if (FI && n && ('object' == typeof n || 'function' == typeof n)) {
- if (t) return kI(t, n);
- } else if (NI) {
- if (e) return UI(e, n);
- } else if (r)
- return (function (t, e) {
- var r = VI(t, e);
- return r && r.value;
- })(r, n);
- },
- has: function (n) {
- if (FI && n && ('object' == typeof n || 'function' == typeof n)) {
- if (t) return GI(t, n);
- } else if (NI) {
- if (e) return XI(e, n);
- } else if (r)
- return (function (t, e) {
- return !!VI(t, e);
- })(r, n);
- return !1;
- },
- set: function (n, i) {
- FI && n && ('object' == typeof n || 'function' == typeof n)
- ? (t || (t = new FI()), BI(t, n, i))
- : NI
- ? (e || (e = new NI()), jI(e, n, i))
- : (r || (r = { key: {}, next: null }),
- (function (t, e, r) {
- var n = VI(t, e);
- n
- ? (n.value = r)
- : (t.next = { key: e, next: t.next, value: r });
- })(r, n, i));
- },
- };
- return n;
- },
- eM = $I,
- rM = zI,
- nM = Object.prototype.hasOwnProperty,
- iM = {
- brackets: function (t) {
- return t + '[]';
- },
- comma: 'comma',
- indices: function (t, e) {
- return t + '[' + e + ']';
- },
- repeat: function (t) {
- return t;
- },
- },
- oM = Array.isArray,
- sM = Array.prototype.push,
- aM = function (t, e) {
- sM.apply(t, oM(e) ? e : [e]);
- },
- uM = Date.prototype.toISOString,
- cM = rM.default,
- hM = {
- addQueryPrefix: !1,
- allowDots: !1,
- charset: 'utf-8',
- charsetSentinel: !1,
- delimiter: '&',
- encode: !0,
- encoder: eM.encode,
- encodeValuesOnly: !1,
- format: cM,
- formatter: rM.formatters[cM],
- indices: !1,
- serializeDate: function (t) {
- return uM.call(t);
- },
- skipNulls: !1,
- strictNullHandling: !1,
- },
- lM = {},
- dM = function t(e, r, n, i, o, s, a, u, c, h, l, d, f, p, v, m) {
- for (
- var y, g = e, _ = m, b = 0, T = !1;
- void 0 !== (_ = _.get(lM)) && !T;
- ) {
- var x = _.get(e);
- if (((b += 1), void 0 !== x)) {
- if (x === b) throw new RangeError('Cyclic object value');
- T = !0;
- }
- void 0 === _.get(lM) && (b = 0);
- }
- if (
- ('function' == typeof u
- ? (g = u(r, g))
- : g instanceof Date
- ? (g = l(g))
- : 'comma' === n &&
- oM(g) &&
- (g = eM.maybeMap(g, function (t) {
- return t instanceof Date ? l(t) : t;
- })),
- null === g)
- ) {
- if (o) return a && !p ? a(r, hM.encoder, v, 'key', d) : r;
- g = '';
- }
- if (
- 'string' == typeof (y = g) ||
- 'number' == typeof y ||
- 'boolean' == typeof y ||
- 'symbol' == typeof y ||
- 'bigint' == typeof y ||
- eM.isBuffer(g)
- )
- return a
- ? [
- f(p ? r : a(r, hM.encoder, v, 'key', d)) +
- '=' +
- f(a(g, hM.encoder, v, 'value', d)),
- ]
- : [f(r) + '=' + f(String(g))];
- var E,
- S = [];
- if (void 0 === g) return S;
- if ('comma' === n && oM(g))
- p && a && (g = eM.maybeMap(g, a)),
- (E = [{ value: g.length > 0 ? g.join(',') || null : void 0 }]);
- else if (oM(u)) E = u;
- else {
- var w = Object.keys(g);
- E = c ? w.sort(c) : w;
- }
- for (
- var R = i && oM(g) && 1 === g.length ? r + '[]' : r, C = 0;
- C < E.length;
- ++C
- ) {
- var P = E[C],
- A = 'object' == typeof P && void 0 !== P.value ? P.value : g[P];
- if (!s || null !== A) {
- var O = oM(g)
- ? 'function' == typeof n
- ? n(R, P)
- : R
- : R + (h ? '.' + P : '[' + P + ']');
- m.set(e, b);
- var I = tM();
- I.set(lM, m),
- aM(
- S,
- t(
- A,
- O,
- n,
- i,
- o,
- s,
- 'comma' === n && p && oM(g) ? null : a,
- u,
- c,
- h,
- l,
- d,
- f,
- p,
- v,
- I
- )
- );
- }
- }
- return S;
- },
- fM = $I,
- pM = Object.prototype.hasOwnProperty,
- vM = Array.isArray,
- mM = {
- allowDots: !1,
- allowPrototypes: !1,
- allowSparse: !1,
- arrayLimit: 20,
- charset: 'utf-8',
- charsetSentinel: !1,
- comma: !1,
- decoder: fM.decode,
- delimiter: '&',
- depth: 5,
- ignoreQueryPrefix: !1,
- interpretNumericEntities: !1,
- parameterLimit: 1e3,
- parseArrays: !0,
- plainObjects: !1,
- strictNullHandling: !1,
- },
- yM = function (t) {
- return t.replace(/&#(\d+);/g, function (t, e) {
- return String.fromCharCode(parseInt(e, 10));
- });
- },
- gM = function (t, e) {
- return t && 'string' == typeof t && e.comma && t.indexOf(',') > -1
- ? t.split(',')
- : t;
- },
- _M = function (t, e, r, n) {
- if (t) {
- var i = r.allowDots ? t.replace(/\.([^.[]+)/g, '[$1]') : t,
- o = /(\[[^[\]]*])/g,
- s = r.depth > 0 && /(\[[^[\]]*])/.exec(i),
- a = s ? i.slice(0, s.index) : i,
- u = [];
- if (a) {
- if (
- !r.plainObjects &&
- pM.call(Object.prototype, a) &&
- !r.allowPrototypes
- )
- return;
- u.push(a);
- }
- for (
- var c = 0;
- r.depth > 0 && null !== (s = o.exec(i)) && c < r.depth;
- ) {
- if (
- ((c += 1),
- !r.plainObjects &&
- pM.call(Object.prototype, s[1].slice(1, -1)) &&
- !r.allowPrototypes)
- )
- return;
- u.push(s[1]);
- }
- return (
- s && u.push('[' + i.slice(s.index) + ']'),
- (function (t, e, r, n) {
- for (var i = n ? e : gM(e, r), o = t.length - 1; o >= 0; --o) {
- var s,
- a = t[o];
- if ('[]' === a && r.parseArrays) s = [].concat(i);
- else {
- s = r.plainObjects ? Object.create(null) : {};
- var u =
- '[' === a.charAt(0) && ']' === a.charAt(a.length - 1)
- ? a.slice(1, -1)
- : a,
- c = parseInt(u, 10);
- r.parseArrays || '' !== u
- ? !isNaN(c) &&
- a !== u &&
- String(c) === u &&
- c >= 0 &&
- r.parseArrays &&
- c <= r.arrayLimit
- ? ((s = [])[c] = i)
- : '__proto__' !== u && (s[u] = i)
- : (s = { 0: i });
- }
- i = s;
- }
- return i;
- })(u, e, r, n)
- );
- }
- },
- bM = function (t, e) {
- var r,
- n = t,
- i = (function (t) {
- if (!t) return hM;
- if (
- null !== t.encoder &&
- void 0 !== t.encoder &&
- 'function' != typeof t.encoder
- )
- throw new TypeError('Encoder has to be a function.');
- var e = t.charset || hM.charset;
- if (
- void 0 !== t.charset &&
- 'utf-8' !== t.charset &&
- 'iso-8859-1' !== t.charset
- )
- throw new TypeError(
- 'The charset option must be either utf-8, iso-8859-1, or undefined'
- );
- var r = rM.default;
- if (void 0 !== t.format) {
- if (!nM.call(rM.formatters, t.format))
- throw new TypeError('Unknown format option provided.');
- r = t.format;
- }
- var n = rM.formatters[r],
- i = hM.filter;
- return (
- ('function' == typeof t.filter || oM(t.filter)) && (i = t.filter),
- {
- addQueryPrefix:
- 'boolean' == typeof t.addQueryPrefix
- ? t.addQueryPrefix
- : hM.addQueryPrefix,
- allowDots: void 0 === t.allowDots ? hM.allowDots : !!t.allowDots,
- charset: e,
- charsetSentinel:
- 'boolean' == typeof t.charsetSentinel
- ? t.charsetSentinel
- : hM.charsetSentinel,
- delimiter: void 0 === t.delimiter ? hM.delimiter : t.delimiter,
- encode: 'boolean' == typeof t.encode ? t.encode : hM.encode,
- encoder: 'function' == typeof t.encoder ? t.encoder : hM.encoder,
- encodeValuesOnly:
- 'boolean' == typeof t.encodeValuesOnly
- ? t.encodeValuesOnly
- : hM.encodeValuesOnly,
- filter: i,
- format: r,
- formatter: n,
- serializeDate:
- 'function' == typeof t.serializeDate
- ? t.serializeDate
- : hM.serializeDate,
- skipNulls:
- 'boolean' == typeof t.skipNulls ? t.skipNulls : hM.skipNulls,
- sort: 'function' == typeof t.sort ? t.sort : null,
- strictNullHandling:
- 'boolean' == typeof t.strictNullHandling
- ? t.strictNullHandling
- : hM.strictNullHandling,
- }
- );
- })(e);
- 'function' == typeof i.filter
- ? (n = (0, i.filter)('', n))
- : oM(i.filter) && (r = i.filter);
- var o,
- s = [];
- if ('object' != typeof n || null === n) return '';
- o =
- e && e.arrayFormat in iM
- ? e.arrayFormat
- : e && 'indices' in e
- ? e.indices
- ? 'indices'
- : 'repeat'
- : 'indices';
- var a = iM[o];
- if (e && 'commaRoundTrip' in e && 'boolean' != typeof e.commaRoundTrip)
- throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
- var u = 'comma' === a && e && e.commaRoundTrip;
- r || (r = Object.keys(n)), i.sort && r.sort(i.sort);
- for (var c = tM(), h = 0; h < r.length; ++h) {
- var l = r[h];
- (i.skipNulls && null === n[l]) ||
- aM(
- s,
- dM(
- n[l],
- l,
- a,
- u,
- i.strictNullHandling,
- i.skipNulls,
- i.encode ? i.encoder : null,
- i.filter,
- i.sort,
- i.allowDots,
- i.serializeDate,
- i.format,
- i.formatter,
- i.encodeValuesOnly,
- i.charset,
- c
- )
- );
- }
- var d = s.join(i.delimiter),
- f = !0 === i.addQueryPrefix ? '?' : '';
- return (
- i.charsetSentinel &&
- ('iso-8859-1' === i.charset
- ? (f += 'utf8=%26%2310003%3B&')
- : (f += 'utf8=%E2%9C%93&')),
- d.length > 0 ? f + d : ''
- );
- },
- TM = function (t, e) {
- var r = (function (t) {
- if (!t) return mM;
- if (
- null !== t.decoder &&
- void 0 !== t.decoder &&
- 'function' != typeof t.decoder
- )
- throw new TypeError('Decoder has to be a function.');
- if (
- void 0 !== t.charset &&
- 'utf-8' !== t.charset &&
- 'iso-8859-1' !== t.charset
- )
- throw new TypeError(
- 'The charset option must be either utf-8, iso-8859-1, or undefined'
- );
- var e = void 0 === t.charset ? mM.charset : t.charset;
- return {
- allowDots: void 0 === t.allowDots ? mM.allowDots : !!t.allowDots,
- allowPrototypes:
- 'boolean' == typeof t.allowPrototypes
- ? t.allowPrototypes
- : mM.allowPrototypes,
- allowSparse:
- 'boolean' == typeof t.allowSparse ? t.allowSparse : mM.allowSparse,
- arrayLimit:
- 'number' == typeof t.arrayLimit ? t.arrayLimit : mM.arrayLimit,
- charset: e,
- charsetSentinel:
- 'boolean' == typeof t.charsetSentinel
- ? t.charsetSentinel
- : mM.charsetSentinel,
- comma: 'boolean' == typeof t.comma ? t.comma : mM.comma,
- decoder: 'function' == typeof t.decoder ? t.decoder : mM.decoder,
- delimiter:
- 'string' == typeof t.delimiter || fM.isRegExp(t.delimiter)
- ? t.delimiter
- : mM.delimiter,
- depth:
- 'number' == typeof t.depth || !1 === t.depth ? +t.depth : mM.depth,
- ignoreQueryPrefix: !0 === t.ignoreQueryPrefix,
- interpretNumericEntities:
- 'boolean' == typeof t.interpretNumericEntities
- ? t.interpretNumericEntities
- : mM.interpretNumericEntities,
- parameterLimit:
- 'number' == typeof t.parameterLimit
- ? t.parameterLimit
- : mM.parameterLimit,
- parseArrays: !1 !== t.parseArrays,
- plainObjects:
- 'boolean' == typeof t.plainObjects
- ? t.plainObjects
- : mM.plainObjects,
- strictNullHandling:
- 'boolean' == typeof t.strictNullHandling
- ? t.strictNullHandling
- : mM.strictNullHandling,
- };
- })(e);
- if ('' === t || null == t)
- return r.plainObjects ? Object.create(null) : {};
- for (
- var n =
- 'string' == typeof t
- ? (function (t, e) {
- var r,
- n = { __proto__: null },
- i = e.ignoreQueryPrefix ? t.replace(/^\?/, '') : t,
- o = e.parameterLimit === 1 / 0 ? void 0 : e.parameterLimit,
- s = i.split(e.delimiter, o),
- a = -1,
- u = e.charset;
- if (e.charsetSentinel)
- for (r = 0; r < s.length; ++r)
- 0 === s[r].indexOf('utf8=') &&
- ('utf8=%E2%9C%93' === s[r]
- ? (u = 'utf-8')
- : 'utf8=%26%2310003%3B' === s[r] &&
- (u = 'iso-8859-1'),
- (a = r),
- (r = s.length));
- for (r = 0; r < s.length; ++r)
- if (r !== a) {
- var c,
- h,
- l = s[r],
- d = l.indexOf(']='),
- f = -1 === d ? l.indexOf('=') : d + 1;
- -1 === f
- ? ((c = e.decoder(l, mM.decoder, u, 'key')),
- (h = e.strictNullHandling ? null : ''))
- : ((c = e.decoder(l.slice(0, f), mM.decoder, u, 'key')),
- (h = fM.maybeMap(gM(l.slice(f + 1), e), function (t) {
- return e.decoder(t, mM.decoder, u, 'value');
- }))),
- h &&
- e.interpretNumericEntities &&
- 'iso-8859-1' === u &&
- (h = yM(h)),
- l.indexOf('[]=') > -1 && (h = vM(h) ? [h] : h),
- pM.call(n, c)
- ? (n[c] = fM.combine(n[c], h))
- : (n[c] = h);
- }
- return n;
- })(t, r)
- : t,
- i = r.plainObjects ? Object.create(null) : {},
- o = Object.keys(n),
- s = 0;
- s < o.length;
- ++s
- ) {
- var a = o[s],
- u = _M(a, n[a], r, 'string' == typeof t);
- i = fM.merge(i, u, r);
- }
- return !0 === r.allowSparse ? i : fM.compact(i);
- },
- xM = { formats: zI, parse: TM, stringify: bM },
- EM = YA.exports;
- function SM() {
- (this.protocol = null),
- (this.slashes = null),
- (this.auth = null),
- (this.host = null),
- (this.port = null),
- (this.hostname = null),
- (this.hash = null),
- (this.search = null),
- (this.query = null),
- (this.pathname = null),
- (this.path = null),
- (this.href = null);
- }
- var wM = /^([a-z0-9.+-]+:)/i,
- RM = /:[0-9]*$/,
- CM = /^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,
- PM = ['{', '}', '|', '\\', '^', '`'].concat([
- '<',
- '>',
- '"',
- '`',
- ' ',
- '\r',
- '\n',
- '\t',
- ]),
- AM = ["'"].concat(PM),
- OM = ['%', '/', '?', ';', '#'].concat(AM),
- IM = ['/', '?', '#'],
- MM = /^[+a-z0-9A-Z_-]{0,63}$/,
- DM = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
- LM = { javascript: !0, 'javascript:': !0 },
- FM = { javascript: !0, 'javascript:': !0 },
- NM = {
- http: !0,
- https: !0,
- ftp: !0,
- gopher: !0,
- file: !0,
- 'http:': !0,
- 'https:': !0,
- 'ftp:': !0,
- 'gopher:': !0,
- 'file:': !0,
- },
- kM = xM;
- function BM(t, e, r) {
- if (t && 'object' == typeof t && t instanceof SM) return t;
- var n = new SM();
- return n.parse(t, e, r), n;
- }
- (SM.prototype.parse = function (t, e, r) {
- if ('string' != typeof t)
- throw new TypeError("Parameter 'url' must be a string, not " + typeof t);
- var n = t.indexOf('?'),
- i = -1 !== n && n < t.indexOf('#') ? '?' : '#',
- o = t.split(i);
- o[0] = o[0].replace(/\\/g, '/');
- var s = (t = o.join(i));
- if (((s = s.trim()), !r && 1 === t.split('#').length)) {
- var a = CM.exec(s);
- if (a)
- return (
- (this.path = s),
- (this.href = s),
- (this.pathname = a[1]),
- a[2]
- ? ((this.search = a[2]),
- (this.query = e
- ? kM.parse(this.search.substr(1))
- : this.search.substr(1)))
- : e && ((this.search = ''), (this.query = {})),
- this
- );
- }
- var u = wM.exec(s);
- if (u) {
- var c = (u = u[0]).toLowerCase();
- (this.protocol = c), (s = s.substr(u.length));
- }
- if (r || u || s.match(/^\/\/[^@/]+@[^@/]+/)) {
- var h = '//' === s.substr(0, 2);
- !h || (u && FM[u]) || ((s = s.substr(2)), (this.slashes = !0));
- }
- if (!FM[u] && (h || (u && !NM[u]))) {
- for (var l, d, f = -1, p = 0; p < IM.length; p++) {
- -1 !== (v = s.indexOf(IM[p])) && (-1 === f || v < f) && (f = v);
- }
- -1 !== (d = -1 === f ? s.lastIndexOf('@') : s.lastIndexOf('@', f)) &&
- ((l = s.slice(0, d)),
- (s = s.slice(d + 1)),
- (this.auth = decodeURIComponent(l))),
- (f = -1);
- for (p = 0; p < OM.length; p++) {
- var v;
- -1 !== (v = s.indexOf(OM[p])) && (-1 === f || v < f) && (f = v);
- }
- -1 === f && (f = s.length),
- (this.host = s.slice(0, f)),
- (s = s.slice(f)),
- this.parseHost(),
- (this.hostname = this.hostname || '');
- var m =
- '[' === this.hostname[0] &&
- ']' === this.hostname[this.hostname.length - 1];
- if (!m)
- for (
- var y = this.hostname.split(/\./), g = ((p = 0), y.length);
- p < g;
- p++
- ) {
- var _ = y[p];
- if (_ && !_.match(MM)) {
- for (var b = '', T = 0, x = _.length; T < x; T++)
- _.charCodeAt(T) > 127 ? (b += 'x') : (b += _[T]);
- if (!b.match(MM)) {
- var E = y.slice(0, p),
- S = y.slice(p + 1),
- w = _.match(DM);
- w && (E.push(w[1]), S.unshift(w[2])),
- S.length && (s = '/' + S.join('.') + s),
- (this.hostname = E.join('.'));
- break;
- }
- }
- }
- this.hostname.length > 255
- ? (this.hostname = '')
- : (this.hostname = this.hostname.toLowerCase()),
- m || (this.hostname = EM.toASCII(this.hostname));
- var R = this.port ? ':' + this.port : '',
- C = this.hostname || '';
- (this.host = C + R),
- (this.href += this.host),
- m &&
- ((this.hostname = this.hostname.substr(1, this.hostname.length - 2)),
- '/' !== s[0] && (s = '/' + s));
- }
- if (!LM[c])
- for (p = 0, g = AM.length; p < g; p++) {
- var P = AM[p];
- if (-1 !== s.indexOf(P)) {
- var A = encodeURIComponent(P);
- A === P && (A = escape(P)), (s = s.split(P).join(A));
- }
- }
- var O = s.indexOf('#');
- -1 !== O && ((this.hash = s.substr(O)), (s = s.slice(0, O)));
- var I = s.indexOf('?');
- if (
- (-1 !== I
- ? ((this.search = s.substr(I)),
- (this.query = s.substr(I + 1)),
- e && (this.query = kM.parse(this.query)),
- (s = s.slice(0, I)))
- : e && ((this.search = ''), (this.query = {})),
- s && (this.pathname = s),
- NM[c] && this.hostname && !this.pathname && (this.pathname = '/'),
- this.pathname || this.search)
- ) {
- R = this.pathname || '';
- var M = this.search || '';
- this.path = R + M;
- }
- return (this.href = this.format()), this;
- }),
- (SM.prototype.format = function () {
- var t = this.auth || '';
- t && ((t = (t = encodeURIComponent(t)).replace(/%3A/i, ':')), (t += '@'));
- var e = this.protocol || '',
- r = this.pathname || '',
- n = this.hash || '',
- i = !1,
- o = '';
- this.host
- ? (i = t + this.host)
- : this.hostname &&
- ((i =
- t +
- (-1 === this.hostname.indexOf(':')
- ? this.hostname
- : '[' + this.hostname + ']')),
- this.port && (i += ':' + this.port)),
- this.query &&
- 'object' == typeof this.query &&
- Object.keys(this.query).length &&
- (o = kM.stringify(this.query, {
- arrayFormat: 'repeat',
- addQueryPrefix: !1,
- }));
- var s = this.search || (o && '?' + o) || '';
- return (
- e && ':' !== e.substr(-1) && (e += ':'),
- this.slashes || ((!e || NM[e]) && !1 !== i)
- ? ((i = '//' + (i || '')), r && '/' !== r.charAt(0) && (r = '/' + r))
- : i || (i = ''),
- n && '#' !== n.charAt(0) && (n = '#' + n),
- s && '?' !== s.charAt(0) && (s = '?' + s),
- (r = r.replace(/[?#]/g, function (t) {
- return encodeURIComponent(t);
- })),
- e + i + r + (s = s.replace('#', '%23')) + n
- );
- }),
- (SM.prototype.resolve = function (t) {
- return this.resolveObject(BM(t, !1, !0)).format();
- }),
- (SM.prototype.resolveObject = function (t) {
- if ('string' == typeof t) {
- var e = new SM();
- e.parse(t, !1, !0), (t = e);
- }
- for (var r = new SM(), n = Object.keys(this), i = 0; i < n.length; i++) {
- var o = n[i];
- r[o] = this[o];
- }
- if (((r.hash = t.hash), '' === t.href)) return (r.href = r.format()), r;
- if (t.slashes && !t.protocol) {
- for (var s = Object.keys(t), a = 0; a < s.length; a++) {
- var u = s[a];
- 'protocol' !== u && (r[u] = t[u]);
- }
- return (
- NM[r.protocol] &&
- r.hostname &&
- !r.pathname &&
- ((r.pathname = '/'), (r.path = r.pathname)),
- (r.href = r.format()),
- r
- );
- }
- if (t.protocol && t.protocol !== r.protocol) {
- if (!NM[t.protocol]) {
- for (var c = Object.keys(t), h = 0; h < c.length; h++) {
- var l = c[h];
- r[l] = t[l];
- }
- return (r.href = r.format()), r;
- }
- if (((r.protocol = t.protocol), t.host || FM[t.protocol]))
- r.pathname = t.pathname;
- else {
- for (
- var d = (t.pathname || '').split('/');
- d.length && !(t.host = d.shift());
- );
- t.host || (t.host = ''),
- t.hostname || (t.hostname = ''),
- '' !== d[0] && d.unshift(''),
- d.length < 2 && d.unshift(''),
- (r.pathname = d.join('/'));
- }
- if (
- ((r.search = t.search),
- (r.query = t.query),
- (r.host = t.host || ''),
- (r.auth = t.auth),
- (r.hostname = t.hostname || t.host),
- (r.port = t.port),
- r.pathname || r.search)
- ) {
- var f = r.pathname || '',
- p = r.search || '';
- r.path = f + p;
- }
- return (r.slashes = r.slashes || t.slashes), (r.href = r.format()), r;
- }
- var v = r.pathname && '/' === r.pathname.charAt(0),
- m = t.host || (t.pathname && '/' === t.pathname.charAt(0)),
- y = m || v || (r.host && t.pathname),
- g = y,
- _ = (r.pathname && r.pathname.split('/')) || [],
- b =
- ((d = (t.pathname && t.pathname.split('/')) || []),
- r.protocol && !NM[r.protocol]);
- if (
- (b &&
- ((r.hostname = ''),
- (r.port = null),
- r.host && ('' === _[0] ? (_[0] = r.host) : _.unshift(r.host)),
- (r.host = ''),
- t.protocol &&
- ((t.hostname = null),
- (t.port = null),
- t.host && ('' === d[0] ? (d[0] = t.host) : d.unshift(t.host)),
- (t.host = null)),
- (y = y && ('' === d[0] || '' === _[0]))),
- m)
- )
- (r.host = t.host || '' === t.host ? t.host : r.host),
- (r.hostname =
- t.hostname || '' === t.hostname ? t.hostname : r.hostname),
- (r.search = t.search),
- (r.query = t.query),
- (_ = d);
- else if (d.length)
- _ || (_ = []),
- _.pop(),
- (_ = _.concat(d)),
- (r.search = t.search),
- (r.query = t.query);
- else if (null != t.search) {
- if (b)
- (r.host = _.shift()),
- (r.hostname = r.host),
- (w = !!(r.host && r.host.indexOf('@') > 0) && r.host.split('@')) &&
- ((r.auth = w.shift()),
- (r.hostname = w.shift()),
- (r.host = r.hostname));
- return (
- (r.search = t.search),
- (r.query = t.query),
- (null === r.pathname && null === r.search) ||
- (r.path =
- (r.pathname ? r.pathname : '') + (r.search ? r.search : '')),
- (r.href = r.format()),
- r
- );
- }
- if (!_.length)
- return (
- (r.pathname = null),
- r.search ? (r.path = '/' + r.search) : (r.path = null),
- (r.href = r.format()),
- r
- );
- for (
- var T = _.slice(-1)[0],
- x =
- ((r.host || t.host || _.length > 1) && ('.' === T || '..' === T)) ||
- '' === T,
- E = 0,
- S = _.length;
- S >= 0;
- S--
- )
- '.' === (T = _[S])
- ? _.splice(S, 1)
- : '..' === T
- ? (_.splice(S, 1), E++)
- : E && (_.splice(S, 1), E--);
- if (!y && !g) for (; E--; E) _.unshift('..');
- !y || '' === _[0] || (_[0] && '/' === _[0].charAt(0)) || _.unshift(''),
- x && '/' !== _.join('/').substr(-1) && _.push('');
- var w,
- R = '' === _[0] || (_[0] && '/' === _[0].charAt(0));
- b &&
- ((r.hostname = R ? '' : _.length ? _.shift() : ''),
- (r.host = r.hostname),
- (w = !!(r.host && r.host.indexOf('@') > 0) && r.host.split('@')) &&
- ((r.auth = w.shift()),
- (r.hostname = w.shift()),
- (r.host = r.hostname)));
- return (
- (y = y || (r.host && _.length)) && !R && _.unshift(''),
- _.length > 0
- ? (r.pathname = _.join('/'))
- : ((r.pathname = null), (r.path = null)),
- (null === r.pathname && null === r.search) ||
- (r.path =
- (r.pathname ? r.pathname : '') + (r.search ? r.search : '')),
- (r.auth = t.auth || r.auth),
- (r.slashes = r.slashes || t.slashes),
- (r.href = r.format()),
- r
- );
- }),
- (SM.prototype.parseHost = function () {
- var t = this.host,
- e = RM.exec(t);
- e &&
- (':' !== (e = e[0]) && (this.port = e.substr(1)),
- (t = t.substr(0, t.length - e.length))),
- t && (this.hostname = t);
- });
- var GM = {
- parse: BM,
- format: function (t) {
- return (
- 'string' == typeof t && (t = BM(t)),
- t instanceof SM ? t.format() : SM.prototype.format.call(t)
- );
- },
- resolve: function (t, e) {
- return BM(t, !1, !0).resolve(e);
- },
- };
- (vA.RETINA_PREFIX = /@([0-9\.]+)x/),
- (vA.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT = !1);
- var UM,
- jM = !1;
- function XM(t) {
- var e;
- if (!jM) {
- if (
- vA.ADAPTER.getNavigator().userAgent.toLowerCase().indexOf('chrome') > -1
- ) {
- var r = [
- '\n %c %c %c PixiJS 6.5.10 - ✰ ' +
- t +
- ' ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n',
- 'background: #ff66a5; padding:5px 0;',
- 'background: #ff66a5; padding:5px 0;',
- 'color: #ff66a5; background: #030307; padding:5px 0;',
- 'background: #ff66a5; padding:5px 0;',
- 'background: #ffc3dc; padding:5px 0;',
- 'background: #ff66a5; padding:5px 0;',
- 'color: #ff2424; background: #fff; padding:5px 0;',
- 'color: #ff2424; background: #fff; padding:5px 0;',
- 'color: #ff2424; background: #fff; padding:5px 0;',
- ];
- (e = globalThis.console).log.apply(e, r);
- } else
- globalThis.console &&
- globalThis.console.log(
- 'PixiJS 6.5.10 - ' + t + ' - http://www.pixijs.com/'
- );
- jM = !0;
- }
- }
- var VM = {
- aliceblue: '#f0f8ff',
- antiquewhite: '#faebd7',
- aqua: '#00ffff',
- aquamarine: '#7fffd4',
- azure: '#f0ffff',
- beige: '#f5f5dc',
- bisque: '#ffe4c4',
- black: '#000000',
- blanchedalmond: '#ffebcd',
- blue: '#0000ff',
- blueviolet: '#8a2be2',
- brown: '#a52a2a',
- burlywood: '#deb887',
- cadetblue: '#5f9ea0',
- chartreuse: '#7fff00',
- chocolate: '#d2691e',
- coral: '#ff7f50',
- cornflowerblue: '#6495ed',
- cornsilk: '#fff8dc',
- crimson: '#dc143c',
- cyan: '#00ffff',
- darkblue: '#00008b',
- darkcyan: '#008b8b',
- darkgoldenrod: '#b8860b',
- darkgray: '#a9a9a9',
- darkgreen: '#006400',
- darkgrey: '#a9a9a9',
- darkkhaki: '#bdb76b',
- darkmagenta: '#8b008b',
- darkolivegreen: '#556b2f',
- darkorange: '#ff8c00',
- darkorchid: '#9932cc',
- darkred: '#8b0000',
- darksalmon: '#e9967a',
- darkseagreen: '#8fbc8f',
- darkslateblue: '#483d8b',
- darkslategray: '#2f4f4f',
- darkslategrey: '#2f4f4f',
- darkturquoise: '#00ced1',
- darkviolet: '#9400d3',
- deeppink: '#ff1493',
- deepskyblue: '#00bfff',
- dimgray: '#696969',
- dimgrey: '#696969',
- dodgerblue: '#1e90ff',
- firebrick: '#b22222',
- floralwhite: '#fffaf0',
- forestgreen: '#228b22',
- fuchsia: '#ff00ff',
- gainsboro: '#dcdcdc',
- ghostwhite: '#f8f8ff',
- goldenrod: '#daa520',
- gold: '#ffd700',
- gray: '#808080',
- green: '#008000',
- greenyellow: '#adff2f',
- grey: '#808080',
- honeydew: '#f0fff0',
- hotpink: '#ff69b4',
- indianred: '#cd5c5c',
- indigo: '#4b0082',
- ivory: '#fffff0',
- khaki: '#f0e68c',
- lavenderblush: '#fff0f5',
- lavender: '#e6e6fa',
- lawngreen: '#7cfc00',
- lemonchiffon: '#fffacd',
- lightblue: '#add8e6',
- lightcoral: '#f08080',
- lightcyan: '#e0ffff',
- lightgoldenrodyellow: '#fafad2',
- lightgray: '#d3d3d3',
- lightgreen: '#90ee90',
- lightgrey: '#d3d3d3',
- lightpink: '#ffb6c1',
- lightsalmon: '#ffa07a',
- lightseagreen: '#20b2aa',
- lightskyblue: '#87cefa',
- lightslategray: '#778899',
- lightslategrey: '#778899',
- lightsteelblue: '#b0c4de',
- lightyellow: '#ffffe0',
- lime: '#00ff00',
- limegreen: '#32cd32',
- linen: '#faf0e6',
- magenta: '#ff00ff',
- maroon: '#800000',
- mediumaquamarine: '#66cdaa',
- mediumblue: '#0000cd',
- mediumorchid: '#ba55d3',
- mediumpurple: '#9370db',
- mediumseagreen: '#3cb371',
- mediumslateblue: '#7b68ee',
- mediumspringgreen: '#00fa9a',
- mediumturquoise: '#48d1cc',
- mediumvioletred: '#c71585',
- midnightblue: '#191970',
- mintcream: '#f5fffa',
- mistyrose: '#ffe4e1',
- moccasin: '#ffe4b5',
- navajowhite: '#ffdead',
- navy: '#000080',
- oldlace: '#fdf5e6',
- olive: '#808000',
- olivedrab: '#6b8e23',
- orange: '#ffa500',
- orangered: '#ff4500',
- orchid: '#da70d6',
- palegoldenrod: '#eee8aa',
- palegreen: '#98fb98',
- paleturquoise: '#afeeee',
- palevioletred: '#db7093',
- papayawhip: '#ffefd5',
- peachpuff: '#ffdab9',
- peru: '#cd853f',
- pink: '#ffc0cb',
- plum: '#dda0dd',
- powderblue: '#b0e0e6',
- purple: '#800080',
- rebeccapurple: '#663399',
- red: '#ff0000',
- rosybrown: '#bc8f8f',
- royalblue: '#4169e1',
- saddlebrown: '#8b4513',
- salmon: '#fa8072',
- sandybrown: '#f4a460',
- seagreen: '#2e8b57',
- seashell: '#fff5ee',
- sienna: '#a0522d',
- silver: '#c0c0c0',
- skyblue: '#87ceeb',
- slateblue: '#6a5acd',
- slategray: '#708090',
- slategrey: '#708090',
- snow: '#fffafa',
- springgreen: '#00ff7f',
- steelblue: '#4682b4',
- tan: '#d2b48c',
- teal: '#008080',
- thistle: '#d8bfd8',
- tomato: '#ff6347',
- turquoise: '#40e0d0',
- violet: '#ee82ee',
- wheat: '#f5deb3',
- white: '#ffffff',
- whitesmoke: '#f5f5f5',
- yellow: '#ffff00',
- yellowgreen: '#9acd32',
- };
- function HM(t, e) {
- return (
- void 0 === e && (e = []),
- (e[0] = ((t >> 16) & 255) / 255),
- (e[1] = ((t >> 8) & 255) / 255),
- (e[2] = (255 & t) / 255),
- e
- );
- }
- function WM(t) {
- var e = t.toString(16);
- return '#' + (e = '000000'.substring(0, 6 - e.length) + e);
- }
- function YM(t) {
- return (
- 'string' == typeof t &&
- '#' === (t = VM[t.toLowerCase()] || t)[0] &&
- (t = t.slice(1)),
- parseInt(t, 16)
- );
- }
- function zM(t) {
- return ((255 * t[0]) << 16) + ((255 * t[1]) << 8) + ((255 * t[2]) | 0);
- }
- var ZM = (function () {
- for (var t = [], e = [], r = 0; r < 32; r++) (t[r] = r), (e[r] = r);
- (t[OP.NORMAL_NPM] = OP.NORMAL),
- (t[OP.ADD_NPM] = OP.ADD),
- (t[OP.SCREEN_NPM] = OP.SCREEN),
- (e[OP.NORMAL] = OP.NORMAL_NPM),
- (e[OP.ADD] = OP.ADD_NPM),
- (e[OP.SCREEN] = OP.SCREEN_NPM);
- var n = [];
- return n.push(e), n.push(t), n;
- })();
- function JM(t, e) {
- return ZM[e ? 1 : 0][t];
- }
- function KM(t, e) {
- if (1 === e) return ((255 * e) << 24) + t;
- if (0 === e) return 0;
- var r = (t >> 16) & 255,
- n = (t >> 8) & 255,
- i = 255 & t;
- return (
- ((255 * e) << 24) +
- ((r = (r * e + 0.5) | 0) << 16) +
- ((n = (n * e + 0.5) | 0) << 8) +
- (i = (i * e + 0.5) | 0)
- );
- }
- function qM(t, e, r, n) {
- return (
- ((r = r || new Float32Array(4))[0] = ((t >> 16) & 255) / 255),
- (r[1] = ((t >> 8) & 255) / 255),
- (r[2] = (255 & t) / 255),
- (n || void 0 === n) && ((r[0] *= e), (r[1] *= e), (r[2] *= e)),
- (r[3] = e),
- r
- );
- }
- function QM(t) {
- if (4 === t.BYTES_PER_ELEMENT)
- return t instanceof Float32Array
- ? 'Float32Array'
- : t instanceof Uint32Array
- ? 'Uint32Array'
- : 'Int32Array';
- if (2 === t.BYTES_PER_ELEMENT) {
- if (t instanceof Uint16Array) return 'Uint16Array';
- } else if (1 === t.BYTES_PER_ELEMENT && t instanceof Uint8Array)
- return 'Uint8Array';
- return null;
- }
- function $M(t) {
- return (
- (t += 0 === t ? 1 : 0),
- --t,
- (t |= t >>> 1),
- (t |= t >>> 2),
- (t |= t >>> 4),
- (t |= t >>> 8),
- (t |= t >>> 16) + 1
- );
- }
- function tD(t) {
- return !(t & (t - 1) || !t);
- }
- function eD(t) {
- var e = (t > 65535 ? 1 : 0) << 4,
- r = ((t >>>= e) > 255 ? 1 : 0) << 3;
- return (
- (e |= r),
- (e |= r = ((t >>>= r) > 15 ? 1 : 0) << 2),
- (e |= r = ((t >>>= r) > 3 ? 1 : 0) << 1) | ((t >>>= r) >> 1)
- );
- }
- function rD(t, e, r) {
- var n,
- i = t.length;
- if (!(e >= i || 0 === r)) {
- var o = i - (r = e + r > i ? i - e : r);
- for (n = e; n < o; ++n) t[n] = t[n + r];
- t.length = o;
- }
- }
- function nD(t) {
- return 0 === t ? 0 : t < 0 ? -1 : 1;
- }
- var iD = 0;
- function oD() {
- return ++iD;
- }
- var sD = {};
- function aD(t, e, r) {
- if ((void 0 === r && (r = 3), !sD[e])) {
- var n = new Error().stack;
- void 0 === n
- ? console.warn(
- 'PixiJS Deprecation Warning: ',
- e + '\nDeprecated since v' + t
- )
- : ((n = n.split('\n').splice(r).join('\n')),
- console.groupCollapsed
- ? (console.groupCollapsed(
- '%cPixiJS Deprecation Warning: %c%s',
- 'color:#614108;background:#fffbe6',
- 'font-weight:normal;color:#614108;background:#fffbe6',
- e + '\nDeprecated since v' + t
- ),
- console.warn(n),
- console.groupEnd())
- : (console.warn(
- 'PixiJS Deprecation Warning: ',
- e + '\nDeprecated since v' + t
- ),
- console.warn(n))),
- (sD[e] = !0);
- }
- }
- var uD,
- cD = {},
- hD = Object.create(null),
- lD = Object.create(null),
- dD = (function () {
- function t(t, e, r) {
- (this.canvas = vA.ADAPTER.createCanvas()),
- (this.context = this.canvas.getContext('2d')),
- (this.resolution = r || vA.RESOLUTION),
- this.resize(t, e);
- }
- return (
- (t.prototype.clear = function () {
- this.context.setTransform(1, 0, 0, 1, 0, 0),
- this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
- }),
- (t.prototype.resize = function (t, e) {
- (this.canvas.width = Math.round(t * this.resolution)),
- (this.canvas.height = Math.round(e * this.resolution));
- }),
- (t.prototype.destroy = function () {
- (this.context = null), (this.canvas = null);
- }),
- Object.defineProperty(t.prototype, 'width', {
- get: function () {
- return this.canvas.width;
- },
- set: function (t) {
- this.canvas.width = Math.round(t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'height', {
- get: function () {
- return this.canvas.height;
- },
- set: function (t) {
- this.canvas.height = Math.round(t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- t
- );
- })();
- function fD(t, e) {
- if ((void 0 === e && (e = globalThis.location), 0 === t.indexOf('data:')))
- return '';
- (e = e || globalThis.location),
- uD || (uD = document.createElement('a')),
- (uD.href = t);
- var r = GM.parse(uD.href),
- n = (!r.port && '' === e.port) || r.port === e.port;
- return r.hostname === e.hostname && n && r.protocol === e.protocol
- ? ''
- : 'anonymous';
- }
- function pD(t, e) {
- var r = vA.RETINA_PREFIX.exec(t);
- return r ? parseFloat(r[1]) : void 0 !== e ? e : 1;
- }
- var vD,
- mD = 2 * Math.PI,
- yD = 180 / Math.PI,
- gD = Math.PI / 180;
- !(function (t) {
- (t[(t.POLY = 0)] = 'POLY'),
- (t[(t.RECT = 1)] = 'RECT'),
- (t[(t.CIRC = 2)] = 'CIRC'),
- (t[(t.ELIP = 3)] = 'ELIP'),
- (t[(t.RREC = 4)] = 'RREC');
- })(vD || (vD = {}));
- var _D = (function () {
- function t(t, e) {
- void 0 === t && (t = 0),
- void 0 === e && (e = 0),
- (this.x = 0),
- (this.y = 0),
- (this.x = t),
- (this.y = e);
- }
- return (
- (t.prototype.clone = function () {
- return new t(this.x, this.y);
- }),
- (t.prototype.copyFrom = function (t) {
- return this.set(t.x, t.y), this;
- }),
- (t.prototype.copyTo = function (t) {
- return t.set(this.x, this.y), t;
- }),
- (t.prototype.equals = function (t) {
- return t.x === this.x && t.y === this.y;
- }),
- (t.prototype.set = function (t, e) {
- return (
- void 0 === t && (t = 0),
- void 0 === e && (e = t),
- (this.x = t),
- (this.y = e),
- this
- );
- }),
- (t.prototype.toString = function () {
- return '[@pixi/math:Point x=' + this.x + ' y=' + this.y + ']';
- }),
- t
- );
- })(),
- bD = [new _D(), new _D(), new _D(), new _D()],
- TD = (function () {
- function t(t, e, r, n) {
- void 0 === t && (t = 0),
- void 0 === e && (e = 0),
- void 0 === r && (r = 0),
- void 0 === n && (n = 0),
- (this.x = Number(t)),
- (this.y = Number(e)),
- (this.width = Number(r)),
- (this.height = Number(n)),
- (this.type = vD.RECT);
- }
- return (
- Object.defineProperty(t.prototype, 'left', {
- get: function () {
- return this.x;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'right', {
- get: function () {
- return this.x + this.width;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'top', {
- get: function () {
- return this.y;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'bottom', {
- get: function () {
- return this.y + this.height;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t, 'EMPTY', {
- get: function () {
- return new t(0, 0, 0, 0);
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype.clone = function () {
- return new t(this.x, this.y, this.width, this.height);
- }),
- (t.prototype.copyFrom = function (t) {
- return (
- (this.x = t.x),
- (this.y = t.y),
- (this.width = t.width),
- (this.height = t.height),
- this
- );
- }),
- (t.prototype.copyTo = function (t) {
- return (
- (t.x = this.x),
- (t.y = this.y),
- (t.width = this.width),
- (t.height = this.height),
- t
- );
- }),
- (t.prototype.contains = function (t, e) {
- return (
- !(this.width <= 0 || this.height <= 0) &&
- t >= this.x &&
- t < this.x + this.width &&
- e >= this.y &&
- e < this.y + this.height
- );
- }),
- (t.prototype.intersects = function (t, e) {
- if (!e) {
- var r = this.x < t.x ? t.x : this.x;
- if ((this.right > t.right ? t.right : this.right) <= r) return !1;
- var n = this.y < t.y ? t.y : this.y;
- return (this.bottom > t.bottom ? t.bottom : this.bottom) > n;
- }
- var i = this.left,
- o = this.right,
- s = this.top,
- a = this.bottom;
- if (o <= i || a <= s) return !1;
- var u = bD[0].set(t.left, t.top),
- c = bD[1].set(t.left, t.bottom),
- h = bD[2].set(t.right, t.top),
- l = bD[3].set(t.right, t.bottom);
- if (h.x <= u.x || c.y <= u.y) return !1;
- var d = Math.sign(e.a * e.d - e.b * e.c);
- if (0 === d) return !1;
- if (
- (e.apply(u, u),
- e.apply(c, c),
- e.apply(h, h),
- e.apply(l, l),
- Math.max(u.x, c.x, h.x, l.x) <= i ||
- Math.min(u.x, c.x, h.x, l.x) >= o ||
- Math.max(u.y, c.y, h.y, l.y) <= s ||
- Math.min(u.y, c.y, h.y, l.y) >= a)
- )
- return !1;
- var f = d * (c.y - u.y),
- p = d * (u.x - c.x),
- v = f * i + p * s,
- m = f * o + p * s,
- y = f * i + p * a,
- g = f * o + p * a;
- if (
- Math.max(v, m, y, g) <= f * u.x + p * u.y ||
- Math.min(v, m, y, g) >= f * l.x + p * l.y
- )
- return !1;
- var _ = d * (u.y - h.y),
- b = d * (h.x - u.x),
- T = _ * i + b * s,
- x = _ * o + b * s,
- E = _ * i + b * a,
- S = _ * o + b * a;
- return !(
- Math.max(T, x, E, S) <= _ * u.x + b * u.y ||
- Math.min(T, x, E, S) >= _ * l.x + b * l.y
- );
- }),
- (t.prototype.pad = function (t, e) {
- return (
- void 0 === t && (t = 0),
- void 0 === e && (e = t),
- (this.x -= t),
- (this.y -= e),
- (this.width += 2 * t),
- (this.height += 2 * e),
- this
- );
- }),
- (t.prototype.fit = function (t) {
- var e = Math.max(this.x, t.x),
- r = Math.min(this.x + this.width, t.x + t.width),
- n = Math.max(this.y, t.y),
- i = Math.min(this.y + this.height, t.y + t.height);
- return (
- (this.x = e),
- (this.width = Math.max(r - e, 0)),
- (this.y = n),
- (this.height = Math.max(i - n, 0)),
- this
- );
- }),
- (t.prototype.ceil = function (t, e) {
- void 0 === t && (t = 1), void 0 === e && (e = 0.001);
- var r = Math.ceil((this.x + this.width - e) * t) / t,
- n = Math.ceil((this.y + this.height - e) * t) / t;
- return (
- (this.x = Math.floor((this.x + e) * t) / t),
- (this.y = Math.floor((this.y + e) * t) / t),
- (this.width = r - this.x),
- (this.height = n - this.y),
- this
- );
- }),
- (t.prototype.enlarge = function (t) {
- var e = Math.min(this.x, t.x),
- r = Math.max(this.x + this.width, t.x + t.width),
- n = Math.min(this.y, t.y),
- i = Math.max(this.y + this.height, t.y + t.height);
- return (
- (this.x = e),
- (this.width = r - e),
- (this.y = n),
- (this.height = i - n),
- this
- );
- }),
- (t.prototype.toString = function () {
- return (
- '[@pixi/math:Rectangle x=' +
- this.x +
- ' y=' +
- this.y +
- ' width=' +
- this.width +
- ' height=' +
- this.height +
- ']'
- );
- }),
- t
- );
- })(),
- xD = (function () {
- function t(t, e, r) {
- void 0 === t && (t = 0),
- void 0 === e && (e = 0),
- void 0 === r && (r = 0),
- (this.x = t),
- (this.y = e),
- (this.radius = r),
- (this.type = vD.CIRC);
- }
- return (
- (t.prototype.clone = function () {
- return new t(this.x, this.y, this.radius);
- }),
- (t.prototype.contains = function (t, e) {
- if (this.radius <= 0) return !1;
- var r = this.radius * this.radius,
- n = this.x - t,
- i = this.y - e;
- return (n *= n) + (i *= i) <= r;
- }),
- (t.prototype.getBounds = function () {
- return new TD(
- this.x - this.radius,
- this.y - this.radius,
- 2 * this.radius,
- 2 * this.radius
- );
- }),
- (t.prototype.toString = function () {
- return (
- '[@pixi/math:Circle x=' +
- this.x +
- ' y=' +
- this.y +
- ' radius=' +
- this.radius +
- ']'
- );
- }),
- t
- );
- })(),
- ED = (function () {
- function t(t, e, r, n) {
- void 0 === t && (t = 0),
- void 0 === e && (e = 0),
- void 0 === r && (r = 0),
- void 0 === n && (n = 0),
- (this.x = t),
- (this.y = e),
- (this.width = r),
- (this.height = n),
- (this.type = vD.ELIP);
- }
- return (
- (t.prototype.clone = function () {
- return new t(this.x, this.y, this.width, this.height);
- }),
- (t.prototype.contains = function (t, e) {
- if (this.width <= 0 || this.height <= 0) return !1;
- var r = (t - this.x) / this.width,
- n = (e - this.y) / this.height;
- return (r *= r) + (n *= n) <= 1;
- }),
- (t.prototype.getBounds = function () {
- return new TD(
- this.x - this.width,
- this.y - this.height,
- this.width,
- this.height
- );
- }),
- (t.prototype.toString = function () {
- return (
- '[@pixi/math:Ellipse x=' +
- this.x +
- ' y=' +
- this.y +
- ' width=' +
- this.width +
- ' height=' +
- this.height +
- ']'
- );
- }),
- t
- );
- })(),
- SD = (function () {
- function t() {
- for (var t = arguments, e = [], r = 0; r < arguments.length; r++)
- e[r] = t[r];
- var n = Array.isArray(e[0]) ? e[0] : e;
- if ('number' != typeof n[0]) {
- for (var i = [], o = 0, s = n.length; o < s; o++)
- i.push(n[o].x, n[o].y);
- n = i;
- }
- (this.points = n), (this.type = vD.POLY), (this.closeStroke = !0);
- }
- return (
- (t.prototype.clone = function () {
- var e = new t(this.points.slice());
- return (e.closeStroke = this.closeStroke), e;
- }),
- (t.prototype.contains = function (t, e) {
- for (
- var r = !1, n = this.points.length / 2, i = 0, o = n - 1;
- i < n;
- o = i++
- ) {
- var s = this.points[2 * i],
- a = this.points[2 * i + 1],
- u = this.points[2 * o],
- c = this.points[2 * o + 1];
- a > e != c > e && t < ((e - a) / (c - a)) * (u - s) + s && (r = !r);
- }
- return r;
- }),
- (t.prototype.toString = function () {
- return (
- '[@pixi/math:PolygoncloseStroke=' +
- this.closeStroke +
- 'points=' +
- this.points.reduce(function (t, e) {
- return t + ', ' + e;
- }, '') +
- ']'
- );
- }),
- t
- );
- })(),
- wD = (function () {
- function t(t, e, r, n, i) {
- void 0 === t && (t = 0),
- void 0 === e && (e = 0),
- void 0 === r && (r = 0),
- void 0 === n && (n = 0),
- void 0 === i && (i = 20),
- (this.x = t),
- (this.y = e),
- (this.width = r),
- (this.height = n),
- (this.radius = i),
- (this.type = vD.RREC);
- }
- return (
- (t.prototype.clone = function () {
- return new t(this.x, this.y, this.width, this.height, this.radius);
- }),
- (t.prototype.contains = function (t, e) {
- if (this.width <= 0 || this.height <= 0) return !1;
- if (
- t >= this.x &&
- t <= this.x + this.width &&
- e >= this.y &&
- e <= this.y + this.height
- ) {
- var r = Math.max(
- 0,
- Math.min(this.radius, Math.min(this.width, this.height) / 2)
- );
- if (
- (e >= this.y + r && e <= this.y + this.height - r) ||
- (t >= this.x + r && t <= this.x + this.width - r)
- )
- return !0;
- var n = t - (this.x + r),
- i = e - (this.y + r),
- o = r * r;
- if (n * n + i * i <= o) return !0;
- if ((n = t - (this.x + this.width - r)) * n + i * i <= o) return !0;
- if (n * n + (i = e - (this.y + this.height - r)) * i <= o)
- return !0;
- if ((n = t - (this.x + r)) * n + i * i <= o) return !0;
- }
- return !1;
- }),
- (t.prototype.toString = function () {
- return (
- '[@pixi/math:RoundedRectangle x=' +
- this.x +
- ' y=' +
- this.y +
- 'width=' +
- this.width +
- ' height=' +
- this.height +
- ' radius=' +
- this.radius +
- ']'
- );
- }),
- t
- );
- })(),
- RD = (function () {
- function t(t, e, r, n) {
- void 0 === r && (r = 0),
- void 0 === n && (n = 0),
- (this._x = r),
- (this._y = n),
- (this.cb = t),
- (this.scope = e);
- }
- return (
- (t.prototype.clone = function (e, r) {
- return (
- void 0 === e && (e = this.cb),
- void 0 === r && (r = this.scope),
- new t(e, r, this._x, this._y)
- );
- }),
- (t.prototype.set = function (t, e) {
- return (
- void 0 === t && (t = 0),
- void 0 === e && (e = t),
- (this._x === t && this._y === e) ||
- ((this._x = t), (this._y = e), this.cb.call(this.scope)),
- this
- );
- }),
- (t.prototype.copyFrom = function (t) {
- return (
- (this._x === t.x && this._y === t.y) ||
- ((this._x = t.x), (this._y = t.y), this.cb.call(this.scope)),
- this
- );
- }),
- (t.prototype.copyTo = function (t) {
- return t.set(this._x, this._y), t;
- }),
- (t.prototype.equals = function (t) {
- return t.x === this._x && t.y === this._y;
- }),
- (t.prototype.toString = function () {
- return (
- '[@pixi/math:ObservablePoint x=0 y=0 scope=' + this.scope + ']'
- );
- }),
- Object.defineProperty(t.prototype, 'x', {
- get: function () {
- return this._x;
- },
- set: function (t) {
- this._x !== t && ((this._x = t), this.cb.call(this.scope));
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'y', {
- get: function () {
- return this._y;
- },
- set: function (t) {
- this._y !== t && ((this._y = t), this.cb.call(this.scope));
- },
- enumerable: !1,
- configurable: !0,
- }),
- t
- );
- })(),
- CD = (function () {
- function t(t, e, r, n, i, o) {
- void 0 === t && (t = 1),
- void 0 === e && (e = 0),
- void 0 === r && (r = 0),
- void 0 === n && (n = 1),
- void 0 === i && (i = 0),
- void 0 === o && (o = 0),
- (this.array = null),
- (this.a = t),
- (this.b = e),
- (this.c = r),
- (this.d = n),
- (this.tx = i),
- (this.ty = o);
- }
- return (
- (t.prototype.fromArray = function (t) {
- (this.a = t[0]),
- (this.b = t[1]),
- (this.c = t[3]),
- (this.d = t[4]),
- (this.tx = t[2]),
- (this.ty = t[5]);
- }),
- (t.prototype.set = function (t, e, r, n, i, o) {
- return (
- (this.a = t),
- (this.b = e),
- (this.c = r),
- (this.d = n),
- (this.tx = i),
- (this.ty = o),
- this
- );
- }),
- (t.prototype.toArray = function (t, e) {
- this.array || (this.array = new Float32Array(9));
- var r = e || this.array;
- return (
- t
- ? ((r[0] = this.a),
- (r[1] = this.b),
- (r[2] = 0),
- (r[3] = this.c),
- (r[4] = this.d),
- (r[5] = 0),
- (r[6] = this.tx),
- (r[7] = this.ty),
- (r[8] = 1))
- : ((r[0] = this.a),
- (r[1] = this.c),
- (r[2] = this.tx),
- (r[3] = this.b),
- (r[4] = this.d),
- (r[5] = this.ty),
- (r[6] = 0),
- (r[7] = 0),
- (r[8] = 1)),
- r
- );
- }),
- (t.prototype.apply = function (t, e) {
- e = e || new _D();
- var r = t.x,
- n = t.y;
- return (
- (e.x = this.a * r + this.c * n + this.tx),
- (e.y = this.b * r + this.d * n + this.ty),
- e
- );
- }),
- (t.prototype.applyInverse = function (t, e) {
- e = e || new _D();
- var r = 1 / (this.a * this.d + this.c * -this.b),
- n = t.x,
- i = t.y;
- return (
- (e.x =
- this.d * r * n +
- -this.c * r * i +
- (this.ty * this.c - this.tx * this.d) * r),
- (e.y =
- this.a * r * i +
- -this.b * r * n +
- (-this.ty * this.a + this.tx * this.b) * r),
- e
- );
- }),
- (t.prototype.translate = function (t, e) {
- return (this.tx += t), (this.ty += e), this;
- }),
- (t.prototype.scale = function (t, e) {
- return (
- (this.a *= t),
- (this.d *= e),
- (this.c *= t),
- (this.b *= e),
- (this.tx *= t),
- (this.ty *= e),
- this
- );
- }),
- (t.prototype.rotate = function (t) {
- var e = Math.cos(t),
- r = Math.sin(t),
- n = this.a,
- i = this.c,
- o = this.tx;
- return (
- (this.a = n * e - this.b * r),
- (this.b = n * r + this.b * e),
- (this.c = i * e - this.d * r),
- (this.d = i * r + this.d * e),
- (this.tx = o * e - this.ty * r),
- (this.ty = o * r + this.ty * e),
- this
- );
- }),
- (t.prototype.append = function (t) {
- var e = this.a,
- r = this.b,
- n = this.c,
- i = this.d;
- return (
- (this.a = t.a * e + t.b * n),
- (this.b = t.a * r + t.b * i),
- (this.c = t.c * e + t.d * n),
- (this.d = t.c * r + t.d * i),
- (this.tx = t.tx * e + t.ty * n + this.tx),
- (this.ty = t.tx * r + t.ty * i + this.ty),
- this
- );
- }),
- (t.prototype.setTransform = function (t, e, r, n, i, o, s, a, u) {
- return (
- (this.a = Math.cos(s + u) * i),
- (this.b = Math.sin(s + u) * i),
- (this.c = -Math.sin(s - a) * o),
- (this.d = Math.cos(s - a) * o),
- (this.tx = t - (r * this.a + n * this.c)),
- (this.ty = e - (r * this.b + n * this.d)),
- this
- );
- }),
- (t.prototype.prepend = function (t) {
- var e = this.tx;
- if (1 !== t.a || 0 !== t.b || 0 !== t.c || 1 !== t.d) {
- var r = this.a,
- n = this.c;
- (this.a = r * t.a + this.b * t.c),
- (this.b = r * t.b + this.b * t.d),
- (this.c = n * t.a + this.d * t.c),
- (this.d = n * t.b + this.d * t.d);
- }
- return (
- (this.tx = e * t.a + this.ty * t.c + t.tx),
- (this.ty = e * t.b + this.ty * t.d + t.ty),
- this
- );
- }),
- (t.prototype.decompose = function (t) {
- var e = this.a,
- r = this.b,
- n = this.c,
- i = this.d,
- o = t.pivot,
- s = -Math.atan2(-n, i),
- a = Math.atan2(r, e),
- u = Math.abs(s + a);
- return (
- u < 1e-5 || Math.abs(mD - u) < 1e-5
- ? ((t.rotation = a), (t.skew.x = t.skew.y = 0))
- : ((t.rotation = 0), (t.skew.x = s), (t.skew.y = a)),
- (t.scale.x = Math.sqrt(e * e + r * r)),
- (t.scale.y = Math.sqrt(n * n + i * i)),
- (t.position.x = this.tx + (o.x * e + o.y * n)),
- (t.position.y = this.ty + (o.x * r + o.y * i)),
- t
- );
- }),
- (t.prototype.invert = function () {
- var t = this.a,
- e = this.b,
- r = this.c,
- n = this.d,
- i = this.tx,
- o = t * n - e * r;
- return (
- (this.a = n / o),
- (this.b = -e / o),
- (this.c = -r / o),
- (this.d = t / o),
- (this.tx = (r * this.ty - n * i) / o),
- (this.ty = -(t * this.ty - e * i) / o),
- this
- );
- }),
- (t.prototype.identity = function () {
- return (
- (this.a = 1),
- (this.b = 0),
- (this.c = 0),
- (this.d = 1),
- (this.tx = 0),
- (this.ty = 0),
- this
- );
- }),
- (t.prototype.clone = function () {
- var e = new t();
- return (
- (e.a = this.a),
- (e.b = this.b),
- (e.c = this.c),
- (e.d = this.d),
- (e.tx = this.tx),
- (e.ty = this.ty),
- e
- );
- }),
- (t.prototype.copyTo = function (t) {
- return (
- (t.a = this.a),
- (t.b = this.b),
- (t.c = this.c),
- (t.d = this.d),
- (t.tx = this.tx),
- (t.ty = this.ty),
- t
- );
- }),
- (t.prototype.copyFrom = function (t) {
- return (
- (this.a = t.a),
- (this.b = t.b),
- (this.c = t.c),
- (this.d = t.d),
- (this.tx = t.tx),
- (this.ty = t.ty),
- this
- );
- }),
- (t.prototype.toString = function () {
- return (
- '[@pixi/math:Matrix a=' +
- this.a +
- ' b=' +
- this.b +
- ' c=' +
- this.c +
- ' d=' +
- this.d +
- ' tx=' +
- this.tx +
- ' ty=' +
- this.ty +
- ']'
- );
- }),
- Object.defineProperty(t, 'IDENTITY', {
- get: function () {
- return new t();
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t, 'TEMP_MATRIX', {
- get: function () {
- return new t();
- },
- enumerable: !1,
- configurable: !0,
- }),
- t
- );
- })(),
- PD = [1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1, 0, 1],
- AD = [0, 1, 1, 1, 0, -1, -1, -1, 0, 1, 1, 1, 0, -1, -1, -1],
- OD = [0, -1, -1, -1, 0, 1, 1, 1, 0, 1, 1, 1, 0, -1, -1, -1],
- ID = [1, 1, 0, -1, -1, -1, 0, 1, -1, -1, 0, 1, 1, 1, 0, -1],
- MD = [],
- DD = [],
- LD = Math.sign;
- !(function () {
- for (var t = 0; t < 16; t++) {
- var e = [];
- MD.push(e);
- for (var r = 0; r < 16; r++)
- for (
- var n = LD(PD[t] * PD[r] + OD[t] * AD[r]),
- i = LD(AD[t] * PD[r] + ID[t] * AD[r]),
- o = LD(PD[t] * OD[r] + OD[t] * ID[r]),
- s = LD(AD[t] * OD[r] + ID[t] * ID[r]),
- a = 0;
- a < 16;
- a++
- )
- if (PD[a] === n && AD[a] === i && OD[a] === o && ID[a] === s) {
- e.push(a);
- break;
- }
- }
- for (t = 0; t < 16; t++) {
- var u = new CD();
- u.set(PD[t], AD[t], OD[t], ID[t], 0, 0), DD.push(u);
- }
- })();
- var FD = {
- E: 0,
- SE: 1,
- S: 2,
- SW: 3,
- W: 4,
- NW: 5,
- N: 6,
- NE: 7,
- MIRROR_VERTICAL: 8,
- MAIN_DIAGONAL: 10,
- MIRROR_HORIZONTAL: 12,
- REVERSE_DIAGONAL: 14,
- uX: function (t) {
- return PD[t];
- },
- uY: function (t) {
- return AD[t];
- },
- vX: function (t) {
- return OD[t];
- },
- vY: function (t) {
- return ID[t];
- },
- inv: function (t) {
- return 8 & t ? 15 & t : 7 & -t;
- },
- add: function (t, e) {
- return MD[t][e];
- },
- sub: function (t, e) {
- return MD[t][FD.inv(e)];
- },
- rotate180: function (t) {
- return 4 ^ t;
- },
- isVertical: function (t) {
- return 2 == (3 & t);
- },
- byDirection: function (t, e) {
- return 2 * Math.abs(t) <= Math.abs(e)
- ? e >= 0
- ? FD.S
- : FD.N
- : 2 * Math.abs(e) <= Math.abs(t)
- ? t > 0
- ? FD.E
- : FD.W
- : e > 0
- ? t > 0
- ? FD.SE
- : FD.SW
- : t > 0
- ? FD.NE
- : FD.NW;
- },
- matrixAppendRotationInv: function (t, e, r, n) {
- void 0 === r && (r = 0), void 0 === n && (n = 0);
- var i = DD[FD.inv(e)];
- (i.tx = r), (i.ty = n), t.append(i);
- },
- },
- ND = (function () {
- function t() {
- (this.worldTransform = new CD()),
- (this.localTransform = new CD()),
- (this.position = new RD(this.onChange, this, 0, 0)),
- (this.scale = new RD(this.onChange, this, 1, 1)),
- (this.pivot = new RD(this.onChange, this, 0, 0)),
- (this.skew = new RD(this.updateSkew, this, 0, 0)),
- (this._rotation = 0),
- (this._cx = 1),
- (this._sx = 0),
- (this._cy = 0),
- (this._sy = 1),
- (this._localID = 0),
- (this._currentLocalID = 0),
- (this._worldID = 0),
- (this._parentID = 0);
- }
- return (
- (t.prototype.onChange = function () {
- this._localID++;
- }),
- (t.prototype.updateSkew = function () {
- (this._cx = Math.cos(this._rotation + this.skew.y)),
- (this._sx = Math.sin(this._rotation + this.skew.y)),
- (this._cy = -Math.sin(this._rotation - this.skew.x)),
- (this._sy = Math.cos(this._rotation - this.skew.x)),
- this._localID++;
- }),
- (t.prototype.toString = function () {
- return (
- '[@pixi/math:Transform position=(' +
- this.position.x +
- ', ' +
- this.position.y +
- ') rotation=' +
- this.rotation +
- ' scale=(' +
- this.scale.x +
- ', ' +
- this.scale.y +
- ') skew=(' +
- this.skew.x +
- ', ' +
- this.skew.y +
- ') ]'
- );
- }),
- (t.prototype.updateLocalTransform = function () {
- var t = this.localTransform;
- this._localID !== this._currentLocalID &&
- ((t.a = this._cx * this.scale.x),
- (t.b = this._sx * this.scale.x),
- (t.c = this._cy * this.scale.y),
- (t.d = this._sy * this.scale.y),
- (t.tx =
- this.position.x - (this.pivot.x * t.a + this.pivot.y * t.c)),
- (t.ty =
- this.position.y - (this.pivot.x * t.b + this.pivot.y * t.d)),
- (this._currentLocalID = this._localID),
- (this._parentID = -1));
- }),
- (t.prototype.updateTransform = function (t) {
- var e = this.localTransform;
- if (
- (this._localID !== this._currentLocalID &&
- ((e.a = this._cx * this.scale.x),
- (e.b = this._sx * this.scale.x),
- (e.c = this._cy * this.scale.y),
- (e.d = this._sy * this.scale.y),
- (e.tx =
- this.position.x - (this.pivot.x * e.a + this.pivot.y * e.c)),
- (e.ty =
- this.position.y - (this.pivot.x * e.b + this.pivot.y * e.d)),
- (this._currentLocalID = this._localID),
- (this._parentID = -1)),
- this._parentID !== t._worldID)
- ) {
- var r = t.worldTransform,
- n = this.worldTransform;
- (n.a = e.a * r.a + e.b * r.c),
- (n.b = e.a * r.b + e.b * r.d),
- (n.c = e.c * r.a + e.d * r.c),
- (n.d = e.c * r.b + e.d * r.d),
- (n.tx = e.tx * r.a + e.ty * r.c + r.tx),
- (n.ty = e.tx * r.b + e.ty * r.d + r.ty),
- (this._parentID = t._worldID),
- this._worldID++;
- }
- }),
- (t.prototype.setFromMatrix = function (t) {
- t.decompose(this), this._localID++;
- }),
- Object.defineProperty(t.prototype, 'rotation', {
- get: function () {
- return this._rotation;
- },
- set: function (t) {
- this._rotation !== t && ((this._rotation = t), this.updateSkew());
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.IDENTITY = new t()),
- t
- );
- })();
- vA.SORTABLE_CHILDREN = !1;
- var kD = (function () {
- function t() {
- (this.minX = 1 / 0),
- (this.minY = 1 / 0),
- (this.maxX = -1 / 0),
- (this.maxY = -1 / 0),
- (this.rect = null),
- (this.updateID = -1);
- }
- return (
- (t.prototype.isEmpty = function () {
- return this.minX > this.maxX || this.minY > this.maxY;
- }),
- (t.prototype.clear = function () {
- (this.minX = 1 / 0),
- (this.minY = 1 / 0),
- (this.maxX = -1 / 0),
- (this.maxY = -1 / 0);
- }),
- (t.prototype.getRectangle = function (t) {
- return this.minX > this.maxX || this.minY > this.maxY
- ? TD.EMPTY
- : (((t = t || new TD(0, 0, 1, 1)).x = this.minX),
- (t.y = this.minY),
- (t.width = this.maxX - this.minX),
- (t.height = this.maxY - this.minY),
- t);
- }),
- (t.prototype.addPoint = function (t) {
- (this.minX = Math.min(this.minX, t.x)),
- (this.maxX = Math.max(this.maxX, t.x)),
- (this.minY = Math.min(this.minY, t.y)),
- (this.maxY = Math.max(this.maxY, t.y));
- }),
- (t.prototype.addPointMatrix = function (t, e) {
- var r = t.a,
- n = t.b,
- i = t.c,
- o = t.d,
- s = t.tx,
- a = t.ty,
- u = r * e.x + i * e.y + s,
- c = n * e.x + o * e.y + a;
- (this.minX = Math.min(this.minX, u)),
- (this.maxX = Math.max(this.maxX, u)),
- (this.minY = Math.min(this.minY, c)),
- (this.maxY = Math.max(this.maxY, c));
- }),
- (t.prototype.addQuad = function (t) {
- var e = this.minX,
- r = this.minY,
- n = this.maxX,
- i = this.maxY,
- o = t[0],
- s = t[1];
- (e = o < e ? o : e),
- (r = s < r ? s : r),
- (n = o > n ? o : n),
- (i = s > i ? s : i),
- (e = (o = t[2]) < e ? o : e),
- (r = (s = t[3]) < r ? s : r),
- (n = o > n ? o : n),
- (i = s > i ? s : i),
- (e = (o = t[4]) < e ? o : e),
- (r = (s = t[5]) < r ? s : r),
- (n = o > n ? o : n),
- (i = s > i ? s : i),
- (e = (o = t[6]) < e ? o : e),
- (r = (s = t[7]) < r ? s : r),
- (n = o > n ? o : n),
- (i = s > i ? s : i),
- (this.minX = e),
- (this.minY = r),
- (this.maxX = n),
- (this.maxY = i);
- }),
- (t.prototype.addFrame = function (t, e, r, n, i) {
- this.addFrameMatrix(t.worldTransform, e, r, n, i);
- }),
- (t.prototype.addFrameMatrix = function (t, e, r, n, i) {
- var o = t.a,
- s = t.b,
- a = t.c,
- u = t.d,
- c = t.tx,
- h = t.ty,
- l = this.minX,
- d = this.minY,
- f = this.maxX,
- p = this.maxY,
- v = o * e + a * r + c,
- m = s * e + u * r + h;
- (l = v < l ? v : l),
- (d = m < d ? m : d),
- (f = v > f ? v : f),
- (p = m > p ? m : p),
- (l = (v = o * n + a * r + c) < l ? v : l),
- (d = (m = s * n + u * r + h) < d ? m : d),
- (f = v > f ? v : f),
- (p = m > p ? m : p),
- (l = (v = o * e + a * i + c) < l ? v : l),
- (d = (m = s * e + u * i + h) < d ? m : d),
- (f = v > f ? v : f),
- (p = m > p ? m : p),
- (l = (v = o * n + a * i + c) < l ? v : l),
- (d = (m = s * n + u * i + h) < d ? m : d),
- (f = v > f ? v : f),
- (p = m > p ? m : p),
- (this.minX = l),
- (this.minY = d),
- (this.maxX = f),
- (this.maxY = p);
- }),
- (t.prototype.addVertexData = function (t, e, r) {
- for (
- var n = this.minX,
- i = this.minY,
- o = this.maxX,
- s = this.maxY,
- a = e;
- a < r;
- a += 2
- ) {
- var u = t[a],
- c = t[a + 1];
- (n = u < n ? u : n),
- (i = c < i ? c : i),
- (o = u > o ? u : o),
- (s = c > s ? c : s);
- }
- (this.minX = n), (this.minY = i), (this.maxX = o), (this.maxY = s);
- }),
- (t.prototype.addVertices = function (t, e, r, n) {
- this.addVerticesMatrix(t.worldTransform, e, r, n);
- }),
- (t.prototype.addVerticesMatrix = function (t, e, r, n, i, o) {
- void 0 === i && (i = 0), void 0 === o && (o = i);
- for (
- var s = t.a,
- a = t.b,
- u = t.c,
- c = t.d,
- h = t.tx,
- l = t.ty,
- d = this.minX,
- f = this.minY,
- p = this.maxX,
- v = this.maxY,
- m = r;
- m < n;
- m += 2
- ) {
- var y = e[m],
- g = e[m + 1],
- _ = s * y + u * g + h,
- b = c * g + a * y + l;
- (d = Math.min(d, _ - i)),
- (p = Math.max(p, _ + i)),
- (f = Math.min(f, b - o)),
- (v = Math.max(v, b + o));
- }
- (this.minX = d), (this.minY = f), (this.maxX = p), (this.maxY = v);
- }),
- (t.prototype.addBounds = function (t) {
- var e = this.minX,
- r = this.minY,
- n = this.maxX,
- i = this.maxY;
- (this.minX = t.minX < e ? t.minX : e),
- (this.minY = t.minY < r ? t.minY : r),
- (this.maxX = t.maxX > n ? t.maxX : n),
- (this.maxY = t.maxY > i ? t.maxY : i);
- }),
- (t.prototype.addBoundsMask = function (t, e) {
- var r = t.minX > e.minX ? t.minX : e.minX,
- n = t.minY > e.minY ? t.minY : e.minY,
- i = t.maxX < e.maxX ? t.maxX : e.maxX,
- o = t.maxY < e.maxY ? t.maxY : e.maxY;
- if (r <= i && n <= o) {
- var s = this.minX,
- a = this.minY,
- u = this.maxX,
- c = this.maxY;
- (this.minX = r < s ? r : s),
- (this.minY = n < a ? n : a),
- (this.maxX = i > u ? i : u),
- (this.maxY = o > c ? o : c);
- }
- }),
- (t.prototype.addBoundsMatrix = function (t, e) {
- this.addFrameMatrix(e, t.minX, t.minY, t.maxX, t.maxY);
- }),
- (t.prototype.addBoundsArea = function (t, e) {
- var r = t.minX > e.x ? t.minX : e.x,
- n = t.minY > e.y ? t.minY : e.y,
- i = t.maxX < e.x + e.width ? t.maxX : e.x + e.width,
- o = t.maxY < e.y + e.height ? t.maxY : e.y + e.height;
- if (r <= i && n <= o) {
- var s = this.minX,
- a = this.minY,
- u = this.maxX,
- c = this.maxY;
- (this.minX = r < s ? r : s),
- (this.minY = n < a ? n : a),
- (this.maxX = i > u ? i : u),
- (this.maxY = o > c ? o : c);
- }
- }),
- (t.prototype.pad = function (t, e) {
- void 0 === t && (t = 0),
- void 0 === e && (e = t),
- this.isEmpty() ||
- ((this.minX -= t),
- (this.maxX += t),
- (this.minY -= e),
- (this.maxY += e));
- }),
- (t.prototype.addFramePad = function (t, e, r, n, i, o) {
- (t -= i),
- (e -= o),
- (r += i),
- (n += o),
- (this.minX = this.minX < t ? this.minX : t),
- (this.maxX = this.maxX > r ? this.maxX : r),
- (this.minY = this.minY < e ? this.minY : e),
- (this.maxY = this.maxY > n ? this.maxY : n);
- }),
- t
- );
- })(),
- BD = function (t, e) {
- return (
- (BD =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- BD(t, e)
- );
- };
- function GD(t, e) {
- function r() {
- this.constructor = t;
- }
- BD(t, e),
- (t.prototype =
- null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
- }
- var UD = (function (t) {
- function e() {
- var e = t.call(this) || this;
- return (
- (e.tempDisplayObjectParent = null),
- (e.transform = new ND()),
- (e.alpha = 1),
- (e.visible = !0),
- (e.renderable = !0),
- (e.cullable = !1),
- (e.cullArea = null),
- (e.parent = null),
- (e.worldAlpha = 1),
- (e._lastSortedIndex = 0),
- (e._zIndex = 0),
- (e.filterArea = null),
- (e.filters = null),
- (e._enabledFilters = null),
- (e._bounds = new kD()),
- (e._localBounds = null),
- (e._boundsID = 0),
- (e._boundsRect = null),
- (e._localBoundsRect = null),
- (e._mask = null),
- (e._maskRefCount = 0),
- (e._destroyed = !1),
- (e.isSprite = !1),
- (e.isMask = !1),
- e
- );
- }
- return (
- GD(e, t),
- (e.mixin = function (t) {
- for (var r = Object.keys(t), n = 0; n < r.length; ++n) {
- var i = r[n];
- Object.defineProperty(
- e.prototype,
- i,
- Object.getOwnPropertyDescriptor(t, i)
- );
- }
- }),
- Object.defineProperty(e.prototype, 'destroyed', {
- get: function () {
- return this._destroyed;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype._recursivePostUpdateTransform = function () {
- this.parent
- ? (this.parent._recursivePostUpdateTransform(),
- this.transform.updateTransform(this.parent.transform))
- : this.transform.updateTransform(
- this._tempDisplayObjectParent.transform
- );
- }),
- (e.prototype.updateTransform = function () {
- this._boundsID++,
- this.transform.updateTransform(this.parent.transform),
- (this.worldAlpha = this.alpha * this.parent.worldAlpha);
- }),
- (e.prototype.getBounds = function (t, e) {
- return (
- t ||
- (this.parent
- ? (this._recursivePostUpdateTransform(), this.updateTransform())
- : ((this.parent = this._tempDisplayObjectParent),
- this.updateTransform(),
- (this.parent = null))),
- this._bounds.updateID !== this._boundsID &&
- (this.calculateBounds(),
- (this._bounds.updateID = this._boundsID)),
- e ||
- (this._boundsRect || (this._boundsRect = new TD()),
- (e = this._boundsRect)),
- this._bounds.getRectangle(e)
- );
- }),
- (e.prototype.getLocalBounds = function (t) {
- t ||
- (this._localBoundsRect || (this._localBoundsRect = new TD()),
- (t = this._localBoundsRect)),
- this._localBounds || (this._localBounds = new kD());
- var e = this.transform,
- r = this.parent;
- (this.parent = null),
- (this.transform = this._tempDisplayObjectParent.transform);
- var n = this._bounds,
- i = this._boundsID;
- this._bounds = this._localBounds;
- var o = this.getBounds(!1, t);
- return (
- (this.parent = r),
- (this.transform = e),
- (this._bounds = n),
- (this._bounds.updateID += this._boundsID - i),
- o
- );
- }),
- (e.prototype.toGlobal = function (t, e, r) {
- return (
- void 0 === r && (r = !1),
- r ||
- (this._recursivePostUpdateTransform(),
- this.parent
- ? this.displayObjectUpdateTransform()
- : ((this.parent = this._tempDisplayObjectParent),
- this.displayObjectUpdateTransform(),
- (this.parent = null))),
- this.worldTransform.apply(t, e)
- );
- }),
- (e.prototype.toLocal = function (t, e, r, n) {
- return (
- e && (t = e.toGlobal(t, r, n)),
- n ||
- (this._recursivePostUpdateTransform(),
- this.parent
- ? this.displayObjectUpdateTransform()
- : ((this.parent = this._tempDisplayObjectParent),
- this.displayObjectUpdateTransform(),
- (this.parent = null))),
- this.worldTransform.applyInverse(t, r)
- );
- }),
- (e.prototype.setParent = function (t) {
- if (!t || !t.addChild)
- throw new Error('setParent: Argument must be a Container');
- return t.addChild(this), t;
- }),
- (e.prototype.setTransform = function (t, e, r, n, i, o, s, a, u) {
- return (
- void 0 === t && (t = 0),
- void 0 === e && (e = 0),
- void 0 === r && (r = 1),
- void 0 === n && (n = 1),
- void 0 === i && (i = 0),
- void 0 === o && (o = 0),
- void 0 === s && (s = 0),
- void 0 === a && (a = 0),
- void 0 === u && (u = 0),
- (this.position.x = t),
- (this.position.y = e),
- (this.scale.x = r || 1),
- (this.scale.y = n || 1),
- (this.rotation = i),
- (this.skew.x = o),
- (this.skew.y = s),
- (this.pivot.x = a),
- (this.pivot.y = u),
- this
- );
- }),
- (e.prototype.destroy = function (t) {
- this.parent && this.parent.removeChild(this),
- (this._destroyed = !0),
- (this.transform = null),
- (this.parent = null),
- (this._bounds = null),
- (this.mask = null),
- (this.cullArea = null),
- (this.filters = null),
- (this.filterArea = null),
- (this.hitArea = null),
- (this.interactive = !1),
- (this.interactiveChildren = !1),
- this.emit('destroyed'),
- this.removeAllListeners();
- }),
- Object.defineProperty(e.prototype, '_tempDisplayObjectParent', {
- get: function () {
- return (
- null === this.tempDisplayObjectParent &&
- (this.tempDisplayObjectParent = new jD()),
- this.tempDisplayObjectParent
- );
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype.enableTempParent = function () {
- var t = this.parent;
- return (this.parent = this._tempDisplayObjectParent), t;
- }),
- (e.prototype.disableTempParent = function (t) {
- this.parent = t;
- }),
- Object.defineProperty(e.prototype, 'x', {
- get: function () {
- return this.position.x;
- },
- set: function (t) {
- this.transform.position.x = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'y', {
- get: function () {
- return this.position.y;
- },
- set: function (t) {
- this.transform.position.y = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'worldTransform', {
- get: function () {
- return this.transform.worldTransform;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'localTransform', {
- get: function () {
- return this.transform.localTransform;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'position', {
- get: function () {
- return this.transform.position;
- },
- set: function (t) {
- this.transform.position.copyFrom(t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'scale', {
- get: function () {
- return this.transform.scale;
- },
- set: function (t) {
- this.transform.scale.copyFrom(t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'pivot', {
- get: function () {
- return this.transform.pivot;
- },
- set: function (t) {
- this.transform.pivot.copyFrom(t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'skew', {
- get: function () {
- return this.transform.skew;
- },
- set: function (t) {
- this.transform.skew.copyFrom(t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'rotation', {
- get: function () {
- return this.transform.rotation;
- },
- set: function (t) {
- this.transform.rotation = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'angle', {
- get: function () {
- return this.transform.rotation * yD;
- },
- set: function (t) {
- this.transform.rotation = t * gD;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'zIndex', {
- get: function () {
- return this._zIndex;
- },
- set: function (t) {
- (this._zIndex = t), this.parent && (this.parent.sortDirty = !0);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'worldVisible', {
- get: function () {
- var t = this;
- do {
- if (!t.visible) return !1;
- t = t.parent;
- } while (t);
- return !0;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'mask', {
- get: function () {
- return this._mask;
- },
- set: function (t) {
- if (this._mask !== t) {
- var e;
- if (this._mask)
- (e = this._mask.isMaskData
- ? this._mask.maskObject
- : this._mask) &&
- (e._maskRefCount--,
- 0 === e._maskRefCount &&
- ((e.renderable = !0), (e.isMask = !1)));
- if (((this._mask = t), this._mask))
- (e = this._mask.isMaskData
- ? this._mask.maskObject
- : this._mask) &&
- (0 === e._maskRefCount &&
- ((e.renderable = !1), (e.isMask = !0)),
- e._maskRefCount++);
- }
- },
- enumerable: !1,
- configurable: !0,
- }),
- e
- );
- })(yA),
- jD = (function (t) {
- function e() {
- var e = (null !== t && t.apply(this, arguments)) || this;
- return (e.sortDirty = null), e;
- }
- return GD(e, t), e;
- })(UD);
- function XD(t, e) {
- return t.zIndex === e.zIndex
- ? t._lastSortedIndex - e._lastSortedIndex
- : t.zIndex - e.zIndex;
- }
- UD.prototype.displayObjectUpdateTransform = UD.prototype.updateTransform;
- var VD = (function (t) {
- function e() {
- var e = t.call(this) || this;
- return (
- (e.children = []),
- (e.sortableChildren = vA.SORTABLE_CHILDREN),
- (e.sortDirty = !1),
- e
- );
- }
- return (
- GD(e, t),
- (e.prototype.onChildrenChange = function (t) {}),
- (e.prototype.addChild = function () {
- for (var t = arguments, e = [], r = 0; r < arguments.length; r++)
- e[r] = t[r];
- if (e.length > 1)
- for (var n = 0; n < e.length; n++) this.addChild(e[n]);
- else {
- var i = e[0];
- i.parent && i.parent.removeChild(i),
- (i.parent = this),
- (this.sortDirty = !0),
- (i.transform._parentID = -1),
- this.children.push(i),
- this._boundsID++,
- this.onChildrenChange(this.children.length - 1),
- this.emit('childAdded', i, this, this.children.length - 1),
- i.emit('added', this);
- }
- return e[0];
- }),
- (e.prototype.addChildAt = function (t, e) {
- if (e < 0 || e > this.children.length)
- throw new Error(
- t +
- 'addChildAt: The index ' +
- e +
- ' supplied is out of bounds ' +
- this.children.length
- );
- return (
- t.parent && t.parent.removeChild(t),
- (t.parent = this),
- (this.sortDirty = !0),
- (t.transform._parentID = -1),
- this.children.splice(e, 0, t),
- this._boundsID++,
- this.onChildrenChange(e),
- t.emit('added', this),
- this.emit('childAdded', t, this, e),
- t
- );
- }),
- (e.prototype.swapChildren = function (t, e) {
- if (t !== e) {
- var r = this.getChildIndex(t),
- n = this.getChildIndex(e);
- (this.children[r] = e),
- (this.children[n] = t),
- this.onChildrenChange(r < n ? r : n);
- }
- }),
- (e.prototype.getChildIndex = function (t) {
- var e = this.children.indexOf(t);
- if (-1 === e)
- throw new Error(
- 'The supplied DisplayObject must be a child of the caller'
- );
- return e;
- }),
- (e.prototype.setChildIndex = function (t, e) {
- if (e < 0 || e >= this.children.length)
- throw new Error(
- 'The index ' +
- e +
- ' supplied is out of bounds ' +
- this.children.length
- );
- var r = this.getChildIndex(t);
- rD(this.children, r, 1),
- this.children.splice(e, 0, t),
- this.onChildrenChange(e);
- }),
- (e.prototype.getChildAt = function (t) {
- if (t < 0 || t >= this.children.length)
- throw new Error('getChildAt: Index (' + t + ') does not exist.');
- return this.children[t];
- }),
- (e.prototype.removeChild = function () {
- for (var t = arguments, e = [], r = 0; r < arguments.length; r++)
- e[r] = t[r];
- if (e.length > 1)
- for (var n = 0; n < e.length; n++) this.removeChild(e[n]);
- else {
- var i = e[0],
- o = this.children.indexOf(i);
- if (-1 === o) return null;
- (i.parent = null),
- (i.transform._parentID = -1),
- rD(this.children, o, 1),
- this._boundsID++,
- this.onChildrenChange(o),
- i.emit('removed', this),
- this.emit('childRemoved', i, this, o);
- }
- return e[0];
- }),
- (e.prototype.removeChildAt = function (t) {
- var e = this.getChildAt(t);
- return (
- (e.parent = null),
- (e.transform._parentID = -1),
- rD(this.children, t, 1),
- this._boundsID++,
- this.onChildrenChange(t),
- e.emit('removed', this),
- this.emit('childRemoved', e, this, t),
- e
- );
- }),
- (e.prototype.removeChildren = function (t, e) {
- void 0 === t && (t = 0), void 0 === e && (e = this.children.length);
- var r,
- n = t,
- i = e - n;
- if (i > 0 && i <= e) {
- r = this.children.splice(n, i);
- for (var o = 0; o < r.length; ++o)
- (r[o].parent = null),
- r[o].transform && (r[o].transform._parentID = -1);
- this._boundsID++, this.onChildrenChange(t);
- for (o = 0; o < r.length; ++o)
- r[o].emit('removed', this),
- this.emit('childRemoved', r[o], this, o);
- return r;
- }
- if (0 === i && 0 === this.children.length) return [];
- throw new RangeError(
- 'removeChildren: numeric values are outside the acceptable range.'
- );
- }),
- (e.prototype.sortChildren = function () {
- for (var t = !1, e = 0, r = this.children.length; e < r; ++e) {
- var n = this.children[e];
- (n._lastSortedIndex = e), t || 0 === n.zIndex || (t = !0);
- }
- t && this.children.length > 1 && this.children.sort(XD),
- (this.sortDirty = !1);
- }),
- (e.prototype.updateTransform = function () {
- this.sortableChildren && this.sortDirty && this.sortChildren(),
- this._boundsID++,
- this.transform.updateTransform(this.parent.transform),
- (this.worldAlpha = this.alpha * this.parent.worldAlpha);
- for (var t = 0, e = this.children.length; t < e; ++t) {
- var r = this.children[t];
- r.visible && r.updateTransform();
- }
- }),
- (e.prototype.calculateBounds = function () {
- this._bounds.clear(), this._calculateBounds();
- for (var t = 0; t < this.children.length; t++) {
- var e = this.children[t];
- if (e.visible && e.renderable)
- if ((e.calculateBounds(), e._mask)) {
- var r = e._mask.isMaskData ? e._mask.maskObject : e._mask;
- r
- ? (r.calculateBounds(),
- this._bounds.addBoundsMask(e._bounds, r._bounds))
- : this._bounds.addBounds(e._bounds);
- } else
- e.filterArea
- ? this._bounds.addBoundsArea(e._bounds, e.filterArea)
- : this._bounds.addBounds(e._bounds);
- }
- this._bounds.updateID = this._boundsID;
- }),
- (e.prototype.getLocalBounds = function (e, r) {
- void 0 === r && (r = !1);
- var n = t.prototype.getLocalBounds.call(this, e);
- if (!r)
- for (var i = 0, o = this.children.length; i < o; ++i) {
- var s = this.children[i];
- s.visible && s.updateTransform();
- }
- return n;
- }),
- (e.prototype._calculateBounds = function () {}),
- (e.prototype._renderWithCulling = function (t) {
- var r = t.renderTexture.sourceFrame;
- if (r.width > 0 && r.height > 0) {
- var n, i;
- if (
- (this.cullArea
- ? ((n = this.cullArea), (i = this.worldTransform))
- : this._render !== e.prototype._render &&
- (n = this.getBounds(!0)),
- n && r.intersects(n, i))
- )
- this._render(t);
- else if (this.cullArea) return;
- for (var o = 0, s = this.children.length; o < s; ++o) {
- var a = this.children[o],
- u = a.cullable;
- (a.cullable = u || !this.cullArea), a.render(t), (a.cullable = u);
- }
- }
- }),
- (e.prototype.render = function (t) {
- if (this.visible && !(this.worldAlpha <= 0) && this.renderable)
- if (this._mask || (this.filters && this.filters.length))
- this.renderAdvanced(t);
- else if (this.cullable) this._renderWithCulling(t);
- else {
- this._render(t);
- for (var e = 0, r = this.children.length; e < r; ++e)
- this.children[e].render(t);
- }
- }),
- (e.prototype.renderAdvanced = function (t) {
- var e = this.filters,
- r = this._mask;
- if (e) {
- this._enabledFilters || (this._enabledFilters = []),
- (this._enabledFilters.length = 0);
- for (var n = 0; n < e.length; n++)
- e[n].enabled && this._enabledFilters.push(e[n]);
- }
- var i =
- (e && this._enabledFilters && this._enabledFilters.length) ||
- (r &&
- (!r.isMaskData ||
- (r.enabled && (r.autoDetect || r.type !== VP.NONE))));
- if (
- (i && t.batch.flush(),
- e &&
- this._enabledFilters &&
- this._enabledFilters.length &&
- t.filter.push(this, this._enabledFilters),
- r && t.mask.push(this, this._mask),
- this.cullable)
- )
- this._renderWithCulling(t);
- else {
- this._render(t);
- n = 0;
- for (var o = this.children.length; n < o; ++n)
- this.children[n].render(t);
- }
- i && t.batch.flush(),
- r && t.mask.pop(this),
- e &&
- this._enabledFilters &&
- this._enabledFilters.length &&
- t.filter.pop();
- }),
- (e.prototype._render = function (t) {}),
- (e.prototype.destroy = function (e) {
- t.prototype.destroy.call(this), (this.sortDirty = !1);
- var r = 'boolean' == typeof e ? e : e && e.children,
- n = this.removeChildren(0, this.children.length);
- if (r) for (var i = 0; i < n.length; ++i) n[i].destroy(e);
- }),
- Object.defineProperty(e.prototype, 'width', {
- get: function () {
- return this.scale.x * this.getLocalBounds().width;
- },
- set: function (t) {
- var e = this.getLocalBounds().width;
- (this.scale.x = 0 !== e ? t / e : 1), (this._width = t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'height', {
- get: function () {
- return this.scale.y * this.getLocalBounds().height;
- },
- set: function (t) {
- var e = this.getLocalBounds().height;
- (this.scale.y = 0 !== e ? t / e : 1), (this._height = t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- e
- );
- })(UD);
- VD.prototype.containerUpdateTransform = VD.prototype.updateTransform;
- var HD,
- WD = function () {
- return (
- (WD =
- Object.assign ||
- function (t) {
- for (var e, r = arguments, n = 1, i = arguments.length; n < i; n++)
- for (var o in (e = r[n]))
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
- return t;
- }),
- WD.apply(this, arguments)
- );
- };
- !(function (t) {
- (t.Application = 'application'),
- (t.RendererPlugin = 'renderer-webgl-plugin'),
- (t.CanvasRendererPlugin = 'renderer-canvas-plugin'),
- (t.Loader = 'loader'),
- (t.LoadParser = 'load-parser'),
- (t.ResolveParser = 'resolve-parser'),
- (t.CacheParser = 'cache-parser'),
- (t.DetectionParser = 'detection-parser');
- })(HD || (HD = {}));
- var YD,
- zD = function (t) {
- if ('function' == typeof t || ('object' == typeof t && t.extension)) {
- if (!t.extension)
- throw new Error('Extension class must have an extension object');
- var e =
- 'object' != typeof t.extension ? { type: t.extension } : t.extension;
- t = WD(WD({}, e), { ref: t });
- }
- if ('object' != typeof t) throw new Error('Invalid extension type');
- return 'string' == typeof (t = WD({}, t)).type && (t.type = [t.type]), t;
- },
- ZD = {
- _addHandlers: null,
- _removeHandlers: null,
- _queue: {},
- remove: function () {
- for (
- var t = arguments, e = this, r = [], n = 0;
- n < arguments.length;
- n++
- )
- r[n] = t[n];
- return (
- r.map(zD).forEach(function (t) {
- t.type.forEach(function (r) {
- var n, i;
- return null === (i = (n = e._removeHandlers)[r]) || void 0 === i
- ? void 0
- : i.call(n, t);
- });
- }),
- this
- );
- },
- add: function () {
- for (
- var t = arguments, e = this, r = [], n = 0;
- n < arguments.length;
- n++
- )
- r[n] = t[n];
- return (
- r.map(zD).forEach(function (t) {
- t.type.forEach(function (r) {
- var n = e._addHandlers,
- i = e._queue;
- n[r] ? n[r](t) : ((i[r] = i[r] || []), i[r].push(t));
- });
- }),
- this
- );
- },
- handle: function (t, e, r) {
- var n = (this._addHandlers = this._addHandlers || {}),
- i = (this._removeHandlers = this._removeHandlers || {});
- if (n[t] || i[t])
- throw new Error('Extension type ' + t + ' already has a handler');
- (n[t] = e), (i[t] = r);
- var o = this._queue;
- return (
- o[t] &&
- (o[t].forEach(function (t) {
- return e(t);
- }),
- delete o[t]),
- this
- );
- },
- handleByMap: function (t, e) {
- return this.handle(
- t,
- function (t) {
- e[t.name] = t.ref;
- },
- function (t) {
- delete e[t.name];
- }
- );
- },
- handleByList: function (t, e) {
- return this.handle(
- t,
- function (r) {
- var n, i;
- e.includes(r.ref) ||
- (e.push(r.ref),
- t === HD.Loader &&
- (null === (i = (n = r.ref).add) || void 0 === i || i.call(n)));
- },
- function (t) {
- var r = e.indexOf(t.ref);
- -1 !== r && e.splice(r, 1);
- }
- );
- },
- },
- JD = (function () {
- function t(t) {
- (this.items = []), (this._name = t), (this._aliasCount = 0);
- }
- return (
- (t.prototype.emit = function (t, e, r, n, i, o, s, a) {
- if (arguments.length > 8) throw new Error('max arguments reached');
- var u = this,
- c = u.name,
- h = u.items;
- this._aliasCount++;
- for (var l = 0, d = h.length; l < d; l++)
- h[l][c](t, e, r, n, i, o, s, a);
- return h === this.items && this._aliasCount--, this;
- }),
- (t.prototype.ensureNonAliasedItems = function () {
- this._aliasCount > 0 &&
- this.items.length > 1 &&
- ((this._aliasCount = 0), (this.items = this.items.slice(0)));
- }),
- (t.prototype.add = function (t) {
- return (
- t[this._name] &&
- (this.ensureNonAliasedItems(),
- this.remove(t),
- this.items.push(t)),
- this
- );
- }),
- (t.prototype.remove = function (t) {
- var e = this.items.indexOf(t);
- return (
- -1 !== e && (this.ensureNonAliasedItems(), this.items.splice(e, 1)),
- this
- );
- }),
- (t.prototype.contains = function (t) {
- return -1 !== this.items.indexOf(t);
- }),
- (t.prototype.removeAll = function () {
- return this.ensureNonAliasedItems(), (this.items.length = 0), this;
- }),
- (t.prototype.destroy = function () {
- this.removeAll(), (this.items = null), (this._name = null);
- }),
- Object.defineProperty(t.prototype, 'empty', {
- get: function () {
- return 0 === this.items.length;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'name', {
- get: function () {
- return this._name;
- },
- enumerable: !1,
- configurable: !0,
- }),
- t
- );
- })();
- Object.defineProperties(JD.prototype, {
- dispatch: { value: JD.prototype.emit },
- run: { value: JD.prototype.emit },
- }),
- (vA.TARGET_FPMS = 0.06),
- (function (t) {
- (t[(t.INTERACTION = 50)] = 'INTERACTION'),
- (t[(t.HIGH = 25)] = 'HIGH'),
- (t[(t.NORMAL = 0)] = 'NORMAL'),
- (t[(t.LOW = -25)] = 'LOW'),
- (t[(t.UTILITY = -50)] = 'UTILITY');
- })(YD || (YD = {}));
- var KD = (function () {
- function t(t, e, r, n) {
- void 0 === e && (e = null),
- void 0 === r && (r = 0),
- void 0 === n && (n = !1),
- (this.next = null),
- (this.previous = null),
- (this._destroyed = !1),
- (this.fn = t),
- (this.context = e),
- (this.priority = r),
- (this.once = n);
- }
- return (
- (t.prototype.match = function (t, e) {
- return (
- void 0 === e && (e = null), this.fn === t && this.context === e
- );
- }),
- (t.prototype.emit = function (t) {
- this.fn &&
- (this.context ? this.fn.call(this.context, t) : this.fn(t));
- var e = this.next;
- return (
- this.once && this.destroy(!0),
- this._destroyed && (this.next = null),
- e
- );
- }),
- (t.prototype.connect = function (t) {
- (this.previous = t),
- t.next && (t.next.previous = this),
- (this.next = t.next),
- (t.next = this);
- }),
- (t.prototype.destroy = function (t) {
- void 0 === t && (t = !1),
- (this._destroyed = !0),
- (this.fn = null),
- (this.context = null),
- this.previous && (this.previous.next = this.next),
- this.next && (this.next.previous = this.previous);
- var e = this.next;
- return (this.next = t ? null : e), (this.previous = null), e;
- }),
- t
- );
- })(),
- qD = (function () {
- function t() {
- var t = this;
- (this.autoStart = !1),
- (this.deltaTime = 1),
- (this.lastTime = -1),
- (this.speed = 1),
- (this.started = !1),
- (this._requestId = null),
- (this._maxElapsedMS = 100),
- (this._minElapsedMS = 0),
- (this._protected = !1),
- (this._lastFrame = -1),
- (this._head = new KD(null, null, 1 / 0)),
- (this.deltaMS = 1 / vA.TARGET_FPMS),
- (this.elapsedMS = 1 / vA.TARGET_FPMS),
- (this._tick = function (e) {
- (t._requestId = null),
- t.started &&
- (t.update(e),
- t.started &&
- null === t._requestId &&
- t._head.next &&
- (t._requestId = requestAnimationFrame(t._tick)));
- });
- }
- return (
- (t.prototype._requestIfNeeded = function () {
- null === this._requestId &&
- this._head.next &&
- ((this.lastTime = performance.now()),
- (this._lastFrame = this.lastTime),
- (this._requestId = requestAnimationFrame(this._tick)));
- }),
- (t.prototype._cancelIfNeeded = function () {
- null !== this._requestId &&
- (cancelAnimationFrame(this._requestId), (this._requestId = null));
- }),
- (t.prototype._startIfPossible = function () {
- this.started
- ? this._requestIfNeeded()
- : this.autoStart && this.start();
- }),
- (t.prototype.add = function (t, e, r) {
- return (
- void 0 === r && (r = YD.NORMAL), this._addListener(new KD(t, e, r))
- );
- }),
- (t.prototype.addOnce = function (t, e, r) {
- return (
- void 0 === r && (r = YD.NORMAL),
- this._addListener(new KD(t, e, r, !0))
- );
- }),
- (t.prototype._addListener = function (t) {
- var e = this._head.next,
- r = this._head;
- if (e) {
- for (; e; ) {
- if (t.priority > e.priority) {
- t.connect(r);
- break;
- }
- (r = e), (e = e.next);
- }
- t.previous || t.connect(r);
- } else t.connect(r);
- return this._startIfPossible(), this;
- }),
- (t.prototype.remove = function (t, e) {
- for (var r = this._head.next; r; )
- r = r.match(t, e) ? r.destroy() : r.next;
- return this._head.next || this._cancelIfNeeded(), this;
- }),
- Object.defineProperty(t.prototype, 'count', {
- get: function () {
- if (!this._head) return 0;
- for (var t = 0, e = this._head; (e = e.next); ) t++;
- return t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype.start = function () {
- this.started || ((this.started = !0), this._requestIfNeeded());
- }),
- (t.prototype.stop = function () {
- this.started && ((this.started = !1), this._cancelIfNeeded());
- }),
- (t.prototype.destroy = function () {
- if (!this._protected) {
- this.stop();
- for (var t = this._head.next; t; ) t = t.destroy(!0);
- this._head.destroy(), (this._head = null);
- }
- }),
- (t.prototype.update = function (t) {
- var e;
- if ((void 0 === t && (t = performance.now()), t > this.lastTime)) {
- if (
- ((e = this.elapsedMS = t - this.lastTime) > this._maxElapsedMS &&
- (e = this._maxElapsedMS),
- (e *= this.speed),
- this._minElapsedMS)
- ) {
- var r = (t - this._lastFrame) | 0;
- if (r < this._minElapsedMS) return;
- this._lastFrame = t - (r % this._minElapsedMS);
- }
- (this.deltaMS = e),
- (this.deltaTime = this.deltaMS * vA.TARGET_FPMS);
- for (var n = this._head, i = n.next; i; )
- i = i.emit(this.deltaTime);
- n.next || this._cancelIfNeeded();
- } else this.deltaTime = this.deltaMS = this.elapsedMS = 0;
- this.lastTime = t;
- }),
- Object.defineProperty(t.prototype, 'FPS', {
- get: function () {
- return 1e3 / this.elapsedMS;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'minFPS', {
- get: function () {
- return 1e3 / this._maxElapsedMS;
- },
- set: function (t) {
- var e = Math.min(this.maxFPS, t),
- r = Math.min(Math.max(0, e) / 1e3, vA.TARGET_FPMS);
- this._maxElapsedMS = 1 / r;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'maxFPS', {
- get: function () {
- return this._minElapsedMS
- ? Math.round(1e3 / this._minElapsedMS)
- : 0;
- },
- set: function (t) {
- if (0 === t) this._minElapsedMS = 0;
- else {
- var e = Math.max(this.minFPS, t);
- this._minElapsedMS = 1 / (e / 1e3);
- }
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t, 'shared', {
- get: function () {
- if (!t._shared) {
- var e = (t._shared = new t());
- (e.autoStart = !0), (e._protected = !0);
- }
- return t._shared;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t, 'system', {
- get: function () {
- if (!t._system) {
- var e = (t._system = new t());
- (e.autoStart = !0), (e._protected = !0);
- }
- return t._system;
- },
- enumerable: !1,
- configurable: !0,
- }),
- t
- );
- })(),
- QD = (function () {
- function t() {}
- return (
- (t.init = function (t) {
- var e = this;
- (t = Object.assign({ autoStart: !0, sharedTicker: !1 }, t)),
- Object.defineProperty(this, 'ticker', {
- set: function (t) {
- this._ticker && this._ticker.remove(this.render, this),
- (this._ticker = t),
- t && t.add(this.render, this, YD.LOW);
- },
- get: function () {
- return this._ticker;
- },
- }),
- (this.stop = function () {
- e._ticker.stop();
- }),
- (this.start = function () {
- e._ticker.start();
- }),
- (this._ticker = null),
- (this.ticker = t.sharedTicker ? qD.shared : new qD()),
- t.autoStart && this.start();
- }),
- (t.destroy = function () {
- if (this._ticker) {
- var t = this._ticker;
- (this.ticker = null), t.destroy();
- }
- }),
- (t.extension = HD.Application),
- t
- );
- })();
- (vA.PREFER_ENV = pA.any ? CP.WEBGL : CP.WEBGL2),
- (vA.STRICT_TEXTURE_CACHE = !1);
- var $D = [];
- function tL(t, e) {
- if (!t) return null;
- var r = '';
- if ('string' == typeof t) {
- var n = /\.(\w{3,4})(?:$|\?|#)/i.exec(t);
- n && (r = n[1].toLowerCase());
- }
- for (var i = $D.length - 1; i >= 0; --i) {
- var o = $D[i];
- if (o.test && o.test(t, r)) return new o(t, e);
- }
- throw new Error('Unrecognized source type to auto-detect Resource');
- }
- var eL = function (t, e) {
- return (
- (eL =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- eL(t, e)
- );
- };
- function rL(t, e) {
- function r() {
- this.constructor = t;
- }
- eL(t, e),
- (t.prototype =
- null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
- }
- var nL = function () {
- return (
- (nL =
- Object.assign ||
- function (t) {
- for (var e, r = arguments, n = 1, i = arguments.length; n < i; n++)
- for (var o in (e = r[n]))
- Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
- return t;
- }),
- nL.apply(this, arguments)
- );
- };
- var iL = (function () {
- function t(t, e) {
- void 0 === t && (t = 0),
- void 0 === e && (e = 0),
- (this._width = t),
- (this._height = e),
- (this.destroyed = !1),
- (this.internal = !1),
- (this.onResize = new JD('setRealSize')),
- (this.onUpdate = new JD('update')),
- (this.onError = new JD('onError'));
- }
- return (
- (t.prototype.bind = function (t) {
- this.onResize.add(t),
- this.onUpdate.add(t),
- this.onError.add(t),
- (this._width || this._height) &&
- this.onResize.emit(this._width, this._height);
- }),
- (t.prototype.unbind = function (t) {
- this.onResize.remove(t),
- this.onUpdate.remove(t),
- this.onError.remove(t);
- }),
- (t.prototype.resize = function (t, e) {
- (t === this._width && e === this._height) ||
- ((this._width = t), (this._height = e), this.onResize.emit(t, e));
- }),
- Object.defineProperty(t.prototype, 'valid', {
- get: function () {
- return !!this._width && !!this._height;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype.update = function () {
- this.destroyed || this.onUpdate.emit();
- }),
- (t.prototype.load = function () {
- return Promise.resolve(this);
- }),
- Object.defineProperty(t.prototype, 'width', {
- get: function () {
- return this._width;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'height', {
- get: function () {
- return this._height;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype.style = function (t, e, r) {
- return !1;
- }),
- (t.prototype.dispose = function () {}),
- (t.prototype.destroy = function () {
- this.destroyed ||
- ((this.destroyed = !0),
- this.dispose(),
- this.onError.removeAll(),
- (this.onError = null),
- this.onResize.removeAll(),
- (this.onResize = null),
- this.onUpdate.removeAll(),
- (this.onUpdate = null));
- }),
- (t.test = function (t, e) {
- return !1;
- }),
- t
- );
- })(),
- oL = (function (t) {
- function e(e, r) {
- var n = this,
- i = r || {},
- o = i.width,
- s = i.height;
- if (!o || !s) throw new Error('BufferResource width or height invalid');
- return ((n = t.call(this, o, s) || this).data = e), n;
- }
- return (
- rL(e, t),
- (e.prototype.upload = function (t, e, r) {
- var n = t.gl;
- n.pixelStorei(
- n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
- e.alphaMode === GP.UNPACK
- );
- var i = e.realWidth,
- o = e.realHeight;
- return (
- r.width === i && r.height === o
- ? n.texSubImage2D(
- e.target,
- 0,
- 0,
- 0,
- i,
- o,
- e.format,
- r.type,
- this.data
- )
- : ((r.width = i),
- (r.height = o),
- n.texImage2D(
- e.target,
- 0,
- r.internalFormat,
- i,
- o,
- 0,
- e.format,
- r.type,
- this.data
- )),
- !0
- );
- }),
- (e.prototype.dispose = function () {
- this.data = null;
- }),
- (e.test = function (t) {
- return (
- t instanceof Float32Array ||
- t instanceof Uint8Array ||
- t instanceof Uint32Array
- );
- }),
- e
- );
- })(iL),
- sL = { scaleMode: NP.NEAREST, format: MP.RGBA, alphaMode: GP.NPM },
- aL = (function (t) {
- function e(e, r) {
- void 0 === e && (e = null), void 0 === r && (r = null);
- var n = t.call(this) || this,
- i = (r = r || {}).alphaMode,
- o = r.mipmap,
- s = r.anisotropicLevel,
- a = r.scaleMode,
- u = r.width,
- c = r.height,
- h = r.wrapMode,
- l = r.format,
- d = r.type,
- f = r.target,
- p = r.resolution,
- v = r.resourceOptions;
- return (
- !e || e instanceof iL || ((e = tL(e, v)).internal = !0),
- (n.resolution = p || vA.RESOLUTION),
- (n.width = Math.round((u || 0) * n.resolution) / n.resolution),
- (n.height = Math.round((c || 0) * n.resolution) / n.resolution),
- (n._mipmap = void 0 !== o ? o : vA.MIPMAP_TEXTURES),
- (n.anisotropicLevel = void 0 !== s ? s : vA.ANISOTROPIC_LEVEL),
- (n._wrapMode = h || vA.WRAP_MODE),
- (n._scaleMode = void 0 !== a ? a : vA.SCALE_MODE),
- (n.format = l || MP.RGBA),
- (n.type = d || LP.UNSIGNED_BYTE),
- (n.target = f || DP.TEXTURE_2D),
- (n.alphaMode = void 0 !== i ? i : GP.UNPACK),
- (n.uid = oD()),
- (n.touched = 0),
- (n.isPowerOfTwo = !1),
- n._refreshPOT(),
- (n._glTextures = {}),
- (n.dirtyId = 0),
- (n.dirtyStyleId = 0),
- (n.cacheId = null),
- (n.valid = u > 0 && c > 0),
- (n.textureCacheIds = []),
- (n.destroyed = !1),
- (n.resource = null),
- (n._batchEnabled = 0),
- (n._batchLocation = 0),
- (n.parentTextureArray = null),
- n.setResource(e),
- n
- );
- }
- return (
- rL(e, t),
- Object.defineProperty(e.prototype, 'realWidth', {
- get: function () {
- return Math.round(this.width * this.resolution);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'realHeight', {
- get: function () {
- return Math.round(this.height * this.resolution);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'mipmap', {
- get: function () {
- return this._mipmap;
- },
- set: function (t) {
- this._mipmap !== t && ((this._mipmap = t), this.dirtyStyleId++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'scaleMode', {
- get: function () {
- return this._scaleMode;
- },
- set: function (t) {
- this._scaleMode !== t &&
- ((this._scaleMode = t), this.dirtyStyleId++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'wrapMode', {
- get: function () {
- return this._wrapMode;
- },
- set: function (t) {
- this._wrapMode !== t && ((this._wrapMode = t), this.dirtyStyleId++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype.setStyle = function (t, e) {
- var r;
- return (
- void 0 !== t &&
- t !== this.scaleMode &&
- ((this.scaleMode = t), (r = !0)),
- void 0 !== e && e !== this.mipmap && ((this.mipmap = e), (r = !0)),
- r && this.dirtyStyleId++,
- this
- );
- }),
- (e.prototype.setSize = function (t, e, r) {
- return (r = r || this.resolution), this.setRealSize(t * r, e * r, r);
- }),
- (e.prototype.setRealSize = function (t, e, r) {
- return (
- (this.resolution = r || this.resolution),
- (this.width = Math.round(t) / this.resolution),
- (this.height = Math.round(e) / this.resolution),
- this._refreshPOT(),
- this.update(),
- this
- );
- }),
- (e.prototype._refreshPOT = function () {
- this.isPowerOfTwo = tD(this.realWidth) && tD(this.realHeight);
- }),
- (e.prototype.setResolution = function (t) {
- var e = this.resolution;
- return (
- e === t ||
- ((this.resolution = t),
- this.valid &&
- ((this.width = Math.round(this.width * e) / t),
- (this.height = Math.round(this.height * e) / t),
- this.emit('update', this)),
- this._refreshPOT()),
- this
- );
- }),
- (e.prototype.setResource = function (t) {
- if (this.resource === t) return this;
- if (this.resource) throw new Error('Resource can be set only once');
- return t.bind(this), (this.resource = t), this;
- }),
- (e.prototype.update = function () {
- this.valid
- ? (this.dirtyId++, this.dirtyStyleId++, this.emit('update', this))
- : this.width > 0 &&
- this.height > 0 &&
- ((this.valid = !0),
- this.emit('loaded', this),
- this.emit('update', this));
- }),
- (e.prototype.onError = function (t) {
- this.emit('error', this, t);
- }),
- (e.prototype.destroy = function () {
- this.resource &&
- (this.resource.unbind(this),
- this.resource.internal && this.resource.destroy(),
- (this.resource = null)),
- this.cacheId &&
- (delete lD[this.cacheId],
- delete hD[this.cacheId],
- (this.cacheId = null)),
- this.dispose(),
- e.removeFromCache(this),
- (this.textureCacheIds = null),
- (this.destroyed = !0);
- }),
- (e.prototype.dispose = function () {
- this.emit('dispose', this);
- }),
- (e.prototype.castToBaseTexture = function () {
- return this;
- }),
- (e.from = function (t, r, n) {
- void 0 === n && (n = vA.STRICT_TEXTURE_CACHE);
- var i = 'string' == typeof t,
- o = null;
- if (i) o = t;
- else {
- if (!t._pixiId) {
- var s = (r && r.pixiIdPrefix) || 'pixiid';
- t._pixiId = s + '_' + oD();
- }
- o = t._pixiId;
- }
- var a = lD[o];
- if (i && n && !a)
- throw new Error(
- 'The cacheId "' + o + '" does not exist in BaseTextureCache.'
- );
- return a || (((a = new e(t, r)).cacheId = o), e.addToCache(a, o)), a;
- }),
- (e.fromBuffer = function (t, r, n, i) {
- t = t || new Float32Array(r * n * 4);
- var o = new oL(t, { width: r, height: n }),
- s = t instanceof Float32Array ? LP.FLOAT : LP.UNSIGNED_BYTE;
- return new e(
- o,
- Object.assign({}, sL, i || { width: r, height: n, type: s })
- );
- }),
- (e.addToCache = function (t, e) {
- e &&
- (-1 === t.textureCacheIds.indexOf(e) && t.textureCacheIds.push(e),
- lD[e] &&
- console.warn(
- 'BaseTexture added to the cache with an id [' +
- e +
- '] that already had an entry'
- ),
- (lD[e] = t));
- }),
- (e.removeFromCache = function (t) {
- if ('string' == typeof t) {
- var e = lD[t];
- if (e) {
- var r = e.textureCacheIds.indexOf(t);
- return r > -1 && e.textureCacheIds.splice(r, 1), delete lD[t], e;
- }
- } else if (t && t.textureCacheIds) {
- for (var n = 0; n < t.textureCacheIds.length; ++n)
- delete lD[t.textureCacheIds[n]];
- return (t.textureCacheIds.length = 0), t;
- }
- return null;
- }),
- (e._globalBatch = 0),
- e
- );
- })(yA),
- uL = (function (t) {
- function e(e, r) {
- var n = this,
- i = r || {},
- o = i.width,
- s = i.height;
- ((n = t.call(this, o, s) || this).items = []), (n.itemDirtyIds = []);
- for (var a = 0; a < e; a++) {
- var u = new aL();
- n.items.push(u), n.itemDirtyIds.push(-2);
- }
- return (n.length = e), (n._load = null), (n.baseTexture = null), n;
- }
- return (
- rL(e, t),
- (e.prototype.initFromArray = function (t, e) {
- for (var r = 0; r < this.length; r++)
- t[r] &&
- (t[r].castToBaseTexture
- ? this.addBaseTextureAt(t[r].castToBaseTexture(), r)
- : t[r] instanceof iL
- ? this.addResourceAt(t[r], r)
- : this.addResourceAt(tL(t[r], e), r));
- }),
- (e.prototype.dispose = function () {
- for (var t = 0, e = this.length; t < e; t++) this.items[t].destroy();
- (this.items = null), (this.itemDirtyIds = null), (this._load = null);
- }),
- (e.prototype.addResourceAt = function (t, e) {
- if (!this.items[e])
- throw new Error('Index ' + e + ' is out of bounds');
- return (
- t.valid && !this.valid && this.resize(t.width, t.height),
- this.items[e].setResource(t),
- this
- );
- }),
- (e.prototype.bind = function (e) {
- if (null !== this.baseTexture)
- throw new Error(
- 'Only one base texture per TextureArray is allowed'
- );
- t.prototype.bind.call(this, e);
- for (var r = 0; r < this.length; r++)
- (this.items[r].parentTextureArray = e),
- this.items[r].on('update', e.update, e);
- }),
- (e.prototype.unbind = function (e) {
- t.prototype.unbind.call(this, e);
- for (var r = 0; r < this.length; r++)
- (this.items[r].parentTextureArray = null),
- this.items[r].off('update', e.update, e);
- }),
- (e.prototype.load = function () {
- var t = this;
- if (this._load) return this._load;
- var e = this.items
- .map(function (t) {
- return t.resource;
- })
- .filter(function (t) {
- return t;
- })
- .map(function (t) {
- return t.load();
- });
- return (
- (this._load = Promise.all(e).then(function () {
- var e = t.items[0],
- r = e.realWidth,
- n = e.realHeight;
- return t.resize(r, n), Promise.resolve(t);
- })),
- this._load
- );
- }),
- e
- );
- })(iL),
- cL = (function (t) {
- function e(e, r) {
- var n,
- i,
- o = this,
- s = r || {},
- a = s.width,
- u = s.height;
- return (
- Array.isArray(e) ? ((n = e), (i = e.length)) : (i = e),
- (o = t.call(this, i, { width: a, height: u }) || this),
- n && o.initFromArray(n, r),
- o
- );
- }
- return (
- rL(e, t),
- (e.prototype.addBaseTextureAt = function (t, e) {
- if (!t.resource)
- throw new Error('ArrayResource does not support RenderTexture');
- return this.addResourceAt(t.resource, e), this;
- }),
- (e.prototype.bind = function (e) {
- t.prototype.bind.call(this, e), (e.target = DP.TEXTURE_2D_ARRAY);
- }),
- (e.prototype.upload = function (t, e, r) {
- var n = this,
- i = n.length,
- o = n.itemDirtyIds,
- s = n.items,
- a = t.gl;
- r.dirtyId < 0 &&
- a.texImage3D(
- a.TEXTURE_2D_ARRAY,
- 0,
- r.internalFormat,
- this._width,
- this._height,
- i,
- 0,
- e.format,
- r.type,
- null
- );
- for (var u = 0; u < i; u++) {
- var c = s[u];
- o[u] < c.dirtyId &&
- ((o[u] = c.dirtyId),
- c.valid &&
- a.texSubImage3D(
- a.TEXTURE_2D_ARRAY,
- 0,
- 0,
- 0,
- u,
- c.resource.width,
- c.resource.height,
- 1,
- e.format,
- r.type,
- c.resource.source
- ));
- }
- return !0;
- }),
- e
- );
- })(uL),
- hL = (function (t) {
- function e(e) {
- var r = this,
- n = e,
- i = n.naturalWidth || n.videoWidth || n.width,
- o = n.naturalHeight || n.videoHeight || n.height;
- return (
- ((r = t.call(this, i, o) || this).source = e), (r.noSubImage = !1), r
- );
- }
- return (
- rL(e, t),
- (e.crossOrigin = function (t, e, r) {
- void 0 === r && 0 !== e.indexOf('data:')
- ? (t.crossOrigin = fD(e))
- : !1 !== r &&
- (t.crossOrigin = 'string' == typeof r ? r : 'anonymous');
- }),
- (e.prototype.upload = function (t, e, r, n) {
- var i = t.gl,
- o = e.realWidth,
- s = e.realHeight;
- if ((n = n || this.source) instanceof HTMLImageElement) {
- if (!n.complete || 0 === n.naturalWidth) return !1;
- } else if (n instanceof HTMLVideoElement && n.readyState <= 1)
- return !1;
- return (
- i.pixelStorei(
- i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
- e.alphaMode === GP.UNPACK
- ),
- this.noSubImage ||
- e.target !== i.TEXTURE_2D ||
- r.width !== o ||
- r.height !== s
- ? ((r.width = o),
- (r.height = s),
- i.texImage2D(
- e.target,
- 0,
- r.internalFormat,
- e.format,
- r.type,
- n
- ))
- : i.texSubImage2D(i.TEXTURE_2D, 0, 0, 0, e.format, r.type, n),
- !0
- );
- }),
- (e.prototype.update = function () {
- if (!this.destroyed) {
- var e = this.source,
- r = e.naturalWidth || e.videoWidth || e.width,
- n = e.naturalHeight || e.videoHeight || e.height;
- this.resize(r, n), t.prototype.update.call(this);
- }
- }),
- (e.prototype.dispose = function () {
- this.source = null;
- }),
- e
- );
- })(iL),
- lL = (function (t) {
- function e(e) {
- return t.call(this, e) || this;
- }
- return (
- rL(e, t),
- (e.test = function (t) {
- var e = globalThis.OffscreenCanvas;
- return (
- !!(e && t instanceof e) ||
- (globalThis.HTMLCanvasElement && t instanceof HTMLCanvasElement)
- );
- }),
- e
- );
- })(hL),
- dL = (function (t) {
- function e(r, n) {
- var i = this,
- o = n || {},
- s = o.width,
- a = o.height,
- u = o.autoLoad,
- c = o.linkBaseTexture;
- if (r && r.length !== e.SIDES)
- throw new Error('Invalid length. Got ' + r.length + ', expected 6');
- i = t.call(this, 6, { width: s, height: a }) || this;
- for (var h = 0; h < e.SIDES; h++)
- i.items[h].target = DP.TEXTURE_CUBE_MAP_POSITIVE_X + h;
- return (
- (i.linkBaseTexture = !1 !== c),
- r && i.initFromArray(r, n),
- !1 !== u && i.load(),
- i
- );
- }
- return (
- rL(e, t),
- (e.prototype.bind = function (e) {
- t.prototype.bind.call(this, e), (e.target = DP.TEXTURE_CUBE_MAP);
- }),
- (e.prototype.addBaseTextureAt = function (t, e, r) {
- if (!this.items[e])
- throw new Error('Index ' + e + ' is out of bounds');
- if (
- !this.linkBaseTexture ||
- t.parentTextureArray ||
- Object.keys(t._glTextures).length > 0
- ) {
- if (!t.resource)
- throw new Error(
- 'CubeResource does not support copying of renderTexture.'
- );
- this.addResourceAt(t.resource, e);
- } else
- (t.target = DP.TEXTURE_CUBE_MAP_POSITIVE_X + e),
- (t.parentTextureArray = this.baseTexture),
- (this.items[e] = t);
- return (
- t.valid && !this.valid && this.resize(t.realWidth, t.realHeight),
- (this.items[e] = t),
- this
- );
- }),
- (e.prototype.upload = function (t, r, n) {
- for (var i = this.itemDirtyIds, o = 0; o < e.SIDES; o++) {
- var s = this.items[o];
- (i[o] < s.dirtyId || n.dirtyId < r.dirtyId) &&
- (s.valid && s.resource
- ? (s.resource.upload(t, s, n), (i[o] = s.dirtyId))
- : i[o] < -1 &&
- (t.gl.texImage2D(
- s.target,
- 0,
- n.internalFormat,
- r.realWidth,
- r.realHeight,
- 0,
- r.format,
- n.type,
- null
- ),
- (i[o] = -1)));
- }
- return !0;
- }),
- (e.test = function (t) {
- return Array.isArray(t) && t.length === e.SIDES;
- }),
- (e.SIDES = 6),
- e
- );
- })(uL),
- fL = (function (t) {
- function e(e, r) {
- var n = this;
- if (((r = r || {}), !(e instanceof HTMLImageElement))) {
- var i = new Image();
- hL.crossOrigin(i, e, r.crossorigin), (i.src = e), (e = i);
- }
- return (
- (n = t.call(this, e) || this),
- !e.complete &&
- n._width &&
- n._height &&
- ((n._width = 0), (n._height = 0)),
- (n.url = e.src),
- (n._process = null),
- (n.preserveBitmap = !1),
- (n.createBitmap =
- (void 0 !== r.createBitmap
- ? r.createBitmap
- : vA.CREATE_IMAGE_BITMAP) && !!globalThis.createImageBitmap),
- (n.alphaMode = 'number' == typeof r.alphaMode ? r.alphaMode : null),
- (n.bitmap = null),
- (n._load = null),
- !1 !== r.autoLoad && n.load(),
- n
- );
- }
- return (
- rL(e, t),
- (e.prototype.load = function (t) {
- var e = this;
- return (
- this._load ||
- (void 0 !== t && (this.createBitmap = t),
- (this._load = new Promise(function (t, r) {
- var n = e.source;
- e.url = n.src;
- var i = function () {
- e.destroyed ||
- ((n.onload = null),
- (n.onerror = null),
- e.resize(n.width, n.height),
- (e._load = null),
- e.createBitmap ? t(e.process()) : t(e));
- };
- n.complete && n.src
- ? i()
- : ((n.onload = i),
- (n.onerror = function (t) {
- r(t), e.onError.emit(t);
- }));
- }))),
- this._load
- );
- }),
- (e.prototype.process = function () {
- var t = this,
- e = this.source;
- if (null !== this._process) return this._process;
- if (null !== this.bitmap || !globalThis.createImageBitmap)
- return Promise.resolve(this);
- var r = globalThis.createImageBitmap,
- n = !e.crossOrigin || 'anonymous' === e.crossOrigin;
- return (
- (this._process = fetch(e.src, { mode: n ? 'cors' : 'no-cors' })
- .then(function (t) {
- return t.blob();
- })
- .then(function (n) {
- return r(n, 0, 0, e.width, e.height, {
- premultiplyAlpha:
- null === t.alphaMode || t.alphaMode === GP.UNPACK
- ? 'premultiply'
- : 'none',
- });
- })
- .then(function (e) {
- return t.destroyed
- ? Promise.reject()
- : ((t.bitmap = e),
- t.update(),
- (t._process = null),
- Promise.resolve(t));
- })),
- this._process
- );
- }),
- (e.prototype.upload = function (e, r, n) {
- if (
- ('number' == typeof this.alphaMode &&
- (r.alphaMode = this.alphaMode),
- !this.createBitmap)
- )
- return t.prototype.upload.call(this, e, r, n);
- if (!this.bitmap && (this.process(), !this.bitmap)) return !1;
- if (
- (t.prototype.upload.call(this, e, r, n, this.bitmap),
- !this.preserveBitmap)
- ) {
- var i = !0,
- o = r._glTextures;
- for (var s in o) {
- var a = o[s];
- if (a !== n && a.dirtyId !== r.dirtyId) {
- i = !1;
- break;
- }
- }
- i &&
- (this.bitmap.close && this.bitmap.close(), (this.bitmap = null));
- }
- return !0;
- }),
- (e.prototype.dispose = function () {
- (this.source.onload = null),
- (this.source.onerror = null),
- t.prototype.dispose.call(this),
- this.bitmap && (this.bitmap.close(), (this.bitmap = null)),
- (this._process = null),
- (this._load = null);
- }),
- (e.test = function (t) {
- return 'string' == typeof t || t instanceof HTMLImageElement;
- }),
- e
- );
- })(hL),
- pL = (function (t) {
- function e(e, r) {
- var n = this;
- return (
- (r = r || {}),
- ((n = t.call(this, vA.ADAPTER.createCanvas()) || this)._width = 0),
- (n._height = 0),
- (n.svg = e),
- (n.scale = r.scale || 1),
- (n._overrideWidth = r.width),
- (n._overrideHeight = r.height),
- (n._resolve = null),
- (n._crossorigin = r.crossorigin),
- (n._load = null),
- !1 !== r.autoLoad && n.load(),
- n
- );
- }
- return (
- rL(e, t),
- (e.prototype.load = function () {
- var t = this;
- return (
- this._load ||
- (this._load = new Promise(function (r) {
- if (
- ((t._resolve = function () {
- t.resize(t.source.width, t.source.height), r(t);
- }),
- e.SVG_XML.test(t.svg.trim()))
- ) {
- if (!btoa)
- throw new Error(
- "Your browser doesn't support base64 conversions."
- );
- t.svg =
- 'data:image/svg+xml;base64,' +
- btoa(unescape(encodeURIComponent(t.svg)));
- }
- t._loadSvg();
- })),
- this._load
- );
- }),
- (e.prototype._loadSvg = function () {
- var t = this,
- e = new Image();
- hL.crossOrigin(e, this.svg, this._crossorigin),
- (e.src = this.svg),
- (e.onerror = function (r) {
- t._resolve && ((e.onerror = null), t.onError.emit(r));
- }),
- (e.onload = function () {
- if (t._resolve) {
- var r = e.width,
- n = e.height;
- if (!r || !n)
- throw new Error(
- 'The SVG image must have width and height defined (in pixels), canvas API needs them.'
- );
- var i = r * t.scale,
- o = n * t.scale;
- (t._overrideWidth || t._overrideHeight) &&
- ((i = t._overrideWidth || (t._overrideHeight / n) * r),
- (o = t._overrideHeight || (t._overrideWidth / r) * n)),
- (i = Math.round(i)),
- (o = Math.round(o));
- var s = t.source;
- (s.width = i),
- (s.height = o),
- (s._pixiId = 'canvas_' + oD()),
- s.getContext('2d').drawImage(e, 0, 0, r, n, 0, 0, i, o),
- t._resolve(),
- (t._resolve = null);
- }
- });
- }),
- (e.getSize = function (t) {
- var r = e.SVG_SIZE.exec(t),
- n = {};
- return (
- r &&
- ((n[r[1]] = Math.round(parseFloat(r[3]))),
- (n[r[5]] = Math.round(parseFloat(r[7])))),
- n
- );
- }),
- (e.prototype.dispose = function () {
- t.prototype.dispose.call(this),
- (this._resolve = null),
- (this._crossorigin = null);
- }),
- (e.test = function (t, r) {
- return (
- 'svg' === r ||
- ('string' == typeof t && t.startsWith('data:image/svg+xml')) ||
- ('string' == typeof t && e.SVG_XML.test(t))
- );
- }),
- (e.SVG_XML = /^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m),
- (e.SVG_SIZE =
- /<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i),
- e
- );
- })(hL),
- vL = (function (t) {
- function e(r, n) {
- var i = this;
- if (((n = n || {}), !(r instanceof HTMLVideoElement))) {
- var o = document.createElement('video');
- o.setAttribute('preload', 'auto'),
- o.setAttribute('webkit-playsinline', ''),
- o.setAttribute('playsinline', ''),
- 'string' == typeof r && (r = [r]);
- var s = r[0].src || r[0];
- hL.crossOrigin(o, s, n.crossorigin);
- for (var a = 0; a < r.length; ++a) {
- var u = document.createElement('source'),
- c = r[a],
- h = c.src,
- l = c.mime,
- d = (h = h || r[a]).split('?').shift().toLowerCase(),
- f = d.slice(d.lastIndexOf('.') + 1);
- (l = l || e.MIME_TYPES[f] || 'video/' + f),
- (u.src = h),
- (u.type = l),
- o.appendChild(u);
- }
- r = o;
- }
- return (
- ((i = t.call(this, r) || this).noSubImage = !0),
- (i._autoUpdate = !0),
- (i._isConnectedToTicker = !1),
- (i._updateFPS = n.updateFPS || 0),
- (i._msToNextUpdate = 0),
- (i.autoPlay = !1 !== n.autoPlay),
- (i._load = null),
- (i._resolve = null),
- (i._onCanPlay = i._onCanPlay.bind(i)),
- (i._onError = i._onError.bind(i)),
- !1 !== n.autoLoad && i.load(),
- i
- );
- }
- return (
- rL(e, t),
- (e.prototype.update = function (e) {
- if (!this.destroyed) {
- var r = qD.shared.elapsedMS * this.source.playbackRate;
- (this._msToNextUpdate = Math.floor(this._msToNextUpdate - r)),
- (!this._updateFPS || this._msToNextUpdate <= 0) &&
- (t.prototype.update.call(this),
- (this._msToNextUpdate = this._updateFPS
- ? Math.floor(1e3 / this._updateFPS)
- : 0));
- }
- }),
- (e.prototype.load = function () {
- var t = this;
- if (this._load) return this._load;
- var e = this.source;
- return (
- (e.readyState === e.HAVE_ENOUGH_DATA ||
- e.readyState === e.HAVE_FUTURE_DATA) &&
- e.width &&
- e.height &&
- (e.complete = !0),
- e.addEventListener('play', this._onPlayStart.bind(this)),
- e.addEventListener('pause', this._onPlayStop.bind(this)),
- this._isSourceReady()
- ? this._onCanPlay()
- : (e.addEventListener('canplay', this._onCanPlay),
- e.addEventListener('canplaythrough', this._onCanPlay),
- e.addEventListener('error', this._onError, !0)),
- (this._load = new Promise(function (r) {
- t.valid ? r(t) : ((t._resolve = r), e.load());
- })),
- this._load
- );
- }),
- (e.prototype._onError = function (t) {
- this.source.removeEventListener('error', this._onError, !0),
- this.onError.emit(t);
- }),
- (e.prototype._isSourcePlaying = function () {
- var t = this.source;
- return !t.paused && !t.ended && this._isSourceReady();
- }),
- (e.prototype._isSourceReady = function () {
- return this.source.readyState > 2;
- }),
- (e.prototype._onPlayStart = function () {
- this.valid || this._onCanPlay(),
- this.autoUpdate &&
- !this._isConnectedToTicker &&
- (qD.shared.add(this.update, this),
- (this._isConnectedToTicker = !0));
- }),
- (e.prototype._onPlayStop = function () {
- this._isConnectedToTicker &&
- (qD.shared.remove(this.update, this),
- (this._isConnectedToTicker = !1));
- }),
- (e.prototype._onCanPlay = function () {
- var t = this.source;
- t.removeEventListener('canplay', this._onCanPlay),
- t.removeEventListener('canplaythrough', this._onCanPlay);
- var e = this.valid;
- this.resize(t.videoWidth, t.videoHeight),
- !e &&
- this._resolve &&
- (this._resolve(this), (this._resolve = null)),
- this._isSourcePlaying()
- ? this._onPlayStart()
- : this.autoPlay && t.play();
- }),
- (e.prototype.dispose = function () {
- this._isConnectedToTicker &&
- (qD.shared.remove(this.update, this),
- (this._isConnectedToTicker = !1));
- var e = this.source;
- e &&
- (e.removeEventListener('error', this._onError, !0),
- e.pause(),
- (e.src = ''),
- e.load()),
- t.prototype.dispose.call(this);
- }),
- Object.defineProperty(e.prototype, 'autoUpdate', {
- get: function () {
- return this._autoUpdate;
- },
- set: function (t) {
- t !== this._autoUpdate &&
- ((this._autoUpdate = t),
- !this._autoUpdate && this._isConnectedToTicker
- ? (qD.shared.remove(this.update, this),
- (this._isConnectedToTicker = !1))
- : this._autoUpdate &&
- !this._isConnectedToTicker &&
- this._isSourcePlaying() &&
- (qD.shared.add(this.update, this),
- (this._isConnectedToTicker = !0)));
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'updateFPS', {
- get: function () {
- return this._updateFPS;
- },
- set: function (t) {
- t !== this._updateFPS && (this._updateFPS = t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.test = function (t, r) {
- return (
- (globalThis.HTMLVideoElement && t instanceof HTMLVideoElement) ||
- e.TYPES.indexOf(r) > -1
- );
- }),
- (e.TYPES = ['mp4', 'm4v', 'webm', 'ogg', 'ogv', 'h264', 'avi', 'mov']),
- (e.MIME_TYPES = {
- ogv: 'video/ogg',
- mov: 'video/quicktime',
- m4v: 'video/mp4',
- }),
- e
- );
- })(hL),
- mL = (function (t) {
- function e(e) {
- return t.call(this, e) || this;
- }
- return (
- rL(e, t),
- (e.test = function (t) {
- return (
- !!globalThis.createImageBitmap &&
- 'undefined' != typeof ImageBitmap &&
- t instanceof ImageBitmap
- );
- }),
- e
- );
- })(hL);
- $D.push(fL, mL, lL, vL, pL, oL, dL, cL);
- var yL = (function (t) {
- function e() {
- return (null !== t && t.apply(this, arguments)) || this;
- }
- return (
- rL(e, t),
- (e.prototype.upload = function (t, e, r) {
- var n = t.gl;
- n.pixelStorei(
- n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,
- e.alphaMode === GP.UNPACK
- );
- var i = e.realWidth,
- o = e.realHeight;
- return (
- r.width === i && r.height === o
- ? n.texSubImage2D(
- e.target,
- 0,
- 0,
- 0,
- i,
- o,
- e.format,
- r.type,
- this.data
- )
- : ((r.width = i),
- (r.height = o),
- n.texImage2D(
- e.target,
- 0,
- r.internalFormat,
- i,
- o,
- 0,
- e.format,
- r.type,
- this.data
- )),
- !0
- );
- }),
- e
- );
- })(oL),
- gL = (function () {
- function t(t, e) {
- (this.width = Math.round(t || 100)),
- (this.height = Math.round(e || 100)),
- (this.stencil = !1),
- (this.depth = !1),
- (this.dirtyId = 0),
- (this.dirtyFormat = 0),
- (this.dirtySize = 0),
- (this.depthTexture = null),
- (this.colorTextures = []),
- (this.glFramebuffers = {}),
- (this.disposeRunner = new JD('disposeFramebuffer')),
- (this.multisample = WP.NONE);
- }
- return (
- Object.defineProperty(t.prototype, 'colorTexture', {
- get: function () {
- return this.colorTextures[0];
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype.addColorTexture = function (t, e) {
- return (
- void 0 === t && (t = 0),
- (this.colorTextures[t] =
- e ||
- new aL(null, {
- scaleMode: NP.NEAREST,
- resolution: 1,
- mipmap: BP.OFF,
- width: this.width,
- height: this.height,
- })),
- this.dirtyId++,
- this.dirtyFormat++,
- this
- );
- }),
- (t.prototype.addDepthTexture = function (t) {
- return (
- (this.depthTexture =
- t ||
- new aL(new yL(null, { width: this.width, height: this.height }), {
- scaleMode: NP.NEAREST,
- resolution: 1,
- width: this.width,
- height: this.height,
- mipmap: BP.OFF,
- format: MP.DEPTH_COMPONENT,
- type: LP.UNSIGNED_SHORT,
- })),
- this.dirtyId++,
- this.dirtyFormat++,
- this
- );
- }),
- (t.prototype.enableDepth = function () {
- return (this.depth = !0), this.dirtyId++, this.dirtyFormat++, this;
- }),
- (t.prototype.enableStencil = function () {
- return (this.stencil = !0), this.dirtyId++, this.dirtyFormat++, this;
- }),
- (t.prototype.resize = function (t, e) {
- if (
- ((t = Math.round(t)),
- (e = Math.round(e)),
- t !== this.width || e !== this.height)
- ) {
- (this.width = t),
- (this.height = e),
- this.dirtyId++,
- this.dirtySize++;
- for (var r = 0; r < this.colorTextures.length; r++) {
- var n = this.colorTextures[r],
- i = n.resolution;
- n.setSize(t / i, e / i);
- }
- if (this.depthTexture) {
- i = this.depthTexture.resolution;
- this.depthTexture.setSize(t / i, e / i);
- }
- }
- }),
- (t.prototype.dispose = function () {
- this.disposeRunner.emit(this, !1);
- }),
- (t.prototype.destroyDepthTexture = function () {
- this.depthTexture &&
- (this.depthTexture.destroy(),
- (this.depthTexture = null),
- ++this.dirtyId,
- ++this.dirtyFormat);
- }),
- t
- );
- })(),
- _L = (function (t) {
- function e(e) {
- void 0 === e && (e = {});
- var r = this;
- if ('number' == typeof e) {
- var n = arguments[0],
- i = arguments[1],
- o = arguments[2],
- s = arguments[3];
- e = { width: n, height: i, scaleMode: o, resolution: s };
- }
- return (
- (e.width = e.width || 100),
- (e.height = e.height || 100),
- (e.multisample = void 0 !== e.multisample ? e.multisample : WP.NONE),
- ((r = t.call(this, null, e) || this).mipmap = BP.OFF),
- (r.valid = !0),
- (r.clearColor = [0, 0, 0, 0]),
- (r.framebuffer = new gL(r.realWidth, r.realHeight).addColorTexture(
- 0,
- r
- )),
- (r.framebuffer.multisample = e.multisample),
- (r.maskStack = []),
- (r.filterStack = [{}]),
- r
- );
- }
- return (
- rL(e, t),
- (e.prototype.resize = function (t, e) {
- this.framebuffer.resize(t * this.resolution, e * this.resolution),
- this.setRealSize(this.framebuffer.width, this.framebuffer.height);
- }),
- (e.prototype.dispose = function () {
- this.framebuffer.dispose(), t.prototype.dispose.call(this);
- }),
- (e.prototype.destroy = function () {
- t.prototype.destroy.call(this),
- this.framebuffer.destroyDepthTexture(),
- (this.framebuffer = null);
- }),
- e
- );
- })(aL),
- bL = (function () {
- function t() {
- (this.x0 = 0),
- (this.y0 = 0),
- (this.x1 = 1),
- (this.y1 = 0),
- (this.x2 = 1),
- (this.y2 = 1),
- (this.x3 = 0),
- (this.y3 = 1),
- (this.uvsFloat32 = new Float32Array(8));
- }
- return (
- (t.prototype.set = function (t, e, r) {
- var n = e.width,
- i = e.height;
- if (r) {
- var o = t.width / 2 / n,
- s = t.height / 2 / i,
- a = t.x / n + o,
- u = t.y / i + s;
- (r = FD.add(r, FD.NW)),
- (this.x0 = a + o * FD.uX(r)),
- (this.y0 = u + s * FD.uY(r)),
- (r = FD.add(r, 2)),
- (this.x1 = a + o * FD.uX(r)),
- (this.y1 = u + s * FD.uY(r)),
- (r = FD.add(r, 2)),
- (this.x2 = a + o * FD.uX(r)),
- (this.y2 = u + s * FD.uY(r)),
- (r = FD.add(r, 2)),
- (this.x3 = a + o * FD.uX(r)),
- (this.y3 = u + s * FD.uY(r));
- } else
- (this.x0 = t.x / n),
- (this.y0 = t.y / i),
- (this.x1 = (t.x + t.width) / n),
- (this.y1 = t.y / i),
- (this.x2 = (t.x + t.width) / n),
- (this.y2 = (t.y + t.height) / i),
- (this.x3 = t.x / n),
- (this.y3 = (t.y + t.height) / i);
- (this.uvsFloat32[0] = this.x0),
- (this.uvsFloat32[1] = this.y0),
- (this.uvsFloat32[2] = this.x1),
- (this.uvsFloat32[3] = this.y1),
- (this.uvsFloat32[4] = this.x2),
- (this.uvsFloat32[5] = this.y2),
- (this.uvsFloat32[6] = this.x3),
- (this.uvsFloat32[7] = this.y3);
- }),
- (t.prototype.toString = function () {
- return (
- '[@pixi/core:TextureUvs x0=' +
- this.x0 +
- ' y0=' +
- this.y0 +
- ' x1=' +
- this.x1 +
- ' y1=' +
- this.y1 +
- ' x2=' +
- this.x2 +
- ' y2=' +
- this.y2 +
- ' x3=' +
- this.x3 +
- ' y3=' +
- this.y3 +
- ']'
- );
- }),
- t
- );
- })(),
- TL = new bL();
- function xL(t) {
- (t.destroy = function () {}),
- (t.on = function () {}),
- (t.once = function () {}),
- (t.emit = function () {});
- }
- var EL = (function (t) {
- function e(r, n, i, o, s, a) {
- var u = t.call(this) || this;
- if (
- ((u.noFrame = !1),
- n || ((u.noFrame = !0), (n = new TD(0, 0, 1, 1))),
- r instanceof e && (r = r.baseTexture),
- (u.baseTexture = r),
- (u._frame = n),
- (u.trim = o),
- (u.valid = !1),
- (u._uvs = TL),
- (u.uvMatrix = null),
- (u.orig = i || n),
- (u._rotate = Number(s || 0)),
- !0 === s)
- )
- u._rotate = 2;
- else if (u._rotate % 2 != 0)
- throw new Error(
- 'attempt to use diamond-shaped UVs. If you are sure, set rotation manually'
- );
- return (
- (u.defaultAnchor = a ? new _D(a.x, a.y) : new _D(0, 0)),
- (u._updateID = 0),
- (u.textureCacheIds = []),
- r.valid
- ? u.noFrame
- ? r.valid && u.onBaseTextureUpdated(r)
- : (u.frame = n)
- : r.once('loaded', u.onBaseTextureUpdated, u),
- u.noFrame && r.on('update', u.onBaseTextureUpdated, u),
- u
- );
- }
- return (
- rL(e, t),
- (e.prototype.update = function () {
- this.baseTexture.resource && this.baseTexture.resource.update();
- }),
- (e.prototype.onBaseTextureUpdated = function (t) {
- if (this.noFrame) {
- if (!this.baseTexture.valid) return;
- (this._frame.width = t.width),
- (this._frame.height = t.height),
- (this.valid = !0),
- this.updateUvs();
- } else this.frame = this._frame;
- this.emit('update', this);
- }),
- (e.prototype.destroy = function (t) {
- if (this.baseTexture) {
- if (t) {
- var r = this.baseTexture.resource;
- r && r.url && hD[r.url] && e.removeFromCache(r.url),
- this.baseTexture.destroy();
- }
- this.baseTexture.off('loaded', this.onBaseTextureUpdated, this),
- this.baseTexture.off('update', this.onBaseTextureUpdated, this),
- (this.baseTexture = null);
- }
- (this._frame = null),
- (this._uvs = null),
- (this.trim = null),
- (this.orig = null),
- (this.valid = !1),
- e.removeFromCache(this),
- (this.textureCacheIds = null);
- }),
- (e.prototype.clone = function () {
- var t = this._frame.clone(),
- r = this._frame === this.orig ? t : this.orig.clone(),
- n = new e(
- this.baseTexture,
- !this.noFrame && t,
- r,
- this.trim && this.trim.clone(),
- this.rotate,
- this.defaultAnchor
- );
- return this.noFrame && (n._frame = t), n;
- }),
- (e.prototype.updateUvs = function () {
- this._uvs === TL && (this._uvs = new bL()),
- this._uvs.set(this._frame, this.baseTexture, this.rotate),
- this._updateID++;
- }),
- (e.from = function (t, r, n) {
- void 0 === r && (r = {}),
- void 0 === n && (n = vA.STRICT_TEXTURE_CACHE);
- var i = 'string' == typeof t,
- o = null;
- if (i) o = t;
- else if (t instanceof aL) {
- if (!t.cacheId) {
- var s = (r && r.pixiIdPrefix) || 'pixiid';
- (t.cacheId = s + '-' + oD()), aL.addToCache(t, t.cacheId);
- }
- o = t.cacheId;
- } else {
- if (!t._pixiId) {
- s = (r && r.pixiIdPrefix) || 'pixiid';
- t._pixiId = s + '_' + oD();
- }
- o = t._pixiId;
- }
- var a = hD[o];
- if (i && n && !a)
- throw new Error(
- 'The cacheId "' + o + '" does not exist in TextureCache.'
- );
- return (
- a || t instanceof aL
- ? !a && t instanceof aL && ((a = new e(t)), e.addToCache(a, o))
- : (r.resolution || (r.resolution = pD(t)),
- ((a = new e(new aL(t, r))).baseTexture.cacheId = o),
- aL.addToCache(a.baseTexture, o),
- e.addToCache(a, o)),
- a
- );
- }),
- (e.fromURL = function (t, r) {
- var n = Object.assign(
- { autoLoad: !1 },
- null == r ? void 0 : r.resourceOptions
- ),
- i = e.from(t, Object.assign({ resourceOptions: n }, r), !1),
- o = i.baseTexture.resource;
- return i.baseTexture.valid
- ? Promise.resolve(i)
- : o.load().then(function () {
- return Promise.resolve(i);
- });
- }),
- (e.fromBuffer = function (t, r, n, i) {
- return new e(aL.fromBuffer(t, r, n, i));
- }),
- (e.fromLoader = function (t, r, n, i) {
- var o = new aL(
- t,
- Object.assign({ scaleMode: vA.SCALE_MODE, resolution: pD(r) }, i)
- ),
- s = o.resource;
- s instanceof fL && (s.url = r);
- var a = new e(o);
- return (
- n || (n = r),
- aL.addToCache(a.baseTexture, n),
- e.addToCache(a, n),
- n !== r && (aL.addToCache(a.baseTexture, r), e.addToCache(a, r)),
- a.baseTexture.valid
- ? Promise.resolve(a)
- : new Promise(function (t) {
- a.baseTexture.once('loaded', function () {
- return t(a);
- });
- })
- );
- }),
- (e.addToCache = function (t, e) {
- e &&
- (-1 === t.textureCacheIds.indexOf(e) && t.textureCacheIds.push(e),
- hD[e] &&
- console.warn(
- 'Texture added to the cache with an id [' +
- e +
- '] that already had an entry'
- ),
- (hD[e] = t));
- }),
- (e.removeFromCache = function (t) {
- if ('string' == typeof t) {
- var e = hD[t];
- if (e) {
- var r = e.textureCacheIds.indexOf(t);
- return r > -1 && e.textureCacheIds.splice(r, 1), delete hD[t], e;
- }
- } else if (t && t.textureCacheIds) {
- for (var n = 0; n < t.textureCacheIds.length; ++n)
- hD[t.textureCacheIds[n]] === t && delete hD[t.textureCacheIds[n]];
- return (t.textureCacheIds.length = 0), t;
- }
- return null;
- }),
- Object.defineProperty(e.prototype, 'resolution', {
- get: function () {
- return this.baseTexture.resolution;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'frame', {
- get: function () {
- return this._frame;
- },
- set: function (t) {
- (this._frame = t), (this.noFrame = !1);
- var e = t.x,
- r = t.y,
- n = t.width,
- i = t.height,
- o = e + n > this.baseTexture.width,
- s = r + i > this.baseTexture.height;
- if (o || s) {
- var a = o && s ? 'and' : 'or',
- u =
- 'X: ' +
- e +
- ' + ' +
- n +
- ' = ' +
- (e + n) +
- ' > ' +
- this.baseTexture.width,
- c =
- 'Y: ' +
- r +
- ' + ' +
- i +
- ' = ' +
- (r + i) +
- ' > ' +
- this.baseTexture.height;
- throw new Error(
- 'Texture Error: frame does not fit inside the base Texture dimensions: ' +
- u +
- ' ' +
- a +
- ' ' +
- c
- );
- }
- (this.valid = n && i && this.baseTexture.valid),
- this.trim || this.rotate || (this.orig = t),
- this.valid && this.updateUvs();
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'rotate', {
- get: function () {
- return this._rotate;
- },
- set: function (t) {
- (this._rotate = t), this.valid && this.updateUvs();
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'width', {
- get: function () {
- return this.orig.width;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'height', {
- get: function () {
- return this.orig.height;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype.castToBaseTexture = function () {
- return this.baseTexture;
- }),
- Object.defineProperty(e, 'EMPTY', {
- get: function () {
- return (
- e._EMPTY ||
- ((e._EMPTY = new e(new aL())),
- xL(e._EMPTY),
- xL(e._EMPTY.baseTexture)),
- e._EMPTY
- );
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e, 'WHITE', {
- get: function () {
- if (!e._WHITE) {
- var t = vA.ADAPTER.createCanvas(16, 16),
- r = t.getContext('2d');
- (t.width = 16),
- (t.height = 16),
- (r.fillStyle = 'white'),
- r.fillRect(0, 0, 16, 16),
- (e._WHITE = new e(aL.from(t))),
- xL(e._WHITE),
- xL(e._WHITE.baseTexture);
- }
- return e._WHITE;
- },
- enumerable: !1,
- configurable: !0,
- }),
- e
- );
- })(yA),
- SL = (function (t) {
- function e(e, r) {
- var n = t.call(this, e, r) || this;
- return (
- (n.valid = !0),
- (n.filterFrame = null),
- (n.filterPoolKey = null),
- n.updateUvs(),
- n
- );
- }
- return (
- rL(e, t),
- Object.defineProperty(e.prototype, 'framebuffer', {
- get: function () {
- return this.baseTexture.framebuffer;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'multisample', {
- get: function () {
- return this.framebuffer.multisample;
- },
- set: function (t) {
- this.framebuffer.multisample = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype.resize = function (t, e, r) {
- void 0 === r && (r = !0);
- var n = this.baseTexture.resolution,
- i = Math.round(t * n) / n,
- o = Math.round(e * n) / n;
- (this.valid = i > 0 && o > 0),
- (this._frame.width = this.orig.width = i),
- (this._frame.height = this.orig.height = o),
- r && this.baseTexture.resize(i, o),
- this.updateUvs();
- }),
- (e.prototype.setResolution = function (t) {
- var e = this.baseTexture;
- e.resolution !== t &&
- (e.setResolution(t), this.resize(e.width, e.height, !1));
- }),
- (e.create = function (t) {
- for (var r = arguments, n = [], i = 1; i < arguments.length; i++)
- n[i - 1] = r[i];
- return (
- 'number' == typeof t &&
- (aD(
- '6.0.0',
- 'Arguments (width, height, scaleMode, resolution) have been deprecated.'
- ),
- (t = {
- width: t,
- height: n[0],
- scaleMode: n[1],
- resolution: n[2],
- })),
- new e(new _L(t))
- );
- }),
- e
- );
- })(EL),
- wL = (function () {
- function t(t) {
- (this.texturePool = {}),
- (this.textureOptions = t || {}),
- (this.enableFullScreen = !1),
- (this._pixelsWidth = 0),
- (this._pixelsHeight = 0);
- }
- return (
- (t.prototype.createTexture = function (t, e, r) {
- void 0 === r && (r = WP.NONE);
- var n = new _L(
- Object.assign(
- { width: t, height: e, resolution: 1, multisample: r },
- this.textureOptions
- )
- );
- return new SL(n);
- }),
- (t.prototype.getOptimalTexture = function (t, e, r, n) {
- var i;
- void 0 === r && (r = 1),
- void 0 === n && (n = WP.NONE),
- (t = Math.ceil(t * r - 1e-6)),
- (e = Math.ceil(e * r - 1e-6)),
- this.enableFullScreen &&
- t === this._pixelsWidth &&
- e === this._pixelsHeight
- ? (i = n > 1 ? -n : -1)
- : ((i =
- (((65535 & (t = $M(t))) << 16) | (65535 & (e = $M(e)))) >>>
- 0),
- n > 1 && (i += 4294967296 * n)),
- this.texturePool[i] || (this.texturePool[i] = []);
- var o = this.texturePool[i].pop();
- return (
- o || (o = this.createTexture(t, e, n)),
- (o.filterPoolKey = i),
- o.setResolution(r),
- o
- );
- }),
- (t.prototype.getFilterTexture = function (t, e, r) {
- var n = this.getOptimalTexture(
- t.width,
- t.height,
- e || t.resolution,
- r || WP.NONE
- );
- return (n.filterFrame = t.filterFrame), n;
- }),
- (t.prototype.returnTexture = function (t) {
- var e = t.filterPoolKey;
- (t.filterFrame = null), this.texturePool[e].push(t);
- }),
- (t.prototype.returnFilterTexture = function (t) {
- this.returnTexture(t);
- }),
- (t.prototype.clear = function (t) {
- if ((t = !1 !== t))
- for (var e in this.texturePool) {
- var r = this.texturePool[e];
- if (r) for (var n = 0; n < r.length; n++) r[n].destroy(!0);
- }
- this.texturePool = {};
- }),
- (t.prototype.setScreenSize = function (t) {
- if (
- t.width !== this._pixelsWidth ||
- t.height !== this._pixelsHeight
- ) {
- for (var e in ((this.enableFullScreen =
- t.width > 0 && t.height > 0),
- this.texturePool))
- if (Number(e) < 0) {
- var r = this.texturePool[e];
- if (r) for (var n = 0; n < r.length; n++) r[n].destroy(!0);
- this.texturePool[e] = [];
- }
- (this._pixelsWidth = t.width), (this._pixelsHeight = t.height);
- }
- }),
- (t.SCREEN_KEY = -1),
- t
- );
- })(),
- RL = (function () {
- function t(t, e, r, n, i, o, s) {
- void 0 === e && (e = 0),
- void 0 === r && (r = !1),
- void 0 === n && (n = LP.FLOAT),
- (this.buffer = t),
- (this.size = e),
- (this.normalized = r),
- (this.type = n),
- (this.stride = i),
- (this.start = o),
- (this.instance = s);
- }
- return (
- (t.prototype.destroy = function () {
- this.buffer = null;
- }),
- (t.from = function (e, r, n, i, o) {
- return new t(e, r, n, i, o);
- }),
- t
- );
- })(),
- CL = 0,
- PL = (function () {
- function t(t, e, r) {
- void 0 === e && (e = !0),
- void 0 === r && (r = !1),
- (this.data = t || new Float32Array(1)),
- (this._glBuffers = {}),
- (this._updateID = 0),
- (this.index = r),
- (this.static = e),
- (this.id = CL++),
- (this.disposeRunner = new JD('disposeBuffer'));
- }
- return (
- (t.prototype.update = function (t) {
- t instanceof Array && (t = new Float32Array(t)),
- (this.data = t || this.data),
- this._updateID++;
- }),
- (t.prototype.dispose = function () {
- this.disposeRunner.emit(this, !1);
- }),
- (t.prototype.destroy = function () {
- this.dispose(), (this.data = null);
- }),
- Object.defineProperty(t.prototype, 'index', {
- get: function () {
- return this.type === YP.ELEMENT_ARRAY_BUFFER;
- },
- set: function (t) {
- this.type = t ? YP.ELEMENT_ARRAY_BUFFER : YP.ARRAY_BUFFER;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.from = function (e) {
- return e instanceof Array && (e = new Float32Array(e)), new t(e);
- }),
- t
- );
- })(),
- AL = {
- Float32Array: Float32Array,
- Uint32Array: Uint32Array,
- Int32Array: Int32Array,
- Uint8Array: Uint8Array,
- };
- var OL = { 5126: 4, 5123: 2, 5121: 1 },
- IL = 0,
- ML = {
- Float32Array: Float32Array,
- Uint32Array: Uint32Array,
- Int32Array: Int32Array,
- Uint8Array: Uint8Array,
- Uint16Array: Uint16Array,
- },
- DL = (function () {
- function t(t, e) {
- void 0 === t && (t = []),
- void 0 === e && (e = {}),
- (this.buffers = t),
- (this.indexBuffer = null),
- (this.attributes = e),
- (this.glVertexArrayObjects = {}),
- (this.id = IL++),
- (this.instanced = !1),
- (this.instanceCount = 1),
- (this.disposeRunner = new JD('disposeGeometry')),
- (this.refCount = 0);
- }
- return (
- (t.prototype.addAttribute = function (t, e, r, n, i, o, s, a) {
- if (
- (void 0 === r && (r = 0),
- void 0 === n && (n = !1),
- void 0 === a && (a = !1),
- !e)
- )
- throw new Error(
- 'You must pass a buffer when creating an attribute'
- );
- e instanceof PL ||
- (e instanceof Array && (e = new Float32Array(e)), (e = new PL(e)));
- var u = t.split('|');
- if (u.length > 1) {
- for (var c = 0; c < u.length; c++)
- this.addAttribute(u[c], e, r, n, i);
- return this;
- }
- var h = this.buffers.indexOf(e);
- return (
- -1 === h && (this.buffers.push(e), (h = this.buffers.length - 1)),
- (this.attributes[t] = new RL(h, r, n, i, o, s, a)),
- (this.instanced = this.instanced || a),
- this
- );
- }),
- (t.prototype.getAttribute = function (t) {
- return this.attributes[t];
- }),
- (t.prototype.getBuffer = function (t) {
- return this.buffers[this.getAttribute(t).buffer];
- }),
- (t.prototype.addIndex = function (t) {
- return (
- t instanceof PL ||
- (t instanceof Array && (t = new Uint16Array(t)), (t = new PL(t))),
- (t.type = YP.ELEMENT_ARRAY_BUFFER),
- (this.indexBuffer = t),
- -1 === this.buffers.indexOf(t) && this.buffers.push(t),
- this
- );
- }),
- (t.prototype.getIndex = function () {
- return this.indexBuffer;
- }),
- (t.prototype.interleave = function () {
- if (
- 1 === this.buffers.length ||
- (2 === this.buffers.length && this.indexBuffer)
- )
- return this;
- var t,
- e = [],
- r = [],
- n = new PL();
- for (t in this.attributes) {
- var i = this.attributes[t],
- o = this.buffers[i.buffer];
- e.push(o.data), r.push((i.size * OL[i.type]) / 4), (i.buffer = 0);
- }
- for (
- n.data = (function (t, e) {
- for (var r = 0, n = 0, i = {}, o = 0; o < t.length; o++)
- (n += e[o]), (r += t[o].length);
- var s = new ArrayBuffer(4 * r),
- a = null,
- u = 0;
- for (o = 0; o < t.length; o++) {
- var c = e[o],
- h = t[o],
- l = QM(h);
- i[l] || (i[l] = new AL[l](s)), (a = i[l]);
- for (var d = 0; d < h.length; d++)
- a[((d / c) | 0) * n + u + (d % c)] = h[d];
- u += c;
- }
- return new Float32Array(s);
- })(e, r),
- t = 0;
- t < this.buffers.length;
- t++
- )
- this.buffers[t] !== this.indexBuffer && this.buffers[t].destroy();
- return (
- (this.buffers = [n]),
- this.indexBuffer && this.buffers.push(this.indexBuffer),
- this
- );
- }),
- (t.prototype.getSize = function () {
- for (var t in this.attributes) {
- var e = this.attributes[t];
- return (
- this.buffers[e.buffer].data.length / (e.stride / 4 || e.size)
- );
- }
- return 0;
- }),
- (t.prototype.dispose = function () {
- this.disposeRunner.emit(this, !1);
- }),
- (t.prototype.destroy = function () {
- this.dispose(),
- (this.buffers = null),
- (this.indexBuffer = null),
- (this.attributes = null);
- }),
- (t.prototype.clone = function () {
- for (var e = new t(), r = 0; r < this.buffers.length; r++)
- e.buffers[r] = new PL(this.buffers[r].data.slice(0));
- for (var r in this.attributes) {
- var n = this.attributes[r];
- e.attributes[r] = new RL(
- n.buffer,
- n.size,
- n.normalized,
- n.type,
- n.stride,
- n.start,
- n.instance
- );
- }
- return (
- this.indexBuffer &&
- ((e.indexBuffer =
- e.buffers[this.buffers.indexOf(this.indexBuffer)]),
- (e.indexBuffer.type = YP.ELEMENT_ARRAY_BUFFER)),
- e
- );
- }),
- (t.merge = function (e) {
- for (
- var r, n = new t(), i = [], o = [], s = [], a = 0;
- a < e.length;
- a++
- ) {
- r = e[a];
- for (var u = 0; u < r.buffers.length; u++)
- (o[u] = o[u] || 0),
- (o[u] += r.buffers[u].data.length),
- (s[u] = 0);
- }
- for (a = 0; a < r.buffers.length; a++)
- (i[a] = new ML[QM(r.buffers[a].data)](o[a])),
- (n.buffers[a] = new PL(i[a]));
- for (a = 0; a < e.length; a++) {
- r = e[a];
- for (u = 0; u < r.buffers.length; u++)
- i[u].set(r.buffers[u].data, s[u]),
- (s[u] += r.buffers[u].data.length);
- }
- if (((n.attributes = r.attributes), r.indexBuffer)) {
- (n.indexBuffer = n.buffers[r.buffers.indexOf(r.indexBuffer)]),
- (n.indexBuffer.type = YP.ELEMENT_ARRAY_BUFFER);
- var c = 0,
- h = 0,
- l = 0,
- d = 0;
- for (a = 0; a < r.buffers.length; a++)
- if (r.buffers[a] !== r.indexBuffer) {
- d = a;
- break;
- }
- for (var a in r.attributes) {
- var f = r.attributes[a];
- (0 | f.buffer) === d && (h += (f.size * OL[f.type]) / 4);
- }
- for (a = 0; a < e.length; a++) {
- var p = e[a].indexBuffer.data;
- for (u = 0; u < p.length; u++) n.indexBuffer.data[u + l] += c;
- (c += e[a].buffers[d].data.length / h), (l += p.length);
- }
- }
- return n;
- }),
- t
- );
- })(),
- LL = (function (t) {
- function e() {
- var e = t.call(this) || this;
- return (
- e
- .addAttribute(
- 'aVertexPosition',
- new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
- )
- .addIndex([0, 1, 3, 2]),
- e
- );
- }
- return rL(e, t), e;
- })(DL),
- FL = (function (t) {
- function e() {
- var e = t.call(this) || this;
- return (
- (e.vertices = new Float32Array([-1, -1, 1, -1, 1, 1, -1, 1])),
- (e.uvs = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])),
- (e.vertexBuffer = new PL(e.vertices)),
- (e.uvBuffer = new PL(e.uvs)),
- e
- .addAttribute('aVertexPosition', e.vertexBuffer)
- .addAttribute('aTextureCoord', e.uvBuffer)
- .addIndex([0, 1, 2, 0, 2, 3]),
- e
- );
- }
- return (
- rL(e, t),
- (e.prototype.map = function (t, e) {
- var r = 0,
- n = 0;
- return (
- (this.uvs[0] = r),
- (this.uvs[1] = n),
- (this.uvs[2] = r + e.width / t.width),
- (this.uvs[3] = n),
- (this.uvs[4] = r + e.width / t.width),
- (this.uvs[5] = n + e.height / t.height),
- (this.uvs[6] = r),
- (this.uvs[7] = n + e.height / t.height),
- (r = e.x),
- (n = e.y),
- (this.vertices[0] = r),
- (this.vertices[1] = n),
- (this.vertices[2] = r + e.width),
- (this.vertices[3] = n),
- (this.vertices[4] = r + e.width),
- (this.vertices[5] = n + e.height),
- (this.vertices[6] = r),
- (this.vertices[7] = n + e.height),
- this.invalidate(),
- this
- );
- }),
- (e.prototype.invalidate = function () {
- return this.vertexBuffer._updateID++, this.uvBuffer._updateID++, this;
- }),
- e
- );
- })(DL),
- NL = 0,
- kL = (function () {
- function t(t, e, r) {
- (this.group = !0),
- (this.syncUniforms = {}),
- (this.dirtyId = 0),
- (this.id = NL++),
- (this.static = !!e),
- (this.ubo = !!r),
- t instanceof PL
- ? ((this.buffer = t),
- (this.buffer.type = YP.UNIFORM_BUFFER),
- (this.autoManage = !1),
- (this.ubo = !0))
- : ((this.uniforms = t),
- this.ubo &&
- ((this.buffer = new PL(new Float32Array(1))),
- (this.buffer.type = YP.UNIFORM_BUFFER),
- (this.autoManage = !0)));
- }
- return (
- (t.prototype.update = function () {
- this.dirtyId++,
- !this.autoManage && this.buffer && this.buffer.update();
- }),
- (t.prototype.add = function (e, r, n) {
- if (this.ubo)
- throw new Error(
- '[UniformGroup] uniform groups in ubo mode cannot be modified, or have uniform groups nested in them'
- );
- this.uniforms[e] = new t(r, n);
- }),
- (t.from = function (e, r, n) {
- return new t(e, r, n);
- }),
- (t.uboFrom = function (e, r) {
- return new t(e, null == r || r, !0);
- }),
- t
- );
- })(),
- BL = (function () {
- function t() {
- (this.renderTexture = null),
- (this.target = null),
- (this.legacy = !1),
- (this.resolution = 1),
- (this.multisample = WP.NONE),
- (this.sourceFrame = new TD()),
- (this.destinationFrame = new TD()),
- (this.bindingSourceFrame = new TD()),
- (this.bindingDestinationFrame = new TD()),
- (this.filters = []),
- (this.transform = null);
- }
- return (
- (t.prototype.clear = function () {
- (this.target = null),
- (this.filters = null),
- (this.renderTexture = null);
- }),
- t
- );
- })(),
- GL = [new _D(), new _D(), new _D(), new _D()],
- UL = new CD(),
- jL = (function () {
- function t(t) {
- (this.renderer = t),
- (this.defaultFilterStack = [{}]),
- (this.texturePool = new wL()),
- this.texturePool.setScreenSize(t.view),
- (this.statePool = []),
- (this.quad = new LL()),
- (this.quadUv = new FL()),
- (this.tempRect = new TD()),
- (this.activeState = {}),
- (this.globalUniforms = new kL(
- {
- outputFrame: new TD(),
- inputSize: new Float32Array(4),
- inputPixel: new Float32Array(4),
- inputClamp: new Float32Array(4),
- resolution: 1,
- filterArea: new Float32Array(4),
- filterClamp: new Float32Array(4),
- },
- !0
- )),
- (this.forceClear = !1),
- (this.useMaxPadding = !1);
- }
- return (
- (t.prototype.push = function (t, e) {
- for (
- var r,
- n,
- i = this.renderer,
- o = this.defaultFilterStack,
- s = this.statePool.pop() || new BL(),
- a = this.renderer.renderTexture,
- u = e[0].resolution,
- c = e[0].multisample,
- h = e[0].padding,
- l = e[0].autoFit,
- d = null === (r = e[0].legacy) || void 0 === r || r,
- f = 1;
- f < e.length;
- f++
- ) {
- var p = e[f];
- (u = Math.min(u, p.resolution)),
- (c = Math.min(c, p.multisample)),
- (h = this.useMaxPadding ? Math.max(h, p.padding) : h + p.padding),
- (l = l && p.autoFit),
- (d = d || null === (n = p.legacy) || void 0 === n || n);
- }
- 1 === o.length &&
- (this.defaultFilterStack[0].renderTexture = a.current),
- o.push(s),
- (s.resolution = u),
- (s.multisample = c),
- (s.legacy = d),
- (s.target = t),
- s.sourceFrame.copyFrom(t.filterArea || t.getBounds(!0)),
- s.sourceFrame.pad(h);
- var v = this.tempRect.copyFrom(a.sourceFrame);
- i.projection.transform &&
- this.transformAABB(UL.copyFrom(i.projection.transform).invert(), v),
- l
- ? (s.sourceFrame.fit(v),
- (s.sourceFrame.width <= 0 || s.sourceFrame.height <= 0) &&
- ((s.sourceFrame.width = 0), (s.sourceFrame.height = 0)))
- : s.sourceFrame.intersects(v) ||
- ((s.sourceFrame.width = 0), (s.sourceFrame.height = 0)),
- this.roundFrame(
- s.sourceFrame,
- a.current ? a.current.resolution : i.resolution,
- a.sourceFrame,
- a.destinationFrame,
- i.projection.transform
- ),
- (s.renderTexture = this.getOptimalFilterTexture(
- s.sourceFrame.width,
- s.sourceFrame.height,
- u,
- c
- )),
- (s.filters = e),
- (s.destinationFrame.width = s.renderTexture.width),
- (s.destinationFrame.height = s.renderTexture.height);
- var m = this.tempRect;
- (m.x = 0),
- (m.y = 0),
- (m.width = s.sourceFrame.width),
- (m.height = s.sourceFrame.height),
- (s.renderTexture.filterFrame = s.sourceFrame),
- s.bindingSourceFrame.copyFrom(a.sourceFrame),
- s.bindingDestinationFrame.copyFrom(a.destinationFrame),
- (s.transform = i.projection.transform),
- (i.projection.transform = null),
- a.bind(s.renderTexture, s.sourceFrame, m),
- i.framebuffer.clear(0, 0, 0, 0);
- }),
- (t.prototype.pop = function () {
- var t = this.defaultFilterStack,
- e = t.pop(),
- r = e.filters;
- this.activeState = e;
- var n = this.globalUniforms.uniforms;
- (n.outputFrame = e.sourceFrame), (n.resolution = e.resolution);
- var i = n.inputSize,
- o = n.inputPixel,
- s = n.inputClamp;
- if (
- ((i[0] = e.destinationFrame.width),
- (i[1] = e.destinationFrame.height),
- (i[2] = 1 / i[0]),
- (i[3] = 1 / i[1]),
- (o[0] = Math.round(i[0] * e.resolution)),
- (o[1] = Math.round(i[1] * e.resolution)),
- (o[2] = 1 / o[0]),
- (o[3] = 1 / o[1]),
- (s[0] = 0.5 * o[2]),
- (s[1] = 0.5 * o[3]),
- (s[2] = e.sourceFrame.width * i[2] - 0.5 * o[2]),
- (s[3] = e.sourceFrame.height * i[3] - 0.5 * o[3]),
- e.legacy)
- ) {
- var a = n.filterArea;
- (a[0] = e.destinationFrame.width),
- (a[1] = e.destinationFrame.height),
- (a[2] = e.sourceFrame.x),
- (a[3] = e.sourceFrame.y),
- (n.filterClamp = n.inputClamp);
- }
- this.globalUniforms.update();
- var u = t[t.length - 1];
- if ((this.renderer.framebuffer.blit(), 1 === r.length))
- r[0].apply(this, e.renderTexture, u.renderTexture, UP.BLEND, e),
- this.returnFilterTexture(e.renderTexture);
- else {
- var c = e.renderTexture,
- h = this.getOptimalFilterTexture(c.width, c.height, e.resolution);
- h.filterFrame = c.filterFrame;
- var l = 0;
- for (l = 0; l < r.length - 1; ++l) {
- 1 === l &&
- e.multisample > 1 &&
- ((h = this.getOptimalFilterTexture(
- c.width,
- c.height,
- e.resolution
- )).filterFrame = c.filterFrame),
- r[l].apply(this, c, h, UP.CLEAR, e);
- var d = c;
- (c = h), (h = d);
- }
- r[l].apply(this, c, u.renderTexture, UP.BLEND, e),
- l > 1 &&
- e.multisample > 1 &&
- this.returnFilterTexture(e.renderTexture),
- this.returnFilterTexture(c),
- this.returnFilterTexture(h);
- }
- e.clear(), this.statePool.push(e);
- }),
- (t.prototype.bindAndClear = function (t, e) {
- void 0 === e && (e = UP.CLEAR);
- var r = this.renderer,
- n = r.renderTexture,
- i = r.state;
- if (
- (t ===
- this.defaultFilterStack[this.defaultFilterStack.length - 1]
- .renderTexture
- ? (this.renderer.projection.transform =
- this.activeState.transform)
- : (this.renderer.projection.transform = null),
- t && t.filterFrame)
- ) {
- var o = this.tempRect;
- (o.x = 0),
- (o.y = 0),
- (o.width = t.filterFrame.width),
- (o.height = t.filterFrame.height),
- n.bind(t, t.filterFrame, o);
- } else
- t !==
- this.defaultFilterStack[this.defaultFilterStack.length - 1]
- .renderTexture
- ? n.bind(t)
- : this.renderer.renderTexture.bind(
- t,
- this.activeState.bindingSourceFrame,
- this.activeState.bindingDestinationFrame
- );
- var s = 1 & i.stateId || this.forceClear;
- (e === UP.CLEAR || (e === UP.BLIT && s)) &&
- this.renderer.framebuffer.clear(0, 0, 0, 0);
- }),
- (t.prototype.applyFilter = function (t, e, r, n) {
- var i = this.renderer;
- i.state.set(t.state),
- this.bindAndClear(r, n),
- (t.uniforms.uSampler = e),
- (t.uniforms.filterGlobals = this.globalUniforms),
- i.shader.bind(t),
- (t.legacy = !!t.program.attributeData.aTextureCoord),
- t.legacy
- ? (this.quadUv.map(e._frame, e.filterFrame),
- i.geometry.bind(this.quadUv),
- i.geometry.draw(IP.TRIANGLES))
- : (i.geometry.bind(this.quad),
- i.geometry.draw(IP.TRIANGLE_STRIP));
- }),
- (t.prototype.calculateSpriteMatrix = function (t, e) {
- var r = this.activeState,
- n = r.sourceFrame,
- i = r.destinationFrame,
- o = e._texture.orig,
- s = t.set(i.width, 0, 0, i.height, n.x, n.y),
- a = e.worldTransform.copyTo(CD.TEMP_MATRIX);
- return (
- a.invert(),
- s.prepend(a),
- s.scale(1 / o.width, 1 / o.height),
- s.translate(e.anchor.x, e.anchor.y),
- s
- );
- }),
- (t.prototype.destroy = function () {
- (this.renderer = null), this.texturePool.clear(!1);
- }),
- (t.prototype.getOptimalFilterTexture = function (t, e, r, n) {
- return (
- void 0 === r && (r = 1),
- void 0 === n && (n = WP.NONE),
- this.texturePool.getOptimalTexture(t, e, r, n)
- );
- }),
- (t.prototype.getFilterTexture = function (t, e, r) {
- if ('number' == typeof t) {
- var n = t;
- (t = e), (e = n);
- }
- t = t || this.activeState.renderTexture;
- var i = this.texturePool.getOptimalTexture(
- t.width,
- t.height,
- e || t.resolution,
- r || WP.NONE
- );
- return (i.filterFrame = t.filterFrame), i;
- }),
- (t.prototype.returnFilterTexture = function (t) {
- this.texturePool.returnTexture(t);
- }),
- (t.prototype.emptyPool = function () {
- this.texturePool.clear(!0);
- }),
- (t.prototype.resize = function () {
- this.texturePool.setScreenSize(this.renderer.view);
- }),
- (t.prototype.transformAABB = function (t, e) {
- var r = GL[0],
- n = GL[1],
- i = GL[2],
- o = GL[3];
- r.set(e.left, e.top),
- n.set(e.left, e.bottom),
- i.set(e.right, e.top),
- o.set(e.right, e.bottom),
- t.apply(r, r),
- t.apply(n, n),
- t.apply(i, i),
- t.apply(o, o);
- var s = Math.min(r.x, n.x, i.x, o.x),
- a = Math.min(r.y, n.y, i.y, o.y),
- u = Math.max(r.x, n.x, i.x, o.x),
- c = Math.max(r.y, n.y, i.y, o.y);
- (e.x = s), (e.y = a), (e.width = u - s), (e.height = c - a);
- }),
- (t.prototype.roundFrame = function (t, e, r, n, i) {
- if (
- !(t.width <= 0 || t.height <= 0 || r.width <= 0 || r.height <= 0)
- ) {
- if (i) {
- var o = i.a,
- s = i.b,
- a = i.c,
- u = i.d;
- if (
- (Math.abs(s) > 1e-4 || Math.abs(a) > 1e-4) &&
- (Math.abs(o) > 1e-4 || Math.abs(u) > 1e-4)
- )
- return;
- }
- (i = i ? UL.copyFrom(i) : UL.identity())
- .translate(-r.x, -r.y)
- .scale(n.width / r.width, n.height / r.height)
- .translate(n.x, n.y),
- this.transformAABB(i, t),
- t.ceil(e),
- this.transformAABB(i.invert(), t);
- }
- }),
- t
- );
- })(),
- XL = (function () {
- function t(t) {
- this.renderer = t;
- }
- return (
- (t.prototype.flush = function () {}),
- (t.prototype.destroy = function () {
- this.renderer = null;
- }),
- (t.prototype.start = function () {}),
- (t.prototype.stop = function () {
- this.flush();
- }),
- (t.prototype.render = function (t) {}),
- t
- );
- })(),
- VL = (function () {
- function t(t) {
- (this.renderer = t),
- (this.emptyRenderer = new XL(t)),
- (this.currentRenderer = this.emptyRenderer);
- }
- return (
- (t.prototype.setObjectRenderer = function (t) {
- this.currentRenderer !== t &&
- (this.currentRenderer.stop(),
- (this.currentRenderer = t),
- this.currentRenderer.start());
- }),
- (t.prototype.flush = function () {
- this.setObjectRenderer(this.emptyRenderer);
- }),
- (t.prototype.reset = function () {
- this.setObjectRenderer(this.emptyRenderer);
- }),
- (t.prototype.copyBoundTextures = function (t, e) {
- for (
- var r = this.renderer.texture.boundTextures, n = e - 1;
- n >= 0;
- --n
- )
- (t[n] = r[n] || null), t[n] && (t[n]._batchLocation = n);
- }),
- (t.prototype.boundArray = function (t, e, r, n) {
- for (
- var i = t.elements, o = t.ids, s = t.count, a = 0, u = 0;
- u < s;
- u++
- ) {
- var c = i[u],
- h = c._batchLocation;
- if (h >= 0 && h < n && e[h] === c) o[u] = h;
- else
- for (; a < n; ) {
- var l = e[a];
- if (!l || l._batchEnabled !== r || l._batchLocation !== a) {
- (o[u] = a), (c._batchLocation = a), (e[a] = c);
- break;
- }
- a++;
- }
- }
- }),
- (t.prototype.destroy = function () {
- this.renderer = null;
- }),
- t
- );
- })(),
- HL = 0,
- WL = (function () {
- function t(t) {
- (this.renderer = t),
- (this.webGLVersion = 1),
- (this.extensions = {}),
- (this.supports = { uint32Indices: !1 }),
- (this.handleContextLost = this.handleContextLost.bind(this)),
- (this.handleContextRestored = this.handleContextRestored.bind(this)),
- t.view.addEventListener(
- 'webglcontextlost',
- this.handleContextLost,
- !1
- ),
- t.view.addEventListener(
- 'webglcontextrestored',
- this.handleContextRestored,
- !1
- );
- }
- return (
- Object.defineProperty(t.prototype, 'isLost', {
- get: function () {
- return !this.gl || this.gl.isContextLost();
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype.contextChange = function (t) {
- (this.gl = t),
- (this.renderer.gl = t),
- (this.renderer.CONTEXT_UID = HL++);
- }),
- (t.prototype.initFromContext = function (t) {
- (this.gl = t),
- this.validateContext(t),
- (this.renderer.gl = t),
- (this.renderer.CONTEXT_UID = HL++),
- this.renderer.runners.contextChange.emit(t);
- }),
- (t.prototype.initFromOptions = function (t) {
- var e = this.createContext(this.renderer.view, t);
- this.initFromContext(e);
- }),
- (t.prototype.createContext = function (t, e) {
- var r;
- if (
- (vA.PREFER_ENV >= CP.WEBGL2 && (r = t.getContext('webgl2', e)), r)
- )
- this.webGLVersion = 2;
- else if (
- ((this.webGLVersion = 1),
- !(r =
- t.getContext('webgl', e) ||
- t.getContext('experimental-webgl', e)))
- )
- throw new Error(
- 'This browser does not support WebGL. Try using the canvas renderer'
- );
- return (this.gl = r), this.getExtensions(), this.gl;
- }),
- (t.prototype.getExtensions = function () {
- var t = this.gl,
- e = {
- loseContext: t.getExtension('WEBGL_lose_context'),
- anisotropicFiltering: t.getExtension(
- 'EXT_texture_filter_anisotropic'
- ),
- floatTextureLinear: t.getExtension('OES_texture_float_linear'),
- s3tc: t.getExtension('WEBGL_compressed_texture_s3tc'),
- s3tc_sRGB: t.getExtension('WEBGL_compressed_texture_s3tc_srgb'),
- etc: t.getExtension('WEBGL_compressed_texture_etc'),
- etc1: t.getExtension('WEBGL_compressed_texture_etc1'),
- pvrtc:
- t.getExtension('WEBGL_compressed_texture_pvrtc') ||
- t.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),
- atc: t.getExtension('WEBGL_compressed_texture_atc'),
- astc: t.getExtension('WEBGL_compressed_texture_astc'),
- };
- 1 === this.webGLVersion
- ? Object.assign(this.extensions, e, {
- drawBuffers: t.getExtension('WEBGL_draw_buffers'),
- depthTexture: t.getExtension('WEBGL_depth_texture'),
- vertexArrayObject:
- t.getExtension('OES_vertex_array_object') ||
- t.getExtension('MOZ_OES_vertex_array_object') ||
- t.getExtension('WEBKIT_OES_vertex_array_object'),
- uint32ElementIndex: t.getExtension('OES_element_index_uint'),
- floatTexture: t.getExtension('OES_texture_float'),
- floatTextureLinear: t.getExtension('OES_texture_float_linear'),
- textureHalfFloat: t.getExtension('OES_texture_half_float'),
- textureHalfFloatLinear: t.getExtension(
- 'OES_texture_half_float_linear'
- ),
- })
- : 2 === this.webGLVersion &&
- Object.assign(this.extensions, e, {
- colorBufferFloat: t.getExtension('EXT_color_buffer_float'),
- });
- }),
- (t.prototype.handleContextLost = function (t) {
- var e = this;
- t.preventDefault(),
- setTimeout(function () {
- e.gl.isContextLost() &&
- e.extensions.loseContext &&
- e.extensions.loseContext.restoreContext();
- }, 0);
- }),
- (t.prototype.handleContextRestored = function () {
- this.renderer.runners.contextChange.emit(this.gl);
- }),
- (t.prototype.destroy = function () {
- var t = this.renderer.view;
- (this.renderer = null),
- t.removeEventListener('webglcontextlost', this.handleContextLost),
- t.removeEventListener(
- 'webglcontextrestored',
- this.handleContextRestored
- ),
- this.gl.useProgram(null),
- this.extensions.loseContext &&
- this.extensions.loseContext.loseContext();
- }),
- (t.prototype.postrender = function () {
- this.renderer.renderingToScreen && this.gl.flush();
- }),
- (t.prototype.validateContext = function (t) {
- var e = t.getContextAttributes(),
- r =
- 'WebGL2RenderingContext' in globalThis &&
- t instanceof globalThis.WebGL2RenderingContext;
- r && (this.webGLVersion = 2),
- e &&
- !e.stencil &&
- console.warn(
- 'Provided WebGL context does not have a stencil buffer, masks may not render correctly'
- );
- var n = r || !!t.getExtension('OES_element_index_uint');
- (this.supports.uint32Indices = n),
- n ||
- console.warn(
- 'Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly'
- );
- }),
- t
- );
- })(),
- YL = function (t) {
- (this.framebuffer = t),
- (this.stencil = null),
- (this.dirtyId = -1),
- (this.dirtyFormat = -1),
- (this.dirtySize = -1),
- (this.multisample = WP.NONE),
- (this.msaaBuffer = null),
- (this.blitFramebuffer = null),
- (this.mipLevel = 0);
- },
- zL = new TD(),
- ZL = (function () {
- function t(t) {
- (this.renderer = t),
- (this.managedFramebuffers = []),
- (this.unknownFramebuffer = new gL(10, 10)),
- (this.msaaSamples = null);
- }
- return (
- (t.prototype.contextChange = function () {
- this.disposeAll(!0);
- var t = (this.gl = this.renderer.gl);
- if (
- ((this.CONTEXT_UID = this.renderer.CONTEXT_UID),
- (this.current = this.unknownFramebuffer),
- (this.viewport = new TD()),
- (this.hasMRT = !0),
- (this.writeDepthTexture = !0),
- 1 === this.renderer.context.webGLVersion)
- ) {
- var e = this.renderer.context.extensions.drawBuffers,
- r = this.renderer.context.extensions.depthTexture;
- vA.PREFER_ENV === CP.WEBGL_LEGACY && ((e = null), (r = null)),
- e
- ? (t.drawBuffers = function (t) {
- return e.drawBuffersWEBGL(t);
- })
- : ((this.hasMRT = !1), (t.drawBuffers = function () {})),
- r || (this.writeDepthTexture = !1);
- } else
- this.msaaSamples = t.getInternalformatParameter(
- t.RENDERBUFFER,
- t.RGBA8,
- t.SAMPLES
- );
- }),
- (t.prototype.bind = function (t, e, r) {
- void 0 === r && (r = 0);
- var n = this.gl;
- if (t) {
- var i =
- t.glFramebuffers[this.CONTEXT_UID] || this.initFramebuffer(t);
- this.current !== t &&
- ((this.current = t),
- n.bindFramebuffer(n.FRAMEBUFFER, i.framebuffer)),
- i.mipLevel !== r &&
- (t.dirtyId++, t.dirtyFormat++, (i.mipLevel = r)),
- i.dirtyId !== t.dirtyId &&
- ((i.dirtyId = t.dirtyId),
- i.dirtyFormat !== t.dirtyFormat
- ? ((i.dirtyFormat = t.dirtyFormat),
- (i.dirtySize = t.dirtySize),
- this.updateFramebuffer(t, r))
- : i.dirtySize !== t.dirtySize &&
- ((i.dirtySize = t.dirtySize), this.resizeFramebuffer(t)));
- for (var o = 0; o < t.colorTextures.length; o++) {
- var s = t.colorTextures[o];
- this.renderer.texture.unbind(s.parentTextureArray || s);
- }
- if (
- (t.depthTexture && this.renderer.texture.unbind(t.depthTexture),
- e)
- ) {
- var a = e.width >> r,
- u = e.height >> r,
- c = a / e.width;
- this.setViewport(e.x * c, e.y * c, a, u);
- } else {
- (a = t.width >> r), (u = t.height >> r);
- this.setViewport(0, 0, a, u);
- }
- } else
- this.current &&
- ((this.current = null), n.bindFramebuffer(n.FRAMEBUFFER, null)),
- e
- ? this.setViewport(e.x, e.y, e.width, e.height)
- : this.setViewport(
- 0,
- 0,
- this.renderer.width,
- this.renderer.height
- );
- }),
- (t.prototype.setViewport = function (t, e, r, n) {
- var i = this.viewport;
- (t = Math.round(t)),
- (e = Math.round(e)),
- (r = Math.round(r)),
- (n = Math.round(n)),
- (i.width === r && i.height === n && i.x === t && i.y === e) ||
- ((i.x = t),
- (i.y = e),
- (i.width = r),
- (i.height = n),
- this.gl.viewport(t, e, r, n));
- }),
- Object.defineProperty(t.prototype, 'size', {
- get: function () {
- return this.current
- ? {
- x: 0,
- y: 0,
- width: this.current.width,
- height: this.current.height,
- }
- : {
- x: 0,
- y: 0,
- width: this.renderer.width,
- height: this.renderer.height,
- };
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype.clear = function (t, e, r, n, i) {
- void 0 === i && (i = AP.COLOR | AP.DEPTH);
- var o = this.gl;
- o.clearColor(t, e, r, n), o.clear(i);
- }),
- (t.prototype.initFramebuffer = function (t) {
- var e = this.gl,
- r = new YL(e.createFramebuffer());
- return (
- (r.multisample = this.detectSamples(t.multisample)),
- (t.glFramebuffers[this.CONTEXT_UID] = r),
- this.managedFramebuffers.push(t),
- t.disposeRunner.add(this),
- r
- );
- }),
- (t.prototype.resizeFramebuffer = function (t) {
- var e = this.gl,
- r = t.glFramebuffers[this.CONTEXT_UID];
- r.msaaBuffer &&
- (e.bindRenderbuffer(e.RENDERBUFFER, r.msaaBuffer),
- e.renderbufferStorageMultisample(
- e.RENDERBUFFER,
- r.multisample,
- e.RGBA8,
- t.width,
- t.height
- )),
- r.stencil &&
- (e.bindRenderbuffer(e.RENDERBUFFER, r.stencil),
- r.msaaBuffer
- ? e.renderbufferStorageMultisample(
- e.RENDERBUFFER,
- r.multisample,
- e.DEPTH24_STENCIL8,
- t.width,
- t.height
- )
- : e.renderbufferStorage(
- e.RENDERBUFFER,
- e.DEPTH_STENCIL,
- t.width,
- t.height
- ));
- var n = t.colorTextures,
- i = n.length;
- e.drawBuffers || (i = Math.min(i, 1));
- for (var o = 0; o < i; o++) {
- var s = n[o],
- a = s.parentTextureArray || s;
- this.renderer.texture.bind(a, 0);
- }
- t.depthTexture &&
- this.writeDepthTexture &&
- this.renderer.texture.bind(t.depthTexture, 0);
- }),
- (t.prototype.updateFramebuffer = function (t, e) {
- var r = this.gl,
- n = t.glFramebuffers[this.CONTEXT_UID],
- i = t.colorTextures,
- o = i.length;
- r.drawBuffers || (o = Math.min(o, 1)),
- n.multisample > 1 && this.canMultisampleFramebuffer(t)
- ? ((n.msaaBuffer = n.msaaBuffer || r.createRenderbuffer()),
- r.bindRenderbuffer(r.RENDERBUFFER, n.msaaBuffer),
- r.renderbufferStorageMultisample(
- r.RENDERBUFFER,
- n.multisample,
- r.RGBA8,
- t.width,
- t.height
- ),
- r.framebufferRenderbuffer(
- r.FRAMEBUFFER,
- r.COLOR_ATTACHMENT0,
- r.RENDERBUFFER,
- n.msaaBuffer
- ))
- : n.msaaBuffer &&
- (r.deleteRenderbuffer(n.msaaBuffer),
- (n.msaaBuffer = null),
- n.blitFramebuffer &&
- (n.blitFramebuffer.dispose(), (n.blitFramebuffer = null)));
- for (var s = [], a = 0; a < o; a++) {
- var u = i[a],
- c = u.parentTextureArray || u;
- this.renderer.texture.bind(c, 0),
- (0 === a && n.msaaBuffer) ||
- (r.framebufferTexture2D(
- r.FRAMEBUFFER,
- r.COLOR_ATTACHMENT0 + a,
- u.target,
- c._glTextures[this.CONTEXT_UID].texture,
- e
- ),
- s.push(r.COLOR_ATTACHMENT0 + a));
- }
- if (
- (s.length > 1 && r.drawBuffers(s), t.depthTexture) &&
- this.writeDepthTexture
- ) {
- var h = t.depthTexture;
- this.renderer.texture.bind(h, 0),
- r.framebufferTexture2D(
- r.FRAMEBUFFER,
- r.DEPTH_ATTACHMENT,
- r.TEXTURE_2D,
- h._glTextures[this.CONTEXT_UID].texture,
- e
- );
- }
- (!t.stencil && !t.depth) || (t.depthTexture && this.writeDepthTexture)
- ? n.stencil && (r.deleteRenderbuffer(n.stencil), (n.stencil = null))
- : ((n.stencil = n.stencil || r.createRenderbuffer()),
- r.bindRenderbuffer(r.RENDERBUFFER, n.stencil),
- n.msaaBuffer
- ? r.renderbufferStorageMultisample(
- r.RENDERBUFFER,
- n.multisample,
- r.DEPTH24_STENCIL8,
- t.width,
- t.height
- )
- : r.renderbufferStorage(
- r.RENDERBUFFER,
- r.DEPTH_STENCIL,
- t.width,
- t.height
- ),
- r.framebufferRenderbuffer(
- r.FRAMEBUFFER,
- r.DEPTH_STENCIL_ATTACHMENT,
- r.RENDERBUFFER,
- n.stencil
- ));
- }),
- (t.prototype.canMultisampleFramebuffer = function (t) {
- return (
- 1 !== this.renderer.context.webGLVersion &&
- t.colorTextures.length <= 1 &&
- !t.depthTexture
- );
- }),
- (t.prototype.detectSamples = function (t) {
- var e = this.msaaSamples,
- r = WP.NONE;
- if (t <= 1 || null === e) return r;
- for (var n = 0; n < e.length; n++)
- if (e[n] <= t) {
- r = e[n];
- break;
- }
- return 1 === r && (r = WP.NONE), r;
- }),
- (t.prototype.blit = function (t, e, r) {
- var n = this,
- i = n.current,
- o = n.renderer,
- s = n.gl,
- a = n.CONTEXT_UID;
- if (2 === o.context.webGLVersion && i) {
- var u = i.glFramebuffers[a];
- if (u) {
- if (!t) {
- if (!u.msaaBuffer) return;
- var c = i.colorTextures[0];
- if (!c) return;
- u.blitFramebuffer ||
- ((u.blitFramebuffer = new gL(i.width, i.height)),
- u.blitFramebuffer.addColorTexture(0, c)),
- (t = u.blitFramebuffer).colorTextures[0] !== c &&
- ((t.colorTextures[0] = c), t.dirtyId++, t.dirtyFormat++),
- (t.width === i.width && t.height === i.height) ||
- ((t.width = i.width),
- (t.height = i.height),
- t.dirtyId++,
- t.dirtySize++);
- }
- e || (((e = zL).width = i.width), (e.height = i.height)),
- r || (r = e);
- var h = e.width === r.width && e.height === r.height;
- this.bind(t),
- s.bindFramebuffer(s.READ_FRAMEBUFFER, u.framebuffer),
- s.blitFramebuffer(
- e.left,
- e.top,
- e.right,
- e.bottom,
- r.left,
- r.top,
- r.right,
- r.bottom,
- s.COLOR_BUFFER_BIT,
- h ? s.NEAREST : s.LINEAR
- );
- }
- }
- }),
- (t.prototype.disposeFramebuffer = function (t, e) {
- var r = t.glFramebuffers[this.CONTEXT_UID],
- n = this.gl;
- if (r) {
- delete t.glFramebuffers[this.CONTEXT_UID];
- var i = this.managedFramebuffers.indexOf(t);
- i >= 0 && this.managedFramebuffers.splice(i, 1),
- t.disposeRunner.remove(this),
- e ||
- (n.deleteFramebuffer(r.framebuffer),
- r.msaaBuffer && n.deleteRenderbuffer(r.msaaBuffer),
- r.stencil && n.deleteRenderbuffer(r.stencil)),
- r.blitFramebuffer && r.blitFramebuffer.dispose();
- }
- }),
- (t.prototype.disposeAll = function (t) {
- var e = this.managedFramebuffers;
- this.managedFramebuffers = [];
- for (var r = 0; r < e.length; r++) this.disposeFramebuffer(e[r], t);
- }),
- (t.prototype.forceStencil = function () {
- var t = this.current;
- if (t) {
- var e = t.glFramebuffers[this.CONTEXT_UID];
- if (e && !e.stencil) {
- t.stencil = !0;
- var r = t.width,
- n = t.height,
- i = this.gl,
- o = i.createRenderbuffer();
- i.bindRenderbuffer(i.RENDERBUFFER, o),
- e.msaaBuffer
- ? i.renderbufferStorageMultisample(
- i.RENDERBUFFER,
- e.multisample,
- i.DEPTH24_STENCIL8,
- r,
- n
- )
- : i.renderbufferStorage(
- i.RENDERBUFFER,
- i.DEPTH_STENCIL,
- r,
- n
- ),
- (e.stencil = o),
- i.framebufferRenderbuffer(
- i.FRAMEBUFFER,
- i.DEPTH_STENCIL_ATTACHMENT,
- i.RENDERBUFFER,
- o
- );
- }
- }
- }),
- (t.prototype.reset = function () {
- (this.current = this.unknownFramebuffer), (this.viewport = new TD());
- }),
- (t.prototype.destroy = function () {
- this.renderer = null;
- }),
- t
- );
- })(),
- JL = { 5126: 4, 5123: 2, 5121: 1 },
- KL = (function () {
- function t(t) {
- (this.renderer = t),
- (this._activeGeometry = null),
- (this._activeVao = null),
- (this.hasVao = !0),
- (this.hasInstance = !0),
- (this.canUseUInt32ElementIndex = !1),
- (this.managedGeometries = {});
- }
- return (
- (t.prototype.contextChange = function () {
- this.disposeAll(!0);
- var t = (this.gl = this.renderer.gl),
- e = this.renderer.context;
- if (
- ((this.CONTEXT_UID = this.renderer.CONTEXT_UID),
- 2 !== e.webGLVersion)
- ) {
- var r = this.renderer.context.extensions.vertexArrayObject;
- vA.PREFER_ENV === CP.WEBGL_LEGACY && (r = null),
- r
- ? ((t.createVertexArray = function () {
- return r.createVertexArrayOES();
- }),
- (t.bindVertexArray = function (t) {
- return r.bindVertexArrayOES(t);
- }),
- (t.deleteVertexArray = function (t) {
- return r.deleteVertexArrayOES(t);
- }))
- : ((this.hasVao = !1),
- (t.createVertexArray = function () {
- return null;
- }),
- (t.bindVertexArray = function () {
- return null;
- }),
- (t.deleteVertexArray = function () {
- return null;
- }));
- }
- if (2 !== e.webGLVersion) {
- var n = t.getExtension('ANGLE_instanced_arrays');
- n
- ? ((t.vertexAttribDivisor = function (t, e) {
- return n.vertexAttribDivisorANGLE(t, e);
- }),
- (t.drawElementsInstanced = function (t, e, r, i, o) {
- return n.drawElementsInstancedANGLE(t, e, r, i, o);
- }),
- (t.drawArraysInstanced = function (t, e, r, i) {
- return n.drawArraysInstancedANGLE(t, e, r, i);
- }))
- : (this.hasInstance = !1);
- }
- this.canUseUInt32ElementIndex =
- 2 === e.webGLVersion || !!e.extensions.uint32ElementIndex;
- }),
- (t.prototype.bind = function (t, e) {
- e = e || this.renderer.shader.shader;
- var r = this.gl,
- n = t.glVertexArrayObjects[this.CONTEXT_UID],
- i = !1;
- n ||
- ((this.managedGeometries[t.id] = t),
- t.disposeRunner.add(this),
- (t.glVertexArrayObjects[this.CONTEXT_UID] = n = {}),
- (i = !0));
- var o = n[e.program.id] || this.initGeometryVao(t, e, i);
- (this._activeGeometry = t),
- this._activeVao !== o &&
- ((this._activeVao = o),
- this.hasVao
- ? r.bindVertexArray(o)
- : this.activateVao(t, e.program)),
- this.updateBuffers();
- }),
- (t.prototype.reset = function () {
- this.unbind();
- }),
- (t.prototype.updateBuffers = function () {
- for (
- var t = this._activeGeometry, e = this.renderer.buffer, r = 0;
- r < t.buffers.length;
- r++
- ) {
- var n = t.buffers[r];
- e.update(n);
- }
- }),
- (t.prototype.checkCompatibility = function (t, e) {
- var r = t.attributes,
- n = e.attributeData;
- for (var i in n)
- if (!r[i])
- throw new Error(
- 'shader and geometry incompatible, geometry missing the "' +
- i +
- '" attribute'
- );
- }),
- (t.prototype.getSignature = function (t, e) {
- var r = t.attributes,
- n = e.attributeData,
- i = ['g', t.id];
- for (var o in r) n[o] && i.push(o, n[o].location);
- return i.join('-');
- }),
- (t.prototype.initGeometryVao = function (t, e, r) {
- void 0 === r && (r = !0);
- var n = this.gl,
- i = this.CONTEXT_UID,
- o = this.renderer.buffer,
- s = e.program;
- s.glPrograms[i] || this.renderer.shader.generateProgram(e),
- this.checkCompatibility(t, s);
- var a = this.getSignature(t, s),
- u = t.glVertexArrayObjects[this.CONTEXT_UID],
- c = u[a];
- if (c) return (u[s.id] = c), c;
- var h = t.buffers,
- l = t.attributes,
- d = {},
- f = {};
- for (var p in h) (d[p] = 0), (f[p] = 0);
- for (var p in l)
- !l[p].size && s.attributeData[p]
- ? (l[p].size = s.attributeData[p].size)
- : l[p].size ||
- console.warn(
- "PIXI Geometry attribute '" +
- p +
- "' size cannot be determined (likely the bound shader does not have the attribute)"
- ),
- (d[l[p].buffer] += l[p].size * JL[l[p].type]);
- for (var p in l) {
- var v = l[p],
- m = v.size;
- void 0 === v.stride &&
- (d[v.buffer] === m * JL[v.type]
- ? (v.stride = 0)
- : (v.stride = d[v.buffer])),
- void 0 === v.start &&
- ((v.start = f[v.buffer]), (f[v.buffer] += m * JL[v.type]));
- }
- (c = n.createVertexArray()), n.bindVertexArray(c);
- for (var y = 0; y < h.length; y++) {
- var g = h[y];
- o.bind(g), r && g._glBuffers[i].refCount++;
- }
- return (
- this.activateVao(t, s),
- (this._activeVao = c),
- (u[s.id] = c),
- (u[a] = c),
- c
- );
- }),
- (t.prototype.disposeGeometry = function (t, e) {
- var r;
- if (this.managedGeometries[t.id]) {
- delete this.managedGeometries[t.id];
- var n = t.glVertexArrayObjects[this.CONTEXT_UID],
- i = this.gl,
- o = t.buffers,
- s =
- null === (r = this.renderer) || void 0 === r
- ? void 0
- : r.buffer;
- if ((t.disposeRunner.remove(this), n)) {
- if (s)
- for (var a = 0; a < o.length; a++) {
- var u = o[a]._glBuffers[this.CONTEXT_UID];
- u &&
- (u.refCount--, 0 !== u.refCount || e || s.dispose(o[a], e));
- }
- if (!e)
- for (var c in n)
- if ('g' === c[0]) {
- var h = n[c];
- this._activeVao === h && this.unbind(),
- i.deleteVertexArray(h);
- }
- delete t.glVertexArrayObjects[this.CONTEXT_UID];
- }
- }
- }),
- (t.prototype.disposeAll = function (t) {
- for (
- var e = Object.keys(this.managedGeometries), r = 0;
- r < e.length;
- r++
- )
- this.disposeGeometry(this.managedGeometries[e[r]], t);
- }),
- (t.prototype.activateVao = function (t, e) {
- var r = this.gl,
- n = this.CONTEXT_UID,
- i = this.renderer.buffer,
- o = t.buffers,
- s = t.attributes;
- t.indexBuffer && i.bind(t.indexBuffer);
- var a = null;
- for (var u in s) {
- var c = s[u],
- h = o[c.buffer],
- l = h._glBuffers[n];
- if (e.attributeData[u]) {
- a !== l && (i.bind(h), (a = l));
- var d = e.attributeData[u].location;
- if (
- (r.enableVertexAttribArray(d),
- r.vertexAttribPointer(
- d,
- c.size,
- c.type || r.FLOAT,
- c.normalized,
- c.stride,
- c.start
- ),
- c.instance)
- ) {
- if (!this.hasInstance)
- throw new Error(
- 'geometry error, GPU Instancing is not supported on this device'
- );
- r.vertexAttribDivisor(d, 1);
- }
- }
- }
- }),
- (t.prototype.draw = function (t, e, r, n) {
- var i = this.gl,
- o = this._activeGeometry;
- if (o.indexBuffer) {
- var s = o.indexBuffer.data.BYTES_PER_ELEMENT,
- a = 2 === s ? i.UNSIGNED_SHORT : i.UNSIGNED_INT;
- 2 === s || (4 === s && this.canUseUInt32ElementIndex)
- ? o.instanced
- ? i.drawElementsInstanced(
- t,
- e || o.indexBuffer.data.length,
- a,
- (r || 0) * s,
- n || 1
- )
- : i.drawElements(
- t,
- e || o.indexBuffer.data.length,
- a,
- (r || 0) * s
- )
- : console.warn('unsupported index buffer type: uint32');
- } else
- o.instanced
- ? i.drawArraysInstanced(t, r, e || o.getSize(), n || 1)
- : i.drawArrays(t, r, e || o.getSize());
- return this;
- }),
- (t.prototype.unbind = function () {
- this.gl.bindVertexArray(null),
- (this._activeVao = null),
- (this._activeGeometry = null);
- }),
- (t.prototype.destroy = function () {
- this.renderer = null;
- }),
- t
- );
- })(),
- qL = (function () {
- function t(t) {
- void 0 === t && (t = null),
- (this.type = VP.NONE),
- (this.autoDetect = !0),
- (this.maskObject = t || null),
- (this.pooled = !1),
- (this.isMaskData = !0),
- (this.resolution = null),
- (this.multisample = vA.FILTER_MULTISAMPLE),
- (this.enabled = !0),
- (this.colorMask = 15),
- (this._filters = null),
- (this._stencilCounter = 0),
- (this._scissorCounter = 0),
- (this._scissorRect = null),
- (this._scissorRectLocal = null),
- (this._colorMask = 15),
- (this._target = null);
- }
- return (
- Object.defineProperty(t.prototype, 'filter', {
- get: function () {
- return this._filters ? this._filters[0] : null;
- },
- set: function (t) {
- t
- ? this._filters
- ? (this._filters[0] = t)
- : (this._filters = [t])
- : (this._filters = null);
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype.reset = function () {
- this.pooled &&
- ((this.maskObject = null),
- (this.type = VP.NONE),
- (this.autoDetect = !0)),
- (this._target = null),
- (this._scissorRectLocal = null);
- }),
- (t.prototype.copyCountersOrReset = function (t) {
- t
- ? ((this._stencilCounter = t._stencilCounter),
- (this._scissorCounter = t._scissorCounter),
- (this._scissorRect = t._scissorRect))
- : ((this._stencilCounter = 0),
- (this._scissorCounter = 0),
- (this._scissorRect = null));
- }),
- t
- );
- })();
- function QL(t, e, r) {
- var n = t.createShader(e);
- return t.shaderSource(n, r), t.compileShader(n), n;
- }
- function $L(t, e) {
- var r = t
- .getShaderSource(e)
- .split('\n')
- .map(function (t, e) {
- return e + ': ' + t;
- }),
- n = t.getShaderInfoLog(e),
- i = n.split('\n'),
- o = {},
- s = i
- .map(function (t) {
- return parseFloat(t.replace(/^ERROR\: 0\:([\d]+)\:.*$/, '$1'));
- })
- .filter(function (t) {
- return !(!t || o[t]) && ((o[t] = !0), !0);
- }),
- a = [''];
- s.forEach(function (t) {
- (r[t - 1] = '%c' + r[t - 1] + '%c'),
- a.push(
- 'background: #FF0000; color:#FFFFFF; font-size: 10px',
- 'font-size: 10px'
- );
- });
- var u = r.join('\n');
- (a[0] = u),
- console.error(n),
- console.groupCollapsed('click to view full shader code'),
- console.warn.apply(console, a),
- console.groupEnd();
- }
- function tF(t) {
- for (var e = new Array(t), r = 0; r < e.length; r++) e[r] = !1;
- return e;
- }
- function eF(t, e) {
- switch (t) {
- case 'float':
- case 'int':
- case 'uint':
- case 'sampler2D':
- case 'sampler2DArray':
- return 0;
- case 'vec2':
- return new Float32Array(2 * e);
- case 'vec3':
- return new Float32Array(3 * e);
- case 'vec4':
- return new Float32Array(4 * e);
- case 'ivec2':
- return new Int32Array(2 * e);
- case 'ivec3':
- return new Int32Array(3 * e);
- case 'ivec4':
- return new Int32Array(4 * e);
- case 'uvec2':
- return new Uint32Array(2 * e);
- case 'uvec3':
- return new Uint32Array(3 * e);
- case 'uvec4':
- return new Uint32Array(4 * e);
- case 'bool':
- return !1;
- case 'bvec2':
- return tF(2 * e);
- case 'bvec3':
- return tF(3 * e);
- case 'bvec4':
- return tF(4 * e);
- case 'mat2':
- return new Float32Array([1, 0, 0, 1]);
- case 'mat3':
- return new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);
- case 'mat4':
- return new Float32Array([
- 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1,
- ]);
- }
- return null;
- }
- var rF,
- nF = {},
- iF = nF;
- function oF() {
- if (!rF) {
- rF = XP.MEDIUM;
- var t = (function () {
- if (iF === nF || (iF && iF.isContextLost())) {
- var t = vA.ADAPTER.createCanvas(),
- e = void 0;
- vA.PREFER_ENV >= CP.WEBGL2 && (e = t.getContext('webgl2', {})),
- e ||
- ((e =
- t.getContext('webgl', {}) ||
- t.getContext('experimental-webgl', {}))
- ? e.getExtension('WEBGL_draw_buffers')
- : (e = null)),
- (iF = e);
- }
- return iF;
- })();
- if (t && t.getShaderPrecisionFormat) {
- var e = t.getShaderPrecisionFormat(t.FRAGMENT_SHADER, t.HIGH_FLOAT);
- rF = e.precision ? XP.HIGH : XP.MEDIUM;
- }
- }
- return rF;
- }
- function sF(t, e, r) {
- if ('precision' !== t.substring(0, 9)) {
- var n = e;
- return (
- e === XP.HIGH && r !== XP.HIGH && (n = XP.MEDIUM),
- 'precision ' + n + ' float;\n' + t
- );
- }
- return r !== XP.HIGH && 'precision highp' === t.substring(0, 15)
- ? t.replace('precision highp', 'precision mediump')
- : t;
- }
- var aF = {
- float: 1,
- vec2: 2,
- vec3: 3,
- vec4: 4,
- int: 1,
- ivec2: 2,
- ivec3: 3,
- ivec4: 4,
- uint: 1,
- uvec2: 2,
- uvec3: 3,
- uvec4: 4,
- bool: 1,
- bvec2: 2,
- bvec3: 3,
- bvec4: 4,
- mat2: 4,
- mat3: 9,
- mat4: 16,
- sampler2D: 1,
- };
- function uF(t) {
- return aF[t];
- }
- var cF = null,
- hF = {
- FLOAT: 'float',
- FLOAT_VEC2: 'vec2',
- FLOAT_VEC3: 'vec3',
- FLOAT_VEC4: 'vec4',
- INT: 'int',
- INT_VEC2: 'ivec2',
- INT_VEC3: 'ivec3',
- INT_VEC4: 'ivec4',
- UNSIGNED_INT: 'uint',
- UNSIGNED_INT_VEC2: 'uvec2',
- UNSIGNED_INT_VEC3: 'uvec3',
- UNSIGNED_INT_VEC4: 'uvec4',
- BOOL: 'bool',
- BOOL_VEC2: 'bvec2',
- BOOL_VEC3: 'bvec3',
- BOOL_VEC4: 'bvec4',
- FLOAT_MAT2: 'mat2',
- FLOAT_MAT3: 'mat3',
- FLOAT_MAT4: 'mat4',
- SAMPLER_2D: 'sampler2D',
- INT_SAMPLER_2D: 'sampler2D',
- UNSIGNED_INT_SAMPLER_2D: 'sampler2D',
- SAMPLER_CUBE: 'samplerCube',
- INT_SAMPLER_CUBE: 'samplerCube',
- UNSIGNED_INT_SAMPLER_CUBE: 'samplerCube',
- SAMPLER_2D_ARRAY: 'sampler2DArray',
- INT_SAMPLER_2D_ARRAY: 'sampler2DArray',
- UNSIGNED_INT_SAMPLER_2D_ARRAY: 'sampler2DArray',
- };
- function lF(t, e) {
- if (!cF) {
- var r = Object.keys(hF);
- cF = {};
- for (var n = 0; n < r.length; ++n) {
- var i = r[n];
- cF[t[i]] = hF[i];
- }
- }
- return cF[e];
- }
- var dF = [
- {
- test: function (t) {
- return 'float' === t.type && 1 === t.size && !t.isArray;
- },
- code: function (t) {
- return (
- '\n if(uv["' +
- t +
- '"] !== ud["' +
- t +
- '"].value)\n {\n ud["' +
- t +
- '"].value = uv["' +
- t +
- '"]\n gl.uniform1f(ud["' +
- t +
- '"].location, uv["' +
- t +
- '"])\n }\n '
- );
- },
- },
- {
- test: function (t, e) {
- return !(
- ('sampler2D' !== t.type &&
- 'samplerCube' !== t.type &&
- 'sampler2DArray' !== t.type) ||
- 1 !== t.size ||
- t.isArray ||
- (null != e && void 0 === e.castToBaseTexture)
- );
- },
- code: function (t) {
- return (
- 't = syncData.textureCount++;\n\n renderer.texture.bind(uv["' +
- t +
- '"], t);\n\n if(ud["' +
- t +
- '"].value !== t)\n {\n ud["' +
- t +
- '"].value = t;\n gl.uniform1i(ud["' +
- t +
- '"].location, t);\n; // eslint-disable-line max-len\n }'
- );
- },
- },
- {
- test: function (t, e) {
- return (
- 'mat3' === t.type && 1 === t.size && !t.isArray && void 0 !== e.a
- );
- },
- code: function (t) {
- return (
- '\n gl.uniformMatrix3fv(ud["' +
- t +
- '"].location, false, uv["' +
- t +
- '"].toArray(true));\n '
- );
- },
- codeUbo: function (t) {
- return (
- '\n var ' +
- t +
- '_matrix = uv.' +
- t +
- '.toArray(true);\n\n data[offset] = ' +
- t +
- '_matrix[0];\n data[offset+1] = ' +
- t +
- '_matrix[1];\n data[offset+2] = ' +
- t +
- '_matrix[2];\n \n data[offset + 4] = ' +
- t +
- '_matrix[3];\n data[offset + 5] = ' +
- t +
- '_matrix[4];\n data[offset + 6] = ' +
- t +
- '_matrix[5];\n \n data[offset + 8] = ' +
- t +
- '_matrix[6];\n data[offset + 9] = ' +
- t +
- '_matrix[7];\n data[offset + 10] = ' +
- t +
- '_matrix[8];\n '
- );
- },
- },
- {
- test: function (t, e) {
- return (
- 'vec2' === t.type && 1 === t.size && !t.isArray && void 0 !== e.x
- );
- },
- code: function (t) {
- return (
- '\n cv = ud["' +
- t +
- '"].value;\n v = uv["' +
- t +
- '"];\n\n if(cv[0] !== v.x || cv[1] !== v.y)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n gl.uniform2f(ud["' +
- t +
- '"].location, v.x, v.y);\n }'
- );
- },
- codeUbo: function (t) {
- return (
- '\n v = uv.' +
- t +
- ';\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n '
- );
- },
- },
- {
- test: function (t) {
- return 'vec2' === t.type && 1 === t.size && !t.isArray;
- },
- code: function (t) {
- return (
- '\n cv = ud["' +
- t +
- '"].value;\n v = uv["' +
- t +
- '"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(ud["' +
- t +
- '"].location, v[0], v[1]);\n }\n '
- );
- },
- },
- {
- test: function (t, e) {
- return (
- 'vec4' === t.type &&
- 1 === t.size &&
- !t.isArray &&
- void 0 !== e.width
- );
- },
- code: function (t) {
- return (
- '\n cv = ud["' +
- t +
- '"].value;\n v = uv["' +
- t +
- '"];\n\n if(cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height)\n {\n cv[0] = v.x;\n cv[1] = v.y;\n cv[2] = v.width;\n cv[3] = v.height;\n gl.uniform4f(ud["' +
- t +
- '"].location, v.x, v.y, v.width, v.height)\n }'
- );
- },
- codeUbo: function (t) {
- return (
- '\n v = uv.' +
- t +
- ';\n\n data[offset] = v.x;\n data[offset+1] = v.y;\n data[offset+2] = v.width;\n data[offset+3] = v.height;\n '
- );
- },
- },
- {
- test: function (t) {
- return 'vec4' === t.type && 1 === t.size && !t.isArray;
- },
- code: function (t) {
- return (
- '\n cv = ud["' +
- t +
- '"].value;\n v = uv["' +
- t +
- '"];\n\n if(cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(ud["' +
- t +
- '"].location, v[0], v[1], v[2], v[3])\n }'
- );
- },
- },
- ],
- fF = {
- float:
- '\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1f(location, v);\n }',
- vec2: '\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2f(location, v[0], v[1])\n }',
- vec3: '\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3f(location, v[0], v[1], v[2])\n }',
- vec4: '\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }',
- int: '\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }',
- ivec2:
- '\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }',
- ivec3:
- '\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }',
- ivec4:
- '\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }',
- uint: '\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1ui(location, v);\n }',
- uvec2:
- '\n if (cv[0] !== v[0] || cv[1] !== v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2ui(location, v[0], v[1]);\n }',
- uvec3:
- '\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }',
- uvec4:
- '\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }',
- bool: '\n if (cv !== v)\n {\n cu.value = v;\n gl.uniform1i(location, v);\n }',
- bvec2:
- '\n if (cv[0] != v[0] || cv[1] != v[1])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n\n gl.uniform2i(location, v[0], v[1]);\n }',
- bvec3:
- '\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n\n gl.uniform3i(location, v[0], v[1], v[2]);\n }',
- bvec4:
- '\n if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3])\n {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }',
- mat2: 'gl.uniformMatrix2fv(location, false, v)',
- mat3: 'gl.uniformMatrix3fv(location, false, v)',
- mat4: 'gl.uniformMatrix4fv(location, false, v)',
- sampler2D:
- '\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }',
- samplerCube:
- '\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }',
- sampler2DArray:
- '\n if (cv !== v)\n {\n cu.value = v;\n\n gl.uniform1i(location, v);\n }',
- },
- pF = {
- float: 'gl.uniform1fv(location, v)',
- vec2: 'gl.uniform2fv(location, v)',
- vec3: 'gl.uniform3fv(location, v)',
- vec4: 'gl.uniform4fv(location, v)',
- mat4: 'gl.uniformMatrix4fv(location, false, v)',
- mat3: 'gl.uniformMatrix3fv(location, false, v)',
- mat2: 'gl.uniformMatrix2fv(location, false, v)',
- int: 'gl.uniform1iv(location, v)',
- ivec2: 'gl.uniform2iv(location, v)',
- ivec3: 'gl.uniform3iv(location, v)',
- ivec4: 'gl.uniform4iv(location, v)',
- uint: 'gl.uniform1uiv(location, v)',
- uvec2: 'gl.uniform2uiv(location, v)',
- uvec3: 'gl.uniform3uiv(location, v)',
- uvec4: 'gl.uniform4uiv(location, v)',
- bool: 'gl.uniform1iv(location, v)',
- bvec2: 'gl.uniform2iv(location, v)',
- bvec3: 'gl.uniform3iv(location, v)',
- bvec4: 'gl.uniform4iv(location, v)',
- sampler2D: 'gl.uniform1iv(location, v)',
- samplerCube: 'gl.uniform1iv(location, v)',
- sampler2DArray: 'gl.uniform1iv(location, v)',
- };
- var vF,
- mF = [
- 'precision mediump float;',
- 'void main(void){',
- 'float test = 0.1;',
- '%forloop%',
- 'gl_FragColor = vec4(0.0);',
- '}',
- ].join('\n');
- function yF(t) {
- for (var e = '', r = 0; r < t; ++r)
- r > 0 && (e += '\nelse '),
- r < t - 1 && (e += 'if(test == ' + r + '.0){}');
- return e;
- }
- var gF = 0,
- _F = {},
- bF = (function () {
- function t(e, r, n) {
- void 0 === n && (n = 'pixi-shader'),
- (this.id = gF++),
- (this.vertexSrc = e || t.defaultVertexSrc),
- (this.fragmentSrc = r || t.defaultFragmentSrc),
- (this.vertexSrc = this.vertexSrc.trim()),
- (this.fragmentSrc = this.fragmentSrc.trim()),
- '#version' !== this.vertexSrc.substring(0, 8) &&
- ((n = n.replace(/\s+/g, '-')),
- _F[n] ? (_F[n]++, (n += '-' + _F[n])) : (_F[n] = 1),
- (this.vertexSrc =
- '#define SHADER_NAME ' + n + '\n' + this.vertexSrc),
- (this.fragmentSrc =
- '#define SHADER_NAME ' + n + '\n' + this.fragmentSrc),
- (this.vertexSrc = sF(this.vertexSrc, vA.PRECISION_VERTEX, XP.HIGH)),
- (this.fragmentSrc = sF(
- this.fragmentSrc,
- vA.PRECISION_FRAGMENT,
- oF()
- ))),
- (this.glPrograms = {}),
- (this.syncUniforms = null);
- }
- return (
- Object.defineProperty(t, 'defaultVertexSrc', {
- get: function () {
- return 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n';
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t, 'defaultFragmentSrc', {
- get: function () {
- return 'varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor *= texture2D(uSampler, vTextureCoord);\n}';
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.from = function (e, r, n) {
- var i = e + r,
- o = cD[i];
- return o || (cD[i] = o = new t(e, r, n)), o;
- }),
- t
- );
- })(),
- TF = (function () {
- function t(t, e) {
- (this.uniformBindCount = 0),
- (this.program = t),
- (this.uniformGroup = e
- ? e instanceof kL
- ? e
- : new kL(e)
- : new kL({})),
- (this.disposeRunner = new JD('disposeShader'));
- }
- return (
- (t.prototype.checkUniformExists = function (t, e) {
- if (e.uniforms[t]) return !0;
- for (var r in e.uniforms) {
- var n = e.uniforms[r];
- if (n.group && this.checkUniformExists(t, n)) return !0;
- }
- return !1;
- }),
- (t.prototype.destroy = function () {
- (this.uniformGroup = null),
- this.disposeRunner.emit(this),
- this.disposeRunner.destroy();
- }),
- Object.defineProperty(t.prototype, 'uniforms', {
- get: function () {
- return this.uniformGroup.uniforms;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.from = function (e, r, n) {
- return new t(bF.from(e, r), n);
- }),
- t
- );
- })(),
- xF = (function () {
- function t() {
- (this.data = 0),
- (this.blendMode = OP.NORMAL),
- (this.polygonOffset = 0),
- (this.blend = !0),
- (this.depthMask = !0);
- }
- return (
- Object.defineProperty(t.prototype, 'blend', {
- get: function () {
- return !!(1 & this.data);
- },
- set: function (t) {
- !!(1 & this.data) !== t && (this.data ^= 1);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'offsets', {
- get: function () {
- return !!(2 & this.data);
- },
- set: function (t) {
- !!(2 & this.data) !== t && (this.data ^= 2);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'culling', {
- get: function () {
- return !!(4 & this.data);
- },
- set: function (t) {
- !!(4 & this.data) !== t && (this.data ^= 4);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'depthTest', {
- get: function () {
- return !!(8 & this.data);
- },
- set: function (t) {
- !!(8 & this.data) !== t && (this.data ^= 8);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'depthMask', {
- get: function () {
- return !!(32 & this.data);
- },
- set: function (t) {
- !!(32 & this.data) !== t && (this.data ^= 32);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'clockwiseFrontFace', {
- get: function () {
- return !!(16 & this.data);
- },
- set: function (t) {
- !!(16 & this.data) !== t && (this.data ^= 16);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'blendMode', {
- get: function () {
- return this._blendMode;
- },
- set: function (t) {
- (this.blend = t !== OP.NONE), (this._blendMode = t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'polygonOffset', {
- get: function () {
- return this._polygonOffset;
- },
- set: function (t) {
- (this.offsets = !!t), (this._polygonOffset = t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype.toString = function () {
- return (
- '[@pixi/core:State blendMode=' +
- this.blendMode +
- ' clockwiseFrontFace=' +
- this.clockwiseFrontFace +
- ' culling=' +
- this.culling +
- ' depthMask=' +
- this.depthMask +
- ' polygonOffset=' +
- this.polygonOffset +
- ']'
- );
- }),
- (t.for2d = function () {
- var e = new t();
- return (e.depthTest = !1), (e.blend = !0), e;
- }),
- t
- );
- })(),
- EF = (function (t) {
- function e(r, n, i) {
- var o = this,
- s = bF.from(r || e.defaultVertexSrc, n || e.defaultFragmentSrc);
- return (
- ((o = t.call(this, s, i) || this).padding = 0),
- (o.resolution = vA.FILTER_RESOLUTION),
- (o.multisample = vA.FILTER_MULTISAMPLE),
- (o.enabled = !0),
- (o.autoFit = !0),
- (o.state = new xF()),
- o
- );
- }
- return (
- rL(e, t),
- (e.prototype.apply = function (t, e, r, n, i) {
- t.applyFilter(this, e, r, n);
- }),
- Object.defineProperty(e.prototype, 'blendMode', {
- get: function () {
- return this.state.blendMode;
- },
- set: function (t) {
- this.state.blendMode = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'resolution', {
- get: function () {
- return this._resolution;
- },
- set: function (t) {
- this._resolution = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e, 'defaultVertexSrc', {
- get: function () {
- return 'attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n';
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e, 'defaultFragmentSrc', {
- get: function () {
- return 'varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n}\n';
- },
- enumerable: !1,
- configurable: !0,
- }),
- e
- );
- })(TF),
- SF = new CD(),
- wF = (function () {
- function t(t, e) {
- (this._texture = t),
- (this.mapCoord = new CD()),
- (this.uClampFrame = new Float32Array(4)),
- (this.uClampOffset = new Float32Array(2)),
- (this._textureID = -1),
- (this._updateID = 0),
- (this.clampOffset = 0),
- (this.clampMargin = void 0 === e ? 0.5 : e),
- (this.isSimple = !1);
- }
- return (
- Object.defineProperty(t.prototype, 'texture', {
- get: function () {
- return this._texture;
- },
- set: function (t) {
- (this._texture = t), (this._textureID = -1);
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype.multiplyUvs = function (t, e) {
- void 0 === e && (e = t);
- for (var r = this.mapCoord, n = 0; n < t.length; n += 2) {
- var i = t[n],
- o = t[n + 1];
- (e[n] = i * r.a + o * r.c + r.tx),
- (e[n + 1] = i * r.b + o * r.d + r.ty);
- }
- return e;
- }),
- (t.prototype.update = function (t) {
- var e = this._texture;
- if (!e || !e.valid) return !1;
- if (!t && this._textureID === e._updateID) return !1;
- (this._textureID = e._updateID), this._updateID++;
- var r = e._uvs;
- this.mapCoord.set(
- r.x1 - r.x0,
- r.y1 - r.y0,
- r.x3 - r.x0,
- r.y3 - r.y0,
- r.x0,
- r.y0
- );
- var n = e.orig,
- i = e.trim;
- i &&
- (SF.set(
- n.width / i.width,
- 0,
- 0,
- n.height / i.height,
- -i.x / i.width,
- -i.y / i.height
- ),
- this.mapCoord.append(SF));
- var o = e.baseTexture,
- s = this.uClampFrame,
- a = this.clampMargin / o.resolution,
- u = this.clampOffset;
- return (
- (s[0] = (e._frame.x + a + u) / o.width),
- (s[1] = (e._frame.y + a + u) / o.height),
- (s[2] = (e._frame.x + e._frame.width - a + u) / o.width),
- (s[3] = (e._frame.y + e._frame.height - a + u) / o.height),
- (this.uClampOffset[0] = u / o.realWidth),
- (this.uClampOffset[1] = u / o.realHeight),
- (this.isSimple =
- e._frame.width === o.width &&
- e._frame.height === o.height &&
- 0 === e.rotate),
- !0
- );
- }),
- t
- );
- })(),
- RF = (function (t) {
- function e(e, r, n) {
- var i = this,
- o = null;
- return (
- 'string' != typeof e &&
- void 0 === r &&
- void 0 === n &&
- ((o = e), (e = void 0), (r = void 0), (n = void 0)),
- ((i =
- t.call(
- this,
- e ||
- 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n',
- r ||
- 'varying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform sampler2D mask;\nuniform float alpha;\nuniform float npmAlpha;\nuniform vec4 maskClamp;\n\nvoid main(void)\n{\n float clip = step(3.5,\n step(maskClamp.x, vMaskCoord.x) +\n step(maskClamp.y, vMaskCoord.y) +\n step(vMaskCoord.x, maskClamp.z) +\n step(vMaskCoord.y, maskClamp.w));\n\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);\n\n original *= (alphaMul * masky.r * alpha * clip);\n\n gl_FragColor = original;\n}\n',
- n
- ) || this).maskSprite = o),
- (i.maskMatrix = new CD()),
- i
- );
- }
- return (
- rL(e, t),
- Object.defineProperty(e.prototype, 'maskSprite', {
- get: function () {
- return this._maskSprite;
- },
- set: function (t) {
- (this._maskSprite = t),
- this._maskSprite && (this._maskSprite.renderable = !1);
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype.apply = function (t, e, r, n) {
- var i = this._maskSprite,
- o = i._texture;
- o.valid &&
- (o.uvMatrix || (o.uvMatrix = new wF(o, 0)),
- o.uvMatrix.update(),
- (this.uniforms.npmAlpha = o.baseTexture.alphaMode ? 0 : 1),
- (this.uniforms.mask = o),
- (this.uniforms.otherMatrix = t
- .calculateSpriteMatrix(this.maskMatrix, i)
- .prepend(o.uvMatrix.mapCoord)),
- (this.uniforms.alpha = i.worldAlpha),
- (this.uniforms.maskClamp = o.uvMatrix.uClampFrame),
- t.applyFilter(this, e, r, n));
- }),
- e
- );
- })(EF),
- CF = (function () {
- function t(t) {
- (this.renderer = t),
- (this.enableScissor = !0),
- (this.alphaMaskPool = []),
- (this.maskDataPool = []),
- (this.maskStack = []),
- (this.alphaMaskIndex = 0);
- }
- return (
- (t.prototype.setMaskStack = function (t) {
- (this.maskStack = t),
- this.renderer.scissor.setMaskStack(t),
- this.renderer.stencil.setMaskStack(t);
- }),
- (t.prototype.push = function (t, e) {
- var r = e;
- if (!r.isMaskData) {
- var n = this.maskDataPool.pop() || new qL();
- (n.pooled = !0), (n.maskObject = e), (r = n);
- }
- var i =
- 0 !== this.maskStack.length
- ? this.maskStack[this.maskStack.length - 1]
- : null;
- if (
- (r.copyCountersOrReset(i),
- (r._colorMask = i ? i._colorMask : 15),
- r.autoDetect && this.detect(r),
- (r._target = t),
- r.type !== VP.SPRITE && this.maskStack.push(r),
- r.enabled)
- )
- switch (r.type) {
- case VP.SCISSOR:
- this.renderer.scissor.push(r);
- break;
- case VP.STENCIL:
- this.renderer.stencil.push(r);
- break;
- case VP.SPRITE:
- r.copyCountersOrReset(null), this.pushSpriteMask(r);
- break;
- case VP.COLOR:
- this.pushColorMask(r);
- }
- r.type === VP.SPRITE && this.maskStack.push(r);
- }),
- (t.prototype.pop = function (t) {
- var e = this.maskStack.pop();
- if (e && e._target === t) {
- if (e.enabled)
- switch (e.type) {
- case VP.SCISSOR:
- this.renderer.scissor.pop(e);
- break;
- case VP.STENCIL:
- this.renderer.stencil.pop(e.maskObject);
- break;
- case VP.SPRITE:
- this.popSpriteMask(e);
- break;
- case VP.COLOR:
- this.popColorMask(e);
- }
- if (
- (e.reset(),
- e.pooled && this.maskDataPool.push(e),
- 0 !== this.maskStack.length)
- ) {
- var r = this.maskStack[this.maskStack.length - 1];
- r.type === VP.SPRITE &&
- r._filters &&
- (r._filters[0].maskSprite = r.maskObject);
- }
- }
- }),
- (t.prototype.detect = function (t) {
- var e = t.maskObject;
- e
- ? e.isSprite
- ? (t.type = VP.SPRITE)
- : this.enableScissor && this.renderer.scissor.testScissor(t)
- ? (t.type = VP.SCISSOR)
- : (t.type = VP.STENCIL)
- : (t.type = VP.COLOR);
- }),
- (t.prototype.pushSpriteMask = function (t) {
- var e,
- r,
- n = t.maskObject,
- i = t._target,
- o = t._filters;
- o ||
- (o = this.alphaMaskPool[this.alphaMaskIndex]) ||
- (o = this.alphaMaskPool[this.alphaMaskIndex] = [new RF()]);
- var s,
- a,
- u = this.renderer,
- c = u.renderTexture;
- if (c.current) {
- var h = c.current;
- (s = t.resolution || h.resolution),
- (a =
- null !== (e = t.multisample) && void 0 !== e
- ? e
- : h.multisample);
- } else
- (s = t.resolution || u.resolution),
- (a =
- null !== (r = t.multisample) && void 0 !== r
- ? r
- : u.multisample);
- (o[0].resolution = s), (o[0].multisample = a), (o[0].maskSprite = n);
- var l = i.filterArea;
- (i.filterArea = n.getBounds(!0)),
- u.filter.push(i, o),
- (i.filterArea = l),
- t._filters || this.alphaMaskIndex++;
- }),
- (t.prototype.popSpriteMask = function (t) {
- this.renderer.filter.pop(),
- t._filters
- ? (t._filters[0].maskSprite = null)
- : (this.alphaMaskIndex--,
- (this.alphaMaskPool[this.alphaMaskIndex][0].maskSprite = null));
- }),
- (t.prototype.pushColorMask = function (t) {
- var e = t._colorMask,
- r = (t._colorMask = e & t.colorMask);
- r !== e &&
- this.renderer.gl.colorMask(
- 0 != (1 & r),
- 0 != (2 & r),
- 0 != (4 & r),
- 0 != (8 & r)
- );
- }),
- (t.prototype.popColorMask = function (t) {
- var e = t._colorMask,
- r =
- this.maskStack.length > 0
- ? this.maskStack[this.maskStack.length - 1]._colorMask
- : 15;
- r !== e &&
- this.renderer.gl.colorMask(
- 0 != (1 & r),
- 0 != (2 & r),
- 0 != (4 & r),
- 0 != (8 & r)
- );
- }),
- (t.prototype.destroy = function () {
- this.renderer = null;
- }),
- t
- );
- })(),
- PF = (function () {
- function t(t) {
- (this.renderer = t), (this.maskStack = []), (this.glConst = 0);
- }
- return (
- (t.prototype.getStackLength = function () {
- return this.maskStack.length;
- }),
- (t.prototype.setMaskStack = function (t) {
- var e = this.renderer.gl,
- r = this.getStackLength();
- this.maskStack = t;
- var n = this.getStackLength();
- n !== r &&
- (0 === n
- ? e.disable(this.glConst)
- : (e.enable(this.glConst), this._useCurrent()));
- }),
- (t.prototype._useCurrent = function () {}),
- (t.prototype.destroy = function () {
- (this.renderer = null), (this.maskStack = null);
- }),
- t
- );
- })(),
- AF = new CD(),
- OF = [],
- IF = (function (t) {
- function e(e) {
- var r = t.call(this, e) || this;
- return (
- (r.glConst = vA.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST), r
- );
- }
- return (
- rL(e, t),
- (e.prototype.getStackLength = function () {
- var t = this.maskStack[this.maskStack.length - 1];
- return t ? t._scissorCounter : 0;
- }),
- (e.prototype.calcScissorRect = function (t) {
- var e;
- if (!t._scissorRectLocal) {
- var r = t._scissorRect,
- n = t.maskObject,
- i = this.renderer,
- o = i.renderTexture,
- s = n.getBounds(
- !0,
- null !== (e = OF.pop()) && void 0 !== e ? e : new TD()
- );
- this.roundFrameToPixels(
- s,
- o.current ? o.current.resolution : i.resolution,
- o.sourceFrame,
- o.destinationFrame,
- i.projection.transform
- ),
- r && s.fit(r),
- (t._scissorRectLocal = s);
- }
- }),
- (e.isMatrixRotated = function (t) {
- if (!t) return !1;
- var e = t.a,
- r = t.b,
- n = t.c,
- i = t.d;
- return (
- (Math.abs(r) > 1e-4 || Math.abs(n) > 1e-4) &&
- (Math.abs(e) > 1e-4 || Math.abs(i) > 1e-4)
- );
- }),
- (e.prototype.testScissor = function (t) {
- var r = t.maskObject;
- if (!r.isFastRect || !r.isFastRect()) return !1;
- if (e.isMatrixRotated(r.worldTransform)) return !1;
- if (e.isMatrixRotated(this.renderer.projection.transform)) return !1;
- this.calcScissorRect(t);
- var n = t._scissorRectLocal;
- return n.width > 0 && n.height > 0;
- }),
- (e.prototype.roundFrameToPixels = function (t, r, n, i, o) {
- e.isMatrixRotated(o) ||
- ((o = o ? AF.copyFrom(o) : AF.identity())
- .translate(-n.x, -n.y)
- .scale(i.width / n.width, i.height / n.height)
- .translate(i.x, i.y),
- this.renderer.filter.transformAABB(o, t),
- t.fit(i),
- (t.x = Math.round(t.x * r)),
- (t.y = Math.round(t.y * r)),
- (t.width = Math.round(t.width * r)),
- (t.height = Math.round(t.height * r)));
- }),
- (e.prototype.push = function (t) {
- t._scissorRectLocal || this.calcScissorRect(t);
- var e = this.renderer.gl;
- t._scissorRect || e.enable(e.SCISSOR_TEST),
- t._scissorCounter++,
- (t._scissorRect = t._scissorRectLocal),
- this._useCurrent();
- }),
- (e.prototype.pop = function (t) {
- var e = this.renderer.gl;
- t && OF.push(t._scissorRectLocal),
- this.getStackLength() > 0
- ? this._useCurrent()
- : e.disable(e.SCISSOR_TEST);
- }),
- (e.prototype._useCurrent = function () {
- var t,
- e = this.maskStack[this.maskStack.length - 1]._scissorRect;
- (t = this.renderer.renderTexture.current
- ? e.y
- : this.renderer.height - e.height - e.y),
- this.renderer.gl.scissor(e.x, t, e.width, e.height);
- }),
- e
- );
- })(PF),
- MF = (function (t) {
- function e(e) {
- var r = t.call(this, e) || this;
- return (
- (r.glConst = vA.ADAPTER.getWebGLRenderingContext().STENCIL_TEST), r
- );
- }
- return (
- rL(e, t),
- (e.prototype.getStackLength = function () {
- var t = this.maskStack[this.maskStack.length - 1];
- return t ? t._stencilCounter : 0;
- }),
- (e.prototype.push = function (t) {
- var e = t.maskObject,
- r = this.renderer.gl,
- n = t._stencilCounter;
- 0 === n &&
- (this.renderer.framebuffer.forceStencil(),
- r.clearStencil(0),
- r.clear(r.STENCIL_BUFFER_BIT),
- r.enable(r.STENCIL_TEST)),
- t._stencilCounter++;
- var i = t._colorMask;
- 0 !== i && ((t._colorMask = 0), r.colorMask(!1, !1, !1, !1)),
- r.stencilFunc(r.EQUAL, n, 4294967295),
- r.stencilOp(r.KEEP, r.KEEP, r.INCR),
- (e.renderable = !0),
- e.render(this.renderer),
- this.renderer.batch.flush(),
- (e.renderable = !1),
- 0 !== i &&
- ((t._colorMask = i),
- r.colorMask(
- 0 != (1 & i),
- 0 != (2 & i),
- 0 != (4 & i),
- 0 != (8 & i)
- )),
- this._useCurrent();
- }),
- (e.prototype.pop = function (t) {
- var e = this.renderer.gl;
- if (0 === this.getStackLength()) e.disable(e.STENCIL_TEST);
- else {
- var r =
- 0 !== this.maskStack.length
- ? this.maskStack[this.maskStack.length - 1]
- : null,
- n = r ? r._colorMask : 15;
- 0 !== n && ((r._colorMask = 0), e.colorMask(!1, !1, !1, !1)),
- e.stencilOp(e.KEEP, e.KEEP, e.DECR),
- (t.renderable = !0),
- t.render(this.renderer),
- this.renderer.batch.flush(),
- (t.renderable = !1),
- 0 !== n &&
- ((r._colorMask = n),
- e.colorMask(
- 0 != (1 & n),
- 0 != (2 & n),
- 0 != (4 & n),
- 0 != (8 & n)
- )),
- this._useCurrent();
- }
- }),
- (e.prototype._useCurrent = function () {
- var t = this.renderer.gl;
- t.stencilFunc(t.EQUAL, this.getStackLength(), 4294967295),
- t.stencilOp(t.KEEP, t.KEEP, t.KEEP);
- }),
- e
- );
- })(PF),
- DF = (function () {
- function t(t) {
- (this.renderer = t),
- (this.destinationFrame = null),
- (this.sourceFrame = null),
- (this.defaultFrame = null),
- (this.projectionMatrix = new CD()),
- (this.transform = null);
- }
- return (
- (t.prototype.update = function (t, e, r, n) {
- (this.destinationFrame =
- t || this.destinationFrame || this.defaultFrame),
- (this.sourceFrame = e || this.sourceFrame || t),
- this.calculateProjection(
- this.destinationFrame,
- this.sourceFrame,
- r,
- n
- ),
- this.transform && this.projectionMatrix.append(this.transform);
- var i = this.renderer;
- (i.globalUniforms.uniforms.projectionMatrix = this.projectionMatrix),
- i.globalUniforms.update(),
- i.shader.shader &&
- i.shader.syncUniformGroup(i.shader.shader.uniforms.globals);
- }),
- (t.prototype.calculateProjection = function (t, e, r, n) {
- var i = this.projectionMatrix,
- o = n ? -1 : 1;
- i.identity(),
- (i.a = (1 / e.width) * 2),
- (i.d = o * ((1 / e.height) * 2)),
- (i.tx = -1 - e.x * i.a),
- (i.ty = -o - e.y * i.d);
- }),
- (t.prototype.setTransform = function (t) {}),
- (t.prototype.destroy = function () {
- this.renderer = null;
- }),
- t
- );
- })(),
- LF = new TD(),
- FF = new TD(),
- NF = (function () {
- function t(t) {
- (this.renderer = t),
- (this.clearColor = t._backgroundColorRgba),
- (this.defaultMaskStack = []),
- (this.current = null),
- (this.sourceFrame = new TD()),
- (this.destinationFrame = new TD()),
- (this.viewportFrame = new TD());
- }
- return (
- (t.prototype.bind = function (t, e, r) {
- void 0 === t && (t = null);
- var n,
- i,
- o,
- s = this.renderer;
- (this.current = t),
- t
- ? ((o = (n = t.baseTexture).resolution),
- e ||
- ((LF.width = t.frame.width),
- (LF.height = t.frame.height),
- (e = LF)),
- r ||
- ((FF.x = t.frame.x),
- (FF.y = t.frame.y),
- (FF.width = e.width),
- (FF.height = e.height),
- (r = FF)),
- (i = n.framebuffer))
- : ((o = s.resolution),
- e ||
- ((LF.width = s.screen.width),
- (LF.height = s.screen.height),
- (e = LF)),
- r || (((r = LF).width = e.width), (r.height = e.height)));
- var a = this.viewportFrame;
- (a.x = r.x * o),
- (a.y = r.y * o),
- (a.width = r.width * o),
- (a.height = r.height * o),
- t || (a.y = s.view.height - (a.y + a.height)),
- a.ceil(),
- this.renderer.framebuffer.bind(i, a),
- this.renderer.projection.update(r, e, o, !i),
- t
- ? this.renderer.mask.setMaskStack(n.maskStack)
- : this.renderer.mask.setMaskStack(this.defaultMaskStack),
- this.sourceFrame.copyFrom(e),
- this.destinationFrame.copyFrom(r);
- }),
- (t.prototype.clear = function (t, e) {
- t = this.current
- ? t || this.current.baseTexture.clearColor
- : t || this.clearColor;
- var r = this.destinationFrame,
- n = this.current ? this.current.baseTexture : this.renderer.screen,
- i = r.width !== n.width || r.height !== n.height;
- if (i) {
- var o = this.viewportFrame,
- s = o.x,
- a = o.y,
- u = o.width,
- c = o.height;
- (s = Math.round(s)),
- (a = Math.round(a)),
- (u = Math.round(u)),
- (c = Math.round(c)),
- this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),
- this.renderer.gl.scissor(s, a, u, c);
- }
- this.renderer.framebuffer.clear(t[0], t[1], t[2], t[3], e),
- i && this.renderer.scissor.pop();
- }),
- (t.prototype.resize = function () {
- this.bind(null);
- }),
- (t.prototype.reset = function () {
- this.bind(null);
- }),
- (t.prototype.destroy = function () {
- this.renderer = null;
- }),
- t
- );
- })();
- function kF(t, e, r, n, i) {
- r.buffer.update(i);
- }
- var BF = {
- float: '\n data[offset] = v;\n ',
- vec2: '\n data[offset] = v[0];\n data[offset+1] = v[1];\n ',
- vec3: '\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n ',
- vec4: '\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n data[offset+3] = v[3];\n ',
- mat2: '\n data[offset] = v[0];\n data[offset+1] = v[1];\n\n data[offset+4] = v[2];\n data[offset+5] = v[3];\n ',
- mat3: '\n data[offset] = v[0];\n data[offset+1] = v[1];\n data[offset+2] = v[2];\n\n data[offset + 4] = v[3];\n data[offset + 5] = v[4];\n data[offset + 6] = v[5];\n\n data[offset + 8] = v[6];\n data[offset + 9] = v[7];\n data[offset + 10] = v[8];\n ',
- mat4: '\n for(var i = 0; i < 16; i++)\n {\n data[offset + i] = v[i];\n }\n ',
- },
- GF = {
- float: 4,
- vec2: 8,
- vec3: 12,
- vec4: 16,
- int: 4,
- ivec2: 8,
- ivec3: 12,
- ivec4: 16,
- uint: 4,
- uvec2: 8,
- uvec3: 12,
- uvec4: 16,
- bool: 4,
- bvec2: 8,
- bvec3: 12,
- bvec4: 16,
- mat2: 32,
- mat3: 48,
- mat4: 64,
- };
- function UF(t, e) {
- if (!t.autoManage) return { size: 0, syncFunc: kF };
- for (
- var r = (function (t, e) {
- var r = [];
- for (var n in t) e[n] && r.push(e[n]);
- return (
- r.sort(function (t, e) {
- return t.index - e.index;
- }),
- r
- );
- })(t.uniforms, e),
- n = (function (t) {
- for (
- var e = t.map(function (t) {
- return { data: t, offset: 0, dataLen: 0, dirty: 0 };
- }),
- r = 0,
- n = 0,
- i = 0,
- o = 0;
- o < e.length;
- o++
- ) {
- var s = e[o];
- if (
- ((r = GF[s.data.type]),
- s.data.size > 1 && (r = Math.max(r, 16) * s.data.size),
- (s.dataLen = r),
- n % r != 0 && n < 16)
- ) {
- var a = (n % r) % 16;
- (n += a), (i += a);
- }
- n + r > 16
- ? ((i = 16 * Math.ceil(i / 16)),
- (s.offset = i),
- (i += r),
- (n = r))
- : ((s.offset = i), (n += r), (i += r));
- }
- return { uboElements: e, size: (i = 16 * Math.ceil(i / 16)) };
- })(r),
- i = n.uboElements,
- o = n.size,
- s = [
- '\n var v = null;\n var v2 = null;\n var cv = null;\n var t = 0;\n var gl = renderer.gl\n var index = 0;\n var data = buffer.data;\n ',
- ],
- a = 0;
- a < i.length;
- a++
- ) {
- for (
- var u = i[a],
- c = t.uniforms[u.data.name],
- h = u.data.name,
- l = !1,
- d = 0;
- d < dF.length;
- d++
- ) {
- var f = dF[d];
- if (f.codeUbo && f.test(u.data, c)) {
- s.push(
- 'offset = ' + u.offset / 4 + ';',
- dF[d].codeUbo(u.data.name, c)
- ),
- (l = !0);
- break;
- }
- }
- if (!l)
- if (u.data.size > 1) {
- var p = uF(u.data.type),
- v = Math.max(GF[u.data.type] / 16, 1),
- m = p / v,
- y = (4 - (m % 4)) % 4;
- s.push(
- '\n cv = ud.' +
- h +
- '.value;\n v = uv.' +
- h +
- ';\n offset = ' +
- u.offset / 4 +
- ';\n\n t = 0;\n\n for(var i=0; i < ' +
- u.data.size * v +
- '; i++)\n {\n for(var j = 0; j < ' +
- m +
- '; j++)\n {\n data[offset++] = v[t++];\n }\n offset += ' +
- y +
- ';\n }\n\n '
- );
- } else {
- var g = BF[u.data.type];
- s.push(
- '\n cv = ud.' +
- h +
- '.value;\n v = uv.' +
- h +
- ';\n offset = ' +
- u.offset / 4 +
- ';\n ' +
- g +
- ';\n '
- );
- }
- }
- return (
- s.push('\n renderer.buffer.update(buffer);\n '),
- {
- size: o,
- syncFunc: new Function(
- 'ud',
- 'uv',
- 'renderer',
- 'syncData',
- 'buffer',
- s.join('\n')
- ),
- }
- );
- }
- var jF = (function () {
- function t(t, e) {
- (this.program = t),
- (this.uniformData = e),
- (this.uniformGroups = {}),
- (this.uniformDirtyGroups = {}),
- (this.uniformBufferBindings = {});
- }
- return (
- (t.prototype.destroy = function () {
- (this.uniformData = null),
- (this.uniformGroups = null),
- (this.uniformDirtyGroups = null),
- (this.uniformBufferBindings = null),
- (this.program = null);
- }),
- t
- );
- })();
- function XF(t, e) {
- var r = QL(t, t.VERTEX_SHADER, e.vertexSrc),
- n = QL(t, t.FRAGMENT_SHADER, e.fragmentSrc),
- i = t.createProgram();
- if (
- (t.attachShader(i, r),
- t.attachShader(i, n),
- t.linkProgram(i),
- t.getProgramParameter(i, t.LINK_STATUS) ||
- (function (t, e, r, n) {
- t.getProgramParameter(e, t.LINK_STATUS) ||
- (t.getShaderParameter(r, t.COMPILE_STATUS) || $L(t, r),
- t.getShaderParameter(n, t.COMPILE_STATUS) || $L(t, n),
- console.error('PixiJS Error: Could not initialize shader.'),
- '' !== t.getProgramInfoLog(e) &&
- console.warn(
- 'PixiJS Warning: gl.getProgramInfoLog()',
- t.getProgramInfoLog(e)
- ));
- })(t, i, r, n),
- (e.attributeData = (function (t, e) {
- for (
- var r = {}, n = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), i = 0;
- i < n;
- i++
- ) {
- var o = e.getActiveAttrib(t, i);
- if (0 !== o.name.indexOf('gl_')) {
- var s = lF(e, o.type),
- a = {
- type: s,
- name: o.name,
- size: uF(s),
- location: e.getAttribLocation(t, o.name),
- };
- r[o.name] = a;
- }
- }
- return r;
- })(i, t)),
- (e.uniformData = (function (t, e) {
- for (
- var r = {}, n = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), i = 0;
- i < n;
- i++
- ) {
- var o = e.getActiveUniform(t, i),
- s = o.name.replace(/\[.*?\]$/, ''),
- a = !!o.name.match(/\[.*?\]$/),
- u = lF(e, o.type);
- r[s] = {
- name: s,
- index: i,
- type: u,
- size: o.size,
- isArray: a,
- value: eF(u, o.size),
- };
- }
- return r;
- })(i, t)),
- !/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertexSrc))
- ) {
- var o = Object.keys(e.attributeData);
- o.sort(function (t, e) {
- return t > e ? 1 : -1;
- });
- for (var s = 0; s < o.length; s++)
- (e.attributeData[o[s]].location = s), t.bindAttribLocation(i, s, o[s]);
- t.linkProgram(i);
- }
- t.deleteShader(r), t.deleteShader(n);
- var a = {};
- for (var s in e.uniformData) {
- var u = e.uniformData[s];
- a[s] = {
- location: t.getUniformLocation(i, s),
- value: eF(u.type, u.size),
- };
- }
- return new jF(i, a);
- }
- var VF = 0,
- HF = { textureCount: 0, uboCount: 0 },
- WF = (function () {
- function t(t) {
- (this.destroyed = !1),
- (this.renderer = t),
- this.systemCheck(),
- (this.gl = null),
- (this.shader = null),
- (this.program = null),
- (this.cache = {}),
- (this._uboCache = {}),
- (this.id = VF++);
- }
- return (
- (t.prototype.systemCheck = function () {
- if (
- !(function () {
- if ('boolean' == typeof vF) return vF;
- try {
- var t = new Function(
- 'param1',
- 'param2',
- 'param3',
- 'return param1[param2] === param3;'
- );
- vF = !0 === t({ a: 'b' }, 'a', 'b');
- } catch (t) {
- vF = !1;
- }
- return vF;
- })()
- )
- throw new Error(
- 'Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.'
- );
- }),
- (t.prototype.contextChange = function (t) {
- (this.gl = t), this.reset();
- }),
- (t.prototype.bind = function (t, e) {
- t.disposeRunner.add(this),
- (t.uniforms.globals = this.renderer.globalUniforms);
- var r = t.program,
- n =
- r.glPrograms[this.renderer.CONTEXT_UID] ||
- this.generateProgram(t);
- return (
- (this.shader = t),
- this.program !== r &&
- ((this.program = r), this.gl.useProgram(n.program)),
- e ||
- ((HF.textureCount = 0),
- (HF.uboCount = 0),
- this.syncUniformGroup(t.uniformGroup, HF)),
- n
- );
- }),
- (t.prototype.setUniforms = function (t) {
- var e = this.shader.program,
- r = e.glPrograms[this.renderer.CONTEXT_UID];
- e.syncUniforms(r.uniformData, t, this.renderer);
- }),
- (t.prototype.syncUniformGroup = function (t, e) {
- var r = this.getGlProgram();
- (t.static && t.dirtyId === r.uniformDirtyGroups[t.id]) ||
- ((r.uniformDirtyGroups[t.id] = t.dirtyId),
- this.syncUniforms(t, r, e));
- }),
- (t.prototype.syncUniforms = function (t, e, r) {
- (t.syncUniforms[this.shader.program.id] || this.createSyncGroups(t))(
- e.uniformData,
- t.uniforms,
- this.renderer,
- r
- );
- }),
- (t.prototype.createSyncGroups = function (t) {
- var e = this.getSignature(t, this.shader.program.uniformData, 'u');
- return (
- this.cache[e] ||
- (this.cache[e] = (function (t, e) {
- var r,
- n = [
- '\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n ',
- ];
- for (var i in t.uniforms) {
- var o = e[i];
- if (o) {
- for (
- var s = t.uniforms[i], a = !1, u = 0;
- u < dF.length;
- u++
- )
- if (dF[u].test(o, s)) {
- n.push(dF[u].code(i, s)), (a = !0);
- break;
- }
- if (!a) {
- var c = (1 !== o.size || o.isArray ? pF : fF)[
- o.type
- ].replace('location', 'ud["' + i + '"].location');
- n.push(
- '\n cu = ud["' +
- i +
- '"];\n cv = cu.value;\n v = uv["' +
- i +
- '"];\n ' +
- c +
- ';'
- );
- }
- } else
- (null === (r = t.uniforms[i]) || void 0 === r
- ? void 0
- : r.group) &&
- (t.uniforms[i].ubo
- ? n.push(
- '\n renderer.shader.syncUniformBufferGroup(uv.' +
- i +
- ", '" +
- i +
- "');\n "
- )
- : n.push(
- '\n renderer.shader.syncUniformGroup(uv.' +
- i +
- ', syncData);\n '
- ));
- }
- return new Function(
- 'ud',
- 'uv',
- 'renderer',
- 'syncData',
- n.join('\n')
- );
- })(t, this.shader.program.uniformData)),
- (t.syncUniforms[this.shader.program.id] = this.cache[e]),
- t.syncUniforms[this.shader.program.id]
- );
- }),
- (t.prototype.syncUniformBufferGroup = function (t, e) {
- var r = this.getGlProgram();
- if (!t.static || 0 !== t.dirtyId || !r.uniformGroups[t.id]) {
- t.dirtyId = 0;
- var n =
- r.uniformGroups[t.id] || this.createSyncBufferGroup(t, r, e);
- t.buffer.update(),
- n(r.uniformData, t.uniforms, this.renderer, HF, t.buffer);
- }
- this.renderer.buffer.bindBufferBase(
- t.buffer,
- r.uniformBufferBindings[e]
- );
- }),
- (t.prototype.createSyncBufferGroup = function (t, e, r) {
- var n = this.renderer.gl;
- this.renderer.buffer.bind(t.buffer);
- var i = this.gl.getUniformBlockIndex(e.program, r);
- (e.uniformBufferBindings[r] = this.shader.uniformBindCount),
- n.uniformBlockBinding(e.program, i, this.shader.uniformBindCount),
- this.shader.uniformBindCount++;
- var o = this.getSignature(t, this.shader.program.uniformData, 'ubo'),
- s = this._uboCache[o];
- if (
- (s ||
- (s = this._uboCache[o] = UF(t, this.shader.program.uniformData)),
- t.autoManage)
- ) {
- var a = new Float32Array(s.size / 4);
- t.buffer.update(a);
- }
- return (e.uniformGroups[t.id] = s.syncFunc), e.uniformGroups[t.id];
- }),
- (t.prototype.getSignature = function (t, e, r) {
- var n = t.uniforms,
- i = [r + '-'];
- for (var o in n) i.push(o), e[o] && i.push(e[o].type);
- return i.join('-');
- }),
- (t.prototype.getGlProgram = function () {
- return this.shader
- ? this.shader.program.glPrograms[this.renderer.CONTEXT_UID]
- : null;
- }),
- (t.prototype.generateProgram = function (t) {
- var e = this.gl,
- r = t.program,
- n = XF(e, r);
- return (r.glPrograms[this.renderer.CONTEXT_UID] = n), n;
- }),
- (t.prototype.reset = function () {
- (this.program = null), (this.shader = null);
- }),
- (t.prototype.disposeShader = function (t) {
- this.shader === t && (this.shader = null);
- }),
- (t.prototype.destroy = function () {
- (this.renderer = null), (this.destroyed = !0);
- }),
- t
- );
- })();
- var YF = (function () {
- function t() {
- (this.gl = null),
- (this.stateId = 0),
- (this.polygonOffset = 0),
- (this.blendMode = OP.NONE),
- (this._blendEq = !1),
- (this.map = []),
- (this.map[0] = this.setBlend),
- (this.map[1] = this.setOffset),
- (this.map[2] = this.setCullFace),
- (this.map[3] = this.setDepthTest),
- (this.map[4] = this.setFrontFace),
- (this.map[5] = this.setDepthMask),
- (this.checks = []),
- (this.defaultState = new xF()),
- (this.defaultState.blend = !0);
- }
- return (
- (t.prototype.contextChange = function (t) {
- (this.gl = t),
- (this.blendModes = (function (t, e) {
- return (
- void 0 === e && (e = []),
- (e[OP.NORMAL] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.ADD] = [t.ONE, t.ONE]),
- (e[OP.MULTIPLY] = [
- t.DST_COLOR,
- t.ONE_MINUS_SRC_ALPHA,
- t.ONE,
- t.ONE_MINUS_SRC_ALPHA,
- ]),
- (e[OP.SCREEN] = [
- t.ONE,
- t.ONE_MINUS_SRC_COLOR,
- t.ONE,
- t.ONE_MINUS_SRC_ALPHA,
- ]),
- (e[OP.OVERLAY] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.DARKEN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.LIGHTEN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.COLOR_DODGE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.COLOR_BURN] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.HARD_LIGHT] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.SOFT_LIGHT] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.DIFFERENCE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.EXCLUSION] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.HUE] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.SATURATION] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.COLOR] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.LUMINOSITY] = [t.ONE, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.NONE] = [0, 0]),
- (e[OP.NORMAL_NPM] = [
- t.SRC_ALPHA,
- t.ONE_MINUS_SRC_ALPHA,
- t.ONE,
- t.ONE_MINUS_SRC_ALPHA,
- ]),
- (e[OP.ADD_NPM] = [t.SRC_ALPHA, t.ONE, t.ONE, t.ONE]),
- (e[OP.SCREEN_NPM] = [
- t.SRC_ALPHA,
- t.ONE_MINUS_SRC_COLOR,
- t.ONE,
- t.ONE_MINUS_SRC_ALPHA,
- ]),
- (e[OP.SRC_IN] = [t.DST_ALPHA, t.ZERO]),
- (e[OP.SRC_OUT] = [t.ONE_MINUS_DST_ALPHA, t.ZERO]),
- (e[OP.SRC_ATOP] = [t.DST_ALPHA, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.DST_OVER] = [t.ONE_MINUS_DST_ALPHA, t.ONE]),
- (e[OP.DST_IN] = [t.ZERO, t.SRC_ALPHA]),
- (e[OP.DST_OUT] = [t.ZERO, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.DST_ATOP] = [t.ONE_MINUS_DST_ALPHA, t.SRC_ALPHA]),
- (e[OP.XOR] = [t.ONE_MINUS_DST_ALPHA, t.ONE_MINUS_SRC_ALPHA]),
- (e[OP.SUBTRACT] = [
- t.ONE,
- t.ONE,
- t.ONE,
- t.ONE,
- t.FUNC_REVERSE_SUBTRACT,
- t.FUNC_ADD,
- ]),
- e
- );
- })(t)),
- this.set(this.defaultState),
- this.reset();
- }),
- (t.prototype.set = function (t) {
- if (((t = t || this.defaultState), this.stateId !== t.data)) {
- for (var e = this.stateId ^ t.data, r = 0; e; )
- 1 & e && this.map[r].call(this, !!(t.data & (1 << r))),
- (e >>= 1),
- r++;
- this.stateId = t.data;
- }
- for (r = 0; r < this.checks.length; r++) this.checks[r](this, t);
- }),
- (t.prototype.forceState = function (t) {
- t = t || this.defaultState;
- for (var e = 0; e < this.map.length; e++)
- this.map[e].call(this, !!(t.data & (1 << e)));
- for (e = 0; e < this.checks.length; e++) this.checks[e](this, t);
- this.stateId = t.data;
- }),
- (t.prototype.setBlend = function (e) {
- this.updateCheck(t.checkBlendMode, e),
- this.gl[e ? 'enable' : 'disable'](this.gl.BLEND);
- }),
- (t.prototype.setOffset = function (e) {
- this.updateCheck(t.checkPolygonOffset, e),
- this.gl[e ? 'enable' : 'disable'](this.gl.POLYGON_OFFSET_FILL);
- }),
- (t.prototype.setDepthTest = function (t) {
- this.gl[t ? 'enable' : 'disable'](this.gl.DEPTH_TEST);
- }),
- (t.prototype.setDepthMask = function (t) {
- this.gl.depthMask(t);
- }),
- (t.prototype.setCullFace = function (t) {
- this.gl[t ? 'enable' : 'disable'](this.gl.CULL_FACE);
- }),
- (t.prototype.setFrontFace = function (t) {
- this.gl.frontFace(this.gl[t ? 'CW' : 'CCW']);
- }),
- (t.prototype.setBlendMode = function (t) {
- if (t !== this.blendMode) {
- this.blendMode = t;
- var e = this.blendModes[t],
- r = this.gl;
- 2 === e.length
- ? r.blendFunc(e[0], e[1])
- : r.blendFuncSeparate(e[0], e[1], e[2], e[3]),
- 6 === e.length
- ? ((this._blendEq = !0), r.blendEquationSeparate(e[4], e[5]))
- : this._blendEq &&
- ((this._blendEq = !1),
- r.blendEquationSeparate(r.FUNC_ADD, r.FUNC_ADD));
- }
- }),
- (t.prototype.setPolygonOffset = function (t, e) {
- this.gl.polygonOffset(t, e);
- }),
- (t.prototype.reset = function () {
- this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, !1),
- this.forceState(this.defaultState),
- (this._blendEq = !0),
- (this.blendMode = -1),
- this.setBlendMode(0);
- }),
- (t.prototype.updateCheck = function (t, e) {
- var r = this.checks.indexOf(t);
- e && -1 === r
- ? this.checks.push(t)
- : e || -1 === r || this.checks.splice(r, 1);
- }),
- (t.checkBlendMode = function (t, e) {
- t.setBlendMode(e.blendMode);
- }),
- (t.checkPolygonOffset = function (t, e) {
- t.setPolygonOffset(1, e.polygonOffset);
- }),
- (t.prototype.destroy = function () {
- this.gl = null;
- }),
- t
- );
- })(),
- zF = (function () {
- function t(t) {
- (this.renderer = t),
- (this.count = 0),
- (this.checkCount = 0),
- (this.maxIdle = vA.GC_MAX_IDLE),
- (this.checkCountMax = vA.GC_MAX_CHECK_COUNT),
- (this.mode = vA.GC_MODE);
- }
- return (
- (t.prototype.postrender = function () {
- this.renderer.renderingToScreen &&
- (this.count++,
- this.mode !== jP.MANUAL &&
- (this.checkCount++,
- this.checkCount > this.checkCountMax &&
- ((this.checkCount = 0), this.run())));
- }),
- (t.prototype.run = function () {
- for (
- var t = this.renderer.texture, e = t.managedTextures, r = !1, n = 0;
- n < e.length;
- n++
- ) {
- var i = e[n];
- !i.framebuffer &&
- this.count - i.touched > this.maxIdle &&
- (t.destroyTexture(i, !0), (e[n] = null), (r = !0));
- }
- if (r) {
- var o = 0;
- for (n = 0; n < e.length; n++) null !== e[n] && (e[o++] = e[n]);
- e.length = o;
- }
- }),
- (t.prototype.unload = function (t) {
- var e = this.renderer.texture,
- r = t._texture;
- r && !r.framebuffer && e.destroyTexture(r);
- for (var n = t.children.length - 1; n >= 0; n--)
- this.unload(t.children[n]);
- }),
- (t.prototype.destroy = function () {
- this.renderer = null;
- }),
- t
- );
- })();
- var ZF = function (t) {
- (this.texture = t),
- (this.width = -1),
- (this.height = -1),
- (this.dirtyId = -1),
- (this.dirtyStyleId = -1),
- (this.mipmap = !1),
- (this.wrapMode = 33071),
- (this.type = LP.UNSIGNED_BYTE),
- (this.internalFormat = MP.RGBA),
- (this.samplerType = 0);
- },
- JF = (function () {
- function t(t) {
- (this.renderer = t),
- (this.boundTextures = []),
- (this.currentLocation = -1),
- (this.managedTextures = []),
- (this._unknownBoundTextures = !1),
- (this.unknownTexture = new aL()),
- (this.hasIntegerTextures = !1);
- }
- return (
- (t.prototype.contextChange = function () {
- var t = (this.gl = this.renderer.gl);
- (this.CONTEXT_UID = this.renderer.CONTEXT_UID),
- (this.webGLVersion = this.renderer.context.webGLVersion),
- (this.internalFormats = (function (t) {
- var e,
- r,
- n,
- i,
- o,
- s,
- a,
- u,
- c,
- h,
- l,
- d,
- f,
- p,
- v,
- m,
- y,
- g,
- _,
- b,
- T,
- x,
- E;
- return (
- 'WebGL2RenderingContext' in globalThis &&
- t instanceof globalThis.WebGL2RenderingContext
- ? (((e = {})[LP.UNSIGNED_BYTE] =
- (((r = {})[MP.RGBA] = t.RGBA8),
- (r[MP.RGB] = t.RGB8),
- (r[MP.RG] = t.RG8),
- (r[MP.RED] = t.R8),
- (r[MP.RGBA_INTEGER] = t.RGBA8UI),
- (r[MP.RGB_INTEGER] = t.RGB8UI),
- (r[MP.RG_INTEGER] = t.RG8UI),
- (r[MP.RED_INTEGER] = t.R8UI),
- (r[MP.ALPHA] = t.ALPHA),
- (r[MP.LUMINANCE] = t.LUMINANCE),
- (r[MP.LUMINANCE_ALPHA] = t.LUMINANCE_ALPHA),
- r)),
- (e[LP.BYTE] =
- (((n = {})[MP.RGBA] = t.RGBA8_SNORM),
- (n[MP.RGB] = t.RGB8_SNORM),
- (n[MP.RG] = t.RG8_SNORM),
- (n[MP.RED] = t.R8_SNORM),
- (n[MP.RGBA_INTEGER] = t.RGBA8I),
- (n[MP.RGB_INTEGER] = t.RGB8I),
- (n[MP.RG_INTEGER] = t.RG8I),
- (n[MP.RED_INTEGER] = t.R8I),
- n)),
- (e[LP.UNSIGNED_SHORT] =
- (((i = {})[MP.RGBA_INTEGER] = t.RGBA16UI),
- (i[MP.RGB_INTEGER] = t.RGB16UI),
- (i[MP.RG_INTEGER] = t.RG16UI),
- (i[MP.RED_INTEGER] = t.R16UI),
- (i[MP.DEPTH_COMPONENT] = t.DEPTH_COMPONENT16),
- i)),
- (e[LP.SHORT] =
- (((o = {})[MP.RGBA_INTEGER] = t.RGBA16I),
- (o[MP.RGB_INTEGER] = t.RGB16I),
- (o[MP.RG_INTEGER] = t.RG16I),
- (o[MP.RED_INTEGER] = t.R16I),
- o)),
- (e[LP.UNSIGNED_INT] =
- (((s = {})[MP.RGBA_INTEGER] = t.RGBA32UI),
- (s[MP.RGB_INTEGER] = t.RGB32UI),
- (s[MP.RG_INTEGER] = t.RG32UI),
- (s[MP.RED_INTEGER] = t.R32UI),
- (s[MP.DEPTH_COMPONENT] = t.DEPTH_COMPONENT24),
- s)),
- (e[LP.INT] =
- (((a = {})[MP.RGBA_INTEGER] = t.RGBA32I),
- (a[MP.RGB_INTEGER] = t.RGB32I),
- (a[MP.RG_INTEGER] = t.RG32I),
- (a[MP.RED_INTEGER] = t.R32I),
- a)),
- (e[LP.FLOAT] =
- (((u = {})[MP.RGBA] = t.RGBA32F),
- (u[MP.RGB] = t.RGB32F),
- (u[MP.RG] = t.RG32F),
- (u[MP.RED] = t.R32F),
- (u[MP.DEPTH_COMPONENT] = t.DEPTH_COMPONENT32F),
- u)),
- (e[LP.HALF_FLOAT] =
- (((c = {})[MP.RGBA] = t.RGBA16F),
- (c[MP.RGB] = t.RGB16F),
- (c[MP.RG] = t.RG16F),
- (c[MP.RED] = t.R16F),
- c)),
- (e[LP.UNSIGNED_SHORT_5_6_5] =
- (((h = {})[MP.RGB] = t.RGB565), h)),
- (e[LP.UNSIGNED_SHORT_4_4_4_4] =
- (((l = {})[MP.RGBA] = t.RGBA4), l)),
- (e[LP.UNSIGNED_SHORT_5_5_5_1] =
- (((d = {})[MP.RGBA] = t.RGB5_A1), d)),
- (e[LP.UNSIGNED_INT_2_10_10_10_REV] =
- (((f = {})[MP.RGBA] = t.RGB10_A2),
- (f[MP.RGBA_INTEGER] = t.RGB10_A2UI),
- f)),
- (e[LP.UNSIGNED_INT_10F_11F_11F_REV] =
- (((p = {})[MP.RGB] = t.R11F_G11F_B10F), p)),
- (e[LP.UNSIGNED_INT_5_9_9_9_REV] =
- (((v = {})[MP.RGB] = t.RGB9_E5), v)),
- (e[LP.UNSIGNED_INT_24_8] =
- (((m = {})[MP.DEPTH_STENCIL] = t.DEPTH24_STENCIL8), m)),
- (e[LP.FLOAT_32_UNSIGNED_INT_24_8_REV] =
- (((y = {})[MP.DEPTH_STENCIL] = t.DEPTH32F_STENCIL8), y)),
- (E = e))
- : (((g = {})[LP.UNSIGNED_BYTE] =
- (((_ = {})[MP.RGBA] = t.RGBA),
- (_[MP.RGB] = t.RGB),
- (_[MP.ALPHA] = t.ALPHA),
- (_[MP.LUMINANCE] = t.LUMINANCE),
- (_[MP.LUMINANCE_ALPHA] = t.LUMINANCE_ALPHA),
- _)),
- (g[LP.UNSIGNED_SHORT_5_6_5] =
- (((b = {})[MP.RGB] = t.RGB), b)),
- (g[LP.UNSIGNED_SHORT_4_4_4_4] =
- (((T = {})[MP.RGBA] = t.RGBA), T)),
- (g[LP.UNSIGNED_SHORT_5_5_5_1] =
- (((x = {})[MP.RGBA] = t.RGBA), x)),
- (E = g)),
- E
- );
- })(t));
- var e = t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);
- this.boundTextures.length = e;
- for (var r = 0; r < e; r++) this.boundTextures[r] = null;
- this.emptyTextures = {};
- var n = new ZF(t.createTexture());
- t.bindTexture(t.TEXTURE_2D, n.texture),
- t.texImage2D(
- t.TEXTURE_2D,
- 0,
- t.RGBA,
- 1,
- 1,
- 0,
- t.RGBA,
- t.UNSIGNED_BYTE,
- new Uint8Array(4)
- ),
- (this.emptyTextures[t.TEXTURE_2D] = n),
- (this.emptyTextures[t.TEXTURE_CUBE_MAP] = new ZF(
- t.createTexture()
- )),
- t.bindTexture(
- t.TEXTURE_CUBE_MAP,
- this.emptyTextures[t.TEXTURE_CUBE_MAP].texture
- );
- for (r = 0; r < 6; r++)
- t.texImage2D(
- t.TEXTURE_CUBE_MAP_POSITIVE_X + r,
- 0,
- t.RGBA,
- 1,
- 1,
- 0,
- t.RGBA,
- t.UNSIGNED_BYTE,
- null
- );
- t.texParameteri(t.TEXTURE_CUBE_MAP, t.TEXTURE_MAG_FILTER, t.LINEAR),
- t.texParameteri(t.TEXTURE_CUBE_MAP, t.TEXTURE_MIN_FILTER, t.LINEAR);
- for (r = 0; r < this.boundTextures.length; r++) this.bind(null, r);
- }),
- (t.prototype.bind = function (t, e) {
- void 0 === e && (e = 0);
- var r = this.gl;
- if (
- (t = null == t ? void 0 : t.castToBaseTexture()) &&
- t.valid &&
- !t.parentTextureArray
- ) {
- t.touched = this.renderer.textureGC.count;
- var n = t._glTextures[this.CONTEXT_UID] || this.initTexture(t);
- this.boundTextures[e] !== t &&
- (this.currentLocation !== e &&
- ((this.currentLocation = e), r.activeTexture(r.TEXTURE0 + e)),
- r.bindTexture(t.target, n.texture)),
- n.dirtyId !== t.dirtyId
- ? (this.currentLocation !== e &&
- ((this.currentLocation = e),
- r.activeTexture(r.TEXTURE0 + e)),
- this.updateTexture(t))
- : n.dirtyStyleId !== t.dirtyStyleId &&
- this.updateTextureStyle(t),
- (this.boundTextures[e] = t);
- } else
- this.currentLocation !== e &&
- ((this.currentLocation = e), r.activeTexture(r.TEXTURE0 + e)),
- r.bindTexture(
- r.TEXTURE_2D,
- this.emptyTextures[r.TEXTURE_2D].texture
- ),
- (this.boundTextures[e] = null);
- }),
- (t.prototype.reset = function () {
- (this._unknownBoundTextures = !0),
- (this.hasIntegerTextures = !1),
- (this.currentLocation = -1);
- for (var t = 0; t < this.boundTextures.length; t++)
- this.boundTextures[t] = this.unknownTexture;
- }),
- (t.prototype.unbind = function (t) {
- var e = this.gl,
- r = this.boundTextures;
- if (this._unknownBoundTextures) {
- this._unknownBoundTextures = !1;
- for (var n = 0; n < r.length; n++)
- r[n] === this.unknownTexture && this.bind(null, n);
- }
- for (n = 0; n < r.length; n++)
- r[n] === t &&
- (this.currentLocation !== n &&
- (e.activeTexture(e.TEXTURE0 + n), (this.currentLocation = n)),
- e.bindTexture(t.target, this.emptyTextures[t.target].texture),
- (r[n] = null));
- }),
- (t.prototype.ensureSamplerType = function (t) {
- var e = this,
- r = e.boundTextures,
- n = e.hasIntegerTextures,
- i = e.CONTEXT_UID;
- if (n)
- for (var o = t - 1; o >= 0; --o) {
- var s = r[o];
- if (s)
- s._glTextures[i].samplerType !== FP.FLOAT &&
- this.renderer.texture.unbind(s);
- }
- }),
- (t.prototype.initTexture = function (t) {
- var e = new ZF(this.gl.createTexture());
- return (
- (e.dirtyId = -1),
- (t._glTextures[this.CONTEXT_UID] = e),
- this.managedTextures.push(t),
- t.on('dispose', this.destroyTexture, this),
- e
- );
- }),
- (t.prototype.initTextureType = function (t, e) {
- var r, n;
- (e.internalFormat =
- null !==
- (n =
- null === (r = this.internalFormats[t.type]) || void 0 === r
- ? void 0
- : r[t.format]) && void 0 !== n
- ? n
- : t.format),
- 2 === this.webGLVersion && t.type === LP.HALF_FLOAT
- ? (e.type = this.gl.HALF_FLOAT)
- : (e.type = t.type);
- }),
- (t.prototype.updateTexture = function (t) {
- var e = t._glTextures[this.CONTEXT_UID];
- if (e) {
- var r = this.renderer;
- if (
- (this.initTextureType(t, e),
- t.resource && t.resource.upload(r, t, e))
- )
- e.samplerType !== FP.FLOAT && (this.hasIntegerTextures = !0);
- else {
- var n = t.realWidth,
- i = t.realHeight,
- o = r.gl;
- (e.width !== n || e.height !== i || e.dirtyId < 0) &&
- ((e.width = n),
- (e.height = i),
- o.texImage2D(
- t.target,
- 0,
- e.internalFormat,
- n,
- i,
- 0,
- t.format,
- e.type,
- null
- ));
- }
- t.dirtyStyleId !== e.dirtyStyleId && this.updateTextureStyle(t),
- (e.dirtyId = t.dirtyId);
- }
- }),
- (t.prototype.destroyTexture = function (t, e) {
- var r = this.gl;
- if (
- (t = t.castToBaseTexture())._glTextures[this.CONTEXT_UID] &&
- (this.unbind(t),
- r.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),
- t.off('dispose', this.destroyTexture, this),
- delete t._glTextures[this.CONTEXT_UID],
- !e)
- ) {
- var n = this.managedTextures.indexOf(t);
- -1 !== n && rD(this.managedTextures, n, 1);
- }
- }),
- (t.prototype.updateTextureStyle = function (t) {
- var e = t._glTextures[this.CONTEXT_UID];
- e &&
- ((t.mipmap !== BP.POW2 && 2 === this.webGLVersion) || t.isPowerOfTwo
- ? (e.mipmap = t.mipmap >= 1)
- : (e.mipmap = !1),
- 2 === this.webGLVersion || t.isPowerOfTwo
- ? (e.wrapMode = t.wrapMode)
- : (e.wrapMode = kP.CLAMP),
- (t.resource && t.resource.style(this.renderer, t, e)) ||
- this.setStyle(t, e),
- (e.dirtyStyleId = t.dirtyStyleId));
- }),
- (t.prototype.setStyle = function (t, e) {
- var r = this.gl;
- if (
- (e.mipmap &&
- t.mipmap !== BP.ON_MANUAL &&
- r.generateMipmap(t.target),
- r.texParameteri(t.target, r.TEXTURE_WRAP_S, e.wrapMode),
- r.texParameteri(t.target, r.TEXTURE_WRAP_T, e.wrapMode),
- e.mipmap)
- ) {
- r.texParameteri(
- t.target,
- r.TEXTURE_MIN_FILTER,
- t.scaleMode === NP.LINEAR
- ? r.LINEAR_MIPMAP_LINEAR
- : r.NEAREST_MIPMAP_NEAREST
- );
- var n = this.renderer.context.extensions.anisotropicFiltering;
- if (n && t.anisotropicLevel > 0 && t.scaleMode === NP.LINEAR) {
- var i = Math.min(
- t.anisotropicLevel,
- r.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT)
- );
- r.texParameterf(t.target, n.TEXTURE_MAX_ANISOTROPY_EXT, i);
- }
- } else
- r.texParameteri(
- t.target,
- r.TEXTURE_MIN_FILTER,
- t.scaleMode === NP.LINEAR ? r.LINEAR : r.NEAREST
- );
- r.texParameteri(
- t.target,
- r.TEXTURE_MAG_FILTER,
- t.scaleMode === NP.LINEAR ? r.LINEAR : r.NEAREST
- );
- }),
- (t.prototype.destroy = function () {
- this.renderer = null;
- }),
- t
- );
- })(),
- KF = new CD(),
- qF = (function (t) {
- function e(e, r) {
- void 0 === e && (e = PP.UNKNOWN);
- var n = t.call(this) || this;
- return (
- (r = Object.assign({}, vA.RENDER_OPTIONS, r)),
- (n.options = r),
- (n.type = e),
- (n.screen = new TD(0, 0, r.width, r.height)),
- (n.view = r.view || vA.ADAPTER.createCanvas()),
- (n.resolution = r.resolution || vA.RESOLUTION),
- (n.useContextAlpha = r.useContextAlpha),
- (n.autoDensity = !!r.autoDensity),
- (n.preserveDrawingBuffer = r.preserveDrawingBuffer),
- (n.clearBeforeRender = r.clearBeforeRender),
- (n._backgroundColor = 0),
- (n._backgroundColorRgba = [0, 0, 0, 1]),
- (n._backgroundColorString = '#000000'),
- (n.backgroundColor = r.backgroundColor || n._backgroundColor),
- (n.backgroundAlpha = r.backgroundAlpha),
- void 0 !== r.transparent &&
- (aD(
- '6.0.0',
- 'Option transparent is deprecated, please use backgroundAlpha instead.'
- ),
- (n.useContextAlpha = r.transparent),
- (n.backgroundAlpha = r.transparent ? 0 : 1)),
- (n._lastObjectRendered = null),
- (n.plugins = {}),
- n
- );
- }
- return (
- rL(e, t),
- (e.prototype.initPlugins = function (t) {
- for (var e in t) this.plugins[e] = new t[e](this);
- }),
- Object.defineProperty(e.prototype, 'width', {
- get: function () {
- return this.view.width;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'height', {
- get: function () {
- return this.view.height;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype.resize = function (t, e) {
- (this.view.width = Math.round(t * this.resolution)),
- (this.view.height = Math.round(e * this.resolution));
- var r = this.view.width / this.resolution,
- n = this.view.height / this.resolution;
- (this.screen.width = r),
- (this.screen.height = n),
- this.autoDensity &&
- ((this.view.style.width = r + 'px'),
- (this.view.style.height = n + 'px')),
- this.emit('resize', r, n);
- }),
- (e.prototype.generateTexture = function (t, e, r, n) {
- void 0 === e && (e = {}),
- 'number' == typeof e &&
- (aD(
- '6.1.0',
- 'generateTexture options (scaleMode, resolution, region) are now object options.'
- ),
- (e = { scaleMode: e, resolution: r, region: n }));
- var i = e.region,
- o = (function (t, e) {
- var r = {};
- for (var n in t)
- Object.prototype.hasOwnProperty.call(t, n) &&
- e.indexOf(n) < 0 &&
- (r[n] = t[n]);
- if (
- null != t &&
- 'function' == typeof Object.getOwnPropertySymbols
- ) {
- var i = 0;
- for (n = Object.getOwnPropertySymbols(t); i < n.length; i++)
- e.indexOf(n[i]) < 0 &&
- Object.prototype.propertyIsEnumerable.call(t, n[i]) &&
- (r[n[i]] = t[n[i]]);
- }
- return r;
- })(e, ['region']);
- 0 === (n = i || t.getLocalBounds(null, !0)).width && (n.width = 1),
- 0 === n.height && (n.height = 1);
- var s = SL.create(nL({ width: n.width, height: n.height }, o));
- return (
- (KF.tx = -n.x),
- (KF.ty = -n.y),
- this.render(t, {
- renderTexture: s,
- clear: !1,
- transform: KF,
- skipUpdateTransform: !!t.parent,
- }),
- s
- );
- }),
- (e.prototype.destroy = function (t) {
- for (var e in this.plugins)
- this.plugins[e].destroy(), (this.plugins[e] = null);
- t &&
- this.view.parentNode &&
- this.view.parentNode.removeChild(this.view);
- var r = this;
- (r.plugins = null),
- (r.type = PP.UNKNOWN),
- (r.view = null),
- (r.screen = null),
- (r._tempDisplayObjectParent = null),
- (r.options = null),
- (this._backgroundColorRgba = null),
- (this._backgroundColorString = null),
- (this._lastObjectRendered = null);
- }),
- Object.defineProperty(e.prototype, 'backgroundColor', {
- get: function () {
- return this._backgroundColor;
- },
- set: function (t) {
- (this._backgroundColor = t),
- (this._backgroundColorString = WM(t)),
- HM(t, this._backgroundColorRgba);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'backgroundAlpha', {
- get: function () {
- return this._backgroundColorRgba[3];
- },
- set: function (t) {
- this._backgroundColorRgba[3] = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- e
- );
- })(yA),
- QF = function (t) {
- (this.buffer = t || null),
- (this.updateID = -1),
- (this.byteLength = -1),
- (this.refCount = 0);
- },
- $F = (function () {
- function t(t) {
- (this.renderer = t),
- (this.managedBuffers = {}),
- (this.boundBufferBases = {});
- }
- return (
- (t.prototype.destroy = function () {
- this.renderer = null;
- }),
- (t.prototype.contextChange = function () {
- this.disposeAll(!0),
- (this.gl = this.renderer.gl),
- (this.CONTEXT_UID = this.renderer.CONTEXT_UID);
- }),
- (t.prototype.bind = function (t) {
- var e = this.gl,
- r = this.CONTEXT_UID,
- n = t._glBuffers[r] || this.createGLBuffer(t);
- e.bindBuffer(t.type, n.buffer);
- }),
- (t.prototype.bindBufferBase = function (t, e) {
- var r = this.gl,
- n = this.CONTEXT_UID;
- if (this.boundBufferBases[e] !== t) {
- var i = t._glBuffers[n] || this.createGLBuffer(t);
- (this.boundBufferBases[e] = t),
- r.bindBufferBase(r.UNIFORM_BUFFER, e, i.buffer);
- }
- }),
- (t.prototype.bindBufferRange = function (t, e, r) {
- var n = this.gl,
- i = this.CONTEXT_UID;
- r = r || 0;
- var o = t._glBuffers[i] || this.createGLBuffer(t);
- n.bindBufferRange(n.UNIFORM_BUFFER, e || 0, o.buffer, 256 * r, 256);
- }),
- (t.prototype.update = function (t) {
- var e = this.gl,
- r = this.CONTEXT_UID,
- n = t._glBuffers[r];
- if (t._updateID !== n.updateID)
- if (
- ((n.updateID = t._updateID),
- e.bindBuffer(t.type, n.buffer),
- n.byteLength >= t.data.byteLength)
- )
- e.bufferSubData(t.type, 0, t.data);
- else {
- var i = t.static ? e.STATIC_DRAW : e.DYNAMIC_DRAW;
- (n.byteLength = t.data.byteLength),
- e.bufferData(t.type, t.data, i);
- }
- }),
- (t.prototype.dispose = function (t, e) {
- if (this.managedBuffers[t.id]) {
- delete this.managedBuffers[t.id];
- var r = t._glBuffers[this.CONTEXT_UID],
- n = this.gl;
- t.disposeRunner.remove(this),
- r &&
- (e || n.deleteBuffer(r.buffer),
- delete t._glBuffers[this.CONTEXT_UID]);
- }
- }),
- (t.prototype.disposeAll = function (t) {
- for (
- var e = Object.keys(this.managedBuffers), r = 0;
- r < e.length;
- r++
- )
- this.dispose(this.managedBuffers[e[r]], t);
- }),
- (t.prototype.createGLBuffer = function (t) {
- var e = this.CONTEXT_UID,
- r = this.gl;
- return (
- (t._glBuffers[e] = new QF(r.createBuffer())),
- (this.managedBuffers[t.id] = t),
- t.disposeRunner.add(this),
- t._glBuffers[e]
- );
- }),
- t
- );
- })(),
- tN = (function (t) {
- function e(r) {
- var n = t.call(this, PP.WEBGL, r) || this;
- return (
- (r = n.options),
- (n.gl = null),
- (n.CONTEXT_UID = 0),
- (n.runners = {
- destroy: new JD('destroy'),
- contextChange: new JD('contextChange'),
- reset: new JD('reset'),
- update: new JD('update'),
- postrender: new JD('postrender'),
- prerender: new JD('prerender'),
- resize: new JD('resize'),
- }),
- n.runners.contextChange.add(n),
- (n.globalUniforms = new kL({ projectionMatrix: new CD() }, !0)),
- n
- .addSystem(CF, 'mask')
- .addSystem(WL, 'context')
- .addSystem(YF, 'state')
- .addSystem(WF, 'shader')
- .addSystem(JF, 'texture')
- .addSystem($F, 'buffer')
- .addSystem(KL, 'geometry')
- .addSystem(ZL, 'framebuffer')
- .addSystem(IF, 'scissor')
- .addSystem(MF, 'stencil')
- .addSystem(DF, 'projection')
- .addSystem(zF, 'textureGC')
- .addSystem(jL, 'filter')
- .addSystem(NF, 'renderTexture')
- .addSystem(VL, 'batch'),
- n.initPlugins(e.__plugins),
- (n.multisample = void 0),
- r.context
- ? n.context.initFromContext(r.context)
- : n.context.initFromOptions({
- alpha: !!n.useContextAlpha,
- antialias: r.antialias,
- premultipliedAlpha:
- n.useContextAlpha && 'notMultiplied' !== n.useContextAlpha,
- stencil: !0,
- preserveDrawingBuffer: r.preserveDrawingBuffer,
- powerPreference: n.options.powerPreference,
- }),
- (n.renderingToScreen = !0),
- XM(2 === n.context.webGLVersion ? 'WebGL 2' : 'WebGL 1'),
- n.resize(n.options.width, n.options.height),
- n
- );
- }
- return (
- rL(e, t),
- (e.create = function (t) {
- if (
- (void 0 === UM &&
- (UM = (function () {
- var t = {
- stencil: !0,
- failIfMajorPerformanceCaveat:
- vA.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT,
- };
- try {
- if (!vA.ADAPTER.getWebGLRenderingContext()) return !1;
- var e = vA.ADAPTER.createCanvas(),
- r =
- e.getContext('webgl', t) ||
- e.getContext('experimental-webgl', t),
- n = !(!r || !r.getContextAttributes().stencil);
- if (r) {
- var i = r.getExtension('WEBGL_lose_context');
- i && i.loseContext();
- }
- return (r = null), n;
- } catch (t) {
- return !1;
- }
- })()),
- UM)
- )
- return new e(t);
- throw new Error(
- 'WebGL unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.'
- );
- }),
- (e.prototype.contextChange = function () {
- var t,
- e = this.gl;
- if (1 === this.context.webGLVersion) {
- var r = e.getParameter(e.FRAMEBUFFER_BINDING);
- e.bindFramebuffer(e.FRAMEBUFFER, null),
- (t = e.getParameter(e.SAMPLES)),
- e.bindFramebuffer(e.FRAMEBUFFER, r);
- } else {
- r = e.getParameter(e.DRAW_FRAMEBUFFER_BINDING);
- e.bindFramebuffer(e.DRAW_FRAMEBUFFER, null),
- (t = e.getParameter(e.SAMPLES)),
- e.bindFramebuffer(e.DRAW_FRAMEBUFFER, r);
- }
- t >= WP.HIGH
- ? (this.multisample = WP.HIGH)
- : t >= WP.MEDIUM
- ? (this.multisample = WP.MEDIUM)
- : t >= WP.LOW
- ? (this.multisample = WP.LOW)
- : (this.multisample = WP.NONE);
- }),
- (e.prototype.addSystem = function (t, e) {
- var r = new t(this);
- if (this[e])
- throw new Error('Whoops! The name "' + e + '" is already in use');
- for (var n in ((this[e] = r), this.runners)) this.runners[n].add(r);
- return this;
- }),
- (e.prototype.render = function (t, e) {
- var r, n, i, o;
- if (
- (e &&
- (e instanceof SL
- ? (aD(
- '6.0.0',
- 'Renderer#render arguments changed, use options instead.'
- ),
- (r = e),
- (n = arguments[2]),
- (i = arguments[3]),
- (o = arguments[4]))
- : ((r = e.renderTexture),
- (n = e.clear),
- (i = e.transform),
- (o = e.skipUpdateTransform))),
- (this.renderingToScreen = !r),
- this.runners.prerender.emit(),
- this.emit('prerender'),
- (this.projection.transform = i),
- !this.context.isLost)
- ) {
- if ((r || (this._lastObjectRendered = t), !o)) {
- var s = t.enableTempParent();
- t.updateTransform(), t.disableTempParent(s);
- }
- this.renderTexture.bind(r),
- this.batch.currentRenderer.start(),
- (void 0 !== n ? n : this.clearBeforeRender) &&
- this.renderTexture.clear(),
- t.render(this),
- this.batch.currentRenderer.flush(),
- r && r.baseTexture.update(),
- this.runners.postrender.emit(),
- (this.projection.transform = null),
- this.emit('postrender');
- }
- }),
- (e.prototype.generateTexture = function (e, r, n, i) {
- void 0 === r && (r = {});
- var o = t.prototype.generateTexture.call(this, e, r, n, i);
- return this.framebuffer.blit(), o;
- }),
- (e.prototype.resize = function (e, r) {
- t.prototype.resize.call(this, e, r),
- this.runners.resize.emit(this.screen.height, this.screen.width);
- }),
- (e.prototype.reset = function () {
- return this.runners.reset.emit(), this;
- }),
- (e.prototype.clear = function () {
- this.renderTexture.bind(), this.renderTexture.clear();
- }),
- (e.prototype.destroy = function (e) {
- for (var r in (this.runners.destroy.emit(), this.runners))
- this.runners[r].destroy();
- t.prototype.destroy.call(this, e), (this.gl = null);
- }),
- Object.defineProperty(e.prototype, 'extract', {
- get: function () {
- return (
- aD(
- '6.0.0',
- 'Renderer#extract has been deprecated, please use Renderer#plugins.extract instead.'
- ),
- this.plugins.extract
- );
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.registerPlugin = function (t, e) {
- aD(
- '6.5.0',
- 'Renderer.registerPlugin() has been deprecated, please use extensions.add() instead.'
- ),
- ZD.add({ name: t, type: HD.RendererPlugin, ref: e });
- }),
- (e.__plugins = {}),
- e
- );
- })(qF);
- function eN(t) {
- return tN.create(t);
- }
- ZD.handleByMap(HD.RendererPlugin, tN.__plugins);
- var rN =
- 'attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n gl_Position = filterVertexPosition();\n vTextureCoord = filterTextureCoord();\n}\n',
- nN = function () {
- (this.texArray = null),
- (this.blend = 0),
- (this.type = IP.TRIANGLES),
- (this.start = 0),
- (this.size = 0),
- (this.data = null);
- },
- iN = (function () {
- function t() {
- (this.elements = []), (this.ids = []), (this.count = 0);
- }
- return (
- (t.prototype.clear = function () {
- for (var t = 0; t < this.count; t++) this.elements[t] = null;
- this.count = 0;
- }),
- t
- );
- })(),
- oN = (function () {
- function t(t) {
- 'number' == typeof t
- ? (this.rawBinaryData = new ArrayBuffer(t))
- : t instanceof Uint8Array
- ? (this.rawBinaryData = t.buffer)
- : (this.rawBinaryData = t),
- (this.uint32View = new Uint32Array(this.rawBinaryData)),
- (this.float32View = new Float32Array(this.rawBinaryData));
- }
- return (
- Object.defineProperty(t.prototype, 'int8View', {
- get: function () {
- return (
- this._int8View ||
- (this._int8View = new Int8Array(this.rawBinaryData)),
- this._int8View
- );
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'uint8View', {
- get: function () {
- return (
- this._uint8View ||
- (this._uint8View = new Uint8Array(this.rawBinaryData)),
- this._uint8View
- );
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'int16View', {
- get: function () {
- return (
- this._int16View ||
- (this._int16View = new Int16Array(this.rawBinaryData)),
- this._int16View
- );
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'uint16View', {
- get: function () {
- return (
- this._uint16View ||
- (this._uint16View = new Uint16Array(this.rawBinaryData)),
- this._uint16View
- );
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'int32View', {
- get: function () {
- return (
- this._int32View ||
- (this._int32View = new Int32Array(this.rawBinaryData)),
- this._int32View
- );
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype.view = function (t) {
- return this[t + 'View'];
- }),
- (t.prototype.destroy = function () {
- (this.rawBinaryData = null),
- (this._int8View = null),
- (this._uint8View = null),
- (this._int16View = null),
- (this._uint16View = null),
- (this._int32View = null),
- (this.uint32View = null),
- (this.float32View = null);
- }),
- (t.sizeOf = function (t) {
- switch (t) {
- case 'int8':
- case 'uint8':
- return 1;
- case 'int16':
- case 'uint16':
- return 2;
- case 'int32':
- case 'uint32':
- case 'float32':
- return 4;
- default:
- throw new Error(t + " isn't a valid view type");
- }
- }),
- t
- );
- })(),
- sN = (function (t) {
- function e(e) {
- var r = t.call(this, e) || this;
- return (
- (r.shaderGenerator = null),
- (r.geometryClass = null),
- (r.vertexSize = null),
- (r.state = xF.for2d()),
- (r.size = 4 * vA.SPRITE_BATCH_SIZE),
- (r._vertexCount = 0),
- (r._indexCount = 0),
- (r._bufferedElements = []),
- (r._bufferedTextures = []),
- (r._bufferSize = 0),
- (r._shader = null),
- (r._packedGeometries = []),
- (r._packedGeometryPoolSize = 2),
- (r._flushId = 0),
- (r._aBuffers = {}),
- (r._iBuffers = {}),
- (r.MAX_TEXTURES = 1),
- r.renderer.on('prerender', r.onPrerender, r),
- e.runners.contextChange.add(r),
- (r._dcIndex = 0),
- (r._aIndex = 0),
- (r._iIndex = 0),
- (r._attributeBuffer = null),
- (r._indexBuffer = null),
- (r._tempBoundTextures = []),
- r
- );
- }
- return (
- rL(e, t),
- (e.prototype.contextChange = function () {
- var t = this.renderer.gl;
- vA.PREFER_ENV === CP.WEBGL_LEGACY
- ? (this.MAX_TEXTURES = 1)
- : ((this.MAX_TEXTURES = Math.min(
- t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),
- vA.SPRITE_MAX_TEXTURES
- )),
- (this.MAX_TEXTURES = (function (t, e) {
- if (0 === t)
- throw new Error(
- 'Invalid value of `0` passed to `checkMaxIfStatementsInShader`'
- );
- for (var r = e.createShader(e.FRAGMENT_SHADER); ; ) {
- var n = mF.replace(/%forloop%/gi, yF(t));
- if (
- (e.shaderSource(r, n),
- e.compileShader(r),
- e.getShaderParameter(r, e.COMPILE_STATUS))
- )
- break;
- t = (t / 2) | 0;
- }
- return t;
- })(this.MAX_TEXTURES, t))),
- (this._shader = this.shaderGenerator.generateShader(
- this.MAX_TEXTURES
- ));
- for (var e = 0; e < this._packedGeometryPoolSize; e++)
- this._packedGeometries[e] = new this.geometryClass();
- this.initFlushBuffers();
- }),
- (e.prototype.initFlushBuffers = function () {
- for (
- var t = e._drawCallPool,
- r = e._textureArrayPool,
- n = this.size / 4,
- i = Math.floor(n / this.MAX_TEXTURES) + 1;
- t.length < n;
- )
- t.push(new nN());
- for (; r.length < i; ) r.push(new iN());
- for (var o = 0; o < this.MAX_TEXTURES; o++)
- this._tempBoundTextures[o] = null;
- }),
- (e.prototype.onPrerender = function () {
- this._flushId = 0;
- }),
- (e.prototype.render = function (t) {
- t._texture.valid &&
- (this._vertexCount + t.vertexData.length / 2 > this.size &&
- this.flush(),
- (this._vertexCount += t.vertexData.length / 2),
- (this._indexCount += t.indices.length),
- (this._bufferedTextures[this._bufferSize] = t._texture.baseTexture),
- (this._bufferedElements[this._bufferSize++] = t));
- }),
- (e.prototype.buildTexturesAndDrawCalls = function () {
- var t = this._bufferedTextures,
- r = this.MAX_TEXTURES,
- n = e._textureArrayPool,
- i = this.renderer.batch,
- o = this._tempBoundTextures,
- s = this.renderer.textureGC.count,
- a = ++aL._globalBatch,
- u = 0,
- c = n[0],
- h = 0;
- i.copyBoundTextures(o, r);
- for (var l = 0; l < this._bufferSize; ++l) {
- var d = t[l];
- (t[l] = null),
- d._batchEnabled !== a &&
- (c.count >= r &&
- (i.boundArray(c, o, a, r),
- this.buildDrawCalls(c, h, l),
- (h = l),
- (c = n[++u]),
- ++a),
- (d._batchEnabled = a),
- (d.touched = s),
- (c.elements[c.count++] = d));
- }
- c.count > 0 &&
- (i.boundArray(c, o, a, r),
- this.buildDrawCalls(c, h, this._bufferSize),
- ++u,
- ++a);
- for (l = 0; l < o.length; l++) o[l] = null;
- aL._globalBatch = a;
- }),
- (e.prototype.buildDrawCalls = function (t, r, n) {
- var i = this,
- o = i._bufferedElements,
- s = i._attributeBuffer,
- a = i._indexBuffer,
- u = i.vertexSize,
- c = e._drawCallPool,
- h = this._dcIndex,
- l = this._aIndex,
- d = this._iIndex,
- f = c[h];
- (f.start = this._iIndex), (f.texArray = t);
- for (var p = r; p < n; ++p) {
- var v = o[p],
- m = v._texture.baseTexture,
- y = ZM[m.alphaMode ? 1 : 0][v.blendMode];
- (o[p] = null),
- r < p &&
- f.blend !== y &&
- ((f.size = d - f.start),
- (r = p),
- ((f = c[++h]).texArray = t),
- (f.start = d)),
- this.packInterleavedGeometry(v, s, a, l, d),
- (l += (v.vertexData.length / 2) * u),
- (d += v.indices.length),
- (f.blend = y);
- }
- r < n && ((f.size = d - f.start), ++h),
- (this._dcIndex = h),
- (this._aIndex = l),
- (this._iIndex = d);
- }),
- (e.prototype.bindAndClearTexArray = function (t) {
- for (var e = this.renderer.texture, r = 0; r < t.count; r++)
- e.bind(t.elements[r], t.ids[r]), (t.elements[r] = null);
- t.count = 0;
- }),
- (e.prototype.updateGeometry = function () {
- var t = this,
- e = t._packedGeometries,
- r = t._attributeBuffer,
- n = t._indexBuffer;
- vA.CAN_UPLOAD_SAME_BUFFER
- ? (e[this._flushId]._buffer.update(r.rawBinaryData),
- e[this._flushId]._indexBuffer.update(n),
- this.renderer.geometry.updateBuffers())
- : (this._packedGeometryPoolSize <= this._flushId &&
- (this._packedGeometryPoolSize++,
- (e[this._flushId] = new this.geometryClass())),
- e[this._flushId]._buffer.update(r.rawBinaryData),
- e[this._flushId]._indexBuffer.update(n),
- this.renderer.geometry.bind(e[this._flushId]),
- this.renderer.geometry.updateBuffers(),
- this._flushId++);
- }),
- (e.prototype.drawBatches = function () {
- for (
- var t = this._dcIndex,
- r = this.renderer,
- n = r.gl,
- i = r.state,
- o = e._drawCallPool,
- s = null,
- a = 0;
- a < t;
- a++
- ) {
- var u = o[a],
- c = u.texArray,
- h = u.type,
- l = u.size,
- d = u.start,
- f = u.blend;
- s !== c && ((s = c), this.bindAndClearTexArray(c)),
- (this.state.blendMode = f),
- i.set(this.state),
- n.drawElements(h, l, n.UNSIGNED_SHORT, 2 * d);
- }
- }),
- (e.prototype.flush = function () {
- 0 !== this._vertexCount &&
- ((this._attributeBuffer = this.getAttributeBuffer(
- this._vertexCount
- )),
- (this._indexBuffer = this.getIndexBuffer(this._indexCount)),
- (this._aIndex = 0),
- (this._iIndex = 0),
- (this._dcIndex = 0),
- this.buildTexturesAndDrawCalls(),
- this.updateGeometry(),
- this.drawBatches(),
- (this._bufferSize = 0),
- (this._vertexCount = 0),
- (this._indexCount = 0));
- }),
- (e.prototype.start = function () {
- this.renderer.state.set(this.state),
- this.renderer.texture.ensureSamplerType(this.MAX_TEXTURES),
- this.renderer.shader.bind(this._shader),
- vA.CAN_UPLOAD_SAME_BUFFER &&
- this.renderer.geometry.bind(
- this._packedGeometries[this._flushId]
- );
- }),
- (e.prototype.stop = function () {
- this.flush();
- }),
- (e.prototype.destroy = function () {
- for (var e = 0; e < this._packedGeometryPoolSize; e++)
- this._packedGeometries[e] && this._packedGeometries[e].destroy();
- this.renderer.off('prerender', this.onPrerender, this),
- (this._aBuffers = null),
- (this._iBuffers = null),
- (this._packedGeometries = null),
- (this._attributeBuffer = null),
- (this._indexBuffer = null),
- this._shader && (this._shader.destroy(), (this._shader = null)),
- t.prototype.destroy.call(this);
- }),
- (e.prototype.getAttributeBuffer = function (t) {
- var e = $M(Math.ceil(t / 8)),
- r = eD(e),
- n = 8 * e;
- this._aBuffers.length <= r && (this._iBuffers.length = r + 1);
- var i = this._aBuffers[n];
- return (
- i || (this._aBuffers[n] = i = new oN(n * this.vertexSize * 4)), i
- );
- }),
- (e.prototype.getIndexBuffer = function (t) {
- var e = $M(Math.ceil(t / 12)),
- r = eD(e),
- n = 12 * e;
- this._iBuffers.length <= r && (this._iBuffers.length = r + 1);
- var i = this._iBuffers[r];
- return i || (this._iBuffers[r] = i = new Uint16Array(n)), i;
- }),
- (e.prototype.packInterleavedGeometry = function (t, e, r, n, i) {
- for (
- var o = e.uint32View,
- s = e.float32View,
- a = n / this.vertexSize,
- u = t.uvs,
- c = t.indices,
- h = t.vertexData,
- l = t._texture.baseTexture._batchLocation,
- d = Math.min(t.worldAlpha, 1),
- f =
- d < 1 && t._texture.baseTexture.alphaMode
- ? KM(t._tintRGB, d)
- : t._tintRGB + ((255 * d) << 24),
- p = 0;
- p < h.length;
- p += 2
- )
- (s[n++] = h[p]),
- (s[n++] = h[p + 1]),
- (s[n++] = u[p]),
- (s[n++] = u[p + 1]),
- (o[n++] = f),
- (s[n++] = l);
- for (p = 0; p < c.length; p++) r[i++] = a + c[p];
- }),
- (e._drawCallPool = []),
- (e._textureArrayPool = []),
- e
- );
- })(XL),
- aN = (function () {
- function t(t, e) {
- if (
- ((this.vertexSrc = t),
- (this.fragTemplate = e),
- (this.programCache = {}),
- (this.defaultGroupCache = {}),
- e.indexOf('%count%') < 0)
- )
- throw new Error('Fragment template must contain "%count%".');
- if (e.indexOf('%forloop%') < 0)
- throw new Error('Fragment template must contain "%forloop%".');
- }
- return (
- (t.prototype.generateShader = function (t) {
- if (!this.programCache[t]) {
- for (var e = new Int32Array(t), r = 0; r < t; r++) e[r] = r;
- this.defaultGroupCache[t] = kL.from({ uSamplers: e }, !0);
- var n = this.fragTemplate;
- (n = (n = n.replace(/%count%/gi, '' + t)).replace(
- /%forloop%/gi,
- this.generateSampleSrc(t)
- )),
- (this.programCache[t] = new bF(this.vertexSrc, n));
- }
- var i = {
- tint: new Float32Array([1, 1, 1, 1]),
- translationMatrix: new CD(),
- default: this.defaultGroupCache[t],
- };
- return new TF(this.programCache[t], i);
- }),
- (t.prototype.generateSampleSrc = function (t) {
- var e = '';
- (e += '\n'), (e += '\n');
- for (var r = 0; r < t; r++)
- r > 0 && (e += '\nelse '),
- r < t - 1 && (e += 'if(vTextureId < ' + r + '.5)'),
- (e += '\n{'),
- (e +=
- '\n\tcolor = texture2D(uSamplers[' + r + '], vTextureCoord);'),
- (e += '\n}');
- return (e += '\n'), (e += '\n');
- }),
- t
- );
- })(),
- uN = (function (t) {
- function e(e) {
- void 0 === e && (e = !1);
- var r = t.call(this) || this;
- return (
- (r._buffer = new PL(null, e, !1)),
- (r._indexBuffer = new PL(null, e, !0)),
- r
- .addAttribute('aVertexPosition', r._buffer, 2, !1, LP.FLOAT)
- .addAttribute('aTextureCoord', r._buffer, 2, !1, LP.FLOAT)
- .addAttribute('aColor', r._buffer, 4, !0, LP.UNSIGNED_BYTE)
- .addAttribute('aTextureId', r._buffer, 1, !0, LP.FLOAT)
- .addIndex(r._indexBuffer),
- r
- );
- }
- return rL(e, t), e;
- })(DL),
- cN =
- 'precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform vec4 tint;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor * tint;\n}\n',
- hN =
- 'varying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\nuniform sampler2D uSamplers[%count%];\n\nvoid main(void){\n vec4 color;\n %forloop%\n gl_FragColor = color * vColor;\n}\n',
- lN = (function () {
- function t() {}
- return (
- (t.create = function (t) {
- var e = Object.assign(
- { vertex: cN, fragment: hN, geometryClass: uN, vertexSize: 6 },
- t
- ),
- r = e.vertex,
- n = e.fragment,
- i = e.vertexSize,
- o = e.geometryClass;
- return (function (t) {
- function e(e) {
- var s = t.call(this, e) || this;
- return (
- (s.shaderGenerator = new aN(r, n)),
- (s.geometryClass = o),
- (s.vertexSize = i),
- s
- );
- }
- return rL(e, t), e;
- })(sN);
- }),
- Object.defineProperty(t, 'defaultVertexSrc', {
- get: function () {
- return cN;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t, 'defaultFragmentTemplate', {
- get: function () {
- return hN;
- },
- enumerable: !1,
- configurable: !0,
- }),
- t
- );
- })(),
- dN = lN.create();
- Object.assign(dN, { extension: { name: 'batch', type: HD.RendererPlugin } });
- UD.mixin({
- accessible: !1,
- accessibleTitle: null,
- accessibleHint: null,
- tabIndex: 0,
- _accessibleActive: !1,
- _accessibleDiv: null,
- accessibleType: 'button',
- accessiblePointerEvents: 'auto',
- accessibleChildren: !0,
- renderId: -1,
- });
- var fN = (function () {
- function t(t) {
- (this.debug = !1),
- (this._isActive = !1),
- (this._isMobileAccessibility = !1),
- (this.pool = []),
- (this.renderId = 0),
- (this.children = []),
- (this.androidUpdateCount = 0),
- (this.androidUpdateFrequency = 500),
- (this._hookDiv = null),
- (pA.tablet || pA.phone) && this.createTouchHook();
- var e = document.createElement('div');
- (e.style.width = '100px'),
- (e.style.height = '100px'),
- (e.style.position = 'absolute'),
- (e.style.top = '0px'),
- (e.style.left = '0px'),
- (e.style.zIndex = (2).toString()),
- (this.div = e),
- (this.renderer = t),
- (this._onKeyDown = this._onKeyDown.bind(this)),
- (this._onMouseMove = this._onMouseMove.bind(this)),
- globalThis.addEventListener('keydown', this._onKeyDown, !1);
- }
- return (
- Object.defineProperty(t.prototype, 'isActive', {
- get: function () {
- return this._isActive;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'isMobileAccessibility', {
- get: function () {
- return this._isMobileAccessibility;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype.createTouchHook = function () {
- var t = this,
- e = document.createElement('button');
- (e.style.width = '1px'),
- (e.style.height = '1px'),
- (e.style.position = 'absolute'),
- (e.style.top = '-1000px'),
- (e.style.left = '-1000px'),
- (e.style.zIndex = (2).toString()),
- (e.style.backgroundColor = '#FF0000'),
- (e.title = 'select to enable accessibility for this content'),
- e.addEventListener('focus', function () {
- (t._isMobileAccessibility = !0),
- t.activate(),
- t.destroyTouchHook();
- }),
- document.body.appendChild(e),
- (this._hookDiv = e);
- }),
- (t.prototype.destroyTouchHook = function () {
- this._hookDiv &&
- (document.body.removeChild(this._hookDiv), (this._hookDiv = null));
- }),
- (t.prototype.activate = function () {
- var t;
- this._isActive ||
- ((this._isActive = !0),
- globalThis.document.addEventListener(
- 'mousemove',
- this._onMouseMove,
- !0
- ),
- globalThis.removeEventListener('keydown', this._onKeyDown, !1),
- this.renderer.on('postrender', this.update, this),
- null === (t = this.renderer.view.parentNode) ||
- void 0 === t ||
- t.appendChild(this.div));
- }),
- (t.prototype.deactivate = function () {
- var t;
- this._isActive &&
- !this._isMobileAccessibility &&
- ((this._isActive = !1),
- globalThis.document.removeEventListener(
- 'mousemove',
- this._onMouseMove,
- !0
- ),
- globalThis.addEventListener('keydown', this._onKeyDown, !1),
- this.renderer.off('postrender', this.update),
- null === (t = this.div.parentNode) ||
- void 0 === t ||
- t.removeChild(this.div));
- }),
- (t.prototype.updateAccessibleObjects = function (t) {
- if (t.visible && t.accessibleChildren) {
- t.accessible &&
- t.interactive &&
- (t._accessibleActive || this.addChild(t),
- (t.renderId = this.renderId));
- var e = t.children;
- if (e)
- for (var r = 0; r < e.length; r++)
- this.updateAccessibleObjects(e[r]);
- }
- }),
- (t.prototype.update = function () {
- var t = performance.now();
- if (
- !(pA.android.device && t < this.androidUpdateCount) &&
- ((this.androidUpdateCount = t + this.androidUpdateFrequency),
- this.renderer.renderingToScreen)
- ) {
- this.renderer._lastObjectRendered &&
- this.updateAccessibleObjects(this.renderer._lastObjectRendered);
- var e = this.renderer.view.getBoundingClientRect(),
- r = e.left,
- n = e.top,
- i = e.width,
- o = e.height,
- s = this.renderer,
- a = s.width,
- u = s.height,
- c = s.resolution,
- h = (i / a) * c,
- l = (o / u) * c,
- d = this.div;
- (d.style.left = r + 'px'),
- (d.style.top = n + 'px'),
- (d.style.width = a + 'px'),
- (d.style.height = u + 'px');
- for (var f = 0; f < this.children.length; f++) {
- var p = this.children[f];
- if (p.renderId !== this.renderId)
- (p._accessibleActive = !1),
- rD(this.children, f, 1),
- this.div.removeChild(p._accessibleDiv),
- this.pool.push(p._accessibleDiv),
- (p._accessibleDiv = null),
- f--;
- else {
- d = p._accessibleDiv;
- var v = p.hitArea,
- m = p.worldTransform;
- p.hitArea
- ? ((d.style.left = (m.tx + v.x * m.a) * h + 'px'),
- (d.style.top = (m.ty + v.y * m.d) * l + 'px'),
- (d.style.width = v.width * m.a * h + 'px'),
- (d.style.height = v.height * m.d * l + 'px'))
- : ((v = p.getBounds()),
- this.capHitArea(v),
- (d.style.left = v.x * h + 'px'),
- (d.style.top = v.y * l + 'px'),
- (d.style.width = v.width * h + 'px'),
- (d.style.height = v.height * l + 'px'),
- d.title !== p.accessibleTitle &&
- null !== p.accessibleTitle &&
- (d.title = p.accessibleTitle),
- d.getAttribute('aria-label') !== p.accessibleHint &&
- null !== p.accessibleHint &&
- d.setAttribute('aria-label', p.accessibleHint)),
- (p.accessibleTitle === d.title &&
- p.tabIndex === d.tabIndex) ||
- ((d.title = p.accessibleTitle),
- (d.tabIndex = p.tabIndex),
- this.debug && this.updateDebugHTML(d));
- }
- }
- this.renderId++;
- }
- }),
- (t.prototype.updateDebugHTML = function (t) {
- t.innerHTML =
- 'type: ' +
- t.type +
- '</br> title : ' +
- t.title +
- '</br> tabIndex: ' +
- t.tabIndex;
- }),
- (t.prototype.capHitArea = function (t) {
- t.x < 0 && ((t.width += t.x), (t.x = 0)),
- t.y < 0 && ((t.height += t.y), (t.y = 0));
- var e = this.renderer,
- r = e.width,
- n = e.height;
- t.x + t.width > r && (t.width = r - t.x),
- t.y + t.height > n && (t.height = n - t.y);
- }),
- (t.prototype.addChild = function (t) {
- var e = this.pool.pop();
- e ||
- (((e = document.createElement('button')).style.width = '100px'),
- (e.style.height = '100px'),
- (e.style.backgroundColor = this.debug
- ? 'rgba(255,255,255,0.5)'
- : 'transparent'),
- (e.style.position = 'absolute'),
- (e.style.zIndex = (2).toString()),
- (e.style.borderStyle = 'none'),
- navigator.userAgent.toLowerCase().indexOf('chrome') > -1
- ? e.setAttribute('aria-live', 'off')
- : e.setAttribute('aria-live', 'polite'),
- navigator.userAgent.match(/rv:.*Gecko\//)
- ? e.setAttribute('aria-relevant', 'additions')
- : e.setAttribute('aria-relevant', 'text'),
- e.addEventListener('click', this._onClick.bind(this)),
- e.addEventListener('focus', this._onFocus.bind(this)),
- e.addEventListener('focusout', this._onFocusOut.bind(this))),
- (e.style.pointerEvents = t.accessiblePointerEvents),
- (e.type = t.accessibleType),
- t.accessibleTitle && null !== t.accessibleTitle
- ? (e.title = t.accessibleTitle)
- : (t.accessibleHint && null !== t.accessibleHint) ||
- (e.title = 'displayObject ' + t.tabIndex),
- t.accessibleHint &&
- null !== t.accessibleHint &&
- e.setAttribute('aria-label', t.accessibleHint),
- this.debug && this.updateDebugHTML(e),
- (t._accessibleActive = !0),
- (t._accessibleDiv = e),
- (e.displayObject = t),
- this.children.push(t),
- this.div.appendChild(t._accessibleDiv),
- (t._accessibleDiv.tabIndex = t.tabIndex);
- }),
- (t.prototype._onClick = function (t) {
- var e = this.renderer.plugins.interaction,
- r = t.target.displayObject,
- n = e.eventData;
- e.dispatchEvent(r, 'click', n),
- e.dispatchEvent(r, 'pointertap', n),
- e.dispatchEvent(r, 'tap', n);
- }),
- (t.prototype._onFocus = function (t) {
- t.target.getAttribute('aria-live') ||
- t.target.setAttribute('aria-live', 'assertive');
- var e = this.renderer.plugins.interaction,
- r = t.target.displayObject,
- n = e.eventData;
- e.dispatchEvent(r, 'mouseover', n);
- }),
- (t.prototype._onFocusOut = function (t) {
- t.target.getAttribute('aria-live') ||
- t.target.setAttribute('aria-live', 'polite');
- var e = this.renderer.plugins.interaction,
- r = t.target.displayObject,
- n = e.eventData;
- e.dispatchEvent(r, 'mouseout', n);
- }),
- (t.prototype._onKeyDown = function (t) {
- 9 === t.keyCode && this.activate();
- }),
- (t.prototype._onMouseMove = function (t) {
- (0 === t.movementX && 0 === t.movementY) || this.deactivate();
- }),
- (t.prototype.destroy = function () {
- this.destroyTouchHook(),
- (this.div = null),
- globalThis.document.removeEventListener(
- 'mousemove',
- this._onMouseMove,
- !0
- ),
- globalThis.removeEventListener('keydown', this._onKeyDown),
- (this.pool = null),
- (this.children = null),
- (this.renderer = null);
- }),
- (t.extension = {
- name: 'accessibility',
- type: [HD.RendererPlugin, HD.CanvasRendererPlugin],
- }),
- t
- );
- })(),
- pN = (function () {
- function t() {
- (this.pressure = 0),
- (this.rotationAngle = 0),
- (this.twist = 0),
- (this.tangentialPressure = 0),
- (this.global = new _D()),
- (this.target = null),
- (this.originalEvent = null),
- (this.identifier = null),
- (this.isPrimary = !1),
- (this.button = 0),
- (this.buttons = 0),
- (this.width = 0),
- (this.height = 0),
- (this.tiltX = 0),
- (this.tiltY = 0),
- (this.pointerType = null),
- (this.pressure = 0),
- (this.rotationAngle = 0),
- (this.twist = 0),
- (this.tangentialPressure = 0);
- }
- return (
- Object.defineProperty(t.prototype, 'pointerId', {
- get: function () {
- return this.identifier;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype.getLocalPosition = function (t, e, r) {
- return t.worldTransform.applyInverse(r || this.global, e);
- }),
- (t.prototype.copyEvent = function (t) {
- 'isPrimary' in t && t.isPrimary && (this.isPrimary = !0),
- (this.button = 'button' in t && t.button);
- var e = 'buttons' in t && t.buttons;
- (this.buttons = Number.isInteger(e) ? e : 'which' in t && t.which),
- (this.width = 'width' in t && t.width),
- (this.height = 'height' in t && t.height),
- (this.tiltX = 'tiltX' in t && t.tiltX),
- (this.tiltY = 'tiltY' in t && t.tiltY),
- (this.pointerType = 'pointerType' in t && t.pointerType),
- (this.pressure = 'pressure' in t && t.pressure),
- (this.rotationAngle = 'rotationAngle' in t && t.rotationAngle),
- (this.twist = ('twist' in t && t.twist) || 0),
- (this.tangentialPressure =
- ('tangentialPressure' in t && t.tangentialPressure) || 0);
- }),
- (t.prototype.reset = function () {
- this.isPrimary = !1;
- }),
- t
- );
- })(),
- vN = function (t, e) {
- return (
- (vN =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- vN(t, e)
- );
- };
- var mN = (function () {
- function t() {
- (this.stopped = !1),
- (this.stopsPropagatingAt = null),
- (this.stopPropagationHint = !1),
- (this.target = null),
- (this.currentTarget = null),
- (this.type = null),
- (this.data = null);
- }
- return (
- (t.prototype.stopPropagation = function () {
- (this.stopped = !0),
- (this.stopPropagationHint = !0),
- (this.stopsPropagatingAt = this.currentTarget);
- }),
- (t.prototype.reset = function () {
- (this.stopped = !1),
- (this.stopsPropagatingAt = null),
- (this.stopPropagationHint = !1),
- (this.currentTarget = null),
- (this.target = null);
- }),
- t
- );
- })(),
- yN = (function () {
- function t(e) {
- (this._pointerId = e), (this._flags = t.FLAGS.NONE);
- }
- return (
- (t.prototype._doSet = function (t, e) {
- this._flags = e ? this._flags | t : this._flags & ~t;
- }),
- Object.defineProperty(t.prototype, 'pointerId', {
- get: function () {
- return this._pointerId;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'flags', {
- get: function () {
- return this._flags;
- },
- set: function (t) {
- this._flags = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'none', {
- get: function () {
- return this._flags === t.FLAGS.NONE;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'over', {
- get: function () {
- return 0 != (this._flags & t.FLAGS.OVER);
- },
- set: function (e) {
- this._doSet(t.FLAGS.OVER, e);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'rightDown', {
- get: function () {
- return 0 != (this._flags & t.FLAGS.RIGHT_DOWN);
- },
- set: function (e) {
- this._doSet(t.FLAGS.RIGHT_DOWN, e);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'leftDown', {
- get: function () {
- return 0 != (this._flags & t.FLAGS.LEFT_DOWN);
- },
- set: function (e) {
- this._doSet(t.FLAGS.LEFT_DOWN, e);
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.FLAGS = Object.freeze({
- NONE: 0,
- OVER: 1,
- LEFT_DOWN: 2,
- RIGHT_DOWN: 4,
- })),
- t
- );
- })(),
- gN = (function () {
- function t() {
- this._tempPoint = new _D();
- }
- return (
- (t.prototype.recursiveFindHit = function (t, e, r, n, i) {
- var o;
- if (!e || !e.visible) return !1;
- var s = t.data.global,
- a = !1,
- u = (i = e.interactive || i),
- c = !0;
- if (e.hitArea)
- n &&
- (e.worldTransform.applyInverse(s, this._tempPoint),
- e.hitArea.contains(this._tempPoint.x, this._tempPoint.y)
- ? (a = !0)
- : ((n = !1), (c = !1))),
- (u = !1);
- else if (e._mask && n) {
- var h = e._mask.isMaskData ? e._mask.maskObject : e._mask;
- h &&
- !(null === (o = h.containsPoint) || void 0 === o
- ? void 0
- : o.call(h, s)) &&
- (n = !1);
- }
- if (c && e.interactiveChildren && e.children)
- for (var l = e.children, d = l.length - 1; d >= 0; d--) {
- var f = l[d],
- p = this.recursiveFindHit(t, f, r, n, u);
- if (p) {
- if (!f.parent) continue;
- (u = !1), p && (t.target && (n = !1), (a = !0));
- }
- }
- return (
- i &&
- (n &&
- !t.target &&
- !e.hitArea &&
- e.containsPoint &&
- e.containsPoint(s) &&
- (a = !0),
- e.interactive &&
- (a && !t.target && (t.target = e), r && r(t, e, !!a))),
- a
- );
- }),
- (t.prototype.findHit = function (t, e, r, n) {
- this.recursiveFindHit(t, e, r, n, !1);
- }),
- t
- );
- })(),
- _N = {
- interactive: !1,
- interactiveChildren: !0,
- hitArea: null,
- get buttonMode() {
- return 'pointer' === this.cursor;
- },
- set buttonMode(t) {
- t
- ? (this.cursor = 'pointer')
- : 'pointer' === this.cursor && (this.cursor = null);
- },
- cursor: null,
- get trackedPointers() {
- return (
- void 0 === this._trackedPointers && (this._trackedPointers = {}),
- this._trackedPointers
- );
- },
- _trackedPointers: void 0,
- };
- UD.mixin(_N);
- var bN = { target: null, data: { global: null } },
- TN = (function (t) {
- function e(e, r) {
- var n = t.call(this) || this;
- return (
- (r = r || {}),
- (n.renderer = e),
- (n.autoPreventDefault =
- void 0 === r.autoPreventDefault || r.autoPreventDefault),
- (n.interactionFrequency = r.interactionFrequency || 10),
- (n.mouse = new pN()),
- (n.mouse.identifier = 1),
- n.mouse.global.set(-999999),
- (n.activeInteractionData = {}),
- (n.activeInteractionData[1] = n.mouse),
- (n.interactionDataPool = []),
- (n.eventData = new mN()),
- (n.interactionDOMElement = null),
- (n.moveWhenInside = !1),
- (n.eventsAdded = !1),
- (n.tickerAdded = !1),
- (n.mouseOverRenderer = !('PointerEvent' in globalThis)),
- (n.supportsTouchEvents = 'ontouchstart' in globalThis),
- (n.supportsPointerEvents = !!globalThis.PointerEvent),
- (n.onPointerUp = n.onPointerUp.bind(n)),
- (n.processPointerUp = n.processPointerUp.bind(n)),
- (n.onPointerCancel = n.onPointerCancel.bind(n)),
- (n.processPointerCancel = n.processPointerCancel.bind(n)),
- (n.onPointerDown = n.onPointerDown.bind(n)),
- (n.processPointerDown = n.processPointerDown.bind(n)),
- (n.onPointerMove = n.onPointerMove.bind(n)),
- (n.processPointerMove = n.processPointerMove.bind(n)),
- (n.onPointerOut = n.onPointerOut.bind(n)),
- (n.processPointerOverOut = n.processPointerOverOut.bind(n)),
- (n.onPointerOver = n.onPointerOver.bind(n)),
- (n.cursorStyles = { default: 'inherit', pointer: 'pointer' }),
- (n.currentCursorMode = null),
- (n.cursor = null),
- (n.resolution = 1),
- (n.delayedEvents = []),
- (n.search = new gN()),
- (n._tempDisplayObject = new jD()),
- (n._eventListenerOptions = { capture: !0, passive: !1 }),
- (n._useSystemTicker =
- void 0 === r.useSystemTicker || r.useSystemTicker),
- n.setTargetElement(n.renderer.view, n.renderer.resolution),
- n
- );
- }
- return (
- (function (t, e) {
- function r() {
- this.constructor = t;
- }
- vN(t, e),
- (t.prototype =
- null === e
- ? Object.create(e)
- : ((r.prototype = e.prototype), new r()));
- })(e, t),
- Object.defineProperty(e.prototype, 'useSystemTicker', {
- get: function () {
- return this._useSystemTicker;
- },
- set: function (t) {
- (this._useSystemTicker = t),
- t ? this.addTickerListener() : this.removeTickerListener();
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'lastObjectRendered', {
- get: function () {
- return this.renderer._lastObjectRendered || this._tempDisplayObject;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype.hitTest = function (t, e) {
- return (
- (bN.target = null),
- (bN.data.global = t),
- e || (e = this.lastObjectRendered),
- this.processInteractive(bN, e, null, !0),
- bN.target
- );
- }),
- (e.prototype.setTargetElement = function (t, e) {
- void 0 === e && (e = 1),
- this.removeTickerListener(),
- this.removeEvents(),
- (this.interactionDOMElement = t),
- (this.resolution = e),
- this.addEvents(),
- this.addTickerListener();
- }),
- (e.prototype.addTickerListener = function () {
- !this.tickerAdded &&
- this.interactionDOMElement &&
- this._useSystemTicker &&
- (qD.system.add(this.tickerUpdate, this, YD.INTERACTION),
- (this.tickerAdded = !0));
- }),
- (e.prototype.removeTickerListener = function () {
- this.tickerAdded &&
- (qD.system.remove(this.tickerUpdate, this),
- (this.tickerAdded = !1));
- }),
- (e.prototype.addEvents = function () {
- if (!this.eventsAdded && this.interactionDOMElement) {
- var t = this.interactionDOMElement.style;
- globalThis.navigator.msPointerEnabled
- ? ((t.msContentZooming = 'none'), (t.msTouchAction = 'none'))
- : this.supportsPointerEvents && (t.touchAction = 'none'),
- this.supportsPointerEvents
- ? (globalThis.document.addEventListener(
- 'pointermove',
- this.onPointerMove,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.addEventListener(
- 'pointerdown',
- this.onPointerDown,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.addEventListener(
- 'pointerleave',
- this.onPointerOut,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.addEventListener(
- 'pointerover',
- this.onPointerOver,
- this._eventListenerOptions
- ),
- globalThis.addEventListener(
- 'pointercancel',
- this.onPointerCancel,
- this._eventListenerOptions
- ),
- globalThis.addEventListener(
- 'pointerup',
- this.onPointerUp,
- this._eventListenerOptions
- ))
- : (globalThis.document.addEventListener(
- 'mousemove',
- this.onPointerMove,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.addEventListener(
- 'mousedown',
- this.onPointerDown,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.addEventListener(
- 'mouseout',
- this.onPointerOut,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.addEventListener(
- 'mouseover',
- this.onPointerOver,
- this._eventListenerOptions
- ),
- globalThis.addEventListener(
- 'mouseup',
- this.onPointerUp,
- this._eventListenerOptions
- )),
- this.supportsTouchEvents &&
- (this.interactionDOMElement.addEventListener(
- 'touchstart',
- this.onPointerDown,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.addEventListener(
- 'touchcancel',
- this.onPointerCancel,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.addEventListener(
- 'touchend',
- this.onPointerUp,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.addEventListener(
- 'touchmove',
- this.onPointerMove,
- this._eventListenerOptions
- )),
- (this.eventsAdded = !0);
- }
- }),
- (e.prototype.removeEvents = function () {
- if (this.eventsAdded && this.interactionDOMElement) {
- var t = this.interactionDOMElement.style;
- globalThis.navigator.msPointerEnabled
- ? ((t.msContentZooming = ''), (t.msTouchAction = ''))
- : this.supportsPointerEvents && (t.touchAction = ''),
- this.supportsPointerEvents
- ? (globalThis.document.removeEventListener(
- 'pointermove',
- this.onPointerMove,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.removeEventListener(
- 'pointerdown',
- this.onPointerDown,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.removeEventListener(
- 'pointerleave',
- this.onPointerOut,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.removeEventListener(
- 'pointerover',
- this.onPointerOver,
- this._eventListenerOptions
- ),
- globalThis.removeEventListener(
- 'pointercancel',
- this.onPointerCancel,
- this._eventListenerOptions
- ),
- globalThis.removeEventListener(
- 'pointerup',
- this.onPointerUp,
- this._eventListenerOptions
- ))
- : (globalThis.document.removeEventListener(
- 'mousemove',
- this.onPointerMove,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.removeEventListener(
- 'mousedown',
- this.onPointerDown,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.removeEventListener(
- 'mouseout',
- this.onPointerOut,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.removeEventListener(
- 'mouseover',
- this.onPointerOver,
- this._eventListenerOptions
- ),
- globalThis.removeEventListener(
- 'mouseup',
- this.onPointerUp,
- this._eventListenerOptions
- )),
- this.supportsTouchEvents &&
- (this.interactionDOMElement.removeEventListener(
- 'touchstart',
- this.onPointerDown,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.removeEventListener(
- 'touchcancel',
- this.onPointerCancel,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.removeEventListener(
- 'touchend',
- this.onPointerUp,
- this._eventListenerOptions
- ),
- this.interactionDOMElement.removeEventListener(
- 'touchmove',
- this.onPointerMove,
- this._eventListenerOptions
- )),
- (this.interactionDOMElement = null),
- (this.eventsAdded = !1);
- }
- }),
- (e.prototype.tickerUpdate = function (t) {
- (this._deltaTime += t),
- this._deltaTime < this.interactionFrequency ||
- ((this._deltaTime = 0), this.update());
- }),
- (e.prototype.update = function () {
- if (this.interactionDOMElement)
- if (this._didMove) this._didMove = !1;
- else {
- for (var t in ((this.cursor = null), this.activeInteractionData))
- if (this.activeInteractionData.hasOwnProperty(t)) {
- var e = this.activeInteractionData[t];
- if (e.originalEvent && 'touch' !== e.pointerType) {
- var r = this.configureInteractionEventForDOMEvent(
- this.eventData,
- e.originalEvent,
- e
- );
- this.processInteractive(
- r,
- this.lastObjectRendered,
- this.processPointerOverOut,
- !0
- );
- }
- }
- this.setCursorMode(this.cursor);
- }
- }),
- (e.prototype.setCursorMode = function (t) {
- t = t || 'default';
- var e = !0;
- if (
- (globalThis.OffscreenCanvas &&
- this.interactionDOMElement instanceof OffscreenCanvas &&
- (e = !1),
- this.currentCursorMode !== t)
- ) {
- this.currentCursorMode = t;
- var r = this.cursorStyles[t];
- if (r)
- switch (typeof r) {
- case 'string':
- e && (this.interactionDOMElement.style.cursor = r);
- break;
- case 'function':
- r(t);
- break;
- case 'object':
- e && Object.assign(this.interactionDOMElement.style, r);
- }
- else
- e &&
- 'string' == typeof t &&
- !Object.prototype.hasOwnProperty.call(this.cursorStyles, t) &&
- (this.interactionDOMElement.style.cursor = t);
- }
- }),
- (e.prototype.dispatchEvent = function (t, e, r) {
- (r.stopPropagationHint && t !== r.stopsPropagatingAt) ||
- ((r.currentTarget = t),
- (r.type = e),
- t.emit(e, r),
- t[e] && t[e](r));
- }),
- (e.prototype.delayDispatchEvent = function (t, e, r) {
- this.delayedEvents.push({
- displayObject: t,
- eventString: e,
- eventData: r,
- });
- }),
- (e.prototype.mapPositionToPoint = function (t, e, r) {
- var n;
- n = this.interactionDOMElement.parentElement
- ? this.interactionDOMElement.getBoundingClientRect()
- : {
- x: 0,
- y: 0,
- width: this.interactionDOMElement.width,
- height: this.interactionDOMElement.height,
- left: 0,
- top: 0,
- };
- var i = 1 / this.resolution;
- (t.x =
- (e - n.left) * (this.interactionDOMElement.width / n.width) * i),
- (t.y =
- (r - n.top) * (this.interactionDOMElement.height / n.height) * i);
- }),
- (e.prototype.processInteractive = function (t, e, r, n) {
- var i = this.search.findHit(t, e, r, n),
- o = this.delayedEvents;
- if (!o.length) return i;
- t.stopPropagationHint = !1;
- var s = o.length;
- this.delayedEvents = [];
- for (var a = 0; a < s; a++) {
- var u = o[a],
- c = u.displayObject,
- h = u.eventString,
- l = u.eventData;
- l.stopsPropagatingAt === c && (l.stopPropagationHint = !0),
- this.dispatchEvent(c, h, l);
- }
- return i;
- }),
- (e.prototype.onPointerDown = function (t) {
- if (!this.supportsTouchEvents || 'touch' !== t.pointerType) {
- var e = this.normalizeToPointerData(t);
- if (this.autoPreventDefault && e[0].isNormalized)
- (t.cancelable || !('cancelable' in t)) && t.preventDefault();
- for (var r = e.length, n = 0; n < r; n++) {
- var i = e[n],
- o = this.getInteractionDataForPointerId(i),
- s = this.configureInteractionEventForDOMEvent(
- this.eventData,
- i,
- o
- );
- if (
- ((s.data.originalEvent = t),
- this.processInteractive(
- s,
- this.lastObjectRendered,
- this.processPointerDown,
- !0
- ),
- this.emit('pointerdown', s),
- 'touch' === i.pointerType)
- )
- this.emit('touchstart', s);
- else if ('mouse' === i.pointerType || 'pen' === i.pointerType) {
- var a = 2 === i.button;
- this.emit(a ? 'rightdown' : 'mousedown', this.eventData);
- }
- }
- }
- }),
- (e.prototype.processPointerDown = function (t, e, r) {
- var n = t.data,
- i = t.data.identifier;
- if (r)
- if (
- (e.trackedPointers[i] || (e.trackedPointers[i] = new yN(i)),
- this.dispatchEvent(e, 'pointerdown', t),
- 'touch' === n.pointerType)
- )
- this.dispatchEvent(e, 'touchstart', t);
- else if ('mouse' === n.pointerType || 'pen' === n.pointerType) {
- var o = 2 === n.button;
- o
- ? (e.trackedPointers[i].rightDown = !0)
- : (e.trackedPointers[i].leftDown = !0),
- this.dispatchEvent(e, o ? 'rightdown' : 'mousedown', t);
- }
- }),
- (e.prototype.onPointerComplete = function (t, e, r) {
- var n = this.normalizeToPointerData(t),
- i = n.length,
- o = t.target;
- t.composedPath &&
- t.composedPath().length > 0 &&
- (o = t.composedPath()[0]);
- for (
- var s = o !== this.interactionDOMElement ? 'outside' : '', a = 0;
- a < i;
- a++
- ) {
- var u = n[a],
- c = this.getInteractionDataForPointerId(u),
- h = this.configureInteractionEventForDOMEvent(
- this.eventData,
- u,
- c
- );
- if (
- ((h.data.originalEvent = t),
- this.processInteractive(h, this.lastObjectRendered, r, e || !s),
- this.emit(e ? 'pointercancel' : 'pointerup' + s, h),
- 'mouse' === u.pointerType || 'pen' === u.pointerType)
- ) {
- var l = 2 === u.button;
- this.emit(l ? 'rightup' + s : 'mouseup' + s, h);
- } else
- 'touch' === u.pointerType &&
- (this.emit(e ? 'touchcancel' : 'touchend' + s, h),
- this.releaseInteractionDataForPointerId(u.pointerId));
- }
- }),
- (e.prototype.onPointerCancel = function (t) {
- (this.supportsTouchEvents && 'touch' === t.pointerType) ||
- this.onPointerComplete(t, !0, this.processPointerCancel);
- }),
- (e.prototype.processPointerCancel = function (t, e) {
- var r = t.data,
- n = t.data.identifier;
- void 0 !== e.trackedPointers[n] &&
- (delete e.trackedPointers[n],
- this.dispatchEvent(e, 'pointercancel', t),
- 'touch' === r.pointerType &&
- this.dispatchEvent(e, 'touchcancel', t));
- }),
- (e.prototype.onPointerUp = function (t) {
- (this.supportsTouchEvents && 'touch' === t.pointerType) ||
- this.onPointerComplete(t, !1, this.processPointerUp);
- }),
- (e.prototype.processPointerUp = function (t, e, r) {
- var n = t.data,
- i = t.data.identifier,
- o = e.trackedPointers[i],
- s = 'touch' === n.pointerType,
- a = 'mouse' === n.pointerType || 'pen' === n.pointerType,
- u = !1;
- if (a) {
- var c = 2 === n.button,
- h = yN.FLAGS,
- l = c ? h.RIGHT_DOWN : h.LEFT_DOWN,
- d = void 0 !== o && o.flags & l;
- r
- ? (this.dispatchEvent(e, c ? 'rightup' : 'mouseup', t),
- d &&
- (this.dispatchEvent(e, c ? 'rightclick' : 'click', t),
- (u = !0)))
- : d &&
- this.dispatchEvent(
- e,
- c ? 'rightupoutside' : 'mouseupoutside',
- t
- ),
- o && (c ? (o.rightDown = !1) : (o.leftDown = !1));
- }
- r
- ? (this.dispatchEvent(e, 'pointerup', t),
- s && this.dispatchEvent(e, 'touchend', t),
- o &&
- ((a && !u) || this.dispatchEvent(e, 'pointertap', t),
- s && (this.dispatchEvent(e, 'tap', t), (o.over = !1))))
- : o &&
- (this.dispatchEvent(e, 'pointerupoutside', t),
- s && this.dispatchEvent(e, 'touchendoutside', t)),
- o && o.none && delete e.trackedPointers[i];
- }),
- (e.prototype.onPointerMove = function (t) {
- if (!this.supportsTouchEvents || 'touch' !== t.pointerType) {
- var e = this.normalizeToPointerData(t);
- ('mouse' !== e[0].pointerType && 'pen' !== e[0].pointerType) ||
- ((this._didMove = !0), (this.cursor = null));
- for (var r = e.length, n = 0; n < r; n++) {
- var i = e[n],
- o = this.getInteractionDataForPointerId(i),
- s = this.configureInteractionEventForDOMEvent(
- this.eventData,
- i,
- o
- );
- (s.data.originalEvent = t),
- this.processInteractive(
- s,
- this.lastObjectRendered,
- this.processPointerMove,
- !0
- ),
- this.emit('pointermove', s),
- 'touch' === i.pointerType && this.emit('touchmove', s),
- ('mouse' !== i.pointerType && 'pen' !== i.pointerType) ||
- this.emit('mousemove', s);
- }
- 'mouse' === e[0].pointerType && this.setCursorMode(this.cursor);
- }
- }),
- (e.prototype.processPointerMove = function (t, e, r) {
- var n = t.data,
- i = 'touch' === n.pointerType,
- o = 'mouse' === n.pointerType || 'pen' === n.pointerType;
- o && this.processPointerOverOut(t, e, r),
- (this.moveWhenInside && !r) ||
- (this.dispatchEvent(e, 'pointermove', t),
- i && this.dispatchEvent(e, 'touchmove', t),
- o && this.dispatchEvent(e, 'mousemove', t));
- }),
- (e.prototype.onPointerOut = function (t) {
- if (!this.supportsTouchEvents || 'touch' !== t.pointerType) {
- var e = this.normalizeToPointerData(t)[0];
- 'mouse' === e.pointerType &&
- ((this.mouseOverRenderer = !1), this.setCursorMode(null));
- var r = this.getInteractionDataForPointerId(e),
- n = this.configureInteractionEventForDOMEvent(
- this.eventData,
- e,
- r
- );
- (n.data.originalEvent = e),
- this.processInteractive(
- n,
- this.lastObjectRendered,
- this.processPointerOverOut,
- !1
- ),
- this.emit('pointerout', n),
- 'mouse' === e.pointerType || 'pen' === e.pointerType
- ? this.emit('mouseout', n)
- : this.releaseInteractionDataForPointerId(r.identifier);
- }
- }),
- (e.prototype.processPointerOverOut = function (t, e, r) {
- var n = t.data,
- i = t.data.identifier,
- o = 'mouse' === n.pointerType || 'pen' === n.pointerType,
- s = e.trackedPointers[i];
- r && !s && (s = e.trackedPointers[i] = new yN(i)),
- void 0 !== s &&
- (r && this.mouseOverRenderer
- ? (s.over ||
- ((s.over = !0),
- this.delayDispatchEvent(e, 'pointerover', t),
- o && this.delayDispatchEvent(e, 'mouseover', t)),
- o && null === this.cursor && (this.cursor = e.cursor))
- : s.over &&
- ((s.over = !1),
- this.dispatchEvent(e, 'pointerout', this.eventData),
- o && this.dispatchEvent(e, 'mouseout', t),
- s.none && delete e.trackedPointers[i]));
- }),
- (e.prototype.onPointerOver = function (t) {
- if (!this.supportsTouchEvents || 'touch' !== t.pointerType) {
- var e = this.normalizeToPointerData(t)[0],
- r = this.getInteractionDataForPointerId(e),
- n = this.configureInteractionEventForDOMEvent(
- this.eventData,
- e,
- r
- );
- (n.data.originalEvent = e),
- 'mouse' === e.pointerType && (this.mouseOverRenderer = !0),
- this.emit('pointerover', n),
- ('mouse' !== e.pointerType && 'pen' !== e.pointerType) ||
- this.emit('mouseover', n);
- }
- }),
- (e.prototype.getInteractionDataForPointerId = function (t) {
- var e,
- r = t.pointerId;
- return (
- 1 === r || 'mouse' === t.pointerType
- ? (e = this.mouse)
- : this.activeInteractionData[r]
- ? (e = this.activeInteractionData[r])
- : (((e = this.interactionDataPool.pop() || new pN()).identifier =
- r),
- (this.activeInteractionData[r] = e)),
- e.copyEvent(t),
- e
- );
- }),
- (e.prototype.releaseInteractionDataForPointerId = function (t) {
- var e = this.activeInteractionData[t];
- e &&
- (delete this.activeInteractionData[t],
- e.reset(),
- this.interactionDataPool.push(e));
- }),
- (e.prototype.configureInteractionEventForDOMEvent = function (t, e, r) {
- return (
- (t.data = r),
- this.mapPositionToPoint(r.global, e.clientX, e.clientY),
- 'touch' === e.pointerType &&
- ((e.globalX = r.global.x), (e.globalY = r.global.y)),
- (r.originalEvent = e),
- t.reset(),
- t
- );
- }),
- (e.prototype.normalizeToPointerData = function (t) {
- var e = [];
- if (this.supportsTouchEvents && t instanceof TouchEvent)
- for (var r = 0, n = t.changedTouches.length; r < n; r++) {
- var i = t.changedTouches[r];
- void 0 === i.button && (i.button = t.touches.length ? 1 : 0),
- void 0 === i.buttons && (i.buttons = t.touches.length ? 1 : 0),
- void 0 === i.isPrimary &&
- (i.isPrimary =
- 1 === t.touches.length && 'touchstart' === t.type),
- void 0 === i.width && (i.width = i.radiusX || 1),
- void 0 === i.height && (i.height = i.radiusY || 1),
- void 0 === i.tiltX && (i.tiltX = 0),
- void 0 === i.tiltY && (i.tiltY = 0),
- void 0 === i.pointerType && (i.pointerType = 'touch'),
- void 0 === i.pointerId && (i.pointerId = i.identifier || 0),
- void 0 === i.pressure && (i.pressure = i.force || 0.5),
- void 0 === i.twist && (i.twist = 0),
- void 0 === i.tangentialPressure && (i.tangentialPressure = 0),
- void 0 === i.layerX && (i.layerX = i.offsetX = i.clientX),
- void 0 === i.layerY && (i.layerY = i.offsetY = i.clientY),
- (i.isNormalized = !0),
- e.push(i);
- }
- else if (
- globalThis.MouseEvent &&
- (!(t instanceof MouseEvent) ||
- (this.supportsPointerEvents &&
- t instanceof globalThis.PointerEvent))
- )
- e.push(t);
- else {
- var o = t;
- void 0 === o.isPrimary && (o.isPrimary = !0),
- void 0 === o.width && (o.width = 1),
- void 0 === o.height && (o.height = 1),
- void 0 === o.tiltX && (o.tiltX = 0),
- void 0 === o.tiltY && (o.tiltY = 0),
- void 0 === o.pointerType && (o.pointerType = 'mouse'),
- void 0 === o.pointerId && (o.pointerId = 1),
- void 0 === o.pressure && (o.pressure = 0.5),
- void 0 === o.twist && (o.twist = 0),
- void 0 === o.tangentialPressure && (o.tangentialPressure = 0),
- (o.isNormalized = !0),
- e.push(o);
- }
- return e;
- }),
- (e.prototype.destroy = function () {
- this.removeEvents(),
- this.removeTickerListener(),
- this.removeAllListeners(),
- (this.renderer = null),
- (this.mouse = null),
- (this.eventData = null),
- (this.interactionDOMElement = null),
- (this.onPointerDown = null),
- (this.processPointerDown = null),
- (this.onPointerUp = null),
- (this.processPointerUp = null),
- (this.onPointerCancel = null),
- (this.processPointerCancel = null),
- (this.onPointerMove = null),
- (this.processPointerMove = null),
- (this.onPointerOut = null),
- (this.processPointerOverOut = null),
- (this.onPointerOver = null),
- (this.search = null);
- }),
- (e.extension = {
- name: 'interaction',
- type: [HD.RendererPlugin, HD.CanvasRendererPlugin],
- }),
- e
- );
- })(yA),
- xN = new TD(),
- EN = (function () {
- function t(t) {
- this.renderer = t;
- }
- return (
- (t.prototype.image = function (t, e, r) {
- var n = new Image();
- return (n.src = this.base64(t, e, r)), n;
- }),
- (t.prototype.base64 = function (t, e, r) {
- return this.canvas(t).toDataURL(e, r);
- }),
- (t.prototype.canvas = function (e, r) {
- var n = this._rawPixels(e, r),
- i = n.pixels,
- o = n.width,
- s = n.height,
- a = n.flipY,
- u = new dD(o, s, 1),
- c = u.context.getImageData(0, 0, o, s);
- if (
- (t.arrayPostDivide(i, c.data), u.context.putImageData(c, 0, 0), a)
- ) {
- var h = new dD(u.width, u.height, 1);
- h.context.scale(1, -1),
- h.context.drawImage(u.canvas, 0, -s),
- u.destroy(),
- (u = h);
- }
- return u.canvas;
- }),
- (t.prototype.pixels = function (e, r) {
- var n = this._rawPixels(e, r).pixels;
- return t.arrayPostDivide(n, n), n;
- }),
- (t.prototype._rawPixels = function (t, e) {
- var r,
- n,
- i = this.renderer,
- o = !1,
- s = !1;
- if (t)
- if (t instanceof SL) n = t;
- else {
- var a = i.context.webGLVersion >= 2 ? i.multisample : WP.NONE;
- if (
- ((n = this.renderer.generateTexture(t, { multisample: a })),
- a !== WP.NONE)
- ) {
- var u = SL.create({ width: n.width, height: n.height });
- i.framebuffer.bind(n.framebuffer),
- i.framebuffer.blit(u.framebuffer),
- i.framebuffer.bind(null),
- n.destroy(!0),
- (n = u);
- }
- s = !0;
- }
- n
- ? ((r = n.baseTexture.resolution),
- (e = null != e ? e : n.frame),
- (o = !1),
- i.renderTexture.bind(n))
- : ((r = i.resolution),
- e || (((e = xN).width = i.width), (e.height = i.height)),
- (o = !0),
- i.renderTexture.bind(null));
- var c = Math.round(e.width * r),
- h = Math.round(e.height * r),
- l = new Uint8Array(4 * c * h),
- d = i.gl;
- return (
- d.readPixels(
- Math.round(e.x * r),
- Math.round(e.y * r),
- c,
- h,
- d.RGBA,
- d.UNSIGNED_BYTE,
- l
- ),
- s && n.destroy(!0),
- { pixels: l, width: c, height: h, flipY: o }
- );
- }),
- (t.prototype.destroy = function () {
- this.renderer = null;
- }),
- (t.arrayPostDivide = function (t, e) {
- for (var r = 0; r < t.length; r += 4) {
- var n = (e[r + 3] = t[r + 3]);
- 0 !== n
- ? ((e[r] = Math.round(Math.min((255 * t[r]) / n, 255))),
- (e[r + 1] = Math.round(Math.min((255 * t[r + 1]) / n, 255))),
- (e[r + 2] = Math.round(Math.min((255 * t[r + 2]) / n, 255))))
- : ((e[r] = t[r]), (e[r + 1] = t[r + 1]), (e[r + 2] = t[r + 2]));
- }
- }),
- (t.extension = { name: 'extract', type: HD.RendererPlugin }),
- t
- );
- })(),
- SN = (function () {
- function t(t, e, r) {
- void 0 === e && (e = !1),
- (this._fn = t),
- (this._once = e),
- (this._thisArg = r),
- (this._next = this._prev = this._owner = null);
- }
- return (
- (t.prototype.detach = function () {
- return null !== this._owner && (this._owner.detach(this), !0);
- }),
- t
- );
- })();
- function wN(t, e) {
- return (
- t._head
- ? ((t._tail._next = e), (e._prev = t._tail), (t._tail = e))
- : ((t._head = e), (t._tail = e)),
- (e._owner = t),
- e
- );
- }
- var RN,
- CN = (function () {
- function t() {
- this._head = this._tail = void 0;
- }
- return (
- (t.prototype.handlers = function (t) {
- void 0 === t && (t = !1);
- var e = this._head;
- if (t) return !!e;
- for (var r = []; e; ) r.push(e), (e = e._next);
- return r;
- }),
- (t.prototype.has = function (t) {
- if (!(t instanceof SN))
- throw new Error(
- 'MiniSignal#has(): First arg must be a SignalBinding object.'
- );
- return t._owner === this;
- }),
- (t.prototype.dispatch = function () {
- for (var t = arguments, e = [], r = 0; r < arguments.length; r++)
- e[r] = t[r];
- var n = this._head;
- if (!n) return !1;
- for (; n; )
- n._once && this.detach(n),
- n._fn.apply(n._thisArg, e),
- (n = n._next);
- return !0;
- }),
- (t.prototype.add = function (t, e) {
- if ((void 0 === e && (e = null), 'function' != typeof t))
- throw new Error('MiniSignal#add(): First arg must be a Function.');
- return wN(this, new SN(t, !1, e));
- }),
- (t.prototype.once = function (t, e) {
- if ((void 0 === e && (e = null), 'function' != typeof t))
- throw new Error('MiniSignal#once(): First arg must be a Function.');
- return wN(this, new SN(t, !0, e));
- }),
- (t.prototype.detach = function (t) {
- if (!(t instanceof SN))
- throw new Error(
- 'MiniSignal#detach(): First arg must be a SignalBinding object.'
- );
- return (
- t._owner !== this ||
- (t._prev && (t._prev._next = t._next),
- t._next && (t._next._prev = t._prev),
- t === this._head
- ? ((this._head = t._next),
- null === t._next && (this._tail = null))
- : t === this._tail &&
- ((this._tail = t._prev), (this._tail._next = null)),
- (t._owner = null)),
- this
- );
- }),
- (t.prototype.detachAll = function () {
- var t = this._head;
- if (!t) return this;
- for (this._head = this._tail = null; t; )
- (t._owner = null), (t = t._next);
- return this;
- }),
- t
- );
- })();
- function PN(t, e) {
- e = e || {};
- for (
- var r = {
- key: [
- 'source',
- 'protocol',
- 'authority',
- 'userInfo',
- 'user',
- 'password',
- 'host',
- 'port',
- 'relative',
- 'path',
- 'directory',
- 'file',
- 'query',
- 'anchor',
- ],
- q: { name: 'queryKey', parser: /(?:^|&)([^&=]*)=?([^&]*)/g },
- parser: {
- strict:
- /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
- loose:
- /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,
- },
- },
- n = r.parser[e.strictMode ? 'strict' : 'loose'].exec(t),
- i = {},
- o = 14;
- o--;
- )
- i[r.key[o]] = n[o] || '';
- return (
- (i[r.q.name] = {}),
- i[r.key[12]].replace(r.q.parser, function (t, e, n) {
- e && (i[r.q.name][e] = n);
- }),
- i
- );
- }
- var AN = null;
- function ON() {}
- function IN(t, e, r) {
- e && 0 === e.indexOf('.') && (e = e.substring(1)), e && (t[e] = r);
- }
- function MN(t) {
- return t.toString().replace('object ', '');
- }
- var DN = (function () {
- function t(e, r, n) {
- if (
- ((this._dequeue = ON),
- (this._onLoadBinding = null),
- (this._elementTimer = 0),
- (this._boundComplete = null),
- (this._boundOnError = null),
- (this._boundOnProgress = null),
- (this._boundOnTimeout = null),
- (this._boundXhrOnError = null),
- (this._boundXhrOnTimeout = null),
- (this._boundXhrOnAbort = null),
- (this._boundXhrOnLoad = null),
- 'string' != typeof e || 'string' != typeof r)
- )
- throw new Error(
- 'Both name and url are required for constructing a resource.'
- );
- (n = n || {}),
- (this._flags = 0),
- this._setFlag(t.STATUS_FLAGS.DATA_URL, 0 === r.indexOf('data:')),
- (this.name = e),
- (this.url = r),
- (this.extension = this._getExtension()),
- (this.data = null),
- (this.crossOrigin = !0 === n.crossOrigin ? 'anonymous' : n.crossOrigin),
- (this.timeout = n.timeout || 0),
- (this.loadType = n.loadType || this._determineLoadType()),
- (this.xhrType = n.xhrType),
- (this.metadata = n.metadata || {}),
- (this.error = null),
- (this.xhr = null),
- (this.children = []),
- (this.type = t.TYPE.UNKNOWN),
- (this.progressChunk = 0),
- (this._dequeue = ON),
- (this._onLoadBinding = null),
- (this._elementTimer = 0),
- (this._boundComplete = this.complete.bind(this)),
- (this._boundOnError = this._onError.bind(this)),
- (this._boundOnProgress = this._onProgress.bind(this)),
- (this._boundOnTimeout = this._onTimeout.bind(this)),
- (this._boundXhrOnError = this._xhrOnError.bind(this)),
- (this._boundXhrOnTimeout = this._xhrOnTimeout.bind(this)),
- (this._boundXhrOnAbort = this._xhrOnAbort.bind(this)),
- (this._boundXhrOnLoad = this._xhrOnLoad.bind(this)),
- (this.onStart = new CN()),
- (this.onProgress = new CN()),
- (this.onComplete = new CN()),
- (this.onAfterMiddleware = new CN());
- }
- return (
- (t.setExtensionLoadType = function (e, r) {
- IN(t._loadTypeMap, e, r);
- }),
- (t.setExtensionXhrType = function (e, r) {
- IN(t._xhrTypeMap, e, r);
- }),
- Object.defineProperty(t.prototype, 'isDataUrl', {
- get: function () {
- return this._hasFlag(t.STATUS_FLAGS.DATA_URL);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'isComplete', {
- get: function () {
- return this._hasFlag(t.STATUS_FLAGS.COMPLETE);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'isLoading', {
- get: function () {
- return this._hasFlag(t.STATUS_FLAGS.LOADING);
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype.complete = function () {
- this._clearEvents(), this._finish();
- }),
- (t.prototype.abort = function (e) {
- if (!this.error) {
- if (((this.error = new Error(e)), this._clearEvents(), this.xhr))
- this.xhr.abort();
- else if (this.xdr) this.xdr.abort();
- else if (this.data)
- if (this.data.src) this.data.src = t.EMPTY_GIF;
- else
- for (; this.data.firstChild; )
- this.data.removeChild(this.data.firstChild);
- this._finish();
- }
- }),
- (t.prototype.load = function (e) {
- var r = this;
- if (!this.isLoading)
- if (this.isComplete)
- e &&
- setTimeout(function () {
- return e(r);
- }, 1);
- else
- switch (
- (e && this.onComplete.once(e),
- this._setFlag(t.STATUS_FLAGS.LOADING, !0),
- this.onStart.dispatch(this),
- (!1 !== this.crossOrigin &&
- 'string' == typeof this.crossOrigin) ||
- (this.crossOrigin = this._determineCrossOrigin(this.url)),
- this.loadType)
- ) {
- case t.LOAD_TYPE.IMAGE:
- (this.type = t.TYPE.IMAGE), this._loadElement('image');
- break;
- case t.LOAD_TYPE.AUDIO:
- (this.type = t.TYPE.AUDIO), this._loadSourceElement('audio');
- break;
- case t.LOAD_TYPE.VIDEO:
- (this.type = t.TYPE.VIDEO), this._loadSourceElement('video');
- break;
- case t.LOAD_TYPE.XHR:
- default:
- void 0 === RN &&
- (RN = !(
- !globalThis.XDomainRequest ||
- 'withCredentials' in new XMLHttpRequest()
- )),
- RN && this.crossOrigin ? this._loadXdr() : this._loadXhr();
- }
- }),
- (t.prototype._hasFlag = function (t) {
- return 0 != (this._flags & t);
- }),
- (t.prototype._setFlag = function (t, e) {
- this._flags = e ? this._flags | t : this._flags & ~t;
- }),
- (t.prototype._clearEvents = function () {
- clearTimeout(this._elementTimer),
- this.data &&
- this.data.removeEventListener &&
- (this.data.removeEventListener('error', this._boundOnError, !1),
- this.data.removeEventListener('load', this._boundComplete, !1),
- this.data.removeEventListener(
- 'progress',
- this._boundOnProgress,
- !1
- ),
- this.data.removeEventListener(
- 'canplaythrough',
- this._boundComplete,
- !1
- )),
- this.xhr &&
- (this.xhr.removeEventListener
- ? (this.xhr.removeEventListener(
- 'error',
- this._boundXhrOnError,
- !1
- ),
- this.xhr.removeEventListener(
- 'timeout',
- this._boundXhrOnTimeout,
- !1
- ),
- this.xhr.removeEventListener(
- 'abort',
- this._boundXhrOnAbort,
- !1
- ),
- this.xhr.removeEventListener(
- 'progress',
- this._boundOnProgress,
- !1
- ),
- this.xhr.removeEventListener('load', this._boundXhrOnLoad, !1))
- : ((this.xhr.onerror = null),
- (this.xhr.ontimeout = null),
- (this.xhr.onprogress = null),
- (this.xhr.onload = null)));
- }),
- (t.prototype._finish = function () {
- if (this.isComplete)
- throw new Error(
- 'Complete called again for an already completed resource.'
- );
- this._setFlag(t.STATUS_FLAGS.COMPLETE, !0),
- this._setFlag(t.STATUS_FLAGS.LOADING, !1),
- this.onComplete.dispatch(this);
- }),
- (t.prototype._loadElement = function (t) {
- this.metadata.loadElement
- ? (this.data = this.metadata.loadElement)
- : 'image' === t && void 0 !== globalThis.Image
- ? (this.data = new Image())
- : (this.data = document.createElement(t)),
- this.crossOrigin && (this.data.crossOrigin = this.crossOrigin),
- this.metadata.skipSource || (this.data.src = this.url),
- this.data.addEventListener('error', this._boundOnError, !1),
- this.data.addEventListener('load', this._boundComplete, !1),
- this.data.addEventListener('progress', this._boundOnProgress, !1),
- this.timeout &&
- (this._elementTimer = setTimeout(
- this._boundOnTimeout,
- this.timeout
- ));
- }),
- (t.prototype._loadSourceElement = function (t) {
- if (
- (this.metadata.loadElement
- ? (this.data = this.metadata.loadElement)
- : 'audio' === t && void 0 !== globalThis.Audio
- ? (this.data = new Audio())
- : (this.data = document.createElement(t)),
- null !== this.data)
- ) {
- if (
- (this.crossOrigin && (this.data.crossOrigin = this.crossOrigin),
- !this.metadata.skipSource)
- )
- if (navigator.isCocoonJS)
- this.data.src = Array.isArray(this.url) ? this.url[0] : this.url;
- else if (Array.isArray(this.url))
- for (
- var e = this.metadata.mimeType, r = 0;
- r < this.url.length;
- ++r
- )
- this.data.appendChild(
- this._createSource(
- t,
- this.url[r],
- Array.isArray(e) ? e[r] : e
- )
- );
- else {
- e = this.metadata.mimeType;
- this.data.appendChild(
- this._createSource(t, this.url, Array.isArray(e) ? e[0] : e)
- );
- }
- this.data.addEventListener('error', this._boundOnError, !1),
- this.data.addEventListener('load', this._boundComplete, !1),
- this.data.addEventListener('progress', this._boundOnProgress, !1),
- this.data.addEventListener(
- 'canplaythrough',
- this._boundComplete,
- !1
- ),
- this.data.load(),
- this.timeout &&
- (this._elementTimer = setTimeout(
- this._boundOnTimeout,
- this.timeout
- ));
- } else this.abort('Unsupported element: ' + t);
- }),
- (t.prototype._loadXhr = function () {
- 'string' != typeof this.xhrType &&
- (this.xhrType = this._determineXhrType());
- var e = (this.xhr = new XMLHttpRequest());
- 'use-credentials' === this.crossOrigin && (e.withCredentials = !0),
- e.open('GET', this.url, !0),
- (e.timeout = this.timeout),
- this.xhrType === t.XHR_RESPONSE_TYPE.JSON ||
- this.xhrType === t.XHR_RESPONSE_TYPE.DOCUMENT
- ? (e.responseType = t.XHR_RESPONSE_TYPE.TEXT)
- : (e.responseType = this.xhrType),
- e.addEventListener('error', this._boundXhrOnError, !1),
- e.addEventListener('timeout', this._boundXhrOnTimeout, !1),
- e.addEventListener('abort', this._boundXhrOnAbort, !1),
- e.addEventListener('progress', this._boundOnProgress, !1),
- e.addEventListener('load', this._boundXhrOnLoad, !1),
- e.send();
- }),
- (t.prototype._loadXdr = function () {
- 'string' != typeof this.xhrType &&
- (this.xhrType = this._determineXhrType());
- var t = (this.xhr = new globalThis.XDomainRequest());
- (t.timeout = this.timeout || 5e3),
- (t.onerror = this._boundXhrOnError),
- (t.ontimeout = this._boundXhrOnTimeout),
- (t.onprogress = this._boundOnProgress),
- (t.onload = this._boundXhrOnLoad),
- t.open('GET', this.url, !0),
- setTimeout(function () {
- return t.send();
- }, 1);
- }),
- (t.prototype._createSource = function (t, e, r) {
- r || (r = t + '/' + this._getExtension(e));
- var n = document.createElement('source');
- return (n.src = e), (n.type = r), n;
- }),
- (t.prototype._onError = function (t) {
- this.abort('Failed to load element using: ' + t.target.nodeName);
- }),
- (t.prototype._onProgress = function (t) {
- t &&
- t.lengthComputable &&
- this.onProgress.dispatch(this, t.loaded / t.total);
- }),
- (t.prototype._onTimeout = function () {
- this.abort('Load timed out.');
- }),
- (t.prototype._xhrOnError = function () {
- var t = this.xhr;
- this.abort(
- MN(t) +
- ' Request failed. Status: ' +
- t.status +
- ', text: "' +
- t.statusText +
- '"'
- );
- }),
- (t.prototype._xhrOnTimeout = function () {
- var t = this.xhr;
- this.abort(MN(t) + ' Request timed out.');
- }),
- (t.prototype._xhrOnAbort = function () {
- var t = this.xhr;
- this.abort(MN(t) + ' Request was aborted by the user.');
- }),
- (t.prototype._xhrOnLoad = function () {
- var e = this.xhr,
- r = '',
- n = void 0 === e.status ? 200 : e.status;
- if (
- (('' !== e.responseType &&
- 'text' !== e.responseType &&
- void 0 !== e.responseType) ||
- (r = e.responseText),
- 0 === n &&
- (r.length > 0 || e.responseType === t.XHR_RESPONSE_TYPE.BUFFER)
- ? (n = 200)
- : 1223 === n && (n = 204),
- 2 === ((n / 100) | 0))
- ) {
- if (this.xhrType === t.XHR_RESPONSE_TYPE.TEXT)
- (this.data = r), (this.type = t.TYPE.TEXT);
- else if (this.xhrType === t.XHR_RESPONSE_TYPE.JSON)
- try {
- (this.data = JSON.parse(r)), (this.type = t.TYPE.JSON);
- } catch (t) {
- return void this.abort('Error trying to parse loaded json: ' + t);
- }
- else if (this.xhrType === t.XHR_RESPONSE_TYPE.DOCUMENT)
- try {
- if (globalThis.DOMParser) {
- var i = new DOMParser();
- this.data = i.parseFromString(r, 'text/xml');
- } else {
- var o = document.createElement('div');
- (o.innerHTML = r), (this.data = o);
- }
- this.type = t.TYPE.XML;
- } catch (t) {
- return void this.abort('Error trying to parse loaded xml: ' + t);
- }
- else this.data = e.response || r;
- this.complete();
- } else
- this.abort(
- '[' + e.status + '] ' + e.statusText + ': ' + e.responseURL
- );
- }),
- (t.prototype._determineCrossOrigin = function (t, e) {
- if (0 === t.indexOf('data:')) return '';
- if (globalThis.origin !== globalThis.location.origin)
- return 'anonymous';
- (e = e || globalThis.location),
- AN || (AN = document.createElement('a')),
- (AN.href = t);
- var r = PN(AN.href, { strictMode: !0 }),
- n = (!r.port && '' === e.port) || r.port === e.port,
- i = r.protocol ? r.protocol + ':' : '';
- return r.host === e.hostname && n && i === e.protocol
- ? ''
- : 'anonymous';
- }),
- (t.prototype._determineXhrType = function () {
- return t._xhrTypeMap[this.extension] || t.XHR_RESPONSE_TYPE.TEXT;
- }),
- (t.prototype._determineLoadType = function () {
- return t._loadTypeMap[this.extension] || t.LOAD_TYPE.XHR;
- }),
- (t.prototype._getExtension = function (t) {
- void 0 === t && (t = this.url);
- var e = '';
- if (this.isDataUrl) {
- var r = t.indexOf('/');
- e = t.substring(r + 1, t.indexOf(';', r));
- } else {
- var n = t.indexOf('?'),
- i = t.indexOf('#'),
- o = Math.min(n > -1 ? n : t.length, i > -1 ? i : t.length);
- e = (t = t.substring(0, o)).substring(t.lastIndexOf('.') + 1);
- }
- return e.toLowerCase();
- }),
- (t.prototype._getMimeFromXhrType = function (e) {
- switch (e) {
- case t.XHR_RESPONSE_TYPE.BUFFER:
- return 'application/octet-binary';
- case t.XHR_RESPONSE_TYPE.BLOB:
- return 'application/blob';
- case t.XHR_RESPONSE_TYPE.DOCUMENT:
- return 'application/xml';
- case t.XHR_RESPONSE_TYPE.JSON:
- return 'application/json';
- case t.XHR_RESPONSE_TYPE.DEFAULT:
- case t.XHR_RESPONSE_TYPE.TEXT:
- default:
- return 'text/plain';
- }
- }),
- t
- );
- })();
- function LN() {}
- function FN(t) {
- return function () {
- for (var e = arguments, r = [], n = 0; n < arguments.length; n++)
- r[n] = e[n];
- if (null === t) throw new Error('Callback was already called.');
- var i = t;
- (t = null), i.apply(this, r);
- };
- }
- !(function (t) {
- var e, r, n, i;
- ((e = t.STATUS_FLAGS || (t.STATUS_FLAGS = {}))[(e.NONE = 0)] = 'NONE'),
- (e[(e.DATA_URL = 1)] = 'DATA_URL'),
- (e[(e.COMPLETE = 2)] = 'COMPLETE'),
- (e[(e.LOADING = 4)] = 'LOADING'),
- ((r = t.TYPE || (t.TYPE = {}))[(r.UNKNOWN = 0)] = 'UNKNOWN'),
- (r[(r.JSON = 1)] = 'JSON'),
- (r[(r.XML = 2)] = 'XML'),
- (r[(r.IMAGE = 3)] = 'IMAGE'),
- (r[(r.AUDIO = 4)] = 'AUDIO'),
- (r[(r.VIDEO = 5)] = 'VIDEO'),
- (r[(r.TEXT = 6)] = 'TEXT'),
- ((n = t.LOAD_TYPE || (t.LOAD_TYPE = {}))[(n.XHR = 1)] = 'XHR'),
- (n[(n.IMAGE = 2)] = 'IMAGE'),
- (n[(n.AUDIO = 3)] = 'AUDIO'),
- (n[(n.VIDEO = 4)] = 'VIDEO'),
- ((i = t.XHR_RESPONSE_TYPE || (t.XHR_RESPONSE_TYPE = {})).DEFAULT =
- 'text'),
- (i.BUFFER = 'arraybuffer'),
- (i.BLOB = 'blob'),
- (i.DOCUMENT = 'document'),
- (i.JSON = 'json'),
- (i.TEXT = 'text'),
- (t._loadTypeMap = {
- gif: t.LOAD_TYPE.IMAGE,
- png: t.LOAD_TYPE.IMAGE,
- bmp: t.LOAD_TYPE.IMAGE,
- jpg: t.LOAD_TYPE.IMAGE,
- jpeg: t.LOAD_TYPE.IMAGE,
- tif: t.LOAD_TYPE.IMAGE,
- tiff: t.LOAD_TYPE.IMAGE,
- webp: t.LOAD_TYPE.IMAGE,
- tga: t.LOAD_TYPE.IMAGE,
- avif: t.LOAD_TYPE.IMAGE,
- svg: t.LOAD_TYPE.IMAGE,
- 'svg+xml': t.LOAD_TYPE.IMAGE,
- mp3: t.LOAD_TYPE.AUDIO,
- ogg: t.LOAD_TYPE.AUDIO,
- wav: t.LOAD_TYPE.AUDIO,
- mp4: t.LOAD_TYPE.VIDEO,
- webm: t.LOAD_TYPE.VIDEO,
- }),
- (t._xhrTypeMap = {
- xhtml: t.XHR_RESPONSE_TYPE.DOCUMENT,
- html: t.XHR_RESPONSE_TYPE.DOCUMENT,
- htm: t.XHR_RESPONSE_TYPE.DOCUMENT,
- xml: t.XHR_RESPONSE_TYPE.DOCUMENT,
- tmx: t.XHR_RESPONSE_TYPE.DOCUMENT,
- svg: t.XHR_RESPONSE_TYPE.DOCUMENT,
- tsx: t.XHR_RESPONSE_TYPE.DOCUMENT,
- gif: t.XHR_RESPONSE_TYPE.BLOB,
- png: t.XHR_RESPONSE_TYPE.BLOB,
- bmp: t.XHR_RESPONSE_TYPE.BLOB,
- jpg: t.XHR_RESPONSE_TYPE.BLOB,
- jpeg: t.XHR_RESPONSE_TYPE.BLOB,
- tif: t.XHR_RESPONSE_TYPE.BLOB,
- tiff: t.XHR_RESPONSE_TYPE.BLOB,
- webp: t.XHR_RESPONSE_TYPE.BLOB,
- tga: t.XHR_RESPONSE_TYPE.BLOB,
- avif: t.XHR_RESPONSE_TYPE.BLOB,
- json: t.XHR_RESPONSE_TYPE.JSON,
- text: t.XHR_RESPONSE_TYPE.TEXT,
- txt: t.XHR_RESPONSE_TYPE.TEXT,
- ttf: t.XHR_RESPONSE_TYPE.BUFFER,
- otf: t.XHR_RESPONSE_TYPE.BUFFER,
- }),
- (t.EMPTY_GIF =
- 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
- })(DN || (DN = {}));
- var NN = function (t, e) {
- (this.data = t), (this.callback = e);
- },
- kN = (function () {
- function t(t, e) {
- var r = this;
- if (
- (void 0 === e && (e = 1),
- (this.workers = 0),
- (this.saturated = LN),
- (this.unsaturated = LN),
- (this.empty = LN),
- (this.drain = LN),
- (this.error = LN),
- (this.started = !1),
- (this.paused = !1),
- (this._tasks = []),
- (this._insert = function (t, e, n) {
- if (n && 'function' != typeof n)
- throw new Error('task callback must be a function');
- if (((r.started = !0), null == t && r.idle()))
- setTimeout(function () {
- return r.drain();
- }, 1);
- else {
- var i = new NN(t, 'function' == typeof n ? n : LN);
- e ? r._tasks.unshift(i) : r._tasks.push(i),
- setTimeout(r.process, 1);
- }
- }),
- (this.process = function () {
- for (
- ;
- !r.paused && r.workers < r.concurrency && r._tasks.length;
- ) {
- var t = r._tasks.shift();
- 0 === r._tasks.length && r.empty(),
- (r.workers += 1),
- r.workers === r.concurrency && r.saturated(),
- r._worker(t.data, FN(r._next(t)));
- }
- }),
- (this._worker = t),
- 0 === e)
- )
- throw new Error('Concurrency must not be zero');
- (this.concurrency = e), (this.buffer = e / 4);
- }
- return (
- (t.prototype._next = function (t) {
- var e = this;
- return function () {
- for (var r = arguments, n = [], i = 0; i < arguments.length; i++)
- n[i] = r[i];
- (e.workers -= 1),
- t.callback.apply(t, n),
- null != n[0] && e.error(n[0], t.data),
- e.workers <= e.concurrency - e.buffer && e.unsaturated(),
- e.idle() && e.drain(),
- e.process();
- };
- }),
- (t.prototype.push = function (t, e) {
- this._insert(t, !1, e);
- }),
- (t.prototype.kill = function () {
- (this.workers = 0),
- (this.drain = LN),
- (this.started = !1),
- (this._tasks = []);
- }),
- (t.prototype.unshift = function (t, e) {
- this._insert(t, !0, e);
- }),
- (t.prototype.length = function () {
- return this._tasks.length;
- }),
- (t.prototype.running = function () {
- return this.workers;
- }),
- (t.prototype.idle = function () {
- return this._tasks.length + this.workers === 0;
- }),
- (t.prototype.pause = function () {
- !0 !== this.paused && (this.paused = !0);
- }),
- (t.prototype.resume = function () {
- if (!1 !== this.paused) {
- this.paused = !1;
- for (var t = 1; t <= this.concurrency; t++) this.process();
- }
- }),
- (t.eachSeries = function (t, e, r, n) {
- var i = 0,
- o = t.length;
- !(function s(a) {
- a || i === o
- ? r && r(a)
- : n
- ? setTimeout(function () {
- e(t[i++], s);
- }, 1)
- : e(t[i++], s);
- })();
- }),
- (t.queue = function (e, r) {
- return new t(e, r);
- }),
- t
- );
- })(),
- BN = /(#[\w-]+)?$/,
- GN = (function () {
- function t(e, r) {
- var n = this;
- void 0 === e && (e = ''),
- void 0 === r && (r = 10),
- (this.progress = 0),
- (this.loading = !1),
- (this.defaultQueryString = ''),
- (this._beforeMiddleware = []),
- (this._afterMiddleware = []),
- (this._resourcesParsing = []),
- (this._boundLoadResource = function (t, e) {
- return n._loadResource(t, e);
- }),
- (this.resources = {}),
- (this.baseUrl = e),
- (this._beforeMiddleware = []),
- (this._afterMiddleware = []),
- (this._resourcesParsing = []),
- (this._boundLoadResource = function (t, e) {
- return n._loadResource(t, e);
- }),
- (this._queue = kN.queue(this._boundLoadResource, r)),
- this._queue.pause(),
- (this.resources = {}),
- (this.onProgress = new CN()),
- (this.onError = new CN()),
- (this.onLoad = new CN()),
- (this.onStart = new CN()),
- (this.onComplete = new CN());
- for (var i = 0; i < t._plugins.length; ++i) {
- var o = t._plugins[i],
- s = o.pre,
- a = o.use;
- s && this.pre(s), a && this.use(a);
- }
- this._protected = !1;
- }
- return (
- (t.prototype._add = function (t, e, r, n) {
- if (this.loading && (!r || !r.parentResource))
- throw new Error(
- 'Cannot add resources while the loader is running.'
- );
- if (this.resources[t])
- throw new Error('Resource named "' + t + '" already exists.');
- if (
- ((e = this._prepareUrl(e)),
- (this.resources[t] = new DN(t, e, r)),
- 'function' == typeof n &&
- this.resources[t].onAfterMiddleware.once(n),
- this.loading)
- ) {
- for (
- var i = r.parentResource, o = [], s = 0;
- s < i.children.length;
- ++s
- )
- i.children[s].isComplete || o.push(i.children[s]);
- var a = (i.progressChunk * (o.length + 1)) / (o.length + 2);
- i.children.push(this.resources[t]), (i.progressChunk = a);
- for (s = 0; s < o.length; ++s) o[s].progressChunk = a;
- this.resources[t].progressChunk = a;
- }
- return this._queue.push(this.resources[t]), this;
- }),
- (t.prototype.pre = function (t) {
- return this._beforeMiddleware.push(t), this;
- }),
- (t.prototype.use = function (t) {
- return this._afterMiddleware.push(t), this;
- }),
- (t.prototype.reset = function () {
- for (var t in ((this.progress = 0),
- (this.loading = !1),
- this._queue.kill(),
- this._queue.pause(),
- this.resources)) {
- var e = this.resources[t];
- e._onLoadBinding && e._onLoadBinding.detach(),
- e.isLoading && e.abort('loader reset');
- }
- return (this.resources = {}), this;
- }),
- (t.prototype.load = function (t) {
- if (
- (aD(
- '6.5.0',
- '@pixi/loaders is being replaced with @pixi/assets in the next major release.'
- ),
- 'function' == typeof t && this.onComplete.once(t),
- this.loading)
- )
- return this;
- if (this._queue.idle()) this._onStart(), this._onComplete();
- else {
- for (
- var e = 100 / this._queue._tasks.length, r = 0;
- r < this._queue._tasks.length;
- ++r
- )
- this._queue._tasks[r].data.progressChunk = e;
- this._onStart(), this._queue.resume();
- }
- return this;
- }),
- Object.defineProperty(t.prototype, 'concurrency', {
- get: function () {
- return this._queue.concurrency;
- },
- set: function (t) {
- this._queue.concurrency = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype._prepareUrl = function (t) {
- var e,
- r = PN(t, { strictMode: !0 });
- if (
- ((e =
- r.protocol || !r.path || 0 === t.indexOf('//')
- ? t
- : this.baseUrl.length &&
- this.baseUrl.lastIndexOf('/') !== this.baseUrl.length - 1 &&
- '/' !== t.charAt(0)
- ? this.baseUrl + '/' + t
- : this.baseUrl + t),
- this.defaultQueryString)
- ) {
- var n = BN.exec(e)[0];
- -1 !== (e = e.slice(0, e.length - n.length)).indexOf('?')
- ? (e += '&' + this.defaultQueryString)
- : (e += '?' + this.defaultQueryString),
- (e += n);
- }
- return e;
- }),
- (t.prototype._loadResource = function (t, e) {
- var r = this;
- (t._dequeue = e),
- kN.eachSeries(
- this._beforeMiddleware,
- function (e, n) {
- e.call(r, t, function () {
- n(t.isComplete ? {} : null);
- });
- },
- function () {
- t.isComplete
- ? r._onLoad(t)
- : ((t._onLoadBinding = t.onComplete.once(r._onLoad, r)),
- t.load());
- },
- !0
- );
- }),
- (t.prototype._onStart = function () {
- (this.progress = 0), (this.loading = !0), this.onStart.dispatch(this);
- }),
- (t.prototype._onComplete = function () {
- (this.progress = 100),
- (this.loading = !1),
- this.onComplete.dispatch(this, this.resources);
- }),
- (t.prototype._onLoad = function (t) {
- var e = this;
- (t._onLoadBinding = null),
- this._resourcesParsing.push(t),
- t._dequeue(),
- kN.eachSeries(
- this._afterMiddleware,
- function (r, n) {
- r.call(e, t, n);
- },
- function () {
- t.onAfterMiddleware.dispatch(t),
- (e.progress = Math.min(100, e.progress + t.progressChunk)),
- e.onProgress.dispatch(e, t),
- t.error
- ? e.onError.dispatch(t.error, e, t)
- : e.onLoad.dispatch(e, t),
- e._resourcesParsing.splice(e._resourcesParsing.indexOf(t), 1),
- e._queue.idle() &&
- 0 === e._resourcesParsing.length &&
- e._onComplete();
- },
- !0
- );
- }),
- (t.prototype.destroy = function () {
- this._protected || this.reset();
- }),
- Object.defineProperty(t, 'shared', {
- get: function () {
- var e = t._shared;
- return e || (((e = new t())._protected = !0), (t._shared = e)), e;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.registerPlugin = function (e) {
- return (
- aD(
- '6.5.0',
- 'Loader.registerPlugin() is deprecated, use extensions.add() instead.'
- ),
- ZD.add({ type: HD.Loader, ref: e }),
- t
- );
- }),
- (t._plugins = []),
- t
- );
- })();
- ZD.handleByList(HD.Loader, GN._plugins),
- (GN.prototype.add = function (t, e, r, n) {
- if (Array.isArray(t)) {
- for (var i = 0; i < t.length; ++i) this.add(t[i]);
- return this;
- }
- if (
- ('object' == typeof t &&
- ((r = t),
- (n = e || r.callback || r.onComplete),
- (e = r.url),
- (t = r.name || r.key || r.url)),
- 'string' != typeof e && ((n = r), (r = e), (e = t)),
- 'string' != typeof e)
- )
- throw new Error('No url passed to add resource to loader.');
- return (
- 'function' == typeof r && ((n = r), (r = null)), this._add(t, e, r, n)
- );
- });
- var UN = (function () {
- function t() {}
- return (
- (t.init = function (t) {
- (t = Object.assign({ sharedLoader: !1 }, t)),
- (this.loader = t.sharedLoader ? GN.shared : new GN());
- }),
- (t.destroy = function () {
- this.loader && (this.loader.destroy(), (this.loader = null));
- }),
- (t.extension = HD.Application),
- t
- );
- })(),
- jN = (function () {
- function t() {}
- return (
- (t.add = function () {
- DN.setExtensionLoadType('svg', DN.LOAD_TYPE.XHR),
- DN.setExtensionXhrType('svg', DN.XHR_RESPONSE_TYPE.TEXT);
- }),
- (t.use = function (t, e) {
- if (!t.data || (t.type !== DN.TYPE.IMAGE && 'svg' !== t.extension))
- e();
- else {
- var r = t.data,
- n = t.url,
- i = t.name,
- o = t.metadata;
- EL.fromLoader(r, n, i, o)
- .then(function (r) {
- (t.texture = r), e();
- })
- .catch(e);
- }
- }),
- (t.extension = HD.Loader),
- t
- );
- })();
- function XN(t, e) {
- if (t.data) {
- if (t.xhr && t.xhrType === DN.XHR_RESPONSE_TYPE.BLOB)
- if (self.Blob && 'string' != typeof t.data) {
- if (0 === t.data.type.indexOf('image')) {
- var r = globalThis.URL || globalThis.webkitURL,
- n = r.createObjectURL(t.data);
- return (
- (t.blob = t.data),
- (t.data = new Image()),
- (t.data.src = n),
- (t.type = DN.TYPE.IMAGE),
- void (t.data.onload = function () {
- r.revokeObjectURL(n), (t.data.onload = null), e();
- })
- );
- }
- } else {
- var i = t.xhr.getResponseHeader('content-type');
- if (i && 0 === i.indexOf('image'))
- return (
- (t.data = new Image()),
- (t.data.src =
- 'data:' +
- i +
- ';base64,' +
- (function (t) {
- for (var e = '', r = 0; r < t.length; ) {
- for (
- var n = [0, 0, 0], i = [0, 0, 0, 0], o = 0;
- o < n.length;
- ++o
- )
- r < t.length
- ? (n[o] = 255 & t.charCodeAt(r++))
- : (n[o] = 0);
- switch (
- ((i[0] = n[0] >> 2),
- (i[1] = ((3 & n[0]) << 4) | (n[1] >> 4)),
- (i[2] = ((15 & n[1]) << 2) | (n[2] >> 6)),
- (i[3] = 63 & n[2]),
- r - (t.length - 1))
- ) {
- case 2:
- (i[3] = 64), (i[2] = 64);
- break;
- case 1:
- i[3] = 64;
- }
- for (o = 0; o < i.length; ++o)
- e +=
- 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.charAt(
- i[o]
- );
- }
- return e;
- })(t.xhr.responseText)),
- (t.type = DN.TYPE.IMAGE),
- void (t.data.onload = function () {
- (t.data.onload = null), e();
- })
- );
- }
- e();
- } else e();
- }
- var VN,
- HN,
- WN = (function () {
- function t() {}
- return (t.extension = HD.Loader), (t.use = XN), t;
- })();
- ZD.add(jN, WN),
- (function (t) {
- (t[(t.COMPRESSED_RGB_S3TC_DXT1_EXT = 33776)] =
- 'COMPRESSED_RGB_S3TC_DXT1_EXT'),
- (t[(t.COMPRESSED_RGBA_S3TC_DXT1_EXT = 33777)] =
- 'COMPRESSED_RGBA_S3TC_DXT1_EXT'),
- (t[(t.COMPRESSED_RGBA_S3TC_DXT3_EXT = 33778)] =
- 'COMPRESSED_RGBA_S3TC_DXT3_EXT'),
- (t[(t.COMPRESSED_RGBA_S3TC_DXT5_EXT = 33779)] =
- 'COMPRESSED_RGBA_S3TC_DXT5_EXT'),
- (t[(t.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 35917)] =
- 'COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT'),
- (t[(t.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 35918)] =
- 'COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT'),
- (t[(t.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 35919)] =
- 'COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT'),
- (t[(t.COMPRESSED_SRGB_S3TC_DXT1_EXT = 35916)] =
- 'COMPRESSED_SRGB_S3TC_DXT1_EXT'),
- (t[(t.COMPRESSED_R11_EAC = 37488)] = 'COMPRESSED_R11_EAC'),
- (t[(t.COMPRESSED_SIGNED_R11_EAC = 37489)] =
- 'COMPRESSED_SIGNED_R11_EAC'),
- (t[(t.COMPRESSED_RG11_EAC = 37490)] = 'COMPRESSED_RG11_EAC'),
- (t[(t.COMPRESSED_SIGNED_RG11_EAC = 37491)] =
- 'COMPRESSED_SIGNED_RG11_EAC'),
- (t[(t.COMPRESSED_RGB8_ETC2 = 37492)] = 'COMPRESSED_RGB8_ETC2'),
- (t[(t.COMPRESSED_RGBA8_ETC2_EAC = 37496)] =
- 'COMPRESSED_RGBA8_ETC2_EAC'),
- (t[(t.COMPRESSED_SRGB8_ETC2 = 37493)] = 'COMPRESSED_SRGB8_ETC2'),
- (t[(t.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 37497)] =
- 'COMPRESSED_SRGB8_ALPHA8_ETC2_EAC'),
- (t[(t.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37494)] =
- 'COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2'),
- (t[(t.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 37495)] =
- 'COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2'),
- (t[(t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 35840)] =
- 'COMPRESSED_RGB_PVRTC_4BPPV1_IMG'),
- (t[(t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 35842)] =
- 'COMPRESSED_RGBA_PVRTC_4BPPV1_IMG'),
- (t[(t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 35841)] =
- 'COMPRESSED_RGB_PVRTC_2BPPV1_IMG'),
- (t[(t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 35843)] =
- 'COMPRESSED_RGBA_PVRTC_2BPPV1_IMG'),
- (t[(t.COMPRESSED_RGB_ETC1_WEBGL = 36196)] =
- 'COMPRESSED_RGB_ETC1_WEBGL'),
- (t[(t.COMPRESSED_RGB_ATC_WEBGL = 35986)] = 'COMPRESSED_RGB_ATC_WEBGL'),
- (t[(t.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 35986)] =
- 'COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL'),
- (t[(t.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 34798)] =
- 'COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL'),
- (t[(t.COMPRESSED_RGBA_ASTC_4x4_KHR = 37808)] =
- 'COMPRESSED_RGBA_ASTC_4x4_KHR');
- })(HN || (HN = {}));
- var YN =
- (((VN = {})[HN.COMPRESSED_RGB_S3TC_DXT1_EXT] = 0.5),
- (VN[HN.COMPRESSED_RGBA_S3TC_DXT1_EXT] = 0.5),
- (VN[HN.COMPRESSED_RGBA_S3TC_DXT3_EXT] = 1),
- (VN[HN.COMPRESSED_RGBA_S3TC_DXT5_EXT] = 1),
- (VN[HN.COMPRESSED_SRGB_S3TC_DXT1_EXT] = 0.5),
- (VN[HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT] = 0.5),
- (VN[HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT] = 1),
- (VN[HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT] = 1),
- (VN[HN.COMPRESSED_R11_EAC] = 0.5),
- (VN[HN.COMPRESSED_SIGNED_R11_EAC] = 0.5),
- (VN[HN.COMPRESSED_RG11_EAC] = 1),
- (VN[HN.COMPRESSED_SIGNED_RG11_EAC] = 1),
- (VN[HN.COMPRESSED_RGB8_ETC2] = 0.5),
- (VN[HN.COMPRESSED_RGBA8_ETC2_EAC] = 1),
- (VN[HN.COMPRESSED_SRGB8_ETC2] = 0.5),
- (VN[HN.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC] = 1),
- (VN[HN.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2] = 0.5),
- (VN[HN.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2] = 0.5),
- (VN[HN.COMPRESSED_RGB_PVRTC_4BPPV1_IMG] = 0.5),
- (VN[HN.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG] = 0.5),
- (VN[HN.COMPRESSED_RGB_PVRTC_2BPPV1_IMG] = 0.25),
- (VN[HN.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG] = 0.25),
- (VN[HN.COMPRESSED_RGB_ETC1_WEBGL] = 0.5),
- (VN[HN.COMPRESSED_RGB_ATC_WEBGL] = 0.5),
- (VN[HN.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL] = 1),
- (VN[HN.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL] = 1),
- (VN[HN.COMPRESSED_RGBA_ASTC_4x4_KHR] = 1),
- VN),
- zN = function (t, e) {
- return (
- (zN =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- zN(t, e)
- );
- };
- function ZN(t, e) {
- function r() {
- this.constructor = t;
- }
- zN(t, e),
- (t.prototype =
- null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
- }
- function JN(t, e, r, n) {
- return new (r || (r = Promise))(function (i, o) {
- function s(t) {
- try {
- u(n.next(t));
- } catch (t) {
- o(t);
- }
- }
- function a(t) {
- try {
- u(n.throw(t));
- } catch (t) {
- o(t);
- }
- }
- function u(t) {
- var e;
- t.done
- ? i(t.value)
- : ((e = t.value),
- e instanceof r
- ? e
- : new r(function (t) {
- t(e);
- })).then(s, a);
- }
- u((n = n.apply(t, e || [])).next());
- });
- }
- function KN(t, e) {
- var r,
- n,
- i,
- o,
- s = {
- label: 0,
- sent: function () {
- if (1 & i[0]) throw i[1];
- return i[1];
- },
- trys: [],
- ops: [],
- };
- return (
- (o = { next: a(0), throw: a(1), return: a(2) }),
- 'function' == typeof Symbol &&
- (o[Symbol.iterator] = function () {
- return this;
- }),
- o
- );
- function a(o) {
- return function (a) {
- return (function (o) {
- if (r) throw new TypeError('Generator is already executing.');
- for (; s; )
- try {
- if (
- ((r = 1),
- n &&
- (i =
- 2 & o[0]
- ? n.return
- : o[0]
- ? n.throw || ((i = n.return) && i.call(n), 0)
- : n.next) &&
- !(i = i.call(n, o[1])).done)
- )
- return i;
- switch (((n = 0), i && (o = [2 & o[0], i.value]), o[0])) {
- case 0:
- case 1:
- i = o;
- break;
- case 4:
- return s.label++, { value: o[1], done: !1 };
- case 5:
- s.label++, (n = o[1]), (o = [0]);
- continue;
- case 7:
- (o = s.ops.pop()), s.trys.pop();
- continue;
- default:
- if (
- !((i = s.trys),
- (i = i.length > 0 && i[i.length - 1]) ||
- (6 !== o[0] && 2 !== o[0]))
- ) {
- s = 0;
- continue;
- }
- if (3 === o[0] && (!i || (o[1] > i[0] && o[1] < i[3]))) {
- s.label = o[1];
- break;
- }
- if (6 === o[0] && s.label < i[1]) {
- (s.label = i[1]), (i = o);
- break;
- }
- if (i && s.label < i[2]) {
- (s.label = i[2]), s.ops.push(o);
- break;
- }
- i[2] && s.ops.pop(), s.trys.pop();
- continue;
- }
- o = e.call(t, s);
- } catch (t) {
- (o = [6, t]), (n = 0);
- } finally {
- r = i = 0;
- }
- if (5 & o[0]) throw o[1];
- return { value: o[0] ? o[1] : void 0, done: !0 };
- })([o, a]);
- };
- }
- }
- var qN,
- QN,
- $N = (function (t) {
- function e(e, r) {
- void 0 === r && (r = { width: 1, height: 1, autoLoad: !0 });
- var n,
- i,
- o = this;
- return (
- 'string' == typeof e
- ? ((n = e), (i = new Uint8Array()))
- : ((n = null), (i = e)),
- ((o = t.call(this, i, r) || this).origin = n),
- (o.buffer = i ? new oN(i) : null),
- o.origin && !1 !== r.autoLoad && o.load(),
- i &&
- i.length &&
- ((o.loaded = !0), o.onBlobLoaded(o.buffer.rawBinaryData)),
- o
- );
- }
- return (
- ZN(e, t),
- (e.prototype.onBlobLoaded = function (t) {}),
- (e.prototype.load = function () {
- return JN(this, void 0, Promise, function () {
- var t;
- return KN(this, function (e) {
- switch (e.label) {
- case 0:
- return [4, fetch(this.origin)];
- case 1:
- return [4, e.sent().blob()];
- case 2:
- return [4, e.sent().arrayBuffer()];
- case 3:
- return (
- (t = e.sent()),
- (this.data = new Uint32Array(t)),
- (this.buffer = new oN(t)),
- (this.loaded = !0),
- this.onBlobLoaded(t),
- this.update(),
- [2, this]
- );
- }
- });
- });
- }),
- e
- );
- })(oL),
- tk = (function (t) {
- function e(r, n) {
- var i = t.call(this, r, n) || this;
- return (
- (i.format = n.format),
- (i.levels = n.levels || 1),
- (i._width = n.width),
- (i._height = n.height),
- (i._extension = e._formatToExtension(i.format)),
- (n.levelBuffers || i.buffer) &&
- (i._levelBuffers =
- n.levelBuffers ||
- e._createLevelBuffers(
- r instanceof Uint8Array ? r : i.buffer.uint8View,
- i.format,
- i.levels,
- 4,
- 4,
- i.width,
- i.height
- )),
- i
- );
- }
- return (
- ZN(e, t),
- (e.prototype.upload = function (t, e, r) {
- var n = t.gl;
- if (!t.context.extensions[this._extension])
- throw new Error(
- this._extension +
- ' textures are not supported on the current machine'
- );
- if (!this._levelBuffers) return !1;
- for (var i = 0, o = this.levels; i < o; i++) {
- var s = this._levelBuffers[i],
- a = s.levelID,
- u = s.levelWidth,
- c = s.levelHeight,
- h = s.levelBuffer;
- n.compressedTexImage2D(n.TEXTURE_2D, a, this.format, u, c, 0, h);
- }
- return !0;
- }),
- (e.prototype.onBlobLoaded = function () {
- this._levelBuffers = e._createLevelBuffers(
- this.buffer.uint8View,
- this.format,
- this.levels,
- 4,
- 4,
- this.width,
- this.height
- );
- }),
- (e._formatToExtension = function (t) {
- if (t >= 33776 && t <= 33779) return 's3tc';
- if (t >= 37488 && t <= 37497) return 'etc';
- if (t >= 35840 && t <= 35843) return 'pvrtc';
- if (t >= 36196) return 'etc1';
- if (t >= 35986 && t <= 34798) return 'atc';
- throw new Error('Invalid (compressed) texture format given!');
- }),
- (e._createLevelBuffers = function (t, e, r, n, i, o, s) {
- for (
- var a = new Array(r),
- u = t.byteOffset,
- c = o,
- h = s,
- l = (c + n - 1) & ~(n - 1),
- d = (h + i - 1) & ~(i - 1),
- f = l * d * YN[e],
- p = 0;
- p < r;
- p++
- )
- (a[p] = {
- levelID: p,
- levelWidth: r > 1 ? c : l,
- levelHeight: r > 1 ? h : d,
- levelBuffer: new Uint8Array(t.buffer, u, f),
- }),
- (u += f),
- (f =
- (l = ((c = c >> 1 || 1) + n - 1) & ~(n - 1)) *
- (d = ((h = h >> 1 || 1) + i - 1) & ~(i - 1)) *
- YN[e]);
- return a;
- }),
- e
- );
- })($N),
- ek = (function () {
- function t() {}
- return (
- (t.use = function (e, r) {
- var n = e.data;
- if (e.type === DN.TYPE.JSON && n && n.cacheID && n.textures) {
- for (
- var i = n.textures, o = void 0, s = void 0, a = 0, u = i.length;
- a < u;
- a++
- ) {
- var c = i[a],
- h = c.src,
- l = c.format;
- if ((l || (s = h), t.textureFormats[l])) {
- o = h;
- break;
- }
- }
- if (!(o = o || s))
- return void r(
- new Error(
- 'Cannot load compressed-textures in ' +
- e.url +
- ', make sure you provide a fallback'
- )
- );
- if (o === e.url)
- return void r(
- new Error(
- "URL of compressed texture cannot be the same as the manifest's URL"
- )
- );
- var d = {
- crossOrigin: e.crossOrigin,
- metadata: e.metadata.imageMetadata,
- parentResource: e,
- },
- f = GM.resolve(e.url.replace(this.baseUrl, ''), o),
- p = n.cacheID;
- this.add(p, f, d, function (t) {
- if (t.error) r(t.error);
- else {
- var n = t.texture,
- i = void 0 === n ? null : n,
- o = t.textures,
- s = void 0 === o ? {} : o;
- Object.assign(e, { texture: i, textures: s }), r();
- }
- });
- } else r();
- }),
- Object.defineProperty(t, 'textureExtensions', {
- get: function () {
- if (!t._textureExtensions) {
- var e = vA.ADAPTER.createCanvas().getContext('webgl');
- if (!e)
- return (
- console.warn(
- 'WebGL not available for compressed textures. Silently failing.'
- ),
- {}
- );
- var r = {
- s3tc: e.getExtension('WEBGL_compressed_texture_s3tc'),
- s3tc_sRGB: e.getExtension('WEBGL_compressed_texture_s3tc_srgb'),
- etc: e.getExtension('WEBGL_compressed_texture_etc'),
- etc1: e.getExtension('WEBGL_compressed_texture_etc1'),
- pvrtc:
- e.getExtension('WEBGL_compressed_texture_pvrtc') ||
- e.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc'),
- atc: e.getExtension('WEBGL_compressed_texture_atc'),
- astc: e.getExtension('WEBGL_compressed_texture_astc'),
- };
- t._textureExtensions = r;
- }
- return t._textureExtensions;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t, 'textureFormats', {
- get: function () {
- if (!t._textureFormats) {
- var e = t.textureExtensions;
- for (var r in ((t._textureFormats = {}), e)) {
- var n = e[r];
- n && Object.assign(t._textureFormats, Object.getPrototypeOf(n));
- }
- }
- return t._textureFormats;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.extension = HD.Loader),
- t
- );
- })();
- function rk(t, e, r) {
- var n = { textures: {}, texture: null };
- return e
- ? (e
- .map(function (t) {
- return new EL(
- new aL(
- t,
- Object.assign(
- { mipmap: BP.OFF, alphaMode: GP.NO_PREMULTIPLIED_ALPHA },
- r
- )
- )
- );
- })
- .forEach(function (e, r) {
- var i = e.baseTexture,
- o = t + '-' + (r + 1);
- aL.addToCache(i, o),
- EL.addToCache(e, o),
- 0 === r &&
- (aL.addToCache(i, t), EL.addToCache(e, t), (n.texture = e)),
- (n.textures[o] = e);
- }),
- n)
- : n;
- }
- var nk,
- ik,
- ok = 124,
- sk = 3,
- ak = 4,
- uk = 7,
- ck = 19,
- hk = 2,
- lk = 0,
- dk = 1,
- fk = 2,
- pk = 3;
- !(function (t) {
- (t[(t.DXGI_FORMAT_UNKNOWN = 0)] = 'DXGI_FORMAT_UNKNOWN'),
- (t[(t.DXGI_FORMAT_R32G32B32A32_TYPELESS = 1)] =
- 'DXGI_FORMAT_R32G32B32A32_TYPELESS'),
- (t[(t.DXGI_FORMAT_R32G32B32A32_FLOAT = 2)] =
- 'DXGI_FORMAT_R32G32B32A32_FLOAT'),
- (t[(t.DXGI_FORMAT_R32G32B32A32_UINT = 3)] =
- 'DXGI_FORMAT_R32G32B32A32_UINT'),
- (t[(t.DXGI_FORMAT_R32G32B32A32_SINT = 4)] =
- 'DXGI_FORMAT_R32G32B32A32_SINT'),
- (t[(t.DXGI_FORMAT_R32G32B32_TYPELESS = 5)] =
- 'DXGI_FORMAT_R32G32B32_TYPELESS'),
- (t[(t.DXGI_FORMAT_R32G32B32_FLOAT = 6)] = 'DXGI_FORMAT_R32G32B32_FLOAT'),
- (t[(t.DXGI_FORMAT_R32G32B32_UINT = 7)] = 'DXGI_FORMAT_R32G32B32_UINT'),
- (t[(t.DXGI_FORMAT_R32G32B32_SINT = 8)] = 'DXGI_FORMAT_R32G32B32_SINT'),
- (t[(t.DXGI_FORMAT_R16G16B16A16_TYPELESS = 9)] =
- 'DXGI_FORMAT_R16G16B16A16_TYPELESS'),
- (t[(t.DXGI_FORMAT_R16G16B16A16_FLOAT = 10)] =
- 'DXGI_FORMAT_R16G16B16A16_FLOAT'),
- (t[(t.DXGI_FORMAT_R16G16B16A16_UNORM = 11)] =
- 'DXGI_FORMAT_R16G16B16A16_UNORM'),
- (t[(t.DXGI_FORMAT_R16G16B16A16_UINT = 12)] =
- 'DXGI_FORMAT_R16G16B16A16_UINT'),
- (t[(t.DXGI_FORMAT_R16G16B16A16_SNORM = 13)] =
- 'DXGI_FORMAT_R16G16B16A16_SNORM'),
- (t[(t.DXGI_FORMAT_R16G16B16A16_SINT = 14)] =
- 'DXGI_FORMAT_R16G16B16A16_SINT'),
- (t[(t.DXGI_FORMAT_R32G32_TYPELESS = 15)] = 'DXGI_FORMAT_R32G32_TYPELESS'),
- (t[(t.DXGI_FORMAT_R32G32_FLOAT = 16)] = 'DXGI_FORMAT_R32G32_FLOAT'),
- (t[(t.DXGI_FORMAT_R32G32_UINT = 17)] = 'DXGI_FORMAT_R32G32_UINT'),
- (t[(t.DXGI_FORMAT_R32G32_SINT = 18)] = 'DXGI_FORMAT_R32G32_SINT'),
- (t[(t.DXGI_FORMAT_R32G8X24_TYPELESS = 19)] =
- 'DXGI_FORMAT_R32G8X24_TYPELESS'),
- (t[(t.DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20)] =
- 'DXGI_FORMAT_D32_FLOAT_S8X24_UINT'),
- (t[(t.DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21)] =
- 'DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS'),
- (t[(t.DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22)] =
- 'DXGI_FORMAT_X32_TYPELESS_G8X24_UINT'),
- (t[(t.DXGI_FORMAT_R10G10B10A2_TYPELESS = 23)] =
- 'DXGI_FORMAT_R10G10B10A2_TYPELESS'),
- (t[(t.DXGI_FORMAT_R10G10B10A2_UNORM = 24)] =
- 'DXGI_FORMAT_R10G10B10A2_UNORM'),
- (t[(t.DXGI_FORMAT_R10G10B10A2_UINT = 25)] =
- 'DXGI_FORMAT_R10G10B10A2_UINT'),
- (t[(t.DXGI_FORMAT_R11G11B10_FLOAT = 26)] = 'DXGI_FORMAT_R11G11B10_FLOAT'),
- (t[(t.DXGI_FORMAT_R8G8B8A8_TYPELESS = 27)] =
- 'DXGI_FORMAT_R8G8B8A8_TYPELESS'),
- (t[(t.DXGI_FORMAT_R8G8B8A8_UNORM = 28)] = 'DXGI_FORMAT_R8G8B8A8_UNORM'),
- (t[(t.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29)] =
- 'DXGI_FORMAT_R8G8B8A8_UNORM_SRGB'),
- (t[(t.DXGI_FORMAT_R8G8B8A8_UINT = 30)] = 'DXGI_FORMAT_R8G8B8A8_UINT'),
- (t[(t.DXGI_FORMAT_R8G8B8A8_SNORM = 31)] = 'DXGI_FORMAT_R8G8B8A8_SNORM'),
- (t[(t.DXGI_FORMAT_R8G8B8A8_SINT = 32)] = 'DXGI_FORMAT_R8G8B8A8_SINT'),
- (t[(t.DXGI_FORMAT_R16G16_TYPELESS = 33)] = 'DXGI_FORMAT_R16G16_TYPELESS'),
- (t[(t.DXGI_FORMAT_R16G16_FLOAT = 34)] = 'DXGI_FORMAT_R16G16_FLOAT'),
- (t[(t.DXGI_FORMAT_R16G16_UNORM = 35)] = 'DXGI_FORMAT_R16G16_UNORM'),
- (t[(t.DXGI_FORMAT_R16G16_UINT = 36)] = 'DXGI_FORMAT_R16G16_UINT'),
- (t[(t.DXGI_FORMAT_R16G16_SNORM = 37)] = 'DXGI_FORMAT_R16G16_SNORM'),
- (t[(t.DXGI_FORMAT_R16G16_SINT = 38)] = 'DXGI_FORMAT_R16G16_SINT'),
- (t[(t.DXGI_FORMAT_R32_TYPELESS = 39)] = 'DXGI_FORMAT_R32_TYPELESS'),
- (t[(t.DXGI_FORMAT_D32_FLOAT = 40)] = 'DXGI_FORMAT_D32_FLOAT'),
- (t[(t.DXGI_FORMAT_R32_FLOAT = 41)] = 'DXGI_FORMAT_R32_FLOAT'),
- (t[(t.DXGI_FORMAT_R32_UINT = 42)] = 'DXGI_FORMAT_R32_UINT'),
- (t[(t.DXGI_FORMAT_R32_SINT = 43)] = 'DXGI_FORMAT_R32_SINT'),
- (t[(t.DXGI_FORMAT_R24G8_TYPELESS = 44)] = 'DXGI_FORMAT_R24G8_TYPELESS'),
- (t[(t.DXGI_FORMAT_D24_UNORM_S8_UINT = 45)] =
- 'DXGI_FORMAT_D24_UNORM_S8_UINT'),
- (t[(t.DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46)] =
- 'DXGI_FORMAT_R24_UNORM_X8_TYPELESS'),
- (t[(t.DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47)] =
- 'DXGI_FORMAT_X24_TYPELESS_G8_UINT'),
- (t[(t.DXGI_FORMAT_R8G8_TYPELESS = 48)] = 'DXGI_FORMAT_R8G8_TYPELESS'),
- (t[(t.DXGI_FORMAT_R8G8_UNORM = 49)] = 'DXGI_FORMAT_R8G8_UNORM'),
- (t[(t.DXGI_FORMAT_R8G8_UINT = 50)] = 'DXGI_FORMAT_R8G8_UINT'),
- (t[(t.DXGI_FORMAT_R8G8_SNORM = 51)] = 'DXGI_FORMAT_R8G8_SNORM'),
- (t[(t.DXGI_FORMAT_R8G8_SINT = 52)] = 'DXGI_FORMAT_R8G8_SINT'),
- (t[(t.DXGI_FORMAT_R16_TYPELESS = 53)] = 'DXGI_FORMAT_R16_TYPELESS'),
- (t[(t.DXGI_FORMAT_R16_FLOAT = 54)] = 'DXGI_FORMAT_R16_FLOAT'),
- (t[(t.DXGI_FORMAT_D16_UNORM = 55)] = 'DXGI_FORMAT_D16_UNORM'),
- (t[(t.DXGI_FORMAT_R16_UNORM = 56)] = 'DXGI_FORMAT_R16_UNORM'),
- (t[(t.DXGI_FORMAT_R16_UINT = 57)] = 'DXGI_FORMAT_R16_UINT'),
- (t[(t.DXGI_FORMAT_R16_SNORM = 58)] = 'DXGI_FORMAT_R16_SNORM'),
- (t[(t.DXGI_FORMAT_R16_SINT = 59)] = 'DXGI_FORMAT_R16_SINT'),
- (t[(t.DXGI_FORMAT_R8_TYPELESS = 60)] = 'DXGI_FORMAT_R8_TYPELESS'),
- (t[(t.DXGI_FORMAT_R8_UNORM = 61)] = 'DXGI_FORMAT_R8_UNORM'),
- (t[(t.DXGI_FORMAT_R8_UINT = 62)] = 'DXGI_FORMAT_R8_UINT'),
- (t[(t.DXGI_FORMAT_R8_SNORM = 63)] = 'DXGI_FORMAT_R8_SNORM'),
- (t[(t.DXGI_FORMAT_R8_SINT = 64)] = 'DXGI_FORMAT_R8_SINT'),
- (t[(t.DXGI_FORMAT_A8_UNORM = 65)] = 'DXGI_FORMAT_A8_UNORM'),
- (t[(t.DXGI_FORMAT_R1_UNORM = 66)] = 'DXGI_FORMAT_R1_UNORM'),
- (t[(t.DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67)] =
- 'DXGI_FORMAT_R9G9B9E5_SHAREDEXP'),
- (t[(t.DXGI_FORMAT_R8G8_B8G8_UNORM = 68)] = 'DXGI_FORMAT_R8G8_B8G8_UNORM'),
- (t[(t.DXGI_FORMAT_G8R8_G8B8_UNORM = 69)] = 'DXGI_FORMAT_G8R8_G8B8_UNORM'),
- (t[(t.DXGI_FORMAT_BC1_TYPELESS = 70)] = 'DXGI_FORMAT_BC1_TYPELESS'),
- (t[(t.DXGI_FORMAT_BC1_UNORM = 71)] = 'DXGI_FORMAT_BC1_UNORM'),
- (t[(t.DXGI_FORMAT_BC1_UNORM_SRGB = 72)] = 'DXGI_FORMAT_BC1_UNORM_SRGB'),
- (t[(t.DXGI_FORMAT_BC2_TYPELESS = 73)] = 'DXGI_FORMAT_BC2_TYPELESS'),
- (t[(t.DXGI_FORMAT_BC2_UNORM = 74)] = 'DXGI_FORMAT_BC2_UNORM'),
- (t[(t.DXGI_FORMAT_BC2_UNORM_SRGB = 75)] = 'DXGI_FORMAT_BC2_UNORM_SRGB'),
- (t[(t.DXGI_FORMAT_BC3_TYPELESS = 76)] = 'DXGI_FORMAT_BC3_TYPELESS'),
- (t[(t.DXGI_FORMAT_BC3_UNORM = 77)] = 'DXGI_FORMAT_BC3_UNORM'),
- (t[(t.DXGI_FORMAT_BC3_UNORM_SRGB = 78)] = 'DXGI_FORMAT_BC3_UNORM_SRGB'),
- (t[(t.DXGI_FORMAT_BC4_TYPELESS = 79)] = 'DXGI_FORMAT_BC4_TYPELESS'),
- (t[(t.DXGI_FORMAT_BC4_UNORM = 80)] = 'DXGI_FORMAT_BC4_UNORM'),
- (t[(t.DXGI_FORMAT_BC4_SNORM = 81)] = 'DXGI_FORMAT_BC4_SNORM'),
- (t[(t.DXGI_FORMAT_BC5_TYPELESS = 82)] = 'DXGI_FORMAT_BC5_TYPELESS'),
- (t[(t.DXGI_FORMAT_BC5_UNORM = 83)] = 'DXGI_FORMAT_BC5_UNORM'),
- (t[(t.DXGI_FORMAT_BC5_SNORM = 84)] = 'DXGI_FORMAT_BC5_SNORM'),
- (t[(t.DXGI_FORMAT_B5G6R5_UNORM = 85)] = 'DXGI_FORMAT_B5G6R5_UNORM'),
- (t[(t.DXGI_FORMAT_B5G5R5A1_UNORM = 86)] = 'DXGI_FORMAT_B5G5R5A1_UNORM'),
- (t[(t.DXGI_FORMAT_B8G8R8A8_UNORM = 87)] = 'DXGI_FORMAT_B8G8R8A8_UNORM'),
- (t[(t.DXGI_FORMAT_B8G8R8X8_UNORM = 88)] = 'DXGI_FORMAT_B8G8R8X8_UNORM'),
- (t[(t.DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89)] =
- 'DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM'),
- (t[(t.DXGI_FORMAT_B8G8R8A8_TYPELESS = 90)] =
- 'DXGI_FORMAT_B8G8R8A8_TYPELESS'),
- (t[(t.DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91)] =
- 'DXGI_FORMAT_B8G8R8A8_UNORM_SRGB'),
- (t[(t.DXGI_FORMAT_B8G8R8X8_TYPELESS = 92)] =
- 'DXGI_FORMAT_B8G8R8X8_TYPELESS'),
- (t[(t.DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93)] =
- 'DXGI_FORMAT_B8G8R8X8_UNORM_SRGB'),
- (t[(t.DXGI_FORMAT_BC6H_TYPELESS = 94)] = 'DXGI_FORMAT_BC6H_TYPELESS'),
- (t[(t.DXGI_FORMAT_BC6H_UF16 = 95)] = 'DXGI_FORMAT_BC6H_UF16'),
- (t[(t.DXGI_FORMAT_BC6H_SF16 = 96)] = 'DXGI_FORMAT_BC6H_SF16'),
- (t[(t.DXGI_FORMAT_BC7_TYPELESS = 97)] = 'DXGI_FORMAT_BC7_TYPELESS'),
- (t[(t.DXGI_FORMAT_BC7_UNORM = 98)] = 'DXGI_FORMAT_BC7_UNORM'),
- (t[(t.DXGI_FORMAT_BC7_UNORM_SRGB = 99)] = 'DXGI_FORMAT_BC7_UNORM_SRGB'),
- (t[(t.DXGI_FORMAT_AYUV = 100)] = 'DXGI_FORMAT_AYUV'),
- (t[(t.DXGI_FORMAT_Y410 = 101)] = 'DXGI_FORMAT_Y410'),
- (t[(t.DXGI_FORMAT_Y416 = 102)] = 'DXGI_FORMAT_Y416'),
- (t[(t.DXGI_FORMAT_NV12 = 103)] = 'DXGI_FORMAT_NV12'),
- (t[(t.DXGI_FORMAT_P010 = 104)] = 'DXGI_FORMAT_P010'),
- (t[(t.DXGI_FORMAT_P016 = 105)] = 'DXGI_FORMAT_P016'),
- (t[(t.DXGI_FORMAT_420_OPAQUE = 106)] = 'DXGI_FORMAT_420_OPAQUE'),
- (t[(t.DXGI_FORMAT_YUY2 = 107)] = 'DXGI_FORMAT_YUY2'),
- (t[(t.DXGI_FORMAT_Y210 = 108)] = 'DXGI_FORMAT_Y210'),
- (t[(t.DXGI_FORMAT_Y216 = 109)] = 'DXGI_FORMAT_Y216'),
- (t[(t.DXGI_FORMAT_NV11 = 110)] = 'DXGI_FORMAT_NV11'),
- (t[(t.DXGI_FORMAT_AI44 = 111)] = 'DXGI_FORMAT_AI44'),
- (t[(t.DXGI_FORMAT_IA44 = 112)] = 'DXGI_FORMAT_IA44'),
- (t[(t.DXGI_FORMAT_P8 = 113)] = 'DXGI_FORMAT_P8'),
- (t[(t.DXGI_FORMAT_A8P8 = 114)] = 'DXGI_FORMAT_A8P8'),
- (t[(t.DXGI_FORMAT_B4G4R4A4_UNORM = 115)] = 'DXGI_FORMAT_B4G4R4A4_UNORM'),
- (t[(t.DXGI_FORMAT_P208 = 116)] = 'DXGI_FORMAT_P208'),
- (t[(t.DXGI_FORMAT_V208 = 117)] = 'DXGI_FORMAT_V208'),
- (t[(t.DXGI_FORMAT_V408 = 118)] = 'DXGI_FORMAT_V408'),
- (t[(t.DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE = 119)] =
- 'DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE'),
- (t[(t.DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE = 120)] =
- 'DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE'),
- (t[(t.DXGI_FORMAT_FORCE_UINT = 121)] = 'DXGI_FORMAT_FORCE_UINT');
- })(nk || (nk = {})),
- (function (t) {
- (t[(t.DDS_DIMENSION_TEXTURE1D = 2)] = 'DDS_DIMENSION_TEXTURE1D'),
- (t[(t.DDS_DIMENSION_TEXTURE2D = 3)] = 'DDS_DIMENSION_TEXTURE2D'),
- (t[(t.DDS_DIMENSION_TEXTURE3D = 6)] = 'DDS_DIMENSION_TEXTURE3D');
- })(ik || (ik = {}));
- var vk,
- mk,
- yk,
- gk =
- (((qN = {})[827611204] = HN.COMPRESSED_RGBA_S3TC_DXT1_EXT),
- (qN[861165636] = HN.COMPRESSED_RGBA_S3TC_DXT3_EXT),
- (qN[894720068] = HN.COMPRESSED_RGBA_S3TC_DXT5_EXT),
- qN),
- _k =
- (((QN = {})[nk.DXGI_FORMAT_BC1_TYPELESS] =
- HN.COMPRESSED_RGBA_S3TC_DXT1_EXT),
- (QN[nk.DXGI_FORMAT_BC1_UNORM] = HN.COMPRESSED_RGBA_S3TC_DXT1_EXT),
- (QN[nk.DXGI_FORMAT_BC2_TYPELESS] = HN.COMPRESSED_RGBA_S3TC_DXT3_EXT),
- (QN[nk.DXGI_FORMAT_BC2_UNORM] = HN.COMPRESSED_RGBA_S3TC_DXT3_EXT),
- (QN[nk.DXGI_FORMAT_BC3_TYPELESS] = HN.COMPRESSED_RGBA_S3TC_DXT5_EXT),
- (QN[nk.DXGI_FORMAT_BC3_UNORM] = HN.COMPRESSED_RGBA_S3TC_DXT5_EXT),
- (QN[nk.DXGI_FORMAT_BC1_UNORM_SRGB] =
- HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT),
- (QN[nk.DXGI_FORMAT_BC2_UNORM_SRGB] =
- HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT),
- (QN[nk.DXGI_FORMAT_BC3_UNORM_SRGB] =
- HN.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT),
- QN);
- var bk = [171, 75, 84, 88, 32, 49, 49, 187, 13, 10, 26, 10],
- Tk = 12,
- xk = 16,
- Ek = 24,
- Sk = 28,
- wk = 36,
- Rk = 40,
- Ck = 44,
- Pk = 48,
- Ak = 52,
- Ok = 56,
- Ik = 60,
- Mk =
- (((vk = {})[LP.UNSIGNED_BYTE] = 1),
- (vk[LP.UNSIGNED_SHORT] = 2),
- (vk[LP.INT] = 4),
- (vk[LP.UNSIGNED_INT] = 4),
- (vk[LP.FLOAT] = 4),
- (vk[LP.HALF_FLOAT] = 8),
- vk),
- Dk =
- (((mk = {})[MP.RGBA] = 4),
- (mk[MP.RGB] = 3),
- (mk[MP.RG] = 2),
- (mk[MP.RED] = 1),
- (mk[MP.LUMINANCE] = 1),
- (mk[MP.LUMINANCE_ALPHA] = 2),
- (mk[MP.ALPHA] = 1),
- mk),
- Lk =
- (((yk = {})[LP.UNSIGNED_SHORT_4_4_4_4] = 2),
- (yk[LP.UNSIGNED_SHORT_5_5_5_1] = 2),
- (yk[LP.UNSIGNED_SHORT_5_6_5] = 2),
- yk);
- function Fk(t, e, r) {
- void 0 === r && (r = !1);
- var n = new DataView(e);
- if (
- !(function (t, e) {
- for (var r = 0; r < bk.length; r++)
- if (e.getUint8(r) !== bk[r])
- return console.error(t + ' is not a valid *.ktx file!'), !1;
- return !0;
- })(t, n)
- )
- return null;
- var i = 67305985 === n.getUint32(Tk, !0),
- o = n.getUint32(xk, i),
- s = n.getUint32(Ek, i),
- a = n.getUint32(Sk, i),
- u = n.getUint32(wk, i),
- c = n.getUint32(Rk, i) || 1,
- h = n.getUint32(Ck, i) || 1,
- l = n.getUint32(Pk, i) || 1,
- d = n.getUint32(Ak, i),
- f = n.getUint32(Ok, i),
- p = n.getUint32(Ik, i);
- if (0 === c || 1 !== h) throw new Error('Only 2D textures are supported');
- if (1 !== d)
- throw new Error('CubeTextures are not supported by KTXLoader yet!');
- if (1 !== l) throw new Error('WebGL does not support array textures');
- var v,
- m = (u + 3) & -4,
- y = (c + 3) & -4,
- g = new Array(l),
- _ = u * c;
- if (
- (0 === o && (_ = m * y),
- void 0 === (v = 0 !== o ? (Mk[o] ? Mk[o] * Dk[s] : Lk[o]) : YN[a]))
- )
- throw new Error(
- 'Unable to resolve the pixel format stored in the *.ktx file!'
- );
- for (
- var b = r
- ? (function (t, e, r) {
- var n = new Map(),
- i = 0;
- for (; i < e; ) {
- var o = t.getUint32(64 + i, r),
- s = 64 + i + 4,
- a = 3 - ((o + 3) % 4);
- if (0 === o || o > e - i) {
- console.error('KTXLoader: keyAndValueByteSize out of bounds');
- break;
- }
- for (var u = 0; u < o && 0 !== t.getUint8(s + u); u++);
- if (-1 === u) {
- console.error(
- 'KTXLoader: Failed to find null byte terminating kvData key'
- );
- break;
- }
- var c = new TextDecoder().decode(
- new Uint8Array(t.buffer, s, u)
- ),
- h = new DataView(t.buffer, s + u + 1, o - u - 1);
- n.set(c, h), (i += 4 + o + a);
- }
- return n;
- })(n, p, i)
- : null,
- T = _ * v,
- x = u,
- E = c,
- S = m,
- w = y,
- R = 64 + p,
- C = 0;
- C < f;
- C++
- ) {
- for (var P = n.getUint32(R, i), A = R + 4, O = 0; O < l; O++) {
- var I = g[O];
- I || (I = g[O] = new Array(f)),
- (I[C] = {
- levelID: C,
- levelWidth: f > 1 || 0 !== o ? x : S,
- levelHeight: f > 1 || 0 !== o ? E : w,
- levelBuffer: new Uint8Array(e, A, T),
- }),
- (A += T);
- }
- (R = (R += P + 4) % 4 != 0 ? R + 4 - (R % 4) : R),
- (T =
- (S = ((x = x >> 1 || 1) + 4 - 1) & -4) *
- (w = ((E = E >> 1 || 1) + 4 - 1) & -4) *
- v);
- }
- return 0 !== o
- ? {
- uncompressed: g.map(function (t) {
- var e = t[0].levelBuffer,
- r = !1;
- return (
- o === LP.FLOAT
- ? (e = new Float32Array(
- t[0].levelBuffer.buffer,
- t[0].levelBuffer.byteOffset,
- t[0].levelBuffer.byteLength / 4
- ))
- : o === LP.UNSIGNED_INT
- ? ((r = !0),
- (e = new Uint32Array(
- t[0].levelBuffer.buffer,
- t[0].levelBuffer.byteOffset,
- t[0].levelBuffer.byteLength / 4
- )))
- : o === LP.INT &&
- ((r = !0),
- (e = new Int32Array(
- t[0].levelBuffer.buffer,
- t[0].levelBuffer.byteOffset,
- t[0].levelBuffer.byteLength / 4
- ))),
- {
- resource: new oL(e, {
- width: t[0].levelWidth,
- height: t[0].levelHeight,
- }),
- type: o,
- format: r ? Nk(s) : s,
- }
- );
- }),
- kvData: b,
- }
- : {
- compressed: g.map(function (t) {
- return new tk(null, {
- format: a,
- width: u,
- height: c,
- levels: f,
- levelBuffers: t,
- });
- }),
- kvData: b,
- };
- }
- function Nk(t) {
- switch (t) {
- case MP.RGBA:
- return MP.RGBA_INTEGER;
- case MP.RGB:
- return MP.RGB_INTEGER;
- case MP.RG:
- return MP.RG_INTEGER;
- case MP.RED:
- return MP.RED_INTEGER;
- default:
- return t;
- }
- }
- DN.setExtensionXhrType('dds', DN.XHR_RESPONSE_TYPE.BUFFER);
- var kk = (function () {
- function t() {}
- return (
- (t.use = function (t, e) {
- if ('dds' === t.extension && t.data)
- try {
- Object.assign(
- t,
- rk(
- t.name || t.url,
- (function (t) {
- var e = new Uint32Array(t);
- if (542327876 !== e[0])
- throw new Error('Invalid DDS file magic word');
- var r = new Uint32Array(
- t,
- 0,
- ok / Uint32Array.BYTES_PER_ELEMENT
- ),
- n = r[sk],
- i = r[ak],
- o = r[uk],
- s = new Uint32Array(
- t,
- ck * Uint32Array.BYTES_PER_ELEMENT,
- 32 / Uint32Array.BYTES_PER_ELEMENT
- ),
- a = s[1];
- if (4 & a) {
- var u = s[hk];
- if (808540228 !== u) {
- var c = gk[u],
- h = new Uint8Array(t, 128);
- return [
- new tk(h, {
- format: c,
- width: i,
- height: n,
- levels: o,
- }),
- ];
- }
- var l = new Uint32Array(
- e.buffer,
- 128,
- 20 / Uint32Array.BYTES_PER_ELEMENT
- ),
- d = l[lk],
- f = l[dk],
- p = l[fk],
- v = l[pk],
- m = _k[d];
- if (void 0 === m)
- throw new Error(
- 'DDSParser cannot parse texture data with DXGI format ' +
- d
- );
- if (4 === p)
- throw new Error(
- 'DDSParser does not support cubemap textures'
- );
- if (f === ik.DDS_DIMENSION_TEXTURE3D)
- throw new Error(
- 'DDSParser does not supported 3D texture data'
- );
- var y = new Array();
- if (1 === v) y.push(new Uint8Array(t, 148));
- else {
- for (
- var g = YN[m], _ = 0, b = i, T = n, x = 0;
- x < o;
- x++
- )
- (_ +=
- Math.max(1, (b + 3) & -4) *
- Math.max(1, (T + 3) & -4) *
- g),
- (b >>>= 1),
- (T >>>= 1);
- var E = 148;
- for (x = 0; x < v; x++)
- y.push(new Uint8Array(t, E, _)), (E += _);
- }
- return y.map(function (t) {
- return new tk(t, {
- format: m,
- width: i,
- height: n,
- levels: o,
- });
- });
- }
- if (64 & a)
- throw new Error(
- 'DDSParser does not support uncompressed texture data.'
- );
- if (512 & a)
- throw new Error(
- 'DDSParser does not supported YUV uncompressed texture data.'
- );
- if (131072 & a)
- throw new Error(
- 'DDSParser does not support single-channel (lumninance) texture data!'
- );
- if (2 & a)
- throw new Error(
- 'DDSParser does not support single-channel (alpha) texture data!'
- );
- throw new Error(
- 'DDSParser failed to load a texture file due to an unknown reason!'
- );
- })(t.data),
- t.metadata
- )
- );
- } catch (t) {
- return void e(t);
- }
- e();
- }),
- (t.extension = HD.Loader),
- t
- );
- })();
- DN.setExtensionXhrType('ktx', DN.XHR_RESPONSE_TYPE.BUFFER);
- var Bk = (function () {
- function t() {}
- return (
- (t.use = function (t, e) {
- if ('ktx' === t.extension && t.data)
- try {
- var r = t.name || t.url,
- n = Fk(r, t.data, this.loadKeyValueData),
- i = n.compressed,
- o = n.uncompressed,
- s = n.kvData;
- if (i) {
- var a = rk(r, i, t.metadata);
- if (s && a.textures)
- for (var u in a.textures)
- a.textures[u].baseTexture.ktxKeyValueData = s;
- Object.assign(t, a);
- } else if (o) {
- var c = {};
- o.forEach(function (t, e) {
- var n = new EL(
- new aL(t.resource, {
- mipmap: BP.OFF,
- alphaMode: GP.NO_PREMULTIPLIED_ALPHA,
- type: t.type,
- format: t.format,
- })
- ),
- i = r + '-' + (e + 1);
- s && (n.baseTexture.ktxKeyValueData = s),
- aL.addToCache(n.baseTexture, i),
- EL.addToCache(n, i),
- 0 === e &&
- ((c[r] = n),
- aL.addToCache(n.baseTexture, r),
- EL.addToCache(n, r)),
- (c[i] = n);
- }),
- Object.assign(t, { textures: c });
- }
- } catch (t) {
- return void e(t);
- }
- e();
- }),
- (t.extension = HD.Loader),
- (t.loadKeyValueData = !1),
- t
- );
- })(),
- Gk = function (t, e) {
- return (
- (Gk =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- Gk(t, e)
- );
- };
- function Uk(t, e) {
- function r() {
- this.constructor = t;
- }
- Gk(t, e),
- (t.prototype =
- null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
- }
- var jk,
- Xk,
- Vk = (function (t) {
- function e(e, r, n, i) {
- void 0 === e && (e = 1500),
- void 0 === n && (n = 16384),
- void 0 === i && (i = !1);
- var o = t.call(this) || this;
- return (
- n > 16384 && (n = 16384),
- (o._properties = [!1, !0, !1, !1, !1]),
- (o._maxSize = e),
- (o._batchSize = n),
- (o._buffers = null),
- (o._bufferUpdateIDs = []),
- (o._updateID = 0),
- (o.interactiveChildren = !1),
- (o.blendMode = OP.NORMAL),
- (o.autoResize = i),
- (o.roundPixels = !0),
- (o.baseTexture = null),
- o.setProperties(r),
- (o._tint = 0),
- (o.tintRgb = new Float32Array(4)),
- (o.tint = 16777215),
- o
- );
- }
- return (
- Uk(e, t),
- (e.prototype.setProperties = function (t) {
- t &&
- ((this._properties[0] =
- 'vertices' in t || 'scale' in t
- ? !!t.vertices || !!t.scale
- : this._properties[0]),
- (this._properties[1] =
- 'position' in t ? !!t.position : this._properties[1]),
- (this._properties[2] =
- 'rotation' in t ? !!t.rotation : this._properties[2]),
- (this._properties[3] = 'uvs' in t ? !!t.uvs : this._properties[3]),
- (this._properties[4] =
- 'tint' in t || 'alpha' in t
- ? !!t.tint || !!t.alpha
- : this._properties[4]));
- }),
- (e.prototype.updateTransform = function () {
- this.displayObjectUpdateTransform();
- }),
- Object.defineProperty(e.prototype, 'tint', {
- get: function () {
- return this._tint;
- },
- set: function (t) {
- (this._tint = t), HM(t, this.tintRgb);
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype.render = function (t) {
- var e = this;
- this.visible &&
- !(this.worldAlpha <= 0) &&
- this.children.length &&
- this.renderable &&
- (this.baseTexture ||
- ((this.baseTexture = this.children[0]._texture.baseTexture),
- this.baseTexture.valid ||
- this.baseTexture.once('update', function () {
- return e.onChildrenChange(0);
- })),
- t.batch.setObjectRenderer(t.plugins.particle),
- t.plugins.particle.render(this));
- }),
- (e.prototype.onChildrenChange = function (t) {
- for (
- var e = Math.floor(t / this._batchSize);
- this._bufferUpdateIDs.length < e;
- )
- this._bufferUpdateIDs.push(0);
- this._bufferUpdateIDs[e] = ++this._updateID;
- }),
- (e.prototype.dispose = function () {
- if (this._buffers) {
- for (var t = 0; t < this._buffers.length; ++t)
- this._buffers[t].destroy();
- this._buffers = null;
- }
- }),
- (e.prototype.destroy = function (e) {
- t.prototype.destroy.call(this, e),
- this.dispose(),
- (this._properties = null),
- (this._buffers = null),
- (this._bufferUpdateIDs = null);
- }),
- e
- );
- })(VD),
- Hk = (function () {
- function t(t, e, r) {
- (this.geometry = new DL()),
- (this.indexBuffer = null),
- (this.size = r),
- (this.dynamicProperties = []),
- (this.staticProperties = []);
- for (var n = 0; n < t.length; ++n) {
- var i = t[n];
- (i = {
- attributeName: i.attributeName,
- size: i.size,
- uploadFunction: i.uploadFunction,
- type: i.type || LP.FLOAT,
- offset: i.offset,
- }),
- e[n]
- ? this.dynamicProperties.push(i)
- : this.staticProperties.push(i);
- }
- (this.staticStride = 0),
- (this.staticBuffer = null),
- (this.staticData = null),
- (this.staticDataUint32 = null),
- (this.dynamicStride = 0),
- (this.dynamicBuffer = null),
- (this.dynamicData = null),
- (this.dynamicDataUint32 = null),
- (this._updateID = 0),
- this.initBuffers();
- }
- return (
- (t.prototype.initBuffers = function () {
- var t = this.geometry,
- e = 0;
- (this.indexBuffer = new PL(
- (function (t, e) {
- void 0 === e && (e = null);
- var r = 6 * t;
- if ((e = e || new Uint16Array(r)).length !== r)
- throw new Error(
- 'Out buffer length is incorrect, got ' +
- e.length +
- ' and expected ' +
- r
- );
- for (var n = 0, i = 0; n < r; n += 6, i += 4)
- (e[n + 0] = i + 0),
- (e[n + 1] = i + 1),
- (e[n + 2] = i + 2),
- (e[n + 3] = i + 0),
- (e[n + 4] = i + 2),
- (e[n + 5] = i + 3);
- return e;
- })(this.size),
- !0,
- !0
- )),
- t.addIndex(this.indexBuffer),
- (this.dynamicStride = 0);
- for (var r = 0; r < this.dynamicProperties.length; ++r) {
- ((s = this.dynamicProperties[r]).offset = e),
- (e += s.size),
- (this.dynamicStride += s.size);
- }
- var n = new ArrayBuffer(this.size * this.dynamicStride * 4 * 4);
- (this.dynamicData = new Float32Array(n)),
- (this.dynamicDataUint32 = new Uint32Array(n)),
- (this.dynamicBuffer = new PL(this.dynamicData, !1, !1));
- var i = 0;
- this.staticStride = 0;
- for (r = 0; r < this.staticProperties.length; ++r) {
- ((s = this.staticProperties[r]).offset = i),
- (i += s.size),
- (this.staticStride += s.size);
- }
- var o = new ArrayBuffer(this.size * this.staticStride * 4 * 4);
- (this.staticData = new Float32Array(o)),
- (this.staticDataUint32 = new Uint32Array(o)),
- (this.staticBuffer = new PL(this.staticData, !0, !1));
- for (r = 0; r < this.dynamicProperties.length; ++r) {
- var s = this.dynamicProperties[r];
- t.addAttribute(
- s.attributeName,
- this.dynamicBuffer,
- 0,
- s.type === LP.UNSIGNED_BYTE,
- s.type,
- 4 * this.dynamicStride,
- 4 * s.offset
- );
- }
- for (r = 0; r < this.staticProperties.length; ++r) {
- s = this.staticProperties[r];
- t.addAttribute(
- s.attributeName,
- this.staticBuffer,
- 0,
- s.type === LP.UNSIGNED_BYTE,
- s.type,
- 4 * this.staticStride,
- 4 * s.offset
- );
- }
- }),
- (t.prototype.uploadDynamic = function (t, e, r) {
- for (var n = 0; n < this.dynamicProperties.length; n++) {
- var i = this.dynamicProperties[n];
- i.uploadFunction(
- t,
- e,
- r,
- i.type === LP.UNSIGNED_BYTE
- ? this.dynamicDataUint32
- : this.dynamicData,
- this.dynamicStride,
- i.offset
- );
- }
- this.dynamicBuffer._updateID++;
- }),
- (t.prototype.uploadStatic = function (t, e, r) {
- for (var n = 0; n < this.staticProperties.length; n++) {
- var i = this.staticProperties[n];
- i.uploadFunction(
- t,
- e,
- r,
- i.type === LP.UNSIGNED_BYTE
- ? this.staticDataUint32
- : this.staticData,
- this.staticStride,
- i.offset
- );
- }
- this.staticBuffer._updateID++;
- }),
- (t.prototype.destroy = function () {
- (this.indexBuffer = null),
- (this.dynamicProperties = null),
- (this.dynamicBuffer = null),
- (this.dynamicData = null),
- (this.dynamicDataUint32 = null),
- (this.staticProperties = null),
- (this.staticBuffer = null),
- (this.staticData = null),
- (this.staticDataUint32 = null),
- this.geometry.destroy();
- }),
- t
- );
- })(),
- Wk = (function (t) {
- function e(e) {
- var r = t.call(this, e) || this;
- return (
- (r.shader = null),
- (r.properties = null),
- (r.tempMatrix = new CD()),
- (r.properties = [
- {
- attributeName: 'aVertexPosition',
- size: 2,
- uploadFunction: r.uploadVertices,
- offset: 0,
- },
- {
- attributeName: 'aPositionCoord',
- size: 2,
- uploadFunction: r.uploadPosition,
- offset: 0,
- },
- {
- attributeName: 'aRotation',
- size: 1,
- uploadFunction: r.uploadRotation,
- offset: 0,
- },
- {
- attributeName: 'aTextureCoord',
- size: 2,
- uploadFunction: r.uploadUvs,
- offset: 0,
- },
- {
- attributeName: 'aColor',
- size: 1,
- type: LP.UNSIGNED_BYTE,
- uploadFunction: r.uploadTint,
- offset: 0,
- },
- ]),
- (r.shader = TF.from(
- 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nattribute vec2 aPositionCoord;\nattribute float aRotation;\n\nuniform mat3 translationMatrix;\nuniform vec4 uColor;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void){\n float x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);\n float y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);\n\n vec2 v = vec2(x, y);\n v = v + aPositionCoord;\n\n gl_Position = vec4((translationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vColor = aColor * uColor;\n}\n',
- 'varying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void){\n vec4 color = texture2D(uSampler, vTextureCoord) * vColor;\n gl_FragColor = color;\n}',
- {}
- )),
- (r.state = xF.for2d()),
- r
- );
- }
- return (
- Uk(e, t),
- (e.prototype.render = function (t) {
- var e = t.children,
- r = t._maxSize,
- n = t._batchSize,
- i = this.renderer,
- o = e.length;
- if (0 !== o) {
- o > r && !t.autoResize && (o = r);
- var s = t._buffers;
- s || (s = t._buffers = this.generateBuffers(t));
- var a = e[0]._texture.baseTexture,
- u = a.alphaMode > 0;
- (this.state.blendMode = JM(t.blendMode, u)),
- i.state.set(this.state);
- var c,
- h,
- l,
- d,
- f = i.gl,
- p = t.worldTransform.copyTo(this.tempMatrix);
- p.prepend(i.globalUniforms.uniforms.projectionMatrix),
- (this.shader.uniforms.translationMatrix = p.toArray(!0)),
- (this.shader.uniforms.uColor =
- ((c = t.tintRgb),
- (h = t.worldAlpha),
- (l = this.shader.uniforms.uColor),
- (d = u),
- (l = l || new Float32Array(4)),
- d || void 0 === d
- ? ((l[0] = c[0] * h), (l[1] = c[1] * h), (l[2] = c[2] * h))
- : ((l[0] = c[0]), (l[1] = c[1]), (l[2] = c[2])),
- (l[3] = h),
- l)),
- (this.shader.uniforms.uSampler = a),
- this.renderer.shader.bind(this.shader);
- for (var v = !1, m = 0, y = 0; m < o; m += n, y += 1) {
- var g = o - m;
- g > n && (g = n),
- y >= s.length && s.push(this._generateOneMoreBuffer(t));
- var _ = s[y];
- _.uploadDynamic(e, m, g);
- var b = t._bufferUpdateIDs[y] || 0;
- (v = v || _._updateID < b) &&
- ((_._updateID = t._updateID), _.uploadStatic(e, m, g)),
- i.geometry.bind(_.geometry),
- f.drawElements(f.TRIANGLES, 6 * g, f.UNSIGNED_SHORT, 0);
- }
- }
- }),
- (e.prototype.generateBuffers = function (t) {
- for (
- var e = [],
- r = t._maxSize,
- n = t._batchSize,
- i = t._properties,
- o = 0;
- o < r;
- o += n
- )
- e.push(new Hk(this.properties, i, n));
- return e;
- }),
- (e.prototype._generateOneMoreBuffer = function (t) {
- var e = t._batchSize,
- r = t._properties;
- return new Hk(this.properties, r, e);
- }),
- (e.prototype.uploadVertices = function (t, e, r, n, i, o) {
- for (var s = 0, a = 0, u = 0, c = 0, h = 0; h < r; ++h) {
- var l = t[e + h],
- d = l._texture,
- f = l.scale.x,
- p = l.scale.y,
- v = d.trim,
- m = d.orig;
- v
- ? ((s = (a = v.x - l.anchor.x * m.width) + v.width),
- (u = (c = v.y - l.anchor.y * m.height) + v.height))
- : ((s = m.width * (1 - l.anchor.x)),
- (a = m.width * -l.anchor.x),
- (u = m.height * (1 - l.anchor.y)),
- (c = m.height * -l.anchor.y)),
- (n[o] = a * f),
- (n[o + 1] = c * p),
- (n[o + i] = s * f),
- (n[o + i + 1] = c * p),
- (n[o + 2 * i] = s * f),
- (n[o + 2 * i + 1] = u * p),
- (n[o + 3 * i] = a * f),
- (n[o + 3 * i + 1] = u * p),
- (o += 4 * i);
- }
- }),
- (e.prototype.uploadPosition = function (t, e, r, n, i, o) {
- for (var s = 0; s < r; s++) {
- var a = t[e + s].position;
- (n[o] = a.x),
- (n[o + 1] = a.y),
- (n[o + i] = a.x),
- (n[o + i + 1] = a.y),
- (n[o + 2 * i] = a.x),
- (n[o + 2 * i + 1] = a.y),
- (n[o + 3 * i] = a.x),
- (n[o + 3 * i + 1] = a.y),
- (o += 4 * i);
- }
- }),
- (e.prototype.uploadRotation = function (t, e, r, n, i, o) {
- for (var s = 0; s < r; s++) {
- var a = t[e + s].rotation;
- (n[o] = a),
- (n[o + i] = a),
- (n[o + 2 * i] = a),
- (n[o + 3 * i] = a),
- (o += 4 * i);
- }
- }),
- (e.prototype.uploadUvs = function (t, e, r, n, i, o) {
- for (var s = 0; s < r; ++s) {
- var a = t[e + s]._texture._uvs;
- a
- ? ((n[o] = a.x0),
- (n[o + 1] = a.y0),
- (n[o + i] = a.x1),
- (n[o + i + 1] = a.y1),
- (n[o + 2 * i] = a.x2),
- (n[o + 2 * i + 1] = a.y2),
- (n[o + 3 * i] = a.x3),
- (n[o + 3 * i + 1] = a.y3),
- (o += 4 * i))
- : ((n[o] = 0),
- (n[o + 1] = 0),
- (n[o + i] = 0),
- (n[o + i + 1] = 0),
- (n[o + 2 * i] = 0),
- (n[o + 2 * i + 1] = 0),
- (n[o + 3 * i] = 0),
- (n[o + 3 * i + 1] = 0),
- (o += 4 * i));
- }
- }),
- (e.prototype.uploadTint = function (t, e, r, n, i, o) {
- for (var s = 0; s < r; ++s) {
- var a = t[e + s],
- u = a._texture.baseTexture.alphaMode > 0,
- c = a.alpha,
- h =
- c < 1 && u ? KM(a._tintRGB, c) : a._tintRGB + ((255 * c) << 24);
- (n[o] = h),
- (n[o + i] = h),
- (n[o + 2 * i] = h),
- (n[o + 3 * i] = h),
- (o += 4 * i);
- }
- }),
- (e.prototype.destroy = function () {
- t.prototype.destroy.call(this),
- this.shader && (this.shader.destroy(), (this.shader = null)),
- (this.tempMatrix = null);
- }),
- (e.extension = { name: 'particle', type: HD.RendererPlugin }),
- e
- );
- })(XL);
- !(function (t) {
- (t.MITER = 'miter'), (t.BEVEL = 'bevel'), (t.ROUND = 'round');
- })(jk || (jk = {})),
- (function (t) {
- (t.BUTT = 'butt'), (t.ROUND = 'round'), (t.SQUARE = 'square');
- })(Xk || (Xk = {}));
- var Yk = {
- adaptive: !0,
- maxLength: 10,
- minSegments: 8,
- maxSegments: 2048,
- epsilon: 1e-4,
- _segmentsCount: function (t, e) {
- if ((void 0 === e && (e = 20), !this.adaptive || !t || isNaN(t)))
- return e;
- var r = Math.ceil(t / this.maxLength);
- return (
- r < this.minSegments
- ? (r = this.minSegments)
- : r > this.maxSegments && (r = this.maxSegments),
- r
- );
- },
- },
- zk = (function () {
- function t() {
- (this.color = 16777215),
- (this.alpha = 1),
- (this.texture = EL.WHITE),
- (this.matrix = null),
- (this.visible = !1),
- this.reset();
- }
- return (
- (t.prototype.clone = function () {
- var e = new t();
- return (
- (e.color = this.color),
- (e.alpha = this.alpha),
- (e.texture = this.texture),
- (e.matrix = this.matrix),
- (e.visible = this.visible),
- e
- );
- }),
- (t.prototype.reset = function () {
- (this.color = 16777215),
- (this.alpha = 1),
- (this.texture = EL.WHITE),
- (this.matrix = null),
- (this.visible = !1);
- }),
- (t.prototype.destroy = function () {
- (this.texture = null), (this.matrix = null);
- }),
- t
- );
- })(),
- Zk = function (t, e) {
- return (
- (Zk =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- Zk(t, e)
- );
- };
- function Jk(t, e) {
- function r() {
- this.constructor = t;
- }
- Zk(t, e),
- (t.prototype =
- null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
- }
- function Kk(t, e) {
- var r, n;
- void 0 === e && (e = !1);
- var i = t.length;
- if (!(i < 6)) {
- for (var o = 0, s = 0, a = t[i - 2], u = t[i - 1]; s < i; s += 2) {
- var c = t[s],
- h = t[s + 1];
- (o += (c - a) * (h + u)), (a = c), (u = h);
- }
- if ((!e && o > 0) || (e && o <= 0)) {
- var l = i / 2;
- for (s = l + (l % 2); s < i; s += 2) {
- var d = i - s - 2,
- f = i - s - 1,
- p = s,
- v = s + 1;
- (r = [t[p], t[d]]),
- (t[d] = r[0]),
- (t[p] = r[1]),
- (n = [t[v], t[f]]),
- (t[f] = n[0]),
- (t[v] = n[1]);
- }
- }
- }
- }
- var qk = {
- build: function (t) {
- t.points = t.shape.points.slice();
- },
- triangulate: function (t, e) {
- var r = t.points,
- n = t.holes,
- i = e.points,
- o = e.indices;
- if (r.length >= 6) {
- Kk(r, !1);
- for (var s = [], a = 0; a < n.length; a++) {
- var u = n[a];
- Kk(u.points, !0), s.push(r.length / 2), (r = r.concat(u.points));
- }
- var c = WA(r, s, 2);
- if (!c) return;
- var h = i.length / 2;
- for (a = 0; a < c.length; a += 3)
- o.push(c[a] + h), o.push(c[a + 1] + h), o.push(c[a + 2] + h);
- for (a = 0; a < r.length; a++) i.push(r[a]);
- }
- },
- },
- Qk = {
- build: function (t) {
- var e,
- r,
- n,
- i,
- o,
- s,
- a = t.points;
- if (t.type === vD.CIRC) {
- var u = t.shape;
- (e = u.x), (r = u.y), (o = s = u.radius), (n = i = 0);
- } else if (t.type === vD.ELIP) {
- var c = t.shape;
- (e = c.x), (r = c.y), (o = c.width), (s = c.height), (n = i = 0);
- } else {
- var h = t.shape,
- l = h.width / 2,
- d = h.height / 2;
- (e = h.x + l),
- (r = h.y + d),
- (n = l - (o = s = Math.max(0, Math.min(h.radius, Math.min(l, d))))),
- (i = d - s);
- }
- if (o >= 0 && s >= 0 && n >= 0 && i >= 0) {
- var f = Math.ceil(2.3 * Math.sqrt(o + s)),
- p = 8 * f + (n ? 4 : 0) + (i ? 4 : 0);
- if (((a.length = p), 0 !== p)) {
- if (0 === f)
- return (
- (a.length = 8),
- (a[0] = a[6] = e + n),
- (a[1] = a[3] = r + i),
- (a[2] = a[4] = e - n),
- void (a[5] = a[7] = r - i)
- );
- var v = 0,
- m = 4 * f + (n ? 2 : 0) + 2,
- y = m,
- g = p,
- _ = e + (w = n + o),
- b = e - w,
- T = r + (R = i);
- if (((a[v++] = _), (a[v++] = T), (a[--m] = T), (a[--m] = b), i)) {
- var x = r - R;
- (a[y++] = b), (a[y++] = x), (a[--g] = x), (a[--g] = _);
- }
- for (var E = 1; E < f; E++) {
- var S = (Math.PI / 2) * (E / f);
- (_ = e + (w = n + Math.cos(S) * o)),
- (b = e - w),
- (T = r + (R = i + Math.sin(S) * s)),
- (x = r - R);
- (a[v++] = _),
- (a[v++] = T),
- (a[--m] = T),
- (a[--m] = b),
- (a[y++] = b),
- (a[y++] = x),
- (a[--g] = x),
- (a[--g] = _);
- }
- var w, R;
- (_ = e + (w = n)), (b = e - w), (T = r + (R = i + s)), (x = r - R);
- (a[v++] = _),
- (a[v++] = T),
- (a[--g] = x),
- (a[--g] = _),
- n && ((a[v++] = b), (a[v++] = T), (a[--g] = x), (a[--g] = b));
- }
- } else a.length = 0;
- },
- triangulate: function (t, e) {
- var r = t.points,
- n = e.points,
- i = e.indices;
- if (0 !== r.length) {
- var o,
- s,
- a = n.length / 2,
- u = a;
- if (t.type !== vD.RREC) {
- var c = t.shape;
- (o = c.x), (s = c.y);
- } else {
- var h = t.shape;
- (o = h.x + h.width / 2), (s = h.y + h.height / 2);
- }
- var l = t.matrix;
- n.push(
- t.matrix ? l.a * o + l.c * s + l.tx : o,
- t.matrix ? l.b * o + l.d * s + l.ty : s
- ),
- a++,
- n.push(r[0], r[1]);
- for (var d = 2; d < r.length; d += 2)
- n.push(r[d], r[d + 1]), i.push(a++, u, a);
- i.push(u + 1, u, a);
- }
- },
- };
- function $k(t, e, r) {
- return t + (e - t) * r;
- }
- function tB(t, e, r, n, i, o, s) {
- void 0 === s && (s = []);
- for (
- var a = s, u = 0, c = 0, h = 0, l = 0, d = 0, f = 0, p = 0, v = 0;
- p <= 20;
- ++p
- )
- (u = $k(t, r, (v = p / 20))),
- (c = $k(e, n, v)),
- (h = $k(r, i, v)),
- (l = $k(n, o, v)),
- (d = $k(u, h, v)),
- (f = $k(c, l, v)),
- (0 === p && a[a.length - 2] === d && a[a.length - 1] === f) ||
- a.push(d, f);
- return a;
- }
- var eB = {
- build: function (t) {
- if (_B.nextRoundedRectBehavior) Qk.build(t);
- else {
- var e = t.shape,
- r = t.points,
- n = e.x,
- i = e.y,
- o = e.width,
- s = e.height,
- a = Math.max(0, Math.min(e.radius, Math.min(o, s) / 2));
- (r.length = 0),
- a
- ? (tB(n, i + a, n, i, n + a, i, r),
- tB(n + o - a, i, n + o, i, n + o, i + a, r),
- tB(n + o, i + s - a, n + o, i + s, n + o - a, i + s, r),
- tB(n + a, i + s, n, i + s, n, i + s - a, r))
- : r.push(n, i, n + o, i, n + o, i + s, n, i + s);
- }
- },
- triangulate: function (t, e) {
- if (_B.nextRoundedRectBehavior) Qk.triangulate(t, e);
- else {
- for (
- var r = t.points,
- n = e.points,
- i = e.indices,
- o = n.length / 2,
- s = WA(r, null, 2),
- a = 0,
- u = s.length;
- a < u;
- a += 3
- )
- i.push(s[a] + o), i.push(s[a + 1] + o), i.push(s[a + 2] + o);
- for (a = 0, u = r.length; a < u; a++) n.push(r[a], r[++a]);
- }
- },
- };
- function rB(t, e, r, n, i, o, s, a) {
- var u, c;
- s ? ((u = n), (c = -r)) : ((u = -n), (c = r));
- var h = t - r * i + u,
- l = e - n * i + c,
- d = t + r * o + u,
- f = e + n * o + c;
- return a.push(h, l), a.push(d, f), 2;
- }
- function nB(t, e, r, n, i, o, s, a) {
- var u = r - t,
- c = n - e,
- h = Math.atan2(u, c),
- l = Math.atan2(i - t, o - e);
- a && h < l ? (h += 2 * Math.PI) : !a && h > l && (l += 2 * Math.PI);
- var d = h,
- f = l - h,
- p = Math.abs(f),
- v = Math.sqrt(u * u + c * c),
- m = 1 + (((15 * p * Math.sqrt(v)) / Math.PI) >> 0),
- y = f / m;
- if (((d += y), a)) {
- s.push(t, e), s.push(r, n);
- for (var g = 1, _ = d; g < m; g++, _ += y)
- s.push(t, e), s.push(t + Math.sin(_) * v, e + Math.cos(_) * v);
- s.push(t, e), s.push(i, o);
- } else {
- s.push(r, n), s.push(t, e);
- for (g = 1, _ = d; g < m; g++, _ += y)
- s.push(t + Math.sin(_) * v, e + Math.cos(_) * v), s.push(t, e);
- s.push(i, o), s.push(t, e);
- }
- return 2 * m;
- }
- function iB(t, e) {
- t.lineStyle.native
- ? (function (t, e) {
- var r = 0,
- n = t.shape,
- i = t.points || n.points,
- o = n.type !== vD.POLY || n.closeStroke;
- if (0 !== i.length) {
- var s = e.points,
- a = e.indices,
- u = i.length / 2,
- c = s.length / 2,
- h = c;
- for (s.push(i[0], i[1]), r = 1; r < u; r++)
- s.push(i[2 * r], i[2 * r + 1]), a.push(h, h + 1), h++;
- o && a.push(h, c);
- }
- })(t, e)
- : (function (t, e) {
- var r = t.shape,
- n = t.points || r.points.slice(),
- i = e.closePointEps;
- if (0 !== n.length) {
- var o = t.lineStyle,
- s = new _D(n[0], n[1]),
- a = new _D(n[n.length - 2], n[n.length - 1]),
- u = r.type !== vD.POLY || r.closeStroke,
- c = Math.abs(s.x - a.x) < i && Math.abs(s.y - a.y) < i;
- if (u) {
- (n = n.slice()),
- c &&
- (n.pop(), n.pop(), a.set(n[n.length - 2], n[n.length - 1]));
- var h = 0.5 * (s.x + a.x),
- l = 0.5 * (a.y + s.y);
- n.unshift(h, l), n.push(h, l);
- }
- var d = e.points,
- f = n.length / 2,
- p = n.length,
- v = d.length / 2,
- m = o.width / 2,
- y = m * m,
- g = o.miterLimit * o.miterLimit,
- _ = n[0],
- b = n[1],
- T = n[2],
- x = n[3],
- E = 0,
- S = 0,
- w = -(b - x),
- R = _ - T,
- C = 0,
- P = 0,
- A = Math.sqrt(w * w + R * R);
- (w /= A), (R /= A), (w *= m), (R *= m);
- var O = o.alignment,
- I = 2 * (1 - O),
- M = 2 * O;
- u ||
- (o.cap === Xk.ROUND
- ? (p +=
- nB(
- _ - w * (I - M) * 0.5,
- b - R * (I - M) * 0.5,
- _ - w * I,
- b - R * I,
- _ + w * M,
- b + R * M,
- d,
- !0
- ) + 2)
- : o.cap === Xk.SQUARE && (p += rB(_, b, w, R, I, M, !0, d))),
- d.push(_ - w * I, b - R * I),
- d.push(_ + w * M, b + R * M);
- for (var D = 1; D < f - 1; ++D) {
- (_ = n[2 * (D - 1)]),
- (b = n[2 * (D - 1) + 1]),
- (T = n[2 * D]),
- (x = n[2 * D + 1]),
- (E = n[2 * (D + 1)]),
- (S = n[2 * (D + 1) + 1]),
- (w = -(b - x)),
- (R = _ - T),
- (w /= A = Math.sqrt(w * w + R * R)),
- (R /= A),
- (w *= m),
- (R *= m),
- (C = -(x - S)),
- (P = T - E),
- (C /= A = Math.sqrt(C * C + P * P)),
- (P /= A),
- (C *= m),
- (P *= m);
- var L = T - _,
- F = b - x,
- N = T - E,
- k = S - x,
- B = L * N + F * k,
- G = F * N - k * L,
- U = G < 0;
- if (Math.abs(G) < 0.001 * Math.abs(B))
- d.push(T - w * I, x - R * I),
- d.push(T + w * M, x + R * M),
- B >= 0 &&
- (o.join === jk.ROUND
- ? (p +=
- nB(
- T,
- x,
- T - w * I,
- x - R * I,
- T - C * I,
- x - P * I,
- d,
- !1
- ) + 4)
- : (p += 2),
- d.push(T - C * M, x - P * M),
- d.push(T + C * I, x + P * I));
- else {
- var j = (-w + _) * (-R + x) - (-w + T) * (-R + b),
- X = (-C + E) * (-P + x) - (-C + T) * (-P + S),
- V = (L * X - N * j) / G,
- H = (k * j - F * X) / G,
- W = (V - T) * (V - T) + (H - x) * (H - x),
- Y = T + (V - T) * I,
- z = x + (H - x) * I,
- Z = T - (V - T) * M,
- J = x - (H - x) * M,
- K = U ? I : M;
- W <= Math.min(L * L + F * F, N * N + k * k) + K * K * y
- ? o.join === jk.BEVEL || W / y > g
- ? (U
- ? (d.push(Y, z),
- d.push(T + w * M, x + R * M),
- d.push(Y, z),
- d.push(T + C * M, x + P * M))
- : (d.push(T - w * I, x - R * I),
- d.push(Z, J),
- d.push(T - C * I, x - P * I),
- d.push(Z, J)),
- (p += 2))
- : o.join === jk.ROUND
- ? U
- ? (d.push(Y, z),
- d.push(T + w * M, x + R * M),
- (p +=
- nB(
- T,
- x,
- T + w * M,
- x + R * M,
- T + C * M,
- x + P * M,
- d,
- !0
- ) + 4),
- d.push(Y, z),
- d.push(T + C * M, x + P * M))
- : (d.push(T - w * I, x - R * I),
- d.push(Z, J),
- (p +=
- nB(
- T,
- x,
- T - w * I,
- x - R * I,
- T - C * I,
- x - P * I,
- d,
- !1
- ) + 4),
- d.push(T - C * I, x - P * I),
- d.push(Z, J))
- : (d.push(Y, z), d.push(Z, J))
- : (d.push(T - w * I, x - R * I),
- d.push(T + w * M, x + R * M),
- o.join === jk.ROUND
- ? (p += U
- ? nB(
- T,
- x,
- T + w * M,
- x + R * M,
- T + C * M,
- x + P * M,
- d,
- !0
- ) + 2
- : nB(
- T,
- x,
- T - w * I,
- x - R * I,
- T - C * I,
- x - P * I,
- d,
- !1
- ) + 2)
- : o.join === jk.MITER &&
- W / y <= g &&
- (U
- ? (d.push(Z, J), d.push(Z, J))
- : (d.push(Y, z), d.push(Y, z)),
- (p += 2)),
- d.push(T - C * I, x - P * I),
- d.push(T + C * M, x + P * M),
- (p += 2));
- }
- }
- (_ = n[2 * (f - 2)]),
- (b = n[2 * (f - 2) + 1]),
- (T = n[2 * (f - 1)]),
- (w = -(b - (x = n[2 * (f - 1) + 1]))),
- (R = _ - T),
- (w /= A = Math.sqrt(w * w + R * R)),
- (R /= A),
- (w *= m),
- (R *= m),
- d.push(T - w * I, x - R * I),
- d.push(T + w * M, x + R * M),
- u ||
- (o.cap === Xk.ROUND
- ? (p +=
- nB(
- T - w * (I - M) * 0.5,
- x - R * (I - M) * 0.5,
- T - w * I,
- x - R * I,
- T + w * M,
- x + R * M,
- d,
- !1
- ) + 2)
- : o.cap === Xk.SQUARE && (p += rB(T, x, w, R, I, M, !1, d)));
- var q = e.indices,
- Q = Yk.epsilon * Yk.epsilon;
- for (D = v; D < p + v - 2; ++D)
- (_ = d[2 * D]),
- (b = d[2 * D + 1]),
- (T = d[2 * (D + 1)]),
- (x = d[2 * (D + 1) + 1]),
- (E = d[2 * (D + 2)]),
- (S = d[2 * (D + 2) + 1]),
- Math.abs(_ * (x - S) + T * (S - b) + E * (b - x)) < Q ||
- q.push(D, D + 1, D + 2);
- }
- })(t, e);
- }
- var oB,
- sB = (function () {
- function t() {}
- return (
- (t.curveTo = function (t, e, r, n, i, o) {
- var s = o[o.length - 2],
- a = o[o.length - 1] - e,
- u = s - t,
- c = n - e,
- h = r - t,
- l = Math.abs(a * h - u * c);
- if (l < 1e-8 || 0 === i)
- return (
- (o[o.length - 2] === t && o[o.length - 1] === e) || o.push(t, e),
- null
- );
- var d = a * a + u * u,
- f = c * c + h * h,
- p = a * c + u * h,
- v = (i * Math.sqrt(d)) / l,
- m = (i * Math.sqrt(f)) / l,
- y = (v * p) / d,
- g = (m * p) / f,
- _ = v * h + m * u,
- b = v * c + m * a,
- T = u * (m + y),
- x = a * (m + y),
- E = h * (v + g),
- S = c * (v + g);
- return {
- cx: _ + t,
- cy: b + e,
- radius: i,
- startAngle: Math.atan2(x - b, T - _),
- endAngle: Math.atan2(S - b, E - _),
- anticlockwise: u * c > h * a,
- };
- }),
- (t.arc = function (t, e, r, n, i, o, s, a, u) {
- for (
- var c = s - o,
- h = Yk._segmentsCount(
- Math.abs(c) * i,
- 40 * Math.ceil(Math.abs(c) / mD)
- ),
- l = c / (2 * h),
- d = 2 * l,
- f = Math.cos(l),
- p = Math.sin(l),
- v = h - 1,
- m = (v % 1) / v,
- y = 0;
- y <= v;
- ++y
- ) {
- var g = l + o + d * (y + m * y),
- _ = Math.cos(g),
- b = -Math.sin(g);
- u.push((f * _ + p * b) * i + r, (f * -b + p * _) * i + n);
- }
- }),
- t
- );
- })(),
- aB = (function () {
- function t() {}
- return (
- (t.curveLength = function (t, e, r, n, i, o, s, a) {
- for (
- var u = 0,
- c = 0,
- h = 0,
- l = 0,
- d = 0,
- f = 0,
- p = 0,
- v = 0,
- m = 0,
- y = 0,
- g = 0,
- _ = t,
- b = e,
- T = 1;
- T <= 10;
- ++T
- )
- (y =
- _ -
- (v =
- (p = (f = (d = 1 - (c = T / 10)) * d) * d) * t +
- 3 * f * c * r +
- 3 * d * (h = c * c) * i +
- (l = h * c) * s)),
- (g = b - (m = p * e + 3 * f * c * n + 3 * d * h * o + l * a)),
- (_ = v),
- (b = m),
- (u += Math.sqrt(y * y + g * g));
- return u;
- }),
- (t.curveTo = function (e, r, n, i, o, s, a) {
- var u = a[a.length - 2],
- c = a[a.length - 1];
- a.length -= 2;
- var h = Yk._segmentsCount(t.curveLength(u, c, e, r, n, i, o, s)),
- l = 0,
- d = 0,
- f = 0,
- p = 0,
- v = 0;
- a.push(u, c);
- for (var m = 1, y = 0; m <= h; ++m)
- (f = (d = (l = 1 - (y = m / h)) * l) * l),
- (v = (p = y * y) * y),
- a.push(
- f * u + 3 * d * y * e + 3 * l * p * n + v * o,
- f * c + 3 * d * y * r + 3 * l * p * i + v * s
- );
- }),
- t
- );
- })(),
- uB = (function () {
- function t() {}
- return (
- (t.curveLength = function (t, e, r, n, i, o) {
- var s = t - 2 * r + i,
- a = e - 2 * n + o,
- u = 2 * r - 2 * t,
- c = 2 * n - 2 * e,
- h = 4 * (s * s + a * a),
- l = 4 * (s * u + a * c),
- d = u * u + c * c,
- f = 2 * Math.sqrt(h + l + d),
- p = Math.sqrt(h),
- v = 2 * h * p,
- m = 2 * Math.sqrt(d),
- y = l / p;
- return (
- (v * f +
- p * l * (f - m) +
- (4 * d * h - l * l) * Math.log((2 * p + y + f) / (y + m))) /
- (4 * v)
- );
- }),
- (t.curveTo = function (e, r, n, i, o) {
- for (
- var s = o[o.length - 2],
- a = o[o.length - 1],
- u = Yk._segmentsCount(t.curveLength(s, a, e, r, n, i)),
- c = 0,
- h = 0,
- l = 1;
- l <= u;
- ++l
- ) {
- var d = l / u;
- (c = s + (e - s) * d),
- (h = a + (r - a) * d),
- o.push(
- c + (e + (n - e) * d - c) * d,
- h + (r + (i - r) * d - h) * d
- );
- }
- }),
- t
- );
- })(),
- cB = (function () {
- function t() {
- this.reset();
- }
- return (
- (t.prototype.begin = function (t, e, r) {
- this.reset(),
- (this.style = t),
- (this.start = e),
- (this.attribStart = r);
- }),
- (t.prototype.end = function (t, e) {
- (this.attribSize = e - this.attribStart),
- (this.size = t - this.start);
- }),
- (t.prototype.reset = function () {
- (this.style = null),
- (this.size = 0),
- (this.start = 0),
- (this.attribStart = 0),
- (this.attribSize = 0);
- }),
- t
- );
- })(),
- hB =
- (((oB = {})[vD.POLY] = qk),
- (oB[vD.CIRC] = Qk),
- (oB[vD.ELIP] = Qk),
- (oB[vD.RECT] = {
- build: function (t) {
- var e = t.shape,
- r = e.x,
- n = e.y,
- i = e.width,
- o = e.height,
- s = t.points;
- (s.length = 0), s.push(r, n, r + i, n, r + i, n + o, r, n + o);
- },
- triangulate: function (t, e) {
- var r = t.points,
- n = e.points,
- i = n.length / 2;
- n.push(r[0], r[1], r[2], r[3], r[6], r[7], r[4], r[5]),
- e.indices.push(i, i + 1, i + 2, i + 1, i + 2, i + 3);
- },
- }),
- (oB[vD.RREC] = eB),
- oB),
- lB = [],
- dB = [],
- fB = (function () {
- function t(t, e, r, n) {
- void 0 === e && (e = null),
- void 0 === r && (r = null),
- void 0 === n && (n = null),
- (this.points = []),
- (this.holes = []),
- (this.shape = t),
- (this.lineStyle = r),
- (this.fillStyle = e),
- (this.matrix = n),
- (this.type = t.type);
- }
- return (
- (t.prototype.clone = function () {
- return new t(this.shape, this.fillStyle, this.lineStyle, this.matrix);
- }),
- (t.prototype.destroy = function () {
- (this.shape = null),
- (this.holes.length = 0),
- (this.holes = null),
- (this.points.length = 0),
- (this.points = null),
- (this.lineStyle = null),
- (this.fillStyle = null);
- }),
- t
- );
- })(),
- pB = new _D(),
- vB = (function (t) {
- function e() {
- var e = t.call(this) || this;
- return (
- (e.closePointEps = 1e-4),
- (e.boundsPadding = 0),
- (e.uvsFloat32 = null),
- (e.indicesUint16 = null),
- (e.batchable = !1),
- (e.points = []),
- (e.colors = []),
- (e.uvs = []),
- (e.indices = []),
- (e.textureIds = []),
- (e.graphicsData = []),
- (e.drawCalls = []),
- (e.batchDirty = -1),
- (e.batches = []),
- (e.dirty = 0),
- (e.cacheDirty = -1),
- (e.clearDirty = 0),
- (e.shapeIndex = 0),
- (e._bounds = new kD()),
- (e.boundsDirty = -1),
- e
- );
- }
- return (
- Jk(e, t),
- Object.defineProperty(e.prototype, 'bounds', {
- get: function () {
- return (
- this.updateBatches(),
- this.boundsDirty !== this.dirty &&
- ((this.boundsDirty = this.dirty), this.calculateBounds()),
- this._bounds
- );
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype.invalidate = function () {
- (this.boundsDirty = -1),
- this.dirty++,
- this.batchDirty++,
- (this.shapeIndex = 0),
- (this.points.length = 0),
- (this.colors.length = 0),
- (this.uvs.length = 0),
- (this.indices.length = 0),
- (this.textureIds.length = 0);
- for (var t = 0; t < this.drawCalls.length; t++)
- this.drawCalls[t].texArray.clear(), dB.push(this.drawCalls[t]);
- this.drawCalls.length = 0;
- for (t = 0; t < this.batches.length; t++) {
- var e = this.batches[t];
- e.reset(), lB.push(e);
- }
- this.batches.length = 0;
- }),
- (e.prototype.clear = function () {
- return (
- this.graphicsData.length > 0 &&
- (this.invalidate(),
- this.clearDirty++,
- (this.graphicsData.length = 0)),
- this
- );
- }),
- (e.prototype.drawShape = function (t, e, r, n) {
- void 0 === e && (e = null),
- void 0 === r && (r = null),
- void 0 === n && (n = null);
- var i = new fB(t, e, r, n);
- return this.graphicsData.push(i), this.dirty++, this;
- }),
- (e.prototype.drawHole = function (t, e) {
- if ((void 0 === e && (e = null), !this.graphicsData.length))
- return null;
- var r = new fB(t, null, null, e),
- n = this.graphicsData[this.graphicsData.length - 1];
- return (
- (r.lineStyle = n.lineStyle), n.holes.push(r), this.dirty++, this
- );
- }),
- (e.prototype.destroy = function () {
- t.prototype.destroy.call(this);
- for (var e = 0; e < this.graphicsData.length; ++e)
- this.graphicsData[e].destroy();
- (this.points.length = 0),
- (this.points = null),
- (this.colors.length = 0),
- (this.colors = null),
- (this.uvs.length = 0),
- (this.uvs = null),
- (this.indices.length = 0),
- (this.indices = null),
- this.indexBuffer.destroy(),
- (this.indexBuffer = null),
- (this.graphicsData.length = 0),
- (this.graphicsData = null),
- (this.drawCalls.length = 0),
- (this.drawCalls = null),
- (this.batches.length = 0),
- (this.batches = null),
- (this._bounds = null);
- }),
- (e.prototype.containsPoint = function (t) {
- for (var e = this.graphicsData, r = 0; r < e.length; ++r) {
- var n = e[r];
- if (
- n.fillStyle.visible &&
- n.shape &&
- (n.matrix ? n.matrix.applyInverse(t, pB) : pB.copyFrom(t),
- n.shape.contains(pB.x, pB.y))
- ) {
- var i = !1;
- if (n.holes)
- for (var o = 0; o < n.holes.length; o++) {
- if (n.holes[o].shape.contains(pB.x, pB.y)) {
- i = !0;
- break;
- }
- }
- if (!i) return !0;
- }
- }
- return !1;
- }),
- (e.prototype.updateBatches = function () {
- if (this.graphicsData.length) {
- if (this.validateBatching()) {
- this.cacheDirty = this.dirty;
- var t = this.uvs,
- e = this.graphicsData,
- r = null,
- n = null;
- this.batches.length > 0 &&
- (n = (r = this.batches[this.batches.length - 1]).style);
- for (var i = this.shapeIndex; i < e.length; i++) {
- this.shapeIndex++;
- var o = e[i],
- s = o.fillStyle,
- a = o.lineStyle;
- hB[o.type].build(o),
- o.matrix && this.transformPoints(o.points, o.matrix),
- (s.visible || a.visible) && this.processHoles(o.holes);
- for (var u = 0; u < 2; u++) {
- var c = 0 === u ? s : a;
- if (c.visible) {
- var h = c.texture.baseTexture,
- l = this.indices.length,
- d = this.points.length / 2;
- (h.wrapMode = kP.REPEAT),
- 0 === u ? this.processFill(o) : this.processLine(o);
- var f = this.points.length / 2 - d;
- 0 !== f &&
- (r &&
- !this._compareStyles(n, c) &&
- (r.end(l, d), (r = null)),
- r ||
- ((r = lB.pop() || new cB()).begin(c, l, d),
- this.batches.push(r),
- (n = c)),
- this.addUvs(this.points, t, c.texture, d, f, c.matrix));
- }
- }
- }
- var p = this.indices.length,
- v = this.points.length / 2;
- if ((r && r.end(p, v), 0 !== this.batches.length)) {
- var m = v > 65535;
- this.indicesUint16 &&
- this.indices.length === this.indicesUint16.length &&
- m === this.indicesUint16.BYTES_PER_ELEMENT > 2
- ? this.indicesUint16.set(this.indices)
- : (this.indicesUint16 = m
- ? new Uint32Array(this.indices)
- : new Uint16Array(this.indices)),
- (this.batchable = this.isBatchable()),
- this.batchable ? this.packBatches() : this.buildDrawCalls();
- } else this.batchable = !0;
- }
- } else this.batchable = !0;
- }),
- (e.prototype._compareStyles = function (t, e) {
- return (
- !(!t || !e) &&
- t.texture.baseTexture === e.texture.baseTexture &&
- t.color + t.alpha === e.color + e.alpha &&
- !!t.native == !!e.native
- );
- }),
- (e.prototype.validateBatching = function () {
- if (this.dirty === this.cacheDirty || !this.graphicsData.length)
- return !1;
- for (var t = 0, e = this.graphicsData.length; t < e; t++) {
- var r = this.graphicsData[t],
- n = r.fillStyle,
- i = r.lineStyle;
- if (n && !n.texture.baseTexture.valid) return !1;
- if (i && !i.texture.baseTexture.valid) return !1;
- }
- return !0;
- }),
- (e.prototype.packBatches = function () {
- this.batchDirty++, (this.uvsFloat32 = new Float32Array(this.uvs));
- for (var t = this.batches, e = 0, r = t.length; e < r; e++)
- for (var n = t[e], i = 0; i < n.size; i++) {
- var o = n.start + i;
- this.indicesUint16[o] = this.indicesUint16[o] - n.attribStart;
- }
- }),
- (e.prototype.isBatchable = function () {
- if (this.points.length > 131070) return !1;
- for (var t = this.batches, r = 0; r < t.length; r++)
- if (t[r].style.native) return !1;
- return this.points.length < 2 * e.BATCHABLE_SIZE;
- }),
- (e.prototype.buildDrawCalls = function () {
- for (var t = ++aL._globalBatch, e = 0; e < this.drawCalls.length; e++)
- this.drawCalls[e].texArray.clear(), dB.push(this.drawCalls[e]);
- this.drawCalls.length = 0;
- var r = this.colors,
- n = this.textureIds,
- i = dB.pop();
- i || ((i = new nN()).texArray = new iN()),
- (i.texArray.count = 0),
- (i.start = 0),
- (i.size = 0),
- (i.type = IP.TRIANGLES);
- var o = 0,
- s = null,
- a = 0,
- u = !1,
- c = IP.TRIANGLES,
- h = 0;
- this.drawCalls.push(i);
- for (e = 0; e < this.batches.length; e++) {
- var l = this.batches[e],
- d = l.style,
- f = d.texture.baseTexture;
- u !== !!d.native &&
- ((c = (u = !!d.native) ? IP.LINES : IP.TRIANGLES),
- (s = null),
- (o = 8),
- t++),
- s !== f &&
- ((s = f),
- f._batchEnabled !== t &&
- (8 === o &&
- (t++,
- (o = 0),
- i.size > 0 &&
- ((i = dB.pop()) || ((i = new nN()).texArray = new iN()),
- this.drawCalls.push(i)),
- (i.start = h),
- (i.size = 0),
- (i.texArray.count = 0),
- (i.type = c)),
- (f.touched = 1),
- (f._batchEnabled = t),
- (f._batchLocation = o),
- (f.wrapMode = kP.REPEAT),
- (i.texArray.elements[i.texArray.count++] = f),
- o++)),
- (i.size += l.size),
- (h += l.size),
- (a = f._batchLocation),
- this.addColors(r, d.color, d.alpha, l.attribSize, l.attribStart),
- this.addTextureIds(n, a, l.attribSize, l.attribStart);
- }
- (aL._globalBatch = t), this.packAttributes();
- }),
- (e.prototype.packAttributes = function () {
- for (
- var t = this.points,
- e = this.uvs,
- r = this.colors,
- n = this.textureIds,
- i = new ArrayBuffer(3 * t.length * 4),
- o = new Float32Array(i),
- s = new Uint32Array(i),
- a = 0,
- u = 0;
- u < t.length / 2;
- u++
- )
- (o[a++] = t[2 * u]),
- (o[a++] = t[2 * u + 1]),
- (o[a++] = e[2 * u]),
- (o[a++] = e[2 * u + 1]),
- (s[a++] = r[u]),
- (o[a++] = n[u]);
- this._buffer.update(i), this._indexBuffer.update(this.indicesUint16);
- }),
- (e.prototype.processFill = function (t) {
- t.holes.length
- ? qk.triangulate(t, this)
- : hB[t.type].triangulate(t, this);
- }),
- (e.prototype.processLine = function (t) {
- iB(t, this);
- for (var e = 0; e < t.holes.length; e++) iB(t.holes[e], this);
- }),
- (e.prototype.processHoles = function (t) {
- for (var e = 0; e < t.length; e++) {
- var r = t[e];
- hB[r.type].build(r),
- r.matrix && this.transformPoints(r.points, r.matrix);
- }
- }),
- (e.prototype.calculateBounds = function () {
- var t = this._bounds;
- t.clear(),
- t.addVertexData(this.points, 0, this.points.length),
- t.pad(this.boundsPadding, this.boundsPadding);
- }),
- (e.prototype.transformPoints = function (t, e) {
- for (var r = 0; r < t.length / 2; r++) {
- var n = t[2 * r],
- i = t[2 * r + 1];
- (t[2 * r] = e.a * n + e.c * i + e.tx),
- (t[2 * r + 1] = e.b * n + e.d * i + e.ty);
- }
- }),
- (e.prototype.addColors = function (t, e, r, n, i) {
- void 0 === i && (i = 0);
- var o = KM((e >> 16) + (65280 & e) + ((255 & e) << 16), r);
- t.length = Math.max(t.length, i + n);
- for (var s = 0; s < n; s++) t[i + s] = o;
- }),
- (e.prototype.addTextureIds = function (t, e, r, n) {
- void 0 === n && (n = 0), (t.length = Math.max(t.length, n + r));
- for (var i = 0; i < r; i++) t[n + i] = e;
- }),
- (e.prototype.addUvs = function (t, e, r, n, i, o) {
- void 0 === o && (o = null);
- for (var s = 0, a = e.length, u = r.frame; s < i; ) {
- var c = t[2 * (n + s)],
- h = t[2 * (n + s) + 1];
- if (o) {
- var l = o.a * c + o.c * h + o.tx;
- (h = o.b * c + o.d * h + o.ty), (c = l);
- }
- s++, e.push(c / u.width, h / u.height);
- }
- var d = r.baseTexture;
- (u.width < d.width || u.height < d.height) &&
- this.adjustUvs(e, r, a, i);
- }),
- (e.prototype.adjustUvs = function (t, e, r, n) {
- for (
- var i = e.baseTexture,
- o = 1e-6,
- s = r + 2 * n,
- a = e.frame,
- u = a.width / i.width,
- c = a.height / i.height,
- h = a.x / a.width,
- l = a.y / a.height,
- d = Math.floor(t[r] + o),
- f = Math.floor(t[r + 1] + o),
- p = r + 2;
- p < s;
- p += 2
- )
- (d = Math.min(d, Math.floor(t[p] + o))),
- (f = Math.min(f, Math.floor(t[p + 1] + o)));
- (h -= d), (l -= f);
- for (p = r; p < s; p += 2)
- (t[p] = (t[p] + h) * u), (t[p + 1] = (t[p + 1] + l) * c);
- }),
- (e.BATCHABLE_SIZE = 100),
- e
- );
- })(uN),
- mB = (function (t) {
- function e() {
- var e = (null !== t && t.apply(this, arguments)) || this;
- return (
- (e.width = 0),
- (e.alignment = 0.5),
- (e.native = !1),
- (e.cap = Xk.BUTT),
- (e.join = jk.MITER),
- (e.miterLimit = 10),
- e
- );
- }
- return (
- Jk(e, t),
- (e.prototype.clone = function () {
- var t = new e();
- return (
- (t.color = this.color),
- (t.alpha = this.alpha),
- (t.texture = this.texture),
- (t.matrix = this.matrix),
- (t.visible = this.visible),
- (t.width = this.width),
- (t.alignment = this.alignment),
- (t.native = this.native),
- (t.cap = this.cap),
- (t.join = this.join),
- (t.miterLimit = this.miterLimit),
- t
- );
- }),
- (e.prototype.reset = function () {
- t.prototype.reset.call(this),
- (this.color = 0),
- (this.alignment = 0.5),
- (this.width = 0),
- (this.native = !1);
- }),
- e
- );
- })(zk),
- yB = new Float32Array(3),
- gB = {},
- _B = (function (t) {
- function e(e) {
- void 0 === e && (e = null);
- var r = t.call(this) || this;
- return (
- (r.shader = null),
- (r.pluginName = 'batch'),
- (r.currentPath = null),
- (r.batches = []),
- (r.batchTint = -1),
- (r.batchDirty = -1),
- (r.vertexData = null),
- (r._fillStyle = new zk()),
- (r._lineStyle = new mB()),
- (r._matrix = null),
- (r._holeMode = !1),
- (r.state = xF.for2d()),
- (r._geometry = e || new vB()),
- r._geometry.refCount++,
- (r._transformID = -1),
- (r.tint = 16777215),
- (r.blendMode = OP.NORMAL),
- r
- );
- }
- return (
- Jk(e, t),
- Object.defineProperty(e.prototype, 'geometry', {
- get: function () {
- return this._geometry;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype.clone = function () {
- return this.finishPoly(), new e(this._geometry);
- }),
- Object.defineProperty(e.prototype, 'blendMode', {
- get: function () {
- return this.state.blendMode;
- },
- set: function (t) {
- this.state.blendMode = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'tint', {
- get: function () {
- return this._tint;
- },
- set: function (t) {
- this._tint = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'fill', {
- get: function () {
- return this._fillStyle;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'line', {
- get: function () {
- return this._lineStyle;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype.lineStyle = function (t, e, r, n, i) {
- return (
- void 0 === t && (t = null),
- void 0 === e && (e = 0),
- void 0 === r && (r = 1),
- void 0 === n && (n = 0.5),
- void 0 === i && (i = !1),
- 'number' == typeof t &&
- (t = { width: t, color: e, alpha: r, alignment: n, native: i }),
- this.lineTextureStyle(t)
- );
- }),
- (e.prototype.lineTextureStyle = function (t) {
- (t = Object.assign(
- {
- width: 0,
- texture: EL.WHITE,
- color: t && t.texture ? 16777215 : 0,
- alpha: 1,
- matrix: null,
- alignment: 0.5,
- native: !1,
- cap: Xk.BUTT,
- join: jk.MITER,
- miterLimit: 10,
- },
- t
- )),
- this.currentPath && this.startPoly();
- var e = t.width > 0 && t.alpha > 0;
- return (
- e
- ? (t.matrix && ((t.matrix = t.matrix.clone()), t.matrix.invert()),
- Object.assign(this._lineStyle, { visible: e }, t))
- : this._lineStyle.reset(),
- this
- );
- }),
- (e.prototype.startPoly = function () {
- if (this.currentPath) {
- var t = this.currentPath.points,
- e = this.currentPath.points.length;
- e > 2 &&
- (this.drawShape(this.currentPath),
- (this.currentPath = new SD()),
- (this.currentPath.closeStroke = !1),
- this.currentPath.points.push(t[e - 2], t[e - 1]));
- } else
- (this.currentPath = new SD()), (this.currentPath.closeStroke = !1);
- }),
- (e.prototype.finishPoly = function () {
- this.currentPath &&
- (this.currentPath.points.length > 2
- ? (this.drawShape(this.currentPath), (this.currentPath = null))
- : (this.currentPath.points.length = 0));
- }),
- (e.prototype.moveTo = function (t, e) {
- return (
- this.startPoly(),
- (this.currentPath.points[0] = t),
- (this.currentPath.points[1] = e),
- this
- );
- }),
- (e.prototype.lineTo = function (t, e) {
- this.currentPath || this.moveTo(0, 0);
- var r = this.currentPath.points,
- n = r[r.length - 2],
- i = r[r.length - 1];
- return (n === t && i === e) || r.push(t, e), this;
- }),
- (e.prototype._initCurve = function (t, e) {
- void 0 === t && (t = 0),
- void 0 === e && (e = 0),
- this.currentPath
- ? 0 === this.currentPath.points.length &&
- (this.currentPath.points = [t, e])
- : this.moveTo(t, e);
- }),
- (e.prototype.quadraticCurveTo = function (t, e, r, n) {
- this._initCurve();
- var i = this.currentPath.points;
- return (
- 0 === i.length && this.moveTo(0, 0), uB.curveTo(t, e, r, n, i), this
- );
- }),
- (e.prototype.bezierCurveTo = function (t, e, r, n, i, o) {
- return (
- this._initCurve(),
- aB.curveTo(t, e, r, n, i, o, this.currentPath.points),
- this
- );
- }),
- (e.prototype.arcTo = function (t, e, r, n, i) {
- this._initCurve(t, e);
- var o = this.currentPath.points,
- s = sB.curveTo(t, e, r, n, i, o);
- if (s) {
- var a = s.cx,
- u = s.cy,
- c = s.radius,
- h = s.startAngle,
- l = s.endAngle,
- d = s.anticlockwise;
- this.arc(a, u, c, h, l, d);
- }
- return this;
- }),
- (e.prototype.arc = function (t, e, r, n, i, o) {
- if ((void 0 === o && (o = !1), n === i)) return this;
- if (
- (!o && i <= n ? (i += mD) : o && n <= i && (n += mD), 0 === i - n)
- )
- return this;
- var s = t + Math.cos(n) * r,
- a = e + Math.sin(n) * r,
- u = this._geometry.closePointEps,
- c = this.currentPath ? this.currentPath.points : null;
- if (c) {
- var h = Math.abs(c[c.length - 2] - s),
- l = Math.abs(c[c.length - 1] - a);
- (h < u && l < u) || c.push(s, a);
- } else this.moveTo(s, a), (c = this.currentPath.points);
- return sB.arc(s, a, t, e, r, n, i, o, c), this;
- }),
- (e.prototype.beginFill = function (t, e) {
- return (
- void 0 === t && (t = 0),
- void 0 === e && (e = 1),
- this.beginTextureFill({ texture: EL.WHITE, color: t, alpha: e })
- );
- }),
- (e.prototype.beginTextureFill = function (t) {
- (t = Object.assign(
- { texture: EL.WHITE, color: 16777215, alpha: 1, matrix: null },
- t
- )),
- this.currentPath && this.startPoly();
- var e = t.alpha > 0;
- return (
- e
- ? (t.matrix && ((t.matrix = t.matrix.clone()), t.matrix.invert()),
- Object.assign(this._fillStyle, { visible: e }, t))
- : this._fillStyle.reset(),
- this
- );
- }),
- (e.prototype.endFill = function () {
- return this.finishPoly(), this._fillStyle.reset(), this;
- }),
- (e.prototype.drawRect = function (t, e, r, n) {
- return this.drawShape(new TD(t, e, r, n));
- }),
- (e.prototype.drawRoundedRect = function (t, e, r, n, i) {
- return this.drawShape(new wD(t, e, r, n, i));
- }),
- (e.prototype.drawCircle = function (t, e, r) {
- return this.drawShape(new xD(t, e, r));
- }),
- (e.prototype.drawEllipse = function (t, e, r, n) {
- return this.drawShape(new ED(t, e, r, n));
- }),
- (e.prototype.drawPolygon = function () {
- for (var t, e = arguments, r = [], n = 0; n < arguments.length; n++)
- r[n] = e[n];
- var i = !0,
- o = r[0];
- o.points
- ? ((i = o.closeStroke), (t = o.points))
- : (t = Array.isArray(r[0]) ? r[0] : r);
- var s = new SD(t);
- return (s.closeStroke = i), this.drawShape(s), this;
- }),
- (e.prototype.drawShape = function (t) {
- return (
- this._holeMode
- ? this._geometry.drawHole(t, this._matrix)
- : this._geometry.drawShape(
- t,
- this._fillStyle.clone(),
- this._lineStyle.clone(),
- this._matrix
- ),
- this
- );
- }),
- (e.prototype.clear = function () {
- return (
- this._geometry.clear(),
- this._lineStyle.reset(),
- this._fillStyle.reset(),
- this._boundsID++,
- (this._matrix = null),
- (this._holeMode = !1),
- (this.currentPath = null),
- this
- );
- }),
- (e.prototype.isFastRect = function () {
- var t = this._geometry.graphicsData;
- return !(
- 1 !== t.length ||
- t[0].shape.type !== vD.RECT ||
- t[0].matrix ||
- t[0].holes.length ||
- (t[0].lineStyle.visible && t[0].lineStyle.width)
- );
- }),
- (e.prototype._render = function (t) {
- this.finishPoly();
- var e = this._geometry;
- e.updateBatches(),
- e.batchable
- ? (this.batchDirty !== e.batchDirty && this._populateBatches(),
- this._renderBatched(t))
- : (t.batch.flush(), this._renderDirect(t));
- }),
- (e.prototype._populateBatches = function () {
- var t = this._geometry,
- e = this.blendMode,
- r = t.batches.length;
- (this.batchTint = -1),
- (this._transformID = -1),
- (this.batchDirty = t.batchDirty),
- (this.batches.length = r),
- (this.vertexData = new Float32Array(t.points));
- for (var n = 0; n < r; n++) {
- var i = t.batches[n],
- o = i.style.color,
- s = new Float32Array(
- this.vertexData.buffer,
- 4 * i.attribStart * 2,
- 2 * i.attribSize
- ),
- a = new Float32Array(
- t.uvsFloat32.buffer,
- 4 * i.attribStart * 2,
- 2 * i.attribSize
- ),
- u = {
- vertexData: s,
- blendMode: e,
- indices: new Uint16Array(
- t.indicesUint16.buffer,
- 2 * i.start,
- i.size
- ),
- uvs: a,
- _batchRGB: HM(o),
- _tintRGB: o,
- _texture: i.style.texture,
- alpha: i.style.alpha,
- worldAlpha: 1,
- };
- this.batches[n] = u;
- }
- }),
- (e.prototype._renderBatched = function (t) {
- if (this.batches.length) {
- t.batch.setObjectRenderer(t.plugins[this.pluginName]),
- this.calculateVertices(),
- this.calculateTints();
- for (var e = 0, r = this.batches.length; e < r; e++) {
- var n = this.batches[e];
- (n.worldAlpha = this.worldAlpha * n.alpha),
- t.plugins[this.pluginName].render(n);
- }
- }
- }),
- (e.prototype._renderDirect = function (t) {
- var e = this._resolveDirectShader(t),
- r = this._geometry,
- n = this.tint,
- i = this.worldAlpha,
- o = e.uniforms,
- s = r.drawCalls;
- (o.translationMatrix = this.transform.worldTransform),
- (o.tint[0] = (((n >> 16) & 255) / 255) * i),
- (o.tint[1] = (((n >> 8) & 255) / 255) * i),
- (o.tint[2] = ((255 & n) / 255) * i),
- (o.tint[3] = i),
- t.shader.bind(e),
- t.geometry.bind(r, e),
- t.state.set(this.state);
- for (var a = 0, u = s.length; a < u; a++)
- this._renderDrawCallDirect(t, r.drawCalls[a]);
- }),
- (e.prototype._renderDrawCallDirect = function (t, e) {
- for (
- var r = e.texArray,
- n = e.type,
- i = e.size,
- o = e.start,
- s = r.count,
- a = 0;
- a < s;
- a++
- )
- t.texture.bind(r.elements[a], a);
- t.geometry.draw(n, i, o);
- }),
- (e.prototype._resolveDirectShader = function (t) {
- var e = this.shader,
- r = this.pluginName;
- if (!e) {
- if (!gB[r]) {
- for (
- var n = t.plugins[r].MAX_TEXTURES, i = new Int32Array(n), o = 0;
- o < n;
- o++
- )
- i[o] = o;
- var s = {
- tint: new Float32Array([1, 1, 1, 1]),
- translationMatrix: new CD(),
- default: kL.from({ uSamplers: i }, !0),
- },
- a = t.plugins[r]._shader.program;
- gB[r] = new TF(a, s);
- }
- e = gB[r];
- }
- return e;
- }),
- (e.prototype._calculateBounds = function () {
- this.finishPoly();
- var t = this._geometry;
- if (t.graphicsData.length) {
- var e = t.bounds,
- r = e.minX,
- n = e.minY,
- i = e.maxX,
- o = e.maxY;
- this._bounds.addFrame(this.transform, r, n, i, o);
- }
- }),
- (e.prototype.containsPoint = function (t) {
- return (
- this.worldTransform.applyInverse(t, e._TEMP_POINT),
- this._geometry.containsPoint(e._TEMP_POINT)
- );
- }),
- (e.prototype.calculateTints = function () {
- if (this.batchTint !== this.tint) {
- this.batchTint = this.tint;
- for (
- var t = HM(this.tint, yB), e = 0;
- e < this.batches.length;
- e++
- ) {
- var r = this.batches[e],
- n = r._batchRGB,
- i =
- ((t[0] * n[0] * 255) << 16) +
- ((t[1] * n[1] * 255) << 8) +
- (0 | (t[2] * n[2] * 255));
- r._tintRGB = (i >> 16) + (65280 & i) + ((255 & i) << 16);
- }
- }
- }),
- (e.prototype.calculateVertices = function () {
- var t = this.transform._worldID;
- if (this._transformID !== t) {
- this._transformID = t;
- for (
- var e = this.transform.worldTransform,
- r = e.a,
- n = e.b,
- i = e.c,
- o = e.d,
- s = e.tx,
- a = e.ty,
- u = this._geometry.points,
- c = this.vertexData,
- h = 0,
- l = 0;
- l < u.length;
- l += 2
- ) {
- var d = u[l],
- f = u[l + 1];
- (c[h++] = r * d + i * f + s), (c[h++] = o * f + n * d + a);
- }
- }
- }),
- (e.prototype.closePath = function () {
- var t = this.currentPath;
- return t && ((t.closeStroke = !0), this.finishPoly()), this;
- }),
- (e.prototype.setMatrix = function (t) {
- return (this._matrix = t), this;
- }),
- (e.prototype.beginHole = function () {
- return this.finishPoly(), (this._holeMode = !0), this;
- }),
- (e.prototype.endHole = function () {
- return this.finishPoly(), (this._holeMode = !1), this;
- }),
- (e.prototype.destroy = function (e) {
- this._geometry.refCount--,
- 0 === this._geometry.refCount && this._geometry.dispose(),
- (this._matrix = null),
- (this.currentPath = null),
- this._lineStyle.destroy(),
- (this._lineStyle = null),
- this._fillStyle.destroy(),
- (this._fillStyle = null),
- (this._geometry = null),
- (this.shader = null),
- (this.vertexData = null),
- (this.batches.length = 0),
- (this.batches = null),
- t.prototype.destroy.call(this, e);
- }),
- (e.nextRoundedRectBehavior = !1),
- (e._TEMP_POINT = new _D()),
- e
- );
- })(VD),
- bB = function (t, e) {
- return (
- (bB =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- bB(t, e)
- );
- };
- var TB,
- xB = new _D(),
- EB = new Uint16Array([0, 1, 2, 0, 2, 3]),
- SB = (function (t) {
- function e(e) {
- var r = t.call(this) || this;
- return (
- (r._anchor = new RD(
- r._onAnchorUpdate,
- r,
- e ? e.defaultAnchor.x : 0,
- e ? e.defaultAnchor.y : 0
- )),
- (r._texture = null),
- (r._width = 0),
- (r._height = 0),
- (r._tint = null),
- (r._tintRGB = null),
- (r.tint = 16777215),
- (r.blendMode = OP.NORMAL),
- (r._cachedTint = 16777215),
- (r.uvs = null),
- (r.texture = e || EL.EMPTY),
- (r.vertexData = new Float32Array(8)),
- (r.vertexTrimmedData = null),
- (r._transformID = -1),
- (r._textureID = -1),
- (r._transformTrimmedID = -1),
- (r._textureTrimmedID = -1),
- (r.indices = EB),
- (r.pluginName = 'batch'),
- (r.isSprite = !0),
- (r._roundPixels = vA.ROUND_PIXELS),
- r
- );
- }
- return (
- (function (t, e) {
- function r() {
- this.constructor = t;
- }
- bB(t, e),
- (t.prototype =
- null === e
- ? Object.create(e)
- : ((r.prototype = e.prototype), new r()));
- })(e, t),
- (e.prototype._onTextureUpdate = function () {
- (this._textureID = -1),
- (this._textureTrimmedID = -1),
- (this._cachedTint = 16777215),
- this._width &&
- (this.scale.x =
- (nD(this.scale.x) * this._width) / this._texture.orig.width),
- this._height &&
- (this.scale.y =
- (nD(this.scale.y) * this._height) / this._texture.orig.height);
- }),
- (e.prototype._onAnchorUpdate = function () {
- (this._transformID = -1), (this._transformTrimmedID = -1);
- }),
- (e.prototype.calculateVertices = function () {
- var t = this._texture;
- if (
- this._transformID !== this.transform._worldID ||
- this._textureID !== t._updateID
- ) {
- this._textureID !== t._updateID &&
- (this.uvs = this._texture._uvs.uvsFloat32),
- (this._transformID = this.transform._worldID),
- (this._textureID = t._updateID);
- var e = this.transform.worldTransform,
- r = e.a,
- n = e.b,
- i = e.c,
- o = e.d,
- s = e.tx,
- a = e.ty,
- u = this.vertexData,
- c = t.trim,
- h = t.orig,
- l = this._anchor,
- d = 0,
- f = 0,
- p = 0,
- v = 0;
- if (
- (c
- ? ((d = (f = c.x - l._x * h.width) + c.width),
- (p = (v = c.y - l._y * h.height) + c.height))
- : ((d = (f = -l._x * h.width) + h.width),
- (p = (v = -l._y * h.height) + h.height)),
- (u[0] = r * f + i * v + s),
- (u[1] = o * v + n * f + a),
- (u[2] = r * d + i * v + s),
- (u[3] = o * v + n * d + a),
- (u[4] = r * d + i * p + s),
- (u[5] = o * p + n * d + a),
- (u[6] = r * f + i * p + s),
- (u[7] = o * p + n * f + a),
- this._roundPixels)
- )
- for (var m = vA.RESOLUTION, y = 0; y < u.length; ++y)
- u[y] = Math.round(((u[y] * m) | 0) / m);
- }
- }),
- (e.prototype.calculateTrimmedVertices = function () {
- if (this.vertexTrimmedData) {
- if (
- this._transformTrimmedID === this.transform._worldID &&
- this._textureTrimmedID === this._texture._updateID
- )
- return;
- } else this.vertexTrimmedData = new Float32Array(8);
- (this._transformTrimmedID = this.transform._worldID),
- (this._textureTrimmedID = this._texture._updateID);
- var t = this._texture,
- e = this.vertexTrimmedData,
- r = t.orig,
- n = this._anchor,
- i = this.transform.worldTransform,
- o = i.a,
- s = i.b,
- a = i.c,
- u = i.d,
- c = i.tx,
- h = i.ty,
- l = -n._x * r.width,
- d = l + r.width,
- f = -n._y * r.height,
- p = f + r.height;
- (e[0] = o * l + a * f + c),
- (e[1] = u * f + s * l + h),
- (e[2] = o * d + a * f + c),
- (e[3] = u * f + s * d + h),
- (e[4] = o * d + a * p + c),
- (e[5] = u * p + s * d + h),
- (e[6] = o * l + a * p + c),
- (e[7] = u * p + s * l + h);
- }),
- (e.prototype._render = function (t) {
- this.calculateVertices(),
- t.batch.setObjectRenderer(t.plugins[this.pluginName]),
- t.plugins[this.pluginName].render(this);
- }),
- (e.prototype._calculateBounds = function () {
- var t = this._texture.trim,
- e = this._texture.orig;
- !t || (t.width === e.width && t.height === e.height)
- ? (this.calculateVertices(), this._bounds.addQuad(this.vertexData))
- : (this.calculateTrimmedVertices(),
- this._bounds.addQuad(this.vertexTrimmedData));
- }),
- (e.prototype.getLocalBounds = function (e) {
- return 0 === this.children.length
- ? (this._localBounds || (this._localBounds = new kD()),
- (this._localBounds.minX =
- this._texture.orig.width * -this._anchor._x),
- (this._localBounds.minY =
- this._texture.orig.height * -this._anchor._y),
- (this._localBounds.maxX =
- this._texture.orig.width * (1 - this._anchor._x)),
- (this._localBounds.maxY =
- this._texture.orig.height * (1 - this._anchor._y)),
- e ||
- (this._localBoundsRect || (this._localBoundsRect = new TD()),
- (e = this._localBoundsRect)),
- this._localBounds.getRectangle(e))
- : t.prototype.getLocalBounds.call(this, e);
- }),
- (e.prototype.containsPoint = function (t) {
- this.worldTransform.applyInverse(t, xB);
- var e = this._texture.orig.width,
- r = this._texture.orig.height,
- n = -e * this.anchor.x,
- i = 0;
- return (
- xB.x >= n &&
- xB.x < n + e &&
- ((i = -r * this.anchor.y), xB.y >= i && xB.y < i + r)
- );
- }),
- (e.prototype.destroy = function (e) {
- if (
- (t.prototype.destroy.call(this, e),
- this._texture.off('update', this._onTextureUpdate, this),
- (this._anchor = null),
- 'boolean' == typeof e ? e : e && e.texture)
- ) {
- var r = 'boolean' == typeof e ? e : e && e.baseTexture;
- this._texture.destroy(!!r);
- }
- this._texture = null;
- }),
- (e.from = function (t, r) {
- return new e(t instanceof EL ? t : EL.from(t, r));
- }),
- Object.defineProperty(e.prototype, 'roundPixels', {
- get: function () {
- return this._roundPixels;
- },
- set: function (t) {
- this._roundPixels !== t && (this._transformID = -1),
- (this._roundPixels = t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'width', {
- get: function () {
- return Math.abs(this.scale.x) * this._texture.orig.width;
- },
- set: function (t) {
- var e = nD(this.scale.x) || 1;
- (this.scale.x = (e * t) / this._texture.orig.width),
- (this._width = t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'height', {
- get: function () {
- return Math.abs(this.scale.y) * this._texture.orig.height;
- },
- set: function (t) {
- var e = nD(this.scale.y) || 1;
- (this.scale.y = (e * t) / this._texture.orig.height),
- (this._height = t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'anchor', {
- get: function () {
- return this._anchor;
- },
- set: function (t) {
- this._anchor.copyFrom(t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'tint', {
- get: function () {
- return this._tint;
- },
- set: function (t) {
- (this._tint = t),
- (this._tintRGB = (t >> 16) + (65280 & t) + ((255 & t) << 16));
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'texture', {
- get: function () {
- return this._texture;
- },
- set: function (t) {
- this._texture !== t &&
- (this._texture &&
- this._texture.off('update', this._onTextureUpdate, this),
- (this._texture = t || EL.EMPTY),
- (this._cachedTint = 16777215),
- (this._textureID = -1),
- (this._textureTrimmedID = -1),
- t &&
- (t.baseTexture.valid
- ? this._onTextureUpdate()
- : t.once('update', this._onTextureUpdate, this)));
- },
- enumerable: !1,
- configurable: !0,
- }),
- e
- );
- })(VD),
- wB = function (t, e) {
- return (
- (wB =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- wB(t, e)
- );
- };
- !(function (t) {
- (t[(t.LINEAR_VERTICAL = 0)] = 'LINEAR_VERTICAL'),
- (t[(t.LINEAR_HORIZONTAL = 1)] = 'LINEAR_HORIZONTAL');
- })(TB || (TB = {}));
- var RB = {
- align: 'left',
- breakWords: !1,
- dropShadow: !1,
- dropShadowAlpha: 1,
- dropShadowAngle: Math.PI / 6,
- dropShadowBlur: 0,
- dropShadowColor: 'black',
- dropShadowDistance: 5,
- fill: 'black',
- fillGradientType: TB.LINEAR_VERTICAL,
- fillGradientStops: [],
- fontFamily: 'Arial',
- fontSize: 26,
- fontStyle: 'normal',
- fontVariant: 'normal',
- fontWeight: 'normal',
- letterSpacing: 0,
- lineHeight: 0,
- lineJoin: 'miter',
- miterLimit: 10,
- padding: 0,
- stroke: 'black',
- strokeThickness: 0,
- textBaseline: 'alphabetic',
- trim: !1,
- whiteSpace: 'pre',
- wordWrap: !1,
- wordWrapWidth: 100,
- leading: 0,
- },
- CB = [
- 'serif',
- 'sans-serif',
- 'monospace',
- 'cursive',
- 'fantasy',
- 'system-ui',
- ],
- PB = (function () {
- function t(t) {
- (this.styleID = 0), this.reset(), IB(this, t, t);
- }
- return (
- (t.prototype.clone = function () {
- var e = {};
- return IB(e, this, RB), new t(e);
- }),
- (t.prototype.reset = function () {
- IB(this, RB, RB);
- }),
- Object.defineProperty(t.prototype, 'align', {
- get: function () {
- return this._align;
- },
- set: function (t) {
- this._align !== t && ((this._align = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'breakWords', {
- get: function () {
- return this._breakWords;
- },
- set: function (t) {
- this._breakWords !== t && ((this._breakWords = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'dropShadow', {
- get: function () {
- return this._dropShadow;
- },
- set: function (t) {
- this._dropShadow !== t && ((this._dropShadow = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'dropShadowAlpha', {
- get: function () {
- return this._dropShadowAlpha;
- },
- set: function (t) {
- this._dropShadowAlpha !== t &&
- ((this._dropShadowAlpha = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'dropShadowAngle', {
- get: function () {
- return this._dropShadowAngle;
- },
- set: function (t) {
- this._dropShadowAngle !== t &&
- ((this._dropShadowAngle = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'dropShadowBlur', {
- get: function () {
- return this._dropShadowBlur;
- },
- set: function (t) {
- this._dropShadowBlur !== t &&
- ((this._dropShadowBlur = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'dropShadowColor', {
- get: function () {
- return this._dropShadowColor;
- },
- set: function (t) {
- var e = OB(t);
- this._dropShadowColor !== e &&
- ((this._dropShadowColor = e), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'dropShadowDistance', {
- get: function () {
- return this._dropShadowDistance;
- },
- set: function (t) {
- this._dropShadowDistance !== t &&
- ((this._dropShadowDistance = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'fill', {
- get: function () {
- return this._fill;
- },
- set: function (t) {
- var e = OB(t);
- this._fill !== e && ((this._fill = e), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'fillGradientType', {
- get: function () {
- return this._fillGradientType;
- },
- set: function (t) {
- this._fillGradientType !== t &&
- ((this._fillGradientType = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'fillGradientStops', {
- get: function () {
- return this._fillGradientStops;
- },
- set: function (t) {
- (function (t, e) {
- if (!Array.isArray(t) || !Array.isArray(e)) return !1;
- if (t.length !== e.length) return !1;
- for (var r = 0; r < t.length; ++r) if (t[r] !== e[r]) return !1;
- return !0;
- })(this._fillGradientStops, t) ||
- ((this._fillGradientStops = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'fontFamily', {
- get: function () {
- return this._fontFamily;
- },
- set: function (t) {
- this.fontFamily !== t && ((this._fontFamily = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'fontSize', {
- get: function () {
- return this._fontSize;
- },
- set: function (t) {
- this._fontSize !== t && ((this._fontSize = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'fontStyle', {
- get: function () {
- return this._fontStyle;
- },
- set: function (t) {
- this._fontStyle !== t && ((this._fontStyle = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'fontVariant', {
- get: function () {
- return this._fontVariant;
- },
- set: function (t) {
- this._fontVariant !== t &&
- ((this._fontVariant = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'fontWeight', {
- get: function () {
- return this._fontWeight;
- },
- set: function (t) {
- this._fontWeight !== t && ((this._fontWeight = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'letterSpacing', {
- get: function () {
- return this._letterSpacing;
- },
- set: function (t) {
- this._letterSpacing !== t &&
- ((this._letterSpacing = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'lineHeight', {
- get: function () {
- return this._lineHeight;
- },
- set: function (t) {
- this._lineHeight !== t && ((this._lineHeight = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'leading', {
- get: function () {
- return this._leading;
- },
- set: function (t) {
- this._leading !== t && ((this._leading = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'lineJoin', {
- get: function () {
- return this._lineJoin;
- },
- set: function (t) {
- this._lineJoin !== t && ((this._lineJoin = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'miterLimit', {
- get: function () {
- return this._miterLimit;
- },
- set: function (t) {
- this._miterLimit !== t && ((this._miterLimit = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'padding', {
- get: function () {
- return this._padding;
- },
- set: function (t) {
- this._padding !== t && ((this._padding = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'stroke', {
- get: function () {
- return this._stroke;
- },
- set: function (t) {
- var e = OB(t);
- this._stroke !== e && ((this._stroke = e), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'strokeThickness', {
- get: function () {
- return this._strokeThickness;
- },
- set: function (t) {
- this._strokeThickness !== t &&
- ((this._strokeThickness = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'textBaseline', {
- get: function () {
- return this._textBaseline;
- },
- set: function (t) {
- this._textBaseline !== t &&
- ((this._textBaseline = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'trim', {
- get: function () {
- return this._trim;
- },
- set: function (t) {
- this._trim !== t && ((this._trim = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'whiteSpace', {
- get: function () {
- return this._whiteSpace;
- },
- set: function (t) {
- this._whiteSpace !== t && ((this._whiteSpace = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'wordWrap', {
- get: function () {
- return this._wordWrap;
- },
- set: function (t) {
- this._wordWrap !== t && ((this._wordWrap = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'wordWrapWidth', {
- get: function () {
- return this._wordWrapWidth;
- },
- set: function (t) {
- this._wordWrapWidth !== t &&
- ((this._wordWrapWidth = t), this.styleID++);
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype.toFontString = function () {
- var t =
- 'number' == typeof this.fontSize
- ? this.fontSize + 'px'
- : this.fontSize,
- e = this.fontFamily;
- Array.isArray(this.fontFamily) || (e = this.fontFamily.split(','));
- for (var r = e.length - 1; r >= 0; r--) {
- var n = e[r].trim();
- !/([\"\'])[^\'\"]+\1/.test(n) &&
- CB.indexOf(n) < 0 &&
- (n = '"' + n + '"'),
- (e[r] = n);
- }
- return (
- this.fontStyle +
- ' ' +
- this.fontVariant +
- ' ' +
- this.fontWeight +
- ' ' +
- t +
- ' ' +
- e.join(',')
- );
- }),
- t
- );
- })();
- function AB(t) {
- return 'number' == typeof t
- ? WM(t)
- : ('string' == typeof t &&
- 0 === t.indexOf('0x') &&
- (t = t.replace('0x', '#')),
- t);
- }
- function OB(t) {
- if (Array.isArray(t)) {
- for (var e = 0; e < t.length; ++e) t[e] = AB(t[e]);
- return t;
- }
- return AB(t);
- }
- function IB(t, e, r) {
- for (var n in r)
- Array.isArray(e[n]) ? (t[n] = e[n].slice()) : (t[n] = e[n]);
- }
- var MB = { willReadFrequently: !0 },
- DB = (function () {
- function t(t, e, r, n, i, o, s, a, u) {
- (this.text = t),
- (this.style = e),
- (this.width = r),
- (this.height = n),
- (this.lines = i),
- (this.lineWidths = o),
- (this.lineHeight = s),
- (this.maxLineWidth = a),
- (this.fontProperties = u);
- }
- return (
- (t.measureText = function (e, r, n, i) {
- void 0 === i && (i = t._canvas), (n = null == n ? r.wordWrap : n);
- var o = r.toFontString(),
- s = t.measureFont(o);
- 0 === s.fontSize &&
- ((s.fontSize = r.fontSize), (s.ascent = r.fontSize));
- var a = i.getContext('2d', MB);
- a.font = o;
- for (
- var u = (n ? t.wordWrap(e, r, i) : e).split(/(?:\r\n|\r|\n)/),
- c = new Array(u.length),
- h = 0,
- l = 0;
- l < u.length;
- l++
- ) {
- var d =
- a.measureText(u[l]).width + (u[l].length - 1) * r.letterSpacing;
- (c[l] = d), (h = Math.max(h, d));
- }
- var f = h + r.strokeThickness;
- r.dropShadow && (f += r.dropShadowDistance);
- var p = r.lineHeight || s.fontSize + r.strokeThickness,
- v =
- Math.max(p, s.fontSize + r.strokeThickness) +
- (u.length - 1) * (p + r.leading);
- return (
- r.dropShadow && (v += r.dropShadowDistance),
- new t(e, r, f, v, u, c, p + r.leading, h, s)
- );
- }),
- (t.wordWrap = function (e, r, n) {
- void 0 === n && (n = t._canvas);
- for (
- var i = n.getContext('2d', MB),
- o = 0,
- s = '',
- a = '',
- u = Object.create(null),
- c = r.letterSpacing,
- h = r.whiteSpace,
- l = t.collapseSpaces(h),
- d = t.collapseNewlines(h),
- f = !l,
- p = r.wordWrapWidth + c,
- v = t.tokenize(e),
- m = 0;
- m < v.length;
- m++
- ) {
- var y = v[m];
- if (t.isNewline(y)) {
- if (!d) {
- (a += t.addLine(s)), (f = !l), (s = ''), (o = 0);
- continue;
- }
- y = ' ';
- }
- if (l) {
- var g = t.isBreakingSpace(y),
- _ = t.isBreakingSpace(s[s.length - 1]);
- if (g && _) continue;
- }
- var b = t.getFromCache(y, c, u, i);
- if (b > p)
- if (
- ('' !== s && ((a += t.addLine(s)), (s = ''), (o = 0)),
- t.canBreakWords(y, r.breakWords))
- )
- for (var T = t.wordWrapSplit(y), x = 0; x < T.length; x++) {
- for (var E = T[x], S = 1; T[x + S]; ) {
- var w = T[x + S],
- R = E[E.length - 1];
- if (t.canBreakChars(R, w, y, x, r.breakWords)) break;
- (E += w), S++;
- }
- x += E.length - 1;
- var C = t.getFromCache(E, c, u, i);
- C + o > p &&
- ((a += t.addLine(s)), (f = !1), (s = ''), (o = 0)),
- (s += E),
- (o += C);
- }
- else {
- s.length > 0 && ((a += t.addLine(s)), (s = ''), (o = 0));
- var P = m === v.length - 1;
- (a += t.addLine(y, !P)), (f = !1), (s = ''), (o = 0);
- }
- else
- b + o > p && ((f = !1), (a += t.addLine(s)), (s = ''), (o = 0)),
- (s.length > 0 || !t.isBreakingSpace(y) || f) &&
- ((s += y), (o += b));
- }
- return (a += t.addLine(s, !1));
- }),
- (t.addLine = function (e, r) {
- return (
- void 0 === r && (r = !0),
- (e = t.trimRight(e)),
- (e = r ? e + '\n' : e)
- );
- }),
- (t.getFromCache = function (t, e, r, n) {
- var i = r[t];
- if ('number' != typeof i) {
- var o = t.length * e;
- (i = n.measureText(t).width + o), (r[t] = i);
- }
- return i;
- }),
- (t.collapseSpaces = function (t) {
- return 'normal' === t || 'pre-line' === t;
- }),
- (t.collapseNewlines = function (t) {
- return 'normal' === t;
- }),
- (t.trimRight = function (e) {
- if ('string' != typeof e) return '';
- for (var r = e.length - 1; r >= 0; r--) {
- var n = e[r];
- if (!t.isBreakingSpace(n)) break;
- e = e.slice(0, -1);
- }
- return e;
- }),
- (t.isNewline = function (e) {
- return (
- 'string' == typeof e && t._newlines.indexOf(e.charCodeAt(0)) >= 0
- );
- }),
- (t.isBreakingSpace = function (e, r) {
- return (
- 'string' == typeof e &&
- t._breakingSpaces.indexOf(e.charCodeAt(0)) >= 0
- );
- }),
- (t.tokenize = function (e) {
- var r = [],
- n = '';
- if ('string' != typeof e) return r;
- for (var i = 0; i < e.length; i++) {
- var o = e[i],
- s = e[i + 1];
- t.isBreakingSpace(o, s) || t.isNewline(o)
- ? ('' !== n && (r.push(n), (n = '')), r.push(o))
- : (n += o);
- }
- return '' !== n && r.push(n), r;
- }),
- (t.canBreakWords = function (t, e) {
- return e;
- }),
- (t.canBreakChars = function (t, e, r, n, i) {
- return !0;
- }),
- (t.wordWrapSplit = function (t) {
- return t.split('');
- }),
- (t.measureFont = function (e) {
- if (t._fonts[e]) return t._fonts[e];
- var r = { ascent: 0, descent: 0, fontSize: 0 },
- n = t._canvas,
- i = t._context;
- i.font = e;
- var o = t.METRICS_STRING + t.BASELINE_SYMBOL,
- s = Math.ceil(i.measureText(o).width),
- a = Math.ceil(i.measureText(t.BASELINE_SYMBOL).width),
- u = Math.ceil(t.HEIGHT_MULTIPLIER * a);
- (a = (a * t.BASELINE_MULTIPLIER) | 0),
- (n.width = s),
- (n.height = u),
- (i.fillStyle = '#f00'),
- i.fillRect(0, 0, s, u),
- (i.font = e),
- (i.textBaseline = 'alphabetic'),
- (i.fillStyle = '#000'),
- i.fillText(o, 0, a);
- var c = i.getImageData(0, 0, s, u).data,
- h = c.length,
- l = 4 * s,
- d = 0,
- f = 0,
- p = !1;
- for (d = 0; d < a; ++d) {
- for (var v = 0; v < l; v += 4)
- if (255 !== c[f + v]) {
- p = !0;
- break;
- }
- if (p) break;
- f += l;
- }
- for (r.ascent = a - d, f = h - l, p = !1, d = u; d > a; --d) {
- for (v = 0; v < l; v += 4)
- if (255 !== c[f + v]) {
- p = !0;
- break;
- }
- if (p) break;
- f -= l;
- }
- return (
- (r.descent = d - a),
- (r.fontSize = r.ascent + r.descent),
- (t._fonts[e] = r),
- r
- );
- }),
- (t.clearMetrics = function (e) {
- void 0 === e && (e = ''), e ? delete t._fonts[e] : (t._fonts = {});
- }),
- Object.defineProperty(t, '_canvas', {
- get: function () {
- if (!t.__canvas) {
- var e = void 0;
- try {
- var r = new OffscreenCanvas(0, 0),
- n = r.getContext('2d', MB);
- if (n && n.measureText) return (t.__canvas = r), r;
- e = vA.ADAPTER.createCanvas();
- } catch (t) {
- e = vA.ADAPTER.createCanvas();
- }
- (e.width = e.height = 10), (t.__canvas = e);
- }
- return t.__canvas;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t, '_context', {
- get: function () {
- return (
- t.__context || (t.__context = t._canvas.getContext('2d', MB)),
- t.__context
- );
- },
- enumerable: !1,
- configurable: !0,
- }),
- t
- );
- })();
- (DB._fonts = {}),
- (DB.METRICS_STRING = '|ÉqÅ'),
- (DB.BASELINE_SYMBOL = 'M'),
- (DB.BASELINE_MULTIPLIER = 1.4),
- (DB.HEIGHT_MULTIPLIER = 2),
- (DB._newlines = [10, 13]),
- (DB._breakingSpaces = [
- 9, 32, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8200, 8201, 8202, 8287,
- 12288,
- ]);
- var LB = { texture: !0, children: !1, baseTexture: !0 },
- FB = (function (t) {
- function e(e, r, n) {
- var i = this,
- o = !1;
- n || ((n = vA.ADAPTER.createCanvas()), (o = !0)),
- (n.width = 3),
- (n.height = 3);
- var s = EL.from(n);
- return (
- (s.orig = new TD()),
- (s.trim = new TD()),
- ((i = t.call(this, s) || this)._ownCanvas = o),
- (i.canvas = n),
- (i.context = n.getContext('2d', { willReadFrequently: !0 })),
- (i._resolution = vA.RESOLUTION),
- (i._autoResolution = !0),
- (i._text = null),
- (i._style = null),
- (i._styleListener = null),
- (i._font = ''),
- (i.text = e),
- (i.style = r),
- (i.localStyleID = -1),
- i
- );
- }
- return (
- (function (t, e) {
- function r() {
- this.constructor = t;
- }
- wB(t, e),
- (t.prototype =
- null === e
- ? Object.create(e)
- : ((r.prototype = e.prototype), new r()));
- })(e, t),
- (e.prototype.updateText = function (t) {
- var r = this._style;
- if (
- (this.localStyleID !== r.styleID &&
- ((this.dirty = !0), (this.localStyleID = r.styleID)),
- this.dirty || !t)
- ) {
- this._font = this._style.toFontString();
- var n,
- i,
- o = this.context,
- s = DB.measureText(
- this._text || ' ',
- this._style,
- this._style.wordWrap,
- this.canvas
- ),
- a = s.width,
- u = s.height,
- c = s.lines,
- h = s.lineHeight,
- l = s.lineWidths,
- d = s.maxLineWidth,
- f = s.fontProperties;
- (this.canvas.width = Math.ceil(
- Math.ceil(Math.max(1, a) + 2 * r.padding) * this._resolution
- )),
- (this.canvas.height = Math.ceil(
- Math.ceil(Math.max(1, u) + 2 * r.padding) * this._resolution
- )),
- o.scale(this._resolution, this._resolution),
- o.clearRect(0, 0, this.canvas.width, this.canvas.height),
- (o.font = this._font),
- (o.lineWidth = r.strokeThickness),
- (o.textBaseline = r.textBaseline),
- (o.lineJoin = r.lineJoin),
- (o.miterLimit = r.miterLimit);
- for (var p = r.dropShadow ? 2 : 1, v = 0; v < p; ++v) {
- var m = r.dropShadow && 0 === v,
- y = m ? Math.ceil(Math.max(1, u) + 2 * r.padding) : 0,
- g = y * this._resolution;
- if (m) {
- (o.fillStyle = 'black'), (o.strokeStyle = 'black');
- var _ = r.dropShadowColor,
- b = HM('number' == typeof _ ? _ : YM(_)),
- T = r.dropShadowBlur * this._resolution,
- x = r.dropShadowDistance * this._resolution;
- (o.shadowColor =
- 'rgba(' +
- 255 * b[0] +
- ',' +
- 255 * b[1] +
- ',' +
- 255 * b[2] +
- ',' +
- r.dropShadowAlpha +
- ')'),
- (o.shadowBlur = T),
- (o.shadowOffsetX = Math.cos(r.dropShadowAngle) * x),
- (o.shadowOffsetY = Math.sin(r.dropShadowAngle) * x + g);
- } else
- (o.fillStyle = this._generateFillStyle(r, c, s)),
- (o.strokeStyle = r.stroke),
- (o.shadowColor = 'black'),
- (o.shadowBlur = 0),
- (o.shadowOffsetX = 0),
- (o.shadowOffsetY = 0);
- var E = (h - f.fontSize) / 2;
- (!e.nextLineHeightBehavior || h - f.fontSize < 0) && (E = 0);
- for (var S = 0; S < c.length; S++)
- (n = r.strokeThickness / 2),
- (i = r.strokeThickness / 2 + S * h + f.ascent + E),
- 'right' === r.align
- ? (n += d - l[S])
- : 'center' === r.align && (n += (d - l[S]) / 2),
- r.stroke &&
- r.strokeThickness &&
- this.drawLetterSpacing(
- c[S],
- n + r.padding,
- i + r.padding - y,
- !0
- ),
- r.fill &&
- this.drawLetterSpacing(
- c[S],
- n + r.padding,
- i + r.padding - y
- );
- }
- this.updateTexture();
- }
- }),
- (e.prototype.drawLetterSpacing = function (t, r, n, i) {
- void 0 === i && (i = !1);
- var o = this._style.letterSpacing,
- s =
- e.experimentalLetterSpacing &&
- ('letterSpacing' in CanvasRenderingContext2D.prototype ||
- 'textLetterSpacing' in CanvasRenderingContext2D.prototype);
- if (0 === o || s)
- return (
- s &&
- ((this.context.letterSpacing = o),
- (this.context.textLetterSpacing = o)),
- void (i
- ? this.context.strokeText(t, r, n)
- : this.context.fillText(t, r, n))
- );
- for (
- var a = r,
- u = Array.from ? Array.from(t) : t.split(''),
- c = this.context.measureText(t).width,
- h = 0,
- l = 0;
- l < u.length;
- ++l
- ) {
- var d = u[l];
- i
- ? this.context.strokeText(d, a, n)
- : this.context.fillText(d, a, n);
- for (var f = '', p = l + 1; p < u.length; ++p) f += u[p];
- (a += c - (h = this.context.measureText(f).width) + o), (c = h);
- }
- }),
- (e.prototype.updateTexture = function () {
- var t = this.canvas;
- if (this._style.trim) {
- var e = (function (t) {
- var e,
- r,
- n,
- i = t.width,
- o = t.height,
- s = t.getContext('2d', { willReadFrequently: !0 }),
- a = s.getImageData(0, 0, i, o).data,
- u = a.length,
- c = { top: null, left: null, right: null, bottom: null },
- h = null;
- for (e = 0; e < u; e += 4)
- 0 !== a[e + 3] &&
- ((r = (e / 4) % i),
- (n = ~~(e / 4 / i)),
- null === c.top && (c.top = n),
- (null === c.left || r < c.left) && (c.left = r),
- (null === c.right || c.right < r) && (c.right = r + 1),
- (null === c.bottom || c.bottom < n) && (c.bottom = n));
- return (
- null !== c.top &&
- ((i = c.right - c.left),
- (o = c.bottom - c.top + 1),
- (h = s.getImageData(c.left, c.top, i, o))),
- { height: o, width: i, data: h }
- );
- })(t);
- e.data &&
- ((t.width = e.width),
- (t.height = e.height),
- this.context.putImageData(e.data, 0, 0));
- }
- var r = this._texture,
- n = this._style,
- i = n.trim ? 0 : n.padding,
- o = r.baseTexture;
- (r.trim.width = r._frame.width = t.width / this._resolution),
- (r.trim.height = r._frame.height = t.height / this._resolution),
- (r.trim.x = -i),
- (r.trim.y = -i),
- (r.orig.width = r._frame.width - 2 * i),
- (r.orig.height = r._frame.height - 2 * i),
- this._onTextureUpdate(),
- o.setRealSize(t.width, t.height, this._resolution),
- r.updateUvs(),
- (this.dirty = !1);
- }),
- (e.prototype._render = function (e) {
- this._autoResolution &&
- this._resolution !== e.resolution &&
- ((this._resolution = e.resolution), (this.dirty = !0)),
- this.updateText(!0),
- t.prototype._render.call(this, e);
- }),
- (e.prototype.updateTransform = function () {
- this.updateText(!0), t.prototype.updateTransform.call(this);
- }),
- (e.prototype.getBounds = function (e, r) {
- return (
- this.updateText(!0),
- -1 === this._textureID && (e = !1),
- t.prototype.getBounds.call(this, e, r)
- );
- }),
- (e.prototype.getLocalBounds = function (e) {
- return this.updateText(!0), t.prototype.getLocalBounds.call(this, e);
- }),
- (e.prototype._calculateBounds = function () {
- this.calculateVertices(), this._bounds.addQuad(this.vertexData);
- }),
- (e.prototype._generateFillStyle = function (t, e, r) {
- var n,
- i = t.fill;
- if (!Array.isArray(i)) return i;
- if (1 === i.length) return i[0];
- var o = t.dropShadow ? t.dropShadowDistance : 0,
- s = t.padding || 0,
- a = this.canvas.width / this._resolution - o - 2 * s,
- u = this.canvas.height / this._resolution - o - 2 * s,
- c = i.slice(),
- h = t.fillGradientStops.slice();
- if (!h.length)
- for (var l = c.length + 1, d = 1; d < l; ++d) h.push(d / l);
- if (
- (c.unshift(i[0]),
- h.unshift(0),
- c.push(i[i.length - 1]),
- h.push(1),
- t.fillGradientType === TB.LINEAR_VERTICAL)
- ) {
- n = this.context.createLinearGradient(a / 2, s, a / 2, u + s);
- var f = r.fontProperties.fontSize + t.strokeThickness;
- for (d = 0; d < e.length; d++) {
- var p = r.lineHeight * (d - 1) + f,
- v = r.lineHeight * d,
- m = v;
- d > 0 && p > v && (m = (v + p) / 2);
- var y = v + f,
- g = r.lineHeight * (d + 1),
- _ = y;
- d + 1 < e.length && g < y && (_ = (y + g) / 2);
- for (var b = (_ - m) / u, T = 0; T < c.length; T++) {
- var x = 0;
- x = 'number' == typeof h[T] ? h[T] : T / c.length;
- var E = Math.min(1, Math.max(0, m / u + x * b));
- (E = Number(E.toFixed(5))), n.addColorStop(E, c[T]);
- }
- }
- } else {
- n = this.context.createLinearGradient(s, u / 2, a + s, u / 2);
- var S = c.length + 1,
- w = 1;
- for (d = 0; d < c.length; d++) {
- var R = void 0;
- (R = 'number' == typeof h[d] ? h[d] : w / S),
- n.addColorStop(R, c[d]),
- w++;
- }
- }
- return n;
- }),
- (e.prototype.destroy = function (e) {
- 'boolean' == typeof e && (e = { children: e }),
- (e = Object.assign({}, LB, e)),
- t.prototype.destroy.call(this, e),
- this._ownCanvas && (this.canvas.height = this.canvas.width = 0),
- (this.context = null),
- (this.canvas = null),
- (this._style = null);
- }),
- Object.defineProperty(e.prototype, 'width', {
- get: function () {
- return (
- this.updateText(!0),
- Math.abs(this.scale.x) * this._texture.orig.width
- );
- },
- set: function (t) {
- this.updateText(!0);
- var e = nD(this.scale.x) || 1;
- (this.scale.x = (e * t) / this._texture.orig.width),
- (this._width = t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'height', {
- get: function () {
- return (
- this.updateText(!0),
- Math.abs(this.scale.y) * this._texture.orig.height
- );
- },
- set: function (t) {
- this.updateText(!0);
- var e = nD(this.scale.y) || 1;
- (this.scale.y = (e * t) / this._texture.orig.height),
- (this._height = t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'style', {
- get: function () {
- return this._style;
- },
- set: function (t) {
- (t = t || {}),
- (this._style = t instanceof PB ? t : new PB(t)),
- (this.localStyleID = -1),
- (this.dirty = !0);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'text', {
- get: function () {
- return this._text;
- },
- set: function (t) {
- (t = String(null == t ? '' : t)),
- this._text !== t && ((this._text = t), (this.dirty = !0));
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'resolution', {
- get: function () {
- return this._resolution;
- },
- set: function (t) {
- (this._autoResolution = !1),
- this._resolution !== t &&
- ((this._resolution = t), (this.dirty = !0));
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.nextLineHeightBehavior = !1),
- (e.experimentalLetterSpacing = !1),
- e
- );
- })(SB);
- vA.UPLOADS_PER_FRAME = 4;
- var NB = function (t, e) {
- return (
- (NB =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- NB(t, e)
- );
- };
- var kB = (function () {
- function t(t) {
- (this.maxItemsPerFrame = t), (this.itemsLeft = 0);
- }
- return (
- (t.prototype.beginFrame = function () {
- this.itemsLeft = this.maxItemsPerFrame;
- }),
- (t.prototype.allowedToUpload = function () {
- return this.itemsLeft-- > 0;
- }),
- t
- );
- })();
- function BB(t, e) {
- var r = !1;
- if (t && t._textures && t._textures.length)
- for (var n = 0; n < t._textures.length; n++)
- if (t._textures[n] instanceof EL) {
- var i = t._textures[n].baseTexture;
- -1 === e.indexOf(i) && (e.push(i), (r = !0));
- }
- return r;
- }
- function GB(t, e) {
- if (t.baseTexture instanceof aL) {
- var r = t.baseTexture;
- return -1 === e.indexOf(r) && e.push(r), !0;
- }
- return !1;
- }
- function UB(t, e) {
- if (t._texture && t._texture instanceof EL) {
- var r = t._texture.baseTexture;
- return -1 === e.indexOf(r) && e.push(r), !0;
- }
- return !1;
- }
- function jB(t, e) {
- return e instanceof FB && (e.updateText(!0), !0);
- }
- function XB(t, e) {
- if (e instanceof PB) {
- var r = e.toFontString();
- return DB.measureFont(r), !0;
- }
- return !1;
- }
- function VB(t, e) {
- if (t instanceof FB) {
- -1 === e.indexOf(t.style) && e.push(t.style),
- -1 === e.indexOf(t) && e.push(t);
- var r = t._texture.baseTexture;
- return -1 === e.indexOf(r) && e.push(r), !0;
- }
- return !1;
- }
- function HB(t, e) {
- return t instanceof PB && (-1 === e.indexOf(t) && e.push(t), !0);
- }
- var WB = (function () {
- function t(t) {
- var e = this;
- (this.limiter = new kB(vA.UPLOADS_PER_FRAME)),
- (this.renderer = t),
- (this.uploadHookHelper = null),
- (this.queue = []),
- (this.addHooks = []),
- (this.uploadHooks = []),
- (this.completes = []),
- (this.ticking = !1),
- (this.delayedTick = function () {
- e.queue && e.prepareItems();
- }),
- this.registerFindHook(VB),
- this.registerFindHook(HB),
- this.registerFindHook(BB),
- this.registerFindHook(GB),
- this.registerFindHook(UB),
- this.registerUploadHook(jB),
- this.registerUploadHook(XB);
- }
- return (
- (t.prototype.upload = function (t, e) {
- var r = this;
- return (
- 'function' == typeof t && ((e = t), (t = null)),
- e &&
- aD(
- '6.5.0',
- 'BasePrepare.upload callback is deprecated, use the return Promise instead.'
- ),
- new Promise(function (n) {
- t && r.add(t);
- var i = function () {
- null == e || e(), n();
- };
- r.queue.length
- ? (r.completes.push(i),
- r.ticking ||
- ((r.ticking = !0), qD.system.addOnce(r.tick, r, YD.UTILITY)))
- : i();
- })
- );
- }),
- (t.prototype.tick = function () {
- setTimeout(this.delayedTick, 0);
- }),
- (t.prototype.prepareItems = function () {
- for (
- this.limiter.beginFrame();
- this.queue.length && this.limiter.allowedToUpload();
- ) {
- var t = this.queue[0],
- e = !1;
- if (t && !t._destroyed)
- for (var r = 0, n = this.uploadHooks.length; r < n; r++)
- if (this.uploadHooks[r](this.uploadHookHelper, t)) {
- this.queue.shift(), (e = !0);
- break;
- }
- e || this.queue.shift();
- }
- if (this.queue.length) qD.system.addOnce(this.tick, this, YD.UTILITY);
- else {
- this.ticking = !1;
- var i = this.completes.slice(0);
- this.completes.length = 0;
- for (r = 0, n = i.length; r < n; r++) i[r]();
- }
- }),
- (t.prototype.registerFindHook = function (t) {
- return t && this.addHooks.push(t), this;
- }),
- (t.prototype.registerUploadHook = function (t) {
- return t && this.uploadHooks.push(t), this;
- }),
- (t.prototype.add = function (t) {
- for (
- var e = 0, r = this.addHooks.length;
- e < r && !this.addHooks[e](t, this.queue);
- e++
- );
- if (t instanceof VD)
- for (e = t.children.length - 1; e >= 0; e--) this.add(t.children[e]);
- return this;
- }),
- (t.prototype.destroy = function () {
- this.ticking && qD.system.remove(this.tick, this),
- (this.ticking = !1),
- (this.addHooks = null),
- (this.uploadHooks = null),
- (this.renderer = null),
- (this.completes = null),
- (this.queue = null),
- (this.limiter = null),
- (this.uploadHookHelper = null);
- }),
- t
- );
- })();
- function YB(t, e) {
- return (
- e instanceof aL && (e._glTextures[t.CONTEXT_UID] || t.texture.bind(e), !0)
- );
- }
- function zB(t, e) {
- if (!(e instanceof _B)) return !1;
- var r = e.geometry;
- e.finishPoly(), r.updateBatches();
- for (var n = r.batches, i = 0; i < n.length; i++) {
- var o = n[i].style.texture;
- o && YB(t, o.baseTexture);
- }
- return r.batchable || t.geometry.bind(r, e._resolveDirectShader(t)), !0;
- }
- function ZB(t, e) {
- return t instanceof _B && (e.push(t), !0);
- }
- var JB = (function (t) {
- function e(e) {
- var r = t.call(this, e) || this;
- return (
- (r.uploadHookHelper = r.renderer),
- r.registerFindHook(ZB),
- r.registerUploadHook(YB),
- r.registerUploadHook(zB),
- r
- );
- }
- return (
- (function (t, e) {
- function r() {
- this.constructor = t;
- }
- NB(t, e),
- (t.prototype =
- null === e
- ? Object.create(e)
- : ((r.prototype = e.prototype), new r()));
- })(e, t),
- (e.extension = { name: 'prepare', type: HD.RendererPlugin }),
- e
- );
- })(WB),
- KB = (function () {
- function t(t, e, r) {
- void 0 === r && (r = null),
- (this.linkedSheets = []),
- (this._texture = t instanceof EL ? t : null),
- (this.baseTexture = t instanceof aL ? t : this._texture.baseTexture),
- (this.textures = {}),
- (this.animations = {}),
- (this.data = e);
- var n = this.baseTexture.resource;
- (this.resolution = this._updateResolution(r || (n ? n.url : null))),
- (this._frames = this.data.frames),
- (this._frameKeys = Object.keys(this._frames)),
- (this._batchIndex = 0),
- (this._callback = null);
- }
- return (
- (t.prototype._updateResolution = function (t) {
- void 0 === t && (t = null);
- var e = this.data.meta.scale,
- r = pD(t, null);
- return (
- null === r && (r = void 0 !== e ? parseFloat(e) : 1),
- 1 !== r && this.baseTexture.setResolution(r),
- r
- );
- }),
- (t.prototype.parse = function (e) {
- var r = this;
- return (
- e &&
- aD(
- '6.5.0',
- 'Spritesheet.parse callback is deprecated, use the return Promise instead.'
- ),
- new Promise(function (n) {
- (r._callback = function (t) {
- null == e || e(t), n(t);
- }),
- (r._batchIndex = 0),
- r._frameKeys.length <= t.BATCH_SIZE
- ? (r._processFrames(0),
- r._processAnimations(),
- r._parseComplete())
- : r._nextBatch();
- })
- );
- }),
- (t.prototype._processFrames = function (e) {
- for (
- var r = e, n = t.BATCH_SIZE;
- r - e < n && r < this._frameKeys.length;
- ) {
- var i = this._frameKeys[r],
- o = this._frames[i],
- s = o.frame;
- if (s) {
- var a = null,
- u = null,
- c = !1 !== o.trimmed && o.sourceSize ? o.sourceSize : o.frame,
- h = new TD(
- 0,
- 0,
- Math.floor(c.w) / this.resolution,
- Math.floor(c.h) / this.resolution
- );
- (a = o.rotated
- ? new TD(
- Math.floor(s.x) / this.resolution,
- Math.floor(s.y) / this.resolution,
- Math.floor(s.h) / this.resolution,
- Math.floor(s.w) / this.resolution
- )
- : new TD(
- Math.floor(s.x) / this.resolution,
- Math.floor(s.y) / this.resolution,
- Math.floor(s.w) / this.resolution,
- Math.floor(s.h) / this.resolution
- )),
- !1 !== o.trimmed &&
- o.spriteSourceSize &&
- (u = new TD(
- Math.floor(o.spriteSourceSize.x) / this.resolution,
- Math.floor(o.spriteSourceSize.y) / this.resolution,
- Math.floor(s.w) / this.resolution,
- Math.floor(s.h) / this.resolution
- )),
- (this.textures[i] = new EL(
- this.baseTexture,
- a,
- h,
- u,
- o.rotated ? 2 : 0,
- o.anchor
- )),
- EL.addToCache(this.textures[i], i);
- }
- r++;
- }
- }),
- (t.prototype._processAnimations = function () {
- var t = this.data.animations || {};
- for (var e in t) {
- this.animations[e] = [];
- for (var r = 0; r < t[e].length; r++) {
- var n = t[e][r];
- this.animations[e].push(this.textures[n]);
- }
- }
- }),
- (t.prototype._parseComplete = function () {
- var t = this._callback;
- (this._callback = null),
- (this._batchIndex = 0),
- t.call(this, this.textures);
- }),
- (t.prototype._nextBatch = function () {
- var e = this;
- this._processFrames(this._batchIndex * t.BATCH_SIZE),
- this._batchIndex++,
- setTimeout(function () {
- e._batchIndex * t.BATCH_SIZE < e._frameKeys.length
- ? e._nextBatch()
- : (e._processAnimations(), e._parseComplete());
- }, 0);
- }),
- (t.prototype.destroy = function (t) {
- var e;
- for (var r in (void 0 === t && (t = !1), this.textures))
- this.textures[r].destroy();
- (this._frames = null),
- (this._frameKeys = null),
- (this.data = null),
- (this.textures = null),
- t &&
- (null === (e = this._texture) || void 0 === e || e.destroy(),
- this.baseTexture.destroy()),
- (this._texture = null),
- (this.baseTexture = null),
- (this.linkedSheets = []);
- }),
- (t.BATCH_SIZE = 1e3),
- t
- );
- })(),
- qB = (function () {
- function t() {}
- return (
- (t.use = function (e, r) {
- var n,
- i,
- o = this,
- s = e.name + '_image';
- if (
- e.data &&
- e.type === DN.TYPE.JSON &&
- e.data.frames &&
- !o.resources[s]
- ) {
- var a =
- null ===
- (i = null === (n = e.data) || void 0 === n ? void 0 : n.meta) ||
- void 0 === i
- ? void 0
- : i.related_multi_packs;
- if (Array.isArray(a))
- for (
- var u = function (t) {
- if ('string' != typeof t) return 'continue';
- var r = t.replace('.json', ''),
- n = GM.resolve(e.url.replace(o.baseUrl, ''), t);
- if (
- o.resources[r] ||
- Object.values(o.resources).some(function (t) {
- return GM.format(GM.parse(t.url)) === n;
- })
- )
- return 'continue';
- var i = {
- crossOrigin: e.crossOrigin,
- loadType: DN.LOAD_TYPE.XHR,
- xhrType: DN.XHR_RESPONSE_TYPE.JSON,
- parentResource: e,
- metadata: e.metadata,
- };
- o.add(r, n, i);
- },
- c = 0,
- h = a;
- c < h.length;
- c++
- ) {
- u(h[c]);
- }
- var l = {
- crossOrigin: e.crossOrigin,
- metadata: e.metadata.imageMetadata,
- parentResource: e,
- },
- d = t.getResourcePath(e, o.baseUrl);
- o.add(s, d, l, function (t) {
- if (t.error) r(t.error);
- else {
- var n = new KB(t.texture, e.data, e.url);
- n.parse().then(function () {
- (e.spritesheet = n), (e.textures = n.textures), r();
- });
- }
- });
- } else r();
- }),
- (t.getResourcePath = function (t, e) {
- return t.isDataUrl
- ? t.data.meta.image
- : GM.resolve(t.url.replace(e, ''), t.data.meta.image);
- }),
- (t.extension = HD.Loader),
- t
- );
- })(),
- QB = function (t, e) {
- return (
- (QB =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- QB(t, e)
- );
- };
- function $B(t, e) {
- function r() {
- this.constructor = t;
- }
- QB(t, e),
- (t.prototype =
- null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
- }
- var tG = new _D(),
- eG = (function (t) {
- function e(e, r, n) {
- void 0 === r && (r = 100), void 0 === n && (n = 100);
- var i = t.call(this, e) || this;
- return (
- (i.tileTransform = new ND()),
- (i._width = r),
- (i._height = n),
- (i.uvMatrix = i.texture.uvMatrix || new wF(e)),
- (i.pluginName = 'tilingSprite'),
- (i.uvRespectAnchor = !1),
- i
- );
- }
- return (
- $B(e, t),
- Object.defineProperty(e.prototype, 'clampMargin', {
- get: function () {
- return this.uvMatrix.clampMargin;
- },
- set: function (t) {
- (this.uvMatrix.clampMargin = t), this.uvMatrix.update(!0);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'tileScale', {
- get: function () {
- return this.tileTransform.scale;
- },
- set: function (t) {
- this.tileTransform.scale.copyFrom(t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'tilePosition', {
- get: function () {
- return this.tileTransform.position;
- },
- set: function (t) {
- this.tileTransform.position.copyFrom(t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype._onTextureUpdate = function () {
- this.uvMatrix && (this.uvMatrix.texture = this._texture),
- (this._cachedTint = 16777215);
- }),
- (e.prototype._render = function (t) {
- var e = this._texture;
- e &&
- e.valid &&
- (this.tileTransform.updateLocalTransform(),
- this.uvMatrix.update(),
- t.batch.setObjectRenderer(t.plugins[this.pluginName]),
- t.plugins[this.pluginName].render(this));
- }),
- (e.prototype._calculateBounds = function () {
- var t = this._width * -this._anchor._x,
- e = this._height * -this._anchor._y,
- r = this._width * (1 - this._anchor._x),
- n = this._height * (1 - this._anchor._y);
- this._bounds.addFrame(this.transform, t, e, r, n);
- }),
- (e.prototype.getLocalBounds = function (e) {
- return 0 === this.children.length
- ? ((this._bounds.minX = this._width * -this._anchor._x),
- (this._bounds.minY = this._height * -this._anchor._y),
- (this._bounds.maxX = this._width * (1 - this._anchor._x)),
- (this._bounds.maxY = this._height * (1 - this._anchor._y)),
- e ||
- (this._localBoundsRect || (this._localBoundsRect = new TD()),
- (e = this._localBoundsRect)),
- this._bounds.getRectangle(e))
- : t.prototype.getLocalBounds.call(this, e);
- }),
- (e.prototype.containsPoint = function (t) {
- this.worldTransform.applyInverse(t, tG);
- var e = this._width,
- r = this._height,
- n = -e * this.anchor._x;
- if (tG.x >= n && tG.x < n + e) {
- var i = -r * this.anchor._y;
- if (tG.y >= i && tG.y < i + r) return !0;
- }
- return !1;
- }),
- (e.prototype.destroy = function (e) {
- t.prototype.destroy.call(this, e),
- (this.tileTransform = null),
- (this.uvMatrix = null);
- }),
- (e.from = function (t, r) {
- return new e(t instanceof EL ? t : EL.from(t, r), r.width, r.height);
- }),
- Object.defineProperty(e.prototype, 'width', {
- get: function () {
- return this._width;
- },
- set: function (t) {
- this._width = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'height', {
- get: function () {
- return this._height;
- },
- set: function (t) {
- this._height = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- e
- );
- })(SB),
- rG =
- '#version 100\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n',
- nG = new CD(),
- iG = (function (t) {
- function e(e) {
- var r = t.call(this, e) || this;
- return (
- e.runners.contextChange.add(r),
- (r.quad = new FL()),
- (r.state = xF.for2d()),
- r
- );
- }
- return (
- $B(e, t),
- (e.prototype.contextChange = function () {
- var t = this.renderer,
- e = { globals: t.globalUniforms };
- (this.simpleShader = TF.from(
- rG,
- '#version 100\n#define SHADER_NAME Tiling-Sprite-Simple-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\n\nvoid main(void)\n{\n vec4 texSample = texture2D(uSampler, vTextureCoord);\n gl_FragColor = texSample * uColor;\n}\n',
- e
- )),
- (this.shader =
- t.context.webGLVersion > 1
- ? TF.from(
- '#version 300 es\n#define SHADER_NAME Tiling-Sprite-300\n\nprecision lowp float;\n\nin vec2 aVertexPosition;\nin vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nout vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n',
- '#version 300 es\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nin vec2 vTextureCoord;\n\nout vec4 fragmentColor;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n vec4 texSample = texture(uSampler, coord, unclamped == coord ? 0.0f : -32.0f);// lod-bias very negative to force lod 0\n\n fragmentColor = texSample * uColor;\n}\n',
- e
- )
- : TF.from(
- rG,
- '#version 100\n#ifdef GL_EXT_shader_texture_lod\n #extension GL_EXT_shader_texture_lod : enable\n#endif\n#define SHADER_NAME Tiling-Sprite-100\n\nprecision lowp float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 uColor;\nuniform mat3 uMapCoord;\nuniform vec4 uClampFrame;\nuniform vec2 uClampOffset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord + ceil(uClampOffset - vTextureCoord);\n coord = (uMapCoord * vec3(coord, 1.0)).xy;\n vec2 unclamped = coord;\n coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);\n\n #ifdef GL_EXT_shader_texture_lod\n vec4 texSample = unclamped == coord\n ? texture2D(uSampler, coord) \n : texture2DLodEXT(uSampler, coord, 0);\n #else\n vec4 texSample = texture2D(uSampler, coord);\n #endif\n\n gl_FragColor = texSample * uColor;\n}\n',
- e
- ));
- }),
- (e.prototype.render = function (t) {
- var e = this.renderer,
- r = this.quad,
- n = r.vertices;
- (n[0] = n[6] = t._width * -t.anchor.x),
- (n[1] = n[3] = t._height * -t.anchor.y),
- (n[2] = n[4] = t._width * (1 - t.anchor.x)),
- (n[5] = n[7] = t._height * (1 - t.anchor.y));
- var i = t.uvRespectAnchor ? t.anchor.x : 0,
- o = t.uvRespectAnchor ? t.anchor.y : 0;
- ((n = r.uvs)[0] = n[6] = -i),
- (n[1] = n[3] = -o),
- (n[2] = n[4] = 1 - i),
- (n[5] = n[7] = 1 - o),
- r.invalidate();
- var s = t._texture,
- a = s.baseTexture,
- u = a.alphaMode > 0,
- c = t.tileTransform.localTransform,
- h = t.uvMatrix,
- l =
- a.isPowerOfTwo &&
- s.frame.width === a.width &&
- s.frame.height === a.height;
- l &&
- (a._glTextures[e.CONTEXT_UID]
- ? (l = a.wrapMode !== kP.CLAMP)
- : a.wrapMode === kP.CLAMP && (a.wrapMode = kP.REPEAT));
- var d = l ? this.simpleShader : this.shader,
- f = s.width,
- p = s.height,
- v = t._width,
- m = t._height;
- nG.set(
- (c.a * f) / v,
- (c.b * f) / m,
- (c.c * p) / v,
- (c.d * p) / m,
- c.tx / v,
- c.ty / m
- ),
- nG.invert(),
- l
- ? nG.prepend(h.mapCoord)
- : ((d.uniforms.uMapCoord = h.mapCoord.toArray(!0)),
- (d.uniforms.uClampFrame = h.uClampFrame),
- (d.uniforms.uClampOffset = h.uClampOffset)),
- (d.uniforms.uTransform = nG.toArray(!0)),
- (d.uniforms.uColor = qM(
- t.tint,
- t.worldAlpha,
- d.uniforms.uColor,
- u
- )),
- (d.uniforms.translationMatrix = t.transform.worldTransform.toArray(
- !0
- )),
- (d.uniforms.uSampler = s),
- e.shader.bind(d),
- e.geometry.bind(r),
- (this.state.blendMode = JM(t.blendMode, u)),
- e.state.set(this.state),
- e.geometry.draw(this.renderer.gl.TRIANGLES, 6, 0);
- }),
- (e.extension = { name: 'tilingSprite', type: HD.RendererPlugin }),
- e
- );
- })(XL),
- oG = function (t, e) {
- return (
- (oG =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- oG(t, e)
- );
- };
- function sG(t, e) {
- function r() {
- this.constructor = t;
- }
- oG(t, e),
- (t.prototype =
- null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
- }
- var aG = (function () {
- function t(t, e) {
- (this.uvBuffer = t),
- (this.uvMatrix = e),
- (this.data = null),
- (this._bufferUpdateId = -1),
- (this._textureUpdateId = -1),
- (this._updateID = 0);
- }
- return (
- (t.prototype.update = function (t) {
- if (
- t ||
- this._bufferUpdateId !== this.uvBuffer._updateID ||
- this._textureUpdateId !== this.uvMatrix._updateID
- ) {
- (this._bufferUpdateId = this.uvBuffer._updateID),
- (this._textureUpdateId = this.uvMatrix._updateID);
- var e = this.uvBuffer.data;
- (this.data && this.data.length === e.length) ||
- (this.data = new Float32Array(e.length)),
- this.uvMatrix.multiplyUvs(e, this.data),
- this._updateID++;
- }
- }),
- t
- );
- })(),
- uG = new _D(),
- cG = new SD(),
- hG = (function (t) {
- function e(e, r, n, i) {
- void 0 === i && (i = IP.TRIANGLES);
- var o = t.call(this) || this;
- return (
- (o.geometry = e),
- (o.shader = r),
- (o.state = n || xF.for2d()),
- (o.drawMode = i),
- (o.start = 0),
- (o.size = 0),
- (o.uvs = null),
- (o.indices = null),
- (o.vertexData = new Float32Array(1)),
- (o.vertexDirty = -1),
- (o._transformID = -1),
- (o._roundPixels = vA.ROUND_PIXELS),
- (o.batchUvs = null),
- o
- );
- }
- return (
- sG(e, t),
- Object.defineProperty(e.prototype, 'geometry', {
- get: function () {
- return this._geometry;
- },
- set: function (t) {
- this._geometry !== t &&
- (this._geometry &&
- (this._geometry.refCount--,
- 0 === this._geometry.refCount && this._geometry.dispose()),
- (this._geometry = t),
- this._geometry && this._geometry.refCount++,
- (this.vertexDirty = -1));
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'uvBuffer', {
- get: function () {
- return this.geometry.buffers[1];
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'verticesBuffer', {
- get: function () {
- return this.geometry.buffers[0];
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'material', {
- get: function () {
- return this.shader;
- },
- set: function (t) {
- this.shader = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'blendMode', {
- get: function () {
- return this.state.blendMode;
- },
- set: function (t) {
- this.state.blendMode = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'roundPixels', {
- get: function () {
- return this._roundPixels;
- },
- set: function (t) {
- this._roundPixels !== t && (this._transformID = -1),
- (this._roundPixels = t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'tint', {
- get: function () {
- return 'tint' in this.shader ? this.shader.tint : null;
- },
- set: function (t) {
- this.shader.tint = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'texture', {
- get: function () {
- return 'texture' in this.shader ? this.shader.texture : null;
- },
- set: function (t) {
- this.shader.texture = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype._render = function (t) {
- var r = this.geometry.buffers[0].data;
- this.shader.batchable &&
- this.drawMode === IP.TRIANGLES &&
- r.length < 2 * e.BATCHABLE_SIZE
- ? this._renderToBatch(t)
- : this._renderDefault(t);
- }),
- (e.prototype._renderDefault = function (t) {
- var e = this.shader;
- (e.alpha = this.worldAlpha),
- e.update && e.update(),
- t.batch.flush(),
- (e.uniforms.translationMatrix =
- this.transform.worldTransform.toArray(!0)),
- t.shader.bind(e),
- t.state.set(this.state),
- t.geometry.bind(this.geometry, e),
- t.geometry.draw(
- this.drawMode,
- this.size,
- this.start,
- this.geometry.instanceCount
- );
- }),
- (e.prototype._renderToBatch = function (t) {
- var e = this.geometry,
- r = this.shader;
- r.uvMatrix && (r.uvMatrix.update(), this.calculateUvs()),
- this.calculateVertices(),
- (this.indices = e.indexBuffer.data),
- (this._tintRGB = r._tintRGB),
- (this._texture = r.texture);
- var n = this.material.pluginName;
- t.batch.setObjectRenderer(t.plugins[n]), t.plugins[n].render(this);
- }),
- (e.prototype.calculateVertices = function () {
- var t = this.geometry.buffers[0],
- e = t.data,
- r = t._updateID;
- if (
- r !== this.vertexDirty ||
- this._transformID !== this.transform._worldID
- ) {
- (this._transformID = this.transform._worldID),
- this.vertexData.length !== e.length &&
- (this.vertexData = new Float32Array(e.length));
- for (
- var n = this.transform.worldTransform,
- i = n.a,
- o = n.b,
- s = n.c,
- a = n.d,
- u = n.tx,
- c = n.ty,
- h = this.vertexData,
- l = 0;
- l < h.length / 2;
- l++
- ) {
- var d = e[2 * l],
- f = e[2 * l + 1];
- (h[2 * l] = i * d + s * f + u),
- (h[2 * l + 1] = o * d + a * f + c);
- }
- if (this._roundPixels) {
- var p = vA.RESOLUTION;
- for (l = 0; l < h.length; ++l)
- h[l] = Math.round(((h[l] * p) | 0) / p);
- }
- this.vertexDirty = r;
- }
- }),
- (e.prototype.calculateUvs = function () {
- var t = this.geometry.buffers[1],
- e = this.shader;
- e.uvMatrix.isSimple
- ? (this.uvs = t.data)
- : (this.batchUvs || (this.batchUvs = new aG(t, e.uvMatrix)),
- this.batchUvs.update(),
- (this.uvs = this.batchUvs.data));
- }),
- (e.prototype._calculateBounds = function () {
- this.calculateVertices(),
- this._bounds.addVertexData(
- this.vertexData,
- 0,
- this.vertexData.length
- );
- }),
- (e.prototype.containsPoint = function (t) {
- if (!this.getBounds().contains(t.x, t.y)) return !1;
- this.worldTransform.applyInverse(t, uG);
- for (
- var e = this.geometry.getBuffer('aVertexPosition').data,
- r = cG.points,
- n = this.geometry.getIndex().data,
- i = n.length,
- o = 4 === this.drawMode ? 3 : 1,
- s = 0;
- s + 2 < i;
- s += o
- ) {
- var a = 2 * n[s],
- u = 2 * n[s + 1],
- c = 2 * n[s + 2];
- if (
- ((r[0] = e[a]),
- (r[1] = e[a + 1]),
- (r[2] = e[u]),
- (r[3] = e[u + 1]),
- (r[4] = e[c]),
- (r[5] = e[c + 1]),
- cG.contains(uG.x, uG.y))
- )
- return !0;
- }
- return !1;
- }),
- (e.prototype.destroy = function (e) {
- t.prototype.destroy.call(this, e),
- this._cachedTexture &&
- (this._cachedTexture.destroy(), (this._cachedTexture = null)),
- (this.geometry = null),
- (this.shader = null),
- (this.state = null),
- (this.uvs = null),
- (this.indices = null),
- (this.vertexData = null);
- }),
- (e.BATCHABLE_SIZE = 100),
- e
- );
- })(VD),
- lG = (function (t) {
- function e(e, r) {
- var n = this,
- i = {
- uSampler: e,
- alpha: 1,
- uTextureMatrix: CD.IDENTITY,
- uColor: new Float32Array([1, 1, 1, 1]),
- };
- return (
- (r = Object.assign(
- { tint: 16777215, alpha: 1, pluginName: 'batch' },
- r
- )).uniforms && Object.assign(i, r.uniforms),
- ((n =
- t.call(
- this,
- r.program ||
- bF.from(
- 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTextureMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\n}\n',
- 'varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n'
- ),
- i
- ) || this)._colorDirty = !1),
- (n.uvMatrix = new wF(e)),
- (n.batchable = void 0 === r.program),
- (n.pluginName = r.pluginName),
- (n.tint = r.tint),
- (n.alpha = r.alpha),
- n
- );
- }
- return (
- sG(e, t),
- Object.defineProperty(e.prototype, 'texture', {
- get: function () {
- return this.uniforms.uSampler;
- },
- set: function (t) {
- this.uniforms.uSampler !== t &&
- (!this.uniforms.uSampler.baseTexture.alphaMode !=
- !t.baseTexture.alphaMode && (this._colorDirty = !0),
- (this.uniforms.uSampler = t),
- (this.uvMatrix.texture = t));
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'alpha', {
- get: function () {
- return this._alpha;
- },
- set: function (t) {
- t !== this._alpha && ((this._alpha = t), (this._colorDirty = !0));
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'tint', {
- get: function () {
- return this._tint;
- },
- set: function (t) {
- t !== this._tint &&
- ((this._tint = t),
- (this._tintRGB = (t >> 16) + (65280 & t) + ((255 & t) << 16)),
- (this._colorDirty = !0));
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype.update = function () {
- if (this._colorDirty) {
- this._colorDirty = !1;
- var t = this.texture.baseTexture;
- qM(this._tint, this._alpha, this.uniforms.uColor, t.alphaMode);
- }
- this.uvMatrix.update() &&
- (this.uniforms.uTextureMatrix = this.uvMatrix.mapCoord);
- }),
- e
- );
- })(TF),
- dG = (function (t) {
- function e(e, r, n) {
- var i = t.call(this) || this,
- o = new PL(e),
- s = new PL(r, !0),
- a = new PL(n, !0, !0);
- return (
- i
- .addAttribute('aVertexPosition', o, 2, !1, LP.FLOAT)
- .addAttribute('aTextureCoord', s, 2, !1, LP.FLOAT)
- .addIndex(a),
- (i._updateId = -1),
- i
- );
- }
- return (
- sG(e, t),
- Object.defineProperty(e.prototype, 'vertexDirtyId', {
- get: function () {
- return this.buffers[0]._updateID;
- },
- enumerable: !1,
- configurable: !0,
- }),
- e
- );
- })(DL),
- fG = function (t, e) {
- return (
- (fG =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- fG(t, e)
- );
- };
- var pG = function () {
- (this.info = []),
- (this.common = []),
- (this.page = []),
- (this.char = []),
- (this.kerning = []),
- (this.distanceField = []);
- },
- vG = (function () {
- function t() {}
- return (
- (t.test = function (t) {
- return 'string' == typeof t && 0 === t.indexOf('info face=');
- }),
- (t.parse = function (t) {
- var e = t.match(/^[a-z]+\s+.+$/gm),
- r = {
- info: [],
- common: [],
- page: [],
- char: [],
- chars: [],
- kerning: [],
- kernings: [],
- distanceField: [],
- };
- for (var n in e) {
- var i = e[n].match(/^[a-z]+/gm)[0],
- o = e[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),
- s = {};
- for (var a in o) {
- var u = o[a].split('='),
- c = u[0],
- h = u[1].replace(/"/gm, ''),
- l = parseFloat(h),
- d = isNaN(l) ? h : l;
- s[c] = d;
- }
- r[i].push(s);
- }
- var f = new pG();
- return (
- r.info.forEach(function (t) {
- return f.info.push({ face: t.face, size: parseInt(t.size, 10) });
- }),
- r.common.forEach(function (t) {
- return f.common.push({ lineHeight: parseInt(t.lineHeight, 10) });
- }),
- r.page.forEach(function (t) {
- return f.page.push({ id: parseInt(t.id, 10), file: t.file });
- }),
- r.char.forEach(function (t) {
- return f.char.push({
- id: parseInt(t.id, 10),
- page: parseInt(t.page, 10),
- x: parseInt(t.x, 10),
- y: parseInt(t.y, 10),
- width: parseInt(t.width, 10),
- height: parseInt(t.height, 10),
- xoffset: parseInt(t.xoffset, 10),
- yoffset: parseInt(t.yoffset, 10),
- xadvance: parseInt(t.xadvance, 10),
- });
- }),
- r.kerning.forEach(function (t) {
- return f.kerning.push({
- first: parseInt(t.first, 10),
- second: parseInt(t.second, 10),
- amount: parseInt(t.amount, 10),
- });
- }),
- r.distanceField.forEach(function (t) {
- return f.distanceField.push({
- distanceRange: parseInt(t.distanceRange, 10),
- fieldType: t.fieldType,
- });
- }),
- f
- );
- }),
- t
- );
- })(),
- mG = (function () {
- function t() {}
- return (
- (t.test = function (t) {
- return (
- t instanceof XMLDocument &&
- t.getElementsByTagName('page').length &&
- null !== t.getElementsByTagName('info')[0].getAttribute('face')
- );
- }),
- (t.parse = function (t) {
- for (
- var e = new pG(),
- r = t.getElementsByTagName('info'),
- n = t.getElementsByTagName('common'),
- i = t.getElementsByTagName('page'),
- o = t.getElementsByTagName('char'),
- s = t.getElementsByTagName('kerning'),
- a = t.getElementsByTagName('distanceField'),
- u = 0;
- u < r.length;
- u++
- )
- e.info.push({
- face: r[u].getAttribute('face'),
- size: parseInt(r[u].getAttribute('size'), 10),
- });
- for (u = 0; u < n.length; u++)
- e.common.push({
- lineHeight: parseInt(n[u].getAttribute('lineHeight'), 10),
- });
- for (u = 0; u < i.length; u++)
- e.page.push({
- id: parseInt(i[u].getAttribute('id'), 10) || 0,
- file: i[u].getAttribute('file'),
- });
- for (u = 0; u < o.length; u++) {
- var c = o[u];
- e.char.push({
- id: parseInt(c.getAttribute('id'), 10),
- page: parseInt(c.getAttribute('page'), 10) || 0,
- x: parseInt(c.getAttribute('x'), 10),
- y: parseInt(c.getAttribute('y'), 10),
- width: parseInt(c.getAttribute('width'), 10),
- height: parseInt(c.getAttribute('height'), 10),
- xoffset: parseInt(c.getAttribute('xoffset'), 10),
- yoffset: parseInt(c.getAttribute('yoffset'), 10),
- xadvance: parseInt(c.getAttribute('xadvance'), 10),
- });
- }
- for (u = 0; u < s.length; u++)
- e.kerning.push({
- first: parseInt(s[u].getAttribute('first'), 10),
- second: parseInt(s[u].getAttribute('second'), 10),
- amount: parseInt(s[u].getAttribute('amount'), 10),
- });
- for (u = 0; u < a.length; u++)
- e.distanceField.push({
- fieldType: a[u].getAttribute('fieldType'),
- distanceRange: parseInt(a[u].getAttribute('distanceRange'), 10),
- });
- return e;
- }),
- t
- );
- })(),
- yG = (function () {
- function t() {}
- return (
- (t.test = function (t) {
- if ('string' == typeof t && t.indexOf('<font>') > -1) {
- var e = new globalThis.DOMParser().parseFromString(t, 'text/xml');
- return mG.test(e);
- }
- return !1;
- }),
- (t.parse = function (t) {
- var e = new globalThis.DOMParser().parseFromString(t, 'text/xml');
- return mG.parse(e);
- }),
- t
- );
- })(),
- gG = [vG, mG, yG];
- function _G(t) {
- for (var e = 0; e < gG.length; e++) if (gG[e].test(t)) return gG[e];
- return null;
- }
- function bG(t, e, r, n, i, o, s) {
- var a = r.text,
- u = r.fontProperties;
- e.translate(n, i), e.scale(o, o);
- var c = s.strokeThickness / 2,
- h = -s.strokeThickness / 2;
- if (
- ((e.font = s.toFontString()),
- (e.lineWidth = s.strokeThickness),
- (e.textBaseline = s.textBaseline),
- (e.lineJoin = s.lineJoin),
- (e.miterLimit = s.miterLimit),
- (e.fillStyle = (function (t, e, r, n, i, o) {
- var s,
- a = r.fill;
- if (!Array.isArray(a)) return a;
- if (1 === a.length) return a[0];
- var u = r.dropShadow ? r.dropShadowDistance : 0,
- c = r.padding || 0,
- h = t.width / n - u - 2 * c,
- l = t.height / n - u - 2 * c,
- d = a.slice(),
- f = r.fillGradientStops.slice();
- if (!f.length)
- for (var p = d.length + 1, v = 1; v < p; ++v) f.push(v / p);
- if (
- (d.unshift(a[0]),
- f.unshift(0),
- d.push(a[a.length - 1]),
- f.push(1),
- r.fillGradientType === TB.LINEAR_VERTICAL)
- ) {
- s = e.createLinearGradient(h / 2, c, h / 2, l + c);
- var m = 0,
- y = (o.fontProperties.fontSize + r.strokeThickness) / l;
- for (v = 0; v < i.length; v++)
- for (var g = o.lineHeight * v, _ = 0; _ < d.length; _++) {
- var b =
- g / l + ('number' == typeof f[_] ? f[_] : _ / d.length) * y,
- T = Math.max(m, b);
- (T = Math.min(T, 1)), s.addColorStop(T, d[_]), (m = T);
- }
- } else {
- s = e.createLinearGradient(c, l / 2, h + c, l / 2);
- var x = d.length + 1,
- E = 1;
- for (v = 0; v < d.length; v++) {
- var S = void 0;
- (S = 'number' == typeof f[v] ? f[v] : E / x),
- s.addColorStop(S, d[v]),
- E++;
- }
- }
- return s;
- })(t, e, s, o, [a], r)),
- (e.strokeStyle = s.stroke),
- s.dropShadow)
- ) {
- var l = s.dropShadowColor,
- d = HM('number' == typeof l ? l : YM(l)),
- f = s.dropShadowBlur * o,
- p = s.dropShadowDistance * o;
- (e.shadowColor =
- 'rgba(' +
- 255 * d[0] +
- ',' +
- 255 * d[1] +
- ',' +
- 255 * d[2] +
- ',' +
- s.dropShadowAlpha +
- ')'),
- (e.shadowBlur = f),
- (e.shadowOffsetX = Math.cos(s.dropShadowAngle) * p),
- (e.shadowOffsetY = Math.sin(s.dropShadowAngle) * p);
- } else
- (e.shadowColor = 'black'),
- (e.shadowBlur = 0),
- (e.shadowOffsetX = 0),
- (e.shadowOffsetY = 0);
- s.stroke &&
- s.strokeThickness &&
- e.strokeText(a, c, h + r.lineHeight - u.descent),
- s.fill && e.fillText(a, c, h + r.lineHeight - u.descent),
- e.setTransform(1, 0, 0, 1, 0, 0),
- (e.fillStyle = 'rgba(0, 0, 0, 0)');
- }
- function TG(t) {
- return Array.from ? Array.from(t) : t.split('');
- }
- function xG(t) {
- return t.codePointAt ? t.codePointAt(0) : t.charCodeAt(0);
- }
- var EG = (function () {
- function t(t, e, r) {
- var n,
- i,
- o = t.info[0],
- s = t.common[0],
- a = t.page[0],
- u = t.distanceField[0],
- c = pD(a.file),
- h = {};
- (this._ownsTextures = r),
- (this.font = o.face),
- (this.size = o.size),
- (this.lineHeight = s.lineHeight / c),
- (this.chars = {}),
- (this.pageTextures = h);
- for (var l = 0; l < t.page.length; l++) {
- var d = t.page[l],
- f = d.id,
- p = d.file;
- (h[f] = e instanceof Array ? e[l] : e[p]),
- (null == u ? void 0 : u.fieldType) &&
- 'none' !== u.fieldType &&
- ((h[f].baseTexture.alphaMode = GP.NO_PREMULTIPLIED_ALPHA),
- (h[f].baseTexture.mipmap = BP.OFF));
- }
- for (l = 0; l < t.char.length; l++) {
- var v = t.char[l],
- m = ((f = v.id), v.page),
- y = t.char[l],
- g = y.x,
- _ = y.y,
- b = y.width,
- T = y.height,
- x = y.xoffset,
- E = y.yoffset,
- S = y.xadvance;
- (_ /= c), (b /= c), (T /= c), (x /= c), (E /= c), (S /= c);
- var w = new TD(
- (g /= c) + h[m].frame.x / c,
- _ + h[m].frame.y / c,
- b,
- T
- );
- this.chars[f] = {
- xOffset: x,
- yOffset: E,
- xAdvance: S,
- kerning: {},
- texture: new EL(h[m].baseTexture, w),
- page: m,
- };
- }
- for (l = 0; l < t.kerning.length; l++) {
- var R = t.kerning[l],
- C = R.first,
- P = R.second,
- A = R.amount;
- (C /= c),
- (P /= c),
- (A /= c),
- this.chars[P] && (this.chars[P].kerning[C] = A);
- }
- (this.distanceFieldRange = null == u ? void 0 : u.distanceRange),
- (this.distanceFieldType =
- null !==
- (i =
- null === (n = null == u ? void 0 : u.fieldType) || void 0 === n
- ? void 0
- : n.toLowerCase()) && void 0 !== i
- ? i
- : 'none');
- }
- return (
- (t.prototype.destroy = function () {
- for (var t in this.chars)
- this.chars[t].texture.destroy(), (this.chars[t].texture = null);
- for (var t in this.pageTextures)
- this._ownsTextures && this.pageTextures[t].destroy(!0),
- (this.pageTextures[t] = null);
- (this.chars = null), (this.pageTextures = null);
- }),
- (t.install = function (e, r, n) {
- var i;
- if (e instanceof pG) i = e;
- else {
- var o = _G(e);
- if (!o) throw new Error('Unrecognized data format for font.');
- i = o.parse(e);
- }
- r instanceof EL && (r = [r]);
- var s = new t(i, r, n);
- return (t.available[s.font] = s), s;
- }),
- (t.uninstall = function (e) {
- var r = t.available[e];
- if (!r) throw new Error("No font found named '" + e + "'");
- r.destroy(), delete t.available[e];
- }),
- (t.from = function (e, r, n) {
- if (!e) throw new Error('[BitmapFont] Property `name` is required.');
- var i = Object.assign({}, t.defaultOptions, n),
- o = i.chars,
- s = i.padding,
- a = i.resolution,
- u = i.textureWidth,
- c = i.textureHeight,
- h = (function (t) {
- 'string' == typeof t && (t = [t]);
- for (var e = [], r = 0, n = t.length; r < n; r++) {
- var i = t[r];
- if (Array.isArray(i)) {
- if (2 !== i.length)
- throw new Error(
- '[BitmapFont]: Invalid character range length, expecting 2 got ' +
- i.length +
- '.'
- );
- var o = i[0].charCodeAt(0),
- s = i[1].charCodeAt(0);
- if (s < o)
- throw new Error('[BitmapFont]: Invalid character range.');
- for (var a = o, u = s; a <= u; a++)
- e.push(String.fromCharCode(a));
- } else e.push.apply(e, TG(i));
- }
- if (0 === e.length)
- throw new Error(
- '[BitmapFont]: Empty set when resolving characters.'
- );
- return e;
- })(o),
- l = r instanceof PB ? r : new PB(r),
- d = u,
- f = new pG();
- (f.info[0] = { face: l.fontFamily, size: l.fontSize }),
- (f.common[0] = { lineHeight: l.fontSize });
- for (
- var p, v, m, y = 0, g = 0, _ = 0, b = [], T = 0;
- T < h.length;
- T++
- ) {
- p ||
- (((p = vA.ADAPTER.createCanvas()).width = u),
- (p.height = c),
- (v = p.getContext('2d')),
- (m = new aL(p, { resolution: a })),
- b.push(new EL(m)),
- f.page.push({ id: b.length - 1, file: '' }));
- var x = h[T],
- E = DB.measureText(x, l, !1, p),
- S = E.width,
- w = Math.ceil(E.height),
- R = Math.ceil(('italic' === l.fontStyle ? 2 : 1) * S);
- if (g >= c - w * a) {
- if (0 === g)
- throw new Error(
- '[BitmapFont] textureHeight ' +
- c +
- "px is too small (fontFamily: '" +
- l.fontFamily +
- "', fontSize: " +
- l.fontSize +
- "px, char: '" +
- x +
- "')"
- );
- --T,
- (p = null),
- (v = null),
- (m = null),
- (g = 0),
- (y = 0),
- (_ = 0);
- } else if (
- ((_ = Math.max(w + E.fontProperties.descent, _)), R * a + y >= d)
- ) {
- if (0 === y)
- throw new Error(
- '[BitmapFont] textureWidth ' +
- u +
- "px is too small (fontFamily: '" +
- l.fontFamily +
- "', fontSize: " +
- l.fontSize +
- "px, char: '" +
- x +
- "')"
- );
- --T, (g += _ * a), (g = Math.ceil(g)), (y = 0), (_ = 0);
- } else {
- bG(p, v, E, y, g, a, l);
- var C = xG(E.text);
- f.char.push({
- id: C,
- page: b.length - 1,
- x: y / a,
- y: g / a,
- width: R,
- height: w,
- xoffset: 0,
- yoffset: 0,
- xadvance: Math.ceil(
- S -
- (l.dropShadow ? l.dropShadowDistance : 0) -
- (l.stroke ? l.strokeThickness : 0)
- ),
- }),
- (y += (R + 2 * s) * a),
- (y = Math.ceil(y));
- }
- }
- if (!(null == n ? void 0 : n.skipKerning)) {
- T = 0;
- for (var P = h.length; T < P; T++)
- for (var A = h[T], O = 0; O < P; O++) {
- var I = h[O],
- M = v.measureText(A).width,
- D = v.measureText(I).width,
- L = v.measureText(A + I).width - (M + D);
- L && f.kerning.push({ first: xG(A), second: xG(I), amount: L });
- }
- }
- var F = new t(f, b, !0);
- return (
- void 0 !== t.available[e] && t.uninstall(e), (t.available[e] = F), F
- );
- }),
- (t.ALPHA = [['a', 'z'], ['A', 'Z'], ' ']),
- (t.NUMERIC = [['0', '9']]),
- (t.ALPHANUMERIC = [['a', 'z'], ['A', 'Z'], ['0', '9'], ' ']),
- (t.ASCII = [[' ', '~']]),
- (t.defaultOptions = {
- resolution: 1,
- textureWidth: 512,
- textureHeight: 512,
- padding: 4,
- chars: t.ALPHANUMERIC,
- }),
- (t.available = {}),
- t
- );
- })(),
- SG = [],
- wG = [],
- RG = [];
- !(function (t) {
- function e(r, n) {
- void 0 === n && (n = {});
- var i = t.call(this) || this;
- i._tint = 16777215;
- var o = Object.assign({}, e.styleDefaults, n),
- s = o.align,
- a = o.tint,
- u = o.maxWidth,
- c = o.letterSpacing,
- h = o.fontName,
- l = o.fontSize;
- if (!EG.available[h]) throw new Error('Missing BitmapFont "' + h + '"');
- return (
- (i._activePagesMeshData = []),
- (i._textWidth = 0),
- (i._textHeight = 0),
- (i._align = s),
- (i._tint = a),
- (i._font = void 0),
- (i._fontName = h),
- (i._fontSize = l),
- (i.text = r),
- (i._maxWidth = u),
- (i._maxLineHeight = 0),
- (i._letterSpacing = c),
- (i._anchor = new RD(
- function () {
- i.dirty = !0;
- },
- i,
- 0,
- 0
- )),
- (i._roundPixels = vA.ROUND_PIXELS),
- (i.dirty = !0),
- (i._resolution = vA.RESOLUTION),
- (i._autoResolution = !0),
- (i._textureCache = {}),
- i
- );
- }
- (function (t, e) {
- function r() {
- this.constructor = t;
- }
- fG(t, e),
- (t.prototype =
- null === e
- ? Object.create(e)
- : ((r.prototype = e.prototype), new r()));
- })(e, t),
- (e.prototype.updateText = function () {
- for (
- var t,
- e = EG.available[this._fontName],
- r = this.fontSize,
- n = r / e.size,
- i = new _D(),
- o = [],
- s = [],
- a = [],
- u = TG(this._text.replace(/(?:\r\n|\r)/g, '\n') || ' '),
- c = (this._maxWidth * e.size) / r,
- h = 'none' === e.distanceFieldType ? SG : wG,
- l = null,
- d = 0,
- f = 0,
- p = 0,
- v = -1,
- m = 0,
- y = 0,
- g = 0,
- _ = 0,
- b = 0;
- b < u.length;
- b++
- ) {
- var T = xG((j = u[b]));
- if (
- (/(?:\s)/.test(j) && ((v = b), (m = d), _++),
- '\r' !== j && '\n' !== j)
- ) {
- var x = e.chars[T];
- if (x) {
- l && x.kerning[l] && (i.x += x.kerning[l]);
- var E = RG.pop() || {
- texture: EL.EMPTY,
- line: 0,
- charCode: 0,
- prevSpaces: 0,
- position: new _D(),
- };
- (E.texture = x.texture),
- (E.line = p),
- (E.charCode = T),
- (E.position.x = i.x + x.xOffset + this._letterSpacing / 2),
- (E.position.y = i.y + x.yOffset),
- (E.prevSpaces = _),
- o.push(E),
- (d =
- E.position.x +
- Math.max(x.xAdvance - x.xOffset, x.texture.orig.width)),
- (i.x += x.xAdvance + this._letterSpacing),
- (g = Math.max(g, x.yOffset + x.texture.height)),
- (l = T),
- -1 !== v &&
- c > 0 &&
- i.x > c &&
- (rD(o, 1 + v - ++y, 1 + b - v),
- (b = v),
- (v = -1),
- s.push(m),
- a.push(o.length > 0 ? o[o.length - 1].prevSpaces : 0),
- (f = Math.max(f, m)),
- p++,
- (i.x = 0),
- (i.y += e.lineHeight),
- (l = null),
- (_ = 0));
- }
- } else
- s.push(d),
- a.push(-1),
- (f = Math.max(f, d)),
- ++p,
- ++y,
- (i.x = 0),
- (i.y += e.lineHeight),
- (l = null),
- (_ = 0);
- }
- var S = u[u.length - 1];
- '\r' !== S &&
- '\n' !== S &&
- (/(?:\s)/.test(S) && (d = m),
- s.push(d),
- (f = Math.max(f, d)),
- a.push(-1));
- var w = [];
- for (b = 0; b <= p; b++) {
- var R = 0;
- 'right' === this._align
- ? (R = f - s[b])
- : 'center' === this._align
- ? (R = (f - s[b]) / 2)
- : 'justify' === this._align &&
- (R = a[b] < 0 ? 0 : (f - s[b]) / a[b]),
- w.push(R);
- }
- var C = o.length,
- P = {},
- A = [],
- O = this._activePagesMeshData;
- h.push.apply(h, O);
- for (b = 0; b < C; b++) {
- var I = (V = o[b].texture).baseTexture.uid;
- if (!P[I]) {
- if (!(K = h.pop())) {
- var M = new dG(),
- D = void 0,
- L = void 0;
- 'none' === e.distanceFieldType
- ? ((D = new lG(EL.EMPTY)), (L = OP.NORMAL))
- : ((D = new lG(EL.EMPTY, {
- program: bF.from(
- '// Mesh material default fragment\r\nattribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3 projectionMatrix;\r\nuniform mat3 translationMatrix;\r\nuniform mat3 uTextureMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void)\r\n{\r\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n\r\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r\n}\r\n',
- '// Pixi texture info\r\nvarying vec2 vTextureCoord;\r\nuniform sampler2D uSampler;\r\n\r\n// Tint\r\nuniform vec4 uColor;\r\n\r\n// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r\nuniform float uFWidth;\r\n\r\nvoid main(void) {\r\n\r\n // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r\n vec4 texColor = texture2D(uSampler, vTextureCoord);\r\n\r\n // MSDF\r\n float median = texColor.r + texColor.g + texColor.b -\r\n min(texColor.r, min(texColor.g, texColor.b)) -\r\n max(texColor.r, max(texColor.g, texColor.b));\r\n // SDF\r\n median = min(median, texColor.a);\r\n\r\n float screenPxDistance = uFWidth * (median - 0.5);\r\n float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r\n if (median < 0.01) {\r\n alpha = 0.0;\r\n } else if (median > 0.99) {\r\n alpha = 1.0;\r\n }\r\n\r\n // NPM Textures, NPM outputs\r\n gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r\n\r\n}\r\n'
- ),
- uniforms: { uFWidth: 0 },
- })),
- (L = OP.NORMAL_NPM));
- var F = new hG(M, D);
- (F.blendMode = L),
- (K = {
- index: 0,
- indexCount: 0,
- vertexCount: 0,
- uvsCount: 0,
- total: 0,
- mesh: F,
- vertices: null,
- uvs: null,
- indices: null,
- });
- }
- (K.index = 0),
- (K.indexCount = 0),
- (K.vertexCount = 0),
- (K.uvsCount = 0),
- (K.total = 0);
- var N = this._textureCache;
- (N[I] = N[I] || new EL(V.baseTexture)),
- (K.mesh.texture = N[I]),
- (K.mesh.tint = this._tint),
- A.push(K),
- (P[I] = K);
- }
- P[I].total++;
- }
- for (b = 0; b < O.length; b++)
- -1 === A.indexOf(O[b]) && this.removeChild(O[b].mesh);
- for (b = 0; b < A.length; b++)
- A[b].mesh.parent !== this && this.addChild(A[b].mesh);
- for (var b in ((this._activePagesMeshData = A), P)) {
- var k = (K = P[b]).total;
- if (
- !(
- (null === (t = K.indices) || void 0 === t ? void 0 : t.length) >
- 6 * k
- ) ||
- K.vertices.length < 2 * hG.BATCHABLE_SIZE
- )
- (K.vertices = new Float32Array(8 * k)),
- (K.uvs = new Float32Array(8 * k)),
- (K.indices = new Uint16Array(6 * k));
- else
- for (
- var B = K.total, G = K.vertices, U = 4 * B * 2;
- U < G.length;
- U++
- )
- G[U] = 0;
- K.mesh.size = 6 * k;
- }
- for (b = 0; b < C; b++) {
- var j,
- X =
- (j = o[b]).position.x +
- w[j.line] * ('justify' === this._align ? j.prevSpaces : 1);
- this._roundPixels && (X = Math.round(X));
- var V,
- H = X * n,
- W = j.position.y * n,
- Y = P[(V = j.texture).baseTexture.uid],
- z = V.frame,
- Z = V._uvs,
- J = Y.index++;
- (Y.indices[6 * J + 0] = 0 + 4 * J),
- (Y.indices[6 * J + 1] = 1 + 4 * J),
- (Y.indices[6 * J + 2] = 2 + 4 * J),
- (Y.indices[6 * J + 3] = 0 + 4 * J),
- (Y.indices[6 * J + 4] = 2 + 4 * J),
- (Y.indices[6 * J + 5] = 3 + 4 * J),
- (Y.vertices[8 * J + 0] = H),
- (Y.vertices[8 * J + 1] = W),
- (Y.vertices[8 * J + 2] = H + z.width * n),
- (Y.vertices[8 * J + 3] = W),
- (Y.vertices[8 * J + 4] = H + z.width * n),
- (Y.vertices[8 * J + 5] = W + z.height * n),
- (Y.vertices[8 * J + 6] = H),
- (Y.vertices[8 * J + 7] = W + z.height * n),
- (Y.uvs[8 * J + 0] = Z.x0),
- (Y.uvs[8 * J + 1] = Z.y0),
- (Y.uvs[8 * J + 2] = Z.x1),
- (Y.uvs[8 * J + 3] = Z.y1),
- (Y.uvs[8 * J + 4] = Z.x2),
- (Y.uvs[8 * J + 5] = Z.y2),
- (Y.uvs[8 * J + 6] = Z.x3),
- (Y.uvs[8 * J + 7] = Z.y3);
- }
- for (var b in ((this._textWidth = f * n),
- (this._textHeight = (i.y + e.lineHeight) * n),
- P)) {
- var K = P[b];
- if (0 !== this.anchor.x || 0 !== this.anchor.y)
- for (
- var q = 0,
- Q = this._textWidth * this.anchor.x,
- $ = this._textHeight * this.anchor.y,
- tt = 0;
- tt < K.total;
- tt++
- )
- (K.vertices[q++] -= Q),
- (K.vertices[q++] -= $),
- (K.vertices[q++] -= Q),
- (K.vertices[q++] -= $),
- (K.vertices[q++] -= Q),
- (K.vertices[q++] -= $),
- (K.vertices[q++] -= Q),
- (K.vertices[q++] -= $);
- this._maxLineHeight = g * n;
- var et = K.mesh.geometry.getBuffer('aVertexPosition'),
- rt = K.mesh.geometry.getBuffer('aTextureCoord'),
- nt = K.mesh.geometry.getIndex();
- (et.data = K.vertices),
- (rt.data = K.uvs),
- (nt.data = K.indices),
- et.update(),
- rt.update(),
- nt.update();
- }
- for (b = 0; b < o.length; b++) RG.push(o[b]);
- (this._font = e), (this.dirty = !1);
- }),
- (e.prototype.updateTransform = function () {
- this.validate(), this.containerUpdateTransform();
- }),
- (e.prototype._render = function (e) {
- this._autoResolution &&
- this._resolution !== e.resolution &&
- ((this._resolution = e.resolution), (this.dirty = !0));
- var r = EG.available[this._fontName],
- n = r.distanceFieldRange,
- i = r.distanceFieldType,
- o = r.size;
- if ('none' !== i)
- for (
- var s = this.worldTransform,
- a = s.a,
- u = s.b,
- c = s.c,
- h = s.d,
- l = Math.sqrt(a * a + u * u),
- d = Math.sqrt(c * c + h * h),
- f = (Math.abs(l) + Math.abs(d)) / 2,
- p = this.fontSize / o,
- v = 0,
- m = this._activePagesMeshData;
- v < m.length;
- v++
- ) {
- m[v].mesh.shader.uniforms.uFWidth = f * n * p * this._resolution;
- }
- t.prototype._render.call(this, e);
- }),
- (e.prototype.getLocalBounds = function () {
- return this.validate(), t.prototype.getLocalBounds.call(this);
- }),
- (e.prototype.validate = function () {
- var t = EG.available[this._fontName];
- if (!t) throw new Error('Missing BitmapFont "' + this._fontName + '"');
- this._font !== t && (this.dirty = !0), this.dirty && this.updateText();
- }),
- Object.defineProperty(e.prototype, 'tint', {
- get: function () {
- return this._tint;
- },
- set: function (t) {
- if (this._tint !== t) {
- this._tint = t;
- for (var e = 0; e < this._activePagesMeshData.length; e++)
- this._activePagesMeshData[e].mesh.tint = t;
- }
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'align', {
- get: function () {
- return this._align;
- },
- set: function (t) {
- this._align !== t && ((this._align = t), (this.dirty = !0));
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'fontName', {
- get: function () {
- return this._fontName;
- },
- set: function (t) {
- if (!EG.available[t])
- throw new Error('Missing BitmapFont "' + t + '"');
- this._fontName !== t && ((this._fontName = t), (this.dirty = !0));
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'fontSize', {
- get: function () {
- var t;
- return null !== (t = this._fontSize) && void 0 !== t
- ? t
- : EG.available[this._fontName].size;
- },
- set: function (t) {
- this._fontSize !== t && ((this._fontSize = t), (this.dirty = !0));
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'anchor', {
- get: function () {
- return this._anchor;
- },
- set: function (t) {
- 'number' == typeof t ? this._anchor.set(t) : this._anchor.copyFrom(t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'text', {
- get: function () {
- return this._text;
- },
- set: function (t) {
- (t = String(null == t ? '' : t)),
- this._text !== t && ((this._text = t), (this.dirty = !0));
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'maxWidth', {
- get: function () {
- return this._maxWidth;
- },
- set: function (t) {
- this._maxWidth !== t && ((this._maxWidth = t), (this.dirty = !0));
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'maxLineHeight', {
- get: function () {
- return this.validate(), this._maxLineHeight;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'textWidth', {
- get: function () {
- return this.validate(), this._textWidth;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'letterSpacing', {
- get: function () {
- return this._letterSpacing;
- },
- set: function (t) {
- this._letterSpacing !== t &&
- ((this._letterSpacing = t), (this.dirty = !0));
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'roundPixels', {
- get: function () {
- return this._roundPixels;
- },
- set: function (t) {
- t !== this._roundPixels &&
- ((this._roundPixels = t), (this.dirty = !0));
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'textHeight', {
- get: function () {
- return this.validate(), this._textHeight;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'resolution', {
- get: function () {
- return this._resolution;
- },
- set: function (t) {
- (this._autoResolution = !1),
- this._resolution !== t &&
- ((this._resolution = t), (this.dirty = !0));
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype.destroy = function (e) {
- var r = this._textureCache,
- n =
- 'none' === EG.available[this._fontName].distanceFieldType ? SG : wG;
- n.push.apply(n, this._activePagesMeshData);
- for (var i = 0, o = this._activePagesMeshData; i < o.length; i++) {
- var s = o[i];
- this.removeChild(s.mesh);
- }
- for (var a in ((this._activePagesMeshData = []),
- n
- .filter(function (t) {
- return r[t.mesh.texture.baseTexture.uid];
- })
- .forEach(function (t) {
- t.mesh.texture = EL.EMPTY;
- }),
- r)) {
- r[a].destroy(), delete r[a];
- }
- (this._font = null),
- (this._textureCache = null),
- t.prototype.destroy.call(this, e);
- }),
- (e.styleDefaults = {
- align: 'left',
- tint: 16777215,
- maxWidth: 0,
- letterSpacing: 0,
- });
- })(VD);
- var CG = (function () {
- function t() {}
- return (
- (t.add = function () {
- DN.setExtensionXhrType('fnt', DN.XHR_RESPONSE_TYPE.TEXT);
- }),
- (t.use = function (e, r) {
- var n = _G(e.data);
- if (n)
- for (
- var i = t.getBaseUrl(this, e),
- o = n.parse(e.data),
- s = {},
- a = function (t) {
- (s[t.metadata.pageFile] = t.texture),
- Object.keys(s).length === o.page.length &&
- ((e.bitmapFont = EG.install(o, s, !0)), r());
- },
- u = 0;
- u < o.page.length;
- ++u
- ) {
- var c = o.page[u].file,
- h = i + c,
- l = !1;
- for (var d in this.resources) {
- var f = this.resources[d];
- if (f.url === h) {
- (f.metadata.pageFile = c),
- f.texture ? a(f) : f.onAfterMiddleware.add(a),
- (l = !0);
- break;
- }
- }
- if (!l) {
- var p = {
- crossOrigin: e.crossOrigin,
- loadType: DN.LOAD_TYPE.IMAGE,
- metadata: Object.assign(
- { pageFile: c },
- e.metadata.imageMetadata
- ),
- parentResource: e,
- };
- this.add(h, p, a);
- }
- }
- else r();
- }),
- (t.getBaseUrl = function (e, r) {
- var n = r.isDataUrl ? '' : t.dirname(r.url);
- return (
- r.isDataUrl &&
- ('.' === n && (n = ''),
- e.baseUrl &&
- n &&
- '/' === e.baseUrl.charAt(e.baseUrl.length - 1) &&
- (n += '/')),
- (n = n.replace(e.baseUrl, '')) &&
- '/' !== n.charAt(n.length - 1) &&
- (n += '/'),
- n
- );
- }),
- (t.dirname = function (t) {
- var e = t
- .replace(/\\/g, '/')
- .replace(/\/$/, '')
- .replace(/\/[^\/]*$/, '');
- return e === t ? '.' : '' === e ? '/' : e;
- }),
- (t.extension = HD.Loader),
- t
- );
- })(),
- PG = function (t, e) {
- return (
- (PG =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- PG(t, e)
- );
- };
- !(function (t) {
- function e(e) {
- void 0 === e && (e = 1);
- var r =
- t.call(
- this,
- 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}',
- 'varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float uAlpha;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uAlpha;\n}\n',
- { uAlpha: 1 }
- ) || this;
- return (r.alpha = e), r;
- }
- (function (t, e) {
- function r() {
- this.constructor = t;
- }
- PG(t, e),
- (t.prototype =
- null === e
- ? Object.create(e)
- : ((r.prototype = e.prototype), new r()));
- })(e, t),
- Object.defineProperty(e.prototype, 'alpha', {
- get: function () {
- return this.uniforms.uAlpha;
- },
- set: function (t) {
- this.uniforms.uAlpha = t;
- },
- enumerable: !1,
- configurable: !0,
- });
- })(EF);
- var AG = function (t, e) {
- return (
- (AG =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- AG(t, e)
- );
- };
- function OG(t, e) {
- function r() {
- this.constructor = t;
- }
- AG(t, e),
- (t.prototype =
- null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
- }
- var IG = {
- 5: [0.153388, 0.221461, 0.250301],
- 7: [0.071303, 0.131514, 0.189879, 0.214607],
- 9: [0.028532, 0.067234, 0.124009, 0.179044, 0.20236],
- 11: [0.0093, 0.028002, 0.065984, 0.121703, 0.175713, 0.198596],
- 13: [
- 0.002406, 0.009255, 0.027867, 0.065666, 0.121117, 0.174868, 0.197641,
- ],
- 15: [
- 489e-6, 0.002403, 0.009246, 0.02784, 0.065602, 0.120999, 0.174697,
- 0.197448,
- ],
- },
- MG = [
- 'varying vec2 vBlurTexCoords[%size%];',
- 'uniform sampler2D uSampler;',
- 'void main(void)',
- '{',
- ' gl_FragColor = vec4(0.0);',
- ' %blur%',
- '}',
- ].join('\n');
- var DG = (function (t) {
- function e(e, r, n, i, o) {
- void 0 === r && (r = 8),
- void 0 === n && (n = 4),
- void 0 === i && (i = vA.FILTER_RESOLUTION),
- void 0 === o && (o = 5);
- var s = this,
- a = (function (t, e) {
- var r,
- n = Math.ceil(t / 2),
- i =
- '\n attribute vec2 aVertexPosition;\n\n uniform mat3 projectionMatrix;\n\n uniform float strength;\n\n varying vec2 vBlurTexCoords[%size%];\n\n uniform vec4 inputSize;\n uniform vec4 outputFrame;\n\n vec4 filterVertexPosition( void )\n {\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n }\n\n vec2 filterTextureCoord( void )\n {\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n }\n\n void main(void)\n {\n gl_Position = filterVertexPosition();\n\n vec2 textureCoord = filterTextureCoord();\n %blur%\n }',
- o = '';
- r = e
- ? 'vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);'
- : 'vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);';
- for (var s = 0; s < t; s++) {
- var a = r.replace('%index%', s.toString());
- (o += a = a.replace('%sampleIndex%', s - (n - 1) + '.0')),
- (o += '\n');
- }
- return (i = i.replace('%blur%', o)).replace('%size%', t.toString());
- })(o, e),
- u = (function (t) {
- for (
- var e, r = IG[t], n = r.length, i = MG, o = '', s = 0;
- s < t;
- s++
- ) {
- var a =
- 'gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;'.replace(
- '%index%',
- s.toString()
- );
- (e = s),
- s >= n && (e = t - s - 1),
- (o += a = a.replace('%value%', r[e].toString())),
- (o += '\n');
- }
- return (i = i.replace('%blur%', o)).replace('%size%', t.toString());
- })(o);
- return (
- ((s = t.call(this, a, u) || this).horizontal = e),
- (s.resolution = i),
- (s._quality = 0),
- (s.quality = n),
- (s.blur = r),
- s
- );
- }
- return (
- OG(e, t),
- (e.prototype.apply = function (t, e, r, n) {
- if (
- (r
- ? this.horizontal
- ? (this.uniforms.strength = (1 / r.width) * (r.width / e.width))
- : (this.uniforms.strength =
- (1 / r.height) * (r.height / e.height))
- : this.horizontal
- ? (this.uniforms.strength =
- (1 / t.renderer.width) * (t.renderer.width / e.width))
- : (this.uniforms.strength =
- (1 / t.renderer.height) * (t.renderer.height / e.height)),
- (this.uniforms.strength *= this.strength),
- (this.uniforms.strength /= this.passes),
- 1 === this.passes)
- )
- t.applyFilter(this, e, r, n);
- else {
- var i = t.getFilterTexture(),
- o = t.renderer,
- s = e,
- a = i;
- (this.state.blend = !1), t.applyFilter(this, s, a, UP.CLEAR);
- for (var u = 1; u < this.passes - 1; u++) {
- t.bindAndClear(s, UP.BLIT), (this.uniforms.uSampler = a);
- var c = a;
- (a = s), (s = c), o.shader.bind(this), o.geometry.draw(5);
- }
- (this.state.blend = !0),
- t.applyFilter(this, a, r, n),
- t.returnFilterTexture(i);
- }
- }),
- Object.defineProperty(e.prototype, 'blur', {
- get: function () {
- return this.strength;
- },
- set: function (t) {
- (this.padding = 1 + 2 * Math.abs(t)), (this.strength = t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'quality', {
- get: function () {
- return this._quality;
- },
- set: function (t) {
- (this._quality = t), (this.passes = t);
- },
- enumerable: !1,
- configurable: !0,
- }),
- e
- );
- })(EF);
- !(function (t) {
- function e(e, r, n, i) {
- void 0 === e && (e = 8),
- void 0 === r && (r = 4),
- void 0 === n && (n = vA.FILTER_RESOLUTION),
- void 0 === i && (i = 5);
- var o = t.call(this) || this;
- return (
- (o.blurXFilter = new DG(!0, e, r, n, i)),
- (o.blurYFilter = new DG(!1, e, r, n, i)),
- (o.resolution = n),
- (o.quality = r),
- (o.blur = e),
- (o.repeatEdgePixels = !1),
- o
- );
- }
- OG(e, t),
- (e.prototype.apply = function (t, e, r, n) {
- var i = Math.abs(this.blurXFilter.strength),
- o = Math.abs(this.blurYFilter.strength);
- if (i && o) {
- var s = t.getFilterTexture();
- this.blurXFilter.apply(t, e, s, UP.CLEAR),
- this.blurYFilter.apply(t, s, r, n),
- t.returnFilterTexture(s);
- } else
- o
- ? this.blurYFilter.apply(t, e, r, n)
- : this.blurXFilter.apply(t, e, r, n);
- }),
- (e.prototype.updatePadding = function () {
- this._repeatEdgePixels
- ? (this.padding = 0)
- : (this.padding =
- 2 *
- Math.max(
- Math.abs(this.blurXFilter.strength),
- Math.abs(this.blurYFilter.strength)
- ));
- }),
- Object.defineProperty(e.prototype, 'blur', {
- get: function () {
- return this.blurXFilter.blur;
- },
- set: function (t) {
- (this.blurXFilter.blur = this.blurYFilter.blur = t),
- this.updatePadding();
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'quality', {
- get: function () {
- return this.blurXFilter.quality;
- },
- set: function (t) {
- this.blurXFilter.quality = this.blurYFilter.quality = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'blurX', {
- get: function () {
- return this.blurXFilter.blur;
- },
- set: function (t) {
- (this.blurXFilter.blur = t), this.updatePadding();
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'blurY', {
- get: function () {
- return this.blurYFilter.blur;
- },
- set: function (t) {
- (this.blurYFilter.blur = t), this.updatePadding();
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'blendMode', {
- get: function () {
- return this.blurYFilter.blendMode;
- },
- set: function (t) {
- this.blurYFilter.blendMode = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'repeatEdgePixels', {
- get: function () {
- return this._repeatEdgePixels;
- },
- set: function (t) {
- (this._repeatEdgePixels = t), this.updatePadding();
- },
- enumerable: !1,
- configurable: !0,
- });
- })(EF);
- var LG = function (t, e) {
- return (
- (LG =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- LG(t, e)
- );
- };
- var FG = (function (t) {
- function e() {
- var e = this,
- r = {
- m: new Float32Array([
- 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0,
- ]),
- uAlpha: 1,
- };
- return (
- ((e =
- t.call(
- this,
- rN,
- 'varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (uAlpha == 0.0) {\n gl_FragColor = c;\n return;\n }\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n',
- r
- ) || this).alpha = 1),
- e
- );
- }
- return (
- (function (t, e) {
- function r() {
- this.constructor = t;
- }
- LG(t, e),
- (t.prototype =
- null === e
- ? Object.create(e)
- : ((r.prototype = e.prototype), new r()));
- })(e, t),
- (e.prototype._loadMatrix = function (t, e) {
- void 0 === e && (e = !1);
- var r = t;
- e &&
- (this._multiply(r, this.uniforms.m, t), (r = this._colorMatrix(r))),
- (this.uniforms.m = r);
- }),
- (e.prototype._multiply = function (t, e, r) {
- return (
- (t[0] = e[0] * r[0] + e[1] * r[5] + e[2] * r[10] + e[3] * r[15]),
- (t[1] = e[0] * r[1] + e[1] * r[6] + e[2] * r[11] + e[3] * r[16]),
- (t[2] = e[0] * r[2] + e[1] * r[7] + e[2] * r[12] + e[3] * r[17]),
- (t[3] = e[0] * r[3] + e[1] * r[8] + e[2] * r[13] + e[3] * r[18]),
- (t[4] =
- e[0] * r[4] + e[1] * r[9] + e[2] * r[14] + e[3] * r[19] + e[4]),
- (t[5] = e[5] * r[0] + e[6] * r[5] + e[7] * r[10] + e[8] * r[15]),
- (t[6] = e[5] * r[1] + e[6] * r[6] + e[7] * r[11] + e[8] * r[16]),
- (t[7] = e[5] * r[2] + e[6] * r[7] + e[7] * r[12] + e[8] * r[17]),
- (t[8] = e[5] * r[3] + e[6] * r[8] + e[7] * r[13] + e[8] * r[18]),
- (t[9] =
- e[5] * r[4] + e[6] * r[9] + e[7] * r[14] + e[8] * r[19] + e[9]),
- (t[10] = e[10] * r[0] + e[11] * r[5] + e[12] * r[10] + e[13] * r[15]),
- (t[11] = e[10] * r[1] + e[11] * r[6] + e[12] * r[11] + e[13] * r[16]),
- (t[12] = e[10] * r[2] + e[11] * r[7] + e[12] * r[12] + e[13] * r[17]),
- (t[13] = e[10] * r[3] + e[11] * r[8] + e[12] * r[13] + e[13] * r[18]),
- (t[14] =
- e[10] * r[4] +
- e[11] * r[9] +
- e[12] * r[14] +
- e[13] * r[19] +
- e[14]),
- (t[15] = e[15] * r[0] + e[16] * r[5] + e[17] * r[10] + e[18] * r[15]),
- (t[16] = e[15] * r[1] + e[16] * r[6] + e[17] * r[11] + e[18] * r[16]),
- (t[17] = e[15] * r[2] + e[16] * r[7] + e[17] * r[12] + e[18] * r[17]),
- (t[18] = e[15] * r[3] + e[16] * r[8] + e[17] * r[13] + e[18] * r[18]),
- (t[19] =
- e[15] * r[4] +
- e[16] * r[9] +
- e[17] * r[14] +
- e[18] * r[19] +
- e[19]),
- t
- );
- }),
- (e.prototype._colorMatrix = function (t) {
- var e = new Float32Array(t);
- return (e[4] /= 255), (e[9] /= 255), (e[14] /= 255), (e[19] /= 255), e;
- }),
- (e.prototype.brightness = function (t, e) {
- var r = [t, 0, 0, 0, 0, 0, t, 0, 0, 0, 0, 0, t, 0, 0, 0, 0, 0, 1, 0];
- this._loadMatrix(r, e);
- }),
- (e.prototype.tint = function (t, e) {
- var r = [
- ((t >> 16) & 255) / 255,
- 0,
- 0,
- 0,
- 0,
- 0,
- ((t >> 8) & 255) / 255,
- 0,
- 0,
- 0,
- 0,
- 0,
- (255 & t) / 255,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- ];
- this._loadMatrix(r, e);
- }),
- (e.prototype.greyscale = function (t, e) {
- var r = [t, t, t, 0, 0, t, t, t, 0, 0, t, t, t, 0, 0, 0, 0, 0, 1, 0];
- this._loadMatrix(r, e);
- }),
- (e.prototype.blackAndWhite = function (t) {
- this._loadMatrix(
- [
- 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0.3, 0.6, 0.1, 0, 0, 0, 0,
- 0, 1, 0,
- ],
- t
- );
- }),
- (e.prototype.hue = function (t, e) {
- t = ((t || 0) / 180) * Math.PI;
- var r = Math.cos(t),
- n = Math.sin(t),
- i = 1 / 3,
- o = (0, Math.sqrt)(i),
- s = [
- r + (1 - r) * i,
- i * (1 - r) - o * n,
- i * (1 - r) + o * n,
- 0,
- 0,
- i * (1 - r) + o * n,
- r + i * (1 - r),
- i * (1 - r) - o * n,
- 0,
- 0,
- i * (1 - r) - o * n,
- i * (1 - r) + o * n,
- r + i * (1 - r),
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- ];
- this._loadMatrix(s, e);
- }),
- (e.prototype.contrast = function (t, e) {
- var r = (t || 0) + 1,
- n = -0.5 * (r - 1),
- i = [r, 0, 0, 0, n, 0, r, 0, 0, n, 0, 0, r, 0, n, 0, 0, 0, 1, 0];
- this._loadMatrix(i, e);
- }),
- (e.prototype.saturate = function (t, e) {
- void 0 === t && (t = 0);
- var r = (2 * t) / 3 + 1,
- n = -0.5 * (r - 1),
- i = [r, n, n, 0, 0, n, r, n, 0, 0, n, n, r, 0, 0, 0, 0, 0, 1, 0];
- this._loadMatrix(i, e);
- }),
- (e.prototype.desaturate = function () {
- this.saturate(-1);
- }),
- (e.prototype.negative = function (t) {
- this._loadMatrix(
- [-1, 0, 0, 1, 0, 0, -1, 0, 1, 0, 0, 0, -1, 1, 0, 0, 0, 0, 1, 0],
- t
- );
- }),
- (e.prototype.sepia = function (t) {
- this._loadMatrix(
- [
- 0.393, 0.7689999, 0.18899999, 0, 0, 0.349, 0.6859999, 0.16799999, 0,
- 0, 0.272, 0.5339999, 0.13099999, 0, 0, 0, 0, 0, 1, 0,
- ],
- t
- );
- }),
- (e.prototype.technicolor = function (t) {
- this._loadMatrix(
- [
- 1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0,
- 11.793603434377337, -0.3087833385928097, 1.7658908555458428,
- -0.10601743074722245, 0, -70.35205161461398, -0.231103377548616,
- -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138, 0, 0,
- 0, 1, 0,
- ],
- t
- );
- }),
- (e.prototype.polaroid = function (t) {
- this._loadMatrix(
- [
- 1.438, -0.062, -0.062, 0, 0, -0.122, 1.378, -0.122, 0, 0, -0.016,
- -0.016, 1.483, 0, 0, 0, 0, 0, 1, 0,
- ],
- t
- );
- }),
- (e.prototype.toBGR = function (t) {
- this._loadMatrix(
- [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0],
- t
- );
- }),
- (e.prototype.kodachrome = function (t) {
- this._loadMatrix(
- [
- 1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0,
- 63.72958762196502, -0.16404339962244616, 1.0835251566291304,
- -0.05498805115633132, 0, 24.732407896706203, -0.16786010706155763,
- -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946, 0, 0,
- 0, 1, 0,
- ],
- t
- );
- }),
- (e.prototype.browni = function (t) {
- this._loadMatrix(
- [
- 0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0,
- 47.43192855600873, -0.037703249837783157, 0.8609577587992641,
- 0.15059552388459913, 0, -36.96841498319127, 0.24113635128153335,
- -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283, 0,
- 0, 0, 1, 0,
- ],
- t
- );
- }),
- (e.prototype.vintage = function (t) {
- this._loadMatrix(
- [
- 0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0,
- 9.651285835294123, 0.02578397704808868, 0.6441188644374771,
- 0.03259127616149294, 0, 7.462829176470591, 0.0466055556782719,
- -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296, 0, 0,
- 0, 1, 0,
- ],
- t
- );
- }),
- (e.prototype.colorTone = function (t, e, r, n, i) {
- var o = (((r = r || 16770432) >> 16) & 255) / 255,
- s = ((r >> 8) & 255) / 255,
- a = (255 & r) / 255,
- u = (((n = n || 3375104) >> 16) & 255) / 255,
- c = ((n >> 8) & 255) / 255,
- h = (255 & n) / 255,
- l = [
- 0.3,
- 0.59,
- 0.11,
- 0,
- 0,
- o,
- s,
- a,
- (t = t || 0.2),
- 0,
- u,
- c,
- h,
- (e = e || 0.15),
- 0,
- o - u,
- s - c,
- a - h,
- 0,
- 0,
- ];
- this._loadMatrix(l, i);
- }),
- (e.prototype.night = function (t, e) {
- var r = [
- -2 * (t = t || 0.1),
- -t,
- 0,
- 0,
- 0,
- -t,
- 0,
- t,
- 0,
- 0,
- 0,
- t,
- 2 * t,
- 0,
- 0,
- 0,
- 0,
- 0,
- 1,
- 0,
- ];
- this._loadMatrix(r, e);
- }),
- (e.prototype.predator = function (t, e) {
- var r = [
- 11.224130630493164 * t,
- -4.794486999511719 * t,
- -2.8746118545532227 * t,
- 0 * t,
- 0.40342438220977783 * t,
- -3.6330697536468506 * t,
- 9.193157196044922 * t,
- -2.951810836791992 * t,
- 0 * t,
- -1.316135048866272 * t,
- -3.2184197902679443 * t,
- -4.2375030517578125 * t,
- 7.476448059082031 * t,
- 0 * t,
- 0.8044459223747253 * t,
- 0,
- 0,
- 0,
- 1,
- 0,
- ];
- this._loadMatrix(r, e);
- }),
- (e.prototype.lsd = function (t) {
- this._loadMatrix(
- [
- 2, -0.4, 0.5, 0, 0, -0.5, 2, -0.4, 0, 0, -0.4, -0.5, 3, 0, 0, 0, 0,
- 0, 1, 0,
- ],
- t
- );
- }),
- (e.prototype.reset = function () {
- this._loadMatrix(
- [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0],
- !1
- );
- }),
- Object.defineProperty(e.prototype, 'matrix', {
- get: function () {
- return this.uniforms.m;
- },
- set: function (t) {
- this.uniforms.m = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'alpha', {
- get: function () {
- return this.uniforms.uAlpha;
- },
- set: function (t) {
- this.uniforms.uAlpha = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- e
- );
- })(EF);
- FG.prototype.grayscale = FG.prototype.greyscale;
- var NG = function (t, e) {
- return (
- (NG =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- NG(t, e)
- );
- };
- !(function (t) {
- function e(e, r) {
- var n = this,
- i = new CD();
- return (
- (e.renderable = !1),
- ((n =
- t.call(
- this,
- 'attribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\nuniform mat3 filterMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vFilterCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvec2 filterTextureCoord( void )\n{\n return aVertexPosition * (outputFrame.zw * inputSize.zw);\n}\n\nvoid main(void)\n{\n\tgl_Position = filterVertexPosition();\n\tvTextureCoord = filterTextureCoord();\n\tvFilterCoord = ( filterMatrix * vec3( vTextureCoord, 1.0) ).xy;\n}\n',
- 'varying vec2 vFilterCoord;\nvarying vec2 vTextureCoord;\n\nuniform vec2 scale;\nuniform mat2 rotation;\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nuniform highp vec4 inputSize;\nuniform vec4 inputClamp;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vFilterCoord);\n\n map -= 0.5;\n map.xy = scale * inputSize.zw * (rotation * map.xy);\n\n gl_FragColor = texture2D(uSampler, clamp(vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y), inputClamp.xy, inputClamp.zw));\n}\n',
- {
- mapSampler: e._texture,
- filterMatrix: i,
- scale: { x: 1, y: 1 },
- rotation: new Float32Array([1, 0, 0, 1]),
- }
- ) || this).maskSprite = e),
- (n.maskMatrix = i),
- null == r && (r = 20),
- (n.scale = new _D(r, r)),
- n
- );
- }
- (function (t, e) {
- function r() {
- this.constructor = t;
- }
- NG(t, e),
- (t.prototype =
- null === e
- ? Object.create(e)
- : ((r.prototype = e.prototype), new r()));
- })(e, t),
- (e.prototype.apply = function (t, e, r, n) {
- (this.uniforms.filterMatrix = t.calculateSpriteMatrix(
- this.maskMatrix,
- this.maskSprite
- )),
- (this.uniforms.scale.x = this.scale.x),
- (this.uniforms.scale.y = this.scale.y);
- var i = this.maskSprite.worldTransform,
- o = Math.sqrt(i.a * i.a + i.b * i.b),
- s = Math.sqrt(i.c * i.c + i.d * i.d);
- 0 !== o &&
- 0 !== s &&
- ((this.uniforms.rotation[0] = i.a / o),
- (this.uniforms.rotation[1] = i.b / o),
- (this.uniforms.rotation[2] = i.c / s),
- (this.uniforms.rotation[3] = i.d / s)),
- t.applyFilter(this, e, r, n);
- }),
- Object.defineProperty(e.prototype, 'map', {
- get: function () {
- return this.uniforms.mapSampler;
- },
- set: function (t) {
- this.uniforms.mapSampler = t;
- },
- enumerable: !1,
- configurable: !0,
- });
- })(EF);
- var kG = function (t, e) {
- return (
- (kG =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- kG(t, e)
- );
- };
- !(function (t) {
- function e() {
- return (
- t.call(
- this,
- '\nattribute vec2 aVertexPosition;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\n\nuniform vec4 inputSize;\nuniform vec4 outputFrame;\n\nvec4 filterVertexPosition( void )\n{\n vec2 position = aVertexPosition * max(outputFrame.zw, vec2(0.)) + outputFrame.xy;\n\n return vec4((projectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);\n}\n\nvoid texcoords(vec2 fragCoord, vec2 inverseVP,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void) {\n\n gl_Position = filterVertexPosition();\n\n vFragCoord = aVertexPosition * outputFrame.zw;\n\n texcoords(vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n',
- 'varying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nvarying vec2 vFragCoord;\nuniform sampler2D uSampler;\nuniform highp vec4 inputSize;\n\n\n/**\n Basic FXAA implementation based on the code on geeks3d.com with the\n modification that the texture2DLod stuff was removed since it\'s\n unsupported by WebGL.\n\n --\n\n From:\n https://github.com/mitsuhiko/webgl-meincraft\n\n Copyright (c) 2011 by Armin Ronacher.\n\n Some rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are\n met:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n#ifndef FXAA_REDUCE_MIN\n#define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n#define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n#define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 inverseVP,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec4 color;\n\n color = fxaa(uSampler, vFragCoord, inputSize.zw, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n'
- ) || this
- );
- }
- (function (t, e) {
- function r() {
- this.constructor = t;
- }
- kG(t, e),
- (t.prototype =
- null === e
- ? Object.create(e)
- : ((r.prototype = e.prototype), new r()));
- })(e, t);
- })(EF);
- var BG = function (t, e) {
- return (
- (BG =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- BG(t, e)
- );
- };
- !(function (t) {
- function e(e, r) {
- void 0 === e && (e = 0.5), void 0 === r && (r = Math.random());
- var n =
- t.call(
- this,
- rN,
- 'precision highp float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform float uNoise;\nuniform float uSeed;\nuniform sampler2D uSampler;\n\nfloat rand(vec2 co)\n{\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float randomValue = rand(gl_FragCoord.xy * uSeed);\n float diff = (randomValue - 0.5) * uNoise;\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (color.a > 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n',
- { uNoise: 0, uSeed: 0 }
- ) || this;
- return (n.noise = e), (n.seed = r), n;
- }
- (function (t, e) {
- function r() {
- this.constructor = t;
- }
- BG(t, e),
- (t.prototype =
- null === e
- ? Object.create(e)
- : ((r.prototype = e.prototype), new r()));
- })(e, t),
- Object.defineProperty(e.prototype, 'noise', {
- get: function () {
- return this.uniforms.uNoise;
- },
- set: function (t) {
- this.uniforms.uNoise = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'seed', {
- get: function () {
- return this.uniforms.uSeed;
- },
- set: function (t) {
- this.uniforms.uSeed = t;
- },
- enumerable: !1,
- configurable: !0,
- });
- })(EF);
- var GG = new CD();
- (UD.prototype._cacheAsBitmap = !1),
- (UD.prototype._cacheData = null),
- (UD.prototype._cacheAsBitmapResolution = null),
- (UD.prototype._cacheAsBitmapMultisample = WP.NONE);
- var UG = function () {
- (this.textureCacheId = null),
- (this.originalRender = null),
- (this.originalRenderCanvas = null),
- (this.originalCalculateBounds = null),
- (this.originalGetLocalBounds = null),
- (this.originalUpdateTransform = null),
- (this.originalDestroy = null),
- (this.originalMask = null),
- (this.originalFilterArea = null),
- (this.originalContainsPoint = null),
- (this.sprite = null);
- };
- Object.defineProperties(UD.prototype, {
- cacheAsBitmapResolution: {
- get: function () {
- return this._cacheAsBitmapResolution;
- },
- set: function (t) {
- t !== this._cacheAsBitmapResolution &&
- ((this._cacheAsBitmapResolution = t),
- this.cacheAsBitmap &&
- ((this.cacheAsBitmap = !1), (this.cacheAsBitmap = !0)));
- },
- },
- cacheAsBitmapMultisample: {
- get: function () {
- return this._cacheAsBitmapMultisample;
- },
- set: function (t) {
- t !== this._cacheAsBitmapMultisample &&
- ((this._cacheAsBitmapMultisample = t),
- this.cacheAsBitmap &&
- ((this.cacheAsBitmap = !1), (this.cacheAsBitmap = !0)));
- },
- },
- cacheAsBitmap: {
- get: function () {
- return this._cacheAsBitmap;
- },
- set: function (t) {
- var e;
- this._cacheAsBitmap !== t &&
- ((this._cacheAsBitmap = t),
- t
- ? (this._cacheData || (this._cacheData = new UG()),
- ((e = this._cacheData).originalRender = this.render),
- (e.originalRenderCanvas = this.renderCanvas),
- (e.originalUpdateTransform = this.updateTransform),
- (e.originalCalculateBounds = this.calculateBounds),
- (e.originalGetLocalBounds = this.getLocalBounds),
- (e.originalDestroy = this.destroy),
- (e.originalContainsPoint = this.containsPoint),
- (e.originalMask = this._mask),
- (e.originalFilterArea = this.filterArea),
- (this.render = this._renderCached),
- (this.renderCanvas = this._renderCachedCanvas),
- (this.destroy = this._cacheAsBitmapDestroy))
- : ((e = this._cacheData).sprite &&
- this._destroyCachedDisplayObject(),
- (this.render = e.originalRender),
- (this.renderCanvas = e.originalRenderCanvas),
- (this.calculateBounds = e.originalCalculateBounds),
- (this.getLocalBounds = e.originalGetLocalBounds),
- (this.destroy = e.originalDestroy),
- (this.updateTransform = e.originalUpdateTransform),
- (this.containsPoint = e.originalContainsPoint),
- (this._mask = e.originalMask),
- (this.filterArea = e.originalFilterArea)));
- },
- },
- }),
- (UD.prototype._renderCached = function (t) {
- !this.visible ||
- this.worldAlpha <= 0 ||
- !this.renderable ||
- (this._initCachedDisplayObject(t),
- (this._cacheData.sprite.transform._worldID = this.transform._worldID),
- (this._cacheData.sprite.worldAlpha = this.worldAlpha),
- this._cacheData.sprite._render(t));
- }),
- (UD.prototype._initCachedDisplayObject = function (t) {
- var e;
- if (!this._cacheData || !this._cacheData.sprite) {
- var r = this.alpha;
- (this.alpha = 1), t.batch.flush();
- var n = this.getLocalBounds(null, !0).clone();
- if (this.filters && this.filters.length) {
- var i = this.filters[0].padding;
- n.pad(i);
- }
- n.ceil(vA.RESOLUTION);
- var o = t.renderTexture.current,
- s = t.renderTexture.sourceFrame.clone(),
- a = t.renderTexture.destinationFrame.clone(),
- u = t.projection.transform,
- c = SL.create({
- width: n.width,
- height: n.height,
- resolution: this.cacheAsBitmapResolution || t.resolution,
- multisample:
- null !== (e = this.cacheAsBitmapMultisample) && void 0 !== e
- ? e
- : t.multisample,
- }),
- h = 'cacheAsBitmap_' + oD();
- (this._cacheData.textureCacheId = h),
- aL.addToCache(c.baseTexture, h),
- EL.addToCache(c, h);
- var l = this.transform.localTransform
- .copyTo(GG)
- .invert()
- .translate(-n.x, -n.y);
- (this.render = this._cacheData.originalRender),
- t.render(this, {
- renderTexture: c,
- clear: !0,
- transform: l,
- skipUpdateTransform: !1,
- }),
- t.framebuffer.blit(),
- (t.projection.transform = u),
- t.renderTexture.bind(o, s, a),
- (this.render = this._renderCached),
- (this.updateTransform = this.displayObjectUpdateTransform),
- (this.calculateBounds = this._calculateCachedBounds),
- (this.getLocalBounds = this._getCachedLocalBounds),
- (this._mask = null),
- (this.filterArea = null),
- (this.alpha = r);
- var d = new SB(c);
- (d.transform.worldTransform = this.transform.worldTransform),
- (d.anchor.x = -n.x / n.width),
- (d.anchor.y = -n.y / n.height),
- (d.alpha = r),
- (d._bounds = this._bounds),
- (this._cacheData.sprite = d),
- (this.transform._parentID = -1),
- this.parent
- ? this.updateTransform()
- : (this.enableTempParent(),
- this.updateTransform(),
- this.disableTempParent(null)),
- (this.containsPoint = d.containsPoint.bind(d));
- }
- }),
- (UD.prototype._renderCachedCanvas = function (t) {
- !this.visible ||
- this.worldAlpha <= 0 ||
- !this.renderable ||
- (this._initCachedDisplayObjectCanvas(t),
- (this._cacheData.sprite.worldAlpha = this.worldAlpha),
- this._cacheData.sprite._renderCanvas(t));
- }),
- (UD.prototype._initCachedDisplayObjectCanvas = function (t) {
- if (!this._cacheData || !this._cacheData.sprite) {
- var e = this.getLocalBounds(null, !0),
- r = this.alpha;
- this.alpha = 1;
- var n = t.context,
- i = t._projTransform;
- e.ceil(vA.RESOLUTION);
- var o = SL.create({ width: e.width, height: e.height }),
- s = 'cacheAsBitmap_' + oD();
- (this._cacheData.textureCacheId = s),
- aL.addToCache(o.baseTexture, s),
- EL.addToCache(o, s);
- var a = GG;
- this.transform.localTransform.copyTo(a),
- a.invert(),
- (a.tx -= e.x),
- (a.ty -= e.y),
- (this.renderCanvas = this._cacheData.originalRenderCanvas),
- t.render(this, {
- renderTexture: o,
- clear: !0,
- transform: a,
- skipUpdateTransform: !1,
- }),
- (t.context = n),
- (t._projTransform = i),
- (this.renderCanvas = this._renderCachedCanvas),
- (this.updateTransform = this.displayObjectUpdateTransform),
- (this.calculateBounds = this._calculateCachedBounds),
- (this.getLocalBounds = this._getCachedLocalBounds),
- (this._mask = null),
- (this.filterArea = null),
- (this.alpha = r);
- var u = new SB(o);
- (u.transform.worldTransform = this.transform.worldTransform),
- (u.anchor.x = -e.x / e.width),
- (u.anchor.y = -e.y / e.height),
- (u.alpha = r),
- (u._bounds = this._bounds),
- (this._cacheData.sprite = u),
- (this.transform._parentID = -1),
- this.parent
- ? this.updateTransform()
- : ((this.parent = t._tempDisplayObjectParent),
- this.updateTransform(),
- (this.parent = null)),
- (this.containsPoint = u.containsPoint.bind(u));
- }
- }),
- (UD.prototype._calculateCachedBounds = function () {
- this._bounds.clear(),
- (this._cacheData.sprite.transform._worldID = this.transform._worldID),
- this._cacheData.sprite._calculateBounds(),
- (this._bounds.updateID = this._boundsID);
- }),
- (UD.prototype._getCachedLocalBounds = function () {
- return this._cacheData.sprite.getLocalBounds(null);
- }),
- (UD.prototype._destroyCachedDisplayObject = function () {
- this._cacheData.sprite._texture.destroy(!0),
- (this._cacheData.sprite = null),
- aL.removeFromCache(this._cacheData.textureCacheId),
- EL.removeFromCache(this._cacheData.textureCacheId),
- (this._cacheData.textureCacheId = null);
- }),
- (UD.prototype._cacheAsBitmapDestroy = function (t) {
- (this.cacheAsBitmap = !1), this.destroy(t);
- }),
- (UD.prototype.name = null),
- (VD.prototype.getChildByName = function (t, e) {
- for (var r = 0, n = this.children.length; r < n; r++)
- if (this.children[r].name === t) return this.children[r];
- if (e)
- for (r = 0, n = this.children.length; r < n; r++) {
- var i = this.children[r];
- if (i.getChildByName) {
- var o = i.getChildByName(t, !0);
- if (o) return o;
- }
- }
- return null;
- }),
- (UD.prototype.getGlobalPosition = function (t, e) {
- return (
- void 0 === t && (t = new _D()),
- void 0 === e && (e = !1),
- this.parent
- ? this.parent.toGlobal(this.position, t, e)
- : ((t.x = this.position.x), (t.y = this.position.y)),
- t
- );
- });
- var jG = (function () {
- function t() {}
- return (
- (t.init = function (t) {
- var e = this;
- Object.defineProperty(this, 'resizeTo', {
- set: function (t) {
- globalThis.removeEventListener('resize', this.queueResize),
- (this._resizeTo = t),
- t &&
- (globalThis.addEventListener('resize', this.queueResize),
- this.resize());
- },
- get: function () {
- return this._resizeTo;
- },
- }),
- (this.queueResize = function () {
- e._resizeTo &&
- (e.cancelResize(),
- (e._resizeId = requestAnimationFrame(function () {
- return e.resize();
- })));
- }),
- (this.cancelResize = function () {
- e._resizeId &&
- (cancelAnimationFrame(e._resizeId), (e._resizeId = null));
- }),
- (this.resize = function () {
- if (e._resizeTo) {
- var t, r;
- if ((e.cancelResize(), e._resizeTo === globalThis.window))
- (t = globalThis.innerWidth), (r = globalThis.innerHeight);
- else {
- var n = e._resizeTo;
- (t = n.clientWidth), (r = n.clientHeight);
- }
- e.renderer.resize(t, r);
- }
- }),
- (this._resizeId = null),
- (this._resizeTo = null),
- (this.resizeTo = t.resizeTo || null);
- }),
- (t.destroy = function () {
- globalThis.removeEventListener('resize', this.queueResize),
- this.cancelResize(),
- (this.cancelResize = null),
- (this.queueResize = null),
- (this.resizeTo = null),
- (this.resize = null);
- }),
- (t.extension = HD.Application),
- t
- );
- })(),
- XG = (function () {
- function t(e) {
- var r = this;
- (this.stage = new VD()),
- (e = Object.assign({ forceCanvas: !1 }, e)),
- (this.renderer = eN(e)),
- t._plugins.forEach(function (t) {
- t.init.call(r, e);
- });
- }
- return (
- (t.registerPlugin = function (t) {
- aD(
- '6.5.0',
- 'Application.registerPlugin() is deprecated, use extensions.add()'
- ),
- ZD.add({ type: HD.Application, ref: t });
- }),
- (t.prototype.render = function () {
- this.renderer.render(this.stage);
- }),
- Object.defineProperty(t.prototype, 'view', {
- get: function () {
- return this.renderer.view;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(t.prototype, 'screen', {
- get: function () {
- return this.renderer.screen;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (t.prototype.destroy = function (e, r) {
- var n = this,
- i = t._plugins.slice(0);
- i.reverse(),
- i.forEach(function (t) {
- t.destroy.call(n);
- }),
- this.stage.destroy(r),
- (this.stage = null),
- this.renderer.destroy(e),
- (this.renderer = null);
- }),
- (t._plugins = []),
- t
- );
- })();
- ZD.handleByList(HD.Application, XG._plugins), ZD.add(jG);
- var VG = function (t, e) {
- return (
- (VG =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- VG(t, e)
- );
- };
- function HG(t, e) {
- function r() {
- this.constructor = t;
- }
- VG(t, e),
- (t.prototype =
- null === e ? Object.create(e) : ((r.prototype = e.prototype), new r()));
- }
- var WG = (function (t) {
- function e(e, r, n, i) {
- void 0 === e && (e = 100),
- void 0 === r && (r = 100),
- void 0 === n && (n = 10),
- void 0 === i && (i = 10);
- var o = t.call(this) || this;
- return (
- (o.segWidth = n),
- (o.segHeight = i),
- (o.width = e),
- (o.height = r),
- o.build(),
- o
- );
- }
- return (
- HG(e, t),
- (e.prototype.build = function () {
- for (
- var t = this.segWidth * this.segHeight,
- e = [],
- r = [],
- n = [],
- i = this.segWidth - 1,
- o = this.segHeight - 1,
- s = this.width / i,
- a = this.height / o,
- u = 0;
- u < t;
- u++
- ) {
- var c = u % this.segWidth,
- h = (u / this.segWidth) | 0;
- e.push(c * s, h * a), r.push(c / i, h / o);
- }
- var l = i * o;
- for (u = 0; u < l; u++) {
- var d = u % i,
- f = (u / i) | 0,
- p = f * this.segWidth + d,
- v = f * this.segWidth + d + 1,
- m = (f + 1) * this.segWidth + d,
- y = (f + 1) * this.segWidth + d + 1;
- n.push(p, v, m, v, y, m);
- }
- (this.buffers[0].data = new Float32Array(e)),
- (this.buffers[1].data = new Float32Array(r)),
- (this.indexBuffer.data = new Uint16Array(n)),
- this.buffers[0].update(),
- this.buffers[1].update(),
- this.indexBuffer.update();
- }),
- e
- );
- })(dG),
- YG = (function (t) {
- function e(e, r, n) {
- void 0 === e && (e = 200), void 0 === n && (n = 0);
- var i =
- t.call(
- this,
- new Float32Array(4 * r.length),
- new Float32Array(4 * r.length),
- new Uint16Array(6 * (r.length - 1))
- ) || this;
- return (
- (i.points = r), (i._width = e), (i.textureScale = n), i.build(), i
- );
- }
- return (
- HG(e, t),
- Object.defineProperty(e.prototype, 'width', {
- get: function () {
- return this._width;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype.build = function () {
- var t = this.points;
- if (t) {
- var e = this.getBuffer('aVertexPosition'),
- r = this.getBuffer('aTextureCoord'),
- n = this.getIndex();
- if (!(t.length < 1)) {
- e.data.length / 4 !== t.length &&
- ((e.data = new Float32Array(4 * t.length)),
- (r.data = new Float32Array(4 * t.length)),
- (n.data = new Uint16Array(6 * (t.length - 1))));
- var i = r.data,
- o = n.data;
- (i[0] = 0), (i[1] = 0), (i[2] = 0), (i[3] = 1);
- for (
- var s = 0,
- a = t[0],
- u = this._width * this.textureScale,
- c = t.length,
- h = 0;
- h < c;
- h++
- ) {
- var l = 4 * h;
- if (this.textureScale > 0) {
- var d = a.x - t[h].x,
- f = a.y - t[h].y,
- p = Math.sqrt(d * d + f * f);
- (a = t[h]), (s += p / u);
- } else s = h / (c - 1);
- (i[l] = s), (i[l + 1] = 0), (i[l + 2] = s), (i[l + 3] = 1);
- }
- var v = 0;
- for (h = 0; h < c - 1; h++) {
- l = 2 * h;
- (o[v++] = l),
- (o[v++] = l + 1),
- (o[v++] = l + 2),
- (o[v++] = l + 2),
- (o[v++] = l + 1),
- (o[v++] = l + 3);
- }
- r.update(), n.update(), this.updateVertices();
- }
- }
- }),
- (e.prototype.updateVertices = function () {
- var t = this.points;
- if (!(t.length < 1)) {
- for (
- var e,
- r = t[0],
- n = 0,
- i = 0,
- o = this.buffers[0].data,
- s = t.length,
- a = 0;
- a < s;
- a++
- ) {
- var u = t[a],
- c = 4 * a;
- (i = -((e = a < t.length - 1 ? t[a + 1] : u).x - r.x)),
- (n = e.y - r.y);
- var h = Math.sqrt(n * n + i * i),
- l =
- this.textureScale > 0
- ? (this.textureScale * this._width) / 2
- : this._width / 2;
- (n /= h),
- (i /= h),
- (n *= l),
- (i *= l),
- (o[c] = u.x + n),
- (o[c + 1] = u.y + i),
- (o[c + 2] = u.x - n),
- (o[c + 3] = u.y - i),
- (r = u);
- }
- this.buffers[0].update();
- }
- }),
- (e.prototype.update = function () {
- this.textureScale > 0 ? this.build() : this.updateVertices();
- }),
- e
- );
- })(dG),
- zG = (function (t) {
- function e(e, r, n) {
- void 0 === n && (n = 0);
- var i = this,
- o = new YG(e.height, r, n),
- s = new lG(e);
- return (
- n > 0 && (e.baseTexture.wrapMode = kP.REPEAT),
- ((i = t.call(this, o, s) || this).autoUpdate = !0),
- i
- );
- }
- return (
- HG(e, t),
- (e.prototype._render = function (e) {
- var r = this.geometry;
- (this.autoUpdate || r._width !== this.shader.texture.height) &&
- ((r._width = this.shader.texture.height), r.update()),
- t.prototype._render.call(this, e);
- }),
- e
- );
- })(hG),
- ZG = (function (t) {
- function e(e, r, n) {
- var i = this,
- o = new WG(e.width, e.height, r, n),
- s = new lG(EL.WHITE);
- return (
- ((i = t.call(this, o, s) || this).texture = e), (i.autoResize = !0), i
- );
- }
- return (
- HG(e, t),
- (e.prototype.textureUpdated = function () {
- this._textureID = this.shader.texture._updateID;
- var t = this.geometry,
- e = this.shader.texture,
- r = e.width,
- n = e.height;
- !this.autoResize ||
- (t.width === r && t.height === n) ||
- ((t.width = this.shader.texture.width),
- (t.height = this.shader.texture.height),
- t.build());
- }),
- Object.defineProperty(e.prototype, 'texture', {
- get: function () {
- return this.shader.texture;
- },
- set: function (t) {
- this.shader.texture !== t &&
- ((this.shader.texture = t),
- (this._textureID = -1),
- t.baseTexture.valid
- ? this.textureUpdated()
- : t.once('update', this.textureUpdated, this));
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype._render = function (e) {
- this._textureID !== this.shader.texture._updateID &&
- this.textureUpdated(),
- t.prototype._render.call(this, e);
- }),
- (e.prototype.destroy = function (e) {
- this.shader.texture.off('update', this.textureUpdated, this),
- t.prototype.destroy.call(this, e);
- }),
- e
- );
- })(hG),
- JG = (function (t) {
- function e(e, r, n, i, o) {
- void 0 === e && (e = EL.EMPTY);
- var s = this,
- a = new dG(r, n, i);
- a.getBuffer('aVertexPosition').static = !1;
- var u = new lG(e);
- return ((s = t.call(this, a, u, null, o) || this).autoUpdate = !0), s;
- }
- return (
- HG(e, t),
- Object.defineProperty(e.prototype, 'vertices', {
- get: function () {
- return this.geometry.getBuffer('aVertexPosition').data;
- },
- set: function (t) {
- this.geometry.getBuffer('aVertexPosition').data = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype._render = function (e) {
- this.autoUpdate &&
- this.geometry.getBuffer('aVertexPosition').update(),
- t.prototype._render.call(this, e);
- }),
- e
- );
- })(hG),
- KG = (function (t) {
- function e(e, r, n, i, o) {
- void 0 === r && (r = 10),
- void 0 === n && (n = 10),
- void 0 === i && (i = 10),
- void 0 === o && (o = 10);
- var s = t.call(this, EL.WHITE, 4, 4) || this;
- return (
- (s._origWidth = e.orig.width),
- (s._origHeight = e.orig.height),
- (s._width = s._origWidth),
- (s._height = s._origHeight),
- (s._leftWidth = r),
- (s._rightWidth = i),
- (s._topHeight = n),
- (s._bottomHeight = o),
- (s.texture = e),
- s
- );
- }
- return (
- HG(e, t),
- (e.prototype.textureUpdated = function () {
- (this._textureID = this.shader.texture._updateID), this._refresh();
- }),
- Object.defineProperty(e.prototype, 'vertices', {
- get: function () {
- return this.geometry.getBuffer('aVertexPosition').data;
- },
- set: function (t) {
- this.geometry.getBuffer('aVertexPosition').data = t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype.updateHorizontalVertices = function () {
- var t = this.vertices,
- e = this._getMinScale();
- (t[9] = t[11] = t[13] = t[15] = this._topHeight * e),
- (t[17] =
- t[19] =
- t[21] =
- t[23] =
- this._height - this._bottomHeight * e),
- (t[25] = t[27] = t[29] = t[31] = this._height);
- }),
- (e.prototype.updateVerticalVertices = function () {
- var t = this.vertices,
- e = this._getMinScale();
- (t[2] = t[10] = t[18] = t[26] = this._leftWidth * e),
- (t[4] = t[12] = t[20] = t[28] = this._width - this._rightWidth * e),
- (t[6] = t[14] = t[22] = t[30] = this._width);
- }),
- (e.prototype._getMinScale = function () {
- var t = this._leftWidth + this._rightWidth,
- e = this._width > t ? 1 : this._width / t,
- r = this._topHeight + this._bottomHeight,
- n = this._height > r ? 1 : this._height / r;
- return Math.min(e, n);
- }),
- Object.defineProperty(e.prototype, 'width', {
- get: function () {
- return this._width;
- },
- set: function (t) {
- (this._width = t), this._refresh();
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'height', {
- get: function () {
- return this._height;
- },
- set: function (t) {
- (this._height = t), this._refresh();
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'leftWidth', {
- get: function () {
- return this._leftWidth;
- },
- set: function (t) {
- (this._leftWidth = t), this._refresh();
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'rightWidth', {
- get: function () {
- return this._rightWidth;
- },
- set: function (t) {
- (this._rightWidth = t), this._refresh();
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'topHeight', {
- get: function () {
- return this._topHeight;
- },
- set: function (t) {
- (this._topHeight = t), this._refresh();
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'bottomHeight', {
- get: function () {
- return this._bottomHeight;
- },
- set: function (t) {
- (this._bottomHeight = t), this._refresh();
- },
- enumerable: !1,
- configurable: !0,
- }),
- (e.prototype._refresh = function () {
- var t = this.texture,
- e = this.geometry.buffers[1].data;
- (this._origWidth = t.orig.width), (this._origHeight = t.orig.height);
- var r = 1 / this._origWidth,
- n = 1 / this._origHeight;
- (e[0] = e[8] = e[16] = e[24] = 0),
- (e[1] = e[3] = e[5] = e[7] = 0),
- (e[6] = e[14] = e[22] = e[30] = 1),
- (e[25] = e[27] = e[29] = e[31] = 1),
- (e[2] = e[10] = e[18] = e[26] = r * this._leftWidth),
- (e[4] = e[12] = e[20] = e[28] = 1 - r * this._rightWidth),
- (e[9] = e[11] = e[13] = e[15] = n * this._topHeight),
- (e[17] = e[19] = e[21] = e[23] = 1 - n * this._bottomHeight),
- this.updateHorizontalVertices(),
- this.updateVerticalVertices(),
- this.geometry.buffers[0].update(),
- this.geometry.buffers[1].update();
- }),
- e
- );
- })(ZG),
- qG = function (t, e) {
- return (
- (qG =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- qG(t, e)
- );
- };
- !(function (t) {
- function e(e, r) {
- void 0 === r && (r = !0);
- var n = t.call(this, e[0] instanceof EL ? e[0] : e[0].texture) || this;
- return (
- (n._textures = null),
- (n._durations = null),
- (n._autoUpdate = r),
- (n._isConnectedToTicker = !1),
- (n.animationSpeed = 1),
- (n.loop = !0),
- (n.updateAnchor = !1),
- (n.onComplete = null),
- (n.onFrameChange = null),
- (n.onLoop = null),
- (n._currentTime = 0),
- (n._playing = !1),
- (n._previousFrame = null),
- (n.textures = e),
- n
- );
- }
- (function (t, e) {
- function r() {
- this.constructor = t;
- }
- qG(t, e),
- (t.prototype =
- null === e
- ? Object.create(e)
- : ((r.prototype = e.prototype), new r()));
- })(e, t),
- (e.prototype.stop = function () {
- this._playing &&
- ((this._playing = !1),
- this._autoUpdate &&
- this._isConnectedToTicker &&
- (qD.shared.remove(this.update, this),
- (this._isConnectedToTicker = !1)));
- }),
- (e.prototype.play = function () {
- this._playing ||
- ((this._playing = !0),
- this._autoUpdate &&
- !this._isConnectedToTicker &&
- (qD.shared.add(this.update, this, YD.HIGH),
- (this._isConnectedToTicker = !0)));
- }),
- (e.prototype.gotoAndStop = function (t) {
- this.stop();
- var e = this.currentFrame;
- (this._currentTime = t),
- e !== this.currentFrame && this.updateTexture();
- }),
- (e.prototype.gotoAndPlay = function (t) {
- var e = this.currentFrame;
- (this._currentTime = t),
- e !== this.currentFrame && this.updateTexture(),
- this.play();
- }),
- (e.prototype.update = function (t) {
- if (this._playing) {
- var e = this.animationSpeed * t,
- r = this.currentFrame;
- if (null !== this._durations) {
- var n =
- (this._currentTime % 1) * this._durations[this.currentFrame];
- for (n += (e / 60) * 1e3; n < 0; )
- this._currentTime--, (n += this._durations[this.currentFrame]);
- var i = Math.sign(this.animationSpeed * t);
- for (
- this._currentTime = Math.floor(this._currentTime);
- n >= this._durations[this.currentFrame];
- )
- (n -= this._durations[this.currentFrame] * i),
- (this._currentTime += i);
- this._currentTime += n / this._durations[this.currentFrame];
- } else this._currentTime += e;
- this._currentTime < 0 && !this.loop
- ? (this.gotoAndStop(0), this.onComplete && this.onComplete())
- : this._currentTime >= this._textures.length && !this.loop
- ? (this.gotoAndStop(this._textures.length - 1),
- this.onComplete && this.onComplete())
- : r !== this.currentFrame &&
- (this.loop &&
- this.onLoop &&
- ((this.animationSpeed > 0 && this.currentFrame < r) ||
- (this.animationSpeed < 0 && this.currentFrame > r)) &&
- this.onLoop(),
- this.updateTexture());
- }
- }),
- (e.prototype.updateTexture = function () {
- var t = this.currentFrame;
- this._previousFrame !== t &&
- ((this._previousFrame = t),
- (this._texture = this._textures[t]),
- (this._textureID = -1),
- (this._textureTrimmedID = -1),
- (this._cachedTint = 16777215),
- (this.uvs = this._texture._uvs.uvsFloat32),
- this.updateAnchor &&
- this._anchor.copyFrom(this._texture.defaultAnchor),
- this.onFrameChange && this.onFrameChange(this.currentFrame));
- }),
- (e.prototype.destroy = function (e) {
- this.stop(),
- t.prototype.destroy.call(this, e),
- (this.onComplete = null),
- (this.onFrameChange = null),
- (this.onLoop = null);
- }),
- (e.fromFrames = function (t) {
- for (var r = [], n = 0; n < t.length; ++n) r.push(EL.from(t[n]));
- return new e(r);
- }),
- (e.fromImages = function (t) {
- for (var r = [], n = 0; n < t.length; ++n) r.push(EL.from(t[n]));
- return new e(r);
- }),
- Object.defineProperty(e.prototype, 'totalFrames', {
- get: function () {
- return this._textures.length;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'textures', {
- get: function () {
- return this._textures;
- },
- set: function (t) {
- if (t[0] instanceof EL)
- (this._textures = t), (this._durations = null);
- else {
- (this._textures = []), (this._durations = []);
- for (var e = 0; e < t.length; e++)
- this._textures.push(t[e].texture),
- this._durations.push(t[e].time);
- }
- (this._previousFrame = null),
- this.gotoAndStop(0),
- this.updateTexture();
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'currentFrame', {
- get: function () {
- var t = Math.floor(this._currentTime) % this._textures.length;
- return t < 0 && (t += this._textures.length), t;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'playing', {
- get: function () {
- return this._playing;
- },
- enumerable: !1,
- configurable: !0,
- }),
- Object.defineProperty(e.prototype, 'autoUpdate', {
- get: function () {
- return this._autoUpdate;
- },
- set: function (t) {
- t !== this._autoUpdate &&
- ((this._autoUpdate = t),
- !this._autoUpdate && this._isConnectedToTicker
- ? (qD.shared.remove(this.update, this),
- (this._isConnectedToTicker = !1))
- : this._autoUpdate &&
- !this._isConnectedToTicker &&
- this._playing &&
- (qD.shared.add(this.update, this),
- (this._isConnectedToTicker = !0)));
- },
- enumerable: !1,
- configurable: !0,
- });
- })(SB),
- ZD.add(fN, EN, TN, Wk, JB, dN, iG, CG, ek, kk, Bk, qB, QD, UN);
- var QG = function (t, e) {
- return (
- (QG =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- QG(t, e)
- );
- };
- var $G = (function () {
- function t(t) {
- (this._foundShapes = []), (this.renderer = t);
- }
- return (
- (t.prototype.pushMask = function (t) {
- var e = this.renderer,
- r = t.maskObject || t;
- e.context.save();
- var n = this._foundShapes;
- if ((this.recursiveFindShapes(r, n), n.length > 0)) {
- var i = e.context;
- i.beginPath();
- for (var o = 0; o < n.length; o++) {
- var s = n[o],
- a = s.transform.worldTransform;
- this.renderer.setContextTransform(a), this.renderGraphicsShape(s);
- }
- (n.length = 0), i.clip();
- }
- }),
- (t.prototype.recursiveFindShapes = function (t, e) {
- t.geometry && t.geometry.graphicsData && e.push(t);
- var r = t.children;
- if (r)
- for (var n = 0; n < r.length; n++) this.recursiveFindShapes(r[n], e);
- }),
- (t.prototype.renderGraphicsShape = function (t) {
- t.finishPoly();
- var e = this.renderer.context,
- r = t.geometry.graphicsData,
- n = r.length;
- if (0 !== n)
- for (var i = 0; i < n; i++) {
- var o = r[i],
- s = o.shape;
- if (s.type === vD.POLY) {
- var a = s.points,
- u = o.holes,
- c = void 0,
- h = void 0,
- l = void 0,
- d = void 0;
- e.moveTo(a[0], a[1]);
- for (var f = 1; f < a.length / 2; f++)
- e.lineTo(a[2 * f], a[2 * f + 1]);
- if (u.length > 0) {
- (c = 0), (l = a[0]), (d = a[1]);
- for (f = 2; f + 2 < a.length; f += 2)
- c +=
- (a[f] - l) * (a[f + 3] - d) -
- (a[f + 2] - l) * (a[f + 1] - d);
- for (var p = 0; p < u.length; p++)
- if ((a = u[p].shape.points)) {
- (h = 0), (l = a[0]), (d = a[1]);
- for (f = 2; f + 2 < a.length; f += 2)
- h +=
- (a[f] - l) * (a[f + 3] - d) -
- (a[f + 2] - l) * (a[f + 1] - d);
- if (h * c < 0) {
- e.moveTo(a[0], a[1]);
- for (f = 2; f < a.length; f += 2)
- e.lineTo(a[f], a[f + 1]);
- } else {
- e.moveTo(a[a.length - 2], a[a.length - 1]);
- for (f = a.length - 4; f >= 0; f -= 2)
- e.lineTo(a[f], a[f + 1]);
- }
- u[p].shape.closeStroke && e.closePath();
- }
- }
- a[0] === a[a.length - 2] &&
- a[1] === a[a.length - 1] &&
- e.closePath();
- } else if (s.type === vD.RECT)
- e.rect(s.x, s.y, s.width, s.height), e.closePath();
- else if (s.type === vD.CIRC)
- e.arc(s.x, s.y, s.radius, 0, 2 * Math.PI), e.closePath();
- else if (s.type === vD.ELIP) {
- var v = 2 * s.width,
- m = 2 * s.height,
- y = s.x - v / 2,
- g = s.y - m / 2,
- _ = 0.5522848,
- b = (v / 2) * _,
- T = (m / 2) * _,
- x = y + v,
- E = g + m,
- S = y + v / 2,
- w = g + m / 2;
- e.moveTo(y, w),
- e.bezierCurveTo(y, w - T, S - b, g, S, g),
- e.bezierCurveTo(S + b, g, x, w - T, x, w),
- e.bezierCurveTo(x, w + T, S + b, E, S, E),
- e.bezierCurveTo(S - b, E, y, w + T, y, w),
- e.closePath();
- } else if (s.type === vD.RREC) {
- var R = s.x,
- C = s.y,
- P = s.width,
- A = s.height,
- O = s.radius,
- I = Math.min(P, A) / 2;
- (O = O > I ? I : O),
- e.moveTo(R, C + O),
- e.lineTo(R, C + A - O),
- e.quadraticCurveTo(R, C + A, R + O, C + A),
- e.lineTo(R + P - O, C + A),
- e.quadraticCurveTo(R + P, C + A, R + P, C + A - O),
- e.lineTo(R + P, C + O),
- e.quadraticCurveTo(R + P, C, R + P - O, C),
- e.lineTo(R + O, C),
- e.quadraticCurveTo(R, C, R, C + O),
- e.closePath();
- }
- }
- }),
- (t.prototype.popMask = function (t) {
- t.context.restore(), t.invalidateBlendMode();
- }),
- (t.prototype.destroy = function () {}),
- t
- );
- })();
- function tU(t) {
- var e = vA.ADAPTER.createCanvas(6, 1),
- r = e.getContext('2d');
- return (r.fillStyle = t), r.fillRect(0, 0, 6, 1), e;
- }
- function eU() {
- if ('undefined' == typeof document) return !1;
- var t = tU('#ff00ff'),
- e = tU('#ffff00'),
- r = vA.ADAPTER.createCanvas(6, 1).getContext('2d');
- (r.globalCompositeOperation = 'multiply'),
- r.drawImage(t, 0, 0),
- r.drawImage(e, 2, 0);
- var n = r.getImageData(2, 0, 1, 1);
- if (!n) return !1;
- var i = n.data;
- return 255 === i[0] && 0 === i[1] && 0 === i[2];
- }
- var rU = new CD(),
- nU = (function (t) {
- function e(r) {
- var n,
- i = t.call(this, PP.CANVAS, r) || this;
- if (
- ((i.refresh = !0),
- (i.maskManager = new $G(i)),
- (i.smoothProperty = 'imageSmoothingEnabled'),
- (i.blendModes =
- (void 0 === n && (n = []),
- eU()
- ? ((n[OP.NORMAL] = 'source-over'),
- (n[OP.ADD] = 'lighter'),
- (n[OP.MULTIPLY] = 'multiply'),
- (n[OP.SCREEN] = 'screen'),
- (n[OP.OVERLAY] = 'overlay'),
- (n[OP.DARKEN] = 'darken'),
- (n[OP.LIGHTEN] = 'lighten'),
- (n[OP.COLOR_DODGE] = 'color-dodge'),
- (n[OP.COLOR_BURN] = 'color-burn'),
- (n[OP.HARD_LIGHT] = 'hard-light'),
- (n[OP.SOFT_LIGHT] = 'soft-light'),
- (n[OP.DIFFERENCE] = 'difference'),
- (n[OP.EXCLUSION] = 'exclusion'),
- (n[OP.HUE] = 'hue'),
- (n[OP.SATURATION] = 'saturation'),
- (n[OP.COLOR] = 'color'),
- (n[OP.LUMINOSITY] = 'luminosity'))
- : ((n[OP.NORMAL] = 'source-over'),
- (n[OP.ADD] = 'lighter'),
- (n[OP.MULTIPLY] = 'source-over'),
- (n[OP.SCREEN] = 'source-over'),
- (n[OP.OVERLAY] = 'source-over'),
- (n[OP.DARKEN] = 'source-over'),
- (n[OP.LIGHTEN] = 'source-over'),
- (n[OP.COLOR_DODGE] = 'source-over'),
- (n[OP.COLOR_BURN] = 'source-over'),
- (n[OP.HARD_LIGHT] = 'source-over'),
- (n[OP.SOFT_LIGHT] = 'source-over'),
- (n[OP.DIFFERENCE] = 'source-over'),
- (n[OP.EXCLUSION] = 'source-over'),
- (n[OP.HUE] = 'source-over'),
- (n[OP.SATURATION] = 'source-over'),
- (n[OP.COLOR] = 'source-over'),
- (n[OP.LUMINOSITY] = 'source-over')),
- (n[OP.NORMAL_NPM] = n[OP.NORMAL]),
- (n[OP.ADD_NPM] = n[OP.ADD]),
- (n[OP.SCREEN_NPM] = n[OP.SCREEN]),
- (n[OP.SRC_IN] = 'source-in'),
- (n[OP.SRC_OUT] = 'source-out'),
- (n[OP.SRC_ATOP] = 'source-atop'),
- (n[OP.DST_OVER] = 'destination-over'),
- (n[OP.DST_IN] = 'destination-in'),
- (n[OP.DST_OUT] = 'destination-out'),
- (n[OP.DST_ATOP] = 'destination-atop'),
- (n[OP.XOR] = 'xor'),
- (n[OP.SUBTRACT] = 'source-over'),
- n)),
- (i.renderingToScreen = !1),
- (i._activeBlendMode = null),
- (i._projTransform = null),
- (i._outerBlend = !1),
- (i.rootContext = i.view.getContext('2d', {
- alpha: i.useContextAlpha,
- })),
- (i.context = i.rootContext),
- !i.rootContext.imageSmoothingEnabled)
- ) {
- var o = i.rootContext;
- o.webkitImageSmoothingEnabled
- ? (i.smoothProperty = 'webkitImageSmoothingEnabled')
- : o.mozImageSmoothingEnabled
- ? (i.smoothProperty = 'mozImageSmoothingEnabled')
- : o.oImageSmoothingEnabled
- ? (i.smoothProperty = 'oImageSmoothingEnabled')
- : o.msImageSmoothingEnabled &&
- (i.smoothProperty = 'msImageSmoothingEnabled');
- }
- return (
- i.initPlugins(e.__plugins),
- XM('Canvas'),
- i.resize(i.options.width, i.options.height),
- i
- );
- }
- return (
- (function (t, e) {
- function r() {
- this.constructor = t;
- }
- QG(t, e),
- (t.prototype =
- null === e
- ? Object.create(e)
- : ((r.prototype = e.prototype), new r()));
- })(e, t),
- (e.prototype.addSystem = function () {
- return this;
- }),
- (e.prototype.render = function (t, e) {
- if (this.view) {
- var r, n, i, o;
- e &&
- (e instanceof SL || e instanceof _L
- ? (aD(
- '6.0.0',
- 'CanvasRenderer#render arguments changed, use options instead.'
- ),
- (r = e),
- (n = arguments[2]),
- (i = arguments[3]),
- (o = arguments[4]))
- : ((r = e.renderTexture),
- (n = e.clear),
- (i = e.transform),
- (o = e.skipUpdateTransform))),
- (this.renderingToScreen = !r),
- this.emit('prerender');
- var s = this.resolution;
- r
- ? ((r = r.castToBaseTexture())._canvasRenderTarget ||
- ((r._canvasRenderTarget = new dD(
- r.width,
- r.height,
- r.resolution
- )),
- (r.resource = new lL(r._canvasRenderTarget.canvas)),
- (r.valid = !0)),
- (this.context = r._canvasRenderTarget.context),
- (this.resolution = r._canvasRenderTarget.resolution))
- : (this.context = this.rootContext);
- var a = this.context;
- if (
- ((this._projTransform = i || null),
- r || (this._lastObjectRendered = t),
- !o)
- ) {
- var u = t.enableTempParent();
- t.updateTransform(), t.disableTempParent(u);
- }
- if (
- (a.save(),
- a.setTransform(1, 0, 0, 1, 0, 0),
- (a.globalAlpha = 1),
- (this._activeBlendMode = OP.NORMAL),
- (this._outerBlend = !1),
- (a.globalCompositeOperation = this.blendModes[OP.NORMAL]),
- void 0 !== n ? n : this.clearBeforeRender)
- )
- if (this.renderingToScreen)
- a.clearRect(0, 0, this.width, this.height),
- this.backgroundAlpha > 0 &&
- ((a.globalAlpha = this.useContextAlpha
- ? this.backgroundAlpha
- : 1),
- (a.fillStyle = this._backgroundColorString),
- a.fillRect(0, 0, this.width, this.height),
- (a.globalAlpha = 1));
- else {
- r._canvasRenderTarget.clear();
- var c = r.clearColor;
- c[3] > 0 &&
- ((a.globalAlpha = this.useContextAlpha ? c[3] : 1),
- (a.fillStyle = WM(zM(c))),
- a.fillRect(0, 0, r.realWidth, r.realHeight),
- (a.globalAlpha = 1));
- }
- var h = this.context;
- (this.context = a),
- t.renderCanvas(this),
- (this.context = h),
- a.restore(),
- (this.resolution = s),
- (this._projTransform = null),
- this.emit('postrender');
- }
- }),
- (e.prototype.setContextTransform = function (t, e, r) {
- var n = t,
- i = this._projTransform,
- o = this.resolution;
- (r = r || o),
- i && ((n = rU).copyFrom(t), n.prepend(i)),
- e
- ? this.context.setTransform(
- n.a * r,
- n.b * r,
- n.c * r,
- n.d * r,
- (n.tx * o) | 0,
- (n.ty * o) | 0
- )
- : this.context.setTransform(
- n.a * r,
- n.b * r,
- n.c * r,
- n.d * r,
- n.tx * o,
- n.ty * o
- );
- }),
- (e.prototype.clear = function (t, e) {
- void 0 === t && (t = this._backgroundColorString),
- void 0 === e && (e = this.backgroundAlpha);
- var r = this.context;
- r.clearRect(0, 0, this.width, this.height),
- t &&
- ((r.globalAlpha = this.useContextAlpha ? e : 1),
- (r.fillStyle = t),
- r.fillRect(0, 0, this.width, this.height),
- (r.globalAlpha = 1));
- }),
- (e.prototype.setBlendMode = function (t, e) {
- var r =
- t === OP.SRC_IN ||
- t === OP.SRC_OUT ||
- t === OP.DST_IN ||
- t === OP.DST_ATOP;
- !e && r && (t = OP.NORMAL),
- this._activeBlendMode !== t &&
- ((this._activeBlendMode = t),
- (this._outerBlend = r),
- (this.context.globalCompositeOperation = this.blendModes[t]));
- }),
- (e.prototype.destroy = function (e) {
- t.prototype.destroy.call(this, e),
- (this.context = null),
- (this.refresh = !0),
- this.maskManager.destroy(),
- (this.maskManager = null),
- (this.smoothProperty = null);
- }),
- (e.prototype.resize = function (e, r) {
- t.prototype.resize.call(this, e, r),
- this.smoothProperty &&
- (this.rootContext[this.smoothProperty] =
- vA.SCALE_MODE === NP.LINEAR);
- }),
- (e.prototype.invalidateBlendMode = function () {
- this._activeBlendMode = this.blendModes.indexOf(
- this.context.globalCompositeOperation
- );
- }),
- (e.registerPlugin = function (t, e) {
- aD(
- '6.5.0',
- 'CanvasRenderer.registerPlugin() has been deprecated, please use extensions.add() instead.'
- ),
- ZD.add({ name: t, type: HD.CanvasRendererPlugin, ref: e });
- }),
- (e.__plugins = {}),
- e
- );
- })(qF);
- ZD.handleByMap(HD.CanvasRendererPlugin, nU.__plugins);
- var iU = {
- canvas: null,
- getTintedCanvas: function (t, e) {
- var r = t.texture,
- n =
- '#' + ('00000' + (0 | (e = iU.roundColor(e))).toString(16)).slice(-6);
- r.tintCache = r.tintCache || {};
- var i,
- o = r.tintCache[n];
- if (o) {
- if (o.tintId === r._updateID) return r.tintCache[n];
- i = r.tintCache[n];
- } else i = vA.ADAPTER.createCanvas();
- return (
- iU.tintMethod(r, e, i),
- (i.tintId = r._updateID),
- (r.tintCache[n] = i),
- i
- );
- },
- getTintedPattern: function (t, e) {
- var r =
- '#' + ('00000' + (0 | (e = iU.roundColor(e))).toString(16)).slice(-6);
- t.patternCache = t.patternCache || {};
- var n = t.patternCache[r];
- return (
- (n && n.tintId === t._updateID) ||
- (iU.canvas || (iU.canvas = vA.ADAPTER.createCanvas()),
- iU.tintMethod(t, e, iU.canvas),
- ((n = iU.canvas
- .getContext('2d')
- .createPattern(iU.canvas, 'repeat')).tintId = t._updateID),
- (t.patternCache[r] = n)),
- n
- );
- },
- tintWithMultiply: function (t, e, r) {
- var n = r.getContext('2d'),
- i = t._frame.clone(),
- o = t.baseTexture.resolution;
- (i.x *= o),
- (i.y *= o),
- (i.width *= o),
- (i.height *= o),
- (r.width = Math.ceil(i.width)),
- (r.height = Math.ceil(i.height)),
- n.save(),
- (n.fillStyle = '#' + ('00000' + (0 | e).toString(16)).slice(-6)),
- n.fillRect(0, 0, i.width, i.height),
- (n.globalCompositeOperation = 'multiply');
- var s = t.baseTexture.getDrawableSource();
- n.drawImage(s, i.x, i.y, i.width, i.height, 0, 0, i.width, i.height),
- (n.globalCompositeOperation = 'destination-atop'),
- n.drawImage(s, i.x, i.y, i.width, i.height, 0, 0, i.width, i.height),
- n.restore();
- },
- tintWithOverlay: function (t, e, r) {
- var n = r.getContext('2d'),
- i = t._frame.clone(),
- o = t.baseTexture.resolution;
- (i.x *= o),
- (i.y *= o),
- (i.width *= o),
- (i.height *= o),
- (r.width = Math.ceil(i.width)),
- (r.height = Math.ceil(i.height)),
- n.save(),
- (n.globalCompositeOperation = 'copy'),
- (n.fillStyle = '#' + ('00000' + (0 | e).toString(16)).slice(-6)),
- n.fillRect(0, 0, i.width, i.height),
- (n.globalCompositeOperation = 'destination-atop'),
- n.drawImage(
- t.baseTexture.getDrawableSource(),
- i.x,
- i.y,
- i.width,
- i.height,
- 0,
- 0,
- i.width,
- i.height
- ),
- n.restore();
- },
- tintWithPerPixel: function (t, e, r) {
- var n = r.getContext('2d'),
- i = t._frame.clone(),
- o = t.baseTexture.resolution;
- (i.x *= o),
- (i.y *= o),
- (i.width *= o),
- (i.height *= o),
- (r.width = Math.ceil(i.width)),
- (r.height = Math.ceil(i.height)),
- n.save(),
- (n.globalCompositeOperation = 'copy'),
- n.drawImage(
- t.baseTexture.getDrawableSource(),
- i.x,
- i.y,
- i.width,
- i.height,
- 0,
- 0,
- i.width,
- i.height
- ),
- n.restore();
- for (
- var s = HM(e),
- a = s[0],
- u = s[1],
- c = s[2],
- h = n.getImageData(0, 0, i.width, i.height),
- l = h.data,
- d = 0;
- d < l.length;
- d += 4
- )
- (l[d + 0] *= a), (l[d + 1] *= u), (l[d + 2] *= c);
- n.putImageData(h, 0, 0);
- },
- roundColor: function (t) {
- var e = iU.cacheStepsPerColorChannel,
- r = HM(t);
- return (
- (r[0] = Math.min(255, (r[0] / e) * e)),
- (r[1] = Math.min(255, (r[1] / e) * e)),
- (r[2] = Math.min(255, (r[2] / e) * e)),
- zM(r)
- );
- },
- cacheStepsPerColorChannel: 8,
- convertTintToImage: !1,
- canUseMultiply: eU(),
- tintMethod: null,
- };
- iU.tintMethod = iU.canUseMultiply ? iU.tintWithMultiply : iU.tintWithPerPixel;
- var oU = tN.create;
- (tN.create = function (t) {
- if (!(t && t.forceCanvas))
- try {
- return oU(t);
- } catch (t) {}
- return new nU(t);
- }),
- (aL.prototype.getDrawableSource = function () {
- var t = this.resource;
- return t ? t.bitmap || t.source : null;
- }),
- (_L.prototype._canvasRenderTarget = null),
- (EL.prototype.patternCache = null),
- (EL.prototype.tintCache = null);
- var sU = (function () {
- function t(t) {
- this.renderer = t;
- }
- return (
- (t.prototype.render = function (t) {
- var e = this.renderer,
- r = t.worldTransform;
- (e.context.globalAlpha = t.worldAlpha),
- e.setBlendMode(t.blendMode),
- e.setContextTransform(r, t.roundPixels),
- t.drawMode !== IP.TRIANGLES
- ? this._renderTriangleMesh(t)
- : this._renderTriangles(t);
- }),
- (t.prototype._renderTriangleMesh = function (t) {
- for (var e = t.geometry.buffers[0].data.length, r = 0; r < e - 2; r++) {
- var n = 2 * r;
- this._renderDrawTriangle(t, n, n + 2, n + 4);
- }
- }),
- (t.prototype._renderTriangles = function (t) {
- for (
- var e = t.geometry.getIndex().data, r = e.length, n = 0;
- n < r;
- n += 3
- ) {
- var i = 2 * e[n],
- o = 2 * e[n + 1],
- s = 2 * e[n + 2];
- this._renderDrawTriangle(t, i, o, s);
- }
- }),
- (t.prototype._renderDrawTriangle = function (t, e, r, n) {
- var i = this.renderer.context,
- o = t.geometry.buffers[0].data,
- s = t.uvs,
- a = t.texture;
- if (a.valid) {
- var u = 16777215 !== t.tint,
- c = a.baseTexture,
- h = c.width,
- l = c.height;
- u &&
- t._cachedTint !== t.tint &&
- ((t._cachedTint = t.tint),
- (t._cachedTexture = t._cachedTexture || new EL(c)),
- (t._tintedCanvas = iU.getTintedCanvas(
- { texture: t._cachedTexture },
- t.tint
- )));
- var d = u ? t._tintedCanvas : c.getDrawableSource(),
- f = s[e] * c.width,
- p = s[r] * c.width,
- v = s[n] * c.width,
- m = s[e + 1] * c.height,
- y = s[r + 1] * c.height,
- g = s[n + 1] * c.height,
- _ = o[e],
- b = o[r],
- T = o[n],
- x = o[e + 1],
- E = o[r + 1],
- S = o[n + 1],
- w = t.canvasPadding / this.renderer.resolution;
- if (w > 0) {
- var R = t.worldTransform,
- C = R.a,
- P = R.b,
- A = R.c,
- O = R.d,
- I = (_ + b + T) / 3,
- M = (x + E + S) / 3,
- D = _ - I,
- L = x - M,
- F = C * D + A * L,
- N = P * D + O * L,
- k = Math.sqrt(F * F + N * N),
- B = 1 + w / k;
- (_ = I + D * B),
- (x = M + L * B),
- (F = C * (D = b - I) + A * (L = E - M)),
- (N = P * D + O * L),
- (b = I + D * (B = 1 + w / (k = Math.sqrt(F * F + N * N)))),
- (E = M + L * B),
- (F = C * (D = T - I) + A * (L = S - M)),
- (N = P * D + O * L),
- (T = I + D * (B = 1 + w / (k = Math.sqrt(F * F + N * N)))),
- (S = M + L * B);
- }
- i.save(),
- i.beginPath(),
- i.moveTo(_, x),
- i.lineTo(b, E),
- i.lineTo(T, S),
- i.closePath(),
- i.clip();
- var G = f * y + m * v + p * g - y * v - m * p - f * g,
- U = _ * y + m * T + b * g - y * T - m * b - _ * g,
- j = f * b + _ * v + p * T - b * v - _ * p - f * T,
- X =
- f * y * T +
- m * b * v +
- _ * p * g -
- _ * y * v -
- m * p * T -
- f * b * g,
- V = x * y + m * S + E * g - y * S - m * E - x * g,
- H = f * E + x * v + p * S - E * v - x * p - f * S,
- W =
- f * y * S +
- m * E * v +
- x * p * g -
- x * y * v -
- m * p * S -
- f * E * g;
- i.transform(U / G, V / G, j / G, H / G, X / G, W / G),
- i.drawImage(
- d,
- 0,
- 0,
- h * c.resolution,
- l * c.resolution,
- 0,
- 0,
- h,
- l
- ),
- i.restore(),
- this.renderer.invalidateBlendMode();
- }
- }),
- (t.prototype.renderMeshFlat = function (t) {
- var e = this.renderer.context,
- r = t.geometry.getBuffer('aVertexPosition').data,
- n = r.length / 2;
- e.beginPath();
- for (var i = 1; i < n - 2; ++i) {
- var o = 2 * i,
- s = r[o],
- a = r[o + 1],
- u = r[o + 2],
- c = r[o + 3],
- h = r[o + 4],
- l = r[o + 5];
- e.moveTo(s, a), e.lineTo(u, c), e.lineTo(h, l);
- }
- (e.fillStyle = '#FF0000'), e.fill(), e.closePath();
- }),
- (t.prototype.destroy = function () {
- this.renderer = null;
- }),
- (t.extension = { name: 'mesh', type: HD.CanvasRendererPlugin }),
- t
- );
- })();
- (vA.MESH_CANVAS_PADDING = 0),
- (lG.prototype._renderCanvas = function (t, e) {
- t.plugins.mesh.render(e);
- }),
- (KG.prototype._cachedTint = 16777215),
- (KG.prototype._tintedCanvas = null),
- (KG.prototype._canvasUvs = null),
- (KG.prototype._renderCanvas = function (t) {
- var e = t.context,
- r = this.worldTransform,
- n = 16777215 !== this.tint,
- i = this.texture;
- if (i.valid) {
- n &&
- this._cachedTint !== this.tint &&
- ((this._cachedTint = this.tint),
- (this._tintedCanvas = iU.getTintedCanvas(this, this.tint)));
- var o = n ? this._tintedCanvas : i.baseTexture.getDrawableSource();
- this._canvasUvs || (this._canvasUvs = [0, 0, 0, 0, 0, 0, 0, 0]);
- var s = this.vertices,
- a = this._canvasUvs,
- u = n ? 0 : i.frame.x,
- c = n ? 0 : i.frame.y,
- h = u + i.frame.width,
- l = c + i.frame.height;
- (a[0] = u),
- (a[1] = u + this._leftWidth),
- (a[2] = h - this._rightWidth),
- (a[3] = h),
- (a[4] = c),
- (a[5] = c + this._topHeight),
- (a[6] = l - this._bottomHeight),
- (a[7] = l);
- for (var d = 0; d < 8; d++) a[d] *= i.baseTexture.resolution;
- (e.globalAlpha = this.worldAlpha),
- t.setBlendMode(this.blendMode),
- t.setContextTransform(r, this.roundPixels);
- for (var f = 0; f < 3; f++)
- for (var p = 0; p < 3; p++) {
- var v = 2 * p + 8 * f,
- m = Math.max(1, a[p + 1] - a[p]),
- y = Math.max(1, a[f + 5] - a[f + 4]),
- g = Math.max(1, s[v + 10] - s[v]),
- _ = Math.max(1, s[v + 11] - s[v + 1]);
- e.drawImage(o, a[p], a[f + 4], m, y, s[v], s[v + 1], g, _);
- }
- }
- });
- var aU = !1;
- (hG.prototype._cachedTint = 16777215),
- (hG.prototype._tintedCanvas = null),
- (hG.prototype._cachedTexture = null),
- (hG.prototype._renderCanvas = function (t) {
- this.shader.uvMatrix &&
- (this.shader.uvMatrix.update(), this.calculateUvs()),
- this.material._renderCanvas
- ? this.material._renderCanvas(t, this)
- : aU ||
- ((aU = !0),
- globalThis.console &&
- console.warn(
- 'Mesh with custom shaders are not supported in CanvasRenderer.'
- ));
- }),
- (hG.prototype._canvasPadding = null),
- Object.defineProperty(hG.prototype, 'canvasPadding', {
- get: function () {
- return null !== this._canvasPadding
- ? this._canvasPadding
- : vA.MESH_CANVAS_PADDING;
- },
- set: function (t) {
- this._canvasPadding = t;
- },
- }),
- (JG.prototype._renderCanvas = function (t) {
- this.autoUpdate && this.geometry.getBuffer('aVertexPosition').update(),
- this.shader.update && this.shader.update(),
- this.calculateUvs(),
- this.material._renderCanvas(t, this);
- }),
- (zG.prototype._renderCanvas = function (t) {
- (this.autoUpdate ||
- this.geometry._width !== this.shader.texture.height) &&
- ((this.geometry._width = this.shader.texture.height),
- this.geometry.update()),
- this.shader.update && this.shader.update(),
- this.calculateUvs(),
- this.material._renderCanvas(t, this);
- });
- var uU,
- cU = (function () {
- function t() {}
- return (
- (t.offsetPolygon = function (e, r) {
- var n = [],
- i = e.length;
- r = t.isPolygonClockwise(e) ? r : -1 * r;
- for (var o = 0; o < i; o += 2) {
- var s = o - 2;
- s < 0 && (s += i);
- var a = (o + 2) % i,
- u = e[o] - e[s],
- c = e[o + 1] - e[s + 1],
- h = Math.sqrt(u * u + c * c);
- (u /= h), (c /= h);
- var l = -(c *= r),
- d = (u *= r),
- f = [e[s] + l, e[s + 1] + d],
- p = [e[o] + l, e[o + 1] + d],
- v = e[a] - e[o],
- m = e[a + 1] - e[o + 1];
- (v /= h = Math.sqrt(v * v + m * m)), (m /= h);
- var y = -(m *= r),
- g = (v *= r),
- _ = [e[o] + y, e[o + 1] + g],
- b = [e[a] + y, e[a + 1] + g],
- T = t.findIntersection(
- f[0],
- f[1],
- p[0],
- p[1],
- _[0],
- _[1],
- b[0],
- b[1]
- );
- T && n.push.apply(n, T);
- }
- return n;
- }),
- (t.findIntersection = function (t, e, r, n, i, o, s, a) {
- var u = (a - o) * (r - t) - (s - i) * (n - e),
- c = (s - i) * (e - o) - (a - o) * (t - i);
- if (0 === u)
- return 0 === c && 0 === (r - t) * (e - o) - (n - e) * (t - i)
- ? [(t + r) / 2, (e + n) / 2]
- : null;
- var h = c / u;
- return [t + h * (r - t), e + h * (n - e)];
- }),
- (t.isPolygonClockwise = function (t) {
- for (var e = 0, r = 0, n = t.length - 2; r < t.length; n = r, r += 2)
- e += (t[r] - t[n]) * (t[r + 1] + t[n + 1]);
- return e > 0;
- }),
- t
- );
- })(),
- hU = (function () {
- function t(t) {
- (this._svgMatrix = null),
- (this._tempMatrix = new CD()),
- (this.renderer = t);
- }
- return (
- (t.prototype._calcCanvasStyle = function (t, e) {
- var r;
- return (
- t.texture && t.texture.baseTexture !== EL.WHITE.baseTexture
- ? t.texture.valid
- ? ((r = iU.getTintedPattern(t.texture, e)),
- this.setPatternTransform(r, t.matrix || CD.IDENTITY))
- : (r = '#808080')
- : (r = '#' + ('00000' + (0 | e).toString(16)).slice(-6)),
- r
- );
- }),
- (t.prototype.render = function (t) {
- var e = this.renderer,
- r = e.context,
- n = t.worldAlpha,
- i = t.transform.worldTransform;
- e.setContextTransform(i), e.setBlendMode(t.blendMode);
- for (
- var o,
- s,
- a = t.geometry.graphicsData,
- u = ((t.tint >> 16) & 255) / 255,
- c = ((t.tint >> 8) & 255) / 255,
- h = (255 & t.tint) / 255,
- l = 0;
- l < a.length;
- l++
- ) {
- var d = a[l],
- f = d.shape,
- p = d.fillStyle,
- v = d.lineStyle,
- m = 0 | d.fillStyle.color,
- y = 0 | d.lineStyle.color;
- if (
- (d.matrix &&
- e.setContextTransform(
- i.copyTo(this._tempMatrix).append(d.matrix)
- ),
- p.visible)
- ) {
- var g =
- (((((m >> 16) & 255) / 255) * u * 255) << 16) +
- (((((m >> 8) & 255) / 255) * c * 255) << 8) +
- ((255 & m) / 255) * h * 255;
- o = this._calcCanvasStyle(p, g);
- }
- if (v.visible) {
- var _ =
- (((((y >> 16) & 255) / 255) * u * 255) << 16) +
- (((((y >> 8) & 255) / 255) * c * 255) << 8) +
- ((255 & y) / 255) * h * 255;
- s = this._calcCanvasStyle(v, _);
- }
- if (
- ((r.lineWidth = v.width),
- (r.lineCap = v.cap),
- (r.lineJoin = v.join),
- (r.miterLimit = v.miterLimit),
- d.type === vD.POLY)
- ) {
- r.beginPath();
- var b = (A = f).points,
- T = d.holes,
- x = void 0,
- E = void 0,
- S = void 0,
- w = void 0,
- R = void 0;
- r.moveTo(b[0], b[1]);
- for (var C = 2; C < b.length; C += 2) r.lineTo(b[C], b[C + 1]);
- if ((A.closeStroke && r.closePath(), T.length > 0)) {
- (R = []), (x = 0), (S = b[0]), (w = b[1]);
- for (C = 2; C + 2 < b.length; C += 2)
- x +=
- (b[C] - S) * (b[C + 3] - w) -
- (b[C + 2] - S) * (b[C + 1] - w);
- for (var P = 0; P < T.length; P++)
- if ((b = T[P].shape.points)) {
- (E = 0), (S = b[0]), (w = b[1]);
- for (C = 2; C + 2 < b.length; C += 2)
- E +=
- (b[C] - S) * (b[C + 3] - w) -
- (b[C + 2] - S) * (b[C + 1] - w);
- if (E * x < 0) {
- r.moveTo(b[0], b[1]);
- for (C = 2; C < b.length; C += 2)
- r.lineTo(b[C], b[C + 1]);
- } else {
- r.moveTo(b[b.length - 2], b[b.length - 1]);
- for (C = b.length - 4; C >= 0; C -= 2)
- r.lineTo(b[C], b[C + 1]);
- }
- T[P].shape.closeStroke && r.closePath(), (R[P] = E * x < 0);
- }
- }
- p.visible &&
- ((r.globalAlpha = p.alpha * n), (r.fillStyle = o), r.fill()),
- v.visible && this.paintPolygonStroke(A, v, s, T, R, n, r);
- } else if (d.type === vD.RECT) {
- var A = f;
- if (
- (p.visible &&
- ((r.globalAlpha = p.alpha * n),
- (r.fillStyle = o),
- r.fillRect(A.x, A.y, A.width, A.height)),
- v.visible)
- ) {
- var O = v.width * (0.5 - (1 - v.alignment)),
- I = A.width + 2 * O,
- M = A.height + 2 * O;
- (r.globalAlpha = v.alpha * n),
- (r.strokeStyle = s),
- r.strokeRect(A.x - O, A.y - O, I, M);
- }
- } else if (d.type === vD.CIRC) {
- A = f;
- if (
- (r.beginPath(),
- r.arc(A.x, A.y, A.radius, 0, 2 * Math.PI),
- r.closePath(),
- p.visible &&
- ((r.globalAlpha = p.alpha * n), (r.fillStyle = o), r.fill()),
- v.visible)
- ) {
- if (0.5 !== v.alignment) {
- O = v.width * (0.5 - (1 - v.alignment));
- r.beginPath(),
- r.arc(A.x, A.y, A.radius + O, 0, 2 * Math.PI),
- r.closePath();
- }
- (r.globalAlpha = v.alpha * n), (r.strokeStyle = s), r.stroke();
- }
- } else if (d.type === vD.ELIP) {
- A = f;
- if (
- ((H = 1 === v.alignment) || this.paintEllipse(A, p, v, o, n, r),
- v.visible)
- ) {
- if (0.5 !== v.alignment) {
- var D = 0.5522848,
- L =
- ((O = v.width * (0.5 - (1 - v.alignment))),
- 2 * (A.width + O)),
- F = 2 * (A.height + O),
- N = A.x - L / 2,
- k = A.y - F / 2,
- B = (L / 2) * D,
- G = (F / 2) * D,
- U = N + L,
- j = k + F,
- X = N + L / 2,
- V = k + F / 2;
- r.beginPath(),
- r.moveTo(N, V),
- r.bezierCurveTo(N, V - G, X - B, k, X, k),
- r.bezierCurveTo(X + B, k, U, V - G, U, V),
- r.bezierCurveTo(U, V + G, X + B, j, X, j),
- r.bezierCurveTo(X - B, j, N, V + G, N, V),
- r.closePath();
- }
- (r.globalAlpha = v.alpha * n), (r.strokeStyle = s), r.stroke();
- }
- H && this.paintEllipse(A, p, v, o, n, r);
- } else if (d.type === vD.RREC) {
- var H;
- A = f;
- if (
- ((H = 1 === v.alignment) ||
- this.paintRoundedRectangle(A, p, v, o, n, r),
- v.visible)
- ) {
- if (0.5 !== v.alignment) {
- (I = A.width),
- (M = A.height),
- (O = v.width * (0.5 - (1 - v.alignment)));
- var W = A.x - O,
- Y = A.y - O,
- z = A.width + 2 * O,
- Z = A.height + 2 * O,
- J =
- O *
- (v.alignment >= 1
- ? Math.min(z / I, Z / M)
- : Math.min(I / z, M / Z)),
- K = A.radius + J,
- q = Math.min(z, Z) / 2;
- (K = K > q ? q : K),
- r.beginPath(),
- r.moveTo(W, Y + K),
- r.lineTo(W, Y + Z - K),
- r.quadraticCurveTo(W, Y + Z, W + K, Y + Z),
- r.lineTo(W + z - K, Y + Z),
- r.quadraticCurveTo(W + z, Y + Z, W + z, Y + Z - K),
- r.lineTo(W + z, Y + K),
- r.quadraticCurveTo(W + z, Y, W + z - K, Y),
- r.lineTo(W + K, Y),
- r.quadraticCurveTo(W, Y, W, Y + K),
- r.closePath();
- }
- (r.globalAlpha = v.alpha * n), (r.strokeStyle = s), r.stroke();
- }
- H && this.paintRoundedRectangle(A, p, v, o, n, r);
- }
- }
- }),
- (t.prototype.paintPolygonStroke = function (t, e, r, n, i, o, s) {
- if (0.5 !== e.alignment) {
- var a = e.width * (0.5 - (1 - e.alignment)),
- u = cU.offsetPolygon(t.points, a),
- c = void 0;
- s.beginPath(), s.moveTo(u[0], u[1]);
- for (var h = 2; h < u.length; h += 2) s.lineTo(u[h], u[h + 1]);
- t.closeStroke && s.closePath();
- for (var l = 0; l < n.length; l++) {
- if (
- ((c = n[l].shape.points), (u = cU.offsetPolygon(c, a)), i[l])
- ) {
- s.moveTo(u[0], u[1]);
- for (h = 2; h < u.length; h += 2) s.lineTo(u[h], u[h + 1]);
- } else {
- s.moveTo(u[u.length - 2], u[u.length - 1]);
- for (h = u.length - 4; h >= 0; h -= 2) s.lineTo(u[h], u[h + 1]);
- }
- n[l].shape.closeStroke && s.closePath();
- }
- }
- (s.globalAlpha = e.alpha * o), (s.strokeStyle = r), s.stroke();
- }),
- (t.prototype.paintEllipse = function (t, e, r, n, i, o) {
- var s = 2 * t.width,
- a = 2 * t.height,
- u = t.x - s / 2,
- c = t.y - a / 2,
- h = 0.5522848,
- l = (s / 2) * h,
- d = (a / 2) * h,
- f = u + s,
- p = c + a,
- v = u + s / 2,
- m = c + a / 2;
- 0 === r.alignment && o.save(),
- o.beginPath(),
- o.moveTo(u, m),
- o.bezierCurveTo(u, m - d, v - l, c, v, c),
- o.bezierCurveTo(v + l, c, f, m - d, f, m),
- o.bezierCurveTo(f, m + d, v + l, p, v, p),
- o.bezierCurveTo(v - l, p, u, m + d, u, m),
- o.closePath(),
- 0 === r.alignment && o.clip(),
- e.visible &&
- ((o.globalAlpha = e.alpha * i), (o.fillStyle = n), o.fill()),
- 0 === r.alignment && o.restore();
- }),
- (t.prototype.paintRoundedRectangle = function (t, e, r, n, i, o) {
- var s = t.x,
- a = t.y,
- u = t.width,
- c = t.height,
- h = t.radius,
- l = Math.min(u, c) / 2;
- (h = h > l ? l : h),
- 0 === r.alignment && o.save(),
- o.beginPath(),
- o.moveTo(s, a + h),
- o.lineTo(s, a + c - h),
- o.quadraticCurveTo(s, a + c, s + h, a + c),
- o.lineTo(s + u - h, a + c),
- o.quadraticCurveTo(s + u, a + c, s + u, a + c - h),
- o.lineTo(s + u, a + h),
- o.quadraticCurveTo(s + u, a, s + u - h, a),
- o.lineTo(s + h, a),
- o.quadraticCurveTo(s, a, s, a + h),
- o.closePath(),
- 0 === r.alignment && o.clip(),
- e.visible &&
- ((o.globalAlpha = e.alpha * i), (o.fillStyle = n), o.fill()),
- 0 === r.alignment && o.restore();
- }),
- (t.prototype.setPatternTransform = function (t, e) {
- if (!1 !== this._svgMatrix) {
- if (!this._svgMatrix) {
- var r = document.createElementNS(
- 'http://www.w3.org/2000/svg',
- 'svg'
- );
- if (
- (r &&
- r.createSVGMatrix &&
- (this._svgMatrix = r.createSVGMatrix()),
- !this._svgMatrix || !t.setTransform)
- )
- return void (this._svgMatrix = !1);
- }
- (this._svgMatrix.a = e.a),
- (this._svgMatrix.b = e.b),
- (this._svgMatrix.c = e.c),
- (this._svgMatrix.d = e.d),
- (this._svgMatrix.e = e.tx),
- (this._svgMatrix.f = e.ty),
- t.setTransform(this._svgMatrix.inverse());
- }
- }),
- (t.prototype.destroy = function () {
- (this.renderer = null),
- (this._svgMatrix = null),
- (this._tempMatrix = null);
- }),
- (t.extension = { name: 'graphics', type: HD.CanvasRendererPlugin }),
- t
- );
- })(),
- lU = new CD();
- (_B.prototype.generateCanvasTexture = function (t, e) {
- void 0 === e && (e = 1);
- var r = this.getLocalBounds(),
- n = SL.create({
- width: r.width,
- height: r.height,
- scaleMode: t,
- resolution: e,
- });
- uU || (uU = new nU()),
- this.transform.updateLocalTransform(),
- this.transform.localTransform.copyTo(lU),
- lU.invert(),
- (lU.tx -= r.x),
- (lU.ty -= r.y),
- uU.render(this, { renderTexture: n, clear: !0, transform: lU });
- var i = EL.from(n.baseTexture._canvasRenderTarget.canvas, { scaleMode: t });
- return i.baseTexture.setResolution(e), i;
- }),
- (_B.prototype.cachedGraphicsData = []),
- (_B.prototype._renderCanvas = function (t) {
- !0 !== this.isMask &&
- (this.finishPoly(), t.plugins.graphics.render(this));
- });
- var dU = new CD(),
- fU = (function () {
- function t(t) {
- this.renderer = t;
- }
- return (
- (t.prototype.render = function (t) {
- var e = t._texture,
- r = this.renderer,
- n = r.context;
- if (e.valid) {
- var i = e._frame.width,
- o = e._frame.height,
- s = e._frame.width,
- a = e._frame.height;
- e.trim &&
- (FD.isVertical(e.rotate)
- ? ((s = e.trim.height), (a = e.trim.width))
- : ((s = e.trim.width), (a = e.trim.height)));
- var u = t.transform.worldTransform,
- c = 0,
- h = 0,
- l = e.baseTexture.getDrawableSource();
- if (!(e.orig.width <= 0 || e.orig.height <= 0) && e.valid && l) {
- r.setBlendMode(t.blendMode, !0),
- (r.context.globalAlpha = t.worldAlpha);
- var d = e.baseTexture.scaleMode === NP.LINEAR;
- r.smoothProperty &&
- r.context[r.smoothProperty] !== d &&
- (n[r.smoothProperty] = d),
- e.trim
- ? ((c =
- e.trim.width / 2 + e.trim.x - t.anchor.x * e.orig.width),
- (h =
- e.trim.height / 2 +
- e.trim.y -
- t.anchor.y * e.orig.height))
- : ((c = (0.5 - t.anchor.x) * e.orig.width),
- (h = (0.5 - t.anchor.y) * e.orig.height)),
- e.rotate &&
- (u.copyTo(dU),
- (u = dU),
- FD.matrixAppendRotationInv(u, e.rotate, c, h),
- (c = 0),
- (h = 0)),
- (c -= s / 2),
- (h -= a / 2),
- r.setContextTransform(u, t.roundPixels, 1),
- t.roundPixels && ((c |= 0), (h |= 0));
- var f = e.baseTexture.resolution,
- p = r._outerBlend;
- p &&
- (n.save(),
- n.beginPath(),
- n.rect(
- c * r.resolution,
- h * r.resolution,
- s * r.resolution,
- a * r.resolution
- ),
- n.clip()),
- 16777215 !== t.tint
- ? ((t._cachedTint === t.tint &&
- t._tintedCanvas.tintId === t._texture._updateID) ||
- ((t._cachedTint = t.tint),
- (t._tintedCanvas = iU.getTintedCanvas(t, t.tint))),
- n.drawImage(
- t._tintedCanvas,
- 0,
- 0,
- Math.floor(i * f),
- Math.floor(o * f),
- Math.floor(c * r.resolution),
- Math.floor(h * r.resolution),
- Math.floor(s * r.resolution),
- Math.floor(a * r.resolution)
- ))
- : n.drawImage(
- l,
- e._frame.x * f,
- e._frame.y * f,
- Math.floor(i * f),
- Math.floor(o * f),
- Math.floor(c * r.resolution),
- Math.floor(h * r.resolution),
- Math.floor(s * r.resolution),
- Math.floor(a * r.resolution)
- ),
- p && n.restore(),
- r.setBlendMode(OP.NORMAL);
- }
- }
- }),
- (t.prototype.destroy = function () {
- this.renderer = null;
- }),
- (t.extension = { name: 'sprite', type: HD.CanvasRendererPlugin }),
- t
- );
- })();
- (SB.prototype._tintedCanvas = null),
- (SB.prototype._renderCanvas = function (t) {
- t.plugins.sprite.render(this);
- });
- var pU = new TD(),
- vU = (function () {
- function t(t) {
- this.renderer = t;
- }
- return (
- (t.prototype.image = function (t, e, r) {
- var n = new Image();
- return (n.src = this.base64(t, e, r)), n;
- }),
- (t.prototype.base64 = function (t, e, r) {
- return this.canvas(t).toDataURL(e, r);
- }),
- (t.prototype.canvas = function (t, e) {
- var r,
- n,
- i,
- o = this.renderer;
- t && (i = t instanceof SL ? t : o.generateTexture(t)),
- i
- ? ((r = i.baseTexture._canvasRenderTarget.context),
- (n = i.baseTexture._canvasRenderTarget.resolution),
- (e = null != e ? e : i.frame))
- : ((r = o.rootContext),
- (n = o.resolution),
- e || (((e = pU).width = o.width), (e.height = o.height)));
- var s = Math.round(e.x * n),
- a = Math.round(e.y * n),
- u = Math.round(e.width * n),
- c = Math.round(e.height * n),
- h = new dD(u, c, 1),
- l = r.getImageData(s, a, u, c);
- return h.context.putImageData(l, 0, 0), h.canvas;
- }),
- (t.prototype.pixels = function (t, e) {
- var r,
- n,
- i,
- o = this.renderer;
- t && (i = t instanceof SL ? t : o.generateTexture(t)),
- i
- ? ((r = i.baseTexture._canvasRenderTarget.context),
- (n = i.baseTexture._canvasRenderTarget.resolution),
- (e = null != e ? e : i.frame))
- : ((r = o.rootContext),
- (n = o.resolution),
- e || (((e = pU).width = o.width), (e.height = o.height)));
- var s = Math.round(e.x * n),
- a = Math.round(e.y * n),
- u = Math.round(e.width * n),
- c = Math.round(e.height * n);
- return r.getImageData(s, a, u, c).data;
- }),
- (t.prototype.destroy = function () {
- this.renderer = null;
- }),
- (t.extension = { name: 'extract', type: HD.CanvasRendererPlugin }),
- t
- );
- })(),
- mU = function (t, e) {
- return (
- (mU =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e) e.hasOwnProperty(r) && (t[r] = e[r]);
- }),
- mU(t, e)
- );
- };
- function yU(t, e) {
- var r = t;
- if (e instanceof aL) {
- var n = e.source,
- i = 0 === n.width ? r.canvas.width : Math.min(r.canvas.width, n.width),
- o =
- 0 === n.height
- ? r.canvas.height
- : Math.min(r.canvas.height, n.height);
- return (
- r.ctx.drawImage(n, 0, 0, i, o, 0, 0, r.canvas.width, r.canvas.height),
- !0
- );
- }
- return !1;
- }
- var gU = (function (t) {
- function e(e) {
- var r = t.call(this, e) || this;
- return (
- (r.uploadHookHelper = r),
- (r.canvas = vA.ADAPTER.createCanvas(16, 16)),
- (r.ctx = r.canvas.getContext('2d')),
- r.registerUploadHook(yU),
- r
- );
- }
- return (
- (function (t, e) {
- function r() {
- this.constructor = t;
- }
- mU(t, e),
- (t.prototype =
- null === e
- ? Object.create(e)
- : ((r.prototype = e.prototype), new r()));
- })(e, t),
- (e.prototype.destroy = function () {
- t.prototype.destroy.call(this),
- (this.ctx = null),
- (this.canvas = null);
- }),
- (e.extension = { name: 'prepare', type: HD.CanvasRendererPlugin }),
- e
- );
- })(WB),
- _U = new CD(),
- bU = new CD(),
- TU = [new _D(), new _D(), new _D(), new _D()];
- (eG.prototype._renderCanvas = function (t) {
- var e = this._texture;
- if (e.baseTexture.valid) {
- var r = t.context,
- n = this.worldTransform,
- i = e.baseTexture,
- o = i.getDrawableSource(),
- s = i.resolution;
- if (
- this._textureID !== this._texture._updateID ||
- this._cachedTint !== this.tint
- ) {
- this._textureID = this._texture._updateID;
- var a = new dD(e._frame.width, e._frame.height, s);
- 16777215 !== this.tint
- ? ((this._tintedCanvas = iU.getTintedCanvas(this, this.tint)),
- a.context.drawImage(this._tintedCanvas, 0, 0))
- : a.context.drawImage(o, -e._frame.x * s, -e._frame.y * s),
- (this._cachedTint = this.tint),
- (this._canvasPattern = a.context.createPattern(a.canvas, 'repeat'));
- }
- (r.globalAlpha = this.worldAlpha),
- t.setBlendMode(this.blendMode),
- this.tileTransform.updateLocalTransform();
- var u = this.tileTransform.localTransform,
- c = this._width,
- h = this._height;
- _U.identity(),
- bU.copyFrom(u),
- this.uvRespectAnchor ||
- bU.translate(-this.anchor.x * c, -this.anchor.y * h),
- bU.scale(this.tileScale.x / s, this.tileScale.y / s),
- _U.prepend(bU),
- _U.prepend(n),
- t.setContextTransform(_U),
- (r.fillStyle = this._canvasPattern);
- var l = this.anchor.x * -c,
- d = this.anchor.y * -h;
- TU[0].set(l, d),
- TU[1].set(l + c, d),
- TU[2].set(l + c, d + h),
- TU[3].set(l, d + h);
- for (var f = 0; f < 4; f++) bU.applyInverse(TU[f], TU[f]);
- r.beginPath(), r.moveTo(TU[0].x, TU[0].y);
- for (f = 1; f < 4; f++) r.lineTo(TU[f].x, TU[f].y);
- r.closePath(), r.fill();
- }
- }),
- (Vk.prototype.renderCanvas = function (t) {
- if (
- this.visible &&
- !(this.worldAlpha <= 0) &&
- this.children.length &&
- this.renderable
- ) {
- var e = t.context,
- r = this.worldTransform,
- n = !0,
- i = 0,
- o = 0,
- s = 0,
- a = 0;
- t.setBlendMode(this.blendMode),
- (e.globalAlpha = this.worldAlpha),
- this.displayObjectUpdateTransform();
- for (var u = 0; u < this.children.length; ++u) {
- var c = this.children[u];
- if (c.visible && c._texture.valid) {
- var h = c._texture.frame;
- if (
- ((e.globalAlpha = this.worldAlpha * c.alpha),
- c.rotation % (2 * Math.PI) == 0)
- )
- n && (t.setContextTransform(r, !1, 1), (n = !1)),
- (i = c.anchor.x * (-h.width * c.scale.x) + c.position.x + 0.5),
- (o = c.anchor.y * (-h.height * c.scale.y) + c.position.y + 0.5),
- (s = h.width * c.scale.x),
- (a = h.height * c.scale.y);
- else {
- n || (n = !0), c.displayObjectUpdateTransform();
- var l = c.worldTransform;
- t.setContextTransform(l, this.roundPixels, 1),
- (i = c.anchor.x * -h.width + 0.5),
- (o = c.anchor.y * -h.height + 0.5),
- (s = h.width),
- (a = h.height);
- }
- var d = c._texture.baseTexture.resolution;
- e.drawImage(
- c._texture.baseTexture.getDrawableSource(),
- h.x * d,
- h.y * d,
- h.width * d,
- h.height * d,
- i * t.resolution,
- o * t.resolution,
- s * t.resolution,
- a * t.resolution
- );
- }
- }
- }
- }),
- (VD.prototype._renderCanvas = function (t) {}),
- (VD.prototype.renderCanvas = function (t) {
- if (this.visible && !(this.worldAlpha <= 0) && this.renderable) {
- this._mask && t.maskManager.pushMask(this._mask), this._renderCanvas(t);
- for (var e = 0, r = this.children.length; e < r; ++e)
- this.children[e].renderCanvas(t);
- this._mask && t.maskManager.popMask(t);
- }
- }),
- (UD.prototype.renderCanvas = function (t) {}),
- (FB.prototype._renderCanvas = function (t) {
- this._autoResolution &&
- this._resolution !== t.resolution &&
- ((this._resolution = t.resolution), (this.dirty = !0)),
- this.updateText(!0),
- SB.prototype._renderCanvas.call(this, t);
- }),
- ZD.add(vU, hU, sU, gU, fU);
- var xU = function (t, e) {
- return (
- (xU =
- Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array &&
- function (t, e) {
- t.__proto__ = e;
- }) ||
- function (t, e) {
- for (var r in e)
- Object.prototype.hasOwnProperty.call(e, r) && (t[r] = e[r]);
- }),
- xU(t, e)
- );
- };
- var EU = (function (t) {
- function e(e) {
- var r =
- t.call(
- this,
- 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}',
- 'varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform float gamma;\nuniform float contrast;\nuniform float saturation;\nuniform float brightness;\nuniform float red;\nuniform float green;\nuniform float blue;\nuniform float alpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (c.a > 0.0) {\n c.rgb /= c.a;\n\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n\n c.rgb *= c.a;\n }\n\n gl_FragColor = c * alpha;\n}\n'
- ) || this;
- return (
- (r.gamma = 1),
- (r.saturation = 1),
- (r.contrast = 1),
- (r.brightness = 1),
- (r.red = 1),
- (r.green = 1),
- (r.blue = 1),
- (r.alpha = 1),
- Object.assign(r, e),
- r
- );
- }
- return (
- (function (t, e) {
- function r() {
- this.constructor = t;
- }
- xU(t, e),
- (t.prototype =
- null === e
- ? Object.create(e)
- : ((r.prototype = e.prototype), new r()));
- })(e, t),
- (e.prototype.apply = function (t, e, r, n) {
- (this.uniforms.gamma = Math.max(this.gamma, 1e-4)),
- (this.uniforms.saturation = this.saturation),
- (this.uniforms.contrast = this.contrast),
- (this.uniforms.brightness = this.brightness),
- (this.uniforms.red = this.red),
- (this.uniforms.green = this.green),
- (this.uniforms.blue = this.blue),
- (this.uniforms.alpha = this.alpha),
- t.applyFilter(this, e, r, n);
- }),
- e
- );
- })(EF),
- SU = Yf('process:video'),
- wU = (function () {
- function t(t) {
- var e, r;
- (this.frameRate = null),
- (this.resolution = null),
- (this.backgroundColor = null),
- (this.streamList = []),
- (this.textList = []),
- (this.isStart = !1),
- (this.output = null),
- (this.worker = null),
- (this.renderer = null),
- (this.stage = null),
- (this.ticker = qD.shared),
- (this.isPaused = !1);
- var n = t.frameRate,
- i = t.resolution,
- o = t.backgroundColor;
- (this.frameRate = n),
- (this.resolution = i),
- (this.backgroundColor = o),
- (this.worker = LC()),
- (this.renderer = eN({
- width: i.width,
- height: i.height,
- backgroundColor: o,
- antialias: !0,
- resolution: 1,
- forceCanvas: $x,
- })),
- (this.stage = new VD()),
- (this.stage.sortableChildren = !0),
- (this.ticker.autoStart = !1),
- this.ticker.stop(),
- (this.draw = lh((e = this.draw)).call(e, this)),
- (this.setStreamParams = lh((r = this.setStreamParams)).call(r, this));
- }
- return (
- (t.prototype.setResolution = function (t) {
- var e;
- (this.resolution = t),
- null === (e = this.renderer) ||
- void 0 === e ||
- e.resize(t.width, t.height);
- }),
- (t.prototype.setBackgroundColor = function (t) {
- (this.backgroundColor = t),
- this.renderer && (this.renderer.backgroundColor = t);
- }),
- (t.prototype.addStream = function (t) {
- var e,
- r = this,
- n = t.source,
- i = t.order,
- o = null,
- s = null;
- if (n instanceof MediaStream) {
- var a,
- u = El((a = this.streamList)).call(a, function (t) {
- return t.source === n;
- });
- u
- ? (o = u.element)
- : (((o = gy()).onpause = function () {
- SU('video is paused, try to resume'),
- cd(function () {
- var t;
- null === (t = null == o ? void 0 : o.play) ||
- void 0 === t ||
- t.call(o);
- }, 50);
- }),
- (o.muted = !0),
- (o.srcObject = n),
- o.load());
- } else o = n;
- var c = El((e = this.streamList)).call(e, function (t) {
- return t.element === o;
- });
- s = c ? c.texture : EL.from(o);
- var h = new SB(s),
- l = _y(o),
- d = l.width,
- f = l.height;
- if (0 === d || 0 === f) {
- var p = o instanceof HTMLVideoElement ? 'loadedmetadata' : 'load';
- o.addEventListener(
- p,
- function e() {
- o.removeEventListener(p, e, !1), r.setStreamParams(h, o, t);
- },
- !1
- );
- } else this.setStreamParams(h, o, t);
- (h.zIndex = i),
- this.stage.addChild(h),
- this.streamList.push(
- xd(xd({}, t), { element: o, texture: s, sprite: h })
- );
- }),
- (t.prototype.removeStream = function (t) {
- var e,
- r,
- n,
- i = Vh((e = this.streamList)).call(e, function (e) {
- return e.id === t;
- });
- if (-1 !== i) {
- var o,
- s = Rd(pl((r = this.streamList)).call(r, i, 1), 1)[0];
- if (
- (this.stage.removeChild(s.sprite),
- (s.sprite.filters = null),
- s.sprite.destroy(),
- (s.sprite = null),
- !El((n = this.streamList)).call(n, function (t) {
- return t.element === s.element;
- }))
- ) {
- if (s.source instanceof HTMLVideoElement) {
- var a = s.texture.baseTexture.resource,
- u = a.source,
- c = a._onError;
- u && u.removeEventListener('error', c, !0), (a.source = null);
- }
- s.texture.destroy(!0);
- }
- if (((s.texture = null), s.source instanceof MediaStream))
- if (
- !El((o = this.streamList)).call(o, function (t) {
- return t.source === s.source;
- }) &&
- s.element instanceof HTMLVideoElement
- ) {
- var h = s.element;
- (h.onpause = null),
- h.pause(),
- (h.srcObject = null),
- h.load(),
- h.remove();
- }
- s.element = null;
- } else SU('remove failed, stream '.concat(t, ' is not existed'));
- }),
- (t.prototype.addText = function (t) {
- var e = t.x,
- r = t.y,
- n = t.order,
- i = t.content,
- o = t.style,
- s = o.font_alpha,
- a = void 0 === s ? 100 : s,
- u = o.background_color,
- c = o.background_alpha,
- h = void 0 === c ? 100 : c,
- l = new VD();
- l.sortableChildren = !0;
- var d = this.transformTextStyle(o),
- f = new FB(i, d);
- if (((f.alpha = Number(a) / 100), (f.zIndex = 1), l.addChild(f), u)) {
- var p = new _B();
- p.beginFill('number' == typeof u ? u : YM(u), Number(h) / 100),
- p.drawRect(0, 0, l.width, l.height),
- p.endFill(),
- (p.zIndex = 0),
- l.addChild(p);
- }
- (l.pivot.x = l.width / 2),
- (l.pivot.y = l.height / 2),
- (l.x = e),
- (l.y = r),
- (l.zIndex = n),
- this.stage.addChild(l),
- this.textList.push(xd(xd({}, t), { container: l }));
- }),
- (t.prototype.removeText = function (t) {
- var e,
- r,
- n = Vh((e = this.textList)).call(e, function (e) {
- return e.id === t;
- });
- if (-1 !== n) {
- var i = Rd(pl((r = this.textList)).call(r, n, 1), 1)[0];
- this.stage.removeChild(i.container),
- i.container.destroy(!0),
- (i.container = null);
- } else SU('remove failed, text '.concat(t, ' is not existed'));
- }),
- (t.prototype.start = function () {
- var t;
- this.isStart
- ? SU('rendering has started')
- : this.renderer
- ? ((this.isStart = !0),
- (this.isPaused = !1),
- this.draw(),
- (this.output =
- null === (t = this.getRenderView()) || void 0 === t
- ? void 0
- : t.captureStream(this.frameRate)))
- : SU('renderer is not existed');
- }),
- (t.prototype.stop = function () {
- this.isStart
- ? ((this.isStart = !1), (this.isPaused = !1), this.destroy())
- : SU('rendering has stopped');
- }),
- (t.prototype.getOutput = function () {
- return this.output;
- }),
- (t.prototype.getRenderView = function () {
- var t;
- return null === (t = this.renderer) || void 0 === t ? void 0 : t.view;
- }),
- (t.prototype.pause = function () {
- this.isPaused = !0;
- }),
- (t.prototype.resume = function () {
- this.isPaused = !1;
- }),
- (t.prototype.setStreamParams = function (t, e, r) {
- var n = r.x,
- i = r.y,
- o = r.width,
- s = r.height,
- a = r.operations,
- u = _y(e),
- c = u.width,
- h = u.height,
- l = { width: o, height: s };
- 0 !== c &&
- 0 !== h &&
- (l =
- o / s < c / h
- ? { width: o, height: (o * h) / c }
- : { width: (s * c) / h, height: s }),
- t.anchor.set(0.5, 0.5),
- (t.width = l.width),
- (t.height = l.height),
- (t.x = n),
- (t.y = i),
- Ph(a).call(a, function (e) {
- var r,
- n,
- i,
- o = e.type,
- s = e.params,
- a = void 0 === s ? {} : s;
- if (
- ('image_mirror' === o &&
- (a.left_right && (t.scale.x *= -1),
- a.up_down && (t.scale.y *= -1)),
- 'image_filter_normal' === o)
- ) {
- t.filters || (t.filters = []);
- var u = function (t) {
- return 1 + t / 100;
- },
- c = {
- contrast: u(
- null !== (r = a.contrast) && void 0 !== r ? r : 0
- ),
- brightness: u(
- null !== (n = a.brightness) && void 0 !== n ? n : 0
- ),
- saturation: u(
- null !== (i = a.saturation) && void 0 !== i ? i : 0
- ),
- };
- t.filters.push(new EU(c));
- }
- });
- }),
- (t.prototype.transformTextStyle = function (t) {
- var e,
- r = {};
- return (
- Ph((e = Rl(t))).call(e, function (e) {
- var n = zC[e];
- if (n)
- switch (n) {
- case 'fontWeight':
- r[n] = t[e] ? 'bold' : 'normal';
- break;
- case 'fontStyle':
- r[n] = t[e] ? 'italic' : 'normal';
- break;
- case 'dropShadowColor':
- t[e] && ((r.dropShadow = !0), (r[n] = t[e]));
- break;
- case 'dropShadowAlpha':
- r[n] = Number(t[e]) / 100;
- break;
- default:
- r[n] = t[e];
- }
- }),
- new PB(r)
- );
- }),
- (t.prototype.draw = function () {
- this.isStart && this.renderer && this.stage
- ? (this.isPaused ||
- (this.ticker.update(), this.renderer.render(this.stage)),
- this.requestAnimationFrameWrapper(this.draw))
- : SU('render stop');
- }),
- (t.prototype.destroy = function () {
- var t,
- e,
- r,
- n,
- i,
- o,
- s,
- a = this;
- null === (n = this.worker) || void 0 === n || n.terminate(),
- (this.worker = null);
- var u = vd((t = this.streamList)).call(t, function (t) {
- return t.id;
- });
- Ph(u).call(u, function (t) {
- a.removeStream(t);
- }),
- (this.streamList = []);
- var c = vd((e = this.textList)).call(e, function (t) {
- return t.id;
- });
- Ph(c).call(c, function (t) {
- a.removeText(t);
- }),
- (this.textList = []),
- null === (i = this.stage) ||
- void 0 === i ||
- i.destroy({ children: !0, texture: !0, baseTexture: !0 }),
- (this.stage = null),
- null === (o = this.renderer) || void 0 === o || o.destroy(!0),
- (this.renderer = null),
- null === (s = this.output) ||
- void 0 === s ||
- Ph((r = s.getTracks())).call(r, function (t) {
- t.stop();
- }),
- (this.output = null);
- }),
- (t.prototype.setWorkerInterval = function (t, e) {
- var r,
- n,
- i = this;
- null === (r = this.worker) ||
- void 0 === r ||
- r.addEventListener('message', t),
- null === (n = this.worker) ||
- void 0 === n ||
- n.postMessage({ type: 'start', data: { time: e } });
- return function () {
- var e, r;
- null === (e = i.worker) ||
- void 0 === e ||
- e.postMessage({ type: 'stop' }),
- null === (r = i.worker) ||
- void 0 === r ||
- r.removeEventListener('message', t);
- };
- }),
- (t.prototype.requestAnimationFrameWrapper = function (t) {
- var e = !1,
- r = this.setWorkerInterval(function () {
- !e && document.hidden && ((e = !0), r(), t());
- }, 1e3 / this.frameRate);
- requestAnimationFrame(function () {
- e || ((e = !0), r(), t());
- });
- }),
- t
- );
- })(),
- RU = sh('Array').entries,
- CU = rn,
- PU = qt,
- AU = ut,
- OU = RU,
- IU = Array.prototype,
- MU = { DOMTokenList: !0, NodeList: !0 },
- DU = function (t) {
- var e = t.entries;
- return t === IU || (AU(IU, t) && e === IU.entries) || PU(MU, CU(t))
- ? OU
- : e;
- },
- LU = Yf('process:audio'),
- FU = (function () {
- function t() {
- (this.streamList = []),
- (this.isStart = !1),
- (this.output = null),
- (this.audioContext = null),
- (this.audioDestination = null),
- (this.audioConstantSource = null);
- var t = yy(),
- e = t.createGain();
- if (((e.gain.value = 1), t.createConstantSource)) {
- var r = t.createConstantSource();
- r.start();
- var n = t.createGain();
- (n.gain.value = 0),
- r.connect(n),
- n.connect(e),
- (this.audioConstantSource = r);
- }
- (this.audioContext = t), (this.audioDestination = e);
- }
- return (
- (t.prototype.addStream = function (t) {
- var e,
- r,
- n,
- i = this,
- o = t.source,
- s = t.operations,
- a = null,
- u = El((e = this.streamList)).call(e, function (t) {
- return t.source === o;
- });
- u
- ? (a = u.audioSource)
- : o instanceof MediaStream
- ? o.getAudioTracks().length > 0 &&
- (a = this.audioContext.createMediaStreamSource(o))
- : ((a =
- o._audioSource ||
- this.audioContext.createMediaElementSource(o)),
- (o._audioSource = a),
- a.connect(this.audioContext.destination));
- var c = [];
- if (a) {
- Ph(s).call(s, function (t) {
- var e,
- r,
- n,
- o,
- s,
- a,
- u = t.type,
- h = t.params,
- l = void 0 === h ? {} : h;
- if ('audio_volumes' === u) {
- var d = i.audioContext.createGain();
- (d.gain.value =
- (null !== (e = l.all) && void 0 !== e ? e : 100) / 100),
- c.push(d);
- }
- if ('audio_compressor' === u) {
- var f = i.audioContext.createDynamicsCompressor();
- (f.threshold.value =
- null !== (r = l.threshold) && void 0 !== r
- ? r
- : ZC.threshold.value),
- (f.ratio.value =
- null !== (n = l.ratio) && void 0 !== n
- ? n
- : ZC.ratio.value),
- (f.knee.value =
- null !== (o = l.knee) && void 0 !== o ? o : ZC.knee.value),
- (f.attack.value =
- (null !== (s = l.attack) && void 0 !== s
- ? s
- : ZC.attack.value) / 1e3),
- (f.release.value =
- (null !== (a = l.release) && void 0 !== a
- ? a
- : ZC.release.value) / 1e3),
- c.push(f);
- }
- });
- var h = c.length;
- if (h > 0)
- try {
- for (
- var l = wd(DU(c).call(c)), d = l.next();
- !d.done;
- d = l.next()
- ) {
- var f = Rd(d.value, 2),
- p = f[0],
- v = f[1];
- 0 === p && a.connect(v),
- p === h - 1 && v.connect(this.audioDestination),
- p < h - 1 && v.connect(c[p + 1]);
- }
- } catch (t) {
- r = { error: t };
- } finally {
- try {
- d && !d.done && (n = l.return) && n.call(l);
- } finally {
- if (r) throw r.error;
- }
- }
- else a.connect(this.audioDestination);
- }
- this.streamList.push(
- xd(xd({}, t), { audioSource: a, audioNodeList: c })
- );
- }),
- (t.prototype.removeStream = function (t) {
- var e,
- r,
- n,
- i,
- o = Vh((e = this.streamList)).call(e, function (e) {
- return e.id === t;
- });
- if (-1 !== o) {
- var s = Rd(pl((r = this.streamList)).call(r, o, 1), 1)[0];
- if (s.audioSource) {
- var a = s.audioSource,
- u = s.audioNodeList,
- c = u.length;
- if (c > 0)
- try {
- for (
- var h = wd(DU(u).call(u)), l = h.next();
- !l.done;
- l = h.next()
- ) {
- var d = Rd(l.value, 2),
- f = d[0],
- p = d[1];
- 0 === f && a.disconnect(p),
- f === c - 1 && p.disconnect(this.audioDestination),
- f < c - 1 && p.disconnect(u[f + 1]);
- }
- } catch (t) {
- n = { error: t };
- } finally {
- try {
- l && !l.done && (i = h.return) && i.call(h);
- } finally {
- if (n) throw n.error;
- }
- }
- else a.disconnect(this.audioDestination);
- }
- (s.audioSource = null), (s.audioNodeList = null);
- } else LU('remove failed, stream '.concat(t, ' is not existed'));
- }),
- (t.prototype.start = function () {
- if (this.isStart) LU('process has started');
- else if (this.audioContext && this.audioDestination) {
- this.isStart = !0;
- var t = this.audioContext.createMediaStreamDestination();
- this.audioDestination.connect(t), (this.output = t.stream);
- } else LU('audio context is not existed');
- }),
- (t.prototype.stop = function () {
- this.isStart
- ? ((this.isStart = !1), this.destroy())
- : LU('process has stopped');
- }),
- (t.prototype.getOutput = function () {
- return this.output;
- }),
- (t.prototype.destroy = function () {
- var t,
- e,
- r,
- n,
- i,
- o,
- s,
- a = this,
- u = vd((t = this.streamList)).call(t, function (t) {
- return t.id;
- });
- Ph(u).call(u, function (t) {
- a.removeStream(t);
- }),
- (this.streamList = []),
- null === (r = this.audioConstantSource) || void 0 === r || r.stop(),
- null === (n = this.audioConstantSource) ||
- void 0 === n ||
- n.disconnect(),
- (this.audioConstantSource = null),
- null === (i = this.audioDestination) ||
- void 0 === i ||
- i.disconnect(),
- (this.audioDestination = null),
- window.TXLiveAudioContext ||
- (null === (o = this.audioContext) || void 0 === o || o.close(),
- (this.audioContext = null)),
- null === (s = this.output) ||
- void 0 === s ||
- Ph((e = s.getTracks())).call(e, function (t) {
- t.stop();
- }),
- (this.output = null);
- }),
- t
- );
- })(),
- NU = Yf('process'),
- kU = (function () {
- function t(t) {
- void 0 === t && (t = {}),
- (this.frameRate = 15),
- (this.resolution = WC),
- (this.backgroundColor = 0),
- (this.lastData = null),
- (this.curData = null),
- (this.isProcessStart = !1),
- (this.output = null),
- (this.videoProcess = null),
- (this.audioProcess = null);
- var e = t.frameRate,
- r = t.resolution,
- n = t.backgroundColor,
- i = t.data;
- e && this.setFrameRate(e),
- r && this.setResolution(r),
- n && this.setBackgroundColor(n),
- i && this.setData(i);
- }
- return (
- (t.prototype.setFrameRate = function (t) {
- t
- ? 'number' != typeof t || t <= 0
- ? NU('frameRate must be a number greater than 0')
- : (this.frameRate = t)
- : NU('frameRate must be existed');
- }),
- (t.prototype.setResolution = function (t) {
- var e;
- t
- ? 'object' === Wc(t) &&
- 'number' == typeof t.width &&
- 'number' == typeof t.height &&
- ((t.width > 0 && t.height > 0) ||
- (0 === t.width && 0 === t.height))
- ? ((this.resolution = t),
- t.width > 0 &&
- t.height > 0 &&
- (null === (e = this.videoProcess) ||
- void 0 === e ||
- e.setResolution(t)))
- : NU(
- 'resolution width and height must be a number greater than or equal to 0'
- )
- : NU('resolution must be existed');
- }),
- (t.prototype.setBackgroundColor = function (t) {
- var e;
- null != t
- ? 'number' != typeof t || t < 0 || t > 16777215
- ? NU('backgroundColor must be a valid color number')
- : ((this.backgroundColor = t),
- null === (e = this.videoProcess) ||
- void 0 === e ||
- e.setBackgroundColor(t))
- : NU('backgroundColor must be existed');
- }),
- (t.prototype.setData = function (t) {
- var e,
- r,
- n,
- i,
- o,
- s,
- a = this;
- if (HC(t)) {
- try {
- for (var u = wd(t), c = u.next(); !c.done; c = u.next()) {
- var h,
- l = c.value,
- d = l.id,
- f = l.type,
- p = l.order,
- v = l.items;
- if (!d) return void NU('data.id is not existed');
- if (!Jl((h = Rl(YC))).call(h, f))
- return void NU('data.type('.concat(f, ') is invalid'));
- if (void 0 !== p && 'number' != typeof p)
- return void NU('data.order must be a number');
- if (!HC(v)) return void NU('data.items must be an array');
- try {
- for (
- var m = ((n = void 0), wd(v)), y = m.next();
- !y.done;
- y = m.next()
- ) {
- var g,
- _ = y.value,
- b = _.id,
- T = _.type,
- x = _.source,
- E = _.content,
- S = _.operations;
- if (!b) return void NU('data.items.id is not existed');
- if (!Jl((g = YC[f])).call(g, T))
- return void NU(
- 'data.items.type('.concat(T, ') is invalid')
- );
- if ('video' === f) {
- if (
- !(
- 'video' !== T ||
- x instanceof UC ||
- x instanceof MediaStream ||
- x instanceof HTMLVideoElement
- )
- )
- return void NU(
- 'data.items.source('.concat(T, ') is invalid')
- );
- if ('image' === T && !(x instanceof HTMLImageElement))
- return void NU(
- 'data.items.source('.concat(T, ') is invalid')
- );
- } else if ('audio' === f) {
- if (
- !(
- x instanceof UC ||
- x instanceof MediaStream ||
- x instanceof HTMLVideoElement ||
- x instanceof HTMLAudioElement
- )
- )
- return void NU(
- 'data.items.source('.concat(T, ') is invalid')
- );
- } else if ('text' === f) {
- if (!E)
- return void NU('data.items.content is not existed');
- var w = E.text,
- R = E.text_style;
- if (!w)
- return void NU(
- 'data.items.content.text is not existed'
- );
- if ('object' !== Wc(R) || HC(R) || null === R)
- return void NU(
- 'data.items.content.text_style is invalid'
- );
- }
- if (void 0 !== S) {
- if (!HC(S))
- return void NU(
- 'data.items.operations must be an array'
- );
- var C = function (t) {
- var e,
- r,
- n = t.type,
- i = t.params,
- o = void 0 === i ? {} : i;
- if (
- 'audio_volumes' === n &&
- void 0 !== o.all &&
- 'number' != typeof o.all
- )
- return (
- NU('audio_volumes param must be a number'),
- { value: void 0 }
- );
- if (
- 'audio_compressor' === n &&
- Rl(o).length > 0 &&
- !PE((e = Rl(o))).call(e, function (t) {
- var e = ZC[t];
- if (!e)
- return (
- NU(
- 'audio_compressor param '.concat(
- t,
- ' is invalid'
- )
- ),
- !1
- );
- var r,
- n,
- i = o[t];
- return (
- !(
- 'number' != typeof i ||
- i < e.min ||
- i > e.max
- ) ||
- (NU(
- mh(
- (r = mh(
- (n = 'audio_compressor param '.concat(
- t,
- ' must be a number between '
- ))
- ).call(n, e.min, ' and '))
- ).call(r, e.max)
- ),
- !1)
- );
- })
- )
- return { value: void 0 };
- if (
- 'image_filter_normal' === n &&
- Rl(o).length > 0 &&
- !PE((r = Rl(o))).call(r, function (t) {
- var e = o[t];
- return (
- !('number' != typeof e || e < -100 || e > 100) ||
- (NU(
- 'image_filter_normal param '.concat(
- t,
- ' must be a number between -100 and 100'
- )
- ),
- !1)
- );
- })
- )
- return { value: void 0 };
- };
- try {
- for (
- var P = ((o = void 0), wd(S)), A = P.next();
- !A.done;
- A = P.next()
- ) {
- var O = C(A.value);
- if ('object' === Wc(O)) return O.value;
- }
- } catch (t) {
- o = { error: t };
- } finally {
- try {
- A && !A.done && (s = P.return) && s.call(P);
- } finally {
- if (o) throw o.error;
- }
- }
- }
- }
- } catch (t) {
- n = { error: t };
- } finally {
- try {
- y && !y.done && (i = m.return) && i.call(m);
- } finally {
- if (n) throw n.error;
- }
- }
- }
- } catch (t) {
- e = { error: t };
- } finally {
- try {
- c && !c.done && (r = u.return) && r.call(u);
- } finally {
- if (e) throw e.error;
- }
- }
- if (
- ((this.lastData = this.curData),
- (this.curData = zm(t)),
- this.isProcessStart)
- ) {
- var I = Rd(
- ((L = this.curData),
- (F = this.lastData),
- [fy(F, L, py), fy(L, F, py)]),
- 2
- ),
- M = I[0],
- D = I[1];
- this.videoProcess &&
- (this.videoProcess.pause(),
- this.removeVideoData(M),
- this.addVideoData(D),
- cd(function () {
- var t;
- null === (t = a.videoProcess) || void 0 === t || t.resume();
- }, 1500 / this.frameRate)),
- this.removeAudioData(M),
- this.addAudioData(D);
- }
- var L, F;
- } else NU('data must be an array');
- }),
- (t.prototype.start = function () {
- var t = this;
- return new zx(function (e, r) {
- var n;
- if (t.isProcessStart)
- return (
- NU('processing has started'),
- void r(new Error('processing has started'))
- );
- if (!t.curData || 0 === t.curData.length)
- return NU('data is empty'), void r(new Error('data is empty'));
- t.isProcessStart = !0;
- var i = t,
- o = i.frameRate,
- s = i.resolution,
- a = i.backgroundColor;
- s.width > 0 &&
- s.height > 0 &&
- ((t.videoProcess = new wU({
- frameRate: o,
- resolution: s,
- backgroundColor: a,
- })),
- t.addVideoData(t.curData)),
- (t.audioProcess = new FU()),
- t.addAudioData(t.curData),
- null === (n = t.videoProcess) || void 0 === n || n.start(),
- t.audioProcess.start(),
- e();
- });
- }),
- (t.prototype.stop = function () {
- var t, e, r;
- this.isProcessStart
- ? ((this.isProcessStart = !1),
- null === (e = this.videoProcess) || void 0 === e || e.stop(),
- this.audioProcess.stop(),
- (this.lastData = null),
- (this.videoProcess = null),
- (this.audioProcess = null),
- null === (r = this.output) ||
- void 0 === r ||
- Ph((t = r.getTracks())).call(t, function (t) {
- t.stop();
- }),
- (this.output = null))
- : NU('processing has stopped');
- }),
- (t.prototype.isStart = function () {
- return this.isProcessStart;
- }),
- (t.prototype.getOutput = function () {
- var t, e, r, n;
- if (!this.isProcessStart) return null;
- var i = this.output || new MediaStream(),
- o = i.getVideoTracks().length > 0,
- s = i.getAudioTracks().length > 0,
- a =
- null ===
- (e =
- null === (t = this.videoProcess) || void 0 === t
- ? void 0
- : t.getOutput()) || void 0 === e
- ? void 0
- : e.getVideoTracks();
- !o && (null == a ? void 0 : a.length)
- ? i.addTrack(a[0])
- : o &&
- !(null == a ? void 0 : a.length) &&
- i.removeTrack(i.getVideoTracks()[0]);
- var u =
- null ===
- (n =
- null === (r = this.audioProcess) || void 0 === r
- ? void 0
- : r.getOutput()) || void 0 === n
- ? void 0
- : n.getAudioTracks();
- return (
- !s && (null == u ? void 0 : u.length)
- ? i.addTrack(u[0])
- : s &&
- !(null == u ? void 0 : u.length) &&
- i.removeTrack(i.getAudioTracks()[0]),
- (this.output = i),
- i
- );
- }),
- (t.prototype.getRenderView = function () {
- var t;
- return null === (t = this.videoProcess) || void 0 === t
- ? void 0
- : t.getRenderView();
- }),
- (t.prototype.addVideoData = function (t) {
- var e = this;
- if (this.videoProcess) {
- var r = Lh(t).call(t, function (t) {
- return 'video' === t.type || 'text' === t.type;
- });
- Ph(r).call(r, function (t) {
- var r = t.id,
- n = t.order,
- i = void 0 === n ? 0 : n,
- o = t.items;
- Ph(o).call(o, function (t) {
- var n,
- o = t.id,
- s = t.type,
- a = t.source,
- u = t.width,
- c = void 0 === u ? e.resolution.width : u,
- h = t.height,
- l = void 0 === h ? e.resolution.height : h,
- d = t.position,
- f = void 0 === d ? {} : d,
- p = t.content,
- v = void 0 === p ? {} : p,
- m = t.operations,
- y = void 0 === m ? [] : m,
- g = f.x,
- _ = void 0 === g ? 0 : g,
- b = f.y,
- T = void 0 === b ? 0 : b,
- x = v.text,
- E = void 0 === x ? '' : x,
- S = v.text_style,
- w = void 0 === S ? {} : S,
- R = mh((n = ''.concat(r, '-'))).call(n, o);
- if ('video' === s || 'image' === s) {
- if (0 === c || 0 === l) return;
- var C = a instanceof UC ? a.getMediaStream() : a,
- P = a instanceof UC ? a.getRenderElement() : null;
- if (!C) return;
- e.videoProcess.addStream({
- id: R,
- width: c,
- height: l,
- x: _,
- y: T,
- order: i,
- source: null != P ? P : C,
- operations: y,
- });
- } else
- 'text' === s &&
- e.videoProcess.addText({
- id: R,
- x: _,
- y: T,
- order: i,
- operations: y,
- content: E,
- style: w,
- });
- });
- });
- }
- }),
- (t.prototype.removeVideoData = function (t) {
- var e = this;
- if (this.videoProcess) {
- var r = Lh(t).call(t, function (t) {
- return 'video' === t.type || 'text' === t.type;
- });
- Ph(r).call(r, function (t) {
- var r = t.id,
- n = t.items;
- Ph(n).call(n, function (t) {
- var n,
- i = t.id,
- o = t.type,
- s = mh((n = ''.concat(r, '-'))).call(n, i);
- 'video' === o || 'image' === o
- ? e.videoProcess.removeStream(s)
- : 'text' === o && e.videoProcess.removeText(s);
- });
- });
- }
- }),
- (t.prototype.addAudioData = function (t) {
- var e = this,
- r = Lh(t).call(t, function (t) {
- return 'video' === t.type || 'audio' === t.type;
- });
- Ph(r).call(r, function (t) {
- var r = t.id,
- n = t.items;
- Ph(n).call(n, function (t) {
- var n = t.id,
- i = t.type,
- o = t.source,
- s = t.operations,
- a = void 0 === s ? [] : s;
- if ('video' === i || 'audio' === i) {
- var u,
- c = o instanceof UC ? o.getMediaStream() : o;
- if (!c) return;
- e.audioProcess.addStream({
- id: mh((u = ''.concat(r, '-'))).call(u, n),
- source: c,
- operations: a,
- });
- }
- });
- });
- }),
- (t.prototype.removeAudioData = function (t) {
- var e = this,
- r = Lh(t).call(t, function (t) {
- return 'video' === t.type || 'audio' === t.type;
- });
- Ph(r).call(r, function (t) {
- var r = t.id,
- n = t.items;
- Ph(n).call(n, function (t) {
- var n,
- i = t.id,
- o = t.type;
- ('video' !== o && 'audio' !== o) ||
- e.audioProcess.removeStream(
- mh((n = ''.concat(r, '-'))).call(n, i)
- );
- });
- });
- }),
- t
- );
- })();
- Yf.disable();
- var BU = Yf('app'),
- GU = (function () {
- function t() {
- var t, e, r, n;
- (this.videoView = null),
- (this.canvasView = null),
- (this.videoQuality = xd({}, Jf['720p'])),
- (this.audioQuality = xd(xd({}, Kf.standard), {
- echoCancellation: !0,
- noiseSuppression: !0,
- autoGainControl: !0,
- })),
- (this.connectRetry = {
- maxCount: 3,
- curCount: 0,
- delay: 1,
- timeoutId: 0,
- }),
- (this.connection = null),
- (this.isStreamPushing = !1),
- (this.streamList = []),
- (this.streamOutput = null),
- (this.deviceManager = null),
- (this.videoEffectManager = null),
- (this.audioEffectManager = null),
- (this.effectProcess = null),
- (this.effectTrackList = []),
- (this.observer = {
- onError: null,
- onWarning: null,
- onCaptureFirstAudioFrame: null,
- onCaptureFirstVideoFrame: null,
- onPushStatusUpdate: null,
- onStatisticsUpdate: null,
- }),
- (this.advancedSettings = { signalingServer: null, metadata: null }),
- (this.onConnectionStatusUpdate = lh(
- (t = this.onConnectionStatusUpdate)
- ).call(t, this)),
- (this.setProcessData = lh((e = this.setProcessData)).call(e, this)),
- (this.getCommonData = lh((r = this.getCommonData)).call(r, this)),
- (this.onVisibilityChange = lh((n = this.onVisibilityChange)).call(
- n,
- this
- )),
- null === document ||
- void 0 === document ||
- document.addEventListener(
- 'visibilitychange',
- this.onVisibilityChange
- ),
- (this.deviceManager = new XC({ getCommonData: this.getCommonData })),
- (this.videoEffectManager = new $C({
- getCommonData: this.getCommonData,
- })),
- (this.audioEffectManager = new eP({
- getCommonData: this.getCommonData,
- }));
- }
- return (
- (t.checkSupport = function () {
- return Ed(void 0, void 0, void 0, function () {
- var t;
- return Sd(this, function (e) {
- switch (e.label) {
- case 0:
- return (
- (t = {
- isWebRTCSupported: !(
- !window.RTCPeerConnection &&
- !window.webkitRTCPeerConnection
- ),
- }),
- [
- 4,
- new zx(function (t) {
- try {
- var e,
- r = new RTCPeerConnection({ iceServers: [] });
- r.addEventListener('negotiationneeded', function e() {
- r.createOffer().then(function (n) {
- var i,
- o = Jl((i = n.sdp.toLowerCase())).call(
- i,
- 'h264'
- );
- r.removeEventListener('negotiationneeded', e),
- r.close(),
- t(o);
- });
- });
- var n = document.createElement('canvas');
- n.getContext('2d');
- var i = n.captureStream(0);
- Ph((e = i.getTracks())).call(e, function (t) {
- r.addTrack(t, i);
- });
- } catch (e) {
- t(!1);
- }
- }),
- ]
- );
- case 1:
- return (
- (t.isH264EncodeSupported = e.sent()),
- [
- 4,
- Ed(void 0, void 0, void 0, function () {
- var t, e, r, n;
- return Sd(this, function (i) {
- var o;
- switch (i.label) {
- case 0:
- return (
- i.trys.push([0, 2, , 3]),
- (t = new RTCPeerConnection({
- iceServers: [],
- sdpSemantics: 'unified-plan',
- })),
- (e = {}),
- t.addTransceiver
- ? (t.addTransceiver('audio', {
- direction: 'recvonly',
- }),
- t.addTransceiver('video', {
- direction: 'recvonly',
- }))
- : (e = {
- offerToReceiveVideo: !0,
- offerToReceiveAudio: !0,
- }),
- [4, t.createOffer(e)]
- );
- case 1:
- return (
- (r = i.sent()),
- (n = Jl((o = r.sdp.toLowerCase())).call(
- o,
- 'h264'
- )),
- t.close(),
- [2, n]
- );
- case 2:
- return i.sent(), [2, !1];
- case 3:
- return [2];
- }
- });
- }),
- ]
- );
- case 2:
- return [
- 2,
- ((t.isH264DecodeSupported = e.sent()),
- (t.isMediaDevicesSupported = eE()),
- (t.isScreenCaptureSupported = rE()),
- (t.isMediaFileSupported = !(
- !document.createElement('canvas').captureStream ||
- (!window.AudioContext && !window.webkitAudioContext)
- )),
- t),
- ];
- }
- });
- });
- }),
- (t.init = function () {
- var t,
- e = Mf.browserDetails,
- r = e.browser,
- n = e.version;
- BU(mh((t = 'browser is '.concat(r, ', version is '))).call(t, n));
- var i = document.body;
- if (i)
- if (window.TXLiveAudioContext) BU('TXLiveAudioContext is existed');
- else {
- var o = ['touchstart', 'touchend', 'mouseup', 'click'],
- s = function t() {
- Ph(o).call(o, function (e) {
- return i.removeEventListener(e, t, !1);
- });
- var e = new (window.AudioContext ||
- window.webkitAudioContext)();
- my(e), (window.TXLiveAudioContext = e);
- };
- Ph(o).call(o, function (t) {
- return i.addEventListener(t, s, !1);
- });
- }
- else BU('document.body is not existed');
- }),
- (t.prototype.setRenderView = function (t) {
- if (this.videoView) BU('render view is existed');
- else {
- var e = 'string' == typeof t ? document.getElementById(t) : t;
- e && e instanceof HTMLDivElement
- ? (this.videoView = gy({
- parentEl: e,
- style: Zf,
- crossOrigin: !1,
- loop: !1,
- }))
- : BU('require container element id or HTMLDivElement');
- }
- }),
- (t.prototype.setVideoQuality = function (t) {
- Jf[t]
- ? (this.videoQuality = xd(xd({}, this.videoQuality), Jf[t]))
- : BU('video quality '.concat(t, ' is not existed'));
- }),
- (t.prototype.setAudioQuality = function (t) {
- Kf[t]
- ? (this.audioQuality = xd(xd({}, this.audioQuality), Kf[t]))
- : BU('audio quality '.concat(t, ' is not existed'));
- }),
- (t.prototype.setProperty = function (t, e) {
- var r, n;
- switch (t) {
- case 'setVideoResolution':
- 'object' === Wc(e) &&
- 'number' == typeof e.width &&
- 'number' == typeof e.height &&
- e.width > 0 &&
- e.height > 0
- ? ((this.videoQuality.width = e.width),
- (this.videoQuality.height = e.height))
- : BU(
- 'videoResolution width and height must be a number greater than 0'
- );
- break;
- case 'setVideoFPS':
- 'number' == typeof e && e > 0
- ? (this.videoQuality.frameRate = e)
- : BU('videoFPS must be a number greater than 0');
- break;
- case 'setVideoBitrate':
- 'number' == typeof e && e > 0
- ? ((this.videoQuality.bitrate = e),
- null === (r = this.connection) ||
- void 0 === r ||
- r.setVideoBitrate(e))
- : BU('videoBitrate must be a number greater than 0');
- break;
- case 'setAudioSampleRate':
- 'number' == typeof e && e > 0
- ? (this.audioQuality.sampleRate = e)
- : BU('audioSampleRate must be a number greater than 0');
- break;
- case 'setAudioBitrate':
- 'number' == typeof e && e > 0
- ? ((this.audioQuality.bitrate = e),
- null === (n = this.connection) ||
- void 0 === n ||
- n.setAudioBitrate(e))
- : BU('audioBitrate must be a number greater than 0');
- break;
- case 'enableAudioAEC':
- this.audioQuality.echoCancellation = !!e;
- break;
- case 'enableAudioAGC':
- this.audioQuality.autoGainControl = !!e;
- break;
- case 'enableAudioANS':
- this.audioQuality.noiseSuppression = !!e;
- break;
- case 'setConnectRetryCount':
- 'number' == typeof e && e >= 0 && e <= 10
- ? (this.connectRetry.maxCount = e)
- : BU(
- 'connectRetryCount must be a number between 0 and '.concat(
- 10
- )
- );
- break;
- case 'setConnectRetryDelay':
- 'number' == typeof e && e >= 0 && e <= 10
- ? (this.connectRetry.delay = e)
- : BU(
- 'connectRetryDelay must be a number between 0 and '.concat(
- 10
- )
- );
- break;
- case 'setMetadata':
- 'object' === Wc(e)
- ? (this.advancedSettings.metadata = e ? xd({}, e) : null)
- : BU('metadata must be an object');
- break;
- case 'setSignalingServer':
- 'string' == typeof e
- ? (this.advancedSettings.signalingServer = e)
- : BU('signalingServer must be string');
- break;
- case 'enableLog':
- e ? Yf.enable('*') : Yf.disable();
- break;
- default:
- BU(''.concat(t, ' is not existed'));
- }
- }),
- (t.prototype.startCamera = function (t) {
- var e, r, n;
- return Ed(this, void 0, void 0, function () {
- var i,
- o,
- s,
- a,
- u,
- c,
- h,
- l,
- d,
- f = this;
- return Sd(this, function (p) {
- switch (p.label) {
- case 0:
- if (!this.videoEffectManager.enabled) {
- if (this.isStreamPushing)
- throw (
- (BU('stream is pushing, please stop pushing first'),
- new Error('stream is pushing'))
- );
- if (
- (null === (e = this.streamOutput) || void 0 === e
- ? void 0
- : e.getVideoTracks().length) > 0
- )
- throw (
- (BU('video track is existed'),
- new Error('video track is existed'))
- );
- }
- (i = Df()),
- (o = new UC({
- type: 'device',
- video: !0,
- audio: !1,
- onEvent: function (t) {
- var e, r, n;
- t.type === lp &&
- 'stream ended' ===
- (null === (e = t.data) || void 0 === e
- ? void 0
- : e.message) &&
- (null === (n = (r = f.observer).onWarning) ||
- void 0 === n ||
- n.call(
- r,
- Hf.TXLIVE_WARNING_CAMERA_INTERRUPTED,
- 'interrupted',
- { streamId: i }
- ));
- },
- })),
- (s = this.videoQuality),
- (a = s.frameRate),
- (u = s.width),
- (c = s.height),
- o.setVideoConfig({
- deviceId: t || '',
- frameRate: a,
- resolution: { width: u, height: c },
- }),
- (p.label = 1);
- case 1:
- return p.trys.push([1, 3, , 4]), [4, o.start()];
- case 2:
- return (
- (h = p.sent()),
- (l = qC('video', o)),
- this.initTrackData(l, h),
- this.streamList.push({
- id: i,
- type: 'camera',
- source: o,
- track: l,
- }),
- this.videoEffectManager.enabled
- ? this.startVideoProcess()
- : this.startVideoPlay(),
- [2, i]
- );
- case 3:
- throw (
- ((d = p.sent()),
- null === (n = (r = this.observer).onWarning) ||
- void 0 === n ||
- n.call(
- r,
- Hf.TXLIVE_WARNING_CAMERA_START_FAILED,
- d.toString(),
- null
- ),
- d)
- );
- case 4:
- return [2];
- }
- });
- });
- }),
- (t.prototype.stopCamera = function (t) {
- var e, r, n;
- if (this.videoEffectManager.enabled || !this.isStreamPushing) {
- var i = Lh((e = this.streamList)).call(e, function (e) {
- return 'camera' === e.type && (void 0 === t || e.id === t);
- });
- if (0 !== i.length) {
- var o = function (t, e) {
- var r;
- e instanceof UC && e.stop();
- var n,
- i = Vh((r = s.streamList)).call(r, function (e) {
- return e.id === t;
- });
- -1 !== i && pl((n = s.streamList)).call(n, i, 1);
- s.videoEffectManager.enabled
- ? s.updateVideoProcess()
- : s.stopVideoPlay();
- },
- s = this;
- try {
- for (var a = wd(i), u = a.next(); !u.done; u = a.next()) {
- var c = u.value;
- o(c.id, c.source);
- }
- } catch (t) {
- r = { error: t };
- } finally {
- try {
- u && !u.done && (n = a.return) && n.call(a);
- } finally {
- if (r) throw r.error;
- }
- }
- } else BU('camera stream is not existed');
- } else BU('stream is pushing, please stop pushing first');
- }),
- (t.prototype.startMicrophone = function (t) {
- var e, r, n;
- return Ed(this, void 0, void 0, function () {
- var i,
- o,
- s,
- a,
- u,
- c,
- h,
- l,
- d,
- f,
- p = this;
- return Sd(this, function (v) {
- switch (v.label) {
- case 0:
- if (!this.videoEffectManager.enabled) {
- if (this.isStreamPushing)
- throw (
- (BU('stream is pushing, please stop pushing first'),
- new Error('stream is pushing'))
- );
- if (
- (null === (e = this.streamOutput) || void 0 === e
- ? void 0
- : e.getAudioTracks().length) > 0
- )
- throw (
- (BU('audio track is existed'),
- new Error('audio track is existed'))
- );
- }
- (i = Df()),
- (o = new UC({
- type: 'device',
- video: !1,
- audio: !0,
- onEvent: function (t) {
- var e, r, n;
- t.type === lp &&
- 'stream ended' ===
- (null === (e = t.data) || void 0 === e
- ? void 0
- : e.message) &&
- (null === (n = (r = p.observer).onWarning) ||
- void 0 === n ||
- n.call(
- r,
- Hf.TXLIVE_WARNING_MICROPHONE_INTERRUPTED,
- 'interrupted',
- { streamId: i }
- ));
- },
- })),
- (s = this.audioQuality),
- (a = s.sampleRate),
- (u = s.echoCancellation),
- (c = s.noiseSuppression),
- (h = s.autoGainControl),
- o.setAudioConfig({
- deviceId: t || '',
- sampleRate: a,
- echoCancellation: u,
- noiseSuppression: c,
- autoGainControl: h,
- }),
- (v.label = 1);
- case 1:
- return v.trys.push([1, 3, , 4]), [4, o.start()];
- case 2:
- return (
- (l = v.sent()),
- (d = qC('audio', o)),
- this.initTrackData(d, l),
- this.streamList.push({
- id: i,
- type: 'microphone',
- source: o,
- track: d,
- }),
- this.videoEffectManager.enabled
- ? this.startVideoProcess()
- : this.startVideoPlay(),
- [2, i]
- );
- case 3:
- throw (
- ((f = v.sent()),
- null === (n = (r = this.observer).onWarning) ||
- void 0 === n ||
- n.call(
- r,
- Hf.TXLIVE_WARNING_MICROPHONE_START_FAILED,
- f.toString(),
- null
- ),
- f)
- );
- case 4:
- return [2];
- }
- });
- });
- }),
- (t.prototype.stopMicrophone = function (t) {
- var e, r, n;
- if (this.videoEffectManager.enabled || !this.isStreamPushing) {
- var i = Lh((e = this.streamList)).call(e, function (e) {
- return 'microphone' === e.type && (void 0 === t || e.id === t);
- });
- if (0 !== i.length) {
- var o = function (t, e) {
- var r;
- e instanceof UC && e.stop();
- var n,
- i = Vh((r = s.streamList)).call(r, function (e) {
- return e.id === t;
- });
- -1 !== i && pl((n = s.streamList)).call(n, i, 1);
- s.videoEffectManager.enabled
- ? s.updateVideoProcess()
- : s.stopVideoPlay();
- },
- s = this;
- try {
- for (var a = wd(i), u = a.next(); !u.done; u = a.next()) {
- var c = u.value;
- o(c.id, c.source);
- }
- } catch (t) {
- r = { error: t };
- } finally {
- try {
- u && !u.done && (n = a.return) && n.call(a);
- } finally {
- if (r) throw r.error;
- }
- }
- } else BU('microphone stream is not existed');
- } else BU('stream is pushing, please stop pushing first');
- }),
- (t.prototype.startScreenCapture = function (t) {
- var e, r, n, i;
- return (
- void 0 === t && (t = !1),
- Ed(this, void 0, void 0, function () {
- var o,
- s,
- a,
- u,
- c,
- h,
- l,
- d,
- f,
- p,
- v,
- m,
- y,
- g,
- _ = this;
- return Sd(this, function (b) {
- switch (b.label) {
- case 0:
- if (!this.videoEffectManager.enabled) {
- if (this.isStreamPushing)
- throw (
- (BU('stream is pushing, please stop pushing first'),
- new Error('stream is pushing'))
- );
- if (
- (null === (e = this.streamOutput) || void 0 === e
- ? void 0
- : e.getVideoTracks().length) > 0
- )
- throw (
- (BU('video track is existed'),
- new Error('video track is existed'))
- );
- if (
- t &&
- (null === (r = this.streamOutput) || void 0 === r
- ? void 0
- : r.getAudioTracks().length) > 0
- )
- throw (
- (BU('audio track is existed'),
- new Error('audio track is existed'))
- );
- }
- (o = Df()),
- (s = new UC({
- type: 'screen',
- video: !0,
- audio: t,
- onEvent: function (t) {
- var e, r, n;
- t.type === lp &&
- 'stream ended' ===
- (null === (e = t.data) || void 0 === e
- ? void 0
- : e.message) &&
- (null === (n = (r = _.observer).onWarning) ||
- void 0 === n ||
- n.call(
- r,
- Hf.TXLIVE_WARNING_SCREEN_CAPTURE_INTERRUPTED,
- 'interrupted',
- { streamId: o }
- ));
- },
- })),
- (a = this.videoQuality),
- (u = a.frameRate),
- (c = a.width),
- (h = a.height),
- s.setVideoConfig({
- frameRate: u,
- resolution: { width: c, height: h },
- }),
- t &&
- ((l = this.audioQuality),
- (d = l.sampleRate),
- (f = l.echoCancellation),
- (p = l.noiseSuppression),
- (v = l.autoGainControl),
- s.setAudioConfig({
- sampleRate: d,
- echoCancellation: f,
- noiseSuppression: p,
- autoGainControl: v,
- })),
- (b.label = 1);
- case 1:
- return b.trys.push([1, 3, , 4]), [4, s.start()];
- case 2:
- return (
- (m = b.sent()),
- (y = qC('video', s)),
- this.initTrackData(y, m),
- this.streamList.push({
- id: o,
- type: 'screen',
- source: s,
- track: y,
- }),
- this.videoEffectManager.enabled
- ? this.startVideoProcess()
- : this.startVideoPlay(),
- [2, o]
- );
- case 3:
- throw (
- ((g = b.sent()),
- null === (i = (n = this.observer).onWarning) ||
- void 0 === i ||
- i.call(
- n,
- Hf.TXLIVE_WARNING_SCREEN_CAPTURE_START_FAILED,
- g.toString(),
- null
- ),
- g)
- );
- case 4:
- return [2];
- }
- });
- })
- );
- }),
- (t.prototype.stopScreenCapture = function (t) {
- var e, r, n;
- if (this.videoEffectManager.enabled || !this.isStreamPushing) {
- var i = Lh((e = this.streamList)).call(e, function (e) {
- return 'screen' === e.type && (void 0 === t || e.id === t);
- });
- if (0 !== i.length) {
- var o = function (t, e) {
- var r;
- e instanceof UC && e.stop();
- var n,
- i = Vh((r = s.streamList)).call(r, function (e) {
- return e.id === t;
- });
- -1 !== i && pl((n = s.streamList)).call(n, i, 1);
- s.videoEffectManager.enabled
- ? s.updateVideoProcess()
- : s.stopVideoPlay();
- },
- s = this;
- try {
- for (var a = wd(i), u = a.next(); !u.done; u = a.next()) {
- var c = u.value;
- o(c.id, c.source);
- }
- } catch (t) {
- r = { error: t };
- } finally {
- try {
- u && !u.done && (n = a.return) && n.call(a);
- } finally {
- if (r) throw r.error;
- }
- }
- } else BU('screen stream is not existed');
- } else BU('stream is pushing, please stop pushing first');
- }),
- (t.prototype.startVirtualCamera = function (t) {
- var e, r, n, i;
- return Ed(this, void 0, void 0, function () {
- var o, s, a, u, c, h, l, d, f, p;
- return Sd(this, function (v) {
- switch (v.label) {
- case 0:
- if (!(t && t instanceof File))
- throw (BU('file is invalid'), new Error('file is invalid'));
- if (
- ((o = (function (t) {
- var e = '';
- switch (t.type) {
- case 'video/mp4':
- e = 'video';
- break;
- case 'audio/mpeg':
- e = 'audio';
- break;
- case 'image/jpeg':
- case 'image/png':
- case 'image/bmp':
- e = 'image';
- break;
- default:
- e = '';
- }
- return e;
- })(t)),
- !o)
- )
- throw (
- (BU('file type is invalid'),
- new Error('file type is invalid'))
- );
- if (!this.videoEffectManager.enabled) {
- if (this.isStreamPushing)
- throw (
- (BU('stream is pushing, please stop pushing first'),
- new Error('stream is pushing'))
- );
- if (
- ('video' === o || 'image' === o) &&
- (null === (e = this.streamOutput) || void 0 === e
- ? void 0
- : e.getVideoTracks().length) > 0
- )
- throw (
- (BU('video track is existed'),
- new Error('video track is existed'))
- );
- if (
- ('video' === o || 'audio' === o) &&
- (null === (r = this.streamOutput) || void 0 === r
- ? void 0
- : r.getAudioTracks().length) > 0
- )
- throw (
- (BU('audio track is existed'),
- new Error('audio track is existed'))
- );
- }
- (s = Df()),
- (a = new UC({
- type: 'file',
- video: 'audio' !== o,
- audio: 'image' !== o,
- fileSource: t,
- })),
- (u = this.videoQuality),
- (c = u.frameRate),
- (h = u.width),
- (l = u.height),
- a.setVideoConfig({
- frameRate: c,
- resolution: { width: h, height: l },
- }),
- (v.label = 1);
- case 1:
- return v.trys.push([1, 3, , 4]), [4, a.start()];
- case 2:
- return (
- (d = v.sent()),
- (f = qC('audio' !== o ? 'video' : 'audio', a)),
- this.initTrackData(f, d),
- this.streamList.push({
- id: s,
- type: 'file',
- source: a,
- track: f,
- }),
- this.videoEffectManager.enabled
- ? this.startVideoProcess()
- : this.startVideoPlay(),
- [2, s]
- );
- case 3:
- throw (
- ((p = v.sent()),
- null === (i = (n = this.observer).onWarning) ||
- void 0 === i ||
- i.call(
- n,
- Hf.TXLIVE_WARNING_VIRTUAL_CAMERA_START_FAILED,
- p.toString(),
- null
- ),
- p)
- );
- case 4:
- return [2];
- }
- });
- });
- }),
- (t.prototype.stopVirtualCamera = function (t) {
- var e, r, n;
- if (this.videoEffectManager.enabled || !this.isStreamPushing) {
- var i = Lh((e = this.streamList)).call(e, function (e) {
- return 'file' === e.type && (void 0 === t || e.id === t);
- });
- if (0 !== i.length) {
- var o = function (t, e) {
- var r;
- e instanceof UC && e.stop();
- var n,
- i = Vh((r = s.streamList)).call(r, function (e) {
- return e.id === t;
- });
- -1 !== i && pl((n = s.streamList)).call(n, i, 1);
- s.videoEffectManager.enabled
- ? s.updateVideoProcess()
- : s.stopVideoPlay();
- },
- s = this;
- try {
- for (var a = wd(i), u = a.next(); !u.done; u = a.next()) {
- var c = u.value;
- o(c.id, c.source);
- }
- } catch (t) {
- r = { error: t };
- } finally {
- try {
- u && !u.done && (n = a.return) && n.call(a);
- } finally {
- if (r) throw r.error;
- }
- }
- } else BU('file stream is not existed');
- } else BU('stream is pushing, please stop pushing first');
- }),
- (t.prototype.startMediaFile = function (t) {
- return this.startVirtualCamera(t);
- }),
- (t.prototype.stopMediaFile = function (t) {
- return this.stopVirtualCamera(t);
- }),
- (t.prototype.startCustomCapture = function (t) {
- var e, r;
- return Ed(this, void 0, void 0, function () {
- var n, i, o, s;
- return Sd(this, function (a) {
- if (!(t && t instanceof MediaStream))
- throw (BU('stream is invalid'), new Error('stream is invalid'));
- if (
- ((n = t.getVideoTracks().length),
- (i = t.getAudioTracks().length),
- 0 === n && 0 === i)
- )
- throw (BU('stream is empty'), new Error('stream is empty'));
- if (n > 1 || i > 1)
- throw (
- (BU(
- 'the number of '.concat(
- n > 1 ? 'video' : 'audio',
- ' tracks is greater than 1'
- )
- ),
- new Error(
- 'the number of '.concat(
- n > 1 ? 'video' : 'audio',
- ' tracks is greater than 1'
- )
- ))
- );
- if (!this.videoEffectManager.enabled) {
- if (this.isStreamPushing)
- throw (
- (BU('stream is pushing, please stop pushing first'),
- new Error('stream is pushing'))
- );
- if (
- n > 0 &&
- (null === (e = this.streamOutput) || void 0 === e
- ? void 0
- : e.getVideoTracks().length) > 0
- )
- throw (
- (BU('video track is existed'),
- new Error('video track is existed'))
- );
- if (
- i > 0 &&
- (null === (r = this.streamOutput) || void 0 === r
- ? void 0
- : r.getAudioTracks().length) > 0
- )
- throw (
- (BU('audio track is existed'),
- new Error('audio track is existed'))
- );
- }
- return (
- (o = Df()),
- (s = qC(n > 0 ? 'video' : 'audio', t)),
- this.initTrackData(s, t),
- this.streamList.push({
- id: o,
- type: 'custom',
- source: t,
- track: s,
- }),
- this.videoEffectManager.enabled
- ? this.startVideoProcess()
- : this.startVideoPlay(),
- [2, o]
- );
- });
- });
- }),
- (t.prototype.stopCustomCapture = function (t) {
- var e, r, n;
- if (this.videoEffectManager.enabled || !this.isStreamPushing) {
- var i = Lh((e = this.streamList)).call(e, function (e) {
- return 'custom' === e.type && (void 0 === t || e.id === t);
- });
- if (0 !== i.length) {
- var o = function (t, e) {
- var r,
- n,
- i = Vh((r = s.streamList)).call(r, function (e) {
- return e.id === t;
- });
- -1 !== i && pl((n = s.streamList)).call(n, i, 1);
- s.videoEffectManager.enabled
- ? s.updateVideoProcess()
- : s.stopVideoPlay(e);
- },
- s = this;
- try {
- for (var a = wd(i), u = a.next(); !u.done; u = a.next()) {
- var c = u.value;
- o(c.id, c.source);
- }
- } catch (t) {
- r = { error: t };
- } finally {
- try {
- u && !u.done && (n = a.return) && n.call(a);
- } finally {
- if (r) throw r.error;
- }
- }
- } else BU('custom stream is not existed');
- } else BU('stream is pushing, please stop pushing first');
- }),
- (t.prototype.startPush = function (t) {
- var e, r;
- return Ed(this, void 0, void 0, function () {
- var n,
- i,
- o,
- s,
- a,
- u,
- c,
- h = this;
- return Sd(this, function (l) {
- switch (l.label) {
- case 0:
- if (!t)
- throw (
- (BU('push url is not existed'),
- new Error('push url is not existed'))
- );
- if (this.isStreamPushing)
- throw (
- (BU('stream is pushing, please stop pushing first'),
- new Error('stream is pushing'))
- );
- if (!this.streamOutput)
- throw (
- (BU('no stream for pushing'),
- new Error('no stream for pushing'))
- );
- this.connection ||
- (this.connection = new cP({
- onStatusUpdate: this.onConnectionStatusUpdate,
- onStatisticsUpdate: function (t) {
- var e, r;
- null === (r = (e = h.observer).onStatisticsUpdate) ||
- void 0 === r ||
- r.call(e, t);
- },
- })),
- this.connection.setUrl(t),
- this.connection.setStreamSource(this.streamOutput),
- this.connection.setVideoBitrate(this.videoQuality.bitrate),
- this.connection.setAudioBitrate(this.audioQuality.bitrate),
- (n = this.advancedSettings),
- (i = n.metadata),
- (o = n.signalingServer),
- (s = o ? { domainName: o } : {}),
- (a = i || {
- videodatarate: this.videoQuality.bitrate,
- audiodatarate: this.audioQuality.bitrate,
- }),
- this.connection.setSignalingConfig(
- xd(xd({}, s), { extraParams: { metadata: a } })
- ),
- (l.label = 1);
- case 1:
- return l.trys.push([1, 3, , 4]), [4, this.connection.start()];
- case 2:
- return l.sent(), [3, 4];
- case 3:
- throw (
- ((u = l.sent()),
- (c =
- 'RequestError' === u.name
- ? Hf.TXLIVE_ERROR_REQUEST_FAILED
- : Hf.TXLIVE_ERROR_WEBRTC_FAILED),
- null === (r = (e = this.observer).onError) ||
- void 0 === r ||
- r.call(e, c, u.toString(), null),
- u)
- );
- case 4:
- return [2];
- }
- });
- });
- }),
- (t.prototype.stopPush = function () {
- var t;
- this.isStreamPushing
- ? (this.connectRetry.timeoutId &&
- (window.clearTimeout(this.connectRetry.timeoutId),
- (this.connectRetry.timeoutId = null),
- (this.connectRetry.curCount = 0)),
- null === (t = this.connection) || void 0 === t || t.stop())
- : BU('no stream is pushing');
- }),
- (t.prototype.isPushing = function () {
- return !(!this.streamOutput || !this.isStreamPushing);
- }),
- (t.prototype.getRenderView = function () {
- return this.videoView;
- }),
- (t.prototype.getMediaStream = function (t) {
- var e;
- if (!t) return BU('streamId is not existed'), null;
- var r = El((e = this.streamList)).call(e, function (e) {
- return e.id === t;
- });
- return r
- ? r.source instanceof UC
- ? r.source.getMediaStream()
- : r.source
- : (BU('stream is not existed'), null);
- }),
- (t.prototype.getDeviceManager = function () {
- return this.deviceManager;
- }),
- (t.prototype.getVideoEffectManager = function () {
- return this.videoEffectManager;
- }),
- (t.prototype.getAudioEffectManager = function () {
- return this.audioEffectManager;
- }),
- (t.prototype.setVideoMute = function (t) {
- var e, r;
- null === (r = this.streamOutput) ||
- void 0 === r ||
- Ph((e = r.getVideoTracks())).call(e, function (e) {
- e.enabled = !t;
- }),
- this.canvasView &&
- (t
- ? (this.canvasView.style.filter = 'brightness(0%)')
- : this.canvasView.style.removeProperty('filter'));
- }),
- (t.prototype.setAudioMute = function (t) {
- var e, r;
- null === (r = this.streamOutput) ||
- void 0 === r ||
- Ph((e = r.getAudioTracks())).call(e, function (e) {
- e.enabled = !t;
- });
- }),
- (t.prototype.pauseVideo = function () {
- this.setVideoMute(!0);
- }),
- (t.prototype.pauseAudio = function () {
- this.setAudioMute(!0);
- }),
- (t.prototype.resumeVideo = function () {
- this.setVideoMute(!1);
- }),
- (t.prototype.resumeAudio = function () {
- this.setAudioMute(!1);
- }),
- (t.prototype.setVideoContentHint = function (t) {
- var e, r;
- null === (r = this.streamOutput) ||
- void 0 === r ||
- Ph((e = r.getVideoTracks())).call(e, function (e) {
- e.contentHint = t;
- });
- }),
- (t.prototype.setObserver = function (t) {
- var e,
- r = this,
- n = Rl(this.observer);
- Ph((e = Rl(t))).call(e, function (e) {
- var i = t[e];
- Jl(n).call(n, e) && 'function' == typeof i && (r.observer[e] = i);
- });
- }),
- (t.prototype.destroy = function () {
- var t, e;
- (null === document ||
- void 0 === document ||
- document.removeEventListener(
- 'visibilitychange',
- this.onVisibilityChange
- ),
- this.connectRetry.timeoutId &&
- (window.clearTimeout(this.connectRetry.timeoutId),
- (this.connectRetry.timeoutId = null)),
- this.connection && (this.connection.stop(), (this.connection = null)),
- this.effectProcess &&
- (this.effectProcess.stop(), (this.effectProcess = null)),
- this.streamList) &&
- (Ph((t = this.streamList)).call(t, function (t) {
- t.source instanceof UC && t.source.stop();
- }),
- (this.streamList = null));
- this.streamOutput &&
- (Ph((e = this.streamOutput.getTracks())).call(e, function (t) {
- 'ended' !== t.readyState && t.stop();
- }),
- (this.streamOutput = null));
- this.videoView &&
- (this.videoView.pause(),
- (this.videoView.srcObject = null),
- this.videoView.load(),
- this.videoView.remove(),
- (this.videoView = null)),
- this.canvasView &&
- (this.canvasView.remove(), (this.canvasView = null)),
- (this.observer = null),
- (this.deviceManager = null),
- (this.videoEffectManager = null),
- (this.audioEffectManager = null);
- }),
- (t.prototype.onConnectionStatusUpdate = function (t) {
- var e,
- r,
- n,
- i,
- o,
- s,
- a,
- u = this;
- t.type === ep
- ? ((this.isStreamPushing = !0),
- (this.connectRetry.curCount = 0),
- null === (r = (e = this.observer).onPushStatusUpdate) ||
- void 0 === r ||
- r.call(e, Wf.TXLIVE_PUSH_STATUS_CONNECTED, 'connected', null))
- : t.type === $f
- ? ((this.isStreamPushing = !1),
- 'connection disconnected' ===
- (null === (n = t.data) || void 0 === n ? void 0 : n.message)
- ? (this.connection.stop(),
- this.connectRetry.timeoutId &&
- (window.clearTimeout(this.connectRetry.timeoutId),
- (this.connectRetry.timeoutId = null)),
- (this.connectRetry.timeoutId = cd(function () {
- var t, e, r, n;
- u.connectRetry.curCount += 1;
- var i,
- o = u.connectRetry,
- s = o.curCount,
- a = o.maxCount;
- s <= a
- ? (BU(
- mh(
- (i = 'current retry count: '.concat(
- s,
- ', max retry count: '
- ))
- ).call(i, a)
- ),
- null === (e = (t = u.observer).onPushStatusUpdate) ||
- void 0 === e ||
- e.call(
- t,
- Wf.TXLIVE_PUSH_STATUS_RECONNECTING,
- 'reconnecting',
- null
- ),
- u.connection.start().catch(function (t) {
- var e, r;
- BU('reconnect error, '.concat(t.toString())),
- 'RequestError' === t.name &&
- (null === (r = (e = u.observer).onError) ||
- void 0 === r ||
- r.call(
- e,
- Hf.TXLIVE_ERROR_REQUEST_FAILED,
- t.toString(),
- null
- ));
- }))
- : (null === (n = (r = u.observer).onPushStatusUpdate) ||
- void 0 === n ||
- n.call(
- r,
- Wf.TXLIVE_PUSH_STATUS_DISCONNECTED,
- 'disconnected',
- null
- ),
- (u.connectRetry.curCount = 0),
- u.stopVideoProcess());
- u.connectRetry.timeoutId = null;
- }, 1e3 * this.connectRetry.delay)))
- : (null === (o = (i = this.observer).onPushStatusUpdate) ||
- void 0 === o ||
- o.call(
- i,
- Wf.TXLIVE_PUSH_STATUS_DISCONNECTED,
- 'disconnected',
- null
- ),
- this.stopVideoProcess()))
- : t.type === tp &&
- (null === (a = (s = this.observer).onPushStatusUpdate) ||
- void 0 === a ||
- a.call(
- s,
- Wf.TXLIVE_PUSH_STATUS_CONNECTING,
- 'connecting',
- null
- ));
- }),
- (t.prototype.initTrackData = function (t, e) {
- if (e.getVideoTracks().length > 0) {
- var r,
- n = Lh((r = this.streamList)).call(r, function (t) {
- var e,
- r = t.source,
- n = r instanceof UC ? r.getMediaStream() : r;
- return null === (e = null == n ? void 0 : n.getVideoTracks()) ||
- void 0 === e
- ? void 0
- : e.length;
- });
- t.setOrder(n.length);
- }
- e.getAudioTracks().length > 0 && t.setVolume(100);
- }),
- (t.prototype.setProcessData = function () {
- var t,
- e,
- r,
- n,
- i,
- o,
- s = null;
- this.videoEffectManager.enabled
- ? (s = vd(
- (e = mh(
- (r = vd((n = this.streamList)).call(n, function (t) {
- return t.track;
- }))
- ).call(r, this.effectTrackList))
- ).call(e, function (t) {
- return t.data;
- }))
- : (s = vd(
- (i = Lh((o = this.streamList)).call(o, function (t) {
- var e,
- r = t.source,
- n = r instanceof UC ? r.getMediaStream() : r;
- return null ===
- (e = null == n ? void 0 : n.getAudioTracks()) ||
- void 0 === e
- ? void 0
- : e.length;
- }))
- ).call(i, function (t) {
- return t.track.data;
- }));
- null === (t = this.effectProcess) || void 0 === t || t.setData(s);
- }),
- (t.prototype.startVideoPlay = function () {
- var t, e, r, n, i;
- return Ed(this, void 0, void 0, function () {
- var o, s, a, u, c, h, l, d;
- return Sd(this, function (f) {
- switch (f.label) {
- case 0:
- return (
- this.streamOutput ||
- (this.streamOutput = new MediaStream()),
- this.effectProcess || (this.effectProcess = new kU()),
- (o = this.streamList[this.streamList.length - 1]),
- (s = o.source),
- (a = s instanceof UC ? s.getMediaStream() : s),
- (u = null),
- a.getAudioTracks().length > 0
- ? (this.setProcessData(),
- this.effectProcess.isStart()
- ? [3, 2]
- : (this.effectProcess.setResolution({
- width: 0,
- height: 0,
- }),
- [4, this.effectProcess.start()]))
- : [3, 3]
- );
- case 1:
- f.sent(), (f.label = 2);
- case 2:
- (u = this.effectProcess.getOutput()), (f.label = 3);
- case 3:
- if (
- ((c = a.getVideoTracks()),
- 0 === this.streamOutput.getVideoTracks().length &&
- c.length > 0 &&
- (this.streamOutput.addTrack(c[0]),
- null ===
- (e = (t = this.observer).onCaptureFirstVideoFrame) ||
- void 0 === e ||
- e.call(t)),
- (h = null == u ? void 0 : u.getAudioTracks()),
- 0 === this.streamOutput.getAudioTracks().length &&
- (null == h ? void 0 : h.length) > 0 &&
- (this.streamOutput.addTrack(h[0]),
- null ===
- (n = (r = this.observer).onCaptureFirstAudioFrame) ||
- void 0 === n ||
- n.call(r)),
- !this.videoView)
- )
- return [2];
- var p;
- if (!this.canvasView)
- if ((l = $x && s instanceof UC ? s.getRenderView() : null))
- l.setAttribute('style', Zf),
- (this.canvasView = l),
- this.videoView.setAttribute(
- 'style',
- mh((p = ''.concat(Zf))).call(p, vy)
- ),
- null === (i = this.videoView.parentElement) ||
- void 0 === i ||
- i.insertBefore(l, this.videoView);
- if (this.videoView.srcObject) return [2];
- if (
- ((this.videoView.srcObject = this.streamOutput),
- this.videoView.load(),
- !this.videoView.autoplay)
- )
- return [2];
- f.label = 4;
- case 4:
- return f.trys.push([4, 6, , 7]), [4, this.videoView.play()];
- case 5:
- return f.sent(), BU('play ok'), [3, 7];
- case 6:
- return (d = f.sent()), BU('play failed', d), [3, 7];
- case 7:
- return [2];
- }
- });
- });
- }),
- (t.prototype.stopVideoPlay = function (t) {
- var e,
- r,
- n = this;
- if (this.streamOutput) {
- var i,
- o =
- null === (e = this.effectProcess) || void 0 === e
- ? void 0
- : e.getOutput();
- if (
- null === (r = null == o ? void 0 : o.getAudioTracks()) ||
- void 0 === r
- ? void 0
- : r.length
- )
- Td((i = this.streamList)).call(i, function (t) {
- var e = t.source;
- return e instanceof UC
- ? !!e.getAudioTrack()
- : e.getAudioTracks().length > 0;
- }) ||
- (this.streamOutput.removeTrack(o.getAudioTracks()[0]),
- this.effectProcess.stop());
- var s,
- a = this.streamOutput.getTracks();
- if (
- (Ph(a).call(a, function (t) {
- 'ended' === t.readyState && n.streamOutput.removeTrack(t);
- }),
- t && t instanceof MediaStream)
- )
- Ph((s = t.getTracks())).call(s, function (t) {
- n.streamOutput.removeTrack(t);
- });
- this.canvasView &&
- 0 === this.streamOutput.getVideoTracks().length &&
- (this.canvasView.remove(),
- (this.canvasView = null),
- this.videoView.setAttribute('style', Zf)),
- this.streamOutput.getTracks().length > 0 ||
- ((this.streamOutput = null),
- this.videoView &&
- (this.videoView.pause(),
- (this.videoView.srcObject = null),
- this.videoView.load()));
- }
- }),
- (t.prototype.startVideoProcess = function () {
- var t, e, r, n, i, o, s;
- return Ed(this, void 0, void 0, function () {
- var a, u, c, h, l, d, f, p, v, m, y, g, _, b, T, x, E, S, w;
- return Sd(this, function (R) {
- switch (R.label) {
- case 0:
- var C;
- if (
- (this.streamOutput ||
- (this.streamOutput = new MediaStream()),
- this.effectProcess || (this.effectProcess = new kU()),
- (a = this.videoEffectManager.getMixingConfig()),
- (u = a.videoWidth),
- (c = a.videoHeight),
- (h = a.videoFramerate),
- (l = a.backgroundColor),
- (d = this.streamList[this.streamList.length - 1]),
- (f = d.source),
- (p = f instanceof UC ? f.getMediaStream() : f),
- null === (t = null == p ? void 0 : p.getVideoTracks()) ||
- void 0 === t
- ? void 0
- : t.length)
- )
- (v =
- null !==
- (e =
- f instanceof UC
- ? f.getResolution()
- : p.getVideoTracks()[0].getSettings()) &&
- void 0 !== e
- ? e
- : {}),
- (m = Lh((C = this.streamList)).call(C, function (t) {
- var e,
- r = t.source,
- n = r instanceof UC ? r.getMediaStream() : r;
- return null ===
- (e = null == n ? void 0 : n.getVideoTracks()) ||
- void 0 === e
- ? void 0
- : e.length;
- })),
- 1 === m.length
- ? d.track.setLayout({
- width: u,
- height: c,
- x: u / 2,
- y: c / 2,
- })
- : ((y = v.width),
- (g = v.height),
- (_ = null != y ? y : u),
- (b = null != g ? g : c),
- d.track.setLayout({
- width: _ / 2,
- height: b / 2,
- x: _ / 4,
- y: b / 4,
- }));
- return (
- this.setProcessData(),
- this.effectProcess.isStart()
- ? [3, 2]
- : (this.effectProcess.setResolution({
- width: u,
- height: c,
- }),
- this.effectProcess.setFrameRate(h),
- this.effectProcess.setBackgroundColor(l),
- [4, this.effectProcess.start()])
- );
- case 1:
- R.sent(), (R.label = 2);
- case 2:
- if (
- ((T = this.effectProcess.getOutput()),
- (x = T.getVideoTracks()),
- 0 === this.streamOutput.getVideoTracks().length &&
- x.length > 0 &&
- (this.streamOutput.addTrack(x[0]),
- null ===
- (n = (r = this.observer).onCaptureFirstVideoFrame) ||
- void 0 === n ||
- n.call(r)),
- (E = T.getAudioTracks()),
- 0 === this.streamOutput.getAudioTracks().length &&
- E.length > 0 &&
- (this.streamOutput.addTrack(E[0]),
- null ===
- (o = (i = this.observer).onCaptureFirstAudioFrame) ||
- void 0 === o ||
- o.call(i)),
- !this.videoView)
- )
- return [2];
- var P;
- if (!this.canvasView)
- if ((S = $x ? this.effectProcess.getRenderView() : null))
- S.setAttribute('style', Zf),
- (this.canvasView = S),
- this.videoView.setAttribute(
- 'style',
- mh((P = ''.concat(Zf))).call(P, vy)
- ),
- null === (s = this.videoView.parentElement) ||
- void 0 === s ||
- s.insertBefore(S, this.videoView);
- if (this.videoView.srcObject) return [2];
- if (
- ((this.videoView.srcObject = this.streamOutput),
- this.videoView.load(),
- !this.videoView.autoplay)
- )
- return [2];
- R.label = 3;
- case 3:
- return R.trys.push([3, 5, , 6]), [4, this.videoView.play()];
- case 4:
- return R.sent(), BU('play ok'), [3, 6];
- case 5:
- return (w = R.sent()), BU('play failed', w), [3, 6];
- case 6:
- return [2];
- }
- });
- });
- }),
- (t.prototype.updateVideoProcess = function () {
- 0 !== this.streamList.length || this.isStreamPushing
- ? this.setProcessData()
- : this.stopVideoProcess();
- }),
- (t.prototype.stopVideoProcess = function () {
- var t,
- e = this;
- if (
- this.videoEffectManager.enabled &&
- this.streamOutput &&
- 0 === this.streamList.length
- ) {
- var r,
- n =
- null === (t = this.effectProcess) || void 0 === t
- ? void 0
- : t.getOutput();
- if (n)
- Ph((r = n.getTracks())).call(r, function (t) {
- e.streamOutput.removeTrack(t);
- }),
- this.effectProcess.stop();
- (this.streamOutput = null),
- this.canvasView &&
- (this.canvasView.remove(),
- (this.canvasView = null),
- this.videoView.setAttribute('style', Zf)),
- this.videoView &&
- (this.videoView.pause(),
- (this.videoView.srcObject = null),
- this.videoView.load());
- }
- }),
- (t.prototype.getCommonData = function () {
- return {
- streamList: this.streamList,
- videoEffectManager: this.videoEffectManager,
- observer: this.observer,
- videoQuality: this.videoQuality,
- audioQuality: this.audioQuality,
- streamOutput: this.streamOutput,
- isStreamPushing: this.isStreamPushing,
- connection: this.connection,
- setProcessData: this.setProcessData,
- effectTrackList: this.effectTrackList,
- effectProcess: this.effectProcess,
- };
- }),
- (t.prototype.onVisibilityChange = function () {
- 'visible' === document.visibilityState &&
- window.TXLiveAudioContext &&
- my(window.TXLiveAudioContext);
- }),
- (t.version = zf),
- t
- );
- })();
- return GU.init(), GU;
- });
|